Commit f21c137dd51244acf374d9fdd8d733d28b37f314

Authored by chenhang4442024
1 parent 1691c6bf

fix:给orderbase订单添加(捆绑)invoice和生产科对账单号增加注释,

src/main/java/com/order/erp/domain/dto/order/OrderBaseInfoDO.java
@@ -120,4 +120,14 @@ public class OrderBaseInfoDO extends BaseDO implements Serializable { @@ -120,4 +120,14 @@ public class OrderBaseInfoDO extends BaseDO implements Serializable {
120 * 是否返单 120 * 是否返单
121 */ 121 */
122 private String returnOrder; 122 private String returnOrder;
  123 +
  124 + /**
  125 + * invoice号
  126 + */
  127 + private String invoiceNo;
  128 + /**
  129 + * 生产科对账单号
  130 + */
  131 + private String checkNo;
  132 +
123 } 133 }
src/main/java/com/order/erp/domain/vo/order/BusinessProfitRatioResultVO.java
@@ -165,7 +165,7 @@ public class BusinessProfitRatioResultVO implements Serializable { @@ -165,7 +165,7 @@ public class BusinessProfitRatioResultVO implements Serializable {
165 private BigDecimal customerTotalPriceUsd; 165 private BigDecimal customerTotalPriceUsd;
166 166
167 /** 167 /**
168 - * 生科总价$ 168 + * 生科总价$
169 */ 169 */
170 private BigDecimal productionDepartmentTotalPriceUsd; 170 private BigDecimal productionDepartmentTotalPriceUsd;
171 /** 171 /**
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoQueryVO.java
@@ -188,5 +188,14 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable { @@ -188,5 +188,14 @@ public class OrderBaseInfoQueryVO extends BasePageVO implements Serializable {
188 188
189 private List<Long> exportOrderIds; 189 private List<Long> exportOrderIds;
190 190
  191 + /**
  192 + * invoice 首页筛选invoice。
  193 + */
  194 + private List<String> invoiceNo;
  195 +
  196 + /**
  197 + * checkNo 首页筛选Check。
  198 + */
  199 + private List<String> CheckNo;
191 } 200 }
192 201
src/main/java/com/order/erp/domain/vo/order/OrderBaseInfoVO.java
@@ -25,6 +25,11 @@ public class OrderBaseInfoVO implements Serializable { @@ -25,6 +25,11 @@ public class OrderBaseInfoVO implements Serializable {
25 * 发票单号 25 * 发票单号
26 */ 26 */
27 private String invoiceNo; 27 private String invoiceNo;
  28 +
  29 + /**
  30 + * 生产科对账单号 如果要在首页添加生产科对账单号列数,就需要在这里加上。
  31 + */
  32 + private String checkNo;
28 /** 33 /**
29 * 客户编码 34 * 客户编码
30 */ 35 */
src/main/java/com/order/erp/service/order/impl/CalculateProfitServiceImpl.java
@@ -67,8 +67,6 @@ public class CalculateProfitServiceImpl { @@ -67,8 +67,6 @@ public class CalculateProfitServiceImpl {
67 */ 67 */
68 public ServerResult businessProfitRatioExport(HttpServletResponse response, BusinessProfitRatioQueryVO queryVO) throws IOException { 68 public ServerResult businessProfitRatioExport(HttpServletResponse response, BusinessProfitRatioQueryVO queryVO) throws IOException {
69 BusinessProfitRatioResultVO resultVO = buildBusinessProfitRatioResultVO(queryVO); 69 BusinessProfitRatioResultVO resultVO = buildBusinessProfitRatioResultVO(queryVO);
70 -// File file = pdfUtils.createBusinessProfitResultPdf(resultVO, "business_profit_ratio.pdf");  
71 -// FileUtil.downloadFile(request, response, file, true);  
72 //开始 70 //开始
73 Workbook workbook = new XSSFWorkbook(); 71 Workbook workbook = new XSSFWorkbook();
74 Sheet sheet = workbook.createSheet("业务净利润分析表"); 72 Sheet sheet = workbook.createSheet("业务净利润分析表");
@@ -205,10 +203,6 @@ public class CalculateProfitServiceImpl { @@ -205,10 +203,6 @@ public class CalculateProfitServiceImpl {
205 */ 203 */
206 public ServerResult innerProfitRatioExport(HttpServletResponse response,InnerProfitRatioQueryVO queryVO) throws IOException { 204 public ServerResult innerProfitRatioExport(HttpServletResponse response,InnerProfitRatioQueryVO queryVO) throws IOException {
207 InnerProfitRatioResultVO resultVO = buildInnerProfitRatioResultVO(queryVO); 205 InnerProfitRatioResultVO resultVO = buildInnerProfitRatioResultVO(queryVO);
208 -// File file = pdfUtils.createInnerProfitResultPdf(resultVO, "inner_profit_ratio.pdf");  
209 -// FileUtil.downloadFile(request, response, file, true);  
210 -////开始  
211 -//结束  
212 Workbook workbook = new XSSFWorkbook(); 206 Workbook workbook = new XSSFWorkbook();
213 Sheet sheet = workbook.createSheet("内部生产净利润分析表"); 207 Sheet sheet = workbook.createSheet("内部生产净利润分析表");
214 Row row = sheet.createRow(0); 208 Row row = sheet.createRow(0);
@@ -392,7 +386,7 @@ public class CalculateProfitServiceImpl { @@ -392,7 +386,7 @@ public class CalculateProfitServiceImpl {
392 customerRmbTotalPrice = customerRmbTotalPrice.add(new BigDecimal(profitAnalysisDO.getCustomerRmbTotalPrice())); 386 customerRmbTotalPrice = customerRmbTotalPrice.add(new BigDecimal(profitAnalysisDO.getCustomerRmbTotalPrice()));
393 customerTotalPrice=customerTotalPrice.add(new BigDecimal(profitAnalysisDO.getCustomerTotalPrice())); 387 customerTotalPrice=customerTotalPrice.add(new BigDecimal(profitAnalysisDO.getCustomerTotalPrice()));
394 productionDepartmentTotalPrice = productionDepartmentTotalPrice.add(new BigDecimal(profitAnalysisDO.getProductionDepartmentTotalPrice())); 388 productionDepartmentTotalPrice = productionDepartmentTotalPrice.add(new BigDecimal(profitAnalysisDO.getProductionDepartmentTotalPrice()));
395 - //这里的包装费用好像为美元。需要采用人民币 389 + //这里得到的包装费用好像为美元。需要采用人民币。所以乘上汇率
396 packetTotalPrice = packetTotalPrice.add(new BigDecimal(profitAnalysisDO.getPacketTotalPrice()).multiply(exchangeRate)); 390 packetTotalPrice = packetTotalPrice.add(new BigDecimal(profitAnalysisDO.getPacketTotalPrice()).multiply(exchangeRate));
397 } 391 }
398 392
@@ -433,39 +427,45 @@ public class CalculateProfitServiceImpl { @@ -433,39 +427,45 @@ public class CalculateProfitServiceImpl {
433 BigDecimal totalProfitPrice = developProfit.add(actualRatioProfitPrice).add(packetProfitPrice); 427 BigDecimal totalProfitPrice = developProfit.add(actualRatioProfitPrice).add(packetProfitPrice);
434 BusinessProfitRatioResultVO resultVO = new BusinessProfitRatioResultVO(); 428 BusinessProfitRatioResultVO resultVO = new BusinessProfitRatioResultVO();
435 BeanUtils.copyProperties(queryVO, resultVO); 429 BeanUtils.copyProperties(queryVO, resultVO);
436 - //5 430 + //5 客户总金额
437 resultVO.setCustomerTotalPrice(customerRmbTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 431 resultVO.setCustomerTotalPrice(customerRmbTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
438 - //6 432 + //6 生产科总价
439 resultVO.setProductionDepartmentTotalPrice(productionDepartmentTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 433 resultVO.setProductionDepartmentTotalPrice(productionDepartmentTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
440 // resultVO.setPacketTotalPrice(packetTotalPrice.multiply(new BigDecimal(10 )).doubleValue()); 434 // resultVO.setPacketTotalPrice(packetTotalPrice.multiply(new BigDecimal(10 )).doubleValue());
441 - //7 435 + //7 包装费用合计金额
442 resultVO.setPacketTotalPrice(packetTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 436 resultVO.setPacketTotalPrice(packetTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
  437 + // 14 包装费用合计 与包装费用合计金额都是一个值。
443 resultVO.setPacketTotalPriceCount(packetTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 438 resultVO.setPacketTotalPriceCount(packetTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
444 - //9 如果没有配置固定成本,就会得到0。 439 + //9 如果没有配置固定成本,就会得到0。 固定成本计算¥:开发持续时间*日固定成本(日固定成本需要从系统配置读取)
445 resultVO.setFixCost(fixCost.setScale(2, BigDecimal.ROUND_HALF_UP)); 440 resultVO.setFixCost(fixCost.setScale(2, BigDecimal.ROUND_HALF_UP));
446 - //10.1 441 + //10.1 西班牙团队提成比例:订单总金额*配置比例。
447 resultVO.setSpainRatioProfitPrice(spainRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 442 resultVO.setSpainRatioProfitPrice(spainRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
448 - //10.2 443 + //10.2 中国团队提成比例:订单总金额*配置比例。
449 resultVO.setChinaRatioProfitPrice(chinaRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 444 resultVO.setChinaRatioProfitPrice(chinaRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
450 - //11 445 + //11 支出合计计算¥:生产科总金额+包装费用总金额+研发开发费+复制费用+固定成本+西班牙提成+中国团队提成
451 resultVO.setOutTotalPrice(outTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 446 resultVO.setOutTotalPrice(outTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
452 - //13 447 + //13 研发贸易净利润¥: 客户金额合计-支出合计(正数黑色字体、负数红色字体并加上-号)
453 resultVO.setDevelopProfit(developProfit.setScale(2, BigDecimal.ROUND_HALF_UP)); 448 resultVO.setDevelopProfit(developProfit.setScale(2, BigDecimal.ROUND_HALF_UP));
454 - //18 449 + //18 包装费用收益计算¥:包装费用合计金额-包装费用实际金额
455 resultVO.setPacketProfitPrice(packetProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 450 resultVO.setPacketProfitPrice(packetProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
456 - //19 451 + //19 汇率收益计算:实际汇率(财务手动输入)-固定汇率(取系统汇率)*客户金额合计(基础信息汇总)
457 resultVO.setActualRatioProfitPrice(actualRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 452 resultVO.setActualRatioProfitPrice(actualRatioProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
458 - //20 453 + //20 综合收益计算¥: 贸易研发净利润+包装费用收益+汇率收益。
459 resultVO.setTotalProfitPrice(totalProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 454 resultVO.setTotalProfitPrice(totalProfitPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
460 - // 16 455 + // 16 实际跟单单价:包装费用实际金额除订单数量。
461 resultVO.setActualRmbPrice(queryVO.getPacketActualTotalPrice().divide(new BigDecimal(sumCount), 2, BigDecimal.ROUND_HALF_UP)); 456 resultVO.setActualRmbPrice(queryVO.getPacketActualTotalPrice().divide(new BigDecimal(sumCount), 2, BigDecimal.ROUND_HALF_UP));
  457 + // 17 实际跟单单价折算美金:实际跟单单价/汇率(6.2)
462 resultVO.setActualPrice((resultVO.getActualRmbPrice().divide(exchangeRate,2, BigDecimal.ROUND_HALF_UP))); 458 resultVO.setActualPrice((resultVO.getActualRmbPrice().divide(exchangeRate,2, BigDecimal.ROUND_HALF_UP)));
463 resultVO.setOrderCount(sumCount); 459 resultVO.setOrderCount(sumCount);
464 - //12 460 + //12 毛利润计算:客户总价-生产科总价-包装费用总价。
465 resultVO.setGrossProfit(customerRmbTotalPrice.subtract(productionDepartmentTotalPrice).subtract(packetTotalPrice).setScale(2, BigDecimal.ROUND_HALF_UP)); 461 resultVO.setGrossProfit(customerRmbTotalPrice.subtract(productionDepartmentTotalPrice).subtract(packetTotalPrice).setScale(2, BigDecimal.ROUND_HALF_UP));
  462 + // 项目号
466 resultVO.setProjectNo(String.join(",",projectList)); 463 resultVO.setProjectNo(String.join(",",projectList));
  464 + // 包装费用合计(美元)
467 resultVO.setPacketTotalPriceUsd(packetTotalPrice.divide(exchangeRate, 2, RoundingMode.HALF_UP)); 465 resultVO.setPacketTotalPriceUsd(packetTotalPrice.divide(exchangeRate, 2, RoundingMode.HALF_UP));
  466 + // 客户总金额(美元)
468 resultVO.setCustomerTotalPriceUsd(customerTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP)); 467 resultVO.setCustomerTotalPriceUsd(customerTotalPrice.setScale(2, BigDecimal.ROUND_HALF_UP));
  468 + //生产科总金额合计(美元)
469 resultVO.setProductionDepartmentTotalPriceUsd(productionDepartmentTotalPrice.divide(exchangeRate, 2, RoundingMode.HALF_UP)); 469 resultVO.setProductionDepartmentTotalPriceUsd(productionDepartmentTotalPrice.divide(exchangeRate, 2, RoundingMode.HALF_UP));
470 return resultVO; 470 return resultVO;
471 } 471 }
@@ -567,7 +567,7 @@ public class CalculateProfitServiceImpl { @@ -567,7 +567,7 @@ public class CalculateProfitServiceImpl {
567 .divide(queryVO.getProductionDepartmentPredictPrice(),4,BigDecimal.ROUND_HALF_UP); 567 .divide(queryVO.getProductionDepartmentPredictPrice(),4,BigDecimal.ROUND_HALF_UP);
568 } 568 }
569 } 569 }
570 - //如果大于1.05则就把内部生产提成变为0 570 + //需求要求:如果计算出来的预算占比大于1.05则就把内部生产提成变为0
571 if(predictRatio.compareTo(bigDecimal)>0){ 571 if(predictRatio.compareTo(bigDecimal)>0){
572 innerProduceTotalPrice=BigDecimal.ZERO; 572 innerProduceTotalPrice=BigDecimal.ZERO;
573 } 573 }
@@ -579,22 +579,25 @@ public class CalculateProfitServiceImpl { @@ -579,22 +579,25 @@ public class CalculateProfitServiceImpl {
579 579
580 InnerProfitRatioResultVO resultVO = new InnerProfitRatioResultVO(); 580 InnerProfitRatioResultVO resultVO = new InnerProfitRatioResultVO();
581 BeanUtils.copyProperties(queryVO, resultVO); 581 BeanUtils.copyProperties(queryVO, resultVO);
  582 + //生产持续时间。
582 resultVO.setProjectDays(projectDays); 583 resultVO.setProjectDays(projectDays);
  584 + //数量。
583 resultVO.setOrderCount(sumCount); 585 resultVO.setOrderCount(sumCount);
  586 + //客户总价。
584 resultVO.setCustomerTotalPrice(customerTotalPrice.setScale(2, RoundingMode.HALF_UP).doubleValue()); 587 resultVO.setCustomerTotalPrice(customerTotalPrice.setScale(2, RoundingMode.HALF_UP).doubleValue());
585 - // 5 588 + // 5 生产科总价合计
586 resultVO.setProductionDepartmentTotalPrice(productionDepartmentTotalPrice.setScale(2, RoundingMode.HALF_UP)); 589 resultVO.setProductionDepartmentTotalPrice(productionDepartmentTotalPrice.setScale(2, RoundingMode.HALF_UP));
587 - // 9 590 + // 9 内部生产固定成本:生产持续时间*固定陈本(配置)
588 resultVO.setInnerProduceFixProfit(innerProduceFixProfit.setScale(2, RoundingMode.HALF_UP)); 591 resultVO.setInnerProduceFixProfit(innerProduceFixProfit.setScale(2, RoundingMode.HALF_UP));
589 - // 7.1 592 + // 7.1预算占比计算:实际发生费用/生产科预算金额。
590 resultVO.setPredictRatio(predictRatio.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)); 593 resultVO.setPredictRatio(predictRatio.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP));
591 - // 将计算结果乘以 100,并四舍五入到整数 594 + // 将计算结果乘以 100,并四舍五入到整数 预算占比与实际占比差:1-预算占比。
592 resultVO.setPredictAndActualRatio(predictAndActualRatio.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP)); 595 resultVO.setPredictAndActualRatio(predictAndActualRatio.multiply(new BigDecimal(100)).setScale(2, RoundingMode.HALF_UP));
593 - // 8 596 + // 8 内部生产毛利润计算:生产科总价减去实际发生费用。
594 resultVO.setGrossProfit(grossProfit.setScale(2, RoundingMode.HALF_UP)); 597 resultVO.setGrossProfit(grossProfit.setScale(2, RoundingMode.HALF_UP));
595 - // 10 598 + // 10 内部生产提成计算:订单数量*生产提成单价
596 resultVO.setInnerProduceTotalPrice(innerProduceTotalPrice.setScale(2, RoundingMode.HALF_UP)); 599 resultVO.setInnerProduceTotalPrice(innerProduceTotalPrice.setScale(2, RoundingMode.HALF_UP));
597 - // 11 600 + // 11 内部生产净利润计算:生产科总价-实际发生费用-内部生产提成计算-内部生产固定成本。
598 resultVO.setInnerProduceTotalProfit(innerProduceTotalProfit.setScale(2, RoundingMode.HALF_UP)); 601 resultVO.setInnerProduceTotalProfit(innerProduceTotalProfit.setScale(2, RoundingMode.HALF_UP));
599 //项目号 602 //项目号
600 resultVO.setProjectNo(String.join(", ", projectNoSet)); 603 resultVO.setProjectNo(String.join(", ", projectNoSet));
src/main/java/com/order/erp/service/order/impl/InvoiceBillOrderServiceImpl.java
@@ -573,13 +573,18 @@ public class InvoiceBillOrderServiceImpl extends ServiceImpl&lt;InvoiceBillOrderMap @@ -573,13 +573,18 @@ public class InvoiceBillOrderServiceImpl extends ServiceImpl&lt;InvoiceBillOrderMap
573 createVO.setId(null); 573 createVO.setId(null);
574 } 574 }
575 575
576 - validaBillOrder(createVO); 576 + List<OrderBaseInfoDO> orderBaseInfoDOList = validaBillOrder(createVO);
577 577
578 InvoiceBillOrderDO invoiceBillOrderDO = buildInvoiceBillOrderDO(createVO); 578 InvoiceBillOrderDO invoiceBillOrderDO = buildInvoiceBillOrderDO(createVO);
579 579
580 - boolean success= transactionHelper.run(() -> {  
581 - save(invoiceBillOrderDO); 580 + List<OrderBaseInfoDO> containInvoiceOrderBaseInfoList=orderBaseInfoDOList.stream().map(x->{
  581 + x.setInvoiceNo(createVO.getInvoiceNo());
  582 + return x;
  583 + }).collect(Collectors.toList());
582 584
  585 + boolean success= transactionHelper.run(() -> {
  586 + save(invoiceBillOrderDO);
  587 + orderBaseInfoService.updateBatchById(containInvoiceOrderBaseInfoList);
583 invoiceBillMappingService.saveBatch(buildInvoiceBillMappingDOS(createVO, invoiceBillOrderDO)); 588 invoiceBillMappingService.saveBatch(buildInvoiceBillMappingDOS(createVO, invoiceBillOrderDO));
584 return true; 589 return true;
585 }); 590 });
@@ -729,7 +734,7 @@ public class InvoiceBillOrderServiceImpl extends ServiceImpl&lt;InvoiceBillOrderMap @@ -729,7 +734,7 @@ public class InvoiceBillOrderServiceImpl extends ServiceImpl&lt;InvoiceBillOrderMap
729 /** 734 /**
730 * @param createVO 735 * @param createVO
731 */ 736 */
732 - private void validaBillOrder(InvoiceBillCreateVO createVO) { 737 + private List<OrderBaseInfoDO> validaBillOrder(InvoiceBillCreateVO createVO) {
733 if (CollectionUtils.isEmpty(createVO.getOrderIds())) { 738 if (CollectionUtils.isEmpty(createVO.getOrderIds())) {
734 throw new BusinessException("请勾选订单!"); 739 throw new BusinessException("请勾选订单!");
735 } 740 }
@@ -781,6 +786,7 @@ public class InvoiceBillOrderServiceImpl extends ServiceImpl&lt;InvoiceBillOrderMap @@ -781,6 +786,7 @@ public class InvoiceBillOrderServiceImpl extends ServiceImpl&lt;InvoiceBillOrderMap
781 if (CollectionUtils.isNotEmpty(invoiceBillMappingDOList)) { 786 if (CollectionUtils.isNotEmpty(invoiceBillMappingDOList)) {
782 throw new BusinessException("该勾选的订单已经绑定其他账单了!"); 787 throw new BusinessException("该勾选的订单已经绑定其他账单了!");
783 } 788 }
  789 + return orderBaseInfoDOList;
784 } 790 }
785 791
786 /** 792 /**
@@ -951,6 +957,7 @@ public class InvoiceBillOrderServiceImpl extends ServiceImpl&lt;InvoiceBillOrderMap @@ -951,6 +957,7 @@ public class InvoiceBillOrderServiceImpl extends ServiceImpl&lt;InvoiceBillOrderMap
951 */ 957 */
952 @Override 958 @Override
953 public ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) { 959 public ServerResult deleteById(InvoiceBillOrderQueryVO invoiceBillOrderQueryVO) {
  960 + //其实是不能批量删除的,前端是一个一个删除按钮点击的,但是这里还是使用数组接受的。这里是传的一个id。
954 List<Long> ids = invoiceBillOrderQueryVO.getIds(); 961 List<Long> ids = invoiceBillOrderQueryVO.getIds();
955 if (CollUtil.isEmpty(ids)) { 962 if (CollUtil.isEmpty(ids)) {
956 return ServerResult.fail("ids 参数不能为空"); 963 return ServerResult.fail("ids 参数不能为空");
src/main/java/com/order/erp/service/order/impl/OrderFieldLockApplyServiceImpl.java
@@ -441,36 +441,31 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp @@ -441,36 +441,31 @@ public class OrderFieldLockApplyServiceImpl extends ServiceImpl&lt;OrderFieldLockAp
441 queryWrapper.eq(Objects.nonNull(queryVO.getType()), OrderFieldLockApplyDO::getType, queryVO.getType()); 441 queryWrapper.eq(Objects.nonNull(queryVO.getType()), OrderFieldLockApplyDO::getType, queryVO.getType());
442 } 442 }
443 } 443 }
444 - /* //只针对于应收款的过滤信息。这两个搜索框只会在应收款和应付款中进行展示。 还没有测试行不行。  
445 - if (StringUtils.isNotBlank(queryVO.getInvoiceNo())) {  
446 - String invoiceNos = queryVO.getInvoiceNo();  
447 - // 防止空值或分割后的数组为空  
448 - if (invoiceNos != null && !invoiceNos.trim().isEmpty()) {  
449 - String[] invoiceNoArray = invoiceNos.split(",");  
450 - // 确保数组不为空并过滤空白元素  
451 - String condition = Arrays.stream(invoiceNoArray)  
452 - .filter(StringUtils::isNotBlank) // 过滤掉空白字符串  
453 - .map(val -> "'" + val.trim() + "'") // 去掉多余空格并加单引号  
454 - .collect(Collectors.joining(","));  
455 - if (!condition.isEmpty()) { // 防止最终拼接的条件为空  
456 - queryWrapper.apply("JSON_UNQUOTE(JSON_EXTRACT(fields, '$.invoiceNo')) IN (" + condition + ")");  
457 - } 444 + // 已测试,没问题。用途:在应收款和应付款中,通过输入invoiceNo和checkNo进行筛选查询。 变量名为invoice和checkNo。
  445 + /* if (StringUtils.isNotBlank(queryVO.getInvoiceNo())) {
  446 + // 获取并修整 invoiceNo 字符串
  447 + String invoiceNos = queryVO.getInvoiceNo().trim();
  448 + // 检查处理后的字符串是否仍然有效
  449 + if (!invoiceNos.isEmpty()) {
  450 + // 使用参数化查询避免 SQL 拼接问题
  451 + queryWrapper.apply(
  452 + "JSON_UNQUOTE(JSON_EXTRACT(fields, '$.invoiceBillOrderDO.invoiceNo')) = {0}",
  453 + invoiceNos
  454 + );
458 } 455 }
459 } 456 }
460 -//只针对于应付款的过滤信息。 457 +
  458 +//只针对于应付款的过滤信息。 前端要设置搜索框的变量为checkNo。
461 if (StringUtils.isNotBlank(queryVO.getCheckNo())) { 459 if (StringUtils.isNotBlank(queryVO.getCheckNo())) {
462 - String checkNos = queryVO.getCheckNo();  
463 - // 防止空值或分割后的数组为空  
464 - if (checkNos != null && !checkNos.trim().isEmpty()) {  
465 - String[] checkNoArray = checkNos.split(",");  
466 - // 确保数组不为空并过滤空白元素  
467 - String condition = Arrays.stream(checkNoArray)  
468 - .filter(StringUtils::isNotBlank) // 过滤掉空白字符串  
469 - .map(val -> "'" + val.trim() + "'") // 去掉多余空格并加单引号  
470 - .collect(Collectors.joining(","));  
471 - if (!condition.isEmpty()) { // 防止最终拼接的条件为空  
472 - queryWrapper.apply("JSON_UNQUOTE(JSON_EXTRACT(fields, '$.invoiceNo')) IN (" + condition + ")");  
473 - } 460 + // 获取并修整 checkNo字符串
  461 + String checkNos = queryVO.getCheckNo().trim();
  462 + // 检查处理后的字符串是否仍然有效
  463 + if (!checkNos.isEmpty()) {
  464 + // 使用参数化查询避免 SQL 拼接问题
  465 + queryWrapper.apply(
  466 + "JSON_UNQUOTE(JSON_EXTRACT(fields, '$.checkBillOrderDO.checkNo')) = {0}",
  467 + checkNos
  468 + );
474 } 469 }
475 }*/ 470 }*/
476 //由于不懂下面的代码,所以我只对我需要的需求进行判断,我只针对我需要的这种情况,其他情况下就不走这种情况。 471 //由于不懂下面的代码,所以我只对我需要的需求进行判断,我只针对我需要的这种情况,其他情况下就不走这种情况。
src/main/java/com/order/erp/service/order/impl/ProducePaymentCheckBillOrderServiceImpl.java
@@ -533,13 +533,17 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl&lt;Produce @@ -533,13 +533,17 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl&lt;Produce
533 if (Objects.nonNull(createVO.getId())) { 533 if (Objects.nonNull(createVO.getId())) {
534 createVO.setId(null); 534 createVO.setId(null);
535 } 535 }
536 - validaBillOrder(createVO); 536 + List<OrderBaseInfoDO> orderBaseInfoDOList = validaBillOrder(createVO);
537 537
538 ProducePaymentCheckBillOrderDO checkBillOrderDO = buildCheckBillOrderDO(createVO); 538 ProducePaymentCheckBillOrderDO checkBillOrderDO = buildCheckBillOrderDO(createVO);
  539 + List<OrderBaseInfoDO> containCheckOrderBaseInfoList = orderBaseInfoDOList.stream().map(x -> {
  540 + x.setCheckNo(createVO.getCheckNo());
  541 + return x;
  542 + }).collect(Collectors.toList());
539 543
540 Boolean success = transactionHelper.run(() -> { 544 Boolean success = transactionHelper.run(() -> {
541 save(checkBillOrderDO); 545 save(checkBillOrderDO);
542 - 546 + orderBaseInfoService.updateBatchById(containCheckOrderBaseInfoList);
543 checkBillMappingService.saveBatch(buildCheckBillMappingDOS(createVO, checkBillOrderDO)); 547 checkBillMappingService.saveBatch(buildCheckBillMappingDOS(createVO, checkBillOrderDO));
544 return true; 548 return true;
545 }); 549 });
@@ -693,7 +697,7 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl&lt;Produce @@ -693,7 +697,7 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl&lt;Produce
693 /** 697 /**
694 * @param createVO 698 * @param createVO
695 */ 699 */
696 - private void validaBillOrder(ProducePaymentCheckBillCreateVO createVO) { 700 + private List<OrderBaseInfoDO> validaBillOrder(ProducePaymentCheckBillCreateVO createVO) {
697 if (CollectionUtils.isEmpty(createVO.getOrderIds())) { 701 if (CollectionUtils.isEmpty(createVO.getOrderIds())) {
698 throw new BusinessException("请勾选订单!"); 702 throw new BusinessException("请勾选订单!");
699 } 703 }
@@ -753,6 +757,7 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl&lt;Produce @@ -753,6 +757,7 @@ public class ProducePaymentCheckBillOrderServiceImpl extends ServiceImpl&lt;Produce
753 throw new BusinessException("勾选订单的生产科不一致!"); 757 throw new BusinessException("勾选订单的生产科不一致!");
754 } 758 }
755 } 759 }
  760 + return orderBaseInfoDOList;
756 } 761 }
757 762
758 /** 763 /**