|
@@ -8,6 +8,7 @@ import com.winsea.svc.base.base.util.DateUtils;
|
|
import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.view.BiViewInfo;
|
|
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.service.*;
|
|
import com.yh.saas.plugin.yiliangyiyun.util.Const;
|
|
import com.yh.saas.plugin.yiliangyiyun.util.Const;
|
|
import jxl.Cell;
|
|
import jxl.Cell;
|
|
@@ -27,9 +28,7 @@ import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -46,6 +45,8 @@ public class BiInfoController {
|
|
@Autowired
|
|
@Autowired
|
|
private IContractManagementInfoService contractManagementInfoService;
|
|
private IContractManagementInfoService contractManagementInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private ContractManagementInfoMapper contractManagementInfoMapper;
|
|
|
|
+ @Autowired
|
|
private ITranProcessInfoService tranProcessInfoService;
|
|
private ITranProcessInfoService tranProcessInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private IWarehouseInOutInfoService warehouseInOutInfoService;
|
|
private IWarehouseInOutInfoService warehouseInOutInfoService;
|
|
@@ -71,6 +72,15 @@ public class BiInfoController {
|
|
@Autowired
|
|
@Autowired
|
|
private CacheComponent cacheComponent;
|
|
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);
|
|
cacheComponent.putRaw(Const.ADMIN_BI_INFO, JSONObject.toJSONString(biViewInfos),60*60);
|
|
return biViewInfos;
|
|
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;
|
|
|
|
+ }
|
|
/**
|
|
/**
|
|
* 库点流向
|
|
* 库点流向
|
|
*
|
|
*
|