Browse Source

Merge remote-tracking branch 'origin_elink/yantai_zhengwu_master'

feature/evaluate
yinzuomei 3 years ago
parent
commit
d02c8b8ae5
  1. 1
      epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java
  2. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java
  3. 26
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  4. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
  5. 110
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java
  6. 90
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java
  7. 133
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java
  8. 28
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java
  9. 87
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java
  10. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java
  11. 101
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java
  12. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java
  13. 21
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java
  14. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java
  15. 76
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java
  16. 44
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java
  17. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java
  18. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java
  19. 171
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java
  20. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java
  21. 38
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.29__public_service_org.sql
  22. 81
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml
  23. 30
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgServiceMatterDao.xml
  24. 112
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java
  25. 50
      epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java
  26. 83
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java
  27. 16
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java
  28. 71
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java
  29. 66
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java
  30. 112
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java
  31. 20
      epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql
  32. 27
      epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml
  33. 100
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java
  34. 18
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java
  35. 6
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java
  36. 15
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java
  37. 61
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java
  38. 1
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java
  39. 20
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java
  40. 54
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java
  41. 37
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java
  42. 75
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java
  43. 36
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  44. 16
      epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql
  45. 36
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml
  46. 18
      epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml
  47. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/IcPropertyManagementDTO.java
  48. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java
  49. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java
  50. 9
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java
  51. 4
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java
  52. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridDetailResultDTO.java
  53. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/GridController.java
  54. 34
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java
  55. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java
  56. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerAgencyEntity.java
  57. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java
  58. 4
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/PropertyManagementService.java
  59. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java
  60. 3
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  61. 50
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java
  62. 8
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql
  63. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql
  64. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  65. 19
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPropertyManagementDao.xml
  66. 22
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/IcEventServiceImpl.java
  67. 4
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java
  68. 8
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java
  69. 6
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java
  70. 4
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java
  71. 6
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java
  72. 16
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideReaderDao.java
  73. 44
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideReaderEntity.java
  74. 34
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideReaderService.java
  75. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java
  76. 98
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  77. 35
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideReaderServiceImpl.java
  78. 23
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java
  79. 14
      epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.12__guide_reader.sql
  80. 6
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml
  81. 6
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml
  82. 21
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideReaderDao.xml
  83. 12
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java
  84. 95
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicAttachmentDTO.java
  85. 109
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentAttachmentDTO.java
  86. 74
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentDTO.java
  87. 125
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicDTO.java
  88. 70
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicVoteDetailDTO.java
  89. 100
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateYtTopicFormDTO.java
  90. 15
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java
  91. 31
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicCommentFormDTO.java
  92. 36
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicDetailFormDTO.java
  93. 61
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicPageFormDTO.java
  94. 28
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicVoteFormDTO.java
  95. 15
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java
  96. 65
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicCommentResultDTO.java
  97. 86
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicDetailResultDTO.java
  98. 75
      epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicInfoResultDTO.java
  99. 142
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/YtTopicController.java
  100. 16
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicAttachmentDao.java

1
epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java

@ -198,6 +198,7 @@ public class ThirdLoginController {
*
* @param formDTO
* @return
* 目前烟台用的这个
*/
@PostMapping("resilogin-internalding")
public Result<ResiDingAppLoginResDTO> resiLoginInternalDing(@RequestBody DingAppLoginMdFormDTO formDTO) {

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aop/NoRepeatSubmitAop.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.distributedlock.DistributedLock;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys;
import lombok.extern.slf4j.Slf4j;
@ -57,7 +58,8 @@ public class NoRepeatSubmitAop {
//因为getLock如果获取失败抛异常 所以不做锁状态的判断
}
} catch (Exception e) {
log.warn("noRepeatSubmit key:{},msg:{}", key, e.getMessage());
String error = ExceptionUtils.getErrorStackTrace(e);
log.warn("noRepeatSubmit key:{},msg:{}", key, error);
//"未获取到锁,重复提交了
throw new RenException(EpmetErrorCode.REPEAT_SUBMIT.getCode());
}

26
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -245,11 +245,11 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.evaluationIndex1.url>
<datasource.druid..url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex1.url>
<datasource.druid.evaluationIndex1.username>root</datasource.druid.evaluationIndex1.username>
<datasource.druid.evaluationIndex1.password>root</datasource.druid.evaluationIndex1.password>
</datasource.druid..url>
<datasource.druid..username>root</datasource.druid..username>
<datasource.druid..password>root</datasource.druid..password>
<datasource.druid.opercustomize.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
@ -390,12 +390,6 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.evaluationIndex1.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex1.url>
<datasource.druid.evaluationIndex1.username>root</datasource.druid.evaluationIndex1.username>
<datasource.druid.evaluationIndex1.password>root</datasource.druid.evaluationIndex1.password>
<datasource.druid.opercustomize.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercustomize.url>
@ -534,12 +528,6 @@
<datasource.druid.evaluationIndex.username>epmet</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>elink@833066</datasource.druid.evaluationIndex.password>
<datasource.druid.evaluationIndex1.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex1.url>
<datasource.druid.evaluationIndex1.username>epmet</datasource.druid.evaluationIndex1.username>
<datasource.druid.evaluationIndex1.password>elink@833066</datasource.druid.evaluationIndex1.password>
<datasource.druid.opercustomize.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercustomize.url>
@ -679,12 +667,6 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.evaluationIndex1.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_evaluation_index?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.evaluationIndex1.url>
<datasource.druid.evaluationIndex1.username>epmet_cloud_viewer</datasource.druid.evaluationIndex1.username>
<datasource.druid.evaluationIndex1.password>EpmEtclOUdvIEwEr@w</datasource.druid.evaluationIndex1.password>
<datasource.druid.opercustomize.url>
<![CDATA[jdbc:mysql://10.2.2.44:3306/epmet_oper_customize?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercustomize.url>

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

@ -174,11 +174,6 @@ dynamic:
url: @datasource.druid.partymember.url@
username: @datasource.druid.partymember.username@
password: @datasource.druid.partymember.password@
evaluationIndexRead:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.evaluationIndex1.url@
username: @datasource.druid.evaluationIndex1.username@
password: @datasource.druid.evaluationIndex1.password@
feign:
hystrix:
enabled: true

110
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgDTO.java

@ -0,0 +1,110 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 公共服务组织管理(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
public class IcPublicServiceOrgDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* AGENCY_ID的pids
*/
private String pids;
/**
* 名称
*/
private String name;
/**
* 1实有单位2社会服务组织3志愿团队
*/
private String type;
/**
* 联系人
*/
private String contact;
/**
* 联系电话
*/
private String contactMobile;
/**
* 地址
*/
private String address;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
/**
* 备注
*/
private String remark;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
private List<IcPublicServiceOrgServiceMatterDTO> serviceMatterList;
}

90
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPublicServiceOrgServiceMatterDTO.java

@ -0,0 +1,90 @@
package com.epmet.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 公共服务组织服务事项(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
public class IcPublicServiceOrgServiceMatterDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@JsonIgnore
private String id;
/**
* 客户id
*/
@JsonIgnore
private String customerId;
/**
* ic_public_service_org.ID
*/
@JsonIgnore
private String orgId;
/**
* ic_service_item_dict.ID
*/
private String categoryId;
/**
* 服务事项编码ic_service_item_dict.CATEGORY_CODE
*/
private String categoryCode;
/**
* 删除标识 0未删除1已删除
*/
@JsonIgnore
private String delFlag;
/**
* 乐观锁
*/
@JsonIgnore
private Integer revision;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
@JsonIgnore
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
/**
* 详情页面显示
*/
private String categoryName;
}

133
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgFormDTO.java

@ -0,0 +1,133 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2023/2/3 15:04
*/
@Data
public class IcPublicServiceOrgFormDTO {
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
public interface UpdateUserInternalGroup {
}
public interface UpdateUserShowGroup extends CustomerClientShowGroup {
}
/**
* 主键
*/
@NotBlank(message = "id为空", groups = UpdateUserInternalGroup.class)
private String id;
/**
* 客户id
*/
@NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class})
private String customerId;
/**
* 组织ID
*/
@NotBlank(message = "agencyId不能为空",groups =UpdateUserInternalGroup.class )
private String agencyId;
/**
* AGENCY_ID的pids
*/
private String pids;
/**
* 名称
*/
@Length(max = 100, groups = AddUserShowGroup.class, message = "最多输入100字")
@NotBlank(message = "名称不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
private String name;
/**
* 1实有单位2社会服务组织3志愿团队
*/
@NotBlank(message = "类别不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
private String type;
/**
* 联系人
*/
@NotBlank(message = "联系人不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
private String contact;
/**
* 联系电话
*/
@NotBlank(message = "联系电话不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
private String contactMobile;
/**
* 地址
*/
@NotBlank(message = "地址不能为空", groups = {UpdateUserShowGroup.class, AddUserShowGroup.class})
private String address;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
/**
* 备注
*/
@Length(max = 500,message = "最多输入500字",groups ={UpdateUserShowGroup.class,AddUserShowGroup.class} )
private String remark;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
private List<IcPublicServiceOrgServiceMatterDTO> serviceMatterList;
}

28
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/IcPublicServiceOrgPageFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2023/2/3 16:02
*/
@Data
public class IcPublicServiceOrgPageFormDTO extends PageFormDTO {
private String customerId;
private String agencyId;
private String name;
private List<String> categoryIds;
private String type;
private String contact;
private String contactMobile;
/**
* 工作端当前登录人员
*/
private String currentStaffId;
}

87
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/IcPublicServiceOrgDetailResDTO.java

@ -0,0 +1,87 @@
package com.epmet.dto.result;
import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO;
import lombok.Data;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2023/2/3 15:52
*/
@Data
public class IcPublicServiceOrgDetailResDTO {
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
private String agencyName;
/**
* AGENCY_ID的pids
*/
private String pids;
/**
* 名称
*/
private String name;
/**
* 1实有单位2社会服务组织3志愿团队
*/
private String type;
private String typeName;
/**
* 联系人
*/
private String contact;
/**
* 联系电话
*/
private String contactMobile;
/**
* 地址
*/
private String address;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
/**
* 备注
*/
private String remark;
/**
* 服务事项名称
* 多个按照英文逗号隔开
*/
private String serviceMatterName;
private List<IcPublicServiceOrgServiceMatterDTO> serviceMatterList;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/ServiceItemResultDTO.java

@ -13,6 +13,10 @@ import java.io.Serializable;
public class ServiceItemResultDTO implements Serializable {
private static final long serialVersionUID = -590440160577071133L;
private String categoryId;
/**
* 分类编码
*/
private String categoryCode;
private String categoryName;
private Integer awardPoint;
private Boolean usableFlag;

101
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPublicServiceOrgController.java

@ -0,0 +1,101 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.page.PageData;
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.dto.form.IcPublicServiceOrgFormDTO;
import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO;
import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO;
import com.epmet.service.IcPublicServiceOrgService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 公共服务组织管理(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@RestController
@RequestMapping("icPublicServiceOrg")
public class IcPublicServiceOrgController {
@Autowired
private IcPublicServiceOrgService icPublicServiceOrgService;
/**
*
* @param tokenDto
* @param formDTO
* @return
*/
@RequestMapping("page")
public Result<PageData<IcPublicServiceOrgDetailResDTO>> page(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgPageFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
//工作端调用的话,赋值当前登录用户id
if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){
formDTO.setCurrentStaffId(tokenDto.getUserId());
}
PageData<IcPublicServiceOrgDetailResDTO> page = icPublicServiceOrgService.page(formDTO);
return new Result<PageData<IcPublicServiceOrgDetailResDTO>>().ok(page);
}
@PostMapping("detail/{id}")
public Result<IcPublicServiceOrgDetailResDTO> get(@PathVariable("id") String id){
IcPublicServiceOrgDetailResDTO data = icPublicServiceOrgService.get(id);
return new Result<IcPublicServiceOrgDetailResDTO>().ok(data);
}
/**
* 新增名称组织下唯一
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("save")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPublicServiceOrgFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setCreatedBy(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.AddUserShowGroup.class, IcPublicServiceOrgFormDTO.AddUserInternalGroup.class);
icPublicServiceOrgService.save(formDTO);
return new Result();
}
/**
*
* @param tokenDto
* @param formDTO
* @return
*/
@NoRepeatSubmit
@PostMapping("update")
public Result update(@LoginUser TokenDto tokenDto,@RequestBody IcPublicServiceOrgFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setCreatedBy(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, IcPublicServiceOrgFormDTO.UpdateUserShowGroup.class, IcPublicServiceOrgFormDTO.UpdateUserInternalGroup.class);
icPublicServiceOrgService.update(formDTO);
return new Result();
}
/**
* 同时删除服务事项表
* @param ids
* @return
*/
@PostMapping("delete")
public Result delete(@RequestBody List<String> ids){
if(CollectionUtils.isNotEmpty(ids)){
icPublicServiceOrgService.delete(ids);
}
return new Result();
}
}

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcServiceItemDictController.java

@ -87,6 +87,18 @@ public class IcServiceItemDictController {
return new Result<List<OptionDTO>>().ok(icServiceItemDictService.queryDictListForSelect(formDTO));
}
/**
* 烟台的公共服务组织服务事项列表
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("dict-options")
public Result<List<ServiceItemResultDTO>> queryDictOption(@LoginUser TokenDto tokenDto, @RequestBody ServiceItemSelectFormDTO formDTO) {
return new Result<List<ServiceItemResultDTO>>().ok(icServiceItemDictService.queryDictOption(formDTO.getType(), tokenDto.getCustomerId()));
}
/**
* 客户初始化数据
* @Param customerId

21
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgDao.java

@ -0,0 +1,21 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO;
import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO;
import com.epmet.entity.IcPublicServiceOrgEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 公共服务组织管理(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Mapper
public interface IcPublicServiceOrgDao extends BaseDao<IcPublicServiceOrgEntity> {
List<IcPublicServiceOrgDetailResDTO> pageList(IcPublicServiceOrgPageFormDTO formDTO);
}

20
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPublicServiceOrgServiceMatterDao.java

@ -0,0 +1,20 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcPublicServiceOrgServiceMatterDTO;
import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 公共服务组织服务事项(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Mapper
public interface IcPublicServiceOrgServiceMatterDao extends BaseDao<IcPublicServiceOrgServiceMatterEntity> {
List<IcPublicServiceOrgServiceMatterDTO> selectServiceMatter(String orgId);
}

76
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgEntity.java

@ -0,0 +1,76 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 公共服务组织管理(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_public_service_org")
public class IcPublicServiceOrgEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* AGENCY_ID的pids
*/
private String pids;
/**
* 名称
*/
private String name;
/**
* 1实有单位2社会服务组织3志愿团队
*/
private String type;
/**
* 联系人
*/
private String contact;
/**
* 联系电话
*/
private String contactMobile;
/**
* 地址
*/
private String address;
/**
* 中心位置经度
*/
private String longitude;
/**
* 中心位置纬度
*/
private String latitude;
/**
* 备注
*/
private String remark;
}

44
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcPublicServiceOrgServiceMatterEntity.java

@ -0,0 +1,44 @@
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;
/**
* 公共服务组织服务事项(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_public_service_org_service_matter")
public class IcPublicServiceOrgServiceMatterEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* ic_public_service_org.ID
*/
private String orgId;
/**
* ic_service_item_dict.ID
*/
private String categoryId;
/**
* 服务事项编码ic_service_item_dict.CATEGORY_CODE
*/
private String categoryCode;
}

34
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPublicServiceOrgService.java

@ -0,0 +1,34 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.IcPublicServiceOrgFormDTO;
import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO;
import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO;
import com.epmet.entity.IcPublicServiceOrgEntity;
import java.util.List;
/**
* 公共服务组织管理(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
public interface IcPublicServiceOrgService extends BaseService<IcPublicServiceOrgEntity> {
/**
* 公共服务组织
* @param dto
* @return
*/
String save(IcPublicServiceOrgFormDTO dto);
String update(IcPublicServiceOrgFormDTO formDTO);
void delete(List<String> orgIds);
IcPublicServiceOrgDetailResDTO get(String id);
PageData<IcPublicServiceOrgDetailResDTO> page(IcPublicServiceOrgPageFormDTO formDTO);
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcServiceItemDictService.java

@ -81,4 +81,6 @@ public interface IcServiceItemDictService extends BaseService<IcServiceItemDictE
void customerInit(String customerId);
String getCategoryName(String customerId, String id);
List<ServiceItemResultDTO> queryDictOption(String type, String customerId);
}

171
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPublicServiceOrgServiceImpl.java

@ -0,0 +1,171 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
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.utils.ConvertUtils;
import com.epmet.dao.IcPublicServiceOrgDao;
import com.epmet.dao.IcPublicServiceOrgServiceMatterDao;
import com.epmet.dto.form.IcPublicServiceOrgFormDTO;
import com.epmet.dto.form.IcPublicServiceOrgPageFormDTO;
import com.epmet.dto.result.IcPublicServiceOrgDetailResDTO;
import com.epmet.entity.IcPublicServiceOrgEntity;
import com.epmet.entity.IcPublicServiceOrgServiceMatterEntity;
import com.epmet.service.IcPublicServiceOrgService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.stream.Collectors;
/**
* 公共服务组织管理(烟台需求)
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Service
public class IcPublicServiceOrgServiceImpl extends BaseServiceImpl<IcPublicServiceOrgDao, IcPublicServiceOrgEntity> implements IcPublicServiceOrgService {
@Autowired
private IcPublicServiceOrgServiceMatterDao icPublicServiceOrgServiceMatterDao;
@Transactional(rollbackFor = EpmetException.class)
@Override
public String save(IcPublicServiceOrgFormDTO formDto) {
CustomerStaffInfoCacheResult staffInfo= CustomerStaffRedis.getStaffInfo(formDto.getCustomerId(),formDto.getCreatedBy());
if(null==staffInfo|| StringUtils.isBlank(staffInfo.getAgencyId())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode());
}
checkUnqiueName(formDto.getName(),staffInfo.getAgencyId(),null);
formDto.setAgencyId(staffInfo.getAgencyId());
formDto.setPids(staffInfo.getAgencyPIds());
IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDto,IcPublicServiceOrgEntity.class);
baseDao.insert(entity);
if(CollectionUtils.isNotEmpty(formDto.getServiceMatterList())){
formDto.getServiceMatterList().forEach(dto->{
IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class);
serviceOrgServiceMatterEntity.setOrgId(entity.getId());
serviceOrgServiceMatterEntity.setCustomerId(formDto.getCustomerId());
icPublicServiceOrgServiceMatterDao.insert(serviceOrgServiceMatterEntity);
});
}
return entity.getId();
}
/**
*
* @param name
* @param agencyId
* @param id
*/
private void checkUnqiueName(String name, String agencyId, String id) {
LambdaQueryWrapper<IcPublicServiceOrgEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(IcPublicServiceOrgEntity::getName,name)
.eq(IcPublicServiceOrgEntity::getAgencyId,agencyId)
.ne(StringUtils.isNotBlank(id),IcPublicServiceOrgEntity::getId,id);
int count=baseDao.selectCount(queryWrapper);
if(count>0){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"名称已存在","名称已存在");
}
}
@Transactional(rollbackFor = EpmetException.class)
@Override
public String update(IcPublicServiceOrgFormDTO formDTO) {
checkUnqiueName(formDTO.getName(),formDTO.getAgencyId(),formDTO.getId());
IcPublicServiceOrgEntity entity=ConvertUtils.sourceToTarget(formDTO,IcPublicServiceOrgEntity.class);
baseDao.updateById(entity);
//先删除
LambdaQueryWrapper<IcPublicServiceOrgServiceMatterEntity> deleteWrapper=new LambdaQueryWrapper<>();
deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,formDTO.getId());
icPublicServiceOrgServiceMatterDao.delete(deleteWrapper);
if(CollectionUtils.isNotEmpty(formDTO.getServiceMatterList())){
formDTO.getServiceMatterList().forEach(dto->{
IcPublicServiceOrgServiceMatterEntity serviceOrgServiceMatterEntity=ConvertUtils.sourceToTarget(dto,IcPublicServiceOrgServiceMatterEntity.class);
serviceOrgServiceMatterEntity.setOrgId(entity.getId());
serviceOrgServiceMatterEntity.setCustomerId(formDTO.getCustomerId());
icPublicServiceOrgServiceMatterDao.insert(serviceOrgServiceMatterEntity);
});
}
return entity.getId();
}
@Transactional(rollbackFor = EpmetException.class)
@Override
public void delete(List<String> orgIds) {
orgIds.forEach(orgId->{
baseDao.deleteById(orgId);
//先删除
LambdaQueryWrapper<IcPublicServiceOrgServiceMatterEntity> deleteWrapper=new LambdaQueryWrapper<>();
deleteWrapper.eq(IcPublicServiceOrgServiceMatterEntity::getOrgId,orgId);
icPublicServiceOrgServiceMatterDao.delete(deleteWrapper);
});
}
@Override
public IcPublicServiceOrgDetailResDTO get(String id) {
IcPublicServiceOrgEntity entity = baseDao.selectById(id);
if (null == entity) {
return null;
}
IcPublicServiceOrgDetailResDTO result = ConvertUtils.sourceToTarget(entity, IcPublicServiceOrgDetailResDTO.class);
// 1:实有单位;2:社会服务组织3:志愿团队
if(NumConstant.ONE_STR.equals(result.getType())){
result.setTypeName("实有单位");
}else if(NumConstant.TWO_STR.equals(result.getType())){
result.setTypeName("社会服务组织");
}else if(NumConstant.THREE_STR.equals(result.getType())){
result.setTypeName("志愿团队");
}
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(result.getAgencyId());
if (null != agencyInfoCache) {
result.setAgencyName(agencyInfoCache.getOrganizationName());
}
result.setServiceMatterList(icPublicServiceOrgServiceMatterDao.selectServiceMatter(id));
List<String> nameList=result.getServiceMatterList().stream().map(m->m.getCategoryName()).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(nameList)){
result.setServiceMatterName(StringUtils.joinWith(StrConstant.SEMICOLON,nameList.toArray()));
}
return result;
}
@Override
public PageData<IcPublicServiceOrgDetailResDTO> page(IcPublicServiceOrgPageFormDTO formDTO) {
if (StringUtils.isNotBlank(formDTO.getCurrentStaffId()) && StringUtils.isBlank(formDTO.getAgencyId())) {
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentStaffId());
formDTO.setAgencyId(staffInfo.getAgencyId());
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<IcPublicServiceOrgDetailResDTO> list = baseDao.pageList(formDTO);
PageInfo<IcPublicServiceOrgDetailResDTO> pageInfo = new PageInfo<>(list);
list.forEach(item -> {
AgencyInfoCache agencyInfoCache = CustomerOrgRedis.getAgencyInfo(item.getAgencyId());
item.setAgencyName(null != agencyInfoCache ? agencyInfoCache.getOrganizationName() : StrConstant.EPMETY_STR);
List<String> nameList=item.getServiceMatterList().stream().map(m->m.getCategoryName()).collect(Collectors.toList());
if(CollectionUtils.isNotEmpty(nameList)){
item.setServiceMatterName(StringUtils.joinWith(StrConstant.SEMICOLON,nameList.toArray()));
}
});
return new PageData<>(list, pageInfo.getTotal());
}
}

22
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcServiceItemDictServiceImpl.java

@ -205,4 +205,26 @@ public class IcServiceItemDictServiceImpl extends BaseServiceImpl<IcServiceItemD
public String getCategoryName(String customerId, String categoryCode) {
return baseDao.selectName(customerId,categoryCode);
}
@Override
public List<ServiceItemResultDTO> queryDictOption(String type, String customerId) {
List<ServiceItemResultDTO> resultList = new ArrayList<>();
LambdaQueryWrapper<IcServiceItemDictEntity> query = new LambdaQueryWrapper<>();
query.eq(IcServiceItemDictEntity::getCustomerId, customerId)
.eq(StringUtils.isNotBlank(type) && "usable".equals(type), IcServiceItemDictEntity::getUsableFlag, true)
.orderByAsc(IcServiceItemDictEntity::getSort);
List<IcServiceItemDictEntity> list = baseDao.selectList(query);
for (IcServiceItemDictEntity entity : list) {
ServiceItemResultDTO dto = new ServiceItemResultDTO();
dto.setCategoryName(entity.getCategoryName());
dto.setCategoryId(entity.getId());
dto.setCategoryCode(entity.getCategoryCode());
dto.setUsableFlag(entity.getUsableFlag());
dto.setAwardPoint(entity.getAwardPoint());
resultList.add(dto);
}
return resultList;
}
}

38
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.29__public_service_org.sql

@ -0,0 +1,38 @@
CREATE TABLE `ic_public_service_org` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '组织ID',
`PIDS` varchar(255) NOT NULL COMMENT 'AGENCY_ID的pids',
`NAME` varchar(128) NOT NULL COMMENT '名称',
`TYPE` varchar(64) NOT NULL COMMENT '1:实有单位;2:社会服务组织3:志愿团队',
`CONTACT` varchar(32) NOT NULL COMMENT '联系人',
`CONTACT_MOBILE` varchar(32) NOT NULL COMMENT '联系电话',
`ADDRESS` varchar(255) NOT NULL COMMENT '地址',
`LONGITUDE` varchar(32) DEFAULT NULL COMMENT '中心位置经度',
`LATITUDE` varchar(32) DEFAULT NULL COMMENT '中心位置纬度',
`REMARK` varchar(512) DEFAULT NULL COMMENT '备注',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共服务组织管理(烟台需求)';
CREATE TABLE `ic_public_service_org_service_matter` (
`ID` varchar(64) NOT NULL COMMENT '主键',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`ORG_ID` varchar(64) NOT NULL COMMENT 'ic_public_service_org.ID',
`CATEGORY_ID` varchar(64) NOT NULL COMMENT 'ic_service_item_dict.ID',
`CATEGORY_CODE` varchar(255) NOT NULL COMMENT '服务事项编码ic_service_item_dict.CATEGORY_CODE',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除',
`REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='公共服务组织服务事项(烟台需求)';

81
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgDao.xml

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcPublicServiceOrgDao">
<resultMap type="com.epmet.entity.IcPublicServiceOrgEntity" id="icPublicServiceOrgMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="name" column="NAME"/>
<result property="type" column="TYPE"/>
<result property="contact" column="CONTACT"/>
<result property="contactMobile" column="CONTACT_MOBILE"/>
<result property="address" column="ADDRESS"/>
<result property="longitude" column="LONGITUDE"/>
<result property="latitude" column="LATITUDE"/>
<result property="remark" column="REMARK"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<resultMap id="IcPublicServiceOrgDetailResDTOMap" type="com.epmet.dto.result.IcPublicServiceOrgDetailResDTO">
<result property="id" column="ID"/>
<result property="name" column="NAME"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="type" column="TYPE"/>
<result property="typeName" column="typeName"/>
<result property="contact" column="CONTACT"/>
<result property="contactMobile" column="CONTACT_MOBILE"/>
<result property="remark" column="REMARK"/>
<collection property="serviceMatterList" ofType="com.epmet.dto.IcPublicServiceOrgServiceMatterDTO"
select="com.epmet.dao.IcPublicServiceOrgServiceMatterDao.selectServiceMatter" column="ID">
</collection>
</resultMap>
<select id="pageList" parameterType="com.epmet.dto.form.IcPublicServiceOrgPageFormDTO" resultMap="IcPublicServiceOrgDetailResDTOMap">
SELECT
distinct o.ID,
o.`NAME`,
o.AGENCY_ID,
o.TYPE,
( CASE WHEN o.type = '1' THEN '实有单位' WHEN o.type = '2' THEN '社会服务组织' WHEN o.type = '3' THEN '志愿团队' end) AS typeName,
o.CONTACT,
o.CONTACT_MOBILE,
o.REMARK
FROM
ic_public_service_org o
LEFT JOIN ic_public_service_org_service_matter m ON ( o.id = m.ORG_ID and m.del_flag='0')
LEFT JOIN ic_service_item_dict d ON ( m.CATEGORY_ID = d.ID and m.CUSTOMER_ID=d.CUSTOMER_ID)
WHERE
o.DEL_FLAG = '0'
and o.CUSTOMER_ID=#{customerId}
<if test='null != agencyId and "" != agencyId'>
AND ( o.AGENCY_ID = #{agencyId} OR o.PIDS LIKE concat( '%', #{agencyId}, '%' ))
</if>
<if test='null != name and "" != name'>
AND o.`NAME` LIKE concat( '%', #{name}, '%' )
</if>
<if test="null != categoryIds and categoryIds.size() > 0">
<foreach collection="categoryIds" item="categoryId" open="AND (" separator="or" close=")">
m.CATEGORY_ID = #{categoryId}
</foreach>
</if>
<if test='null != type and "" != type'>
AND o.TYPE = #{type}
</if>
<if test='null != contact and "" != contact'>
AND o.CONTACT LIKE concat( '%', #{contact}, '%' )
</if>
<if test='null != contactMobile and "" != contactMobile'>
AND o.CONTACT_MOBILE like concat( '%', #{contactMobile}, '%' )
</if>
ORDER BY
o.CREATED_TIME DESC
</select>
</mapper>

30
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPublicServiceOrgServiceMatterDao.xml

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IcPublicServiceOrgServiceMatterDao">
<resultMap type="com.epmet.entity.IcPublicServiceOrgServiceMatterEntity" id="icPublicServiceOrgServiceMatterMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="orgId" column="ORG_ID"/>
<result property="categoryId" column="CATEGORY_ID"/>
<result property="categoryCode" column="CATEGORY_CODE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectServiceMatter" parameterType="java.lang.String" resultType="com.epmet.dto.IcPublicServiceOrgServiceMatterDTO">
SELECT
m.*,
i.CATEGORY_NAME
FROM
ic_public_service_org_service_matter m
LEFT JOIN ic_service_item_dict i ON ( m.CATEGORY_ID = i.ID )
WHERE m.del_flag='0'
and m.ORG_ID = #{orgId}
</select>
</mapper>

112
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/ThirdAppManageDTO.java

@ -0,0 +1,112 @@
package com.epmet.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
public class ThirdAppManageDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 应用名称
*/
@NotBlank(message = "应用名称不能为空")
private String name;
/**
* 应用链接
*/
@NotBlank(message = "应用链接不能为空")
private String link;
/**
* 账号
*/
@NotBlank(message = "测试账号不能为空")
private String account;
/**
* 密码
*/
@NotBlank(message = "测试密码不能为空")
private String password;
/**
* 应用介绍
*/
private String remark;
/**
* 第三方公司名
*/
private String companyName;
/**
* 联系人
*/
@NotBlank(message = "联系人不能为空")
private String contacts;
/**
* 联系电话
*/
@NotBlank(message = "联系电话不能为空")
private String mobile;
/**
* 状态0:未审核;1:审核不通过;2:审核通过;3:已发布
*/
private String status;
/**
* 乐观锁
*/
private Integer revision;
/**
* 删除标识 0未删除 1删除
*/
private Integer delFlag;
/**
* 创建者
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新者
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

50
epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/form/ThirdAppManageFormDTO.java

@ -0,0 +1,50 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
public class ThirdAppManageFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private String id;
/**
* 应用名称
*/
private String name;
/**
* 第三方公司名
*/
private String companyName;
/**
* 联系人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
/**
* 状态0:未审核;1:审核不通过;2:审核通过;3:已发布
*/
private String status;
}

83
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/ThirdAppManageController.java

@ -0,0 +1,83 @@
package com.epmet.controller;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.ThirdAppManageDTO;
import com.epmet.dto.form.ThirdAppManageFormDTO;
import com.epmet.service.ThirdAppManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@RestController
@RequestMapping("thirdAppManage")
public class ThirdAppManageController {
@Autowired
private ThirdAppManageService thirdAppManageService;
@PostMapping("page")
public Result<PageData<ThirdAppManageDTO>> page(@RequestBody ThirdAppManageFormDTO formDTO){
PageData<ThirdAppManageDTO> page = thirdAppManageService.page(formDTO);
return new Result<PageData<ThirdAppManageDTO>>().ok(page);
}
@PostMapping("detail/{id}")
public Result<ThirdAppManageDTO> get(@PathVariable("id") String id){
ThirdAppManageDTO data = thirdAppManageService.get(id);
return new Result<ThirdAppManageDTO>().ok(data);
}
@NoRepeatSubmit
@PostMapping("save")
public Result save(@RequestBody ThirdAppManageDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
thirdAppManageService.save(dto);
return new Result();
}
/**
* 审核
*
* @Param dto
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2023/2/3 14:18
*/
@NoRepeatSubmit
@PostMapping("audit")
public Result audit(@RequestBody ThirdAppManageDTO dto){
//效验数据
thirdAppManageService.audit(dto);
return new Result();
}
/**
* 发布
*
* @Param dto
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2023/2/3 14:18
*/
@NoRepeatSubmit
@PostMapping("release")
public Result release(@RequestBody ThirdAppManageDTO dto){
//效验数据
thirdAppManageService.release(dto);
return new Result();
}
}

16
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/ThirdAppManageDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ThirdAppManageEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Mapper
public interface ThirdAppManageDao extends BaseDao<ThirdAppManageEntity> {
}

71
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/ThirdAppManageEntity.java

@ -0,0 +1,71 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("third_app_manage")
public class ThirdAppManageEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 应用名称
*/
private String name;
/**
* 应用链接
*/
private String link;
/**
* 账号
*/
private String account;
/**
* 密码
*/
private String password;
/**
* 应用介绍
*/
private String remark;
/**
* 第三方公司名
*/
private String companyName;
/**
* 联系人
*/
private String contacts;
/**
* 联系电话
*/
private String mobile;
/**
* 状态0:未审核;1:审核不通过;2:审核通过;3:已发布
*/
private String status;
}

66
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/ThirdAppManageService.java

@ -0,0 +1,66 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ThirdAppManageDTO;
import com.epmet.dto.form.ThirdAppManageFormDTO;
import com.epmet.entity.ThirdAppManageEntity;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
public interface ThirdAppManageService extends BaseService<ThirdAppManageEntity> {
/**
* 默认分页
*
* @param formDTO
* @return PageData<ThirdAppManageDTO>
* @author generator
* @date 2023-02-03
*/
PageData<ThirdAppManageDTO> page(ThirdAppManageFormDTO formDTO);
/**
* 单条查询
*
* @param id
* @return ThirdAppManageDTO
* @author generator
* @date 2023-02-03
*/
ThirdAppManageDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2023-02-03
*/
void save(ThirdAppManageDTO dto);
/**
* 审核
*
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2023/2/3 14:19
*/
void audit(ThirdAppManageDTO dto);
/**
* 发布
*
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2023/2/3 14:19
*/
void release(ThirdAppManageDTO dto);
}

112
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/ThirdAppManageServiceImpl.java

@ -0,0 +1,112 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.ThirdAppManageDao;
import com.epmet.dto.ThirdAppManageDTO;
import com.epmet.dto.form.ThirdAppManageFormDTO;
import com.epmet.entity.ThirdAppManageEntity;
import com.epmet.service.ThirdAppManageService;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* 烟台第三方应用管理
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-03
*/
@Service
public class ThirdAppManageServiceImpl extends BaseServiceImpl<ThirdAppManageDao, ThirdAppManageEntity> implements ThirdAppManageService {
@Override
public PageData<ThirdAppManageDTO> page(ThirdAppManageFormDTO formDTO) {
PageMethod.startPage(formDTO.getPageNo(), formDTO.getPageSize());
LambdaQueryWrapper<ThirdAppManageEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.like(StringUtils.isNotBlank(formDTO.getName()), ThirdAppManageEntity::getName, formDTO.getName());
wrapper.like(StringUtils.isNotBlank(formDTO.getCompanyName()), ThirdAppManageEntity::getCompanyName, formDTO.getCompanyName());
wrapper.like(StringUtils.isNotBlank(formDTO.getContacts()), ThirdAppManageEntity::getContacts, formDTO.getContacts());
wrapper.like(StringUtils.isNotBlank(formDTO.getMobile()), ThirdAppManageEntity::getMobile, formDTO.getMobile());
wrapper.eq(StringUtils.isNotBlank(formDTO.getStatus()), ThirdAppManageEntity::getStatus, formDTO.getStatus());
wrapper.orderByDesc(ThirdAppManageEntity::getCreatedTime);
List<ThirdAppManageEntity> list = baseDao.selectList(wrapper);
PageInfo<ThirdAppManageEntity> pageInfo = new PageInfo<>(list);
return new PageData<>(ConvertUtils.sourceToTarget(list, ThirdAppManageDTO.class), pageInfo.getTotal());
}
@Override
public ThirdAppManageDTO get(String id) {
ThirdAppManageEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ThirdAppManageDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ThirdAppManageDTO dto) {
ThirdAppManageEntity entity = ConvertUtils.sourceToTarget(dto, ThirdAppManageEntity.class);
insert(entity);
}
/**
* 审核
*
* @param dto
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2023/2/3 14:19
*/
@Override
public void audit(ThirdAppManageDTO dto) {
ThirdAppManageEntity info = baseDao.selectById(dto.getId());
if (!NumConstant.ZERO_STR.equals(info.getStatus())) {
String errorMsg = "应用已审核";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
ThirdAppManageEntity entity = new ThirdAppManageEntity();
entity.setId(dto.getId());
entity.setStatus(dto.getStatus());
baseDao.updateById(entity);
}
/**
* 发布
*
* @param dto
* @Param dto
* @Return
* @Author zhaoqifeng
* @Date 2023/2/3 14:19
*/
@Override
public void release(ThirdAppManageDTO dto) {
ThirdAppManageEntity info = baseDao.selectById(dto.getId());
if (NumConstant.ZERO_STR.equals(info.getStatus())) {
String errorMsg = "应用未审核,请先审核";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
} else if (NumConstant.ONE_STR.equals(info.getStatus())) {
String errorMsg = "应用审核不通过,不能发布";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
} else if (NumConstant.THREE_STR.equals(info.getStatus())) {
String errorMsg = "应用已发布";
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
ThirdAppManageEntity entity = new ThirdAppManageEntity();
entity.setId(dto.getId());
entity.setStatus(NumConstant.THREE_STR);
baseDao.updateById(entity);
}
}

20
epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.10__third_app.sql

@ -0,0 +1,20 @@
CREATE TABLE `third_app_manage` (
`ID` varchar(64) NOT NULL COMMENT 'id',
`CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户ID',
`NAME` varchar(64) NOT NULL COMMENT '应用名称',
`LINK` varchar(128) NOT NULL COMMENT '应用链接',
`ACCOUNT` varchar(64) NOT NULL COMMENT '账号',
`PASSWORD` varchar(64) NOT NULL COMMENT '密码',
`REMARK` text COMMENT '应用介绍',
`COMPANY_NAME` varchar(64) DEFAULT '0' COMMENT '第三方公司名',
`CONTACTS` varchar(64) NOT NULL COMMENT '联系人',
`MOBILE` varchar(32) NOT NULL COMMENT '联系电话',
`STATUS` varchar(1) DEFAULT '0' COMMENT '状态【0:未审核;1:审核不通过;2:审核通过;3:已发布】',
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁',
`DEL_FLAG` tinyint(1) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除',
`CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者',
`CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者',
`UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='烟台第三方应用管理';

27
epmet-module/gov-access/gov-access-server/src/main/resources/mapper/ThirdAppManageDao.xml

@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ThirdAppManageDao">
<resultMap type="com.epmet.entity.ThirdAppManageEntity" id="thirdAppManageMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="name" column="NAME"/>
<result property="link" column="LINK"/>
<result property="account" column="ACCOUNT"/>
<result property="password" column="PASSWORD"/>
<result property="remark" column="REMARK"/>
<result property="companyName" column="COMPANY_NAME"/>
<result property="contacts" column="CONTACTS"/>
<result property="mobile" column="MOBILE"/>
<result property="status" column="STATUS"/>
<result property="revision" column="REVISION"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

100
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueCommentDTO.java

@ -0,0 +1,100 @@
package com.epmet.dto;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Data
public class IssueCommentDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 议题ID
*/
@NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class)
private String issueId;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 评论内容至多200字
*/
@Length(max = 200,message = "评论内容最多输入200字",groups = AddUserShowGroup.class)
@NotBlank(message = "content不能为空",groups = AddUserInternalGroup.class)
private String content;
/**
* 评论用户id
*/
private String userId;
/**
* 姓名
*/
private String userName;
/**
* 头像
*/
private String headPhoto;
/**
* 删除标识 0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
private String commentId;
}

18
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueCommentPageFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description
* @Author yzm
* @Date 2023/2/2 13:45
*/
@Data
public class IssueCommentPageFormDTO extends PageFormDTO {
@NotBlank(message = "issueId不能为空",groups = AddUserInternalGroup.class)
private String issueId;
}

6
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueDetailFormDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@ -13,8 +14,9 @@ import java.io.Serializable;
@Data
public class IssueDetailFormDTO implements Serializable {
private static final long serialVersionUID = 4859779755214503489L;
@NotBlank(message = "议题id不能为空")
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "议题id不能为空",groups =AddUserShowGroup.class )
private String issueId;
}

15
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/IssueShiftedFromTopicFormDTO.java

@ -122,4 +122,19 @@ public class IssueShiftedFromTopicFormDTO implements Serializable {
private String groupId;
private String issueId;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 地址
*/
private String address;
}

61
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueCommentController.java

@ -0,0 +1,61 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.page.PageData;
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.dto.IssueCommentDTO;
import com.epmet.dto.form.IssueCommentPageFormDTO;
import com.epmet.service.IssueCommentService;
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;
/**
* 议题评论表
* 目前只有烟台客户钉钉居民端议事厅可以发表评论
* 产品没有此功能
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@RestController
@RequestMapping("issuecomment")
public class IssueCommentController {
@Autowired
private IssueCommentService issueCommentService;
/**
* 议题评论列表
* @param formDTO
* @return
*/
@RequestMapping("page")
public Result<PageData<IssueCommentDTO>> page(@RequestBody IssueCommentPageFormDTO formDTO){
PageData<IssueCommentDTO> page = issueCommentService.page(formDTO);
return new Result<PageData<IssueCommentDTO>>().ok(page);
}
/**
* 议题评论
* @param tokenDto
* @param dto
* @return
*/
@NoRepeatSubmit
@PostMapping("save")
public Result save(@LoginUser TokenDto tokenDto, @RequestBody IssueCommentDTO dto){
dto.setCustomerId(tokenDto.getCustomerId());
dto.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(dto,IssueCommentDTO.AddUserShowGroup.class,IssueCommentDTO.AddUserInternalGroup.class);
issueCommentService.save(dto);
return new Result();
}
}

1
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java

@ -43,6 +43,7 @@ public class IssueController {
*/
@PostMapping(value = "detail")
public Result<IssueResultDTO> detail(@RequestBody IssueDetailFormDTO issueDetail){
ValidatorUtils.validateEntity(issueDetail,IssueDetailFormDTO.AddUserShowGroup.class);
return new Result<IssueResultDTO>().ok(issueService.detail(issueDetail));
}

20
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueCommentDao.java

@ -0,0 +1,20 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IssueCommentDTO;
import com.epmet.entity.IssueCommentEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Mapper
public interface IssueCommentDao extends BaseDao<IssueCommentEntity> {
List<IssueCommentDTO> selectCommentList(String issueId);
}

54
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueCommentEntity.java

@ -0,0 +1,54 @@
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;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("issue_comment")
public class IssueCommentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 议题ID
*/
private String issueId;
/**
* 客户ID
*/
private String customerId;
/**
* 评论内容至多200字
*/
private String content;
/**
* 评论用户id
*/
private String userId;
/**
* 姓名
*/
private String userName;
/**
* 头像
*/
private String headPhoto;
}

37
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueCommentService.java

@ -0,0 +1,37 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IssueCommentDTO;
import com.epmet.dto.form.IssueCommentPageFormDTO;
import com.epmet.entity.IssueCommentEntity;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
public interface IssueCommentService extends BaseService<IssueCommentEntity> {
/**
* 默认分页
*
* @param formDTO
* @return PageData<IssueCommentDTO>
* @author generator
* @date 2023-02-02
*/
PageData<IssueCommentDTO> page(IssueCommentPageFormDTO formDTO);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2023-02-02
*/
void save(IssueCommentDTO dto);
}

75
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueCommentServiceImpl.java

@ -0,0 +1,75 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IssueCommentDao;
import com.epmet.dto.IssueCommentDTO;
import com.epmet.dto.form.IssueCommentPageFormDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.IssueCommentEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.IssueCommentService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
/**
* 议题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Slf4j
@Service
public class IssueCommentServiceImpl extends BaseServiceImpl<IssueCommentDao, IssueCommentEntity> implements IssueCommentService {
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/**
* 议题评论列表
* @param formDTO
* @return
*/
@Override
public PageData<IssueCommentDTO> page(IssueCommentPageFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
List<IssueCommentDTO> list = baseDao.selectCommentList(formDTO.getIssueId());
PageInfo<IssueCommentDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* 议题评论
* 需求来源于烟台https://modao.cc/app/Uz9nPVerhvcupzLnhoiY#screen=sl8mfpxd863xmb5
* @param dto
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void save(IssueCommentDTO dto) {
//查询用户信息
List<String> userIdList=new ArrayList<>();
userIdList.add(dto.getUserId());
Result<List<UserBaseInfoResultDTO>> userInfoRes= userOpenFeignClient.queryUserBaseInfo(userIdList);
if(!userInfoRes.success()|| CollectionUtils.isEmpty(userInfoRes.getData())){
log.error("议题评论查询用户信息异常userId: "+dto.getUserId());
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"查询用户信息异常userId:"+dto.getUserId(),"查询用户信息异常");
}
IssueCommentEntity entity = ConvertUtils.sourceToTarget(dto, IssueCommentEntity.class);
entity.setHeadPhoto(userInfoRes.getData().get(NumConstant.ZERO).getHeadImgUrl());
entity.setUserName(userInfoRes.getData().get(NumConstant.ZERO).getRealName());
insert(entity);
}
}

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

@ -510,23 +510,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
@Override
@Transactional(rollbackFor = Exception.class)
public String audit(TokenDto token, IssueAuditionFormDTO param){
if (StringUtils.isNotBlank(param.getReason())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(param.getReason());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
scanReason(param.getReason());
Date unifiedDate = new Date();
IssueApplicationDTO application = applicationService.get(param.getIssueApplicationId());
@ -613,6 +597,24 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
return app2update.getIssueId();
}
private void scanReason(String reason) {
if (StringUtils.isNotBlank(reason)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(reason);
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()){
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
}
/**
* @Description 表决中列表
* @param issueListForm

16
epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/V0.0.21__issue_comment.sql

@ -0,0 +1,16 @@
CREATE TABLE `issue_comment` (
`ID` varchar(32) NOT NULL COMMENT '主键ID',
`ISSUE_ID` varchar(32) NOT NULL COMMENT '议题ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`CONTENT` varchar(255) NOT NULL COMMENT '评论内容至多200字',
`USER_ID` varchar(64) NOT NULL COMMENT '评论用户id',
`USER_NAME` varchar(64) DEFAULT NULL COMMENT '姓名',
`HEAD_PHOTO` varchar(255) DEFAULT NULL COMMENT '头像',
`DEL_FLAG` varchar(2) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(64) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='议题评论表';

36
epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueCommentDao.xml

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.IssueCommentDao">
<resultMap type="com.epmet.entity.IssueCommentEntity" id="issueCommentMap">
<result property="id" column="ID"/>
<result property="issueId" column="ISSUE_ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="content" column="CONTENT"/>
<result property="userId" column="USER_ID"/>
<result property="userName" column="USER_NAME"/>
<result property="headPhoto" column="HEAD_PHOTO"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectCommentList" parameterType="java.lang.String" resultType="com.epmet.dto.IssueCommentDTO">
SELECT
ic.id as commentId,
ic.*
FROM
issue_comment ic
WHERE
ic.DEL_FLAG = '0'
AND ic.ISSUE_ID = #{issueId}
ORDER BY
ic.CREATED_TIME DESC
</select>
</mapper>

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

@ -115,6 +115,15 @@
<if test ='null != suggestion'>
suggestion,
</if>
<if test ='null != address'>
ADDRESS,
</if>
<if test ='null != longitude'>
LONGITUDE,
</if>
<if test ='null != latitude'>
LATITUDE,
</if>
<if test ='null != customerId'>
customer_id,
</if>
@ -186,6 +195,15 @@
<if test ='null != suggestion'>
#{suggestion},
</if>
<if test ='null != address'>
#{address},
</if>
<if test ='null != longitude'>
#{longitude},
</if>
<if test ='null != latitude'>
#{latitude},
</if>
<if test ='null != customerId'>
#{customerId},
</if>

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

@ -43,6 +43,10 @@ public class IcPropertyManagementDTO implements Serializable {
* 物业名称
*/
private String name;
/**
* 客户id
*/
private String customerId;
/**
* 删除标识 0未删除1已删除
@ -73,5 +77,8 @@ public class IcPropertyManagementDTO implements Serializable {
* 更新时间
*/
private Date updatedTime;
/**
* 关联的小区数量
*/
private Integer totalNeighborHood;
}

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

@ -118,4 +118,10 @@ public class AddAgencyV2FormDTO implements Serializable {
* 中心点位位置
*/
private String centerAddress;
/**
* 社区简介
*/
@Length(max = 500,message ="最多输入500字",groups =DefaultUserShowGroup.class )
private String remark;
}

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

@ -110,4 +110,7 @@ public class EditAgencyFormDTO implements Serializable {
private String centerAddress;
private String customerId;
@Length(max = 500,message = "最多输入500字",groups =DefaultUserShowGroup.class )
private String remark;
}

9
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/IcPropertyManagementFormDTO.java

@ -22,6 +22,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
@ -39,6 +40,8 @@ public class IcPropertyManagementFormDTO implements Serializable {
public interface UpdateShowGroup extends CustomerClientShowGroup {
}
public interface PageGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "物业id不能为空", groups = {DeleteGroup.class, UpdateShowGroup.class})
private String id;
@ -49,5 +52,11 @@ public class IcPropertyManagementFormDTO implements Serializable {
@Length(max = 50, message = "物业名称不能超过50个字", groups = {AddShowGroup.class})
private String name;
private String customerId;
@NotNull(message = "pageNo不能为空", groups = PageGroup.class)
private Integer pageNo;
@NotNull(message = "pageSize不能为空", groups = PageGroup.class)
private Integer pageSize;
}

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

@ -133,4 +133,8 @@ public class AgencysResultDTO implements Serializable {
* 中心点位位置
*/
private String centerAddress;
private String remark;
private String coordinates;
}

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

@ -96,4 +96,6 @@ public class GridDetailResultDTO implements Serializable {
*/
private Integer gridSort = 0;
private String coordinates;
}

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

@ -43,7 +43,7 @@ public class GridController {
* @return
*/
@PostMapping("griddetail")
public Result<GridDetailResultDTO> gridDetail(@LoginUser TokenDto tokenDto,@RequestBody CustomerGridFormDTO customerGridFormDTO){
public Result<GridDetailResultDTO> gridDetail(@RequestBody CustomerGridFormDTO customerGridFormDTO){
Result<GridDetailResultDTO> griddetail = customerGridService.griddetail(customerGridFormDTO);
return griddetail;
}

34
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/PropertyManagementController.java

@ -18,12 +18,13 @@
package com.epmet.controller;
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.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
import com.epmet.service.IcPropertyManagementService;
import com.epmet.service.PropertyManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -45,33 +46,46 @@ import java.util.Map;
@RestController
@RequestMapping("propertymanagement")
public class PropertyManagementController {
@Autowired
private IcPropertyManagementService icPropertyManagementService;
@Autowired
private PropertyManagementService propertyManagementService;
/**
* 分页查询物业列表
*/
@PostMapping("page")
public Result<PageData<IcPropertyManagementDTO>> page(@RequestBody IcPropertyManagementFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,IcPropertyManagementFormDTO.PageGroup.class);
return new Result<PageData<IcPropertyManagementDTO>>().ok(propertyManagementService.page(formDTO.getPageNo(),formDTO.getPageSize(),formDTO.getName()));
}
/**
* 新增小区时下拉框调用此接口
* @return
*/
@PostMapping("list")
public Result<List<IcPropertyManagementResultDTO>> list(){
return new Result<List<IcPropertyManagementResultDTO>>().ok(propertyManagementService.getList());
}
/**
* 新增物业
* 新增小区页面添加小区也调用此接口
* @param tokenDTO
* @param formDTO
* @return
*/
@PostMapping("add")
public Result add(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据
formDTO.setCustomerId(tokenDTO.getCustomerId());
ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.AddShowGroup.class);
Map map=new HashMap<>();
map.put("propertyId",propertyManagementService.add(formDTO));
return new Result().ok(map);
}
@PostMapping("update")
public Result update(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){
public Result update(@RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.UpdateShowGroup.class);
propertyManagementService.update(formDTO);
@ -79,7 +93,7 @@ public class PropertyManagementController {
}
@PostMapping("delete")
public Result delete(@LoginUser TokenDto tokenDTO, @RequestBody IcPropertyManagementFormDTO formDTO){
public Result delete(@RequestBody IcPropertyManagementFormDTO formDTO){
//效验数据
ValidatorUtils.validateEntity(formDTO, IcPropertyManagementFormDTO.DeleteGroup.class);
propertyManagementService.delete(formDTO);

4
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcPropertyManagementDao.java

@ -34,7 +34,7 @@ import java.util.List;
@Mapper
public interface IcPropertyManagementDao extends BaseDao<IcPropertyManagementEntity> {
IcPropertyManagementEntity selectByName(String name);
IcPropertyManagementEntity selectByName(String customerId,String name,String id);
/**
* @Description 根据物业名查询已存在的物业名
@ -58,4 +58,6 @@ public interface IcPropertyManagementDao extends BaseDao<IcPropertyManagementEnt
* @return
*/
List<IcPropertyManagementDTO> selectPropertyNameList(String neighborhoodId);
List<IcPropertyManagementDTO> queryList(@Param("customerId") String customerId,@Param("name")String name);
}

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

@ -143,4 +143,10 @@ public class CustomerAgencyEntity extends BaseEpmetEntity {
* 联系电话
*/
private String mobile;
/**
* 备注
*/
private String remark;
}

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/IcPropertyManagementEntity.java

@ -39,5 +39,5 @@ public class IcPropertyManagementEntity extends BaseEpmetEntity {
* 物业名称
*/
private String name;
private String customerId;
}

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

@ -17,6 +17,8 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
@ -36,4 +38,6 @@ public interface PropertyManagementService {
void update(IcPropertyManagementFormDTO formDTO);
void delete(IcPropertyManagementFormDTO formDTO);
PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name);
}

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

@ -166,6 +166,7 @@ public class AgencyServiceImpl implements AgencyService {
originalEntity.setCode(formDTO.getCode());
originalEntity.setContacts(formDTO.getContacts());
originalEntity.setMobile(formDTO.getMobile());
originalEntity.setRemark(formDTO.getRemark());
//利用mybatis 拦截器填充值
originalEntity.setUpdatedTime(null);
originalEntity.setUpdatedBy(null);

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

@ -239,6 +239,9 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
@Override
public Result<GridDetailResultDTO> griddetail(CustomerGridFormDTO customerGridFormDTO) {
GridDetailResultDTO griddetail = baseDao.griddetail(customerGridFormDTO);
if(null==griddetail){
return new Result<>();
}
List<UserIdAndPidDTO> customerStaffGridDTOS = baseDao.selectUserIdByGridId(customerGridFormDTO);
//获取人员具体信息(头像、名字...)
Result<List<StaffGridListDTO>> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS);

50
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/PropertyManagementServiceImpl.java

@ -1,19 +1,24 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.tools.exception.RenException;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.EpmetRequestHolder;
import com.epmet.dao.IcNeighborHoodPropertyDao;
import com.epmet.dao.IcPropertyManagementDao;
import com.epmet.dto.IcPropertyManagementDTO;
import com.epmet.dto.form.IcPropertyManagementFormDTO;
import com.epmet.dto.result.IcPropertyManagementResultDTO;
import com.epmet.entity.IcNeighborHoodPropertyEntity;
import com.epmet.entity.IcPropertyManagementEntity;
import com.epmet.service.PropertyManagementService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -28,9 +33,15 @@ public class PropertyManagementServiceImpl implements PropertyManagementService
@Resource
private IcNeighborHoodPropertyDao icNeighborHoodPropertyDao;
/**
* 查询当前客户下的物业
* @return
*/
@Override
public List<IcPropertyManagementResultDTO> getList() {
List<IcPropertyManagementEntity> propertyManagementEntityList = icPropertyManagementDao.selectList(null);
LambdaQueryWrapper<IcPropertyManagementEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(IcPropertyManagementEntity::getCustomerId, EpmetRequestHolder.getLoginUserCustomerId());
List<IcPropertyManagementEntity> propertyManagementEntityList = icPropertyManagementDao.selectList(queryWrapper);
List<IcPropertyManagementResultDTO> list = new ArrayList<>();
propertyManagementEntityList.forEach(item->{
IcPropertyManagementResultDTO propertyManagementResultDTO = new IcPropertyManagementResultDTO();
@ -41,13 +52,19 @@ public class PropertyManagementServiceImpl implements PropertyManagementService
return list;
}
/**
* 新增物业
* 名称客户下唯一
* @param formDTO
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String add(IcPropertyManagementFormDTO formDTO) {
//物业名字平台内唯一
//如果输入的物业名字已经存在,直接返回物业id
formDTO.setName(formDTO.getName().trim());
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getName());
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(formDTO.getCustomerId(),formDTO.getName(),null);
if (null != entity) {
return entity.getId();
}
@ -59,17 +76,34 @@ public class PropertyManagementServiceImpl implements PropertyManagementService
@Override
@Transactional(rollbackFor = Exception.class)
public void update(IcPropertyManagementFormDTO formDTO) {
IcPropertyManagementEntity entity = icPropertyManagementDao.selectByName(EpmetRequestHolder.getLoginUserCustomerId(),formDTO.getName(),formDTO.getId());
if (null != entity) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业名称已存在","物业名称已存在");
}
IcPropertyManagementEntity icPropertyManagementEntity = ConvertUtils.sourceToTarget(formDTO, IcPropertyManagementEntity.class);
icPropertyManagementDao.updateById(icPropertyManagementEntity);
}
/**
* 单个删除
* @param formDTO
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(IcPropertyManagementFormDTO formDTO) {
List<IcNeighborHoodPropertyEntity> list = icNeighborHoodPropertyDao.selectList(new QueryWrapper<IcNeighborHoodPropertyEntity>().lambda().eq(IcNeighborHoodPropertyEntity::getPropertyId, formDTO.getId()));
if(!CollectionUtils.isEmpty(list)){
throw new RenException("物业存在与小区关联,无法删除");
LambdaQueryWrapper<IcNeighborHoodPropertyEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(IcNeighborHoodPropertyEntity::getPropertyId,formDTO.getId());
if (icNeighborHoodPropertyDao.selectCount(queryWrapper) > 0) {
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"物业存在与小区关联,无法删除","已与小区关联,无法删除");
}
icPropertyManagementDao.deleteById(formDTO.getId());
}
@Override
public PageData<IcPropertyManagementDTO> page(Integer pageNo, Integer pageSize, String name) {
PageHelper.startPage(pageNo,pageSize);
List<IcPropertyManagementDTO> list=icPropertyManagementDao.queryList(EpmetRequestHolder.getLoginUserCustomerId(),name);
PageInfo<IcPropertyManagementDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
}

8
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.48__ic_property_management.sql

@ -0,0 +1,8 @@
alter table ic_property_management add COLUMN `CUSTOMER_ID` varchar(64) DEFAULT NULL COMMENT '客户id' after NAME;
update ic_property_management p,ic_neighbor_hood_property pr,ic_neighbor_hood h
set p.CUSTOMER_ID=h.CUSTOMER_ID
where p.DEL_FLAG='0'
and p.id=pr.PROPERTY_ID
and pr.NEIGHBOR_HOOD_ID=h.id;

2
epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.49__alter_agency.sql

@ -0,0 +1,2 @@
ALTER TABLE `epmet_gov_org`.`customer_agency`
ADD COLUMN `REMARK` varchar(512) NULL COMMENT '备注说明' AFTER `REVISION`;

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

@ -197,7 +197,8 @@
grid_type AS 'gridType',
contacts AS 'contacts',
mobile AS 'mobile',
sort AS gridSort
sort AS gridSort,
COORDINATES AS coordinates
FROM
customer_grid
WHERE

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

@ -14,14 +14,18 @@
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectByName" parameterType="java.lang.String" resultType="com.epmet.entity.IcPropertyManagementEntity">
<select id="selectByName" parameterType="map" resultType="com.epmet.entity.IcPropertyManagementEntity">
SELECT
m.id
FROM
ic_property_management m
WHERE
m.DEL_FLAG = '0'
and m.customer_id = #{customerId}
AND m.`NAME` = #{name}
<if test="id != null and id != ''">
and m.id !=#{id}
</if>
</select>
<!-- 根据物业名查询已存在的物业名 -->
@ -65,4 +69,17 @@
AND p.DEL_FLAG = '0'
)
</select>
<select id="queryList" parameterType="map" resultType="com.epmet.dto.IcPropertyManagementDTO">
select m.*,(
select count(pr.NEIGHBOR_HOOD_ID) from ic_neighbor_hood_property pr where pr.PROPERTY_ID=m.id and pr.del_flag='0'
)as totalNeighborHood
from ic_property_management m
where m.del_flag='0'
and m.customer_id=#{customerId}
<if test="name != null and name != ''">
and m.name like concat('%',#{name},'%')
</if>
order by m.CREATED_TIME desc
</select>
</mapper>

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

@ -1870,6 +1870,28 @@ public class IcEventServiceImpl extends BaseServiceImpl<IcEventDao, IcEventEntit
logEntity.setActionDesc("转议题");
logEntity.setOperateTime(nowTime);
icEventOperationLogService.insert(logEntity);
// 来源于随手拍,随时讲发送站内信消息
if ("0".equals(icEventEntity.getSourceType())) {
// 通知
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(formDTO.getCustomerId());
messageFormDTO.setApp(ProjectConstant.RESI);
messageFormDTO.setGridId(icEventEntity.getGridId());
messageFormDTO.setUserId(icEventEntity.getCreatedBy());
messageFormDTO.setTitle(UserMessageConstant.EVENT_TITILE);
// 获取当前工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = getStaffInfo(formDTO.getCustomerId(), formDTO.getCurrentUserId());
messageFormDTO.setMessageContent(String.format("%s将您上报的事件转为议题,请查看。", staffInfo.getAgencyName()));
messageFormDTO.setReadFlag(Constant.UNREAD);
messageFormDTO.setMessageType(UserMessageTypeConstant.IC_EVENT);
messageFormDTO.setTargetId(icEventEntity.getId());
msgList.add(messageFormDTO);
Result sendMessageRes = messageOpenFeignClient.saveUserMessageList(msgList);
if (!sendMessageRes.success()) {
log.warn(String.format("事件转议题,给居民端用户发送站内信异常,事件Id->%s", icEventEntity.getId()));
}
}
}
/**

4
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/CommonArticleListFormDTO.java

@ -39,5 +39,9 @@ public class CommonArticleListFormDTO implements Serializable {
* 排除的标签名称(高级配置里的参数)
* */
private String excludeTagName;
/**
* 是否置顶 1是0否
*/
private Integer isTop;
}

8
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/GuideListFormDTO.java

@ -16,7 +16,15 @@ import java.io.Serializable;
public class GuideListFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = -4471422632936288213L;
/**
* tokenDto.customerId
*/
private String customerId;
/**
* tokenDto.userId
*/
private String userId;
/**
* 组织ID
*/

6
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/GuideListResultDTO.java

@ -32,4 +32,10 @@ public class GuideListResultDTO implements Serializable {
* 更新时间
*/
private Date updatedTime;
/**
* 1已读
* 0未读
*/
private Integer readFlag;
}

4
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/GuideController.java

@ -100,8 +100,10 @@ public class GuideController {
*/
@PostMapping("list")
public Result<PageData<GuideListResultDTO>> guideList(@LoginUser TokenDto tokenDto, @RequestBody GuideListFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
PageData<GuideListResultDTO> page = guideService.guideList(tokenDto, formDTO);
PageData<GuideListResultDTO> page = guideService.guideList(formDTO);
return new Result<PageData<GuideListResultDTO>>().ok(page);
}

6
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java

@ -114,7 +114,11 @@ public interface ArticleDao extends BaseDao<ArticleEntity> {
* @author wangc
* @date 2020.06.02 16:04
**/
List<ArticleLatestResultDTO> selectLatestArticleMsg(@Param("gridId") String gridId, @Param("tagName") String tagName, @Param("excludeTagName") String excludeTagName, @Param("num") Integer num);
List<ArticleLatestResultDTO> selectLatestArticleMsg(@Param("gridId") String gridId,
@Param("tagName") String tagName,
@Param("excludeTagName") String excludeTagName,
@Param("num") Integer num,
@Param("isTop")Integer isTop);
/**
* @param gridId

16
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/GuideReaderDao.java

@ -0,0 +1,16 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.GuideReaderEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 办事指南阅读记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Mapper
public interface GuideReaderDao extends BaseDao<GuideReaderEntity> {
}

44
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/GuideReaderEntity.java

@ -0,0 +1,44 @@
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;
/**
* 办事指南阅读记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("guide_reader")
public class GuideReaderEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 办事指南id
*/
private String guideId;
/**
* 用户id;进入过办事指南详情就算是已读
*/
private String userId;
/**
* 工作端gov居民端resi
*/
private String userType;
}

34
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideReaderService.java

@ -0,0 +1,34 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.GuideReaderEntity;
/**
* 办事指南阅读记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
public interface GuideReaderService extends BaseService<GuideReaderEntity> {
/**
* 单条查询
*
* @param guideId
* @param userId
* @return GuideReaderDTO
* @author generator
* @date 2023-02-02
*/
GuideReaderEntity get(String guideId,String userId);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2023-02-02
*/
void save(GuideReaderEntity dto);
}

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/GuideService.java

@ -109,7 +109,7 @@ public interface GuideService extends BaseService<GuideEntity> {
* @Author zhaoqifeng
* @Date 2021/9/7 14:00
*/
PageData<GuideListResultDTO> guideList(TokenDto tokenDto, GuideListFormDTO formDTO);
PageData<GuideListResultDTO> guideList(GuideListFormDTO formDTO);
/**
* 添加指南

98
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java

@ -537,8 +537,10 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
}
}
});
//2.1:批量更新发布范围表数据
articlePublishRangeService.updateBatchById(offLineList);
if(!CollectionUtils.isEmpty(offLineList)){
//2.1:批量更新发布范围表数据
articlePublishRangeService.updateBatchById(offLineList);
}
//3:根据是否全部下线更新文章主表数据
ArticleEntity entity = new ArticleEntity();
@ -702,9 +704,12 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
**/
@Override
public List<ArticleLatestResultDTO> getLatestArticleList(CommonArticleListFormDTO commonArticleListFormDTO) {
return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(),commonArticleListFormDTO.getTagName(),commonArticleListFormDTO.getExcludeTagName(),
return baseDao.selectLatestArticleMsg(commonArticleListFormDTO.getGridId(),
commonArticleListFormDTO.getTagName(),
commonArticleListFormDTO.getExcludeTagName(),
null == commonArticleListFormDTO.getNum() || commonArticleListFormDTO.getNum() <= NumConstant.ZERO ?
NumConstant.FIVE : commonArticleListFormDTO.getNum());
NumConstant.FIVE : commonArticleListFormDTO.getNum(),
commonArticleListFormDTO.getIsTop());
}
/**
@ -1740,47 +1745,47 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
PublishedListResultDTO resultDTO = new PublishedListResultDTO();
//1.查询文章主表信息
List<PublishedListResultDTO> list = baseDao.selectAllArticle(formDTO);
if (!CollectionUtils.isEmpty(list)) {
resultDTO = list.get(NumConstant.ZERO);
resultDTO.setTagNameList(StringUtils.isNotBlank(resultDTO.getTags())?Arrays.asList(resultDTO.getTags().split("[|]")):new ArrayList<>());
resultDTO.setIsMePublished(resultDTO.getCreatedBy().equals(formDTO.getStaffId())?true:false);
//查询文章涉及的发布范围网络Id列表
LambdaQueryWrapper<ArticlePublishRangeEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId());
tWrapper.eq(ArticlePublishRangeEntity::getDelFlag, NumConstant.ZERO_STR);
//【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】
if("offline".equals(resultDTO.getStatusFlag())){
tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "offline");
}else {
tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "published");
}
List<ArticlePublishRangeEntity> entityList = articlePublishRangeDao.selectList(tWrapper);
if (!CollectionUtils.isEmpty(entityList)) {
List<String> contentList = entityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList());
resultDTO.setGridIdList(contentList);
}
//查询文章内容
LambdaQueryWrapper<ArticleContentEntity> tWrapper1 = new LambdaQueryWrapper<>();
tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId());
tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR);
tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum);
List<ArticleContentEntity> contentEntityList = articleContentDao.selectList(tWrapper1);
if (!CollectionUtils.isEmpty(contentEntityList)) {
List<PublishedListResultDTO.Content> contentList = ConvertUtils.sourceToTarget(contentEntityList, PublishedListResultDTO.Content.class);
resultDTO.setContentList(contentList);
}
//标签列表
LambdaQueryWrapper<ArticleTagsEntity> tWrapper2 = new LambdaQueryWrapper<>();
tWrapper2.eq(ArticleTagsEntity::getArticleId, formDTO.getArticleId());
tWrapper2.eq(ArticleTagsEntity::getDelFlag, NumConstant.ZERO_STR);
List<ArticleTagsEntity> tagsEntityList = articleTagsDao.selectList(tWrapper2);
if (!CollectionUtils.isEmpty(tagsEntityList)) {
List<String> contentList = tagsEntityList.stream().map(ArticleTagsEntity::getTagId).collect(Collectors.toList());
resultDTO.setTagIdList(contentList);
}
if(CollectionUtils.isEmpty(list)){
return null;
}
resultDTO = list.get(NumConstant.ZERO);
resultDTO.setTagNameList(StringUtils.isNotBlank(resultDTO.getTags())?Arrays.asList(resultDTO.getTags().split("[|]")):new ArrayList<>());
resultDTO.setIsMePublished(resultDTO.getCreatedBy().equals(formDTO.getStaffId())?true:false);
//查询文章涉及的发布范围网络Id列表
LambdaQueryWrapper<ArticlePublishRangeEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(ArticlePublishRangeEntity::getArticleId, formDTO.getArticleId());
tWrapper.eq(ArticlePublishRangeEntity::getDelFlag, NumConstant.ZERO_STR);
//【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】
if("offline".equals(resultDTO.getStatusFlag())){
tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "offline");
}else {
tWrapper.eq(ArticlePublishRangeEntity::getPublishStatus, "published");
}
List<ArticlePublishRangeEntity> entityList = articlePublishRangeDao.selectList(tWrapper);
if (!CollectionUtils.isEmpty(entityList)) {
List<String> contentList = entityList.stream().map(ArticlePublishRangeEntity::getGridId).collect(Collectors.toList());
resultDTO.setGridIdList(contentList);
}
//查询文章内容
LambdaQueryWrapper<ArticleContentEntity> tWrapper1 = new LambdaQueryWrapper<>();
tWrapper1.eq(ArticleContentEntity::getArticleId, formDTO.getArticleId());
tWrapper1.eq(ArticleContentEntity::getDelFlag, NumConstant.ZERO_STR);
tWrapper1.orderByDesc(ArticleContentEntity::getOrderNum);
List<ArticleContentEntity> contentEntityList = articleContentDao.selectList(tWrapper1);
if (!CollectionUtils.isEmpty(contentEntityList)) {
List<PublishedListResultDTO.Content> contentList = ConvertUtils.sourceToTarget(contentEntityList, PublishedListResultDTO.Content.class);
resultDTO.setContentList(contentList);
}
//标签列表
LambdaQueryWrapper<ArticleTagsEntity> tWrapper2 = new LambdaQueryWrapper<>();
tWrapper2.eq(ArticleTagsEntity::getArticleId, formDTO.getArticleId());
tWrapper2.eq(ArticleTagsEntity::getDelFlag, NumConstant.ZERO_STR);
List<ArticleTagsEntity> tagsEntityList = articleTagsDao.selectList(tWrapper2);
if (!CollectionUtils.isEmpty(tagsEntityList)) {
List<String> contentList = tagsEntityList.stream().map(ArticleTagsEntity::getTagId).collect(Collectors.toList());
resultDTO.setTagIdList(contentList);
}
return resultDTO;
@ -1799,7 +1804,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if(StringUtils.isNotBlank(imgUrl)){
//如果没有封面图片的话,更新
LambdaQueryWrapper<ArticleCoverEntity> queryWrapper=new LambdaQueryWrapper();
queryWrapper.eq(ArticleCoverEntity::getArticleId,articleEntity);
queryWrapper.eq(ArticleCoverEntity::getArticleId,articleId);
if (articleCoverDao.selectCount(queryWrapper) == 0) {
ArticleCoverEntity articleCoverEntity=new ArticleCoverEntity();
articleCoverEntity.setCustomerId(articleEntity.getCustomerId());
@ -1847,6 +1852,7 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
articleEntity.setOrgIdPath(StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR) ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId()));
articleEntity.setRichTextFlag(NumConstant.ONE_STR);
articleEntity.setIsTop(formDTO.getIsTop());
articleEntity.setTitle(formDTO.getTitle());
baseDao.updateById(articleEntity);
// 2.内容
ArticleContentEntity articleContent = articleContentDao.selectByArticleId(formDTO.getArticleId());

35
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideReaderServiceImpl.java

@ -0,0 +1,35 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.GuideReaderDao;
import com.epmet.entity.GuideReaderEntity;
import com.epmet.service.GuideReaderService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 办事指南阅读记录
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-02-02
*/
@Service
public class GuideReaderServiceImpl extends BaseServiceImpl<GuideReaderDao, GuideReaderEntity> implements GuideReaderService {
@Override
public GuideReaderEntity get(String guideId,String userId) {
LambdaQueryWrapper<GuideReaderEntity> queryWrapper=new LambdaQueryWrapper<>();
queryWrapper.eq(GuideReaderEntity::getGuideId,guideId)
.eq(GuideReaderEntity::getUserId,userId);
GuideReaderEntity entity = baseDao.selectOne(queryWrapper);
return entity;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(GuideReaderEntity entity) {
insert(entity);
}
}

23
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/GuideServiceImpl.java

@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -31,6 +32,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.dao.GuideDao;
import com.epmet.dto.GuideDTO;
@ -38,10 +40,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.GuideDetailResultDTO;
import com.epmet.dto.result.GuideListResultDTO;
import com.epmet.dto.result.OrgResultDTO;
import com.epmet.entity.GuideAttachmentEntity;
import com.epmet.entity.GuideEntity;
import com.epmet.entity.GuideExternalLinkEntity;
import com.epmet.entity.GuideModuleEntity;
import com.epmet.entity.*;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
@ -140,15 +139,14 @@ public class GuideServiceImpl extends BaseServiceImpl<GuideDao, GuideEntity> imp
* @Date 2021/9/7 14:00
*/
@Override
public PageData<GuideListResultDTO> guideList(TokenDto tokenDto, GuideListFormDTO formDTO) {
public PageData<GuideListResultDTO> guideList(GuideListFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
formDTO.setCustomerId(tokenDto.getCustomerId());
List<GuideListResultDTO> list = baseDao.getGuideList(formDTO);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), item.getCreatedId());
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), item.getCreatedId());
if (null == staffInfoCache) {
item.setCategoryName("");
item.setCategoryName(StrConstant.EPMETY_STR);
} else {
item.setCreatedName(staffInfoCache.getRealName());
}
@ -390,6 +388,15 @@ public class GuideServiceImpl extends BaseServiceImpl<GuideDao, GuideEntity> imp
if (null != guideCollectionService.getCollection(tokenDto, formDTO.getGuideId())) {
result.setCollectionFlag(NumConstant.ONE_STR);
}
//记录已读未读 来源于烟台
if (null == SpringContextUtils.getBean(GuideReaderService.class).get(formDTO.getGuideId(), tokenDto.getUserId())) {
GuideReaderEntity guideReaderEntity=new GuideReaderEntity();
guideReaderEntity.setGuideId(formDTO.getGuideId());
guideReaderEntity.setCustomerId(formDTO.getCustomerId());
guideReaderEntity.setUserId(tokenDto.getUserId());
guideReaderEntity.setUserType(tokenDto.getApp());
SpringContextUtils.getBean(GuideReaderService.class).save(guideReaderEntity);
}
return result;
}

14
epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.12__guide_reader.sql

@ -0,0 +1,14 @@
CREATE TABLE `guide_reader` (
`ID` varchar(64) NOT NULL COMMENT 'ID',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`GUIDE_ID` varchar(64) NOT NULL COMMENT '办事指南id',
`USER_ID` varchar(64) NOT NULL COMMENT '用户id;进入过办事指南详情就算是已读',
`USER_TYPE` varchar(10) NOT NULL COMMENT '工作端:gov;居民端:resi',
`DEL_FLAG` int(11) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='办事指南阅读记录';

6
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml

@ -187,7 +187,7 @@
</select>
<!-- 根据网格Id查找最新文章的相关信息列表 用处:居民端首页最新文章列表 参数:网格Id、客户定制化显示条数 -->
<select id="selectLatestArticleMsg" resultType="com.epmet.dto.result.ArticleLatestResultDTO">
<select id="selectLatestArticleMsg" parameterType="map" resultType="com.epmet.dto.result.ArticleLatestResultDTO">
SELECT
art.ID AS articleId,
art.TITLE AS articleTitle ,
@ -224,7 +224,9 @@
art.DEL_FLAG = '0'
AND
art.STATUS_FLAG = 'published'
<if test="isTop != null">
AND art.IS_TOP=#{isTop}
</if>
GROUP BY art.ID
HAVING 1 = 1
<if test="tagName != null and tagName != ''">

6
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideDao.xml

@ -26,7 +26,11 @@
g.TITLE AS "title",
gc.CATEGORY_NAME AS "categoryName",
g.CREATED_BY AS "createdId",
g.UPDATED_TIME AS "updatedTime"
g.UPDATED_TIME AS "updatedTime",
if(exists( select gr.id from guide_reader gr
where gr.del_flag='0'
and gr.GUIDE_ID=g.id
and gr.USER_ID = #{userId}),1,0) AS readFlag
FROM
guide g
INNER JOIN guide_category gc ON g.CATEGORY_CODE = gc.CATEGORY_CODE AND gc.DEL_FLAG = 0 AND gc.CUSTOMER_ID = #{customerId}

21
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/GuideReaderDao.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.GuideReaderDao">
<resultMap type="com.epmet.entity.GuideReaderEntity" id="guideReaderMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="guideId" column="GUIDE_ID"/>
<result property="userId" column="USER_ID"/>
<result property="userType" column="USER_TYPE"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>

12
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java

@ -120,4 +120,16 @@ public interface TopicConstant {
String RESOLVED = "resolved";
String MEMBER = "member";
/**
* 反对
*/
String OPPOSITION = "opposition";
/**
* 赞成
*/
String SUPPORT = "support";
/**
*
*/
String NONE = "none";
}

95
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicAttachmentDTO.java

@ -0,0 +1,95 @@
package com.epmet.resi.group.dto.topic;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 烟台话题附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-01-30
*/
@Data
public class YtTopicAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 话题Id关联resi_topic的id
*/
private String topicId;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 排序字段
*/
private Integer sort;
/**
* 语音或视频时长
*/
private Integer duration;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

109
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentAttachmentDTO.java

@ -0,0 +1,109 @@
package com.epmet.resi.group.dto.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 烟台话题评论附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-01-30
*/
@Data
public class YtTopicCommentAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 话题Id
*/
private String topicId;
/**
* 评论Id
*/
private String topicCommentId;
/**
* 文件名
*/
private String fileName;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件大小单位b
*/
private Integer attachmentSize;
/**
* 文件格式JPGPNGPDFJPEGBMPMP4WMAM4AMP3DOCDOCXXLS
*/
private String attachmentFormat;
/**
* 附件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* 附件地址
*/
private String attachmentUrl;
/**
* 排序字段
*/
private Integer sort;
/**
* 语音或视频时长
*/
private Integer duration;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

74
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicCommentDTO.java

@ -0,0 +1,74 @@
package com.epmet.resi.group.dto.topic;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 烟台话题评论表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-01-30
*/
@Data
public class YtTopicCommentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 话题Id来自resi_topic
*/
private String topicId;
/**
*
*/
private String commentContent;
/**
* 评论状态讨论中discussing已屏蔽 :hidden
*/
private String status;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人评论人Id来自user
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

125
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicDTO.java

@ -0,0 +1,125 @@
package com.epmet.resi.group.dto.topic;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 烟台话题信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-01-30
*/
@Data
public class YtTopicDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 网格ID
*/
private String gridId;
/**
*
*/
private String topicContent;
/**
* 话题状态讨论中 - discussing 已屏蔽 - hidden 已关闭 - closed
*/
private String status;
/**
* 关闭状态已解决 resolved未解决 unresolved
*/
private String closedStatus;
/**
*
*/
private String province;
/**
*
*/
private String city;
/**
*
*/
private String area;
/**
* 地址
*/
private String address;
/**
* 经度
*/
private String longitude;
/**
* 维度
*/
private String latitude;
/**
* 定位地址
*/
private String locateAddress;
/**
* 定位经度
*/
private String locateLongitude;
/**
* 定位维度
*/
private String locateLatitude;
/**
* 删除标记 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人发布人Id来源于user
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

70
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/YtTopicVoteDetailDTO.java

@ -0,0 +1,70 @@
package com.epmet.resi.group.dto.topic;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 话题表决记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-01-30
*/
@Data
public class YtTopicVoteDetailDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键ID
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 话题ID
*/
private String topicId;
/**
* 态度 - opposition反对support赞成
*/
private String attitude;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

100
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateYtTopicFormDTO.java

@ -0,0 +1,100 @@
package com.epmet.resi.group.dto.topic.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Author zhaoqifeng
* @Date 2023/1/30 16:17
*/
@Data
public class CreateYtTopicFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "customerId不能为空",groups =AddUserInternalGroup.class )
private String customerId;
@NotBlank(message ="网格不能为空",groups =AddUserShowGroup.class )
private String gridId;
@Length(max=3000,message ="话题内容最多输入3000字",groups =AddUserShowGroup.class )
private String topicContent;
/**
* 经度
* */
private String longitude;
/**
* 纬度
* */
private String latitude;
/**
* 地址
* */
@NotBlank(message = "地址信息不能为空")
private String address;
/**
* 经度
* */
private String locateLongitude;
/**
* 纬度
* */
private String locateLatitude;
/**
* 地址
* */
private String locateAddress;
/**
* 省份
* */
private String province;
/**
* 城市
* */
private String city;
/**
* 地区
* */
private String area;
/**
* 图片附件
*/
private List<String> imageList;
// /**
// * 文件附件
// */
// private List<FileDTO> docList;
/**
* 语音附件
*/
private List<FileDTO> voiceList;
// /**
// * 视频附件
// */
// private List<FileDTO> videoList;
/**
* tokenDto.getUserId
*/
@NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class )
private String userId;
}

15
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/IssueShiftedFromTopicFormDTO.java

@ -122,4 +122,19 @@ public class IssueShiftedFromTopicFormDTO implements Serializable {
private String groupId;
private String issueId;
/**
* 经度
*/
private String longitude;
/**
* 纬度
*/
private String latitude;
/**
* 地址
*/
private String address;
}

31
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicCommentFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.resi.group.dto.topic.form;
import com.epmet.resi.group.dto.notice.form.NoticeFileDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @ClassName ResiPublishCommentFormDTO
* @Author wangc
* @date 2020.03.31 17:32
*/
@Data
public class YtTopicCommentFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotBlank(message = "话题Id不能为空")
private String topicId;
//@NotBlank(message = "评论内容不能为空")
private String commentContent;
/**
* 图片附件集合
*/
private List<NoticeFileDTO> imageList;
}

36
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicDetailFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.resi.group.dto.topic.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @ClassName ResiTopicDetailFormDTO
* @Author wangc
* @date 2020.04.07 09:07
*/
@Data
public class YtTopicDetailFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 话题Id
* */
@NotBlank(message = "话题Id不能为空",groups = AddUserShowGroup.class)
private String topicId;
/**
* tokenDto.getUserId
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class )
private String userId;
}

61
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicPageFormDTO.java

@ -0,0 +1,61 @@
package com.epmet.resi.group.dto.topic.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author Administrator
*/
@Data
public class YtTopicPageFormDTO extends PageFormDTO implements Serializable{
private static final long serialVersionUID = 1L;
/**
* 组织Id
* */
private String agencyId;
/**
* 网格Idsource是居民端时必填
* */
@NotBlank(message = "网格Id不能为空")
private String gridId;
/**
* 搜索时可以带状态的查询也可以不带
* */
private String status;
/**
* 用户Id
* */
private String userId;
/**
* 请求来源0 居民端1 PC端
* */
private String source;
/**
* 话题内容
* */
private String topicContent;
/**
* 话题发表人
* */
private String userName;
/**
* 发布时间
* */
private String startDate;
/**
* 发布时间
* */
private String endDate;
}

28
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/YtTopicVoteFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.resi.group.dto.topic.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @ClassName ResiPublishCommentFormDTO
* @Author wangc
* @date 2020.03.31 17:32
*/
@Data
public class YtTopicVoteFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotBlank(message = "话题Id不能为空")
private String topicId;
/**
* 态度opposition反对support赞成
*/
@NotBlank(message = "投票结果不能为空")
private String attitude;
}

15
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/ResiTopicAndGroupResultDTO.java

@ -33,4 +33,19 @@ public class ResiTopicAndGroupResultDTO implements Serializable {
* 客户Id
* */
private String customerId;
/**
* 定位地址
* */
private String locateAddress;
/**
* 定位经度
* */
private String locateLongitude;
/**
* 定位纬度
* */
private String locateDimension;
}

65
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicCommentResultDTO.java

@ -0,0 +1,65 @@
package com.epmet.resi.group.dto.topic.result;
import com.alibaba.fastjson.annotation.JSONField;
import com.epmet.resi.group.dto.group.result.CommentFileDTO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* @Description
* @ClassName ResiCommentResultDTO
* @Author wangc
* @date 2020.04.01 17:07
*/
@Data
public class YtTopicCommentResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 评论Id
* */
private String commentId;
/**
* 评论内容
* */
private String commentContent;
/**
* 评论者头像
* */
private String commentUserHeadPhoto;
/**
* 评论者姓名
* */
private String commentUserName;
/**
* 用户Id 评论者Id
* */
@JsonIgnore
private String userId;
/**
* 评论时间 yyyy-MM-dd HH:mm
* */
@JSONField(format="yyyy-MM-dd HH:mm")
private Date commentTime;
/**
* 评论状态
* */
private String commentStatus;
/**
* 图片附件集合
*/
private List<CommentFileDTO> imageList = new ArrayList<>();
}

86
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicDetailResultDTO.java

@ -0,0 +1,86 @@
package com.epmet.resi.group.dto.topic.result;
import com.epmet.resi.group.dto.topic.form.FileDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author Administrator
*/
@Data
public class YtTopicDetailResultDTO implements Serializable {
private static final long serialVersionUID = -6790536784979922200L;
/**
* 话题Id
* */
private String topicId;
/**
* 发布人名称
* */
private String releaseUserName;
/**
* 发布人头像
* */
private String releaseUserHeadPhoto;
/**
* 发布时间 yyyy-MM-dd HH:mm
* */
private String releaseTime;
/**
* 发布地址
* */
private String releaseAddress;
/**
* 经度
*/
private String longitude;
/**
* 维度
*/
private String latitude;
/**
* 话题内容
* */
private String topicContent;
/**
* 话题状态
* */
private String topicStatus;
/**
* 图片访问地址
* */
private List<String> topicImages;
/**
* 话题语音详情
* */
private List<FileDTO> topicVoices;
/**
* 本人投票状态opposition反对support赞成 none(未投票)
* */
private String voteStatus;
/**
* 投票支持数
* */
private String supportCount;
/**
* 投票反对数
* */
private String oppositionCount;
private String userName;
private String gridName;
}

75
epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/YtTopicInfoResultDTO.java

@ -0,0 +1,75 @@
package com.epmet.resi.group.dto.topic.result;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @author Administrator
*/
@Data
public class YtTopicInfoResultDTO implements Serializable {
private static final long serialVersionUID = -7029232911456325417L;
/**
* 话题Id
* */
private String topicId;
/**
* 用户Id 话题发布人
* */
private String userId;
/**
* 发布人名称
* */
private String releaseUserName;
private String userName;
/**
* 网格ID
*/
private String gridId;
/**
* 网格名
*/
private String gridName;
/**
* 发布人头像
* */
private String releaseUserHeadPhoto;
/**
* 发布时间 yyyy-MM-dd HH:mm
* */
@JSONField(format="yyyy-MM-dd HH:mm")
private Date releaseTime;
/**
* 话题内容
* */
private String topicContent;
/**
* 话题状态 讨论中 已关闭
* */
private String status;
/**
* 是否本人 me other
* */
private String releaseUserFlag;
/**
* 第一张图片
* */
private List<String> imageList;
}

142
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/YtTopicController.java

@ -0,0 +1,142 @@
package com.epmet.modules.topic.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.MaskResponse;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
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.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.modules.topic.service.YtTopicService;
import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO;
import com.epmet.resi.group.dto.topic.form.*;
import com.epmet.resi.group.dto.topic.result.YtTopicCommentResultDTO;
import com.epmet.resi.group.dto.topic.result.YtTopicDetailResultDTO;
import com.epmet.resi.group.dto.topic.result.YtTopicInfoResultDTO;
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;
/**
* 烟台话题信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-01-30
*/
@RestController
@RequestMapping("ytTopic")
public class YtTopicController {
@Autowired
private YtTopicService ytTopicService;
/**
* 发布话题
*
* @Param tokenDto
* @Param formDTO
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2023/1/30 16:32
*/
@PostMapping("createTopic")
@NoRepeatSubmit
public Result createTopic(@LoginUser TokenDto tokenDto, @RequestBody CreateYtTopicFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,CreateYtTopicFormDTO.AddUserShowGroup.class,CreateYtTopicFormDTO.AddUserInternalGroup.class);
ytTopicService.createTopic(formDTO);
return new Result();
}
/**
* 话题详情
*
* @Param tokenDto
* @Param topicDetailFormDTO
* @Return {@link Result< YtTopicDetailResultDTO>}
* @Author zhaoqifeng
* @Date 2023/1/30 16:39
*/
@PostMapping("topicDetail")
public Result<YtTopicDetailResultDTO> getTopicDetail(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO topicDetailFormDTO) {
topicDetailFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(topicDetailFormDTO,YtTopicDetailFormDTO.AddUserShowGroup.class,YtTopicDetailFormDTO.AddUserInternalGroup.class);
return new Result<YtTopicDetailResultDTO>().ok(ytTopicService.getTopicDetail(topicDetailFormDTO));
}
/**
* 话题列表
*
* @Param tokenDto
* @Param topicPageFormDTO
* @Return {@link Result< PageData< YtTopicInfoResultDTO>>}
* @Author zhaoqifeng
* @Date 2023/1/30 16:55
*/
@PostMapping("topicList")
@MaskResponse(fieldNames = "userName", fieldsMaskType = {MaskResponse.MASK_TYPE_CHINESE_NAME})
public Result<PageData<YtTopicInfoResultDTO>> getTopicList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicPageFormDTO topicPageFormDTO) {
topicPageFormDTO.setUserId(tokenDto.getUserId());
if (NumConstant.ZERO_STR.equals(topicPageFormDTO.getSource())) {
ValidatorUtils.validateEntity(topicPageFormDTO);
}
return new Result<PageData<YtTopicInfoResultDTO>>().ok(ytTopicService.getTopicList(tokenDto, topicPageFormDTO));
}
/**
* 话题详情评论列表
*
* @Param tokenDto
* @Param queryCommentFormDTO
* @Return {@link Result<List<ResiCommentResultDTO>>}
* @Author zhaoqifeng
* @Date 2023/1/30 16:57
*/
@PostMapping("topicCommentList")
public Result<PageData<YtTopicCommentResultDTO>> getTopiCommentList(@LoginUser TokenDto tokenDto, @RequestBody YtTopicDetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<PageData<YtTopicCommentResultDTO>>().ok(ytTopicService.getTopicCommentList(tokenDto, formDTO));
}
/**
* 评论话题
*
* @Param tokenDto
* @Param formDTO
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2023/1/30 17:06
*/
@PostMapping("topicComment")
@NoRepeatSubmit
public Result topiComment(@LoginUser TokenDto tokenDto, @RequestBody YtTopicCommentFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
ytTopicService.topicComment(tokenDto, formDTO);
return new Result();
}
/**
* 话题投票
*
* @Param tokenDto
* @Param formDTO
* @Return {@link Result}
* @Author zhaoqifeng
* @Date 2023/1/30 17:08
*/
@PostMapping("topicVote")
@NoRepeatSubmit
public Result topicVote(@LoginUser TokenDto tokenDto, @RequestBody YtTopicVoteFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
ytTopicService.topicVote(tokenDto, formDTO);
return new Result();
}
}

16
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/YtTopicAttachmentDao.java

@ -0,0 +1,16 @@
package com.epmet.modules.topic.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.modules.topic.entity.YtTopicAttachmentEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 烟台话题附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2023-01-30
*/
@Mapper
public interface YtTopicAttachmentDao extends BaseDao<YtTopicAttachmentEntity> {
}

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

Loading…
Cancel
Save