|
|
|
@ -27,10 +27,7 @@ import com.epmet.dto.form.UserMessageFormDTO; |
|
|
|
import com.epmet.dto.form.work.*; |
|
|
|
import com.epmet.dto.result.ActSponsorResultDTO; |
|
|
|
import com.epmet.dto.result.work.*; |
|
|
|
import com.epmet.entity.ActContentEntity; |
|
|
|
import com.epmet.entity.ActInfoEntity; |
|
|
|
import com.epmet.entity.ActOperationRecEntity; |
|
|
|
import com.epmet.entity.ActUserRelationEntity; |
|
|
|
import com.epmet.entity.*; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.feign.GovOrgOpenFeignClient; |
|
|
|
import com.epmet.service.*; |
|
|
|
@ -90,6 +87,8 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
private HeartUserInfoDao heartUserInfoDao; |
|
|
|
@Autowired |
|
|
|
private HeartUserInfoService heartUserInfoService; |
|
|
|
@Autowired |
|
|
|
private ActSummaryDao actSummaryDao; |
|
|
|
|
|
|
|
/** |
|
|
|
* @return void |
|
|
|
@ -657,6 +656,10 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
@Override |
|
|
|
public void finishAct(String actId) { |
|
|
|
ActInfoDTO actInfoDTO=actInfoService.get(actId); |
|
|
|
if(null==actInfoDTO){ |
|
|
|
logger.error("act_info is null"); |
|
|
|
return; |
|
|
|
} |
|
|
|
//校验是否可以结束
|
|
|
|
this.checkActInfoDTO(actInfoDTO); |
|
|
|
//act_info表改为已完成
|
|
|
|
@ -773,18 +776,68 @@ public class WorkActServiceImpl implements WorkActService { |
|
|
|
} |
|
|
|
|
|
|
|
private ActInfoDTO checkActInfoDTO(ActInfoDTO actInfoDTO) { |
|
|
|
//只有我发布的活动,我可以就结束
|
|
|
|
if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ |
|
|
|
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); |
|
|
|
} |
|
|
|
//待处理事项为空时才可以结束活动
|
|
|
|
List<ActUserRelationDTO> list=actUserRelationDao.selectInProgress(actInfoDTO.getId()); |
|
|
|
if(null!=list&&list.size()>0){ |
|
|
|
throw new RenException(EpmetErrorCode.HAVE_HANDLE.getCode()); |
|
|
|
} |
|
|
|
//先填写实际开始时间、实际结束时间
|
|
|
|
if(null==actInfoDTO.getActualStartTime()||null==actInfoDTO.getActualEndTime()){ |
|
|
|
throw new RenException(EpmetErrorCode.ACTUAL_TIME.getCode()); |
|
|
|
} |
|
|
|
return actInfoDTO; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @param formDTO |
|
|
|
* @return void |
|
|
|
* @author yinzuomei |
|
|
|
* @description 保存添加回顾 |
|
|
|
* @Date 2020/7/27 10:45 |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public void summaryAct(SummaryActFormDTO formDTO) { |
|
|
|
ActInfoDTO actInfoDTO=actInfoService.get(formDTO.getActId()); |
|
|
|
if(null==actInfoDTO){ |
|
|
|
logger.info("act_info is null"); |
|
|
|
return; |
|
|
|
} |
|
|
|
if(!actInfoDTO.getActStatus().equals(ActConstant.ACT_STATUS_FINISHED)){ |
|
|
|
//先结束活动,才能添加回顾
|
|
|
|
throw new RenException(EpmetErrorCode.ACTUAL_NOT_FINISHED.getCode()); |
|
|
|
} |
|
|
|
if(!actInfoDTO.getCreatedBy().equals(loginUserUtil.getLoginUserId())){ |
|
|
|
//只有我发布的活动,才可以添加回顾
|
|
|
|
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); |
|
|
|
} |
|
|
|
//审核
|
|
|
|
List<String> textList=new ArrayList<>(); |
|
|
|
List<String> imgList=new ArrayList<>(); |
|
|
|
for(PublishActContentFormDTO actContent:formDTO.getActContent()){ |
|
|
|
if(ActConstant.ACT_CONTENT_TYPE_TEXT.equals(actContent.getContentType())){ |
|
|
|
textList.add(actContent.getContent()); |
|
|
|
}else if(ActConstant.ACT_CONTENT_TYPE_IMG.equals(actContent.getContentType())){ |
|
|
|
imgList.add(actContent.getContent()); |
|
|
|
} |
|
|
|
} |
|
|
|
this.auditActContent(textList,imgList); |
|
|
|
//插入act_summary记录
|
|
|
|
int orderNum=1; |
|
|
|
for(PublishActContentFormDTO actContentFormDTO:formDTO.getActContent()){ |
|
|
|
ActSummaryEntity actSummaryEntity=new ActSummaryEntity(); |
|
|
|
actSummaryEntity.setActId(formDTO.getActId()); |
|
|
|
actSummaryEntity.setContent(actContentFormDTO.getContent()); |
|
|
|
actSummaryEntity.setContentType(actContentFormDTO.getContentType()); |
|
|
|
actSummaryEntity.setOrderNum(orderNum); |
|
|
|
actSummaryDao.insert(actSummaryEntity); |
|
|
|
orderNum++; |
|
|
|
} |
|
|
|
//更新act_info表的SUMMARY_FLAG=true
|
|
|
|
actInfoDTO.setSummaryFlag(true); |
|
|
|
actInfoService.update(actInfoDTO); |
|
|
|
} |
|
|
|
} |
|
|
|
|