Browse Source

修改单车预提推凭证10

master
fanzongzhe0036 3 months ago
parent
commit
bc227d6381
  1. 58
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java

58
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/busdeliveredapply/BusDeliveredApplyService.java

@ -1371,36 +1371,38 @@ public class BusDeliveredApplyService extends MybatisBaseService<BusDeliveredApp
}
if (cjtx.compareTo(txdck) > 0) {
BigDecimal pushMoney = cjtx.subtract(txdck);
CostAdjustmentsBill costAdjustmentsBill = new CostAdjustmentsBill();
costAdjustmentsBill.setBussDate(DateUtil.formatDate(new Date()));
List<CostAdjustmentsBill.CostAdjustmentsBillDetailDto> resultDetails = new ArrayList<>();
String useOrgCode = "";
if (StringUtils.isNotBlank(busDeliveredApply.getUseOrgSid())) {
String useOrgSid = busDeliveredApply.getUseOrgSid();
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData();
if (null != organizationVo) {
costAdjustmentsBill.setUseOrgCode(organizationVo.getOrgCode());
useOrgCode = organizationVo.getOrgCode();
if (pushMoney.compareTo(BigDecimal.ZERO) != 0) {
CostAdjustmentsBill costAdjustmentsBill = new CostAdjustmentsBill();
costAdjustmentsBill.setBussDate(DateUtil.formatDate(new Date()));
List<CostAdjustmentsBill.CostAdjustmentsBillDetailDto> resultDetails = new ArrayList<>();
String useOrgCode = "";
if (StringUtils.isNotBlank(busDeliveredApply.getUseOrgSid())) {
String useOrgSid = busDeliveredApply.getUseOrgSid();
SysOrganizationVo organizationVo = sysOrganizationFeign.fetchBySid(useOrgSid).getData();
if (null != organizationVo) {
costAdjustmentsBill.setUseOrgCode(organizationVo.getOrgCode());
useOrgCode = organizationVo.getOrgCode();
}
}
}
for (BusDeliveredApplyDetails d : detailsList) {
BaseVehicle vehicle = baseVehicleFeign.fetchBySid(d.getVinSid()).getData();
if (null != vehicle) {
costAdjustmentsBill.setCommUnit(vehicle.getManufacturerCode());
String vinCode = "";
String deptCode = "";
SysOrganizationVo data = sysOrganizationFeign.fetchBySid(vehicle.getPurchaseSystemSid()).getData();
if (null != data) {
deptCode = data.getOrgCode();
for (BusDeliveredApplyDetails d : detailsList) {
BaseVehicle vehicle = baseVehicleFeign.fetchBySid(d.getVinSid()).getData();
if (null != vehicle) {
costAdjustmentsBill.setCommUnit(vehicle.getManufacturerCode());
String vinCode = "";
String deptCode = "";
SysOrganizationVo data = sysOrganizationFeign.fetchBySid(vehicle.getPurchaseSystemSid()).getData();
if (null != data) {
deptCode = data.getOrgCode();
}
vinCode = vehicle.getVinNo().substring(vehicle.getVinNo().length() - 8);
//添加成本调整单
CostAdjustmentsBill.CostAdjustmentsBillDetailDto dto = new CostAdjustmentsBill.CostAdjustmentsBillDetailDto();
dto.setCompanyCode(useOrgCode);
dto.setMaterialID(vinCode);
dto.setDeptCode(deptCode);
dto.setAmount(pushMoney.negate().toString());
resultDetails.add(dto);
}
vinCode = vehicle.getVinNo().substring(vehicle.getVinNo().length() - 8);
//添加成本调整单
CostAdjustmentsBill.CostAdjustmentsBillDetailDto dto = new CostAdjustmentsBill.CostAdjustmentsBillDetailDto();
dto.setCompanyCode(useOrgCode);
dto.setMaterialID(vinCode);
dto.setDeptCode(deptCode);
dto.setAmount(pushMoney.negate().toString());
resultDetails.add(dto);
}
}
if (!resultDetails.isEmpty()) {

Loading…
Cancel
Save