czt
2025-11-28 2f432f52c1cfb1567dadcf6e040c5d38b0a26a79
数量检测配置页面
已修改1个文件
已添加4个文件
1105 ■■■■■ 文件已修改
fzzy-igdss-core/src/main/java/com/fzzy/igds/domain/QuantityConf.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/repository/QuantityConfRepository.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fzzy-igdss-core/src/main/java/com/fzzy/igds/service/QuantityService.java 239 ●●●●● 补丁 | 查看 | 原始文档 | 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-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/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/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-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);
    }
}