|
|
@ -6,6 +6,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.ErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
@ -34,6 +35,7 @@ import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Objects; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
@ -187,9 +189,11 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec |
|
|
|
throw new RenException("巡查记录不存在"); |
|
|
|
} |
|
|
|
if (PatrolConstant.END.equals(record.getStatus())) { |
|
|
|
throw new RenException("巡查已结束,请勿重复提交"); |
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "巡查已结束,请勿重复提交"); |
|
|
|
} |
|
|
|
if (record.getPatrolStartTime().compareTo(Objects.requireNonNull(DateUtils.parse(formDTO.getPatrolEndTime(), DateUtils.DATE_TIME_PATTERN))) > 0) { |
|
|
|
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), "巡查结束时间不能小于巡查开始时间"); |
|
|
|
} |
|
|
|
|
|
|
|
record.setActrualEndTime(new Date()); |
|
|
|
record.setUpdatedTime(null); |
|
|
|
record.setPatrolEndTime(DateUtils.parse(formDTO.getPatrolEndTime(), DateUtils.DATE_TIME_PATTERN)); |
|
|
|