|
|
@ -199,26 +199,12 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean<String> saveOrUpdateApplyInBound(ScmApplyInboundDto dto) { |
|
|
|
List<ScmFileDto> scmFiles = dto.getScmFiles(); |
|
|
|
List<ScmApplyInboundVehicleDto> vehicleList = dto.getVehicleList(); |
|
|
|
if (vehicleList.size() == 0) { |
|
|
|
return new ResultBean().fail().setMsg("车辆列表不能为空"); |
|
|
|
} |
|
|
|
for (ScmApplyInboundVehicleDto scmApplyInboundVehicleDto : vehicleList) { |
|
|
|
String vinNo = scmApplyInboundVehicleDto.getVinNo(); |
|
|
|
vinNo = vinNo.trim(); |
|
|
|
vinNo = vinNo.replace(" ",""); |
|
|
|
if (vinNo.length() != 17){ |
|
|
|
if (vinNo.length() != 8){ |
|
|
|
return new ResultBean().fail().setMsg(scmApplyInboundVehicleDto.getVinNo()+"车架号输入不正确"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String orgPath = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgPath())) { |
|
|
|
orgPath = dto.getOrgPath(); |
|
|
|
} else { |
|
|
|
SysOrganizationVo sysOrganizationVo = sysOrganizationFeign.fetchBySid(dto.getOrgSid()).getData(); |
|
|
|
if (sysOrganizationVo != null){ |
|
|
|
if (sysOrganizationVo != null) { |
|
|
|
orgPath = sysOrganizationVo.getOrgSidPath(); |
|
|
|
} |
|
|
|
/*//根据用户sid获取staffSid
|
|
|
@ -262,6 +248,22 @@ public class ScmApplyInboundService extends MybatisBaseService<ScmApplyInboundMa |
|
|
|
if (StringUtils.isBlank(dto.getDepartureDate())) { |
|
|
|
return new ResultBean().fail().setMsg("请填写厂家发车日期"); |
|
|
|
} |
|
|
|
List<ScmApplyInboundVehicleDto> vehicleList = dto.getVehicleList(); |
|
|
|
if (vehicleList == null) { |
|
|
|
return new ResultBean().fail().setMsg("车辆列表不能为空"); |
|
|
|
} |
|
|
|
for (ScmApplyInboundVehicleDto scmApplyInboundVehicleDto : vehicleList) { |
|
|
|
if (StringUtils.isNotBlank(scmApplyInboundVehicleDto.getVinNo())) { |
|
|
|
String vinNo = scmApplyInboundVehicleDto.getVinNo(); |
|
|
|
vinNo = vinNo.trim(); |
|
|
|
vinNo = vinNo.replace(" ", ""); |
|
|
|
if (vinNo.length() != 17) { |
|
|
|
if (vinNo.length() != 8) { |
|
|
|
return new ResultBean().fail().setMsg(scmApplyInboundVehicleDto.getVinNo() + "车架号输入不正确"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> vinNoList = vehicleList.stream().filter(vehicle -> StringUtils.isNotBlank(vehicle.getVinNo())).map(vehicle -> vehicle.getVinNo()).collect(Collectors.toList()); |
|
|
|
// 采购订单下线日期一旦维护,二次确认,则不能修改 TODO
|
|
|
|
// 验证填写的车架号是否重复
|
|
|
|