Commit 1e1a909d by YG8999

保洁分配

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