ccj 2 năm trước cách đây
mục cha
commit
9aae2d8a63
14 tập tin đã thay đổi với 173 bổ sung75 xóa
  1. 41 51
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/controller/BiInfoController.java
  2. 3 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CostManagementInfo.java
  3. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/CostManagementInfoMapper.java
  4. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/PaymentManagementMapper.java
  5. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionStorageInfoMapper.java
  6. 2 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/IContractManagementInfoService.java
  7. 1 0
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICostManagementInfoService.java
  8. 4 2
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/ContractManagementInfoServiceImpl.java
  9. 34 1
      winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CostManagementInfoServiceImpl.java
  10. 2 2
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml
  11. 49 9
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CostManagementInfoMapper.xml
  12. 11 1
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml
  13. 6 6
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StockSaleReceiptReportMapper.xml
  14. 17 0
      winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionStorageInfoMapper.xml

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

@@ -10,6 +10,7 @@ import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.yh.saas.plugin.yiliangyiyun.entity.*;
 import com.yh.saas.plugin.yiliangyiyun.entity.view.BiViewInfo;
 import com.yh.saas.plugin.yiliangyiyun.mapper.ContractManagementInfoMapper;
+import com.yh.saas.plugin.yiliangyiyun.mapper.PaymentManagementMapper;
 import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseInOutInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.mapper.WarehousePositionStorageInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
@@ -74,6 +75,8 @@ public class BiInfoController {
     private IStockSaleReceiptReportService stockSaleReceiptReportService;
     @Autowired
     private IStockPurchaseReceiptReportService stockPurchaseReceiptReportService;
+    @Autowired
+    private PaymentManagementMapper paymentManagementMapper;
     private String companyId;
     @Autowired
     private CacheComponent cacheComponent;
@@ -117,7 +120,7 @@ public class BiInfoController {
         // 执行中的所有合同-已完成量、待完成量   2  执行中的合同额  -已开票、待开票 3 已付款 未付款
         getCompletedAndNotQuantity(contractManagementInfos, biViewInfos);
         // 采购
-        getBuyInfo(contractManagementInfos, biViewInfos);
+        getBuyInfo(contractManagementInfos, biViewInfos, seachMoth);
         // 车辆
         getTranCount(biViewInfos, seachMoth);
         // 库存成本
@@ -140,7 +143,7 @@ public class BiInfoController {
     public List<BiViewInfo> selectBiInfoNew(String compId, String seachMoth) {
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
-            List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO+userId, BiViewInfo.class);
+            List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO+userId+seachMoth, BiViewInfo.class);
             if (listRedis != null && listRedis.size() > 0) {
                 return listRedis;
             }
@@ -176,26 +179,26 @@ public class BiInfoController {
                 contractManagementInfoEntityWrapper.eq("joint_venture_parties", "洮南市二龙乡瀚城农产品有限公司");
             }
         }
-        if (seachMoth != null) {
-            if (!seachMoth.contains("-")) {
-                contractManagementInfoEntityWrapper.and("YEAR(create_date)='" + seachMoth + "'");
-            } else {
-                contractManagementInfoEntityWrapper.like("create_date", seachMoth + "%");
-            }
-        }
-
+//        if (seachMoth != null) {
+//            if (!seachMoth.contains("-")) {
+//                contractManagementInfoEntityWrapper.and("YEAR(create_date)='" + seachMoth + "'");
+//            } else {
+//                contractManagementInfoEntityWrapper.like("create_date", seachMoth + "%");
+//            }
+//        }
+        contractManagementInfoEntityWrapper.gt("create_date",seachMoth);
         List<ContractManagementInfo> contractManagementInfos = contractManagementInfoService.selectList(contractManagementInfoEntityWrapper);
         // 执行中的所有合同-已完成量、待完成量   2  执行中的合同额  -已开票、待开票 3 已付款 未付款
         getCompletedAndNotQuantity(contractManagementInfos, biViewInfos);
         // 采购
-        getBuyInfo(contractManagementInfos, biViewInfos);
+        getBuyInfo(contractManagementInfos, biViewInfos, seachMoth);
         // 收入支出毛利润
         getMoney(biViewInfos, seachMoth);
 
 
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
-            cacheComponent.putRaw(Const.ADMIN_BI_INFO+userId, JSONObject.toJSONString(biViewInfos), 60 * 20);
+            cacheComponent.putRaw(Const.ADMIN_BI_INFO+userId+seachMoth, JSONObject.toJSONString(biViewInfos), 60 * 20);
         }
         return biViewInfos;
     }
@@ -214,6 +217,7 @@ public class BiInfoController {
         EntityWrapper<ContractManagementInfo> contractManagementInfoEntityWrapper = new EntityWrapper<ContractManagementInfo>();
         contractManagementInfoEntityWrapper.eq("delete_flag", "0");
         contractManagementInfoEntityWrapper.eq("comp_id", companyId);
+        contractManagementInfoEntityWrapper.gt("create_date", seachMoth);
         contractManagementInfoEntityWrapper.orderBy("create_date",false);
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
@@ -471,9 +475,12 @@ public class BiInfoController {
 //            }
 //        }
 //        List<CostManagementInfo> costManagementInfos = costManagementInfoService.selectList(costManagementInfoEntityWrapper);
-        Double sumAct = warehousePositionStorageInfoService.selectSumStoreage(companyId);
-        Double sumBuy = contractManagementInfoService.selectSumBuy(companyId);
-        Double sumSale = contractManagementInfoService.selectSumSale(companyId);
+//        Double sumAct = warehousePositionStorageInfoService.selectSumStoreage(companyId);
+        Double inWeight = warehousePositionStorageInfoMapper.selectSumWareNew(companyId, null,"2",seachMoth);
+        Double outWeight = warehousePositionStorageInfoMapper.selectSumWareNew(companyId, null,"1",seachMoth);
+        Double sumAct = inWeight - outWeight;
+        Double sumBuy = contractManagementInfoService.selectSumBuy(companyId,seachMoth);
+        Double sumSale = contractManagementInfoService.selectSumSale(companyId,seachMoth);
 //        if (CollectionUtils.isNotEmpty(costManagementInfos)) {
 //            for (int i = 0; i < costManagementInfos.size(); i++) {
 //                CostManagementInfo costManagementInfo = costManagementInfos.get(i);
@@ -512,42 +519,19 @@ public class BiInfoController {
         biViewInfos.add(biViewInfo);
 
         // 粮食储存总量
-        EntityWrapper<CostManagementInfo> costManagementInfoEntityWrapper1 = new EntityWrapper<CostManagementInfo>();
-        costManagementInfoEntityWrapper1.eq("comp_id", companyId);
-        costManagementInfoEntityWrapper1.groupBy("goods_name_key");
-//        if(seachMoth != null) {
-//            if (!seachMoth.contains("-")) {
-//                costManagementInfoEntityWrapper1.and("YEAR(create_date)='" + seachMoth + "'");
-//            } else {
-//                costManagementInfoEntityWrapper1.and("(YEAR(create_date)+\"-\"+MONTH(create_date))='" + seachMoth + "'");
-//
-//            }
-//        }
-        List<CostManagementInfo> costManagementInfoList = costManagementInfoService.selectList(costManagementInfoEntityWrapper1);
+        CostManagementInfo costManagementInfo = new CostManagementInfo();
+        costManagementInfo.setCompId(companyId);
+        costManagementInfo.setSearchMoth(seachMoth);
+        List<CostManagementInfo> costManagementInfoList = costManagementInfoService.selectCostManagementInfoBi(costManagementInfo);
         BiViewInfo biViewInfo4 = new BiViewInfo();
         List<BiViewInfo> biViewInfos1 = new ArrayList<>();
         if (CollectionUtils.isNotEmpty(costManagementInfoList)) {
+            Double weight = 0d;
             for (int i = 0; i < costManagementInfoList.size(); i++) {
-                CostManagementInfo costManagementInfo = costManagementInfoList.get(i);
                 BiViewInfo biViewInfo3 = new BiViewInfo();
-                EntityWrapper<CostManagementInfo> costManagementInfoEntityWrapper2 = new EntityWrapper<CostManagementInfo>();
-                costManagementInfoEntityWrapper2.eq("comp_id", companyId);
-                costManagementInfoEntityWrapper2.eq("goods_name_key", costManagementInfo.getGoodsNameKey());
-//                if(seachMoth != null) {
-//                    if (!seachMoth.contains("-")) {
-//                        costManagementInfoEntityWrapper1.and("YEAR(create_date)='" + seachMoth + "'");
-//                    } else {
-//                        costManagementInfoEntityWrapper1.and("(YEAR(create_date)+\"-\"+MONTH(create_date))='" + seachMoth + "'");
-//
-//                    }
-//                }
-                List<CostManagementInfo> costManagementInfoList1 = costManagementInfoService.selectList(costManagementInfoEntityWrapper2);
-                Double weight = 0d;
-                for (int j = 0; j < costManagementInfoList1.size(); j++) {
-                    CostManagementInfo costManagementInfo1 = costManagementInfoList1.get(j);
-                    weight = weight + costManagementInfo1.getStorage();
-                }
-                biViewInfo3.setName(costManagementInfo.getGoodsName());
+                CostManagementInfo costManagementInfo1 = costManagementInfoList.get(i);
+                weight = weight + costManagementInfo1.getStorage();
+                biViewInfo3.setName(costManagementInfo1.getGoodsName());
                 biViewInfo3.setCount(String.valueOf(weight));
                 biViewInfos1.add(biViewInfo3);
             }
@@ -757,7 +741,7 @@ public class BiInfoController {
      *
      * @return
      */
-    private List<BiViewInfo> getBuyInfo(List<ContractManagementInfo> contractManagementInfos, List<BiViewInfo> biViewInfos) {
+    private List<BiViewInfo> getBuyInfo(List<ContractManagementInfo> contractManagementInfos, List<BiViewInfo> biViewInfos,String seachMoth) {
         // 采购合同总量
         Double sumTotal = 0d;
         // 采购合同完成量
@@ -770,11 +754,11 @@ public class BiInfoController {
         Double payTotal = 0.00;
         for (int i = 0; i < contractManagementInfos.size(); i++) {
             ContractManagementInfo contractManagementInfo1 = contractManagementInfos.get(i);
-            sumTotal = sumTotal + contractManagementInfo1.getWeight();
 //            moneyTotal = moneyTotal + contractManagementInfo1.getTotalContractPrice();
 
             //现货自运采购合同
             if ("1".equals(contractManagementInfo1.getGoodsType()) && "1".equals(contractManagementInfo1.getDeliverType()) && "2".equals(contractManagementInfo1.getContractType())) {
+                sumTotal = sumTotal + contractManagementInfo1.getWeight();
                 //定义出库量
                 Double outWeight = 0.0d;
                 //查询同名临时库出库量
@@ -801,10 +785,11 @@ public class BiInfoController {
                         returnWeight = returnWeight + Float.valueOf(String.valueOf(warehouseInOutInfo.getNetWeight()));
                     }
                 }
-                sumTotal += outWeight - returnWeight;
+                completedQuantity += outWeight - returnWeight;
             }
             //现货他运采购合同
             else if ("1".equals(contractManagementInfo1.getGoodsType()) && "2".equals(contractManagementInfo1.getDeliverType()) && "2".equals(contractManagementInfo1.getContractType())) {
+                sumTotal = sumTotal + contractManagementInfo1.getWeight();
                 //定义出库量
                 Double inWeight = 0.0d;
                 //查询同合同编号入库量
@@ -820,6 +805,11 @@ public class BiInfoController {
 
                 completedQuantity += inWeight;
             }
+//            else if("3".equals(contractManagementInfo1.getContractType())){
+//               Double sum = paymentManagementMapper.selectPayNum(companyId,seachMoth);
+//                invoicingTotal += sum;
+//                payTotal += sum;
+//            }
             // 查询已开票未开票
             ContractProcessInfo contractProcessInfo = contractProcessInfoService.selectOne(new EntityWrapper<ContractProcessInfo>().eq(ContractGoodsInfo.QueryFiles.CONTRACT_ID, contractManagementInfo1.getId()));
             invoicingTotal = invoicingTotal + (contractProcessInfo.getGoodsName() != null ? contractProcessInfo.getGoodsName() : 0.00);
@@ -828,12 +818,12 @@ public class BiInfoController {
         // 执行中的所有合同量求和-- 已完成量、待完成量
         BiViewInfo biViewInfo = new BiViewInfo();
         biViewInfo.setBiType("4-采购合同(已完成量、待完成量)");
-        BigDecimal bg = new BigDecimal(sumTotal);
+        BigDecimal bg = new BigDecimal(Math.round(sumTotal*100)/100);
         biViewInfo.setTotal(String.valueOf(bg));
         List<BiViewInfo> biViewInfos1 = new ArrayList<>();
         BiViewInfo biViewInfo1 = new BiViewInfo();
         biViewInfo1.setName("已完成量");
-        biViewInfo1.setCount(String.valueOf(completedQuantity));
+        biViewInfo1.setCount(String.valueOf(Math.round(completedQuantity*100)/100));
         biViewInfo1.setPercentage(completedQuantity / sumTotal * 100 + "");
         BiViewInfo biViewInfo2 = new BiViewInfo();
         biViewInfo2.setName("待完成量");

+ 3 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/CostManagementInfo.java

@@ -3,6 +3,7 @@ package com.yh.saas.plugin.yiliangyiyun.entity;
 import com.baomidou.mybatisplus.activerecord.Model;
 import java.io.Serializable;
 
+import com.baomidou.mybatisplus.annotations.TableField;
 import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import com.baomidou.mybatisplus.annotations.Version;
@@ -87,7 +88,8 @@ public class CostManagementInfo extends BaseModel<CostManagementInfo> {
      */
     private String warehouseType;
 
-
+    @TableField(exist = false)
+    private String searchMoth;
     @Override
     protected Serializable pkVal() {
         return this.id;

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/CostManagementInfoMapper.java

@@ -18,4 +18,5 @@ import java.util.Map;
 public interface CostManagementInfoMapper extends BaseMapper<CostManagementInfo> {
 
     List<CostManagementInfo> getListByCondition(Map<String, Object> pageView);
+    List<CostManagementInfo> getListByConditionBi(Map<String, Object> pageView);
 }

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/PaymentManagementMapper.java

@@ -48,4 +48,5 @@ public interface PaymentManagementMapper extends BaseMapper<PaymentManagement> {
      * @return
      */
     List<PaymentManagement> getListByConditionOut(Map<String, Object> pageView);
+    Double selectPayNum(String compId,String seachMoth);
 }

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/mapper/WarehousePositionStorageInfoMapper.java

@@ -17,4 +17,5 @@ public interface WarehousePositionStorageInfoMapper extends BaseMapper<Warehouse
 
     Double selectSumStoreage(Map<String, Object> pageView);
     Double selectSumWare(String compId,String baseId);
+    Double selectSumWareNew(String compId,String baseId,String flag,String seachMoth);
 }

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

@@ -108,8 +108,8 @@ public interface IContractManagementInfoService extends IService<ContractManagem
      * @throws Exception
      */
     void exportStorageFee(ContractManagementInfo example, HttpServletResponse response) throws Exception;
-    Double selectSumSale(String compId);
-    Double selectSumBuy(String compId);
+    Double selectSumSale(String compId,String seachMoth);
+    Double selectSumBuy(String compId,String seachMoth);
 
     /**
      * 合同利润详情列表查询

+ 1 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/ICostManagementInfoService.java

@@ -22,6 +22,7 @@ public interface ICostManagementInfoService extends IService<CostManagementInfo>
      * @return
      */
     List<CostManagementInfo> selectCostManagementInfo(CostManagementInfo costManagementInfo);
+    List<CostManagementInfo> selectCostManagementInfoBi(CostManagementInfo costManagementInfo);
 
     /**
      * 编辑信息

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

@@ -1926,9 +1926,10 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
     }
 
     @Override
-    public Double selectSumSale(String compId) {
+    public Double selectSumSale(String compId,String seachMoth) {
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("compId",compId);
+        pageView.put("seachMoth",seachMoth);
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
@@ -1939,9 +1940,10 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
         return baseMapper.selectSumSale(pageView);
     }
     @Override
-    public Double selectSumBuy(String compId) {
+    public Double selectSumBuy(String compId,String seachMoth) {
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("compId",compId);
+        pageView.put("seachMoth",seachMoth);
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看

+ 34 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/CostManagementInfoServiceImpl.java

@@ -64,6 +64,7 @@ public class CostManagementInfoServiceImpl extends ServiceImpl<CostManagementInf
 //        List<CostManagementInfo> costManagementInfoList = this.selectList(costManagementInfoWrapper);
         Map<String, Object> pageView = new HashMap<>();
         pageView.put("compId",compId);
+        pageView.put("searchMoth",costManagementInfo.getSearchMoth());
         if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
             String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
             //洮南瀚城合营人员查看
@@ -74,7 +75,39 @@ public class CostManagementInfoServiceImpl extends ServiceImpl<CostManagementInf
         List<CostManagementInfo> costManagementInfoList = baseMapper.getListByCondition(pageView);
         return costManagementInfoList;
     }
-
+    @Override
+    public List<CostManagementInfo> selectCostManagementInfoBi(CostManagementInfo costManagementInfo) {
+        String compId = costManagementInfo.getCompId();
+        if(compId == null){
+            compId = AuthSecurityUtils.getCurrentUserInfo().getCompId();
+        }
+//        Wrapper<CostManagementInfo> costManagementInfoWrapper = new EntityWrapper<>();
+//        costManagementInfoWrapper.eq("warehouse_type", costManagementInfo.getWarehouseType())
+//                                 .eq("comp_id", compId);
+//        if (costManagementInfo.getWarehouseId()!=null&&!costManagementInfo.getWarehouseId().isEmpty()){
+//            costManagementInfoWrapper.eq("warehouse_id", costManagementInfo.getWarehouseId());
+//        }
+//        if (costManagementInfo.getWarehouseName()!=null&&!costManagementInfo.getWarehouseName().isEmpty()){
+//            costManagementInfoWrapper.like("warehouse_name", "%" + costManagementInfo.getWarehouseName() + "%");
+//        }
+//
+//        costManagementInfoWrapper.gt("storage", 0);
+//        costManagementInfoWrapper.orderBy("warehouse_name",false);
+//
+//        List<CostManagementInfo> costManagementInfoList = this.selectList(costManagementInfoWrapper);
+        Map<String, Object> pageView = new HashMap<>();
+        pageView.put("compId",compId);
+        pageView.put("searchMoth",costManagementInfo.getSearchMoth());
+        if(AuthSecurityUtils.getCurrentUserInfo() != null && AuthSecurityUtils.getCurrentUserInfo().getUserId() != null){
+            String userId = AuthSecurityUtils.getCurrentUserInfo().getUserId();
+            //洮南瀚城合营人员查看
+            if("647b84ee01044e2a8d4fdc1943ce3d01,23eff8bab2ed4af38a1be1315ce7046d,d958ef5aa62849039802356a63f6e7ca".contains(userId)){
+                pageView.put("jointVentureParties","洮南市二龙乡瀚城农产品有限公司");
+            }
+        }
+        List<CostManagementInfo> costManagementInfoList = baseMapper.getListByConditionBi(pageView);
+        return costManagementInfoList;
+    }
 
     /**
      * 编辑信息

+ 2 - 2
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/ContractManagementInfoMapper.xml

@@ -221,7 +221,7 @@
         AND a.goods_type = '1'
         AND a.contract_type = '1'
         AND a.comp_id = #{compId}
-        AND a.signing_date >= '2022-10-01'
+        AND a.signing_date >= #{seachMoth}
 		and a.seller != a.buyer
         <if test="jointVentureParties != null">
             AND a.joint_venture_parties = #{jointVentureParties}
@@ -254,7 +254,7 @@
         AND a.goods_type = '1'
         AND a.contract_type = '2'
         AND a.comp_id = #{compId}
-        AND a.signing_date >= '2022-10-01'
+        AND a.signing_date >= #{seachMoth}
 		and a.seller != a.buyer
         <if test="jointVentureParties != null">
             AND a.joint_venture_parties = #{jointVentureParties}

+ 49 - 9
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/CostManagementInfoMapper.xml

@@ -4,25 +4,32 @@
 
     <select id="getListByCondition" resultType="com.yh.saas.plugin.yiliangyiyun.entity.CostManagementInfo">
         SELECT
-            wbi.warehouse_name AS warehouseName,
-            wpsi.goods_name AS goodsName,
-            wpsi.`storage` AS STORAGE,
-            ROUND(AVG(wo.avg_cost), 3) AS cost
+        wbi.warehouse_name AS warehouseName,
+        wpsi.goods_name AS goodsName,
+        sum( wpsi.`storage` ) AS STORAGE,
+        (
+        SELECT
+        ROUND( AVG( wo.avg_cost ), 3 )
         FROM
-            warehouse_base_info wbi
-        LEFT JOIN warehousing_order wo ON wbi.warehouse_name = wo.warehouse_name
+        warehousing_order wo
+        WHERE
+        wo.warehouse_name = wbi.warehouse_name
         AND wo.delete_flag = 0
         AND wbi.comp_id = wo.comp_id
+        ) AS cost
+        FROM
+        warehouse_base_info wbi
         LEFT JOIN warehouse_position_info wpi ON wpi.base_id = wbi.id
         AND wpi.delete_flag = 0
         LEFT JOIN warehouse_position_storage_info wpsi ON wpsi.position_id = wpi.id
         AND wpsi.delete_flag = 0
-        AND wpsi.goods_name = wo.goods_name
-        WHERE 1=1
-        and wpsi.`storage` > 0
+        WHERE
+        1 = 1
+        AND wpsi.`storage` > 0
         AND wbi.warehouse_type = 1
         AND wbi.delete_flag = 0
         AND wbi.comp_id =#{compId}
+        AND wbi.create_date >=#{searchMoth}
         <if test="jointVentureParties != null">
             AND wbi.joint_venture_parties = #{jointVentureParties}
         </if>
@@ -30,4 +37,37 @@
             wpsi.goods_name,
             wbi.warehouse_name
     </select>
+    <select id="getListByConditionBi" resultType="com.yh.saas.plugin.yiliangyiyun.entity.CostManagementInfo">
+        SELECT
+        wpsi.goods_name AS goodsName,
+        sum( wpsi.`storage` ) AS STORAGE,
+        (
+        SELECT
+        ROUND( AVG( wo.avg_cost ), 3 )
+        FROM
+        warehousing_order wo
+        WHERE
+        wo.warehouse_name = wbi.warehouse_name
+        AND wo.delete_flag = 0
+        AND wbi.comp_id = wo.comp_id
+        ) AS cost
+        FROM
+        warehouse_base_info wbi
+        LEFT JOIN warehouse_position_info wpi ON wpi.base_id = wbi.id
+        AND wpi.delete_flag = 0
+        LEFT JOIN warehouse_position_storage_info wpsi ON wpsi.position_id = wpi.id
+        AND wpsi.delete_flag = 0
+        WHERE
+        1 = 1
+        AND wpsi.`storage` > 0
+        AND wbi.warehouse_type = 1
+        AND wbi.delete_flag = 0
+        AND wbi.comp_id =#{compId}
+        AND wbi.create_date >=#{searchMoth}
+        <if test="jointVentureParties != null">
+            AND wbi.joint_venture_parties = #{jointVentureParties}
+        </if>
+        GROUP BY
+        wpsi.goods_name
+    </select>
 </mapper>

+ 11 - 1
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/PaymentManagementMapper.xml

@@ -342,5 +342,15 @@
             )
         </if>
     </select>
-
+    <select id="selectPayNum" parameterType="Map" resultType="java.lang.Double">
+        SELECT
+            sum( p.amount_ing_payable )
+        FROM
+            payment_management p
+        WHERE
+            p.delete_flag = 0
+            AND p.comp_id = #{compId}
+            AND p.create_date >= #{seachMoth}
+            and p.invoicing = 1
+    </select>
 </mapper>

+ 6 - 6
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/StockSaleReceiptReportMapper.xml

@@ -114,10 +114,10 @@
         WHERE
         s.delete_flag = 0
         AND s.comp_id = #{compId}
+        and s.delivery_date > #{seachMoth}
         <if test="jointVentureParties != null">
             AND wbi.joint_venture_parties = #{jointVentureParties}
         </if>
-        AND s.delivery_date like CONCAT('%',#{seachMoth},'%')
     </select>
 
     <select id="getAmonutOut" parameterType="Map"
@@ -131,7 +131,7 @@
         WHERE
         p.delete_flag = 0
         AND p.comp_id = #{compId}
-        AND p.create_date like CONCAT('%',#{seachMoth},'%')
+        AND p.create_date > #{seachMoth}
         ),
         0
         ) + IFNULL((
@@ -142,7 +142,7 @@
         WHERE
         i.delete_flag = 0
         AND i.comp_id = #{compId}
-        AND i.create_date like CONCAT('%',#{seachMoth},'%')
+        AND i.create_date > #{seachMoth}
         ),
         0
         )
@@ -154,7 +154,7 @@
         WHERE
         s.delete_flag = 0
         AND s.comp_id = #{compId}
-        AND s.delivery_date like CONCAT('%',#{seachMoth},'%')
+        AND s.delivery_date > #{seachMoth}
         ),
         0
         ) as aa
@@ -168,7 +168,7 @@
         <if test="jointVentureParties != null">
             AND wbi.joint_venture_parties = #{jointVentureParties}
         </if>
-        AND s.warehousing_date like CONCAT('%',#{seachMoth},'%')
+        AND s.warehousing_date > #{seachMoth}
     </select>
 
 
@@ -192,7 +192,7 @@
         <if test="jointVentureParties != null">
             AND wbi.joint_venture_parties = #{jointVentureParties}
         </if>
-        AND a.delivery_date like CONCAT('%',#{seachMoth},'%')
+        AND a.delivery_date > #{seachMoth}
     </select>
 
 </mapper>

+ 17 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/resources/mapper/WarehousePositionStorageInfoMapper.xml

@@ -30,4 +30,21 @@
             wbi.id = #{baseId}
             and wbi.comp_id = #{compId}
     </select>
+    <select id="selectSumWareNew" parameterType="Map" resultType="java.lang.Double">
+       SELECT
+            sum( wioi.net_weight )
+        FROM
+            warehouse_in_out_info wioi
+            LEFT JOIN warehouse_base_info wbi ON wbi.id = wioi.base_id
+            AND wbi.delete_flag = 0
+        WHERE
+            wioi.delete_flag = 0
+        <if test="baseId != null">
+            and wbi.id = #{baseId}
+        </if>
+            and wbi.comp_id = #{compId}
+            and wioi.in_out_flag = #{flag}
+            and wioi.create_date >= #{seachMoth}
+            and wbi.create_date >= #{seachMoth}
+    </select>
 </mapper>