|
|
|
|
@ -13,7 +13,7 @@ import com.biutag.supervision.pojo.entity.SupDepart;
|
|
|
|
|
import com.biutag.supervision.service.NegativeService; |
|
|
|
|
import com.biutag.supervision.service.NegativeWorkService; |
|
|
|
|
import com.biutag.supervision.service.SupDepartService; |
|
|
|
|
import jakarta.validation.Validator; |
|
|
|
|
import jakarta.validation.ValidationException; |
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
@ -50,6 +50,11 @@ public class FirstDistributeAction implements Action {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void updateNegative(String negativeId, String nextFlowKey, @Validated FirstDistributeData distributeData, boolean thirdHandling) { |
|
|
|
|
// 防御
|
|
|
|
|
if (StrUtil.isBlank(negativeId)) { |
|
|
|
|
throw new ValidationException("negativeId不能为空"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
LocalDateTime now = LocalDateTime.now(); |
|
|
|
|
LambdaUpdateWrapper<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>() |
|
|
|
|
.set(Negative::getHostLevel, distributeData.getHostLevel()) |
|
|
|
|
@ -61,7 +66,26 @@ public class FirstDistributeAction implements Action {
|
|
|
|
|
.set(Negative::getUpdTime, now) |
|
|
|
|
// 市局下发意见
|
|
|
|
|
.set(Negative::getFirstDistributeComments, distributeData.getFirstDistributeComments()) |
|
|
|
|
.set(Negative::getInvolveDepartId, distributeData.getInvolveDepartId()) |
|
|
|
|
.set(Negative::getInvolveDepartName, distributeData.getInvolveDepartName()) |
|
|
|
|
.eq(Negative::getId, negativeId); |
|
|
|
|
// 涉及单位重新更新
|
|
|
|
|
String involveDepartId = distributeData.getInvolveDepartId(); |
|
|
|
|
if (StrUtil.isBlank(involveDepartId)) { |
|
|
|
|
throw new ValidationException("涉及单位不能为空"); |
|
|
|
|
} |
|
|
|
|
SupDepart depart = departService.getById(involveDepartId); |
|
|
|
|
if (depart == null) { |
|
|
|
|
throw new ValidationException("涉及单位不存在"); |
|
|
|
|
} |
|
|
|
|
if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) { |
|
|
|
|
updateWrapper.set(Negative::getSecondInvolveDepartId, depart.getId()); |
|
|
|
|
} else if (DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) { |
|
|
|
|
updateWrapper.set(Negative::getThreeInvolveDepartId, depart.getId()); |
|
|
|
|
updateWrapper.set(Negative::getSecondInvolveDepartId, depart.getPid()); |
|
|
|
|
} else { |
|
|
|
|
throw new RuntimeException("涉及单位请选择二级或三级单位"); |
|
|
|
|
} |
|
|
|
|
if (TimeLimitEnum.OTHER.getValue().equals(distributeData.getTimeLimit())) { |
|
|
|
|
updateWrapper.set(Negative::getMaxSignDuration, distributeData.getMaxSignDuration()) |
|
|
|
|
.set(Negative::getMaxHandleDuration, distributeData.getMaxHandleDuration()) |
|
|
|
|
|