czt
2025-11-27 fdcb3d4255a5897972aae4c31cf0cbaa81aef431
仓库页面
已修改5个文件
已添加9个文件
1695 ■■■■■ 文件已修改
fzzy-igdss-core/src/main/java/com/fzzy/igds/constant/Constant.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/constant/RedisConst.java 228 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DepotRepository.java 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DepotStoreRepository.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotService.java 251 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotStoreService.java 103 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/SysUserService.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/utils/ContextUtil.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/Company.view.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/Depot.view.xml 488 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotPR.java 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/Dept.view.xml 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/SysUserPR.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/models/core.model.xml 285 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/constant/Constant.java
@@ -7,7 +7,10 @@
 */
public class Constant {
    /**
     * ç³»ç»Ÿåç§°
     */
    public static final String APP_NAME = "igdss";
    /**
     * éƒ¨é—¨ç±»åž‹
     */
fzzy-igdss-core/src/main/java/com/fzzy/igds/constant/RedisConst.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,228 @@
package com.fzzy.igds.constant;
/**
 * Redis缓存使用的系统常量配置 ä¸»è¦ç”¨äºŽé…ç½®ç³»ç»Ÿç¼“存的KEY配置
 */
public class RedisConst {
    /**
     * æ ¹æ®ç»„织编码构建实际使用的KEY
     *
     * @param key1 ç»„织编码
     * @param key2 ç¼“å­˜KEY
     * @return
     */
    public static String buildKey(String key1, String key2) {
        return Constant.APP_NAME + ":" + key1 + ":" + key2;
    }
    /**
     * ä¸‰å±‚结构的KEY
     *
     * @param key1
     * @param key2
     * @param tag
     * @return
     */
    public static String buildKey(String key1, String key2, String tag) {
        return Constant.APP_NAME + ":" + key1 + ":" + key2 + ":" + tag;
    }
    /**
     * å››å±‚结构的KEY
     *
     * @param companyId
     * @param key
     * @param tag1
     * @param tag2
     * @return
     */
    public static String buildKey(String companyId, String key, String tag1, String tag2) {
        return Constant.APP_NAME + ":" + companyId + ":" + key + ":" + tag1 + ":" + tag2;
    }
    /**
     * åˆ›å»ºè®¾å¤‡åˆ—表的KEY,以分机为分组创建
     *
     * @param companyId
     * @param key
     * @param tag1
     * @return
     */
    public static String buildDeviceKey(String companyId, String key, String tag1) {
        return Constant.APP_NAME + ":" + companyId + ":" + key + ":" + tag1;
    }
    /**
     * æ ¹æ®ç¼“å­˜KEY的前缀生成缓存KEy
     *
     * @param prefix
     * @param bizId
     */
    public static String buildKeyByPrefix(String prefix, String bizId) {
        if (null == bizId) return Constant.APP_NAME + ":" + prefix;
        return Constant.APP_NAME + ":" + prefix + ":" + bizId;
    }
    /**
     * å­—典表缓存配置
     */
    public static final String KEY_DIC_TRIGGER = "KEY_DIC_TRIGGER";
    /**
     * ä»“库列表KEY
     */
    public static final String KEY_DEPOT = "DEPOT_DATA";
    /**
     * ä»“库参数列表KEY
     */
    public static final String KEY_DEPOT_CONF = "DEPOT_CONF";
    /**
     * åˆ†æœºåˆ—表KEY
     */
    public static final String KEY_DEVICE_SER_LIST = "SER_LIST";
    /**
     * è®¾å¤‡åˆ—表
     */
    public static final String KEY_DEVICE_LIST = "DEVICE_LIST";
    /**
     * å•个色号吧
     */
    public static final String KEY_DEVICE = "DEVICE";
    /**
     * è®¾å¤‡åˆ—表
     */
    public static final String KEY_DEVICE_IOT_LIST = "DEVICE_IOT_LIST";
    /**
     * ä»“库和分机的多对多关系集合
     */
    public static final String KEY_DEPOT_SER_LIST = "DEPOT_SER_LIST";
    /**
     * å»ºç­‘物信息
     */
    public static final String KEY_BUILDING_LIST = "BUILDING_LIST";
    /**
     * æ‰§è¡Œå‘½ä»¤KEY前缀
     */
    public static final String KEY_ORDER_PRE = "ORDER";
    /**
     * æœ€æ–°ç²®æƒ…信息缓存列表,用于存放当前最新的粮情信息
     */
    public static final String KEY_GRAIN = "GRAIN_DATA";
    /**
     * æœ€æ–°æ°”体信息缓存列表
     */
    public static final String KEY_GAS_DATA = "GAS_DATA";
    /**
     * ç³»ç»Ÿé…ç½®KEY
     */
    public static final String KEY_SYS_CONF = "SYS_CONF";
    /**
     * ç²®åº“的温湿度信息缓存
     */
    public static final String KEY_DEPOT_TH_PREFIX = "DEPOT_TH_PREFIX";
    /**
     * ä»¥åˆ†æœºæˆ–者仓库为单位存储的仓温仓湿缓存标标签
     */
    public static final String KEY_T_TH = "T_TH";
    /**
     * å­˜æ”¾æ°”象信息的KEY
     */
    public static final String KEY_WEATHER_INFO = "WEATHER_INFO";
    /**
     * æ ¹æ®ä»“库编码存放最新的能耗数据信息
     */
    public static final String KEY_ES_DATA_MAP = "ES_DATA_MAP";
    /**
     * ç³»ç»Ÿä¸­ç»„织列表
     */
    public static final String KEY_DEPT_LIST = "DEPT_LIST";
    /**
     * åˆ¶æ°®æœºé…ç½®åˆ—表
     */
    public static final String KEY_N2_CONF_LIST = "N2_CONF_LIST";
    /**
     * æœ€æ–°æ°”压信息缓存列表
     */
    public static final String KEY_PRESSURE_DATA = "PRESSURE_DATA";
    /**
     * ç³»ç»Ÿé…ç½®çš„æ‘„像机信息缓存
     */
    public static final String KEY_CAMERA_LIST = "CAMERA_LIST";
    /**
     * ä¸‰ç»´é…ç½®å…³è”信息key
     */
    public static final String KEY_THREE_CONF = "THREE_CONF";
    /**
     * ä¸´æ—¶ç¼“å­˜KEY前缀
     */
    public static final String KEY_TEMP_PREFIX = "TEMP_";
    /**
     * æ•°é‡ç›‘测参数列表KEY--单个设备
     */
    public static final String KEY_QUANTITY_CONF = "QUANTITY_CONF";
    /**
     * ä»“库质量巡检数据缓存
     */
    public static final String KEY_DEPOT_QUALITY = "DEPOT_QUALITY";
    /**
     * ä»“库液位数据缓存
     */
    public static final String KEY_DEPOT_HEIGHT = "DEPOT_HEIGHT";
    /**
     * ä»“库物联网关iot设备温湿度缓存key
     */
    public static final String KEY_IOT_DEPOT_TEMP_HUM = "IOT_DEPOT_TEMP_HUM";
    /**
     * å•个数量检测服务
     */
    public static final String PREFIX_QUANTITY_SER = "QUANTITY_SER";
    /**
     * è­¦å‘Šé…ç½®åˆ—表KEY
     */
    public static final String KEY_WARN_CONF = "WARN_CONF";
    /**
     * é—¨ç£è®¾å¤‡é…ç½®åˆ—表
     */
    public static final String KEY_DOOR_SENSOR_LIST = "DOOR_SENSOR_LIST";
    /**
     * æŠ“拍分机缓存前缀
     */
    public static final String CACHE_KEY_PRE = "SNAP_SER";
    /**
     * AI设备缓存key
     */
    public static final String KEY_AI_SER = "AI_SER";
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DepotRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,78 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.Depot;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/27 13:39
 */
@Service
public interface DepotRepository extends JpaRepository<Depot, String> {
    /**
     * æ ¹æ®ç»„织编码获取仓库货位信息
     *
     * @param companyId
     * @return
     */
    @Query("from Depot where companyId =:companyId order by orderNum")
    List<Depot> getDepotByCompanyId(@Param("companyId") String companyId);
    /**
     * æ ¹æ®ç»„织编码和库区编码获取仓库货位信息
     *
     * @param companyId
     * @param deptId
     * @return
     */
    @Query("from Depot where companyId =:companyId and deptId =:deptId order by orderNum")
    List<Depot> getDepot(@Param("companyId") String companyId, @Param("deptId") String deptId);
    /**
     * æ ¹æ®ç»„织编码和仓库编码获取仓库货位信息
     * @param companyId
     * @param id
     * @return
     */
    @Query("from Depot where companyId =:companyId and id =:id")
    Depot getDepotById(@Param("companyId") String companyId, @Param("id") String id);
    /**
     * æ›´æ–°ä»“库状态
     * @param status
     * @param depotId
     */
    @Transactional
    @Modifying
    @Query("update Depot set depotStatus =:status where id =:depotId")
    void updateDepotStatus(@Param("status") String status, @Param("depotId") String depotId);
    /**
     * æ ¹æ®ids获取仓库
     *
     * @param list
     * @return
     */
    @Query("from Depot where id IN :list order by orderNum")
    List<Depot> getDepotByIds(@Param("list") List<String> list);
    /**
     * æ›´æ–°ä»“库储量
     * @param weight
     * @param depotId
     */
    @Transactional
    @Modifying
    @Query("update Depot set storageReal =:weight where id =:depotId")
    void updateDepotStorage(@Param("weight") Double weight, @Param("depotId") String depotId);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DepotStoreRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,30 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.DepotStore;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/27 13:44
 */
@Service
public interface DepotStoreRepository extends JpaRepository<DepotStore, String>, JpaSpecificationExecutor<DepotStore> {
    /**
     * æ ¹æ®ä»“库编码获取最后一条数据
     * @param depotId
     * @param end
     * @return
     */
    @Query("from DepotStore where depotId =:depotId and createDate <:end order by createDate desc")
    List<DepotStore> getDataByDepotId(@Param("depotId") String depotId,@Param("end") Date end);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,251 @@
package com.fzzy.igds.service;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.domain.Depot;
import com.fzzy.igds.domain.DepotStore;
import com.fzzy.igds.repository.DepotRepository;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.SysDeptMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/27 13:43
 */
@Slf4j
@Service
public class DepotService {
    @Resource
    private DepotRepository depotRepository;
    @Resource
    private RedisCache redisCache;
    @Resource
    private SysDeptMapper deptMapper;
    @Resource
    private DepotStoreService depotStoreService;
    /**
     * jpa查询仓库列表
     * @param companyId
     * @param deptId
     * @return
     */
    public List<Depot> getData(String companyId, String deptId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        if (StringUtils.isEmpty(deptId)) {
            deptId = ContextUtil.subDeptId(null);
        }
        return depotRepository.getDepot(companyId, deptId);
    }
    /**
     * jpa查询仓库列表
     * @param ids
     * @return
     */
    public List<Depot> getDepotByIds(List<String> ids) {
        if (null == ids ||ids.isEmpty()) {
            return null;
        }
        return depotRepository.getDepotByIds(ids);
    }
    /**
     * jpa保存更新仓库信息
     * @param depot
     */
    public void saveDepot(Depot depot) {
        if (StringUtils.isEmpty(depot.getCompanyId())) {
            depot.setCompanyId(ContextUtil.getCompanyId());
        }
        if (StringUtils.isEmpty(depot.getDeptId())) {
            depot.setDeptId(ContextUtil.subDeptId(null));
        }
        if(null == depot.getOrderNum()){
            depot.setOrderNum(1);
        }
        depotRepository.save(depot);
        flushCache(depot.getCompanyId());
    }
    /**
     * jpa更新仓库状态
     * @param depotId
     * @param status
     */
    public void updateDepotStatus(String depotId, String status) {
        if (StringUtils.isEmpty(depotId)) {
            return;
        }
        depotRepository.updateDepotStatus(status, depotId);
    }
    /**
     * jpa删除仓库货位信息
     * @param depot
     */
    public void deleteDepot(Depot depot) {
        depotRepository.delete(depot);
        //删除配置缓存
        this.delCacheDepot(depot, depot.getCompanyId());
    }
    /**
     * åˆ·æ–°ä»“库货位缓存
     * @param companyId
     */
    public void flushCache(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        List<Depot> list = depotRepository.getDepotByCompanyId(companyId);
        this.setCacheDepotList(list, companyId);
    }
    /**
     * è®¾ç½®ç¼“å­˜
     * @param list
     * @param companyId
     */
    public void setCacheDepotList(List<Depot> list, String companyId) {
        if (null == list) return;
        String key;
        for (Depot depot : list) {
            key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT, depot.getId());
            redisCache.setCacheObject(key, depot);
        }
    }
    /**
     * åˆ é™¤ç¼“存信息
     * @param depot
     * @param companyId
     */
    public void delCacheDepot(Depot depot, String companyId) {
        if (null == depot) {
            return;
        }
        if(StringUtils.isEmpty(companyId)){
            companyId = ContextUtil.getCompanyId();
        }
        String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT, depot.getId());
        redisCache.deleteObject(key);
    }
    /**
     * èŽ·å–ç¼“å­˜-根据组织编码获取仓库集合
     * @param companyId
     * @return
     */
    public List<Depot> getCacheDepotList(String companyId) {
        if(StringUtils.isEmpty(companyId)){
            companyId = ContextUtil.getCompanyId();
        }
        String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT) + "*";
        Collection<String> keys = redisCache.keys(patten);
        if (null == keys) {
            return null;
        }
        List<Depot> list = new ArrayList<>();
        for (String key : keys) {
            list.add((Depot) redisCache.getCacheObject(key));
        }
        //缓存获取为空,则查询数据库
        if(list.size() < 1){
            list = depotRepository.getDepotByCompanyId(companyId);
            setCacheDepotList(list, companyId);
        }
        //重新排序
        Collections.sort(list, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
        return list;
    }
    /**
     * èŽ·å–ç¼“å­˜-根据组织编码和库区编码获取仓库集合
     * @param companyId
     * @param deptId
     * @return
     */
    public List<Depot> getCacheDepotList(String companyId, String deptId) {
        if (StringUtils.isEmpty(deptId)) {
            return null;
        }
        List<Depot> list = getCacheDepotList(companyId);
        if(null == list || list.isEmpty()){
            return null;
        }
        List<Depot> result = new ArrayList<>();
        for (Depot depot : list) {
            if (deptId.equals(depot.getDeptId())) {
                result.add(depot);
            }
        }
        //重新排序
        Collections.sort(result, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
        return result;
    }
    /**
     * èŽ·å–ä»“åº“ä¿¡æ¯-根据仓库编码获取缓存信息
     * @param companyId
     * @param depotId
     * @return
     */
    public Depot getCacheDepot(String companyId, String depotId) {
        if (StringUtils.isEmpty(depotId)) {
            return null;
        }
        if(StringUtils.isEmpty(companyId)){
            companyId = ContextUtil.getCompanyId();
        }
        String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT, depotId);
        Depot depot = redisCache.getCacheObject(key);
        if(null == depot){
            depot = depotRepository.getDepotById(companyId, depotId);
            redisCache.setCacheObject(key, depot);
        }
        return depot;
    }
    /**
     * æ ¹æ®åº“存信息更新仓库信息
     * @param data
     */
    public void updateByStore(DepotStore data) {
        Depot depot = this.getCacheDepot(data.getCompanyId(), data.getDepotId());
        if (null == depot) {
            return;
        }
        depot.setStorageReal(data.getStorageReal());
        depot.setDepotStatus(data.getDepotStatus());
        depot.setFoodLevel(data.getFoodLevel());
        depot.setFoodLocation(data.getFoodLocation());
        depot.setFoodVariety(data.getFoodVariety());
        depot.setFoodType(data.getFoodType());
        depot.setFoodYear(data.getFoodYear());
        if (null != data.getStoreDate()) {
            depot.setStoreDate(data.getStoreDate());
        }
        this.saveDepot(depot);
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotStoreService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,103 @@
package com.fzzy.igds.service;
import com.fzzy.igds.domain.DepotStore;
import com.fzzy.igds.repository.DepotRepository;
import com.fzzy.igds.repository.DepotStoreRepository;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/27 13:44
 */
@Slf4j
@Service
public class DepotStoreService {
    @Resource
    private DepotStoreRepository depotStoreRepository;
    @Resource
    private DepotRepository depotRepository;
    /**
     * JPA分页查询数据
     *
     * @param specification
     * @param pageable
     * @return
     */
    public Page<DepotStore> findAll(Specification<DepotStore> specification, Pageable pageable) {
        return depotStoreRepository.findAll(specification, pageable);
    }
    /**
     * JPA更新保存数据
     *
     * @param data
     */
    public void saveDepotStore(DepotStore data) {
        if (StringUtils.isEmpty(data.getCompanyId())) {
            data.setCompanyId(ContextUtil.getCompanyId());
        }
        if (StringUtils.isEmpty(data.getDeptId())) {
            data.setDeptId(ContextUtil.subDeptId(null));
        }
        data.setUpdateBy(ContextUtil.getLoginUserName());
        data.setUpdateTime(new Date());
        data.setId(data.getDepotId() + "_" + DateFormatUtils.format(data.getStoreDate(), "yyyyMMddHHmmss") + "_" + DateFormatUtils.format(data.getUpdateTime(), "yyyyMMddHHmmss"));
        data.setCreateTime(new Date());
        data.setRemark("系统生成");
        depotStoreRepository.save(data);
    }
    /**
     * JPA删除数据
     *
     * @param data
     * @return
     */
    public String delDepotStore(DepotStore data) {
        depotStoreRepository.delete(data);
        return null;
    }
    /**
     * JPA获取仓库最后一条库存数据
     *
     * @param depotId
     * @param time
     * @return
     */
    public DepotStore getLastData(String depotId, Date time) {
        List<DepotStore> list = depotStoreRepository.getDataByDepotId(depotId, time);
        if (null == list || list.isEmpty()) {
            return null;
        }
        return list.get(0);
    }
    public void addDepotStore(DepotStore store, boolean updateDepot) {
        if (null == store.getUpdateTime()) store.setUpdateTime(new Date());
        if (null == store.getId()) store.setId(ContextUtil.generateId());
        depotStoreRepository.save(store);
        if (updateDepot) {
            depotRepository.updateDepotStorage(store.getStorageReal(), store.getDepotId());
        }
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/SysUserService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
package com.fzzy.igds.service;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.SysUserMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2024/11/22 18:03
 */
@Slf4j
@Service
public class SysUserService {
    @Resource
    private SysUserMapper userMapper;
    /**
     * æ ¹æ®ç»„织编码,获取用户列表
     * @param companyId
     * @return
     */
    public List<SysUser> getUser(String companyId) {
        if(StringUtils.isEmpty(companyId)){
            companyId = ContextUtil.getCompanyId();
        }
        SysUser sysUser = new SysUser();
        sysUser.setCompanyId(companyId);
        return userMapper.selectUserList(sysUser);
    }
    /**
     * æ ¹æ®ç™»å½•名称,获取用户信息
     * @param loginName
     * @return
     */
    public SysUser getUserByLoginName(String loginName) {
        return userMapper.selectUserByLoginName(loginName);
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/utils/ContextUtil.java
@@ -22,6 +22,9 @@
    private static final AtomicLong sequence = new AtomicLong(0);
    private static String lastTimestamp = "";
    //全局用户实时坐在部门
    public static Map<String, String> contextUserDept = new HashMap<>();
    /**
     * ç”Ÿæˆé¡ºåºID:年月日时分秒毫秒(17位) + åºåˆ—号(4位) = 21位
     *
@@ -60,6 +63,36 @@
    }
    public static String getLoginUserName() {
      return  ShiroUtils.getUserName() ;
        SysUser user = ShiroUtils.getSysUser();
        return null == user ? "系统" : user.getUserName();
    }
    public static SysUser getLoginUser() {
        return ShiroUtils.getSysUser();
    }
    public static String subDeptId(SysUser user) {
        if (null == user) {
            user = getLoginUser();
        }
        if (null == user) {
            return getCompanyId() + "001";
        }
        //从全局获取,如果有则取全局的默认,如果没有则取自己所属
        if (null != contextUserDept.get(user.getLoginName())) {
            return contextUserDept.get(user.getLoginName());
        }
        if (null == user.getDeptId()) {
            return user.getCompanyId();
        }
        return user.getDeptId().toString();
    }
    public static void updateSubDept(String userId, String deptId) {
        if (null == deptId) return;
        contextUserDept.put(userId, deptId);
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/Company.view.xml
@@ -230,7 +230,7 @@
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
          </ClientEvent>
          <Property name="caption">刷新</Property>
          <Property name="exClassName">btn-q2</Property>
          <Property name="exClassName">btn4</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-refresh</Property>
        </ToolBarButton>
fzzy-igdss-view/src/main/java/com/fzzy/igds/Depot.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,488 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dataTypeUser">
      <Property name="creationType">com.ruoyi.common.core.domain.entity.SysUser</Property>
      <PropertyDef name="loginName">
        <Property name="dataType">String</Property>
        <Property name="label">用户名</Property>
      </PropertyDef>
      <PropertyDef name="userName">
        <Property name="dataType">String</Property>
        <Property name="label">中文名</Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="padding:10">
    <ClientEvent name="onReady">&#xD;
/**&#xD;
 * æŸ¥è¯¢&#xD;
 */&#xD;
query = function(){&#xD;
    view.get(&quot;#dataSetdepot&quot;).flushAsync();&#xD;
}&#xD;</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dataSetdepot">
      <Property name="dataProvider">depotPR#getData</Property>
      <Property name="dataType">[dtDepot]</Property>
    </DataSet>
    <DataSet id="dataSetUser">
      <Property name="dataType">[dataTypeUser]</Property>
      <Property name="dataProvider">sysUserPR#loadUser</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dataSetdepot&quot;).insert();&#xD;
view.get(&quot;#depotdialog&quot;).show();&#xD;
view.get(&quot;#oneId&quot;).set(&quot;readOnly&quot;,false);&#xD;
view.get(&quot;#twoId&quot;).set(&quot;readOnly&quot;,false);</ClientEvent>
          <Property name="caption">新增</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-plus</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dataGridDepot&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#depotdialog&quot;).show();&#xD;
    view.get(&quot;#oneId&quot;).set(&quot;readOnly&quot;,true);&#xD;
    view.get(&quot;#twoId&quot;).set(&quot;readOnly&quot;,true);
}else{&#xD;
    $notify(&quot;请选择需要修改的仓库……&quot;);&#xD;
}</ClientEvent>
          <Property name="caption">修改</Property>
          <Property name="exClassName">btn2</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-pencil-square-o</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dataGridDepot&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#deleteAjaxAction&quot;).set(&quot;parameter&quot;,select).execute();&#xD;
    query();&#xD;
}else{&#xD;
    $notify(&quot;请选择需要删除的仓库……&quot;);&#xD;
}</ClientEvent>
          <Property name="caption">删除</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-times</Property>
        </ToolBarButton>
        <ToolBarButton>
          <Property name="caption">刷新缓存</Property>
          <Property name="exClassName">btn4</Property>
          <Property name="iconClass">fa fa-refresh</Property>
          <Property name="width">100</Property>
          <Property name="action">ajaxRefreshCache</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">var url = &quot;com.fzzy.igds.sys.DepotStore.d&quot;;&#xD;
var panelId = window.frameElement.getAttribute('data-id');
window.parent.$.modal.openTab(&quot;库存管理&quot;, url, false, panelId);</ClientEvent>
          <Property name="caption">库存管理</Property>
          <Property name="iconClass">fa fa-book</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="width">100</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dataGridDepot" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridDepot&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dataSetdepot</Property>
        <Property name="selectionMode">singleRow</Property>
        <Property name="readOnly">true</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="id">
          <Property name="property">id</Property>
          <Property name="align">center</Property>
          <Property name="width">160</Property>
        </DataColumn>
        <DataColumn name="name">
          <Property name="property">name</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="depotStatus">
          <Property name="property">depotStatus</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="foodVariety">
          <Property name="property">foodVariety</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="foodType">
          <Property name="property">foodType</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="foodLevel">
          <Property name="property">foodLevel</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="storageReal">
          <Property name="property">storageReal</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="foodYear">
          <Property name="property">foodYear</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="foodLocation">
          <Property name="property">foodLocation</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="storeDate">
          <Property name="property">storeDate</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="storeKeeperName">
          <Property name="property">storeKeeperName</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="depotType">
          <Property name="property">depotType</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="updateBy">
          <Property name="property">updateBy</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn name="updateTime">
          <Property name="property">updateTime</Property>
          <Property name="align">center</Property>
          <Property name="width">160</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <Dialog id="depotdialog" layout="regionPadding:8">
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">仓库信息</Property>
      <Property name="width">1200</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button id="btnOK">
          <ClientEvent name="onClick">//同时提交历史书&#xD;
var data = view.get(&quot;#dataSetdepot.data:#&quot;);&#xD;
view.get(&quot;#updateactionSave&quot;).execute(function(result){&#xD;
    if(result){&#xD;
        $notify(result);&#xD;
    }else{&#xD;
        self.get(&quot;parent&quot;).hide();&#xD;
        query();&#xD;
    }&#xD;
});</ClientEvent>
          <Property name="caption">保存</Property>
          <Property name="iconClass">fa fa-check-circle</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="width">120</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">var cur = view.get(&quot;#dataSetdepot.data:#&quot;);&#xD;
if(cur) cur.cancel();&#xD;
self.get(&quot;parent&quot;).hide();</ClientEvent>
          <Property name="caption">取消</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="iconClass">fa fa-times-circle</Property>
          <Property name="width">120</Property>
        </Button>
      </Buttons>
      <Children>
        <FieldSet layout="padding:5">
          <Property name="caption">基本信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dataSetdepot</Property>
              <Property name="readOnly">false</Property>
              <Property name="labelSeparator"> : </Property>
              <Property name="labelAlign">right</Property>
              <Property name="cols">*,*,*,*,*,*</Property>
              <Property name="labelWidth">80</Property>
              <AutoFormElement id="oneId" layoutConstraint="colSpan:2">
                <Property name="name">id</Property>
                <Property name="property">id</Property>
                <Editor>
                  <TextEditor>
                    <Property name="blankText">-- ç³»ç»Ÿè‡ªåŠ¨ç”Ÿæˆ --</Property>
                  </TextEditor>
                </Editor>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">name</Property>
                <Property name="property">name</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">deptId</Property>
                <Property name="property">deptId</Property>
                <Editor/>
              </AutoFormElement>
                <AutoFormElement layoutConstraint="colSpan:2">
                    <Property name="name">storageMax</Property>
                    <Property name="property">storageMax</Property>
                    <Editor/>
                </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">storeType</Property>
                <Property name="property">storeType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">createBy</Property>
                <Property name="property">createBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">depotStatus</Property>
                <Property name="property">depotStatus</Property>
                <Property name="trigger">autoMappingDropDown2</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">depotType</Property>
                <Property name="property">depotType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">createTime</Property>
                <Property name="property">createTime</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">storeKeeperName</Property>
                <Property name="property">storeKeeperName</Property>
                <Property name="trigger">triggerUserList</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">orderNum</Property>
                <Property name="property">orderNum</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">updateBy</Property>
                <Property name="property">updateBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:4">
                <Property name="name">remark</Property>
                <Property name="property">remark</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">updateTime</Property>
                <Property name="property">updateTime</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:5">
          <Property name="caption">储粮信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dataSetdepot</Property>
              <Property name="readOnly">false</Property>
              <Property name="labelSeparator"> : </Property>
              <Property name="labelAlign">right</Property>
              <Property name="cols">*,*,*,*,*,*</Property>
              <Property name="labelWidth">80</Property>
              <AutoFormElement id="twoId" layoutConstraint="colSpan:2">
                <Property name="name">storageReal</Property>
                <Property name="property">storageReal</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">foodVariety</Property>
                <Property name="property">foodVariety</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">foodType</Property>
                <Property name="property">foodType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">foodLevel</Property>
                <Property name="property">foodLevel</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">foodYear</Property>
                <Property name="property">foodYear</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">foodLocation</Property>
                <Property name="property">foodLocation</Property>
                <Property name="trigger">ddFoodOrigin</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">storeDate</Property>
                <Property name="property">storeDate</Property>
                <Editor/>
              </AutoFormElement>
              <Label>
                <Property name="text"></Property>
                <Property name="style">
                  <Property name="color">blue</Property>
                  <Property name="padding-left">50px</Property>
                </Property>
              </Label>
              <Label layoutConstraint="colSpan:3">
                <Property name="text">说明:1、实际储量调整请使用“库存管理”功能;</Property>
                <Property name="style">
                  <Property name="color">blue</Property>
                  <Property name="padding-left">50px</Property>
                </Property>
              </Label>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:5">
          <Property name="caption">质检信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dataSetdepot</Property>
              <Property name="readOnly">false</Property>
              <Property name="labelSeparator"> : </Property>
              <Property name="labelAlign">right</Property>
              <Property name="cols">*,*,*,*,*,*</Property>
              <Property name="labelWidth">80</Property>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">perWet</Property>
                <Property name="property">perWet</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">perImpurity</Property>
                <Property name="property">perImpurity</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">bulkWeight</Property>
                <Property name="property">bulkWeight</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">checkDate</Property>
                <Property name="property">checkDate</Property>
                <Editor/>
              </AutoFormElement>
              <Label>
                <Property name="text"></Property>
                <Property name="style">
                  <Property name="color">blue</Property>
                  <Property name="padding-left">50px</Property>
                </Property>
              </Label>
              <Label layoutConstraint="colSpan:3">
                <Property name="text">说明:储备粮质检信息会根据质量管理 è‡ªåŠ¨åŒæ­¥æ›´æ–°</Property>
                <Property name="style">
                  <Property name="color">blue</Property>
                  <Property name="padding-left">50px</Property>
                </Property>
              </Label>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="updateactionSave">
      <Property name="executingMessage">正在执行中..</Property>
      <Property name="dataResolver">depotPR#saveOrUpdate</Property>
      <UpdateItem>
        <Property name="dataSet">dataSetdepot</Property>
        <Property name="dataPath">[#current]</Property>
        <Property name="alias">data</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="deleteAjaxAction">
      <Property name="successMessage">删除成功</Property>
      <Property name="service">depotPR#deletedepot</Property>
      <Property name="executingMessage">正在删除</Property>
    </AjaxAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="service">depotPR#flushCache</Property>
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
    </AjaxAction>
    <YearDropDown id="yearDropDown1"/>
    <DataSetDropDown id="triggerUserList">
      <Property name="dataSet">dataSetUser</Property>
      <Property name="property">userName</Property>
      <Property name="assignmentMap">storeKeeperName=userName,storeKeeper=loginName</Property>
    </DataSetDropDown>
    <CustomDropDown id="ddFoodOrigin">
      <Property name="minHeight">500</Property>
      <Property name="assignmentMap">foodLocation=name</Property>
      <Property name="minWidth">500</Property>
      <Container layout="regionPadding:5">
        <DataSet id="dsFoodOrigin">
          <Property name="dataProvider">dicAreaPR#pageList</Property>
          <Property name="parameter"></Property>
          <Property name="pageSize">30</Property>
          <Property name="dataType">[dtArea]</Property>
        </DataSet>
        <Container layout="hbox regionPadding:5">
          <TextEditor id="key2">
            <Property name="blankText"> -- åç§° --</Property>
            <Property name="width">200</Property>
          </TextEditor>
          <Button>
            <ClientEvent name="onClick">var key = view.get(&quot;#key2.value&quot;);&#xD;
                  view.get(&quot;#dsFoodOrigin&quot;).set(&quot;parameter&quot;,{key:key}).flushAsync();</ClientEvent>
            <Property name="caption">查询</Property>
            <Property name="iconClass">fa fa-search</Property>
          </Button>
          <Button>
            <ClientEvent name="onClick">var data = view.get(&quot;#dsFoodOrigin.data:#&quot;);&#xD;
                  if(data){&#xD;
                  view.get(&quot;#ddFoodOrigin&quot;).close(data.toJSON());&#xD;
                  }</ClientEvent>
            <Property name="iconClass">fa fa-check</Property>
            <Property name="caption">确定</Property>
          </Button>
        </Container>
        <DataGrid>
          <ClientEvent name="onDataRowDoubleClick">var data = view.get(&quot;#dsFoodOrigin.data:#&quot;);&#xD;
                if(data){&#xD;
                view.get(&quot;#ddFoodOrigin&quot;).close(data.toJSON());&#xD;
                }</ClientEvent>
          <Property name="dataSet">dsFoodOrigin</Property>
          <Property name="readOnly">true</Property>
          <DataColumn name="code">
            <Property name="property">code</Property>
            <Property name="readOnly">true</Property>
            <Property name="align">center</Property>
          </DataColumn>
          <DataColumn name="name">
            <ClientEvent name="onRenderCell">arg.dom.style.fontWeight = &quot;bold&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
            <Property name="property">name</Property>
            <Property name="readOnly">true</Property>
            <Property name="align">center</Property>
          </DataColumn>
          <DataColumn name="simple">
            <Property name="property">simple</Property>
            <Property name="readOnly">true</Property>
            <Property name="align">center</Property>
          </DataColumn>
        </DataGrid>
        <DataPilot layoutConstraint="bottom">
          <Property name="dataSet">dsFoodOrigin</Property>
        </DataPilot>
      </Container>
    </CustomDropDown>
    <ListDropDown id="listOri">
      <Property name="items">东,南,西,北,东北,东南,西南,西北</Property>
    </ListDropDown>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,102 @@
package com.fzzy.igds;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.fzzy.igds.domain.Depot;
import com.fzzy.igds.service.DepotService;
import com.fzzy.igds.utils.ContextUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/27 13:57
 */
@Slf4j
@Component
public class DepotPR {
    @Resource
    private DepotService depotService;
    /**
     * depotPR#getData
     * @return
     */
    @DataProvider
    public List<Depot> getData(){
        return depotService.getData(null, null);
    }
    /**
     * depotPR#saveOrUpdate
     * @param data
     * @return
     */
    @DataResolver
    @Transactional
    public String saveOrUpdate(Depot data) {
        Depot depot = new Depot();
        BeanUtils.copyProperties(data, depot);
        depotService.saveDepot(depot);
        depotService.flushCache(null);
        return null;
    }
    /**
     * depotPR#deleteDepot
     * @param data
     */
    @Expose
    @Transactional
    public void deleteDepot(Depot data)  {
        Depot depot = new Depot();
        BeanUtils.copyProperties(data, depot);
        depotService.deleteDepot(depot);
    }
    /**
     * depotPR#flushCache
     */
    @Expose
    public void flushCache() {
        depotService.flushCache(null);
    }
    /**
     * ${dorado.getDataProvider("depotPR#getAllCache").getResult()}
     * @return
     */
    @DataProvider
    public List<Depot> getAllCache() {
        return depotService.getCacheDepotList(null, ContextUtil.subDeptId(null));
    }
    /**
     * depotPR#ajaxGetAllCache
     * @return
     */
    @Expose
    public List<Depot> ajaxGetAllCache() {
        return depotService.getCacheDepotList(null, ContextUtil.subDeptId(null));
    }
    /**
     * depotPR#getDepot èŽ·å–ä»“åº“ä¿¡æ¯
     *
     * @param depotId
     * @return
     */
    @Expose
    public Depot getDepot(String depotId) {
        return depotService.getCacheDepot(null, depotId);
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/Dept.view.xml
@@ -163,7 +163,7 @@
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
          </ClientEvent>
          <Property name="caption">刷新</Property>
          <Property name="exClassName">btn-q2</Property>
          <Property name="exClassName">btn4</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-refresh</Property>
        </ToolBarButton>
@@ -231,16 +231,18 @@
            view.get(&quot;#dialogMain&quot;).hide();&#xD;
            }&#xD;
            });</ClientEvent>
          <Property name="caption">确定</Property>
          <Property name="caption">保存</Property>
          <Property name="iconClass">fa fa-check-circle</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="iconClass">fa fa-check</Property>
          <Property name="width">120</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dsMain.data:#&quot;).cancel();&#xD;
            self.get(&quot;parent&quot;).hide();</ClientEvent>
          <Property name="caption">取消</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="iconClass">fa fa-times</Property>
          <Property name="iconClass">fa fa-times-circle</Property>
          <Property name="width">120</Property>
        </Button>
      </Buttons>
      <Children>
fzzy-igdss-view/src/main/java/com/fzzy/igds/SysUserPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package com.fzzy.igds;
import com.bstek.dorado.annotation.DataProvider;
import com.fzzy.igds.service.SysUserService;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
 * @Description ç”¨æˆ·ä¿¡æ¯
 * @Author CZT
 * @Date 2025/11/27 14:40
 */
@Component
public class SysUserPR {
    @Resource
    private SysUserService sysUserService;
    /**
     * sysUserPR#loadUser
     * @return
     */
    @DataProvider
    public List<SysUser> loadUser() {
        return sysUserService.getUser(null);
    }
}
fzzy-igdss-view/src/main/java/models/core.model.xml
@@ -148,4 +148,289 @@
      <Property name="required">false</Property>
    </PropertyDef>
  </DataType>
  <DataType name="dtDepot">
    <Property name="creationType">com.fzzy.igds.domain.Depot</Property>
    <PropertyDef name="id">
      <Property></Property>
      <Property name="label">仓库编号</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
    <PropertyDef name="companyId">
      <Property></Property>
      <Property name="label">组织编码</Property>
    </PropertyDef>
    <PropertyDef name="deptId">
      <Property></Property>
      <Property name="label">所属分库</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;deptPR#getData&quot;).getResult()}</Property>
        <Property name="keyProperty">deptId</Property>
        <Property name="valueProperty">deptName</Property>
      </Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
    <PropertyDef name="name">
      <Property></Property>
      <Property name="label">仓库名称</Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="depotType">
      <Property></Property>
      <Property name="label">仓房类型</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerDepotType&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="depotStatus">
      <Property></Property>
      <Property name="label">仓库状态</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerDepotStatus&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="storeType">
      <Property></Property>
      <Property name="label">储粮方式</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerStoreType&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="storageMax">
      <Property name="dataType">Double</Property>
      <Property name="label">设计储量</Property>
      <Property name="displayFormat">#0.0 KG</Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="storageReal">
      <Property name="dataType">Double</Property>
      <Property name="label">实际储量</Property>
      <Property name="displayFormat">#0.0 KG</Property>
      <Property name="required">false</Property>
    </PropertyDef>
    <PropertyDef name="foodType">
      <Property></Property>
      <Property name="label">粮食性质</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;FOOD_TYPE_&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="foodVariety">
      <Property></Property>
      <Property name="label">粮食品种</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;FOOD_VARIETY_&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="foodLevel">
      <Property></Property>
      <Property name="label">粮食等级</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerFoodLevel&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="foodLocation">
      <Property></Property>
      <Property name="label">粮食产地</Property>
    </PropertyDef>
    <PropertyDef name="foodLocationId">
      <Property></Property>
      <Property name="label">粮食产地</Property>
    </PropertyDef>
    <PropertyDef name="foodYear">
      <Property></Property>
      <Property name="label">粮食年份</Property>
    </PropertyDef>
    <PropertyDef name="perWet">
      <Property name="dataType">Double</Property>
      <Property name="label">水分</Property>
      <Property name="displayFormat">0.0 %</Property>
    </PropertyDef>
    <PropertyDef name="perImpurity">
      <Property name="dataType">Double</Property>
      <Property name="label">杂质</Property>
      <Property name="displayFormat">0.0 %</Property>
    </PropertyDef>
    <PropertyDef name="bulkWeight">
      <Property name="dataType">Double</Property>
      <Property name="label">容重</Property>
      <Property name="displayFormat">0.0 g/L</Property>
    </PropertyDef>
    <PropertyDef name="storeKeeper">
      <Property></Property>
      <Property name="label">保管员</Property>
    </PropertyDef>
    <PropertyDef name="storeKeeperName">
      <Property></Property>
      <Property name="label">保管员</Property>
    </PropertyDef>
    <PropertyDef name="storeDate">
      <Property name="dataType">Date</Property>
      <Property name="label">入库日期</Property>
    </PropertyDef>
    <PropertyDef name="checkDate">
      <Property name="dataType">Date</Property>
      <Property name="label">质检日期</Property>
    </PropertyDef>
    <PropertyDef name="remark">
      <Property></Property>
      <Property name="label">备注信息</Property>
    </PropertyDef>
    <PropertyDef name="orderNum">
      <Property name="dataType">Integer</Property>
      <Property name="label">顺序号</Property>
    </PropertyDef>
    <PropertyDef name="createTime">
      <Property name="dataType">DateTime</Property>
      <Property name="label">创建时间</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
    <PropertyDef name="createBy">
      <Property></Property>
      <Property name="label">创建人</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
    <PropertyDef name="updateTime">
      <Property name="dataType">DateTime</Property>
      <Property name="label">更新时间</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
    <PropertyDef name="updateBy">
      <Property></Property>
      <Property name="label">更新人</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
  </DataType>
  <DataType name="dtDepotStore">
    <Property name="creationType">com.fzzy.igds.domain.DepotStore</Property>
    <PropertyDef name="id">
      <Property></Property>
    </PropertyDef>
    <PropertyDef name="companyId">
      <Property></Property>
      <Property name="label">组织编码</Property>
    </PropertyDef>
    <PropertyDef name="deptId">
      <Property></Property>
      <Property name="label">所属分库</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;deptPR#getData&quot;).getResult()}</Property>
        <Property name="keyProperty">deptId</Property>
        <Property name="valueProperty">deptName</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="depotId">
      <Property></Property>
      <Property name="label">所属仓库</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;depotPR#getAllCache&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">name</Property>
      </Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="foodType">
      <Property></Property>
      <Property name="label">粮食性质</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;FOOD_TYPE_&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="foodVariety">
      <Property></Property>
      <Property name="label">粮食品种</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;FOOD_VARIETY_&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="foodLevel">
      <Property></Property>
      <Property name="label">粮食等级</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerFoodLevel&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="foodLocationId">
      <Property></Property>
      <Property name="label">粮食产地</Property>
    </PropertyDef>
    <PropertyDef name="foodLocation">
      <Property></Property>
      <Property name="label">粮食产地</Property>
    </PropertyDef>
    <PropertyDef name="foodYear">
      <Property></Property>
      <Property name="label">收货年度</Property>
    </PropertyDef>
    <PropertyDef name="depotStatus">
      <Property></Property>
      <Property name="label">仓库状态</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerDepotStatus&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="storeDate">
      <Property name="dataType">DateTime</Property>
      <Property name="label">入仓时间</Property>
    </PropertyDef>
    <PropertyDef name="fullDate">
      <Property name="dataType">Date</Property>
      <Property name="label">封仓日期</Property>
    </PropertyDef>
    <PropertyDef name="outDate">
      <Property name="label">出仓完成时间</Property>
      <Property name="dataType">DateTime</Property>
    </PropertyDef>
    <PropertyDef name="storageReal">
      <Property name="dataType">Double</Property>
      <Property name="label">实际储量</Property>
      <Property name="displayFormat">#,##0 KG</Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="remark">
      <Property></Property>
      <Property name="label">备注</Property>
    </PropertyDef>
    <PropertyDef name="createTime">
      <Property name="dataType">DateTime</Property>
      <Property name="label">创建时间</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
    <PropertyDef name="createBy">
      <Property></Property>
      <Property name="label">创建人</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
    <PropertyDef name="updateTime">
      <Property name="dataType">DateTime</Property>
      <Property name="label">更新时间</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
    <PropertyDef name="updateBy">
      <Property></Property>
      <Property name="label">更新人</Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
  </DataType>
</Model>