Browse Source

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

dev
jianjun 4 years ago
parent
commit
e32c245b93
  1. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 15
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java
  3. 15
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java
  4. 20
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java
  5. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java
  6. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java
  7. 20
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java
  8. 19
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/heart/VolunteerDemandServiceFormDTO.java
  9. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java
  10. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java
  11. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java
  12. 44
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java
  13. 13
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml
  14. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java
  15. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java
  16. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java
  17. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java
  18. 83
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java
  19. 14
      epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.27__volunteer_service_daily_add_gridid.sql
  20. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml
  21. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml
  22. 11
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java
  23. 13
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CancelDemandFormDTO.java
  24. 44
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java
  25. 27
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java
  26. 34
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java
  27. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/TakeOrderFormDTO.java
  28. 37
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java
  29. 12
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java
  30. 100
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java
  31. 79
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java
  32. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
  33. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/FinishResultDTO.java
  34. 15
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/TakeOrderResultDTO.java
  35. 1
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java
  36. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java
  37. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcUserDemandRecController.java
  38. 156
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java
  39. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiVolunteerController.java
  40. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  41. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  42. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java
  43. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandOperateLogEntity.java
  44. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java
  45. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java
  46. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  47. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  48. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/VolunteerInfoService.java
  49. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  50. 313
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  51. 122
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java
  52. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql
  53. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  54. 43
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  55. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml
  56. 30
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ResiEventAutoAuditTask.java
  57. 12
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java
  58. 13
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java
  59. 6
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java
  60. 6
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java
  61. 10
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java
  62. 11
      epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml
  63. 2
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java
  64. 26
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  65. 4
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
  66. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java
  67. 15
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java
  68. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java
  69. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java
  70. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java
  71. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java
  72. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java
  73. 16
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java
  74. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AllMattersFormDTO.java
  75. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java
  76. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java
  77. 16
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java
  78. 26
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgMobileFormDTO.java
  79. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java
  80. 12
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java
  81. 43
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java
  82. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java
  83. 14
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java
  84. 16
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java
  85. 17
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java
  86. 14
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java
  87. 25
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgMobileResultDTO.java
  88. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  89. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java
  90. 14
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java
  91. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java
  92. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java
  93. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java
  94. 15
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java
  95. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java
  96. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java
  97. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java
  98. 9
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/IcPartyServiceCenterService.java
  99. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  100. 10
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -93,7 +93,8 @@ public enum EpmetErrorCode {
DEMAND_CAN_NOT_UPDATE(8223,"当前状态,不可更新需求"),
DEMAND_NOT_EXITS(8224,"需求不存在"),
DEMAND_SERVICE_NOT_EXITS(8225,"服务记录不存在"),
DEMAND_CAN_NOT_TAKE_ORDER(8226, "当前状态,不可接单"),
DEMAND_CAN_NOT_EVALUATE(8227, "当前状态,不可评价"),
REQUIRE_PERMISSION(8301, "您没有足够的操作权限"),
THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"),

15
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.java

@ -157,4 +157,19 @@ public class CustomerAgencyDTO implements Serializable {
* 中心位置纬度
*/
private String latitude;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

15
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java

@ -94,4 +94,19 @@ public class CustomerDepartmentDTO implements Serializable {
*/
private Date updatedTime;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

20
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java

@ -133,4 +133,24 @@ public class CustomerGridDTO implements Serializable {
* 组织-网格
*/
private String gridNamePath;
/**
* 网格编码
*/
private String code;
/**
* 组织编码
*/
private String gridType;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.java

@ -108,4 +108,19 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
* 社区
*/
private String community;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java

@ -64,4 +64,19 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity {
* 部门所属的行政地区编码:实际就是所属组织的地区编码
*/
private String areaCode;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

20
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java

@ -79,4 +79,24 @@ public class CustomerGridEntity extends BaseEpmetEntity {
* 所有上级组织ID
*/
private String pids;
/**
* 网格编码
*/
private String code;
/**
* 组织编码
*/
private String gridType;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

19
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/heart/VolunteerDemandServiceFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dto.form.heart;
import lombok.Data;
/**
* @Description
* @Author wangxianzhang
* @Date 2021/12/22 3:12 下午
* @Version 1.0
*/
@Data
public class VolunteerDemandServiceFormDTO {
/**
* 组织ID
*/
private String agencyId;
}

12
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/heart/DataReportHeartDemandController.java

@ -3,10 +3,13 @@ package com.epmet.datareport.controller.heart;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.heart.DemandService;
import com.epmet.dto.form.heart.VolunteerDemandServiceFormDTO;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -29,9 +32,14 @@ public class DataReportHeartDemandController {
* @return
*/
@PostMapping("volunteer/service")
public Result<VolunteerDemandServiceStatsResultDTO> getVolunteerServiceStats(@LoginUser TokenDto loginUser) {
public Result<VolunteerDemandServiceStatsResultDTO> getVolunteerServiceStats(@LoginUser TokenDto loginUser, @RequestBody VolunteerDemandServiceFormDTO input) {
ValidatorUtils.validateEntity(input);
String agencyId = input.getAgencyId();
String customerId = loginUser.getCustomerId();
VolunteerDemandServiceStatsResultDTO r = demandService.getVolunteerServiceStats(customerId);
VolunteerDemandServiceStatsResultDTO r = demandService.getVolunteerServiceStats(customerId, agencyId);
return new Result<VolunteerDemandServiceStatsResultDTO>().ok(r);
}

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactVolunteerServiceDailyDao.java

@ -36,8 +36,9 @@ public interface FactVolunteerServiceDailyDao extends BaseDao<FactVolunteerServi
/**
* 查询最新一条"志愿者需求服务统计信息"
* @param customerId
* @param customerId 客户ID
* @param agencyPids 查询条件的组织的PIDS
* @return
*/
VolunteerDemandServiceStatsResultDTO getLatestVolunteerDemandServiceStats(@Param("customerId") String customerId);
VolunteerDemandServiceStatsResultDTO getLatestVolunteerDemandServiceStats(@Param("customerId") String customerId, @Param("agencyPids") String agencyPids);
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/DemandService.java

@ -9,5 +9,5 @@ import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
* @Version 1.0
*/
public interface DemandService {
VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId);
VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId, String agencyId);
}

44
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/heart/impl/DemandServiceImpl.java

@ -1,12 +1,14 @@
package com.epmet.datareport.service.heart.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.datareport.dao.fact.FactVolunteerServiceDailyDao;
import com.epmet.datareport.entity.heart.FactVolunteerServiceDailyEntity;
import com.epmet.datareport.service.heart.DemandService;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO;
import com.epmet.feign.GovOrgOpenFeignClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -17,13 +19,41 @@ import org.springframework.stereotype.Service;
* @Version 1.0
*/
@Service
public class DemandServiceImpl implements DemandService {
public class DemandServiceImpl implements DemandService, ResultDataResolver {
@Autowired
private FactVolunteerServiceDailyDao factVolunteerServiceDailyDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId) {
return factVolunteerServiceDailyDao.getLatestVolunteerDemandServiceStats(customerId);
public VolunteerDemandServiceStatsResultDTO getVolunteerServiceStats(String customerId, String agencyId) {
String errorMsg = "【查询志愿者需求服务信息】查询选中组织信息失败";
CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(agencyId),
ServiceConstant.GOV_ORG_SERVER,
EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),
errorMsg, errorMsg);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
String agencyIdPath = agencyInfo.getPids().concat(":").concat(agencyId);
agencyIdPath = agencyIdPath.startsWith(":") ? agencyIdPath.replaceFirst(":", "") : agencyIdPath;
VolunteerDemandServiceStatsResultDTO r = factVolunteerServiceDailyDao.getLatestVolunteerDemandServiceStats(customerId, agencyIdPath);
if (r == null) {
r = new VolunteerDemandServiceStatsResultDTO();
r.setCustomerId(customerId);
r.setDateId(null);
r.setPartyServiceTotal(0);
r.setServiceTotal(0);
r.setResiServiceTotal(0);
r.setVolunteerTotal(0);
r.setPartyTotal(0);
r.setResiTotal(0);
}
return r;
}
}

13
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactVolunteerServiceDailyDao.xml

@ -24,12 +24,21 @@
<select id="getLatestVolunteerDemandServiceStats"
resultType="com.epmet.dto.result.heart.VolunteerDemandServiceStatsResultDTO">
select *
select CUSTOMER_ID CUSTOMER_ID,
DATE_ID DATE_ID,
sum(VOLUNTEER_TOTAL) VOLUNTEER_TOTAL,
sum(PARTY_TOTAL) PARTY_TOTAL,
sum(RESI_TOTAL) RESI_TOTAL,
sum(SERVICE_TOTAL) SERVICE_TOTAL,
sum(PARTY_SERVICE_TOTAL) PARTY_SERVICE_TOTAL,
sum(RESI_SERVICE_TOTAL) RESI_SERVICE_TOTAL
from fact_volunteer_service_daily
where DEL_FLAG = 0
and CUSTOMER_ID = #{customerId}
and PIDS like CONCAT(#{agencyPids}, "%")
group by CUSTOMER_ID, DATE_ID
order by DATE_ID desc
limit 1
limit 1
</select>

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/heart/IcUserDemandServiceDao.java

@ -40,5 +40,5 @@ public interface IcUserDemandServiceDao extends BaseDao<IcUserDemandServiceEntit
* @param customerId 客户id
* @param serviceType 服务者类型
*/
List<DemandServiceCountResultDTO> listDemandServeTimes(@Param("customerId") String customerId, @Param("endTime") Date endTime, @Param("serviceType") String serviceType);
List<DemandServiceCountResultDTO> listDemandServeTimes(@Param("customerId") String customerId, @Param("gridId") String gridId, @Param("endTime") Date endTime, @Param("serviceType") String serviceType);
}

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactVolunteerServiceDailyEntity.java

@ -43,6 +43,11 @@ public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
* yyyyMMdd
*/
@ -82,5 +87,9 @@ public class FactVolunteerServiceDailyEntity extends BaseEpmetEntity {
* 居民服务总次数
*/
private Integer resiServiceTotal;
private String pid;
private String pids;
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/HeartDemandService.java

@ -11,5 +11,5 @@ import java.util.List;
*@Date 2021/12/8
*/
public interface HeartDemandService {
List<DemandServiceCountResultDTO> listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize);
List<DemandServiceCountResultDTO> listDemandServeTimesPage(String customerId, String gridId, Date endTime, int serviceCountPageNo, int serviceCountPageSize);
}

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/heart/impl/HeartDemandServiceImpl.java

@ -29,11 +29,11 @@ public class HeartDemandServiceImpl implements HeartDemandService {
private IcUserDemandServiceDao demandServiceDao;
@Override
public List<DemandServiceCountResultDTO> listDemandServeTimesPage(String customerId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) {
public List<DemandServiceCountResultDTO> listDemandServeTimesPage(String customerId, String gridId, Date endTime, int serviceCountPageNo, int serviceCountPageSize) {
return PageHelper.startPage(serviceCountPageNo, serviceCountPageSize).doSelectPage(new ISelect() {
@Override
public void doSelect() {
demandServiceDao.listDemandServeTimes(customerId, endTime, "volunteer");
demandServiceDao.listDemandServeTimes(customerId, gridId, endTime, "volunteer");
}
});
}

83
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DemandServiceImpl.java

@ -1,11 +1,16 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.EpmetRoleKeyConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.heart.result.DemandServiceCountResultDTO;
import com.epmet.entity.crm.CustomerEntity;
import com.epmet.entity.heart.VolunteerInfoEntity;
import com.epmet.entity.stats.FactVolunteerServiceDailyEntity;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.DemandService;
import com.epmet.service.crm.CustomerService;
import com.epmet.service.heart.HeartDemandService;
@ -27,7 +32,7 @@ import java.util.stream.Collectors;
* @Version 1.0
*/
@Service
public class DemandServiceImpl implements DemandService {
public class DemandServiceImpl implements DemandService, ResultDataResolver {
@Autowired
private HeartDemandService heartDemandService;
@ -37,12 +42,15 @@ public class DemandServiceImpl implements DemandService {
@Autowired
private UserService userService;
@Autowired
private DemandStatsService demandStatsService;
@Autowired
private CustomerService customerService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
public void statsVolunteerDemandServicesDaily(String customerId) {
@ -50,7 +58,7 @@ public class DemandServiceImpl implements DemandService {
Date now = new Date();
Date today = DateUtils.integrate(now, "yyyy-MM-dd");
Date yestoday = DateUtils.addDateDays(today, -1);
if (StringUtils.isNotBlank(customerId)) {
// 只计算单个客户
clearOldDatas(Arrays.asList(customerId), yestoday);
@ -67,7 +75,8 @@ public class DemandServiceImpl implements DemandService {
/**
* 清理旧数据
* @param targetDate 要清理哪天的数据
*
* @param targetDate 要清理哪天的数据
* @param customerIds 要清理哪些客户的
*/
private void clearOldDatas(List<String> customerIds, Date targetDate) {
@ -80,12 +89,44 @@ public class DemandServiceImpl implements DemandService {
/**
* 统计单个客户的志愿者服务情况
*
* @param customerId 客户ID
* @param endTime 统计截止时间(<endTime)
* @param endTime 统计截止时间(<endTime)
*/
private void statsVolunteerDemandServicesDaily4Customer(String customerId, Date endTime, Date belongTime) {
// 一.将客户下所有志愿者,按照网格ID,放到map中去
// 网格ID和志愿者列表。key:网格id;value:志愿者列表
HashMap<String, List<VolunteerInfoEntity>> gridIdAndVolunteers = new HashMap<>();
heartVolunteerService.listVolunteers(customerId, endTime).forEach(v -> {
String volunteerGridId = v.getGridId();
if (StringUtils.isNotBlank(volunteerGridId)) {
if (!gridIdAndVolunteers.containsKey(volunteerGridId)) {
gridIdAndVolunteers.put(volunteerGridId, new ArrayList<>());
}
gridIdAndVolunteers.get(volunteerGridId).add(v);
}
});
// 2.按网格分别统计,且持久化
for (Map.Entry<String, List<VolunteerInfoEntity>> entry : gridIdAndVolunteers.entrySet()) {
statsVolunteerDemandServicesDaily4Grid(customerId, entry.getKey(), endTime, entry.getValue(), belongTime);
}
}
/**
* 按日统计网格需求服务数据
* @param customerId
* @param gridId
* @param endTime 统计截止时间
* @param volunteers 志愿者volunteerInfo列表
* @param belongTime 该次统计要归属到哪一天即createTime
* @return 统计结果entity以备他用
*/
private FactVolunteerServiceDailyEntity statsVolunteerDemandServicesDaily4Grid(String customerId, String gridId, Date endTime, List<VolunteerInfoEntity> volunteers, Date belongTime) {
// 1.志愿者分流为党员志愿者&普通居民志愿者
Integer volunteerTotalCount = 0;
Integer volunteerTotalCount = volunteers.size();
// 党员志愿者数量
Integer partymemberVolunteerCount = 0;
// 居民志愿者数量
@ -94,15 +135,13 @@ public class DemandServiceImpl implements DemandService {
// 党员志愿者用户id列表
List<String> partymemberVolunteerUserIds = new ArrayList<>(16);
List<VolunteerInfoEntity> volunteers = heartVolunteerService.listVolunteers(customerId, endTime);
volunteerTotalCount = volunteers.size();
//--------------------------------【以上是结果数据变量】------------------------------------------
// 分片开始下标
int shardingStartIndex = 0;
// 分片大小(条数)
int shardingSize = 100;
// 分片去确定党员身份,防止in条件过大
while (true) {
int realShardingSize = Math.min(shardingSize, volunteerTotalCount - shardingStartIndex);
@ -141,7 +180,7 @@ public class DemandServiceImpl implements DemandService {
while (true) {
// 取出每一个服务者的服务次数
List<DemandServiceCountResultDTO> damendServeTimes = heartDemandService.listDemandServeTimesPage(customerId, endTime, serviceCountPageNo, serviceCountPageSize);
List<DemandServiceCountResultDTO> damendServeTimes = heartDemandService.listDemandServeTimesPage(customerId, gridId, endTime, serviceCountPageNo, serviceCountPageSize);
for (DemandServiceCountResultDTO damendServiceTimes : damendServeTimes) {
String serverId = damendServiceTimes.getServerId();
@ -158,11 +197,12 @@ public class DemandServiceImpl implements DemandService {
}
totalDemandServeTimes = partymemberDemandServeTimes + resiDemandServeTimes;
// 3.持久化
// 3.组装entity数据返回,待存储
FactVolunteerServiceDailyEntity insert = new FactVolunteerServiceDailyEntity();
insert.setDateId(DimIdGenerator.getDateDimId(belongTime));
insert.setCustomerId(customerId);
insert.setGridId(gridId);
insert.setMonthId(DimIdGenerator.getMonthDimId(belongTime));
insert.setPartyServiceTotal(partymemberDemandServeTimes);
insert.setServiceTotal(totalDemandServeTimes);
@ -171,6 +211,19 @@ public class DemandServiceImpl implements DemandService {
insert.setResiTotal(resiVolunteerCount);
insert.setVolunteerTotal(volunteerTotalCount);
CustomerGridFormDTO gridForm = new CustomerGridFormDTO();
gridForm.setGridId(gridId);
String errorMsg = "【志愿者服务按日统计】查询网格基本信息失败";
CustomerGridDTO gridInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getGridBaseInfoByGridId(gridForm), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
Optional.ofNullable(gridInfo).ifPresent(gi -> {
insert.setPid(gi.getPid());
insert.setPids(gi.getPids());
});
// 持久化
demandStatsService.addVolunteerServiceDaily(insert);
return insert;
}
}

14
epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.27__volunteer_service_daily_add_gridid.sql

@ -0,0 +1,14 @@
-- 发布前执行
alter table fact_volunteer_service_daily add column GRID_ID varchar(64) not null comment '网格ID' after CUSTOMER_ID;
alter table fact_volunteer_service_daily add column PID varchar(64) default '' comment 'pid网格父级ID' after RESI_SERVICE_TOTAL;
alter table fact_volunteer_service_daily add column PIDS varchar(255) default '' comment 'pid网格父级ID路径,包含PID' after PID;
-- 发布后执行
delete from fact_volunteer_service_daily;
alter table fact_volunteer_service_daily drop key uni_vsd;
alter table fact_volunteer_service_daily
add constraint uni_vsd
unique (GRID_ID, DATE_ID, DEL_FLAG);

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/heart/IcUserDemandServiceDao.xml

@ -24,11 +24,13 @@
select service.SERVER_ID, SERVICE_TYPE, count(1) as SERVE_TIMES
from ic_user_demand_rec damend
inner join ic_user_demand_service service on (damend.ID = service.DEMAND_REC_ID and service.DEL_FLAG = 0)
inner join volunteer_info v on (service.SERVER_ID = v.USER_ID and v.DEL_FLAG = 0)
where damend.DEL_FLAG = 0
and damend.STATUS = 'finished'
and damend.CUSTOMER_ID = #{customerId}
and service.SERVICE_END_TIME <![CDATA[<]]> #{endTime}
and service.SERVICE_TYPE = #{serviceType}
and v.GRID_ID = #{gridId}
group by service.SERVER_ID, SERVICE_TYPE
</select>
</mapper>

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactVolunteerServiceDailyDao.xml

@ -14,6 +14,8 @@
<result property="serviceTotal" column="SERVICE_TOTAL"/>
<result property="partyServiceTotal" column="PARTY_SERVICE_TOTAL"/>
<result property="resiServiceTotal" column="RESI_SERVICE_TOTAL"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>

11
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/VolunteerInfoDTO.java

@ -17,9 +17,10 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
@ -97,4 +98,12 @@ public class VolunteerInfoDTO implements Serializable {
* 志愿者注册所在网格名称
*/
private String gridName;
/**
* 网格所属的组织id
*/
private String pid;
/**
* 网格的所有上级
*/
private String pids;
}

13
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/StaffCancelFormDTO.java → epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/CancelDemandFormDTO.java

@ -4,8 +4,11 @@ import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 取消需求入参dto
*/
@Data
public class StaffCancelFormDTO {
public class CancelDemandFormDTO {
public interface AddUserInternalGroup {}
@NotBlank(message = "需求id不能为空",groups = AddUserInternalGroup.class)
private String demandRecId;
@ -14,4 +17,12 @@ public class StaffCancelFormDTO {
private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
/**
* staff:pc工作人员取消
* resi:居民端用户主动需求
* 代码里写死的UserDemandConstant.RESI/STAFF
*/
private String userType;
}

44
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/EvaluateDemandFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
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.math.BigDecimal;
/**
* 居民端-需求-服务评价入参
*/
@Data
public class EvaluateDemandFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface ShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class)
private String demandRecId;
@NotBlank(message = "服务id不能为空", groups = AddUserInternalGroup.class)
private String serviceId;
@NotBlank(message = "完成结果不能为空", groups = ShowGroup.class)
private String finishResult;
@Length(max = 1000,message = "最多输入1000字",groups = {ShowGroup.class})
private String finishDesc;
@NotNull(message = "得分不能为空", groups = ShowGroup.class)
private BigDecimal score;
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

27
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java

@ -2,6 +2,7 @@ package com.epmet.dto.form.demand;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
@ -16,27 +17,31 @@ public class FinishStaffFromDTO implements Serializable {
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
public interface IcShowGroup extends CustomerClientShowGroup {
}
public interface ResiShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class)
private String demandRecId;
@NotBlank(message = "服务id不能为空", groups = AddUserShowGroup.class)
@NotBlank(message = "服务id不能为空", groups = AddUserInternalGroup.class)
private String serviceId;
@NotNull(message = "实际服务开始不能为空", groups = AddUserShowGroup.class)
@NotNull(message = "实际服务开始不能为空", groups = {IcShowGroup.class,ResiShowGroup.class})
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date serviceStartTime;
@NotNull(message = "实际服务结束不能为空", groups = AddUserShowGroup.class)
@NotNull(message = "实际服务结束不能为空", groups = {IcShowGroup.class,ResiShowGroup.class})
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date serviceEndTime;
@NotBlank(message = "完成结果不能为空", groups = AddUserShowGroup.class)
@NotBlank(message = "完成结果不能为空", groups = IcShowGroup.class)
private String finishResult;
@Length(max = 1000,message = "最多输入1000字",groups = {IcShowGroup.class})
private String finishDesc;
@NotNull(message = "得分不能为空", groups = AddUserShowGroup.class)
@NotNull(message = "得分不能为空", groups = IcShowGroup.class)
private BigDecimal score;
@ -45,4 +50,14 @@ public class FinishStaffFromDTO implements Serializable {
private String userId;
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
/**
* pc完成情况完成+评价 UserDemandConstant.FINISH_AND_EVALUATE
* 居民端完成UserDemandConstant.FINISHED
*/
private String type;
/**
* pc完成情况UserDemandConstant.STAFF
* 居民端完成UserDemandConstant.RESI
*/
private String userType;
}

34
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ListHallFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form.demand;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* * 居民端-需求大厅未处理处理中已完成入参
*/
@Data
public class ListHallFormDTO extends PageFormDTO implements Serializable {
public interface AddUserInternalGroup {}
/**
* 当前所在网格id
*/
@NotBlank(message = "gridId不能为空", groups = AddUserInternalGroup.class)
private String gridId;
/**
* 未处理unprocessed处理中processing已完成finished
*/
@NotBlank(message = "type不能为空,未处理:unprocessed;处理中:processing;已完成:finished", groups = AddUserInternalGroup.class)
private String type;
// 以下入参从token中获取
@NotBlank(message = "tokenDto获取userId不能为空", groups = AddUserInternalGroup.class)
private String currentUserId;
@NotBlank(message = "tokenDto获取customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/TakeOrderFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form.demand;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 需求大厅-我要接单
*/
@Data
public class TakeOrderFormDTO implements Serializable {
private static final long serialVersionUID = -2030750128789890382L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "demandRecId不能为空", groups = AddUserInternalGroup.class)
private String demandRecId;
@NotBlank(message = "tokenDto获取userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
}

37
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/ResiVolunteerAuthenticateFormDTO.java

@ -17,80 +17,67 @@ import java.io.Serializable;
public class ResiVolunteerAuthenticateFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
//>>>>>>>>>>>>>>>>>校验分组开始>>>>>>>>>>>>>>>>>>>>>
/**
* 添加用户操作的内部异常分组
* 出现错误会提示给前端7000错误码返回信息为服务器开小差...
*/
public interface AddUserInternalGroup {}
/**
* 添加用户操作的用户可见异常分组
* 该分组用于校验需要返回给前端错误信息提示的列需要继承CustomerClientShowGroup
* 返回错误码为8999提示信息为DTO中具体的列的校验注解message的内容
*/
public interface AddUserShowGroup extends CustomerClientShowGroup {}
// <<<<<<<<<<<<<<<<<<<校验分组结束<<<<<<<<<<<<<<<<<<<<<<<<
/**
* 用户id
*/
@NotBlank(message = "tokenDto中获取userId为空", groups = {AddUserInternalGroup.class })
private String userId;
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空", groups = {AddUserShowGroup.class })
@NotBlank(message = "tokenDto中获取customerId为空", groups = {AddUserInternalGroup.class })
private String customerId;
/**
*
*/
@NotBlank(message = "姓不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "姓不能为空", groups = {AddUserShowGroup.class })
private String surname;
/**
*
*/
@NotBlank(message = "名不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "名不能为空", groups = {AddUserShowGroup.class })
private String name;
/**
* 性别1男2女0未知
*/
@NotBlank(message = "性别不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "性别不能为空", groups = {AddUserShowGroup.class })
private String gender;
/**
* 手机号
*/
@NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class })
private String mobile;
/**
* 身份证号码
*/
@NotBlank(message = "身份证号码不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "身份证号码不能为空", groups = {AddUserShowGroup.class })
private String idNum;
/**
* 街道
*/
@NotBlank(message = "街道不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "居住地址:街道不能为空", groups = {AddUserShowGroup.class })
private String street;
/**
* 小区名
*/
@NotBlank(message = "小区名不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "居住地址:小区名不能为空", groups = {AddUserShowGroup.class })
private String district;
/**
* 楼栋单元
*/
@NotBlank(message = "楼栋单元不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "居住地址:楼栋单元不能为空", groups = {AddUserShowGroup.class })
private String buildingAddress;
/**
@ -101,13 +88,13 @@ public class ResiVolunteerAuthenticateFormDTO implements Serializable {
/**
* 昵称
*/
@NotBlank(message = "昵称不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "昵称不能为空", groups = {AddUserInternalGroup.class})
private String nickname;
/**
* 头像
*/
@NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class })
@NotBlank(message = "头像不能为空", groups = {AddUserInternalGroup.class})
private String avatarUrl;
/**

12
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/resi/VolunteerCommonFormDTO.java

@ -14,12 +14,16 @@ import javax.validation.constraints.NotNull;
@Data
public class VolunteerCommonFormDTO {
public interface VolunteerPage {
}
@NotBlank(message = "客户ID不能为空", groups = {VolunteerPage.class})
/**
* 客户ID
*/
private String customerId;
/**
* 上级组织ID使用PIDS like查询该组织下所有志愿者注意是like 'agencyId:%'
*/
private String superiorAgencyId;
private Integer pageNo = 0;
private Integer pageSize = 20;

100
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandDetailResDTO.java

@ -0,0 +1,100 @@
package com.epmet.dto.result.demand;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 需求大厅-需求详情
*/
@Data
public class DemandDetailResDTO implements Serializable {
private String demandRecId;
@JsonIgnore
private String categoryCode;
@JsonIgnore
private String parentCode;
/**
* 二级分类名称
*/
private String categoryName;
/**
* 奖励积分
*/
private Integer awardPoint;
/**
* 需求内容
*/
private String content;
/**
* 服务要求-服务时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date wantServiceTime;
/**
* 服务要求-联系人需求人名称
*/
private String demandUserName;
/**
* 服务要求-联系人需求人电话
*/
private String demandUserMobile;
/**
* 服务地点
*/
private String serviceAddress;
/**
* 实际服务开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceStartTime;
/**
* 实际服务结束时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceEndTime;
/**
* 得分可为半星
*/
private BigDecimal score;
/**
* 完成结果已解决 resolved未解决 unresolved
*/
private String finishResult;
/**
* 完成情况
*/
private String finishDesc;
/**
* 待处理pending已取消canceled已派单assigned已接单have_order已完成finished
*/
private String status;
/**
* 1已评价0未评价;评价后ic_user_satisfaction表有记录
*/
private Boolean evaluateFlag;
/**
* 服务记录主键
*/
private String serviceId;
}

79
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandHallResultDTO.java

@ -0,0 +1,79 @@
package com.epmet.dto.result.demand;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 居民端-需求大厅未处理处理中已完成返参DTO
* 返参DTO
*/
@Data
public class DemandHallResultDTO implements Serializable {
/**
* 需求id
*/
private String demandRecId;
/**
* 分类编码
*/
@JsonIgnore
private String categoryCode;
/**
* 父级分类编码
*/
@JsonIgnore
private String parentCode;
/**
* 服务事项实际就是需求分类二级分类名字
*/
private String categoryName;
/**
* 服务时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date wantServiceTime;
/**
* 服务地点
*/
private String serviceAddress;
/**
* 奖励积分
*/
private Integer awardPoint;
/**
* 需求人名字
*/
private String demandUserName;
/**
* 需求人联系电话
*/
private String demandUserMobile;
/**
* 得分可为半星
*/
private BigDecimal score;
/**
* 待处理pending已取消canceled已派单assigned已接单have_order已完成finished
*/
private String status;
/**
* 1已评价0未评价;评价后ic_user_satisfaction表有记录
*/
private Boolean evaluateFlag;
}

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java

@ -121,4 +121,14 @@ public class DemandRecResultDTO implements Serializable {
private String icResiUserId;
private String epmetUserId;
/**
* 奖励积分
*/
private Integer awardPoint;
/**
* 服务地点
*/
private String serviceAddress;
}

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

@ -10,6 +10,8 @@ import java.io.Serializable;
*/
@Data
public class FinishResultDTO implements Serializable {
private Boolean sendCalStatisfaction;
private String partyUnitId;
private String serverId;
private String serviceType;
private Boolean grantPoint;
private Integer awardPoint;
}

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

@ -0,0 +1,15 @@
package com.epmet.dto.result.demand;
import lombok.Data;
import java.io.Serializable;
/**
* 需求大厅-我要接单
*/
@Data
public class TakeOrderResultDTO implements Serializable {
private static final long serialVersionUID = -4390598017224563310L;
private Boolean isVolunteer;
private String serviceId;
}

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

@ -23,6 +23,7 @@ import java.util.List;
* @date 2020/6/4 13:25
*/
@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallbackFactory = EpmetHeartOpenFeignClientFallbackFactory.class)
//@FeignClient(name = ServiceConstant.EPMET_HEART_SERVER, fallbackFactory = EpmetHeartOpenFeignClientFallbackFactory.class, url = "http://localhost:8111")
public interface EpmetHeartOpenFeignClient {
/**

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/UserDemandConstant.java

@ -35,7 +35,7 @@ public interface UserDemandConstant {
/**
* 创建需求create;撤销需求cancel;指派assign;接单take_order;完成finish;
* 创建需求create;撤销需求cancel;指派assign;接单take_order;完成finish;评价evaluate
* 更新需求update
*/
String CREATE="create";
@ -44,6 +44,7 @@ public interface UserDemandConstant {
String ASSIGN="assign";
String TAKE_ORDER="take_order";
String FINISH="finish";
String EVALUATE="evaluate";
// 服务方类型:志愿者:volunteer;社会组织:social_org;社区自组织:community_org;区域党建单位:party_unit;
String VOLUNTEER="volunteer";
@ -58,4 +59,9 @@ public interface UserDemandConstant {
*/
String PERSONAL_DATA="personal-data";
String DEMAND_ANALYSIS="demand-analysis";
/**
* pc完成情况完成+评价
*/
String FINISH_AND_EVALUATE="finish_and_evaluate";
}

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

@ -19,6 +19,7 @@ package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils;
@ -29,10 +30,6 @@ 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;
@ -85,7 +82,7 @@ public class IcUserDemandRecController {
formDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class);
if (UserDemandConstant.VOLUNTEER.equals(formDTO.getServiceType())) {
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getServiceName()));
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(), formDTO.getStaffId(),formDTO.getServiceName()));
} else if (UserDemandConstant.SOCIAL_ORG.equals(formDTO.getServiceType())) {
ValidatorUtils.validateEntity(formDTO, ServiceQueryFormDTO.AddUserInternalGroup.class, ServiceQueryFormDTO.SocietyOrgInternalGroup.class);
return new Result<List<OptionDTO>>().ok(societyOrgService.queryServiceList(formDTO));
@ -150,10 +147,11 @@ public class IcUserDemandRecController {
* @return
*/
@PostMapping("cancel")
public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody StaffCancelFormDTO formDTO){
public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody CancelDemandFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,StaffCancelFormDTO.AddUserInternalGroup.class);
formDTO.setUserType(UserDemandConstant.STAFF);
ValidatorUtils.validateEntity(formDTO,CancelDemandFormDTO.AddUserInternalGroup.class);
icUserDemandRecService.cancel(formDTO);
return new Result();
}
@ -187,16 +185,22 @@ public class IcUserDemandRecController {
public Result finish(@LoginUser TokenDto tokenDto,@RequestBody FinishStaffFromDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.AddUserShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class);
formDTO.setType(UserDemandConstant.FINISH_AND_EVALUATE);
formDTO.setUserType(UserDemandConstant.STAFF);
ValidatorUtils.validateEntity(formDTO,FinishStaffFromDTO.IcShowGroup.class,FinishStaffFromDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO=icUserDemandRecService.finish(formDTO);
if(finishResultDTO.getSendCalStatisfaction()){
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if(UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())){
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getPartyUnitId());
mqMsg.setPartyUnitId(finishResultDTO.getServerId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
}
return new Result();
}

156
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiDemandController.java

@ -0,0 +1,156 @@
package com.epmet.controller;
import com.epmet.commons.rocketmq.messages.CalPartyUnitSatisfactionFormDTO;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.security.dto.TokenDto;
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.DemandDetailResDTO;
import com.epmet.dto.result.demand.DemandHallResultDTO;
import com.epmet.dto.result.demand.FinishResultDTO;
import com.epmet.dto.result.demand.TakeOrderResultDTO;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.service.IcUserDemandRecService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 居民端-需求相关API 写在这吧
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-19
*/
@Slf4j
@RestController
@RequestMapping("residemand")
public class ResiDemandController {
@Autowired
private IcUserDemandRecService icUserDemandRecService;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
/**
* 居民端-需求大厅未处理处理中已完成
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("list-hall")
public Result<List<DemandHallResultDTO>> listHall(@LoginUser TokenDto tokenDto, @RequestBody ListHallFormDTO formDTO) {
formDTO.setCurrentUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class, ListHallFormDTO.AddUserInternalGroup.class);
return new Result<List<DemandHallResultDTO>>().ok(icUserDemandRecService.listHall(formDTO));
}
/**
* 需求大厅-需求详情
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("detail-hall")
public Result<DemandDetailResDTO> queryDetailHall(@LoginUser TokenDto tokenDto, @RequestBody DemandDetailFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, DemandDetailFormDTO.AddUserInternalGroup.class);
return new Result<DemandDetailResDTO>().ok(icUserDemandRecService.queryDetailHall(formDTO));
}
/**
* 需求大厅-我要接单
*
* @param tokenDto
* @return
*/
@PostMapping("takeorder")
public Result<TakeOrderResultDTO> takeOrder(@LoginUser TokenDto tokenDto, @RequestBody TakeOrderFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, TakeOrderFormDTO.AddUserInternalGroup.class);
return new Result<TakeOrderResultDTO>().ok(icUserDemandRecService.takeOrder(formDTO));
}
/**
* 需求大厅-完成需求
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("finish")
public Result finish(@LoginUser TokenDto tokenDto, @RequestBody FinishStaffFromDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setType(UserDemandConstant.FINISHED);
formDTO.setUserType(UserDemandConstant.RESI);
ValidatorUtils.validateEntity(formDTO, FinishStaffFromDTO.ResiShowGroup.class, FinishStaffFromDTO.AddUserInternalGroup.class);
icUserDemandRecService.finish(formDTO);
return new Result();
}
/**
* 我的需求-服务评价
* 已经完成的可以评价
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("evaluate")
public Result evaluate(@LoginUser TokenDto tokenDto, @RequestBody EvaluateDemandFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, EvaluateDemandFormDTO.ShowGroup.class, EvaluateDemandFormDTO.AddUserInternalGroup.class);
FinishResultDTO finishResultDTO = icUserDemandRecService.evaluate(formDTO);
//如果服务方是区域化党建单位,需要实时去计算他的群众满意度=服务过的需求的评价分数相加➗ 需求的总个数。
if (UserDemandConstant.PARTY_UNIT.equals(finishResultDTO.getServiceType())) {
CalPartyUnitSatisfactionFormDTO mqMsg = new CalPartyUnitSatisfactionFormDTO();
mqMsg.setCustomerId(formDTO.getCustomerId());
mqMsg.setPartyUnitId(finishResultDTO.getServerId());
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.CAL_PARTY_UNIT_SATISFACTION);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
} else if (UserDemandConstant.VOLUNTEER.equals(finishResultDTO.getServiceType()) && finishResultDTO.getAwardPoint() > NumConstant.ZERO) {
// todo
// 志愿者发放积分
}
return new Result();
}
/**
* 我的需求-取消需求
* 取消未完成之前都可以取消,pc和居民端小程序内部通用
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("cancel")
public Result cancel(@LoginUser TokenDto tokenDto,@RequestBody CancelDemandFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
formDTO.setUserType(UserDemandConstant.RESI);
ValidatorUtils.validateEntity(formDTO,CancelDemandFormDTO.AddUserInternalGroup.class);
icUserDemandRecService.cancel(formDTO);
return new Result();
}
}

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

@ -60,8 +60,11 @@ public class ResiVolunteerController {
**/
@PostMapping("authenticate")
public Result authenticate(@LoginUser TokenDto tokenDto, @RequestBody ResiVolunteerAuthenticateFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class);
return volunteerInfoService.authenticate(tokenDto, formDTO);
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, ResiVolunteerAuthenticateFormDTO.AddUserShowGroup.class, ResiVolunteerAuthenticateFormDTO.AddUserInternalGroup.class);
volunteerInfoService.authenticate(formDTO);
return new Result();
}
/**
@ -125,7 +128,7 @@ public class ResiVolunteerController {
*/
@PostMapping("listprofile")
public Result<List<OptionDTO>> queryListVolunteer(@LoginUser TokenDto tokenDto,@RequestBody ServiceQueryFormDTO formDTO){
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),formDTO.getServiceName()));
return new Result<List<OptionDTO>>().ok(volunteerInfoService.queryListVolunteer(tokenDto.getCustomerId(),tokenDto.getUserId(),formDTO.getServiceName()));
}
/**
@ -135,13 +138,11 @@ public class ResiVolunteerController {
*/
@PostMapping("page")
public Result<List<PageVolunteerInfoResultDTO>> queryVolunteerPage(@RequestBody VolunteerCommonFormDTO input) {
ValidatorUtils.validateEntity(input, VolunteerCommonFormDTO.VolunteerPage.class);
Integer pageNo = input.getPageNo();
Integer pageSize = input.getPageSize();
String customerId = input.getCustomerId();
List<PageVolunteerInfoResultDTO> l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize);
String superiorAgencyId = input.getSuperiorAgencyId();
List<PageVolunteerInfoResultDTO> l = volunteerInfoService.queryVolunteerPage(customerId, pageNo, pageSize, superiorAgencyId);
return new Result<List<PageVolunteerInfoResultDTO>>().ok(l);
}
}

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

@ -66,4 +66,6 @@ public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
List<IcResiDemandDictEntity> selectSecondCodes(@Param("customerId") String customerId, @Param("cateogryCodes") List<String> categoryCodes);
String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode);
IcResiDemandDictEntity selectByCode(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode);
}

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

@ -86,4 +86,17 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
@Param("endDateId") String endDateId);
List<ServiceStatDTO> selectGroupByPartyUnit(@Param("customerId") String customerId, @Param("partyUnitId") String partyUnitId);
/**
* 居民端-需求大厅未处理处理中已完成
* 未处理未指派未接单;处理中已指派已接单给我的 ;已完成我填写实际服务时间并点击确认
*
* @param gridId
* @param type 未处理unprocessed处理中processing已完成finished
* @param currentUserId 当前用户自己提出的不在这展示在我的需求里面展示
* @return
*/
List<DemandHallResultDTO> selectListDemandHall(@Param("gridId") String gridId,
@Param("type") String type,
@Param("currentUserId") String currentUserId);
}

1
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java

@ -79,4 +79,5 @@ public class IcResiDemandDictEntity extends BaseEpmetEntity {
* 1可用0不可用,11.17
*/
private Boolean usableFlag;
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandOperateLogEntity.java

@ -59,7 +59,7 @@ public class IcUserDemandOperateLogEntity extends BaseEpmetEntity {
private String userId;
/**
* 创建需求create;撤销需求cancel;指派assign;接单take_order;完成finish;
* 创建需求create;更新需求update撤销需求cancel;指派assign;接单take_order;完成finish;评价evaluate
*/
private String actionCode;

28
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java

@ -143,4 +143,32 @@ public class IcUserDemandRecEntity extends BaseEpmetEntity {
*/
private Boolean evaluateFlag;
/**
* 奖励积分
*/
private Integer awardPoint;
/**
* 服务地点工作端指派默认居民居住房屋地址居民端地图选择
*/
private String serviceLocation;
/**
* 门牌号详细地址
*/
private String locationDetail;
/**
* 经度,需求人是ic的居民时取所住楼栋的中心点位
*/
private String longitude;
/**
* 纬度,需求人是ic的居民时取所住楼栋的中心点位
*/
private String latitude;
/**
* 需求人是ic的居民时,记录下住的房屋id
*/
private String demandUserHouseId;
}

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/VolunteerInfoEntity.java

@ -18,13 +18,10 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 志愿者信息
*
@ -67,4 +64,12 @@ public class VolunteerInfoEntity extends BaseEpmetEntity {
* 志愿者注册所在网格名称
*/
private String gridName;
/**
* 网格所属的组织id
*/
private String pid;
/**
* 网格的所有上级
*/
private String pids;
}

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

@ -119,4 +119,13 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
* @return
*/
String getCategoryName(String customerId, String categoryCode);
/**
* 根据编码获取分类信息
*
* @param customerId
* @param categoryCode
* @return
*/
IcResiDemandDictEntity getByCode(String customerId, String categoryCode);
}

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

@ -21,12 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcUserDemandRecDTO;
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.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity;
import java.util.List;
@ -111,11 +106,11 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
PageData<DemandRecResultDTO> pageList(UserDemandPageFormDTO formDTO);
/**
* 未完成之前都可以取消
* 未完成之前都可以取消,pc和居民端小程序内部通用
*
* @param formDTO
*/
void cancel(StaffCancelFormDTO formDTO);
void cancel(CancelDemandFormDTO formDTO);
/**
* 指派
@ -180,4 +175,33 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @return
*/
List<ServiceStatDTO> groupByPartyUnit(String customerId, String partyUnitId);
/**
* 居民端-需求大厅未处理处理中已完成
* @param formDTO
* @return
*/
List<DemandHallResultDTO> listHall(ListHallFormDTO formDTO);
/**
* 需求大厅-需求详情
* @param formDTO
* @return
*/
DemandDetailResDTO queryDetailHall(DemandDetailFormDTO formDTO);
/**
* 需求大厅-我要接单
* @param formDTO
* @return
*/
TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO);
/**
* 居民端-我的需求-服务评价
*
* @param formDTO
* @return
*/
FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO);
}

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

@ -42,13 +42,12 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
/**
* 志愿者认证
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author zhangyong
* @Date 10:09 2020-07-23
**/
Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO);
void authenticate(ResiVolunteerAuthenticateFormDTO formDTO);
/**
* 志愿者认证界面获取用户基础信息+志愿者信息
@ -94,7 +93,7 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @param customerId
* @return
*/
List<OptionDTO> queryListVolunteer(String customerId,String userRealName);
List<OptionDTO> queryListVolunteer(String customerId,String staffId,String userRealName);
List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize);
List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String superiorAgencyId);
}

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

@ -258,5 +258,10 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
return StringUtils.isNotBlank(categoryName)?categoryName: StrConstant.EPMETY_STR;
}
@Override
public IcResiDemandDictEntity getByCode(String customerId, String categoryCode) {
return baseDao.selectByCode(customerId,categoryCode);
}
}

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

@ -38,9 +38,7 @@ import com.epmet.dao.IcUserDemandOperateLogDao;
import com.epmet.dao.IcUserDemandRecDao;
import com.epmet.dao.IcUserDemandSatisfactionDao;
import com.epmet.dao.IcUserDemandServiceDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.FindIcUserFormDTO;
import com.epmet.dto.form.ResiUserFormDTO;
@ -53,6 +51,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiDemandDictService;
import com.epmet.service.IcUserDemandRecService;
import com.epmet.service.VolunteerInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -90,7 +89,8 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private EpmetAdminOpenFeignClient adminOpenFeignClient;
@Autowired
private VolunteerInfoService volunteerInfoService;
@Override
public PageData<IcUserDemandRecDTO> page(Map<String, Object> params) {
@ -154,6 +154,32 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
updateEntity.setStatus(UserDemandConstant.PENDING);
updateEntity.setEvaluateFlag(false);
updateEntity.setId(dto.getDemandRecId());
//记录发放积分
IcResiDemandDictEntity icResiDemandDictEntity=demandDictService.getByCode(dto.getCustomerId(),dto.getCategoryCode());
if(null!=icResiDemandDictEntity){
updateEntity.setAwardPoint(icResiDemandDictEntity.getAwardPoint());
}
//查找需求人居住的房子
Result<IcResiUserDTO> demandUserRes=epmetUserOpenFeignClient.getIcResiUserDTO(dto.getDemandUserId());
if(!demandUserRes.success()||null==demandUserRes.getData()){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常");
}
updateEntity.setDemandUserHouseId(demandUserRes.getData().getHomeId());
// 查询需求人的居住地址
Set<String> houseIds=new HashSet<>();
houseIds.add(updateEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes));
}
HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO);
updateEntity.setServiceLocation(houseInfoDTO.getNeighborAddress().
concat(houseInfoDTO.getNeighborHoodName())
.concat(houseInfoDTO.getBuildingName())
.concat(houseInfoDTO.getUnitName())
.concat(houseInfoDTO.getDoorName()));
updateEntity.setLongitude(houseInfoDTO.getBuildingLongitude());
updateEntity.setLatitude(houseInfoDTO.getBuildingLatitude());
baseDao.updateById(updateEntity);
IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity();
@ -197,6 +223,32 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
insertEntity.setDemandUserType(UserDemandConstant.IC_RESI_USER);
insertEntity.setStatus(UserDemandConstant.PENDING);
insertEntity.setEvaluateFlag(false);
//记录发放积分
IcResiDemandDictEntity icResiDemandDictEntity=demandDictService.getByCode(fromDTO.getCustomerId(),fromDTO.getCategoryCode());
if(null!=icResiDemandDictEntity){
insertEntity.setAwardPoint(icResiDemandDictEntity.getAwardPoint());
}
//查找需求人居住的房子
Result<IcResiUserDTO> demandUserRes=epmetUserOpenFeignClient.getIcResiUserDTO(fromDTO.getDemandUserId());
if(!demandUserRes.success()||null==demandUserRes.getData()){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常"+ JSON.toJSONString(demandUserRes));
}
insertEntity.setDemandUserHouseId(demandUserRes.getData().getHomeId());
// 查询需求人的居住地址
Set<String> houseIds=new HashSet<>();
houseIds.add(insertEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
if(!houseInfoRes.success()||CollectionUtils.isEmpty(houseInfoRes.getData())){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人房屋地址信息异常"+JSON.toJSONString(houseInfoRes));
}
HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO);
insertEntity.setServiceLocation(houseInfoDTO.getNeighborAddress().
concat(houseInfoDTO.getNeighborHoodName())
.concat(houseInfoDTO.getBuildingName())
.concat(houseInfoDTO.getUnitName())
.concat(houseInfoDTO.getDoorName()));
insertEntity.setLongitude(houseInfoDTO.getBuildingLongitude());
insertEntity.setLatitude(houseInfoDTO.getBuildingLatitude());
baseDao.insert(insertEntity);
IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(fromDTO.getCustomerId());
@ -330,13 +382,13 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}
/**
* 未完成之前都可以取消
* 未完成之前都可以取消,pc和居民端小程序内部通用
*
* @param formDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void cancel(StaffCancelFormDTO formDTO) {
public void cancel(CancelDemandFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
@ -351,11 +403,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
entity.setCancelTime(new Date());
baseDao.updateById(entity);
//2、插入操作日志
IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(formDTO.getCustomerId());
logEntity.setDemandRecId(formDTO.getDemandRecId());
logEntity.setUserType(UserDemandConstant.STAFF);
logEntity.setUserId(formDTO.getUserId());
IcUserDemandOperateLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
logEntity.setActionCode(UserDemandConstant.CANCEL);
logEntity.setOperateTime(entity.getCancelTime());
operateLogDao.insert(logEntity);
@ -414,64 +462,75 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
@Transactional(rollbackFor = Exception.class)
@Override
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());
}
if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) {
//待处理或者已取消的不能评价
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getMsg());
}
if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){
//已经完成
throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg());
}
//1、修改主表
entity.setStatus(UserDemandConstant.FINISHED);
entity.setFinishResult(formDTO.getFinishResult());
entity.setEvaluateFlag(true);
baseDao.updateById(entity);
IcUserDemandRecEntity entity = checkFinishPreCondition(formDTO.getDemandRecId());
//2、插入操作日志
IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(formDTO.getCustomerId());
logEntity.setDemandRecId(formDTO.getDemandRecId());
logEntity.setUserType(UserDemandConstant.STAFF);
logEntity.setUserId(formDTO.getUserId());
//1、插入完成操作日志
IcUserDemandOperateLogEntity logEntity = ConvertUtils.sourceToTarget(formDTO,IcUserDemandOperateLogEntity.class);
logEntity.setActionCode(UserDemandConstant.FINISH);
logEntity.setOperateTime(new Date());
operateLogDao.insert(logEntity);
//3、更新服务记录
//2、更新服务记录,记录实际开始,实际结束时间
IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId());
if(null==serviceEntity){
throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg());
}
serviceEntity.setServiceStartTime(formDTO.getServiceStartTime());
serviceEntity.setServiceEndTime(formDTO.getServiceEndTime());
serviceEntity.setFinishDesc(formDTO.getFinishDesc());
serviceEntity.setFinishDesc(StringUtils.isNotBlank(formDTO.getFinishDesc())?formDTO.getFinishDesc():StrConstant.EPMETY_STR);
demandServiceDao.updateById(serviceEntity);
//4、插入评价
IcUserDemandSatisfactionEntity satisfactionEntity=new IcUserDemandSatisfactionEntity();
satisfactionEntity.setCustomerId(formDTO.getCustomerId());
satisfactionEntity.setDemandRecId(formDTO.getDemandRecId());
satisfactionEntity.setUserType(UserDemandConstant.STAFF);
satisfactionEntity.setUserId(formDTO.getUserId());
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);
// 3、pc完成情况:完成+评价
if(UserDemandConstant.FINISH_AND_EVALUATE.equals(formDTO.getType())){
//3.1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity=ConvertUtils.sourceToTarget(formDTO,IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(logEntity.getOperateTime());
demandSatisfactionDao.insert(satisfactionEntity);
// 3.2插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity=ConvertUtils.sourceToTarget(logEntity,IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
operateLogDao.insert(evaluateEntity);
//3.4更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
}
//4、修改主表状态为已完成
entity.setStatus(UserDemandConstant.FINISHED);
baseDao.updateById(entity);
FinishResultDTO finishResultDTO=new FinishResultDTO();
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
return finishResultDTO;
}
/**
* 校验需求是否可以点击完成
*
* @param demandRecId
* @return
*/
private IcUserDemandRecEntity checkFinishPreCondition(String demandRecId) {
IcUserDemandRecEntity entity=baseDao.selectById(demandRecId);
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if (UserDemandConstant.PENDING.equals(entity.getStatus()) ||UserDemandConstant.CANCELED.equals(entity.getStatus())) {
//待处理或者已取消的不能评价
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_FINISH.getMsg());
}
if(UserDemandConstant.FINISHED.equals(entity.getStatus()) ){
//已经完成
throw new RenException(EpmetErrorCode.DEMAND_FINISHED.getCode(), EpmetErrorCode.DEMAND_FINISHED.getMsg());
}
return entity;
}
/**
* 数据分析-个人档案居民需求列表table
*
@ -912,4 +971,154 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
}
/**
* 居民端-需求大厅未处理处理中已完成
* 未处理未指派未接单;处理中已指派已接单给我的 ;已完成我填写实际服务时间并点击确认
* @param formDTO
* @return
*/
@Override
public List<DemandHallResultDTO> listHall(ListHallFormDTO formDTO) {
PageInfo<DemandHallResultDTO> result = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectListDemandHall(formDTO.getGridId(),
formDTO.getType(),formDTO.getCurrentUserId()));
result.getList().forEach(resultDTO->{
//设置分类名称
IcResiDemandDictEntity demandDictEntity=demandDictService.getByCode(formDTO.getCustomerId(),resultDTO.getCategoryCode());
if(null!=demandDictEntity){
resultDTO.setCategoryName(demandDictEntity.getCategoryName());
}
});
return result.getList();
}
/**
* 需求大厅-需求详情
*
* @param formDTO
* @return
*/
@Override
public DemandDetailResDTO queryDetailHall(DemandDetailFormDTO formDTO) {
DemandRecResultDTO demandRecResultDTO = baseDao.selectDemandRecDetail(formDTO.getCustomerId(), formDTO.getDemandRecId());
if (null != demandRecResultDTO) {
DemandDetailResDTO result = ConvertUtils.sourceToTarget(demandRecResultDTO, DemandDetailResDTO.class);
//设置分类名称
IcResiDemandDictEntity demandDictEntity = demandDictService.getByCode(formDTO.getCustomerId(), result.getCategoryCode());
if (null != demandDictEntity) {
result.setCategoryName(demandDictEntity.getCategoryName());
}
return result;
}
return null;
}
/**
* 需求大厅-我要接单
* 未处理列表中不包含自己提出的需求不会存在自己提的需求自己接单
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public TakeOrderResultDTO takeOrder(TakeOrderFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if (!UserDemandConstant.PENDING.equals(entity.getStatus())) {
//待处理的才可以抢单
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_TAKE_ORDER.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_TAKE_ORDER.getMsg());
}
TakeOrderResultDTO takeOrderResultDTO=new TakeOrderResultDTO();
//只有志愿者才可以接单
VolunteerInfoDTO volunteerInfoDTO=volunteerInfoService.queryUserVolunteerInfo(formDTO.getUserId());
if(null==volunteerInfoDTO){
takeOrderResultDTO.setIsVolunteer(false);
return takeOrderResultDTO;
}
takeOrderResultDTO.setIsVolunteer(true);
//1、修改主表
//置为已接单
entity.setStatus(UserDemandConstant.HAVE_ORDER);
baseDao.updateById(entity);
//2、插入操作日志
IcUserDemandOperateLogEntity logEntity = new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(entity.getCustomerId());
logEntity.setDemandRecId(formDTO.getDemandRecId());
logEntity.setUserType(UserDemandConstant.RESI);
logEntity.setUserId(formDTO.getUserId());
logEntity.setActionCode(UserDemandConstant.TAKE_ORDER);
logEntity.setOperateTime(new Date());
operateLogDao.insert(logEntity);
//3、插入或更新服务记录
IcUserDemandServiceEntity origin=demandServiceDao.selectByRecId(formDTO.getDemandRecId());
String serviceId="";
if (null == origin) {
IcUserDemandServiceEntity serviceEntity=new IcUserDemandServiceEntity();
serviceEntity.setCustomerId(entity.getCustomerId());
serviceEntity.setDemandRecId(entity.getId());
serviceEntity.setServiceType(UserDemandConstant.VOLUNTEER);
serviceEntity.setServerId(formDTO.getUserId());
demandServiceDao.insert(serviceEntity);
serviceId=serviceEntity.getId();
}else{
origin.setServiceType(UserDemandConstant.VOLUNTEER);
origin.setServerId(formDTO.getUserId());
origin.setUpdatedBy(formDTO.getUserId());
demandServiceDao.updateById(origin);
serviceId=origin.getId();
}
takeOrderResultDTO.setServiceId(serviceId);
return takeOrderResultDTO;
}
/**
* 居民端-我的需求-服务评价
*
* @param formDTO
* @return
*/
@Transactional(rollbackFor = Exception.class)
@Override
public FinishResultDTO evaluate(EvaluateDemandFormDTO formDTO) {
IcUserDemandRecEntity entity = baseDao.selectById(formDTO.getDemandRecId());
if (null == entity) {
throw new RenException(EpmetErrorCode.DEMAND_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_NOT_EXITS.getMsg());
}
if (!UserDemandConstant.FINISHED.equals(entity.getStatus())) {
// 已完成的可以评价
throw new RenException(EpmetErrorCode.DEMAND_CAN_NOT_EVALUATE.getCode(), EpmetErrorCode.DEMAND_CAN_NOT_EVALUATE.getMsg());
}
// todo 只有需求人才可以评价
// 1、插入评价得分记录
IcUserDemandSatisfactionEntity satisfactionEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandSatisfactionEntity.class);
satisfactionEntity.setEvaluateTime(new Date());
satisfactionEntity.setUserType(UserDemandConstant.RESI);
demandSatisfactionDao.insert(satisfactionEntity);
// 2、插入评价操作日志
IcUserDemandOperateLogEntity evaluateEntity = ConvertUtils.sourceToTarget(formDTO, IcUserDemandOperateLogEntity.class);
evaluateEntity.setActionCode(UserDemandConstant.EVALUATE);
evaluateEntity.setOperateTime(satisfactionEntity.getEvaluateTime());
evaluateEntity.setUserType(UserDemandConstant.RESI);
operateLogDao.insert(evaluateEntity);
// 3、更新主表已评价标识,是否解决标识。
entity.setEvaluateFlag(true);
entity.setFinishResult(formDTO.getFinishResult());
baseDao.updateById(entity);
//4、返回服务方,志愿者发放积分,区域化党建单位,计算群众满意度
IcUserDemandServiceEntity serviceEntity = demandServiceDao.selectById(formDTO.getServiceId());
FinishResultDTO finishResultDTO = new FinishResultDTO();
finishResultDTO.setServerId(serviceEntity.getServerId());
finishResultDTO.setServiceType(serviceEntity.getServiceType());
finishResultDTO.setAwardPoint(entity.getAwardPoint());
return finishResultDTO;
}
}

122
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/VolunteerInfoServiceImpl.java

@ -22,23 +22,33 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.MqConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.EventEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.ResultDataResolver;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SendMqMsgUtils;
import com.epmet.constant.SmsTemplateConstant;
import com.epmet.dao.VolunteerInfoDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.HeartUserInfoDTO;
import com.epmet.dto.VolunteerInfoDTO;
import com.epmet.dto.form.CommonCustomerFormDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.SendVerificationCodeFormDTO;
import com.epmet.dto.form.VolunteerRegResiFormDTO;
import com.epmet.dto.form.resi.ResiSendSmsCodeFormDTO;
import com.epmet.dto.form.resi.ResiVolunteerAuthenticateFormDTO;
import com.epmet.dto.result.ResiUserBaseInfoResultDTO;
@ -50,6 +60,7 @@ import com.epmet.dto.result.resi.ResiVolunteerInfoResultDTO;
import com.epmet.entity.VolunteerInfoEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.HeartUserInfoService;
import com.epmet.service.VolunteerInfoService;
import com.github.pagehelper.PageHelper;
@ -64,6 +75,9 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -74,7 +88,7 @@ import java.util.stream.Collectors;
* @since v1.0.0 2020-07-19
*/
@Service
public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, VolunteerInfoEntity> implements VolunteerInfoService {
public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao, VolunteerInfoEntity> implements VolunteerInfoService, ResultDataResolver {
private Logger logger = LogManager.getLogger(VolunteerInfoServiceImpl.class);
private static final String SEND_SMS_CODE_ERROR = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]";
@ -90,7 +104,11 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Override
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/*@Override
@Transactional(rollbackFor = Exception.class)
public Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO) {
// 验证码校验
@ -125,6 +143,58 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
// 志愿者认证,更新用户基础信息
com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO param = ConvertUtils.sourceToTarget(formDTO, com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO.class);
return epmetUserOpenFeignClient.volunteerBaseInfo(param);
}*/
@Override
@Transactional(rollbackFor = Exception.class)
public void authenticate(ResiVolunteerAuthenticateFormDTO formDTO) {
// 1、验证码校验
if (StringUtils.isNotBlank(formDTO.getSmsCode())) {
String smsCodeKey = RedisKeys.getVolunteerSmsCodeKey(formDTO.getMobile());
String rightSmsCode = (String) redisUtils.get(smsCodeKey);
if (!formDTO.getSmsCode().equals(rightSmsCode)) {
logger.warn(String.format("验证码错误code[%s],msg[%s]", EpmetErrorCode.MOBILE_CODE_ERROR.getCode(), EpmetErrorCode.MOBILE_CODE_ERROR.getMsg()));
throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode());
}
}
// 2、检查是否是志愿者
VolunteerInfoDTO originVolunteer = baseDao.selectVolunteerInfoByUserId(formDTO.getUserId());
if (null != originVolunteer) {
//能修改的只有这两个属性,像是网格id,网格名称,pid,pids不允许修改,第一次注册成功后不可修改
originVolunteer.setVolunteerIntroduce(formDTO.getVolunteerIntroduce());
originVolunteer.setVolunteerSignature(formDTO.getVolunteerSignature());
baseDao.updateById(ConvertUtils.sourceToTarget(originVolunteer, VolunteerInfoEntity.class));
} else {
//2.1不是志愿者:插入志愿者信息表
VolunteerInfoEntity insertVolunteer = ConvertUtils.sourceToTarget(formDTO, VolunteerInfoEntity.class);
// 赋值gridName,pid,pids
CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO();
customerGridFormDTO.setGridId(formDTO.getGridId());
Result<CustomerGridDTO> gridInfoRes = govOrgOpenFeignClient.getGridBaseInfoByGridId(customerGridFormDTO);
if (!gridInfoRes.success() || null == gridInfoRes.getData()) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询网格信息失败");
}
insertVolunteer.setGridName(gridInfoRes.getData().getGridName());
insertVolunteer.setPid(gridInfoRes.getData().getPid());
insertVolunteer.setPids(gridInfoRes.getData().getPids());
baseDao.insert(insertVolunteer);
// 2.2 更新用户信息表的 是否是志愿者标识
HeartUserInfoDTO userInfoDTO = new HeartUserInfoDTO();
userInfoDTO.setUserId(formDTO.getUserId());
userInfoDTO.setVolunteerFlag(true);
heartUserInfoService.updateHeartUserInfoByUserId(userInfoDTO);
// 2.3发送消息 由积分系统消费消息(需要使用规则)
this.grantActPoints(formDTO);
}
//3、志愿者认证,更新用户基础信息user_base_info+自动注册居民
VolunteerRegResiFormDTO param = ConvertUtils.sourceToTarget(formDTO, VolunteerRegResiFormDTO.class);
Result regResi=epmetUserOpenFeignClient.volunteerAutoRegResi(param);
if(!regResi.success()){
logger.warn(String.format("userId:%s,认证志愿者时,自动注册居民失败,返参:%s",formDTO.getUserId(), JSON.toJSONString(regResi)));
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), regResi.getMsg());
}
}
private void grantActPoints(ResiVolunteerAuthenticateFormDTO formDTO){
@ -231,14 +301,38 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
return volunteerInfoDTO;
}
/**
* pc指派需求给志愿者时根据工作人员登录的组织显示组织下的志愿者
*
* @param customerId
* @param staffId
* @param userRealName
* @return
*/
@Override
public List<OptionDTO> queryListVolunteer(String customerId, String userRealName) {
public List<OptionDTO> queryListVolunteer(String customerId, String staffId,String userRealName) {
CustomerStaffInfoCacheResult staffInfo= CustomerStaffRedis.getStaffInfo(customerId,staffId);
if (null == staffInfo) {
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询工作人员信息异常");
}
// 如果是根级组织的工作人员,agencyPids="";正常是以英文冒号隔开
String pids="";
if(StringUtils.isBlank(staffInfo.getAgencyPIds())||NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())){
pids=staffInfo.getAgencyId();
}else{
pids=staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId());
}
LambdaQueryWrapper<VolunteerInfoEntity> query=new LambdaQueryWrapper<>();
query.eq(VolunteerInfoEntity::getCustomerId,customerId);
query.likeRight(VolunteerInfoEntity::getPids,pids);
query.select(VolunteerInfoEntity::getUserId);
query.orderByAsc(VolunteerInfoEntity::getCreatedTime);
Set<String> userIds = baseDao.selectObjs(query).stream().map(o->o.toString()).collect(Collectors.toSet());
List<OptionDTO> resultList = new ArrayList<>();
List<String> userIds = baseDao.selectVolunteerIds(customerId);
if (CollectionUtils.isEmpty(userIds)) {
return resultList;
}
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(userIds);
Result<List<UserBaseInfoResultDTO>> userInfoRes = epmetUserOpenFeignClient.queryUserBaseInfo(new ArrayList<>(userIds));
if (userInfoRes.success() && CollectionUtils.isNotEmpty(userInfoRes.getData())) {
Map<String, UserBaseInfoResultDTO> userMap = userInfoRes.getData().stream().collect(Collectors.toMap(UserBaseInfoResultDTO::getUserId, Function.identity()));
for (String userId : userIds) {
@ -263,9 +357,23 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
}
@Override
public List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize) {
public List<PageVolunteerInfoResultDTO> queryVolunteerPage(String customerId, Integer pageNo, Integer pageSize, String superiorAgencyId) {
LambdaQueryWrapper<VolunteerInfoEntity> query = new LambdaQueryWrapper<>();
query.eq(VolunteerInfoEntity::getCustomerId, customerId);
Optional.ofNullable(customerId).ifPresent(cid -> query.eq(VolunteerInfoEntity::getCustomerId, cid));
Optional.ofNullable(superiorAgencyId).ifPresent(cid -> {
// 需要查询agency的pids:id,通过这个字符串去匹配志愿者的Pids字段来查询
String errorMsg = "【分页查询志愿者列表】失败";
CustomerAgencyDTO agencyInfo = getResultDataOrThrowsException(govOrgOpenFeignClient.getAgencyById(superiorAgencyId), ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
if (agencyInfo == null) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
String pidsAndAgencyIdPath = agencyInfo.getPids().concat(":").concat(superiorAgencyId);
if (pidsAndAgencyIdPath.startsWith(":")) pidsAndAgencyIdPath = pidsAndAgencyIdPath.replaceFirst(":", "");
query.likeRight(VolunteerInfoEntity::getPids, pidsAndAgencyIdPath);
});
PageHelper.startPage(pageNo, pageSize);
List<VolunteerInfoEntity> volunteerInfoEntities = baseDao.selectList(query);

8
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql

@ -0,0 +1,8 @@
alter table ic_user_demand_rec add COLUMN AWARD_POINT int(11) not null default '0' comment '奖励积分',
add COLUMN SERVICE_LOCATION VARCHAR(255) NOT NULL DEFAULT '' COMMENT '服务地点,工作端指派默认居民居住房屋地址,居民端地图选择',
add COLUMN LOCATION_DETAIL VARCHAR(255) DEFAULT'' COMMENT '门牌号详细地址',
add COLUMN LONGITUDE VARCHAR(64) DEFAULT'' COMMENT '经度,需求人是ic的居民时,取所住楼栋的中心点位',
add COLUMN LATITUDE VARCHAR(64) DEFAULT'' COMMENT '纬度,需求人是ic的居民时,取所住楼栋的中心点位',
add COLUMN DEMAND_USER_HOUSE_ID VARCHAR(64) DEFAULT'' COMMENT '需求人是ic的居民时,记录下住的房屋id';
alter table volunteer_info add COLUMN PID VARCHAR(64) comment '网格所属的组织id' after GRID_ID;
alter table volunteer_info add COLUMN PIDS VARCHAR(255) comment '网格的所有上级' after PID;

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

@ -247,4 +247,11 @@
AND m.CUSTOMER_ID = #{customerId}
AND m.CATEGORY_CODE = #{categoryCode}
</select>
<select id="selectByCode" parameterType="map" resultType="com.epmet.entity.IcResiDemandDictEntity">
select * from ic_resi_demand_dict
where del_flag='0'
and customer_id=#{customerId}
and category_code=#{categoryCode}
</select>
</mapper>

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

@ -205,7 +205,9 @@
CASE WHEN R.DEMAND_USER_TYPE='mini_resi' THEN R.DEMAND_USER_ID
ELSE ''
END
) as epmetUserId
) as epmetUserId,
r.AWARD_POINT as awardPoint,
concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress
FROM
ic_user_demand_rec r
left JOIN ic_user_demand_service s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )
@ -411,4 +413,43 @@
</if>
group by s.SERVER_ID
</select>
<!-- 居民端-需求大厅(未处理、处理中、已完成) type 未处理:unprocessed;处理中:processing;已完成:finished -->
<!-- 未处理:未指派、未接单;处理中:已指派、已接单给我的 ;已完成:我填写实际服务时间,并点击确认 -->
<select id="selectListDemandHall" parameterType="map" resultType="com.epmet.dto.result.demand.DemandHallResultDTO">
SELECT
r.id as demandRecId,
r.CATEGORY_CODE,
r.PARENT_CODE,
r.WANT_SERVICE_TIME,
concat( r.SERVICE_LOCATION, r.LOCATION_DETAIL ) AS serviceAddress,
r.AWARD_POINT,
r.DEMAND_USER_NAME,
r.DEMAND_USER_MOBILE,
s.SCORE,
r.`STATUS`,
r.EVALUATE_FLAG
FROM
ic_user_demand_rec r
left join ic_user_demand_service m
on(r.id=m.DEMAND_REC_ID and m.DEL_FLAG='0')
LEFT JOIN ic_user_demand_satisfaction s ON ( r.id = s.DEMAND_REC_ID AND s.DEL_FLAG = '0' )
WHERE
r.DEL_FLAG = '0'
AND r.GRID_ID = #{gridId}
AND R.DEMAND_USER_ID !=#{currentUserId}
<if test="null !=type and type =='unprocessed' ">
AND r.`STATUS` = 'pending'
</if>
<if test="null !=type and type =='processing' ">
AND (r.`STATUS` = 'assigned' OR r.`STATUS` = 'have_order')
and m.SERVER_ID=#{currentUserId}
</if>
<if test="null !=type and type =='finished' ">
AND r.`STATUS`='finished'
and m.SERVER_ID=#{currentUserId}
and m.SERVICE_START_TIME is not null and m.SERVICE_END_TIME is not null
</if>
order by r.WANT_SERVICE_TIME asc
</select>
</mapper>

9
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -17,6 +17,8 @@
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="pid" column="PID"/>
<result property="pids" column="PIDS"/>
</resultMap>
<select id="queryVolunteerFlagByUserId" parameterType="java.lang.String" resultType="java.lang.Integer">
@ -55,12 +57,7 @@
<select id="selectVolunteerInfoByUserId" parameterType="java.lang.String" resultType="com.epmet.dto.VolunteerInfoDTO">
SELECT
CUSTOMER_ID customerId,
VOLUNTEER_INTRODUCE volunteerIntroduce,
VOLUNTEER_SIGNATURE volunteerSignature,
GRID_ID gridId,
GRID_NAME gridName,
USER_ID as userId
*
FROM volunteer_info
WHERE DEL_FLAG = '0'
AND USER_ID = #{userId}

30
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ResiEventAutoAuditTask.java

@ -0,0 +1,30 @@
package com.epmet.task;
import com.epmet.commons.tools.utils.Result;
import com.epmet.feign.GovProjectOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author sun
* @dscription 事件语音附件自动审核任务没两分钟执行一次
*/
@Slf4j
@Component("resiEventAutoAuditTask")
public class ResiEventAutoAuditTask implements ITask {
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
@Override
public void run(String params) {
log.info("ResiEventAutoAuditTask定时任务正在执行,参数为:{}", params);
Result result = govProjectOpenFeignClient.autoAudit();
if (result.success()) {
log.info("ResiEventAutoAuditTask定时任务执行成功");
} else {
log.error("ResiEventAutoAuditTask定时任务执行失败:" + result.getMsg());
}
}
}

12
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/UserMessageTypeConstant.java

@ -191,4 +191,16 @@ public interface UserMessageTypeConstant {
* user_badge_certificate_record.id
*/
String BADGE_AUTH_APPLY="badge_auth_apply";
/**
* 事件回复立项办结操作
* rsi_event.id
*/
String EVENT ="event ";
/**
* 需求接单指派确认服务时间操作
* ic_user_demand_rec.id
*/
String DEMAND="demand";
}

13
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/UserMessageController.java

@ -18,7 +18,9 @@
package com.epmet.controller;
import com.baomidou.mybatisplus.extension.api.R;
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.AssertUtils;
@ -162,4 +164,15 @@ public class UserMessageController {
List<StaffMessageResultDTO> list = userMessageService.queryStaffMessage(formDTO);
return new Result<List<StaffMessageResultDTO>>().ok(list);
}
/**
* @Author sun
* @Description 消息删除已读消息列表
**/
@PostMapping("delreadmsg")
public Result delReadMsg(@LoginUser TokenDto tokenDto) {
userMessageService.delReadMsg(tokenDto.getUserId());
return new Result();
}
}

6
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/UserMessageDao.java

@ -62,4 +62,10 @@ public interface UserMessageDao extends BaseDao<UserMessageEntity> {
* @Date 2020/5/17 16:47
**/
List<StaffMessageResultDTO> queryStaffMessage(StaffMessageFormDTO formDTO);
/**
* @Author sun
* @Description 消息删除已读消息列表
**/
int delReadMsg(@Param("userId") String userId);
}

6
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/UserMessageService.java

@ -142,4 +142,10 @@ public interface UserMessageService extends BaseService<UserMessageEntity> {
StaffUnReadMsgResultDTO queryUnReadMsg(StaffMessageCommonFormDTO formDTO);
List<StaffMessageResultDTO> queryStaffMessage(StaffMessageFormDTO formDTO);
/**
* @Author sun
* @Description 消息删除已读消息列表
**/
void delReadMsg(String userId);
}

10
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/UserMessageServiceImpl.java

@ -209,4 +209,14 @@ public class UserMessageServiceImpl extends BaseServiceImpl<UserMessageDao, User
List<StaffMessageResultDTO> list = baseDao.queryStaffMessage(formDTO);
return list;
}
/**
* @Author sun
* @Description 消息删除已读消息列表
**/
@Override
public void delReadMsg(String userId) {
baseDao.delReadMsg(userId);
}
}

11
epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/UserMessageDao.xml

@ -81,4 +81,15 @@
ORDER BY CREATED_TIME DESC
LIMIT #{pageNo}, #{pageSize}
</select>
<delete id="delReadMsg">
UPDATE user_message
SET del_flag = '0',
updated_by = #{userId},
updated_time = NOW()
WHERE
read_flag = 'read'
AND user_id = #{userId}
</delete>
</mapper>

2
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/CommonIssueListFormDTO.java

@ -32,4 +32,6 @@ public class CommonIssueListFormDTO implements Serializable {
* 每页多少条
* */
private Integer pageSize = 20;
private Boolean isPage = true;
}

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

@ -587,9 +587,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
**/
@Override
public List<VotingIssueListResultDTO> votingList(CommonIssueListFormDTO issueListForm) {
issueListForm.setPageNo(null == issueListForm.getPageNo() ? NumConstant.ZERO :
(issueListForm.getPageNo() - NumConstant.ONE)*issueListForm.getPageSize()
);
PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage());
return baseDao.selectVotingList(issueListForm);
}
@ -602,9 +600,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
**/
@Override
public List<ClosedIssueListResultDTO> closedList(CommonIssueListFormDTO issueListForm) {
issueListForm.setPageNo(null == issueListForm.getPageNo() ? NumConstant.ZERO :
(issueListForm.getPageNo() - NumConstant.ONE)*issueListForm.getPageSize()
);
PageHelper.startPage(issueListForm.getPageNo(), issueListForm.getPageSize(), issueListForm.getIsPage());
return baseDao.selectClosedList(issueListForm);
}
@ -1555,15 +1551,17 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
}
if (CollectionUtils.isNotEmpty(resultList)) {
resultList = resultList.stream().sorted(Comparator.comparing(UnResolvedResultDTO::getClosedTime).reversed()).collect(Collectors.toList());
int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize();
int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize();
if (fromIndex >= resultList.size()) {
return new ArrayList<>();
}
if (toIndex > resultList.size()) {
toIndex = resultList.size();
if (fromDTO.getIsPage()) {
int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize();
int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize();
if (fromIndex >= resultList.size()) {
return new ArrayList<>();
}
if (toIndex > resultList.size()) {
toIndex = resultList.size();
}
resultList = resultList.subList(fromIndex, toIndex);
}
resultList = resultList.subList(fromIndex, toIndex);
}
return resultList;
}

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

@ -218,8 +218,6 @@
AND ISSUE_STATUS = 'voting'
ORDER BY
created_time DESC
LIMIT #{pageNo},
#{pageSize}
</select>
<!-- 查询已关闭议题列表 -->
@ -239,8 +237,6 @@
AND RESOLVE_TYPE = 'resolved'
ORDER BY
created_time DESC
LIMIT #{pageNo},
#{pageSize}
</select>
<!-- 查询已关闭议题列表 政府端 -->
<select id="selectClosedListGov" parameterType="com.epmet.dto.form.CommonIssueListFormDTO" resultType="com.epmet.dto.result.ClosedIssueListGovResultDTO">

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerAgencyDTO.java

@ -157,4 +157,19 @@ public class CustomerAgencyDTO implements Serializable {
* 中心位置纬度
*/
private String latitude;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

15
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerDepartmentDTO.java

@ -94,4 +94,19 @@ public class CustomerDepartmentDTO implements Serializable {
*/
private Date updatedTime;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

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

@ -126,4 +126,24 @@ public class CustomerGridDTO implements Serializable {
* 所有上级组织名
*/
private String allParentName;
/**
* 网格编码
*/
private String code;
/**
* 组织编码
*/
private String gridType;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPartyServiceCenterMatterDTO.java

@ -98,4 +98,9 @@ public class IcPartyServiceCenterMatterDTO implements Serializable {
*/
private String customerId;
/**
* 封面图
*/
private String matterImg;
}

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/MatterListDTO.java

@ -38,10 +38,13 @@ public class MatterListDTO implements Serializable {
private String appointmentType;
private String matterImg;
public MatterListDTO() {
this.sort = NumConstant.ZERO;
this.matterName = "";
this.matterId = "";
this.allowTime = "";
this.matterImg = "";
}
}

12
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java

@ -87,4 +87,16 @@ public class AddAgencyV2FormDTO implements Serializable {
//区域编码名称
@NotBlank(message = "", groups = AreaCodeGroup.class)
private String areaName;
/**
* 组织编码[手动输入的]
*/
private String code;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddDepartmentFormDTO.java

@ -54,5 +54,18 @@ public class AddDepartmentFormDTO implements Serializable {
@Length(max=250,message = "部门职责不能超过250个字")
private String departmentDuty;
/**
* 组织编码
*/
private String code;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

16
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddGridFormDTO.java

@ -34,5 +34,21 @@ public class AddGridFormDTO implements Serializable {
* 管辖区域
*/
private String manageDistrict;
/**
* 网格编码[手动输入的]
*/
private String code;
/**
* 网格类型字典表sys_dict_data,key:grid_type
*/
private String gridType;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AllMattersFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/20 1:50 下午
* @DESC
*/
@Data
public class AllMattersFormDTO implements Serializable {
private static final long serialVersionUID = 5292223887794821327L;
public interface AllMattersForm{}
@NotBlank(message = "gridId不能为空",groups = AllMattersForm.class)
private String gridId;
}

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java

@ -59,4 +59,17 @@ public class EditAgencyFormDTO implements Serializable {
@NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class)
private String userId;
/**
* 组织编码[手动输入的]
*/
private String code;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditDepartmentFormDTO.java

@ -56,4 +56,17 @@ public class EditDepartmentFormDTO implements Serializable {
@Length(max=250,message = "部门职责不能超过250个字")
private String departmentDuty;
/**
* 组织编码[手动输入的]
*/
private String code;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

16
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditGridFormDTO.java

@ -42,5 +42,21 @@ public class EditGridFormDTO implements Serializable {
//客户Id
private String customerId;
/**
* 网格编码[手动输入的]
*/
private String code;
/**
* 网格类型字典表sys_dict_data,key:grid_type
*/
private String gridType;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

26
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/OrgMobileFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
/**
* @author sun
* @Description 查询网格所属组织电话
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrgMobileFormDTO {
/**
* 网格Id
*/
@NotBlank(message = "网格Id不能为空", groups = OrgMobile.class)
private String gridId;
public interface OrgMobile{}
}

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyListResultDTO.java

@ -46,6 +46,17 @@ public class AgencyListResultDTO implements Serializable {
* 总人数
*/
private Integer totalUser;
/**
* 编码
*/
private String code;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

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

@ -106,4 +106,16 @@ public class AgencysResultDTO implements Serializable {
* 当前agencyId所属的客户id
*/
private String customerId;
/**
* 组织编码[手动输入的]
*/
private String code;
/**
* 负责人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

43
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AllMattersResultDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/12/20 1:51 下午
* @DESC
*/
@Data
public class AllMattersResultDTO implements Serializable {
private static final long serialVersionUID = -2859875516671396422L;
/**
* 可预约事项名字
*/
private String matterName;
/**
* 可预约时间
*/
private String allowTime;
/**
* 可预约事项ID
*/
private String matterId;
/**
* 事项封面图
*/
private String matterImg;
public AllMattersResultDTO() {
this.matterName = "";
this.allowTime = "";
this.matterId = "";
this.matterImg = "";
}
}

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java

@ -60,4 +60,17 @@ public class DepartmentDetailResultDTO implements Serializable {
private String areaCode;
/**
* 组织编码[手动输入的]
*/
private String code = "";
/**
* 负责人
*/
private String contacts = "";
/**
* 联系电话
*/
private String mobile = "";
}

14
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentListResultDTO.java

@ -45,5 +45,17 @@ public class DepartmentListResultDTO implements Serializable {
/**
* 部门下总人数
*/
private Integer totalUser;
private Integer totalUser = 0;
/**
* 编码
*/
private String code;
/**
* 负责人
*/
private String contacts = "";
/**
* 联系电话
*/
private String mobile = "";
}

16
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridBaseInfoResultDTO.java

@ -29,4 +29,20 @@ public class GridBaseInfoResultDTO implements Serializable {
* 网格人数
* */
private Integer totalUser;
/**
* 编码
*/
private String code = "";
/**
* 编码
*/
private String gridType = "";
/**
* 负责人
*/
private String contacts = "";
/**
* 联系电话
*/
private String mobile = "";
}

17
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java

@ -65,4 +65,21 @@ public class GridDetailResultDTO implements Serializable {
*/
private List<StaffGridListDTO> staffGridList;
/**
* 网格编码
*/
private String code = "";
/**
* 网格类型
*/
private String gridType = "";
/**
* 负责人
*/
private String contacts = "";
/**
* 联系电话
*/
private String mobile = "";
}

14
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java

@ -17,7 +17,10 @@ public class HouseInfoDTO implements Serializable {
*/
private String homeId;
/**
* 小区详细地址
*/
private String neighborAddress;
/**
* 小区id
*/
@ -59,4 +62,13 @@ public class HouseInfoDTO implements Serializable {
private String houseType;
private String houseName;
/**
* 楼的经度
*/
private String buildingLongitude;
/**
* 楼的纬度
*/
private String buildingLatitude;
}

25
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgMobileResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @author sun
* @Description 查询网格所属组织电话
*/
@Data
public class OrgMobileResultDTO implements Serializable {
/**
* 机关组织Id
*/
private String agencyId = "";
/**
* 机关组织名称
*/
private String agencyName = "";
/**
* 组织联系电话
*/
private String mobile = "";
}

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

@ -20,7 +20,7 @@ import java.util.Set;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:37
*/
//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092")
// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class, url = "localhost:8092")
@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallbackFactory = GovOrgOpenFeignClientFallbackFactory.class)
public interface GovOrgOpenFeignClient {

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

@ -369,4 +369,14 @@ public class CustomerAgencyController {
return new Result<AgencyTreeResultDTO>().ok(customerAgencyService.getOrgTreeData(tokenDTO.getUserId()));
}
/**
* @Description 事件社区服务热线
* @author sun
**/
@PostMapping("orgmobile")
Result<OrgMobileResultDTO> orgMobile(@RequestBody OrgMobileFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, OrgMobileFormDTO.OrgMobile.class);
return new Result<OrgMobileResultDTO>().ok(customerAgencyService.orgMobile(formDTO.getGridId()));
}
}

14
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPartyServiceCenterController.java

@ -30,6 +30,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
@ -204,4 +205,17 @@ public class IcPartyServiceCenterController {
return new Result();
}
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
@PostMapping("getallmatters")
public Result<List<AllMattersResultDTO>> getAllMatters(@RequestBody AllMattersFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, AllMattersFormDTO.AllMattersForm.class);
return new Result<List<AllMattersResultDTO>>().ok(icPartyServiceCenterService.getAllMatters(formDTO));
}
}

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

@ -282,5 +282,10 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
*/
List<String> getSonAgencyId(@Param("orgId") String orgId);
/**
* @Description 事件社区服务热线
* @author sun
**/
OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId);
}

9
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPartyServiceCenterDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.entity.IcPartyServiceCenterEntity;
import org.apache.ibatis.annotations.Mapper;
@ -42,4 +43,12 @@ public interface IcPartyServiceCenterDao extends BaseDao<IcPartyServiceCenterEnt
*/
List<PartyServiceCenterListResultDTO> partyServiceCenterList(@Param("orgId")String orgId);
/**
* @Description 获取网格所属组织下所有的可预约事项
* @param orgId
* @author zxc
* @date 2021/12/21 1:59 下午
*/
List<AllMattersResultDTO> getAllMatters(@Param("orgId")String orgId);
}

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java

@ -123,4 +123,19 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
* 中心位置纬度
*/
private String latitude;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

15
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerDepartmentEntity.java

@ -64,4 +64,19 @@ public class CustomerDepartmentEntity extends BaseEpmetEntity {
* 部门所属的行政地区编码:实际就是所属组织的地区编码
*/
private String areaCode;
/**
* 组织编码
*/
private String code;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerGridEntity.java

@ -84,4 +84,24 @@ public class CustomerGridEntity extends BaseEpmetEntity {
* 坐标
*/
private String coordinates;
/**
* 网格编码
*/
private String code;
/**
* 组织编码
*/
private String gridType;
/**
* 负责人姓名
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
}

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPartyServiceCenterMatterEntity.java

@ -68,4 +68,9 @@ public class IcPartyServiceCenterMatterEntity extends BaseEpmetEntity {
*/
private String customerId;
/**
* 封面图
*/
private String matterImg;
}

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

@ -263,4 +263,10 @@ public interface CustomerAgencyService extends BaseService<CustomerAgencyEntity>
* @return
*/
AgencyTreeResultDTO getOrgTreeData(String staffId);
/**
* @Description 事件社区服务热线
* @author sun
**/
OrgMobileResultDTO orgMobile(String gridId);
}

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

@ -22,6 +22,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AllMattersResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
@ -166,4 +167,12 @@ public interface IcPartyServiceCenterService extends BaseService<IcPartyServiceC
*/
void cancelAppointment(CancelAppointmentFormDTO formDTO);
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
List<AllMattersResultDTO> getAllMatters(AllMattersFormDTO formDTO);
}

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

@ -149,6 +149,9 @@ public class AgencyServiceImpl implements AgencyService {
//当前客户下,同级组织中,组织名称不允许重复
customerAgencyService.checkAgencyName(formDTO.getAgencyName(),originalEntity.getCustomerId(),originalEntity.getId(),originalEntity.getPid());
originalEntity.setOrganizationName(formDTO.getAgencyName());
originalEntity.setCode(formDTO.getCode());
originalEntity.setContacts(formDTO.getContacts());
originalEntity.setMobile(formDTO.getMobile());
//1:更新当前组织信息
if (customerAgencyDao.updateById(originalEntity) < NumConstant.ONE) {
log.error(CustomerAgencyConstant.UPDATE_EXCEPTION);
@ -252,6 +255,9 @@ public class AgencyServiceImpl implements AgencyService {
agencysResultDTO = ConvertUtils.sourceToTarget(entity, AgencysResultDTO.class);
agencysResultDTO.setAgencyId(entity.getId());
agencysResultDTO.setAgencyName(entity.getOrganizationName());
agencysResultDTO.setCode(entity.getCode());
agencysResultDTO.setContacts(entity.getContacts());
agencysResultDTO.setMobile(entity.getMobile());
//2021.5.26 sun 添加当前组织对应客户的根组织级别返参 start
if (null != entity) {
if (null == entity.getPids() || "".equals(entity.getPids())) {

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

@ -1193,4 +1193,14 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
public List<StaffOrgsResultDTO> getStaffOrgListByStaffId(String staffId) {
return baseDao.getStaffOrgListByStaffId(staffId);
}
/**
* @Description 事件社区服务热线
* @author sun
**/
@Override
public OrgMobileResultDTO orgMobile(String gridId) {
return baseDao.getAgencyMobile(gridId);
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save