|
|
@ -174,22 +174,37 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String s1 = ""; |
|
|
|
String type1 = "06"; //巡检相关照片
|
|
|
|
|
|
|
|
ScmVehiclePatrolinspectionsheet scmVehiclePatrolinspectionsheet = new ScmVehiclePatrolinspectionsheet(); |
|
|
|
|
|
|
|
BeanUtil.copyProperties(dto, scmVehiclePatrolinspectionsheet, "sid"); |
|
|
|
ScmVehiclePatrolinspectionsheetDetailsVo pcInspection = baseMapper.getPCInspection(dto.getPatrolInspectionSid()); |
|
|
|
String sid = scmVehiclePatrolinspectionsheet.getSid(); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(dto.getUserSid()).getData(); |
|
|
|
|
|
|
|
if (pcInspection != null) { |
|
|
|
ScmVehiclePatrolinspectionsheetDetailsVo pcInspection = baseMapper.getPCInspection(dto.getPatrolInspectionSid()); |
|
|
|
if (pcInspection == null) { |
|
|
|
BeanUtil.copyProperties(dto, scmVehiclePatrolinspectionsheet, "sid"); |
|
|
|
scmVehiclePatrolinspectionsheet.setCreateOrgSid(useOrgSid); |
|
|
|
save(scmVehiclePatrolinspectionsheet); |
|
|
|
scmVehicleStayPatrolinspectionService.updateState(dto.getPatrolInspectionSid()); |
|
|
|
scmFileService.deleteByLinkSidAndType(scmVehiclePatrolinspectionsheet.getSid(), type1); |
|
|
|
List<String> images = dto.getImages(); |
|
|
|
for (String s : images) { |
|
|
|
if (s.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s1 = s.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
ScmFile scmFile1 = new ScmFile(); |
|
|
|
scmFile1.setAttachType(type1); |
|
|
|
scmFile1.setFileName("巡检相关照片"); |
|
|
|
scmFile1.setFilePath(s1); |
|
|
|
scmFile1.setLinkSid(scmVehiclePatrolinspectionsheet.getSid()); |
|
|
|
scmFileService.save(scmFile1); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} else { |
|
|
|
dto.setCreateOrgSid(useOrgSid); |
|
|
|
dto.setSid(pcInspection.getSid()); |
|
|
|
int i = updateBySid(dto, pcInspection.getSid()); |
|
|
|
if (i == 0) { |
|
|
|
return rb.setMsg("操作失败"); |
|
|
|
} |
|
|
|
//更新待巡检中的为已暂存
|
|
|
|
scmVehicleStayPatrolinspectionService.updateByState(dto.getPatrolInspectionSid(),2); |
|
|
|
scmVehicleStayPatrolinspectionService.updateByState(dto.getPatrolInspectionSid(), 2); |
|
|
|
scmFileService.deleteByLinkSidAndType(dto.getSid(), type1); |
|
|
|
List<String> images = dto.getImages(); |
|
|
|
for (String s : images) { |
|
|
@ -203,25 +218,8 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S |
|
|
|
scmFile1.setLinkSid(dto.getSid()); |
|
|
|
scmFileService.save(scmFile1); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
scmVehiclePatrolinspectionsheet.setCreateOrgSid(useOrgSid); |
|
|
|
scmVehiclePatrolinspectionsheet.setSid(sid); |
|
|
|
scmFileService.deleteByLinkSidAndType(scmVehiclePatrolinspectionsheet.getSid(), type1); |
|
|
|
List<String> images = dto.getImages(); |
|
|
|
for (String s : images) { |
|
|
|
if (s.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s1 = s.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
ScmFile scmFile1 = new ScmFile(); |
|
|
|
scmFile1.setAttachType(type1); |
|
|
|
scmFile1.setFileName("巡检相关照片"); |
|
|
|
scmFile1.setFilePath(s1); |
|
|
|
scmFile1.setLinkSid(scmVehiclePatrolinspectionsheet.getSid()); |
|
|
|
scmFileService.save(scmFile1); |
|
|
|
} |
|
|
|
save(scmVehiclePatrolinspectionsheet); |
|
|
|
scmVehicleStayPatrolinspectionService.updateState(dto.getPatrolInspectionSid()); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -236,7 +234,7 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S |
|
|
|
if (StringUtils.isNotBlank(dto.getDutyName())) { |
|
|
|
return rb.setMsg("选择相关责任人后,不允许点击通过"); |
|
|
|
} |
|
|
|
if(StringUtils.isNotBlank(dto.getDutySid())){ |
|
|
|
if (StringUtils.isNotBlank(dto.getDutySid())) { |
|
|
|
return rb.setMsg("选择相关责任人后,不允许点击通过"); |
|
|
|
} |
|
|
|
String s1 = ""; |
|
|
@ -282,8 +280,8 @@ public class ScmVehiclePatrolinspectionsheetService extends MybatisBaseService<S |
|
|
|
return rb.success().setMsg("操作成功"); |
|
|
|
} |
|
|
|
ScmVehiclePatrolinspectionsheet scmVehiclePatrolinspectionsheet = new ScmVehiclePatrolinspectionsheet(); |
|
|
|
BeanUtil.copyProperties(dto, scmVehiclePatrolinspectionsheet, "sid"); |
|
|
|
String sid = scmVehiclePatrolinspectionsheet.getSid(); |
|
|
|
BeanUtil.copyProperties(dto, scmVehiclePatrolinspectionsheet,"sid"); |
|
|
|
scmVehiclePatrolinspectionsheet.setCreateOrgSid(useOrgSid); |
|
|
|
scmFileService.deleteByLinkSidAndType(scmVehiclePatrolinspectionsheet.getSid(), type1); |
|
|
|
List<String> images = dto.getImages(); |
|
|
|