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