|
@@ -216,7 +216,7 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
|
|
|
*/
|
|
|
@Override
|
|
|
public Page<WarehousingOrder> selectInfo(WarehousingOrder warehousingOrder) {
|
|
|
- Map<String, Object> pageView = new HashMap<>();
|
|
|
+ Map<String, Object> pageView = new HashMap<>(20);
|
|
|
pageView.put("startRecord", (warehousingOrder.getCurrentPage() - 1)
|
|
|
* warehousingOrder.getPageSize());
|
|
|
List<String> businessKeys = null;
|
|
@@ -2599,13 +2599,13 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
|
|
|
warehousingOrder1.setAfterWeight((warehouseInOutInfoList.stream().mapToDouble(WarehouseInOutInfo::getPureWeight).sum()));
|
|
|
}
|
|
|
}
|
|
|
- else if ("收购入库".equals(warehousingOrder1.getInType())){
|
|
|
- List<PaymentManagement> paymentManagementList=paymentManagementService.selectList(new EntityWrapper<PaymentManagement>()
|
|
|
- .eq("order_id",warehousingOrder1.getId()));
|
|
|
- if (!CollectionUtils.isEmpty(paymentManagementList)){
|
|
|
- warehousingOrder1.setAfterWeight(((paymentManagementList.stream().mapToDouble(PaymentManagement::getPureWeight).sum())/ 1000));
|
|
|
- }
|
|
|
- }
|
|
|
+// else if ("收购入库".equals(warehousingOrder1.getInType())){
|
|
|
+// List<PaymentManagement> paymentManagementList=paymentManagementService.selectList(new EntityWrapper<PaymentManagement>()
|
|
|
+// .eq("order_id",warehousingOrder1.getId()));
|
|
|
+// if (!CollectionUtils.isEmpty(paymentManagementList)){
|
|
|
+// warehousingOrder1.setAfterWeight(((paymentManagementList.stream().mapToDouble(PaymentManagement::getPureWeight).sum())/ 1000));
|
|
|
+// }
|
|
|
+// }
|
|
|
afterCost = warehousingOrder1.getSurplusWeight() * warehousingOrder1.getAvgCost() / warehousingOrder1.getAfterWeight();
|
|
|
warehousingOrder1.setSurplusWeight(0d);
|
|
|
warehousingOrder1.setOutWarehouseWeight(warehousingOrder1.getInWarehouseWeight());
|
|
@@ -2744,7 +2744,29 @@ public class WarehousingOrderServiceImpl extends ServiceImpl<WarehousingOrderMap
|
|
|
List<PaymentManagement> paymentManagementList=paymentManagementService.selectList(new EntityWrapper<PaymentManagement>()
|
|
|
.eq("order_id",warehousingOrder1.getId()));
|
|
|
if (!CollectionUtils.isEmpty(paymentManagementList)){
|
|
|
- dryWeight =dryWeight+((paymentManagementList.stream().mapToDouble(PaymentManagement::getPureWeight).sum())/ 1000) ;
|
|
|
+// dryWeight =dryWeight+((paymentManagementList.stream().mapToDouble(PaymentManagement::getPureWeight).sum())/ 1000) ;
|
|
|
+ //todo
|
|
|
+ for(PaymentManagement paymentManagement : paymentManagementList){
|
|
|
+ List<QualityInspectionManagement> qualityInspectionManagementList=qualityInspectionManagementService.selectList
|
|
|
+ (new EntityWrapper<QualityInspectionManagement>().eq("quality_no",paymentManagement.getPaymentNo()));
|
|
|
+ if (!CollectionUtils.isEmpty(qualityInspectionManagementList)){
|
|
|
+ for (QualityInspectionManagement qualityInspectionManagement1 : qualityInspectionManagementList){
|
|
|
+ Double num = 0d;
|
|
|
+ if(Double.valueOf(qualityInspectionManagement1.getWaterContent()) >= 30){
|
|
|
+ num = (100-(Double.valueOf(qualityInspectionManagement1.getWaterContent()) - 14) * 1.3) / 100;
|
|
|
+ }
|
|
|
+ else if(Double.valueOf(qualityInspectionManagement1.getWaterContent())<= 15){
|
|
|
+ num = (100-(Double.valueOf(qualityInspectionManagement1.getWaterContent()) - 14) * 1.15) / 100;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ num = (100-(Double.valueOf(qualityInspectionManagement1.getWaterContent()) - 14) *
|
|
|
+ (1.3 - (30 - Double.valueOf(qualityInspectionManagement1.getWaterContent()))*0.01)) /100;
|
|
|
+ }
|
|
|
+ DecimalFormat df = new DecimalFormat(".000");
|
|
|
+ dryWeight = Double.valueOf(df.format(dryWeight + (num * warehousingOrder1.getSurplusWeight())));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|