Browse Source

Merge remote-tracking branch 'origin/dev_new_article'

master
yinzuomei 3 years ago
parent
commit
ed07263a36
  1. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  2. 1
      epmet-gateway/pom.xml
  3. 3
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  4. 18
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml
  5. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java
  6. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java
  7. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.java
  8. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.java
  9. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java
  10. 36
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPageFormDTO.java
  11. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java
  12. 21
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/FinishActFormDTO.java
  13. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java
  14. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java
  15. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java
  16. 10
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java
  17. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java
  18. 183
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDetailResultDTO.java
  19. 106
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPageResDTO.java
  20. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java
  21. 108
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActUserResDTO.java
  22. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java
  23. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java
  24. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java
  25. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java
  26. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java
  27. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java
  28. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java
  29. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java
  30. 72
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java
  31. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java
  32. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java
  33. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActContentEntity.java
  34. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java
  35. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActSummaryEntity.java
  36. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActContentEntity.java
  37. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActInfoEntity.java
  38. 22
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActService.java
  39. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java
  40. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/GrantPointsServiceImpl.java
  41. 143
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  42. 49
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  43. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.22__act_addcol.sql
  44. 4
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.23__acttel.sql
  45. 74
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml
  46. 34
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  47. 2
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java
  48. 4
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java
  49. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java
  50. 2
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java
  51. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java
  52. 2
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java
  53. 5
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java
  54. 84
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java
  55. 60
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java
  56. 23
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java
  57. 4
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/PublishGridListFormDTO.java
  58. 128
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java
  59. 82
      epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java
  60. 10
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java
  61. 54
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java
  62. 35
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java
  63. 3
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/ArticleDao.java
  64. 3
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java
  65. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java
  66. 4
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java
  67. 2
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java
  68. 5
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java
  69. 12
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java
  70. 5
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java
  71. 376
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java
  72. 99
      epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java
  73. 6
      epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.10__alert_new_article_and_draft.sql
  74. 1
      epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.11__alert_article_draft_id.sql
  75. 90
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/ArticleDao.xml
  76. 54
      epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml
  77. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java
  78. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java
  79. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

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

@ -160,6 +160,7 @@ public enum EpmetErrorCode {
ERROR_DATE(8533, "不合理日期"),
CHECK_PHONE_ERROR(8534, "号码不合法"),
TITLE_AND_CONTENT_ERROR(8535, "标题和内容不能同时为空"),
// 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),

1
epmet-gateway/pom.xml

@ -275,6 +275,7 @@
<gateway.routes.epmet-admin-server.uri>lb://epmet-admin-server</gateway.routes.epmet-admin-server.uri>
<!-- 4、OSS服务 -->
<gateway.routes.epmet-oss-server.uri>lb://epmet-oss-server</gateway.routes.epmet-oss-server.uri>
<!-- <gateway.routes.epmet-oss-server.uri>http://localhost:8083</gateway.routes.epmet-oss-server.uri>-->
<!-- 5、消息服务 -->
<gateway.routes.epmet-message-server.uri>lb://epmet-message-server</gateway.routes.epmet-message-server.uri>
<!-- 6、工作流服务 -->

3
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -688,6 +688,9 @@ public class EpmetUserServiceImpl implements EpmetUserService {
//1.分页查询排好序的工作人员Id列表【原本1/2步可以用一个sql,但涉及2需要按1的顺序排序,sql复杂且效率低,所以拆开】
LinkedList<String> staffIds = customerStaffDao.selectOrderRole(formDTO);
//2.批量查询工作人员信息,按传入顺序排序
if(CollectionUtils.isEmpty(staffIds)){
return new ArrayList<>();
}
List<ListStaffResultDTO> resultList = customerStaffDao.selectStaffList(staffIds);
return resultList;
}

18
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml

@ -116,16 +116,18 @@
customer_staff
WHERE
del_flag = '0'
AND user_id IN
<foreach item="staffId" collection="staffIds" open="(" separator="," close=")">
#{staffId}
</foreach>
ORDER BY field(
user_id,
<foreach item="staffId" collection="staffIds" separator=",">
<if test="staffIds != null and staffIds.size() > 0">
AND user_id IN
<foreach item="staffId" collection="staffIds" open="(" separator="," close=")">
#{staffId}
</foreach>
)
ORDER BY field(
user_id,
<foreach item="staffId" collection="staffIds" separator=",">
#{staffId}
</foreach>
)
</if>
</select>
<select id="selectByStaffId" resultType="com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO">

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActContentDTO.java

@ -50,7 +50,7 @@ public class ActContentDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
private String contentType;

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActInfoDTO.java

@ -193,6 +193,11 @@ public class ActInfoDTO implements Serializable {
*/
private String sponsorId;
/**
* 主办方全路径包含自身id
*/
private String sponsorPath;
/**
* 活动主办方名称机关或网格的名称
*/
@ -238,6 +243,11 @@ public class ActInfoDTO implements Serializable {
*/
private Boolean summaryFlag;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
/**
* 乐观锁
*/

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/ActSummaryDTO.java

@ -50,7 +50,7 @@ public class ActSummaryDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
private String contentType;

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActContentDTO.java

@ -50,7 +50,7 @@ public class LatestActContentDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
private String contentType;

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActInfoDTO.java

@ -154,6 +154,11 @@ public class LatestActInfoDTO implements Serializable {
*/
private String sponsorId;
/**
* 主办方全路径包含自身id
*/
private String sponsorPath;
/**
* 活动主办方名称机关或网格的名称
*/
@ -179,6 +184,11 @@ public class LatestActInfoDTO implements Serializable {
*/
private Boolean auditSwitch;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
/**
* 活动类型爱心活动heart 联建活动party
*/

36
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/ActPageFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.form.work;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import java.io.Serializable;
/**
* 爱心互助列表入参DTO
*/
@Data
public class ActPageFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 6473824879249274683L;
/**
* 活动标题
*/
private String title;
/**
* 活动预计开始时间
*/
private String actStartTime;
/**
* 活动预计结束时间
*/
private String actEndTime;
/**
* 状态 已发布/报名中published 已取消canceled; 已结束finished
*/
private String status;
/**
* tokenDto获取
*/
private String customerId;
private String userId;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/AuditUserFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.form.work;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ -12,6 +13,7 @@ import java.io.Serializable;
* @author yinzuomei@elink-cn.com
* @date 2020/7/23 17:28
*/
@Valid
@Data
public class AuditUserFormDTO implements Serializable {
private static final long serialVersionUID = 243279409415285207L;
@ -28,4 +30,7 @@ public class AuditUserFormDTO implements Serializable {
@NotBlank(message = "拒绝理由不能为空", groups = {RefusedUserShowGroup.class})
private String rejectReason;
@NotBlank(message = "type不能为空【通过:pass;拒绝:refused】", groups = {AddUserInternalGroup.class})
private String type;
}

21
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/FinishActFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form.work;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2022/6/30 19:22
*/
@Data
public class FinishActFormDTO extends SaveActualTimeFormDTO implements Serializable {
private static final long serialVersionUID = -4352058593501077516L;
@NotNull(message = "分值不能为空",groups =AddUserInternalGroup.class )
private Integer reward;
private List<GrantPointsFormDTO> userList;
}

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/GrantPointsFormDTO.java

@ -4,6 +4,7 @@ import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
@ -27,4 +28,9 @@ public class GrantPointsFormDTO implements Serializable {
@NotBlank(message = "理由不能为空", groups = {DenyUserShowGroup.class})
private String denyRewardReason;
/**
* true:给分false不给分
*/
@NotNull(message = "请选择是否给分", groups = DenyUserShowGroup.class)
private Boolean grantPoint;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActContentFormDTO.java

@ -29,8 +29,8 @@ public class PublishActContentFormDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
@NotBlank(message = "内容类型不能为空,图片:img;文字:text", groups = {UserInternalGroup.class})
@NotBlank(message = "内容类型 图片:img;文字:text;富文本:rich_text", groups = {UserInternalGroup.class})
private String contentType;
}

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/PublishActInfoFormDTO.java

@ -165,6 +165,11 @@ public class PublishActInfoFormDTO implements Serializable {
@NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class})
private String sponsorId;
/**
* 主办方全路径包含自身id
*/
private String sponsorPath;
/**
* 主办方类型以网格名义grid , 以机关名义 agency
*/
@ -212,4 +217,9 @@ public class PublishActInfoFormDTO implements Serializable {
private String serviceMatter;
@NotEmpty(message = "服务事项不能为空", groups = {AddPartyActivityGroup.class})
private List<String> serviceMatterList;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

10
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/work/RePublishFormDTO.java

@ -173,6 +173,11 @@ public class RePublishFormDTO implements Serializable {
@NotBlank(message = "主办方id不能为空", groups = {AddUserInternalGroup.class})
private String sponsorId;
/**
* 主办方全路径包含自身id
*/
private String sponsorPath;
/**
* 主办方类型以网格名义grid , 以机关名义 agency
*/
@ -221,4 +226,9 @@ public class RePublishFormDTO implements Serializable {
private String serviceMatter;
@NotEmpty(message = "服务事项不能为空", groups = {PublishActInfoFormDTO.AddPartyActivityGroup.class})
private List<String> serviceMatterList;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/resi/ResiActDetailResultDTO.java

@ -203,4 +203,8 @@ public class ResiActDetailResultDTO implements Serializable {
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

183
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActDetailResultDTO.java

@ -0,0 +1,183 @@
package com.epmet.dto.result.work;
import com.epmet.dto.result.resi.ResiActSummaryResultDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @Description
* @Author yzm
* @Date 2022/6/30 16:47
*/
@Data
public class ActDetailResultDTO implements Serializable {
private static final long serialVersionUID = 4235569576711312094L;
private String actId;
/**
* 活动标题
*/
private String title;
/**
* 封面图
*/
private String coverPic;
/**
* 活动地点
*/
private String actAddress;
/**
* 活动地点-经度
*/
private BigDecimal actLongitude;
/**
* 活动地点-纬度
*/
private BigDecimal actLatitude;
/**
* 活动预计开始时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actStartTime;
/**
* 活动预计结束时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actEndTime;
/**
* 活动人数
*/
private Integer actQuota;
/**
* 活动积分
*/
private Integer reward;
/**
* 报名审核true只有志愿者才可以参加活动false: 只要是居民就可以参加活动
*/
private Boolean volunteerLimit;
/**
* 报名审核 true: 需人工审核 false: 无需审核
*/
private Boolean auditSwitch;
/**
* 报名截止时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signUpEndTime;
/**
* 报名条件
*/
private String requirement;
/**
* 签到开始时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signInStartTime;
/**
* 签到结束时间: yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signInEndTime;
/**
* 签到地址
*/
private String signInAddress;
/**
* 签到地址-纬度
*/
private BigDecimal signInLatitude;
/**
* 签到地址-经度
*/
private BigDecimal signInLongitude;
/**
* 签到有效范围()
*/
private Integer signInRadius;
/**
* 主办方id
*/
private String sponsorId;
/**
* 主办方全路径包含自身id
*/
private String sponsorPath;
/**
* 主办方类型以网格名义grid , 以机关名义 agency
*/
private String sponsorType;
/**
* 主办方名称
*/
private String sponsorName;
/**
* 联系人
*/
private String sponsorContacts;
/**
* 联系电话
*/
private String sponsorTel;
/**
* 活动类型爱心活动heart 联建活动party
*/
@JsonIgnore
private String actType;
@JsonIgnore
private String createdBy;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
/**
* true我发布的false,其他人发布的
*/
private Boolean isMyPublish;
private List<ActPreviewContentResultDTO> actContent;
/**
* 1已经总结0未总结
*/
private Boolean summaryFlag;
/**
* 只有填写了总结的才有内容
*/
List<ResiActSummaryResultDTO> summaryContent;
}

106
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPageResDTO.java

@ -0,0 +1,106 @@
package com.epmet.dto.result.work;
import com.epmet.dto.form.work.PublishActInfoFormDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @Author yzm
* @Date 2022/6/30 14:15
*/
@Data
public class ActPageResDTO implements Serializable {
private static final long serialVersionUID = 5330377961022020364L;
/**
*活动id
*/
private String actId;
/**
*活动标题
*/
private String title;
/**
* 活动地点
*/
private String actAddress;
/**
* 活动预计开始时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actStartTime;
/**
* 活动预计结束时间yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date actEndTime;
/**
* 报名截止时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signUpEndTime;
/**
* 报名开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date signUpStartTime;
/**
* 活动状态报名中signing_up截止报名: end_sign_up; 已开始 in_progress; 已报满 enough
*/
private String status="";
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
/**
* true我发布的false,其他人发布的
*/
private Boolean isMyPublish;
/**
* true:固定名额 false 不限制名额
*/
@JsonIgnore
private Boolean actQuotaCategory;
/**
* 活动名额人数
*/
@JsonIgnore
private Integer actQuota;
/**
* 已报名人数
*/
@JsonIgnore
private Integer signedUp;
/**
* 1已经总结0未总结
*/
private Boolean summaryFlag;
/**
* 活动积分
*/
private Integer reward;
/**
* 报名审核 true: 需人工审核 false: 无需审核
*/
@NotNull(message = "报名审核方式不能为空", groups = {PublishActInfoFormDTO.AddUserInternalGroup.class})
private Boolean auditSwitch;
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActPreviewContentResultDTO.java

@ -19,7 +19,7 @@ public class ActPreviewContentResultDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
private String contentType;
}

108
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ActUserResDTO.java

@ -0,0 +1,108 @@
package com.epmet.dto.result.work;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Description
* @Author yzm
* @Date 2022/6/30 17:58
*/
@Data
public class ActUserResDTO implements Serializable {
private static final long serialVersionUID = 7621004224467504031L;
/**
* 主键
*/
private String actUserRelationId;
/**
* 活动id
*/
private String actId;
/**
* 用户id
*/
private String userId;
/**
* 姓名
*/
private String realName;
/**
* 昵称
*/
private String nickName;
/**
* 联系方式
*/
private String mobile;
/**
* 身份证号
*/
private String idNum;
/**
* 报名时间yyyy-MM-dd HH:mm:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date signUpTime;
/**
* true: 是志愿者 false : 不是志愿者
*/
private Boolean volunteerFlag;
/**
* 实际参加活动个数
*/
private Integer signInActNum;
/**
* 报名活动个数
*/
private Integer signUpActNum;
/**
* 获得积分活动个数
*/
private Integer obtainPointsActNum;
/**
* 已处理: handled; 默认"",重新处理时reward_flag置为空字符串
*/
private String processFlag;
/**
* 已签到:signed_in; 默认""
*/
private String signInFlag;
/**
* 已给分agree, 不给分deny 默认""
*/
private String rewardFlag;
/**
* 当前状态已报名/待审核auditing
审核通过passed
审核不通过refused
取消报名canceled
*/
private String status;
public ActUserResDTO(){
this.signInActNum=0;
this.signUpActNum=0;
this.obtainPointsActNum=0;
}
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActDetailResultDTO.java

@ -174,4 +174,9 @@ public class CanceledActDetailResultDTO implements Serializable {
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/CanceledActResultDTO.java

@ -61,4 +61,9 @@ public class CanceledActResultDTO implements Serializable {
* 活动类型 爱心活动heart 联建活动party
*/
private String actType;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActDetailResultDTO.java

@ -164,4 +164,9 @@ public class FinishedActDetailResultDTO implements Serializable {
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/FinishedActResultDTO.java

@ -63,4 +63,9 @@ public class FinishedActResultDTO implements Serializable {
* 活动类型 爱心活动heart 联建活动party
*/
private String actType;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActDetailResultDTO.java

@ -159,4 +159,9 @@ public class InProgressActDetailResultDTO implements Serializable {
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/InProgressActResultDTO.java

@ -87,4 +87,9 @@ public class InProgressActResultDTO implements Serializable {
* 活动类型 爱心活动heart 联建活动party
*/
private String actType;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/work/ReEditActInfoResultDTO.java

@ -176,4 +176,9 @@ public class ReEditActInfoResultDTO implements Serializable {
private String serviceMatterName;
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
}

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/GrantPointsController.java

@ -54,6 +54,7 @@ public class GrantPointsController {
**/
@PostMapping("deny")
public Result deny(@RequestBody GrantPointsFormDTO formDTO){
formDTO.setGrantPoint(false);
ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.DenyUserShowGroup.class);
grantPointsService.deny(formDTO);
return new Result();
@ -68,6 +69,7 @@ public class GrantPointsController {
**/
@PostMapping("agree")
public Result agree(@RequestBody GrantPointsFormDTO formDTO){
formDTO.setGrantPoint(true);
ValidatorUtils.validateEntity(formDTO, GrantPointsFormDTO.AddUserInternalGroup.class);
grantPointsService.agree(formDTO);
return new Result();

72
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActController.java

@ -1,6 +1,8 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
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;
@ -57,11 +59,16 @@ public class WorkActController {
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.PublishActResultDTO>
* @author yinzuomei
* @description 发布活动
* @description 发布活动-----废弃现在使用publishV2
* @Date 2020/7/21 18:32
**/
@PostMapping("publish")
public Result<PublishActResultDTO> publishAct(@RequestBody PublishActInfoFormDTO formDTO) {
public Result<PublishActResultDTO> publishAct(@LoginUser TokenDto tokenDto,@RequestBody PublishActInfoFormDTO formDTO) {
if (AppClientConstant.CLIENT_WEB.equals(tokenDto.getClient())) {
formDTO.setRichTextFlag(true);
} else {
formDTO.setRichTextFlag(false);
}
ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
for (PublishActContentFormDTO actContentFormDTO : formDTO.getActContent()) {
ValidatorUtils.validateEntity(actContentFormDTO,
@ -73,7 +80,12 @@ public class WorkActController {
}
@PostMapping("publishV2")
public Result<PublishActResultDTO> publishActV2(@RequestBody PublishActInfoFormDTO formDTO) {
public Result<PublishActResultDTO> publishActV2(@LoginUser TokenDto tokenDto ,@RequestBody PublishActInfoFormDTO formDTO) {
if (AppClientConstant.CLIENT_WEB.equals(tokenDto.getClient())) {
formDTO.setRichTextFlag(true);
} else {
formDTO.setRichTextFlag(false);
}
if (ActConstant.HEART.equals(formDTO.getActType())) {
ValidatorUtils.validateEntity(formDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
} else {
@ -260,11 +272,16 @@ public class WorkActController {
* @param rePublishFormDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.work.PublishActResultDTO>
* @author yinzuomei
* @description 重新发布活动
* @description 重新发布活动-----废弃现在使用republishV2
* @Date 2020/7/27 13:55
**/
@PostMapping("republish")
public Result<PublishActResultDTO> rePublish(@RequestBody RePublishFormDTO rePublishFormDTO) {
public Result<PublishActResultDTO> rePublish(@LoginUser TokenDto tokenDto,@RequestBody RePublishFormDTO rePublishFormDTO) {
if (AppClientConstant.CLIENT_WEB.equals(tokenDto.getClient())) {
rePublishFormDTO.setRichTextFlag(true);
} else {
rePublishFormDTO.setRichTextFlag(false);
}
ValidatorUtils.validateEntity(rePublishFormDTO, RePublishFormDTO.AddUserShowGroup.class, RePublishFormDTO.AddUserInternalGroup.class);
for (PublishActContentFormDTO actContentFormDTO : rePublishFormDTO.getActContent()) {
ValidatorUtils.validateEntity(actContentFormDTO,
@ -276,9 +293,14 @@ public class WorkActController {
}
@PostMapping("republishV2")
public Result<PublishActResultDTO> rePublishV2(@RequestBody RePublishFormDTO rePublishFormDTO) {
public Result<PublishActResultDTO> rePublishV2(@LoginUser TokenDto tokenDto,@RequestBody RePublishFormDTO rePublishFormDTO) {
if (AppClientConstant.CLIENT_WEB.equals(tokenDto.getClient())) {
rePublishFormDTO.setRichTextFlag(true);
} else {
rePublishFormDTO.setRichTextFlag(false);
}
if (ActConstant.HEART.equals(rePublishFormDTO.getActType())) {
ValidatorUtils.validateEntity(rePublishFormDTO, PublishActInfoFormDTO.AddUserShowGroup.class, PublishActInfoFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(rePublishFormDTO, RePublishFormDTO.AddUserShowGroup.class, RePublishFormDTO.AddUserInternalGroup.class);
} else {
ValidatorUtils.validateEntity(rePublishFormDTO, RePublishFormDTO.AddUserShowGroup.class, RePublishFormDTO.AddUserInternalGroup.class);
}
@ -291,5 +313,41 @@ public class WorkActController {
return new Result<PublishActResultDTO>().ok(workActService.rePublishV2(rePublishFormDTO));
}
/**
* 数字社区-爱心互助活动列表查询当前客户下的所有活动限制活动类型是爱心活动
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("pagelist")
public Result<PageData<ActPageResDTO>> pageList(@LoginUser TokenDto tokenDto, @RequestBody ActPageFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
PageData<ActPageResDTO> page = workActService.pageList(formDTO);
return new Result<PageData<ActPageResDTO>>().ok(page);
}
/**
* 数字社区查看活动详情
*
* @param tokenDto
* @param formDTO
* @return
*/
@PostMapping("detail")
public Result<ActDetailResultDTO> queryActDetail(@LoginUser TokenDto tokenDto, @RequestBody ActIdFormDTO formDTO) {
return new Result<ActDetailResultDTO>().ok(workActService.queryActDetail(formDTO.getActId(), tokenDto.getUserId()));
}
/**
* 数字社区结束活动
* @param formDTO
* @return
*/
@PostMapping("finish")
public Result finish(@RequestBody FinishActFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO,SaveActualTimeFormDTO.AddUserInternalGroup.class,SaveActualTimeFormDTO.UserShowGroup.class);
workActService.finish(formDTO);
return new Result();
}
}

34
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/WorkActUserController.java

@ -1,7 +1,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.ActConstant;
import com.epmet.dto.form.work.AactUserDetailFormDTO;
import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.AuditUserFormDTO;
@ -130,6 +132,7 @@ public class WorkActUserController {
**/
@PostMapping("auditpass")
public Result auditPass(@RequestBody AuditUserFormDTO formDTO){
formDTO.setType(ActConstant.ACT_USER_STATUS_PASSED);
ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.AddUserInternalGroup.class);
workActUserService.auditPass(formDTO.getActUserRelationId());
return new Result();
@ -144,6 +147,7 @@ public class WorkActUserController {
**/
@PostMapping("auditrefuse")
public Result auditrefuse(@RequestBody AuditUserFormDTO formDTO){
formDTO.setType(ActConstant.ACT_USER_STATUS_REFUSED);
ValidatorUtils.validateEntity(formDTO, AuditUserFormDTO.RefusedUserShowGroup.class);
workActUserService.auditRefuse(formDTO);
return new Result();
@ -174,4 +178,34 @@ public class WorkActUserController {
ValidatorUtils.validateEntity(formDTO, ActIdFormDTO.AddUserInternalGroup.class);
return new Result<List<CanceledUserResultDTO>>().ok(workActUserService.queryCanceledUserList(formDTO));
}
/**
* 数字社区查看人员列表报名审核查看人员活动结束发放积分页面人员列表
* @param formDTO
* @return
*/
@PostMapping("userlist")
public Result<PageData<ActUserResDTO>> queryUserList(@RequestBody ActIdFormDTO formDTO){
return new Result<PageData<ActUserResDTO>>().ok(workActUserService.queryUserList(formDTO.getActId()));
}
/**
* 批量审核通过拒绝调用原来的接口
* @param formDTOList
* @return
*/
@PostMapping("audit-user")
public Result auditUser(@RequestBody List<AuditUserFormDTO> formDTOList) {
ValidatorUtils.validateEntity(formDTOList);
for (AuditUserFormDTO formDTO : formDTOList) {
if (ActConstant.ACT_USER_STATUS_REFUSED.equals(formDTO.getType())) {
workActUserService.auditRefuse(formDTO);
} else if (ActConstant.ACT_USER_STATUS_PASSED.equals(formDTO.getType())) {
workActUserService.auditPass(formDTO.getActUserRelationId());
}
}
return new Result();
}
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java

@ -24,6 +24,7 @@ import com.epmet.dto.form.resi.ResiActDetailFormDTO;
import com.epmet.dto.form.resi.ResiLatestActFormDTO;
import com.epmet.dto.form.resi.ResiMyActFormDTO;
import com.epmet.dto.form.work.ActListCommonFormDTO;
import com.epmet.dto.form.work.ActPageFormDTO;
import com.epmet.dto.result.resi.*;
import com.epmet.dto.result.work.*;
import com.epmet.entity.ActInfoEntity;
@ -319,4 +320,11 @@ public interface ActInfoDao extends BaseDao<ActInfoEntity> {
* @return java.util.List<com.epmet.dto.ActInfoDTO>
*/
List<ActInfoDTO> selectPublishedAct(@Param("staffId") String staffId);
/**
* 数字社区-爱心互助活动列表查询当前客户下的所有活动限制活动类型是爱心活动
* @param formDTO
* @return
*/
List<ActPageResDTO> pageList(ActPageFormDTO formDTO);
}

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

@ -48,7 +48,7 @@ public class ActContentEntity extends BaseEpmetEntity {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
private String contentType;

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/ActInfoEntity.java

@ -171,6 +171,11 @@ public class ActInfoEntity extends BaseEpmetEntity {
*/
private String sponsorId;
/**
* 主办方全路径包含自身id
*/
private String sponsorPath;
/**
* 活动主办方名称机关或网格的名称
*/
@ -216,6 +221,11 @@ public class ActInfoEntity extends BaseEpmetEntity {
*/
private Boolean summaryFlag;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
/**
* 活动类型爱心活动heart 联建活动party
*/

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

@ -48,7 +48,7 @@ public class ActSummaryEntity extends BaseEpmetEntity {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
private String contentType;

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

@ -48,7 +48,7 @@ public class LatestActContentEntity extends BaseEpmetEntity {
private String content;
/**
* 内容类型 图片img文字text
* 内容类型 图片img文字text;富文本rich_text
*/
private String contentType;

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

@ -153,6 +153,11 @@ public class LatestActInfoEntity extends BaseEpmetEntity {
*/
private String sponsorId;
/**
* 主办方全路径包含自身id
*/
private String sponsorPath;
/**
* 活动主办方名称机关或网格的名称
*/
@ -177,6 +182,12 @@ public class LatestActInfoEntity extends BaseEpmetEntity {
* 审核开关1报名人员需要人工审核0不需要
*/
private Boolean auditSwitch;
/**
* true:富文本false: 原来小程序那种发布内容
*/
private Boolean richTextFlag;
/**
* 数据库新增ACT_INFO_ID字段act_info.id
*/

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

@ -1,5 +1,6 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.work.*;
@ -148,4 +149,25 @@ public interface WorkActService {
PublishActResultDTO rePublish(RePublishFormDTO rePublishFormDTO);
PublishActResultDTO rePublishV2(RePublishFormDTO rePublishFormDTO);
void testGrantPoint(TestGrantFormDTO formDTO);
/**
* 数字社区-爱心互助活动列表查询当前客户下的所有活动限制活动类型是爱心活动
* @param formDTO
* @return
*/
PageData<ActPageResDTO> pageList(ActPageFormDTO formDTO);
/**
* 数字社区查看活动详情
* @param actId
* @param userId
* @return
*/
ActDetailResultDTO queryActDetail(String actId, String userId);
/**
*
* @param formDTO
*/
void finish(FinishActFormDTO formDTO);
}

8
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/WorkActUserService.java

@ -1,5 +1,6 @@
package com.epmet.service;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.form.work.AactUserDetailFormDTO;
import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.AuditUserFormDTO;
@ -141,4 +142,11 @@ public interface WorkActUserService {
* @Date 2020/7/24 12:52
**/
Boolean getVolunteerFlag(String userId);
/**
* 数字社区查看人员列表报名审核查看人员活动结束发放积分页面人员列表
* @param actId
* @return
*/
PageData<ActUserResDTO> queryUserList(String actId);
}

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

@ -1,5 +1,6 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
@ -108,19 +109,14 @@ public class GrantPointsServiceImpl implements GrantPointsService {
@Transactional(rollbackFor = Exception.class)
public void agree(GrantPointsFormDTO formDTO) {
//是否是待处理
ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
if(null==actUserRelationDTO){
logger.warn("积分发放-给分act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId());
return;
}
//如果是已处理直接返回
if(ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())){
logger.info("积分发放-给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId());
ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
if (null == actUserRelationDTO || ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())) {
return;
}
//查取分值
ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId());
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) {
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())|| NumConstant.ZERO==actInfoDTO.getReward()) {
logger.warn("积分发放-给分act_info is null or act_info is finished");
return;
}
@ -152,20 +148,14 @@ public class GrantPointsServiceImpl implements GrantPointsService {
@Override
@Transactional(rollbackFor = Exception.class)
public void deny(GrantPointsFormDTO formDTO) {
//是否是待处理
ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
if(null==actUserRelationDTO){
logger.warn("积分发放-不给分act_user_relation is null,actUserRelationId="+formDTO.getActUserRelationId());
return;
}
//如果是已处理直接返回
if(ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())){
logger.info("积分发放-不给分act_user_relation already handled,actUserRelationId="+formDTO.getActUserRelationId());
ActUserRelationDTO actUserRelationDTO=actUserRelationService.get(formDTO.getActUserRelationId());
if (null == actUserRelationDTO || ActConstant.HANDLED.equals(actUserRelationDTO.getProcessFlag())) {
return;
}
//查取分值
ActInfoDTO actInfoDTO=actInfoService.get(actUserRelationDTO.getActId());
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())) {
if (null == actInfoDTO || ActConstant.ACT_STATUS_FINISHED.equals(actInfoDTO.getActStatus())|| NumConstant.ZERO==actInfoDTO.getReward()) {
logger.warn("积分发放-不给分act_info is null or act_info is finished");
return;
}

143
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
@ -27,6 +28,7 @@ import com.epmet.dto.*;
import com.epmet.dto.form.SystemMsgFormDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.resi.ResiActContentFormDTO;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.ActSponsorResultDTO;
import com.epmet.dto.result.demand.OptionDTO;
@ -35,6 +37,9 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -108,7 +113,8 @@ public class WorkActServiceImpl implements WorkActService {
private IcActivityUnitRelationService icActivityUnitRelationService;
@Resource
private IcActivityServiceRelationService icActivityServiceRelationService;
@Autowired
private ActPointLogService actPointLogService;
/**
* @author yinzuomei
@ -304,6 +310,10 @@ public class WorkActServiceImpl implements WorkActService {
* @Date 2020/7/21 19:20
**/
private void auditAct(PublishActInfoFormDTO formDTO) {
if(formDTO.getRichTextFlag()){
// true:富文本;false: 原来小程序那种发布内容
return;
}
//1、活动标题
if (StringUtils.isNotBlank(formDTO.getTitle())) {
this.auditActTitle(formDTO.getTitle());
@ -341,6 +351,9 @@ public class WorkActServiceImpl implements WorkActService {
* @Date 2020/7/27 14:01
**/
private void auditRePublishAct(RePublishFormDTO formDTO) {
if(formDTO.getRichTextFlag()){
return;
}
//1、活动标题
if (StringUtils.isNotBlank(formDTO.getTitle())) {
this.auditActTitle(formDTO.getTitle());
@ -1346,7 +1359,11 @@ public class WorkActServiceImpl implements WorkActService {
imgList.add(actContent.getContent());
}
}
this.auditActContent(textList,imgList);
//
if(!actInfoDTO.getRichTextFlag()){
//不是富文本的走审核
this.auditActContent(textList,imgList);
}
//插入act_summary记录
int orderNum=1;
for(PublishActContentFormDTO actContentFormDTO:formDTO.getActSummary()){
@ -1621,4 +1638,126 @@ public class WorkActServiceImpl implements WorkActService {
});
return content.get();
}
/**
* @param formDTO
* @return 数字社区-爱心互助活动列表查询当前客户下的所有活动限制活动类型是爱心活动
*/
@Override
public PageData<ActPageResDTO> pageList(ActPageFormDTO formDTO) {
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<ActPageResDTO> list = actInfoDao.pageList(formDTO);
if (CollectionUtils.isNotEmpty(list)) {
Date nowDate = new Date();
for (ActPageResDTO actPageResDTO : list) {
// 进行中的重新设置状态
if (ActConstant.ACT_STATUS_PUBLISHED.equals(actPageResDTO.getStatus())) {
// 活动状态:报名中:signing_up;截止报名: end_sign_up; 已开始: in_progress; 已报满: enough
if (!NumConstant.ONE_STR.equals(DateUtils.comparteDate(nowDate, actPageResDTO.getSignUpEndTime()))) {
logger.info(String.format("当前时间%s报名截止时间%s处于报名中",
DateUtils.format(nowDate, DateUtils.DATE_TIME_PATTERN),
DateUtils.format(actPageResDTO.getSignUpEndTime(), DateUtils.DATE_TIME_PATTERN)));
// 截止报名时间之前(包含报名时间截止时间点)
if (!actPageResDTO.getActQuotaCategory()) {
// 如果是不限制名额,则显示报名中
actPageResDTO.setStatus("signing_up");
logger.info("活动不限制名额,界面显示 报名中");
continue;
} else {
// 固定名额,且已报名人数<活动需要人数显示报名中
if (actPageResDTO.getActQuota() > actPageResDTO.getSignedUp()) {
logger.info("活动限制名额,未报满,界面显示报名中");
actPageResDTO.setStatus("signing_up");
continue;
} else if (actPageResDTO.getActQuota().equals(actPageResDTO.getSignedUp())) {
actPageResDTO.setStatus("enough");
logger.info("活动限制名额,且已报满,界面显示已报满");
continue;
}
}
} else if (NumConstant.ONE_STR.equals(DateUtils.comparteDate(nowDate, actPageResDTO.getSignUpEndTime()))
&& NumConstant.ONE_NEG_STR.equals(DateUtils.comparteDate(nowDate, actPageResDTO.getActStartTime()))) {
logger.info(String.format("当前时间%s报名截止时间%s活动预计开始时间%s界面显示截止报名",
DateUtils.format(nowDate, DateUtils.DATE_TIME_PATTERN),
DateUtils.format(actPageResDTO.getSignUpEndTime(), DateUtils.DATE_TIME_PATTERN),
DateUtils.format(actPageResDTO.getActStartTime(), DateUtils.DATE_TIME_PATTERN)));
// 活动报名截止-活动预计开始之间显示截止报名
actPageResDTO.setStatus("end_sign_up");
continue;
} else if (!NumConstant.ONE_NEG_STR.equals(DateUtils.comparteDate(nowDate, actPageResDTO.getActStartTime()))) {
logger.info(String.format("当前时间%s活动预计开始时间%s界面显示已开始",
DateUtils.format(nowDate, DateUtils.DATE_TIME_PATTERN),
DateUtils.format(actPageResDTO.getActStartTime(), DateUtils.DATE_TIME_PATTERN)));
// 活动预计开始时间点之后,包含活动预计开始时间点,显示 已开始
actPageResDTO.setStatus("in_progress");
continue;
}
}
}
}
PageInfo<ActPageResDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
/**
* 数字社区查看活动详情
*
* @param actId
* @param userId
* @return
*/
@Override
public ActDetailResultDTO queryActDetail(String actId, String userId) {
ActInfoEntity actInfoEntity=actInfoDao.selectById(actId);
ActDetailResultDTO resultDTO=ConvertUtils.sourceToTarget(actInfoEntity,ActDetailResultDTO.class);
resultDTO.setActId(actId);
//查询活动详情
List<ActPreviewContentResultDTO> list = actContentDao.selectByActId(actId);
resultDTO.setActContent(list);
//当前活动是否是我发布的
if(resultDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){
resultDTO.setIsMyPublish(true);
}else{
resultDTO.setIsMyPublish(false);
}
if(resultDTO.getSummaryFlag()){
ResiActContentFormDTO resiActContentFormDTO=new ResiActContentFormDTO();
resiActContentFormDTO.setActId(actId);
resultDTO.setSummaryContent(actSummaryDao.selectListSummary(resiActContentFormDTO));
}
return resultDTO;
}
/**
* @param formDTO
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void finish(FinishActFormDTO formDTO) {
// 1、保存活动实际开始、结束时间
saveActualTime(formDTO);
// 2、积分大于0的->发放积分
if (formDTO.getReward() > NumConstant.ZERO) {
for (GrantPointsFormDTO grantPointsFormDTO : formDTO.getUserList()) {
ActUserRelationDTO actUserRelationDTO = actUserRelationService.get(grantPointsFormDTO.getActUserRelationId());
// 更新act_user_relation改为已处理,给分
actUserRelationDTO.setProcessFlag(ActConstant.HANDLED);
actUserRelationDTO.setRewardFlag(grantPointsFormDTO.getGrantPoint() ? ActConstant.ACT_USER_STATUS_AGREE : ActConstant.ACT_USER_STATUS_DENY);
actUserRelationDTO.setDenyRewardReason(StrConstant.EPMETY_STR);
actUserRelationService.update(actUserRelationDTO);
// 增加一条act_point_log
ActPointLogDTO actPointLogDTO = new ActPointLogDTO();
actPointLogDTO.setActId(actUserRelationDTO.getActId());
actPointLogDTO.setUserId(actUserRelationDTO.getUserId());
actPointLogDTO.setPoints(formDTO.getReward());
actPointLogDTO.setOperateType(grantPointsFormDTO.getGrantPoint() ? ActConstant.ACT_USER_STATUS_AGREE : ActConstant.ACT_USER_STATUS_DENY);
actPointLogDTO.setRemark(grantPointsFormDTO.getGrantPoint() ? StrConstant.EPMETY_STR : grantPointsFormDTO.getDenyRewardReason());
actPointLogService.save(actPointLogDTO);
}
}
// 3、结束活动
finishAct(formDTO.getActId());
}
}

49
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java

@ -6,7 +6,9 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ActConstant;
import com.epmet.constant.ActMessageConstant;
@ -36,6 +38,7 @@ import com.epmet.service.ActInfoService;
import com.epmet.service.ActUserRelationService;
import com.epmet.service.HeartUserInfoService;
import com.epmet.service.WorkActUserService;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -46,6 +49,8 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 工作端活动人员相关api
@ -775,4 +780,48 @@ public class WorkActUserServiceImpl implements WorkActUserService {
}
return resultUserList.getData().get(0);
}
/**
* 数字社区查看人员列表报名审核查看人员活动结束发放积分页面人员列表
*
* @param actId
* @return
*/
@Override
public PageData<ActUserResDTO> queryUserList(String actId) {
List<ActUserResDTO> list = new ArrayList<>();
// 活动相关人员
List<ActUserRelationDTO> actUserRelationDTOList = actUserRelationService.getUserList(actId, StrConstant.EPMETY_STR);
if (null == actUserRelationDTOList || actUserRelationDTOList.size() == 0) {
return new PageData<>(list, NumConstant.ZERO);
}
// 查询人员id集合
Set<String> userIdList = actUserRelationDTOList.stream().map(ActUserRelationDTO::getUserId).collect(Collectors.toSet());
// 查询出用户基本信息
List<UserBaseInfoResultDTO> userInfoList = this.queryUserBaseInfoList(new ArrayList<>(userIdList));
for (ActUserRelationDTO actUserRelationDTO : actUserRelationDTOList) {
ActUserResDTO resultDTO = ConvertUtils.sourceToTarget(actUserRelationDTO,ActUserResDTO.class);
resultDTO.setActUserRelationId(actUserRelationDTO.getId());
resultDTO.setSignUpTime(actUserRelationDTO.getCreatedTime());
// true: 是志愿者 false : 不是志愿者
resultDTO.setVolunteerFlag(getVolunteerFlag(actUserRelationDTO.getUserId()));
// 赋值基本信息
for (UserBaseInfoResultDTO userBaseInfoResultDTO : userInfoList) {
if (actUserRelationDTO.getUserId().equals(userBaseInfoResultDTO.getUserId())) {
resultDTO.setRealName(StringUtils.isNotBlank(userBaseInfoResultDTO.getRealName()) ? userBaseInfoResultDTO.getRealName() : StrConstant.EPMETY_STR);
resultDTO.setNickName(StringUtils.isNotBlank(userBaseInfoResultDTO.getNickname()) ? userBaseInfoResultDTO.getNickname() : StrConstant.EPMETY_STR);
resultDTO.setMobile(StringUtils.isNotBlank(userBaseInfoResultDTO.getMobile()) ? userBaseInfoResultDTO.getMobile() : StrConstant.EPMETY_STR);
resultDTO.setIdNum(StringUtils.isNotBlank(userBaseInfoResultDTO.getIdNum()) ? userBaseInfoResultDTO.getIdNum() : StrConstant.EPMETY_STR);
break;
}
}
HistoricalActInfo historicalActInfo = this.getHistoricalActInfo(resultDTO.getUserId(), actId);
resultDTO.setSignInActNum(historicalActInfo.getSignInActNum());
resultDTO.setSignUpActNum(historicalActInfo.getSignUpActNum());
resultDTO.setObtainPointsActNum(historicalActInfo.getObtainPointsActNum());
list.add(resultDTO);
}
PageInfo<ActUserResDTO> pageInfo = new PageInfo<>(list);
return new PageData<>(list, pageInfo.getTotal());
}
}

12
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.22__act_addcol.sql

@ -0,0 +1,12 @@
alter table act_content MODIFY COLUMN CONTENT_TYPE varchar(32) NOT NULL COMMENT '内容类型 图片:img;文字:text;富文本:rich_text';
alter table act_content MODIFY COLUMN CONTENT LONGTEXT not null COMMENT '内容';
alter table act_info add COLUMN RICH_TEXT_FLAG TINYINT(1) not null DEFAULT '0' COMMENT '1:富文本;0:不是' AFTER SUMMARY_FLAG;
alter table latest_act_info add COLUMN RICH_TEXT_FLAG TINYINT(1) not null DEFAULT '0' COMMENT '1:富文本;0:不是' AFTER AUDIT_SWITCH;
alter table latest_act_content MODIFY COLUMN CONTENT_TYPE varchar(32) NOT NULL COMMENT '内容类型 图片:img;文字:text;富文本:rich_text';
alter table latest_act_content MODIFY COLUMN CONTENT LONGTEXT not null COMMENT '内容';
alter table act_summary MODIFY COLUMN CONTENT LONGTEXT not null COMMENT '总结内容';
alter table act_summary MODIFY CONTENT_TYPE VARCHAR(32)not null COMMENT '内容类型 图片:img;文字:text;富文本:rich_text';
alter table act_info add COLUMN SPONSOR_PATH VARCHAR(512) comment '主办方全路径包含自身id' AFTER SPONSOR_ID;
alter table latest_act_info add COLUMN SPONSOR_PATH VARCHAR(512) comment '主办方全路径包含自身id' AFTER SPONSOR_ID;

4
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.23__acttel.sql

@ -0,0 +1,4 @@
alter table act_info MODIFY COLUMN
`SPONSOR_TEL` varchar(64) NOT NULL COMMENT '联系电话' AFTER SPONSOR_CONTACTS;
alter table latest_act_info MODIFY COLUMN `SPONSOR_TEL` varchar(64)COMMENT '联系电话' AFTER SPONSOR_CONTACTS;

74
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml

@ -449,7 +449,8 @@
i.UNIT_ID AS unitId,
i.SERVICE_MATTER AS serviceMatter,
i.TARGET AS target,
i.act_type as actType
i.act_type as actType,
i.RICH_TEXT_FLAG as richTextFlag
FROM
act_info i
LEFT JOIN (SELECT count(1) signupNum, re.ACT_ID from act_user_relation re WHERE re.DEL_FLAG = '0' AND re.`STATUS` != 'refused' AND re.`STATUS` != 'canceled' GROUP BY re.ACT_ID) c ON c.ACT_ID = i.ID
@ -534,7 +535,8 @@
ai.SIGN_UP_END_TIME as signUpEndTime,
ai.SIGN_UP_START_TIME as signUpStartTime,
ai.ACT_ADDRESS as actAddress,
ai.act_type as actType
ai.act_type as actType,
ai.RICH_TEXT_FLAG as richTextFlag
FROM
act_info ai
WHERE
@ -556,7 +558,8 @@
ai.CANCEL_TIME AS cancelTime,
ai.CANCEL_REASON AS cancelReason,
ai.ACT_ADDRESS as actAddress,
ai.act_type as actType
ai.act_type as actType,
ai.RICH_TEXT_FLAG as richTextFlag
FROM
act_info ai
WHERE
@ -579,7 +582,8 @@
ai.ACTUAL_START_TIME as actualStartTime,
ai.ACTUAL_END_TIME as actualEndTime,
ai.ACT_ADDRESS as actAddress,
ai.act_type as actType
ai.act_type as actType,
ai.RICH_TEXT_FLAG as richTextFlag
FROM
act_info ai
WHERE
@ -669,7 +673,8 @@
ai.ACT_TYPE,
ai.UNIT_ID,
ai.SERVICE_MATTER,
ai.TARGET
ai.TARGET,
ai.RICH_TEXT_FLAG as richTextFlag
FROM
act_info ai
WHERE
@ -706,7 +711,8 @@
ai.ACT_TYPE,
ai.UNIT_ID,
ai.SERVICE_MATTER,
ai.TARGET
ai.TARGET,
ai.RICH_TEXT_FLAG as richTextFlag
FROM
act_info ai
WHERE
@ -749,7 +755,8 @@
ai.ACT_TYPE,
ai.UNIT_ID,
ai.SERVICE_MATTER,
ai.TARGET
ai.TARGET,
ai.RICH_TEXT_FLAG as richTextFlag
FROM
act_info ai
WHERE
@ -798,4 +805,57 @@
AND ACT_STATUS = 'published'
AND CREATED_BY = #{staffId}
</select>
<!-- 分页查询爱心活动-->
<select id="pageList" parameterType="com.epmet.dto.form.work.ActPageFormDTO" resultType="com.epmet.dto.result.work.ActPageResDTO">
SELECT
ai.id AS actId,
ai.TITLE AS title,
ai.ACT_ADDRESS as actAddress,
ai.ACT_START_TIME AS actStartTime,
ai.ACT_END_TIME AS actEndTime,
ai.SIGN_UP_END_TIME as signUpEndTime,
ai.SIGN_UP_START_TIME as signUpStartTime,
ai.ACT_STATUS as status,
ai.RICH_TEXT_FLAG as richTextFlag,
(
case when ai.CREATED_BY =#{userId} then 1
else 0
end
)as isMyPublish,
ai.ACT_QUOTA_CATEGORY AS actQuotaCategory,
ai.ACT_QUOTA AS actQuota,
(
SELECT
count( aur.id )
FROM
act_user_relation aur
WHERE
aur.ACT_ID = ai.ID
AND aur.DEL_FLAG = '0'
AND ( aur.`STATUS` = 'auditing' OR aur.`STATUS` = 'passed' )
) AS signedUp,
ai.SUMMARY_FLAG as summaryFlag,
ai.REWARD as reward,
ai.AUDIT_SWITCH as auditSwitch
FROM
act_info ai
WHERE
ai.DEL_FLAG = '0'
<if test='null != status and "" != status'>
AND ai.ACT_STATUS = #{status}
</if>
<if test='null != title and "" != title'>
AND ai.TITLE like concat('%',#{title},'%')
</if>
<if test='null != actStartTime and "" != actStartTime'>
AND DATE_FORMAT(ai.ACT_START_TIME,'%Y-%m-%d %H:%i') &gt;= #{actStartTime}
</if>
<if test='null != actEndTime and "" != actEndTime'>
AND DATE_FORMAT(ai.ACT_END_TIME,'%Y-%m-%d %H:%i') &lt;= #{actEndTime}
</if>
and ai.CUSTOMER_ID= #{customerId}
and ai.act_type = 'heart'
order by ai.CREATED_TIME desc
</select>
</mapper>

34
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -158,7 +158,7 @@ public class OssController {
*/
@PostMapping("compressuploadimg")
public Result<UploadImgResultDTO> compressUploadImg(@RequestParam("file") MultipartFile file) {
return ossService.compressUploadImg(file, null);
return ossService.compressUploadImg(file, null,200L);
}
@PostMapping("uploadwximg")
@ -254,15 +254,19 @@ public class OssController {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
}
Result<UploadImgResultDTO> result =null;
String originFileName = file.getOriginalFilename();
String format = "-" + originFileName.substring(originFileName.lastIndexOf(".") + NumConstant.ONE) + "-";
format = format.toLowerCase();
int compressSize = 2 * 1024 * 1024;
// 如果是图片,超过2M的压缩一下
if (ModuleConstant.PROJECT_FILE_IMAGE.contains(format) && file.getSize() > compressSize) {
// 单个图片10M
result= ossService.compressUploadImg(file, null, 2 * 1024);
} else {
// 校验文件大小,不超过2m
long maxSize = 2 * 1024 * 1024;
if (size > maxSize) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
result=ossService.uploadImg(file, null);
}
Result<UploadImgResultDTO> result = ossService.uploadImg(file, null);
if (result != null && result.success() ){
UploadImgResultDTO data = result.getData();
if ( data!= null && StringUtils.isNotBlank(data.getUrl())){
@ -350,7 +354,13 @@ public class OssController {
if (size > maxSize) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(), EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
// 如果是图片,超过2M的压缩一下
if (ModuleConstant.PROJECT_FILE_IMAGE.contains(format)) {//单个图片10M
int compressSize = 2 * 1024 * 1024;
if(file.getSize()>compressSize){
return ossService.compressUploadImg(file, null,2 * 1024);
}
}
return ossService.uploadVariedFile(file);
}
@ -410,7 +420,11 @@ public class OssController {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode()
, EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg());
}
//如果图片大于2M压缩一下
int compressSize = 2 * 1024 * 1024;
if(file.getSize()>compressSize){
return ossService.compressUploadImg(file, null,2 * 1024);
}
return ossService.uploadImgV2(file, PrivacyType.EXTERNAL, customerId);
}

2
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java

@ -31,7 +31,7 @@ public interface OssService extends BaseService<OssEntity> {
Result<UploadImgResultDTO> uploadImg(MultipartFile file, String privacy);
Result<UploadImgResultDTO> compressUploadImg(MultipartFile file, String privacy);
Result<UploadImgResultDTO> compressUploadImg(MultipartFile file, String privacy,long desFileSize);
Result<UploadImgResultDTO> extUpload(MultipartFile file, String fileName, String privacy);

4
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java

@ -101,7 +101,7 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
}
@Override
public Result<UploadImgResultDTO> compressUploadImg(MultipartFile file, String privacy) {
public Result<UploadImgResultDTO> compressUploadImg(MultipartFile file, String privacy,long desFileSize) {
if (file.isEmpty()) {
return new Result<UploadImgResultDTO>().error(ModuleErrorCode.UPLOAD_FILE_EMPTY);
}
@ -110,7 +110,7 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
String url = null;
String ossDomain = null;
try {
byte[] fileBytes = compressPicCycle(file.getBytes(),200L,0.3);
byte[] fileBytes = compressPicCycle(file.getBytes(),desFileSize,0.3);
AbstractCloudStorageService storageService = OssFactory.build();
url = storageService.uploadSuffix(fileBytes, extension, privacy);
ossDomain = storageService.getOssDomain(privacy);

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

@ -710,6 +710,9 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
boolean party = false;
//网格指导员角色
boolean gridParty = false;
//2022.7.5 pc端党建声音可选发布范围为当前组织及下级组织的网格,不在区分角色
party = true;
/*
for (CustomerStaffRoleListResultDTO role : RoleList) {
if (CustomerAgencyConstant.PARTY_PRINCIPALS.equals(role.getRoleKey())) {
party = true;
@ -720,7 +723,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
}
if (!party && !gridParty) {
return returnDTO;
}
}*/
//4:根据不同角色查询不同数据
CustomerAgencyEntity agencyEntity = baseDao.selectById(staffAgencyDTO.getAgencyId());

2
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleContentDTO.java

@ -55,7 +55,7 @@ public class ArticleContentDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text文件file
* 内容类型 图片img文字text文件file 富文本rich_text
*/
private String contentType;

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/ArticleDTO.java

@ -124,6 +124,11 @@ public class ArticleDTO implements Serializable {
*/
private String departmentId;
/**
* 1富文本0不是
*/
private String richTextFlag;
/**
* 删除标识 0.未删除 1.已删除
*/

2
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftContentDTO.java

@ -55,7 +55,7 @@ public class DraftContentDTO implements Serializable {
private String content;
/**
* 内容类型 图片img文字text文件file
* 内容类型 图片img文字text文件file 富文本rich_text
*/
private String contentType;

5
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/DraftDTO.java

@ -114,6 +114,11 @@ public class DraftDTO implements Serializable {
*/
private String departmentId;
/**
* 1富文本0不是
*/
private String richTextFlag;
/**
* 删除标识 0.未删除 1.已删除
*/

84
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddOrSaveDraftFormDTO.java

@ -0,0 +1,84 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Author zxc
* @DateTime 2022/6/30 13:41
* @DESC
*/
@Data
public class AddOrSaveDraftFormDTO implements Serializable {
public interface AddArticleForm{}
public interface AddDraftForm{}
/**
* 类型 发布文章article存草稿draft
*/
@NotBlank(message = "类型不能为空",groups = AddArticleForm.class)
private String type;
@NotBlank(message = "标题不能为空",groups = {AddArticleForm.class})
@Length(max = 50, message = "标题最长为50个字")
private String title;
/**
* 发布范围IDs
*/
private List<String> gridIdList;
/**
* 发布范围Names
*/
private String publishRangeDesc;
/**
* 文章标签
*/
private List<String> tagNameList;
@NotBlank(message = "发布单位不能为空",groups = AddArticleForm.class)
private String publisher;
@NotBlank(message = "发布单位名称不能为空",groups = AddArticleForm.class)
private String publisherName;
/**
* 发布单位类型 机关:agency部门department网格grid
*/
@NotBlank(message = "发布单位类型不能为空",groups = AddArticleForm.class)
private String publisherType;
@NotBlank(message = "发布时间不能为空",groups = AddArticleForm.class)
private String publishDate;
@NotBlank(message = "文章内容不能为空",groups = {AddArticleForm.class})
private String content;
/**
* 是否置顶 1是0否
*/
private Integer isTop = NumConstant.ZERO;
private String userId;
private String customerId;
/**
* 草稿ID
*/
private String draftId;
/**
* 封面图地址
*/
private String imgUrl;
}

60
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/ArticleListFormDTO.java

@ -0,0 +1,60 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/7/15 4:34 下午
* @DESC
*/
@Data
public class ArticleListFormDTO implements Serializable {
private static final long serialVersionUID = 6397877545890473794L;
/**
* 文章标题
*/
private String title;
/**
* 标签Id集合
*/
private List<String> tagIds;
/**
* 上下线状态上线published下线offline
*/
private String statusFlag;
/**
* 发布范围类型组织agency网格grid
*/
private String publishRangeType;
/**
* 发布范围Id==网格Id
*/
private String publishRangeId;
/**
* 开始日期 yyyy-MM-dd
*/
private String startDate;
/**
* 结束日期 yyyy-MM-dd
*/
private String endDate;
/**
* 页码
*/
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize = 20;
private Boolean isPage = true;
private String articleId;
private String customerId;
private String agencyId;
private String staffId;
}

23
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/DraftListFormDTO.java

@ -12,12 +12,31 @@ import java.io.Serializable;
@Data
public class DraftListFormDTO implements Serializable {
private static final long serialVersionUID = 7957826609741967502L;
/**
* 文章标题
*/
private String title;
/**
* 开始日期 yyyy-MM-dd
*/
private String startDate;
/**
* 结束日期 yyyy-MM-dd
*/
private String endDate;
/**
* 页码
*/
private Integer pageNo;
private Integer pageNo = 1;
/**
* 每页显示数量
*/
private Integer pageSize;
private Integer pageSize = 20;
private Boolean isPage = true;
private String draftId;
private String customerId;
private String agencyId;
private String staffId;
}

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

@ -25,4 +25,8 @@ public class PublishGridListFormDTO implements Serializable {
* token中人员Id
*/
private String staffId;
/**
* token中客户ID
*/
private String customerId;
}

128
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/DraftPcListResultDTO.java

@ -0,0 +1,128 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @author sun
*/
@NoArgsConstructor
@Data
public class DraftPcListResultDTO implements Serializable {
private static final long serialVersionUID = -8525181219822398750L;
/**
* 文章草稿ID
*/
private String draftId;
/**
* 组织Id
*/
private String agencyId;
/**
* 文章标题
*/
private String title;
/**
* 是否置顶 1是0否
*/
private String isTop;
/**
* 是否置顶 1是0否
*/
private String isTopName;
/**
* 发布单位ID
*/
private String publisher;
/**
* 发布单位
*/
private String publisherName;
/**
* 发布单位类型 机关:agency部门department网格grid
*/
private String publisherType;
/**
* 发布时间
*/
private String publishDate;
/**
* 创建时间
*/
private String createdTime;
/**
* 文章标签串
*/
@JsonIgnore
private String tags;
/**
* 文章标签名列表
*/
private List<String> tagNameList;
/**
* 文章标签Id列表
*/
private List<String> tagIdList;
/**
* 概要内容
*/
private String previewContent;
/**
* 上下线状态上线published下线offline
*/
private String statusFlag;
/**
* 是不是我发布
*/
private Boolean isMePublished;
/**
* 发布范围
*/
private String publishRangeDesc;
/**
* 1是否富文本类型富文本0不是
*/
private String richTextFlag;
/**
* 文章创建人
*/
private String createdBy;
/**
* 封面图片url
*/
private String imgUrl;
/**
* 发布范围网格Id集合
*/
private List<String> gridIdList;
/**
* 文章内容
*/
private List<Content> contentList;
@Data
public static class Content {
/**
* 内容
*/
private String content;
/**
* 内容类型 图片img文字text文件file视频video富文本rich_text
*/
private String contentType;
/**
* 文件名称
*/
private String fileName;
/**
* 内容顺序 从1开始
*/
private Integer orderNum;
}
}

82
epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/result/PublishedListResultDTO.java

@ -21,14 +21,34 @@ public class PublishedListResultDTO implements Serializable {
* 文章ID
*/
private String articleId;
/**
* 组织Id
*/
private String agencyId;
/**
* 文章标题
*/
private String title;
/**
* 是否置顶 1是0否
*/
private String isTop;
/**
* 是否置顶 1是0否
*/
private String isTopName;
/**
* 发布单位ID
*/
private String publisher;
/**
* 发布单位
*/
private String publisherName;
/**
* 发布单位类型 机关:agency部门department网格grid
*/
private String publisherType;
/**
* 发布时间
*/
@ -39,11 +59,71 @@ public class PublishedListResultDTO implements Serializable {
@JsonIgnore
private String tags;
/**
* 文章标签列表
* 文章标签列表
*/
private List<String> tagNameList;
/**
* 文章标签Id列表
*/
private List<String> tagIdList;
/**
* 概要内容
*/
private String previewContent;
/**
* 上下线状态上线published下线offline
*/
private String statusFlag;
/**
* 上下线状态已发布published已下线offline
*/
private String statusFlagName;
/**
* 是不是我发布
*/
private Boolean isMePublished;
/**
* 发布范围
*/
private String publishRangeDesc;
/**
* 1是否富文本类型富文本0不是
*/
private String richTextFlag;
/**
* 文章创建人
*/
private String createdBy;
/**
* 封面图片url
*/
private String imgUrl;
/**
* 发布范围网格Id集合
*/
private List<String> gridIdList;
/**
* 文章内容
*/
private List<Content> contentList;
@Data
public static class Content {
/**
* 内容
*/
private String content;
/**
* 内容类型 图片img文字text文件file视频video富文本rich_text
*/
private String contentType;
/**
* 文件名称
*/
private String fileName;
/**
* 内容顺序 从1开始
*/
private Integer orderNum;
}
}

10
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/constant/ArticleConstant.java

@ -19,6 +19,8 @@ public interface ArticleConstant {
* 发布状态-已发布
*/
String PUBLISHED = "published";
String PUBLISH = "publish";
String PUBLISH_CONTENT = "发布文章";
/**
* 发布状态-已下线
*/
@ -66,4 +68,12 @@ public interface ArticleConstant {
* 发布方式 api审核后自动发布
*/
String PUBLISH_WAY_AUTO_AUDIT = "autoAudit";
/**
* 未审核
*/
String AUDIT_WAY_NO_AUDIT = "noAudit";
String SAVE_TYPE_ARTICLE = "article";
String SAVE_TYPE_DRAFT = "draft";
}

54
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java

@ -21,11 +21,15 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
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.scan.result.SyncScanResult;
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.commons.tools.validator.group.DefaultGroup;
import com.epmet.constant.ArticleConstant;
import com.epmet.constant.DraftConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -33,6 +37,7 @@ import com.epmet.service.ArticleOperateRecordService;
import com.epmet.service.ArticleService;
import com.epmet.service.DraftService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.PostMapping;
@ -177,7 +182,7 @@ public class ArticleController {
* @Description 党建声音-政府端-下线文章
**/
@PostMapping("offlinearticle")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE)
//@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OFFLINE)
public Result offLineArticle(@LoginUser TokenDto tokenDTO, @RequestBody OffLineArticleFormDTO formDTO) {
formDTO.setStaffId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO, OffLineArticleFormDTO.AddUserInternalGroup.class);
@ -346,6 +351,7 @@ public class ArticleController {
**/
@PostMapping("publishgridlist")
public Result<ArticleAgencyGridListResultDTO> publishGridList(@LoginUser TokenDto tokenDTO, @RequestBody PublishGridListFormDTO formDTO) {
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setStaffId(tokenDTO.getUserId());
ValidatorUtils.validateEntity(formDTO, PublishGridListFormDTO.AddUserInternalGroup.class);
ArticleAgencyGridListResultDTO agencyGridList = new ArticleAgencyGridListResultDTO();
@ -405,4 +411,50 @@ public class ArticleController {
return new Result<List<SubjectListResultDTO>>().ok(articleService.subjectList(formDTO));
}
/**
* @param tokenDTO
* @return
* @Author sun
* @Description 数字平台-党建声音-文章列表
**/
@PostMapping("articleListV2")
public Result<PageData<PublishedListResultDTO>> articleListV2(@LoginUser TokenDto tokenDTO, @RequestBody ArticleListFormDTO formDTO) {
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setStaffId(tokenDTO.getUserId());
return new Result<PageData<PublishedListResultDTO>>().ok(articleService.articleListV2(formDTO));
}
/**
* @param tokenDTO
* @return
* @Author sun
* @Description 数字平台-党建声音-文章详情
**/
@PostMapping("detailV2")
public Result<PublishedListResultDTO> detailV2(@LoginUser TokenDto tokenDTO, @RequestBody ArticleListFormDTO formDTO) {
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setStaffId(tokenDTO.getUserId());
return new Result<PublishedListResultDTO>().ok(articleService.detailV2(formDTO));
}
/**
* Desc: 发布文章/存草稿
* @param formDTO
* @author zxc
* @date 2022/6/30 14:03
*/
@PostMapping("addOrSaveDraft")
public Result addOrSaveDraft(@LoginUser TokenDto tokenDto,@RequestBody AddOrSaveDraftFormDTO formDTO){
if (formDTO.getType().equals(ArticleConstant.SAVE_TYPE_ARTICLE)){
ValidatorUtils.validateEntity(formDTO, AddOrSaveDraftFormDTO.AddArticleForm.class);
}else {
if (StringUtils.isBlank(formDTO.getTitle()) && StringUtils.isBlank(formDTO.getContent())){
throw new EpmetException(EpmetErrorCode.TITLE_AND_CONTENT_ERROR.getCode());
}
}
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
articleService.addOrSaveDraft(formDTO);
return new Result();
}
}

35
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/DraftController.java

@ -20,15 +20,15 @@ package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
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.DeleteDraftFormDTO;
import com.epmet.dto.form.DraftDetailFormDTO;
import com.epmet.dto.form.DraftListFormDTO;
import com.epmet.dto.form.GovArticleDetailFormDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.DraftDetailResultDTO;
import com.epmet.dto.result.DraftListResultDTO;
import com.epmet.dto.result.DraftPcListResultDTO;
import com.epmet.dto.result.PublishedListResultDTO;
import com.epmet.service.DraftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -86,4 +86,31 @@ public class DraftController {
DraftDetailResultDTO draftDetailResultDTO = draftService.queryDraftDetail(formDTO);
return new Result<DraftDetailResultDTO>().ok(draftDetailResultDTO);
}
/**
* @param tokenDTO
* @return
* @Author sun
* @Description 数字平台-党建声音-草稿列表
**/
@PostMapping("draftListV2")
public Result<PageData<DraftPcListResultDTO>> draftListV2(@LoginUser TokenDto tokenDTO, @RequestBody DraftListFormDTO formDTO) {
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setStaffId(tokenDTO.getUserId());
return new Result<PageData<DraftPcListResultDTO>>().ok(draftService.draftListV2(formDTO));
}
/**
* @param tokenDTO
* @return
* @Author sun
* @Description 数字平台-党建声音-草稿详情
**/
@PostMapping("detailV2")
public Result<DraftPcListResultDTO> detailV2(@LoginUser TokenDto tokenDTO, @RequestBody DraftListFormDTO formDTO) {
formDTO.setCustomerId(tokenDTO.getCustomerId());
formDTO.setStaffId(tokenDTO.getUserId());
return new Result<DraftPcListResultDTO>().ok(draftService.detailV2(formDTO));
}
}

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

@ -16,6 +16,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.annotation.DataFilter;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.ArticleListFormDTO;
import com.epmet.dto.form.ResiTagListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.ArticleEntity;
@ -160,4 +161,6 @@ public interface ArticleDao extends BaseDao<ArticleEntity> {
* @date 2021/7/16 10:29 上午
*/
List<SubjectListResultDTO> subjectList(@Param("pidList")List<String> pidList);
List<PublishedListResultDTO> selectAllArticle(ArticleListFormDTO formDTO);
}

3
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/DraftDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.DraftListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.DraftEntity;
import org.apache.ibatis.annotations.Mapper;
@ -112,4 +113,6 @@ public interface DraftDao extends BaseDao<DraftEntity> {
* @return
*/
int updateAuditStatusById(@Param("draftId") String draftId, @Param("statusFlag") String statusFlag, @Param("titleAuditStatus") String titleAuditStatus);
List<DraftPcListResultDTO> selectAllDraft(DraftListFormDTO formDTO);
}

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleContentEntity.java

@ -51,7 +51,7 @@ public class ArticleContentEntity extends BaseEpmetEntity {
private String content;
/**
* 内容类型 图片img文字text文件file
* 内容类型 图片img文字text文件file 富文本rich_text
*/
private String contentType;

4
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/ArticleEntity.java

@ -131,5 +131,9 @@ public class ArticleEntity extends BaseEpmetEntity {
* 部门ID 数据权限使用
*/
private String departmentId;
/**
* 1富文本0不是
*/
private String richTextFlag;
}

2
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftContentEntity.java

@ -51,7 +51,7 @@ public class DraftContentEntity extends BaseEpmetEntity {
private String content;
/**
* 内容类型 图片img文字text文件file
* 内容类型 图片img文字text文件file 富文本rich_text
*/
private String contentType;

5
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/entity/DraftEntity.java

@ -117,4 +117,9 @@ public class DraftEntity extends BaseEpmetEntity {
*/
private String departmentId;
/**
* 1富文本0不是
*/
private String richTextFlag;
}

12
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/ArticleService.java

@ -243,4 +243,16 @@ public interface ArticleService extends BaseService<ArticleEntity> {
* @return java.util.List<com.epmet.dto.result.ArticleListResultDTO>
*/
List<ArticleListResultDTO> getArticleListByTag(String tagId, Integer pageNo, Integer pageSize);
/**
* Desc: 发布文章/存草稿
* @param formDTO
* @author zxc
* @date 2022/6/30 14:03
*/
void addOrSaveDraft(AddOrSaveDraftFormDTO formDTO);
PageData<PublishedListResultDTO> articleListV2(ArticleListFormDTO formDTO);
PublishedListResultDTO detailV2(ArticleListFormDTO formDTO);
}

5
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/DraftService.java

@ -27,6 +27,7 @@ import com.epmet.dto.form.DraftListFormDTO;
import com.epmet.dto.result.DraftAttrResultDTO;
import com.epmet.dto.result.DraftContentResultDTO;
import com.epmet.dto.result.DraftDetailResultDTO;
import com.epmet.dto.result.DraftPcListResultDTO;
import com.epmet.entity.DraftEntity;
import java.util.List;
@ -148,4 +149,8 @@ public interface DraftService extends BaseService<DraftEntity> {
* @date 2020-06-03
*/
DraftDetailResultDTO queryDraftDetail(DraftDetailFormDTO formDTO);
PageData<DraftPcListResultDTO> draftListV2(DraftListFormDTO formDTO);
DraftPcListResultDTO detailV2(DraftListFormDTO formDTO);
}

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

@ -18,15 +18,22 @@
package com.epmet.service.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.AppClientConstant;
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.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.scan.param.ImgScanParamDTO;
import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
@ -41,10 +48,7 @@ import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.*;
import com.epmet.dao.*;
import com.epmet.dto.ArticleVisitRecordDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.DraftCoverDTO;
import com.epmet.dto.DraftDTO;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
@ -70,6 +74,8 @@ import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@ -122,6 +128,10 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
private ArticleTagsDao articleTagsDao;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private ArticleTagsService articleTagsService;
@Autowired
private DraftPublishRangeService draftPublishRangeService;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@ -489,9 +499,11 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
if (null == articleEntity) {
throw new RenException(ArticleConstant.SELECT_ARTICLE_EXCEPTION);
}
/*
//2022.7.4 pc端下线文章不再限制自己下自己的
if (!formDTO.getStaffId().equals(articleEntity.getCreatedBy())) {
throw new RenException(ArticleConstant.SHIRO_EXCEPTION);
}
}*/
//1:根据文章Id查询全部(已发布、已下线)发布范围数据
ArticlePublishRangeEntity rangeEntity = new ArticlePublishRangeEntity();
@ -724,12 +736,17 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
return new ArticleGridResultDTO();
}
//2:查询当前工作人员的所属组织,以此作为根节点的起始位置
LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO();
/*LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO();
loginUserDetailsFormDTO.setApp("gov");
loginUserDetailsFormDTO.setClient("wxmp");
loginUserDetailsFormDTO.setUserId(formDTO.getStaffId());
Result<LoginUserDetailsResultDTO> resultDTOResult = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO);
String agencyId = resultDTOResult.getData().getOrgIdPath().substring(resultDTOResult.getData().getOrgIdPath().lastIndexOf(":") + NumConstant.ONE);
String agencyId = resultDTOResult.getData().getOrgIdPath().substring(resultDTOResult.getData().getOrgIdPath().lastIndexOf(":") + NumConstant.ONE);*/
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo) {
throw new EpmetException("获取工作人员信息失败");
}
String agencyId = staffInfo.getAgencyId();
//存放树的每一个节点对象,用于将同一节点下的网格列表合并(主键:agencyId 值:节点对象)
Map<String, ArticleGridResultDTO> map = new HashMap<>();
//3:循环可下线网格列表,根据pids组织每一个树节点对象信息
@ -1258,9 +1275,18 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
public UpdateCustomerTagCacheDTO updateCustomerTag(TokenDto tokenDto, String draftId) {
//获取草稿基本信息
DraftDTO draft = draftService.get(draftId);
String tags = draft.getTags();
String customerId = draft.getCustomerId();
String userId = tokenDto.getUserId();
return updateCustomerTagV2(tokenDto.getUserId(), draft.getCustomerId(), draft.getTags());
}
/**
* Desc:
* @param userId
* @param customerId
* @param tags eg: aa|bb|cc
* @author zxc
* @date 2022/6/30 16:14
*/
public UpdateCustomerTagCacheDTO updateCustomerTagV2(String userId,String customerId,String tags){
UpdateCustomerTagCacheDTO result = null;
if (StringUtils.isNotBlank(tags)) {
result = new UpdateCustomerTagCacheDTO();
@ -1274,8 +1300,6 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
result.setCustomerId(customerId);
result.setTagsInfo(tagsInfo);
}
return result;
}
@ -1285,6 +1309,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
* @author zxc
*/
public void updateCacheCustomerTag(UpdateCustomerTagCacheDTO formDto) {
if (null == formDto){
return;
}
List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo();
String customerId = formDto.getCustomerId();
//更新缓存标签使用数量
@ -1314,13 +1341,20 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
//获取草稿基本信息
DraftDTO draft = draftService.get(draftId);
String customerId = draft.getCustomerId();
List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo();
String userId = tokenDto.getUserId();
//根据草稿id查询发布范围id集合
List<String> gridIds = draftPublishRangeDao.selectGridIdByDraftId(draftId);
if (gridIds.size() == NumConstant.ZERO) {
throw new RenException(TagConstant.SELECT_GRIDIDLIST_FAILURE);
}
return updateGridTagV2(formDto,customerId,gridIds,userId);
}
public List<UpdateGridTagCacheDTO> updateGridTagV2(UpdateCustomerTagCacheDTO formDto,String customerId,List<String> gridIds,String userId){
if ( null == formDto || CollectionUtils.isEmpty(formDto.getTagsInfo()) || CollectionUtils.isEmpty(gridIds)){
return new ArrayList<>();
}
List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo();
List<UpdateGridTagsFormDTO> gridTags = new ArrayList<>();
List<UpdateGridTagCacheDTO> gridTagCache = new ArrayList<>();
gridIds.forEach(gridId -> {
@ -1348,6 +1382,9 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
* @author zxc
*/
public void updateCacheGridTag(List<UpdateGridTagCacheDTO> gridTagCache) {
if (CollectionUtils.isEmpty(gridTagCache)){
return;
}
//更新 网格下 标签使用数量
List<UpdateTagUseCountsResultDTO> gridTagCacheCopy = new ArrayList<>();
gridTagCache.forEach(cacheDTO -> {
@ -1376,23 +1413,26 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
* @author zxc
*/
public void addArticleTags(UpdateCustomerTagCacheDTO formDto, String draftId, TokenDto tokenDto, Date createdTime) {
List<AddArticleTagsFormDTO> addArticleTags = new ArrayList<>();
List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo();
DraftDTO draft = draftService.get(draftId);
String customerId = draft.getCustomerId();
String userId = tokenDto.getUserId();
String articleId = articleDao.getArticleIdByDraftId(draftId);
addArticleTagsV2(formDto,customerId,articleId);
}
public void addArticleTagsV2(UpdateCustomerTagCacheDTO formDto,String customerId,String articleId){
List<ArticleTagsEntity> articleTags = new ArrayList<>();
if (null == formDto || CollectionUtils.isEmpty(formDto.getTagsInfo())){
return;
}
List<UpdateTagUseCountsResultDTO> tagsInfo = formDto.getTagsInfo();
tagsInfo.forEach(resultDTO -> {
AddArticleTagsFormDTO addArticleTag = new AddArticleTagsFormDTO();
addArticleTag.setCreatedBy(userId);
addArticleTag.setUpdatedBy(userId);
addArticleTag.setCustomerId(customerId);
addArticleTag.setArticleId(articleId);
BeanUtils.copyProperties(resultDTO, addArticleTag);
addArticleTag.setCreatedTime(createdTime);
addArticleTags.add(addArticleTag);
ArticleTagsEntity e = ConvertUtils.sourceToTarget(resultDTO, ArticleTagsEntity.class);
e.setCustomerId(customerId);
e.setArticleId(articleId);
articleTags.add(e);
});
articleTagsDao.addArticleTags(addArticleTags);
articleTagsService.insertBatch(articleTags);
}
/**
@ -1449,4 +1489,290 @@ public class ArticleServiceImpl extends BaseServiceImpl<ArticleDao, ArticleEntit
public List<ArticleListResultDTO> getArticleListByTag(String tagId, Integer pageNo, Integer pageSize) {
return baseDao.selectArticleListByTag(tagId, pageNo, pageSize);
}
/**
* Desc: 发布文章/存草稿
* @param formDTO
* @author zxc
* @date 2022/6/30 14:03
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void addOrSaveDraft(AddOrSaveDraftFormDTO formDTO) {
if (StringUtils.isNotBlank(formDTO.getDraftId())){
// 删除草稿,草稿内容,草稿发布范围,封面图
draftDao.deleteDraft(formDTO.getDraftId());
draftContentDao.deleteByDraftId(formDTO.getDraftId());
draftPublishRangeDao.deleteByDraftId(formDTO.getDraftId());
draftCoverDao.deleteByDraftId(formDTO.getDraftId());
}
String customerId = formDTO.getCustomerId();
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, formDTO.getUserId());
if (null == staffInfo){
throw new EpmetException("未查询到当前工作人员信息:"+formDTO.getUserId());
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
if (null == agencyInfo){
throw new EpmetException("未查询到组织信息:"+staffInfo.getAgencyId());
}
// 发文章
if (formDTO.getType().equals(ArticleConstant.SAVE_TYPE_ARTICLE)){
// 1.文章
ArticleEntity article = ConvertUtils.sourceToTarget(formDTO, ArticleEntity.class);
// 按照之前逻辑存成客户ID
article.setDepartmentId(customerId);
article.setStatusFlag(DraftConstant.PUBLISHED);
article.setPublishWay(ArticleConstant.PUBLISH_WAY_MANUAL);
if (formDTO.getPublisherType().equals(DraftConstant.GRID)){
article.setGridId(formDTO.getPublisher());
}
article.setPreviewContent(getPreviewContent(formDTO.getContent()).length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH ? getPreviewContent(formDTO.getContent()).substring(NumConstant.ZERO,DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) : getPreviewContent(formDTO.getContent()));
article.setPublishDate(DateUtils.stringToDate(formDTO.getPublishDate(),DateUtils.DATE_PATTERN));
article.setPublisherId(formDTO.getPublisher());
article.setTags(CollectionUtils.isEmpty(formDTO.getTagNameList()) ? "" : formDTO.getTagNameList().stream().collect(Collectors.joining("|")));
article.setOrgId(staffInfo.getAgencyId());
article.setOrgIdPath(StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR) ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId()));
article.setRichTextFlag(NumConstant.ONE_STR);
baseDao.insert(article);
// 2.内容
ArticleContentEntity articleContent = ConvertUtils.sourceToTarget(article, ArticleContentEntity.class);
articleContent.setCustomerId(customerId);
articleContent.setArticleId(article.getId());
articleContent.setContent(formDTO.getContent());
articleContent.setContentType("rich_text");
articleContent.setOrderNum(NumConstant.ZERO);
articleContentDao.insert(articleContent);
// 3.操作记录
ArticleOperateRecordEntity articleOperateRecord = new ArticleOperateRecordEntity();
articleOperateRecord.setCustomerId(customerId);
articleOperateRecord.setArticleId(article.getId());
articleOperateRecord.setGridIds(CollectionUtils.isEmpty(formDTO.getGridIdList()) ? "" : formDTO.getGridIdList().stream().collect(Collectors.joining(":")));
articleOperateRecord.setOpUser(staffInfo.getAgencyName().concat("-").concat(staffInfo.getRealName()));
articleOperateRecord.setContent(articleOperateRecord.getOpUser() + "发布文章【" +formDTO.getTitle() + "】");
articleOperateRecord.setOpType(ArticleConstant.PUBLISH);
articleOperateRecord.setOpTime(new Date());
articleOperateRecordService.insert(articleOperateRecord);
// 4.发布范围
if (!CollectionUtils.isEmpty(formDTO.getGridIdList())){
List<ArticlePublishRangeEntity> rangeList = new ArrayList<>();
formDTO.getGridIdList().forEach(g -> {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(g);
if (null == gridInfo){
throw new EpmetException("未查询到网格信息:"+g);
}
ArticlePublishRangeEntity articlePublishRange = ConvertUtils.sourceToTarget(gridInfo,ArticlePublishRangeEntity.class);
articlePublishRange.setCustomerId(customerId);
articlePublishRange.setArticleId(article.getId());
articlePublishRange.setGridId(g);
articlePublishRange.setAgencyGridName(gridInfo.getGridNamePath());
articlePublishRange.setAgencyId(gridInfo.getPid());
AgencyInfoCache info = CustomerOrgRedis.getAgencyInfo(gridInfo.getPid());
if (null == info){
throw new EpmetException("未查询到组织信息:"+gridInfo.getPid());
}
articlePublishRange.setPids(info.getPids());
articlePublishRange.setPublishStatus(ArticleConstant.PUBLISHED);
articlePublishRange.setId(null);
rangeList.add(articlePublishRange);
});
articlePublishRangeService.insertBatch(rangeList);
}
// 5.文章标签
UpdateCustomerTagCacheDTO updateCustomerTagCacheDTO = updateCustomerTagV2(formDTO.getUserId(), formDTO.getCustomerId(), StringUtils.isBlank(article.getTags()) ? "" : article.getTags());
if (null != updateCustomerTagCacheDTO){
addArticleTagsV2(updateCustomerTagCacheDTO,customerId,article.getId());
}
// 6.更新网格tag
List<UpdateGridTagCacheDTO> updateGridTagCacheDTOS = updateGridTagV2(updateCustomerTagCacheDTO, customerId, formDTO.getGridIdList(), formDTO.getUserId());
// 7.文章封面
if (StringUtils.isNotBlank(formDTO.getImgUrl())){
ArticleCoverEntity articleCover = new ArticleCoverEntity();
articleCover.setCustomerId(customerId);
articleCover.setArticleId(article.getId());
articleCover.setImgUrl(formDTO.getImgUrl());
articleCover.setAuditStatus("pass");
articleCoverDao.insert(articleCover);
}
// 8.更新redis
try {
this.updateCacheCustomerTag(updateCustomerTagCacheDTO);
this.updateCacheGridTag(updateGridTagCacheDTOS);
} catch (Exception e) {
log.error("scanAllPassPublishArticle update redis exception", e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg());
}
}else {// 存草稿
// 1.草稿
DraftEntity draft = ConvertUtils.sourceToTarget(formDTO, DraftEntity.class);
draft.setDepartmentId(customerId);
draft.setPreviewContent(StringUtils.isBlank(formDTO.getContent()) ? "" : getPreviewContent(formDTO.getContent()).length() > DraftConstant.PREVIEW_CONTENT_MAX_LENGTH ? getPreviewContent(formDTO.getContent()).substring(NumConstant.ZERO,DraftConstant.PREVIEW_CONTENT_MAX_LENGTH) : getPreviewContent(formDTO.getContent()));
draft.setPublisherId(StringUtils.isBlank(formDTO.getPublisher()) ? "" : formDTO.getPublisher());
draft.setPublishDate(StringUtils.isBlank(formDTO.getPublishDate()) ? null : DateUtils.stringToDate(formDTO.getPublishDate(),DateUtils.DATE_PATTERN));
draft.setTags(CollectionUtils.isEmpty(formDTO.getTagNameList()) ? "" : formDTO.getTagNameList().stream().collect(Collectors.joining("|")));
draft.setOrgId(staffInfo.getAgencyId());
draft.setOrgIdPath(StringUtils.isBlank(agencyInfo.getPids()) || agencyInfo.getPids().equals(NumConstant.ZERO_STR) ? agencyInfo.getId() : agencyInfo.getPids().concat(":").concat(agencyInfo.getId()));
if (formDTO.getPublisherType().equals(DraftConstant.GRID)){
draft.setGridId(formDTO.getPublisher());
}
draft.setStatusFlag(DraftConstant.UNPUBLISH);
draft.setRichTextFlag(NumConstant.ONE_STR);
draftDao.insert(draft);
// 2.内容
if (StringUtils.isNotBlank(formDTO.getContent())){
DraftContentEntity draftContent = ConvertUtils.sourceToTarget(draft, DraftContentEntity.class);
draftContent.setCustomerId(customerId);
draftContent.setDraftId(draft.getId());
draftContent.setContent(formDTO.getContent());
draftContent.setContentType("rich_text");
draftContent.setOrderNum(NumConstant.ZERO);
draftContentDao.insert(draftContent);
}
// 3.发布范围
if (!CollectionUtils.isEmpty(formDTO.getGridIdList())){
List<DraftPublishRangeEntity> rangeList = new ArrayList<>();
formDTO.getGridIdList().forEach(g -> {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(g);
if (null == gridInfo){
throw new EpmetException("未查询到网格信息:"+g);
}
DraftPublishRangeEntity draftPublishRange = ConvertUtils.sourceToTarget(gridInfo,DraftPublishRangeEntity.class);
draftPublishRange.setCustomerId(customerId);
draftPublishRange.setDraftId(draft.getId());
draftPublishRange.setGridId(g);
draftPublishRange.setAgencyGridName(gridInfo.getGridNamePath());
draftPublishRange.setAgencyId(gridInfo.getPid());
AgencyInfoCache info = CustomerOrgRedis.getAgencyInfo(gridInfo.getPid());
if (null == info){
throw new EpmetException("未查询到组织信息:"+gridInfo.getPid());
}
draftPublishRange.setPids(info.getPids());
draftPublishRange.setPublishStatus(DraftConstant.UNPUBLISH);
draftPublishRange.setId(null);
rangeList.add(draftPublishRange);
});
draftPublishRangeService.insertBatch(rangeList);
}
// 4.草稿封面
if (StringUtils.isNotBlank(formDTO.getImgUrl())){
DraftCoverEntity draftCover = new DraftCoverEntity();
draftCover.setCustomerId(customerId);
draftCover.setDraftId(draft.getId());
draftCover.setImgUrl(formDTO.getImgUrl());
draftCover.setAuditStatus("pass");
draftCoverDao.insert(draftCover);
}
}
}
/**
* Desc: 获取内容中的汉字
* @param content
* @author zxc
* @date 2022/7/1 10:32
*/
public String getPreviewContent(String content) {
// 定义script的正则表达式
String regEx_script = "<script[^>]*?>[\\s\\S]*?<\\/script>";
// 定义style的正则表达式
String regEx_style = "<style[^>]*?>[\\s\\S]*?<\\/style>";
// 定义HTML标签的正则表达式
String regEx_html = "<[^>]+>";
//定义空格回车换行符
String regEx_space = "\\s*|\t|\r|\n";
Pattern p_script = Pattern.compile(regEx_script, Pattern.CASE_INSENSITIVE);
Matcher m_script = p_script.matcher(content);
// 过滤script标签
content = m_script.replaceAll("");
Pattern p_style = Pattern.compile(regEx_style, Pattern.CASE_INSENSITIVE);
Matcher m_style = p_style.matcher(content);
// 过滤style标签
content = m_style.replaceAll("");
Pattern p_html = Pattern.compile(regEx_html, Pattern.CASE_INSENSITIVE);
Matcher m_html = p_html.matcher(content);
// 过滤html标签
content = m_html.replaceAll("");
Pattern p_space = Pattern.compile(regEx_space, Pattern.CASE_INSENSITIVE);
Matcher m_space = p_space.matcher(content);
// 过滤空格回车标签
content = m_space.replaceAll("");
//去空格
content = content.replaceAll("&nbsp;", "");
return content.trim();
}
@Override
public PageData<PublishedListResultDTO> articleListV2(ArticleListFormDTO formDTO) {
//1.获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo) {
throw new EpmetException("获取工作人员信息失败");
}
//查询当前组织及下级数据
formDTO.setAgencyId(staffInfo.getAgencyId());
//列表查询
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<PublishedListResultDTO> list = baseDao.selectAllArticle(formDTO);
PageInfo<PublishedListResultDTO> pageInfo = new PageInfo<>(list);
//封装数据
if (!CollectionUtils.isEmpty(list)) {
list.forEach(l->{
l.setTagNameList(StringUtils.isNotBlank(l.getTags())?Arrays.asList(l.getTags().split("[|]")):new ArrayList<>());
l.setIsMePublished(l.getCreatedBy().equals(formDTO.getStaffId())?true:false);
});
}
return new PageData<>(list, pageInfo.getTotal());
}
@Override
public PublishedListResultDTO detailV2(ArticleListFormDTO formDTO) {
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);
}
}
return resultDTO;
}
}

99
epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/DraftServiceImpl.java

@ -17,24 +17,26 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
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.constant.DraftConstant;
import com.epmet.dao.DraftCoverDao;
import com.epmet.dao.DraftDao;
import com.epmet.dao.*;
import com.epmet.dto.DraftDTO;
import com.epmet.dto.form.DeleteDraftFormDTO;
import com.epmet.dto.form.DraftDetailFormDTO;
import com.epmet.dto.form.DraftListFormDTO;
import com.epmet.dto.result.*;
import com.epmet.entity.DraftCoverEntity;
import com.epmet.entity.DraftEntity;
import com.epmet.entity.*;
import com.epmet.service.DraftService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -44,11 +46,13 @@ import org.slf4j.LoggerFactory;
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.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 草稿表
@ -62,6 +66,13 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
@Autowired
private DraftCoverDao draftCoverDao;
@Autowired
private DraftPublishRangeDao draftPublishRangeDao;
@Autowired
private DraftContentDao draftContentDao;
@Autowired
private TagCustomerDao tagCustomerDao;
@Override
public PageData<DraftDTO> page(Map<String, Object> params) {
IPage<DraftEntity> page = baseDao.selectPage(
@ -201,4 +212,84 @@ public class DraftServiceImpl extends BaseServiceImpl<DraftDao, DraftEntity> imp
return draftDetailResultDTO;
}
@Override
public PageData<DraftPcListResultDTO> draftListV2(DraftListFormDTO formDTO) {
//1.获取工作人员缓存信息
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if (null == staffInfo) {
throw new EpmetException("获取工作人员信息失败");
}
//查询当前组织及下级数据
formDTO.setAgencyId(staffInfo.getAgencyId());
//列表查询
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage());
List<DraftPcListResultDTO> list = baseDao.selectAllDraft(formDTO);
PageInfo<DraftPcListResultDTO> pageInfo = new PageInfo<>(list);
//封装数据
if (!CollectionUtils.isEmpty(list)) {
list.forEach(l->{
l.setTagNameList(StringUtils.isNotBlank(l.getTags())?Arrays.asList(l.getTags().split("[|]")):new ArrayList<>());
l.setIsMePublished(l.getCreatedBy().equals(formDTO.getStaffId())?true:false);
});
}
return new PageData<>(list, pageInfo.getTotal());
}
@Override
public DraftPcListResultDTO detailV2(DraftListFormDTO formDTO) {
DraftPcListResultDTO resultDTO = new DraftPcListResultDTO();
//1.查询文章主表信息
List<DraftPcListResultDTO> list = baseDao.selectAllDraft(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<DraftPublishRangeEntity> tWrapper = new LambdaQueryWrapper<>();
tWrapper.eq(DraftPublishRangeEntity::getDraftId, formDTO.getDraftId());
tWrapper.eq(DraftPublishRangeEntity::getDelFlag, NumConstant.ZERO_STR);
//【文章下线的查所有发布范围,文章没下线的只查还没下线的发布范围】
if("unpublish".equals(resultDTO.getStatusFlag())){
tWrapper.eq(DraftPublishRangeEntity::getPublishStatus, "unpublish");
}else {
tWrapper.eq(DraftPublishRangeEntity::getPublishStatus, "published");
}
List<DraftPublishRangeEntity> entityList = draftPublishRangeDao.selectList(tWrapper);
if (!CollectionUtils.isEmpty(entityList)) {
List<String> contentList = entityList.stream().map(DraftPublishRangeEntity::getGridId).collect(Collectors.toList());
resultDTO.setGridIdList(contentList);
}
//查询文章内容
LambdaQueryWrapper<DraftContentEntity> tWrapper1 = new LambdaQueryWrapper<>();
tWrapper1.eq(DraftContentEntity::getDraftId, formDTO.getDraftId());
tWrapper1.eq(DraftContentEntity::getDelFlag, NumConstant.ZERO_STR);
tWrapper1.orderByDesc(DraftContentEntity::getOrderNum);
List<DraftContentEntity> contentEntityList = draftContentDao.selectList(tWrapper1);
if (!CollectionUtils.isEmpty(contentEntityList)) {
List<DraftPcListResultDTO.Content> contentList = ConvertUtils.sourceToTarget(contentEntityList, DraftPcListResultDTO.Content.class);
resultDTO.setContentList(contentList);
}
//标签列表
if(!CollectionUtils.isEmpty(resultDTO.getTagNameList())){
LambdaQueryWrapper<TagCustomerEntity> tWrapper2 = new LambdaQueryWrapper<>();
tWrapper2.eq(TagCustomerEntity::getCustomerId, formDTO.getCustomerId());
tWrapper2.in(TagCustomerEntity::getTagName, resultDTO.getTagNameList());
tWrapper2.eq(TagCustomerEntity::getDelFlag, NumConstant.ZERO_STR);
List<TagCustomerEntity> tagEntityList = tagCustomerDao.selectList(tWrapper2);
if (!CollectionUtils.isEmpty(tagEntityList)) {
List<String> contentList = tagEntityList.stream().map(TagCustomerEntity::getId).collect(Collectors.toList());
resultDTO.setTagIdList(contentList);
}
}
}
return resultDTO;
}
}

6
epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.10__alert_new_article_and_draft.sql

@ -0,0 +1,6 @@
ALTER TABLE `draft` ADD COLUMN `RICH_TEXT_FLAG` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1:富文本;0:不是' AFTER `DEPARTMENT_ID`;
ALTER TABLE `draft_content` MODIFY COLUMN `CONTENT_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容类型 图片:img;文字:text;文件:file;\r\n富文本:rich_text' AFTER `CONTENT`;
ALTER TABLE `article` ADD COLUMN `RICH_TEXT_FLAG` tinyint(1) NOT NULL DEFAULT 0 COMMENT '1:富文本;0:不是' AFTER `DEPARTMENT_ID`;
ALTER TABLE `article_content`
MODIFY COLUMN `CONTENT` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容' AFTER `ARTICLE_ID`,
MODIFY COLUMN `CONTENT_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '内容类型 图片:img;文字:text;文件:file;视频:video;富文本:rich_text' AFTER `CONTENT`;

1
epmet-module/gov-voice/gov-voice-server/src/main/resources/db/migration/V0.0.11__alert_article_draft_id.sql

@ -0,0 +1 @@
ALTER TABLE `article` MODIFY COLUMN `DRAFT_ID` varchar(64) NULL COMMENT '草稿ID';

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

@ -25,8 +25,8 @@
<select id="queryGovArticleContent" parameterType="java.lang.String" resultType="com.epmet.dto.result.GovArticleContentDTO">
SELECT
ac.CONTENT_TYPE,
ac.CONTENT,
ac.FILE_NAME
IFNULL(ac.CONTENT,''),
IFNULL(ac.FILE_NAME,'')
FROM
article_content ac
WHERE
@ -298,9 +298,9 @@
art.PUBLISHER_NAME AS publishUnitDesc,
art.PUBLISH_DATE AS publishDate,
IFNULL(art.TAGS,'') AS tags,
content2.CONTENT,
IFNULL(content2.CONTENT,''),
content2.CONTENT_TYPE,
content2.FILE_NAME,
IFNULL(content2.FILE_NAME,''),
(SELECT COUNT(1) FROM ARTICLE_VISIT_RECORD WHERE DEL_FLAG = '0' AND ARTICLE_ID = #{articleId} AND GRID_ID = #{gridId}) AS visitRecordCount,
art.CUSTOMER_ID
FROM
@ -308,9 +308,9 @@
LEFT JOIN (
SELECT
content.ARTICLE_ID,
content.CONTENT,
IFNULL(content.CONTENT,''),
content.CONTENT_TYPE,
content.FILE_NAME,
IFNULL(content.FILE_NAME,''),
content.ORDER_NUM
FROM
ARTICLE_CONTENT content
@ -426,4 +426,82 @@
LIMIT #{pageNo}, #{pageSize}
</select>
<select id="selectAllArticle" resultType="com.epmet.dto.result.PublishedListResultDTO">
SELECT
a.id AS "articleId",
a.org_id AS "agencyId",
a.title AS "title",
IFNULL(a.preview_content, "") AS "previewContent",
a.publish_range_desc AS "publishRangeDesc",
a.publisher_id AS "publisher",
a.publisher_name AS "publisherName",
a.publisher_type AS "publisherType",
a.publish_date AS "publishDate",
IFNULL(a.tags, "") AS "tags",
a.status_flag AS "statusFlag",
IF (a.status_flag = 'published', '已发布', '已下线') "statusFlagName",
a.rich_text_flag AS "richTextFlag",
a.created_by AS "createdBy",
a.is_top AS "isTop",
IF (a.is_top = '0', '否', '是') "isTopName",
ac.img_url AS "imgUrl"
FROM
article a
LEFT JOIN article_cover ac ON a.id = ac.article_id AND ac.del_flag = '0'
WHERE
a.del_flag = '0'
<if test="articleId != null and articleId != '' ">
AND a.id = #{articleId}
</if>
<if test="customerId != null and customerId != '' ">
AND a.customer_id = #{customerId}
</if>
<if test="agencyId != null and agencyId != '' ">
AND a.org_id_path like concat('%',#{agencyId},'%')
</if>
<if test="title != null and title.trim() != ''">
AND a.title like concat('%', #{title}, '%')
</if>
<if test="statusFlag != null and statusFlag.trim() != ''">
AND a.status_flag = #{statusFlag}
</if>
<if test="startDate != null and startDate.trim() != ''">
AND a.publish_date >= #{startDate}
</if>
<if test="endDate != null and endDate.trim() != ''">
<![CDATA[AND a.publish_date <= #{endDate}]]>
</if>
<if test="publishRangeType != null and publishRangeType.trim() != '' and publishRangeId != null and publishRangeId.trim() != ''">
<choose>
<when test='publishRangeType == "agency"'>
AND EXISTS(
SELECT 1 FROM article_publish_range
WHERE del_flag = '0'
AND article_id = a.id
AND agency_id = #{publishRangeId}
)
</when>
<otherwise>
AND EXISTS(
SELECT 1 FROM article_publish_range
WHERE del_flag = '0'
AND article_id = a.id
AND grid_id = #{publishRangeId}
)
</otherwise>
</choose>
</if>
<if test="tagIds !=null and tagIds.size() > 0">
<foreach collection="tagIds" item="tagId" separator=" ">
AND EXISTS(
SELECT 1 FROM article_tags
WHERE del_flag = '0'
AND article_id = a.id
AND tag_id = #{tagId}
)
</foreach>
</if>
ORDER BY a.publish_date DESC, a.updated_time DESC
</select>
</mapper>

54
epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/DraftDao.xml

@ -26,9 +26,9 @@
<select id="selectDraftContentDetail" parameterType="java.lang.String" resultType="com.epmet.dto.result.DraftContentDetailDTO">
SELECT
dc.ID,
dc.CONTENT,
IFNULL(dc.CONTENT,''),
dc.CONTENT_TYPE,
dc.FILE_NAME,
IFNULL(dc.FILE_NAME,''),
dc.ORDER_NUM,
(case
when dc.AUDIT_STATUS is null then ""
@ -177,6 +177,56 @@
ORDER BY
dc.ORDER_NUM ASC
</select>
<select id="selectAllDraft" resultType="com.epmet.dto.result.DraftPcListResultDTO">
SELECT
a.id AS "draftId",
a.org_id AS "agencyId",
a.title AS "title",
IFNULL(a.preview_content, "") AS "previewContent",
a.publish_range_desc AS "publishRangeDesc",
a.publisher_id AS "publisher",
a.publisher_name AS "publisherName",
a.publisher_type AS "publisherType",
a.publish_date AS "publishDate",
IFNULL(a.tags, "") AS "tags",
a.status_flag AS "statusFlag",
a.rich_text_flag AS "richTextFlag",
a.created_by AS "createdBy",
a.is_top AS "isTop",
IF (a.is_top = '0', '否', '是') "isTopName",
date_format(a.created_time, '%Y-%m-%d') AS "createdTime",
ac.img_url AS "imgUrl"
FROM
draft a
LEFT JOIN draft_cover ac ON a.id = ac.draft_id AND ac.del_flag = '0'
WHERE
a.del_flag = '0'
AND (a.STATUS_FLAG = 'unpublish' OR a.STATUS_FLAG = 'auditfail')
<if test="draftId != null and draftId != '' ">
AND a.id = #{draftId}
</if>
<if test="customerId != null and customerId != '' ">
AND a.customer_id = #{customerId}
</if>
<if test="staffId != null and staffId != '' ">
AND a.created_by = #{staffId}
</if>
<if test="agencyId != null and agencyId != '' ">
AND a.org_id_path like concat('%',#{agencyId},'%')
</if>
<if test="title != null and title.trim() != ''">
AND a.title like concat('%', #{title}, '%')
</if>
<if test="startDate != null and startDate.trim() != ''">
AND date_format(a.created_time, '%Y-%m-%d') >= #{startDate}
</if>
<if test="endDate != null and endDate.trim() != ''">
<![CDATA[AND date_format(a.created_time, '%Y-%m-%d') <= #{endDate}]]>
</if>
ORDER BY a.created_time DESC, a.updated_time DESC
</select>
<update id="deleteDraft" parameterType="java.lang.String">
update draft set DEL_FLAG='1' where id=#{draftId}
</update>

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/EditInfoFormDTO.java

@ -37,11 +37,13 @@ public class EditInfoFormDTO implements Serializable {
*
*/
@NotBlank(message = "姓不能为空",groups = AddUserShowGroup.class)
@Length(max = 10,groups =AddUserShowGroup.class ,message = "姓不能超过10个字")
private String surname;
/**
*
*/
@NotBlank(message = "名不能为空",groups = AddUserShowGroup.class)
@Length(max = 10,groups =AddUserShowGroup.class ,message = "名不能超过10个字")
private String name;
//@NotBlank(message = "身份证号不能为空")

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java

@ -378,6 +378,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
userWechatDTO.setUpdatedTime(new Date());
userWechatDTO.setUpdatedBy(param.getUserId());
userWechatDao.updateByUserId(userWechatDTO);
//2.1、删除用户缓存信息
clearUserCache(Arrays.asList(param.getUserId()));
//3、查看是否已经注册居民
UserResiInfoDTO userResiInfoDTO = userResiInfoDao.selectByUserId(param.getUserId());
if (null == userResiInfoDTO) {
@ -399,8 +401,6 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl<UserBaseInfoDao, Us
return result;
}
}
//5、删除用户缓存信息
clearUserCache(Arrays.asList(param.getUserId()));
return new Result();
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java

@ -49,6 +49,7 @@ import com.epmet.entity.UserResiRegisterVisitEntity;
import com.epmet.entity.UserWechatEntity;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovIssueOpenFeignClient;
import com.epmet.redis.UserBaseInfoRedis;
import com.epmet.redis.UserResiInfoRedis;
import com.epmet.resi.group.dto.topic.form.SharableTopicAndInviteeFormDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
@ -96,7 +97,8 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
private ResiGroupOpenFeignClient resiGroupClient;
@Autowired
private GovIssueOpenFeignClient govIssueClient;
@Autowired
private UserBaseInfoRedis userBaseInfoRedis;
@Override
public PageData<UserResiInfoDTO> page(Map<String, Object> params) {
IPage<UserResiInfoEntity> page = baseDao.selectPage(
@ -420,6 +422,7 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl<UserResiInfoDao, Us
UserBaseInfoEntity baseInfo = ConvertUtils.sourceToTarget(formDTO, UserBaseInfoEntity.class);
baseInfo.setRealName(formDTO.getSurname() + formDTO.getName());
userBaseInfoService.insertOrUpdate(baseInfo);
userBaseInfoRedis.clearUserCache(Arrays.asList(formDTO.getUserId()));
}
/**

Loading…
Cancel
Save