|
|
@ -1493,6 +1493,16 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
for (BaseVehicleZSOutDto zcDto : zcDtos) { |
|
|
|
String price = zcDto.getPrice(); |
|
|
|
totalDealPrice = totalDealPrice.add(new BigDecimal(price)); |
|
|
|
//查询出库的车辆是否满足出库条件
|
|
|
|
int count = baseMapper.selectCountByVinSid(zcDto.getVinSid()); |
|
|
|
if (count > 0) { |
|
|
|
return rb.setMsg(zcDto.getVinNo() + "车辆不满足出库条件"); |
|
|
|
} |
|
|
|
//查询是否已出库
|
|
|
|
int counts = baseMapper.selectCountBySidVin(zcDto.getVinSid()); |
|
|
|
if (counts > 0) { |
|
|
|
return rb.setMsg("该车辆已出库,不允许重复出库"); |
|
|
|
} |
|
|
|
} |
|
|
|
baseVehicleOutApply.setTotalDealPrice(totalDealPrice.toString()); |
|
|
|
//保存车辆出库单主表
|
|
|
@ -1527,6 +1537,16 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
for (BaseVehicleZSOutDto dto : zcDtos) { |
|
|
|
String vinSid = dto.getVinSid(); |
|
|
|
BaseVehicle baseVehicle1 = baseVehicleService.fetchBySid(vinSid); |
|
|
|
//更新车辆台账的出库状态等值,库存状态修改为出库,销售日期修改为当天,成交价,备注
|
|
|
|
//String remarks = baseVehicleZSOutApplyDto.getContractNo() + baseVehicleZSOutApplyDto.getSaleTypeValue();
|
|
|
|
//baseVehicle1.setRemarks(remarks);
|
|
|
|
baseVehicle1.setVehicleState(VehicleState.StockEnum.OUT_STOCK.getCode()); |
|
|
|
baseVehicle1.setVehicleStateValue(VehicleState.StockEnum.OUT_STOCK.getRemarks()); |
|
|
|
baseVehicle1.setSalesDate(new Date()); |
|
|
|
if (StringUtils.isNotBlank(dto.getPrice())) { |
|
|
|
baseVehicle1.setSalePrice(Integer.valueOf(dto.getPrice())); |
|
|
|
} |
|
|
|
baseVehicleService.updateById(baseVehicle1); |
|
|
|
//获取主车sid
|
|
|
|
List<BdCustomer> bdCustomers = new ArrayList<>(); |
|
|
|
BdCustomer bdCustomer = new BdCustomer(); |
|
|
@ -1552,16 +1572,6 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
finKingDeeFeign.saveBdCustomers(bdCustomers); |
|
|
|
} |
|
|
|
} |
|
|
|
//查询出库的车辆是否满足出库条件
|
|
|
|
int count = baseMapper.selectCountByVinSid(dto.getVinSid()); |
|
|
|
if (count > 0) { |
|
|
|
return rb.setMsg(dto.getVinNo() + "车辆不满足出库条件"); |
|
|
|
} |
|
|
|
//查询是否已出库
|
|
|
|
int counts = baseMapper.selectCountBySidVin(dto.getVinSid()); |
|
|
|
if (counts > 0) { |
|
|
|
return rb.setMsg("该车辆已出库,不允许重复出库"); |
|
|
|
} |
|
|
|
//查询主车对应的挂车或上装
|
|
|
|
List<BaseTrailerVo> baseTrailerVos = baseTrailerService.fetchAllByVehSid(dto.getVinSid()); |
|
|
|
if (baseTrailerVos.size() > 0) { |
|
|
@ -1651,16 +1661,7 @@ public class BaseVehicleOutService extends MybatisBaseService<BaseVehicleOutMapp |
|
|
|
//baseVehicleOut.setBillNo(billNo);
|
|
|
|
//保存车辆出库单子表
|
|
|
|
baseMapper.insert(baseVehicleOut); |
|
|
|
//更新车辆台账的出库状态等值,库存状态修改为出库,销售日期修改为当天,成交价,备注
|
|
|
|
//String remarks = baseVehicleZSOutApplyDto.getContractNo() + baseVehicleZSOutApplyDto.getSaleTypeValue();
|
|
|
|
//baseVehicle1.setRemarks(remarks);
|
|
|
|
baseVehicle1.setVehicleState(VehicleState.StockEnum.OUT_STOCK.getCode()); |
|
|
|
baseVehicle1.setVehicleStateValue(VehicleState.StockEnum.OUT_STOCK.getRemarks()); |
|
|
|
baseVehicle1.setSalesDate(new Date()); |
|
|
|
if (StringUtils.isNotBlank(dto.getPrice())) { |
|
|
|
baseVehicle1.setSalePrice(Integer.valueOf(dto.getPrice())); |
|
|
|
} |
|
|
|
baseVehicleService.updateById(baseVehicle1); |
|
|
|
|
|
|
|
if (!"001".equals(payTypeKey)) {//贷款
|
|
|
|
try { |
|
|
|
String temporaryNumZc = String.format("%02d", j); |
|
|
|