|
|
|
@ -35,6 +35,7 @@ import com.elink.esua.epdc.commons.tools.constant.StrConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.page.PageData; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.ModuleName; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO; |
|
|
|
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO; |
|
|
|
@ -57,6 +58,7 @@ import com.elink.esua.epdc.modules.activity.entity.ActUserRelationEntity; |
|
|
|
import com.elink.esua.epdc.modules.activity.service.ActBannerService; |
|
|
|
import com.elink.esua.epdc.modules.activity.service.ActInfoService; |
|
|
|
import com.elink.esua.epdc.modules.async.NewsTask; |
|
|
|
import com.elink.esua.epdc.modules.feign.AdminFeignClient; |
|
|
|
import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; |
|
|
|
import com.elink.esua.epdc.modules.feign.JobFeignClient; |
|
|
|
import com.elink.esua.epdc.modules.feign.UserInfoFeignClient; |
|
|
|
@ -98,6 +100,8 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
private ActBannerDao actBannerDao; |
|
|
|
@Autowired |
|
|
|
private ActClockPicDao actClockPicDao; |
|
|
|
@Autowired |
|
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(ActInfoServiceImpl.class); |
|
|
|
|
|
|
|
@ -143,6 +147,7 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Result save(ActInfoDTO dto) { |
|
|
|
//内容审核
|
|
|
|
Boolean isConReview = dto.getIsConReview(); |
|
|
|
String userName = null; |
|
|
|
String userId = null; |
|
|
|
if(null != SecurityUser.getUser()){ |
|
|
|
@ -155,15 +160,18 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
List<String> imgList = new ArrayList<>(); |
|
|
|
imgList.add(dto.getHeadPic()); |
|
|
|
imgList.add(dto.getBannerUrl()); |
|
|
|
CheckResultDTO contentResult = CheckDataUtils.checkContent(imgList); |
|
|
|
// 获取所有上级机构名称和ID拼接
|
|
|
|
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(SecurityUser.getDeptId()).getData(); |
|
|
|
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList); |
|
|
|
CheckResultDTO imgResult = CheckDataUtils.checkImgs(imgList); |
|
|
|
if((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass())){ |
|
|
|
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"); |
|
|
|
imgList, null,contentResult, imgResult,null,dto.getTel(),"0",deptDto); |
|
|
|
contentSecurityFeign.insertViolationsRecord(record); |
|
|
|
return new Result().error(CheckDataUtils.violations_message); |
|
|
|
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message); |
|
|
|
} |
|
|
|
|
|
|
|
ActInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActInfoEntity.class); |
|
|
|
@ -173,28 +181,34 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
this.saveActInfoToBanner(entity.getId(), dto); |
|
|
|
} |
|
|
|
//接口异常,保存至待审核信息
|
|
|
|
if(contentResult == null || imgResult == null) { |
|
|
|
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"); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
imgList, entity.getId(),null,null, null,dto.getTel(),"1",deptDto); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
|
|
|
|
//保存待审核记录
|
|
|
|
if (contentResult != null && imgResult != null) { |
|
|
|
CheckResultMessageDTO twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult); |
|
|
|
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"); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
imgList, entity.getId(),null,null, twoTypes,dto.getTel(),"0",deptDto); |
|
|
|
contentSecurityFeign.insertRecords(record); |
|
|
|
} |
|
|
|
} |
|
|
|
// 创建定时任务(活动开始后将未审核的报名人员自动置为审核通过或不通过)
|
|
|
|
return this.saveActToScheduleJob(entity.getId(), dto.getActStartTime()); |
|
|
|
// return this.saveActToScheduleJob(entity.getId(), dto.getActStartTime());
|
|
|
|
} |
|
|
|
return new Result().error(); |
|
|
|
return new Result(); |
|
|
|
// return new Result().error();
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@ -619,6 +633,17 @@ public class ActInfoServiceImpl extends BaseServiceImpl<ActInfoDao, ActInfoEntit |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public Result rejectActClockInfo(RejectRecordDTO dto) { |
|
|
|
//判断是否只打过一次卡,打过一次则更新关系表状态为 审核成功
|
|
|
|
ActUserClockLogEntity actUserClockLogEntity = actUserClockLogDao.selectById(dto.getRelationId()); |
|
|
|
Map<String,Object> queryMap = new HashMap<>(); |
|
|
|
queryMap.put("ACT_USER_ID",actUserClockLogEntity.getActUserId()); |
|
|
|
List<ActUserClockLogEntity> actUserClockLogEntities = actUserClockLogDao.selectByMap(queryMap); |
|
|
|
if(actUserClockLogEntities.size()==1){ |
|
|
|
ActUserRelationEntity actUserRelationEntity = new ActUserRelationEntity(); |
|
|
|
actUserRelationEntity.setId(actUserClockLogEntity.getActUserId()); |
|
|
|
actUserRelationEntity.setStatus("1"); |
|
|
|
actUserRelationDao.updateById(actUserRelationEntity); |
|
|
|
} |
|
|
|
actUserClockLogDao.rejectActClockInfo(dto.getRelationId()); |
|
|
|
actClockPicDao.rejectActClockPicInfo(dto.getRelationId()); |
|
|
|
return new Result(); |
|
|
|
|