fix:店-招商经理关系

This commit is contained in:
suzhuhong
2026-01-02 11:54:49 +08:00
parent e34aea7a40
commit 2eaa1533c2
5 changed files with 33 additions and 3 deletions

View File

@@ -46,7 +46,19 @@
and type = #{type}
</if>
</where>
order by enable_flag desc
order by
enable_flag desc,
<choose>
<when test="type != null and type == 2">
id asc
</when>
<when test="type != null and type == 1">
id desc
</when>
<otherwise>
id asc
</otherwise>
</choose>
</select>
<select id="queryOrgInfoByBigRegionAndJoinMode" resultMap="BaseResultMap">

View File

@@ -41,6 +41,7 @@
<result column="monthly_other_expenses" property="monthlyOtherExpenses"/>
<result column="unified_management" property="unifiedManagement" jdbcType="TINYINT"/>
<result column="join_model" property="joinModel" jdbcType="TINYINT"/>
<result column="join_supervision" property="joinSupervision" jdbcType="VARCHAR"/>
<result column="join_brand" property="joinBrand" jdbcType="TINYINT"/>
<result column="store_type" property="storeType" jdbcType="TINYINT"/>
<result column="mini_program_order_store_name" property="miniProgramOrderStoreName"/>

View File

@@ -70,4 +70,10 @@ public class StoreDTO {
@ApiModelProperty("")
private String county;
@ApiModelProperty("招商经理")
private String investManager;
@ApiModelProperty("招商经理手机号")
private String investManagerMobile;
}

View File

@@ -265,4 +265,6 @@ public class StoreDO {
private Long branch;
private String joinSupervision;
}

View File

@@ -94,10 +94,14 @@ public class StoreServiceImpl implements StoreService {
.filter(Objects::nonNull)
.collect(Collectors.toSet());
List<String> userIds = list.stream().filter(Objects::nonNull).map(StoreDO::getJoinSupervision).collect(Collectors.toList());
Map<String, EnterpriseUserDO> userNameMap = enterpriseUserDAO.getUserMap(userIds);
List<RegionDO> regionList = regionMapper.getByIds(new ArrayList<>(regionIds));
Map<Long, String> regionNameMap = regionList.stream().collect(Collectors.toMap(RegionDO::getId, RegionDO::getName));
List<StoreDTO> storeDTOS = processStores(list, regionNameMap);
List<StoreDTO> storeDTOS = processStores(list, regionNameMap,userNameMap);
info.setList(storeDTOS);
return info;
}
@@ -390,7 +394,7 @@ public class StoreServiceImpl implements StoreService {
}
public static List<StoreDTO> processStores(List<StoreDO> stores,Map<Long, String> regionMap) {
public static List<StoreDTO> processStores(List<StoreDO> stores,Map<Long, String> regionMap,Map<String, EnterpriseUserDO> userMap) {
// 处理每个门店
return stores.stream().map(store -> {
StoreDTO dto = BeanUtil.toBean(store, StoreDTO.class);
@@ -407,6 +411,11 @@ public class StoreServiceImpl implements StoreService {
if (store.getBranch()!=null){
dto.setBranchName(regionMap.get(store.getBranch()));
}
if (store.getJoinSupervision()!=null){
EnterpriseUserDO enterpriseUserDO = userMap.getOrDefault(store.getJoinSupervision(),new EnterpriseUserDO());
dto.setInvestManager(enterpriseUserDO.getUserId());
dto.setInvestManagerMobile(enterpriseUserDO.getMobile());
}
return dto;
}).collect(Collectors.toList());
}