Merge branch 'cc_20250905_storeExtendInfo' into 'master'

Cc 20250905 store extend info

See merge request hangzhou/java/custom_zxjp!163
This commit is contained in:
苏竹红
2025-09-24 01:57:58 +00:00
11 changed files with 337 additions and 122 deletions

View File

@@ -0,0 +1,37 @@
package com.cool.store.dao.store;
import cn.hutool.core.collection.CollStreamUtil;
import com.cool.store.entity.store.StoreMasterSignerInfoDO;
import com.cool.store.mapper.store.StoreMasterSignerInfoMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* <p>
* 门店签约信息DAO
* </p>
*
* @author wangff
* @since 2025/9/23
*/
@Repository
@RequiredArgsConstructor
public class StoreMasterSignerInfoDAO {
private final StoreMasterSignerInfoMapper storeMasterSignerInfoMapper;
/**
* 获取门店签约信息Map
*/
public Map<String, StoreMasterSignerInfoDO> getSignerMapByStoreIds(List<String> storeIds) {
if (CollectionUtils.isEmpty(storeIds)) {
return Collections.emptyMap();
}
List<StoreMasterSignerInfoDO> list = storeMasterSignerInfoMapper.selectByStoreIds(storeIds);
return CollStreamUtil.toMap(list, StoreMasterSignerInfoDO::getStoreId, v -> v);
}
}

View File

@@ -0,0 +1,19 @@
package com.cool.store.mapper.store;
import com.cool.store.entity.store.StoreMasterSignerInfoDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @author zhangchenbiao
* @date 2025-09-23 11:32
*/
public interface StoreMasterSignerInfoMapper {
/**
* 根据门店id查询签约信息
*/
List<StoreMasterSignerInfoDO> selectByStoreIds(@Param("storeIds") List<String> storeIds);
}

View File

@@ -93,6 +93,15 @@
</select>
<select id="listByMobile" resultMap="BaseResultMap">
select a.*
from store_${enterpriseId} a left join store_master_signer_info_5558ce7a3aa84e3590392fcaa8697ffb b on a.store_id = b.store_id
<where>
and a.is_delete = 'effective'
<if test="mobile!=null and mobile !=''">
and ( b.signer1_mobile = #{mobile} or b.signer2_mobile = #{mobile})
</if>
</where>
union
select *
from store_${enterpriseId}
<where>
@@ -104,34 +113,57 @@
</select>
<select id="getSubStoreByRegionIdsAndMobile" resultType="com.cool.store.response.MiniShopsResponse">
select store_id as storeId, store_name as shopName, store_num as shopCode, store_address as detailAddress
from store_${enterpriseId}
where is_delete = 'effective'
<if test="storeName!=null and storeName!=''">
and store_name like concat('%', #{storeName}, '%')
</if>
<if test="storeNum!=null and storeNum!=''">
and store_num = #{storeNum}
</if>
and (
<if test="regionIdList != null and regionIdList.size >0 ">
<foreach collection="regionIdList" item="regionId" separator=" or " open=" (" close=" )">
region_path like concat('%/', #{regionId}, '/%')
</foreach>
</if>
<if test="mobile!=null and mobile !=''">
<choose>
<when test="regionIdList != null and regionIdList.size >0 ">
or `extend_field` like concat('%', #{mobile}, '%')
</when>
<otherwise>
`extend_field` like concat('%', #{mobile}, '%')
</otherwise>
</choose>
</if>
)
<choose>
<!-- 情况1regionIdList不为空使用UNION优化 -->
<when test="regionIdList != null and regionIdList.size > 0">
SELECT store_id as storeId, store_name as shopName, store_num as shopCode, store_address as detailAddress
FROM store_${enterpriseId} a
WHERE a.is_delete = 'effective'
<if test="storeName!=null and storeName!=''">
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
</if>
<if test="storeNum!=null and storeNum!=''">
AND a.store_num = #{storeNum}
</if>
AND (
<foreach collection="regionIdList" item="regionId" separator=" OR ">
a.region_path LIKE CONCAT('%/', #{regionId}, '/%')
</foreach>
)
UNION
SELECT a.store_id as storeId, a.store_name as shopName, a.store_num as shopCode, a.store_address as detailAddress
FROM store_${enterpriseId} a
INNER JOIN store_master_signer_info_${enterpriseId} b ON a.store_id = b.store_id
WHERE a.is_delete = 'effective'
<if test="storeName!=null and storeName!=''">
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
</if>
<if test="storeNum!=null and storeNum!=''">
AND a.store_num = #{storeNum}
</if>
AND (b.signer1_mobile = #{mobile} OR b.signer2_mobile = #{mobile})
</when>
<!-- 情况2regionIdList为空直接查询关联表 -->
<otherwise>
SELECT a.store_id as storeId, a.store_name as shopName, a.store_num as shopCode, a.store_address as detailAddress
FROM store_${enterpriseId} a
INNER JOIN store_master_signer_info_${enterpriseId} b ON a.store_id = b.store_id
WHERE a.is_delete = 'effective'
<if test="storeName!=null and storeName!=''">
AND a.store_name LIKE CONCAT('%', #{storeName}, '%')
</if>
<if test="storeNum!=null and storeNum!=''">
AND a.store_num = #{storeNum}
</if>
AND (b.signer1_mobile = #{mobile} OR b.signer2_mobile = #{mobile})
</otherwise>
</choose>
</select>
<select id="list" resultMap="BaseResultMap">
select *
from store_${enterpriseId}

View File

@@ -397,7 +397,7 @@
and eu.active = true
-- and sr.source = 'create'
<if test="positionType != null and positionType != '' ">
and sr.position_type = #{positionType}
and (sr.position_type = #{positionType} or sr.id = 180000000)
</if>
and eu.user_status = '1'
</select>

View File

@@ -55,7 +55,7 @@
</foreach>
</if>
<if test="positionType!=null and positionType!=''">
and b.position_type =#{positionType}
and (b.position_type =#{positionType} or b.id = 180000000 )
</if>
<if test="notRoleAuth!=null and notRoleAuth!=''">
and b.role_auth !=#{notRoleAuth}

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cool.store.mapper.store.StoreMasterSignerInfoMapper">
<resultMap id="BaseResultMap" type="com.cool.store.entity.store.StoreMasterSignerInfoDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="store_id" jdbcType="VARCHAR" property="storeId" />
<result column="signer1_name" jdbcType="VARCHAR" property="signer1Name" />
<result column="signer1_mobile" jdbcType="VARCHAR" property="signer1Mobile" />
<result column="signer1_id_card_no" jdbcType="VARCHAR" property="signer1IdCardNo" />
<result column="signer1_id_card_front" jdbcType="VARCHAR" property="signer1IdCardFront" />
<result column="signer1_id_card_back" jdbcType="VARCHAR" property="signer1IdCardBack" />
<result column="signer2_name" jdbcType="VARCHAR" property="signer2Name" />
<result column="signer2_mobile" jdbcType="VARCHAR" property="signer2Mobile" />
<result column="signer2_id_card_no" jdbcType="VARCHAR" property="signer2IdCardNo" />
<result column="signer2_id_card_front" jdbcType="VARCHAR" property="signer2IdCardFront" />
<result column="signer2_id_card_back" jdbcType="VARCHAR" property="signer2IdCardBack" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, store_id, signer1_name, signer1_mobile, signer1_id_card_no, signer1_id_card_front,
signer1_id_card_back, signer2_name, signer2_mobile, signer2_id_card_no, signer2_id_card_front,
signer2_id_card_back, create_time, update_time
</sql>
<select id="selectByStoreIds" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from store_master_signer_info_${enterpriseId}
where store_id in
<foreach item="storeId" collection="storeIds" open="(" separator="," close=")">
#{storeId}
</foreach>
</select>
</mapper>

View File

@@ -1,6 +1,7 @@
package com.cool.store.dto.store;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author suzhuhong
@@ -8,6 +9,7 @@ import lombok.Data;
* @Version 1.0
*/
@Data
@NoArgsConstructor
public class StoreUserDTO {
private String userId;
@@ -18,4 +20,8 @@ public class StoreUserDTO {
private String positionName;
public StoreUserDTO(String userName, String mobile) {
this.userName = userName;
this.mobile = mobile;
}
}

View File

@@ -0,0 +1,63 @@
package com.cool.store.entity.store;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
*
* @author wangff
* @date 2025-09-23 11:32
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class StoreMasterSignerInfoDO implements Serializable {
@ApiModelProperty("主键")
private Long id;
@ApiModelProperty("门店ID")
private String storeId;
@ApiModelProperty("签约人1姓名")
private String signer1Name;
@ApiModelProperty("签约人1手机号")
private String signer1Mobile;
@ApiModelProperty("签约人1身份证号()")
private String signer1IdCardNo;
@ApiModelProperty("签约人1身份证正面图片路径")
private String signer1IdCardFront;
@ApiModelProperty("签约人1身份证反面图片路径")
private String signer1IdCardBack;
@ApiModelProperty("签约人2姓名")
private String signer2Name;
@ApiModelProperty("签约人2手机号")
private String signer2Mobile;
@ApiModelProperty("签约人2身份证号()")
private String signer2IdCardNo;
@ApiModelProperty("签约人2身份证正面图片路径")
private String signer2IdCardFront;
@ApiModelProperty("签约人2身份证反面图片路径")
private String signer2IdCardBack;
@ApiModelProperty("创建时间")
private Date createTime;
@ApiModelProperty("更新时间")
private Date updateTime;
}

View File

@@ -1,6 +1,7 @@
package com.cool.store.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.constants.CommonConstants;
import com.cool.store.dao.*;
import com.cool.store.entity.*;
@@ -20,7 +21,7 @@ import com.cool.store.service.UserAuthMappingService;
import com.cool.store.utils.RedisConstantUtil;
import com.cool.store.utils.RedisUtilPool;
import com.cool.store.utils.poi.StringUtils;
import io.lettuce.core.ZAddArgs;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
@@ -38,6 +39,7 @@ import java.util.stream.Stream;
* @createDate 2024-10-09 14:05:52
*/
@Service
@Slf4j
public class BuildInformationServiceImpl implements BuildInformationService {
@Resource
private PlatformBuildDAO platformBuildDAO;
@@ -73,6 +75,102 @@ public class BuildInformationServiceImpl implements BuildInformationService {
private BigRegionDAO bigRegionDAO;
@Override
@Transactional(rollbackFor = Exception.class)
public Integer submitOrUpdate(BuildInformationRequest request) {
log.info("提交/修改建店资料开始,shopId:{}", JSONObject.toJSONString(request));
String lockKey = redisConstantUtil.submitBuildKey(request.getShopId());
String lockValue = UUID.randomUUID().toString();
boolean acquired = false;
try {
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
if (Boolean.TRUE.equals(acquired)) {
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(request.getShopId());
// if (JoinModeEnum.FLAGSHIP_STORE.getCode()!=shopInfoDO.getJoinMode()){
// log.info("FLAGSHIP_STORE{}{}{}{}{}{}{}",request.getSettlerName(),request.getSettlerIdCardFront(),
// request.getSettlerInHandFrontPicture(),request.getSettlerBankBackPhotoUrl(),
// request.getSettlerBankNumber(),request.getSettlerBankMobile(),request.getSettlerBankName());
// //校验结算人非空
// if (StringUtils.isAnyBlank(request.getSettlerName(),request.getSettlerIdCardFront(),
// request.getSettlerInHandFrontPicture(),request.getSettlerBankBackPhotoUrl(),
// request.getSettlerBankNumber(),request.getSettlerBankMobile(),request.getSettlerBankName())) {
// throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
// }
// }
BuildInformationDO informationDO = buildInformationDAO.selectOneByShopId(request.getShopId());
BuildInformationDO buildInformationDO = request.toDO();
OrderSysInfoDO orderSysInfoDO = getOrderSysInfoDO(request);
OrderSysInfoDO orderSysInfoDO1 = orderSysInfoDAO.selectByShopId(request.getShopId());
if (Objects.nonNull(orderSysInfoDO1)) {
orderSysInfoDAO.updateByShopId(orderSysInfoDO);
} else {
orderSysInfoDAO.insertSelective(orderSysInfoDO);
}
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId());
QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDAO.getByLineId(lineInfoDO.getId());
if (request.getJuridicalIsSamePartner()) {
buildInformationDO.setJuridicalName(lineInfoDO.getUsername());
buildInformationDO.setJuridicalIdCardNo(qualificationsInfoDO.getIdCardNo());
buildInformationDO.setJuridicalIdCardFront(qualificationsInfoDO.getFrontOfIdCard());
buildInformationDO.setJuridicalIdCardReverse(qualificationsInfoDO.getBackOfIdCard());
}
if (request.getSettlerIsSamePartner()!=null&&request.getSettlerIsSamePartner()) {
buildInformationDO.setSettlerIdCardNo(qualificationsInfoDO.getIdCardNo());
buildInformationDO.setSettlerName(lineInfoDO.getUsername());
buildInformationDO.setSettlerIdCardFront(qualificationsInfoDO.getFrontOfIdCard());
buildInformationDO.setSettlerIdCardReverse(qualificationsInfoDO.getBackOfIdCard());
}
if (Objects.isNull(informationDO)) {
buildInformationDO.setCreateTime(new Date());
buildInformationDO.setUpdateTime(new Date());
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfoDO.getUsername());
map.put("partnerMobile", lineInfoDO.getMobile());
map.put("storeName", shopInfoDO.getShopName());
List<EnterpriseUserDO> logisticsList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.LOGISTICS, shopInfoDO.getRegionId());
List<String> logistics = new ArrayList<>();
if (Objects.nonNull(logisticsList)) {
logistics.addAll(logisticsList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
}
commonService.sendQWMessage(logistics,
MessageEnum.MESSAGE_52,
map);
return buildInformationDAO.insertSelective(buildInformationDO);
} else {
buildInformationDO.setUpdateTime(new Date());
List<PlatformBuildDO> platformBuildDOS = platformBuildDAO.selectByShopId(request.getShopId());
if (CollectionUtils.isNotEmpty(platformBuildDOS)){
for (PlatformBuildDO platformBuildDO : platformBuildDOS){
platformBuildDO.setSettlerName(buildInformationDO.getSettlerName());
platformBuildDO.setSettlerIdCardFront(buildInformationDO.getSettlerIdCardFront());
platformBuildDO.setSettlerIdCardReverse(buildInformationDO.getSettlerIdCardReverse());
platformBuildDO.setSettlerInHandBackPicture(buildInformationDO.getSettlerInHandBackPicture());
platformBuildDO.setSettlerInHandFrontPicture(buildInformationDO.getSettlerInHandFrontPicture());
platformBuildDO.setSettlerIdCardNo(buildInformationDO.getSettlerIdCardNo());
platformBuildDO.setSettlerBankPhotoUrl(buildInformationDO.getSettlerBankPhotoUrl());
platformBuildDO.setSettlerBankNumber(buildInformationDO.getSettlerBankNumber());
platformBuildDO.setSettlerBankMobile(buildInformationDO.getSettlerBankMobile());
platformBuildDO.setSettlerBankName(buildInformationDO.getSettlerBankName());
}
}
platformBuildDAO.batchUpdate(platformBuildDOS);
return buildInformationDAO.updateByShopIdSelective(buildInformationDO);
}
}else{
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
}
} finally {
if (Boolean.TRUE.equals(acquired)) {
String currentValue = redisUtilPool.getString(lockKey);
if (lockValue.equals(currentValue)) {
redisUtilPool.delKey(lockKey);
}
}
}
}
@Override
public BuildInformationResponse getBuildInformation(Long shopId) {
BuildInformationResponse response = new BuildInformationResponse();
@@ -192,98 +290,6 @@ public class BuildInformationServiceImpl implements BuildInformationService {
response.setJuridicalIsSamePartner(informationDO.getJuridicalIsSamePartner());
}
@Override
@Transactional(rollbackFor = Exception.class)
public Integer submitOrUpdate(BuildInformationRequest request) {
String lockKey = redisConstantUtil.submitBuildKey(request.getShopId());
String lockValue = UUID.randomUUID().toString();
boolean acquired = false;
try {
acquired = redisUtilPool.setNxExpire(lockKey, lockValue, CommonConstants.TEN_SECONDS);
if (Boolean.TRUE.equals(acquired)) {
ShopInfoDO shopInfoDO = shopInfoDAO.getShopInfo(request.getShopId());
// if (JoinModeEnum.FLAGSHIP_STORE.getCode()!=shopInfoDO.getJoinMode()){
// //校验结算人非空
// if (StringUtils.isAnyBlank(request.getSettlerName(),request.getSettlerIdCardFront(),
// request.getSettlerInHandFrontPicture(),request.getSettlerBankBackPhotoUrl(),
// request.getSettlerBankNumber(),request.getSettlerBankMobile(),request.getSettlerBankName())) {
// throw new ServiceException(ErrorCodeEnum.PARAMS_VALIDATE_ERROR);
// }
// }
BuildInformationDO informationDO = buildInformationDAO.selectOneByShopId(request.getShopId());
BuildInformationDO buildInformationDO = request.toDO();
OrderSysInfoDO orderSysInfoDO = getOrderSysInfoDO(request);
OrderSysInfoDO orderSysInfoDO1 = orderSysInfoDAO.selectByShopId(request.getShopId());
if (Objects.nonNull(orderSysInfoDO1)) {
orderSysInfoDAO.updateByShopId(orderSysInfoDO);
} else {
orderSysInfoDAO.insertSelective(orderSysInfoDO);
}
LineInfoDO lineInfoDO = lineInfoDAO.getLineInfo(shopInfoDO.getLineId());
QualificationsInfoDO qualificationsInfoDO = qualificationsInfoDAO.getByLineId(lineInfoDO.getId());
if (request.getJuridicalIsSamePartner()) {
buildInformationDO.setJuridicalName(lineInfoDO.getUsername());
buildInformationDO.setJuridicalIdCardNo(qualificationsInfoDO.getIdCardNo());
buildInformationDO.setJuridicalIdCardFront(qualificationsInfoDO.getFrontOfIdCard());
buildInformationDO.setJuridicalIdCardReverse(qualificationsInfoDO.getBackOfIdCard());
}
if (request.getSettlerIsSamePartner()!=null&&request.getSettlerIsSamePartner()) {
buildInformationDO.setSettlerIdCardNo(qualificationsInfoDO.getIdCardNo());
buildInformationDO.setSettlerName(lineInfoDO.getUsername());
buildInformationDO.setSettlerIdCardFront(qualificationsInfoDO.getFrontOfIdCard());
buildInformationDO.setSettlerIdCardReverse(qualificationsInfoDO.getBackOfIdCard());
}
if (Objects.isNull(informationDO)) {
buildInformationDO.setCreateTime(new Date());
buildInformationDO.setUpdateTime(new Date());
shopStageInfoDAO.updateShopStageInfo(request.getShopId(), ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_151);
HashMap<String, String> map = new HashMap<>();
map.put("partnerUsername", lineInfoDO.getUsername());
map.put("partnerMobile", lineInfoDO.getMobile());
map.put("storeName", shopInfoDO.getShopName());
List<EnterpriseUserDO> logisticsList = userAuthMappingService.getAllUserByRoleEnumAndRegionId(UserRoleEnum.LOGISTICS, shopInfoDO.getRegionId());
List<String> logistics = new ArrayList<>();
if (Objects.nonNull(logisticsList)) {
logistics.addAll(logisticsList.stream().map(EnterpriseUserDO::getUserId).collect(Collectors.toList()));
}
commonService.sendQWMessage(logistics,
MessageEnum.MESSAGE_52,
map);
return buildInformationDAO.insertSelective(buildInformationDO);
} else {
buildInformationDO.setUpdateTime(new Date());
List<PlatformBuildDO> platformBuildDOS = platformBuildDAO.selectByShopId(request.getShopId());
if (CollectionUtils.isNotEmpty(platformBuildDOS)){
for (PlatformBuildDO platformBuildDO : platformBuildDOS){
platformBuildDO.setSettlerName(buildInformationDO.getSettlerName());
platformBuildDO.setSettlerIdCardFront(buildInformationDO.getSettlerIdCardFront());
platformBuildDO.setSettlerIdCardReverse(buildInformationDO.getSettlerIdCardReverse());
platformBuildDO.setSettlerInHandBackPicture(buildInformationDO.getSettlerInHandBackPicture());
platformBuildDO.setSettlerInHandFrontPicture(buildInformationDO.getSettlerInHandFrontPicture());
platformBuildDO.setSettlerIdCardNo(buildInformationDO.getSettlerIdCardNo());
platformBuildDO.setSettlerBankPhotoUrl(buildInformationDO.getSettlerBankPhotoUrl());
platformBuildDO.setSettlerBankNumber(buildInformationDO.getSettlerBankNumber());
platformBuildDO.setSettlerBankMobile(buildInformationDO.getSettlerBankMobile());
platformBuildDO.setSettlerBankName(buildInformationDO.getSettlerBankName());
}
}
platformBuildDAO.batchUpdate(platformBuildDOS);
return buildInformationDAO.updateByShopIdSelective(buildInformationDO);
}
}else{
throw new ServiceException(ErrorCodeEnum.DUPLICATE_SUBMISSION);
}
} finally {
if (Boolean.TRUE.equals(acquired)) {
String currentValue = redisUtilPool.getString(lockKey);
if (lockValue.equals(currentValue)) {
redisUtilPool.delKey(lockKey);
}
}
}
}
private static @NotNull OrderSysInfoDO getOrderSysInfoDO(BuildInformationRequest request) {
OrderSysInfoDO orderSysInfoDO = new OrderSysInfoDO();
orderSysInfoDO.setShopId(request.getShopId());

View File

@@ -1,10 +1,12 @@
package com.cool.store.service.impl;
import cn.hutool.core.collection.CollStreamUtil;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.cool.store.dto.StoreNameDTO;
import com.cool.store.dao.store.StoreMasterSignerInfoDAO;
import com.cool.store.dto.store.AuthStoreUserDTO;
import com.cool.store.dao.EnterpriseUserDAO;
import com.cool.store.dao.EnterpriseUserRoleDao;
@@ -18,6 +20,7 @@ import com.cool.store.entity.EnterpriseUserDO;
import com.cool.store.entity.StoreDO;
import com.cool.store.entity.SysRoleDO;
import com.cool.store.entity.UserAuthMappingDO;
import com.cool.store.entity.store.StoreMasterSignerInfoDO;
import com.cool.store.enums.*;
import com.cool.store.exception.ServiceException;
import com.cool.store.mapper.*;
@@ -72,6 +75,8 @@ public class StoreServiceImpl implements StoreService {
EnterpriseUserMapper enterpriseUserMapper;
@Resource
EnterpriseUserGroupMappingMapper enterpriseUserGroupMappingMapper;
@Resource
StoreMasterSignerInfoDAO storeMasterSignerInfoDAO;
@Override
public PageInfo<StoreDTO> getStoreExtendFieldInfo(Integer pageSize, Integer pageNum) {
@@ -138,6 +143,8 @@ public class StoreServiceImpl implements StoreService {
if (CollectionUtils.isEmpty(list)){
return new ArrayList<>();
}
List<String> storeIds = CollStreamUtil.toList(list, StoreDO::getStoreId);
Map<String, StoreMasterSignerInfoDO> signerMap = storeMasterSignerInfoDAO.getSignerMapByStoreIds(storeIds);
List<StoreUserPositionDTO> result = new ArrayList<>();
list.forEach(x->{
StoreUserPositionDTO storeUserPositionDTO = new StoreUserPositionDTO();
@@ -158,6 +165,16 @@ public class StoreServiceImpl implements StoreService {
storeUserDTO.setPositionName(String.join(Constants.COMMA, positionNameList));
userList.add(storeUserDTO);
}
StoreMasterSignerInfoDO signerInfoDO = signerMap.get(x.getStoreId());
if (Objects.nonNull(signerInfoDO)) {
Set<String> mobiles = CollStreamUtil.toSet(userList, StoreUserDTO::getMobile);
if (StringUtils.isNotBlank(signerInfoDO.getSigner1Mobile()) && mobiles.add(signerInfoDO.getSigner1Mobile())) {
userList.add(new StoreUserDTO(signerInfoDO.getSigner1Name(), signerInfoDO.getSigner1Mobile()));
}
if (StringUtils.isNotBlank(signerInfoDO.getSigner2Mobile()) && mobiles.add(signerInfoDO.getSigner2Mobile())) {
userList.add(new StoreUserDTO(signerInfoDO.getSigner2Name(), signerInfoDO.getSigner2Mobile()));
}
}
storeUserPositionDTO.setUserList(userList);
result.add(storeUserPositionDTO);
});

View File

@@ -135,7 +135,7 @@
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.0.7</version>
<version>5.7.22</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>