Browse Source

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

dev_shibei_match
wangxianzhang 4 years ago
parent
commit
7de4721f67
  1. 4
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java
  2. 5
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java
  3. 19
      epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java
  4. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java
  5. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java
  6. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java
  7. 4
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java
  8. 2
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml
  9. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java
  10. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java
  11. 15
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
  12. 23
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java
  13. 22
      epmet-module/epmet-heart/epmet-heart-server/pom.xml
  14. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  15. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  16. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyUnitDao.java
  17. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  18. 31
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java
  19. 104
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java
  20. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  21. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  22. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  23. 30
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  24. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml
  25. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml
  26. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  27. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  28. 4
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java
  29. 3
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java
  30. 4
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CategoryListResultDTO.java
  31. 4
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java
  32. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java
  33. 8
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  34. 30
      epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_colour.sql
  35. 4
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
  36. 2
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml
  37. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencySubResultDTO.java
  38. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java
  39. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java
  40. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java
  41. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  42. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  43. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java
  44. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java
  45. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java
  46. 90
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  47. 2
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

4
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java

@ -70,4 +70,8 @@ public interface ConsomerGroupConstants {
*/
String IC_WARN_STATS_EVENT_LISTENER_GROUP = "ic_warn_stats_event_listener_group";
/**
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
*/
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
}

5
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java

@ -53,4 +53,9 @@ public interface TopicConstants {
* 项目
*/
String IC_RESI_USER = "ic_resi_user";
/**
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
*/
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
}

19
epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/CalPartyUnitSatisfactionFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.commons.rocketmq.messages;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度,或者直接计算整个客户
*/
@Data
public class CalPartyUnitSatisfactionFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
@NotBlank(message = "客户id不能为空",groups = AddUserInternalGroup.class)
private String customerId;
private String partyUnitId;
}

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectCategoryDictDTO.java

@ -87,7 +87,7 @@ public class IssueProjectCategoryDictDTO implements Serializable {
/**
* 颜色
*/
private String colour;
private String color;
}

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectCategoryTotalResultDTO.java

@ -19,7 +19,7 @@ public class ProjectCategoryTotalResultDTO implements Serializable {
//一级分类名称
private String categoryName;
//一级分类颜色
private String colour = "";
private String color = "";
//分类下项目总数
private Integer total = 0;

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectStatusListResultDTO.java

@ -23,7 +23,7 @@ public class ProjectStatusListResultDTO implements Serializable {
//经度
private String longitude;
//纬度
private String dimension;
private String latitude;
//项目标题
private String title;

4
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java

@ -373,7 +373,7 @@ public class GovProjectServiceImpl implements GovProjectService {
if (ca.getCategoryCode().equals(l.getCategoryCode())) {
dto.setCategoryCode(ca.getCategoryCode());
dto.setCategoryName(ca.getCategoryName());
dto.setColour(ca.getColour());
dto.setColor(ca.getColor());
}
});
map.put(l.getCategoryCode(), l.getCategoryCode());
@ -385,7 +385,7 @@ public class GovProjectServiceImpl implements GovProjectService {
dto.setAgencyId(formDTO.getAgencyId());
dto.setCategoryCode(ca.getCategoryCode());
dto.setCategoryName(ca.getCategoryName());
dto.setColour(ca.getColour());
dto.setColor(ca.getColor());
resultList.add(dto);
map.put(ca.getCategoryCode(), ca.getCategoryCode());
}

2
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml

@ -163,7 +163,7 @@
origin origin,
`status` status,
locate_longitude longitude,
locate_dimension dimension,
locate_dimension latitude,
title title
FROM
project

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java

@ -116,6 +116,6 @@ public class IssueProjectCategoryDictDTO implements Serializable {
/**
* 颜色
*/
private String colour;
private String color;
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java

@ -83,6 +83,6 @@ public class IssueProjectCategoryDictEntity extends BaseEpmetEntity {
/**
* 颜色
*/
private String colour;
private String color;
}

15
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java

@ -0,0 +1,15 @@
package com.epmet.dto.result.demand;
import lombok.Data;
import java.io.Serializable;
/**
* 完成需求时是否需要计算 区域化党建单位的满意度
*
*/
@Data
public class FinishResultDTO implements Serializable {
private Boolean sendCalStatisfaction;
private String partyUnitId;
}

23
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceStatDTO.java

@ -0,0 +1,23 @@
package com.epmet.dto.result.demand;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class ServiceStatDTO implements Serializable {
/**
* 服务方id
*/
private String serverId;
/**
* 总分
*/
private BigDecimal totalScore;
/**
* 服务的需求个数
*/
private Integer demandCount;
}

22
epmet-module/epmet-heart/epmet-heart-server/pom.xml

@ -88,6 +88,12 @@
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
<!--rocketmq-->
<dependency>
<groupId>com.epmet</groupId>
<artifactId>epmet-commons-rocketmq</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
<build>
@ -152,6 +158,10 @@
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
</properties>
</profile>
<profile>
@ -195,6 +205,10 @@
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>false</rocketmq.enable>
<rocketmq.nameserver>192.168.1.140:9876;192.168.1.141:9876</rocketmq.nameserver>
</properties>
</profile>
<profile>
@ -238,6 +252,10 @@
<!--测试钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=e894e5690f9d6a527722974c71548ff6c0fe29bd956589a09e21b16442a35ed4</dingTalk.robot.webHook>
<dingTalk.robot.secret>SECfcc020bdc83bb17a2c00f39977b1fbc409ef4188c7beaea11c5caa90eeaf87fd</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.10.161:9876</rocketmq.nameserver>
</properties>
</profile>
<profile>
@ -281,6 +299,10 @@
<!--生产钉钉 机器人地址-->
<dingTalk.robot.webHook>https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c</dingTalk.robot.webHook>
<dingTalk.robot.secret>SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1</dingTalk.robot.secret>
<!--rocketmq-->
<rocketmq.enable>true</rocketmq.enable>
<rocketmq.nameserver>192.168.11.187:9876;192.168.11.184:9876</rocketmq.nameserver>
</properties>
</profile>
</profiles>

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -17,6 +17,7 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
@ -179,4 +180,18 @@ public class IcPartyUnitController {
ValidatorUtils.validateEntity(formDTO);
return new Result<List<PartyUnitDistributionResultDTO>>().ok(icPartyUnitService.distribution(formDTO));
}
/**
* 计算区域化党建单位的群众满意度
*
* @param formDTO
* @return
*/
@PostMapping("cal-partyunit-satisfation")
public Result calPartyUnitSatisfation(@RequestBody CalPartyUnitSatisfactionFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,CalPartyUnitSatisfactionFormDTO.AddUserInternalGroup.class);
icPartyUnitService.calPartyUnitSatisfation(formDTO);
return new Result();
}
}

22
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java

@ -17,15 +17,23 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.FinishResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -60,7 +68,8 @@ public class IcUserDemandRecController {
private IcCommunitySelfOrganizationService icCommunitySelfOrganizationService;
@Autowired
private IcPartyUnitService icPartyUnitService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* 根据服务方类型查询 下拉框
@ -179,7 +188,16 @@ public class IcUserDemandRecController {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.AddUserShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class);
icUserDemandRecService.finish(formDTO);
FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO);
if(finishResultDTO.getSendCalStatisfaction()){
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getPartyUnitId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
}
return new Result();
}

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

@ -25,6 +25,7 @@ import com.epmet.entity.IcPartyUnitEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
@ -63,4 +64,6 @@ public interface IcPartyUnitDao extends BaseDao<IcPartyUnitEntity> {
* @Date 2021/12/9 14:24
*/
List<PartyUnitDistributionResultDTO> getDistribution(@Param("agencyId")String agencyId);
int updateSatisfaction(@Param("partyUnitId") String serverId, @Param("satisfaction") BigDecimal satisfaction);
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java

@ -22,6 +22,9 @@ import com.epmet.dto.form.demand.IcResiUserDemandFromDTO;
import com.epmet.dto.form.demand.PageListAnalysisFormDTO;
import com.epmet.dto.form.demand.UserDemandPageFormDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.entity.IcUserDemandRecEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -81,4 +84,6 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
@Param("gridPids") String gridPids,
@Param("startDateId") String startDateId,
@Param("endDateId") String endDateId);
List<ServiceStatDTO> selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId);
}

31
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java

@ -0,0 +1,31 @@
package com.epmet.mq;
import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants;
import com.epmet.commons.rocketmq.constants.TopicConstants;
import com.epmet.commons.rocketmq.register.MQAbstractRegister;
import com.epmet.commons.rocketmq.register.MQConsumerProperties;
import com.epmet.mq.listener.PartyUnitSatisfactionCalEventListener;
import org.apache.rocketmq.common.protocol.heartbeat.MessageModel;
import org.springframework.stereotype.Component;
/**
* @Description 如果rocketmq.enable=true这里必须实现 实例化
* @author wxz
* @date 2021.07.14 17:13:41
*/
@Component
public class RocketMQConsumerRegister extends MQAbstractRegister {
@Override
public void registerAllListeners(String env, MQConsumerProperties consumerProperties) {
// 客户初始化监听器注册
register(consumerProperties,
ConsomerGroupConstants.CAL_PARTY_UNIT_SATISFACTION,
MessageModel.CLUSTERING,
TopicConstants.CAL_PARTY_UNIT_SATISFACTION,
"*",
new PartyUnitSatisfactionCalEventListener());
// ...其他监听器类似
}
}

104
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/mq/listener/PartyUnitSatisfactionCalEventListener.java

@ -0,0 +1,104 @@
package com.epmet.mq.listener;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.rocketmq.constants.MQUserPropertys;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.service.IcPartyUnitService;
import org.apache.commons.lang.StringUtils;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext;
import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
import org.apache.rocketmq.common.message.MessageExt;
import org.redisson.api.RLock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @Description 计算区域化党建单位群众满意度=分数相加 需求的总个数
* @author wxz
* @date 2021.10.13 15:21:48
*/
public class PartyUnitSatisfactionCalEventListener implements MessageListenerConcurrently {
private Logger logger = LoggerFactory.getLogger(getClass());
private RedisUtils redisUtils;
@Override
public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, ConsumeConcurrentlyContext context) {
if (redisUtils == null) {
redisUtils = SpringContextUtils.getBean(RedisUtils.class);
}
try {
msgs.forEach(msg -> consumeMessage(msg));
} catch (Exception e) {
logger.error(ExceptionUtils.getErrorStackTrace(e));
return ConsumeConcurrentlyStatus.RECONSUME_LATER;
}
return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
}
private void consumeMessage(MessageExt messageExt) {
// msg即为消息体
// tags为SystemMessageType.java中的项,为具体的操作,此处拿到tags,判断是创建还是变更,来做响应的后续操作即可
String msg = new String(messageExt.getBody());
String topic = messageExt.getTopic();
String tags = messageExt.getTags();
String pendingMsgLabel = messageExt.getUserProperty(MQUserPropertys.BLOCKED_MSG_LABEL);
logger.info("【计算区域化党建单位群众满意度事件监听器】-需求完成-收到消息内容:{},操作:{}", msg, tags);
CalPartyUnitSatisfactionFormDTO obj = JSON.parseObject(msg, CalPartyUnitSatisfactionFormDTO.class);
DistributedLock distributedLock = null;
RLock lock = null;
try {
distributedLock = SpringContextUtils.getBean(DistributedLock.class);
lock = distributedLock.getLock(String.format("lock:ic_warn_stats:%s", obj.getCustomerId()),
30L, 30L, TimeUnit.SECONDS);
//待执行方法
SpringContextUtils.getBean(IcPartyUnitService.class).calPartyUnitSatisfation(obj);
} catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【计算区域化党建单位群众满意度事件监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
} catch (Exception e) {
// 不是我们自己抛出的异常,可以让MQ重试
logger.error("【计算区域化党建单位群众满意度监听器】-MQ失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
throw e;
} finally {
distributedLock.unLock(lock);
}
if (StringUtils.isNotBlank(pendingMsgLabel)) {
try {
removePendingMqMsgCache(pendingMsgLabel);
} catch (Exception e) {
logger.error("【计算区域化党建单位群众满意度监听器】-删除mq阻塞消息缓存失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}
/**
* @description
*
* @param pendingMsgLabel
* @return
* @author wxz
* @date 2021.10.14 16:32:32
*/
private void removePendingMqMsgCache(String pendingMsgLabel) {
String key = RedisKeys.blockedMqMsgKey(pendingMsgLabel);
redisUtils.delete(key);
//logger.info("【开放数据事件监听器】删除mq阻塞消息缓存成功,blockedMsgLabel:{}", pendingMsgLabel);
}
}

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -19,6 +19,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.dto.result.OptionDataResultDTO;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
@ -141,4 +142,10 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
* @Date 2021/12/9 10:10
*/
List<PartyUnitDistributionResultDTO> distribution(PartyActivityFormDTO formDTO);
/**
* 计算区域化党建单位的群众满意度
* @param formDTO
*/
void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO);
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -24,7 +24,9 @@ import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.demand.CategoryAnalysisResDTO;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.DemandResearchAnalysisResultDTO;
import com.epmet.dto.result.demand.FinishResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.entity.IcUserDemandRecEntity;
import java.util.List;
@ -129,7 +131,7 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* 完成并评价
* @param formDTO
*/
void finish(FinishStaffFromDTO formDTO);
FinishResultDTO finish(FinishStaffFromDTO formDTO);
/**
* 数据分析-个人档案居民需求列表table
@ -169,4 +171,13 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
CategoryAnalysisResDTO categoryAnalysis(CategoryAnalysisFormDTO formDTO);
/**
* 计算出服务方评价总分服务的需求个数
*
* @param customerId
* @param partyUnitId
* @return
*/
List<ServiceStatDTO> groupByPartyUnit(String customerId, String partyUnitId);
}

24
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -18,9 +18,11 @@
package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
@ -46,6 +48,7 @@ import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO;
import com.epmet.dto.result.PartyUnitDistributionResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.entity.IcPartyUnitEntity;
import com.epmet.excel.IcPartyUnitImportExcel;
import com.epmet.feign.EpmetAdminOpenFeignClient;
@ -64,6 +67,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@ -111,6 +115,9 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
} else {
item.setServiceMatterList(new ArrayList<>());
}
if(StringUtils.isBlank(item.getSatisfaction())){
item.setSatisfaction(StrConstant.HYPHEN);
}
});
PageInfo<IcPartyUnitDTO> pageInfo = new PageInfo<>(dtoList);
return new PageData<>(dtoList, pageInfo.getTotal());
@ -426,6 +433,23 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
return list;
}
/**
* 计算区域化党建单位的群众满意度
* 总分需求个数
* @param formDTO
*/
@Override
public void calPartyUnitSatisfation(CalPartyUnitSatisfactionFormDTO formDTO) {
log.info("收到消息内容啦...." + JSON.toJSONString(formDTO));
List<ServiceStatDTO> list = icUserDemandRecService.groupByPartyUnit(formDTO.getCustomerId(), formDTO.getPartyUnitId());
for (ServiceStatDTO serviceStatDTO : list) {
if (0 != serviceStatDTO.getDemandCount()) {
BigDecimal result = serviceStatDTO.getTotalScore().divide(new BigDecimal(serviceStatDTO.getDemandCount()), 4, BigDecimal.ROUND_HALF_UP);
baseDao.updateSatisfaction(serviceStatDTO.getServerId(),result);
}
}
}
private String getServiceMatter(Map<String, String> map, String matter) {
List<String> matters = Arrays.asList(matter.split(StrConstant.COLON));
List<String> list = matters.stream().map(map::get).collect(Collectors.toList());

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

@ -46,6 +46,10 @@ import com.epmet.dto.form.demand.*;
import com.epmet.dto.result.AllGridsByUserIdResultDTO;
import com.epmet.dto.result.IcResiUserBriefDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.dto.result.demand.DemandRecResultDTO;
import com.epmet.dto.result.demand.FinishResultDTO;
import com.epmet.dto.result.demand.IcResiUserReportDemandRes;
import com.epmet.dto.result.demand.ServiceStatDTO;
import com.epmet.dto.result.demand.*;
import com.epmet.entity.*;
import com.epmet.feign.EpmetAdminOpenFeignClient;
@ -91,6 +95,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Override
public PageData<IcUserDemandRecDTO> page(Map<String, Object> params) {
IPage<IcUserDemandRecEntity> page = baseDao.selectPage(
@ -411,7 +416,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void finish(FinishStaffFromDTO formDTO) {
public FinishResultDTO finish(FinishStaffFromDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
@ -459,6 +464,15 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
satisfactionEntity.setEvaluateTime(logEntity.getOperateTime());
satisfactionEntity.setScore(formDTO.getScore());
demandSatisfactionDao.insert(satisfactionEntity);
FinishResultDTO finishResultDTO=new FinishResultDTO();
finishResultDTO.setPartyUnitId(serviceEntity.getServerId());
finishResultDTO.setSendCalStatisfaction(false);
//5、如果服务方区域化党建单位,需求重新计算当前这个单位的满意度。
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(serviceEntity.getServiceType())){
finishResultDTO.setSendCalStatisfaction(true);
}
return finishResultDTO;
}
/**
@ -822,6 +836,20 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
});
return l;
}
/**
* 计算出服务方评价总分服务的需求个数
*
* @param customerId
* @param partyUnitId
* @return
*/
@Override
public List<ServiceStatDTO> groupByPartyUnit(String customerId, String partyUnitId) {
if(StringUtils.isBlank(customerId)&&StringUtils.isBlank(partyUnitId)){
return new ArrayList<>();
}
return baseDao.selectGroupByPartyUnit(customerId,partyUnitId);
}
}

5
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml

@ -141,7 +141,10 @@ dingTalk:
robot:
webHook: @dingTalk.robot.webHook@
secret: @dingTalk.robot.secret@
rocketmq:
# 是否开启mq
enable: @rocketmq.enable@
name-server: @rocketmq.nameserver@
# 停机选项
shutdown:
graceful:

6
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml

@ -74,4 +74,10 @@
ID
</select>
<update id="updateSatisfaction" parameterType="map">
update ic_party_unit
set SATISFACTION=#{satisfaction},UPDATED_TIME=NOW()
where del_flag='0'
and id=#{partyUnitId}
</update>
</mapper>

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

@ -141,7 +141,7 @@
AND m.CATEGORY_CODE =#{firstCategoryCode}
</if>
ORDER BY
m.CREATED_TIME DESC
m.CREATED_TIME DESC,m.sort desc
</select>
@ -163,7 +163,7 @@
AND m.CUSTOMER_ID = #{customerId}
AND m.PARENT_CODE = #{parentCode}
ORDER BY
m.CREATED_TIME DESC
m.CREATED_TIME DESC,m.sort desc
</select>

22
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -356,4 +356,26 @@
and DATE_FORMAT(m.REPORT_TIME,'%Y%m%d') &lt;= #{endDateId}
and m.CATEGORY_CODE like concat(#{categoryCode},'%')
</select>
<select id="selectGroupByPartyUnit" parameterType="map" resultType="com.epmet.dto.result.demand.ServiceStatDTO">
SELECT
S.SERVER_ID AS serverId,
SUM( M.SCORE ) AS totalScore,
count( DISTINCT m.DEMAND_REC_ID ) AS demandCount
FROM
ic_user_demand_satisfaction m
INNER JOIN ic_user_demand_rec r ON ( m.DEMAND_REC_ID = r.id )
INNER JOIN ic_user_demand_service s ON ( R.ID = s.DEMAND_REC_ID )
WHERE
m.DEL_FLAG = '0'
AND r.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND r.`STATUS` = 'finished'
and s.SERVICE_TYPE ='party_unit'
<if test="null !=partyUnitId and partyUnitId!='' ">
and s.server_id=#{partyUnitId}
</if>
group by s.SERVER_ID
</select>
</mapper>

4
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java

@ -100,4 +100,8 @@ public interface SystemMessageType {
*/
String IC_RESI_USER_DEL = "ic_resi_user_del";
/**
* 需求完成如果服务方是区域化党建单位重新计算这个单位的满意度
*/
String CAL_PARTY_UNIT_SATISFACTION = "cal_party_unit_satisfaction";
}

3
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java

@ -192,6 +192,9 @@ public class SystemMessageServiceImpl implements SystemMessageService {
case SystemMessageType.IC_RESI_USER_DEL:
topic = TopicConstants.IC_RESI_USER;
break;
case SystemMessageType.CAL_PARTY_UNIT_SATISFACTION:
topic=TopicConstants.CAL_PARTY_UNIT_SATISFACTION;
break;
}
return topic;
}

4
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/CategoryListResultDTO.java

@ -30,7 +30,7 @@ public class CategoryListResultDTO implements Serializable {
/**
* 颜色
*/
private String colour;
private String color;
/**
* 1级分类长度
@ -42,6 +42,6 @@ public class CategoryListResultDTO implements Serializable {
this.categoryName = "";
this.count = NumConstant.ZERO;
this.codeLength = NumConstant.ZERO;
this.colour = "";
this.color = "";
}
}

4
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ResiBuzzLeftPieChartResultDTO.java

@ -35,12 +35,12 @@ public class ResiBuzzLeftPieChartResultDTO implements Serializable {
/**
* 颜色
*/
private String colour;
private String color;
public ResiBuzzLeftPieChartResultDTO() {
this.count = NumConstant.ZERO;
this.categoryCode = "";
this.categoryName = "";
this.colour = "";
this.color = "";
}
}

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueProjectCategoryDictEntity.java

@ -86,6 +86,6 @@ public class IssueProjectCategoryDictEntity extends BaseEpmetEntity {
/**
* 颜色
*/
private String colour;
private String color;
}

8
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -1586,6 +1586,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType(IssueConstant.ISSUE_AGENCY);
}
// 分类编码长度
Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId());
PageInfo<ResiBuzzDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectIssueLimit50(formDTO.getOrgId(), formDTO.getOrgType(), formDTO.getStatus(),length));
List<ResiBuzzDTO> list = pageInfo.getList();
@ -1600,8 +1601,10 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
if (!usersResult.success()){
throw new EpmetException("查询人员姓名失败...");
}
Integer total = Integer.valueOf(String.valueOf(pageInfo.getTotal()));
// 默认最多50 产品要求
Integer total = pageInfo.getSize();
result.setTotal(total > NumConstant.FIFTY ? NumConstant.FIFTY : total);
// 赋值展示名字
list.forEach(l -> {
l.setSort(no.getAndSet(no.get() + NumConstant.ONE));
usersResult.getData().forEach(u -> {
@ -1631,6 +1634,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
formDTO.setOrgId(staffInfo.getAgencyId());
formDTO.setOrgType(IssueConstant.ISSUE_AGENCY);
}
// 分类编码长度
Integer length = baseDao.selectOneLevelCategoryLength(tokenDto.getCustomerId());
List<ResiBuzzLeftPieChartResultDTO> result = baseDao.resiBuzzLeftPieChart(formDTO.getOrgId(), formDTO.getOrgType(), length, tokenDto.getCustomerId());
if(CollectionUtils.isEmpty(result)){
@ -1647,7 +1651,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
*/
@Override
public List<ProjectDistributionAnalysisRightDTO> getProjectCountByGrid(ProjectDistributionAnalysisFormDTO formDTO) {
List<ProjectDistributionAnalysisRightDTO> result = baseDao.getProjectCountByGrid(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate());
List<ProjectDistributionAnalysisRightDTO> result = baseDao.getProjectCountByGrid(formDTO.getOrgId(), formDTO.getStartDate(), formDTO.getEndDate());
if (CollectionUtils.isEmpty(result)){
return new ArrayList<>();
}

30
epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.15__add_colour.sql

@ -1,87 +1,87 @@
alter table issue_project_category_dict add column `COLOUR` VARCHAR(20) COMMENT '颜色' AFTER `SORT`;
alter table issue_project_category_dict add column `COLOR` VARCHAR(20) COMMENT '颜色' AFTER `SORT`;
UPDATE issue_project_category_dict
SET colour = '#ffba00'
SET color = '#ffba00'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '市场监管';
UPDATE issue_project_category_dict
SET colour = '#ffd074'
SET color = '#ffd074'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '卫生计生监督执法';
UPDATE issue_project_category_dict
SET colour = '#42cd05'
SET color = '#42cd05'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '建设管理';
UPDATE issue_project_category_dict
SET colour = '#16d783'
SET color = '#16d783'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '文化执法';
UPDATE issue_project_category_dict
SET colour = '#00e5ed'
SET color = '#00e5ed'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '民政';
UPDATE issue_project_category_dict
SET colour = '#0091ed'
SET color = '#0091ed'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '其他';
UPDATE issue_project_category_dict
SET colour = '#1b51ff'
SET color = '#1b51ff'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '城市管理';
UPDATE issue_project_category_dict
SET colour = '#1641cc'
SET color = '#1641cc'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '公安交通管理';
UPDATE issue_project_category_dict
SET colour = '#2a00ff'
SET color = '#2a00ff'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '消防安全';
UPDATE issue_project_category_dict
SET colour = '#7800ff'
SET color = '#7800ff'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '创卫复审类';
UPDATE issue_project_category_dict
SET colour = '#c600ff'
SET color = '#c600ff'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '环境保护';
UPDATE issue_project_category_dict
SET colour = '#ff00d2'
SET color = '#ff00d2'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '安全监管';
UPDATE issue_project_category_dict
SET colour = '#ff2a00'
SET color = '#ff2a00'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '社会治安综治';
UPDATE issue_project_category_dict
SET colour = '#ff7800'
SET color = '#ff7800'
WHERE DEL_FLAG = '0'
AND CATEGORY_TYPE = '1'
AND CATEGORY_NAME = '食品药品监管';

4
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml

@ -637,12 +637,12 @@
<!-- 查询居民热议左侧饼图 -->
<select id="resiBuzzLeftPieChart" resultType="com.epmet.dto.result.ResiBuzzLeftPieChartResultDTO">
SELECT COUNT(issueId) AS count,categoryCode,categoryName,colour FROM
SELECT COUNT(issueId) AS count,categoryCode,categoryName,color FROM
(SELECT
i.ID AS issueId,
IFNULL(LEFT(ic.CATEGORY_CODE,#{length}),'') AS categoryCode,
IFNULL(cd.CATEGORY_NAME,'其他') AS categoryName,
IFNULL(cd.colour,'#0091ed') AS colour
IFNULL(cd.color,'#0091ed') AS color
FROM issue i
LEFT JOIN issue_vote_statistical s ON (s.ISSUE_ID = i.ID AND s.DEL_FLAG = '0')
LEFT JOIN issue_category ic ON (ic.ISSUE_ID = i.ID AND ic.DEL_FLAG = '0' AND ic.CUSTOMER_ID = i.CUSTOMER_ID)

2
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml

@ -251,7 +251,7 @@
CATEGORY_CODE,
CATEGORY_NAME,
LENGTH(CATEGORY_CODE) AS codeLength,
IFNULL(colour,'') AS colour
IFNULL(color,'') AS colour
FROM issue_project_category_dict
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}

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

@ -49,4 +49,16 @@ public class AgencySubResultDTO implements Serializable {
* 当前组织的所有上级组织Id
*/
private String pids = "";
/**
* 组织级别
*/
private String level = "";
/**
* 组织经度没值取根组织的值
*/
private String longitude = "";
/**
* 组织维度没值取根组织的值
*/
private String latitude = "";
}

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyTreeResultDTO.java

@ -26,6 +26,15 @@ public class AgencyTreeResultDTO implements Serializable {
private String pid;
private String level;
//经度【没值则取跟客户的值】
private String longitude;
//维度【没值则取跟客户的值】
private String latitude;
/**
* orgId-orgLevel
*/
private String orgLevel;
/**
* 下级机关组织
*/

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java

@ -28,4 +28,8 @@ public class ExtGridResultDTO implements Serializable {
* 当前gridId所属的客户id add02.03
* */
private String customerId;
//经度【没值则取跟客户的值】
private String longitude;
//维度【没值则取跟客户的值】
private String latitude;
}

4
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java

@ -50,4 +50,8 @@ public class ExtStaffPermissionResultDTO implements Serializable {
* 当前agencyId所属的客户id add02.03
* */
private String customerId;
//经度【没值则取跟客户的值】
private String longitude;
//维度【没值则取跟客户的值】
private String latitude;
}

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

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

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -1119,6 +1119,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
result.setAgencyName(rootAgency.getAgencyName());
result.setAgencyId(rootAgency.getAgencyId());
result.setLevel(rootAgency.getLevel());
result.setOrgLevel(rootAgency.getAgencyId().concat("-").concat(rootAgency.getLevel()));
result.setLongitude(rootAgency.getLongitude());
result.setLatitude(rootAgency.getLatitude());
ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(rootAgency.getAgencyId());
convert2AgencyTreeResult(result,res.getSubAgencyList(),res.getGridList());
return result;
@ -1137,6 +1140,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
resultDTO.setAgencyName(agency.getAgencyName());
resultDTO.setPid(root.getAgencyId());
resultDTO.setLevel(agency.getLevel());
resultDTO.setLongitude(agency.getLongitude());
resultDTO.setLatitude(agency.getLatitude());
resultDTO.setOrgLevel(agency.getAgencyId().concat("-").concat(agency.getLevel()));
if (root.getSubAgencyList() == null) {
root.setSubAgencyList(new ArrayList<>());
@ -1152,7 +1158,10 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
grid.setAgencyName(o.getGridName());
grid.setPid(root.getAgencyId());
grid.setLevel("grid");
grid.setOrgLevel(o.getGridId().concat("-").concat("grid"));
grid.setSubAgencyList(null);
grid.setLongitude(o.getLongitude());
grid.setLatitude(o.getLatitude());
if (root.getSubAgencyList() == null) {
root.setSubAgencyList(new ArrayList<>());
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingServiceImpl.java

@ -115,7 +115,7 @@ public class IcBuildingServiceImpl extends BaseServiceImpl<IcBuildingDao, IcBuil
@Override
public List<OptionResultDTO> getBuildingOptions(String neighborHoodId) {
if (StringUtils.isBlank(neighborHoodId)) {
log.error("小区ID为空");
log.warn("小区ID为空");
return Collections.emptyList();
}
LambdaQueryWrapper<IcBuildingEntity> wrapper = new LambdaQueryWrapper<>();

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcBuildingUnitServiceImpl.java

@ -115,7 +115,7 @@ public class IcBuildingUnitServiceImpl extends BaseServiceImpl<IcBuildingUnitDao
@Override
public List<OptionResultDTO> getUnitOptions(String buildingId) {
if (StringUtils.isBlank(buildingId)) {
log.error("楼栋ID为空");
log.warn("楼栋ID为空");
return Collections.emptyList();
}
LambdaQueryWrapper<IcBuildingUnitEntity> wrapper = new LambdaQueryWrapper<>();

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcHouseServiceImpl.java

@ -127,7 +127,7 @@ public class IcHouseServiceImpl extends BaseServiceImpl<IcHouseDao, IcHouseEntit
@Override
public List<OptionResultDTO> getHouseOption(HouseFormDTO formDTO) {
if (StringUtils.isBlank(formDTO.getBuildingId()) && StringUtils.isBlank(formDTO.getUnitId())) {
log.error("楼栋和单元ID为空");
log.warn("楼栋和单元ID为空");
return Collections.emptyList();
}
LambdaQueryWrapper<IcHouseEntity> wrapper = new LambdaQueryWrapper<>();

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

@ -178,13 +178,30 @@
<select id="selectSubAgencyList" resultType="com.epmet.dto.result.AgencySubResultDTO">
SELECT
id AS "agencyId",
organization_name AS "agencyName",
pids AS "pids"
FROM customer_agency
WHERE del_flag = '0'
AND pids = #{subAgencyPids}
ORDER BY created_time DESC
ca.id AS "agencyId",
ca.organization_name AS "agencyName",
ca.pids AS "pids",
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
WHERE ca.del_flag = '0'
AND ca.pids = #{subAgencyPids}
ORDER BY ca.created_time DESC
</select>
<select id="getCustomerRootAgency" resultType="com.epmet.dto.CustomerAgencyDTO">
@ -258,11 +275,15 @@
<id column="agencyId" property="agencyId" />
<result column="agencyName" property="agencyName"/>
<result column="level" property="level" />
<result column="longitude" property="longitude" />
<result column="latitude" property="latitude" />
<result column="customerId" property="customerId"/>
<collection property="gridList" column="agencyId" ofType="com.epmet.dto.result.ExtGridResultDTO" select="selectGridList">
<id column="gridId" property="gridId" />
<result column="gridName" property="gridName" />
<result column="customerId" property="customerId"/>
<result column="longitude" property="longitude" />
<result column="latitude" property="latitude" />
</collection>
<collection property="departmentList" column="agencyId" ofType="com.epmet.dto.result.ExtDeptResultDTO" select="selectDeptList">
@ -293,7 +314,23 @@
agency.ID AS agencyId,
agency.ORGANIZATION_NAME AS agencyName,
agency.LEVEL AS level,
agency.CUSTOMER_ID as customerId
agency.CUSTOMER_ID as customerId,
( CASE WHEN agency.longitude is null THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id)
ORDER BY pid ASC LIMIT 1
)
ELSE agency.longitude
END
) longitude,
( CASE WHEN agency.latitude is null THEN
( SELECT latitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id)
ORDER BY pid ASC LIMIT 1
)
ELSE agency.latitude
END
) latitude
FROM
CUSTOMER_AGENCY agency
WHERE
@ -317,9 +354,26 @@
SELECT
cg.id AS gridId,
cg.GRID_NAME AS gridName,
cg.CUSTOMER_ID AS customerId
cg.CUSTOMER_ID AS customerId,
( 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_grid cg
INNER JOIN customer_agency ca ON cg.PID = ca.ID
WHERE
cg.DEL_FLAG = '0'
AND cg.PID =#{agencyId}
@ -330,7 +384,23 @@
agency.ID AS agencyId,
agency.ORGANIZATION_NAME AS agencyName,
agency.LEVEL AS level,
agency.CUSTOMER_ID as customerId
agency.CUSTOMER_ID as customerId,
( CASE WHEN agency.longitude is null THEN
( SELECT longitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id)
ORDER BY pid ASC LIMIT 1
)
ELSE agency.longitude
END
) longitude,
( CASE WHEN agency.latitude is null THEN
( SELECT latitude FROM customer_agency
WHERE del_flag = '0' AND customer_id = (SELECT customer_id FROM customer_agency WHERE id = agency.id)
ORDER BY pid ASC LIMIT 1
)
ELSE agency.latitude
END
) latitude
FROM
CUSTOMER_AGENCY agency
WHERE

2
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -2982,6 +2982,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
/**
* @Description 区间项目分类数量处理
* 查询的是时间段内的分类项目数查询的时间 是传入一个日期拼上时间在进行比较大小
* @param categories
* @param date
* @param listResult
@ -2989,6 +2990,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
* @date 2021/12/8 9:45 上午
*/
public List<ProjectDistributionAnalysisLeftResultDTO> disposeTimeInterval(List<ProjectCategoryByDateDTO> categories, String date,List<CategoryListResultDTO> listResult){
// 把一天分成6段
List<String> intervalTimeList = getIntervalTimeList("00:00", "24:00", 240);
List<ProjectDistributionAnalysisLeftResultDTO> result = new ArrayList<>();
Map<String, List<ProjectCategoryByDateDTO>> groupByCode = categories.stream().collect(Collectors.groupingBy(ProjectCategoryByDateDTO::getCategoryCode));

Loading…
Cancel
Save