Commit bd84aef0 by 吕明尚

代码提交

parent 4eb6a013
......@@ -31,7 +31,7 @@ public class SCleanConsumerController extends BaseController
private SConsumerService sConsumerService;
/**
* 查询保洁员用户列表
* 查询员用户列表
*/
@PreAuthorize("@ss.hasPermi('system:cleanConsumer:list')")
@GetMapping("/list")
......@@ -68,7 +68,7 @@ public class SCleanConsumerController extends BaseController
}
/**
* 新增保洁员用户
* 新增员用户
*/
@PreAuthorize("@ss.hasPermi('system:cleanConsumer:add')")
@Log(title = "保洁员", businessType = BusinessType.INSERT)
......
package share.common.enums;
//职位枚举
public enum PositionEnum {
//1保洁人员 2管理员
CLEANER(1, "保洁人员"),
ADMIN(2, "管理员"),
;
private Integer code;
private String name;
PositionEnum() {
}
PositionEnum(Integer code, String name) {
this.code = code;
this.name = name;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
......@@ -2,8 +2,8 @@ package share.common.enums;
public enum RoleTypeEnum {
MEMBRO(0, "会员"),
CLEANER(1, "保洁人员"),
ADMIN(2, "后台管理人员");;
CLEANER(1, "员"),
;
private Integer code;
private String name;
......
......@@ -53,7 +53,7 @@ public class SConsumer implements Serializable
private Integer level;
/** 会员角色类型(0:会员,1:保洁人员,2:后台管理人员) */
@ApiModelProperty(value = "会员角色类型", example = "0=:会员,1:保洁人员,2:后台管理人员")
@ApiModelProperty(value = "会员角色类型", example = "0=:会员,1:员")
private Integer roleType;
/** 会员性别(0:未知,1:男,2:女) */
......
package share.system.domain;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
......@@ -9,6 +10,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author: lwj
* @create: 2023-10-16 17:02
*/
@Data
public class SStoreConsumer {
/** 门店ID */
private Long storeId;
......@@ -16,27 +18,6 @@ public class SStoreConsumer {
/** 保洁员ID */
private Long consumerId;
public Long getStoreId() {
return storeId;
}
private Integer position;
public void setStoreId(Long storeId) {
this.storeId = storeId;
}
public Long getConsumerId() {
return consumerId;
}
public void setConsumerId(Long consumerId) {
this.consumerId = consumerId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("storeId", getStoreId())
.append("consumerId", getConsumerId())
.toString();
}
}
package share.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import share.system.domain.SStore;
import share.system.domain.SStoreConsumer;
import share.system.domain.SysUserRole;
......@@ -12,7 +14,7 @@ import java.util.List;
* @author: lwj
* @create: 2023-10-16 17:07
*/
public interface SStoreConsumerMapper {
public interface SStoreConsumerMapper extends BaseMapper<SStoreConsumer> {
public int deleteByConsumerId(Long consumerId);
......
......@@ -414,7 +414,18 @@ public class QPServiceImpl implements QPService {
logger.error("适用店铺查询接口:{}", response.getMsg());
throw new RuntimeException(response.getMsg());
}
return response.getData();
//查询所有门店
List<SStore> list = storeService.list();
//过滤以增加的门店 根据open_shop_uuid
List<CustomerKeyShopScopeResponseEntity> data = response.getData();
List<CustomerKeyShopScopeResponseEntity> collect = data.stream().filter(o1 -> {
Optional<SStore> first = list.stream().filter(o2 -> o2.getOpenShopUuid().equals(o1.getOpen_shop_uuid())).findFirst();
if (first.isPresent()) {
return false;
}
return true;
}).collect(java.util.stream.Collectors.toList());
return collect;
}
}
......@@ -23,10 +23,12 @@ import share.common.utils.BaseUtil;
import share.common.utils.DateUtil;
import share.system.domain.SConsumerCoupon;
import share.system.domain.SRoomPack;
import share.system.domain.SStoreConsumer;
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.mapper.SStoreConsumerMapper;
import share.system.request.RegisterThirdSConsumerRequest;
import share.system.service.ISConsumerCouponService;
import share.system.service.SConsumerService;
......@@ -45,6 +47,8 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
@Autowired
private ISConsumerCouponService sConsumerCouponService;
@Autowired
private SStoreConsumerMapper storeConsumerMapper;
/**
* 查询会员用户
......@@ -264,9 +268,10 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
if (ArrayUtil.isNotEmpty(ids)) {
List<Long> idList = ListUtil.toList(ids);
List<SConsumer> list = baseMapper.selectBatchIds(idList);
//解除所有门店关联
storeConsumerMapper.deleteBatchIds(idList);
list.stream().forEach(sConsumer -> {
sConsumer.setRoleType(RoleTypeEnum.MEMBRO.getCode());
});
updateBatchById(list);
return idList.size();
......
......@@ -362,6 +362,7 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
SStoreConsumer sc = new SStoreConsumer();
sc.setStoreId(storeId);
sc.setConsumerId(consumerId);
sc.setPosition(PositionEnum.CLEANER.getCode());
list.add(sc);
}
return storeConsumerMapper.batchSStoreConsumer(list);
......
......@@ -54,7 +54,7 @@
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}
where t1.role_type = '1' and t2.position='1' and t2.store_id = #{storeId}
<if test="nickName != null and nickName != ''">
AND t1.nick_name like concat('%', #{nickName}, '%')
</if>
......@@ -67,7 +67,7 @@
t1.free_amount, t1.total_times, t1.duration, t1.status, t1.pwd, t1.create_time, t1.last_login_time
from s_consumer t1
where t1.role_type = '1'
and t1.id not in (select consumer_id from s_store_consumer where store_id = #{storeId})
and t1.id not in (select consumer_id from s_store_consumer where store_id = #{storeId} and position = '2')
<if test="nickName != null and nickName != ''">
AND t1.nick_name like concat('%', #{nickName}, '%')
</if>
......
......@@ -7,6 +7,7 @@
<resultMap type="SStoreConsumer" id="SStoreConsumerResult">
<result property="storeId" column="store_id" />
<result property="consumerId" column="consumer_id" />
<result property="position" column="position"/>
</resultMap>
<delete id="deleteByConsumerId" parameterType="Long">
......@@ -35,11 +36,15 @@
</insert>
<delete id="deleteInfo" parameterType="SStoreConsumer">
delete from s_store_consumer where consumer_id=#{consumerId} and store_id=#{storeId}
delete
from s_store_consumer
where consumer_id = #{consumerId}
and store_id = #{storeId}
and position = '1'
</delete>
<delete id="deleteInfos">
delete from s_store_consumer where store_id=#{storeId} and consumer_id in
delete from s_store_consumer where store_id=#{storeId} and position = '1' and consumer_id in
<foreach collection="consumerIds" item="consumerId" open="(" separator="," close=")">
#{consumerId}
</foreach>
......
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