|
|
@ -23,6 +23,7 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.FieldConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; |
|
|
|
import com.elink.esua.epdc.commons.tools.exception.RenException; |
|
|
|
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; |
|
|
@ -258,6 +259,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv |
|
|
|
|| "".equals(dto.getCategoryId()))) { |
|
|
|
return new Result().error("分类信息不能为空"); |
|
|
|
} |
|
|
|
// 事件审核校验
|
|
|
|
checkEventReview(dto.getId(), dto.getEventState()); |
|
|
|
|
|
|
|
EpdcEventsEntity entity = new EpdcEventsEntity(); |
|
|
|
entity.setId(dto.getId()); |
|
|
|
entity.setEventState(dto.getEventState()); |
|
|
@ -739,4 +743,31 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv |
|
|
|
return eventTagService.listOfEventTags(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 事件审核校验 |
|
|
|
* |
|
|
|
* @param eventId 事件ID |
|
|
|
* @param eventState 事件状态 |
|
|
|
* @return void |
|
|
|
* @author Liuchuang |
|
|
|
* @since 2020/9/16 10:18 |
|
|
|
*/ |
|
|
|
private void checkEventReview(String eventId, int eventState) { |
|
|
|
boolean checkResult; |
|
|
|
if (EventIssueItemState.EVENT_REVIEW_PASS == eventState) { |
|
|
|
int issueCount = issueService.selectIssueCountByEventId(eventId); |
|
|
|
checkResult = issueCount > NumConstant.ZERO; |
|
|
|
} else if (EventIssueItemState.EVENT_REVIEW_TO_ITEM == eventState) { |
|
|
|
int itemCount = itemService.selectItemCountByEventId(eventId); |
|
|
|
checkResult = itemCount > NumConstant.ZERO; |
|
|
|
} else { |
|
|
|
EpdcEventsEntity entity = baseDao.selectById(eventId); |
|
|
|
checkResult = eventState == entity.getEventState(); |
|
|
|
} |
|
|
|
|
|
|
|
if (!checkResult) { |
|
|
|
throw new RenException("该事件已审核,请勿重复操作"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|