|
@@ -60,7 +60,11 @@ public class InspectionServiceImpl extends BaseServiceImpl<Long, Inspection> imp
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public List<Inspection> add(List<Inspection> inspections, Integer operationUserId) {
|
|
|
Date nowDate = new Date();
|
|
|
+ Date month = DateUtil.getFirstDayOfMonth(nowDate);
|
|
|
for (Inspection inspection : inspections) {
|
|
|
+ if(inspection.getMonth().before(month)){
|
|
|
+ throw new BizException("工作周期不能早于当前月份");
|
|
|
+ }
|
|
|
inspection.setOperation(operationUserId);
|
|
|
inspection.setCreateTime(nowDate);
|
|
|
inspection.setUpdateTime(nowDate);
|
|
@@ -86,10 +90,14 @@ public class InspectionServiceImpl extends BaseServiceImpl<Long, Inspection> imp
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Inspection updateInspection(Inspection inspection, Integer operationUserId) {
|
|
|
+ Date nowDate = new Date();
|
|
|
+ Date month = DateUtil.getFirstDayOfMonth(nowDate);
|
|
|
+ if(inspection.getMonth().before(month)){
|
|
|
+ throw new BizException("工作周期不能早于当前月份");
|
|
|
+ }
|
|
|
if (inspection.getInspectionItems() == null || inspection.getInspectionItems().size() <= 0) {
|
|
|
throw new BizException("任务事项不能为空");
|
|
|
}
|
|
|
- Date nowDate = new Date();
|
|
|
Inspection oldInspection = inspectionDao.get(inspection.getId());
|
|
|
if (oldInspection == null) {
|
|
|
throw new BizException("巡查任务不存在,请核查");
|