Browse Source

Merge branch 'dev_ic_data' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_ic_data

master
wangxianzhang 4 years ago
parent
commit
d21721c227
  1. 13
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java
  2. 3
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java
  3. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  4. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java
  5. 21
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java
  6. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  7. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  8. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  9. 26
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  10. 22
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

13
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDataDTO.java

@ -0,0 +1,13 @@
package com.epmet.dto.result.demand;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
@Data
public class DemandDataDTO implements Serializable {
private String firstCategoryCode;
private String firstCategoryName;
private List<IcResiUserReportDemandRes> demandList;
}

3
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandResearchAnalysisResultDTO.java

@ -20,8 +20,7 @@ public class DemandResearchAnalysisResultDTO implements Serializable {
private String houseId;
private List<HouseUserDTO> houseUserList;
private List<IcResiUserReportDemandRes> demandList;
private List<DemandDataDTO> demandData;
/**
* 入参中给的再返回去
*/

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -574,6 +574,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
IcResiUserBriefDTO icResiUserDTO = userRes.getData();
DemandResearchAnalysisResultDTO resultDTO = ConvertUtils.sourceToTarget(icResiUserDTO, DemandResearchAnalysisResultDTO.class);
resultDTO.setEpmetUserIdList(CollectionUtils.isNotEmpty(formDTO.getEpmetUserIdList()) ? formDTO.getEpmetUserIdList() : Collections.emptyList());
//返参格式套一层类别和类别名称
List<DemandDataDTO> demandData=new ArrayList<>();
DemandDataDTO demandDataDTO=new DemandDataDTO();
demandDataDTO.setFirstCategoryCode(formDTO.getFirstCategoryCode());
demandDataDTO.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),formDTO.getFirstCategoryCode()));
demandDataDTO.setDemandList(new ArrayList<>());
demandData.add(demandDataDTO);
//获取当前需求人,相同分类的需求列表。不分页,直接返回所有
List<String> userIds=new ArrayList<>();
userIds.add(formDTO.getIcResiUserId());
@ -604,8 +613,9 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
//一级分类名称
resDto.setFirstCategoryName(demandDictService.getCategoryName(formDTO.getCustomerId(),resDto.getFirstCategoryCode()));
}
resultDTO.setDemandList(CollectionUtils.isNotEmpty(demandList) ? demandList : Collections.emptyList());
demandData.get(NumConstant.ZERO).setDemandList(CollectionUtils.isNotEmpty(demandList) ? demandList : Collections.emptyList());
}
resultDTO.setDemandData(demandData);
return resultDTO;
}

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyGridList.java

@ -40,5 +40,17 @@ public class AgencyGridList implements Serializable {
* 机关-网格名称
*/
private String agencyGridName = "";
/**
* 网格名称
*/
private String gridName = "";
/**
* 网格经度网格没有经纬度时获取客户根组织下的
*/
private String longitude = "";
/**
* 网格维度网格没有经纬度时获取客户根组织下的
*/
private String latitude = "";
}

21
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java

@ -30,23 +30,22 @@ import java.io.Serializable;
*/
@Data
public class AgencyResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 机关组织Id
*/
//机关组织Id
private String agencyId = "";
/**
* 机关组织名称
*/
//机关组织名称
private String agencyName = "";
//上级组织id
private String pid;
//组织级别
private String level;
/**
* 所有上级组织机构ID(以英文:隔开)
*/
//所有上级组织机构ID(以英文:隔开)
@JsonIgnore
private String pids = "";
//经度【没值则取跟客户的值】
private String longitude;
//维度【没值则取跟客户的值】
private String latitude;
}

10
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -309,4 +309,14 @@ public class CustomerGridController {
List<CustomerGridDTO> resultDTOS = customerGridService.getGridIListByAgency(agencyId);
return new Result<List<CustomerGridDTO>>().ok(resultDTOS);
}
/**
* @Author sun
* @Description 查询组织直属网格列表
**/
@PostMapping("getGridIListByAgency/{agencyId}")
public Result<List<AgencyGridList>> gridListByAgencyId(@PathVariable("agencyId") String agencyId) {
return new Result<List<AgencyGridList>>().ok(customerGridService.gridListByAgencyId(agencyId));
}
}

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -348,4 +348,10 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @Date 2021/11/29 17:00
*/
List<CustomerGridDTO> getGridIListByAgency(String agencyId);
/**
* @Author sun
* @Description 查询组织直属网格列表
**/
List<AgencyGridList> gridListByAgencyId(String agencyId);
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -22,7 +22,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
@ -47,7 +46,6 @@ import com.epmet.entity.CustomerGridEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.send.SendMqMsgUtil;
import com.epmet.service.CustomerAgencyService;
import com.epmet.service.CustomerGridService;
import com.epmet.util.ModuleConstant;
@ -866,4 +864,14 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
return ConvertUtils.sourceToTarget(list, CustomerGridDTO.class);
}
/**
* @Author sun
* @Description 查询组织直属网格列表
**/
@Override
public List<AgencyGridList> gridListByAgencyId(String agencyId) {
List<AgencyGridList> result = baseDao.selectAgencyGridMsgList(agencyId);
return result;
}
}

26
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml

@ -340,11 +340,27 @@
<select id="selectAgencyByStaffId" resultType="com.epmet.dto.result.AgencyResultDTO">
SELECT
ca.id AS "agencyId",
ca.organization_name AS "agencyName",
ca.pids AS "pids",
ca.PID AS pid,
ca.LEVEL
ca.id agencyId,
ca.organization_name agencyName,
ca.pids pids,
ca.pid pid,
ca.level level,
( CASE WHEN ca.longitude is null THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE ca.longitude
END
) longitude,
( CASE WHEN ca.latitude is null THEN
( SELECT latitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE ca.latitude
END
) latitude
FROM
customer_agency ca
INNER JOIN customer_staff_agency csa ON ca.id = csa.agency_id

22
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -389,12 +389,30 @@
<select id="selectAgencyGridMsgList" resultType="com.epmet.dto.result.AgencyGridList">
SELECT
cg.id AS "gridId",
cg.id gridId,
CONCAT(
ca.organization_name,
"-",
cg.grid_name
) "agencyGridName"
) agencyGridName,
cg.grid_name gridName,
<!-- 网格没有经纬度时获取客户根组织下的 -->
( CASE WHEN cg.longitude is null THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE cg.longitude
END
) longitude,
( CASE WHEN cg.latitude is null THEN
( SELECT latitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = ca.id)
ORDER BY pid ASC LIMIT 1
)
ELSE cg.latitude
END
) latitude
FROM
customer_grid cg
INNER JOIN customer_agency ca ON cg.pid = ca.id

Loading…
Cancel
Save