|
|
@ -51,6 +51,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.DateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
@ -238,6 +239,10 @@ public class ScmVehicleExamineService extends MybatisBaseService<ScmVehicleExami |
|
|
|
String useOrgSid = sysOrganizationFeign.getUseOrgByUserSid(userSid).getData().getSid(); |
|
|
|
|
|
|
|
AppScmVehicleExamineInfoVo vo = baseMapper.getCarInspectedInfo(inspectedSid, useOrgSid); |
|
|
|
if (vo.getPrice() == null || vo.getPrice().equals("")) { |
|
|
|
BigDecimal bigDecimal = new BigDecimal("0.00"); |
|
|
|
vo.setPrice(bigDecimal); |
|
|
|
} |
|
|
|
vo.setUserSid(userSid); |
|
|
|
List<ScmFile> scmFiles1 = scmFileService.selectByLinkSid(vo.getInspectedSid(), type1); |
|
|
|
for (ScmFile scmFile : scmFiles1) { |
|
|
@ -266,7 +271,10 @@ public class ScmVehicleExamineService extends MybatisBaseService<ScmVehicleExami |
|
|
|
List<String> carInspectedImages = new ArrayList<>(); |
|
|
|
|
|
|
|
AppScmVehicleExamineDetailsVo vo = baseMapper.getCarInspected(inspectedSid); |
|
|
|
|
|
|
|
if (vo.getPrice() == null || vo.getPrice().equals("")) { |
|
|
|
BigDecimal bigDecimal = new BigDecimal("0.00"); |
|
|
|
vo.setPrice(bigDecimal); |
|
|
|
} |
|
|
|
List<ScmFile> scmFiles1 = scmFileService.selectByLinkSid(inspectedSid, type1); |
|
|
|
for (ScmFile scmFile : scmFiles1) { |
|
|
|
factoryImages.add(fileUploadComponent.getUrlPrefix() + scmFile.getFilePath()); |
|
|
@ -289,6 +297,15 @@ public class ScmVehicleExamineService extends MybatisBaseService<ScmVehicleExami |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean saveCarInspectedInfo(AppScmVehicleExamineDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(dto.getPurchaseKey())) { |
|
|
|
return rb.setMsg("车架号不能为空"); |
|
|
|
} |
|
|
|
if (dto.getCarInspectedImage().size() <= 0) { |
|
|
|
return rb.setMsg("验车相关照片不能为空"); |
|
|
|
} |
|
|
|
if (dto.getFactoryImage().size() <= 0) { |
|
|
|
return rb.setMsg("厂家验车照片不能为空"); |
|
|
|
} |
|
|
|
String staffSid = sysUserFeign.getUserOrgInfoByUserSid(dto.getUserSid()).getData().getStaffSid(); |
|
|
|
SysStaffinfoVo data = sysUserFeign.getSysUserByMobile(staffSid).getData(); |
|
|
|
String s1 = ""; |
|
|
@ -338,11 +355,13 @@ public class ScmVehicleExamineService extends MybatisBaseService<ScmVehicleExami |
|
|
|
scmFile2.setLinkSid(dto.getInspectedSid()); |
|
|
|
scmFileService.save(scmFile2); |
|
|
|
} |
|
|
|
return rb.success().setMsg("操作成功!"); |
|
|
|
|
|
|
|
} else if ("2".equals(scmVehicleExamine.getInspectionResult())) { |
|
|
|
return rb.fail().setMsg("当前车辆已验车完成,请勿重复保存"); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.fail().setMsg("保存失败"); |
|
|
|
return rb.fail().setMsg("操作失败!"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -353,6 +372,15 @@ public class ScmVehicleExamineService extends MybatisBaseService<ScmVehicleExami |
|
|
|
*/ |
|
|
|
public ResultBean submitCarInspectedInfo(AppScmVehicleExamineSubmitDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(dto.getPurchaseKey())) { |
|
|
|
return rb.setMsg("车架号不能为空"); |
|
|
|
} |
|
|
|
if (dto.getCarInspectedImage().size() <= 0) { |
|
|
|
return rb.setMsg("验车相关照片不能为空"); |
|
|
|
} |
|
|
|
if (dto.getFactoryImage().size() <= 0) { |
|
|
|
return rb.setMsg("厂家验车照片不能为空"); |
|
|
|
} |
|
|
|
String staffSid = sysUserFeign.getUserOrgInfoByUserSid(dto.getUserSid()).getData().getStaffSid(); |
|
|
|
SysStaffinfoVo data = sysUserFeign.getSysUserByMobile(staffSid).getData(); |
|
|
|
SysOrganizationVo data1 = sysOrganizationFeign.getUseOrgByUserSid(dto.getUserSid()).getData(); |
|
|
@ -417,10 +445,12 @@ public class ScmVehicleExamineService extends MybatisBaseService<ScmVehicleExami |
|
|
|
scmFile2.setLinkSid(dto.getInspectedSid()); |
|
|
|
scmFileService.save(scmFile2); |
|
|
|
} |
|
|
|
return rb.success().setMsg("操作成功!"); |
|
|
|
|
|
|
|
} else if ("2".equals(scmVehicleExamine.getInspectionResult())) { |
|
|
|
return rb.fail().setMsg("当前车辆已验车完成,请勿重复提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.fail().setMsg("提交失败"); |
|
|
|
return rb.fail().setMsg("操作失败!"); |
|
|
|
} |
|
|
|
} |