zhangyuewww 2 年之前
父节点
当前提交
901e351681

+ 2 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -1060,6 +1060,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             stockSaleReceiptReport.setNetWeight(-warehouseInOutInfo.getNetWeight());
                             stockSaleReceiptReport.setNetWeight(-warehouseInOutInfo.getNetWeight());
                             stockSaleReceiptReport.setReturnDate(warehouseInOutInfo.getInOutDate());
                             stockSaleReceiptReport.setReturnDate(warehouseInOutInfo.getInOutDate());
                             if(contractManagementInfo1.getUnitContractPrice()!=null) {
                             if(contractManagementInfo1.getUnitContractPrice()!=null) {
+                                stockSaleReceiptReport.setSettlementPrice(contractManagementInfo1.getUnitContractPrice());
                                 stockSaleReceiptReport.setAmountIngReceivable(-warehouseInOutInfo.getNetWeight() * contractManagementInfo1.getUnitContractPrice());
                                 stockSaleReceiptReport.setAmountIngReceivable(-warehouseInOutInfo.getNetWeight() * contractManagementInfo1.getUnitContractPrice());
                             }
                             }
                             stockSaleReceiptReport.setSettlementWeight(-warehouseInOutInfo.getNetWeight());
                             stockSaleReceiptReport.setSettlementWeight(-warehouseInOutInfo.getNetWeight());
@@ -4374,6 +4375,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
                             stockSaleReceiptReport.setNetWeight(-warehouseInOutInfo.getNetWeight());
                             stockSaleReceiptReport.setNetWeight(-warehouseInOutInfo.getNetWeight());
                             stockSaleReceiptReport.setReturnDate(warehouseInOutInfo.getInOutDate());
                             stockSaleReceiptReport.setReturnDate(warehouseInOutInfo.getInOutDate());
                             if(contractManagementInfo1.getUnitContractPrice()!=null) {
                             if(contractManagementInfo1.getUnitContractPrice()!=null) {
+                                stockSaleReceiptReport.setSettlementPrice(contractManagementInfo1.getUnitContractPrice());
                                 stockSaleReceiptReport.setAmountIngReceivable(-warehouseInOutInfo.getNetWeight() * (Double.valueOf(String.valueOf(weighingManagement.getContractPrice() == null ? contractManagementInfo1.getUnitContractPrice() : weighingManagement.getContractPrice()))));
                                 stockSaleReceiptReport.setAmountIngReceivable(-warehouseInOutInfo.getNetWeight() * (Double.valueOf(String.valueOf(weighingManagement.getContractPrice() == null ? contractManagementInfo1.getUnitContractPrice() : weighingManagement.getContractPrice()))));
                             }
                             }
                             stockSaleReceiptReport.setSettlementWeight(-warehouseInOutInfo.getNetWeight());
                             stockSaleReceiptReport.setSettlementWeight(-warehouseInOutInfo.getNetWeight());

+ 22 - 21
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehousingOrderServiceImpl.java

@@ -787,27 +787,28 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
                                         .eq("comp_id", warehousingOrder1.getCompId())
                                         .eq("comp_id", warehousingOrder1.getCompId())
                                         .eq("contract_no", warehousingOrder1.getContractNo())
                                         .eq("contract_no", warehousingOrder1.getContractNo())
                                         .eq("delete_flag", "0"));
                                         .eq("delete_flag", "0"));
-                                warehousingOrder.setGoodsSource(inOutWarehouseTask.getWarehouseName());
-                                //更新库点库存 (所在仓库为退货库、所属仓库为原始库、货名一致)
-                                ContractInventoryDistribution contractInventoryDistribution = contractInventoryDistributionService.selectOne(new EntityWrapper<ContractInventoryDistribution>()
-                                        .eq("comp_id", warehousingOrder1.getCompId()).eq("inventory_type", "3").eq("locus_warehouse", warehousingOrder1.getWarehouseName())
-                                        .eq("warehouse", inOutWarehouseTask.getWarehouseName())
-                                        .eq("goods_name", warehousingOrder1.getGoodsName()));
-                                if (contractInventoryDistribution != null) {
-                                    contractInventoryDistribution.setInventory(contractInventoryDistribution.getInventory() + weight * sourceRelationInfo.getProportion());
-                                    contractInventoryDistributionService.updateById(contractInventoryDistribution);
-                                } else {
-                                    ContractInventoryDistribution contractInventoryDistribution1 = new ContractInventoryDistribution();
-                                    contractInventoryDistribution1.setId(IdGenerator.generateUUID());
-                                    contractInventoryDistribution1.setCompId(warehousingOrder1.getCompId());
-                                    contractInventoryDistribution1.setWarehouseId(warehousingOrder1.getBaseId());
-                                    contractInventoryDistribution1.setInventory(weight * sourceRelationInfo.getProportion());
-                                    contractInventoryDistribution1.setWarehouse(warehousingOrder1.getWarehouseName());
-                                    contractInventoryDistribution1.setLocusWarehouse(warehousingOrder1.getWarehouseName());
-                                    contractInventoryDistribution1.setGoodsName(warehousingOrder1.getGoodsName());
-                                    contractInventoryDistribution1.setInventoryType("3");
-                                    contractInventoryDistributionService.insert(contractInventoryDistribution1);
-
+                                if (inOutWarehouseTask!=null) {
+                                    warehousingOrder.setGoodsSource(inOutWarehouseTask.getWarehouseName());
+                                    //更新库点库存 (所在仓库为退货库、所属仓库为原始库、货名一致)
+                                    ContractInventoryDistribution contractInventoryDistribution = contractInventoryDistributionService.selectOne(new EntityWrapper<ContractInventoryDistribution>()
+                                            .eq("comp_id", warehousingOrder1.getCompId()).eq("inventory_type", "3").eq("locus_warehouse", warehousingOrder1.getWarehouseName())
+                                            .eq("warehouse", inOutWarehouseTask.getWarehouseName())
+                                            .eq("goods_name", warehousingOrder1.getGoodsName()));
+                                    if (contractInventoryDistribution != null) {
+                                        contractInventoryDistribution.setInventory(contractInventoryDistribution.getInventory() + weight * sourceRelationInfo.getProportion());
+                                        contractInventoryDistributionService.updateById(contractInventoryDistribution);
+                                    } else {
+                                        ContractInventoryDistribution contractInventoryDistribution1 = new ContractInventoryDistribution();
+                                        contractInventoryDistribution1.setId(IdGenerator.generateUUID());
+                                        contractInventoryDistribution1.setCompId(warehousingOrder1.getCompId());
+                                        contractInventoryDistribution1.setWarehouseId(warehousingOrder1.getBaseId());
+                                        contractInventoryDistribution1.setInventory(weight * sourceRelationInfo.getProportion());
+                                        contractInventoryDistribution1.setWarehouse(warehousingOrder1.getWarehouseName());
+                                        contractInventoryDistribution1.setLocusWarehouse(warehousingOrder1.getWarehouseName());
+                                        contractInventoryDistribution1.setGoodsName(warehousingOrder1.getGoodsName());
+                                        contractInventoryDistribution1.setInventoryType("3");
+                                        contractInventoryDistributionService.insert(contractInventoryDistribution1);
+                                    }
                                 }
                                 }
                             }
                             }
                             this.insert(warehousingOrder);
                             this.insert(warehousingOrder);

+ 8 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java

@@ -872,6 +872,14 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
                         stockPurchaseReceiptReport.setDeleteFlag("1");
                         stockPurchaseReceiptReport.setDeleteFlag("1");
                         stockPurchaseReceiptReportService.updateById(stockPurchaseReceiptReport);
                         stockPurchaseReceiptReportService.updateById(stockPurchaseReceiptReport);
                     }
                     }
+                    //退库查询销售报表
+                    StockSaleReceiptReport stockSaleReceiptReport = stockSaleReceiptReportService.selectOne(new EntityWrapper<StockSaleReceiptReport>()
+                            .eq("warehouse_record_id",warehouseInOutInfo.getId())
+                            .eq("delete_flag","0"));
+                    if(stockSaleReceiptReport != null){
+                        stockSaleReceiptReport.setDeleteFlag("1");
+                        stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
+                    }
                 }
                 }
             }
             }
         }
         }