huangfuli пре 1 година
родитељ
комит
8976bbb520

+ 32 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/QualityInspectionManagement.java

@@ -249,6 +249,22 @@ public class QualityInspectionManagement extends BaseModel<QualityInspectionMana
      * 热损伤
      */
     private String jiaorenli;
+    /**
+     * 蛋白
+     */
+    private String protein;
+    /**
+     * 完整粒率
+     */
+    private String completeGrain;
+    /**
+     * 转基因
+     */
+    private String transgene;
+    /**
+     * 色泽、气味
+     */
+    private String colorLustre;
     /**
      * 等级key
      */
@@ -343,6 +359,22 @@ public class QualityInspectionManagement extends BaseModel<QualityInspectionMana
      * 复检热损伤
      */
     private String reJiaorenli;
+    /**
+     * 复检蛋白
+     */
+    private String reProtein;
+    /**
+     * 复检完整粒率
+     */
+    private String reCompleteGrain;
+    /**
+     * 复检转基因
+     */
+    private String reTransgene;
+    /**
+     * 复检色泽、气味
+     */
+    private String reColorLustre;
     /**
      * 复检等级key
      */

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

@@ -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())));
+                                }
+                            }
+                        }
                     }
                 }
             }

+ 8 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/QualityInspectionManagementMapper.xml

@@ -83,6 +83,14 @@
         q.imperfect_grain as imperfectGrain,
         q.jiaorenli,
         q.impurity,
+        q.protein,
+        q.complete_grain as completeGrain,
+        q.transgene,
+        q.color_lustre as colorLustre,
+        q.re_protein as reProtein,
+        q.re_complete_grain as reCompleteGrain,
+        q.re_transgene as reTransgene,
+        q.re_color_lustre as reColorLustre,
         q.mildew_grain as mildewGrain,
         q.tidal_grain_price as tidalGrainPrice,
         q.water_content as waterContent,