gongdecai 1 year ago
parent
commit
d07e2abfea

+ 1 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/GeneratorCodeByTables.java

@@ -53,7 +53,7 @@ public class GeneratorCodeByTables {
     }
 
     public static void main(String[] args) throws IOException {
-        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","sales_transfer_info");
+        generateByTables("Gdc", "com.yh.saas.plugin.yiliangyiyun","car_info");
     }
 
     /**

+ 174 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BiInfoController.java

@@ -1123,6 +1123,8 @@ public class BiInfoController {
     private CommonUserMapper commonUserMapper;
     @Autowired
     private SettledCompanyInfoMapper settledCompanyInfoMapper;
+    @Autowired
+    private DryWarehouseMapper dryWarehouseMapper;
 
 
     @GetMapping("/selectPhoneBiInfo")
@@ -1388,10 +1390,182 @@ public class BiInfoController {
         biViewInfo1.setName("折算存重");
         biViewInfo1.setBiViewInfoList(biViewInfos);
         biViewInfoList.add(biViewInfo1);
+
+        //烘干     烘干入库量
+        List<BiViewInfo> biViewInfos2 = new ArrayList<>();
+        List<BiViewInfo> biViewInfohongganList = dryWarehouseMapper.selectSumWareHongByGoods(companyId, null,  seachMonth, jointVentureParties);
+        if(CollectionUtils.isNotEmpty(biViewInfohongganList)){
+            for(int i=0;i<biViewInfohongganList.size();i++){
+                BiViewInfo biViewInfo = new BiViewInfo();
+                biViewInfo.setName(biViewInfohongganList.get(i).getName());
+                biViewInfo.setWeight(biViewInfohongganList.get(i).getWeight());
+                if(CollectionUtils.isNotEmpty(biViewInfochaoList2)){
+                    for (int j = 0; j < biViewInfochaoList2.size(); j++) {
+                        if (biViewInfohongganList.get(i).getName().equals(biViewInfochaoList2.get(j).getName())) {
+                            if(biViewInfohongganList.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0) <= 0){
+                                biViewInfo.setWeight(0d);
+                            }else{
+                                biViewInfo.setWeight(biViewInfohongganList.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0));
+                            }
+                            break;
+
+                        }
+
+                    }
+                }
+
+                biViewInfos2.add(biViewInfo);
+            }
+
+        }
+        BiViewInfo biViewInfo2 = new BiViewInfo();
+        biViewInfo2.setName("烘干");
+        biViewInfo2.setBiViewInfoList(biViewInfos2);
+        biViewInfoList.add(biViewInfo2);
+
+
         return biViewInfoList;
     }
 
 
+
+    /**
+     * 仓库 纯重  烘干
+     *
+     * @param compId
+     * @param biViewInfoList
+     * @return
+     */
+    @GetMapping("/quantityChunHong")
+    public List<BiViewInfo> quantityChunHong(String compId, String seachMonth, List<BiViewInfo> biViewInfoList) {
+        String userId = "";
+        if (AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null) {
+            userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+        }
+        String jointVentureParties = null;
+        if ("647b84ee01044e2a8d4fdc1943ce3d01,ec7024427b7347b98bcad422761e5bfc,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)) {
+            jointVentureParties = "洮南市鸿胜粮贸有限公司";
+        }
+        List<BiViewInfo> biViewInfoList1 = warehousePositionStorageInfoMapper.selectSumWareNewByGoods(companyId, null, "2", seachMonth, jointVentureParties);
+        List<BiViewInfo> biViewInfoList2 = warehousePositionStorageInfoMapper.selectSumWareNewByGoods(companyId, null, "1", seachMonth, jointVentureParties);
+        List<BiViewInfo> biViewInfochaoList1 = warehousePositionStorageInfoMapper.selectSumWareChaoByGoods(companyId, null, "2", seachMonth, jointVentureParties);
+        List<BiViewInfo> biViewInfochaoList2 = warehousePositionStorageInfoMapper.selectSumWareChaoByGoods(companyId, null, "1", seachMonth, jointVentureParties);
+        List<BiViewInfo> biViewInfos = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(biViewInfoList1)) {
+            for (int i = 0; i < biViewInfoList1.size(); i++) {
+                BiViewInfo biViewInfo = new BiViewInfo();
+                biViewInfo.setName(biViewInfoList1.get(i).getName());
+                biViewInfo.setWeight(biViewInfoList1.get(i).getWeight());
+                if (CollectionUtils.isNotEmpty(biViewInfoList2)) {
+                    for (int j = 0; j < biViewInfoList2.size(); j++) {
+                        if (biViewInfoList1.get(i).getName().equals(biViewInfoList2.get(j).getName())) {
+                            if(biViewInfoList1.get(i).getWeight() - biViewInfoList2.get(j).getWeight() <= 0){
+                                biViewInfo.setWeight(0d);
+                            }else{
+                                biViewInfo.setWeight(biViewInfoList1.get(i).getWeight() - biViewInfoList2.get(j).getWeight());
+                            }
+                            break;
+                        }
+
+                    }
+
+                }
+                if(biViewInfo.getWeight() == 0){
+                    continue;
+                }
+                biViewInfos.add(biViewInfo);
+            }
+        }
+
+        // 计算潮粮折干后的剩余量
+        List<BiViewInfo> biViewInfos1 = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(biViewInfochaoList1)) {
+            for (int i = 0; i < biViewInfochaoList1.size(); i++) {
+                BiViewInfo biViewInfo = new BiViewInfo();
+                biViewInfo.setName(biViewInfochaoList1.get(i).getName());
+                biViewInfo.setWeight(biViewInfochaoList1.get(i).getWeight());
+                if (CollectionUtils.isNotEmpty(biViewInfochaoList2)) {
+                    for (int j = 0; j < biViewInfochaoList2.size(); j++) {
+                        if (biViewInfochaoList1.get(i).getName().equals(biViewInfochaoList2.get(j).getName())) {
+                            if(biViewInfochaoList1.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0) <= 0){
+                                biViewInfo.setWeight(0d);
+                            }else{
+                                biViewInfo.setWeight(biViewInfochaoList1.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0));
+                            }
+                            break;
+                        }
+
+                    }
+
+                }
+                if(biViewInfo.getWeight() == 0){
+                    continue;
+                }
+                biViewInfos1.add(biViewInfo);
+            }
+        }
+
+
+
+        if(CollectionUtils.isNotEmpty(biViewInfos)){
+            for(int i=0;i<biViewInfos.size();i++){
+                if(biViewInfos.get(i).getName().contains("潮粮")){
+                    biViewInfos.remove(i);
+                    continue;
+                }
+                if(CollectionUtils.isNotEmpty(biViewInfos1)){
+                    for(int j=0;j<biViewInfos1.size();j++){
+                        if(biViewInfos1.get(j).getName().contains(biViewInfos.get(i).getName())){
+                            biViewInfos.get(i).setWeight(biViewInfos.get(i).getWeight()+biViewInfos1.get(j).getWeight());
+                        }
+                    }
+
+                }
+            }
+
+        }
+
+        BiViewInfo biViewInfo1 = new BiViewInfo();
+        biViewInfo1.setName("折算存重");
+        biViewInfo1.setBiViewInfoList(biViewInfos);
+        biViewInfoList.add(biViewInfo1);
+
+        //烘干     烘干入库量
+        List<BiViewInfo> biViewInfos2 = new ArrayList<>();
+        List<BiViewInfo> biViewInfohongganList = dryWarehouseMapper.selectSumWareHongByGoods(companyId, null,  seachMonth, jointVentureParties);
+        if(CollectionUtils.isNotEmpty(biViewInfohongganList)){
+            for(int i=0;i<biViewInfohongganList.size();i++){
+                BiViewInfo biViewInfo = new BiViewInfo();
+                biViewInfo.setName(biViewInfohongganList.get(i).getName());
+                biViewInfo.setWeight(biViewInfohongganList.get(i).getWeight());
+                if(CollectionUtils.isNotEmpty(biViewInfochaoList2)){
+                    for (int j = 0; j < biViewInfochaoList2.size(); j++) {
+                        if (biViewInfohongganList.get(i).getName().equals(biViewInfochaoList2.get(j).getName())) {
+                            if(biViewInfohongganList.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0) <= 0){
+                                biViewInfo.setWeight(0d);
+                            }else{
+                                biViewInfo.setWeight(biViewInfohongganList.get(i).getWeight() - (biViewInfochaoList2.get(j).getWeight() != null?biViewInfochaoList2.get(j).getWeight():0));
+                            }
+                            break;
+
+                        }
+
+                    }
+                }
+
+                biViewInfos2.add(biViewInfo);
+            }
+
+        }
+        BiViewInfo biViewInfo2 = new BiViewInfo();
+        biViewInfo2.setName("烘干");
+        biViewInfo2.setBiViewInfoList(biViewInfos2);
+        biViewInfoList.add(biViewInfo2);
+
+
+        return biViewInfoList;
+    }
+
     /**
      * 库存数量
      *

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

@@ -157,6 +157,22 @@ public class WarehouseBaseInfo extends BaseModel<WarehouseBaseInfo> {
      * 监控url2
      */
     private String monitorUrl2;
+    /**
+     * 监控url1
+     */
+    private String shexiang1;
+    /**
+     * 监控url2
+     */
+    private String shexiang2;
+    /**
+     * 监控url1
+     */
+    private String rom1;
+    /**
+     * 监控url2
+     */
+    private String rom2;
     /**
      * 是否自动获取重量(0否1是)
      */
@@ -206,6 +222,8 @@ public class WarehouseBaseInfo extends BaseModel<WarehouseBaseInfo> {
      */
     @TableField(exist = false)
     private String goodsName;
+    @TableField(exist = false)
+    private String romId;
     /**
      * 开始时间
      */

+ 29 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/DryWarehouseMapper.xml

@@ -94,4 +94,33 @@
             LIMIT ${startRecord}, ${pageSize}
         </if>
     </select>
+
+
+    <select id="selectSumWareHongByGoods" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.view.BiViewInfo">
+        SELECT
+        wioi.goods_name as name,
+        sum( wioi.net_weight ) as weight
+        FROM
+        dry_warehouse wioi
+        LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id
+        AND wbi.delete_flag = 0
+        WHERE
+        wioi.delete_flag = 0
+        and
+        wioi.status_flag = '3'
+        <if test="baseId != null">
+            and wbi.id = #{baseId}
+        </if>
+        <if test="jointVentureParties != null">
+            and wbi.joint_venture_parties = #{jointVentureParties}
+        </if>
+        and wbi.comp_id = #{compId}
+        <if test="seachMoth != null and seachMoth != ''">
+            and wioi.create_date >= #{seachMoth}
+            and wbi.create_date >= #{seachMoth}
+        </if>
+        group by
+        wioi.goods_name
+    </select>
 </mapper>