|
@@ -238,7 +238,13 @@ public class AnnualInspectionController {
|
|
|
Validate.between(oldStepStatus, ValuePool.INSPECTION_STAGE_CONFIRM, ValuePool.INSPECTION_STAGE_SELFCHECK, ValuePool.inspectionCurrentStepStatusIllegal( oldStepStatus, ValuePool.INSPECTION_STEP_ONE_DESC));
|
|
|
Validate.equals(stepStatus, ValuePool.INSPECTION_STAGE_SELFCHECK, ValuePool.inspectionNewStepStatusIllegal(stepStatus, ValuePool.INSPECTION_STEP_ONE_DESC));
|
|
|
|
|
|
- old.setSelfcheckReportImg(entity.getSelfcheckReportImg());
|
|
|
+ String selfcheckReportImg = entity.getSelfcheckReportImg();
|
|
|
+ if (selfcheckReportImg.contains(",")) {
|
|
|
+ int count = selfcheckReportImg.length() - selfcheckReportImg.replace(",", "").length();
|
|
|
+ Validate.notTrue(count > 3, ValuePool.INSPECTION_SELF_CHECK_IMAGE_COUNT);
|
|
|
+ }
|
|
|
+
|
|
|
+ old.setSelfcheckReportImg(selfcheckReportImg);
|
|
|
old.setSelfcheckDate(entity.getSelfcheckDate());
|
|
|
old.setStepStatus(entity.getStepStatus());
|
|
|
|
|
@@ -402,8 +408,14 @@ public class AnnualInspectionController {
|
|
|
Integer stepName = ValuePool.nullable(entity.getStepName(), 1);
|
|
|
Validate.equals(stepName, ValuePool.INSPECTION_STEP_ONE, ValuePool.inspectionCurrentStepStatusIllegal(stepName, ValuePool.INSPECTION_STEP_ONE_DESC));
|
|
|
|
|
|
+ String selfcheckReportImg = request.getSelfcheckReportImg();
|
|
|
+ if (selfcheckReportImg.contains(",")) {
|
|
|
+ int count = selfcheckReportImg.length() - selfcheckReportImg.replace(",", "").length();
|
|
|
+ Validate.notTrue(count > 3, ValuePool.INSPECTION_SELF_CHECK_IMAGE_COUNT);
|
|
|
+ }
|
|
|
+
|
|
|
entity.setSelfcheckDate(request.getSelfcheckDate());
|
|
|
- entity.setSelfcheckReportImg(request.getSelfcheckReportImg());
|
|
|
+ entity.setSelfcheckReportImg(selfcheckReportImg);
|
|
|
entity.setStepStatus(ValuePool.INSPECTION_STAGE_SELFCHECK);
|
|
|
entity.setStepName(ValuePool.INSPECTION_STEP_ONE);
|
|
|
|
|
@@ -514,7 +526,17 @@ public class AnnualInspectionController {
|
|
|
registrationCode = StrUtil.isNotEmpty(registrationCode) ? registrationCode.replace(illegalChars,"-") : "[电梯注册代码]";
|
|
|
//图片文件夹 dir/i.AreaName-ProjectName-RegistrationCode/
|
|
|
String imgDir = StrUtil.format("{}{}{}.{}-{}-{}{}", dir, File.separator, (i + 1), areaName, projectName, registrationCode, File.separator);
|
|
|
- downloadImage(ins.getSelfcheckReportImg(), imgDir, "1.自检报告.jpg");
|
|
|
+ String selfcheckReportImg = ins.getSelfcheckReportImg();
|
|
|
+ if (Objects.nonNull(selfcheckReportImg)) {
|
|
|
+ if (selfcheckReportImg.contains(",")) {
|
|
|
+ String[] imgs = selfcheckReportImg.split(",");
|
|
|
+ for (int num = 0; num < imgs.length; num++) {
|
|
|
+ downloadImage(imgs[num], imgDir, "1.自检报告 "+ (num + 1) +".jpg");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ downloadImage(selfcheckReportImg, imgDir, "1.自检报告.jpg");
|
|
|
+ }
|
|
|
+ }
|
|
|
downloadImage(ins.getCheckResultImg(), imgDir, "2.检验结果.jpg");
|
|
|
downloadImage(ins.getCertificateImgUrl(), imgDir, "3.合格证.jpg");
|
|
|
downloadImage(ins.getAnnualInspectionImg(), imgDir, "4.年检报告.jpg");
|