CZT
2023-10-25 4a41dd96b1a288fee3343c405b3f3b0c08d5646c
调整上海接口信息
已修改14个文件
已添加2个文件
1125 ■■■■■ 文件已修改
src/main/java/com/fzzy/api/entity/Api1210.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutVarietyChange.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/entity/Fz40SecCamera.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1111.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1302.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1306.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1310.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1311.java 108 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2101.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2104.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/otherview/sh2023/ShApi1311.view.xml 723 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/otherview/sh2023/pr/SHApi1311PR.java 205 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1311.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/templates/home/home.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/api/entity/Api1210.java
@@ -31,19 +31,19 @@
    private static final long serialVersionUID = -8223096234800082280L;
    @Id
    @PropertyDef(label = "粮食性质转变单号",required= true)
    @PropertyDef(label = "粮食性质转变单号")
    @Column(name = "lsxzzbdh", length = 41)
    private String lsxzzbdh;
    @PropertyDef(label = "货位代码",required= true )
    @PropertyDef(label = "货位代码")
    @Column(name = "hwdm", length = 30)
    private String hwdm;
    @PropertyDef(label = "粮食数量(公斤)",required= true )
    @PropertyDef(label = "粮食数量(公斤)")
    @Column(name = "lssl", precision = 20, scale = 6)
    private double lssl;
    @PropertyDef(label = "划转数量(公斤)",required= true )
    @PropertyDef(label = "划转数量(公斤)")
    @Column(name = "hzsl", precision = 20, scale = 6)
    private double hzsl;
@@ -51,11 +51,11 @@
    @Column(name = "bzwh", length = 128)
    private String bzwh;
    @PropertyDef(label = "粮食品种代码",required= true )
    @PropertyDef(label = "粮食品种代码")
    @Column(name = "lspzdm", length = 7)
    private String lspzdm;
    @PropertyDef(label = "划转前粮食性质代码",required= true )
    @PropertyDef(label = "划转前粮食性质代码")
    @Column(name = "hzqlsxzdm", length = 3)
    private String hzqlsxzdm;
@@ -64,7 +64,7 @@
    private String hzhlsxzdm;
    @JSONField(format = "yyyy-MM-dd")
    @PropertyDef(label = "划转日期",required= true )
    @PropertyDef(label = "划转日期")
    @Column(name = "hzrq")
    private Date hzrq;
src/main/java/com/fzzy/async/fzzy40/Fzzy40SyncService12.java
@@ -85,7 +85,7 @@
        fzzySync1207.syncData(kqdm, deptId, start, end);
        //出入库文件信息同步
        fzzySync1109.syncData(kqdm, deptId, start, end);
//        fzzySync1109.syncData(kqdm, deptId, start, end);
        //粮食库存同步
        fzzySync1208.syncData(kqdm, deptId, start, end);
@@ -94,13 +94,13 @@
        fzzySync1210.syncData(kqdm, deptId, start, end);
        /*-----各省独有接口信息同步-----*/
        if (StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_SH_2023.getCode().equals(param.getPushProtocol())) {
            //上海市平台2023版,需要同步市储检斤单,同步市储驳运单
//        if (StringUtils.isNotEmpty(param.getPushProtocol()) && PushProtocol.SB_SH_2023.getCode().equals(param.getPushProtocol())) {
//            //上海市平台2023版,需要同步市储检斤单,同步市储驳运单
//            //同步市储检斤单
//            fzzySync2101.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd());
//            //同步市储驳运单
//            fzzySync2104.syncData(param.getKqdm(), param.getDeptId(), param.getStart(), param.getEnd());
        }
//        }
        //账面库存信息同步  TODO
    }
src/main/java/com/fzzy/async/fzzy40/entity/Fz40InoutVarietyChange.java
@@ -24,7 +24,7 @@
    @Id
    @Column(name = "ID_", length = 41)
    @PropertyDef(label = "粮食性质转变单号", description = "由货位代码+划转日期(yyyyMMdd)+3位顺序号组成")
    @PropertyDef(label = "粮食性质转变单号", description = "划转日期(yyyyMMdd)+3位顺序号组成")
    private String id;
    @Column(name = "COMPANY_ID_", length = 10)
src/main/java/com/fzzy/async/fzzy40/entity/Fz40SecCamera.java
@@ -52,9 +52,13 @@
    @PropertyDef(label = "抓拍方式")
    private String snapType;
    @Column(name = "azwzlx", length = 2)
    @PropertyDef(label = "安装位置类型")
    private String azwzlx;
    @Column(name = "spjklx", length = 1)
    @PropertyDef(label = "视频监控类型")
    private String spjklx;
    @Column(name = "spdwlx", length = 2)
    @PropertyDef(label = "视频点位类型")
    private String spdwlx;
    @Column(name = "NAME_", length = 50)
    @PropertyDef(label = "名称")
@@ -92,16 +96,20 @@
    @PropertyDef(label = "流媒体地址")
    private String mediaAddr;
    @Column(name = "PHONE_ADDR_", length = 100)
    @PropertyDef(label = "手机直播地址")
    private String phoneAddr;
    @Column(name = "REMARK_", length = 300)
    @PropertyDef(label = "备注")
    private String remark;
    @PropertyDef(label = "页面中的坐标")
    @Column(name = "POS_X_", updatable = false)
    @Column(name = "POS_X_")
    private double posX;
    @PropertyDef(label = "页面中的坐标")
    @Column(name = "POS_Y_", updatable = false)
    @Column(name = "POS_Y_")
    private double posY;
    @Column(name = "SCREEN_SHOW_", length = 1)
@@ -112,7 +120,7 @@
    @PropertyDef(label = "监管自动抓拍")
    private String snapTag;
    @Column(name = "UPDATE_TIME_")
    @Column(name = "UPDATE_TIME_", length = 1)
    @PropertyDef(label = "更新时间")
    private Date updateTime;
}
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1111.java
@@ -70,7 +70,6 @@
            Api1111 apiData;
            List<Api1111> listApi1111;
            Integer num = 1000001;
//            String spjksbwzys = "left: {X}px ; top : {Y}px ; width : 10px ; height: 10px";
            for (Fz40SecCamera sysData : list) {
                apiData = new Api1111();
@@ -83,14 +82,16 @@
                apiData.setSpjksbid(api1102.getXzqhdm() + "00401327" + String.valueOf(num).substring(1));
                apiData.setSpjksbxdwz("(" + Math.round(sysData.getPosX()*100) + "," + Math.round(sysData.getPosY()*100) + ")");
//                apiData.setSpjksbwzys(spjksbwzys.replace("{X}",Math.round(sysData.getPosX()*100) + "").replace("{Y}",Math.round(sysData.getPosY()*100) + ""));
                apiData.setBz(sysData.getRemark());
                //视频监控类型和点位类型
                apiData.setSpjklx(StringUtils.isEmpty(sysData.getSpjklx())?"3":sysData.getSpjklx());
                apiData.setSpdwlx(StringUtils.isEmpty(sysData.getSpdwlx())?"7":sysData.getSpdwlx());
                //操作标志及最后更新时间
                apiData.setZhgxsj(new Date());
                //业务id、库区编码、同步时间
                apiData.setSyncTime(new Date());
                apiData.setCzbz(Constant.CZBZ_I);
                apiData.setSpjklx("1");
                listApi1111 = api1111Rep.getApi1111ById(apiData.getSpjksbid());
                if(null != listApi1111 && listApi1111.size() > 0){
                    apiData.setCzbz(listApi1111.get(0).getCzbz());
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1205.java
@@ -202,6 +202,9 @@
                int idNum = Integer.valueOf(sysData.getId().substring(12))*100 + 10001;
                for (Fz40InoutRecordItem fz40InoutRecordItem : listInoutRecordItem) {
                    if(fz40InoutRecordItem.getSettleWeight() <= 0){
                        continue;
                    }
                    apiData.setCkywdh(Constant.INOUT_TYPE_15 + sysData.getId().substring(4,10) + String.valueOf(idNum).substring(1));
                    apiData.setMz(fz40InoutRecordItem.getFullWeight());
                    apiData.setPz(fz40InoutRecordItem.getEmptyWeight());
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1302.java
@@ -104,10 +104,10 @@
                api1302.setLszdw(fz40Grain.getTempMin() == null ? 0.00 : fz40Grain.getTempMin());
                //判断粮食最低温、平均温、最高温是否符合逻辑
                if(api1302.getLszdw() >= api1302.getLspjw()){
                if (api1302.getLszdw() >= api1302.getLspjw()) {
                    continue;
                }
                if(api1302.getLspjw() >= api1302.getLszgw()){
                if (api1302.getLspjw() >= api1302.getLszgw()) {
                    continue;
                }
@@ -156,6 +156,9 @@
        String[] points = point.split(",");
        String result = "";
        if (c * h * l > points.length) {
            return result;
        }
        for (int i = 1; i <= l; i++) {
            for (int j = 1; j <= h; j++) {
                for (int z = 1; z <= c; z++) {
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1306.java
@@ -9,6 +9,7 @@
import com.fzzy.async.fzzy40.entity.Fz40DrugLog;
import com.fzzy.async.fzzy40.repository.Fzzy40Sync1306Rep;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -18,7 +19,7 @@
/**
 * ç†è’¸ä½œä¸šæ•°æ®åŒæ­¥
 *
 * @author chen
 * @author czt
 * @date 2022-09-08 09:51
 */
@Slf4j
@@ -83,6 +84,7 @@
                api1306.setNd(fz40DrugLog.getConcentration());
                api1306.setLddwyyl(fz40DrugLog.getGrainDose());
                api1306.setKjdwyyl(fz40DrugLog.getSpaceDose());
                api1306.setSyff(StringUtils.isEmpty(fz40DrugLog.getSyff())?"0":fz40DrugLog.getSyff());
                api1306.setZyyl(fz40DrugLog.getDose());
                api1306.setSqrq(fz40DrugLog.getVentilateTime());
                api1306.setSqff(fz40DrugLog.getVentilateMethod());
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1310.java
@@ -131,6 +131,9 @@
                api1310.setQfrq(fz40Quality.getTime());
                api1310.setBgcjsj(fz40Quality.getTime());
                api1310.setShrxm(fz40Quality.getCheckUser());
                if(null == fz40Quality.getCheckTime()){
                    fz40Quality.setCheckTime(DateUtils.addDays(fz40Quality.getTime(), -1));
                }
                if (!fz40Quality.getCheckTime().before(fz40Quality.getTime())) {
                    fz40Quality.setCheckTime(DateUtils.addDays(fz40Quality.getTime(), -1));
                }
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1311.java
@@ -1,11 +1,13 @@
package com.fzzy.async.fzzy40.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fzzy.api.Constant;
import com.fzzy.api.entity.Api1102;
import com.fzzy.api.entity.ApiInfoData;
import com.fzzy.api.entity.ApiLog;
import com.fzzy.api.service.ApiCommonService;
import com.fzzy.api.utils.ContextUtil;
import com.fzzy.api.view.repository.Api1102Rep;
import com.fzzy.api.view.repository.ApiInfoDataRep;
import com.fzzy.api.view.repository.ApiLogRep;
import com.fzzy.async.fzzy40.entity.Fz40SecCamera;
@@ -16,6 +18,7 @@
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
@@ -29,6 +32,8 @@
public class Fzzy40Sync1311 {
    @Autowired
    private ApiLogRep apiLogRep;
    @Autowired
    private Api1102Rep api1102Rep;
    @Autowired
    private Fzzy40Sync1311Rep fzzy40Sync1311Rep;
    @Autowired
@@ -50,74 +55,87 @@
                log.debug("-------------没有获取到视频监控信息------------------");
                return;
            }
            Api1102 api1102 = api1102Rep.findById(kqdm).get();
            SH2023Api1311 sh2023Api1311;
            SH2023Api1311 sh1311;
            List<ApiInfoData> apiInfoDataList;
            String dataID;
            int num = 1;
            String secType = "01,02,03,04,05";
            Integer num = 1000001;
            for (Fz40SecCamera sysData : list) {
                dataID = kqdm.substring(3, 8) + "01401327" + String.format("%06d", num++);
                List<ApiInfoData> apiInfoData = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_1311, dataID, kqdm);
                if (null != apiInfoData && apiInfoData.size() > 0) {
                    continue;
                }
                sh2023Api1311 = new SH2023Api1311();
                sh2023Api1311.setSpjksbid(dataID);
                sh2023Api1311.setSpjksbid(api1102.getXzqhdm() + "00401327" + String.valueOf(num).substring(1));
                sh2023Api1311.setTdbh(sysData.getChanNum());
                sh2023Api1311.setTdmc(sysData.getChanNum() + "号通道");
                sh2023Api1311.setJksbbm(sysData.getId());
                sh2023Api1311.setJksbmc(sysData.getName());
                sh2023Api1311.setKqdm(kqdm);
                if (sysData.getBrand().equals("01")) {
                    sh2023Api1311.setJkcs("2");
                } else if (sysData.getBrand().equals("02")) {
                    sh2023Api1311.setJkcs("1");
                } else {
                    sh2023Api1311.setJkcs("9");
                }
                //监控厂商
                sh2023Api1311.setJkcs(getBrandId(sysData.getBrand()));
                sh2023Api1311.setJkxh(sysData.getSn());
                sh2023Api1311.setJkxlh(sysData.getSn());
                if(StringUtils.isNotEmpty(sysData.getAzwzlx())){
                    if (sysData.getAzwzlx().equals("08")) {
                        sh2023Api1311.setSpjklx("1");
                    } else if (secType.indexOf(sysData.getAzwzlx()) >= 0) {
                        sh2023Api1311.setSpjklx("2");
                    } else {
                        sh2023Api1311.setSpjklx("3");
                    }
                }
                sh2023Api1311.setSpjklx(StringUtils.isEmpty(sysData.getSpjklx()) ? "3" : sysData.getSpjklx());
                sh2023Api1311.setSblxbm("1");
                sh2023Api1311.setAzwzlx(sysData.getAzwzlx());
                sh2023Api1311.setZsqy("Y");
                sh2023Api1311.setJkjlxbm(sysData.getType().substring(1));
                sh2023Api1311.setAzwz(sysData.getName());
                sh2023Api1311.setAzwzlx(StringUtils.isEmpty(sysData.getSpdwlx()) ? "7" : sysData.getSpdwlx());
                if ("12".equals(sh2023Api1311.getAzwzlx()) || "13".equals(sh2023Api1311.getAzwzlx())
                        || "14".equals(sh2023Api1311.getAzwzlx()) || "15".equals(sh2023Api1311.getAzwzlx())) {
                    sh2023Api1311.setAzwzlx("99");
                }
                if ("16".equals(sh2023Api1311.getAzwzlx())) {
                    sh2023Api1311.setAzwzlx("12");
                }
                sh2023Api1311.setSfazbgd("Y");
                if(StringUtils.isEmpty(sysData.getType())){
                    sysData.setType("01");
                }
                if(sysData.getType().equals("02")){
                    sh2023Api1311.setJkjlxbm("2");
                }
                if(sysData.getType().equals("01")){
                    sh2023Api1311.setJkjlxbm("1");
                }
                sh2023Api1311.setJktyzw(12);
                sh2023Api1311.setSbipdz(sysData.getIpIn());
                sh2023Api1311.setSbdkh(sysData.getPortInV());
                sh2023Api1311.setSbdlmc(sysData.getLoginId());
                sh2023Api1311.setSbdlmm(sysData.getPwd());
                sh2023Api1311.setBz(sysData.getRemark());
                sh2023Api1311.setZhgxsj(sysData.getUpdateTime());
                sh2023Api1311.setZhgxsj(sysData.getUpdateTime()==null?new Date():sysData.getUpdateTime());
                //持久化保存,单独存入非国标接口表
                ApiInfoData infoData = new ApiInfoData();
                infoData.setId(ContextUtil.getUUID());
                infoData.setId(sh2023Api1311.getSpjksbid());
                infoData.setKqdm(kqdm);
                infoData.setInteType(Constant.API_CATEGORY_13);
                infoData.setInteId(SH2023Constant.SH_2023_API_CODE_1311);
                infoData.setUpdateTime(new Date());
                infoData.setDataId(dataID);
                infoData.setUpdateTime(sh2023Api1311.getZhgxsj());
                infoData.setDataId(sh2023Api1311.getSpjksbid());
                infoData.setRemarks("视频监控信息");
                //设置操作标志
                apiInfoDataList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_1311, infoData.getDataId(), kqdm);
                if (null == apiInfoDataList || apiInfoDataList.isEmpty()) {
                    sh2023Api1311.setCzbz(Constant.CZBZ_I);
                    infoData.setCzbz(Constant.CZBZ_I);
                } else {
                    sh2023Api1311.setCzbz(apiInfoDataList.get(0).getCzbz());
                    infoData.setCzbz(apiInfoDataList.get(0).getCzbz());
                    sh1311 = JSONObject.parseObject(infoData.getData(), SH2023Api1311.class);
                    if(null != sh1311 && StringUtils.isNotEmpty(sh1311.getAjdm())){
                        sh2023Api1311.setAjdm(sh1311.getAjdm());
                    }
                    if(null != sh1311 && StringUtils.isNotEmpty(sh1311.getHwdm())){
                        sh2023Api1311.setHwdm(sh1311.getHwdm());
                    }
                }
                infoData.setData(JSON.toJSONString(sh2023Api1311));
                apiInfoDataRep.save(infoData);
                log.info("1311---市储检斤单-同步数据:{}", sh2023Api1311);
                num++;
                log.info("1311---视频监控-同步数据:{}", sh2023Api1311);
            }
        } catch (Exception e) {
@@ -126,4 +144,20 @@
            apiLogRep.save(apiLog);
        }
    }
    private String getBrandId(String brandName) {
        if (StringUtils.isEmpty(brandName)) {
            return "9";
        }
        if (brandName.contains("海康")) {
            return "1";
        }
        if (brandName.contains("大华")) {
            return "2";
        }
        if (brandName.contains("宇视")) {
            return "3";
        }
        return "9";
    }
}
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2101.java
@@ -80,10 +80,6 @@
                bjw = ShAreaBjw.getBjw(api1102List.get(0).getXzqhdm());
            }
            for (Fz40InoutRecord sysData : list) {
                List<ApiInfoData> apiInfoData = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2101, sysData.getCheckId(), kqdm);
                if (null != apiInfoData && apiInfoData.size() > 0) {
                    continue;
                }
                sh2023Api2101 = new SH2023Api2101();
                sh2023Api2101.setJjdh(sysData.getCheckId());
                sh2023Api2101.setKqdm(kqdm);
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2104.java
@@ -83,10 +83,7 @@
                bjw = ShAreaBjw.getBjw(api1102List.get(0).getXzqhdm());
            }
            for (Fz40InoutRecord sysData : list) {
                List<ApiInfoData> apiInfoData = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_2104, sysData.getId().substring(2),kqdm);
                if (null != apiInfoData && apiInfoData.size() > 0) {
                    continue;
                }
                sh2023Api2104 = new SH2023Api2104();
                sh2023Api2104.setBydh(sysData.getId().substring(2));
                sh2023Api2104.setKqdm(kqdm);
src/main/java/com/fzzy/otherview/sh2023/ShApi1311.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,723 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtMain">
      <Property name="creationType">com.fzzy.push.sh2023.dto.SH2023Api1311</Property>
      <PropertyDef name="spjksbid">
        <Property></Property>
        <Property name="label">视频监控设备id</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="tdbh">
        <Property></Property>
        <Property name="label">通道编号</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="tdmc">
        <Property name="label">通道名称</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="jksbbm">
        <Property></Property>
        <Property name="label">监控设备编码</Property>
      </PropertyDef>
      <PropertyDef name="jksbmc">
        <Property name="label">监控设备名称</Property>
      </PropertyDef>
      <PropertyDef name="kqdm">
        <Property></Property>
        <Property name="label">库区代码</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="jkcs">
        <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="value">1-海康</Property>
                <Property name="key">1</Property>
              </Entity>
              <Entity>
                <Property name="value">2-大华</Property>
                <Property name="key">2</Property>
              </Entity>
              <Entity>
                <Property name="value">3-宇视</Property>
                <Property name="key">3</Property>
              </Entity>
              <Entity>
                <Property name="value">4-天地伟业</Property>
                <Property name="key">4</Property>
              </Entity>
              <Entity>
                <Property name="value">5-华为</Property>
                <Property name="key">5</Property>
              </Entity>
              <Entity>
                <Property name="value">9-其他</Property>
                <Property name="key">6</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="jkxh">
        <Property></Property>
        <Property name="label">监控型号</Property>
      </PropertyDef>
      <PropertyDef name="jkxlh">
        <Property></Property>
        <Property name="label">监控序列号</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="azwz">
        <Property></Property>
        <Property name="label">安装位置</Property>
      </PropertyDef>
      <PropertyDef name="azwzlx">
        <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">99</Property>
                <Property name="value">99-其他</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="sblxbm">
        <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="value">1-DVR</Property>
                <Property name="key">1</Property>
              </Entity>
              <Entity>
                <Property name="value">2-NVR</Property>
                <Property name="key">2</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="zsqy">
        <Property></Property>
        <Property name="label">照射区域</Property>
      </PropertyDef>
      <PropertyDef name="sfazbgd">
        <Property></Property>
        <Property name="label">是否安装补光灯</Property>
        <Property name="required">true</Property>
        <Property name="mapping">
          <Property name="keyProperty">key</Property>
          <Property name="valueProperty">value</Property>
          <Property name="mapValues">
            <Collection>
              <Entity>
                <Property name="value">Y-是</Property>
                <Property name="key">Y</Property>
              </Entity>
              <Entity>
                <Property name="value">N-否</Property>
                <Property name="key">N</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="ajdm">
        <Property></Property>
        <Property name="label">廒间代码</Property>
      </PropertyDef>
      <PropertyDef name="hwdm">
        <Property></Property>
        <Property name="label">货位代码</Property>
        <Property name="required">true</Property>
      </PropertyDef>
      <PropertyDef name="jkjlxbm">
        <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="value">1-枪机</Property>
                <Property name="key">1</Property>
              </Entity>
              <Entity>
                <Property name="value">2-球机</Property>
                <Property name="key">2</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="jktyzw">
        <Property></Property>
        <Property name="label">监控预置位数量</Property>
      </PropertyDef>
      <PropertyDef name="sbipdz">
        <Property></Property>
        <Property name="label">设备IP地址</Property>
      </PropertyDef>
      <PropertyDef name="sbdkh">
        <Property></Property>
        <Property name="label">设备端口号</Property>
      </PropertyDef>
      <PropertyDef name="sbdlmc">
        <Property name="label">设备登录名称</Property>
      </PropertyDef>
      <PropertyDef name="sbdlmm">
        <Property name="label">设备登录密码</Property>
      </PropertyDef>
      <PropertyDef name="bz">
        <Property name="label">备注</Property>
      </PropertyDef>
      <PropertyDef name="bjw">
        <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="value">闵行区</Property>
                <Property name="key">minhang</Property>
              </Entity>
              <Entity>
                <Property name="value">宝山区</Property>
                <Property name="key">baoshan</Property>
              </Entity>
              <Entity>
                <Property name="value">嘉定区</Property>
                <Property name="key">jiading</Property>
              </Entity>
              <Entity>
                <Property name="value">浦东新区</Property>
                <Property name="key">pudong</Property>
              </Entity>
              <Entity>
                <Property name="value">金山区</Property>
                <Property name="key">jinshan</Property>
              </Entity>
              <Entity>
                <Property name="value">松江区</Property>
                <Property name="key">songjiang</Property>
              </Entity>
              <Entity>
                <Property name="value">青浦区</Property>
                <Property name="key">qingpu</Property>
              </Entity>
              <Entity>
                <Property name="value">奉贤区</Property>
                <Property name="key">fengxian</Property>
              </Entity>
              <Entity>
                <Property name="value">崇明区</Property>
                <Property name="key">chongming</Property>
              </Entity>
            </Collection>
          </Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="czbz">
        <Property></Property>
        <Property name="label">操作标志</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;apiTriggerService#trigger&quot;).getResult(&quot;CZBZ&quot;)}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
      <PropertyDef name="zhgxsj">
        <Property></Property>
        <Property name="dataType">DateTime</Property>
        <Property name="label">最后更新时间</Property>
      </PropertyDef>
    </DataType>
    <DataType name="dtParam">
      <Property name="creationType">com.fzzy.api.data.ApiParam</Property>
      <PropertyDef name="kqdm">
        <Property></Property>
        <Property name="label">所属库区</Property>
      </PropertyDef>
      <PropertyDef name="start">
        <Property name="dataType">Date</Property>
        <Property name="label">开始时间</Property>
      </PropertyDef>
      <PropertyDef name="end">
        <Property name="dataType">Date</Property>
        <Property name="label">截止时间</Property>
      </PropertyDef>
      <PropertyDef name="czbz">
        <Property></Property>
        <Property name="label">操作标志</Property>
        <Property name="mapping">
          <Property name="mapValues">${dorado.getDataProvider(&quot;apiTriggerService#trigger&quot;).getResult(&quot;CZBZ&quot;)}</Property>
          <Property name="keyProperty">code</Property>
          <Property name="valueProperty">name</Property>
        </Property>
      </PropertyDef>
    </DataType>
  </Model>
  <View layout="regionPadding:10">
    <Property name="packages">font-awesome,css-common</Property>
    <DataSet id="dsMain">
      <Property name="dataType">[dtMain]</Property>
      <Property name="dataProvider">sHApi1311PR#listData</Property>
      <Property name="pageSize">15</Property>
    </DataSet>
    <DataSet id="dsQuery">
      <ClientEvent name="onReady">self.insert();</ClientEvent>
      <Property name="dataType">dtParam</Property>
    </DataSet>
    <ToolBar>
      <ToolBarLabel>
        <Property name="text">工具栏:</Property>
        <Property name="style">
          <Property name="font-weight">bold</Property>
        </Property>
      </ToolBarLabel>
      <ToolBarButton>
        <ClientEvent name="onClick">var query = view.get(&quot;#dsQuery&quot;).getData();&#xD;
view.get(&quot;#dsMain&quot;).set(&quot;parameter&quot;,query).flushAsync();</ClientEvent>
        <Property name="caption">查询</Property>
        <Property name="iconClass">fa fa-search</Property>
        <Property name="width">100</Property>
        <Property name="exClassName">toolbar-button-push</Property>
      </ToolBarButton>
      <ToolBarButton id="btnAdd">
        <ClientEvent name="onClick">view.get(&quot;#dsMain&quot;).insert();&#xD;
view.get(&quot;#dialogMain&quot;).show();</ClientEvent>
        <Property name="caption">新增</Property>
        <Property name="iconClass">fa fa-plus</Property>
        <Property name="width">100</Property>
        <Property name="exClassName">toolbar-button</Property>
        <Property name="hideMode">display</Property>
      </ToolBarButton>
      <ToolBarButton id="btnUpdate">
        <ClientEvent name="onClick">var cur = view.get(&quot;#dgMain&quot;).getCurrentItem();&#xD;
if(cur){&#xD;
    view.get(&quot;#dialogMain&quot;).show();&#xD;
}</ClientEvent>
        <Property name="caption">修改</Property>
        <Property name="iconClass">fa fa-pencil</Property>
        <Property name="width">100</Property>
        <Property name="exClassName">toolbar-button-warm</Property>
        <Property name="hideMode">display</Property>
      </ToolBarButton>
      <ToolBarButton>
        <ClientEvent name="onClick">var cur = view.get(&quot;#dgMain&quot;).getCurrentItem();&#xD;
view.get(&quot;#ajaxDelUpdate&quot;).set(&quot;parameter&quot;,cur).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
    } else{&#xD;
        cur.set(&quot;czbz&quot;,&quot;d&quot;)&#xD;
    }&#xD;
});&#xD;
</ClientEvent>
        <Property name="caption">标记删除</Property>
        <Property name="iconClass">fa fa-minus</Property>
        <Property name="exClassName">toolbar-button-warn</Property>
        <Property name="width">100</Property>
      </ToolBarButton>
      <ToolBarButton id="btnDel">
        <ClientEvent name="onClick">var cur = view.get(&quot;#dgMain&quot;).getCurrentItem();&#xD;
view.get(&quot;#ajaxDel&quot;).set(&quot;parameter&quot;,cur).execute(function(result){&#xD;
    if(result){&#xD;
        $alert(result);&#xD;
    } else{&#xD;
        cur.remove();&#xD;
    }&#xD;
});&#xD;
</ClientEvent>
        <Property name="caption">直接删除</Property>
        <Property name="iconClass">fa fa-minus</Property>
        <Property name="exClassName">toolbar-button-warn</Property>
        <Property name="width">100</Property>
        <Property name="hideMode">display</Property>
      </ToolBarButton>
      <ToolBarButton>
        <ClientEvent name="onClick">var select = view.get(&quot;#dgMain&quot;).get(&quot;selection&quot;);&#xD;
if(select &amp;&amp; select.length > 0){&#xD;
    view.get(&quot;#ajaxPush&quot;).set(&quot;parameter&quot;,select).execute(function(result){&#xD;
        view.get(&quot;#dsMain&quot;).flushAsync();&#xD;
          $notify(result);&#xD;
    });&#xD;
}else{&#xD;
    $alert(&quot;请勾选上报数据!&quot;);&#xD;
}&#xD;
</ClientEvent>
        <Property name="caption">手动上传</Property>
        <Property name="iconClass">fa fa-hand-o-up</Property>
        <Property name="exClassName">toolbar-button-push</Property>
        <Property name="width">100</Property>
      </ToolBarButton>
      <Fill/>
      <ToolBarButton>
        <Property name="caption">上传记录</Property>
        <Property name="iconClass">fa fa-bars</Property>
        <Property name="exClassName">toolbar-button</Property>
        <Property name="width">100</Property>
      </ToolBarButton>
    </ToolBar>
    <AutoForm>
      <Property name="dataSet">dsQuery</Property>
      <Property name="cols">*,*,*,*</Property>
      <Property name="labelAlign">right</Property>
      <Property name="labelSeparator">:</Property>
      <Property name="labelWidth">90</Property>
      <AutoFormElement>
        <Property name="name">kqdm</Property>
        <Property name="property">kqdm</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">start</Property>
        <Property name="property">start</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">end</Property>
        <Property name="property">end</Property>
        <Editor/>
      </AutoFormElement>
      <AutoFormElement>
        <Property name="name">czbz</Property>
        <Property name="property">czbz</Property>
        <Property name="trigger">autoMappingDropDown2</Property>
        <Editor/>
      </AutoFormElement>
    </AutoForm>
    <DataGrid id="dgMain">
      <ClientEvent name="onDataRowDoubleClick">view.get(&quot;#dialogMain&quot;).show();</ClientEvent>
      <Property name="dataSet">dsMain</Property>
      <Property name="selectionMode">multiRows</Property>
      <Property name="readOnly">true</Property>
      <RowNumColumn/>
      <RowSelectorColumn>
        <Property name="caption">上传</Property>
      </RowSelectorColumn>
      <DataColumn name="spjksbid">
        <Property name="property">spjksbid</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="jksbmc">
        <Property name="property">jksbmc</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="kqdm">
        <Property name="property">kqdm</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="jkcs">
        <Property name="property">jkcs</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="spjklx">
        <Property name="property">spjklx</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="azwzlx">
        <Property name="property">azwzlx</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="czbz">
        <Property name="property">czbz</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="zhgxsj">
        <Property name="property">zhgxsj</Property>
        <Property name="align">center</Property>
      </DataColumn>
    </DataGrid>
    <ToolBar layoutConstraint="bottom">
      <Fill/>
      <DataPilot>
        <Property name="itemCodes">pageSize,pages</Property>
        <Property name="dataSet">dsMain</Property>
      </DataPilot>
    </ToolBar>
    <Dialog id="dialogMain">
      <Property name="width">80%</Property>
      <Property name="caption">到仓信息</Property>
      <Property name="iconClass">fa fa-sliders</Property>
      <Property name="closeable">false</Property>
      <Buttons>
        <Button>
          <ClientEvent name="onClick">var cur = view.get(&quot;#dgMain&quot;).getCurrentItem();&#xD;
view.get(&quot;#updateSave&quot;).execute(function(){&#xD;
    self.get(&quot;parent&quot;).hide();&#xD;
});</ClientEvent>
          <Property name="caption">保存修改</Property>
          <Property name="iconClass">fa fa-check</Property>
          <Property name="exClassName">toolbar-button</Property>
        </Button>
        <Button>
          <ClientEvent name="onClick">var cur = view.get(&quot;#dgMain&quot;).getCurrentItem();&#xD;
self.get(&quot;parent&quot;).hide();&#xD;
if(cur) cur.cancel();</ClientEvent>
          <Property name="caption">取消修改</Property>
          <Property name="iconClass">fa fa-times</Property>
          <Property name="exClassName">toolbar-button-warn</Property>
        </Button>
      </Buttons>
      <Children>
        <AutoForm>
          <Property name="dataSet">dsMain</Property>
          <Property name="cols">*,*,*,*</Property>
          <Property name="labelWidth">100</Property>
          <Property name="labelAlign">left</Property>
          <Property name="labelSeparator">:</Property>
          <Property name="labelPosition">top</Property>
          <AutoFormElement>
            <Property name="name">spjksbid</Property>
            <Property name="property">spjksbid</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">tdbh</Property>
            <Property name="property">tdbh</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">tdmc</Property>
            <Property name="property">tdmc</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">jksbbm</Property>
            <Property name="property">jksbbm</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">jksbmc</Property>
            <Property name="property">jksbmc</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">kqdm</Property>
            <Property name="property">kqdm</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">jkcs</Property>
            <Property name="property">jkcs</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">jkxh</Property>
            <Property name="property">jkxh</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">jkxlh</Property>
            <Property name="property">jkxlh</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">spjklx</Property>
            <Property name="property">spjklx</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">sblxbm</Property>
            <Property name="property">sblxbm</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">azwz</Property>
            <Property name="property">azwz</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">azwzlx</Property>
            <Property name="property">azwzlx</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">zsqy</Property>
            <Property name="property">zsqy</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">sfazbgd</Property>
            <Property name="property">sfazbgd</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">ajdm</Property>
            <Property name="property">ajdm</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">hwdm</Property>
            <Property name="property">hwdm</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">jkjlxbm</Property>
            <Property name="property">jkjlxbm</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">jktyzw</Property>
            <Property name="property">jktyzw</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">sbipdz</Property>
            <Property name="property">sbipdz</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">sbdkh</Property>
            <Property name="property">sbdkh</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">sbdlmc</Property>
            <Property name="property">sbdlmc</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">sbdlmm</Property>
            <Property name="property">sbdlmm</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">bz</Property>
            <Property name="property">bz</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">bjw</Property>
            <Property name="property">bjw</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">czbz</Property>
            <Property name="property">czbz</Property>
            <Editor/>
          </AutoFormElement>
          <AutoFormElement>
            <Property name="name">zhgxsj</Property>
            <Property name="property">zhgxsj</Property>
            <Editor/>
          </AutoFormElement>
        </AutoForm>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="updateSave">
      <Property name="dataResolver">sHApi1311PR#saveData</Property>
      <UpdateItem>
        <Property name="dataPath">[#current]</Property>
        <Property name="dataSet">dsMain</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxPush">
      <Property name="service">sHApi1311PR#pushData</Property>
      <Property name="confirmMessage">确定要上报么?</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDel">
      <Property name="service">sHApi1311PR#delData</Property>
      <Property name="confirmMessage">当前数据删除后无法恢复,请确认要删除么?</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDelUpdate">
      <Property name="service">sHApi1311PR#delUpdate</Property>
      <Property name="confirmMessage">确定要将数据标记为删除么?</Property>
    </AjaxAction>
  </View>
</ViewConfig>
src/main/java/com/fzzy/otherview/sh2023/pr/SHApi1311PR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,205 @@
package com.fzzy.otherview.sh2023.pr;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
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.api.Constant;
import com.fzzy.api.data.ApiParam;
import com.fzzy.api.dto.ResponseDto;
import com.fzzy.api.entity.ApiConfs;
import com.fzzy.api.entity.ApiInfoData;
import com.fzzy.api.service.ApiCommonService;
import com.fzzy.api.service.ApiPushManager;
import com.fzzy.api.service.ApiRemoteService;
import com.fzzy.api.utils.ContextUtil;
import com.fzzy.api.view.repository.ApiInfoDataRep;
import com.fzzy.push.sh2023.SH2023Constant;
import com.fzzy.push.sh2023.dto.SH2023Api1311;
import com.fzzy.push.sh2023.dto.SH2023Api2101;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateFormatUtils;
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.Date;
import java.util.List;
/**
 * ä¸Šæµ·å¸‚接口-2101 æ£€æ–¤å•
 *
 * @author czt
 * @date 2023/8/17
 */
@Component(value = "sHApi1311PR")
public class SHApi1311PR {
    @Autowired
    private ApiInfoDataRep apiInfoDataRep;
    @Autowired
    private ApiCommonService apiCommonService;
    @Autowired
    private ApiPushManager apiPushManager;
    /**
     * èŽ·å–ä¿¡æ¯
     * sHApi1311PR#listData
     *
     * @return
     */
    @DataProvider
    public void listData(Page<SH2023Api1311> page, ApiParam param) {
        Pageable pageable = PageRequest.of(page.getPageNo() - 1, page.getPageSize(), Sort.Direction.DESC, "updateTime");
        Specification specification = new Specification<ApiInfoData>() {
            private static final long serialVersionUID = 1L;
            @Override
            public Predicate toPredicate(Root<ApiInfoData> root, CriteriaQuery<?> criteriaQuery, CriteriaBuilder criteriaBuilder) {
                List<Predicate> predicates = new ArrayList<>(); //所有的断言
                Predicate predicate = criteriaBuilder.equal(root.get("inteId"), SH2023Constant.SH_2023_API_CODE_1311);
                predicates.add(predicate);
                if (null != param) {
                    if (StringUtils.isNotBlank(param.getKqdm())) {
                        Predicate predicate1 = criteriaBuilder.equal(root.get("kqdm"), param.getKqdm());
                        predicates.add(predicate1);
                    }
                    if (StringUtils.isNotBlank(param.getCzbz())) {
                        Predicate predicate2 = criteriaBuilder.equal(root.get("czbz"), param.getCzbz());
                        predicates.add(predicate2);
                    }
                    if (null != param.getStart()) {
                        Predicate predicate3 = criteriaBuilder.greaterThan(root.get("updateTime"), ContextUtil.getCurZero(param.getStart()));
                        predicates.add(predicate3);
                    }
                    if (null != param.getEnd()) {
                        Predicate predicate4 = criteriaBuilder.lessThan(root.get("updateTime"), ContextUtil.getNextZero(param.getEnd()));
                        predicates.add(predicate4);
                    }
                }
                return criteriaBuilder.and(predicates.toArray(new Predicate[0]));
            }
        };
        org.springframework.data.domain.Page<ApiInfoData> japPage = apiInfoDataRep.findAll(specification, pageable);
        page.setEntityCount((int) japPage.getTotalElements());
        List<SH2023Api1311> list = new ArrayList<>();
        SH2023Api1311 sh2023Api2101;
        for (ApiInfoData infoData : japPage.getContent()) {
            sh2023Api2101 = JSONObject.parseObject(infoData.getData(), SH2023Api1311.class);
            list.add(sh2023Api2101);
        }
        page.setEntities(list);
    }
    /**
     * sHApi1311PR#saveData
     */
    @DataResolver
    public void saveData(SH2023Api1311 data) {
        ApiInfoData infoData;
        List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_1311, data.getSpjksbid(),data.getKqdm());
        if (apiInfoList.size() != 0) {
            infoData = apiInfoList.get(0);
            infoData.setData(JSON.toJSONString(data));
        } else {
            infoData = new ApiInfoData();
            infoData.setId(ContextUtil.getUUID());
            infoData.setKqdm(data.getKqdm());
            infoData.setInteId(SH2023Constant.SH_2023_API_CODE_1311);
            infoData.setUpdateTime(new Date());
            infoData.setDataId(data.getSpjksbid());
            infoData.setData(JSON.toJSONString(data));
            infoData.setCzbz(data.getCzbz());
            infoData.setRemarks("备注信息");
        }
        apiInfoDataRep.save(infoData);
    }
    /**
     * sHApi1311PR#delData
     */
    @Expose
    public void delData(SH2023Api1311 data) {
        List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_1311, data.getSpjksbid(),data.getKqdm());
        apiInfoDataRep.deleteById(apiInfoList.get(0).getId());
    }
    /**
     * sHApi1311PR#delUpdate
     */
    @Expose
    public String delUpdate(SH2023Api1311 data) {
        if (null == data) {
            return "无数据执行";
        }
        List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_1311, data.getSpjksbid(),data.getKqdm());
        data.setCzbz(Constant.CZBZ_D);
        apiInfoDataRep.updateStatus(apiInfoList.get(0).getId(), JSON.toJSONString(data), Constant.CZBZ_D);
        return null;
    }
    /**
     *  sHApi1311PR#delUpdate
     */
    @Expose
    public String pushData(List<SH2023Api1311> items) {
        ResponseDto responseDto;
        String result = "";
        String kqdm = items.get(0).getKqdm();
        ApiConfs apiConf = apiCommonService.getConf(kqdm);
        if (null == apiConf) {
            return "系统没有获取到当前库区配置信息,执行失败";
        }
        //封装参数
        ApiParam param = new ApiParam(apiConf, "21", SH2023Constant.SH_2023_API_CODE_1311);
        //获取实现接口
        ApiRemoteService apiService = apiPushManager.getApiRemoteService(param.getPushProtocol());
        if (null == apiService) {
            return "系统没有当前推送协议配置,执行失败";
        }
        //推送,数据为集合形式
        responseDto = apiService.pushData(param, apiConf, items);
        if (responseDto.getSuccess() == 0) {
            //推送成功,更新数据上传状态
            ApiInfoData infoData;
            for (SH2023Api1311 data : items) {
                if (Constant.CZBZ_I.equals(data.getCzbz())) {
                    //推送成功,更新数据上传状态
                    List<ApiInfoData> apiInfoList = apiInfoDataRep.getDataByInteAndData(SH2023Constant.SH_2023_API_CODE_1311, data.getSpjksbid(),data.getKqdm());
                    data.setCzbz(Constant.CZBZ_U);
                    infoData = apiInfoList.get(0);
                    infoData.setUpdateTime(new Date());
                    infoData.setCzbz(Constant.CZBZ_U);
                    infoData.setData(JSON.toJSONString(data));
                    apiInfoDataRep.save(infoData);
                }
            }
            result += responseDto.toString();
        }
        return result;
    }
}
src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1311.java
@@ -27,7 +27,7 @@
    private String spjksbid;
    @PropertyDef(label = "通道编号")
    private int tdbh;
    private Integer tdbh;
    @PropertyDef(label = "通道名称")
    private String tdmc;
@@ -100,13 +100,13 @@
    private String jkjlxbm;
    @PropertyDef(label = "监控预置位数量")
    private int jktyzw;
    private Integer jktyzw;
    @PropertyDef(label = "设备IP地址")
    private String sbipdz;
    @PropertyDef(label = "设备端口号")
    private int sbdkh;
    private Integer sbdkh;
    @PropertyDef(label = "设备登录名称")
    private String sbdlmc;
src/main/resources/templates/home/home.html
@@ -300,6 +300,9 @@
                                <a lay-href="com.fzzy.otherview.sh2023.ShApi2102.d">上海-倒仓倒入</a>
                            </dd>
                            <dd>
                                <a lay-href="com.fzzy.otherview.sh2023.ShApi1311.d">上海-视频监控信息</a>
                            </dd>
                            <dd>
                                <a lay-href="com.fzzy.otherview.sh2023.ShApi2103.d">上海-粮情设备配置</a>
                            </dd>
                            <dd>
@@ -310,9 +313,6 @@
                            </dd>
                            <dd>
                                <a lay-href="com.fzzy.otherview.sh2023.ShApi2204.d">上海-定化水检验</a>
                            </dd>
                            <dd>
                                <a lay-href="com.fzzy.test.ApiTest.d">视频接口测试</a>
                            </dd>
                        </dl>
                    </li>