Browse Source

Merge branches 'dev' and 'dev_ic_diaodong' of http://121.42.41.42:7070/r/epmet-cloud into dev_ic_diaodong

dev
yinzuomei 4 years ago
parent
commit
0d3e06d961
  1. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java
  2. 36
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiDemandDictDTO.java
  3. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  4. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java
  5. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java
  6. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  7. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  8. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  9. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  10. 1
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java
  11. 45
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  12. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java
  13. 28
      epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandNameQueryFormDTO.java

@ -16,6 +16,6 @@ public class UserDemandNameQueryFormDTO implements Serializable {
@NotBlank(message = "客户id不能为空",groups =AddUserInternalGroup.class)
private String customerId;
@NotEmpty(message = "分类编码不能为空",groups =AddUserInternalGroup.class)
// @NotEmpty(message = "分类编码不能为空",groups =AddUserInternalGroup.class)
private Set<String> codeSet;
}

36
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/IcResiDemandDictDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.result.demand;
import lombok.Data;
import java.io.Serializable;
@Data
public class IcResiDemandDictDTO implements Serializable {
/**
* 客户Id customer.id
*/
private String customerId;
/**
* 父级
*/
private String parentCode;
private String parentName;
/**
* 字典值
*/
private String categoryCode;
/**
* 字典描述
*/
private String categoryName;
/**
* 级别
*/
private Integer level;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java

@ -8,6 +8,7 @@ import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
@ -24,7 +25,7 @@ import java.util.List;
* @date 2020/6/4 13:25
*/
@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallbackFactory = EpmetHeartOpenFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallbackFactory = EpmetHeartOpenFeignClientFallbackFactory.class, url = "http://localhost:8111")
// @FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallbackFactory = EpmetHeartOpenFeignClientFallbackFactory.class, url = "http://localhost:8111")
public interface EpmetHeartOpenFeignClient {
/**
@ -59,7 +60,7 @@ public interface EpmetHeartOpenFeignClient {
Result<VolunteerInfoDTO> queryUserVolunteerInfo(@PathVariable("userId") String userId);
@PostMapping("/heart/icresidemanddict/demangnames")
Result<String> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO);
Result<List<IcResiDemandDictDTO>> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO);
/**
* 分页查询志愿者列表

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java

@ -9,6 +9,7 @@ import com.epmet.dto.form.AutoEvaluateDemandFormDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.form.resi.VolunteerCommonFormDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.resi.PageVolunteerInfoResultDTO;
import com.epmet.feign.EpmetHeartOpenFeignClient;
@ -53,7 +54,7 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli
}
@Override
public Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
public Result<List<IcResiDemandDictDTO>> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "queryDemandNames", formDTO);
}

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcResiDemandDictController.java

@ -29,6 +29,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.service.IcResiDemandDictService;
import org.springframework.beans.factory.annotation.Autowired;
@ -154,11 +155,12 @@ public class IcResiDemandDictController {
* @return
*/
@PostMapping("demangnames")
public Result<String> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO){
public Result<List<IcResiDemandDictDTO>> queryDemandNames(@RequestBody UserDemandNameQueryFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,UserDemandNameQueryFormDTO.AddUserInternalGroup.class);
return icResiDemandDictService.queryDemandNames(formDTO);
return new Result<List<IcResiDemandDictDTO>>().ok(icResiDemandDictService.queryDemandNames(formDTO));
}
/**
* 居民需求查询条件一级分类列表 0
* 区域化党建单位服务事项下拉框 1010

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import org.apache.ibatis.annotations.Mapper;
@ -40,7 +41,7 @@ public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
List<OptionResultDTO> selectDemandOptions(@Param("customerId") String customerId,@Param("usableFlagFormValue") String usableFlagFormValue);
List<OptionResultDTO> selectChildDemands(@Param("customerId")String customerId, @Param("parentCode") String parentCode,@Param("usableFlagFormValue") String usableFlagFormValue);
String selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);
List<IcResiDemandDictDTO> selectCategoryNames(@Param("customerId") String customerId,@Param("codeSet") Set<String> codeSet);
List<OptionDTO> selectByPCode(@Param("pcode") String pcode,
@Param("customerId") String customerId,

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity;
@ -93,7 +94,7 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
* @param formDTO
* @return
*/
Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO);
List<IcResiDemandDictDTO> queryDemandNames(UserDemandNameQueryFormDTO formDTO);
List<OptionDTO> querySubCodeList(SubCodeFormDTO formDTO);

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java

@ -29,11 +29,11 @@ import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcResiDemandDictDao;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.DemandCategoryResDTO;
import com.epmet.dto.result.demand.DemandPageResDTO;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcResiDemandDictEntity;
import com.epmet.service.IcResiDemandDictService;
@ -207,8 +207,13 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
}
@Override
public Result<String> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
return new Result<String>().ok(baseDao.selectCategoryNames(formDTO.getCustomerId(),formDTO.getCodeSet()));
public List<IcResiDemandDictDTO> queryDemandNames(UserDemandNameQueryFormDTO formDTO) {
List<IcResiDemandDictDTO> list=baseDao.selectCategoryNames(formDTO.getCustomerId(),formDTO.getCodeSet());
if(CollectionUtils.isEmpty(list)){
log.warn("当前客户下未配置需求分类");
return new ArrayList<>();
}
return list;
}
@Override

14
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -72,11 +72,19 @@
</select>
<select id="selectCategoryNames" parameterType="map" resultType="java.lang.String">
<select id="selectCategoryNames" parameterType="map" resultType="com.epmet.dto.result.demand.IcResiDemandDictDTO">
SELECT
GROUP_CONCAT(m.CATEGORY_NAME)
m.CUSTOMER_ID,
m.CATEGORY_CODE,
m.CATEGORY_NAME,
m.LEVEL,
m.PARENT_CODE,
IFNULL(p.CATEGORY_NAME,'') as parentName
FROM
ic_resi_demand_dict m
ic_resi_demand_dict m
left join ic_resi_demand_dict p
on(m.PARENT_CODE=p.CATEGORY_CODE
and p.CUSTOMER_ID=#{customerId})
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}

1
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java

@ -78,6 +78,7 @@ public interface UserResiInfoDao extends BaseDao<UserResiInfoEntity> {
* @date 2020/5/11 11:18
*/
IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO);
IssueInitiatorResultDTO issueInitiatorByBaseInfo(IssueInitiatorFormDTO formDTO);
/**
* @param userId

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

@ -54,6 +54,7 @@ import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.result.demand.IcResiDemandDictDTO;
import com.epmet.entity.IcResiUserEntity;
import com.epmet.entity.IcUserChangeDetailedEntity;
import com.epmet.entity.IcUserChangeRecordEntity;
@ -499,14 +500,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
// 查询列表展示项需要用到哪些子表
Result<List<SubTableJoinDTO>> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO1);
List<SubTableJoinDTO> subTables =subTablesRes.getData();
log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
// log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
//关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重
Set<String> whereConditionTables=formDTO.getConditions().stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
Set<String> tables=new HashSet<>();
tables.addAll(whereConditionTables);
tables.addAll(resultColumnTables);
log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
// log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
//最终关联的子表对应的sql:
List<String> finalSubTables =new ArrayList<>();
subTables.forEach(subTable->{
@ -560,6 +561,16 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds,formDTO.getCustomerId());
List<HouseInfoDTO> houseInfoDTOList = houseInfoRes.success() && !CollectionUtils.isEmpty(houseInfoRes.getData()) ? houseInfoRes.getData() : new ArrayList<>();
Map<String, HouseInfoDTO> houseInfoMap = houseInfoDTOList.stream().collect(Collectors.toMap(HouseInfoDTO::getHomeId, Function.identity()));
//查询需求分类字典
UserDemandNameQueryFormDTO userDemandNameQueryFormDTO=new UserDemandNameQueryFormDTO();
userDemandNameQueryFormDTO.setCustomerId(formDTO.getCustomerId());
Result<List<IcResiDemandDictDTO>> demandNameRes=heartOpenFeignClient.queryDemandNames(userDemandNameQueryFormDTO);
if(!demandNameRes.success()||CollectionUtils.isEmpty(demandNameRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(),"获取需求分类字典表数据异常",EpmetErrorCode.SERVER_ERROR.getMsg());
}
Map<String,IcResiDemandDictDTO> demandDictMap=demandNameRes.getData().stream().collect(Collectors.toMap(IcResiDemandDictDTO::getCategoryCode,Function.identity()));
for (Map<String, Object> resultMap : list) {
String gridIdValue = null != resultMap.get(UserConstant.GRID_ID) ? resultMap.get(UserConstant.GRID_ID).toString() : StrConstant.EPMETY_STR;
resultMap.put("GRID_ID_VALUE", gridIdValue);
@ -596,7 +607,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
resultMap.put(UserConstant.HOME_ID, neighBorName.concat(buildName).concat(unitName).concat(doorName));
resultMap.put("CATEGORY_NAME",queryUserDemandName(formDTO.getCustomerId(),(String) resultMap.get("icResiUserId")));
resultMap.put("CATEGORY_NAME",queryUserDemandName((String) resultMap.get("icResiUserId"),demandDictMap));
}
if (resultMap.containsKey(UserConstant.GENDER)) {
@ -614,32 +625,34 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return new PageData<>(pageInfo.getList(), pageInfo.getTotal());
}
private String queryUserDemandName(String customerId,String icResiUserId) {
private String queryUserDemandName(String icResiUserId,Map<String,IcResiDemandDictDTO> demandDictMap) {
// epmet_user.ic_resi_demand.category_code存储的值为 分类编码的全路径,eg:
// 1003,10030002
// 1012,10120003
// 1016,10160003
Set<String> demandCodePath=baseDao.selectUserDemandCode(icResiUserId);
if(CollectionUtils.isEmpty(demandCodePath)){
return StrConstant.EPMETY_STR;
}
Set<String> codeSet=new HashSet<>();
List<String> nameList=new ArrayList<>();
for(String codePath:demandCodePath){
if(codePath.contains(StrConstant.COMMA)){
String[] codeAtt=codePath.split(StrConstant.COMMA);
codeSet.add(codeAtt[codeAtt.length-1]);
String code=codeAtt[codeAtt.length-1];
if(StringUtils.isNotBlank(code)&&demandDictMap.containsKey(code)){
nameList.add(demandDictMap.get(code).getParentName());
}
}else{
codeSet.add(codePath);
if(StringUtils.isNotBlank(codePath)&&demandDictMap.containsKey(codePath)){
nameList.add(demandDictMap.get(codePath).getParentName());
}
}
}
String demandName="";
// String demandName=baseDao.selectCategoryNames(customerId,codeSet);
UserDemandNameQueryFormDTO userDemandNameQueryFormDTO=new UserDemandNameQueryFormDTO();
userDemandNameQueryFormDTO.setCustomerId(customerId);
userDemandNameQueryFormDTO.setCodeSet(codeSet);
Result<String> demandNameRes=heartOpenFeignClient.queryDemandNames(userDemandNameQueryFormDTO);
if(demandNameRes.success()){
demandName=demandNameRes.getData();
}
String demandName=String.join(StrConstant.COMMA_ZH,nameList);
return demandName;
}
/**
* 编辑页面显示居民信息详情
*

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -387,7 +387,9 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
*/
@Override
public IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO) {
return userResiInfoDao.selectIssueInitiator(formDTO);
//return userResiInfoDao.selectIssueInitiator(formDTO);
//市北赋能平台查询议题创建人姓名,因没有上传userWechat表 所以改去userbaseinfo表查询
return userResiInfoDao.issueInitiatorByBaseInfo(formDTO);
}
/**

28
epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml

@ -168,6 +168,34 @@
AND uw.del_flag = 0
</select>
<select id="issueInitiatorByBaseInfo" parameterType="com.epmet.dto.form.IssueInitiatorFormDTO" resultType="com.epmet.dto.result.IssueInitiatorResultDTO">
SELECT
CONCAT(
uri.street,
'-',
uri.surname,
CASE
WHEN uri.GENDER = '1' THEN
'先生'
WHEN uri.GENDER = '2' THEN
'女士'
ELSE
'先生/女士'
END
) AS issueInitiator,
CONCAT(
uri.street,
'-',
uri.surname,
uri.NAME
) AS realUserName
FROM
user_base_info uri
WHERE
uri.user_id = #{userId}
AND uri.del_flag = 0
</select>
<!-- 根据要用户id,查询用户注册的信息 -->
<select id="selectByUserId" resultType="com.epmet.dto.UserResiInfoDTO">
SELECT

Loading…
Cancel
Save