Browse Source

内容审核功能优化

feature/screenDataPush
songyunpeng 5 years ago
parent
commit
2a457dfc74
  1. 9
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/CheckDataUtils.java
  2. 25
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/advice/service/impl/AdviceServiceImpl.java
  3. 22
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/service/impl/GroupBuyInfoServiceImpl.java
  4. 25
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java
  5. 20
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/sds/service/impl/SdsInfoServiceImpl.java
  6. 22
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java
  7. 24
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java
  8. 21
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  9. 8
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActApplyInfoController.java
  10. 20
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java
  11. 56
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java
  12. 24
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java
  13. 23
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicCommentServiceImpl.java
  14. 24
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java

9
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/CheckDataUtils.java

@ -2,6 +2,7 @@ package com.elink.esua.epdc.commons.tools.security.content;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.CheckContentFormDTO;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.CheckDataFromDTO;
@ -114,7 +115,7 @@ public class CheckDataUtils {
log.error("内容校验接口异常:" + e.getMessage());
return null;
}
log.info("审核返回数据:" + response.body());
log.info("审核返回数据:" + JSONUtil.parse(response));
JSONObject res = JSONObject.parseObject(response.body());
//审核成功
if (0 == Integer.valueOf(res.get("code").toString())) {
@ -168,7 +169,7 @@ public class CheckDataUtils {
e.printStackTrace();
log.error("内容校验接口异常:" + e.getMessage());
}
log.info("审核返回数据:" + response.body());
log.info("审核返回数据:" + JSONUtil.parse(response));
JSONObject res = JSONObject.parseObject(response.body());
//审核成功
if (0 == Integer.valueOf(res.get("code").toString())) {
@ -176,11 +177,11 @@ public class CheckDataUtils {
if (200 == result.getDetails().get(0).getCode()) {
return result;
} else {
log.error("内容审核返回信息错误:" + res);
log.error("图片审核返回信息错误:" + res);
return null;
}
} else {
log.error("内容审核返回信息错误:" + res);
log.error("图片审核返回信息错误:" + res);
return null;
}
}

25
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/advice/service/impl/AdviceServiceImpl.java

@ -45,6 +45,7 @@ import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient;
import com.elink.esua.epdc.modules.reportissue.service.CustomImgService;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -62,6 +63,7 @@ import java.util.Map;
* @since v1.0.0 2021-03-02
*/
@Service
@Slf4j
public class AdviceServiceImpl extends BaseServiceImpl<AdviceDao, AdviceEntity> implements AdviceService {
@Autowired
private CustomImgService customImgService;
@ -145,13 +147,19 @@ public class AdviceServiceImpl extends BaseServiceImpl<AdviceDao, AdviceEntity>
@Transactional(rollbackFor = Exception.class)
public Result saveAdvice(AdviceSubmitFormDTO formDto) {
//内容审核 - start
Boolean isConReview = formDto.getIsConReview();
List<String> textList = new ArrayList<>();
Boolean isConReview = null;
List<String> textList = null;
ParentAndAllDeptDTO deptDto = null;
CheckResultDTO contentResult = null;
CheckResultDTO imgResult = null;
try {
isConReview = formDto.getIsConReview();
textList = new ArrayList<>();
textList.add(formDto.getContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(formDto.getDeptId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
CheckResultDTO imgResult = CheckDataUtils.checkImgs(formDto.getImages());
deptDto = adminFeignClient.getParentAndAllDept(formDto.getDeptId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
imgResult = CheckDataUtils.checkImgs(formDto.getImages());
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){
//组装要保存的信息
@ -161,6 +169,9 @@ public class AdviceServiceImpl extends BaseServiceImpl<AdviceDao, AdviceEntity>
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
} catch (Exception e) {
log.error(e.getMessage());
}
//内容审核 - end
AdviceEntity entity = ConvertUtils.sourceToTarget(formDto, AdviceEntity.class);
if (insert(entity)) {
@ -169,6 +180,7 @@ public class AdviceServiceImpl extends BaseServiceImpl<AdviceDao, AdviceEntity>
}
//内容审核 - start
//接口异常,保存至待审核信息
try {
if((contentResult == null || imgResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(),
formDto.getNickname(), CheckDataUtils.cate_two, null,ModuleName.REPORT_ISSUE.getCode(), textList,
@ -192,6 +204,9 @@ public class AdviceServiceImpl extends BaseServiceImpl<AdviceDao, AdviceEntity>
contentSecurityFeign.insertRecords(record);
}
}
} catch (Exception e) {
log.error(e.getMessage());
}
//内容审核 - end

22
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/groupbuy/service/impl/GroupBuyInfoServiceImpl.java

@ -57,6 +57,7 @@ import com.elink.esua.epdc.modules.reportissue.dao.CustomImgDao;
import com.elink.esua.epdc.modules.reportissue.entity.CustomImgEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -71,6 +72,7 @@ import java.util.*;
* @since v1.0.0 2020-12-02
*/
@Service
@Slf4j
public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, GroupBuyInfoEntity> implements GroupBuyInfoService {
@Autowired
@ -209,12 +211,17 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr
}
//内容审核 - start
Boolean isConReview = formDTO.getIsConReview();
List<String> textList = new ArrayList<>();
Boolean isConReview = null;
List<String> textList = null;
ParentAndAllDeptDTO deptDto = null;
CheckResultDTO contentResult = null;
try {
isConReview = formDTO.getIsConReview();
textList = new ArrayList<>();
textList.add(formDTO.getGroupBuyContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(formDTO.getGridId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
deptDto = adminFeignClient.getParentAndAllDept(formDTO.getGridId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()))){
//组装要保存的信息
@ -224,6 +231,9 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
} catch (Exception e) {
log.error(e.getMessage());
}
//内容审核 - end
GroupBuyInfoEntity groupBuyInfoEntity = ConvertUtils.sourceToTarget(formDTO,GroupBuyInfoEntity.class);
@ -240,6 +250,7 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr
//内容审核 - start
//接口异常,保存至待审核信息
try {
if((contentResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDTO.getUserId(),
formDTO.getNickname(), CheckDataUtils.cate_two, null,ModuleName.GROUP_BUY_CONTENT.getCode(), textList,
@ -263,6 +274,9 @@ public class GroupBuyInfoServiceImpl extends BaseServiceImpl<GroupBuyInfoDao, Gr
contentSecurityFeign.insertRecords(record);
}
}
} catch (Exception e) {
log.error(e.getMessage());
}
//内容审核 - end
return new Result();
}

25
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java

@ -45,6 +45,7 @@ import com.elink.esua.epdc.modules.reportissue.service.CustomImgService;
import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -62,6 +63,7 @@ import java.util.Map;
* @since v1.0.0 2020-10-22
*/
@Service
@Slf4j
public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, ReportIssueEntity> implements ReportIssueService {
@Autowired
@ -147,13 +149,19 @@ public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, Repo
@Transactional(rollbackFor = Exception.class)
public Result saveReportIssue(ReportIssueSubmitFormDTO formDto) {
//内容审核 - start
Boolean isConReview = formDto.getIsConReview();
List<String> textList = new ArrayList<>();
Boolean isConReview = null;
List<String> textList = null;
ParentAndAllDeptDTO deptDto = null;
CheckResultDTO contentResult = null;
CheckResultDTO imgResult = null;
try {
isConReview = formDto.getIsConReview();
textList = new ArrayList<>();
textList.add(formDto.getContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(formDto.getDeptId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
CheckResultDTO imgResult = CheckDataUtils.checkImgs(formDto.getImages());
deptDto = adminFeignClient.getParentAndAllDept(formDto.getDeptId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
imgResult = CheckDataUtils.checkImgs(formDto.getImages());
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){
//组装要保存的信息
@ -163,6 +171,9 @@ public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, Repo
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
} catch (Exception e) {
log.error(e.getMessage());
}
//内容审核 - end
ReportIssueEntity entity = ConvertUtils.sourceToTarget(formDto, ReportIssueEntity.class);
if (insert(entity)) {
@ -171,6 +182,7 @@ public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, Repo
}
//内容审核 - start
//接口异常,保存至待审核信息
try {
if((contentResult == null || imgResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(),
formDto.getNickname(), CheckDataUtils.cate_two, null,ModuleName.REPORT_ISSUE.getCode(), textList,
@ -194,6 +206,9 @@ public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, Repo
contentSecurityFeign.insertRecords(record);
}
}
} catch (Exception e) {
log.error(e.getMessage());
}
//内容审核 - end

20
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/sds/service/impl/SdsInfoServiceImpl.java

@ -176,12 +176,17 @@ public class SdsInfoServiceImpl extends BaseServiceImpl<SdsInfoDao, SdsInfoEntit
@Transactional(rollbackFor = Exception.class)
public Result publishOrUpdate(EpdcAddSdsFormDTO formDTO) {
//内容审核 - start
Boolean isConReview = formDTO.getIsConReview();
List<String> textList = new ArrayList<>();
Boolean isConReview = null;
List<String> textList = null;
ParentAndAllDeptDTO deptDto = null;
CheckResultDTO contentResult = null;
try {
isConReview = formDTO.getIsConReview();
textList = new ArrayList<>();
textList.add(formDTO.getCarryContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(formDTO.getGridId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
deptDto = adminFeignClient.getParentAndAllDept(formDTO.getGridId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()))){
//组装要保存的信息
@ -191,6 +196,9 @@ public class SdsInfoServiceImpl extends BaseServiceImpl<SdsInfoDao, SdsInfoEntit
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
} catch (Exception e) {
log.error(e.getMessage());
}
//内容审核 - end
if(formDTO.getDepartureTime().before(new Date())){
return new Result().error("出发时间不能小于当前时间");
@ -204,6 +212,7 @@ public class SdsInfoServiceImpl extends BaseServiceImpl<SdsInfoDao, SdsInfoEntit
}
//内容审核 - start
try {
//接口异常,保存至待审核信息
if((contentResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDTO.getUserId(),
@ -228,6 +237,9 @@ public class SdsInfoServiceImpl extends BaseServiceImpl<SdsInfoDao, SdsInfoEntit
contentSecurityFeign.insertRecords(record);
}
}
} catch (Exception e) {
log.error(e.getMessage());
}
//内容审核 - end
return new Result();
}

22
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/comment/service/impl/EventCommentServiceImpl.java

@ -58,6 +58,7 @@ import com.elink.esua.epdc.modules.issue.service.IssueService;
import com.elink.esua.epdc.modules.item.entity.ItemEntity;
import com.elink.esua.epdc.modules.item.service.ItemService;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -163,17 +164,21 @@ public class EventCommentServiceImpl extends BaseServiceImpl<EventCommentDao, Ev
public Result submit(CommentFormDTO commentFormDTO) {
//内容审核 - start
Boolean isConReview = commentFormDTO.getIsConReview();
Boolean isConReview = null;
CheckResultDTO contentResult = null;
String mobile = null;
ParentAndAllDeptDTO deptDto = null;
List<String> textList = new ArrayList<>();
try {
isConReview = commentFormDTO.getIsConReview();
textList.add(commentFormDTO.getContent());
String mobile = null;
Result<UserDTO> user = userFeignClient.getUserInfoById(commentFormDTO.getUserId());
if(null != user.getData()){
mobile = user.getData().getMobile();
}
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(commentFormDTO.getDeptId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
deptDto = adminFeignClient.getParentAndAllDept(commentFormDTO.getDeptId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
if (!isConReview && (contentResult != null && !contentResult.getAllPass())) {
//组装要保存的信息
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(commentFormDTO.getUserId(),
@ -183,6 +188,10 @@ public class EventCommentServiceImpl extends BaseServiceImpl<EventCommentDao, Ev
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
}catch (Exception e){
logger.error(e.getMessage());
}
//内容审核 - end
@ -291,6 +300,7 @@ public class EventCommentServiceImpl extends BaseServiceImpl<EventCommentDao, Ev
newsTask.insertUserInformation(informationFormDTO);
//内容审核 - 开始
try {
//接口异常,保存至待审核信息
if(contentResult == null && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(commentFormDTO.getUserId(),
@ -315,6 +325,10 @@ public class EventCommentServiceImpl extends BaseServiceImpl<EventCommentDao, Ev
contentSecurityFeign.insertRecords(record);
}
}
}catch (Exception e){
logger.error(e.getMessage());
}
//内容审核 - 结束
return new Result();

24
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java

@ -76,6 +76,7 @@ import com.elink.esua.epdc.modules.item.service.ItemService;
import com.elink.esua.epdc.modules.rocketmq.dto.CategoryModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.modules.rocketmq.dto.RejectRecordDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -90,6 +91,7 @@ import java.util.*;
* @since v1.0.0 2019-09-04
*/
@Service
@Slf4j
public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEventsEntity> implements EpdcEventsService {
@Autowired
@ -169,13 +171,18 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
@Transactional(rollbackFor = Exception.class)
public Result<EpdcEventsEntity> saveEvent(EpdcEventSubmitFormDTO dto) {
//内容审核 - start
Boolean isConReview = dto.getIsConReview();
Boolean isConReview = null;
CheckResultDTO contentResult = null;
CheckResultDTO imgResult = null;
ParentAndAllDeptDTO deptDto = null;
List<String> textList = new ArrayList<>();
try {
isConReview = dto.getIsConReview();
textList.add(dto.getEventContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(dto.getGridId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
CheckResultDTO imgResult = CheckDataUtils.checkImgs(dto.getImages());
deptDto = adminFeignClient.getParentAndAllDept(dto.getGridId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
imgResult = CheckDataUtils.checkImgs(dto.getImages());
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){
//组装要保存的信息
@ -185,6 +192,10 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
}catch (Exception e){
log.error(e.getMessage());
}
//内容审核 - end
EpdcEventsEntity entity = ConvertUtils.sourceToTarget(dto, EpdcEventsEntity.class);
insert(entity);
@ -204,6 +215,7 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
//内容审核 - start
//接口异常,保存至待审核信息
try {
if((contentResult == null || imgResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(dto.getUserId(),
dto.getNickName(), CheckDataUtils.cate_two, null,ModuleName.ISSUE_SUBMIT.getCode(), textList,
@ -227,6 +239,10 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
contentSecurityFeign.insertRecords(record);
}
}
}catch (Exception e){
log.error(e.getMessage());
}
//内容审核 - end

21
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java

@ -310,17 +310,21 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
ItemEntity itemEntityResult = baseDao.selectById(evaluationFormDTO.getItemId());
if (itemEntityResult.getUserId().equals(evaluationFormDTO.getUserId()) && itemEntityResult.getEvaluationScore() == null) {
//内容审核 - start
Boolean isConReview = evaluationFormDTO.getIsConReview();
Boolean isConReview = null;
CheckResultDTO contentResult = null;
String mobile = null;
ParentAndAllDeptDTO deptDto = null;
List<String> textList = new ArrayList<>();
try {
isConReview = evaluationFormDTO.getIsConReview();
Result<UserDTO> user = userFeignClient.getUserInfoById(evaluationFormDTO.getUserId());
if(null != user.getData()){
mobile = user.getData().getMobile();
}
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(evaluationFormDTO.getDeptId()).getData();
List<String> textList = new ArrayList<>();
deptDto = adminFeignClient.getParentAndAllDept(evaluationFormDTO.getDeptId()).getData();
textList.add(evaluationFormDTO.getEvaluationContent());
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
contentResult = CheckDataUtils.checkContent(textList);
if (!isConReview && (contentResult != null && !contentResult.getAllPass())) {
//组装要保存的信息
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(evaluationFormDTO.getUserId(),
@ -330,6 +334,10 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
}catch (Exception e){
logger.error(e.getMessage());
}
//内容审核 - end
ItemEntity itemEntity = new ItemEntity();
@ -342,6 +350,7 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
//内容审核- 开始
//接口异常,保存至待审核信息
try {
if(contentResult == null && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(evaluationFormDTO.getUserId(),
evaluationFormDTO.getUserName(), CheckDataUtils.cate_two, null,ModuleName.ITEM_SATISFACTION.getCode(), textList,
@ -365,6 +374,10 @@ public class ItemServiceImpl extends BaseServiceImpl<ItemDao, ItemEntity> implem
contentSecurityFeign.insertRecords(record);
}
}
}catch (Exception e){
logger.error(e.getMessage());
}
//内容审核 - 结束
return new Result();

8
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/controller/ActApplyInfoController.java

@ -33,6 +33,9 @@ import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup;
import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup;
import com.elink.esua.epdc.modules.activity.excel.ActApplyInfoExcel;
import com.elink.esua.epdc.modules.activity.service.ActApplyInfoService;
import com.oracle.tools.packager.Log;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -49,6 +52,7 @@ import java.util.Map;
*/
@RestController
@RequestMapping("actapplyinfo")
@Slf4j
public class ActApplyInfoController {
@Autowired
@ -137,8 +141,10 @@ public class ActApplyInfoController {
**/
@GetMapping("applyActDetail/{id}")
public Result<ActApplyDetailResultDTO> applyActDetail(@PathVariable String id){
Log.info("活动详情ID为:" + id);
ActApplyDetailResultDTO actApplyDetailResultDTO = ConvertUtils.sourceToTarget(actApplyInfoService.get(id), ActApplyDetailResultDTO.class);
switch(actApplyDetailResultDTO.getActStatus()){
Log.info("活动状态为:" + actApplyDetailResultDTO.getActStatus());
switch(StringUtils.isBlank(actApplyDetailResultDTO.getActStatus())?"":actApplyDetailResultDTO.getActStatus()){
case "0":
actApplyDetailResultDTO.setActStatus("待审核");
break;

20
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java

@ -144,12 +144,17 @@ public class ActApplyInfoServiceImpl extends BaseServiceImpl<ActApplyInfoDao, Ac
return new Result().error("开始时间不能大于结束时间");
}
//内容审核 - start
Boolean isConReview = dto.getIsConReview();
List<String> textList = new ArrayList<>();
Boolean isConReview = null;
List<String> textList = null;
ParentAndAllDeptDTO deptDto = null;
CheckResultDTO contentResult = null;
try {
isConReview = dto.getIsConReview();
textList = new ArrayList<>();
textList.add(dto.getActContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(dto.getGridId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
deptDto = adminFeignClient.getParentAndAllDept(dto.getGridId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
if (!isConReview && (contentResult != null && !contentResult.getAllPass())) {
//组装要保存的信息
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(dto.getApplyUserId(),
@ -159,11 +164,15 @@ public class ActApplyInfoServiceImpl extends BaseServiceImpl<ActApplyInfoDao, Ac
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
} catch (Exception e) {
e.printStackTrace();
}
//内容审核 - end
ActApplyInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActApplyInfoEntity.class);
insert(entity);
//内容审核 - 开始
try {
//接口异常,保存至待审核信息
if(contentResult == null && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(dto.getApplyUserId(),
@ -188,6 +197,9 @@ public class ActApplyInfoServiceImpl extends BaseServiceImpl<ActApplyInfoDao, Ac
contentSecurityFeign.insertRecords(record);
}
}
} catch (Exception e) {
e.printStackTrace();
}
//内容审核 - 结束
return new Result();
}

56
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActInfoServiceImpl.java

@ -152,23 +152,32 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Transactional(rollbackFor = Exception.class)
public Result save(ActInfoDTO dto) {
//内容审核 - start
Boolean isConReview = dto.getIsConReview();
Boolean isConReview = null;
String userName = null;
String userId = null;
List<String> textList = null;
List<String> imgList = null;
ParentAndAllDeptDTO deptDto = null;
CheckResultDTO contentResult = null;
CheckResultDTO imgResult = null;
try {
isConReview = dto.getIsConReview();
userName = null;
userId = null;
if(null != SecurityUser.getUser()){
userName = SecurityUser.getUser().getUsername();
userId = SecurityUser.getUser().getId().toString();
}
List<String> textList = new ArrayList<>();
textList = new ArrayList<>();
textList.add(dto.getTitle());
textList.add(dto.getActContent());
List<String> imgList = new ArrayList<>();
imgList = new ArrayList<>();
imgList.add(dto.getHeadPic());
imgList.add(dto.getBannerUrl());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
CheckResultDTO imgResult = CheckDataUtils.checkImgs(imgList);
deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
imgResult = CheckDataUtils.checkImgs(imgList);
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){
//组装要保存的信息
@ -178,6 +187,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
} catch (Exception e) {
e.printStackTrace();
}
//内容审核 - end
ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class);
if (insert(entity)) {
@ -187,6 +199,7 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
//内容审核- 开始
//接口异常,保存至待审核信息
try {
if((contentResult == null || imgResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId,
userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList,
@ -210,6 +223,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
contentSecurityFeign.insertRecords(record);
}
}
} catch (Exception e) {
e.printStackTrace();
}
//内容审核 - 结束
return new Result();
}
@ -228,23 +244,32 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
@Transactional(rollbackFor = Exception.class)
public Result updateWithContent(ActInfoDTO dto) {
//内容审核 - start
Boolean isConReview = dto.getIsConReview();
Boolean isConReview = null;
String userName = null;
String userId = null;
List<String> textList = null;
List<String> imgList = null;
ParentAndAllDeptDTO deptDto = null;
CheckResultDTO contentResult = null;
CheckResultDTO imgResult = null;
try {
isConReview = dto.getIsConReview();
userName = null;
userId = null;
if(null != SecurityUser.getUser()){
userName = SecurityUser.getUser().getUsername();
userId = SecurityUser.getUser().getId().toString();
}
List<String> textList = new ArrayList<>();
textList = new ArrayList<>();
textList.add(dto.getTitle());
textList.add(dto.getActContent());
List<String> imgList = new ArrayList<>();
imgList = new ArrayList<>();
imgList.add(dto.getHeadPic());
imgList.add(dto.getBannerUrl());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
CheckResultDTO imgResult = CheckDataUtils.checkImgs(imgList);
deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
imgResult = CheckDataUtils.checkImgs(imgList);
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){
//组装要保存的信息
@ -254,12 +279,16 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
} catch (Exception e) {
e.printStackTrace();
}
//内容审核 - end
ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class);
//如果更新了公益时长,则更新相关确认积分的志愿者的公益时长
updateKindnessTime(dto);
updateById(entity);
//内容审核- 开始
try {
//接口异常,保存至待审核信息
if((contentResult == null || imgResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId,
@ -284,6 +313,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit
contentSecurityFeign.insertRecords(record);
}
}
} catch (Exception e) {
e.printStackTrace();
}
//内容审核 - 结束
return new Result();
}

24
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActUserClockLogServiceImpl.java

@ -344,18 +344,25 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
return new Result().error("请上传打卡图片");
}
//内容审核 - start
Boolean isConReview = appActUserClockLogDTO.getIsConReview();
Boolean isConReview = null;
String mobile = null;
ParentAndAllDeptDTO deptDto = null;
List<String> textList = null;
CheckResultDTO contentResult = null;
CheckResultDTO imgResult = null;
try {
isConReview = appActUserClockLogDTO.getIsConReview();
mobile = null;
Result<UserDTO> user = userInfoFeignClient.getUserInfoById(appActUserClockLogDTO.getUserId());
if(null != user.getData()){
mobile = user.getData().getMobile();
}
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(appActUserClockLogDTO.getDeptId()).getData();
List<String> textList = new ArrayList<>();
deptDto = adminFeignClient.getParentAndAllDept(appActUserClockLogDTO.getDeptId()).getData();
textList = new ArrayList<>();
textList.add(appActUserClockLogDTO.getClockDesc());
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
CheckResultDTO imgResult = CheckDataUtils.checkImgs(appActUserClockLogDTO.getImages());
contentResult = CheckDataUtils.checkContent(textList);
imgResult = CheckDataUtils.checkImgs(appActUserClockLogDTO.getImages());
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){
//组装要保存的信息
@ -365,6 +372,9 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
} catch (Exception e) {
e.printStackTrace();
}
//内容审核 - end
//查询人员活动关系Id(可打卡的)
List<String> statusList = new ArrayList<>();
@ -404,6 +414,7 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
actInfoService.addClockNum(appActUserClockLogDTO.getActId());
//内容审核 - 开始
try {
//接口异常,保存至待审核信息
if((contentResult == null || imgResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(appActUserClockLogDTO.getUserId(),
@ -427,6 +438,9 @@ public class ActUserClockLogServiceImpl extends BaseServiceImpl<ActUserClockLogD
contentSecurityFeign.insertRecords(record);
}
}
} catch (Exception e) {
e.printStackTrace();
}
//内容审核 - 结束
return new Result().ok("打卡成功");

23
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicCommentServiceImpl.java

@ -46,6 +46,7 @@ import com.elink.esua.epdc.rocketmq.dto.RejectRecordDTO;
import com.elink.esua.epdc.service.PartyTopicCommentService;
import com.elink.esua.epdc.service.PartyTopicService;
import com.elink.esua.epdc.service.PartyUserGroupService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -60,6 +61,7 @@ import java.util.*;
* @since v1.0.0 2020-05-29
*/
@Service
@Slf4j
public class PartyTopicCommentServiceImpl extends BaseServiceImpl<PartyTopicCommentDao, PartyTopicCommentEntity> implements PartyTopicCommentService {
@Autowired
@ -146,17 +148,21 @@ public class PartyTopicCommentServiceImpl extends BaseServiceImpl<PartyTopicComm
@Override
public Result saveTopicComment(PartyTopicCommentFormDTO formDto) {
//内容审核 - 开始
Boolean isConReview = formDto.getIsConReview();
Boolean isConReview = null;
CheckResultDTO contentResult = null;
String mobile = null;
ParentAndAllDeptDTO deptDto = null;
List<String> textList = new ArrayList<>();
try {
isConReview = formDto.getIsConReview();
textList.add(formDto.getContent());
String mobile = null;
Result<UserDTO> user = userInfoFeignClient.getUserInfoById(formDto.getUserId());
if(null != user.getData()){
mobile = user.getData().getMobile();
}
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(formDto.getDeptId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
deptDto = adminFeignClient.getParentAndAllDept(formDto.getDeptId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
if (!isConReview && (contentResult != null && !contentResult.getAllPass())) {
//组装要保存的信息
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(),
@ -166,6 +172,10 @@ public class PartyTopicCommentServiceImpl extends BaseServiceImpl<PartyTopicComm
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
}
catch (Exception e){
log.error(e.getMessage());
}
//内容审核 - 结束
PartyTopicCommentEntity entity = ConvertUtils.sourceToTarget(formDto, PartyTopicCommentEntity.class);
@ -206,6 +216,7 @@ public class PartyTopicCommentServiceImpl extends BaseServiceImpl<PartyTopicComm
//内容审核 - 开始
//接口异常,保存至待审核信息
try {
if(contentResult == null && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(),
formDto.getUserName(), CheckDataUtils.cate_two, null,ModuleName.PARTY_GROUP_TOPIC_COMMENT.getCode(), textList,
@ -229,7 +240,9 @@ public class PartyTopicCommentServiceImpl extends BaseServiceImpl<PartyTopicComm
contentSecurityFeign.insertRecords(record);
}
}
}catch (Exception e){
log.error(e.getMessage());
}
return new Result();
}

24
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java

@ -53,6 +53,8 @@ import com.elink.esua.epdc.service.PartyTopicImgService;
import com.elink.esua.epdc.service.PartyTopicService;
import com.elink.esua.epdc.service.PartyTopicUserAttitudeService;
import com.elink.esua.epdc.service.PartyUserGroupService;
import com.oracle.tools.packager.Log;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -67,6 +69,7 @@ import java.util.*;
* @since v1.0.0 2020-05-29
*/
@Service
@Slf4j
public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyTopicEntity> implements PartyTopicService {
@Autowired
@ -184,13 +187,18 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
return new Result().error("用户已被禁言");
}
//内容审核 - 开始
Boolean isConReview = formDto.getIsConReview();
Boolean isConReview = null;
CheckResultDTO contentResult = null;
CheckResultDTO imgResult = null;
ParentAndAllDeptDTO deptDto = null;
List<String> textList = new ArrayList<>();
try {
isConReview = formDto.getIsConReview();
textList.add(formDto.getTopicContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(formDto.getGridId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
CheckResultDTO imgResult = CheckDataUtils.checkImgs(formDto.getImages());
deptDto = adminFeignClient.getParentAndAllDept(formDto.getGridId()).getData();
contentResult = CheckDataUtils.checkContent(textList);
imgResult = CheckDataUtils.checkImgs(formDto.getImages());
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){
//组装要保存的信息
@ -200,6 +208,10 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
}catch (Exception e){
log.error(e.getMessage());
}
//内容审核 - 结束
@ -212,6 +224,7 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
partyTopicImgService.saveImgs(images,entity.getId());
//内容审核 - 开始
try {
//接口异常,保存至待审核信息
if((contentResult == null || imgResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(),
@ -235,6 +248,9 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
contentSecurityFeign.insertRecords(record);
}
}
}catch (Exception e){
log.error(e.getMessage());
}
//内容审核 - 结束
return new Result().ok(entity.getId());

Loading…
Cancel
Save