fix:获取门店人员信息新增签约人员信息
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.cool.store.dto.store;
|
package com.cool.store.dto.store;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author suzhuhong
|
* @Author suzhuhong
|
||||||
@@ -8,6 +9,7 @@ import lombok.Data;
|
|||||||
* @Version 1.0
|
* @Version 1.0
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
public class StoreUserDTO {
|
public class StoreUserDTO {
|
||||||
|
|
||||||
private String userId;
|
private String userId;
|
||||||
@@ -18,4 +20,8 @@ public class StoreUserDTO {
|
|||||||
|
|
||||||
private String positionName;
|
private String positionName;
|
||||||
|
|
||||||
|
public StoreUserDTO(String userName, String mobile) {
|
||||||
|
this.userName = userName;
|
||||||
|
this.mobile = mobile;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.cool.store.service.impl;
|
package com.cool.store.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollStreamUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.cool.store.dao.store.StoreMasterSignerInfoDAO;
|
||||||
import com.cool.store.dto.store.AuthStoreUserDTO;
|
import com.cool.store.dto.store.AuthStoreUserDTO;
|
||||||
import com.cool.store.dao.EnterpriseUserDAO;
|
import com.cool.store.dao.EnterpriseUserDAO;
|
||||||
import com.cool.store.dao.EnterpriseUserRoleDao;
|
import com.cool.store.dao.EnterpriseUserRoleDao;
|
||||||
@@ -16,6 +18,7 @@ import com.cool.store.entity.EnterpriseUserDO;
|
|||||||
import com.cool.store.entity.StoreDO;
|
import com.cool.store.entity.StoreDO;
|
||||||
import com.cool.store.entity.SysRoleDO;
|
import com.cool.store.entity.SysRoleDO;
|
||||||
import com.cool.store.entity.UserAuthMappingDO;
|
import com.cool.store.entity.UserAuthMappingDO;
|
||||||
|
import com.cool.store.entity.store.StoreMasterSignerInfoDO;
|
||||||
import com.cool.store.enums.*;
|
import com.cool.store.enums.*;
|
||||||
import com.cool.store.exception.ServiceException;
|
import com.cool.store.exception.ServiceException;
|
||||||
import com.cool.store.mapper.*;
|
import com.cool.store.mapper.*;
|
||||||
@@ -70,6 +73,8 @@ public class StoreServiceImpl implements StoreService {
|
|||||||
EnterpriseUserMapper enterpriseUserMapper;
|
EnterpriseUserMapper enterpriseUserMapper;
|
||||||
@Resource
|
@Resource
|
||||||
EnterpriseUserGroupMappingMapper enterpriseUserGroupMappingMapper;
|
EnterpriseUserGroupMappingMapper enterpriseUserGroupMappingMapper;
|
||||||
|
@Resource
|
||||||
|
StoreMasterSignerInfoDAO storeMasterSignerInfoDAO;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageInfo<StoreDTO> getStoreExtendFieldInfo(Integer pageSize, Integer pageNum) {
|
public PageInfo<StoreDTO> getStoreExtendFieldInfo(Integer pageSize, Integer pageNum) {
|
||||||
@@ -120,6 +125,8 @@ public class StoreServiceImpl implements StoreService {
|
|||||||
if (CollectionUtils.isEmpty(list)){
|
if (CollectionUtils.isEmpty(list)){
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
List<String> storeIds = CollStreamUtil.toList(list, StoreDO::getStoreId);
|
||||||
|
Map<String, StoreMasterSignerInfoDO> signerMap = storeMasterSignerInfoDAO.getSignerMapByStoreIds(storeIds);
|
||||||
List<StoreUserPositionDTO> result = new ArrayList<>();
|
List<StoreUserPositionDTO> result = new ArrayList<>();
|
||||||
list.forEach(x->{
|
list.forEach(x->{
|
||||||
StoreUserPositionDTO storeUserPositionDTO = new StoreUserPositionDTO();
|
StoreUserPositionDTO storeUserPositionDTO = new StoreUserPositionDTO();
|
||||||
@@ -140,6 +147,16 @@ public class StoreServiceImpl implements StoreService {
|
|||||||
storeUserDTO.setPositionName(String.join(Constants.COMMA, positionNameList));
|
storeUserDTO.setPositionName(String.join(Constants.COMMA, positionNameList));
|
||||||
userList.add(storeUserDTO);
|
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);
|
storeUserPositionDTO.setUserList(userList);
|
||||||
result.add(storeUserPositionDTO);
|
result.add(storeUserPositionDTO);
|
||||||
});
|
});
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -135,7 +135,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
<artifactId>hutool-all</artifactId>
|
<artifactId>hutool-all</artifactId>
|
||||||
<version>5.0.7</version>
|
<version>5.7.22</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aliyun</groupId>
|
<groupId>com.aliyun</groupId>
|
||||||
|
|||||||
Reference in New Issue
Block a user