Commit dfb678c4 by wuwenlong

Merge remote-tracking branch 'origin/main'

parents caa5e5c9 1e1a909d
......@@ -8,6 +8,7 @@ import share.common.core.controller.BaseController;
import share.common.core.domain.AjaxResult;
import share.common.core.page.TableDataInfo;
import share.common.enums.BusinessType;
import share.common.utils.BaseUtil;
import share.common.utils.poi.ExcelUtil;
import share.system.domain.SConsumer;
import share.system.service.SConsumerService;
......@@ -74,6 +75,9 @@ public class SCleanConsumerController extends BaseController
public AjaxResult add(@RequestBody SConsumer sConsumer)
{
sConsumer.setRoleType("1");
sConsumer.setAccount(sConsumer.getPhone());
String password = BaseUtil.encryptPassword("12345678", sConsumer.getPhone());
sConsumer.setPwd(password);
return toAjax(sConsumerService.insertSConsumer(sConsumer));
}
......
......@@ -24,6 +24,7 @@ import share.system.domain.SConsumer;
import share.system.domain.SStore;
import share.system.domain.SStoreConsumer;
import share.system.domain.SysUserRole;
import share.system.domain.vo.SConsumerVo;
import share.system.service.ISStoreService;
import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo;
......@@ -128,7 +129,7 @@ public class SStoreController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('system:store:list')")
@GetMapping("/consumer/allocatedList")
public TableDataInfo allocatedList(SConsumer sConsumer)
public TableDataInfo allocatedList(SConsumerVo sConsumer)
{
startPage();
List<SConsumer> list = sConsumerService.selectAllocatedList(sConsumer);
......@@ -140,7 +141,7 @@ public class SStoreController extends BaseController
*/
@PreAuthorize("@ss.hasPermi('system:store:list')")
@GetMapping("/consumer/unallocatedList")
public TableDataInfo unallocatedList(SConsumer sConsumer)
public TableDataInfo unallocatedList(SConsumerVo sConsumer)
{
startPage();
List<SConsumer> list = sConsumerService.selectUnallocatedList(sConsumer);
......
package share.system.domain;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import share.common.core.domain.BaseEntity;
......@@ -15,11 +18,12 @@ import share.common.core.domain.BaseEntity;
* @date 2023-09-27
*/
@Data
public class SConsumer
public class SConsumer extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 会员用户ID */
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty(value = "用户账号")
......
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.SConsumer;
/**
* @className: share.system.domain.vo.SConsumerVo
* @description: 会员
* @author: lwj
* @create: 2023-10-20 15:06
*/
@Data
public class SConsumerVo extends SConsumer {
private Long storeId;
}
......@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import share.system.domain.SConsumer;
import share.system.domain.vo.SConsumerVo;
/**
* 会员用户Mapper接口
......@@ -61,9 +62,9 @@ public interface SConsumerMapper extends BaseMapper<SConsumer>
*/
public int deleteSConsumerByIds(Long[] ids);
List<SConsumer> selectAllocatedList(SConsumer sConsumer);
List<SConsumer> selectAllocatedList(SConsumerVo sConsumer);
List<SConsumer> selectUnallocatedList(SConsumer sConsumer);
List<SConsumer> selectUnallocatedList(SConsumerVo sConsumer);
List<SConsumer> selectListByStoreId(Long storeId);
}
......@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.SConsumer;
import share.system.domain.vo.SConsumerVo;
import share.system.request.RegisterThirdSConsumerRequest;
/**
......@@ -14,7 +15,7 @@ import share.system.request.RegisterThirdSConsumerRequest;
*/
public interface SConsumerService extends IService<SConsumer>
{
List<SConsumer> selectAllocatedList(SConsumer sConsumer);
List<SConsumer> selectAllocatedList(SConsumerVo sConsumer);
/**
* 查询会员用户
......@@ -110,5 +111,6 @@ public interface SConsumerService extends IService<SConsumer>
* @return
*/
boolean editSConsumer(SConsumer request);
List<SConsumer> selectUnallocatedList(SConsumer sConsumer);
List<SConsumer> selectUnallocatedList(SConsumerVo sConsumer);
}
......@@ -16,6 +16,7 @@ import share.common.exception.base.BaseException;
import share.common.utils.BaseUtil;
import share.common.utils.DateUtil;
import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SConsumerVo;
import share.system.mapper.SConsumerMapper;
import share.system.domain.SConsumer;
import share.system.request.RegisterThirdSConsumerRequest;
......@@ -189,7 +190,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
* @return
*/
@Override
public List<SConsumer> selectAllocatedList(SConsumer sConsumer) {
public List<SConsumer> selectAllocatedList(SConsumerVo sConsumer) {
return sConsumerMapper.selectAllocatedList(sConsumer);
}
......@@ -197,7 +198,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
* 查询未分配保洁列表
*/
@Override
public List<SConsumer> selectUnallocatedList(SConsumer sConsumer) {
public List<SConsumer> selectUnallocatedList(SConsumerVo sConsumer) {
return sConsumerMapper.selectUnallocatedList(sConsumer);
}
}
......@@ -49,9 +49,9 @@
</where>
</select>
<select id="selectAllocatedList" parameterType="SConsumer" resultMap="SConsumerResult">
select t1.id, t1.open_id, t1.nick_name, t1.phone, t1.level, t1.role_type, t1.sex, t1.amount,
t1.free_amount, t1.total_times, t1.duration
<select id="selectAllocatedList" parameterType="SConsumerVo" resultMap="SConsumerResult">
select t1.id, t1.account, t1.nick_name, t1.avatar, t1.phone, t1.level, t1.role_type, t1.sex, t1.addres, t1.amount,
t1.free_amount, t1.total_times, t1.duration, t1.status, t1.pwd, t1.create_time, t1.last_login_time
from s_consumer t1
left join s_store_consumer t2 on t2.consumer_id = t1.id
where t1.role_type = '1' and t2.store_id = #{storeId}
......@@ -62,9 +62,9 @@
AND t1.phone like concat('%', #{phone}, '%')
</if>
</select>
<select id="selectUnallocatedList" parameterType="SConsumer" resultMap="SConsumerResult">
select t1.id, t1.open_id, t1.nick_name, t1.phone, t1.level, t1.role_type, t1.sex, t1.amount,
t1.free_amount, t1.total_times, t1.duration
<select id="selectUnallocatedList" parameterType="SConsumerVo" resultMap="SConsumerResult">
select t1.id, t1.account, t1.nick_name, t1.avatar, t1.phone, t1.level, t1.role_type, t1.sex, t1.addres, t1.amount,
t1.free_amount, t1.total_times, t1.duration, t1.status, t1.pwd, t1.create_time, t1.last_login_time
from s_consumer t1
left join s_store_consumer t2 on t2.consumer_id = t1.id
where t1.role_type = '1' and t1.id not in (select consumer_id from s_store_consumer where store_id = #{storeId})
......@@ -77,8 +77,8 @@
</select>
<select id="selectListByStoreId" parameterType="Long" resultMap="SConsumerResult">
select t1.id, t1.open_id, t1.nick_name, t1.phone, t1.level, t1.role_type, t1.sex, t1.amount,
t1.free_amount, t1.total_times, t1.duration
select t1.id, t1.account, t1.nick_name, t1.avatar, t1.phone, t1.level, t1.role_type, t1.sex, t1.addres, t1.amount,
t1.free_amount, t1.total_times, t1.duration, t1.status, t1.pwd, t1.create_time, t1.last_login_time
from s_consumer t1
left join s_store_consumer t2 on t2.consumer_id = t1.id
where t1.role_type = '1' and t1.id in (select consumer_id from s_store_consumer where store_id = #{storeId})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment