czt
2024-06-28 54b61daf58037385cb8d46404b12a95786c7c8f3
上海省平台协议-增加数据相符性接口
已添加4个文件
已修改14个文件
1002 ■■■■■ 文件已修改
src/main/java/com/fzzy/api/timer/ApiSH2023Scheduled.java 123 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/api/view/repository/Api1202Rep.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/api/view/repository/Api1205Rep.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/api/view/repository/Api1208Rep.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1023.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1302.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2104.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/otherview/sh2023/ShApi1115.view.xml 497 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/otherview/sh2023/ShApi2103.view.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/otherview/sh2023/pr/SHApi1115PR.java 193 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/impl/ComPushService99.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/SH2023Constant.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/SH2023OrderServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/SH2023PushService11.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1115.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/templates/home/home.html 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/fzzy/api/timer/ApiSH2023Scheduled.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,123 @@
package com.fzzy.api.timer;
import com.fzzy.api.Constant;
import com.fzzy.api.entity.*;
import com.fzzy.api.utils.DateUtil;
import com.fzzy.api.view.repository.*;
import com.fzzy.otherview.sh2023.pr.SHApi1115PR;
import com.fzzy.push.sh2023.dto.SH2023Api1115;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
/**
 * @Description ä¸Šæµ·çœå¹³å°æŽ¥å£-定时统计(数据相符性数据)
 * @Author CZT
 * @Date 2024/6/28 16:38
 */
@Slf4j
@Component(ApiSH2023Scheduled.BEAN_ID)
public class ApiSH2023Scheduled {
    public static final String BEAN_ID = "api.apiSH2023Scheduled";
    @Autowired
    private Api1101Rep api1101Rep;
    @Autowired
    private Api1102Rep api1102Rep;
    @Autowired
    private Api1105Rep api1105Rep;
    @Autowired
    private Api1202Rep api1202Rep;
    @Autowired
    private Api1205Rep api1205Rep;
    @Autowired
    private Api1208Rep api1208Rep;
    @Autowired
    private SHApi1115PR shApi1115PR;
    /**
     * æ¯å¤©æ™šä¸Š10点定时统计数据相符性
     */
    @Scheduled(cron = "0 0 22 * * ? ")
    public void scheduled() {
        log.info("------->>>>>>>>>>上海省平台接口,系统定时统计数据相符性");
        List<Api1102> allApi1102 = api1102Rep.findAll();
        if (null == allApi1102 || allApi1102.isEmpty()){
            return;
        }
        Date exeDate = new Date();
        for (Api1102 api1102 : allApi1102) {
            exeCount(api1102, exeDate);
        }
    }
    /**
     * ç»Ÿè®¡æ•°æ®ç›¸ç¬¦æ€§
     * @param api1102
     * @param exeDate
     */
    private void exeCount(Api1102 api1102, Date exeDate) {
        SH2023Api1115 sh2023Api1115 = new SH2023Api1115();
        //库区代码和名称
        sh2023Api1115.setKqdm(api1102.getKqdm());
        sh2023Api1115.setKqmc(api1102.getKqmc());
        //上级单位名称
        Api1101 api1101 = api1101Rep.findData(api1102.getKqdm().substring(0, 18));
        if(null != api1101){
            sh2023Api1115.setSjdwmc(api1101.getDwmc());
        }
        //仓房数,廒间数
        sh2023Api1115.setCfs(api1102.getCfs() + "");
        sh2023Api1115.setAjs(api1102.getAjs() + "");
        //货位数
        List<Api1105> api1105List = api1105Rep.findPushData(api1102.getKqdm());
        Double sum = 0.0;
        if(null != api1105List && api1105List.size() > 0){
            sh2023Api1115.setHws(api1105List.size() + "");
            for (Api1105 api1105 : api1105List) {
                List<Api1208> dataOne = api1208Rep.getDataOne(api1105.getHwdm(), exeDate);
                if(null != dataOne){
                    sum += dataOne.get(0).getJjsl();
                }
            }
        }
        //入库条数
        List<Api1202> api1202List = api1202Rep.getDataByYwrq(api1102.getKqdm(), DateUtil.getYearFirst(exeDate), exeDate);
        if(null != api1202List && api1202List.size() > 0){
            sh2023Api1115.setRkts(api1202List.size() + "");
        }
        //出库条数
        List<Api1205> api1205List = api1205Rep.getDataByYwrq(api1102.getKqdm(), DateUtil.getYearFirst(exeDate), exeDate);
        if(null != api1205List && api1205List.size() > 0){
            sh2023Api1115.setCkts(api1205List.size() + "");
        }
        //库存量
        sh2023Api1115.setKcsl(sum/1000 + "");
        //库存条数
        List<Api1208> api1208List = api1208Rep.findPushDataByTime(api1102.getKqdm(), DateUtil.getYearFirst(exeDate), exeDate);
        if(null != api1208List && api1208List.size() > 0){
            sh2023Api1115.setKcts(api1208List.size() + "");
        }
        sh2023Api1115.setSclqajs(api1102.getAjs() + "");
        sh2023Api1115.setSccntxajs(api1102.getAjs() + "");
        sh2023Api1115.setSjtjsj(exeDate);
        sh2023Api1115.setCzbz(Constant.CZBZ_I);
        sh2023Api1115.setZhgxsj(exeDate);
        shApi1115PR.saveData(sh2023Api1115);
    }
}
src/main/java/com/fzzy/api/view/repository/Api1202Rep.java
@@ -52,4 +52,14 @@
     */
    @Query("from Api1202 where hwdm=:hwdm and ywrq <=:keyTime order by ywrq desc")
    List<Api1202> getDataByHwdmAndTime(@Param("hwdm") String hwdm, @Param("keyTime") Date keyTime);
    /**
     * æ ¹æ®åº“区编码和业务日期查询
     * @param kqdm
     * @param start
     * @param end
     * @return
     */
    @Query("from Api1202 where kqdm=:kqdm and ywrq >=:start and ywrq <:end order by ywrq ")
    List<Api1202> getDataByYwrq(@Param("kqdm") String kqdm, @Param("start") Date start, @Param("end") Date end);
}
src/main/java/com/fzzy/api/view/repository/Api1205Rep.java
@@ -1,5 +1,6 @@
package com.fzzy.api.view.repository;
import com.fzzy.api.entity.Api1202;
import com.fzzy.api.entity.Api1205;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@@ -50,4 +51,14 @@
     */
    @Query("from Api1205 where hwdm=:hwdm and ywrq >=:keyTime order by ywrq asc ")
    List<Api1205> getDataByHwdmAndTime(@Param("hwdm") String hwdm, @Param("keyTime") Date keyTime);
    /**
     * æ ¹æ®åº“区编码和业务日期查询
     * @param kqdm
     * @param start
     * @param end
     * @return
     */
    @Query("from Api1205 where kqdm=:kqdm and ywrq >=:start and ywrq <:end order by ywrq ")
    List<Api1205> getDataByYwrq(@Param("kqdm") String kqdm, @Param("start") Date start, @Param("end") Date end);
}
src/main/java/com/fzzy/api/view/repository/Api1208Rep.java
@@ -36,4 +36,7 @@
     */
    @Query("from Api1208 where hwdm=:hwdm order by zhgxsj desc")
    List<Api1208> findDataByHwdm(@Param("hwdm") String hwdm);
    @Query("from Api1208 where hwdm=:hwdm and zhgxsj <=:end order by zhgxsj desc")
    List<Api1208> getDataOne(@Param("hwdm") String hwdm, @Param("end") Date end);
}
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1023.java
@@ -18,7 +18,6 @@
import com.fzzy.otherview.gd2022.dto.GdApi1023Way;
import com.fzzy.push.gd2022.ApiCodeConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync1302.java
@@ -184,7 +184,10 @@
                }
            }
        }
        return result.substring(1);
        if(result.length() > 0){
            result = result.substring(1);
        }
        return result;
    }
    /**
@@ -215,7 +218,10 @@
            }
        }
        return result.substring(1);
        if(result.length() > 0){
            result = result.substring(1);
        }
        return result;
    }
    /**
@@ -238,7 +244,10 @@
                }
            }
        }
        return result.substring(1);
        if(result.length() > 0){
            result = result.substring(1);
        }
        return result;
    }
    /**
@@ -269,6 +278,9 @@
            }
        }
        return result.substring(1);
        if(result.length() > 0){
            result = result.substring(1);
        }
        return result;
    }
}
src/main/java/com/fzzy/async/fzzy40/impl/Fzzy40Sync2104.java
@@ -7,22 +7,15 @@
import com.fzzy.api.service.ApiTriggerService;
import com.fzzy.api.utils.ContextUtil;
import com.fzzy.api.view.repository.*;
import com.fzzy.async.fzzy40.entity.Fz40InoutCustomer;
import com.fzzy.async.fzzy40.entity.Fz40InoutNoticeIn;
import com.fzzy.async.fzzy40.entity.Fz40InoutRecord;
import com.fzzy.async.fzzy40.repository.Fzzy40Sync1202Rep;
import com.fzzy.async.fzzy40.repository.Fzzy40Sync1212Rep;
import com.fzzy.async.fzzy40.repository.Fzzy40SyncNoticeInRep;
import com.fzzy.push.sh2023.SH2023Constant;
import com.fzzy.push.sh2023.dto.SH2023Api2104;
import com.fzzy.push.sh2023.dto.ShAreaBjw;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
src/main/java/com/fzzy/otherview/sh2023/ShApi1115.view.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,497 @@
<?xml version="1.0" encoding="UTF-8"?>
<ViewConfig>
  <Arguments/>
  <Context/>
  <Model>
    <DataType name="dtMain">
      <Property name="creationType">com.fzzy.push.sh2023.dto.SH2023Api1115</Property>
      <PropertyDef name="kqdm">
        <Property></Property>
        <Property name="label">库区代码</Property>
      </PropertyDef>
      <PropertyDef name="kqmc">
        <Property></Property>
        <Property name="label">库区名称</Property>
      </PropertyDef>
      <PropertyDef name="sjdwmc">
        <Property></Property>
        <Property name="label">上级单位名称</Property>
      </PropertyDef>
      <PropertyDef name="cfs">
        <Property></Property>
        <Property name="label">仓房数</Property>
      </PropertyDef>
      <PropertyDef name="ajs">
        <Property></Property>
        <Property name="label">廒间数</Property>
      </PropertyDef>
      <PropertyDef name="hws">
        <Property></Property>
        <Property name="label">货位数</Property>
      </PropertyDef>
      <PropertyDef name="rkts">
        <Property></Property>
        <Property name="label">入库检斤条数</Property>
      </PropertyDef>
      <PropertyDef name="ckts">
        <Property></Property>
        <Property name="label">出库检斤条数</Property>
      </PropertyDef>
      <PropertyDef name="kcsl">
        <Property></Property>
        <Property name="label">库存数量(吨)</Property>
      </PropertyDef>
      <PropertyDef name="kcts">
        <Property></Property>
        <Property name="label">库存条数</Property>
      </PropertyDef>
      <PropertyDef name="sclqajs">
        <Property></Property>
        <Property name="label">上传粮情廒间数</Property>
      </PropertyDef>
      <PropertyDef name="sccntxajs">
        <Property></Property>
        <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="zhgxsj">
        <Property name="dataType">DateTime</Property>
        <Property name="label">最后更新时间</Property>
      </PropertyDef>
      <PropertyDef name="sjtjsj">
        <Property name="dataType">DateTime</Property>
        <Property name="label">数据统计时间</Property>
      </PropertyDef>
      <PropertyDef name="czbz">
        <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>
    <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">sHApi1115PR#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="kqmc">
        <Property name="property">kqmc</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="kqdm">
        <Property name="property">kqdm</Property>
        <Property name="width">200</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="sjdwmc">
        <Property name="property">sjdwmc</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="cfs">
        <Property name="property">cfs</Property>
        <Property name="width">60</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="ajs">
        <Property name="property">ajs</Property>
        <Property name="width">60</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="hws">
        <Property name="property">hws</Property>
        <Property name="width">60</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="rkts">
        <Property name="property">rkts</Property>
        <Property name="width">100</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="ckts">
        <Property name="property">ckts</Property>
        <Property name="width">100</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="kcsl">
        <Property name="property">kcsl</Property>
        <Property name="width">100</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="kcts">
        <Property name="property">kcts</Property>
        <Property name="width">80</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="sjtjsj">
        <Property name="property">sjtjsj</Property>
        <Property name="width">160</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="czbz">
        <Property name="property">czbz</Property>
        <Property name="width">70</Property>
        <Property name="align">center</Property>
      </DataColumn>
      <DataColumn name="zhgxsj">
        <Property name="property">zhgxsj</Property>
        <Property name="width">160</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" layout="regionPadding:5">
      <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>
        <FieldSet layout="regionPadding:5">
          <Property name="caption">基本信息</Property>
          <Buttons/>
          <Children>
            <AutoForm>
              <Property name="dataSet">dsMain</Property>
              <Property name="cols">*,*,*</Property>
              <Property name="labelWidth">160</Property>
              <Property name="labelAlign">left</Property>
              <Property name="labelSeparator">:</Property>
              <Property name="labelPosition">left</Property>
              <AutoFormElement>
                <Property name="name">kqdm</Property>
                <Property name="property">kqdm</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">kqmc</Property>
                <Property name="property">kqmc</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sjdwmc</Property>
                <Property name="property">sjdwmc</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">cfs</Property>
                <Property name="property">cfs</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ajs</Property>
                <Property name="property">ajs</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">hws</Property>
                <Property name="property">hws</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">rkts</Property>
                <Property name="property">rkts</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">ckts</Property>
                <Property name="property">ckts</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">kcsl</Property>
                <Property name="property">kcsl</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">kcts</Property>
                <Property name="property">kcts</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sclqajs</Property>
                <Property name="property">sclqajs</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sccntxajs</Property>
                <Property name="property">sccntxajs</Property>
                <Editor/>
              </AutoFormElement>
              <AutoFormElement>
                <Property name="name">sjtjsj</Property>
                <Property name="property">sjtjsj</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>
              <AutoFormElement>
                <Property name="name">bjw</Property>
                <Property name="property">bjw</Property>
                <Editor/>
              </AutoFormElement>
            </AutoForm>
          </Children>
        </FieldSet>
      </Children>
      <Tools/>
    </Dialog>
    <UpdateAction id="updateSave">
      <Property name="dataResolver">sHApi1115PR#saveData</Property>
      <UpdateItem>
        <Property name="dataPath">[#current]</Property>
        <Property name="dataSet">dsMain</Property>
      </UpdateItem>
    </UpdateAction>
    <AjaxAction id="ajaxPush">
      <Property name="service">sHApi1115PR#pushData</Property>
      <Property name="confirmMessage">确定要上报么?</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDel">
      <Property name="service">sHApi1115PR#delData</Property>
      <Property name="confirmMessage">当前数据删除后无法恢复,请确认要删除么?</Property>
    </AjaxAction>
    <AjaxAction id="ajaxDelUpdate">
      <Property name="service">sHApi1115PR#delUpdate</Property>
      <Property name="confirmMessage">确定要将数据标记为删除么?</Property>
    </AjaxAction>
  </View>
</ViewConfig>
src/main/java/com/fzzy/otherview/sh2023/ShApi2103.view.xml
@@ -122,7 +122,7 @@
        </Property>
      </PropertyDef>
      <PropertyDef name="zhgxsj">
        <Property name="dataType">Date</Property>
        <Property name="dataType">DateTime</Property>
        <Property name="label">最后更新时间</Property>
      </PropertyDef>
      <PropertyDef name="czbz">
src/main/java/com/fzzy/otherview/sh2023/pr/SHApi1115PR.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,193 @@
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.SH2023Api1115;
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;
/**
 * @Description ä¸Šæµ·å¸‚接口-1115 æ•°æ®ç›¸ç¬¦æ€§
 * @Author CZT
 * @Date 2024/6/28 15:55
 */
@Component(value = "sHApi1115PR")
public class SHApi1115PR {
    @Autowired
    private ApiInfoDataRep apiInfoDataRep;
    @Autowired
    private ApiCommonService apiCommonService;
    @Autowired
    private ApiPushManager apiPushManager;
    /**
     * èŽ·å–ä¿¡æ¯
     * sHApi1115PR#listData
     *
     * @return
     */
    @DataProvider
    public void listData(Page<SH2023Api1115> 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_1115);
                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<SH2023Api1115> list = new ArrayList<>();
        SH2023Api1115 SH2023Api1115;
        for (ApiInfoData infoData : japPage.getContent()) {
            SH2023Api1115 = JSONObject.parseObject(infoData.getData(), SH2023Api1115.class);
            list.add(SH2023Api1115);
        }
        page.setEntities(list);
    }
    /**
     * sHApi1115PR#saveData
     */
    @DataResolver
    public void saveData(SH2023Api1115 data) {
        ApiInfoData infoData = new ApiInfoData();
        infoData.setId(data.getKqdm() + DateFormatUtils.format(data.getSjtjsj(), "yyyyMMddHHmmss"));
        infoData.setKqdm(data.getKqdm());
        infoData.setInteId(SH2023Constant.SH_2023_API_CODE_1115);
        infoData.setUpdateTime(new Date());
        infoData.setDataId(infoData.getId());
        infoData.setData(JSON.toJSONString(data));
        infoData.setCzbz(data.getCzbz());
        infoData.setRemarks("备注信息");
        apiInfoDataRep.save(infoData);
    }
    /**
     * sHApi1115PR#delData
     */
    @Expose
    public void delData(SH2023Api1115 data) {
        apiInfoDataRep.deleteById(data.getKqdm() + DateFormatUtils.format(data.getSjtjsj(), "yyyyMMddHHmmss"));
    }
    /**
     * sHApi1115PR#delUpdate
     */
    @Expose
    public String delUpdate(SH2023Api1115 entity) {
        if (null == entity) {
            return "无数据执行";
        }
        apiInfoDataRep.updateStatus(entity.getKqdm() + DateFormatUtils.format(entity.getSjtjsj(), "yyyyMMddHHmmss"), JSON.toJSONString(entity), Constant.CZBZ_D);
        return null;
    }
    @Expose
    public String pushData(List<SH2023Api1115> items) {
        String result = "";
        String kqdm = items.get(0).getKqdm();
        ApiConfs apiConf = apiCommonService.getConf(kqdm);
        if (null == apiConf) {
            return "系统没有获取到当前库区配置信息,执行失败";
        }
        //封装参数
        ApiParam param = new ApiParam(apiConf, Constant.API_CATEGORY_11, SH2023Constant.SH_2023_API_CODE_1115);
        //获取实现接口
        ApiRemoteService apiService = apiPushManager.getApiRemoteService(param.getPushProtocol());
        if (null == apiService) {
            return "系统没有当前推送协议配置,执行失败";
        }
        ResponseDto responseDto;
        ApiInfoData infoData;
        for (SH2023Api1115 data : items) {
            responseDto = apiService.pushData(param, apiConf, data);
            if (responseDto.getSuccess() == 0) {
                if (Constant.CZBZ_I.equals(data.getCzbz())) {
                    infoData = new ApiInfoData();
                    infoData.setId(data.getKqdm() + DateFormatUtils.format(data.getSjtjsj(), "yyyyMMddHHmmss"));
                    infoData.setKqdm(data.getKqdm());
                    infoData.setInteType("11");
                    infoData.setInteId(SH2023Constant.SH_2023_API_CODE_1115);
                    infoData.setUpdateTime(new Date());
                    infoData.setDataId(infoData.getId());
                    infoData.setCzbz(Constant.CZBZ_U);
                    data.setCzbz(Constant.CZBZ_U);
                    infoData.setData(JSON.toJSONString(data));
                    apiInfoDataRep.save(infoData);
                }
            }
            result += responseDto.toString();
        }
        return result;
    }
}
src/main/java/com/fzzy/otherview/sh2023/pr/SHApi2103PR.java
@@ -130,7 +130,7 @@
        infoData.setUpdateTime(new Date());
        infoData.setDataId(data.getHwdm());
        infoData.setData(JSON.toJSONString(data));
        infoData.setCzbz(Constant.CZBZ_I);
        infoData.setCzbz(data.getCzbz());
        infoData.setRemarks("备注信息");
        apiInfoDataRep.save(infoData);
src/main/java/com/fzzy/push/impl/ComPushService99.java
@@ -1,5 +1,6 @@
package com.fzzy.push.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.fzzy.api.Constant;
import com.fzzy.api.data.ApiParam;
@@ -8,6 +9,7 @@
import com.fzzy.api.service.ApiRemoteService;
import com.fzzy.api.view.repository.ApiInfoDataRep;
import com.fzzy.push.sh2023.SH2023Constant;
import com.fzzy.push.sh2023.dto.SH2023Api1115;
import com.fzzy.push.sh2023.dto.SH2023Api1311;
import com.fzzy.push.sh2023.dto.SH2023Api2103;
import lombok.extern.slf4j.Slf4j;
@@ -29,6 +31,38 @@
    /*==========上海市平台定制接口==========*/
    /**
     * 1311 è§†é¢‘监控接口--上海市平台
     */
    public void pushData1115(ApiRemoteService apiRemoteService, ApiParam param) {
        // èŽ·å– è§†é¢‘监控接口数据
        List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_1115);
        if (null == items || items.isEmpty()) {
            log.error("-----上海市平台2023版:未获取到数据相符性,不推送-----");
            return;
        }
        param.setInteCategory(Constant.API_CATEGORY_11);
        param.setInteId(SH2023Constant.SH_2023_API_CODE_1115);
        SH2023Api1115 shApi1115;
        ResponseDto responseDto;
        for (ApiInfoData infoData : items) {
            shApi1115 = JSONObject.parseObject(infoData.getData(), SH2023Api1115.class);
            shApi1115.setZhgxsj(infoData.getUpdateTime());
            param.setBizId(infoData.getDataId());
            responseDto = apiRemoteService.pushData(param, shApi1115);
            if (responseDto.getSuccess() == 0) {
                if (Constant.CZBZ_I.equals(infoData.getCzbz())) {
                    infoData.setCzbz(Constant.CZBZ_U);
                    shApi1115.setCzbz(Constant.CZBZ_U);
                    infoData.setData(JSON.toJSONString(shApi1115));
                    apiInfoDataRep.save(infoData);
                }
            }
        }
    }
    /**
     * 2101 æ£€æ–¤å•--上海市平台
     */
    public void pushData2101(ApiRemoteService apiRemoteService, ApiParam param) {
src/main/java/com/fzzy/push/sh2023/SH2023ApiRemoteService.java
@@ -449,6 +449,15 @@
            changeObject(api1113);
            return api1113;
        }
        //数据相符性接口
        if (SH2023Constant.SH_2023_API_CODE_1115.equals(inteId)) {
            SH2023Api1115 api1115 = new SH2023Api1115();
            BeanUtils.copyProperties(data, api1115);
            api1115.setBjw(ShAreaBjw.getBjw(code));
            //设置空属性为默认值
            changeObject(api1115);
            return api1115;
        }
        if (SH2023Constant.SH_2023_API_CODE_1201.equals(inteId)) {
            SH2023Api1201 api1201 = new SH2023Api1201();
            BeanUtils.copyProperties(data, api1201);
src/main/java/com/fzzy/push/sh2023/SH2023Constant.java
@@ -66,6 +66,10 @@
    public static String SH_2023_API_CODE_1114_1503 = "1503";
    /**
     * æŽ¥å£ç¼–码-1115 æ•°æ®ç›¸ç¬¦æ€§æ•°æ®æŽ¥å£
     */
    public static String SH_2023_API_CODE_1115 = "1115";
    /**
     * æŽ¥å£ç¼–码-1201 åˆåŒä¿¡æ¯æ•°æ®æŽ¥å£
     */
    public static String SH_2023_API_CODE_1201 = "1201";
src/main/java/com/fzzy/push/sh2023/SH2023OrderServiceImpl.java
@@ -127,6 +127,9 @@
            case "1114":
                pushService11.pushData1114(apiRemoteService, param);
                break;
            case "1115":
                pushService99.pushData1115(apiRemoteService, param);
                break;
            case "1201":
                pushService12.pushData1201(apiRemoteService, param);
                break;
src/main/java/com/fzzy/push/sh2023/SH2023PushService11.java
@@ -4,6 +4,7 @@
import com.fzzy.api.data.PushProtocol;
import com.fzzy.api.service.PushService11;
import com.fzzy.push.impl.ComPushService11;
import com.fzzy.push.impl.ComPushService99;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -22,7 +23,8 @@
    private SH2023ApiRemoteService apiRemoteService;
    @Autowired
    private ComPushService11 pushService11;
    @Autowired
    private ComPushService99 pushService99;
    @Override
    public String getProtocol() {
        return PushProtocol.SB_SH_2023.getCode();
@@ -63,6 +65,7 @@
        //财务报表数据推送
        pushService11.pushData1114(apiRemoteService, param);
        pushService99.pushData1115(apiRemoteService, param);
        log.info("------->>>>基础信息 æŽ¥å£æ¨¡å—上报结束");
    }
src/main/java/com/fzzy/push/sh2023/dto/SH2023Api1115.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,69 @@
package com.fzzy.push.sh2023.dto;
import com.alibaba.fastjson.annotation.JSONField;
import com.bstek.dorado.annotation.PropertyDef;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @Description æ•°æ®ç›¸ç¬¦æ€§æŽ¥å£
 * @Author CZT
 * @Date 2024/6/28 15:35
 */
@Data
public class SH2023Api1115 implements Serializable {
    private static final long serialVersionUID = 9157617424050247565L;
    @PropertyDef(label = "库区代码")
    private String kqdm;
    @PropertyDef(label = "库区名称" )
    private String kqmc;
    @PropertyDef(label = "上级单位名称")
    private String sjdwmc;
    @PropertyDef(label = "仓房数")
    private String cfs;
    @PropertyDef(label = "廒间数")
    private String ajs;
    @PropertyDef(label = "货位数")
    private String hws;
    @PropertyDef(label = "入库检斤条数")
    private String rkts;
    @PropertyDef(label = "出库检斤条数")
    private String ckts;
    @PropertyDef(label = "库存数量")
    private String kcsl;
    @PropertyDef(label = "库存条数")
    private String kcts;
    @PropertyDef(label = "上传粮情廒间数")
    private String sclqajs;
    @PropertyDef(label = "上传仓内图像廒间数")
    private String sccntxajs;
    @PropertyDef(label = "数据统计时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date sjtjsj;
    @PropertyDef(label = "操作标志")
    private String czbz;
    @PropertyDef(label = "最后更新时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date zhgxsj;
    @PropertyDef(label = "标记位")
    private String bjw;
}
src/main/resources/templates/home/home.html
@@ -300,13 +300,16 @@
                                <a lay-href="com.fzzy.otherview.gd2022.GdApi1023.d">广东-熏蒸备案</a>
                            </dd>
                            <dd>
                                <a lay-href="com.fzzy.otherview.sh2023.ShApi1115.d">上海-数据相符性</a>
                            </dd>
                            <dd>
                                <a lay-href="com.fzzy.otherview.sh2023.ShApi1311.d">上海-视频监控信息</a>
                            </dd>
                            <dd>
                                <a lay-href="com.fzzy.otherview.sh2023.ShApi2101.d">上海-检斤单</a>
                            </dd>
                            <dd>
                                <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>