|
@@ -1022,6 +1022,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
//他运的销售合同
|
|
|
ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("deliver_type", "2")
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
@@ -1046,7 +1047,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
stockSaleReceiptReport.setReturnFlag("1");
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.TO_BE_RECEIVED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.TO_BE_RECEIVED.getName());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(stockSaleReceiptReport.getNetWeight());
|
|
|
CostManagementInfo costManagementInfo = costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>().eq("warehouse_id", warehouseInOutInfo.getBaseId()));
|
|
|
if (costManagementInfo != null) {
|
|
|
stockSaleReceiptReport.setCost(costManagementInfo.getCost());
|
|
@@ -1057,6 +1057,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
//自运的销售合同
|
|
|
ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("deliver_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
@@ -1082,7 +1083,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
stockSaleReceiptReport.setReturnFlag("1");
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.TO_BE_RECEIVED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.TO_BE_RECEIVED.getName());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(stockSaleReceiptReport.getNetWeight());
|
|
|
CostManagementInfo costManagementInfo = costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>().eq("warehouse_id", warehouseInOutInfo.getBaseId()));
|
|
|
if (costManagementInfo != null) {
|
|
|
stockSaleReceiptReport.setCost(costManagementInfo.getCost());
|
|
@@ -1557,6 +1557,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
//他运的销售合同
|
|
|
ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("deliver_type", "2")
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
@@ -1661,7 +1662,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
}
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.TO_BE_RECEIVED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.TO_BE_RECEIVED.getName());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(stockSaleReceiptReport.getNetWeight());
|
|
|
CostManagementInfo costManagementInfo = costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>().eq("warehouse_id", warehouseInOutInfo.getBaseId()));
|
|
|
if (costManagementInfo != null) {
|
|
|
stockSaleReceiptReport.setCost(costManagementInfo.getCost());
|
|
@@ -1672,6 +1672,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
//自运的销售合同
|
|
|
ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("deliver_type", "1")
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
@@ -1860,7 +1861,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
stockSaleReceiptReport.setTare(Double.valueOf(String.valueOf(warehouseInOutInfo.getTare())));
|
|
|
stockSaleReceiptReport.setNetWeight(warehouseInOutInfo.getNetWeight());
|
|
|
stockSaleReceiptReport.setDeliveryDate(warehouseInOutInfo.getInOutDate());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(warehouseInOutInfo.getNetWeight());
|
|
|
//按出库重量结算时
|
|
|
if ("1".equals(contractManagementInfo1.getSettlementWeightMethod())) {
|
|
|
stockSaleReceiptReport.setSettlementWeight(warehouseInOutInfo.getNetWeight());
|
|
@@ -1875,7 +1875,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
}
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.TO_BE_RECEIVED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.TO_BE_RECEIVED.getName());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(stockSaleReceiptReport.getNetWeight());
|
|
|
CostManagementInfo costManagementInfo = costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>().eq("warehouse_id", warehouseInOutInfo.getBaseId()));
|
|
|
if (costManagementInfo != null) {
|
|
|
stockSaleReceiptReport.setCost(costManagementInfo.getCost());
|
|
@@ -2299,16 +2298,24 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
stockSaleReceiptReport.setGrossWeight(Double.valueOf(String.valueOf(warehouseInOutInfo.getGrossWeight())));
|
|
|
stockSaleReceiptReport.setTare(Double.valueOf(String.valueOf(warehouseInOutInfo.getTare())));
|
|
|
stockSaleReceiptReport.setNetWeight(Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
- stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
- if (warehouseInOutInfo.getCost() != null) {
|
|
|
- stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getCost())));
|
|
|
- } else {
|
|
|
- stockSaleReceiptReport.setSettlementPrice(0d);
|
|
|
+ //查销售合同
|
|
|
+ ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
+ .eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
+ .eq("delete_flag", "0"));
|
|
|
+ //按出库重量结算时
|
|
|
+ if ("1".equals(contractManagementInfo1.getSettlementWeightMethod())) {
|
|
|
+ stockSaleReceiptReport.setSettlementWeight(warehouseInOutInfo.getNetWeight());
|
|
|
+ //定价销售
|
|
|
+ if (contractManagementInfo1.getUnitContractPrice() != null) {
|
|
|
+ stockSaleReceiptReport.setSettlementPrice(contractManagementInfo1.getUnitContractPrice());
|
|
|
+ stockSaleReceiptReport.setAmountIngReceivable(warehouseInOutInfo.getNetWeight() *
|
|
|
+ (contractManagementInfo1.getUnitContractPrice()));
|
|
|
+ stockSaleReceiptReport.setAmountEdReceivable(0.00);
|
|
|
+ stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
|
|
|
+ }
|
|
|
}
|
|
|
- stockSaleReceiptReport.setAmountEdReceivable(0.0d);
|
|
|
stockSaleReceiptReport.setDeliveryDate(warehouseInOutInfo.getInOutDate());
|
|
|
- stockSaleReceiptReport.setAmountIngReceivable(stockSaleReceiptReport.getSettlementPrice() * warehouseInOutInfo.getNetWeight());
|
|
|
- stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.FORM_REVIEWED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.FORM_REVIEWED.getName());
|
|
|
stockSaleReceiptReportService.insert(stockSaleReceiptReport);
|
|
@@ -2334,11 +2341,11 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
// stockSaleReceiptReportService.updateById(stockSaleReceiptReport);
|
|
|
// workflowService.activateInstance(stockSaleReceiptReport.getWorkflowId(), stockSaleReceiptReport.getId());
|
|
|
// }
|
|
|
- ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
- .eq("contract_no", warehouseBaseInfo.getWarehouseName()).eq("delete_flag", "0"));
|
|
|
- if (contractManagementInfo1 == null) {
|
|
|
- throw new YException(YExceptionEnum.CONTRACT_NO_NOT_EXSITS_ERROR);
|
|
|
- }
|
|
|
+// ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
+// .eq("contract_no", warehouseBaseInfo.getWarehouseName()).eq("delete_flag", "0"));
|
|
|
+// if (contractManagementInfo1 == null) {
|
|
|
+// throw new YException(YExceptionEnum.CONTRACT_NO_NOT_EXSITS_ERROR);
|
|
|
+// }
|
|
|
Wrapper wrapper = new EntityWrapper<TranCarInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
.eq("car_no", warehouseInOutInfo.getCarNo())
|
|
@@ -4215,6 +4222,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
//他运的销售合同
|
|
|
ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("deliver_type", "2")
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
@@ -4239,7 +4247,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
stockSaleReceiptReport.setReturnFlag("1");
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.TO_BE_RECEIVED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.TO_BE_RECEIVED.getName());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(stockSaleReceiptReport.getNetWeight());
|
|
|
CostManagementInfo costManagementInfo = costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>().eq("warehouse_id", warehouseInOutInfo.getBaseId()));
|
|
|
if (costManagementInfo != null) {
|
|
|
stockSaleReceiptReport.setCost(costManagementInfo.getCost());
|
|
@@ -4250,6 +4257,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
//自运的销售合同
|
|
|
ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("deliver_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
@@ -4275,7 +4283,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
stockSaleReceiptReport.setReturnFlag("1");
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.TO_BE_RECEIVED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.TO_BE_RECEIVED.getName());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(stockSaleReceiptReport.getNetWeight());
|
|
|
CostManagementInfo costManagementInfo = costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>().eq("warehouse_id", warehouseInOutInfo.getBaseId()));
|
|
|
if (costManagementInfo != null) {
|
|
|
stockSaleReceiptReport.setCost(costManagementInfo.getCost());
|
|
@@ -4836,6 +4843,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
//他运的销售合同
|
|
|
ContractManagementInfo contractManagementInfo = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("deliver_type", "2")
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
@@ -4941,7 +4949,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
}
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.TO_BE_RECEIVED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.TO_BE_RECEIVED.getName());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(stockSaleReceiptReport.getNetWeight());
|
|
|
CostManagementInfo costManagementInfo = costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>().eq("warehouse_id", warehouseInOutInfo.getBaseId()));
|
|
|
if (costManagementInfo != null) {
|
|
|
stockSaleReceiptReport.setCost(costManagementInfo.getCost());
|
|
@@ -4952,6 +4959,7 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
//自运的销售合同
|
|
|
ContractManagementInfo contractManagementInfo1 = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("deliver_type", "1")
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
@@ -5160,7 +5168,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
stockSaleReceiptReport.setTare(Double.valueOf(String.valueOf(warehouseInOutInfo.getTare())));
|
|
|
stockSaleReceiptReport.setNetWeight(warehouseInOutInfo.getNetWeight());
|
|
|
stockSaleReceiptReport.setDeliveryDate(warehouseInOutInfo.getInOutDate());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(warehouseInOutInfo.getNetWeight());
|
|
|
//按出库重量结算时
|
|
|
if ("1".equals(contractManagementInfo1.getSettlementWeightMethod())) {
|
|
|
stockSaleReceiptReport.setSettlementWeight(warehouseInOutInfo.getNetWeight());
|
|
@@ -5175,7 +5182,6 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
}
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.TO_BE_RECEIVED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.TO_BE_RECEIVED.getName());
|
|
|
- stockSaleReceiptReport.setSettlementWeight(stockSaleReceiptReport.getNetWeight());
|
|
|
CostManagementInfo costManagementInfo = costManagementInfoService.selectOne(new EntityWrapper<CostManagementInfo>().eq("warehouse_id", warehouseInOutInfo.getBaseId()));
|
|
|
if (costManagementInfo != null) {
|
|
|
stockSaleReceiptReport.setCost(costManagementInfo.getCost());
|
|
@@ -5633,13 +5639,12 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
// workflowService.activateInstance(stockPurchaseReceiptReport.getWorkflowId(), stockPurchaseReceiptReport.getId());
|
|
|
// }
|
|
|
}
|
|
|
- //他运销售合同
|
|
|
+ //查询销售合同
|
|
|
ContractManagementInfo contractManagementInfoSale = contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
|
|
|
.eq("contract_no", warehouseInOutInfo.getContractNo())
|
|
|
- .eq("deliver_type", "2")
|
|
|
+ .eq("comp_id", warehouseBaseInfo.getCompId())
|
|
|
.eq("contract_type", "1")
|
|
|
.eq("delete_flag", "0"));
|
|
|
-
|
|
|
//现货销售出库报表
|
|
|
StockSaleReceiptReport stockSaleReceiptReport = new StockSaleReceiptReport();
|
|
|
stockSaleReceiptReport.setId(IdGenerator.generateUUID());
|
|
@@ -5651,17 +5656,18 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
|
|
|
stockSaleReceiptReport.setGrossWeight(Double.valueOf(String.valueOf(warehouseInOutInfo.getGrossWeight())));
|
|
|
stockSaleReceiptReport.setTare(Double.valueOf(String.valueOf(warehouseInOutInfo.getTare())));
|
|
|
stockSaleReceiptReport.setNetWeight(Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
- stockSaleReceiptReport.setSettlementWeight(Double.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight())));
|
|
|
- if (contractManagementInfoSale!=null) {
|
|
|
- stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getCost() == null ? (contractManagementInfoSale.getUnitContractPrice() == null ? 0 : contractManagementInfoSale.getUnitContractPrice()) : warehouseInOutInfo.getCost())));
|
|
|
- }
|
|
|
- else {
|
|
|
- stockSaleReceiptReport.setSettlementPrice(Double.valueOf(String.valueOf(warehouseInOutInfo.getCost() == null ? (contractManagementInfo.getUnitContractPrice() == null ? 0 : contractManagementInfo.getUnitContractPrice()) : warehouseInOutInfo.getCost())));
|
|
|
+ //按出库重量结算时
|
|
|
+ if ("1".equals(contractManagementInfoSale.getSettlementWeightMethod())) {
|
|
|
+ stockSaleReceiptReport.setSettlementWeight(warehouseInOutInfo.getNetWeight());
|
|
|
+ //定价销售
|
|
|
+ if (contractManagementInfoSale.getUnitContractPrice() != null) {
|
|
|
+ stockSaleReceiptReport.setSettlementPrice(contractManagementInfoSale.getUnitContractPrice());
|
|
|
+ stockSaleReceiptReport.setAmountIngReceivable(warehouseInOutInfo.getNetWeight() * contractManagementInfoSale.getUnitContractPrice());
|
|
|
+ stockSaleReceiptReport.setAmountEdReceivable(0.00);
|
|
|
+ stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
|
|
|
+ }
|
|
|
}
|
|
|
- stockSaleReceiptReport.setAmountEdReceivable(0.0d);
|
|
|
stockSaleReceiptReport.setDeliveryDate(warehouseInOutInfo.getInOutDate());
|
|
|
- stockSaleReceiptReport.setAmountIngReceivable(stockSaleReceiptReport.getSettlementPrice() * warehouseInOutInfo.getNetWeight());
|
|
|
- stockSaleReceiptReport.setAmountNotReceivable(stockSaleReceiptReport.getAmountIngReceivable());
|
|
|
stockSaleReceiptReport.setStatusFlag(StatusEnum.FORM_REVIEWED.getFlag());
|
|
|
stockSaleReceiptReport.setStatus(StatusEnum.FORM_REVIEWED.getName());
|
|
|
stockSaleReceiptReportService.insert(stockSaleReceiptReport);
|