已修改9个文件
192 ■■■■ 文件已修改
fzzy-igdss-core/src/main/java/com/fzzy/igds/data/MainData.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotService.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotPR.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/GrainReport.view.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityData.view.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/java/com/fzzy/common/manager/CommonManager.java 45 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/java/com/fzzy/security/SecurityController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/resources/templates/main.html 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-web/src/main/resources/templates/security/quantity.html 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/data/MainData.java
@@ -1,6 +1,7 @@
package com.fzzy.igds.data;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
@@ -45,4 +46,9 @@
    private List<String> weekSnapDateList = new ArrayList<>();
    private List<Integer> weekSnapNumList = new ArrayList<>();
    //玉米出库价格周统计
    private List<String> weekMaizeDateList = new ArrayList<>();
    private List<Double> weekMaizeNumList = new ArrayList<>();
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotService.java
@@ -2,11 +2,14 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.domain.Depot;
import com.fzzy.igds.domain.DepotStore;
import com.fzzy.igds.domain.Dept;
import com.fzzy.igds.mapper.DepotMapper;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
@@ -32,6 +35,9 @@
    private RedisCache redisCache;
    @Resource
    private DepotStoreService depotStoreService;
    @Resource
    private CoreDeptService coreDeptService;
    /**
     * 查询库区下仓库列表
@@ -61,6 +67,51 @@
        }
        return depotMapper.selectList(queryWrapper);
    }
    /**
     * 根据用户类型查询所有仓库,作为dorado的map回显使用
     *
     * @param deptId
     * @author sgj
     * @since 2026/03/24
     */
    public List<Depot> getDepotByUserType(String deptId) {
        List<Depot> result = new ArrayList<>();
        if (StringUtils.isNotBlank(deptId)) {
            //查公司下所有库区
            result = this.getData(null, deptId, false);
            return result;
        }
        //获取当前登录人
        SysUser user = ContextUtil.getLoginUser();
        if (Constant.USER_TYPE_10.equals(user.getUserType())) {
            //监管用户,直接查询组织下所有库区
            result = this.getData(user.getCompanyId(), null, false);
            return result;
        }
        if (Constant.USER_TYPE_20.equals(user.getUserType())) {
            //银行用户,根据合同查询银行下所有库区
            List<Dept> deptByBank = coreDeptService.getDeptByBank(user.getUserData());
            for (Dept dept : deptByBank) {
                result.addAll(this.getData(null, dept.getId(), false));
            }
            return result;
        }
        if (Constant.USER_TYPE_30.equals(user.getUserType())) {
            //库区用户
            if (ContextUtil.isDepotUser(user.getDeptId() + "")) {
                //查询用户所属库区
                result = this.getData(null, user.getDeptId() + "", false);
            } else {
                //查询用户所属公司下所有库区
                result = this.getData(user.getCompanyId(), null, false);
            }
            return result;
        }
        return result;
    }
    /**
@@ -130,7 +181,6 @@
        lastData.setUpdateTime(new Date());
        lastData.setUpdateBy("系统定时统计");
        lastData.setDepotStatus(depot.getDepotStatus());
        lastData.setFoodVariety(depot.getFoodVariety());
        lastData.setFoodLevel(depot.getFoodLevel());
@@ -138,7 +188,6 @@
        lastData.setFoodLocationId(depot.getFoodLocationId());
        lastData.setFoodType(depot.getFoodType());
        lastData.setFoodYear(depot.getFoodYear());
        lastData.setStorageReal(depot.getStorageReal());
        lastData.setCreateTime(new Date()); //设置为最新时间,其他系统可以通过此时间查询数据是否有更新修改,同步到省平台接口。
@@ -255,7 +304,7 @@
        Collection<String> keys = redisCache.keys(patten);
        if (null != keys) {
            for (String key : keys) {
                if(null == redisCache.getCacheObject(key)){
                if (null == redisCache.getCacheObject(key)) {
                    list = new ArrayList<>();
                    break;
                }
fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotPR.java
@@ -48,6 +48,19 @@
    }
    /**
     *     depotPR#getDepotByUserType
     *
     * @return
     */
    @DataProvider
    public List<Depot> getDepotByUserType(String parentId) {
        if (StringUtils.isNotEmpty(parentId)) {
            return depotService.getDepotByUserType(parentId);
        }
        return depotService.getDepotByUserType(null);
    }
    /**
     * depotPR#saveOrUpdate
     *
     * @param data
fzzy-igdss-view/src/main/java/com/fzzy/igds/GrainReport.view.xml
@@ -561,7 +561,7 @@
        <Property></Property>
        <Property name="label">选择仓库</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getData&quot;).getResult()}</Property>
          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getDepotByUserType&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityData.view.xml
@@ -81,7 +81,7 @@
        <Property></Property>
        <Property name="label">选择仓库</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getData&quot;).getResult()}</Property>
          <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getDepotByUserType&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
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) {
fzzy-igdss-web/src/main/java/com/fzzy/security/SecurityController.java
@@ -250,6 +250,10 @@
        List<QuantityConf> listCamera = secManager.getQuantityConfByDeptId(deptId);
        view.put("listCamera", listCamera);
        //库区网关信息
        GatewaySer gatewaySer = commonManager.getGatewaySerByDeptId(deptId);
        view.put("gatewaySer", gatewaySer);
        return prefix + "/quantity";
    }
fzzy-igdss-web/src/main/resources/templates/main.html
@@ -164,7 +164,8 @@
        </div>
        <div class="layui-col-md6">
            <div class="layui-card">
                <div class="layui-card-header">近7天抓拍统计</div>
<!--                <div class="layui-card-header">近7天抓拍统计</div>-->
                <div class="layui-card-header">近7天玉米出库最低单价统计</div>
                <div class="layui-card-body">
                    <div id="snapChartsWeek" style="height: 300px;"></div>
                </div>
@@ -342,26 +343,65 @@
        myCharts4.setOption({series: [{data: mainData.weekAiNumList}]});
        /** 渲染周统计图表 */
        var myCharts5 = echarts.init(document.getElementById('snapChartsWeek'));
        var options5 = {
        // var myCharts5 = echarts.init(document.getElementById('snapChartsWeek'));
        // var options5 = {
        //     tooltip: {trigger: 'axis', axisPointer: {lineStyle: {color: '#E0E0E0'}}},
        //     color: ['#FFA800'],
        //     legend: {
        //         orient: 'vertical', right: '0px', top: '0px',
        //         data: ['抓拍数'], textStyle: {color: '#595959'}
        //     },
        //     grid: {top: '75px', left: '35px', right: '55px', bottom: '40px'},
        //     xAxis: {
        //         name: '日期',
        //         nameTextStyle: {color: '#595959'},
        //         type: 'category',
        //         data: mainData.weekSnapDateList,
        //         axisLine: {lineStyle: {color: '#E0E0E0'}, symbol: ['none', 'arrow'], symbolOffset: [0, 10]},
        //         axisLabel: {color: '#8c8c8c'},
        //         axisTick: {alignWithLabel: true}
        //     },
        //     yAxis: {
        //         name: '数量',
        //         nameTextStyle: {color: '#595959'},
        //         type: 'value',
        //         boundaryGap: ['0', '20%'],
        //         axisTick: {show: false},
        //         axisLine: {lineStyle: {color: '#E0E0E0'}, symbol: ['none', 'arrow'], symbolOffset: [0, 10]},
        //         axisLabel: {color: '#8c8c8c'},
        //         splitLine: {show: false},
        //         splitArea: {show: false},
        //         minInterval: 1
        //     },
        //     series: [{
        //         name: '抓拍信息', type: 'bar', stack: 'one', barMaxWidth: '30px',
        //         label: {normal: {show: true, position: 'inside'}}
        //     }]
        // };
        // myCharts5.setOption(options5);
        // // 赋值
        // myCharts5.setOption({series: [{data: mainData.weekSnapNumList}]});
         //渲染玉米7天出库最低价格
        var myCharts6 = echarts.init(document.getElementById('snapChartsWeek'));
        var options6 = {
            tooltip: {trigger: 'axis', axisPointer: {lineStyle: {color: '#E0E0E0'}}},
            color: ['#FFA800'],
            legend: {
                orient: 'vertical', right: '0px', top: '0px',
                data: ['抓拍数'], textStyle: {color: '#595959'}
                data: ['出库单价'], textStyle: {color: '#595959'}
            },
            grid: {top: '75px', left: '35px', right: '55px', bottom: '40px'},
            grid: {top: '75px', left: '55px', right: '55px', bottom: '40px'},
            xAxis: {
                name: '日期',
                nameTextStyle: {color: '#595959'},
                type: 'category',
                data: mainData.weekSnapDateList,
                data: mainData.weekMaizeDateList,
                axisLine: {lineStyle: {color: '#E0E0E0'}, symbol: ['none', 'arrow'], symbolOffset: [0, 10]},
                axisLabel: {color: '#8c8c8c'},
                axisTick: {alignWithLabel: true}
            },
            yAxis: {
                name: '数量',
                name: '价格(元/公斤)',
                nameTextStyle: {color: '#595959'},
                type: 'value',
                boundaryGap: ['0', '20%'],
@@ -373,13 +413,13 @@
                minInterval: 1
            },
            series: [{
                name: '抓拍信息', type: 'bar', stack: 'one', barMaxWidth: '30px',
                name: '最低单价', type: 'bar', stack: 'one', barMaxWidth: '30px',
                label: {normal: {show: true, position: 'inside'}}
            }]
        };
        myCharts5.setOption(options5);
        myCharts6.setOption(options6);
        // 赋值
        myCharts5.setOption({series: [{data: mainData.weekSnapNumList}]});
        myCharts6.setOption({series: [{data: mainData.weekMaizeNumList}]});
        /** 窗口大小改变事件 */
        window.onresize = function () {
@@ -387,7 +427,8 @@
            myCharts2.resize();
            myCharts3.resize();
            myCharts4.resize();
            myCharts5.resize();
            // myCharts5.resize();
            myCharts6.resize();
        };
    });
fzzy-igdss-web/src/main/resources/templates/security/quantity.html
@@ -255,6 +255,8 @@
    const bizType = [[${bizType}]];
    //设备列表
    const listCamera = [[${listCamera}]];
    //网关信息
    var gatewaySer = [[${gatewaySer}]];
</script>
<script th:src="@{/js/jquery.min.js}"></script>