liuhaonan 1 год назад
Родитель
Сommit
e0c6fad25e

+ 4 - 3
mybusiness/src/main/java/com/business/controller/VisualizationController.java

@@ -73,6 +73,7 @@ public class VisualizationController extends BaseController {
         /**查询接口数量**/
         TUInterfaceinfo shareCount = interfaceinfoService.getShareCountByDeptId(id.toString());
         /**部门归集数据量**/
+//        Long guijiCount = interfaceinfoService.getGuijiCountByDeptId(id.toString());
         Long guijiCount = interfaceinfoService.getGuijiCountByDeptId(id.toString());
         String guijiCountResult = guijiCount!=null?guijiCount.toString():"0";
         mmap.put("deptId",sysDept.getDeptId());
@@ -120,7 +121,7 @@ public class VisualizationController extends BaseController {
     @ResponseBody
     public JSONObject refreshData(){
         JSONObject jsonObject = new JSONObject();
-        interfaceinfoService.refreshData();
+//        interfaceinfoService.refreshData();
         jsonObject.put("data", "well done");
         return jsonObject;
     }
@@ -132,8 +133,8 @@ public class VisualizationController extends BaseController {
     @ResponseBody
     public JSONObject imputationData(){
         JSONObject jsonObject = new JSONObject();
-//        interfaceinfoService.imputationData();
-        interfaceinfoService.imputationDataByMonth();
+////        interfaceinfoService.imputationData();
+//        interfaceinfoService.imputationDataByMonth();
         jsonObject.put("data", "well done");
         return jsonObject;
     }

+ 2 - 2
mybusiness/src/main/java/com/business/domain/ImputationData.java

@@ -23,8 +23,8 @@ public class ImputationData extends BaseEntity
     /** 当月数量 */
     private String count;
 
-    /** 表名 */
-    private String tableName;
+    /** 接口id */
+    private String interfaceId;
 
     /** 接口名称 */
     private String interfaceName;

+ 3 - 1
mybusiness/src/main/java/com/sooka/apply/service/impl/IntRecordServiceImpl.java

@@ -20,6 +20,8 @@ import com.sooka.apply.mapper.IntRecordMapper;
 import com.sooka.apply.domain.IntRecord;
 import com.sooka.apply.service.IIntRecordService;
 
+import javax.annotation.Resource;
+
 /**
  * 申请记录Service业务层处理
  *
@@ -29,7 +31,7 @@ import com.sooka.apply.service.IIntRecordService;
 @Service
 public class IntRecordServiceImpl implements IIntRecordService
 {
-    @Autowired
+    @Resource
     private IntRecordMapper intRecordMapper;
 
     /**

+ 1 - 1
mybusiness/src/main/java/com/sooka/system/mapper/TUInterfaceinfoMapper.java

@@ -232,7 +232,7 @@ public interface TUInterfaceinfoMapper
      * */
     public TUInterfaceinfo getShareCountByDeptId(@Param("deptId") String deptId);
 
-    public void getGuijiCountByDeptId(Map map);
+    public Long getGuijiCountByDeptId(String deptId);
 
     /**
      * 接口调用频次

+ 0 - 15
mybusiness/src/main/java/com/sooka/system/service/ITUInterfaceinfoService.java

@@ -71,21 +71,6 @@ public interface ITUInterfaceinfoService
     public int deleteTUInterfaceinfoById(String id);
 
     /**
-     * 刷新数据
-     */
-    public void refreshData();
-
-    /**
-     * 刷新归集数据分析
-     */
-    public void imputationData();
-
-    /**
-     * 按月刷新归集数据分析
-     */
-    public void imputationDataByMonth();
-
-    /**
      * 查询接口数量
      * @return 结果
      */

+ 1 - 188
mybusiness/src/main/java/com/sooka/system/service/impl/TUInterfaceinfoServiceImpl.java

@@ -198,148 +198,6 @@ public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
     /**
      * 刷新数据
      */
-    @Override
-    public void refreshData(){
-        //(164-57) t_guiji_gas_zenner_gas_purchase_center_infor - 归集-市燃气(真兰收费系统)-中心计费购气信息 - 467184 ms total:[12746163]
-        //(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();
-            if(tableName == null || tableName.equals("")){
-                System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + 0 + " ms");
-                continue;
-            }
-            System.out.println(tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + "updating database... id = " + tuInterfaceinfo.getId());
-            //select count(id) callsuccnum from ${tableName}
-            Date dateBegin = new Date();
-            TUInterfaceinfo result = tUInterfaceinfoMapper.selectCountByTableName(tuInterfaceinfo);
-            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}
-        }
-    }
-
-    /**
-     * 刷新归集数据分析
-     */
-    @Override
-    public void imputationData(){
-        String year = "2022";
-        TUInterfaceinfo param = new TUInterfaceinfo();
-//        param.setNeedRefresh("1");
-        //(164-57) t_guiji_gas_zenner_gas_purchase_center_infor - 归集-市燃气(真兰收费系统)-中心计费购气信息 - 237962 ms
-        //(164-70) t_guiji_gas_zenner_meter_reading_infor - 归集-市燃气(真兰收费系统)-抄表信息 - 352968 ms
-        List<TUInterfaceinfo> tuInterfaceinfoList = tUInterfaceinfoMapper.selectTUInterfaceinfoList(param);
-        for (int i = 0; i < tuInterfaceinfoList.size(); i++) {
-            TUInterfaceinfo tuInterfaceinfo = tuInterfaceinfoList.get(i);
-            String tableName = tuInterfaceinfo.getTableName();
-            if (tableName == null || tableName.equals("") || tableName.equals("t_u_interfaceinfo_emptytable")) {
-                System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + 0 + " ms");
-                continue;
-            }
-            ImputationData imputationDataParam = new ImputationData();
-            imputationDataParam.setYear(year);
-            imputationDataParam.setTableName(tableName);
-            boolean isExist = !(imputationDataMapper.selectImputationInterface(imputationDataParam).size() == 0);
-            if(isExist){
-                continue;
-            }
-            Map map = new HashMap();
-            map.put("year", year);
-            map.put("tableName", tableName);
-            System.out.println(tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + "updating database... id = " + tuInterfaceinfo.getId());
-            Date dateBegin = new Date();
-            ImputationData imputationData = tUInterfaceinfoMapper.imputationData(map);
-            Long interval = new Date().getTime() - dateBegin.getTime();//接口查询总数所用时间
-            ImputationData imputationDataInsert = new ImputationData();
-            imputationDataInsert.setYear(year);
-            imputationDataInsert.setTableName(tableName);
-            imputationDataInsert.setInterfaceName(tuInterfaceinfo.getInterfaceName());
-            imputationDataInsert.setJan(imputationData.getJan());
-            imputationDataInsert.setFeb(imputationData.getFeb());
-            imputationDataInsert.setMar(imputationData.getMar());
-            imputationDataInsert.setApr(imputationData.getApr());
-            imputationDataInsert.setMay(imputationData.getMay());
-            imputationDataInsert.setJun(imputationData.getJun());
-            imputationDataInsert.setJul(imputationData.getJul());
-            imputationDataInsert.setAug(imputationData.getAug());
-            imputationDataInsert.setSep(imputationData.getSep());
-            imputationDataInsert.setOct(imputationData.getOct());
-            imputationDataInsert.setNov(imputationData.getNov());
-            imputationDataInsert.setDecb(imputationData.getDecb());
-            imputationDataMapper.insertImputationInterface(imputationDataInsert);
-            System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + interval + " ms");
-        }
-    }
-
-    /**
-     * 按月刷新归集数据分析
-     */
-    @Override
-    public void imputationDataByMonth(){
-        String year = new SimpleDateFormat("yyyy").format(new Date());//String year = "2022";
-        String month = new SimpleDateFormat("M").format(new Date());
-        TUInterfaceinfo param = new TUInterfaceinfo();
-        param.setShareType("share_type_2");//市归集
-//        param.setNeedRefresh("1");
-        //(164-57) t_guiji_gas_zenner_gas_purchase_center_infor - 归集-市燃气(真兰收费系统)-中心计费购气信息 - 237962 ms
-        //(164-70) t_guiji_gas_zenner_meter_reading_infor - 归集-市燃气(真兰收费系统)-抄表信息 - 352968 ms
-        //t_guiji_naturalresources_qlrjbxx - 归集-市自然资源(不动产)-权利人基本信息 - updating database... id = 1de6752d-19c2-4010-9b61-9450a9d718b6
-        List<TUInterfaceinfo> tuInterfaceinfoList = tUInterfaceinfoMapper.selectTUInterfaceinfoList(param);
-        for (int i = 0; i < tuInterfaceinfoList.size(); i++) {
-            TUInterfaceinfo tuInterfaceinfo = tuInterfaceinfoList.get(i);
-            String tableName = tuInterfaceinfo.getTableName();
-            if (tableName == null || tableName.equals("") || tableName.equals("t_u_interfaceinfo_emptytable")) {
-                System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + 0 + " ms");
-                continue;
-            }
-            ImputationData imputationDataParam = new ImputationData();
-            imputationDataParam.setYear(year);
-            imputationDataParam.setTableName(tableName);
-            boolean isExist = !(imputationDataMapper.selectImputationInterface(imputationDataParam).size() == 0);
-            if(!isExist){
-                continue;
-            }
-            Map map = new HashMap();
-            map.put("year", year);
-            map.put("month", month);
-            map.put("tableName", tableName);
-            System.out.println(tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + "updating database... id = " + tuInterfaceinfo.getId());
-            Map column = new HashMap();
-            column.put("tableSchema", tableName.contains("\\.") ? tableName.split("\\.")[0] : "thsjzt");//thgjj / thsjzt
-            column.put("tableName", tableName.contains("\\.") ? tableName.split("\\.")[1] : tableName);//thgjj.tgjj_gtjkrxx / t_guiji_gas_zenner_meter_reading_infor
-            column.put("columnName", "create_time");//create_time / LAST_UPDATE_TIME
-            System.out.println(column.get("tableSchema"));
-            System.out.println(column.get("tableName"));
-            System.out.println(column.get("columnName"));
-            List<Object> objectList = tUInterfaceinfoMapper.checkColumnExists(column);
-            System.out.println(objectList.size() + "=object");
-            Date dateBegin = new Date();
-            ImputationData imputationData;
-            if(objectList.size() != 0){
-                imputationData = tUInterfaceinfoMapper.imputationDataByMonth(map);
-            }else {
-                imputationData = tUInterfaceinfoMapper.imputationDataByMonthLastUpdateTime(map);
-            }
-            Long interval = new Date().getTime() - dateBegin.getTime();//接口查询总数所用时间
-            ImputationData imputationDataInsert = new ImputationData();
-            imputationDataInsert.setYear(year);
-            imputationDataInsert.setMonth(month);
-            imputationDataInsert.setTableName(tableName);
-//            imputationDataInsert.setInterfaceName(tuInterfaceinfo.getInterfaceName());//接口名称可能会变
-            imputationDataInsert.setCount(imputationData.getCount());
-            imputationDataMapper.updateImputationInterfaceByYearMonthTableName(imputationDataInsert);
-            System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + interval + " ms");
-        }
-    }
 
     /**
      * 查询接口数量
@@ -458,52 +316,7 @@ public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
 
     @Override
     public Long getGuijiCountByDeptId(String deptId){
-        new Thread() {
-            public void run() {
-                try{
-                    TUInterfaceinfo tuInterfaceinfo = new TUInterfaceinfo();
-                    tuInterfaceinfo.setDeptId(deptId);
-                    tuInterfaceinfo.setStatus("0");//状态(0可用,2禁用)
-                    tuInterfaceinfo.setShareType("share_type_2");//数据来源 只统计市归集类型接口对应表中数据条数综合
-                    /*
-                    t_guiji_gas_zenner_gas_purchase_center_infor 真兰中心计费信息
-                     */
-                    List<TUInterfaceinfo> tuInterfaceinfoList = tUInterfaceinfoMapper.selectTUInterfaceinfoDataNumList(tuInterfaceinfo);
-                    for (int i = 0; i < tuInterfaceinfoList.size(); i ++) {
-                        TUInterfaceinfo interfaceinfo = tuInterfaceinfoList.get(i);
-                        boolean uninitialized = interfaceinfo.getUpdateTime() == null;//未初始化
-                        boolean oldData =  interfaceinfo.getUpdateTime() != null && new Date().getTime() - interfaceinfo.getUpdateTime().getTime() > 10 * 60 * 1000;//最多10分钟刷新一次最新数据
-                        boolean isValid = interfaceinfo.getStatus().equals("0");//有效数据
-                        if(uninitialized || (oldData && isValid)){
-                            interfaceinfo.setUpdateTime(new Date());
-                            Date dateBegin = new Date();
-                            tUInterfaceinfoMapper.updateTUInterfaceinfoDataNum(interfaceinfo);//更新更新时间 防止多次操作
-                            System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + interfaceinfo.getInterfaceName() + "更新更新时间 防止多次操作");
-                            tUInterfaceinfoMapper.updateDataNum(interfaceinfo);//更新更新时间为最新的以及数据条数
-                            Long interval = new Date().getTime() - dateBegin.getTime();//接口查询总数所用时间
-                            System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + interfaceinfo.getTableName() + " - " + interfaceinfo.getInterfaceName() + " - " + interval + " ms");
-                            // update t_u_interfaceinfo_datanum set datanum = 0, update_time = null 重置数据总数重新查询 使用updateTime控制min分钟内只能查询一次
-                            // select count(*) from t_guiji_gas_zenner_gas_purchase_center_infor - 归集-真兰收费系统-中心计费购气信息 12452820
-                            // (17-4) t_guiji_gas_zenner_gas_purchase_center_infor - 归集-真兰收费系统-中心计费购气信息 - 32424 ms
-                            // (17-5) t_guiji_gas_zenner_meter_reading_infor - 归集-真兰收费系统-抄表信息 - 222659 ms
-                            /*
-                            update t_u_interfaceinfo_datanum set datanum = 0, update_time = null;
-                            update t_u_interfaceinfo_datanum set status = 2 where table_name = 't_guiji_gas_zenner_gas_purchase_center_infor'; -- 12489514 17ms
-                            update t_u_interfaceinfo_datanum set status = 2 where table_name = 't_guiji_gas_zenner_meter_reading_infor'; -- 12389252 23ms
-                             */
-                            // 燃气 25010409 26114283
-                        }
-                    }
-                    System.out.println((tuInterfaceinfoList.size()>0?tuInterfaceinfoList.get(0).getDeptName():deptId)+": 查询接口数据结束,共" + tuInterfaceinfoList.size() + "个接口");
-                }catch (Exception e){
-                    e.printStackTrace();
-                }
-            }
-        }.start();
-        Map<String, Object> param = new HashMap<>();
-        param.put("deptId", deptId);
-        tUInterfaceinfoMapper.getGuijiCountByDeptId(param);
-        return Long.valueOf(String.valueOf(param.get("count"))).longValue();
+        return tUInterfaceinfoMapper.getGuijiCountByDeptId(deptId);
     }
 
     /**

+ 0 - 161
mybusiness/src/main/java/com/util/StaticScheduleTask.java

@@ -41,167 +41,6 @@ public class StaticScheduleTask {
     @Resource
     private ImputationDataMapper imputationDataMapper;
 
-    /**添加定时任务 每天凌晨1点**/
-    /**
-     * 刷新归集数据分析 更新当月数据
-     */
-    @Scheduled(cron = "0 0 1 * * ?")
-    private void imputationData() {
-        System.out.println("按照年份每年新增一批新数据");
-        imputationDataByYear();//按照年份每年新增一批新数据
-        System.out.println("按照月份每日更新当月数据");
-        imputationDataByMonth();//按照月份每日更新当月数据
-    }
-
-    private void imputationDataByMonth() {
-        String year = new SimpleDateFormat("yyyy").format(new Date());//String year = "2022";
-        String month = new SimpleDateFormat("M").format(new Date());
-        TUInterfaceinfo param = new TUInterfaceinfo();
-        param.setShareType("share_type_2");//市归集
-//        param.setNeedRefresh("1");
-        //(164-57) t_guiji_gas_zenner_gas_purchase_center_infor - 归集-市燃气(真兰收费系统)-中心计费购气信息 - 237962 ms
-        //(164-70) t_guiji_gas_zenner_meter_reading_infor - 归集-市燃气(真兰收费系统)-抄表信息 - 352968 ms
-        List<TUInterfaceinfo> tuInterfaceinfoList = tUInterfaceinfoMapper.selectTUInterfaceinfoList(param);
-        for (int i = 0; i < tuInterfaceinfoList.size(); i++) {
-            TUInterfaceinfo tuInterfaceinfo = tuInterfaceinfoList.get(i);
-            String tableName = tuInterfaceinfo.getTableName();
-            if (tableName == null || tableName.equals("") || tableName.equals("t_u_interfaceinfo_emptytable")) {
-                System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + 0 + " ms");
-                continue;
-            }
-            ImputationData imputationDataParam = new ImputationData();
-            imputationDataParam.setYear(year);
-            imputationDataParam.setTableName(tableName);
-            boolean isExist = !(imputationDataMapper.selectImputationInterface(imputationDataParam).size() == 0);
-            if(!isExist){
-                continue;
-            }
-            Map map = new HashMap();
-            map.put("year", year);
-            map.put("month", month);
-            map.put("tableName", tableName);
-            System.out.println(tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + "updating database... id = " + tuInterfaceinfo.getId());
-            Map column = new HashMap();
-            column.put("tableSchema", tableName.contains("\\.") ? tableName.split("\\.")[0] : "thsjzt");//thgjj / thsjzt
-            column.put("tableName", tableName.contains("\\.") ? tableName.split("\\.")[1] : tableName);//thgjj.tgjj_gtjkrxx / t_guiji_gas_zenner_meter_reading_infor
-            column.put("columnName", "create_time");//create_time / LAST_UPDATE_TIME
-//            System.out.println(column.get("tableSchema"));
-//            System.out.println(column.get("tableName"));
-//            System.out.println(column.get("columnName"));
-            List<Object> objectList = tUInterfaceinfoMapper.checkColumnExists(column);
-            System.out.println(objectList.size() + "=object");
-            Date dateBegin = new Date();
-            ImputationData imputationData;
-            if(objectList.size() != 0){
-                imputationData = tUInterfaceinfoMapper.imputationDataByMonth(map);
-            }else {
-                imputationData = tUInterfaceinfoMapper.imputationDataByMonthLastUpdateTime(map);
-            }
-            Long interval = new Date().getTime() - dateBegin.getTime();//接口查询总数所用时间
-            ImputationData imputationDataInsert = new ImputationData();
-            imputationDataInsert.setYear(year);
-            imputationDataInsert.setMonth(month);
-            imputationDataInsert.setTableName(tableName);
-//            imputationDataInsert.setInterfaceName(tuInterfaceinfo.getInterfaceName());//接口名称可能会变
-            imputationDataInsert.setCount(imputationData.getCount());
-            imputationDataMapper.updateImputationInterfaceByYearMonthTableName(imputationDataInsert);
-            System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + interval + " ms");
-        }
-    }
-
-    private void imputationDataByYear() {
-        String year = new SimpleDateFormat("yyyy").format(new Date());//String year = "2022";
-        TUInterfaceinfo param = new TUInterfaceinfo();
-        param.setShareType("share_type_2");//市归集
-//        param.setNeedRefresh("1");
-        //(164-57) t_guiji_gas_zenner_gas_purchase_center_infor - 归集-市燃气(真兰收费系统)-中心计费购气信息 - 237962 ms
-        //(164-70) t_guiji_gas_zenner_meter_reading_infor - 归集-市燃气(真兰收费系统)-抄表信息 - 352968 ms
-        List<TUInterfaceinfo> tuInterfaceinfoList = tUInterfaceinfoMapper.selectTUInterfaceinfoList(param);
-        for (int i = 0; i < tuInterfaceinfoList.size(); i++) {
-            TUInterfaceinfo tuInterfaceinfo = tuInterfaceinfoList.get(i);
-            String tableName = tuInterfaceinfo.getTableName();
-            if (tableName == null || tableName.equals("") || tableName.equals("t_u_interfaceinfo_emptytable")) {
-                System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + 0 + " ms");
-                continue;
-            }
-            ImputationData imputationDataParam = new ImputationData();
-            imputationDataParam.setYear(year);
-            imputationDataParam.setTableName(tableName);
-            boolean isExist = !(imputationDataMapper.selectImputationInterface(imputationDataParam).size() == 0);
-            if(isExist){
-                continue;
-            }
-            Map map = new HashMap();
-            map.put("year", year);
-            map.put("tableName", tableName);
-            System.out.println(tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + "updating database... id = " + tuInterfaceinfo.getId());
-            Map column = new HashMap();
-            column.put("tableSchema", tableName.contains("\\.") ? tableName.split("\\.")[0] : "thsjzt");//thgjj / thsjzt
-            column.put("tableName", tableName.contains("\\.") ? tableName.split("\\.")[1] : tableName);//thgjj.tgjj_gtjkrxx / t_guiji_gas_zenner_meter_reading_infor
-            column.put("columnName", "create_time");//create_time / LAST_UPDATE_TIME
-            System.out.println(column.get("tableSchema"));
-            System.out.println(column.get("tableName"));
-            System.out.println(column.get("columnName"));
-            List<Object> objectList = tUInterfaceinfoMapper.checkColumnExists(column);
-            System.out.println(objectList.size() + "=object");
-            Date dateBegin = new Date();
-            ImputationData imputationData;
-            if(objectList.size() != 0){
-                imputationData = tUInterfaceinfoMapper.imputationData(map);
-            }else {
-                imputationData = tUInterfaceinfoMapper.imputationDataLastUpdateTime(map);
-            }
-            Long interval = new Date().getTime() - dateBegin.getTime();//接口查询总数所用时间
-            ImputationData imputationDataInsert = new ImputationData();
-            imputationDataInsert.setYear(year);
-            imputationDataInsert.setTableName(tableName);
-            imputationDataInsert.setInterfaceName(tuInterfaceinfo.getInterfaceName());
-            imputationDataInsert.setJan(imputationData.getJan());
-            imputationDataInsert.setFeb(imputationData.getFeb());
-            imputationDataInsert.setMar(imputationData.getMar());
-            imputationDataInsert.setApr(imputationData.getApr());
-            imputationDataInsert.setMay(imputationData.getMay());
-            imputationDataInsert.setJun(imputationData.getJun());
-            imputationDataInsert.setJul(imputationData.getJul());
-            imputationDataInsert.setAug(imputationData.getAug());
-            imputationDataInsert.setSep(imputationData.getSep());
-            imputationDataInsert.setOct(imputationData.getOct());
-            imputationDataInsert.setNov(imputationData.getNov());
-            imputationDataInsert.setDecb(imputationData.getDecb());
-            imputationDataMapper.insertImputationInterface(imputationDataInsert);
-            System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + interval + " ms");
-        }
-    }
-
-    /**添加定时任务 每天凌晨1点**/
-    //@Scheduled(cron = "0 0 1 * * ?")
-    private void configureTasks() {
-        for(int i=0;i<getYears().length;i++){
-            Map map = logService.selectImputationLog(getYears()[i]);
-            try {
-                ImputationData imputationData = new ImputationData();
-                imputationData.setYear(getYears()[i]);
-                ImputationData imd = imputationDataService.selectImputationData(imputationData);
-                ImputationData id = (ImputationData) mapToBean(map,new ImputationData().getClass());
-                if(imd == null){
-                    imputationDataService.insertImputationData(id);
-                }
-                imputationDataService.updateImputationData(id);
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-        }
-    }
-
-    /**获取当前年和前四年的年份**/
-    private String[] getYears() {
-        String[] arr = new String[5];
-        for(int i=0;i<arr.length;i++){
-            arr[i] = getYears(i-4);
-        }
-        return arr;
-    }
-
     /**
      * @Description 获取年份
      * @param num 负数为之前年,0为当前年,正数为之后年

+ 2 - 2
mybusiness/src/main/resources/mapper/imputationData/ImputationDataMapper.xml

@@ -32,10 +32,10 @@
     </select>
 
     <select id="selectImputationInterface" parameterType="ImputationData" resultType="ImputationData">
-        select year, table_name tableName, interface_name interfaceName, jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, decb from t_u_imputation_interface
+        select year, interface_id interfaceId, interface_name interfaceName, jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, decb from t_u_imputation_interface
         <where>
             <if test="year != null  and year != ''"> and year = #{year}</if>
-            <if test="tableName != null  and tableName != ''"> and table_name = #{tableName}</if>
+            <if test="interfaceId != null  and interfaceId != ''"> and interface_id = #{interfaceId}</if>
             <if test="interfaceName != null  and interfaceName != ''"> and interface_name = #{interfaceName}</if>
         </where>
     </select>

+ 6 - 10
mybusiness/src/main/resources/mapper/system/TUInterfaceinfoMapper.xml

@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTUInterfaceinfoDataNumList" parameterType="TUInterfaceinfo" resultMap="TUInterfaceinfoResult">
         select id, status, remark, del_flag, create_by, create_time, update_by, update_time, table_name, interface_name, info_item, usage_scenarios, share_type, interface_type, env, sign_serveraddress, interface_address, type_iam, type_aksk,dept_id,dept_name,code,callsuccnum,callfailnum
-        from t_u_interfaceinfo_datanum
+        from t_u_interfaceinfo
         where dept_id = #{deptId} and status = '0' and share_type = 'share_type_2' and table_name != '' and table_name is not null
     </select>
 
@@ -181,7 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <update id="updateTUInterfaceinfoDataNum" parameterType="TUInterfaceinfo">
-        update t_u_interfaceinfo_datanum
+        update t_u_interfaceinfo
         <trim prefix="SET" suffixOverrides=",">
             <if test="status != null">status = #{status},</if>
             <if test="remark != null">remark = #{remark},</if>
@@ -261,7 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <update id="updateDataNum" parameterType="TUInterfaceinfo">
-        update t_u_interfaceinfo_datanum set update_time = #{updateTime}, datanum = (select count(id) from ${tableName}) where id = #{id}
+        update t_u_interfaceinfo set update_time = #{updateTime}, datanum = (select count(id) from ${tableName}) where id = #{id}
     </update>
 
     <delete id="deleteTUInterfaceinfoById" parameterType="String">
@@ -490,13 +490,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         10
     </select>
 
-    <parameterMap id="guijiCountParameterMap" type="java.util.Map">
-        <parameter property="deptId" jdbcType="BIGINT" mode="IN"></parameter>
-        <parameter property="count" jdbcType="BIGINT" mode="OUT"></parameter>
-    </parameterMap>
-
-    <select id="getGuijiCountByDeptId" parameterMap="guijiCountParameterMap" statementType="CALLABLE">
-        call getGuijiCountByDeptId(#{deptId, mode = IN, jdbcType = BIGINT}, #{count, mode = OUT, jdbcType = BIGINT})
+    <!--报错位置sql1-->
+    <select id="getGuijiCountByDeptId" parameterType="java.lang.String" resultType="java.lang.Long">
+        select callsuccnum from t_u_interfaceinfo where dept_id = #{deptId}  and share_type = 'share_type_2'
     </select>
 
     <select id="getInterfaceCount" parameterType="String" resultType="Integer">

+ 2 - 2
mybusiness/src/main/resources/templates/visualization/tk_iframe.html

@@ -36,7 +36,7 @@
         </div>
     </div>
     <div class="tk_zs">
-        <div class="tk_zs_tit" id="gjsjzl"><span>归集数据总量</span></div>
+        <div class="tk_zs_tit" id="gjsjzl"><span>接口归集总频次</span></div>
         <div class="d_bg"><img th:src="@{/visualization/images/thqzj_tk5.png}"/></div>
         <div class="s_bg"><img th:src="@{/visualization/images/thqzj_tk6.png}"/></div>
         <div class="b_yp"><img th:src="@{/visualization/images/thqzj_tk15.png}"/></div>
@@ -144,7 +144,7 @@
         getYdsqsl();
         //共享应用分析-饼图
         ydsqsl_bt();
-        //归集数据总量
+        //接口归集总频次
         initGjsjzl();
     })
     function initGjsjzl() {

BIN
mybusiness/target/classes/com/business/controller/VisualizationController.class


BIN
mybusiness/target/classes/com/sooka/apply/service/impl/IntRecordServiceImpl.class


BIN
mybusiness/target/classes/com/sooka/system/service/impl/TUInterfaceinfoServiceImpl.class


BIN
mybusiness/target/classes/com/util/StaticScheduleTask.class


+ 6 - 10
mybusiness/target/classes/mapper/system/TUInterfaceinfoMapper.xml

@@ -71,7 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectTUInterfaceinfoDataNumList" parameterType="TUInterfaceinfo" resultMap="TUInterfaceinfoResult">
         select id, status, remark, del_flag, create_by, create_time, update_by, update_time, table_name, interface_name, info_item, usage_scenarios, share_type, interface_type, env, sign_serveraddress, interface_address, type_iam, type_aksk,dept_id,dept_name,code,callsuccnum,callfailnum
-        from t_u_interfaceinfo_datanum
+        from t_u_interfaceinfo
         where dept_id = #{deptId} and status = '0' and share_type = 'share_type_2' and table_name != '' and table_name is not null
     </select>
 
@@ -181,7 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <update id="updateTUInterfaceinfoDataNum" parameterType="TUInterfaceinfo">
-        update t_u_interfaceinfo_datanum
+        update t_u_interfaceinfo
         <trim prefix="SET" suffixOverrides=",">
             <if test="status != null">status = #{status},</if>
             <if test="remark != null">remark = #{remark},</if>
@@ -261,7 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <update id="updateDataNum" parameterType="TUInterfaceinfo">
-        update t_u_interfaceinfo_datanum set update_time = #{updateTime}, datanum = (select count(id) from ${tableName}) where id = #{id}
+        update t_u_interfaceinfo set update_time = #{updateTime}, datanum = (select count(id) from ${tableName}) where id = #{id}
     </update>
 
     <delete id="deleteTUInterfaceinfoById" parameterType="String">
@@ -490,13 +490,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         10
     </select>
 
-    <parameterMap id="guijiCountParameterMap" type="java.util.Map">
-        <parameter property="deptId" jdbcType="BIGINT" mode="IN"></parameter>
-        <parameter property="count" jdbcType="BIGINT" mode="OUT"></parameter>
-    </parameterMap>
-
-    <select id="getGuijiCountByDeptId" parameterMap="guijiCountParameterMap" statementType="CALLABLE">
-        call getGuijiCountByDeptId(#{deptId, mode = IN, jdbcType = BIGINT}, #{count, mode = OUT, jdbcType = BIGINT})
+    <!--报错位置sql1-->
+    <select id="getGuijiCountByDeptId" parameterType="java.lang.String" resultType="java.lang.Long">
+        select callsuccnum from t_u_interfaceinfo where dept_id = #{deptId}  and share_type = 'share_type_2'
     </select>
 
     <select id="getInterfaceCount" parameterType="String" resultType="Integer">