Browse Source

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

 Conflicts:
	epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
	epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
	epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
	epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
	epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventCategoryService.java
	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java
	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
	epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
master
wangxianzhang 3 years ago
parent
commit
b487e24929
  1. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  2. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyUnitDao.xml
  3. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  4. 31
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluationTask.java
  5. 5
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java
  6. 12
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java
  7. 3
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java
  8. 7
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java
  9. 7
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java
  10. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java
  11. 9
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java
  12. 1
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  13. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java
  14. 8
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  15. 11
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  16. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  17. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  18. 7
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  19. 11
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  20. 22
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml
  21. 19
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventOperationLogDTO.java
  22. 21
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AutoEvaluationFormDTO.java
  23. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java
  24. 3
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java
  25. 10
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java
  26. 75
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java
  27. 11
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java
  28. 54
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java
  29. 110
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java
  30. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java
  31. 16
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java
  32. 21
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventCategoryAnalysisResDTO.java
  33. 20
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java
  34. 4
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java
  35. 9
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java
  36. 5
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java
  37. 114
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/IcEventController.java
  38. 1
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java
  39. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java
  40. 43
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventDao.java
  41. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventOperationLogDao.java
  42. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventReplyDao.java
  43. 10
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java
  44. 14
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java
  45. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventOperationLogService.java
  46. 4
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventReplyService.java
  47. 61
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/IcEventService.java
  48. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java
  49. 7
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java
  50. 7
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventOperationLogServiceImpl.java
  51. 7
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventReplyServiceImpl.java
  52. 370
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  53. 16
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  54. 232
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java
  55. 15
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml
  56. 121
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventDao.xml
  57. 18
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventOperationLogDao.xml
  58. 16
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml
  59. 3
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

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

@ -20,9 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.PointRecordFormDTO;
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.form.demand.*;
import com.epmet.dto.result.PointRecordDTO;
import com.epmet.dto.result.ServicePointDTO;
import com.epmet.dto.result.demand.*;

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

@ -121,7 +121,7 @@
CREATED_TIME
FROM ic_community_self_organization
WHERE DEL_FLAG = '0'
AND CONCAT(PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{agencyId},'%')
AND CONCAT(PIDS,':',ORG_ID) LIKE CONCAT('%',#{agencyId},'%')
) t ORDER BY CREATED_TIME desc
</select>

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

@ -643,7 +643,7 @@
</select>
<select id="queryServiceList" parameterType="com.epmet.dto.form.ServiceListFormDTO" resultType="com.epmet.dto.result.demand.DemandRecResultDTO">
<select id="queryServiceList" parameterType="com.epmet.dto.form.demand.ServiceListFormDTO" resultType="com.epmet.dto.result.demand.DemandRecResultDTO">
SELECT
r.ID as demandRecId,
r.CONTENT,
@ -657,4 +657,4 @@
and s.SERVER_ID=#{serverId}
order by r.REPORT_TIME desc
</select>
</mapper>
</mapper>

31
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/AutoEvaluationTask.java

@ -0,0 +1,31 @@
package com.epmet.task;
import com.alibaba.fastjson.JSON;
import com.epmet.dto.form.AutoEvaluationFormDTO;
import com.epmet.feign.GovProjectOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @Author zxc
* @DateTime 2022/5/18 17:53
* @DESC
*/
@Slf4j
@Component("autoEvaluationTask")
public class AutoEvaluationTask implements ITask{
@Autowired
private GovProjectOpenFeignClient projectOpenFeignClient;
@Override
public void run(String params) {
AutoEvaluationFormDTO formDTO = new AutoEvaluationFormDTO();
if (StringUtils.isNotBlank(params)) {
formDTO = JSON.parseObject(params, AutoEvaluationFormDTO.class);
}
projectOpenFeignClient.autoEvaluation(formDTO);
}
}

5
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueProjectCategoryDictDTO.java

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

12
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectFormDTO.java

@ -57,5 +57,17 @@ public class ShiftProjectFormDTO implements Serializable {
*/
private String customerId;
private String gridId;
/**
* 协办单位ID
*/
private String assistanceUnitId;
/**
* 协办单位类型1社区自组织2联建单位
*/
private String assistanceUnitType;
}

3
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java

@ -392,4 +392,7 @@ public interface GovIssueOpenFeignClient {
*/
@PostMapping("/gov/issue/issueprojectcategorydict/getByCategoryCode/{category-code}")
Result<IssueProjectCategoryDictDTO> getByCategoryCode(@PathVariable("category-code") String categoryCode);
@PostMapping(value = "/gov/issue/issueprojectcategorydict/first/{customerId}")
Result<List<IssueProjectCategoryDictDTO>> queryFirstCategory(@PathVariable("customerId") String customerId);
}

7
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java

@ -326,4 +326,11 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient
public Result<IssueProjectCategoryDictDTO> getByCategoryCode(String categoryCode) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getByCategoryCode", categoryCode);
}
@Override
public Result<List<IssueProjectCategoryDictDTO>> queryFirstCategory(String customerId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "queryFirstCategory", customerId);
}
}

7
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java

@ -309,5 +309,12 @@ public class IssueProjectCategoryDictController {
return new Result<IssueProjectCategoryDictDTO>().ok(r);
}
@PostMapping("first/{customerId}")
public Result<List<IssueProjectCategoryDictDTO>> queryFirstCategory(@PathVariable("customerId") String customerId) {
List<IssueProjectCategoryDictDTO> list = issueProjectCategoryDictService.queryFirstCategory(customerId);
return new Result<List<IssueProjectCategoryDictDTO>>().ok(list);
}
}

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java

@ -237,4 +237,6 @@ public interface IssueProjectCategoryDictService extends BaseService<IssueProjec
* @return
*/
IssueProjectCategoryDictDTO getByCategoryCode(String categoryCode);
List<IssueProjectCategoryDictDTO> queryFirstCategory(String customerId);
}

9
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java

@ -568,4 +568,13 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl<IssuePr
}
return r;
}
@Override
public List<IssueProjectCategoryDictDTO> queryFirstCategory(String customerId) {
List<CategoryListResultDTO> list=baseDao.selectCategoryOneLevelListByCustomerId(customerId);
if(CollectionUtils.isEmpty(list)){
return new ArrayList<>();
}
return ConvertUtils.sourceToTarget(list,IssueProjectCategoryDictDTO.class);
}
}

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

@ -1014,6 +1014,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
//3:调用gov-project服务,新增项目各业务表初始数据
formDTO.setCategoryList(categoryList);
formDTO.setGridId(entity.getGridId());
List<IssueTagsDTO> tagList = issueTagsService.getTagsByIssue(formDTO.getIssueId());
formDTO.setTagList(tagList);
Result<IssueProjectResultDTO> resultDTO = govProjectFeignClient.issueShiftProject(formDTO);

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/SubOrgResDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 当前组织的直属下级下级组织+直属网格
*/
@Data
public class SubOrgResDTO implements Serializable {
private String orgId;
/**
* agency
* grid
*/
private String orgType;
private String orgName;
}

8
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -624,4 +624,12 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/house/houseupdate")
Result houseUpdate(@RequestBody IcHouseAddFormDTO formDTO);
/**
* 直属网格+下一级组织
* @param agencyId
* @return
*/
@GetMapping("/gov/org/customeragency/subOrgList/{agencyId}")
Result<List<SubOrgResDTO>> subOrgList(@PathVariable("agencyId")String agencyId);
}

11
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -403,4 +403,15 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
public Result houseUpdate( IcHouseAddFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "houseUpdate",formDTO);
}
/**
* 直属网格+下一级组织
*
* @param agencyId
* @return
*/
@Override
public Result<List<SubOrgResDTO>> subOrgList(String agencyId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "subOrgList",agencyId);
}
}

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java

@ -415,4 +415,16 @@ public class CustomerAgencyController {
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.rootAgencyGridTree(formDTO.getAgencyId()));
}
/**
* 当前agencyId的下一级组织+直属网格
* @param agencyId
* @return
*/
@GetMapping("subOrgList/{agencyId}")
public Result<List<SubOrgResDTO>> subOrgList(@PathVariable("agencyId") String agencyId) {
List<SubOrgResDTO> list = customerAgencyService.subOrgList(agencyId);
return new Result<List<SubOrgResDTO>>().ok(list);
}
}

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java

@ -316,5 +316,6 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
*/
List<CommunityListResultDTO> getCommunityList(@Param("customerId")String customerId, @Param("agencyId")String agencyId);
List<SubOrgResDTO> selectSubOrg(String agencyId);
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java

@ -288,4 +288,11 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @author sun
**/
AgencyTreeResultDTO rootAgencyGridTree(String agencyId);
/**
* 当前agencyId的下一级组织+直属网格
* @param agencyId
* @return
*/
List<SubOrgResDTO> subOrgList(String agencyId);
}

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

@ -1442,4 +1442,15 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
return result;
}
/**
* 当前agencyId的下一级组织+直属网格
*
* @param agencyId
* @return
*/
@Override
public List<SubOrgResDTO> subOrgList(String agencyId) {
return baseDao.selectSubOrg(agencyId);
}
}

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

@ -756,4 +756,26 @@
AND CUSTOMER_ID = #{customerId}
AND pids LIKE concat('%',#{agencyId}, '%' )
</update>
<select id="selectSubOrg" resultType="com.epmet.dto.result.SubOrgResDTO">
SELECT
ca.ID AS orgId,
ca.ORGANIZATION_NAME AS orgName,
'agency' AS orgType
FROM
customer_agency ca
WHERE
ca.DEL_FLAG = '0'
AND ca.PID = #{agencyId}
union ALL
SELECT
cg.ID AS orgId,
cg.GRID_NAME AS orgName,
'grid' AS orgType
FROM
customer_grid cg
WHERE
cg.DEL_FLAG = '0'
AND cg.PID = #{agencyId}
</select>
</mapper>

19
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/IcEventOperationLogDTO.java

@ -47,8 +47,9 @@ public class IcEventOperationLogDTO implements Serializable {
* 3立项shift_project
* 4转需求shift_demand
* 5办结close_case;
* 6需求办结close_demand
*/
private String actionCode;
private String actionCode;
/**
* 1发布事件publish
@ -57,16 +58,26 @@ public class IcEventOperationLogDTO implements Serializable {
* 4立项shift_project
* 5转需求: shift_demand
* 6办结close_case;
* 7选择是否已解决choose_resolve;
* 8首次查看阅读事件read_first人大代表未读=>已读工作人员待处理=>处理中
* 7需求办结close_demand;
* 8选择是否已解决choose_resolve;
* 9首次查看阅读事件read_first人大代表未读=>已读工作人员待处理=>处理中
*/
private String actionDesc;
private String actionDesc;
/**
* 操作时间
*/
private Date operateTime;
/**
* 服务方事件被转需求需求在办结时的服务方名称
*/
private String serviceParty;
/**
* 实际服务时间事件被转需求需求在办结时填写的实际服务时间 xx至xx
*/
private String actualServiceTime;
/**
* 删除标识 1删除0未删除
*/

21
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/AutoEvaluationFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2022/5/18 16:33
* @DESC
*/
@Data
public class AutoEvaluationFormDTO implements Serializable {
private static final long serialVersionUID = -8871508029242477452L;
private String customerId;
private String dateId;
private String startDate;
private String endDate;
}

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventToProjectFormDTO.java

@ -104,4 +104,9 @@ public class EventToProjectFormDTO implements Serializable {
* 协办单位类型1社区自组织2联建单位
*/
private String assistanceUnitType;
/**
* 网格ID
*/
private String gridId;
}

3
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcDemandFormDTO.java

@ -30,6 +30,9 @@ public class IcDemandFormDTO implements Serializable {
public interface UpdateInternalGroup {
}
@NotBlank(message = "事件id不能为空",groups = AddInternalGroup.class)
private String icEventId;
@NotBlank(message = "需求id不能为空",groups = UpdateInternalGroup.class)
private String demandRecId;

10
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventAddEditFormDTO.java

@ -1,10 +1,12 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
@ -47,6 +49,12 @@ public class IcEventAddEditFormDTO implements Serializable {
*/
@NotBlank(message = "反映渠道不能为空", groups = {AddGroup.class})
private String sourceType;
/**
* 发生时间
*/
@NotNull(message = "发生时间不能为空", groups = {AddGroup.class})
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private String happenTime;
/**
* 事件内容
*/
@ -92,7 +100,7 @@ public class IcEventAddEditFormDTO implements Serializable {
/**
* 立项接口入参对象
*/
private EventToProjectFormDTO project;
private IcEventToProjectFormDTO project;
/**
* 转需求接口入参对象
*/

75
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventCategoryAnalysisFormDTO.java

@ -0,0 +1,75 @@
package com.epmet.dto.form;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
/**
* 社区治理可视化分析
* 事件分类分析-饼1入参
*/
@Data
public class IcEventCategoryAnalysisFormDTO {
/**
* 处理状态比例查询
*/
public interface TotalPie {
}
public interface OrgTotalPie {
}
/**
* 要查询的组织ID
*/
@NotBlank(message = "组织ID为必填项", groups = {TotalPie.class,OrgTotalPie.class})
private String orgId;
/**
* 组织类型grid,agency
*/
@NotBlank(message = "组织类型为必填项", groups = {TotalPie.class,OrgTotalPie.class})
private String orgType;
/**
* 查询起始时间 yyyy-MM-dd
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "查询时间为必填项", groups = {TotalPie.class,OrgTotalPie.class})
private Date queryStartTime;
/**
* 查询截止时间 yyyy-MM-dd
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "查询时间为必填项", groups = {TotalPie.class,OrgTotalPie.class})
private Date queryEndTime;
private String categoryCode;
/**
* 一级分类 code长度
*/
private Integer categoryOneLength;
private String gridPids;
//以下参数从token中获取
/**
* 当前登录用户
*/
private String staffId;
/**
* 当前客户id
*/
private String customerId;
}

11
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventListFormDTO.java

@ -1,7 +1,10 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -12,6 +15,14 @@ import java.io.Serializable;
public class IcEventListFormDTO implements Serializable {
private static final long serialVersionUID = 9156247659994638103L;
public interface Detail extends CustomerClientShowGroup {
}
/**
* 事件ID
*/
@NotBlank(message = "事件ID不能为空", groups = Detail.class)
private String icEventId;
/**
* 所属网格
*/

54
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventReplyFormDTO.java

@ -0,0 +1,54 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 事件管理_回复
* @Author sun
*/
@Data
public class IcEventReplyFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface Comment extends CustomerClientShowGroup {
}
public interface Process extends CustomerClientShowGroup {
}
/**
* 事件ID
*/
@NotBlank(message = "事件ID不能为空", groups = {UpdateGroup.class, Comment.class, Process.class})
private String icEventId;
/**
* 二类分类Id
*/
private String categoryId;
/**
* 回复内容
*/
private String content;
/**
* 处理方式[0:已回复 1:已转项目 1:已转需求]
*/
private String operationType;
/**
* 处理中processing已办结closed_case
*/
private String status;
/**
* 满意度 - 不满意:bad基本满意:good非常满意:perfect
*/
@NotBlank(message = "满意度不能为空", groups = {Comment.class})
private String satisfaction;
private String customerId;
private String userId;
}

110
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/IcEventToProjectFormDTO.java

@ -0,0 +1,110 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* 事件管理-立项
*
* @author sun
*/
@Data
public class IcEventToProjectFormDTO implements Serializable {
private static final long serialVersionUID = 3392008990676159012L;
public interface AddUserInternalGroup {
}
public interface ApprovalCategory extends CustomerClientShowGroup {
}
/**
* 事件id
*/
@NotBlank(message = "事件id不能为空", groups = AddUserInternalGroup.class)
private String icEventId;
/**
* 项目方案 1000
*/
@Length(min = 1, max = 1000, message = "项目方案1000字", groups = {ApprovalCategory.class})
private String publicReply;
/**
* 内部备注 1000
* 21.08.09 直接立项的内部备注是必填的然后议题转项目和我要直报转项目的都是非必填的
*/
//@Length(min = 1, max = 1000, message = "内部备注1000字", groups = {ApprovalCategory.class})
private String internalRemark;
/**
* 吹哨勾选的工作人员信息集合,不可为空
*/
@Valid
private List<TickStaffFormDTO> staffList;
/**
* 项目所选分类集合不可为空
*/
@Valid
private List<CategoryOrTagFormDTO> categoryList;
/**
* 项目所选标签集合
*/
private List<CategoryOrTagFormDTO> tagList;
@Length(min = 1, max = 20, message = "项目标题不能超过20位", groups = {ApprovalCategory.class})
private String title;
/**
* 公开答复对应文件集合
*/
private List<FileDTO> publicFile;
/**
* 内部备注对应文件集合
*/
private List<FileDTO> internalFile;
//定位地址[立项项目指的项目发生位置,议题转的项目指的话题发生位置]
private String locateAddress;
//定位经度
private String locateLongitude;
//定位纬度
private String locateDimension;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
private String app;
private String client;
/**
* 网格id
*/
@NotBlank(message = "网格id不能为空", groups = AddUserInternalGroup.class)
private String gridId;
/**
* 协办单位ID
*/
private String assistanceUnitId;
/**
* 协办单位类型1社区自组织2联建单位
*/
private String assistanceUnitType;
}

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectManageListFormDTO.java

@ -16,8 +16,6 @@ public class ProjectManageListFormDTO extends PageFormDTO implements Serializabl
private static final long serialVersionUID = -3317804468566708838L;
public interface ProjectManageListForm{}
/**
* 标题
*/
@ -34,9 +32,8 @@ public class ProjectManageListFormDTO extends PageFormDTO implements Serializabl
private String endDate;
/**
* all全部closed已关闭pending待处理
* null就是全部closed已关闭pending待处理
*/
@NotBlank(message = "status不能为空",groups = ProjectManageListForm.class)
private String status;
private String userId;

16
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventAnalysisOrgResDTO.java

@ -0,0 +1,16 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
@Data
public class IcEventAnalysisOrgResDTO implements Serializable {
private String orgId;
private String orgType;
private String orgName;
private Integer total = 0;
}

21
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventCategoryAnalysisResDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 社区治理可视化分析
* 事件分类分析-饼1
*/
@Data
public class IcEventCategoryAnalysisResDTO implements Serializable {
//一级分类Code
private String categoryCode;
//一级分类名称
private String categoryName;
//一级分类颜色
private String color = "";
//分类下项目总数
private Integer total = 0;
}

20
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/IcEventListResultDTO.java

@ -1,9 +1,11 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
@ -18,7 +20,7 @@ public class IcEventListResultDTO implements Serializable {
/**
* 事件Id
*/
private String eventId;
private String icEventId;
/**
* 网格ID
*/
@ -39,10 +41,23 @@ public class IcEventListResultDTO implements Serializable {
* 音频[url集合]
*/
private List<String> voiceList;
/**
* 分类Id
*/
private String categoryId;
/**
* 分类名称(医疗-二类名)
*/
private String categoryName;
/**
* 上报渠道[字典表]
*/
private String sourceType;
/**
* 发生时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date happenTime;
/**
* 上报渠道
*/
@ -70,7 +85,8 @@ public class IcEventListResultDTO implements Serializable {
/**
* 上报时间
*/
private String createdTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createdTime;
/**
* 状态处理中processing已办结closed_case
*/

4
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectManageListResultDTO.java

@ -53,7 +53,7 @@ public class ProjectManageListResultDTO implements Serializable {
/**
* 滞留天数
*/
private Integer detentionDays;
private String detentionDays;
/**
* 状态
@ -77,7 +77,7 @@ public class ProjectManageListResultDTO implements Serializable {
this.shiftProjectTime = "";
this.projectScheme = "";
this.internalRemark = "";
this.detentionDays = NumConstant.ZERO;
this.detentionDays = NumConstant.ZERO_STR;
this.status = "";
this.departmentNameList = new ArrayList<>();
this.projectId = "";

9
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java

@ -158,4 +158,13 @@ public interface GovProjectOpenFeignClient {
*/
@PostMapping("gov/project/project/audit-reset")
Result<ProjectAuditResetResultDTO> eventAuditReset(@RequestParam("gridId")String gridId);
/**
* Desc: 定时任务自动评价
* @param formDTO
* @author zxc
* @date 2022/5/18 16:35
*/
@PostMapping("gov/project/icEvent/auto-evaluation")
Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO);
}

5
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java

@ -159,4 +159,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli
public Result<ProjectAuditResetResultDTO> eventAuditReset(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "eventAuditReset",gridId);
}
@Override
public Result autoEvaluation(AutoEvaluationFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "autoEvaluation",formDTO);
}
}

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

@ -23,9 +23,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
/**
* 事件管理表
*
@ -167,7 +167,119 @@ public class IcEventController {
PageData<IcEventResultDTO> page = icEventService.getSameCategoryEvents(orgId, orgType, categroyPid, pageNo, pageSize);
return new Result<PageData<IcEventResultDTO>>().ok(page);
}
/**
* @Author sun
* @Description 事件管理-回复
**/
@PostMapping("reply")
public Result reply(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, UpdateGroup.class, DefaultGroup.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icEventService.reply(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 事件管理-立项
**/
@PostMapping("icEventToProject")
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);
icEventService.icEventToProject(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 事件管理-转需求
**/
@PostMapping("icEventToDemand")
public Result icEventToDemand(@LoginUser TokenDto tokenDto, @RequestBody IcDemandFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setDemandUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, IcDemandFormDTO.Add.class,IcDemandFormDTO.AddInternalGroup.class);
icEventService.icEventToDemand(formDTO);
return new Result();
}
/**
* 事件分类分析-一级分类下事件数量
*
* @param formDTO
* @return
*/
@PostMapping("category-analysis/total")
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);
List<IcEventCategoryAnalysisResDTO> list = icEventService.categoryAnalysisTotal(formDTO);
return new Result<List<IcEventCategoryAnalysisResDTO>>().ok(list);
}
/**
* @Author sun
* @Description 事件管理-评价
**/
@PostMapping("comment")
public Result comment(@LoginUser TokenDto tokenDto, @RequestBody IcEventReplyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcEventReplyFormDTO.Comment.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
icEventService.comment(formDTO);
return new Result();
}
/**
* @Author sun
* @Description 事件管理-评价
**/
@PostMapping("detail")
public Result<IcEventListResultDTO> detail(@RequestBody IcEventListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcEventListFormDTO.Detail.class);
return new Result<IcEventListResultDTO>().ok(icEventService.detail(formDTO));
}
/**
* 事件分类分析- 饼图2直属下级 事件数量
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("category-analysis/org-total")
public Result<List<IcEventAnalysisOrgResDTO>> analysisOrgTotal(@LoginUser TokenDto tokenDto, @RequestBody IcEventCategoryAnalysisFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,IcEventCategoryAnalysisFormDTO.OrgTotalPie.class);
List<IcEventAnalysisOrgResDTO> list = icEventService.analysisOrgTotal(formDTO);
return new Result<List<IcEventAnalysisOrgResDTO>>().ok(list);
}
/**
* @Author sun
* @Description 事件管理-处理进展
**/
@PostMapping("process")
public Result<LinkedList<IcEventProcessListResultDTO>> process(@RequestBody IcEventReplyFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, IcEventReplyFormDTO.Process.class);
return new Result<LinkedList<IcEventProcessListResultDTO>>().ok(icEventService.process(formDTO));
}
/**
* Desc: 定时任务自动评价
* @param formDTO
* @author zxc
* @date 2022/5/18 16:35
*/
@PostMapping("auto-evaluation")
public Result autoEvaluation(@RequestBody AutoEvaluationFormDTO formDTO){
icEventService.autoEvaluation(formDTO);
return new Result();
}
}

1
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java

@ -346,7 +346,6 @@ public class ProjectController {
*/
@PostMapping("project-list")
public Result<PageData> projectList(@LoginUser TokenDto tokenDto,@RequestBody ProjectManageListFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ProjectManageListFormDTO.ProjectManageListForm.class);
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<PageData>().ok(projectService.projectList(formDTO));

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventCategoryDao.java

@ -3,6 +3,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcEventCategoryEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 事件所属分类表
@ -12,5 +13,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcEventCategoryDao extends BaseDao<IcEventCategoryEntity> {
IcEventCategoryEntity selectByEventId(@Param("icEventId") String icEventId);
}

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

@ -1,12 +1,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.IcEventMonthlyCountResultDTO;
import com.epmet.dto.result.IcEventMonthlyIncrementResultDTO;
import com.epmet.dto.form.IcEventCategoryAnalysisFormDTO;
import com.epmet.dto.form.IcEventListFormDTO;
import com.epmet.dto.result.IcEventCategoryAnalysisResDTO;
import com.epmet.dto.result.IcEventListResultDTO;
import com.epmet.dto.result.IcEventMonthlyCountResultDTO;
import com.epmet.dto.result.IcEventResultDTO;
import com.epmet.dto.result.ProcessStatusRatioResultDTO;
import com.epmet.entity.IcEventEntity;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Mapper;
@ -16,8 +16,6 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.List;
/**
* 事件管理表
*
@ -90,4 +88,39 @@ public interface IcEventDao extends BaseDao<IcEventEntity> {
@Param("gridPids") String gridPids,
@Param("orgType") String orgType,
@Param("categoryPids") String categoryPids);
/**
*
* @param formDTO
* @return
*/
List<IcEventCategoryAnalysisResDTO> selectFirstCategoryTotal(IcEventCategoryAnalysisFormDTO formDTO);
/**
* Desc: 查询客户下可以自动评价事件的ID
* @param customerId
* @param no
* @param size
* @author zxc
* @date 2022/5/18 17:20
*/
List<String> getAutoEvaluationIds(@Param("customerId") String customerId,@Param("no")Integer no,@Param("size")Integer size);
/**
* Desc: 更新评价默认 perfect
* @param ids
* @author zxc
* @date 2022/5/18 17:26
*/
void updateAutoEvaluation(@Param("ids")List<String> ids);
Integer selectGridTotal(String gridId);
/**
*
* @param orgId
* @param orgType
* @return
*/
Integer selectOrgTotal(@Param("orgId") String orgId, @Param("orgType") String orgType);
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventOperationLogDao.java

@ -1,8 +1,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.IcEventProcessListResultDTO;
import com.epmet.entity.IcEventOperationLogEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList;
/**
* 事件操作日志表
@ -12,5 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcEventOperationLogDao extends BaseDao<IcEventOperationLogEntity> {
LinkedList<IcEventProcessListResultDTO> selectByEventId(@Param("icEventId") String icEventId);
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/IcEventReplyDao.java

@ -1,8 +1,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.IcEventProcessListResultDTO;
import com.epmet.entity.IcEventReplyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList;
/**
* 事件回复表
@ -12,5 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface IcEventReplyDao extends BaseDao<IcEventReplyEntity> {
LinkedList<IcEventProcessListResultDTO> selectByEventId(@Param("icEventId") String icEventId);
}

10
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventEntity.java

@ -153,11 +153,11 @@ public class IcEventEntity extends BaseEpmetEntity {
/**
* 事件审核状态[涉及附件审核需要加的状态]审核中auditing
auto_passed: 自动通过
review结果不确定需要人工审核
block: 结果违规
rejected人工审核驳回;
approved人工审核通过
auto_passed: 自动通过
review结果不确定需要人工审核
block: 结果违规
rejected人工审核驳回;
approved人工审核通过
*/
private String auditStatus;

14
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/IcEventOperationLogEntity.java

@ -47,6 +47,7 @@ public class IcEventOperationLogEntity extends BaseEpmetEntity {
* 3立项shift_project
* 4转需求shift_demand
* 5办结close_case;
* 6需求办结close_demand
*/
private String actionCode;
@ -57,8 +58,9 @@ public class IcEventOperationLogEntity extends BaseEpmetEntity {
* 4立项shift_project
* 5转需求: shift_demand
* 6办结close_case;
* 7选择是否已解决choose_resolve;
* 8首次查看阅读事件read_first人大代表未读=>已读工作人员待处理=>处理中
* 7需求办结close_demand;
* 8选择是否已解决choose_resolve;
* 9首次查看阅读事件read_first人大代表未读=>已读工作人员待处理=>处理中
*/
private String actionDesc;
@ -66,5 +68,13 @@ public class IcEventOperationLogEntity extends BaseEpmetEntity {
* 操作时间
*/
private Date operateTime;
/**
* 服务方事件被转需求需求在办结时的服务方名称
*/
private String serviceParty;
/**
* 实际服务时间事件被转需求需求在办结时填写的实际服务时间 xx至xx
*/
private String actualServiceTime;
}

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

@ -3,8 +3,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcEventOperationLogDTO;
import com.epmet.dto.result.IcEventProcessListResultDTO;
import com.epmet.entity.IcEventOperationLogEntity;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -75,4 +77,6 @@ public interface IcEventOperationLogService extends BaseService<IcEventOperation
* @date 2022-05-17
*/
void delete(String[] ids);
LinkedList<IcEventProcessListResultDTO> getByEventId(String icEventId);
}

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

@ -3,8 +3,10 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcEventReplyDTO;
import com.epmet.dto.result.IcEventProcessListResultDTO;
import com.epmet.entity.IcEventReplyEntity;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -75,4 +77,6 @@ public interface IcEventReplyService extends BaseService<IcEventReplyEntity> {
* @date 2022-05-17
*/
void delete(String[] ids);
LinkedList<IcEventProcessListResultDTO> getByEventId(String icEventId);
}

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

@ -6,11 +6,13 @@ import com.epmet.dto.IcEventDTO;
import com.epmet.dto.form.IcEventAddEditFormDTO;
import com.epmet.dto.form.IcEventListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.IcEventEntity;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
/**
* 事件管理表
@ -112,4 +114,61 @@ public interface IcEventService extends BaseService<IcEventEntity> {
* @return
*/
PageData<IcEventResultDTO> getSameCategoryEvents(String orgId, String orgType, String categoryPids, Integer pageNo, Integer pageSize);
/**
* @Author sun
* @Description 事件管理-回复
**/
void reply(IcEventReplyFormDTO formDTO);
/**
* @Author sun
* @Description 事件管理-立项
**/
void icEventToProject(IcEventToProjectFormDTO formDTO);
/**
* @Author sun
* @Description 事件管理-转需求
**/
void icEventToDemand(IcDemandFormDTO formDTO);
/**
* 事件分类分析-一级分类下事件数量
* @param formDTO
* @return
*/
List<IcEventCategoryAnalysisResDTO> categoryAnalysisTotal(IcEventCategoryAnalysisFormDTO formDTO);
/**
* @Author sun
* @Description 事件管理-评价
**/
void comment(IcEventReplyFormDTO formDTO);
/**
* Desc: 定时任务自动评价
* @param formDTO
* @author zxc
* @date 2022/5/18 16:35
*/
void autoEvaluation(AutoEvaluationFormDTO formDTO);
/**
* @Author sun
* @Description 事件管理-评价
**/
IcEventListResultDTO detail(IcEventListFormDTO formDTO);
/**
* @Author sun
* @Description 事件管理-处理进展
**/
LinkedList<IcEventProcessListResultDTO> process(IcEventReplyFormDTO formDTO);
/**
* 事件分类分析- 饼图2直属下级 事件数量
* @param formDTO
* @return
*/
List<IcEventAnalysisOrgResDTO> analysisOrgTotal(IcEventCategoryAnalysisFormDTO formDTO);
}

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java

@ -205,4 +205,10 @@ public interface ProjectTraceService {
* @Date 2022/1/4 15:33
*/
void approvaledListExport(HttpServletResponse response, ApprovaledListFromDTO formDTO);
/**
* 事件管理-事件立项
* @author sun
*/
EventToProjectResultDTO icEventToProject(IcEventToProjectFormDTO formDTO);
}

7
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventCategoryServiceImpl.java

@ -82,9 +82,8 @@ public class IcEventCategoryServiceImpl extends BaseServiceImpl<IcEventCategoryD
}
@Override
public IcEventCategoryEntity getByEventId(String eventId) {
LambdaQueryWrapper<IcEventCategoryEntity> query = new LambdaQueryWrapper<>();
query.eq(IcEventCategoryEntity::getIcEventId, eventId);
return baseDao.selectOne(query);
public IcEventCategoryEntity getByEventId(String icEventId) {
return baseDao.selectByEventId(icEventId);
}
}

7
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventOperationLogServiceImpl.java

@ -8,6 +8,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcEventOperationLogDao;
import com.epmet.dto.IcEventOperationLogDTO;
import com.epmet.dto.result.IcEventProcessListResultDTO;
import com.epmet.entity.IcEventOperationLogEntity;
import com.epmet.service.IcEventOperationLogService;
import org.apache.commons.lang3.StringUtils;
@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -80,4 +82,9 @@ public class IcEventOperationLogServiceImpl extends BaseServiceImpl<IcEventOpera
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public LinkedList<IcEventProcessListResultDTO> getByEventId(String icEventId) {
return baseDao.selectByEventId(icEventId);
}
}

7
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventReplyServiceImpl.java

@ -8,6 +8,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcEventReplyDao;
import com.epmet.dto.IcEventReplyDTO;
import com.epmet.dto.result.IcEventProcessListResultDTO;
import com.epmet.entity.IcEventReplyEntity;
import com.epmet.service.IcEventReplyService;
import org.apache.commons.lang3.StringUtils;
@ -15,6 +16,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@ -80,4 +82,9 @@ public class IcEventReplyServiceImpl extends BaseServiceImpl<IcEventReplyDao, Ic
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@Override
public LinkedList<IcEventProcessListResultDTO> getByEventId(String icEventId) {
return baseDao.selectByEventId(icEventId);
}
}

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

@ -22,14 +22,12 @@ import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.utils.*;
import com.epmet.dao.IcEventDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerDTO;
import com.epmet.dto.IcEventDTO;
import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.IssueProjectCategoryDictDTO;
import com.epmet.dto.form.*;
@ -42,6 +40,7 @@ import com.epmet.resi.group.constant.TopicConstant;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,6 +52,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -61,7 +61,9 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-05-17
*/
@Slf4j
@Service
public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntity> implements IcEventService, ResultDataResolver {
@Value("${openapi.scan.server.url}")
@ -90,6 +92,9 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
private IcEventOperationLogService icEventOperationLogService;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
@Autowired
private OperCrmOpenFeignClient crmOpenFeignClient;
@Override
public PageData<IcEventListResultDTO> list(IcEventListFormDTO formDTO) {
@ -103,7 +108,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, String> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2));
//与户主关系字典表数据
//事件管理字典表数据
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode());
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
@ -209,7 +214,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
//2.判断是否立项或转需求
//2-1.项目立项
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "1".equals(formDTO.getOperationType())) {
EventToProjectResultDTO project = projectTraceService.eventToProject(formDTO.getProject());
EventToProjectResultDTO project = projectTraceService.icEventToProject(formDTO.getProject());
formDTO.setOperationId(project.getProjectId());
}
//2-2.转需求
@ -230,6 +235,8 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
IcEventEntity entity = ConvertUtils.sourceToTarget(formDTO, IcEventEntity.class);
entity.setAgencyId(gridInfo.getPid());
entity.setGridPids(gridInfo.getPids());
entity.setLatestOperatedTime(new Date());
entity.setAuditStatus(TopicConstant.AUTO_PASSED);
insert(entity);
//3-2.附件数据保存
List<IcEventAttachmentEntity> imageEntityList = new ArrayList<>();
@ -294,8 +301,7 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
}
//转需求对应的操作记录
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "2".equals(formDTO.getOperationType())) {
date.setTime(date.getTime() + 6000 * 1);
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), date, "shift_demand", "shift_demand"));
logList.add(logEntity(formDTO.getCustomerId(), entity.getId(), formDTO.getUserId(), formDTO.getDemand().getWantServiceTime(), "shift_demand", "shift_demand"));
}
//选择了已完成
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())) {
@ -603,4 +609,350 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
PageInfo<IcEventResultDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* @Author sun
* @Description 事件管理-回复
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void reply(IcEventReplyFormDTO formDTO) {
//1.查询事件数据 判断是否允许回复
IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId());
if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许回复");
}
//2.修改事件数据
if (StringUtils.isNotBlank(formDTO.getOperationType()) && "closed_case".equals(formDTO.getStatus())){
entity.setStatus(formDTO.getStatus());
entity.setCloseCaseTime(new Date());
}
entity.setLatestOperatedTime(new Date());
baseDao.updateById(entity);
//3.新增回复数据
//获取当前工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
if (null == staffInfo) {
throw new EpmetException(String.format("查询工作人员%s缓存信息失败...", formDTO.getUserId()));
}
IcEventReplyEntity replyEntity = new IcEventReplyEntity();
replyEntity.setCustomerId(formDTO.getCustomerId());
replyEntity.setIcEventId(formDTO.getIcEventId());
replyEntity.setFromUserId(formDTO.getUserId());
replyEntity.setContent(formDTO.getContent());
replyEntity.setUserShowName(staffInfo.getAgencyName() + "-" + staffInfo.getRealName());
icEventReplyService.insert(replyEntity);
//4.判断新增或修改分类数据
if (StringUtils.isNotBlank(formDTO.getOperationType())) {
//查询分类信息
List<String> categoryList = new ArrayList<>();
categoryList.add(formDTO.getCategoryId());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
AtomicReference<IcEventCategoryEntity> categoryEntity = null;
category.getCategoryList().forEach(ca -> {
if (ca.getId().equals(formDTO.getCategoryId())) {
categoryEntity.set(new IcEventCategoryEntity());
categoryEntity.get().setCustomerId(formDTO.getCustomerId());
categoryEntity.get().setIcEventId(entity.getId());
categoryEntity.get().setCategoryId(ca.getId());
categoryEntity.get().setCategoryPids(ca.getPids());
categoryEntity.get().setCategoryCode(ca.getCategoryCode());
}
});
IcEventCategoryEntity icEventCategory = icEventCategoryService.getByEventId(formDTO.getIcEventId());
if (null == category) {
icEventCategoryService.insert(categoryEntity.get());
} else {
categoryEntity.get().setId(icEventCategory.getId());
icEventCategoryService.updateById(categoryEntity.get());
}
}
//5.新增操作记录数据
IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), new Date(), "reply", "reply");
icEventOperationLogService.insert(logEntity);
}
/**
* @Author sun
* @Description 事件管理-立项
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void icEventToProject(IcEventToProjectFormDTO formDTO) {
//1.查询事件数据
IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId());
if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许立项");
}
//2.调用事件立项接口
EventToProjectResultDTO project = projectTraceService.icEventToProject(formDTO);
//3.更新事件数据
entity.setOperationType("1");
entity.setOperationId(project.getProjectId());
entity.setLatestOperatedTime(new Date());
baseDao.updateById(entity);
//4.新增操作记录
IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getUserId(), new Date(), "shift_project", "shift_project");
icEventOperationLogService.insert(logEntity);
}
/**
* @Author sun
* @Description 事件管理-转需求
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void icEventToDemand(IcDemandFormDTO formDTO) {
//1.查询事件数据
IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId());
if (null == entity || "1".equals(entity.getOperationType()) || "2".equals(entity.getOperationType())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前事件不允许转需求");
}
//2.调用转需求接口
Result<DemandRecId> recIdResult = epmetHeartOpenFeignClient.icEventToDemand(formDTO);
if (!recIdResult.success() || recIdResult.getData() == null) {
throw new RenException(recIdResult.getCode(), recIdResult.getMsg());
}
//3.更新事件数据
entity.setOperationType("2");
entity.setOperationId(recIdResult.getData().getDemandRecId());
entity.setLatestOperatedTime(new Date());
baseDao.updateById(entity);
//4.新增操作记录
IcEventOperationLogEntity logEntity = logEntity(formDTO.getCustomerId(), formDTO.getIcEventId(), formDTO.getDemandUserId(), new Date(), "shift_demand", "shift_demand");
icEventOperationLogService.insert(logEntity);
}
/**
* 事件分类分析-一级分类下事件数量
*
* @param formDTO
* @return
*/
@Override
public List<IcEventCategoryAnalysisResDTO> categoryAnalysisTotal(IcEventCategoryAnalysisFormDTO formDTO) {
Result<List<IssueProjectCategoryDictDTO>> res = govIssueOpenFeignClient.queryFirstCategory(formDTO.getCustomerId());
if (!res.success() || CollectionUtils.isEmpty(res.getData())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "当前客户下未配置事件分类");
}
int length = res.getData().get(NumConstant.ZERO).getCategoryCode().length();
formDTO.setCategoryOneLength(length);
if ("agency".equals(formDTO.getOrgType())) {
formDTO.setGridPids(getEventGridPids(formDTO.getOrgId()));
}
List<IcEventCategoryAnalysisResDTO> resList = baseDao.selectFirstCategoryTotal(formDTO);
Map<String, IcEventCategoryAnalysisResDTO> resMap = resList.stream().collect(Collectors.toMap(IcEventCategoryAnalysisResDTO::getCategoryCode, Function.identity()));
List<IcEventCategoryAnalysisResDTO> result = new ArrayList<>();
for (IssueProjectCategoryDictDTO dict : res.getData()) {
IcEventCategoryAnalysisResDTO resultDto = ConvertUtils.sourceToTarget(dict, IcEventCategoryAnalysisResDTO.class);
resultDto.setTotal(MapUtils.isNotEmpty(resMap) && resMap.containsKey(dict.getCategoryCode()) ? resMap.get(dict.getCategoryCode()).getTotal() : NumConstant.ZERO);
result.add(resultDto);
}
return result;
}
/**
* @Author sun
* @Description 事件管理-评价
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void comment(IcEventReplyFormDTO formDTO) {
//1.查询事件是否存在
IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId());
if (null == entity || !"closed_case".equals(entity.getStatus()) || StringUtils.isNotBlank(entity.getSatisfaction())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "不允许评价,事件不存在或还未办结");
}
//2.判断当前评价人是否是事件创建人
if (!formDTO.getUserId().equals(entity.getCreatedBy())) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "不允许评价,当前评价人不是事件创建人");
}
//3.修改事件数据
entity.setCommentUserId(formDTO.getUserId());
entity.setSatisfaction(formDTO.getSatisfaction());
entity.setCommentTime(new Date());
baseDao.updateById(entity);
}
/**
* @Author sun
* @Description 事件管理-评价
**/
@Override
public IcEventListResultDTO detail(IcEventListFormDTO formDTO) {
IcEventListResultDTO resultDTO = new IcEventListResultDTO();
//1.获取事件基本信息
List<IcEventListResultDTO> list = baseDao.icEventList(formDTO);
if (!CollectionUtils.isEmpty(list)) {
resultDTO = list.get(0);
//查询网格名称(组织-网格)
List<String> gridIds = list.stream().map(IcEventListResultDTO::getGridId).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList());
Result<List<AllGridsByUserIdResultDTO>> gridInfoRes = govOrgOpenFeignClient.getGridListByGridIds(gridIds);
List<AllGridsByUserIdResultDTO> gridInfoList = gridInfoRes.success() && !org.apache.commons.collections4.CollectionUtils.isEmpty(gridInfoRes.getData()) ? gridInfoRes.getData() : new ArrayList<>();
Map<String, String> gridInfoMap = gridInfoList.stream().collect(Collectors.toMap(AllGridsByUserIdResultDTO::getGridId, AllGridsByUserIdResultDTO::getGridName, (key1, key2) -> key2));
//事件管理字典表数据
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.IC_EVENT_SOURCE_TYPE.getCode());
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>();
//封装数据
if (gridInfoMap.containsKey(resultDTO.getGridId())) {
resultDTO.setGridName(gridInfoMap.get(resultDTO.getGridId()));
}
if (StringUtils.isNotBlank(resultDTO.getSourceType())) {
resultDTO.setSourceTypeName(statusMap.get(resultDTO.getSourceType()));
}
//每个事件对应的图片数据
List<String> imageList = new ArrayList<>();
List<String> voiceList = new ArrayList<>();
resultDTO.getAttachmentList().forEach(file -> {
if ("image".equals(file.getType())) {
imageList.add(file.getUrl());
} else if ("voice".equals(file.getType())) {
voiceList.add(file.getUrl());
}
});
resultDTO.setImageList(imageList);
resultDTO.setVoiceList(voiceList);
//分类信息
if(StringUtils.isNotBlank(resultDTO.getCategoryId())){
List<String> categoryList = new ArrayList<>();
categoryList.add(resultDTO.getCategoryId());
CategoryTagResultDTO category = queryCategory(formDTO.getCustomerId(), categoryList);
for (IssueProjectCategoryDictDTO ca : category.getCategoryList()){
if (ca.getId().equals(resultDTO.getCategoryId())) {
resultDTO.setCategoryName(ca.getParentCategoryName()+"-"+ca.getCategoryName());
}
}
}
}
return resultDTO;
}
/**
* 事件分类分析- 饼图2直属下级 事件数量
*
* @param formDTO
* @return
*/
@Override
public List<IcEventAnalysisOrgResDTO> analysisOrgTotal(IcEventCategoryAnalysisFormDTO formDTO) {
List<IcEventAnalysisOrgResDTO> list = new ArrayList<>();
if ("grid".equals(formDTO.getOrgType())) {
GridInfoCache gridInfoCache = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
if (null == gridInfoCache) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "网格信息查询异常");
}
IcEventAnalysisOrgResDTO grid = ConvertUtils.sourceToTarget(formDTO,IcEventAnalysisOrgResDTO.class);
grid.setOrgName(gridInfoCache.getGridName());
grid.setTotal(baseDao.selectGridTotal(formDTO.getOrgId()));
list.add(grid);
return list;
}
Result<List<SubOrgResDTO>> subOrgListRes = govOrgOpenFeignClient.subOrgList(formDTO.getOrgId());
if (!subOrgListRes.success() || CollectionUtils.isEmpty(subOrgListRes.getData())) {
return list;
}
for (SubOrgResDTO org : subOrgListRes.getData()) {
IcEventAnalysisOrgResDTO resultDto = ConvertUtils.sourceToTarget(org, IcEventAnalysisOrgResDTO.class);
resultDto.setTotal(baseDao.selectOrgTotal(org.getOrgId(), org.getOrgType()));
list.add(resultDto);
}
return list;
}
/**
* Desc: 定时任务自动评价
* @param formDTO
* @author zxc
* @date 2022/5/18 16:35
*/
@Override
public void autoEvaluation(AutoEvaluationFormDTO formDTO) {
List<String> customerIds = new ArrayList<>();
if (StringUtils.isBlank(formDTO.getCustomerId())){
Result<List<CustomerDTO>> allCustomerList = crmOpenFeignClient.getAllCustomerList();
if (!allCustomerList.success()){
throw new EpmetException("查询所有客户失败");
}
List<CustomerDTO> data = allCustomerList.getData();
customerIds.addAll(data.stream().map(m -> m.getId()).collect(Collectors.toList()));
}else {
customerIds.add(formDTO.getCustomerId());
}
customerIds.forEach(c -> {
autoEvaluationDispose(c);
});
}
/**
* Desc: 处理未评价的icEvent
* @param customerId
* @author zxc
* @date 2022/5/18 16:52
*/
@Transactional(rollbackFor = Exception.class)
public void autoEvaluationDispose(String customerId){
Integer no = NumConstant.ONE;
Integer size = NumConstant.ONE_HUNDRED;
List<String> ids = new ArrayList<>();
do {
int start = (no - NumConstant.ONE) * size;
ids = baseDao.getAutoEvaluationIds(customerId,start,size);
// 批量更新
baseDao.updateAutoEvaluation(ids);
no++;
}while (ids.size() == size);
}
/**
* @Author sun
* @Description 事件管理-处理进展
**/
@Override
public LinkedList<IcEventProcessListResultDTO> process(IcEventReplyFormDTO formDTO) {
LinkedList<IcEventProcessListResultDTO> resultList = new LinkedList<IcEventProcessListResultDTO>();
//1.查询事件基础信息
IcEventEntity entity = baseDao.selectById(formDTO.getIcEventId());
if (null == entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "事件不存在");
}
//2.查询事件回复信息
LinkedList<IcEventProcessListResultDTO> event = icEventReplyService.getByEventId(formDTO.getIcEventId());
//3.判断查询事件项目进展或需求进展信息
//项目进展
if ("1".equals(entity.getOperationType())) {
ProcessListV2FormDTO processListV2FormDTO = new ProcessListV2FormDTO();
processListV2FormDTO.setProjectId(entity.getOperationId());
List<ProcessListV2ResultDTO> project = projectTraceService.processListV2(processListV2FormDTO);
resultList.addAll(ConvertUtils.sourceToTarget(project, IcEventProcessListResultDTO.class));
}
//需求进展
if ("2".equals(entity.getOperationType())) {
LinkedList<IcEventProcessListResultDTO> demand = icEventOperationLogService.getByEventId(formDTO.getIcEventId());
resultList.addAll(demand);
}
resultList.addAll(event);
return resultList;
}
}

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

@ -1162,6 +1162,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
projectEntity.setTitle(issueDTO.getIssueTitle());
projectEntity.setStatus(ProjectConstant.PENDING);
projectEntity.setOrgIdPath(issueDTO.getOrgIdPath());
projectEntity.setGridId(formDTO.getGridId());
projectEntity.setLocateAddress(null == formDTO.getTopicDTO().getAddress() ? "" : formDTO.getTopicDTO().getAddress());
projectEntity.setLocateLongitude(null == formDTO.getTopicDTO().getLongitude() ? "" : formDTO.getTopicDTO().getLongitude());
projectEntity.setLocateDimension(null == formDTO.getTopicDTO().getDimension() ? "" : formDTO.getTopicDTO().getDimension());
@ -1176,6 +1177,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
processEntity.setOperationName(ProjectConstant.OPERATION_CREATED_NAME);
processEntity.setPublicReply(formDTO.getPublicReply());
processEntity.setInternalRemark(formDTO.getInternalRemark());
processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId());
processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType());
agencyDeptGrid.getAgencyList().forEach(agency -> {
if (issueDTO.getOrgId().equals(agency.getId())) {
processEntity.setDepartmentName(agency.getOrganizationName());
@ -3191,9 +3194,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}
formDTO.setAgencyId(staffInfo.getAgencyId());
PageData<ProjectManageListResultDTO> result = new PageData<>(new ArrayList<>(),NumConstant.ZERO);
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
List<ProjectManageListResultDTO> projectManageList = baseDao.getProjectManageList(formDTO);
PageInfo<ProjectManageListResultDTO> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getProjectManageList(formDTO));
List<ProjectManageListResultDTO> projectManageList = pageInfo.getList();
if (CollectionUtils.isNotEmpty(projectManageList)){
// 获取滞留天数
Integer days = getDays(ConvertUtils.sourceToTarget(formDTO, ProjectListFromDTO.class));
@ -3210,23 +3212,23 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
List<String> departmentNameList = new ArrayList<>();
if (ProjectConstant.CLOSED.equals(p.getStatus())) {
p.setDepartmentNameList(departmentNameList);
p.setDetentionDays(NumConstant.ZERO);
p.setDetentionDays(NumConstant.ZERO_STR);
} else {
ProjectDTO projectDTO = ConvertUtils.sourceToTarget(p, ProjectDTO.class);
projectDTO.setId(p.getProjectId());
if (p.getIsHandle().equals("unhandled")){
String detentionDays = getDetentionDays(projectDTO);
if (!ONE_DAY.equals(detentionDays) && Integer.parseInt(detentionDays) > days) {
p.setDetentionDays(Integer.valueOf(detentionDays));
p.setDetentionDays(detentionDays);
} else {
p.setDetentionDays(Integer.valueOf(detentionDays));
p.setDetentionDays(detentionDays);
}
}
departmentNameList = baseDao.selectDepartmentNameList(projectDTO);
p.setDepartmentNameList(departmentNameList);
}
});
result.setTotal(projectManageList.size());
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
result.setList(projectManageList);
}
return result;

232
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

@ -705,7 +705,7 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
//事件已经立项,不能重复操作
ResiEventEntity resiEventEntity=resiEventService.getById(formDTO.getEventId());
//TODO 兼容新事件表
String gridId = "";
String gridId = formDTO.getGridId();
if(null==resiEventEntity||resiEventEntity.getShiftProject()){
throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(),EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg());
}
@ -1225,4 +1225,234 @@ public class ProjectTraceServiceImpl<ProjectTagService> implements ProjectTraceS
epmetMessageOpenFeignClient.saveUserMessage(userMessage);
}
/**
* 事件管理-事件立项赶时间没空兼容
* @author sun
*/
@Override
public EventToProjectResultDTO icEventToProject(IcEventToProjectFormDTO formDTO) {
//判断是否存在已立项
List<ProjectEntity> projectEntityList = projectService.getByOriginId(formDTO.getIcEventId());
if (!CollectionUtils.isEmpty(projectEntityList)) {
throw new RenException(EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getCode(), EpmetErrorCode.RESI_EVENT_SHIFT_PROJECT.getMsg());
}
List<TickStaffFormDTO> staffList = formDTO.getStaffList();
//1.文字内容安全校验
List<String> list = new ArrayList<>();
list.add(formDTO.getTitle());
list.add(formDTO.getPublicReply());
list.add(formDTO.getPublicReply());
list.add(formDTO.getInternalRemark());
safetyCheck(list);
//2.数据准备
//2-1获取当前工作人员基本信息
EventToProjectFormDTO eventToProjectFormDTO = ConvertUtils.sourceToTarget(formDTO, EventToProjectFormDTO.class);
LoginUserDetailsResultDTO loginUser = queryLoginUserInfo(eventToProjectFormDTO);
//2-2.调用gov-org服务,获取所有勾选人员以及议题数据对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值使用
AgencyDeptGridResultDTO agencyDeptGrid = getAgencyDeptGridRes(formDTO.getStaffList(), loginUser.getAgencyId());
//2-3.调用issue服务,查询分类、标签数据信息
CategoryTagResultDTO categoryTagResultDTO = queryCategoryTagRes(eventToProjectFormDTO);
List<IssueProjectCategoryDictDTO> categoryList = categoryTagResultDTO.getCategoryList();
List<IssueProjectTagDictDTO> tagList = categoryTagResultDTO.getTagList();
//2-4.批量查询被勾选工作人员基础信息
List<StaffListResultDTO> staffInfoList = queryStaffListRes(formDTO.getStaffList(), formDTO.getUserId());
//3.封装保存业务数据
//3-1.项目主表新增数据
ProjectEntity projectEntity = new ProjectEntity();
projectEntity.setCustomerId(formDTO.getCustomerId());
//立项人的所属组织id
projectEntity.setAgencyId(loginUser.getAgencyId());
projectEntity.setOrigin("ic_event");
projectEntity.setOriginId(formDTO.getIcEventId());
projectEntity.setTitle(formDTO.getTitle());
projectEntity.setBackGround(formDTO.getPublicReply());
projectEntity.setGridId(formDTO.getGridId());
projectEntity.setStatus(ProjectConstant.PENDING);
projectEntity.setOrgIdPath(loginUser.getOrgIdPath());
projectEntity.setLocateAddress(null == formDTO.getLocateAddress() ? "" : formDTO.getLocateAddress());
projectEntity.setLocateLongitude(null == formDTO.getLocateLongitude() ? "" : formDTO.getLocateLongitude());
projectEntity.setLocateDimension(null == formDTO.getLocateDimension() ? "" : formDTO.getLocateDimension());
projectService.insert(projectEntity);
//3-2.项目进展表新增第一个节点数据
ProjectProcessEntity processEntity = new ProjectProcessEntity();
processEntity.setProjectId(projectEntity.getId());
processEntity.setCustomerId(formDTO.getCustomerId());
processEntity.setStaffId(formDTO.getUserId());
processEntity.setOperation(ProjectConstant.OPERATION_CREATED);
processEntity.setOperationName(ProjectConstant.OPERATION_PROJECT_APPROVAL);
processEntity.setPublicReply(formDTO.getPublicReply());
processEntity.setInternalRemark(formDTO.getInternalRemark());
processEntity.setAssistanceUnitId(formDTO.getAssistanceUnitId());
processEntity.setAssistanceUnitType(formDTO.getAssistanceUnitType());
agencyDeptGrid.getAgencyList().forEach(agency -> {
if (loginUser.getAgencyId().equals(agency.getId())) {
processEntity.setDepartmentName(agency.getOrganizationName());
processEntity.setAgencyId(agency.getId());
if (org.apache.commons.lang3.StringUtils.isBlank(agency.getPids()) || org.apache.commons.lang3.StringUtils.equals(NumConstant.ZERO_STR, agency.getPids().trim()) || "".equals(agency.getPids().trim())) {
processEntity.setOrgIdPath(agency.getId());
} else {
processEntity.setOrgIdPath(agency.getPids().concat(":").concat(agency.getId()));
}
}
});
projectProcessService.insert(processEntity);
//3-3.项目人员表批量新增数据
List<ProjectStaffEntity> entityList = new ArrayList<>();
staffList.forEach(ts -> {
ProjectStaffEntity entity = ConvertUtils.sourceToTarget(ts, ProjectStaffEntity.class);
entity.setOrgId(ts.getAgencyId());
entity.setProjectId(projectEntity.getId());
entity.setProcessId(processEntity.getId());
entity.setIsHandle(ProjectConstant.UNHANDLED);
agencyDeptGrid.getAgencyList().forEach(agency -> {
if (ts.getAgencyId().equals(agency.getId())) {
entity.setCustomerId(agency.getCustomerId());
entity.setOrgIdPath(("".equals(agency.getPids()) ? "" : agency.getPids() + ":") + agency.getId());
entity.setDepartmentName(agency.getOrganizationName());
}
});
if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getDepartmentId())) {
agencyDeptGrid.getDeptList().forEach(dept -> {
if (ts.getDepartmentId().equals(dept.getId())) {
entity.setDepartmentName(entity.getDepartmentName() + "-" + dept.getDepartmentName());
}
});
}
if (org.apache.commons.lang3.StringUtils.isNotBlank(ts.getGridId())) {
agencyDeptGrid.getGridList().forEach(grid -> {
if (ts.getGridId().equals(grid.getId())) {
entity.setDepartmentName(entity.getDepartmentName() + "-" + grid.getGridName());
}
});
}
entityList.add(entity);
});
projectStaffService.insertBatch(entityList);
//3-4.项目附件表新增数据
if ((null != formDTO.getPublicFile() && formDTO.getPublicFile().size() > NumConstant.ZERO)
|| (null != formDTO.getInternalFile() && formDTO.getInternalFile().size() > NumConstant.ZERO)) {
projectService.saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), formDTO.getCustomerId(), projectEntity.getId(), processEntity.getId());
}
//3-5.项目分类表新增数据
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getCategoryList())) {
List<ProjectCategoryEntity> categoryEntityList = new ArrayList<>();
formDTO.getCategoryList().forEach(item -> {
categoryList.forEach(ca -> {
if (item.getId().equals(ca.getId())) {
ProjectCategoryEntity entity = new ProjectCategoryEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setProjectId(projectEntity.getId());
entity.setCategoryId(item.getId());
entity.setCategoryPids(ca.getPids());
entity.setCategoryCode(ca.getCategoryCode());
entity.setGridId(formDTO.getGridId());
categoryEntityList.add(entity);
}
});
});
projectCategoryService.insertBatch(categoryEntityList);
}
//3-6.项目标签表新增数据
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(formDTO.getTagList())) {
List<ProjectTagsEntity> tagEntityList = new ArrayList<>();
formDTO.getTagList().forEach(item -> {
tagList.forEach(ta -> {
if (item.getId().equals(ta.getId())) {
ProjectTagsEntity entity = new ProjectTagsEntity();
entity.setCustomerId(formDTO.getCustomerId());
entity.setProjectId(projectEntity.getId());
entity.setTagId(item.getId());
entity.setTagName(ta.getTagName());
tagEntityList.add(entity);
}
});
});
projectTagsService.insertBatch(tagEntityList);
}
//3-7:初始化机关-项目时间关联数据
Date current = new Date();
List<String> projectStaffIds = entityList.stream().map(ProjectStaffEntity::getId).distinct().collect(Collectors.toList());
if (!org.apache.commons.collections4.CollectionUtils.isEmpty(projectStaffIds)) {
List<ProjectOrgRelationEntity> container = new LinkedList<>();
projectStaffIds.forEach(o -> {
ProjectOrgRelationEntity period = new ProjectOrgRelationEntity();
period.setProjectStaffId(o);
period.setInformedDate(current);
period.setSourceOperation(ProjectConstant.OPERATION_CREATED);
period.setCreatedBy(formDTO.getUserId());
container.add(period);
});
relationDao.insertBatch(container);
}
//4.推送站内信、微信、短信消息
//4-1.调用epmet-message服务,给工作端勾选的工作人员发送消息
if (!shiftProjectMessage(formDTO.getStaffList(), formDTO.getCustomerId(), formDTO.getTitle(), projectEntity.getId()).success()) {
throw new RenException("事件转为项目,推送站内信失败");
}
//4-2.以及政府端调用epmet-message服务,给工作端工作人员推送微信订阅消息
if (!wxmpShiftProjectMessage(formDTO.getStaffList(), formDTO.getCustomerId(), formDTO.getTitle()).success()) {
logger.error("事件转为项目,推送微信订阅消息失败!");
}
//4-3.吹哨短信消息
List<ProjectSendMsgFormDTO> smsList = new ArrayList<>();
staffList.forEach(staff -> {
staffInfoList.forEach(st -> {
if (staff.getStaffId().equals(st.getStaffId())) {
ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO();
sms.setCustomerId(st.getCustomerId());
sms.setMobile(st.getMobile());
sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER);
sms.setParameterKey("send_msg");
smsList.add(sms);
}
});
});
Result result = epmetMessageOpenFeignClient.projectSendMsg(smsList);
if (!result.success()) {
logger.error("项目吹哨,发送手机短信失败" + JSON.toJSONString(result));
}
//5.项目实时统计消息
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String mqMsgBrief = String.format("创建了\"%s\"的项目", formDTO.getTitle());
ProjectChangedMQMsg mqMsg = new ProjectChangedMQMsg(projectEntity.getCustomerId(), ProjectConstant.OPERATION_CREATED,
projectEntity.getId(),
formDTO.getUserId(),
new Date(),
mqMsgBrief,
IpUtils.getIpAddr(request),
loginUserUtil.getLoginUserApp(),
loginUserUtil.getLoginUserClient());
boolean msgResult = SendMqMsgUtil.build().openFeignClient(epmetMessageOpenFeignClient).sendProjectChangedMqMsg(mqMsg);
if (!msgResult) {
log.error("项目实时统计消息发送失败");
}
// 数据上链
try {
blockChainUploadService.send2BlockChain(projectEntity, processEntity, entityList, null);
} catch (Exception e) {
String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e);
log.error("【项目流转】上链失败,错误信息:{}", errorMsg);
}
EventToProjectResultDTO resultDTO = new EventToProjectResultDTO();
resultDTO.setProjectId(projectEntity.getId());
return resultDTO;
}
}

15
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventCategoryDao.xml

@ -3,6 +3,19 @@
<mapper namespace="com.epmet.dao.IcEventCategoryDao">
<select id="selectByEventId" resultType="com.epmet.entity.IcEventCategoryEntity">
SELECT
id,
customer_id,
ic_event_id,
category_id,
category_pids,
category_code
FROM
ic_event_category
WHERE
del_flag = '0'
AND ic_event_id = #{icEventId}
</select>
</mapper>

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

@ -3,27 +3,21 @@
<mapper namespace="com.epmet.dao.IcEventDao">
<!-- 更新评价,默认 perfect -->
<update id="updateAutoEvaluation">
UPDATE ic_event
SET SATISFACTION = 'perfect',
COMMENT_USER_ID = 'APP_USER',
COMMENT_TIME = NOW(),
LATEST_OPERATED_TIME = NOW(),
UPDATED_TIME = NOW()
WHERE ID IN (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
<resultMap id="icEventMap" type="com.epmet.dto.result.IcEventListResultDTO">
<id property="eventId" column="id"/>
<result property="gridId" column="grid_id"/>
<result property="sourceType" column="source_type" />
<result property="address" column="address" />
<result property="name" column="name" />
<result property="mobile" column="mobile" />
<result property="satisfaction" column="satisfaction" />
<result property="satisfactionName" column="satisfaction" />
<result property="createdTime" column="created_time" />
<result property="status" column="status" />
<result property="createdUserId" column="created_by" />
<collection property="attachmentList" ofType="com.epmet.dto.result.IcEventListResultDTO$Attachment">
<result column="icEventAttachmentId"/><!-- 附件表ID,如果附件url和type一样会被去重 加上id就可以了 -->
<result column="url" property="url"/>
<result column="type" property="type"/>
<result column="duration" property="duration"/>
</collection>
</resultMap>
<select id="getProcessStatusRatio" resultType="java.util.Map">
select STATUS status, count(1) eventCount
from ic_event e
@ -91,9 +85,29 @@
</select>
<resultMap id="icEventMap" type="com.epmet.dto.result.IcEventListResultDTO">
<id property="icEventId" column="id"/>
<result property="gridId" column="grid_id"/>
<result property="sourceType" column="source_type" />
<result property="address" column="address" />
<result property="name" column="name" />
<result property="mobile" column="mobile" />
<result property="satisfaction" column="satisfaction" />
<result property="satisfactionName" column="satisfaction" />
<result property="createdTime" column="created_time" />
<result property="status" column="status" />
<result property="createdUserId" column="created_by" />
<result property="categoryId" column="CATEGORY_ID" />
<collection property="attachmentList" ofType="com.epmet.dto.result.IcEventListResultDTO$Attachment">
<result column="icEventAttachmentId"/><!-- 附件表ID,如果附件url和type一样会被去重 加上id就可以了 -->
<result column="url" property="url"/>
<result column="type" property="type"/>
<result column="duration" property="duration"/>
</collection>
</resultMap>
<select id="icEventList" parameterType="map" resultMap="icEventMap">
SELECT
ie.id eventId,
ie.id icEventId,
ie.grid_id gridId,
ie.event_content eventContent,
ie.source_type sourceType,
@ -109,12 +123,17 @@
rea.id AS iceventattachmentid,
rea.attachment_url AS url,
rea.attachment_type AS type,
rea.duration AS duration
rea.duration AS duration,
iec.category_id AS categoryId
FROM
ic_event ie
LEFT JOIN ic_event_attachment rea ON(ie.id = rea.ic_event_id AND rea.del_flag = '0')
LEFT JOIN ic_event_category iec ON(ie.id = iec.ic_event_id AND iec.del_flag = '0')
WHERE
ie.del_flag = '0'
<if test="icEventId != null and icEventId != '' ">
AND ie.id = #{icEventId}
</if>
<if test="gridId != null and gridId != '' ">
AND ie.grid_id = #{gridId}
</if>
@ -158,5 +177,63 @@
order by e.HAPPEN_TIME desc
</select>
<select id="selectFirstCategoryTotal" parameterType="com.epmet.dto.form.IcEventCategoryAnalysisFormDTO" resultType="com.epmet.dto.result.IcEventCategoryAnalysisResDTO">
SELECT LEFT
( c.CATEGORY_CODE, #{categoryOneLength} ) CATEGORY_CODE,
COUNT( DISTINCT c.IC_EVENT_ID ) total
FROM
ic_event_category c
LEFT JOIN ic_event e ON ( c.IC_EVENT_ID = e.ID AND e.DEL_FLAG = '0' )
WHERE
c.DEL_FLAG = '0'
AND c.CUSTOMER_ID = #{customerId}
and e.HAPPEN_TIME >= #{queryStartTime}
and e.HAPPEN_TIME <![CDATA[<=]]> #{queryEndTime}
<if test="orgType == 'agency'">
and e.GRID_PIDS like CONCAT(#{gridPids},'%')
</if>
<if test="orgType == 'grid'">
and e.GRID_ID=#{orgId}
</if>
GROUP BY
LEFT ( c.CATEGORY_CODE, #{categoryOneLength} )
ORDER BY
total DESC
</select>
<!-- 查询客户下可以自动评价事件的ID -->
<select id="getAutoEvaluationIds" resultType="java.lang.String">
SELECT ID
FROM ic_event
WHERE DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
AND `STATUS` = 'closed_case'
AND SATISFACTION = null
AND UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(CLOSE_CASE_TIME) > 60*60*24*7
LIMIT #{no},#{size}
</select>
<select id="selectGridTotal" parameterType="java.lang.String" resultType="java.lang.Integer">
SELECT
count( ie.id ) as total
FROM
ic_event ie
WHERE
ie.DEL_FLAG = '0'
AND ie.GRID_ID =#{gridId}
</select>
<select id="selectOrgTotal" parameterType="map" resultType="java.lang.Integer">
SELECT
count( ie.id ) as total
FROM
ic_event ie
WHERE
ie.DEL_FLAG = '0'
<if test="orgType == 'agency'">
and ie.GRID_PIDS like CONCAT('%',#{orgId},'%')
</if>
<if test="orgType == 'grid'">
and ie.GRID_ID=#{orgId}
</if>
</select>
</mapper>

18
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventOperationLogDao.xml

@ -3,6 +3,22 @@
<mapper namespace="com.epmet.dao.IcEventOperationLogDao">
<select id="selectByEventId" resultType="com.epmet.dto.result.IcEventProcessListResultDTO">
SELECT
id processId,
'demand' type,
if(action_desc = 'shift_demand', '转服务', '需求完成') processName,
UNIX_TIMESTAMP(created_time) processTime,
operate_time serviceTime,
service_party serviceParty,
actual_service_time actualServiceTime
FROM
ic_event_operation_log
WHERE
del_flag = '0'
AND action_desc in('shift_demand','close_demand')
AND ic_event_id = #{icEventId}
ORDER BY created_time DESC
</select>
</mapper>

16
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/IcEventReplyDao.xml

@ -3,6 +3,20 @@
<mapper namespace="com.epmet.dao.IcEventReplyDao">
<select id="selectByEventId" resultType="com.epmet.dto.result.IcEventProcessListResultDTO">
SELECT
id processId,
'event' type,
'回复' processName,
UNIX_TIMESTAMP(created_time) processTime,
user_show_name departmentName,
content publicReply
FROM
ic_event_reply
WHERE
del_flag = '0'
AND ic_event_id = #{icEventId}
ORDER BY created_time DESC
</select>
</mapper>

3
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -598,11 +598,10 @@
<if test='null != endDate and endDate != "" '>
AND DATE_FORMAT(p.CREATED_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
<if test='null != status and status != "all" '>
<if test='null != status and status != "" and status != "all" '>
AND p.`STATUS` = #{status}
</if>
GROUP BY t.PROJECT_ID
ORDER BY p.CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
</mapper>
Loading…
Cancel
Save