Browse Source

Merge remote-tracking branch 'remotes/origin/develop' into release_temp

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

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;
}

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;
/**

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;
}

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();
}
}

9
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()));
}
/**

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,8 +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);
}

5
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, 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;
}
}

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

@ -23,8 +23,10 @@ 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;
@ -32,6 +34,7 @@ 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;
@ -39,10 +42,13 @@ 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;
@ -70,6 +76,8 @@ 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;
@ -95,11 +103,12 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Override
/*@Override
@Transactional(rollbackFor = Exception.class)
public Result authenticate(TokenDto tokenDto, ResiVolunteerAuthenticateFormDTO formDTO) {
// 验证码校验
@ -134,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){
@ -240,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) {
@ -276,12 +361,12 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
LambdaQueryWrapper<VolunteerInfoEntity> query = new LambdaQueryWrapper<>();
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);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
String pidsAndAgencyIdPath = agencyInfo.getPids().concat(":").concat(superiorAgencyId);

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>

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

@ -57,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()));
}
}

7
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/HouseController.java

@ -32,7 +32,6 @@ import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.IcNeighborHoodResultDTO;
import com.epmet.excel.IcHouseExcel;
import com.epmet.service.HouseService;
import com.epmet.service.NeighborHoodService;
import com.epmet.util.ExcelPoiUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -56,10 +55,6 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("house")
public class HouseController {
@Autowired
private NeighborHoodService neighborHoodService;
@Autowired
private HouseService houseService;
@ -173,4 +168,4 @@ public class HouseController {
Result<List<HouseInfoDTO>> queryListHouseInfo(@RequestBody Set<String> houseIds){
return new Result<List<HouseInfoDTO>>().ok(houseService.queryListHouseInfo(houseIds));
}
}
}

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())) {

18
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/BuildingServiceImpl.java

@ -365,25 +365,9 @@ public class BuildingServiceImpl implements BuildingService {
private IPage<Map<String, Object>> searchBuilding(ListIcNeighborHoodFormDTO formDTO) {
IPage<IcBuildingEntity> page = new Page<IcBuildingEntity>(formDTO.getPageNo(),formDTO.getPageSize());
// IcNeighborHoodEntity neighbor = new IcNeighborHoodEntity();
// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();
// neighborHoodEntityQueryWrapper.lambda()
// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId())
// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId())
// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId())
// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName());
IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class);
building.setDelFlag("0");
// QueryWrapper<IcBuildingEntity> buildingEntityQueryWrapper = new QueryWrapper<>();
//
// buildingEntityQueryWrapper.lambda()
// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId())
// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName());
// buildingEntityQueryWrapper.eq("a.DEL_FLAG","0");
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
IPage<Map<String, Object>> mapIPage = icBuildingDao.searchBuildingByPage(page, building, house);
List<Map<String, Object>> records = mapIPage.getRecords();

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);
}
}

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

@ -258,6 +258,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
customerGridEntity.setAreaCode(customerAgencyDTO.getAreaCode());
customerGridEntity.setCustomerId(customerAgencyDTO.getCustomerId());
customerGridEntity.setPid(addGridFormDTO.getAgencyId());
customerGridEntity.setCode(addGridFormDTO.getCode());
customerGridEntity.setGridType(addGridFormDTO.getGridType());
customerGridEntity.setContacts(addGridFormDTO.getContacts());
customerGridEntity.setMobile(addGridFormDTO.getMobile());
//新增area_code,部门的area_code=所属组织的area_code
customerGridEntity.setAreaCode(null != customerAgencyDTO && StringUtils.isNotBlank(customerAgencyDTO.getAreaCode()) ? customerAgencyDTO.getAreaCode() : StrConstant.EPMETY_STR);
@ -296,6 +300,10 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
customerGridDTO.setGridName(editGridFormDTO.getGridName());
customerGridDTO.setUpdatedBy(tokenDto.getUserId());
customerGridDTO.setId(editGridFormDTO.getGridId());
customerGridDTO.setCode(editGridFormDTO.getCode());
customerGridDTO.setGridType(editGridFormDTO.getGridType());
customerGridDTO.setContacts(editGridFormDTO.getContacts());
customerGridDTO.setMobile(editGridFormDTO.getMobile());
baseDao.editGrid(customerGridDTO);
return new Result();

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java

@ -114,10 +114,8 @@ public class DepartmentServiceImpl implements DepartmentService {
@Transactional(rollbackFor = Exception.class)
public Result editDepartment(EditDepartmentFormDTO formDTO) {
Result result = new Result();
CustomerDepartmentEntity entity = new CustomerDepartmentEntity();
CustomerDepartmentEntity entity = ConvertUtils.sourceToTarget(formDTO, CustomerDepartmentEntity.class);
entity.setId(formDTO.getDepartmentId());
entity.setDepartmentName(formDTO.getDepartmentName());
entity.setDepartmentDuty(formDTO.getDepartmentDuty());
if (customerDepartmentDao.updateById(entity) < NumConstant.ONE) {
log.error(CustomerDepartmentConstant.UPDATE_EXCEPTION);
throw new RenException(CustomerDepartmentConstant.UPDATE_EXCEPTION);

27
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -201,9 +201,7 @@ public class HouseServiceImpl implements HouseService {
//3.保存
icHouseService.insertBatch(houseEntityList);
/*if(!"".equals(str)){
return new Result().error(9999, str.append("不存在").toString());
}*/
return numList;
}
@ -252,28 +250,6 @@ public class HouseServiceImpl implements HouseService {
private IPage<Map<String, Object>> searchHouse(ListIcNeighborHoodFormDTO formDTO) {
IPage<IcHouseEntity> page = new Page<IcHouseEntity>(formDTO.getPageNo(),formDTO.getPageSize());
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();
// neighborHoodEntityQueryWrapper.lambda()
// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId())
// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId())
// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId())
// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName());
// IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
// QueryWrapper<IcBuildingEntity> buildingEntityQueryWrapper = new QueryWrapper<>();
// buildingEntityQueryWrapper.lambda()
// .eq(!StringUtils.isEmpty(formDTO.getBuildingId()),IcBuildingEntity::getId,formDTO.getBuildingId())
// .like(!StringUtils.isEmpty(formDTO.getBuildingName()),IcBuildingEntity::getBuildingName,formDTO.getBuildingName());
// IcBuildingEntity building = ConvertUtils.sourceToTarget(formDTO, IcBuildingEntity.class);
// QueryWrapper<IcHouseEntity> houseEntityQueryWrapper = new QueryWrapper<>();
// houseEntityQueryWrapper.lambda()
// .eq(!StringUtils.isEmpty(formDTO.getOwnerName()),IcHouseEntity::getOwnerName,formDTO.getOwnerName())
// .like(!StringUtils.isEmpty(formDTO.getOwnerPhone()),IcHouseEntity::getOwnerPhone,formDTO.getOwnerPhone());
// houseEntityQueryWrapper.eq("a.DEL_FLAG","0");
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
house.setDelFlag("0");
@ -281,7 +257,6 @@ public class HouseServiceImpl implements HouseService {
List<Map<String, Object>> records = mapIPage.getRecords();
records.forEach(item->{
item.put("houseType", HouseTypeEnums.getTypeValue(item.get("houseTypeKey")));
// item.put("rentFlag", HouseRentFlagEnums.getTypeValue(item.get("rentFlagKey") ));
item.put("purpose", HousePurposeEnums.getTypeValue(item.get("purposeKey")));
});
return mapIPage;

32
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPartyServiceCenterServiceImpl.java

@ -31,6 +31,7 @@ import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
@ -40,10 +41,7 @@ import com.epmet.dao.IcPartyServiceCenterDao;
import com.epmet.dto.IcPartyServiceCenterDTO;
import com.epmet.dto.TimeDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.AppointmentExistRecordResultDTO;
import com.epmet.dto.result.AppointmentRecordResultDTO;
import com.epmet.dto.result.AppointmentTimeResultDTO;
import com.epmet.dto.result.PartyServiceCenterListResultDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.IcMatterAppointmentRecordEntity;
import com.epmet.entity.IcPartyServiceCenterEntity;
import com.epmet.entity.IcPartyServiceCenterMatterEntity;
@ -326,6 +324,13 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
}
formDTO.setOrgId(staffInfo.getAgencyId());
}
if (StringUtils.isNotBlank(formDTO.getOrgType()) && formDTO.getOrgType().equals("grid")){
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getOrgId());
if (null == gridInfo){
throw new EpmetException(String.format("未查询到网格{%s}信息",formDTO.getOrgId()));
}
formDTO.setOrgId(gridInfo.getPid());
}
List<PartyServiceCenterListResultDTO> result = baseDao.partyServiceCenterList(formDTO.getOrgId());
if (CollectionUtils.isNotEmpty(result)){
result.forEach(r -> {
@ -435,6 +440,25 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ
matterAppointmentRecordDao.cancelAppointment(formDTO.getRecordId(), formDTO.getUserId());
}
/**
* @Description 网格所属组织下所有可预约事项
* @param formDTO
* @author zxc
* @date 2021/12/20 3:17 下午
*/
@Override
public List<AllMattersResultDTO> getAllMatters(AllMattersFormDTO formDTO) {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(formDTO.getGridId());
if (null == gridInfo){
throw new EpmetException(String.format("未查询到网格{%s}信息",formDTO.getGridId()));
}
List<AllMattersResultDTO> allMatters = baseDao.getAllMatters(gridInfo.getPid());
if (CollectionUtils.isNotEmpty(allMatters)){
return allMatters;
}
return new ArrayList<>();
}
public List<TimeDTO> getTimeList(String start,String end,Integer interval){
List<TimeDTO> result = new ArrayList<>();
List<String> intervalTimeList = getIntervalTimeList(start, end, interval);

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java

@ -133,14 +133,6 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
IPage<IcNeighborHoodEntity> page = new Page<IcNeighborHoodEntity>(formDTO.getPageNo(),formDTO.getPageSize());
// QueryWrapper<IcNeighborHoodEntity> neighborHoodEntityQueryWrapper = new QueryWrapper<>();
// neighborHoodEntityQueryWrapper.lambda()
// .eq(!StringUtils.isEmpty(formDTO.getAgencyId()),IcNeighborHoodEntity::getAgencyId,formDTO.getAgencyId())
// .eq(!StringUtils.isEmpty(formDTO.getGridId()),IcNeighborHoodEntity::getId,formDTO.getGridId())
// .eq(!StringUtils.isEmpty(formDTO.getNeighborHoodId()),IcNeighborHoodEntity::getId,formDTO.getNeighborHoodId())
// .like(!StringUtils.isEmpty(formDTO.getNeighborHoodName()),IcNeighborHoodEntity::getNeighborHoodName,formDTO.getNeighborHoodName());
// neighborHoodEntityQueryWrapper.eq("a.DEL_FLAG","0");
IcNeighborHoodEntity neighbor = ConvertUtils.sourceToTarget(formDTO, IcNeighborHoodEntity.class);
IcHouseEntity house = ConvertUtils.sourceToTarget(formDTO, IcHouseEntity.class);
neighbor.setDelFlag("0");

1
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.10__add_matter_img.sql

@ -0,0 +1 @@
alter table ic_party_service_center_matter add COLUMN MATTER_IMG VARCHAR(256) NOT NULL comment '封面图' AFTER END_TIME;

14
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.9__alter_org.sql

@ -0,0 +1,14 @@
ALTER TABLE `customer_agency`
ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `PARENT_AREA_CODE`,
ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `PERSON`;
ALTER TABLE `customer_department`
ADD COLUMN `CODE` varchar(64) NULL COMMENT '编码' AFTER `UPDATED_TIME`,
ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `CODE`,
ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `PERSON`;
ALTER TABLE `customer_grid`
ADD COLUMN `GRID_TYPE` varchar(64) NULL COMMENT '网格类型【字典表sys_dict_data,key:grid_type】' AFTER `PIDS`,
ADD COLUMN `CONTACTS` varchar(64) NULL COMMENT '负责人' AFTER `GRID_TYPE`,
ADD COLUMN `MOBILE` varchar(32) NULL COMMENT '联系电话' AFTER `PERSON`;

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

@ -123,7 +123,10 @@
SELECT
id AS 'agencyId',
organization_name AS 'agencyName',
total_user AS 'totalUser'
total_user AS 'totalUser',
code 'code',
contacts 'contacts',
mobile 'mobile'
FROM customer_agency
WHERE del_flag = '0'
AND pid = #{pId}
@ -734,4 +737,18 @@
AND PID = #{orgId}
</select>
<select id="getAgencyMobile" resultType="com.epmet.dto.result.OrgMobileResultDTO">
SELECT
ca.id agencyId,
ca.organization_name agencyName,
ca.mobile mobile
FROM
customer_grid cg
INNER JOIN customer_agency ca ON cg.pid = ca.id
WHERE
cg.del_flag = '0'
AND ca.del_flag = '0'
AND cg.id = #{gridId}
</select>
</mapper>

5
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml

@ -23,7 +23,10 @@
SELECT
id AS 'departmentId',
department_name AS 'departmentName',
total_user AS 'totalUser'
total_user AS 'totalUser',
code AS 'code',
contacts AS 'contacts',
mobile AS 'mobile'
FROM customer_department
WHERE del_flag = '0'
AND agency_id = #{agencyId}

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

@ -189,7 +189,11 @@
manage_district AS manageDistrict,
total_user AS totalUser,
pid AS agencyId,
pids AS pids
pids AS pids,
`code` AS 'code',
grid_type AS 'gridType',
contacts AS 'contacts',
mobile AS 'mobile'
FROM
customer_grid
WHERE
@ -277,9 +281,13 @@
<!-- 得到当前机构的网格列表 -->
<select id="selectGridListByAgencyId" resultType="com.epmet.dto.result.GridBaseInfoResultDTO">
SELECT
ID AS gridId,
IFNULL(GRID_NAME,"") AS gridName,
TOTAL_USER
id AS gridId,
IFNULL(grid_name,"") AS gridName,
total_user,
code,
grid_type,
contacts,
mobile
FROM
CUSTOMER_GRID
<where>

4
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcBuildingDao.xml

@ -94,7 +94,7 @@
AND a.DEL_FLAG = #{building.delFlag}
</if>
</where>
order by a.CREATED_TIME asc
order by a.BUILDING_NAME
</select>
<select id="searchAllBuilding" resultType="com.epmet.excel.IcBuildingExcel">
select
@ -333,4 +333,4 @@
</select>
</mapper>
</mapper>

14
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -144,6 +144,7 @@
</if>
</where>
ORDER BY d.UNIT_NUM,a.DOOR_NAME
</select>
<select id="searchAllHouse" resultType="com.epmet.excel.IcHouseExcel">
select
@ -233,15 +234,18 @@
<select id="queryHouseInfo" parameterType="map" resultType="com.epmet.dto.result.HouseInfoDTO">
SELECT
ih.ID as homeId,
IFNULL(n.ADDRESS,'') as neighborAddress,
ih.NEIGHBOR_HOOD_ID as neighborHoodId,
n.NEIGHBOR_HOOD_NAME as neighborHoodName,
IFNULL(n.NEIGHBOR_HOOD_NAME,'') as neighborHoodName,
ih.BUILDING_ID as buildingId,
ib.BUILDING_NAME as buildingName,
IFNULL(ib.BUILDING_NAME,'') as buildingName,
ih.BUILDING_UNIT_ID as buildingUnitId,
u.UNIT_NAME as unitName,
ih.DOOR_NAME as doorName,
IFNULL(u.UNIT_NAME,'') as unitName,
IFNULL(ih.DOOR_NAME,'') as doorName,
ih.house_type,
ih.HOUSE_NAME
IFNULL(ih.HOUSE_NAME,'') as HOUSE_NAME,
IFNULL(ib.LONGITUDE,'') as buildingLongitude,
IFNULL(ib.LATITUDE,'') as buildingLatitude
FROM
ic_house ih
left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id )

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

@ -106,6 +106,7 @@
AND a.DEL_FLAG = #{neighbor.delFlag}
</if>
</where>
ORDER BY a.CREATED_TIME
</select>
<select id="searchAllNeighborhood" resultType="com.epmet.excel.IcNeighborHoodExcel">
select
@ -213,4 +214,4 @@
and a.id !=#{neighborId}
</if>
</select>
</mapper>
</mapper>

52
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPartyServiceCenterDao.xml

@ -14,16 +14,25 @@
<result property="pmEndTime" column="pmEndTime"/>
<result property="longitude" column="longitude"/>
<result property="latitude" column="latitude"/>
<collection property="matterList" ofType="com.epmet.dto.MatterListDTO">
<result property="matterId" column="matterId"/>
<result property="allowTime" column="allowTime"/>
<result property="matterName" column="matterName"/>
<result property="startTime" column="startTime"/>
<result property="endTime" column="endTime"/>
<result property="appointmentType" column="appointmentType"/>
<result property="sort" column="sort"/>
</collection>
<collection property="matterList" ofType="com.epmet.dto.MatterListDTO"
column="partyServiceCenterId" select="matterListByPartyServiceCenterId"/>
</resultMap>
<select id="matterListByPartyServiceCenterId" resultType="com.epmet.dto.MatterListDTO">
select
cm.MATTER_NAME AS matterName,
cm.ID AS matterId,
cm.START_TIME AS startTime,
cm.END_TIME AS endTime,
cm.APPOINTMENT_TYPE AS appointmentType,
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
from ic_party_service_center_matter cm
where del_flag = 0
and PARTY_SERVICE_CENTER_ID = #{partyServiceCenterId}
</select>
<select id="partyServiceCenterList" resultMap="partyServiceCenterListMap">
SELECT
sc.ID AS partyServiceCenterId,
@ -35,20 +44,27 @@
sc.PM_START_TIME AS pmStartTime,
sc.PM_END_TIME AS pmEndTime,
sc.LONGITUDE AS longitude,
sc.LATITUDE AS latitude,
sc.LATITUDE AS latitude
FROM ic_party_service_center sc
WHERE sc.DEL_FLAG = 0
AND ORG_ID = #{orgId}
ORDER BY sc.CREATED_TIME DESC
</select>
<!-- 获取网格所属组织下所有的可预约事项 -->
<select id="getAllMatters" resultType="com.epmet.dto.result.AllMattersResultDTO">
SELECT
cm.MATTER_NAME AS matterName,
cm.ID AS matterId,
cm.START_TIME AS startTime,
cm.END_TIME AS endTime,
cm.APPOINTMENT_TYPE AS appointmentType,
case when cm.APPOINTMENT_TYPE = 'everyDay' THEN CONCAT('每天',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'workDay' THEN CONCAT('工作日',' ', cm.START_TIME,'-',cm.END_TIME)
when cm.APPOINTMENT_TYPE = 'weekend' THEN CONCAT('周末',' ', cm.START_TIME,'-',cm.END_TIME)
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime
FROM ic_party_service_center sc
LEFT JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = sc.ID AND cm.DEL_FLAG = 0)
WHERE sc.DEL_FLAG = 0
AND ORG_ID = #{orgId}
ORDER BY sc.CREATED_TIME DESC
ELSE CONCAT(cm.START_TIME,'-',cm.END_TIME) END AS allowTime,
IFNULL(cm.MATTER_IMG,'') AS matterImg
FROM ic_party_service_center c
INNER JOIN ic_party_service_center_matter cm ON (cm.PARTY_SERVICE_CENTER_ID = c.ID AND cm.DEL_FLAG = 0)
AND c.DEL_FLAG = 0
AND c.ORG_ID = #{orgId}
</select>
</mapper>

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

Loading…
Cancel
Save