Browse Source

同步数据条数

wangzhe 2 years ago
parent
commit
b603536508

+ 8 - 0
mybusiness/src/main/java/com/sooka/system/domain/TUInterfaceinfo.java

@@ -7,6 +7,8 @@ import lombok.Setter;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 import org.apache.commons.lang3.builder.ToStringStyle;
 
+import java.util.Date;
+
 
 /**
  * 【请填写功能名称】对象 t_u_interfaceinfo
@@ -43,6 +45,12 @@ public class TUInterfaceinfo extends BaseEntity
     /** 接口名称对应表名 */
     private String tableName;
 
+    /** 数据量刷新时间 */
+    private Date refreshTime;
+
+    /** 是否需要刷新数据量(1.需要,2.不需要) */
+    private String needRefresh;
+
     /** 接口名称 */
     @Excel(name = "接口名称")
     private String interfaceName;

+ 7 - 2
mybusiness/src/main/java/com/sooka/system/service/impl/TUInterfaceinfoServiceImpl.java

@@ -196,8 +196,11 @@ public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
     @Override
     public void refreshData(){
         //(164-57) t_guiji_gas_zenner_gas_purchase_center_infor - 归集-市燃气(真兰收费系统)-中心计费购气信息 - 467184 ms total:[12746163]
-        //t_guiji_gas_zenner_meter_reading_infor
-        List<TUInterfaceinfo> tuInterfaceinfoList = tUInterfaceinfoMapper.selectTUInterfaceinfoList(new TUInterfaceinfo());
+        //(123-29) t_guiji_gas_zenner_meter_reading_infor - 归集-市燃气(真兰收费系统)-抄表信息 - 324043 ms total:[12703733]
+        //t_guiji_naturalresources_bdcdjxx - 归集-市自然资源(不动产)-个人基本信息 - updating database... id = 672238a3-3687-433c-888e-5db0c81eb8a8
+        TUInterfaceinfo param = new TUInterfaceinfo();
+        param.setNeedRefresh("1");
+        List<TUInterfaceinfo> tuInterfaceinfoList = tUInterfaceinfoMapper.selectTUInterfaceinfoList(param);
         for (int i = 0; i < tuInterfaceinfoList.size(); i++) {
             TUInterfaceinfo tuInterfaceinfo = tuInterfaceinfoList.get(i);
             String tableName = tuInterfaceinfo.getTableName();
@@ -212,6 +215,8 @@ public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
             Long interval = new Date().getTime() - dateBegin.getTime();//接口查询总数所用时间
             System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + interval + " ms total:[" + result.getCallsuccnum() + "]");
             tuInterfaceinfo.setCallsuccnum(result.getCallsuccnum());
+            tuInterfaceinfo.setRefreshTime(new Date());
+            tuInterfaceinfo.setNeedRefresh("2");
             tUInterfaceinfoMapper.updateInterfaceCallsuccnum(tuInterfaceinfo);
             //update t_u_interfaceinfo set callsuccnum = #{callsuccnum} where id = #{id}
         }

+ 2 - 1
mybusiness/src/main/resources/mapper/system/TUInterfaceinfoMapper.xml

@@ -48,6 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="deptId != null  and deptId != ''"> and dept_id = #{deptId}</if>
             <if test="status != null  and status != ''"> and status = #{status}</if>
             <if test="interfaceName != null  and interfaceName != ''"> and interface_name like concat('%', #{interfaceName}, '%')</if>
+            <if test="needRefresh != null  and needRefresh != ''"> and need_refresh = #{needRefresh}</if>
             <if test="infoItem != null  and infoItem != ''"> and info_item = #{infoItem}</if>
             <if test="usageScenarios != null  and usageScenarios != ''"> and usage_scenarios = #{usageScenarios}</if>
             <if test="shareType != null  and shareType != ''"> and share_type = #{shareType}</if>
@@ -213,7 +214,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <update id="updateInterfaceCallsuccnum" parameterType="TUInterfaceinfo">
-        update t_u_interfaceinfo set callsuccnum = #{callsuccnum} where id = #{id}
+        update t_u_interfaceinfo set refresh_time = #{refreshTime}, need_refresh = #{needRefresh}, callsuccnum = #{callsuccnum} where id = #{id}
     </update>
 
     <update id="updateDataNum" parameterType="TUInterfaceinfo">