|
|
|
@ -152,31 +152,43 @@ 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; |
|
|
|
if(null != SecurityUser.getUser()){ |
|
|
|
userName = SecurityUser.getUser().getUsername(); |
|
|
|
userId = SecurityUser.getUser().getId().toString(); |
|
|
|
} |
|
|
|
List<String> textList = new ArrayList<>(); |
|
|
|
textList.add(dto.getTitle()); |
|
|
|
textList.add(dto.getActContent()); |
|
|
|
List<String> 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); |
|
|
|
if(!isConReview && |
|
|
|
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ |
|
|
|
//组装要保存的信息
|
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, CheckDataUtils.decision_one, ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, null,contentResult, imgResult,null,dto.getTel(),"0",deptDto); |
|
|
|
contentSecurityFeign.insertViolationsRecord(record); |
|
|
|
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); |
|
|
|
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(); |
|
|
|
} |
|
|
|
textList = new ArrayList<>(); |
|
|
|
textList.add(dto.getTitle()); |
|
|
|
textList.add(dto.getActContent()); |
|
|
|
imgList = new ArrayList<>(); |
|
|
|
imgList.add(dto.getHeadPic()); |
|
|
|
imgList.add(dto.getBannerUrl()); |
|
|
|
// 获取所有上级机构名称和ID拼接
|
|
|
|
deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); |
|
|
|
contentResult = CheckDataUtils.checkContent(textList); |
|
|
|
imgResult = CheckDataUtils.checkImgs(imgList); |
|
|
|
if(!isConReview && |
|
|
|
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ |
|
|
|
//组装要保存的信息
|
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, CheckDataUtils.decision_one, ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, null,contentResult, imgResult,null,dto.getTel(),"0",deptDto); |
|
|
|
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); |
|
|
|
@ -187,28 +199,32 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
|
|
|
|
//内容审核- 开始
|
|
|
|
//接口异常,保存至待审核信息
|
|
|
|
if((contentResult == null || imgResult == null) && !isConReview) { |
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, entity.getId(),null,null, null,dto.getTel(),"1",deptDto); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
|
|
|
|
//保存待审核记录
|
|
|
|
if (contentResult != null && imgResult != null) { |
|
|
|
CheckResultMessageDTO twoTypes = null; |
|
|
|
if(isConReview){ |
|
|
|
twoTypes = CheckDataUtils.saveTwoTypes(contentResult, imgResult); |
|
|
|
}else{ |
|
|
|
twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult); |
|
|
|
} |
|
|
|
if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { |
|
|
|
//组装要保存的信息
|
|
|
|
try { |
|
|
|
if((contentResult == null || imgResult == null) && !isConReview) { |
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, entity.getId(),null,null, twoTypes,dto.getTel(),"0",deptDto); |
|
|
|
imgList, entity.getId(),null,null, null,dto.getTel(),"1",deptDto); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
|
|
|
|
//保存待审核记录
|
|
|
|
if (contentResult != null && imgResult != null) { |
|
|
|
CheckResultMessageDTO twoTypes = null; |
|
|
|
if(isConReview){ |
|
|
|
twoTypes = CheckDataUtils.saveTwoTypes(contentResult, imgResult); |
|
|
|
}else{ |
|
|
|
twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult); |
|
|
|
} |
|
|
|
if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { |
|
|
|
//组装要保存的信息
|
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, entity.getId(),null,null, twoTypes,dto.getTel(),"0",deptDto); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
//内容审核 - 结束
|
|
|
|
return new Result(); |
|
|
|
@ -228,31 +244,43 @@ 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; |
|
|
|
if(null != SecurityUser.getUser()){ |
|
|
|
userName = SecurityUser.getUser().getUsername(); |
|
|
|
userId = SecurityUser.getUser().getId().toString(); |
|
|
|
} |
|
|
|
List<String> textList = new ArrayList<>(); |
|
|
|
textList.add(dto.getTitle()); |
|
|
|
textList.add(dto.getActContent()); |
|
|
|
List<String> 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); |
|
|
|
if(!isConReview && |
|
|
|
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ |
|
|
|
//组装要保存的信息
|
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, CheckDataUtils.decision_one, ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, null,contentResult, imgResult,null,dto.getTel(),"0",deptDto); |
|
|
|
contentSecurityFeign.insertViolationsRecord(record); |
|
|
|
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); |
|
|
|
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(); |
|
|
|
} |
|
|
|
textList = new ArrayList<>(); |
|
|
|
textList.add(dto.getTitle()); |
|
|
|
textList.add(dto.getActContent()); |
|
|
|
imgList = new ArrayList<>(); |
|
|
|
imgList.add(dto.getHeadPic()); |
|
|
|
imgList.add(dto.getBannerUrl()); |
|
|
|
// 获取所有上级机构名称和ID拼接
|
|
|
|
deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); |
|
|
|
contentResult = CheckDataUtils.checkContent(textList); |
|
|
|
imgResult = CheckDataUtils.checkImgs(imgList); |
|
|
|
if(!isConReview && |
|
|
|
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){ |
|
|
|
//组装要保存的信息
|
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, CheckDataUtils.decision_one, ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, null,contentResult, imgResult,null,dto.getTel(),"0",deptDto); |
|
|
|
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); |
|
|
|
@ -260,29 +288,33 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
updateKindnessTime(dto); |
|
|
|
updateById(entity); |
|
|
|
//内容审核- 开始
|
|
|
|
//接口异常,保存至待审核信息
|
|
|
|
if((contentResult == null || imgResult == null) && !isConReview) { |
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, entity.getId(),null,null, null,dto.getTel(),"1",deptDto); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
|
|
|
|
//保存待审核记录
|
|
|
|
if (contentResult != null && imgResult != null) { |
|
|
|
CheckResultMessageDTO twoTypes = null; |
|
|
|
if(isConReview){ |
|
|
|
twoTypes = CheckDataUtils.saveTwoTypes(contentResult, imgResult); |
|
|
|
}else{ |
|
|
|
twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult); |
|
|
|
} |
|
|
|
if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { |
|
|
|
//组装要保存的信息
|
|
|
|
try { |
|
|
|
//接口异常,保存至待审核信息
|
|
|
|
if((contentResult == null || imgResult == null) && !isConReview) { |
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, entity.getId(),null,null, twoTypes,dto.getTel(),"0",deptDto); |
|
|
|
imgList, entity.getId(),null,null, null,dto.getTel(),"1",deptDto); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
|
|
|
|
//保存待审核记录
|
|
|
|
if (contentResult != null && imgResult != null) { |
|
|
|
CheckResultMessageDTO twoTypes = null; |
|
|
|
if(isConReview){ |
|
|
|
twoTypes = CheckDataUtils.saveTwoTypes(contentResult, imgResult); |
|
|
|
}else{ |
|
|
|
twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult); |
|
|
|
} |
|
|
|
if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) { |
|
|
|
//组装要保存的信息
|
|
|
|
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(userId, |
|
|
|
userName, CheckDataUtils.cate_one, null,ModuleName.HELP_ACTIVITY.getCode(), textList, |
|
|
|
imgList, entity.getId(),null,null, twoTypes,dto.getTel(),"0",deptDto); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
//内容审核 - 结束
|
|
|
|
return new Result(); |
|
|
|
|