ccj преди 2 години
родител
ревизия
d78e8ef947

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

@@ -1,6 +1,7 @@
 package com.yh.saas.plugin.yiliangyiyun.controller;
 
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.plugins.Page;
 import com.winsea.svc.base.base.util.DateUtils;
@@ -8,6 +9,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.service.*;
+import com.yh.saas.plugin.yiliangyiyun.util.Const;
 import jxl.Cell;
 import jxl.Sheet;
 import jxl.Workbook;
@@ -66,6 +68,8 @@ public class BiInfoController {
     @Autowired
     private IStockPurchaseReceiptReportService stockPurchaseReceiptReportService;
     private String companyId;
+    @Autowired
+    private CacheComponent cacheComponent;
 
     /**
      * 查询
@@ -74,6 +78,10 @@ public class BiInfoController {
      */
     @GetMapping("/selectBiInfo")
     public List<BiViewInfo> selectBiInfo(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<>();
         // 销售合同   执行中的合同
@@ -103,6 +111,7 @@ public class BiInfoController {
         // 收入支出毛利润
         getMoney(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/service/impl/ContractManagementInfoServiceImpl.java

@@ -19,6 +19,7 @@ import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.google.common.collect.Lists;
 import com.winsea.svc.base.security.util.AuthSecurityUtils;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.util.Const;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.httpclient.util.DateUtil;
@@ -92,6 +93,8 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
     @Value("${file-root-path}")
     private String localPath;
 
+    @Autowired
+    private CacheComponent cacheComponent;
     /**
      * 新增合同信息
      *
@@ -346,6 +349,7 @@ public class ContractManagementInfoServiceImpl extends ServiceImpl<ContractManag
 
         boolean two = contractGoodsInfoService.insert(contractGoodsInfo);
         boolean three = contractProcessInfoService.insert(contractProcessInfo);
+        cacheComponent.delPrefixKey(Const.ADMIN_CONTRACTINFO);
         // 假如 都成功返回ok
         if (one && two && three) {
             // 插入操作历史

+ 10 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/QualityInspectionManagementServiceImpl.java

@@ -17,6 +17,7 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.QualityInspectionManagementMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.util.Const;
 import com.yh.saas.plugin.yiliangyiyun.util.QRCodeUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -62,6 +63,10 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
     private ICommonSysParameterService iCommonSysParameterService;
     @Autowired
     private QRCodeUtil qrCodeUtil ;
+
+    @Autowired
+    private CacheComponent cacheComponent;
+
     /**
      * 质检管理列表
      * @param qualityInspectionManagement
@@ -420,6 +425,9 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
         }
         boolean two=weighingManagementService.insert(weighingManagement);
         boolean one=this.insert(qualityInspectionManagement);
+
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+        cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
         //成功返回ok
         if (one &&two ) {
             return qualityInspectionManagement.getId();
@@ -558,6 +566,8 @@ public class QualityInspectionManagementServiceImpl extends ServiceImpl<QualityI
             paymentManagementService.insert(paymentManagement);
             this.insert(qualityInspectionManagement1);
             weighingManagementService.insert(weighingManagement);
+            cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO);
+            cacheComponent.delPrefixKey(Const.ADMIN_WEIGHINGINFO_NUM);
         }
         return "ok";
     }

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

@@ -1,5 +1,7 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.alipay.sofa.runtime.api.annotation.SofaReference;
 import com.alipay.sofa.runtime.api.annotation.SofaService;
 import com.aliyun.oss.OSSClient;
@@ -27,6 +29,7 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.WarehouseBaseInfoMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.util.Const;
 import lombok.Getter;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.httpclient.util.DateUtil;
@@ -39,6 +42,7 @@ import org.apache.poi.ss.util.CellRangeAddress;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
+import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.mock.web.MockMultipartFile;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -112,7 +116,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
     private String bucket;
     @Autowired
     private OSSClient ossClient;
-
+    @Autowired
+    private CacheComponent cacheComponent;
 
     /**
      * 全部仓库
@@ -483,6 +488,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         }
         boolean one = this.insert(warehouseBaseInfo);
         boolean two = warehousePositionInfoService.insertBatch(warehousePositionInfoList);
+        cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
         // 假如 都成功返回ok
         if (one && two) {
             return "OK";
@@ -539,6 +545,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             throw new YException(YExceptionEnum.WAREHOUSE_NAME_ERROR);
         }
         this.insert(warehouseBaseInfo);
+        cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
         return warehouseBaseInfo.getId();
     }
 
@@ -548,7 +555,29 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String editWarehouse(WarehouseBaseInfo warehouseBaseInfo) {
+        String personPhone = warehouseBaseInfo.getPersonPhone();
+        String otherPhone = warehouseBaseInfo.getOtherPersonPhone();
         this.updateById(warehouseBaseInfo);
+        if(personPhone != null){
+            if(!personPhone.equals(warehouseBaseInfo.getPersonPhone())){
+                cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
+            }
+        }
+        else{
+            if(warehouseBaseInfo.getPersonPhone()!=null){
+                cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
+            }
+        }
+        if(otherPhone != null){
+            if(!otherPhone.equals(warehouseBaseInfo.getOtherPersonPhone())){
+                cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
+            }
+        }
+        else{
+            if(warehouseBaseInfo.getOtherPersonPhone()!=null){
+                cacheComponent.delPrefixKey(Const.SELF_WAREHOUSE);
+            }
+        }
         if (warehouseBaseInfo.getWarehouseType().equals("1")) {
             List<WarehousePositionInfo> warehousePositionInfoList = warehouseBaseInfo.getWarehousePositionInfoList();
             if (!CollectionUtils.isEmpty(warehousePositionInfoList)) {
@@ -803,6 +832,10 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             compId = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getCompId();
         }
         List<ContractManagementInfo> temp = new ArrayList();
+        List<ContractManagementInfo> listRedis = cacheComponent.getObjList(Const.ADMIN_CONTRACTINFO+compId+flag,ContractManagementInfo.class);
+        if(listRedis != null && listRedis.size() > 0 ){
+            return listRedis;
+        }
         //查所有合同编号
         if (flag == null) {
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
@@ -818,10 +851,13 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
                 temp.add(contractManagementInfo);
             }
+
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //查采购合同编号
         if (flag == 0) {
+
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
                     .eq("comp_id", compId)
                     .eq("contract_type", "2")
@@ -835,10 +871,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
                 temp.add(contractManagementInfo);
             }
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //查销售合同编号
         else if (flag == 1) {
+
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
                     .eq("comp_id", compId)
                     .eq("contract_type", "1")
@@ -853,10 +891,12 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
                 temp.add(contractManagementInfo);
             }
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //查采购订单审核合同编号
         else if (flag == 3) {
+
             List<ContractManagementInfo> contractManagementInfoList = contractManagementInfoService.selectList(new EntityWrapper<ContractManagementInfo>()
                     .eq("comp_id", compId)
                     .eq("contract_type", "2")
@@ -879,6 +919,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 }
                 temp.addAll(contractManagementInfoList);
             }
+
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //查销售订单审核合同编号
@@ -905,6 +947,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 }
                 temp.addAll(contractManagementInfoList);
             }
+
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //查销售合同编号,以及移库任务编号
@@ -981,6 +1025,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo.setInOutType("移库出库");
                 temp.add(contractManagementInfo);
             }
+
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //查采购合同编号(不包含自运),以及移库任务编号
@@ -1079,6 +1125,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo.setInOutType("移库入库");
                 temp.add(contractManagementInfo);
             }
+
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //查采购合同编号(不包含自运),以及移库任务编号,销售合同
@@ -1398,6 +1446,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo1.setInOutType("移库入库");
                 temp.add(contractManagementInfo1);
             }
+
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //采购合同不包含自运
@@ -1416,6 +1466,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo.setGoodsNameKey(contractGoodsInfo.getGoodsNameKey());
                 temp.add(contractManagementInfo);
             }
+
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
         //查采购、销售合同编号,以及移库任务编号
@@ -1445,6 +1497,8 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
                 contractManagementInfo.setInOutType("移库入库");
                 temp.add(contractManagementInfo);
             }
+
+            cacheComponent.putRaw(Const.ADMIN_CONTRACTINFO+compId+flag,JSONObject.toJSONString(temp),60*60*24);
             return temp;
         }
     }
@@ -1464,6 +1518,10 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         if (personCharge == null || personCharge.isEmpty()) {
             personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
         }
+        List<WarehouseBaseInfo> listRedis = cacheComponent.getObjList(Const.SELF_WAREHOUSE+personCharge,WarehouseBaseInfo.class);
+        if(listRedis != null && listRedis.size() > 0 ){
+            return listRedis;
+        }
         Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
         warehouseBaseInfoWrapper.eq("comp_id", compId).eq("delete_flag", "0");
         warehouseBaseInfoWrapper.andNew().eq("person_phone", personCharge).or()
@@ -1573,6 +1631,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             }
 
         }
+        cacheComponent.putRaw(Const.SELF_WAREHOUSE+personCharge,JSONObject.toJSONString(warehouseBaseInfoList),60*60*24);
         return warehouseBaseInfoList;
     }
 
@@ -1591,6 +1650,10 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
         if (personCharge == null || personCharge.isEmpty()) {
             personCharge = AuthSecurityUtils.getStaffById(AuthSecurityUtils.getCurrentUserId()).getStaffMobilePhone();
         }
+        List<WarehouseBaseInfo> listRedis = cacheComponent.getObjList(Const.SELF_WAREHOUSE+personCharge,WarehouseBaseInfo.class);
+        if(listRedis != null && listRedis.size() > 0 ){
+            return listRedis;
+        }
         Wrapper<WarehouseBaseInfo> warehouseBaseInfoWrapper = new EntityWrapper<>();
         warehouseBaseInfoWrapper.eq("comp_id", compId).eq("warehouse_type", "1")
                 .orderBy("warehouse_type", true).eq("delete_flag", "0");
@@ -1715,6 +1778,7 @@ public class WarehouseBaseInfoServiceImpl extends ServiceImpl<WarehouseBaseInfoM
             }
 
         }
+        cacheComponent.putRaw(Const.SELF_WAREHOUSE+personCharge,JSONObject.toJSONString(warehouseBaseInfoList),60*60*24);
         return warehouseBaseInfoList;
     }
 

+ 5 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WarehouseInOutInfoServiceImpl.java

@@ -31,6 +31,7 @@ import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutDetailService;
 import com.yh.saas.plugin.yiliangyiyun.service.IWarehouseInOutInfoService;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
 import com.yh.saas.plugin.yiliangyiyun.util.CalculationUtil;
+import com.yh.saas.plugin.yiliangyiyun.util.Const;
 import com.yh.saas.plugin.yiliangyiyun.util.GeTuiUtils;
 import com.yh.saas.plugin.yiliangyiyun.util.WebSocket;
 import org.springframework.beans.BeanUtils;
@@ -116,6 +117,8 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
     @Autowired
     private IContractInventoryDistributionService contractInventoryDistributionService;
 
+    @Autowired
+    private CacheComponent cacheComponent;
     /**
      * 待完成页面列表
      *
@@ -2045,6 +2048,8 @@ public class WarehouseInOutInfoServiceImpl extends ServiceImpl<WarehouseInOutInf
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String insertOrUpdateInOutTask(WarehouseInOutInfo warehouseInOutInfo) {
+
+        cacheComponent.delPrefixKey(Const.ADMIN_CONTRACTINFO);
         // 根据传参id判断是否是新增
         //  空是新增
         if (StringUtils.isEmpty(warehouseInOutInfo.getId())) {

+ 61 - 42
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/service/impl/WeighingManagementServiceImpl.java

@@ -1,5 +1,6 @@
 package com.yh.saas.plugin.yiliangyiyun.service.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.plugins.Page;
@@ -20,6 +21,7 @@ import com.yh.saas.plugin.yiliangyiyun.exception.YExceptionEnum;
 import com.yh.saas.plugin.yiliangyiyun.mapper.WeighingManagementMapper;
 import com.yh.saas.plugin.yiliangyiyun.service.*;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
+import com.yh.saas.plugin.yiliangyiyun.util.Const;
 import com.yh.saas.plugin.yiliangyiyun.util.QRCodeUtil;
 import org.apache.commons.collections.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -85,6 +87,8 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
     @Autowired
     private INewWorkflowService workflowService;
 
+    @Autowired
+    private CacheComponent cacheComponent;
 
     /**
      * 检斤管理列表
@@ -113,57 +117,72 @@ public class WeighingManagementServiceImpl extends ServiceImpl<WeighingManagemen
         }
         pageView.put("managementType", weighingManagement.getManagementType());
         pageView.put("warehouseName", weighingManagement.getWarehouseName());
+        List<WeighingManagement> listRedis = cacheComponent.getObjList(Const.ADMIN_WEIGHINGINFO+weighingManagement.getPageSize()+"_"+weighingManagement.getCurrentPage(),WeighingManagement.class);
+        if(listRedis != null && listRedis.size() > 0 ){
+            Long countRedis = Long.parseLong(cacheComponent.getRaw(Const.ADMIN_WEIGHINGINFO_NUM+weighingManagement.getPageSize()+"_"+weighingManagement.getCurrentPage()));
+            Page<WeighingManagement> page = new Page<>();
+            page.setRecords(listRedis == null ? Lists.newArrayList() : listRedis);
+            page.setTotal(countRedis == null ? 0 : countRedis);
+            page.setCurrent(weighingManagement.getCurrentPage());
+            page.setSize(weighingManagement.getPageSize());
+            return page;
+        }
         // 查询销售订单总数
         Integer dataCount = baseMapper.getCountByCondition(pageView);
         List<WeighingManagement> dataList = baseMapper.getListByCondition(pageView);
+
         if(StringUtils.isEmpty(weighingManagement.getViewFlag())){
-        if (CollectionUtils.isNotEmpty(dataList)) {
-            for (WeighingManagement weighingManagement1 : dataList) {
-                CommonCompany commonCompany = commonCompanyService.selectOne(new EntityWrapper<CommonCompany>()
-                        .eq("comp_id", weighingManagement1.getCompId()));
-                //公司名
-                if (commonCompany != null) {
-                    weighingManagement1.setCompName(commonCompany.getCompName());
-                }
-                PaymentManagement paymentManagement = paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
-                        .eq("relation_id", weighingManagement1.getRelationId())
-                        .eq("comp_id", weighingManagement1.getCompId()));
-                if (paymentManagement != null) {
-                    weighingManagement1.setPaymentManagement(paymentManagement);
-                }
-                ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
-                        .eq("comp_id",weighingManagement1.getCompId())
-                        .eq("contract_no",weighingManagement1.getContractNo()));
-                if (contractManagementInfo!=null){
-                    weighingManagement1.setContractManagement(contractManagementInfo);
-                }
-                QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
-                        .eq("relation_id", weighingManagement1.getRelationId())
-                        .eq("comp_id", weighingManagement1.getCompId()));
-                if (qualityInspectionManagement != null) {
-                    weighingManagement1.setQualityInspectionManagement(qualityInspectionManagement);
-                    WarehouseInOutInfo warehouseInOutInfo=warehouseInOutInfoService.selectById(qualityInspectionManagement.getWarehouseInOutId());
-                    if (warehouseInOutInfo!=null){
-                        weighingManagement1.setTranCarNo(warehouseInOutInfo.getTranCarNo());
-                        WarehouseInOutDetail warehouseInOutDetail=warehouseInOutDetailService.selectOne(new EntityWrapper<WarehouseInOutDetail>()
-                                .eq("info_id", warehouseInOutInfo.getId()));
-                        if (warehouseInOutDetail!=null){
-                            weighingManagement1.setInOutDetailId(warehouseInOutDetail.getId());
+            if (CollectionUtils.isNotEmpty(dataList)) {
+                for (WeighingManagement weighingManagement1 : dataList) {
+                    CommonCompany commonCompany = commonCompanyService.selectOne(new EntityWrapper<CommonCompany>()
+                            .eq("comp_id", weighingManagement1.getCompId()));
+                    //公司名
+                    if (commonCompany != null) {
+                        weighingManagement1.setCompName(commonCompany.getCompName());
+                    }
+                    PaymentManagement paymentManagement = paymentManagementService.selectOne(new EntityWrapper<PaymentManagement>()
+                            .eq("relation_id", weighingManagement1.getRelationId())
+                            .eq("comp_id", weighingManagement1.getCompId()));
+                    if (paymentManagement != null) {
+                        weighingManagement1.setPaymentManagement(paymentManagement);
+                    }
+                    ContractManagementInfo contractManagementInfo=contractManagementInfoService.selectOne(new EntityWrapper<ContractManagementInfo>()
+                            .eq("comp_id",weighingManagement1.getCompId())
+                            .eq("contract_no",weighingManagement1.getContractNo()));
+                    if (contractManagementInfo!=null){
+                        weighingManagement1.setContractManagement(contractManagementInfo);
+                    }
+                    QualityInspectionManagement qualityInspectionManagement = qualityInspectionManagementService.selectOne(new EntityWrapper<QualityInspectionManagement>()
+                            .eq("relation_id", weighingManagement1.getRelationId())
+                            .eq("comp_id", weighingManagement1.getCompId()));
+                    if (qualityInspectionManagement != null) {
+                        weighingManagement1.setQualityInspectionManagement(qualityInspectionManagement);
+                        WarehouseInOutInfo warehouseInOutInfo=warehouseInOutInfoService.selectById(qualityInspectionManagement.getWarehouseInOutId());
+                        if (warehouseInOutInfo!=null){
+                            weighingManagement1.setTranCarNo(warehouseInOutInfo.getTranCarNo());
+                            WarehouseInOutDetail warehouseInOutDetail=warehouseInOutDetailService.selectOne(new EntityWrapper<WarehouseInOutDetail>()
+                                    .eq("info_id", warehouseInOutInfo.getId()));
+                            if (warehouseInOutDetail!=null){
+                                weighingManagement1.setInOutDetailId(warehouseInOutDetail.getId());
+                            }
                         }
                     }
-                }
-                WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
-                        .eq("comp_id", weighingManagement1.getCompId())
-                        .eq("warehouse_name", weighingManagement1.getWarehouseName()));
-                if (warehouseBaseInfo != null) {
-                    //仓库负责人,电话
-                    weighingManagement1.setPerson(warehouseBaseInfo.getPersonCharge());
-                    weighingManagement1.setPersonPhone(warehouseBaseInfo.getPersonPhone());
-                    weighingManagement1.setAutomaticWeightAcquisition(warehouseBaseInfo.getAutomaticWeightAcquisition());
+                    WarehouseBaseInfo warehouseBaseInfo = warehouseBaseInfoService.selectOne(new EntityWrapper<WarehouseBaseInfo>()
+                            .eq("comp_id", weighingManagement1.getCompId())
+                            .eq("warehouse_name", weighingManagement1.getWarehouseName()));
+                    if (warehouseBaseInfo != null) {
+                        //仓库负责人,电话
+                        weighingManagement1.setPerson(warehouseBaseInfo.getPersonCharge());
+                        weighingManagement1.setPersonPhone(warehouseBaseInfo.getPersonPhone());
+                        weighingManagement1.setAutomaticWeightAcquisition(warehouseBaseInfo.getAutomaticWeightAcquisition());
+                    }
                 }
             }
         }
-    }
+
+        cacheComponent.putRaw(Const.ADMIN_WEIGHINGINFO+weighingManagement.getPageSize()+"_"+weighingManagement.getCurrentPage(), JSONObject.toJSONString(dataList),60*60*24);
+        cacheComponent.putRaw(Const.ADMIN_WEIGHINGINFO_NUM+weighingManagement.getPageSize()+"_"+weighingManagement.getCurrentPage(), dataList.size()+"",60*60*24);
+
         Page<WeighingManagement> page = new Page<>();
         page.setRecords(dataList == null ? Lists.newArrayList() : dataList);
         page.setTotal(dataCount == null ? 0 : dataCount);

+ 6 - 0
winsea-haixin-plugin-yiliangyiyun/src/main/java/com/yh/saas/plugin/yiliangyiyun/util/Const.java

@@ -34,4 +34,10 @@ public class Const {
 
     public static final String ADMIN_REDIS_PREFIX = "ADMIN_SESSION_";
 
+    public static final String SELF_WAREHOUSE = "SELF_WAREHOUSE_";
+
+    public static final String ADMIN_CONTRACTINFO = "ADMIN_CONTRACTINFO_";
+    public static final String ADMIN_WEIGHINGINFO = "ADMIN_WEIGHINGINFO_";
+    public static final String ADMIN_WEIGHINGINFO_NUM = "ADMIN_WEIGHINGINFO_NUM_";
+    public static final String ADMIN_BI_INFO = "ADMIN_BI_INFO_";
 }