|
@@ -133,15 +133,13 @@ public class AnnualInspectionController {
|
|
|
* stepName: 1
|
|
|
*/
|
|
|
@PostMapping("confirm")
|
|
|
- @Verifier(fields = {"liftId","mtCompanyId","planDate"})
|
|
|
+ @Verifier(fields = {"liftId","mtCompanyId","planDate","isCheckGoverner","loadInspectionSetting"})
|
|
|
public RestResponse confirm(@Ver @RequestBody AnnualInspection entity){
|
|
|
long count = annualInspectionService.countConfirm(entity.getLiftId(), entity.getMtCompanyId(), entity.getPlanDate());
|
|
|
Verify.nogt0(count, "年检计划已存在");
|
|
|
entity.setStatus(0);
|
|
|
entity.setStepStatus(1);
|
|
|
entity.setStepName(1);
|
|
|
- entity.setIsCheckGoverner(0);
|
|
|
- entity.setLoadInspectionSetting(0);
|
|
|
boolean ai = annualInspectionService.saveOrUpdate(entity);
|
|
|
return RestResponse.success(ai);
|
|
|
}
|
|
@@ -176,7 +174,8 @@ public class AnnualInspectionController {
|
|
|
public RestResponse update(@Ver @RequestBody InspectionRequest entity){
|
|
|
AnnualInspection old = annualInspectionService.findByMtCompanyId(entity.getId(), entity.getMtCompanyId());
|
|
|
Verify.notNull(old, Verify.Inspection.confirm);
|
|
|
-
|
|
|
+ Integer oldStepName = old.getStepName();
|
|
|
+ Verify.isTrue(oldStepName == 1, "年检第一阶段才能修改");
|
|
|
old.setIsCheckGoverner(entity.getIsCheckGoverner());
|
|
|
old.setLoadInspectionSetting(entity.getLoadInspectionSetting());
|
|
|
|
|
@@ -247,9 +246,10 @@ public class AnnualInspectionController {
|
|
|
* 6 企业文员确认检验结果-整改 --> 回到第二阶段
|
|
|
* (3 企业文员确认现场检验时间 录入人员信息,政府质检,企业质检,联系电话)
|
|
|
* 7 企业文员确认检验结果-不合格 --> 可以算年检超期
|
|
|
+ * 设置下次年检时间,是否检查限速器和是否荷载设置
|
|
|
*/
|
|
|
@PostMapping("stepThree")
|
|
|
- @Verifier(fields = {"id","mtCompanyId","stepStatus","checkResultImg","projectId"})
|
|
|
+ @Verifier(fields = {"id","mtCompanyId","stepStatus","checkResultImg","projectId","nextInspectionTime","isCheckGoverner","loadInspectionSetting"})
|
|
|
public RestResponse stepThree(@Ver @RequestBody InspectionRequest entity){
|
|
|
AnnualInspection old = annualInspectionService.findByMtCompanyId(entity.getId(), entity.getMtCompanyId());
|
|
|
Verify.notNull(old, Verify.Inspection.confirm);
|
|
@@ -262,6 +262,7 @@ public class AnnualInspectionController {
|
|
|
|
|
|
old.setCheckResultImg(entity.getCheckResultImg());
|
|
|
old.setStepStatus(entity.getStepStatus());
|
|
|
+ old.setNextInspectionTime(entity.getNextInspectionTime());
|
|
|
|
|
|
old.setStatus(0);
|
|
|
//企业文员确认检验结果-整改 --> 回到第二阶段
|
|
@@ -273,7 +274,7 @@ public class AnnualInspectionController {
|
|
|
old.setStepStatus(3);
|
|
|
old.setStepName(2);//转回阶段2
|
|
|
}
|
|
|
- boolean ai = annualInspectionService.stepThree(old, entity.getProjectId());
|
|
|
+ boolean ai = annualInspectionService.stepThree(old, entity.getProjectId(), entity.getIsCheckGoverner(), entity.getLoadInspectionSetting());
|
|
|
return RestResponse.success(ai);
|
|
|
}
|
|
|
|
|
@@ -293,11 +294,6 @@ public class AnnualInspectionController {
|
|
|
Verify.isTrue(oldStepName == 3, "请进行第三阶段操作");
|
|
|
Verify.isTrue(oldStepStatus >= 5 && oldStepStatus <= 10, "请进行第四阶段操作");
|
|
|
Verify.isTrue(stepStatus >= 8 && stepStatus <= 10, "请进行第四阶段操作");
|
|
|
- // 合格,需要下次年检时间
|
|
|
- if(stepStatus == 9){
|
|
|
- Verify.notNull(entity.getNextInspectionTime(), Verify.Inspection.nextInspectionTime);
|
|
|
- old.setNextInspectionTime(entity.getNextInspectionTime());
|
|
|
- }
|
|
|
|
|
|
old.setStepStatus(entity.getStepStatus());
|
|
|
old.setAnnualInspectionImg(entity.getAnnualInspectionImg());
|