Browse Source

分类名赋值

dev_shibei_match
yinzuomei 4 years ago
parent
commit
e9c4fb99a3
  1. 8
      epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java
  2. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  3. 25
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  4. 35
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

8
epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/IcFormItemServiceImpl.java

@ -129,6 +129,14 @@ public class IcFormItemServiceImpl extends BaseServiceImpl<IcFormItemDao, IcForm
list.addAll(result);
}
//list.add(new TableHeaderResultDTO("需求分类","DEMAND_NAME","input"));
TableHeaderResultDTO categoryName=new TableHeaderResultDTO();
categoryName.setItemType("input");
categoryName.setItemId(StrConstant.EPMETY_STR);
categoryName.setColumnName("CATEGORY_NAME");
categoryName.setLabel("居民需求");
categoryName.setOptions(new ArrayList<>());
list.add(categoryName);
TableHeaderResultDTO houseType=new TableHeaderResultDTO();
houseType.setItemType("input");
houseType.setItemId(StrConstant.EPMETY_STR);

4
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -28,6 +28,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* 用户基础信息
@ -117,4 +118,7 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
*/
List<SearchByNameResultDTO> searchByName(@Param("name")String name, @Param("agencyId")String agencyId,@Param("pageNo")Integer pageNo);
Set<String> selectUserDemandCode(String icResiUserId);
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);
}

25
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -414,12 +414,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
resultMap.put(UserConstant.HOME_ID, neighBorName.concat(buildName).concat(unitName).concat(doorName));
if(resultMap.containsKey("CATEGORY_CODE")){
resultMap.put("CATEGORY_CODE_VALUE",resultMap.get("CATEGORY_CODE"));
}
if(resultMap.containsKey("DEMAND_NAME")){
resultMap.put("CATEGORY_CODE",resultMap.get("DEMAND_NAME"));
}
resultMap.put("CATEGORY_NAME",queryUserDemandName(formDTO.getCustomerId(),(String) resultMap.get("icResiUserId")));
}
if (resultMap.containsKey(UserConstant.GENDER)) {
@ -437,6 +432,24 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
private String queryUserDemandName(String customerId,String icResiUserId) {
Set<String> demandCodePath=baseDao.selectUserDemandCode(icResiUserId);
if(CollectionUtils.isEmpty(demandCodePath)){
return StrConstant.EPMETY_STR;
}
Set<String> codeSet=new HashSet<>();
for(String codePath:demandCodePath){
if(codePath.contains(StrConstant.COMMA)){
String[] codeAtt=codePath.split(StrConstant.COMMA);
codeSet.add(codeAtt[codeAtt.length-1]);
}else{
codeSet.add(codePath);
}
}
String demandName=baseDao.selectCategoryNames(customerId,codeSet);
return demandName;
}
/**
* 编辑页面显示居民信息详情
*

35
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -101,9 +101,6 @@
<foreach item="column" collection="resultColumns" open="" separator="," close="">
${column.columnName}
</foreach>
,
GROUP_CONCAT(ic_resi_demand.CATEGORY_CODE) as DEMAND_CATEGORY_IDS,
GROUP_CONCAT(ic_resi_demand_dict.CATEGORY_NAME) as DEMAND_NAME
FROM
ic_resi_user
<if test="null != subTables and subTables.size() > 0">
@ -111,10 +108,6 @@
${subTableName}
</foreach>
</if>
left join ic_resi_demand_dict
on(ic_resi_user.customer_id=ic_resi_demand_dict.CUSTOMER_ID
and ic_resi_demand.CATEGORY_CODE=ic_resi_demand_dict.CATEGORY_CODE )
<where>
<include refid="listWhereForPage"></include>
</where>
@ -185,4 +178,32 @@
AND `NAME` LIKE CONCAT('%',#{name},'%')
ORDER BY `NAME`
</select>
<select id="selectUserDemandCode" parameterType="java.lang.String" resultType="java.lang.String">
SELECT DISTINCT
m.CATEGORY_CODE
FROM
ic_resi_demand m
WHERE
m.DEL_FLAG = '0'
AND m.IC_RESI_USER = #{icResiUserId}
ORDER BY
m.CREATED_TIME ASC
</select>
<select id="selectCategoryNames" parameterType="map" resultType="java.lang.String">
SELECT
GROUP_CONCAT(m.CATEGORY_NAME)
FROM
ic_resi_demand_dict m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
<if test="null != codeSet and codeSet.size() > 0">
AND m.CATEGORY_CODE IN
<foreach item="code" collection="codeSet" open="(" separator="," close=")">
#{code}
</foreach>
</if>
</select>
</mapper>
Loading…
Cancel
Save