1f455e5cda9016054c531bbae6b1639fe646628f..2f432f52c1cfb1567dadcf6e040c5d38b0a26a79
2025-11-28 czt
数量检测配置页面
2f432f 对比 | 目录
2025-11-28 czt
出入库流程及设备、监控、分机、粮情等配置页面及功能
dec93e 对比 | 目录
已修改12个文件
已添加27个文件
7323 ■■■■■ 文件已修改
fzzy-igdss-core/src/main/java/com/fzzy/igds/constant/Constant.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/DepotConf.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/InoutConf.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/QuantityConf.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DepotConfRepository.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeptRepository.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeviceIotRepository.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeviceSerRepository.java 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/InoutConfRepository.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/InoutSysConfRepository.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/QuantityConfRepository.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/SecCameraRepository.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/CoreDeptService.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotConfService.java 249 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DeviceIotService.java 194 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DeviceSerService.java 407 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DicService.java 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutConfService.java 233 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java 239 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/SecCameraService.java 177 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/utils/ContextUtil.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotConf.view.xml 322 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotConfPR.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeptPR.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIot.view.xml 324 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIotPR.java 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceSer.view.xml 427 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceSerPR.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DicArea.view.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/DicPR.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConf.view.xml 804 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConfPR.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutSysConf.view.xml 254 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutSysConfPR.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityConf.view.xml 741 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityConfPR.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/SecCamera.view.xml 1207 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/com/fzzy/igds/SecCameraPR.java 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-view/src/main/java/models/core.model.xml 484 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/constant/Constant.java
@@ -67,4 +67,14 @@
    public static final String NETWORK_01 = "01";// æœ‰çº¿æ¨¡å¼
    public static final String NETWORK_02 = "02";// æ— çº¿æ¨¡å¼
    /**
     * ç¼“å­˜KEY-出入库流程配置信息
     */
    public static final String CACHE_INOUT_SYS_CONF = "INOUT_SYS_CONF";
    /**
     * ç¼“å­˜KEY-出入库配置信息缓存
     */
    public static final String CACHE_INOUT_CONF_LIST = "INOUT_CONF";
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/DepotConf.java
@@ -103,10 +103,6 @@
    @TableField("grain_auto")
    private String grainAuto = Constant.YN_N;
    @Column(name = "only_cur_depot", columnDefinition = "varchar(40) COMMENT '显示当前'")
    @TableField("only_cur_depot")
    private String onlyCurDepot = "Y";
    @Column(name = "is_only_th", columnDefinition = "varchar(40) COMMENT '粮情是否温湿度'")
    @TableField("is_only_th")
    private String isOnlyTH = Constant.YN_N;
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/InoutConf.java
@@ -97,7 +97,7 @@
    @TableField("snap_type")
    private String snapType;
    @Column(name = "plate_snap_type", columnDefinition = "varchar(40) COMMENT '车牌识别抓拍方式'")
    @Column(name = "plate_snap_type", columnDefinition = "varchar(40) COMMENT '抓图识别'")
    @TableField("plate_snap_type")
    private String plateSnapType;
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/QuantityConf.java
@@ -14,8 +14,8 @@
 */
@Data
@Entity
@Table(name = "d_quantity")
@TableName("d_quantity")
@Table(name = "d_quantity_conf")
@TableName("d_quantity_conf")
@EqualsAndHashCode(callSuper = false)
public class QuantityConf extends BizBaseEntity implements Serializable {
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DepotConfRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,56 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.DepotConf;
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/28 15:38
 */
@Service
public interface DepotConfRepository extends JpaRepository<DepotConf, String> {
    /**
     * æ ¹æ®ç»„织编码获取仓库货位信息
     *
     * @param companyId
     * @return
     */
    @Query("from DepotConf where companyId =:companyId order by depotId")
    List<DepotConf> getDepotConfByCompanyId(@Param("companyId") String companyId);
    /**
     * æ ¹æ®ç»„织编码和库区编码获取仓库货位信息
     *
     * @param companyId
     * @param deptId
     * @return
     */
    @Query("from DepotConf where companyId =:companyId and deptId =:deptId order by depotId")
    List<DepotConf> getDepotConf(@Param("companyId") String companyId, @Param("deptId") String deptId);
    /**
     * æ ¹æ®ç»„织编码和仓库编码获取仓库货位信息
     * @param companyId
     * @param depotId
     * @return
     */
    @Query("from DepotConf where companyId =:companyId and depotId =:depotId")
    DepotConf getDepotConfByDepotId(@Param("companyId") String companyId, @Param("depotId") String depotId);
    @Transactional
    @Modifying
    @Query("update DepotConf set grainFreq=:grainFreq where companyId=:companyId and deptId =:deptId")
    int updateGrainFreq(@Param("grainFreq") String grainFreq, @Param("companyId") String companyId, @Param("deptId") String deptId);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeptRepository.java
@@ -28,7 +28,7 @@
    /**
     * æ ¹æ®companyId获取信息
     *
     * @param companyId
     * @param id
     * @return
     */
    @Query("from Dept where id =:id order by id")
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeviceIotRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.DeviceIot;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
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/28 14:42
 */
@Service
public interface DeviceIotRepository extends JpaRepository<DeviceIot, String>, JpaSpecificationExecutor<DeviceIot> {
    /**
     * æ ¹æ®ç»„织编码获取仓库货位信息
     *
     * @param companyId
     * @return
     */
    @Query("from DeviceIot where companyId =:companyId order by id")
    List<DeviceIot> getDeviceIotByCompanyId(@Param("companyId") String companyId);
    /**
     * æ›´æ–°è®¾å¤‡ä½ç½®
     * @param deviceId
     * @param posX
     * @param posY
     */
    @Transactional
    @Modifying
    @Query("update DeviceIot set posX =:posX,posY =:posY where id =:deviceId")
    void updatePos(@Param("deviceId") String deviceId, @Param("posX") Double posX, @Param("posY") Double posY);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/DeviceSerRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,73 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.DeviceSer;
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.Date;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 13:48
 */
@Service
public interface DeviceSerRepository extends JpaRepository<DeviceSer, String> {
    /**
     * æ ¹æ®ç»„织编码获取仓库货位信息
     *
     * @param companyId
     * @return
     */
    @Query("from DeviceSer where companyId =:companyId order by orderNum")
    List<DeviceSer> getDataByDeptId(@Param("companyId") String companyId);
    /**
     * èŽ·å–ä¸‹å±žåˆ†æœºä¿¡æ¯
     *
     * @param parentId
     * @return
     */
    @Query("from DeviceSer where deptId like:parentId order by orderNum")
    List<DeviceSer> getDataByParentId(@Param("parentId") String parentId);
    /**
     * æ ¹æ®ç»„织编码获取仓库货位信息
     *
     * @param companyId
     * @return
     */
    @Query("from DeviceSer where companyId =:companyId and id =:id order by orderNum")
    DeviceSer getDataById(@Param("companyId") String companyId, @Param("id") String id);
    /**
     * æ›´æ–°åˆ†æœºçŠ¶æ€
     * @param companyId
     * @param status
     */
    @Transactional
    @Modifying
    @Query("update DeviceSer set status =:status where  companyId =:companyId")
    void updateSerStatus(@Param("companyId") String companyId, @Param("status") String status);
    /**
     * æ ¹æ®SN更新状态
     * @param ip
     * @param port
     * @param status
     * @param sn
     * @param updateTime
     */
    @Transactional
    @Modifying
    @Query("update DeviceSer set status =:status,ip =:ip,port =:port,updateTime =:updateTime where sn =:sn")
    void updateBySn(@Param("ip") String ip, @Param("port") Integer port,@Param("status") String status,@Param("sn") String sn,@Param("updateTime") Date updateTime);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/InoutConfRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,41 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.InoutConf;
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 20:23
 */
@Service
public interface InoutConfRepository extends JpaRepository<InoutConf, String> {
    /**
     * æ ¹æ®ç»„织编码和库区编码获取信息
     *
     * @param companyId
     * @param deptId
     * @return
     */
    @Query("from InoutConf where companyId =:companyId and deptId =:deptId order by sort,inoutProgress")
    List<InoutConf> getInoutConfList(@Param("companyId") String companyId, @Param("deptId") String deptId);
    /**
     * æ›´æ–°çŠ¶æ€
     * @param status
     * @param ip
     * @param port
     */
    @Transactional
    @Modifying
    @Query("update InoutConf set status =:status where ip =:ip and port =:port")
    void updateInoutConfStatus(@Param("status") String status, @Param("ip") String ip, @Param("port") Integer port);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/InoutSysConfRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,48 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.InoutSysConf;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/27 20:23
 */
@Service
public interface InoutSysConfRepository extends JpaRepository<InoutSysConf, String> {
    /**
     * æ ¹æ®ç»„织编码和库区编码获取信息
     *
     * @param companyId
     * @param deptId
     * @return
     */
    @Query("from InoutSysConf where companyId =:companyId and deptId =:deptId")
    InoutSysConf getInoutSysConf(@Param("companyId") String companyId, @Param("deptId") String deptId);
    /**
     * æ ¹æ®id获取信息
     *
     * @param parentId
     * @return
     */
    @Query("from InoutSysConf where deptId like:parentId order by deptId")
    List<InoutSysConf> getDataByParentId(@Param("parentId") String parentId);
    /**
     * æ ¹æ®companyId获取信息
     *
     * @param companyId
     * @return
     */
    @Query("from InoutSysConf where deptId =:id order by deptId")
    List<InoutSysConf> getDataById(@Param("id") String id);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/QuantityConfRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,53 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.QuantityConf;
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/28 16:52
 */
@Service
public interface QuantityConfRepository extends JpaRepository<QuantityConf, String> {
    /**
     * æ ¹æ®ç»„织编码和库区编码获取仓库货位信息
     *
     * @param companyId
     * @param deptId
     * @return
     */
    @Query("from QuantityConf where companyId =:companyId and deptId =:deptId order by depotId")
    List<QuantityConf> listQuantityConf(@Param("companyId") String companyId, @Param("deptId") String deptId);
    /**
     * æ ¹æ®ç»„织编码获取仓库货位信息
     *
     * @param companyId
     * @return
     */
    @Query("from QuantityConf where companyId =:companyId order by depotId")
    List<QuantityConf> listQuantityConf(@Param("companyId") String companyId);
    /**
     * æ›´æ–°é…ç½®çŠ¶æ€
     * @param ip
     * @param port
     * @param status
     * @param sn
     */
    @Transactional
    @Modifying
    @Query("update QuantityConf set ip =:ip,port =:port,status =:status where sn =:sn")
    void updateConfStatus(@Param("ip") String ip, @Param("port") Integer port, @Param("status") String status, @Param("sn") String sn);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/SecCameraRepository.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,51 @@
package com.fzzy.igds.repository;
import com.fzzy.igds.domain.Camera;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
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/28 10:48
 */
@Service
public interface SecCameraRepository extends JpaRepository<Camera, String> , JpaSpecificationExecutor<Camera> {
    /**
     * æ ¹æ®ç»„织编码和库区编码获取信息
     *
     * @param companyId
     * @param deptId
     * @return
     */
    @Query("from Camera where companyId =:companyId and deptId =:deptId order by orderNum")
    List<Camera> listCamera(@Param("companyId") String companyId, @Param("deptId") String deptId);
    /**
     * æ ¹æ®ç»„织编码和库区编码获取信息
     *
     * @param companyId
     * @return
     */
    @Query("from Camera where companyId =:companyId order by orderNum")
    List<Camera> listCameraByCompanyId(@Param("companyId") String companyId);
    /**
     * æ›´æ–°è®¾å¤‡ä½ç½®
     * @param id
     * @param posX
     * @param posY
     */
    @Transactional
    @Modifying
    @Query("update Camera set posX =:posX,posY =:posY where id =:id")
    void updatePosById(@Param("id") String id, @Param("posX") Double posX, @Param("posY") Double posY);
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/CoreDeptService.java
@@ -25,6 +25,8 @@
    private ISysDeptService iSysDeptService;
    @Resource
    private DeptRepository deptRepository;
    @Resource
    private InoutConfService inoutConfService;
    /**
@@ -36,6 +38,14 @@
        return deptRepository.getDataByParentId(parentId + "%");
    }
    /**
     * jpa查询信息
     * @return
     */
    public List<Dept> getAllDeptData() {
        return deptRepository.getAllData(ContextUtil.getCompanyId());
    }
    /**
     * jpa查询信息
@@ -70,6 +80,9 @@
        dept.setCreateTime(new Date());
        this.update(dept);
        //生成出入库流程配置信息
        inoutConfService.initSysConfData(sysDept.getCompanyId(), dept.getId());
    }
    /**
@@ -93,6 +106,10 @@
     * @return
     */
    public void delData(String deptId) {
        //删除库区信息
        deptRepository.deleteById(deptId);
        //删除流程配置信息
        inoutConfService.delSysConfData(deptId);
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DepotConfService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,249 @@
package com.fzzy.igds.service;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.domain.Depot;
import com.fzzy.igds.domain.DepotConf;
import com.fzzy.igds.repository.DepotConfRepository;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 15:42
 */
@Slf4j
@Service
public class DepotConfService {
    @Resource
    private DepotConfRepository depotConfRepository;
    @Resource
    private DepotService depotService;
    @Resource
    private RedisCache redisCache;
    /**
     * jpa查询配置信息
     *
     * @param companyId
     * @param deptId
     * @return
     */
    public List<DepotConf> getConfList(String companyId, String deptId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        if (StringUtils.isEmpty(deptId)) {
            deptId = ContextUtil.subDeptId(null);
        }
        return depotConfRepository.getDepotConf(companyId, deptId);
    }
    /**
     * jpa更新保存配置信息
     *
     * @param conf
     */
    public void saveConf(DepotConf conf) {
        if (StringUtils.isEmpty(conf.getCompanyId())) {
            conf.setCompanyId(ContextUtil.getCompanyId());
        }
        if (StringUtils.isEmpty(conf.getDeptId())) {
            conf.setDeptId(ContextUtil.subDeptId(null));
            conf.setCreateBy(ContextUtil.getLoginUserName());
            conf.setCreateTime(new Date());
        }
        conf.setUpdateBy(ContextUtil.getLoginUserName());
        conf.setUpdateTime(new Date());
        depotConfRepository.save(conf);
        flushConfCache(conf.getCompanyId());
    }
    /**
     * jpa删除配置信息
     *
     * @param conf
     * @return
     */
    public void deleteDepotConf(DepotConf conf) {
        depotConfRepository.delete(conf);
        //删除配置缓存
        this.delCacheDepotConf(conf, conf.getCompanyId());
    }
    /**
     * è®¾ç½®ç¼“存信息
     *
     * @param list
     * @param companyId
     */
    public void setCacheDepotConf(List<DepotConf> list, String companyId) {
        if (null != list) {
            Depot depot;
            String key;
            for (DepotConf depotConf : list) {
                depot = depotService.getCacheDepot(companyId, depotConf.getDepotId());
                if (null != depot) {
                    depotConf.setDepotName(depot.getName());
                    depotConf.setDepotType(depot.getDepotType());
                }
                key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF, depotConf.getDepotId());
                redisCache.setCacheObject(key, depotConf);
            }
        }
    }
    /**
     * åˆ é™¤ç¼“存信息
     *
     * @param depotConf
     * @param companyId
     */
    public void delCacheDepotConf(DepotConf depotConf, String companyId) {
        if (null == depotConf) {
            return;
        }
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF, depotConf.getDepotId());
        redisCache.deleteObject(key);
    }
    /**
     * èŽ·å–ç¼“å­˜-根据组织编码获取配置信息集合
     *
     * @param companyId
     * @return
     */
    public List<DepotConf> getCacheDepotConfList(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        String patten = RedisConst.buildKey(companyId, RedisConst.KEY_DEPOT_CONF) + "*";
        Collection<String> keys = redisCache.keys(patten);
        if (null == keys || keys.isEmpty()) {
            return null;
        }
        List<DepotConf> result = new ArrayList<>();
        for (String key : keys) {
            result.add((DepotConf) redisCache.getCacheObject(key));
        }
        return result;
    }
    /**
     * èŽ·å–ç¼“å­˜-根据组织编码和粮情分机ID获取配置信息集合
     *
     * @param companyId
     * @param serId
     * @return
     */
    public List<DepotConf> getCacheDepotConfList(String companyId, String serId) {
        List<DepotConf> list = getCacheDepotConfList(companyId);
        if (null == list || list.isEmpty()) {
            return null;
        }
        return list.stream()
                .filter(item -> null != item.getGrainSer() && item.getGrainSer().equals(serId))
                .collect(Collectors.toList());
    }
    /**
     * èŽ·å–ç¼“å­˜-根据组织编码和粮情分机ID获取配置信息
     *
     * @param companyId
     * @param serId
     * @return
     */
    public DepotConf getCacheDepotConfBySerId(String companyId, String serId) {
        List<DepotConf> data = getCacheDepotConfList(companyId);
        if (null == data) {
            return null;
        }
        return data.stream().filter(item -> serId.equals(item.getGrainSer()))
                .findAny().orElse(null);
    }
    /**
     * èŽ·å–ç¼“å­˜-根据组织编码和仓库编码获取配置信息
     *
     * @param companyId
     * @param depotId
     * @return
     */
    public DepotConf getCacheDepotConfByDepotId(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_CONF, depotId);
        DepotConf depotConf = redisCache.getCacheObject(key);
        if (null == depotConf) {
            depotConf = depotConfRepository.getDepotConfByDepotId(companyId, depotId);
            redisCache.setCacheObject(key, depotConf);
        }
        return depotConf;
    }
    /**
     * æ ¹æ®ä»“库列表,自动生成仓库配置信息
     * @param companyId
     */
    private void addConfByDepot(String companyId) {
        List<Depot> list = depotService.getCacheDepotList(companyId);
        if (null == list || list.isEmpty()) {
            return;
        }
        DepotConf conf;
        for (Depot depot : list) {
            conf = new DepotConf();
            conf.setDepotId(depot.getId());
            conf.setCompanyId(depot.getCompanyId());
            conf.setDeptId(depot.getDeptId());
            this.saveConf(conf);
        }
    }
    /**
     * åˆ·æ–°ä»“库配置缓存
     * @param companyId
     */
    public void flushConfCache(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        List<DepotConf> list = depotConfRepository.getDepotConfByCompanyId(companyId);
        this.setCacheDepotConf(list, companyId);
    }
    /**
     * æ›´æ–°ç²®æƒ…保存频率
     * @param freq
     */
    public void updateFreq(String freq) {
        depotConfRepository.updateGrainFreq(ContextUtil.getCompanyId(), ContextUtil.subDeptId(null), freq);
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DeviceIotService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,194 @@
package com.fzzy.igds.service;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.domain.DeviceIot;
import com.fzzy.igds.repository.DeviceIotRepository;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
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.*;
import java.util.stream.Collectors;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 14:45
 */
@Slf4j
@Service
public class DeviceIotService {
    @Resource
    private RedisCache redisCache;
    @Resource
    private DeviceIotRepository deviceIotRepository;
    /**
     * JPA分页查询数据
     *
     * @param specification
     * @param pageable
     * @return
     */
    public Page<DeviceIot> findAll(Specification<DeviceIot> specification, Pageable pageable) {
        return deviceIotRepository.findAll(specification, pageable);
    }
    /**
     * JPA - ä¿å­˜æ•°æ®
     * @param deviceIot
     */
    public void updateDeviceIot(DeviceIot deviceIot) {
        if (StringUtils.isEmpty(deviceIot.getCompanyId())) {
            deviceIot.setCompanyId(ContextUtil.getCompanyId());
        }
        if (StringUtils.isEmpty(deviceIot.getDeptId())) {
            deviceIot.setDeptId(ContextUtil.subDeptId(null));
        }
        if (StringUtils.isEmpty(deviceIot.getId())) {
            deviceIot.setId(ContextUtil.generateId());
            deviceIot.setCreateBy(ContextUtil.getLoginUserName());
            deviceIot.setCreateTime(new Date());
        }
        deviceIot.setUpdateBy(ContextUtil.getLoginUserName());
        deviceIot.setUpdateTime(new Date());
        deviceIotRepository.save(deviceIot);
    }
    /**
     * JPA - åˆ é™¤æ•°æ®
     * @param deviceIot
     */
    public void delDepotDeviceIot(DeviceIot deviceIot) {
        deviceIotRepository.delete(deviceIot);
    }
    /**
     * jpa更新设备位置
     *
     * @param deviceId
     * @param posX
     * @param posY
     */
    public void updatePos(String deviceId, Double posX, Double posY) {
        deviceIotRepository.updatePos(deviceId, posX, posY);
    }
    /**
     * åˆ·æ–°ç¼“å­˜
     * @param companyId
     */
    public void refreshCache(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        // èŽ·å–æ‰€æœ‰çš„è®¾å¤‡ä¿¡æ¯
        List<DeviceIot> listAll =deviceIotRepository.getDeviceIotByCompanyId(companyId);
        if (null != listAll) {
            this.setCacheAllDeviceIot(listAll, companyId);
        }
    }
    /**
     * è®¾ç½®ç¼“å­˜
     * @param listAll
     * @param companyId
     */
    public void setCacheAllDeviceIot(List<DeviceIot> listAll, String companyId) {
        // é¦–先按照分机分组,然后存更新缓存。
        Map<String, List<DeviceIot>> map = listAll.stream().collect(
                Collectors.groupingBy(DeviceIot::getSerId));
        if (null == map || map.isEmpty()) {
            log.error("字典信息:所有设备按照分机分组保存缓存失败,没有分组成功=={}", companyId);
            return;
        }
        for (String serId : map.keySet()) {
            updateCacheDeviceIotBySerId(map.get(serId), companyId, serId);
        }
    }
    /**
     * æ›´æ–°ç¼“å­˜
     * @param listBySer
     * @param companyId
     * @param serId
     */
    public void updateCacheDeviceIotBySerId(List<DeviceIot> listBySer,
                                            String companyId, String serId) {
        String key = RedisConst.buildDeviceKey(companyId,
                RedisConst.KEY_DEVICE_IOT_LIST, serId);
        log.debug("分机-设备-KEY={}", key);
        redisCache.setCacheObject(key, listBySer);
    }
    /**
     * èŽ·å–ç¼“å­˜æ•°æ®
     * @param companyId
     * @param serId
     * @return
     */
    public List<DeviceIot> getCacheDeviceIotBySerId(String companyId, String serId) {
        String key = RedisConst.buildDeviceKey(companyId,
                RedisConst.KEY_DEVICE_IOT_LIST, serId);
        List<DeviceIot> list = (List<DeviceIot>) redisCache.getCacheObject(key);
        if (null == list || list.isEmpty()) {
            log.error("字典信息:没有获取到缓存信息,KEY={}", key);
            return null;
        }
        return list;
    }
    /**
     * èŽ·å–ç¼“å­˜æ•°æ®
     * @param companyId
     * @param depotId
     * @return
     */
    public List<DeviceIot> getCacheDeviceIotByDepotId(String companyId, String depotId) {
        if(org.apache.commons.lang3.StringUtils.isEmpty(depotId)){
            log.error("仓库编码为空,获取Iot设备失败,depotId={}", depotId);
            return null;
        }
        if(StringUtils.isEmpty(companyId)){
            companyId = ContextUtil.getCompanyId();
        }
        String pattern = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_IOT_LIST) + "*";
        Collection<String> keys = redisCache.keys(pattern);
        if (null == keys) {
            log.error("没有获取到Iot缓存key信息");
            return null;
        }
        List<DeviceIot> list = new ArrayList<>();
        List<DeviceIot> result;
        for (String key : keys) {
            result = (List<DeviceIot>) redisCache.getCacheObject(key);
            if(null == result || result.isEmpty()){
                continue;
            }
            for (DeviceIot iot : result) {
                if(depotId.equals(iot.getDepotId())){
                    list.add(iot);
                }
            }
        }
        return list;
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DeviceSerService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,407 @@
package com.fzzy.igds.service;
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.domain.DeviceSer;
import com.fzzy.igds.repository.DeviceSerRepository;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 13:48
 */
@Slf4j
@Service
public class DeviceSerService {
    @Resource
    private ISysDeptService iSysDeptService;
    @Resource
    private DeviceSerRepository deviceSerRepository;
    @Resource
    private RedisCache redisCache;
    /**
     * JPA æŸ¥è¯¢åˆ†æœºåˆ—表
     *
     * @return
     */
    public List<DeviceSer> getAllSer() {
        SysUser user = ContextUtil.getLoginUser();
        SysDept userDept = iSysDeptService.selectDeptById(user.getDeptId());
        if (Constant.DEPT_TYPE_20.equals(userDept.getType())) {
            return deviceSerRepository.getDataByDeptId(user.getDeptId() + "");
        }else {
            return deviceSerRepository.getDataByParentId(user.getDeptId() + "%");
        }
    }
    /**
     * JPA æŸ¥è¯¢åˆ†æœº
     *
     * @param companyId
     * @param id
     * @return
     */
    public DeviceSer getDataById(String companyId, String id) {
        if (StringUtils.isEmpty(id)) {
            return null;
        }
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        return deviceSerRepository.getDataById(companyId, id);
    }
    /**
     * JPA æ›´æ–°ä¿å­˜åˆ†æœº
     *
     * @param ser
     */
    public void saveSer(DeviceSer ser) {
        if (null == ser.getNetworkType()) {
            ser.setNetworkType(Constant.NETWORK_01);
        }
        if (null == ser.getSn()) {
            ser.setSn(ser.getId());
        }
        if (StringUtils.isEmpty(ser.getCompanyId())) {
            ser.setCompanyId(ContextUtil.getCompanyId());
            ser.setCreateBy(ContextUtil.getLoginUserName());
            ser.setCreateTime(new Date());
        }
        ser.setUpdateBy(ContextUtil.getLoginUserName());
        ser.setUpdateTime(new Date());
        deviceSerRepository.save(ser);
        refreshCache(ser.getCompanyId());
    }
    /**
     * JPA æ›´æ–°ä¿å­˜åˆ†æœº
     *
     * @param ser
     */
    public void delSer(DeviceSer ser) {
        deviceSerRepository.delete(ser);
        //删除缓存
        delCache(ser.getCompanyId(), ser.getId());
    }
    /**
     * æ›´æ–°åˆ†æœºä¿¡æ¯
     * @param status
     * @param ip
     * @param port
     */
    public void updateStatusByIp(String status, String ip, Integer port) {
        String companyId = ContextUtil.getCompanyId();
        DeviceSer ser = this.getCacheSerByIp(companyId, ip);
        ser.setStatus(status);
        ser.setIp(ip);
        ser.setPort(port);
        ser.setUpdateTime(new Date());
        deviceSerRepository.save(ser);
        setCacheSer(ser);
    }
    /**
     * æ›´æ–°åˆ†æœºä¿¡æ¯
     * @param data
     */
    public void updateByData(DeviceSer data) {
        if (null == data) {
            return;
        }
        DeviceSer ser = this.getCacheSer(data.getCompanyId(), data.getId());
        if (null == ser) {
            return;
        }
        ser.setStatus(Constant.YN_Y);
        ser.setIp(data.getIp());
        ser.setPort(data.getPort());
        ser.setUpdateTime(new Date());
        ser.setSn(data.getSn());
        deviceSerRepository.save(ser);
        setCacheSer(ser);
    }
    /**
     * æ›´æ–°åˆ†æœºä¿¡æ¯
     * @param companyId
     * @param serId
     * @param controlModel
     */
    public void updateControlModel(String companyId, String serId, String controlModel) {
        DeviceSer ser = this.getCacheSer(companyId, serId);
        if (null == ser) {
            return;
        }
        ser.setStatus(Constant.YN_Y);
        ser.setControlModel(controlModel);
        ser.setUpdateTime(new Date());
        deviceSerRepository.save(ser);
        setCacheSer(ser);
    }
    /**
     * åˆ·æ–°ç¼“å­˜
     *
     * @param companyId
     */
    public void refreshCache(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        List<DeviceSer> list = this.getAllSer();
        this.setCacheSer(list, companyId);
    }
    /**
     * è®¾ç½®å•个分机缓存
     *
     * @param ser
     */
    public void setCacheSer(DeviceSer ser) {
        if (null == ser) {
            return;
        }
        ContextUtil.addSerCompany(ser.getSn(), ser.getCompanyId());
        String key = RedisConst.buildKey(ser.getCompanyId(), RedisConst.KEY_DEVICE_SER_LIST, ser.getId());
        redisCache.setCacheObject(key, ser);
    }
    /**
     * è®¾ç½®ç¼“å­˜
     *
     * @param data
     * @param companyId
     */
    public void setCacheSer(List<DeviceSer> data, String companyId) {
        if (null == data) {
            return;
        }
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        String key;
        for (DeviceSer ser : data) {
            ContextUtil.addSerCompany(ser.getSn(), ser.getCompanyId());
            key = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_SER_LIST, ser.getId());
            redisCache.setCacheObject(key, ser);
        }
    }
    /**
     * åˆ é™¤ç¼“存信息
     *
     * @param companyId
     * @param serId
     */
    public void delCache(String companyId, String serId) {
        if (StringUtils.isEmpty(serId)) {
            return;
        }
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_SER_LIST, serId);
        redisCache.deleteObject(key);
    }
    /**
     * æ ¹æ®ç»„织编码获取分机列表
     *
     * @param companyId
     * @return
     */
    public List<DeviceSer> getCacheSerList(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        String pattern = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_SER_LIST) + "*";
        Collection<String> keys = redisCache.keys(pattern);
        List<DeviceSer> result = new ArrayList<>();
        if (null == keys) {
            return result;
        }
        for (String key : keys) {
            result.add((DeviceSer) redisCache.getCacheObject(key));
        }
        if (result.size() < 1) {
            result = getAllSer();
        }
        if (result.size() < 1) {
            return null;
        }
        //重新排序
        Collections.sort(result, (p1, p2) -> p1.getOrderNum() - p2.getOrderNum());
        return result;
    }
    /**
     * æ ¹æ®ç±»åž‹èŽ·å–åˆ†æœºä¿¡æ¯
     * @param companyId
     * @param type
     * @return
     */
    public List<DeviceSer> getSerCacheByType(String companyId, String type) {
        List<DeviceSer> listAll = this.getCacheSerList(companyId);
        if (null == listAll || listAll.isEmpty()){
            return null;
        }
        if (null == type){
            return listAll;
        }
        List<DeviceSer> result = new ArrayList<DeviceSer>();
        for (DeviceSer ser : listAll) {
            if (ser.getType().equals(type))
                result.add(ser);
        }
        return result;
    }
    /**
     * æ ¹æ®åˆ†æœºID获取分机信息
     *
     * @param companyId
     * @param serId
     * @return
     */
    public DeviceSer getCacheSer(String companyId, String serId) {
        if (StringUtils.isEmpty(serId)) {
            return null;
        }
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        String key = RedisConst.buildKey(companyId, RedisConst.KEY_DEVICE_SER_LIST, serId);
        DeviceSer ser = (DeviceSer) redisCache.getCacheObject(key);
        if (null == ser) {
            ser = getDataById(companyId, serId);
            if (null == ser) {
                log.error("---------缓存中没有获取到分机缓存----------");
                return null;
            }
            redisCache.setCacheObject(key, ser);
        }
        return ser;
    }
    /**
     * æ ¹æ®åˆ†æœºIP获取分机信息
     *
     * @param companyId
     * @param ip
     * @return
     */
    public DeviceSer getCacheSerByIp(String companyId, String ip) {
        if (StringUtils.isEmpty(companyId)) {
            return null;
        }
        List<DeviceSer> serList = getCacheSerList(companyId);
        if (null == serList) {
            return null;
        }
        for (DeviceSer deviceSer : serList) {
            if (deviceSer.getIp().equals(ip)) {
                return deviceSer;
            }
        }
        return null;
    }
    /**
     * æ ¹æ®åˆ†æœºIP和端口获取分机信息
     *
     * @param companyId
     * @param ip
     * @param port
     * @return
     */
    public DeviceSer getCacheSerByIp(String companyId, String ip, Integer port) {
        if (StringUtils.isEmpty(companyId)) {
            return null;
        }
        List<DeviceSer> serList = getCacheSerList(companyId);
        if (null == serList) {
            return null;
        }
        for (DeviceSer deviceSer : serList) {
            if (deviceSer.getIp().equals(ip) && deviceSer.getPort() == port) {
                return deviceSer;
            }
        }
        return null;
    }
    /**
     * æ ¹æ®åˆ†æœºSN获取分机信息
     *
     * @param companyId
     * @param sn
     * @return
     */
    public DeviceSer getCacheSerBySn(String companyId, String sn) {
        if (StringUtils.isEmpty(companyId)) {
            return null;
        }
        List<DeviceSer> serList = getCacheSerList(companyId);
        if (null == serList) {
            return null;
        }
        for (DeviceSer deviceSer : serList) {
            if (deviceSer.getSn().equals(sn)) {
                return deviceSer;
            }
        }
        return null;
    }
    /**
     * JPA-更新设备全部离线
     * @param companyId
     */
    public void allOffLine(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        deviceSerRepository.updateSerStatus(companyId, Constant.YN_N);
    }
    /**
     * JPA-根据SN更新状态
     * @param ip
     * @param port
     * @param sn
     * @param status
     */
    public void onlineBySn(String ip, Integer port, String sn, String status) {
        deviceSerRepository.updateBySn(ip, port, status, sn, new Date());
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/DicService.java
@@ -306,4 +306,68 @@
        return list;
    }
    /**
     * ç”µç¼†èµ·å§‹æ–¹ä½
     *
     * @return
     */
    public List<SysDictData> triggerStartOrientation() {
        List<SysDictData> list = new ArrayList<SysDictData>();
        list.add(new SysDictData("右边", Constant.GRAIN_START_ORIENTATION_RIGHT));
        list.add(new SysDictData("右上", Constant.GRAIN_START_ORIENTATION_RIGHT_UP));
        list.add(new SysDictData("左边", Constant.GRAIN_START_ORIENTATION_LEFT));
        list.add(new SysDictData("左上", Constant.GRAIN_START_ORIENTATION_LEFT_UP));
        return list;
    }
    /**
     * ç”µç¼†å¸ƒçº¿æ–¹å‘
     *
     * @return
     */
    public List<SysDictData> triggerStartDirection() {
        List<SysDictData> list = new ArrayList<SysDictData>();
        list.add(new SysDictData("纵向", Constant.GRAIN_START_DIRECTION_PORTRAIT));
        list.add(new SysDictData("横向", Constant.GRAIN_START_DIRECTION_TRANSVERSE));
        return list;
    }
    /**
     * ç”µç¼†èµ·å§‹ç‚¹ä½
     *
     * @return
     */
    public List<SysDictData> triggerStartPoint() {
        List<SysDictData> list = new ArrayList<SysDictData>();
        list.add(new SysDictData("顶部", Constant.GRAIN_START_POINT_TOP));
        list.add(new SysDictData("底部", Constant.GRAIN_START_POINT_BELOW));
        return list;
    }
    /**
     * å±‚行转换
     *
     * @return
     */
    public List<SysDictData> triggerStartConvert() {
        List<SysDictData> list = new ArrayList<SysDictData>();
        list.add(new SysDictData("默认", Constant.GRAIN_CONVERT_DEFAULT));
        list.add(new SysDictData("顺时针", Constant.GRAIN_CONVERT_CLOCKWISE));
        list.add(new SysDictData("逆时针", Constant.GRAIN_CONVERT_ANTICLOCKWISE));
        return list;
    }
    /**
     * ç­’仓锥形
     *
     * @return
     */
    public List<SysDictData> triggerCableCone() {
        List<SysDictData> list = new ArrayList<SysDictData>();
        list.add(new SysDictData("无锥形", Constant.CABLE_CONE_0));
        list.add(new SysDictData("上锥形", Constant.CABLE_CONE_1));
        list.add(new SysDictData("下锥形", Constant.CABLE_CONE_2));
        return list;
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/InoutConfService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,233 @@
package com.fzzy.igds.service;
import com.fzzy.igds.constant.Constant;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.repository.InoutConfRepository;
import com.fzzy.igds.repository.InoutSysConfRepository;
import com.fzzy.igds.domain.InoutConf;
import com.fzzy.igds.domain.InoutSysConf;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.service.ISysDeptService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
 * @Description å‡ºå…¥åº“配置service层,包含流程配置和设备配置
 * @Author CZT
 * @Date 2025/11/28 09:23
 */
@Slf4j
@Service
public class InoutConfService {
    @Resource
    private ISysDeptService iSysDeptService;
    @Resource
    private InoutSysConfRepository inoutSysConfRepository;
    @Resource
    private InoutConfRepository inoutConfRepository;
    @Resource
    private RedisCache redisCache;
    /*--------------- å‡ºå…¥åº“流程 ---------------*/
    /**
     * JPA-查询流程配置
     *
     * @return
     */
    public List<InoutSysConf> getSysConfData() {
        SysUser user = ContextUtil.getLoginUser();
        SysDept userDept = iSysDeptService.selectDeptById(user.getDeptId());
        if (Constant.DEPT_TYPE_20.equals(userDept.getType())) {
            return inoutSysConfRepository.getDataById(ContextUtil.subDeptId(user));
        }else {
            return inoutSysConfRepository.getDataByParentId(user.getDeptId() + "%");
        }
    }
    /**
     *
     *
     * @param companyId
     * @param deptId
     */
    public void initSysConfData(String companyId, String deptId) {
        InoutSysConf inoutSysConf = new InoutSysConf();
        inoutSysConf.setDeptId(deptId);
        inoutSysConf.setCompanyId(companyId);
        inoutSysConf.setProgressIn("REGISTER-WEIGHT_FULL-HANDLE-WEIGHT_EMPTY-RECORD");
        inoutSysConf.setProgressOut("REGISTER-WEIGHT_EMPTY-HANDLE-WEIGHT_FULL-RECORD");
        this.saveSysConfData(inoutSysConf);
        this.flushInoutSysConfCache(inoutSysConf);
    }
    /**
     *
     * @param deptId
     */
    public void delSysConfData(String deptId) {
        inoutSysConfRepository.deleteById(deptId);
    }
    /**
     * JPA-保存流程配置
     *
     * @param data
     * @return
     */
    public void saveSysConfData(InoutSysConf data) {
        if (StringUtils.isEmpty(data.getCompanyId())) {
            data.setCompanyId(ContextUtil.getCompanyId());
        }
        data.setUpdateBy(ContextUtil.getLoginUserName());
        data.setUpdateTime(new Date());
        inoutSysConfRepository.save(data);
        this.flushInoutSysConfCache(data);
    }
    /**
     * è®¾ç½®ç¼“å­˜
     *
     * @param data
     */
    public void flushInoutSysConfCache(InoutSysConf data) {
        String key = RedisConst.buildKey(data.getDeptId(), Constant.CACHE_INOUT_SYS_CONF);
        redisCache.setCacheObject(key, data);
    }
    /**
     * èŽ·å–ç¼“å­˜ä¿¡æ¯
     *
     * @param companyId
     * @param deptId
     * @return
     */
    public InoutSysConf getCacheInoutSysConf(String companyId, String deptId) {
        String key = RedisConst.buildKey(deptId, Constant.CACHE_INOUT_SYS_CONF);
        return (InoutSysConf) redisCache.getCacheObject(key);
    }
    /*--------------- å‡ºå…¥åº“设备 ---------------*/
    /**
     * JPA-查询设备配置
     *
     * @return
     */
    public List<InoutConf> getInoutConfList(String companyId, String deptId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        if (StringUtils.isEmpty(deptId)) {
            deptId = ContextUtil.subDeptId(null);
        }
        return inoutConfRepository.getInoutConfList(companyId, deptId);
    }
    /**
     * JPA-保存设备配置
     * @param data
     * @return
     */
    public String saveData(InoutConf data) {
        if (0 == data.getInOrder()) {
            data.setInOrder(1);
        }
        if (StringUtils.isEmpty(data.getSort())) {
            data.setSort("1");
        }
        if (StringUtils.isEmpty(data.getId())) {
            data.setId(ContextUtil.generateId());
            data.setCreateBy(ContextUtil.getLoginUserName());
            data.setCreateTime(new Date());
        }
        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());
        inoutConfRepository.save(data);
        return null;
    }
    /**
     * JPA-删除设备配置
     * @param data
     * @return
     */
    public String delData(InoutConf data) {
        inoutConfRepository.delete(data);
        return null;
    }
    /**
     * è®¾ç½®ç¼“å­˜
     * @param companyId
     * @param deptId
     */
    public void flushInoutConfCache(String companyId, String deptId) {
        List<InoutConf> list = this.getInoutConfList(companyId, deptId);
        String key = RedisConst.buildKey(companyId, Constant.CACHE_INOUT_CONF_LIST, deptId);
        redisCache.setCacheObject(key, list);
    }
    /**
     * èŽ·å–ç¼“å­˜
     * @param companyId
     * @param deptId
     * @return
     */
    public List<InoutConf> getCacheInoutConf(String companyId, String deptId) {
        String key = RedisConst.buildKey(companyId, Constant.CACHE_INOUT_CONF_LIST, deptId);
        List<InoutConf> list = redisCache.getCacheObject(key);
        if(null == list){
            list = this.getInoutConfList(companyId, deptId);
            redisCache.setCacheObject(key, list);
        }
        return list;
    }
    /**
     * èŽ·å–ç¼“å­˜
     * @param companyId
     * @param deptId
     * @param confId
     * @return
     */
    public InoutConf getCacheInoutConf(String companyId, String deptId, String confId) {
        if (null == companyId || null == deptId || null == confId) {
            return null;
        }
        List<InoutConf> list = getCacheInoutConf(companyId, deptId);
        if (null == list  || list.isEmpty()) {
            return null;
        }
        for (InoutConf inoutConf : list) {
            if (inoutConf.getId().equals(confId)) {
                return inoutConf;
            }
        }
        return null;
    }
    /**
     * æ›´æ–°å‡ºå…¥åº“设备状态
     * @param ip
     * @param port
     * @param status
     */
    public void updateInoutConfStatus(String ip, Integer port, String status) {
        inoutConfRepository.updateInoutConfStatus(status, ip, port);
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,239 @@
package com.fzzy.igds.service;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.domain.QuantityConf;
import com.fzzy.igds.repository.QuantityConfRepository;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 16:55
 */
@Slf4j
@Service
public class QuantityService {
    @Resource
    private QuantityConfRepository quantityConfRepository;
    @Resource
    private RedisCache redisCache;
    /**
     * JPA - æŸ¥è¯¢é…ç½®ä¿¡æ¯ï¼Œæ ¹æ®åº“区编码获取
     *
     * @param companyId
     * @param deptId
     * @return
     */
    public List<QuantityConf> getConfList(String companyId, String deptId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        if (StringUtils.isEmpty(deptId)) {
            deptId = ContextUtil.subDeptId(null);
        }
        return quantityConfRepository.listQuantityConf(companyId, deptId);
    }
    /**
     * JPA - æŸ¥è¯¢é…ç½®ä¿¡æ¯ï¼Œæ ¹æ®ç»„织编码获取
     *
     * @param companyId
     * @return
     */
    public List<QuantityConf> getConfList(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        return quantityConfRepository.listQuantityConf(companyId);
    }
    /**
     * JPA - æ›´æ–°ä¿å­˜æ•°æ®
     *
     * @param conf
     */
    public void saveConf(QuantityConf conf) {
        if (StringUtils.isEmpty(conf.getDepotId())) {
            return;
        }
        if (StringUtils.isEmpty(conf.getCompanyId())) {
            conf.setCompanyId(ContextUtil.getCompanyId());
        }
        if (StringUtils.isEmpty(conf.getDeptId())) {
            conf.setDeptId(ContextUtil.subDeptId(null));
            conf.setCreateBy(ContextUtil.getLoginUserName());
            conf.setCreateTime(new Date());
        }
        conf.setUpdateBy(ContextUtil.getLoginUserName());
        conf.setUpdateTime(new Date());
        quantityConfRepository.save(conf);
        //刷新缓存
        setCacheQuantityConf(conf);
    }
    /**
     * JPA- æ›´æ–°é…ç½®å’‹æ··ä¸ªå¤ª
     *
     * @param conf
     */
    public void updateQuantityConfBySn(QuantityConf conf) {
        //更新状态
        quantityConfRepository.updateConfStatus(conf.getIp(), conf.getPort(), conf.getStatus(), conf.getSn());
        setCacheQuantityConf(conf);
    }
    /**
     * JPA - åˆ é™¤æ•°æ®
     *
     * @param conf
     * @return
     */
    public String delQuantityConf(QuantityConf conf) {
        quantityConfRepository.delete(conf);
        //删除配置信息
        flushConfCache(conf.getCompanyId(), conf.getDeptId());
        return null;
    }
    /**
     * åˆ·æ–°ç¼“å­˜
     *
     * @param companyId
     * @param deptId
     */
    public void flushConfCache(String companyId, String deptId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        if (StringUtils.isEmpty(deptId)) {
            deptId = ContextUtil.subDeptId(null);
        }
        List<QuantityConf> list = this.getConfList(companyId, deptId);
        this.setCacheQuantityConf(list);
    }
    /**
     * è®¾ç½®ç¼“å­˜
     *
     * @param list
     */
    public void setCacheQuantityConf(List<QuantityConf> list) {
        if (null == list || list.isEmpty()) {
            return;
        }
        String key;
        for (QuantityConf conf : list) {
            if (StringUtils.isEmpty(conf.getSn())) {
                conf.setSn(conf.getYtIp());
            }
            key = RedisConst.buildKeyByPrefix(RedisConst.KEY_QUANTITY_CONF, conf.getSn());
            redisCache.setCacheObject(key, conf);
        }
    }
    /**
     * è®¾ç½®ç¼“å­˜
     *
     * @param conf
     */
    public void setCacheQuantityConf(QuantityConf conf) {
        if (StringUtils.isEmpty(conf.getSn())) {
            conf.setSn(conf.getYtIp());
        }
        String key = RedisConst.buildKeyByPrefix(RedisConst.KEY_QUANTITY_CONF, conf.getSn());
        redisCache.setCacheObject(key, conf);
    }
    /**
     * èŽ·å–æ‰€æœ‰é…ç½®ç¼“å­˜
     *
     * @return
     */
    public List<QuantityConf> getCacheConfList(String companyId) {
        String pattern = RedisConst.buildKeyByPrefix(RedisConst.KEY_QUANTITY_CONF, null) + "*";
        Collection<String> keys = redisCache.keys(pattern);
        if (null == keys || keys.isEmpty()) {
            return null;
        }
        List<QuantityConf> list = new ArrayList<>();
        QuantityConf conf;
        for (String key : keys) {
            conf = (QuantityConf) redisCache.getCacheObject(key);
            if (null == conf) {
                continue;
            }
            list.add(conf);
        }
        if (list.isEmpty()) {
            if (StringUtils.isEmpty(companyId)) {
                companyId = ContextUtil.getCompanyId();
            }
            list = this.getConfList(companyId);
            this.setCacheQuantityConf(list);
        }
        return list;
    }
    /**
     * æ ¹æ®ä»“库编码获取获取缓存
     *
     * @param companyId
     * @param depotId
     * @return
     */
    public QuantityConf getCacheQuantityConf(String companyId, String depotId) {
        if (StringUtils.isEmpty(depotId)) {
            return null;
        }
        List<QuantityConf> list = getCacheConfList(companyId);
        if (null == list || list.isEmpty()) {
            return null;
        }
        for (QuantityConf conf : list) {
            if (conf.getCompanyId().equals(companyId) && conf.getDepotId().equals(depotId)) {
                return conf;
            }
        }
        return null;
    }
    /**
     * æ ¹æ®SN获取配置信息
     *
     * @param sn
     * @return
     */
    public QuantityConf getCacheQuantityConfBySn(String sn) {
        if (StringUtils.isEmpty(sn)) {
            return null;
        }
        List<QuantityConf> list = getCacheConfList(null);
        if (null == list || list.isEmpty()) {
            return null;
        }
        for (QuantityConf conf : list) {
            if (conf.getSn().equals(sn)) {
                return conf;
            }
        }
        return null;
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/SecCameraService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,177 @@
package com.fzzy.igds.service;
import com.fzzy.igds.constant.RedisConst;
import com.fzzy.igds.domain.Camera;
import com.fzzy.igds.repository.SecCameraRepository;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
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.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 10:48
 */
@Slf4j
@Service
public class SecCameraService {
    @Resource
    private SecCameraRepository secCameraRepository;
    @Resource
    private RedisCache redisCache;
    /**
     * JPA分页查询数据
     *
     * @param specification
     * @param pageable
     * @return
     */
    public Page<Camera> findAll(Specification<Camera> specification, Pageable pageable) {
        return secCameraRepository.findAll(specification, pageable);
    }
    /**
     * JPA - æŸ¥è¯¢åº“区下所有监控
     * @return
     */
    public List<Camera> listCamera() {
        return secCameraRepository.listCamera(ContextUtil.getCompanyId(), ContextUtil.subDeptId(null));
    }
    /**
     * JPA - ä¿å­˜æ•°æ®
     * @param data
     */
    public void saveCamera(Camera data) {
        if (StringUtils.isEmpty(data.getCompanyId())) {
            data.setCompanyId(ContextUtil.getCompanyId());
        }
        if (StringUtils.isEmpty(data.getDeptId())) {
            data.setDeptId(ContextUtil.subDeptId(null));
        }
        if (data.getChanNum() == 0) {
            data.setChanNum(1);
        }
        if(StringUtils.isEmpty(data.getId())){
            data.setId(ContextUtil.generateId());
            data.setCreateBy(ContextUtil.getLoginUserName());
            data.setCreateTime(new Date());
        }
        data.setUpdateBy(ContextUtil.getLoginUserName());
        data.setUpdateTime(new Date());
        secCameraRepository.save(data);
    }
    /**
     * JPA - åˆ é™¤æ•°æ®
     * @param data
     * @return
     */
    public String delCamera(Camera data) {
        secCameraRepository.delete(data);
        return null;
    }
    /**
     * è®¾ç½®ç¼“å­˜
     * @param companyId
     */
    public void refreshCache(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        List<Camera> list = secCameraRepository.listCameraByCompanyId(companyId);
        redisCache.setCacheObject(RedisConst.buildKey(companyId, RedisConst.KEY_CAMERA_LIST), list);
    }
    /**
     * èŽ·å–ç¼“å­˜ä¸­ç›‘æŽ§ä¿¡æ¯
     * @param companyId
     * @return
     */
    public List<Camera> getAllCacheCamera(String companyId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        String key = RedisConst.buildKey(companyId, RedisConst.KEY_CAMERA_LIST);
        List<Camera> list =  redisCache.getCacheObject(key);
        if (null == list || list.isEmpty()) {
            list = secCameraRepository.listCameraByCompanyId(companyId);
            redisCache.setCacheObject(key, list);
        }
        return list;
    }
    /**
     * æ ¹æ®åº“区编码获取监控信息
     * @param companyId
     * @param deptId
     * @return
     */
    public List<Camera> getCameraByDeptId(String companyId, String deptId) {
        if (StringUtils.isEmpty(deptId)) {
            return null;
        }
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        List<Camera> list = this.getAllCacheCamera(companyId);
        if (null == list || list.isEmpty()){
            return null;
        }
        List<Camera> result = new ArrayList<>();
        for (Camera data : list) {
            if (data.getDeptId().equals(deptId)){
                result.add(data);
            }
        }
        return result;
    }
    /**
     * æ ¹æ®ç›‘控ID获取监控信息
     * @param companyId
     * @param cameraId
     * @return
     */
    public Camera getCameraById(String companyId, String cameraId) {
        if (StringUtils.isEmpty(companyId)) {
            companyId = ContextUtil.getCompanyId();
        }
        List<Camera> list = this.getAllCacheCamera(companyId);
        if (null == list || list.isEmpty()){
            return null;
        }
        for (Camera data : list) {
            if (data.getId().equals(cameraId)){
                return data;
            }
        }
        return null;
    }
    /**
     * æ›´æ–°è®¾ç½®ä½ç½®
     * @param param
     */
    public void updatePos(Camera param) {
        secCameraRepository.updatePosById(param.getId(), param.getPosX(), param.getPosY());
    }
}
fzzy-igdss-core/src/main/java/com/fzzy/igds/utils/ContextUtil.java
@@ -26,6 +26,11 @@
    public static Map<String, String> contextUserDept = new HashMap<>();
    /**
     * å…¨å±€ç”¨äºŽå­˜æ”¾SN与组织编码的关系,例如分机SN和组织编码关系
     */
    public static Map<String, String> contextSnCompanyIdMap = new HashMap<>();
    /**
     * ç”Ÿæˆé¡ºåºID:年月日时分秒毫秒(17位) + åºåˆ—号(4位) = 21位
     *
     * @return
@@ -122,4 +127,24 @@
        }
        return orderId;
    }
    /**
     * å­˜æ”¾SN与所属组织的关系
     *
     * @param sn
     * @param companyId
     */
    public static void addSerCompany(String sn, String companyId) {
        contextSnCompanyIdMap.put(sn, companyId);
    }
    /**
     * é€šè¿‡SN获取当前SN所属的组织
     *
     * @param sn
     * @return
     */
    public static String getCompanyIdBySn(String sn) {
        return contextSnCompanyIdMap.get(sn);
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotConf.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,322 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model/>
  <View layout="padding:10">
    <ClientEvent name="onReady">var depotList = null;&#xD;
</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">depotConfPR#getConfList</Property>
      <Property name="dataType">[dtDepotConf]</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
view.get(&quot;#depotId&quot;).set(&quot;readOnly&quot;,false);&#xD;
view.get(&quot;#dgMain&quot;).show();</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;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#dgMain&quot;).show();&#xD;
    view.get(&quot;#depotId&quot;).set(&quot;readOnly&quot;,true);&#xD;
}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">&#xD;
&#xD;
var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#ajaxDel2&quot;).set(&quot;parameter&quot;,select).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(result);&#xD;
        }else{&#xD;
            entity.remove();&#xD;
        }&#xD;
    });&#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>
      </ToolBar>
      <DataGrid id="dataGridMain" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="depotId">
          <Property name="property">depotId</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="grainSer">
          <Property name="property">grainSer</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">cableRule</Property>
          <Property name="align">center</Property>
          <Property name="name">cableRule</Property>
        </DataColumn>
        <DataColumn name="cableCir">
          <Property name="property">cableCir</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="tempMax">
          <Property name="property">tempMax</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="grainFreq">
          <Property name="property">grainFreq</Property>
        </DataColumn>
        <DataColumn name="updateBy">
          <Property name="property">updateBy</Property>
        </DataColumn>
        <DataColumn name="updateTime">
          <Property name="property">updateTime</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <UpdateAction id="uaMain">
      <Property name="dataResolver">depotConfPR#saveConf</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="service">depotConfPR#flushConfCache</Property>
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
    </AjaxAction>
    <Dialog id="dgMain" layout="regionPadding:8">
      <ClientEvent name="onShow">//根据仓库类型不同,显示不同的配置信息</ClientEvent>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">检测配置参数</Property>
      <Property name="width">75%</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#uaMain&quot;).execute(function(){&#xD;
    view.get(&quot;#dgMain&quot;).hide();&#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">view.get(&quot;#dsMain.data:#&quot;).cancel();&#xD;
view.get(&quot;#dgMain&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 layoutConstraint="padding:5">
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelWidth">120</Property>
              <AutoFormElement id="depotId">
                <Property name="name">depotId</Property>
                <Property name="property">depotId</Property>
                <Property name="readOnly">true</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableRule</Property>
                <Property name="property">cableRule</Property>
                <Property name="label">布线规则</Property>
                <Editor/>
              </AutoFormElement>
              <Label>
                <Property name="text">说明:平方仓:层-行-列,筒仓:第1圈根数-第2圈根数-第n圈根数</Property>
                <Property name="style">
                  <Property name="color">blue</Property>
                </Property>
              </Label>
              <AutoFormElement>
                <Property name="name">grainSer</Property>
                <Property name="property">grainSer</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableCir</Property>
                <Property name="property">cableCir</Property>
                <Property name="label">层规则</Property>
                <Editor/>
              </AutoFormElement>
              <Label>
                <Property name="text">说明:只针对筒仓:第1圈层数-第2圈层数-第n圈层数</Property>
                <Property name="style">
                  <Property name="color">blue</Property>
                </Property>
              </Label>
              <AutoFormElement>
                <Property name="name">cableStart</Property>
                <Property name="property">cableStart</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableEnd</Property>
                <Property name="property">cableEnd</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="property">startRow</Property>
                <Property name="name">startRow</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">thSer</Property>
                <Property name="property">thSer</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">thConf</Property>
                <Property name="property">thConf</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="property">tempMax</Property>
                <Property name="name">tempMax</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">temperature</Property>
                <Property name="property">temperature</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">isOnlyTH</Property>
                <Property name="property">isOnlyTH</Property>
                <Editor/>
              </AutoFormElement>
              <Label>
                <Property name="text">说明:默认粮情电缆,为温湿度设备需选择!</Property>
                <Property name="style">
                  <Property name="color">blue</Property>
                </Property>
              </Label>
              <AutoFormElement>
                <Property name="property">cableCone</Property>
                <Property name="name">cableCone</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="property">startOrientation</Property>
                <Property name="name">startOrientation</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="property">startDirection</Property>
                <Property name="name">startDirection</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="property">grainAuto</Property>
                <Property name="name">grainAuto</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="property">startPoint</Property>
                <Property name="name">startPoint</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="property">startConvert</Property>
                <Property name="name">startConvert</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">grainFreq</Property>
                <Property name="property">grainFreq</Property>
                <Editor/>
              </AutoFormElement>
              <Button>
                <ClientEvent name="onClick">var grainFreq = view.get(&quot;#dsMain.data:#&quot;).get(&quot;grainFreq&quot;);&#xD;
&#xD;
if(grainFreq){&#xD;
    view.get(&quot;#ajaxUpdateFreq&quot;).set(&quot;parameter&quot;,grainFreq).execute(function(){&#xD;
        view.get(&quot;#dgMain&quot;).hide();&#xD;
        view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
    });&#xD;
}else{&#xD;
    $alert(&quot;请先配置更新频率!&quot;)&#xD;
}</ClientEvent>
                <Property name="caption">频率同步</Property>
                <Property name="tip">更新所有仓库频率一致</Property>
                <Property name="iconClass">fa fa-refresh</Property>
                <Property name="exClassName">btn2</Property>
              </Button>
              <AutoFormElement>
                <Property name="name">createBy</Property>
                <Property name="property">createBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">createTime</Property>
                <Property name="property">createTime</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateBy</Property>
                <Property name="property">updateBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateTime</Property>
                <Property name="property">updateTime</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
    <AjaxAction id="ajaxUpdateFreq">
      <Property name="confirmMessage">确定要更新所有仓库?</Property>
      <Property name="service">depotConfPR#updateFreq</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDel2">
      <Property name="successMessage">删除成功</Property>
      <Property name="service">depotConfPR#delDepotConf</Property>
      <Property name="executingMessage">正在删除</Property>
      <Property name="confirmMessage">确定要删除么?</Property>
    </AjaxAction>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/DepotConfPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
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.DepotConf;
import com.fzzy.igds.service.DepotConfService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 15:44
 */
@Slf4j
@Component
public class DepotConfPR {
    @Resource
    private DepotConfService depotConfService;
    /**
     * å‚数配置列表 depotConfPR#getConfList
     *
     * @return
     */
    @DataProvider
    public List<DepotConf> getConfList() {
        return depotConfService.getConfList(null,null);
    }
    /**
     * depotConfPR#saveConf å‚数配置更新,包括新增和修改
     *
     * @param conf
     */
    @DataResolver
    public void saveConf(DepotConf conf) {
        DepotConf depotConf = new DepotConf();
        BeanUtils.copyProperties(conf, depotConf);
        depotConfService.saveConf(depotConf);
    }
    /**
     * depotConfPR#delDepotConf åˆ é™¤å‚数配置
     *
     * @param conf
     */
    @Expose
    public void delDepotConf(DepotConf conf) {
        DepotConf depotConf = new DepotConf();
        BeanUtils.copyProperties(conf, depotConf);
        depotConfService.deleteDepotConf(depotConf);
    }
    /**
     * depotConfPR#flushConfCache åˆ·æ–°é…ç½®ç¼“å­˜
     */
    @Expose
    public void flushConfCache() {
        depotConfService.flushConfCache(null);
    }
    /**
     * depotConfPR#updateFreq æ›´æ–°æ‰€æœ‰ç²®åº“的粮情频率
     */
    @Expose
    public void updateFreq(String freq) {
        depotConfService.updateFreq(freq);
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeptPR.java
@@ -24,6 +24,18 @@
    @Resource
    private CoreDeptService coreDeptService;
    /**
     * æŸ¥è¯¢è®¾å¤‡,将操作信息调整为空,默认包括分库参数
     *
     * deptPR#getAllData
     *
     * @return
     */
    @DataProvider
    public List<Dept> getAllData() {
        return coreDeptService.getAllDeptData();
    }
    /**
     * æŸ¥è¯¢è®¾å¤‡,将操作信息调整为空,默认包括分库参数
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIot.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,324 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dataTypeC">
      <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>
      </PropertyDef>
      <PropertyDef name="type">
        <Property></Property>
        <Property name="label">设备类型</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;DEVICE_IOT_TYPE&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="serId">
        <Property></Property>
        <Property name="label">所属分机</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;deviceSerPR#getAllSerCache&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="padding:10">
    <ClientEvent name="onReady">view.get(&quot;#dataSetC&quot;).insert();</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsDeviceIot">
      <Property name="dataProvider">deviceIotPR#loadDeviceIotPage</Property>
      <Property name="pageSize">20</Property>
      <Property name="loadMode">lazy</Property>
      <Property name="dataType">[dtDeviceIot]</Property>
    </DataSet>
    <DataSet id="dataSetC">
      <Property name="dataType">dataTypeC</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <AutoForm>
        <Property name="cols">*,*,*,90,90,*</Property>
        <Property name="labelWidth">100</Property>
        <Property name="labelAlign">right</Property>
        <Property name="dataSet">dataSetC</Property>
        <AutoFormElement>
          <Property name="name">depotId</Property>
          <Property name="property">depotId</Property>
          <Property name="trigger">autoOpenMappingDropDown2</Property>
          <Editor/>
        </AutoFormElement>
        <AutoFormElement>
          <Property name="name">serId</Property>
          <Property name="property">serId</Property>
          <Property name="trigger">autoOpenMappingDropDown2</Property>
          <Editor/>
        </AutoFormElement>
        <AutoFormElement>
          <Property name="name">type</Property>
          <Property name="property">type</Property>
          <Property name="trigger">autoOpenMappingDropDown2</Property>
          <Editor/>
        </AutoFormElement>
        <Button>
          <Property name="action">actionDeviceIotQuery</Property>
          <Property name="caption">搜索</Property>
          <Property name="iconClass">fa fa-search</Property>
          <Property name="exClassName">btn-q1</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dataSetC&quot;).setData({});</ClientEvent>
          <Property name="caption">重置</Property>
          <Property name="exClassName">btn-q2</Property>
          <Property name="iconClass">fa fa-refresh</Property>
        </Button>
      </AutoForm>
    </Container>
    <Container>
      <Property name="className">c-data</Property>
      <ToolBar>
        <ToolBarButton>
          <Property name="caption">新增</Property>
          <Property name="exClassName">btn1</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-plus</Property>
          <Property name="action">actionDeviceIotAdd</Property>
        </ToolBarButton>
        <ToolBarButton>
          <Property name="action">actionDeviceIotUpdate</Property>
          <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>
          <Property name="action">actionDeviceIotDelete</Property>
          <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="action">ajaxRefreshCache</Property>
          <Property name="exClassName">btn4</Property>
          <Property name="iconClass">fa fa-refresh</Property>
          <Property name="width">100</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="gridDeviceIot" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#gridDeviceIot&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsDeviceIot</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="depotId">
          <Property name="property">depotId</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="name">
          <Property name="property">name</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="serId">
          <Property name="property">serId</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="passCode">
          <Property name="property">passCode</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="type">
          <Property name="property">type</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="remark">
          <Property name="property">remark</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="updateBy">
          <Property name="property">updateBy</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn name="updateTime">
          <Property name="property">updateTime</Property>
          <Property name="align">center</Property>
          <Property name="width">160</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <Container layoutConstraint="bottom">
      <Property name="className">c-bottom</Property>
      <DataPilot layoutConstraint="right">
        <Property name="dataSet">dsDeviceIot</Property>
        <Property name="itemCodes">pageSize,pages</Property>
      </DataPilot>
    </Container>
    <Dialog id="dialogDeviceIot" layout="regionPadding:8">
      <ClientEvent name="onHide">view.id(&quot;dsDeviceIot&quot;).getData().cancel();</ClientEvent>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">设备信息</Property>
      <Property name="width">800</Property>
      <Buttons>
        <Button>
          <Property name="action">actionDeviceIotSave</Property>
          <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">view.get(&quot;#dialogDeviceIot&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>
        <AutoForm>
          <Property name="dataSet">dsDeviceIot</Property>
          <Property name="cols">*,*</Property>
          <Property name="labelWidth">100</Property>
          <AutoFormElement>
            <Property name="name">depotId</Property>
            <Property name="property">depotId</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">name</Property>
            <Property name="property">name</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">passCode</Property>
            <Property name="property">passCode</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">serId</Property>
            <Property name="property">serId</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">type</Property>
            <Property name="property">type</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:2">
            <Property name="name">remark</Property>
            <Property name="property">remark</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">createBy</Property>
            <Property name="property">createBy</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">createTime</Property>
            <Property name="property">createTime</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">updateBy</Property>
            <Property name="property">updateBy</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">updateTime</Property>
            <Property name="property">updateTime</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <Action id="actionDeviceIotQuery">
      <ClientEvent name="onExecute">var entity = view.get(&quot;#dataSetC.data&quot;);&#xD;
view.get(&quot;#dsDeviceIot&quot;).set(&quot;parameter&quot;,entity).flushAsync();</ClientEvent>
      <ClientEvent name="onFailure">dorado.MessageBox.alert(arg.error,{&#xD;
    title: '系统提示信息'&#xD;
});&#xD;
arg.processDefault = false;</ClientEvent>
      <Property name="hotkey">alt+q</Property>
    </Action>
    <Action id="actionDeviceIotAdd">
      <ClientEvent name="onExecute">var dialog=view.get(&quot;#dialogDeviceIot&quot;);&#xD;
var visible=dialog.get(&quot;actualVisible&quot;);&#xD;
if(!visible){&#xD;
    view.get(&quot;#dsDeviceIot&quot;).insert();&#xD;
    dialog.set(&quot;caption&quot;,&quot;新增设备&quot;);&#xD;
    dialog.show();&#xD;
}</ClientEvent>
    </Action>
    <Action id="actionDeviceIotUpdate">
      <ClientEvent name="onExecute">var entity = view.id(&quot;dsDeviceIot&quot;).getData(&quot;#&quot;);&#xD;
var dialog=view.get(&quot;#dialogDeviceIot&quot;);&#xD;
var visible = dialog.get(&quot;actualVisible&quot;);&#xD;
var select = view.get(&quot;#gridDeviceIot&quot;).get(&quot;selection&quot;);&#xD;
if(!visible){&#xD;
    dialog.set(&quot;caption&quot;,&quot;修改设备&quot;);&#xD;
    if(select){&#xD;
        dialog.show();&#xD;
    }else{&#xD;
        dorado.MessageBox.alert(&quot;请选择需要修改的数据……&quot;);&#xD;
    }&#xD;
}&#xD;
view.get(&quot;^isKey&quot;).each(function(item){&#xD;
    item.set(&quot;readOnly&quot;,true);&#xD;
});</ClientEvent>
    </Action>
    <Action id="actionDeviceIotDelete">
      <ClientEvent name="onExecute">var dialog=view.get(&quot;#dialogDeviceIot&quot;);&#xD;
var visible = dialog.get(&quot;actualVisible&quot;);&#xD;
var dsDeviceIot=view.get(&quot;#dsDeviceIot&quot;);&#xD;
var actionDeviceIotSave=view.get(&quot;#actionDeviceIotSave&quot;);&#xD;
var select = view.get(&quot;#gridDeviceIot&quot;).get(&quot;selection&quot;);&#xD;
if(!visible){&#xD;
    if(!select){&#xD;
        dorado.MessageBox.alert(&quot;请先选择要操作的数据!&quot;);&#xD;
        return;&#xD;
    }else{&#xD;
        dorado.MessageBox.confirm(&quot;确定要删除这条记录吗?&quot;,{&#xD;
        detailCallback: function(button,text){&#xD;
            if(&quot;yes&quot;==button){&#xD;
                select.remove();&#xD;
                actionDeviceIotSave.execute();&#xD;
            }&#xD;
        }});&#xD;
    }&#xD;
}</ClientEvent>
    </Action>
    <UpdateAction id="actionDeviceIotSave">
      <ClientEvent name="onFailure">if(arg.error){&#xD;
    dorado.MessageBox.alert(arg.error,{&#xD;
        title: '系统提示信息'&#xD;
    });&#xD;
    arg.processDefault = false;&#xD;
}</ClientEvent>
      <ClientEvent name="onSuccess">view.get(&quot;#dialogDeviceIot&quot;).close();</ClientEvent>
      <Property name="dataResolver">deviceIotPR#saveAll</Property>
      <UpdateItem>
        <Property name="dataSet">dsDeviceIot</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="service">deviceIotPR#refreshCache</Property>
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
    </AjaxAction>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceIotPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,132 @@
package com.fzzy.igds;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.bstek.dorado.data.entity.EntityState;
import com.bstek.dorado.data.entity.EntityUtils;
import com.bstek.dorado.data.provider.Page;
import com.fzzy.igds.domain.DeviceIot;
import com.fzzy.igds.service.DeviceIotService;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 14:53
 */
@Component
public class DeviceIotPR {
    @Resource
    private DeviceIotService deviceIotService;
    /**
     * æŸ¥è¯¢è®¾å¤‡,将操作信息调整为空
     *
     * deviceIotPR#loadDeviceIotPage
     *
     * @param page
     * @param param
     * @return
     */
    @DataProvider
    public void loadDeviceIotPage(Page<DeviceIot> page, Map<String, Object> param) {
        if (null == param) {
            param = new HashMap<>();
        }
        Map<String, Object> finalParam = param;
        //多参数分页查询
        Pageable pageable = PageRequest.of(page.getPageNo() - 1, page.getPageSize(), Sort.Direction.ASC, DeviceIot.SORT_PROP);
        Specification<DeviceIot> specification = new Specification<DeviceIot>() {
            private static final long serialVersionUID = 1L;
            public Predicate toPredicate(Root<DeviceIot> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
                List<Predicate> predicates = new ArrayList<Predicate>(); //所有的断言
                Predicate predicate1 = cb.equal(root.get("companyId"), ContextUtil.getCompanyId());
                predicates.add(predicate1);
                predicate1 = cb.equal(root.get("deptId"), ContextUtil.subDeptId(null));
                predicates.add(predicate1);
                String key = (String) finalParam.get("depotId");
                if (StringUtils.isNotEmpty(key)) {
                    predicate1 = cb.equal(root.get("depotId"), key);
                    predicates.add(predicate1);
                }
                key = (String) finalParam.get("type");
                if (StringUtils.isNotEmpty(key)) {
                    predicate1 = cb.equal(root.get("type"), key);
                    predicates.add(predicate1);
                }
                key = (String) finalParam.get("serId");
                if (StringUtils.isNotEmpty(key)) {
                    predicate1 = cb.equal(root.get("serId"), key);
                    predicates.add(predicate1);
                }
                return cb.and(predicates.toArray(new Predicate[0]));
            }
        };
        org.springframework.data.domain.Page<DeviceIot> japPage = deviceIotService.findAll(specification, pageable);
        page.setEntityCount((int) japPage.getTotalElements());
        page.setEntities(japPage.getContent());
    }
    /**
     * ä¿å­˜ devicePR#saveAll
     *
     * @param depotDeviceIots
     * @return
     */
    @DataResolver
    @Transactional
    public String saveAll(List<DeviceIot> depotDeviceIots) {
        String msg = "";
        DeviceIot deviceIot;
        for (DeviceIot depotDeviceIot : depotDeviceIots) {
            EntityState state = EntityUtils.getState(depotDeviceIot);
            deviceIot = new DeviceIot();
            BeanUtils.copyProperties(depotDeviceIot, deviceIot);
            if (state == EntityState.NEW) {
                deviceIotService.updateDeviceIot(deviceIot);
                msg = "添加成功!";
            }
            if (state == EntityState.DELETED) {
                deviceIotService.delDepotDeviceIot(deviceIot);
                msg = "删除成功!";
            }
            if (state == EntityState.MODIFIED) {
                deviceIotService.updateDeviceIot(deviceIot);
                msg = "修改成功!";
            }
        }
        return msg;
    }
    /**
     * devicePR#refreshCache
     */
    @Expose
    public void refreshCache(){
        deviceIotService.refreshCache(null);
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceSer.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,427 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model/>
  <View layout="padding:10">
    <ClientEvent name="onReady">&#xD;
addData = function(){&#xD;
    view.get(&quot;#dsDeviceSer&quot;).insert();&#xD;
    view.get(&quot;#dialog1&quot;).set(&quot;caption&quot;,&quot;添加分机&quot;);&#xD;
&#xD;
    view.get(&quot;#dialog1&quot;).show();&#xD;
};&#xD;
&#xD;
delData = function(){&#xD;
    var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
    if(!cur) return;&#xD;
    cur.setState(dorado.Entity.STATE_DELETED);&#xD;
    $confirm(&quot;确定要删除该数据么?&quot;,function(){&#xD;
        view.get(&quot;#uaSave&quot;).execute(function(){&#xD;
            cur.remove();&#xD;
        });&#xD;
    });&#xD;
};&#xD;
&#xD;
btnCancel = function(){&#xD;
    view.get(&quot;#dialog1&quot;).hide();&#xD;
};&#xD;
&#xD;
onDialogHide = function(){&#xD;
    var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
    cur.cancel();&#xD;
};</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <Property name="cache">
      <Property name="mode">clientSide</Property>
    </Property>
    <DataSet id="dsDeviceSer">
      <Property name="parameter"></Property>
      <Property name="dataProvider">deviceSerPR#getAllSer</Property>
      <Property name="dataType">[dtDeviceSer]</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">addData();</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">&#xD;
var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#dialog1&quot;).show();&#xD;
}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;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#ajaxActionDel&quot;).set(&quot;parameter&quot;,{&#xD;id: select.get(&quot;id&quot;)&#xD;
        }).execute(function(){&#xD;
        select.remove();&#xD;
    });&#xD;
}else{&#xD;
    $notify(&quot;请选择需要删除的数据……&quot;);&#xD;
}&#xD;</ClientEvent>
          <Property name="caption">删除</Property>
          <Property name="exClassName">btn3</Property>
          <Property name="width">100</Property>
          <Property name="iconClass">fa fa-times</Property>
          <Property name="action">ajaxActionDel</Property>
        </ToolBarButton>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsDeviceSer&quot;).flushAsync();&#xD;
          </ClientEvent>
          <Property name="caption">刷新数据</Property>
          <Property name="exClassName">btn2</Property>
          <Property name="iconClass">fa fa-refresh</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>
          <Property name="caption">远程操作</Property>
          <Property name="exClassName">btn2</Property>
          <Property name="iconClass">fa fa-flag-checkered</Property>
          <Property name="width">120</Property>
          <Property name="menu">menuPull</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dataGridMain" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsDeviceSer</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="id">
          <Property name="property">id</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="name">
          <Property name="property">name</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="deptId">
          <Property name="property">deptId</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="ip">
          <Property name="property">ip</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="port">
          <Property name="property">port</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="status">
          <ClientEvent name="onRenderCell">arg.dom.style.background = arg.data.get(&quot;status&quot;)== 'Y' ?&quot;&quot;:&quot;#FF5722&quot;;&#xD;
arg.processDefault = true;</ClientEvent>
          <Property name="property">status</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn name="protocol">
          <Property name="property">protocol</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="updateBy">
          <Property name="property">updateBy</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="updateTime">
          <Property name="property">updateTime</Property>
          <Property name="align">center</Property>
          <Property name="width">180</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <Dialog id="dialog1" layout="regionPadding:8">
      <ClientEvent name="onHide">onDialogHide();</ClientEvent>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="width">1200</Property>
      <Property name="caption">分机信息</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
if(cur.validate() == 'ok'){&#xD;
    view.get(&quot;#updateAction&quot;).execute(function(){&#xD;
        view.get(&quot;#dialog1&quot;).close();&#xD;
    });&#xD;
}else{&#xD;
    $alert(&quot;数据校验失败!&quot;);&#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">btnCancel();</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">dsDeviceSer</Property>
              <Property name="cols">*,*,*</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelWidth">100</Property>
              <AutoFormElement>
                <Property name="name">id</Property>
                <Property name="property">id</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">name</Property>
                <Property name="property">name</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">deptId</Property>
                <Property name="property">deptId</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sn</Property>
                <Property name="property">sn</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ip</Property>
                <Property name="property">ip</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">port</Property>
                <Property name="property">port</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">type</Property>
                <Property name="property">type</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">protocol</Property>
                <Property name="property">protocol</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">controlModel</Property>
                <Property name="property">controlModel</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">powerModel</Property>
                <Property name="property">powerModel</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">networkType</Property>
                <Property name="property">networkType</Property>
                <Property name="label">终端联网</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">status</Property>
                <Property name="property">status</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">isMoreDepot</Property>
                <Property name="property">isMoreDepot</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">orderNum</Property>
                <Property name="property">orderNum</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:5">
          <Property name="caption">配置信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsDeviceSer</Property>
              <Property name="cols">*,*,*,*</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelWidth">100</Property>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">producer</Property>
                <Property name="property">producer</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">contactPhone</Property>
                <Property name="property">contactPhone</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableFormat</Property>
                <Property name="property">cableFormat</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableZ</Property>
                <Property name="property">cableZ</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableY</Property>
                <Property name="property">cableY</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableX</Property>
                <Property name="property">cableX</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableStart</Property>
                <Property name="property">cableStart</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">remark</Property>
                <Property name="property">remark</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cableType</Property>
                <Property name="property">cableType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">orgId</Property>
                <Property name="property">orgId</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">createBy</Property>
                <Property name="property">createBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">createTime</Property>
                <Property name="property">createTime</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateBy</Property>
                <Property name="property">updateBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateTime</Property>
                <Property name="property">updateTime</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="updateAction">
      <Property name="dataResolver">deviceSerPR#updateSer</Property>
      <UpdateItem>
        <Property name="dataSet">dsDeviceSer</Property>
        <Property name="dataPath">[#current]</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxActionDel">
      <Property name="service">deviceSerPR#delSerById</Property>
      <Property name="confirmMessage">确定要删除么?</Property>
      <Property name="executingMessage">正在删除</Property>
      <Property name="successMessage">删除成功</Property>
    </AjaxAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="service">deviceSerPR#refreshCache</Property>
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
    </AjaxAction>
    <Menu id="menuPull">
      <MenuItem>
        <ClientEvent name="onClick">var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
view.get(&quot;#ajaxUpdateDepot&quot;).set(&quot;parameter&quot;,cur.get(&quot;id&quot;)).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
    }else{&#xD;
        $alert(&quot;命令发送成功,请等待终端返回!!&quot;);&#xD;
    }&#xD;
});</ClientEvent>
        <Property name="caption">远程同步仓库</Property>
        <Property name="iconClass">fa fa-thumbs-o-up</Property>
      </MenuItem>
      <MenuItem>
        <ClientEvent name="onClick">var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
view.get(&quot;#ajaxUpdateDevice&quot;).set(&quot;parameter&quot;,cur.get(&quot;id&quot;)).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
    }else{&#xD;
        $alert(&quot;命令发送成功,请等待终端返回!!&quot;);&#xD;
    }&#xD;
});</ClientEvent>
        <Property name="caption">远程同步设备</Property>
        <Property name="iconClass">fa fa-thumbs-o-up</Property>
      </MenuItem>
      <MenuItem>
        <ClientEvent name="onClick">var cur = view.get(&quot;#dsDeviceSer.data:#&quot;);&#xD;
dorado.MessageBox.prompt(&quot;请输入授权码?&quot;,function(txt){&#xD;
    view.get(&quot;#ajaxAccess&quot;).set(&quot;parameter&quot;,{serId:cur.get(&quot;id&quot;),accessCode:txt}).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(result);&#xD;
        }else{&#xD;
            $alert(&quot;命令发送成功,请等待终端返回!!&quot;);&#xD;
        }&#xD;
    });&#xD;
});</ClientEvent>
        <Property name="caption">远程授权</Property>
        <Property name="iconClass">fa fa-thumbs-o-up</Property>
      </MenuItem>
    </Menu>
    <AjaxAction id="ajaxUpdateDevice">
      <Property name="service">pullPR#pullDeviceBySer</Property>
      <Property name="confirmMessage">确定要同步远程控制柜中的设备配置到平台么?</Property>
      <Property name="executingMessage">指令发送中……</Property>
    </AjaxAction>
    <AjaxAction id="ajaxUpdateDepot">
      <Property name="service">pullPR#pullDepotBySer</Property>
      <Property name="confirmMessage">确定要同步远程控制柜中的仓库配置到平台么?</Property>
      <Property name="executingMessage">指令发送中……</Property>
    </AjaxAction>
    <AjaxAction id="ajaxAccess">
      <Property name="service">pullPR#pullAccess</Property>
      <Property name="executingMessage">指令发送中……</Property>
    </AjaxAction>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/DeviceSerPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,105 @@
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.DeviceSer;
import com.fzzy.igds.service.DeviceSerService;
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/28 13:50
 */
@Component
public class DeviceSerPR {
    @Resource
    private DeviceSerService deviceSerService;
    /**
     * deviceSerPR#getAllSer
     *
     * @return
     */
    @DataProvider
    public List<DeviceSer> getAllSer() {
        return deviceSerService.getAllSer();
    }
    /**
     * deviceSerPR#getDataById
     *
     * @param id
     * @return
     */
    @Expose
    public DeviceSer getDataById(String id) {
        return deviceSerService.getDataById(null, id);
    }
    /**
     * deviceSerPR#updateSer
     *
     * @param data
     */
    @DataResolver
    public void updateSer(DeviceSer data) {
        DeviceSer deviceSer = new DeviceSer();
        BeanUtils.copyProperties(data, deviceSer);
        if(null == data.getOrderNum()){
            data.setOrderNum(1);
        }
        deviceSerService.saveSer(deviceSer);
    }
    /**
     * æ ¹æ®åˆ†æœºid和名称删除分机
     */
    @Expose
    @Transactional
    public void delSerById(String id) {
        DeviceSer ser = deviceSerService.getDataById(null, id);
        deviceSerService.delSer(ser);
    }
    /**
     * deviceSerPR#refreshCache
     *
     * @throws
     * @Title: refreshCache
     * @Description: åˆ·æ–°ç¼“å­˜ void
     */
    @Expose
    public void refreshCache() {
        deviceSerService.refreshCache(null);
    }
    /**
     * ${dorado.getDataProvider("deviceSerPR#getAllSerCache").getResult()}
     *
     * @return
     */
    @DataProvider
    public List<DeviceSer> getAllSerCache() {
        return deviceSerService.getCacheSerList(null);
    }
    /**
     * ${dorado.getDataProvider("deviceSerPR#getSerCacheByType").getResult("01")}
     *
     * @param type
     * @return
     */
    @DataProvider
    public List<DeviceSer> getSerCacheByType(String type) {
        return deviceSerService.getSerCacheByType(null, type);
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/DicArea.view.xml
@@ -135,7 +135,7 @@
            $notify(&quot;数据执行完成!!&quot;);&#xD;
            self.get(&quot;parent&quot;).hide();&#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="width">120</Property>
fzzy-igdss-view/src/main/java/com/fzzy/igds/DicPR.java
@@ -222,4 +222,59 @@
        return dicService.triggerNoticeType();
    }
    /**
     * ç”µç¼†èµ·å§‹æ–¹ä½
     * ${dorado.getDataProvider("dicPR#triggerStartOrientation").getResult()}
     *
     * @return
     */
    @DataProvider
    public List<SysDictData> triggerStartOrientation() {
        return dicService.triggerStartOrientation();
    }
    /**
     * ç”µç¼†å¸ƒçº¿æ–¹å‘
     * ${dorado.getDataProvider("dicPR#triggerStartDirection").getResult()}
     *
     * @return
     */
    @DataProvider
    public List<SysDictData> triggerStartDirection() {
        return dicService.triggerStartDirection();
    }
    /**
     * ç”µç¼†èµ·å§‹ç‚¹ä½
     * ${dorado.getDataProvider("dicPR#triggerStartPoint").getResult()}
     *
     * @return
     */
    @DataProvider
    public List<SysDictData> triggerStartPoint() {
        return dicService.triggerStartPoint();
    }
    /**
     * å±‚行转换
     * ${dorado.getDataProvider("dicPR#triggerStartConvert").getResult()}
     *
     * @return
     */
    @DataProvider
    public List<SysDictData> triggerStartConvert() {
        return dicService.triggerStartConvert();
    }
    /**
     * ç­’仓锥形
     * ${dorado.getDataProvider("dicPR#triggerCableCone").getResult()}
     *
     * @return
     */
    @DataProvider
    public List<SysDictData> triggerCableCone() {
        return dicService.triggerCableCone();
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConf.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,804 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtMain">
      <Property name="creationType">com.fzzy.igds.domain.InoutConf</Property>
      <PropertyDef name="id">
        <Property></Property>
        <Property name="label">主键</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#getAllData&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">kqmc</Property>
        </Property>
        <Property name="readOnly">true</Property>
      </PropertyDef>
      <PropertyDef name="sort">
        <Property name="label">所属配套号</Property>
        <Property name="required">true</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">1</Property>
                <Property name="name">流程配置#1</Property>
              </Entity>
              <Entity>
                <Property name="code">2</Property>
                <Property name="name">流程配置#2</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="inOrder">
        <Property name="dataType">int</Property>
        <Property name="label">设备顺序</Property>
      </PropertyDef>
      <PropertyDef name="inoutProgress">
        <Property></Property>
        <Property name="label">所属流程</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;PROCESS_STATUS_&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="name">
        <Property></Property>
        <Property name="label">设备名称</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="sn">
        <Property></Property>
        <Property name="label">设备序列号</Property>
      </PropertyDef>
      <PropertyDef name="ip">
        <Property></Property>
        <Property name="label">IP地址</Property>
      </PropertyDef>
      <PropertyDef name="port">
        <Property name="dataType">Integer</Property>
        <Property name="label">设备端口</Property>
      </PropertyDef>
      <PropertyDef name="loginId">
        <Property></Property>
        <Property name="label">登录帐号</Property>
      </PropertyDef>
      <PropertyDef name="pwd">
        <Property></Property>
        <Property name="label">登录密码</Property>
      </PropertyDef>
      <PropertyDef name="chanNum">
        <Property name="dataType">int</Property>
        <Property name="label">通道号</Property>
      </PropertyDef>
      <PropertyDef name="portCtrl">
        <Property name="dataType">Integer</Property>
        <Property name="label">控制端口</Property>
      </PropertyDef>
      <PropertyDef name="type">
        <Property></Property>
        <Property name="label">设备类型</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">10</Property>
                <Property name="name">车牌识别设备</Property>
              </Entity>
              <Entity>
                <Property name="code">20</Property>
                <Property name="name">扦样机设备</Property>
              </Entity>
              <Entity>
                <Property name="code">30</Property>
                <Property name="name">地磅设备</Property>
              </Entity>
              <Entity>
                <Property name="code">21</Property>
                <Property name="name">化验机</Property>
              </Entity>
              <Entity>
                <Property name="code">40</Property>
                <Property name="name">LED显示屏</Property>
              </Entity>
              <Entity>
                <Property name="code">60</Property>
                <Property name="name">过程摄像头</Property>
              </Entity>
              <Entity>
                <Property name="code">70</Property>
                <Property name="name">称重控制器</Property>
              </Entity>
              <Entity>
                <Property name="code">80</Property>
                <Property name="name">智慧卡</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="status">
        <Property></Property>
        <Property name="label">设备状态</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">NONE</Property>
                <Property name="name">未知</Property>
              </Entity>
              <Entity>
                <Property name="code">NORMAL</Property>
                <Property name="name">正常在线</Property>
              </Entity>
              <Entity>
                <Property name="code">NO_SIGNAL</Property>
                <Property name="name">未连接</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="protocol">
        <Property></Property>
        <Property name="label">所属协议</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;PROTOCOL&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="playType">
        <Property></Property>
        <Property name="label">播放方式</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerPlayType&quot;).getResult()}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="snapType">
        <Property></Property>
        <Property name="label">抓拍方式</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerSnapType&quot;).getResult()}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="plateSnapType">
        <Property></Property>
        <Property name="label">抓图识别</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">Y</Property>
                <Property name="name">是</Property>
              </Entity>
              <Entity>
                <Property name="code">N</Property>
                <Property name="name">否</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="urlIn">
        <Property></Property>
        <Property name="label">内网地址</Property>
      </PropertyDef>
      <PropertyDef name="urlOut">
        <Property></Property>
        <Property name="label">外网地址</Property>
      </PropertyDef>
      <PropertyDef name="mediaAddr">
        <Property></Property>
        <Property name="label">RTSP地址</Property>
      </PropertyDef>
      <PropertyDef name="remark">
        <Property></Property>
        <Property name="label">备注信息</Property>
      </PropertyDef>
      <PropertyDef name="errorMsg">
        <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>
  <View layout="padding:10">
    <ClientEvent name="onReady">var deptId = &quot;${request.getParameter('deptId')}&quot;;&#xD;
//查询&#xD;
query = function(){&#xD;
    var data = {deptId:deptId};&#xD;
    view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,data).flushAsync();&#xD;
};&#xD;
query();&#xD;
&#xD;
&#xD;
add = function(){&#xD;
    view.get(&quot;#dsMain&quot;).insert({&#xD;
        deptId:deptId,&#xD;
        inOrder:1,&#xD;
        chanNum:1&#xD;
    });&#xD;
    view.get(&quot;#dialogMain&quot;).show();&#xD;
}</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">inoutConfPR#getData</Property>
      <Property name="dataType">[dtMain]</Property>
      <Property name="loadMode">manual</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">add();</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">&#xD;
            var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
            if(select){&#xD;
            view.get(&quot;#dialogMain&quot;).show();;&#xD;
            }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">                      &#xD;
            var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
            if(select){&#xD;
            view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,select).execute(function(){&#xD;
            select.remove();&#xD;
            });&#xD;
            }else{&#xD;
            $notify(&quot;请选择需要删除的数据……&quot;);&#xD;
            }&#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>
          <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
            if(!data){&#xD;
            return;&#xD;
            }&#xD;
            view.get(&quot;#ajaxFlushCache&quot;).set(&quot;parameter&quot;,data).execute();</ClientEvent>
          <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>
      </ToolBar>
      <DataGrid id="dataGridMain" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="selectionMode">singleRow</Property>
        <Property name="readOnly">true</Property>
        <Property name="groupProperty">sort</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="sort">
          <Property name="property">sort</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="name">
          <Property name="property">name</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="inoutProgress">
          <Property name="property">inoutProgress</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="type">
          <Property name="property">type</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="status">
          <Property name="property">status</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="sn">
          <Property name="property">sn</Property>
        </DataColumn>
        <DataColumn name="protocol">
          <Property name="property">protocol</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="dialogMain" layout="regionPadding:8">
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">出入库配套设备</Property>
      <Property name="width">70%</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
                        &#xD;
                        if(data.validate() != 'ok'){&#xD;
                        $notify(&quot;数据校验失败!!&quot;);&#xD;
                        return;&#xD;
                        }&#xD;
                        &#xD;
                        view.get(&quot;#ajaxSave&quot;).set(&quot;parameter&quot;,data).execute(function(result){&#xD;
                        if(result){&#xD;
                        $alert(result);&#xD;
                        return;&#xD;
                        }&#xD;
                        $notify(&quot;数据执行完成!!&quot;);&#xD;
                        self.get(&quot;parent&quot;).hide();&#xD;
                        });</ClientEvent>
          <Property name="caption">确定</Property>
          <Property name="iconClass">fa fa-check</Property>
          <Property name="exClassName">btn1</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="iconClass">fa fa-times</Property>
          <Property name="exClassName">btn3</Property>
        </Button>
      </Buttons>
      <Children>
        <FieldSet layout="padding:5">
          <Property name="caption">设备信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelWidth">100</Property>
              <AutoFormElement>
                <Property name="name">name</Property>
                <Property name="property">name</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">type</Property>
                <Property name="property">type</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sort</Property>
                <Property name="property">sort</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">inoutProgress</Property>
                <Property name="property">inoutProgress</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">protocol</Property>
                <Property name="property">protocol</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">status</Property>
                <Property name="property">status</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ip</Property>
                <Property name="property">ip</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">createBy</Property>
                <Property name="property">createBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">createTime</Property>
                <Property name="property">createTime</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">port</Property>
                <Property name="property">port</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateBy</Property>
                <Property name="property">updateBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateTime</Property>
                <Property name="property">updateTime</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layoutConstraint="padding:5">
          <Property name="caption">监控信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelWidth">100</Property>
              <AutoFormElement>
                <Property name="name">loginId</Property>
                <Property name="property">loginId</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">pwd</Property>
                <Property name="property">pwd</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">portCtrl</Property>
                <Property name="property">portCtrl</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">playType</Property>
                <Property name="property">playType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">chanNum</Property>
                <Property name="property">chanNum</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">inOrder</Property>
                <Property name="property">inOrder</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">snapType</Property>
                <Property name="property">snapType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">sn</Property>
                <Property name="property">sn</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">plateSnapType</Property>
                <Property name="property">plateSnapType</Property>
                <Editor/>
              </AutoFormElement>
              <Label layoutConstraint="colSpan:2">
                <Property name="style">
                  <Property name="color">blue</Property>
                </Property>
                <Property name="text">注:此配置适用于风正致远API-HTTP协议</Property>
              </Label>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layoutConstraint="padding:5">
          <Property name="caption">播放配置</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelWidth">100</Property>
              <AutoFormElement>
                <Property name="name">urlIn</Property>
                <Property name="property">urlIn</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">urlOut</Property>
                <Property name="property">urlOut</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">mediaAddr</Property>
                <Property name="property">mediaAddr</Property>
                <Property name="trigger">triggerMedia</Property>
                <Editor>
                  <TextEditor id="mediaAddr"/>
                </Editor>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">remark</Property>
                <Property name="property">remark</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
    <AjaxAction id="ajaxSave">
      <Property name="service">inoutConfPR#saveData</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDel">
      <Property name="service">inoutConfPR#delData</Property>
      <Property name="confirmMessage">确定要删除么?</Property>
    </AjaxAction>
    <AjaxAction id="ajaxFlushCache">
      <Property name="service">inoutConfPR#flushCache</Property>
    </AjaxAction>
    <Trigger id="triggerMedia">
      <ClientEvent name="onExecute">view.get(&quot;#dialogMeidaSelect&quot;).show();</ClientEvent>
    </Trigger>
    <Dialog id="dialogMeidaSelect" layout="vbox padding:10">
      <Property name="width">650</Property>
      <Property name="caption">流媒体地址选择</Property>
      <Property name="height">500</Property>
      <Buttons/>
      <Children>
        <Container>
          <Label>
            <Property name="text">海康RTSP(旧版-主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text1">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/h264/ch{4}/main/av_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text1.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(旧版-子码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text2">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/mpeg4/ch{4}/sub/av_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text2.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(新版-主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text3">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/Streaming/Channels/{4}01</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text3.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(新版-子码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text4">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/Streaming/Channels/{4}02</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text4.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">大华RTSP(主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text5">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/cam/realmonitor?channel={4}&amp;subtype=0</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text5.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">大华RTSP(辅码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text6">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/cam/realmonitor?channel={4}&amp;subtype=1</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text6.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">雄迈RTSP(主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text7">
            <Property name="text">rtsp://{2}:{3}/user={0}&amp;password={1}&amp;channel={4}&amp;stream=0.sdp?real_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text7.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">雄迈RTSP(次码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text8">
            <Property name="text">rtsp://{2}:{3}/user={0}&amp;password={1}&amp;channel={4}&amp;stream=1.sdp?real_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text8.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">三星RTSP(高码率)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text9">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/onvif/profile2/media.smp</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text9.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">三星RTSP(低码率)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text10">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/onvif/profile3/media.smp</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text10.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">宇视RTSP</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text11">
            <Property name="text">rtsp://{0}:{1}@{2}/media/video1/multicast</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text11.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
      </Children>
      <Tools/>
    </Dialog>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutConfPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,71 @@
package com.fzzy.igds;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.Expose;
import com.fzzy.igds.service.InoutConfService;
import com.fzzy.igds.domain.InoutConf;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 09:23
 */
@Component
public class InoutConfPR {
    @Resource
    private InoutConfService inoutConfService;
    /**
     * inoutConfPR#getData èŽ·å–å½“å‰äººæ‰€åœ¨çš„åˆ†åº“ä¸‹çš„é…ç½®ä¿¡æ¯
     *
     * @return
     */
    @DataProvider
    public List<InoutConf> getData() {
        return inoutConfService.getInoutConfList(null,null);
    }
    /**
     * inoutConfPR#saveData ä¿å­˜é…ç½®
     *
     * @return
     */
    @Expose
    public String saveData(InoutConf data) {
        InoutConf inoutConf = new InoutConf();
        BeanUtils.copyProperties(data, inoutConf);
        return inoutConfService.saveData(inoutConf);
    }
    /**
     * inoutConfPR#delData åˆ é™¤é…ç½®
     *
     * @param data
     * @return
     */
    @Expose
    public String delData(InoutConf data) {
        InoutConf inoutConf = new InoutConf();
        BeanUtils.copyProperties(data, inoutConf);
        return inoutConfService.delData(inoutConf);
    }
    /**
     * inoutConfPR#flushCache
     *
     * @return
     */
    @Expose
    public void flushCache(InoutConf data) {
        inoutConfService.flushInoutConfCache(data.getCompanyId(), data.getDeptId());
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutSysConf.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,254 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtMain">
      <Property name="creationType">com.fzzy.igds.domain.InoutSysConf</Property>
      <PropertyDef name="deptId">
        <Property></Property>
        <Property name="label">所属库区</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;deptPR#getAllData&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">kqmc</Property>
        </Property>
        <Property name="readOnly">true</Property>
      </PropertyDef>
      <PropertyDef name="companyId">
        <Property></Property>
        <Property name="label">系统组织编码</Property>
      </PropertyDef>
      <PropertyDef name="progressIn">
        <Property></Property>
        <Property name="label">入库流程</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="progressOut">
        <Property></Property>
        <Property name="label">出库流程</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="noticeWx">
        <Property></Property>
        <Property name="label">微信通知</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;sys_yes_no&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="weightEditTag">
        <Property></Property>
        <Property name="label">地磅编辑</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;sys_yes_no&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </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>
  <View layout="padding:10">
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">inoutSysConfPR#getSysConfData</Property>
      <Property name="dataType">[dtMain]</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#dialogMain&quot;).show();;&#xD;
}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">view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
          </ClientEvent>
          <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>
      </ToolBar>
      <DataGrid id="dgMain" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dgMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn name="deptId">
          <Property name="property">deptId</Property>
        </DataColumn>
        <DataColumn name="progressIn">
          <Property name="property">progressIn</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="progressOut">
          <Property name="property">progressOut</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="noticeWx">
          <Property name="property">noticeWx</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn name="weightEditTag">
          <Property name="property">weightEditTag</Property>
          <Property name="align">center</Property>
          <Property name="width">120</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="dialogMain">
      <Property name="width">1200</Property>
      <Property name="caption">流程配置</Property>
      <Property name="closeable">false</Property>
      <Property name="iconClass">fa fa-tasks</Property>
      <Buttons>
        <Button id="btnOk">
          <ClientEvent name="onClick">view.get(&quot;#uaSave&quot;).execute(function(result){&#xD;
            if(result){&#xD;
            $alert(result);&#xD;
            }else{&#xD;
            $notify(&quot;保存成功!!&quot;);&#xD;
            view.get(&quot;#dialogMain&quot;).hide();&#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">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-circle</Property>
          <Property name="width">120</Property>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsMain</Property>
          <Property name="cols">*,*,*,*</Property>
          <Property name="labelAlign">right</Property>
          <Property name="labelSeparator"> : </Property>
          <Property name="labelWidth">120</Property>
          <AutoFormElement layoutConstraint="colSpan:4">
            <Property name="name">deptId</Property>
            <Property name="property">deptId</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:4">
            <Property name="name">progressIn</Property>
            <Property name="property">progressIn</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:4">
            <Property name="name">progressOut</Property>
            <Property name="property">progressOut</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:2">
            <Property name="name">noticeWx</Property>
            <Property name="property">noticeWx</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:2">
            <Property name="name">weightEditTag</Property>
            <Property name="property">weightEditTag</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">createBy</Property>
            <Property name="property">createBy</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">updateBy</Property>
            <Property name="property">updateBy</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement layoutConstraint="colSpan:2">
            <Property name="name">updateTime</Property>
            <Property name="property">updateTime</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="uaSave">
      <Property name="dataResolver">inoutSysConfPR#saveSysConfData</Property>
      <Property name="successMessage">数据保存完成!</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
        <Property name="validateData">false</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="service">inoutSysConfPR#flushCache</Property>
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
    </AjaxAction>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/InoutSysConfPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
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.service.InoutConfService;
import com.fzzy.igds.domain.InoutSysConf;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
 * @Description å‡ºå…¥åº“流程配置
 * @Author CZT
 * @Date 2024/12/12 15:32
 */
@Component
public class InoutSysConfPR {
    @Resource
    private InoutConfService inoutConfService;
    /**
     * inoutSysConfPR#getSysConfData èŽ·å–å½“å‰å‡ºå…¥åº“æµç¨‹é…ç½®
     *
     * @return
     * @throws Exception
     */
    @DataProvider
    public List<InoutSysConf> getSysConfData() {
        return  inoutConfService.getSysConfData();
    }
    /**
     * inoutSysConfPR#saveSysConfData
     *
     * @throws Exception
     * @returns
     */
    @DataResolver
    public String saveSysConfData(InoutSysConf data) {
        InoutSysConf inoutSysConf = new InoutSysConf();
        BeanUtils.copyProperties(data,inoutSysConf);
        inoutConfService.saveSysConfData(inoutSysConf);
        return null;
    }
    /**
     * inoutSysConfPR#flushCache
     */
    @Expose
    public void flushCache() {
        List<InoutSysConf> list = getSysConfData();
        if(null != list && list.size() > 0){
            for (InoutSysConf inoutSysConf : list) {
                inoutConfService.flushInoutSysConfCache(inoutSysConf);
            }
        }
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityConf.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,741 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtQuantityConf">
      <Property name="creationType">com.fzzy.igds.domain.QuantityConf</Property>
      <PropertyDef name="companyId">
        <Property></Property>
        <Property name="label">组织编码</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>
      </PropertyDef>
      <PropertyDef name="deptId">
        <Property></Property>
        <Property name="label">所属分库</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;deptPR#getAllData&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">kqmc</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="name">
        <Property></Property>
        <Property name="label">设备名称</Property>
      </PropertyDef>
      <PropertyDef name="sn">
        <Property></Property>
        <Property name="label">设备序列号</Property>
      </PropertyDef>
      <PropertyDef name="ip">
        <Property></Property>
        <Property name="label">通讯IP</Property>
      </PropertyDef>
      <PropertyDef name="port">
        <Property></Property>
        <Property name="label">通讯端口</Property>
        <Property name="dataType">Integer</Property>
      </PropertyDef>
      <PropertyDef name="loginId">
        <Property></Property>
        <Property name="label">登录账号</Property>
      </PropertyDef>
      <PropertyDef name="pwd">
        <Property></Property>
        <Property name="label">登录密码</Property>
      </PropertyDef>
      <PropertyDef name="status">
        <Property></Property>
        <Property name="label">是否在线</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;sys_yes_no&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="protocol">
        <Property></Property>
        <Property name="label">通讯协议</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;PROTOCOL&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="length1">
        <Property name="dataType">Double</Property>
        <Property name="label">距离1</Property>
      </PropertyDef>
      <PropertyDef name="length2">
        <Property name="dataType">Double</Property>
        <Property name="label">距离2</Property>
      </PropertyDef>
      <PropertyDef name="length3">
        <Property name="dataType">Double</Property>
        <Property name="label">距离3</Property>
      </PropertyDef>
      <PropertyDef name="length4">
        <Property name="dataType">Double</Property>
        <Property name="label">距离4</Property>
      </PropertyDef>
      <PropertyDef name="width">
        <Property name="dataType">Double</Property>
        <Property name="label">仓房宽</Property>
      </PropertyDef>
      <PropertyDef name="height">
        <Property name="dataType">Double</Property>
        <Property name="label">探头高</Property>
      </PropertyDef>
      <PropertyDef name="lineHeight">
        <Property name="dataType">Double</Property>
        <Property name="label">堆粮线高</Property>
      </PropertyDef>
      <PropertyDef name="ytIp">
        <Property></Property>
        <Property name="label">监控ip</Property>
      </PropertyDef>
      <PropertyDef name="cameraSn">
        <Property></Property>
        <Property name="label">监控SN</Property>
      </PropertyDef>
      <PropertyDef name="portCtrl">
        <Property></Property>
        <Property name="label">控制端口</Property>
        <Property name="dataType">Integer</Property>
      </PropertyDef>
      <PropertyDef name="portWeb">
        <Property></Property>
        <Property name="label">web端口</Property>
        <Property name="dataType">Integer</Property>
      </PropertyDef>
      <PropertyDef name="playType">
        <Property></Property>
        <Property name="label">播放方式</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerPlayType&quot;).getResult()}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="snapType">
        <Property></Property>
        <Property name="label">抓拍方式</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerSnapType&quot;).getResult()}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="urlIn">
        <Property></Property>
        <Property name="label">内网地址</Property>
      </PropertyDef>
      <PropertyDef name="urlOut">
        <Property></Property>
        <Property name="label">外网地址</Property>
      </PropertyDef>
      <PropertyDef name="mediaAddr">
        <Property></Property>
        <Property name="label">RTSP地址</Property>
      </PropertyDef>
      <PropertyDef name="remark">
        <Property></Property>
        <Property name="label">备注</Property>
      </PropertyDef>
      <PropertyDef name="chanNum">
        <Property></Property>
        <Property name="label">通道号</Property>
        <Property name="dataType">Integer</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>
  <View layout="padding:10">
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataProvider">quantityConfPR#getConfList</Property>
      <Property name="dataType">[dtQuantityConf]</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
            view.get(&quot;#depotId&quot;).set(&quot;readOnly&quot;,false);&#xD;
            view.get(&quot;#dgMain&quot;).show();</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">&#xD;
            var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
            if(select){&#xD;
            view.get(&quot;#depotId&quot;).set(&quot;readOnly&quot;,true)&#xD;
            view.get(&quot;#dgMain&quot;).show();&#xD;
            }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">&#xD;
            var select = view.get(&quot;#dataGridMain&quot;).get(&quot;selection&quot;);&#xD;
            if(select){&#xD;
            view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,select).execute(function(result){&#xD;
            select.remove();&#xD;
            });&#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>
      </ToolBar>
      <DataGrid id="dataGridMain" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridMain&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="readOnly">true</Property>
        <Property name="selectionMode">singleRow</Property>
        <RowSelectorColumn/>
        <RowNumColumn/>
        <DataColumn>
          <Property name="property">name</Property>
          <Property name="align">center</Property>
          <Property name="name">name</Property>
          <Property name="width">150</Property>
        </DataColumn>
        <DataColumn name="depotId">
          <Property name="property">depotId</Property>
          <Property name="align">center</Property>
          <Property name="width">150</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">ip</Property>
          <Property name="align">center</Property>
          <Property name="name">ip</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">port</Property>
          <Property name="align">center</Property>
          <Property name="name">port</Property>
          <Property name="width">80</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">status</Property>
          <Property name="align">center</Property>
          <Property name="name">status</Property>
          <Property name="width">80</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">protocol</Property>
          <Property name="align">center</Property>
          <Property name="name">protocol</Property>
          <Property name="width">180</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">playType</Property>
          <Property name="align">center</Property>
          <Property name="name">playType</Property>
          <Property name="width">180</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">ytIp</Property>
          <Property name="align">center</Property>
          <Property name="name">ytIp</Property>
        </DataColumn>
        <DataColumn name="updateBy">
          <Property name="property">updateBy</Property>
          <Property name="align">center</Property>
        </DataColumn>
        <DataColumn name="updateTime">
          <Property name="property">updateTime</Property>
          <Property name="align">center</Property>
        </DataColumn>
      </DataGrid>
    </Container>
    <UpdateAction id="uaMain">
      <Property name="dataResolver">quantityConfPR#saveConf</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxRefreshCache">
      <Property name="service">quantityConfPR#flushConfCache</Property>
      <Property name="successMessage">刷新成功!</Property>
      <Property name="confirmMessage">确定要刷新缓存么?</Property>
    </AjaxAction>
    <Dialog id="dgMain" layout="regionPadding:8">
      <ClientEvent name="onShow">//根据仓库类型不同,显示不同的配置信息</ClientEvent>
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="caption">数量检测参数</Property>
      <Property name="width">1100</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#uaMain&quot;).execute(function(){&#xD;
    view.get(&quot;#dgMain&quot;).hide();&#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">view.get(&quot;#dsMain.data:#&quot;).cancel();&#xD;
view.get(&quot;#dgMain&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>
        <GroupBox layoutConstraint="padding:5">
          <Property name="caption">基本信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelWidth">110</Property>
              <AutoFormElement>
                <Property name="name">name</Property>
                <Property name="property">name</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sn</Property>
                <Property name="property">sn</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement id="depotId">
                <Property name="name">depotId</Property>
                <Property name="property">depotId</Property>
                <Property name="readOnly">false</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ip</Property>
                <Property name="property">ip</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">port</Property>
                <Property name="property">port</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">protocol</Property>
                <Property name="property">protocol</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">status</Property>
                <Property name="property">status</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">remark</Property>
                <Property name="property">remark</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </GroupBox>
        <GroupBox layoutConstraint="padding:5">
          <Property name="caption">摄像头配置</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelWidth">110</Property>
              <AutoFormElement>
                <Property name="name">ytIp</Property>
                <Property name="property">ytIp</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">portCtrl</Property>
                <Property name="property">portCtrl</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">portWeb</Property>
                <Property name="property">portWeb</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">loginId</Property>
                <Property name="property">loginId</Property>
                <Property name="readOnly">false</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">pwd</Property>
                <Property name="property">pwd</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">chanNum</Property>
                <Property name="property">chanNum</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">playType</Property>
                <Property name="property">playType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">urlIn</Property>
                <Property name="property">urlIn</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">snapType</Property>
                <Property name="property">snapType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">urlOut</Property>
                <Property name="property">urlOut</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cameraSn</Property>
                <Property name="property">cameraSn</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">mediaAddr</Property>
                <Property name="property">mediaAddr</Property>
                <Property name="trigger">triggerMedia</Property>
                <Editor>
                  <TextEditor id="mediaAddr">
                    <Property name="blankText"> -- ç‚¹å‡»å³ä¾§é€‰æ‹©ï¼Œæˆ–者手动填写 --</Property>
                  </TextEditor>
                </Editor>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </GroupBox>
        <GroupBox layoutConstraint="padding:5">
          <Property name="caption">数量检测参数</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*,*</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelWidth">110</Property>
              <AutoFormElement>
                <Property name="name">length1</Property>
                <Property name="property">length1</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">length2</Property>
                <Property name="property">length2</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">length3</Property>
                <Property name="property">length3</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">length4</Property>
                <Property name="property">length4</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">width</Property>
                <Property name="property">width</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">height</Property>
                <Property name="property">height</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">lineHeight</Property>
                <Property name="property">lineHeight</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </GroupBox>
      </Children>
      <Tools/>
    </Dialog>
    <AjaxAction id="ajaxDel">
      <Property name="successMessage">删除成功</Property>
      <Property name="service">quantityConfPR#delQuantityConf</Property>
      <Property name="executingMessage">正在删除</Property>
      <Property name="confirmMessage">确定要删除么?</Property>
    </AjaxAction>
    <Trigger id="triggerMedia">
      <ClientEvent name="onExecute">view.get(&quot;#dialogMeidaSelect&quot;).show();&#xD;
</ClientEvent>
    </Trigger>
    <Dialog id="dialogMeidaSelect" layout="vbox padding:10">
      <Property name="width">650</Property>
      <Property name="caption">流媒体地址选择</Property>
      <Buttons/>
      <Children>
        <Container>
          <Label>
            <Property name="text">海康RTSP(旧版-主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text1">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/h264/ch{4}/main/av_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text1.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(旧版-子码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text2">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/mpeg4/ch{4}/sub/av_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text2.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(新版-主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text3">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/Streaming/Channels/{4}01</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text3.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(新版-子码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text4">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/Streaming/Channels/{4}02</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text4.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">大华RTSP(主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text5">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/cam/realmonitor?channel={4}&amp;subtype=0</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text5.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">大华RTSP(辅码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text6">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/cam/realmonitor?channel={4}&amp;subtype=1</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text6.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">雄迈RTSP(主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text7">
            <Property name="text">rtsp://{2}:{3}/user={0}&amp;password={1}&amp;channel={4}&amp;stream=0.sdp?real_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text7.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">雄迈RTSP(次码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text8">
            <Property name="text">rtsp://{2}:{3}/user={0}&amp;password={1}&amp;channel={4}&amp;stream=1.sdp?real_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text8.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">三星RTSP(高码率)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text9">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/onvif/profile2/media.smp</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text9.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">三星RTSP(低码率)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text10">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/onvif/profile3/media.smp</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text10.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">宇视RTSP</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text11">
            <Property name="text">rtsp://{0}:{1}@{2}/media/video1/multicast</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text11.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
      </Children>
      <Tools/>
    </Dialog>
    <AjaxAction id="ajaxRemoteConf">
      <Property name="service">quantityConfPR#remoteConf</Property>
    </AjaxAction>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/QuantityConfPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,68 @@
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.QuantityConf;
import com.fzzy.igds.service.DepotService;
import com.fzzy.igds.service.QuantityService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 16:58
 */
@Component
public class QuantityConfPR {
    @Resource
    private QuantityService quantityService;
    @Resource
    private DepotService depotService;
    /**
     * å‚数配置列表 quantityConfPR#getConfList
     *
     * @return
     */
    @DataProvider
    public List<QuantityConf> getConfList() {
        return quantityService.getConfList(null, null);
    }
    /**
     * quantityConfPR#saveConf å‚数配置更新,包括新增和修改
     *
     * @param conf
     */
    @DataResolver
    public void saveConf(QuantityConf conf) {
        QuantityConf quantityConf = new QuantityConf();
        BeanUtils.copyProperties(conf, quantityConf);
        quantityService.saveConf(quantityConf);
    }
    /**
     * quantityConfPR#delQuantityConf
     *
     * @return
     */
    @Expose
    public String delQuantityConf(QuantityConf conf) {
        QuantityConf quantityConf = new QuantityConf();
        BeanUtils.copyProperties(conf, quantityConf);
        return quantityService.delQuantityConf(quantityConf);
    }
    /**
     * quantityConfPR#flushConfCache åˆ·æ–°é…ç½®ç¼“å­˜
     */
    @Expose
    public void flushConfCache() {
        quantityService.flushConfCache(null, null);
    }
}
fzzy-igdss-view/src/main/java/com/fzzy/igds/SecCamera.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,1207 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtSecCameraParam">
      <Property name="creationType">com.fzzy.igds.domain.Camera</Property>
      <PropertyDef name="name">
        <Property></Property>
        <Property name="label">监控名称</Property>
      </PropertyDef>
      <PropertyDef name="brand">
        <Property></Property>
        <Property name="label">监控品牌</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;CAMERA_BRAND&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="spjklx">
        <Property></Property>
        <Property name="label">业务类型</Property>
        <Property name="mapping">
          <Property name="keyProperty">key</Property>
          <Property name="valueProperty">value</Property>
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="key">1</Property>
                <Property name="value">1-仓内</Property>
              </Entity>
              <Entity>
                <Property name="key">2</Property>
                <Property name="value">2-业务类</Property>
              </Entity>
              <Entity>
                <Property name="key">3</Property>
                <Property name="value">3-安防类</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="spdwlx">
        <Property></Property>
        <Property name="label">点位类型</Property>
        <Property name="mapping">
          <Property name="keyProperty">key</Property>
          <Property name="valueProperty">value</Property>
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="key">1</Property>
                <Property name="value">1-出入口</Property>
              </Entity>
              <Entity>
                <Property name="key">2</Property>
                <Property name="value">2-扦样机</Property>
              </Entity>
              <Entity>
                <Property name="key">3</Property>
                <Property name="value">3-化验室</Property>
              </Entity>
              <Entity>
                <Property name="key">4</Property>
                <Property name="value">4-结算室</Property>
              </Entity>
              <Entity>
                <Property name="key">5</Property>
                <Property name="value">5-地磅室</Property>
              </Entity>
              <Entity>
                <Property name="key">6</Property>
                <Property name="value">6-库区主干道</Property>
              </Entity>
              <Entity>
                <Property name="key">7</Property>
                <Property name="value">7-仓间监控</Property>
              </Entity>
              <Entity>
                <Property name="key">8</Property>
                <Property name="value">8-仓内</Property>
              </Entity>
              <Entity>
                <Property name="key">9</Property>
                <Property name="value">9-药品房内外</Property>
              </Entity>
              <Entity>
                <Property name="key">10</Property>
                <Property name="value">10-器材室内外</Property>
              </Entity>
              <Entity>
                <Property name="key">11</Property>
                <Property name="value">11-制高点</Property>
              </Entity>
              <Entity>
                <Property name="key">12</Property>
                <Property name="value">12-油库罐区</Property>
              </Entity>
              <Entity>
                <Property name="key">13</Property>
                <Property name="value">13-收发油设备</Property>
              </Entity>
              <Entity>
                <Property name="key">14</Property>
                <Property name="value">14-泵房</Property>
              </Entity>
              <Entity>
                <Property name="key">15</Property>
                <Property name="value">15-油库主要输送管道</Property>
              </Entity>
              <Entity>
                <Property name="key">16</Property>
                <Property name="value">16-周界</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
      </PropertyDef>
    </DataType>
    <DataType name="dtSecCamera">
      <Property name="creationType">com.fzzy.igds.domain.Camera</Property>
      <PropertyDef name="id">
        <Property></Property>
        <Property name="label">监控编码</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#getAllData&quot;).getResult()}</Property>
          <Property name="keyProperty">id</Property>
          <Property name="valueProperty">kqmc</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="type">
        <Property></Property>
        <Property name="label">设备类型</Property>
        <Property name="required">true</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">01</Property>
                <Property name="name">01-枪机</Property>
              </Entity>
              <Entity>
                <Property name="code">02</Property>
                <Property name="name">02-球机</Property>
              </Entity>
              <Entity>
                <Property name="code">03</Property>
                <Property name="name">03-半球</Property>
              </Entity>
              <Entity>
                <Property name="code">09</Property>
                <Property name="name">09-其他</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="brand">
        <Property></Property>
        <Property name="label">设备品牌</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;CAMERA_BRAND&quot;)}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="sn">
        <Property></Property>
        <Property name="label">序列号</Property>
      </PropertyDef>
      <PropertyDef name="sort">
        <Property name="label">配套序号</Property>
        <Property name="required">true</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">1</Property>
                <Property name="name">配套序号#1</Property>
              </Entity>
              <Entity>
                <Property name="code">2</Property>
                <Property name="name">配套序号#2</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="playType">
        <Property></Property>
        <Property name="label">播放方式</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerPlayType&quot;).getResult()}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="loginId">
        <Property></Property>
        <Property name="label">帐号</Property>
      </PropertyDef>
      <PropertyDef name="pwd">
        <Property></Property>
        <Property name="label">密码</Property>
      </PropertyDef>
      <PropertyDef name="ip">
        <Property></Property>
        <Property name="label">IP地址</Property>
      </PropertyDef>
      <PropertyDef name="controlPort">
        <Property name="dataType">Integer</Property>
        <Property name="label">控制端口</Property>
        <Property name="defaultValue">554</Property>
      </PropertyDef>
      <PropertyDef name="webPort">
        <Property name="dataType">Integer</Property>
        <Property name="label">WEB端口</Property>
        <Property name="defaultValue">80</Property>
      </PropertyDef>
      <PropertyDef name="chanNum">
        <Property name="dataType">Integer</Property>
        <Property name="label">通道号</Property>
        <Property name="defaultValue">1</Property>
      </PropertyDef>
      <PropertyDef name="urlIn">
        <Property></Property>
        <Property name="label">内网地址</Property>
      </PropertyDef>
      <PropertyDef name="urlOut">
        <Property></Property>
        <Property name="label">外网地址</Property>
      </PropertyDef>
      <PropertyDef name="mediaAddr">
        <Property></Property>
        <Property name="label">RTSP地址</Property>
      </PropertyDef>
      <PropertyDef name="snapType">
        <Property></Property>
        <Property name="label">抓拍方式</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerSnapType&quot;).getResult()}</Property>
          <Property name="keyProperty">dictValue</Property>
          <Property name="valueProperty">dictLabel</Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="spjklx">
        <Property></Property>
        <Property name="label">业务类型</Property>
        <Property name="mapping">
          <Property name="keyProperty">key</Property>
          <Property name="valueProperty">value</Property>
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="key">1</Property>
                <Property name="value">1-仓内</Property>
              </Entity>
              <Entity>
                <Property name="key">2</Property>
                <Property name="value">2-业务类</Property>
              </Entity>
              <Entity>
                <Property name="key">3</Property>
                <Property name="value">3-安防类</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="spdwlx">
        <Property></Property>
        <Property name="label">点位类型</Property>
        <Property name="mapping">
          <Property name="keyProperty">key</Property>
          <Property name="valueProperty">value</Property>
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="key">1</Property>
                <Property name="value">1-出入口</Property>
              </Entity>
              <Entity>
                <Property name="key">2</Property>
                <Property name="value">2-扦样机</Property>
              </Entity>
              <Entity>
                <Property name="key">3</Property>
                <Property name="value">3-化验室</Property>
              </Entity>
              <Entity>
                <Property name="key">4</Property>
                <Property name="value">4-结算室</Property>
              </Entity>
              <Entity>
                <Property name="key">5</Property>
                <Property name="value">5-地磅室</Property>
              </Entity>
              <Entity>
                <Property name="key">6</Property>
                <Property name="value">6-库区主干道</Property>
              </Entity>
              <Entity>
                <Property name="key">7</Property>
                <Property name="value">7-仓间监控</Property>
              </Entity>
              <Entity>
                <Property name="key">8</Property>
                <Property name="value">8-仓内</Property>
              </Entity>
              <Entity>
                <Property name="key">9</Property>
                <Property name="value">9-药品房内外</Property>
              </Entity>
              <Entity>
                <Property name="key">10</Property>
                <Property name="value">10-器材室内外</Property>
              </Entity>
              <Entity>
                <Property name="key">11</Property>
                <Property name="value">11-制高点</Property>
              </Entity>
              <Entity>
                <Property name="key">12</Property>
                <Property name="value">12-油库罐区</Property>
              </Entity>
              <Entity>
                <Property name="key">13</Property>
                <Property name="value">13-收发油设备</Property>
              </Entity>
              <Entity>
                <Property name="key">14</Property>
                <Property name="value">14-泵房</Property>
              </Entity>
              <Entity>
                <Property name="key">15</Property>
                <Property name="value">15-油库主要输送管道</Property>
              </Entity>
              <Entity>
                <Property name="key">16</Property>
                <Property name="value">16-周界</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="posX">
        <Property></Property>
        <Property name="label">坐标X</Property>
        <Property name="dataType">Double</Property>
      </PropertyDef>
      <PropertyDef name="posY">
        <Property></Property>
        <Property name="label">坐标Y</Property>
        <Property name="dataType">Double</Property>
      </PropertyDef>
      <PropertyDef name="screenShow">
        <Property></Property>
        <Property name="label">大屏显示</Property>
        <Property name="required">false</Property>
        <Property name="defaultValue">N</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">Y</Property>
                <Property name="name">展示</Property>
              </Entity>
              <Entity>
                <Property name="code">N</Property>
                <Property name="name">不展示</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="phoneShowTag">
        <Property></Property>
        <Property name="label">APP显示</Property>
        <Property name="defaultValue">N</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">Y</Property>
                <Property name="name">展示</Property>
              </Entity>
              <Entity>
                <Property name="code">N</Property>
                <Property name="name">不展示</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="orderNum">
        <Property></Property>
        <Property name="label">显示顺序</Property>
        <Property name="dataType">Integer</Property>
      </PropertyDef>
      <PropertyDef name="vld">
        <Property></Property>
        <Property name="label">是否使用</Property>
        <Property name="defaultValue">Y</Property>
        <Property name="mapping">
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="code">Y</Property>
                <Property name="name">启用</Property>
              </Entity>
              <Entity>
                <Property name="code">N</Property>
                <Property name="name">禁用</Property>
              </Entity>
            </Collection>
          </Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </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>
  <View layout="padding:10">
    <ClientEvent name="onClick">&#xD;
/**&#xD;
 * æŸ¥è¯¢&#xD;
 */&#xD;
query = function(){&#xD;
    view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
}&#xD;
/**&#xD;
 * è®¿é—®&#xD;
 */&#xD;
showWeb = function(){&#xD;
    var cur = view.get(&quot;#dsMain.data:#&quot;);&#xD;
    if(!cur.get(&quot;ip&quot;)){&#xD;
        $alert(&quot;没有配置访问IP,无法访问。&quot;);&#xD;
        return;&#xD;
    }&#xD;
    if(!cur.get(&quot;webPort&quot;)){&#xD;
        $alert(&quot;没有配置访问端口,无法访问。&quot;);&#xD;
        return;&#xD;
    }&#xD;
    var url = &quot;http://&quot;+cur.get(&quot;ip&quot;)+&quot;:&quot;+cur.get(&quot;webPort&quot;);&#xD;
    window.open(url);&#xD;
};&#xD;
&#xD;
/**&#xD;
 * é¢„览&#xD;
 */&#xD;
showVideo = function(){&#xD;
    var cur = view.get(&quot;#dsMain.data:#&quot;);&#xD;
    var playType = cur.get(&quot;playType&quot;);&#xD;
    &#xD;
    if(!playType){&#xD;
        $alert(&quot;没有配置播放方式,无法预览。&quot;);&#xD;
        return;&#xD;
    }&#xD;
    if(!cur.get(&quot;ip&quot;)){&#xD;
        $alert(&quot;没有配置内部访问IP,无法访问。&quot;);&#xD;
        return;&#xD;
    }&#xD;
    if(!cur.get(&quot;controlPort&quot;)){&#xD;
        $alert(&quot;没有配置内部控制端口,无法访问。&quot;);&#xD;
        return;&#xD;
    }&#xD;
    if(!cur.get(&quot;loginId&quot;)){&#xD;
        $alert(&quot;没有配置用户名,无法访问。&quot;);&#xD;
        return;&#xD;
    }&#xD;
    if (!cur.get(&quot;pwd&quot;)) {&#xD;
        $alert(&quot;没有配置密码,无法访问。&quot;);&#xD;
        return;&#xD;
    }&#xD;
    &#xD;
    var url = &quot;./basic/security/video-play?cameraId=&quot;+cur.get(&quot;id&quot;)+&quot;&amp;playType=&quot;+playType+&quot;&amp;time=&quot;+ new Date().getTime();&#xD;
    &#xD;
    view.get(&quot;#iFrameVideo&quot;).set(&quot;path&quot;,url);&#xD;
    view.get(&quot;#dialogVideo&quot;).show();&#xD;
};&#xD;
</ClientEvent>
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="loadMode">lazy</Property>
      <Property name="dataProvider">secCameraPR#listPageCamera</Property>
      <Property name="pageSize">20</Property>
      <Property name="dataType">[dtSecCamera]</Property>
    </DataSet>
    <DataSet id="dsParam">
      <ClientEvent name="onReady">self.insert({});</ClientEvent>
      <Property name="dataType">dtSecCameraParam</Property>
    </DataSet>
    <Container>
      <Property name="className">c-param</Property>
      <AutoForm>
        <Property name="cols">*,*,*,*,90,90</Property>
        <Property name="dataSet">dsParam</Property>
        <Property name="labelAlign">right</Property>
        <Property name="labelWidth">100</Property>
        <AutoFormElement>
          <Property name="name">name</Property>
          <Property name="property">name</Property>
          <Editor/>
        </AutoFormElement>
        <AutoFormElement>
          <Property name="name">brand</Property>
          <Property name="property">brand</Property>
          <Editor/>
        </AutoFormElement>
        <AutoFormElement>
          <Property name="name">spjklx</Property>
          <Property name="property">spjklx</Property>
          <Editor/>
        </AutoFormElement>
        <AutoFormElement>
          <Property name="name">spdwlx</Property>
          <Property name="property">spdwlx</Property>
          <Editor/>
        </AutoFormElement>
        <Button>
          <ClientEvent name="onClick">var param = view.get(&quot;#dsParam.data&quot;);&#xD;
view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,param.toJSON()).flushAsync();</ClientEvent>
          <Property name="caption">搜索</Property>
          <Property name="iconClass">fa fa-search</Property>
          <Property name="exClassName">btn-q1</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">view.get(&quot;#dsParam&quot;).setData({});</ClientEvent>
          <Property name="caption">重置</Property>
          <Property name="exClassName">btn-q2</Property>
          <Property name="iconClass">fa fa-refresh</Property>
        </Button>
      </AutoForm>
    </Container>
    <Container>
      <Property name="className">c-data</Property>
      <ToolBar>
        <ToolBarButton>
          <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
            view.get(&quot;#dialogMain&quot;).show();</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 data = view.get(&quot;#dataGridCamera&quot;).get(&quot;selection&quot;);&#xD;
if(data){&#xD;
    view.get(&quot;#dialogMain&quot;).show();&#xD;
}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;#dataGridCamera&quot;).get(&quot;selection&quot;);&#xD;
if(select){&#xD;
    view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,select).execute(function(result){&#xD;
        if(result){&#xD;
            $alert(result);&#xD;
        }else{&#xD;
            query();&#xD;
        }&#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">refreshCache</Property>
        </ToolBarButton>
      </ToolBar>
      <DataGrid id="dataGridCamera" layoutConstraint="padding:8">
        <ClientEvent name="onDataRowClick">view.get(&quot;#dataGridCamera&quot;).set(&quot;selection&quot;,arg.data);</ClientEvent>
        <Property name="dataSet">dsMain</Property>
        <Property name="selectionMode">singleRow</Property>
        <Property name="readOnly">true</Property>
        <RowSelectorColumn/>
        <RowNumColumn>
          <Property name="width">50</Property>
        </RowNumColumn>
        <DataColumn name="name">
          <Property name="property">name</Property>
        </DataColumn>
        <DataColumn name="type">
          <Property name="property">type</Property>
          <Property name="align">center</Property>
          <Property name="width">90</Property>
        </DataColumn>
        <DataColumn name="spjklx">
          <Property name="property">spjklx</Property>
          <Property name="align">center</Property>
          <Property name="width">90</Property>
        </DataColumn>
        <DataColumn name="spdwlx">
          <Property name="property">spdwlx</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">playType</Property>
          <Property name="align">center</Property>
          <Property name="name">playType</Property>
          <Property name="width">160</Property>
        </DataColumn>
        <DataColumn>
          <Property name="property">snapType</Property>
          <Property name="align">center</Property>
          <Property name="name">snapType</Property>
          <Property name="width">160</Property>
        </DataColumn>
        <DataColumn name="ip">
          <Property name="property">ip</Property>
          <Property name="align">center</Property>
          <Property name="width">120</Property>
        </DataColumn>
        <DataColumn name="controlPort">
          <Property name="property">controlPort</Property>
          <Property name="align">center</Property>
          <Property name="width">100</Property>
        </DataColumn>
        <DataColumn name="chanNum">
          <Property name="property">chanNum</Property>
          <Property name="align">center</Property>
          <Property name="width">80</Property>
        </DataColumn>
        <DataColumn name="brand">
          <Property name="property">brand</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>
        <DataColumn>
          <ClientEvent name="onRenderCell">arg.dom.innerHTML = &quot;&lt;a href='javascript:;' onClick='showVideo()' class='a-btn1'>预览&lt;/a>&amp;nbsp;|&amp;nbsp;&lt;a href='javascript:;' onClick='showWeb()' class='a-btn3'>访问&lt;/a>&quot;;</ClientEvent>
          <Property name="width">160</Property>
          <Property name="caption">操作</Property>
          <Property name="align">center</Property>
          <Editor/>
        </DataColumn>
      </DataGrid>
    </Container>
    <Container layoutConstraint="bottom">
      <Property name="className">c-bottom</Property>
      <DataPilot layoutConstraint="right">
        <Property name="dataSet">dsMain</Property>
        <Property name="itemCodes">pageSize,pages</Property>
      </DataPilot>
    </Container>
    <Dialog id="dialogMain" layout="regionPadding:8">
      <Property name="iconClass">fa fa-tasks</Property>
      <Property name="width">1200</Property>
      <Property name="caption">监控信息</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var data = view.get(&quot;#dsMain.data:#&quot;);&#xD;
if(data.validate() != 'ok'){&#xD;
    $notify(&quot;数据校验失败!!&quot;);&#xD;
    return;&#xD;
}&#xD;
view.get(&quot;#uaAction&quot;).set(&quot;parameter&quot;,data).execute(function(){&#xD;
    self.get(&quot;parent&quot;).hide();&#xD;
    query();&#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;#dsMain.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">dsMain</Property>
              <Property name="cols">*,*,*,*</Property>
              <Property name="labelWidth">100</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator">:</Property>
              <AutoFormElement>
                <Property name="name">name</Property>
                <Property name="property">name</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">type</Property>
                <Property name="property">type</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">brand</Property>
                <Property name="property">brand</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">deptId</Property>
                <Property name="property">deptId</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">loginId</Property>
                <Property name="property">loginId</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">pwd</Property>
                <Property name="property">pwd</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">chanNum</Property>
                <Property name="property">chanNum</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">spjklx</Property>
                <Property name="property">spjklx</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ip</Property>
                <Property name="property">ip</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">controlPort</Property>
                <Property name="property">controlPort</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">webPort</Property>
                <Property name="property">webPort</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">spdwlx</Property>
                <Property name="property">spdwlx</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sort</Property>
                <Property name="property">sort</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">screenShow</Property>
                <Property name="property">screenShow</Property>
                <Editor>
                  <RadioGroup>
                    <RadioButton>
                      <Property name="text">展示</Property>
                      <Property name="value">Y</Property>
                    </RadioButton>
                    <RadioButton>
                      <Property name="text">不展示</Property>
                      <Property name="value">N</Property>
                    </RadioButton>
                  </RadioGroup>
                </Editor>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">phoneShowTag</Property>
                <Property name="property">phoneShowTag</Property>
                <Editor>
                  <RadioGroup>
                    <RadioButton>
                      <Property name="text">展示</Property>
                      <Property name="value">Y</Property>
                    </RadioButton>
                    <RadioButton>
                      <Property name="text">不展示</Property>
                      <Property name="value">N</Property>
                    </RadioButton>
                  </RadioGroup>
                </Editor>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:5">
          <Property name="caption">播放配置</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*,*,*</Property>
              <Property name="labelWidth">100</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator">:</Property>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">playType</Property>
                <Property name="property">playType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:3">
                <Property name="name">urlIn</Property>
                <Property name="property">urlIn</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">snapType</Property>
                <Property name="property">snapType</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:3">
                <Property name="name">urlOut</Property>
                <Property name="property">urlOut</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">sn</Property>
                <Property name="property">sn</Property>
                <Editor>
                  <TextEditor id="sn">
                    <Property name="blankText"> -- æµåª’体平台中设备SN --</Property>
                  </TextEditor>
                </Editor>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:3">
                <Property name="name">mediaAddr</Property>
                <Property name="property">mediaAddr</Property>
                <Property name="trigger">triggerMedia</Property>
                <Editor>
                  <TextEditor id="mediaAddr">
                    <Property name="blankText"> -- ç‚¹å‡»å³ä¾§é€‰æ‹©ï¼Œæˆ–者手动填写 --</Property>
                  </TextEditor>
                </Editor>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
        <FieldSet layout="padding:5">
          <Property name="caption">其他信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*</Property>
              <Property name="labelWidth">100</Property>
              <Property name="labelAlign">right</Property>
              <Property name="labelSeparator">:</Property>
              <AutoFormElement>
                <Property name="name">vld</Property>
                <Property name="property">vld</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">orderNum</Property>
                <Property name="property">orderNum</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateTime</Property>
                <Property name="property">updateTime</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement layoutConstraint="colSpan:2">
                <Property name="name">remark</Property>
                <Property name="property">remark</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">createBy</Property>
                <Property name="property">createBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">createTime</Property>
                <Property name="property">createTime</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateBy</Property>
                <Property name="property">updateBy</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">updateTime</Property>
                <Property name="property">updateTime</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="uaAction">
      <Property name="dataResolver">secCameraPR#saveCamera</Property>
      <UpdateItem>
        <Property name="dataSet">dsMain</Property>
        <Property name="dataPath">[#current]</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxDel">
      <Property name="confirmMessage">确定要删除吗?</Property>
      <Property name="service">secCameraPR#delCamera</Property>
    </AjaxAction>
    <Dialog id="dialogVideo">
      <Property name="width">1320</Property>
      <Property name="caption">视频预览</Property>
      <Property name="contentOverflow">hidden</Property>
      <Property name="height">620</Property>
      <Buttons/>
      <Children>
        <IFrame id="iFrameVideo" layoutConstraint="center"/>
      </Children>
      <Tools/>
    </Dialog>
    <AjaxAction id="refreshCache">
      <Property name="service">secCameraPR#refreshCache</Property>
      <Property name="successMessage">缓存更新成功!</Property>
    </AjaxAction>
    <Trigger id="triggerMedia">
      <ClientEvent name="onExecute">view.get(&quot;#dialogMeidaSelect&quot;).show();&#xD;
</ClientEvent>
    </Trigger>
    <Dialog id="dialogMeidaSelect" layout="vbox padding:10">
      <Property name="width">650</Property>
      <Property name="caption">流媒体地址选择</Property>
      <Buttons/>
      <Children>
        <Container>
          <Label>
            <Property name="text">海康RTSP(旧版-主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text1">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/h264/ch{4}/main/av_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text1.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(旧版-子码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text2">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/mpeg4/ch{4}/sub/av_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text2.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(新版-主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text3">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/Streaming/Channels/{4}01</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text3.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">海康RTSP(新版-子码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text4">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/Streaming/Channels/{4}02</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text4.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">大华RTSP(主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text5">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/cam/realmonitor?channel={4}&amp;subtype=0</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text5.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">大华RTSP(辅码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text6">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/cam/realmonitor?channel={4}&amp;subtype=1</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text6.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">雄迈RTSP(主码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text7">
            <Property name="text">rtsp://{2}:{3}/user={0}&amp;password={1}&amp;channel={4}&amp;stream=0.sdp?real_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text7.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">雄迈RTSP(次码流)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text8">
            <Property name="text">rtsp://{2}:{3}/user={0}&amp;password={1}&amp;channel={4}&amp;stream=1.sdp?real_stream</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text8.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">三星RTSP(高码率)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text9">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/onvif/profile2/media.smp</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text9.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">三星RTSP(低码率)</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text10">
            <Property name="text">rtsp://{0}:{1}@{2}:{3}/onvif/profile3/media.smp</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text10.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
        <Container>
          <Label>
            <Property name="text">宇视RTSP</Property>
            <Property name="style">
              <Property name="font-weight">bold</Property>
            </Property>
          </Label>
          <Label id="text11">
            <Property name="text">rtsp://{0}:{1}@{2}/media/video1/multicast</Property>
          </Label>
          <Button layoutConstraint="right">
            <ClientEvent name="onClick">view.get(&quot;#mediaAddr&quot;).set(&quot;text&quot;,view.get(&quot;#text11.text&quot;));&#xD;
view.get(&quot;#dialogMeidaSelect&quot;).hide();&#xD;
</ClientEvent>
            <Property name="caption">选择</Property>
            <Property name="iconClass">fa fa-check</Property>
          </Button>
        </Container>
      </Children>
      <Tools/>
    </Dialog>
    <AjaxAction id="ajaxRemoteMedia">
      <Property name="confirmMessage">确定要同步么?</Property>
      <Property name="service">secCameraPR#flushByMedia</Property>
    </AjaxAction>
  </View>
</ViewConfig>
fzzy-igdss-view/src/main/java/com/fzzy/igds/SecCameraPR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,183 @@
package com.fzzy.igds;
import com.bstek.dorado.annotation.DataProvider;
import com.bstek.dorado.annotation.DataResolver;
import com.bstek.dorado.annotation.Expose;
import com.bstek.dorado.data.provider.Page;
import com.fzzy.igds.domain.Camera;
import com.fzzy.igds.service.SecCameraService;
import com.fzzy.igds.utils.ContextUtil;
import com.ruoyi.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @Description
 * @Author CZT
 * @Date 2025/11/28 10:48
 */
@Slf4j
@Component
public class SecCameraPR {
    @Autowired
    private SecCameraService secCameraService;
    /**
     * secCameraPR#listPageCamera æ ¹æ®æ¡ä»¶èŽ·å–æ‰€æœ‰çš„æ‘„åƒæœºé…ç½®ä¿¡æ¯
     *
     * @param param
     */
    @DataProvider
    public void listPageCamera(Page<Camera> page, Map<String, Object> param) {
        org.springframework.data.domain.Page<Camera> japPage = pageCamera(page, param);
        page.setEntityCount((int) japPage.getTotalElements());
        page.setEntities(japPage.getContent());
    }
    public org.springframework.data.domain.Page<Camera> pageCamera(Page<Camera> page, Map<String, Object> param) {
        if (null == param) {
            param = new HashMap<>();
        }
        Map<String, Object> finalParam = param;
        //多参数分页查询
        Pageable pageable = PageRequest.of(page.getPageNo() - 1, page.getPageSize(), Sort.Direction.ASC, Camera.SORT_PROP);
        Specification<Camera> specification = new Specification<Camera>() {
            private static final long serialVersionUID = 1L;
            public Predicate toPredicate(Root<Camera> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
                List<Predicate> predicates = new ArrayList<Predicate>(); //所有的断言
                Predicate predicate1 = cb.equal(root.get("companyId"), ContextUtil.getCompanyId());
                predicates.add(predicate1);
                Predicate predicate2 = cb.equal(root.get("deptId"), ContextUtil.subDeptId(null));
                predicates.add(predicate2);
                String key = (String) finalParam.get("bizType");
                if (StringUtils.isNotEmpty(key)) {
                    Predicate predicate3 = cb.equal(root.get("bizType"), key);
                    predicates.add(predicate3);
                }
                key = (String) finalParam.get("name");
                if (StringUtils.isNotEmpty(key)) {
                    Predicate predicate4 = cb.like(root.get("name"), "%" + key + "%");
                    predicates.add(predicate4);
                }
                key = (String) finalParam.get("brand");
                if (StringUtils.isNotEmpty(key)) {
                    Predicate predicate5 = cb.equal(root.get("brand"), key);
                    predicates.add(predicate5);
                }
                key = (String) finalParam.get("spjklx");
                if (StringUtils.isNotEmpty(key)) {
                    Predicate predicate5 = cb.equal(root.get("spjklx"), key);
                    predicates.add(predicate5);
                }
                key = (String) finalParam.get("spdwlx");
                if (StringUtils.isNotEmpty(key)) {
                    Predicate predicate5 = cb.equal(root.get("spdwlx"), key);
                    predicates.add(predicate5);
                }
                return cb.and(predicates.toArray(new Predicate[0]));
            }
        };
        org.springframework.data.domain.Page<Camera> japPage = secCameraService.findAll(specification, pageable);
        return japPage;
    }
    /**
     * secCameraPR#listCamera èŽ·å–æ‰€æœ‰çš„æ‘„åƒæœºé…ç½®ä¿¡æ¯
     * ${dorado.getDataProvider("secCameraPR#listCamera").getResult()}
     * @return
     */
    @DataProvider
    public List<Camera> listCamera() {
        return secCameraService.listCamera();
    }
    /**
     * secCameraPR#saveCamera
     *
     * @param data
     */
    @DataResolver
    public void saveCamera(Camera data) {
        Camera secCamera = new Camera();
        BeanUtils.copyProperties(data, secCamera);
        secCameraService.saveCamera(secCamera);
    }
    /**
     * secCameraPR#delCamera
     *
     * @param data
     * @return
     */
    @Expose
    public String delCamera(Camera data) {
        Camera secCamera = new Camera();
        BeanUtils.copyProperties(data, secCamera);
        return secCameraService.delCamera(secCamera);
    }
    /***
     * secCameraPR#refreshCache
     * @return
     */
    @Expose
    public String refreshCache() {
        secCameraService.refreshCache(ContextUtil.getCompanyId());
        return null;
    }
    /***
     * securityPR#flushByMedia
     *
     * èŽ·å–æ‘„åƒå¤´åˆ—è¡¨ä¿¡æ¯
     * @return
     */
    @Expose
    public String flushByMedia(String playType) {
        if (null == playType){
            return "没有选择播放方式,执行失败";
        }
//        try {
//            if (CameraUtil.PLAY_TYPE_MEDIA_HIK.equals(playType)) {
//                ApiCameraData apiCameraData = new ApiCameraData();
//                apiCameraData.setCompanyId(ContextUtil.getCompanyId());
//                apiCameraData.setDeptId(ContextUtil.subDeptId(null));
//                apiCameraData.setPlayType(playType);
//                List<SecCameraDto> list = apiCameraManager.getApiCameraService(playType).searchCamera(apiCameraData);
//                if(list == null){
//                    return "同步失败!";
//                }else {
//                    return "同步成功!";
//                }
//            }
            return "当前播放方式没有此功能!";
//
//        }catch (Exception e){
//            log.error("-----同步摄像头列表失败-----原因={}", e.toString());
//            return "远程接口服务异常,请核查后重试!";
//        }
    }
}
fzzy-igdss-view/src/main/java/models/core.model.xml
@@ -163,9 +163,9 @@
      <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 name="mapValues">${dorado.getDataProvider(&quot;deptPR#getAllData&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">kqmc</Property>
      </Property>
      <Property name="readOnly">true</Property>
    </PropertyDef>
@@ -433,4 +433,482 @@
      <Property name="readOnly">true</Property>
    </PropertyDef>
  </DataType>
  <DataType name="dtDeviceSer">
    <Property name="creationType">com.fzzy.igds.domain.DeviceSer</Property>
    <PropertyDef name="id">
      <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#getAllData&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">kqmc</Property>
      </Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="companyId">
      <Property></Property>
      <Property name="label">组织编码</Property>
    </PropertyDef>
    <PropertyDef name="sn">
      <Property></Property>
      <Property name="label">序列号</Property>
    </PropertyDef>
    <PropertyDef name="name">
      <Property></Property>
      <Property name="label">分机名称</Property>
    </PropertyDef>
    <PropertyDef name="ip">
      <Property></Property>
      <Property name="label">分机IP</Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="port">
      <Property name="dataType">Integer</Property>
      <Property name="label">分机端口</Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="type">
      <Property></Property>
      <Property name="label">分机类型</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;SER_TYPE&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="status">
      <Property></Property>
      <Property name="label">是否在线</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;sys_yes_no&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="controlModel">
      <Property></Property>
      <Property name="label">操作模式</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#controlModel&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="networkType">
      <Property></Property>
      <Property name="label">网络模式</Property>
      <Property name="mapping">
        <Property name="mapValues">
          <Collection>
            <Entity>
              <Property name="code">01</Property>
              <Property name="name">有线模式</Property>
            </Entity>
            <Entity>
              <Property name="code">02</Property>
              <Property name="name">无线模式</Property>
            </Entity>
          </Collection>
        </Property>
        <Property name="keyProperty">code</Property>
        <Property name="valueProperty">name</Property>
      </Property>
      <Property name="required">false</Property>
    </PropertyDef>
    <PropertyDef name="protocol">
      <Property></Property>
      <Property name="label">分机协议</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;PROTOCOL&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="isMoreDepot">
      <Property></Property>
      <Property name="label">多仓并发</Property>
      <Property name="mapping">
        <Property name="mapValues">
          <Collection>
            <Entity>
              <Property name="code">Y</Property>
              <Property name="name">是</Property>
            </Entity>
            <Entity>
              <Property name="code">N</Property>
              <Property name="name">否</Property>
            </Entity>
          </Collection>
        </Property>
        <Property name="keyProperty">code</Property>
        <Property name="valueProperty">name</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="producer">
      <Property></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="contactPhone">
      <Property></Property>
      <Property name="label">联系电话</Property>
    </PropertyDef>
    <PropertyDef name="powerModel">
      <Property></Property>
      <Property name="label">供电模式</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;POWER_TYPE&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="cableStart">
      <Property name="dataType">int</Property>
      <Property name="label">开始列</Property>
    </PropertyDef>
    <PropertyDef name="cableZ">
      <Property name="dataType">int</Property>
      <Property name="label">层配置</Property>
    </PropertyDef>
    <PropertyDef name="cableY">
      <Property name="dataType">int</Property>
      <Property name="label">行配置</Property>
    </PropertyDef>
    <PropertyDef name="cableX">
      <Property name="dataType">int</Property>
      <Property name="label">列配置</Property>
    </PropertyDef>
    <PropertyDef name="cableType">
      <Property></Property>
      <Property name="label">电缆类型</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;CABLE_TYPE&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="cableFormat">
      <Property></Property>
      <Property name="label">电缆制式</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;CABLE_FORMAT&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="orgId">
      <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>
  <DataType name="dtDeviceIot">
    <Property name="creationType">com.fzzy.igds.domain.DeviceIot</Property>
    <PropertyDef name="id">
      <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#getAllData&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">kqmc</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="companyId">
      <Property></Property>
      <Property name="label">组织编码</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>
    </PropertyDef>
    <PropertyDef name="name">
      <Property></Property>
      <Property name="label">名称</Property>
    </PropertyDef>
    <PropertyDef name="passCode">
      <Property name="dataType">int</Property>
      <Property name="label">设备编号</Property>
    </PropertyDef>
    <PropertyDef name="serId">
      <Property></Property>
      <Property name="label">所属分机</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;deviceSerPR#getAllSerCache&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">name</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="type">
      <Property></Property>
      <Property name="label">设备类型</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;DEVICE_IOT_TYPE&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="remark">
      <Property></Property>
      <Property name="label">备注</Property>
    </PropertyDef>
    <PropertyDef name="posX">
      <Property name="dataType">Double</Property>
      <Property name="label">X坐标</Property>
    </PropertyDef>
    <PropertyDef name="posY">
      <Property name="dataType">Double</Property>
      <Property name="label">Y坐标</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="dtDepotConf">
    <Property name="creationType">com.fzzy.igds.domain.DepotConf</Property>
    <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>
    </PropertyDef>
    <PropertyDef name="deptId">
      <Property></Property>
      <Property name="label">所属库区</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;deptPR#getAllData&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">kqmc</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="companyId">
      <Property></Property>
      <Property name="label">组织编码</Property>
    </PropertyDef>
    <PropertyDef name="grainSer">
      <Property></Property>
      <Property name="label">粮情分机</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;deviceSerPR#getAllSerCache&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">name</Property>
      </Property>
      <Property name="required">true</Property>
    </PropertyDef>
    <PropertyDef name="thSer">
      <Property></Property>
      <Property name="label">温湿度分机</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;deviceSerPR#getAllSerCache&quot;).getResult()}</Property>
        <Property name="keyProperty">id</Property>
        <Property name="valueProperty">name</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="grainFreq">
      <Property></Property>
      <Property name="label">保存频率</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#sysDictData&quot;).getResult(&quot;GRAIN_FREQ&quot;)}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="thConf">
      <Property></Property>
      <Property name="label">温湿度通道</Property>
    </PropertyDef>
    <PropertyDef name="cableRule">
      <Property></Property>
      <Property name="label">布线规则</Property>
    </PropertyDef>
    <PropertyDef name="cableCir">
      <Property></Property>
      <Property name="label">筒仓层规则</Property>
    </PropertyDef>
    <PropertyDef name="cableCone">
      <Property name="label">筒仓锥形</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerCableCone&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="cableStart">
      <Property name="dataType">int</Property>
      <Property name="label">电缆开始列</Property>
    </PropertyDef>
    <PropertyDef name="cableEnd">
      <Property name="dataType">int</Property>
      <Property name="label">电缆截至列</Property>
    </PropertyDef>
    <PropertyDef name="startOrientation">
      <Property></Property>
      <Property name="label">电缆起始方位</Property>
      <Property name="mapping">
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerStartOrientation&quot;).getResult()}</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="startDirection">
      <Property name="label">电缆布线方向</Property>
      <Property name="mapping">
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerStartDirection&quot;).getResult()}</Property>
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="startPoint">
      <Property name="label">电缆起始点位</Property>
      <Property name="mapping">
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerStartPoint&quot;).getResult()}</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="startConvert">
      <Property name="label">层行转换</Property>
      <Property name="mapping">
        <Property name="keyProperty">dictValue</Property>
        <Property name="valueProperty">dictLabel</Property>
        <Property name="mapValues">${dorado.getDataProvider(&quot;dicPR#triggerStartConvert&quot;).getResult()}</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="tempMax">
      <Property name="dataType">Double</Property>
      <Property name="label">温度上限</Property>
    </PropertyDef>
    <PropertyDef name="temperature">
      <Property name="dataType">Double</Property>
      <Property name="label">温差阈值</Property>
    </PropertyDef>
    <PropertyDef name="startRow">
      <Property name="dataType">Integer</Property>
      <Property name="label">起始根号</Property>
    </PropertyDef>
    <PropertyDef name="grainAuto">
      <Property></Property>
      <Property name="label">粮情优化</Property>
      <Property name="mapping">
        <Property name="mapValues">
          <Collection>
            <Entity>
              <Property name="code">Y</Property>
              <Property name="name">是</Property>
            </Entity>
            <Entity>
              <Property name="code">N</Property>
              <Property name="name">否</Property>
            </Entity>
          </Collection>
        </Property>
        <Property name="keyProperty">code</Property>
        <Property name="valueProperty">name</Property>
      </Property>
    </PropertyDef>
    <PropertyDef name="depotName">
      <Property></Property>
    </PropertyDef>
    <PropertyDef name="depotType">
      <Property></Property>
    </PropertyDef>
    <PropertyDef name="isOnlyTH">
      <Property></Property>
      <Property name="label">粮情类型</Property>
      <Property name="mapping">
        <Property name="mapValues">
          <Collection>
            <Entity>
              <Property name="code">Y</Property>
              <Property name="name">温湿度设备</Property>
            </Entity>
            <Entity>
              <Property name="code">N</Property>
              <Property name="name">粮情电缆</Property>
            </Entity>
          </Collection>
        </Property>
        <Property name="keyProperty">code</Property>
        <Property name="valueProperty">name</Property>
      </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>