sgj
2026-03-24 b8e8195a9cae963e6f59fcd5208698098e03aba8
fzzy-igdss-web/src/main/java/com/fzzy/common/manager/CommonManager.java
@@ -9,7 +9,6 @@
import com.fzzy.igds.service.*;
import com.fzzy.igds.utils.ContextUtil;
import com.fzzy.igds.utils.DateUtil;
import com.fzzy.work.data.WorkStatus;
import com.fzzy.work.service.WorkOrderService;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysDictData;
@@ -64,11 +63,12 @@
    /**
     * 根据库区编码获取库区网关信息
     *
     * @param deptId
     * @return
     */
    public GatewaySer getGatewaySerByDeptId(String deptId) {
        if(StringUtils.isBlank(deptId)){
        if (StringUtils.isBlank(deptId)) {
            deptId = ContextUtil.subDeptId(null);
        }
@@ -143,14 +143,15 @@
    /**
     * 根据仓库类型获取库区下仓库列表
     *
     * @param deptId
     * @param depotTypes  类型多个,用逗号隔开
     * @param depotTypes 类型多个,用逗号隔开
     * @return
     */
    public List<Depot> listAllDepot(String deptId, String depotTypes) {
        List<Depot> depots = this.listDepotByDeptId(deptId);
        if(null == depots || depots.isEmpty()){
        if (null == depots || depots.isEmpty()) {
            return null;
        }
@@ -255,6 +256,7 @@
        LinkedHashMap<String, Integer> mapMonthOutNum = new LinkedHashMap<>();
        LinkedHashMap<String, Integer> mapWeekAiNum = new LinkedHashMap<>();
        LinkedHashMap<String, Integer> mapWeekSnapNum = new LinkedHashMap<>();
        LinkedHashMap<String, Double> mapWeekMaizeNum = new LinkedHashMap<>();
        String key;
        for (int i = -29; i <= 0; i++) {
            mapMonthInNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
@@ -264,6 +266,7 @@
                mapWeekOutNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
                mapWeekAiNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
                mapWeekSnapNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0);
                mapWeekMaizeNum.put(DateFormatUtils.format(DateUtil.getNewByDay(new Date(), i), "MM-dd"), 0.0);
            }
        }
@@ -301,12 +304,40 @@
            mainData.getWeekSnapDateList().add(mapKey);
            mainData.getWeekSnapNumList().add(mapWeekSnapNum.get(mapKey));
        }
        //近七天玉米出库价格统计
        InoutParam inoutParamOfMaize = new InoutParam();
        inoutParamOfMaize.setDeptId(user.getDeptId() + "");
        //粮食品种玉米
        inoutParamOfMaize.setFoodVariety("1120000");
        inoutParamOfMaize.setType(Constant.TYPE_OUT);
        inoutParamOfMaize.setStart(DateUtil.getNewByDay(new Date(), -6));
        inoutParamOfMaize.setEnd(new Date());
        List<InoutRecord> inoutRecordsOfMaize = inoutRecordService.listInout(inoutParamOfMaize);
        if (null != inoutRecordsOfMaize && !inoutRecordsOfMaize.isEmpty()) {
            for (InoutRecord record : inoutRecordsOfMaize) {
                key = DateFormatUtils.format(record.getRegisterTime(), "MM-dd");
                if (null != mapWeekMaizeNum.get(key)) {
                    Double nowPrice = mapWeekMaizeNum.get(key);
                    Double newPrice = record.getPrice();
                    if (nowPrice > newPrice || nowPrice == 0) {
                        nowPrice = newPrice;
                    }
                    mapWeekMaizeNum.put(key, nowPrice);
                }
            }
        }
        for (String mapKey : mapWeekMaizeNum.keySet()) {
            mainData.getWeekMaizeDateList().add(mapKey);
            mainData.getWeekMaizeNumList().add(mapWeekMaizeNum.get(mapKey));
        }
        //查询近30天所有出入库信息
        InoutParam inoutParam = new InoutParam();
        param.setDeptId(user.getDeptId() + "");
        param.setStart(DateUtil.getNewByDay(new Date(), -29));
        param.setEnd(new Date());
        inoutParam.setDeptId(user.getDeptId() + "");
        inoutParam.setStart(DateUtil.getNewByDay(new Date(), -29));
        inoutParam.setEnd(new Date());
        List<InoutRecord> inoutRecords = inoutRecordService.listInout(inoutParam);
        if (null != inoutRecords && !inoutRecords.isEmpty()) {
            for (InoutRecord record : inoutRecords) {