ccj 2 lat temu
rodzic
commit
02442e633e

+ 2 - 2
winsea-haixin-platform-backend/src/main/resources/application-test.yml

@@ -1,5 +1,5 @@
 server:
-  port: 9989
+  port: 9888
 
 spring:
   application:
@@ -7,7 +7,7 @@ spring:
   datasource:
     driver-class-name: com.mysql.jdbc.Driver
     password: Ccj841968545
-    url: jdbc:mysql://47.100.3.209:3306/yiliangyiyun_test?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
+    url: jdbc:mysql://47.100.3.209:3306/ylyy_ywtest?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true&useSSL=false&serverTimezone=Asia/Shanghai
     username: root
   redis:
     database: 0

+ 1 - 1
winsea-haixin-platform-backend/src/main/resources/application.yml

@@ -12,7 +12,7 @@ spring:
     date-format: yyyy-MM-dd HH:mm:ss
     time-zone: GMT+8
   profiles:
-    active: local
+    active: test
   resources:
     static-locations: file:///winsea/static/
   thymeleaf:

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

@@ -8,6 +8,7 @@ import com.winsea.svc.base.base.util.DateUtils;
 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.service.*;
 import com.yh.saas.plugin.yiliangyiyun.util.Const;
 import jxl.Cell;
@@ -27,9 +28,7 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * <p>
@@ -46,6 +45,8 @@ public class BiInfoController {
     @Autowired
     private IContractManagementInfoService contractManagementInfoService;
     @Autowired
+    private ContractManagementInfoMapper contractManagementInfoMapper;
+    @Autowired
     private ITranProcessInfoService tranProcessInfoService;
     @Autowired
     private IWarehouseInOutInfoService warehouseInOutInfoService;
@@ -71,6 +72,15 @@ public class BiInfoController {
     @Autowired
     private CacheComponent cacheComponent;
 
+    //清理所有Redis缓存
+    @GetMapping("/clearCache")
+    public void clearCache(){
+        cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
+        cacheComponent.delPrefixKey(Const.ADMIN_CONTRACTINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_BI_INFO);
+    }
     /**
      * 查询
      *
@@ -114,7 +124,60 @@ public class BiInfoController {
         cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos),60*60);
         return biViewInfos;
     }
+    /**
+     * 查询
+     *
+     * @return
+     */
+    @GetMapping("/selectBiInfoNew")
+    public List<BiViewInfo> selectBiInfoNew(String compId,String seachMoth) {
+        List<BiViewInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_BI_INFO,BiViewInfo.class);
+        if(listRedis != null && listRedis.size() > 0 ){
+//            return listRedis;
+        }
+        companyId = compId;
+        List<BiViewInfo> biViewInfos = new ArrayList<>();
+        Map<String, Object> pageView = new HashMap<>();
+        //  公司ID
+        pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
+        pageView.put("seachMoth", seachMoth);
 
+        BiViewInfo biViewInfo = new BiViewInfo();
+        BiViewInfo biViewInfo1 = new BiViewInfo();
+        List<ContractManagementInfo> sellContractList = contractManagementInfoMapper.getSellContractList(pageView);
+        biViewInfo.setBiType("销售合同");
+        List<BiViewInfo> biViewInfoList = new ArrayList<>();
+        for(ContractManagementInfo contractManagementInfo : sellContractList){
+            biViewInfo1.setName(contractManagementInfo.getBuyer());
+            biViewInfo1.setValue(contractManagementInfo.getWeight());
+            biViewInfoList.add(biViewInfo1);
+        }
+        biViewInfo.setBiViewInfoList(biViewInfoList);
+        biViewInfos.add(biViewInfo);
+
+        List<ContractManagementInfo> buyContractList = contractManagementInfoMapper.getBuyContractList(pageView);
+
+        BiViewInfo biViewInfo2 = new BiViewInfo();
+        BiViewInfo biViewInfo3 = new BiViewInfo();
+        biViewInfo2.setBiType("采购合同");
+        List<BiViewInfo> biViewInfoList1 = new ArrayList<>();
+        for(ContractManagementInfo contractManagementInfo : buyContractList){
+            biViewInfo3.setName(contractManagementInfo.getSeller());
+            biViewInfo3.setValue(contractManagementInfo.getWeight());
+            biViewInfoList1.add(biViewInfo3);
+        }
+        biViewInfo2.setBiViewInfoList(biViewInfoList1);
+        biViewInfos.add(biViewInfo2);
+        // 车辆
+        getTranCount(biViewInfos,seachMoth);
+        // 库存成本
+        getCostCount(biViewInfos,seachMoth);
+        // 库点流向
+        getMapInfo(biViewInfos,seachMoth);
+
+        cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos),60*60);
+        return biViewInfos;
+    }
     /**
      * 库点流向
      *

+ 4 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/entity/view/BiViewInfo.java

@@ -34,6 +34,10 @@ public class BiViewInfo  {
      * 统计数量
      */
     private String count;
+    /**
+     * 统计数量
+     */
+    private Float value;
     /**
      * 统计百分比
      */

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

@@ -65,4 +65,18 @@ public interface ContractManagementInfoMapper extends BaseMapper<ContractManagem
      * @return
      */
     List<ContractManagementInfo> getContractFormByCondition(Map<String, Object> pageView);
+
+    /**
+     * 销售合同排行榜
+     *
+     * @param pageView
+     * @return
+     */
+    List<ContractManagementInfo> getSellContractList(Map<String, Object> pageView);/**
+     * 采购合同排行榜
+     *
+     * @param pageView
+     * @return
+     */
+    List<ContractManagementInfo> getBuyContractList(Map<String, Object> pageView);
 }

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

@@ -970,4 +970,34 @@
                DATE_FORMAT(#{endDate},"%Y%m%d"))
           AND ei.cost_type = '1'
     </select>
+    <select id="getSellContractList" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo">
+        SELECT
+            distinct cmi.buyer ,cmi.weight
+        FROM
+            contract_management_info cmi
+        WHERE
+            cmi.status_flag = 1
+            AND cmi.contract_type = 1
+            AND comp_id = #{compId}
+            and cmi.buyer like  '%公司%'
+            and cmi.delete_flag = 0
+            and YEAR(cmi.create_date) =#{seachMoth}
+            order by cmi.weight desc
+    </select>
+    <select id="getBuyContractList" parameterType="Map"
+            resultType="com.yh.saas.plugin.yiliangyiyun.entity.ContractManagementInfo">
+        SELECT
+            distinct cmi.seller ,cmi.weight
+        FROM
+            contract_management_info cmi
+        WHERE
+            cmi.status_flag = 1
+            AND cmi.contract_type = 2
+            AND comp_id = #{compId}
+            and cmi.seller like  '%公司%'
+            and cmi.delete_flag = 0
+            and YEAR(cmi.create_date) =#{seachMoth}
+            order by cmi.weight desc
+    </select>
 </mapper>