Browse Source

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

master
wxz 2 years ago
parent
commit
1f5cde1fb4
  1. 26
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventAnalysisResultDTO.java
  2. 98
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  3. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
  4. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
  5. 14
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  6. 30
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  7. 6
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java
  8. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java
  9. 25
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java
  10. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  11. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  12. 73
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

26
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventAnalysisResultDTO.java

@ -25,29 +25,41 @@ public class EventAnalysisResultDTO implements Serializable {
* 网格化平台数量
*/
private Integer wangGeHua;
/**
* 归档数量
* 待处理
*/
private Integer guiDang;
private Integer daiChuLi;
/**
* 红灯占比
* 待处理占比
*/
private Double daiChuLiRate;
/**
* 黄灯占比
* 处理中
*/
private Integer chuLiZhong;
/**
* 处理中占比
*/
private Double chuLiZhongRate;
/**
* 已结案数量
*/
private Integer yiJieAn;
/**
* 蓝灯占比
* 已结案占比
*/
private Double yiJieAnRate;
/**
* 归档数量
*/
private Integer guiDang;
/**
* 归档占比
*/
private Double guiDangRate;
}

98
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java

@ -62,6 +62,7 @@ public class IcEventController {
/**
* 事件管理-列表
*
* @param tokenDto
* @param formDTO
* @return
@ -72,6 +73,7 @@ public class IcEventController {
formDTO.setStaffId(tokenDto.getUserId());
return new Result<PageData<IcEventListResultDTO>>().ok(icEventService.list(formDTO));
}
/**
* @Author sun
* @Description 工作端小程序-事件管理-列表
@ -84,28 +86,29 @@ public class IcEventController {
return new Result<PageData<IcEventListResultDTO>>().ok(icEventService.list(formDTO));
}
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET})
public Result<IcEventDTO> get(@PathVariable("id") String id){
@RequestMapping(value = "{id}", method = {RequestMethod.POST, RequestMethod.GET})
public Result<IcEventDTO> get(@PathVariable("id") String id) {
IcEventDTO data = icEventService.get(id);
return new Result<IcEventDTO>().ok(data);
}
/**
* 事件管理-新增
*
* @param tokenDto
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("add")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO){
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcEventAddEditFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setApp(tokenDto.getApp());
formDTO.setClient(tokenDto.getClient());
if("3".equals(formDTO.getOperationType())){
ValidatorUtils.validateEntity(formDTO.getIssueInfo(),IcEventToIssueFormDTO.AddEventAndShiftIssue.class);
if ("3".equals(formDTO.getOperationType())) {
ValidatorUtils.validateEntity(formDTO.getIssueInfo(), IcEventToIssueFormDTO.AddEventAndShiftIssue.class);
}
icEventService.save(formDTO);
return new Result();
@ -113,7 +116,7 @@ public class IcEventController {
@NoRepeatSubmit
@PostMapping("update")
public Result update(@RequestBody IcEventDTO dto){
public Result update(@RequestBody IcEventDTO dto) {
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
icEventService.update(dto);
@ -121,7 +124,7 @@ public class IcEventController {
}
@PostMapping("delete")
public Result delete(@RequestBody String[] ids){
public Result delete(@RequestBody String[] ids) {
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
icEventService.delete(ids);
@ -130,6 +133,7 @@ public class IcEventController {
/**
* 事件处理分析-处理状态比例查询
*
* @param formDTO
* @return
*/
@ -148,6 +152,7 @@ public class IcEventController {
/**
* 事件处理分析-事件列表
*
* @param input
* @return
*/
@ -169,6 +174,7 @@ public class IcEventController {
/**
* 时间处理分析-阅读增量查询
*
* @param input
* @return
*/
@ -190,6 +196,7 @@ public class IcEventController {
/**
* 研判分析查询
*
* @param eventId
* @return
*/
@ -201,6 +208,7 @@ public class IcEventController {
/**
* 组织下分类下的事件列表
*
* @param input
* @return
*/
@ -212,16 +220,17 @@ public class IcEventController {
String orgType = input.getOrgType();
Integer pageNo = input.getPageNo();
Integer pageSize = input.getPageSize();
PageData<IcEventResultDTO> page = icEventService.getSameCategoryEvents(orgId, orgType, categroyPid, pageNo, pageSize);
PageData<IcEventResultDTO> page = icEventService.getSameCategoryEvents(orgId, orgType, categroyPid, pageNo, pageSize);
return new Result<PageData<IcEventResultDTO>>().ok(page);
}
/**
* @Author sun
* @Description 事件管理-回复
**/
@NoRepeatSubmit
@PostMapping("reply")
public Result reply(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO){
public Result reply(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
@ -235,12 +244,12 @@ public class IcEventController {
**/
@NoRepeatSubmit
@PostMapping("icEventToProject")
public Result icEventToProject(@LoginUser TokenDto tokenDto, @RequestBody IcEventToProjectFormDTO formDTO){
public Result icEventToProject(@LoginUser TokenDto tokenDto, @RequestBody IcEventToProjectFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setApp(tokenDto.getApp());
formDTO.setClient(tokenDto.getClient());
ValidatorUtils.validateEntity(formDTO,IcEventToProjectFormDTO.ApprovalCategory.class,IcEventToProjectFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, IcEventToProjectFormDTO.ApprovalCategory.class, IcEventToProjectFormDTO.AddUserInternalGroup.class);
icEventService.icEventToProject(formDTO);
return new Result();
}
@ -250,7 +259,7 @@ public class IcEventController {
* @Description 事件管理-转需求
**/
@PostMapping("icEventToDemand")
public Result icEventToDemand(@LoginUser TokenDto tokenDto, @RequestBody IcDemandFormDTO formDTO){
public Result icEventToDemand(@LoginUser TokenDto tokenDto, @RequestBody IcDemandFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setDemandUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, IcDemandFormDTO.AddUserShowGroup.class, IcDemandFormDTO.AddUserInternalGroup.class);
@ -260,6 +269,7 @@ public class IcEventController {
/**
* 事件转议题
*
* @param tokenDto
* @param formDTO
* @return
@ -283,7 +293,7 @@ public class IcEventController {
public Result<List<IcEventCategoryAnalysisResDTO>> categoryAnalysisTotal(@LoginUser TokenDto tokenDto, @RequestBody IcEventCategoryAnalysisFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,IcEventCategoryAnalysisFormDTO.TotalPie.class);
ValidatorUtils.validateEntity(formDTO, IcEventCategoryAnalysisFormDTO.TotalPie.class);
List<IcEventCategoryAnalysisResDTO> list = icEventService.categoryAnalysisTotal(formDTO);
return new Result<List<IcEventCategoryAnalysisResDTO>>().ok(list);
}
@ -305,7 +315,7 @@ public class IcEventController {
* @Author sun
* @Description 事件管理-详情
**/
@MaskResponse(fieldNames = { "idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD })
@MaskResponse(fieldNames = {"idCard"}, fieldsMaskType = {MaskResponse.MASK_TYPE_ID_CARD})
@PostMapping("detail")
public Result<IcEventListResultDTO> detail(@LoginUser TokenDto tokenDto, @RequestBody IcEventListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
@ -313,6 +323,7 @@ public class IcEventController {
ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class);
return new Result<IcEventListResultDTO>().ok(icEventService.detail(formDTO));
}
/**
* @Author sun
* @Description 工作端小程序-事件管理-详情
@ -328,6 +339,7 @@ public class IcEventController {
/**
* 事件分类分析- 饼图2直属下级 事件数量
*
* @param tokenDto
* @param formDTO
* @return
@ -353,19 +365,20 @@ public class IcEventController {
/**
* Desc: 定时任务自动评价
*
* @param formDTO
* @author zxc
* @date 2022/5/18 16:35
*/
@PostMapping("auto-evaluation")
public Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO){
public Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO) {
icEventService.autoEvaluation(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 需求完成/项目结案时 修改事件数据
* @Description 需求完成/项目结案时 修改事件数据
* 议题关闭时如果议题来源于事件也会调用此方法
**/
@PostMapping("closeprojectordemand")
@ -376,6 +389,7 @@ public class IcEventController {
/**
* Desc: 新增随手拍
*
* @param tokenDto
* @param formDTO
* @author zxc
@ -383,7 +397,7 @@ public class IcEventController {
*/
@NoRepeatSubmit
@PostMapping("add-event-resi")
public Result addEventFromResi(@LoginUser TokenDto tokenDto,@RequestBody AddEventFromResiFormDTO formDTO){
public Result addEventFromResi(@LoginUser TokenDto tokenDto, @RequestBody AddEventFromResiFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AddEventFromResiFormDTO.AddEventFromResiForm.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
@ -394,6 +408,7 @@ public class IcEventController {
/**
* 居民端小程序我上报的事件-列表+详情
* yapi: http://yapi.elinkservice.cn/project/102/interface/api/7781
*
* @param tokenDto
* @param formDTO
* @return
@ -408,6 +423,7 @@ public class IcEventController {
/**
* 居民端我上报的事件 消息列表跳转详情
*
* @param tokenDto
* @param formDTO
* @return
@ -423,20 +439,22 @@ public class IcEventController {
/**
* 居民端小程序我上报的事件详情页面-回复列表
* http://yapi.elinkservice.cn/project/102/interface/api/7783
*
* @param formDTO
* @return
*/
@PostMapping("reply-list")
public Result<List<IcEventReplyDTO>> replyList(@LoginUser TokenDto tokenDto,@RequestBody MyReportIcEvFormDTO formDTO) {
public Result<List<IcEventReplyDTO>> replyList(@LoginUser TokenDto tokenDto, @RequestBody MyReportIcEvFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, MyReportIcEvFormDTO.ReplyListGroup.class);
return new Result<List<IcEventReplyDTO>>().ok(icEventReplyService.replyList(formDTO.getIcEventId(),formDTO.getUserId()));
return new Result<List<IcEventReplyDTO>>().ok(icEventReplyService.replyList(formDTO.getIcEventId(), formDTO.getUserId()));
}
/**
* 居民端小程序我上报的事件-处理中
* 点击事件进入详情页时调用此接口消除红点
* yapihttp://yapi.elinkservice.cn/project/102/interface/api/7790
*
* @param tokenDto
* @param formDTO
* @return
@ -452,23 +470,24 @@ public class IcEventController {
/**
* 居民端我上报的事件-回复
* http://yapi.elinkservice.cn/project/102/interface/api/7789
*
* @param tokenDto
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("resi-reply")
public Result resiReply(@LoginUser TokenDto tokenDto, @RequestBody ResiReplyIcEventFormDTO formDTO){
public Result resiReply(@LoginUser TokenDto tokenDto, @RequestBody ResiReplyIcEventFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ResiReplyIcEventFormDTO.AddUserShowGroup.class,ResiReplyIcEventFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, ResiReplyIcEventFormDTO.AddUserShowGroup.class, ResiReplyIcEventFormDTO.AddUserInternalGroup.class);
icEventService.resiReply(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 数字平台-事件导出
* @Description 数字平台-事件导出
**/
@NoRepeatSubmit
@PostMapping("export")
@ -487,8 +506,8 @@ public class IcEventController {
List<IcEventExcel> list = null;
do {
data = icEventService.list(formDTO);
data.getList().forEach(d->{
if(!org.springframework.util.CollectionUtils.isEmpty(d.getImageList())){
data.getList().forEach(d -> {
if (!org.springframework.util.CollectionUtils.isEmpty(d.getImageList())) {
d.setImageUrl(d.getImageList().get(NumConstant.ZERO));
}
});
@ -501,7 +520,7 @@ public class IcEventController {
response.setCharacterEncoding("UTF-8");
response.setHeader("content-type", "application/json; charset=UTF-8");
PrintWriter printWriter = response.getWriter();
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),e.getMsg());
Result<Object> result = new Result<>().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), e.getMsg());
printWriter.write(JSON.toJSONString(result));
printWriter.close();
} catch (Exception e) {
@ -515,7 +534,7 @@ public class IcEventController {
/**
* @Author sun
* @Description 工作端事件红点消除
* @Description 工作端事件红点消除
**/
@PostMapping("govRedDot")
public Result govRedDot(@RequestBody IcEventListFormDTO formDTO) {
@ -526,7 +545,7 @@ public class IcEventController {
/**
* @Author sun
* @Description 标记事件为难点堵点
* @Description 标记事件为难点堵点
**/
@PostMapping("difficultpointevent")
public Result difficultPointEvent(@RequestBody IcEventListFormDTO formDTO) {
@ -537,6 +556,7 @@ public class IcEventController {
/**
* 数据分析-个人档案-上报事件列表,根据epmetUserIdList查询
* 模仿gov/project/resieventreply/pageuserreported接口重新查询新表接口
*
* @author sun
*/
@PostMapping("icevent-pageuserreported")
@ -560,23 +580,25 @@ public class IcEventController {
}
/**
* @description 获取事件数量和分类数量
* @param * @param null
* @return Result
* @throws
* @author yan Lu
* @date 2023/5/17 14:49
*/
* @param * @param null
* @return Result
* @throws
* @description 获取事件数量和分类数量
* @author yan Lu
* @date 2023/5/17 14:49
*/
@GetMapping("getEventRate")
public Result<EventRateResultDTO> getEventRate(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType){
return new Result<EventRateResultDTO>().ok(icEventService.getEventRate(orgId,orgType));
@RequestParam("orgType") String orgType,
@RequestParam("eventType") String eventType) {
return new Result<EventRateResultDTO>().ok(icEventService.getEventRate(orgId, orgType, eventType));
}
@GetMapping("getEventAnalysis")
public Result<EventAnalysisResultDTO> getEventAnalysis(@RequestParam("orgId") String orgId,
@RequestParam("orgType") String orgType){
return new Result<EventAnalysisResultDTO>().ok(icEventService.getEventAnalysis(orgId,orgType));
@RequestParam("orgType") String orgType,
@RequestParam("eventType") String eventType) {
return new Result<EventAnalysisResultDTO>().ok(icEventService.getEventAnalysis(orgId, orgType, eventType));
}
}

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java

@ -148,12 +148,12 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
List<PageUserReportEventResDTO> selectUserReported(PageUserReportEventFormDTO formDTO);
EventRateResultDTO getEventRate(@Param("orgIdPath") String orgIdPath);
EventRateResultDTO getEventRate(@Param("orgIdPath") String orgIdPath, @Param("eventType") String eventType);
EventAnalysisResultDTO getEventAnalysis(@Param("orgIdPath") String orgPath);
EventAnalysisResultDTO getEventAnalysis(@Param("orgIdPath") String orgPath, @Param("eventType") String eventType);
@MapKey("code")
List<Map<String,Integer>> getAnalysis(@Param("orgIdPath") String orgPath);
List<Map<String, Integer>> getAnalysis(@Param("orgIdPath") String orgPath);
IcEventEntity selectByEventId(String icEventId);
}

4
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java

@ -257,7 +257,7 @@ public interface IcEventService extends BaseService<IcEventEntity> {
*
* @return
*/
EventRateResultDTO getEventRate(String orgId, String orgType);
EventRateResultDTO getEventRate(String orgId, String orgType, String eventType);
/**
* 事件分析数据获取
@ -266,5 +266,5 @@ public interface IcEventService extends BaseService<IcEventEntity> {
* @param orgType
* @return
*/
EventAnalysisResultDTO getEventAnalysis(String orgId, String orgType);
EventAnalysisResultDTO getEventAnalysis(String orgId, String orgType, String eventType);
}

14
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java

@ -1924,8 +1924,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
}
@Override
public EventRateResultDTO getEventRate(String orgId, String orgType) {
EventRateResultDTO erDto = baseDao.getEventRate(getOrgPath(orgId, orgType));//事件总量和灯数量,占比
public EventRateResultDTO getEventRate(String orgId, String orgType,String eventType) {
EventRateResultDTO erDto = baseDao.getEventRate(getOrgPath(orgId, orgType), eventType);//事件总量和灯数量,占比
List<Map<String, Integer>> dataMap = baseDao.getAnalysis(getOrgPath(orgId, orgType));//按分类获取数量
Map<String, Integer> temp = new HashMap<>();
if (null != dataMap && dataMap.size() > 0) {
@ -1956,10 +1956,14 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
}
@Override
public EventAnalysisResultDTO getEventAnalysis(String orgId, String orgType) {
public EventAnalysisResultDTO getEventAnalysis(String orgId, String orgType, String eventType) {
String orgPath = getOrgPath(orgId, orgType);
EventRateResultDTO erDto = baseDao.getEventRate(orgPath);//事件总量和灯数量,占比
EventAnalysisResultDTO dto = baseDao.getEventAnalysis(orgPath);
EventRateResultDTO erDto = baseDao.getEventRate(orgPath, eventType);//事件总量和灯数量,占比
EventAnalysisResultDTO dto = baseDao.getEventAnalysis(orgPath, eventType);
dto.setDaiChuLi(erDto.getHongDeng());
dto.setChuLiZhong(erDto.getHuangDeng());
dto.setYiJieAn(erDto.getLanDeng());
dto.setGuiDang(erDto.getGuiDang());
dto.setDaiChuLiRate(erDto.getHongDengRate() == null ? 0 : erDto.getHongDengRate());
dto.setChuLiZhongRate(erDto.getHuangDengRate() == null ? 0 : erDto.getHuangDengRate());
dto.setYiJieAnRate(erDto.getLanDengRate() == null ? 0 : erDto.getLanDengRate());

30
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml

@ -467,24 +467,36 @@
<if test="null != orgIdPath and orgIdPath != ''">
and b.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
<if test="null != eventType and eventType !=''">
AND b.SOURCE_TYPE = #{eventType}
</if>
) eb,
( SELECT SUM( CASE WHEN c.OPERATION_TYPE = 0 THEN 1 ELSE 0 END ) AS huang
FROM ic_event c WHERE c.DEL_FLAG = 0 and c.STATUS = 'processing'
<if test="null != orgIdPath and orgIdPath != ''">
and c.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
<if test="null != eventType and eventType !=''">
AND c.SOURCE_TYPE = #{eventType}
</if>
) ec,
( SELECT SUM( CASE WHEN d.OPERATION_TYPE = 0 THEN 1 ELSE 0 END ) as lan
FROM ic_event d WHERE d.DEL_FLAG = 0 and d.STATUS = 'closed_case'
<if test="null != orgIdPath and orgIdPath != ''">
and d.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
<if test="null != eventType and eventType !=''">
AND d.SOURCE_TYPE = #{eventType}
</if>
) ed,
( SELECT SUM( CASE WHEN d.DIFFICULT_POINT = 1 and d.OPERATION_TYPE = 0 THEN 1 ELSE 0 END) as dang
( SELECT SUM( CASE WHEN d.DIFFICULT_POINT = 1 THEN 1 ELSE 0 END) as dang
FROM ic_event d WHERE d.DEL_FLAG = 0
<if test="null != orgIdPath and orgIdPath != ''">
and d.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
<if test="null != eventType and eventType !=''">
AND d.SOURCE_TYPE = #{eventType}
</if>
) ee
</select>
@ -492,10 +504,13 @@
SELECT
ea.total AS jiSuJiBan,
eb.total AS zhiTongLianBan,
ec.total AS wangGeHua
ec.total AS wangGeHua,
ed.total AS guiDang
FROM
(
SELECT COUNT( e.id ) AS total FROM ic_event e
SELECT COUNT( e.id ) AS total
FROM ic_event e
WHERE e.DEL_FLAG = 0 AND e.SOURCE_TYPE = 0 AND ( e.OPERATION_TYPE = 0 OR e.OPERATION_TYPE IS NULL )
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
@ -514,7 +529,14 @@
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) ec
) ec,
(
SELECT COUNT( e.id ) AS total FROM ic_event e
WHERE e.DEL_FLAG = 0 AND e.DIFFICULT_POINT = 1 AND ( e.OPERATION_TYPE = 0 OR e.OPERATION_TYPE IS NULL )
<if test="null != orgIdPath and orgIdPath != ''">
and e.GRID_PIDS like concat(#{orgIdPath},'%')
</if>
) ed
</select>

6
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonDataFormDTO.java

@ -23,4 +23,10 @@ public class PersonDataFormDTO implements Serializable {
@NotBlank(message = "tokenDto获取customerId不能为空",groups = PersonDataForm.class)
private String customerId;
/**
* 灵山项目需求改造此接口添加houseId支持查询房屋里的所有人
* /epmetuser/icresiuser/ownerrelation接口userId与houseId至少传一个值
*/
private String houseId;
}

8
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcResiUserBriefDTO.java

@ -97,10 +97,14 @@ public class IcResiUserBriefDTO extends HouseUserDTO implements Serializable {
* 民族
*/
private String mz;
/**
* 因灵山项目添加此列
* 与户主关系存储字典纸
* 民族姓名
*/
private String mzName;
/**
* 因灵山项目添加此列
* 与户主关系存储字典/sys/dict/data/relationship
*/
private String yhzgx;

25
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/OwnerRelationResultDTO.java

@ -15,7 +15,18 @@ import java.util.List;
public class OwnerRelationResultDTO implements Serializable {
private static final long serialVersionUID = 2876258704168954941L;
/**
* 与户主关系是本人的居民
*/
private String ownerName;
/**
* 与户主关系是本人的居民id
*/
private String ownerUserId;
/**
* 房屋里的所有人
*/
private List<UserListBean> userList;
@NoArgsConstructor
@ -24,11 +35,25 @@ public class OwnerRelationResultDTO implements Serializable {
private String userId;
private String userName;
private String isSelf;
/**
* 与户主关系key字典表
*/
private String yhzgx;
/**
* 与户主关系名称
*/
private String relation;
/**
* 人户情况
*/
private String rhzk;
/**
* 2022.11.17人户状况人户一致人在户不在户在人不在暂不清楚
*/
private String renHuCondition;
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -859,7 +859,7 @@ public class IcResiUserController implements ResultDataResolver {
*/
@PostMapping("ownerrelation")
public Result<OwnerRelationResultDTO> getOwnerRelation(@RequestBody PersonDataFormDTO formDTO) {
return new Result<OwnerRelationResultDTO>().ok(icResiUserService.getOwnerRelation(formDTO.getUserId()));
return new Result<OwnerRelationResultDTO>().ok(icResiUserService.getOwnerRelation(formDTO.getUserId(),formDTO.getHouseId()));
}
/**

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -134,7 +134,7 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
* @Author zhaoqifeng
* @Date 2021/11/5 10:28
*/
OwnerRelationResultDTO getOwnerRelation(String userId);
OwnerRelationResultDTO getOwnerRelation(String userId,String houseId);
/**
* @Description 获取一栋楼每个房间人员分类的数量

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

@ -1550,41 +1550,65 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
* @Date 2021/11/5 10:28
*/
@Override
public OwnerRelationResultDTO getOwnerRelation(String userId) {
public OwnerRelationResultDTO getOwnerRelation(String userId,String houseId) {
if (StringUtils.isBlank(userId) && StringUtils.isBlank(houseId)) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "入参错误userId,houseId不能同时为空", "入参错误");
}
OwnerRelationResultDTO result = new OwnerRelationResultDTO();
//获取用户信息
IcResiUserEntity user = baseDao.selectById(userId);
result.setOwnerName("");
if (null != user) {
//获取用户所在家庭里所有人员信息
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, user.getHomeId());
wrapper.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
wrapper.orderByAsc(IcResiUserEntity::getYhzgx);
List<IcResiUserEntity> resiUserList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(resiUserList)) {
List<OwnerRelationResultDTO.UserListBean> userList = resiUserList.stream().map(item -> {
if(StringUtils.isBlank(houseId)){
//获取用户信息
IcResiUserEntity user = baseDao.selectById(userId);
if (null != user) {
houseId=user.getHomeId();
}
}
//获取用户所在家庭里所有人员信息
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getHomeId, houseId);
wrapper.eq(IcResiUserEntity::getStatus,NumConstant.ZERO_STR);
wrapper.orderByAsc(IcResiUserEntity::getYhzgx);
List<IcResiUserEntity> resiUserList = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(resiUserList)) {
//先找到户主:正常情况下只会有一个户主,所以找到之后,终止循环
for(IcResiUserEntity resiUserEntity:resiUserList){
//如果与房主的关系是本人,则这个人就是房主
if (RelationshipEnum.SELF.getCode().equals(resiUserEntity.getYhzgx())) {
result.setOwnerName(resiUserEntity.getName());
result.setOwnerUserId(resiUserEntity.getId());
break;
}
}
List<OwnerRelationResultDTO.UserListBean> userList=new ArrayList<>();
for(IcResiUserEntity item:resiUserList){
//成员里排除户主
if(!result.getOwnerUserId().equals(item.getId())){
OwnerRelationResultDTO.UserListBean bean = new OwnerRelationResultDTO.UserListBean();
bean.setUserId(item.getId());
bean.setUserName(item.getName());
bean.setYhzgx(item.getYhzgx());
bean.setRelation(RelationshipEnum.getEnum(item.getYhzgx()).getName());
if (userId.equals(item.getId())) {
bean.setIsSelf(NumConstant.ONE_STR);
}
//如果与房主的关系是本人,则这个人就是房主
if (RelationshipEnum.SELF.getCode().equals(item.getYhzgx())) {
result.setOwnerName(item.getName());
bean.setIsSelf(NumConstant.ZERO_STR);
// 与入参里的居民id对比
if (StringUtils.isNotBlank(userId)) {
if (userId.equals(item.getId())) {
bean.setIsSelf(NumConstant.ONE_STR);
}
}
//2022.11.17 返参增加人户状况名称
bean.setRhzk(item.getRhzk());
if (StringUtils.isBlank(item.getRhzk())){
bean.setRenHuCondition(RenHuConditionEnum.ZBQC.getName());
}else {
bean.setRenHuCondition(RenHuConditionEnum.getNameByCode(item.getRhzk()));
}
return bean;
}).collect(Collectors.toList());
result.setUserList(userList);
userList.add(bean);
}
}
result.setUserList(userList);
}
return result;
}
@ -1673,6 +1697,13 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
r.setGzdw(resiEntity.getGzdw());
// 因灵山项目添加一下几列 start
r.setMz(resiEntity.getMz());
Result<List<OptionResultDTO>> mzRes=epmetAdminOpenFeignClient.getNationOption();
if(mzRes.success()&&CollectionUtils.isNotEmpty(mzRes.getData())){
Map<String, String> mzMap = mzRes.getData().stream().collect(Collectors.toMap(OptionResultDTO::getValue, OptionResultDTO::getLabel));
if(MapUtils.isNotEmpty(mzMap)&&mzMap.containsKey(r.getMz())){
r.setMzName(mzMap.get(r.getMz()));
}
}
r.setYhzgx(resiEntity.getYhzgx());
r.setYhzgxName(StrConstant.EPMETY_STR);
Result<List<OptionResultDTO>> yhzgxRes=epmetAdminOpenFeignClient.getRelationshipOption();

Loading…
Cancel
Save