|
@@ -5,6 +5,8 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import com.business.domain.ImputationData;
|
|
|
+import com.business.mapper.ImputationDataMapper;
|
|
|
import com.sooka.apply.domain.IntDetailed;
|
|
|
import com.sooka.apply.mapper.IntRecordMapper;
|
|
|
import com.sooka.common.core.text.Convert;
|
|
@@ -34,6 +36,8 @@ public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
|
|
|
@Resource
|
|
|
private TUInterfaceinfoMapper tUInterfaceinfoMapper;
|
|
|
@Resource
|
|
|
+ private ImputationDataMapper imputationDataMapper;
|
|
|
+ @Resource
|
|
|
private IntRecordMapper intRecordMapper;
|
|
|
|
|
|
/**
|
|
@@ -223,6 +227,76 @@ public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 刷新归集数据分析
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void imputationData(){
|
|
|
+ Long[] calendar = new Long[13];
|
|
|
+ calendar[1] = 0L;
|
|
|
+ calendar[2] = 0L;
|
|
|
+ calendar[3] = 0L;
|
|
|
+ calendar[4] = 0L;
|
|
|
+ calendar[5] = 0L;
|
|
|
+ calendar[6] = 0L;
|
|
|
+ calendar[7] = 0L;
|
|
|
+ calendar[8] = 0L;
|
|
|
+ calendar[9] = 0L;
|
|
|
+ calendar[10] = 0L;
|
|
|
+ calendar[11] = 0L;
|
|
|
+ calendar[12] = 0L;
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ Map map = new HashMap();
|
|
|
+ map.put("year", "2020");
|
|
|
+ map.put("tableName", tableName);
|
|
|
+ System.out.println(tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + "updating database... id = " + tuInterfaceinfo.getId());
|
|
|
+ Date dateBegin = new Date();
|
|
|
+ Long interval = new Date().getTime() - dateBegin.getTime();//接口查询总数所用时间
|
|
|
+ ImputationData imputationData = tUInterfaceinfoMapper.imputationData(map);
|
|
|
+ calendar[1] += Long.valueOf(imputationData.getJan());
|
|
|
+ calendar[2] += Long.valueOf(imputationData.getFeb());
|
|
|
+ calendar[3] += Long.valueOf(imputationData.getMar());
|
|
|
+ calendar[4] += Long.valueOf(imputationData.getApr());
|
|
|
+ calendar[5] += Long.valueOf(imputationData.getMay());
|
|
|
+ calendar[6] += Long.valueOf(imputationData.getJun());
|
|
|
+ calendar[7] += Long.valueOf(imputationData.getJul());
|
|
|
+ calendar[8] += Long.valueOf(imputationData.getAug());
|
|
|
+ calendar[9] += Long.valueOf(imputationData.getSep());
|
|
|
+ calendar[10] += Long.valueOf(imputationData.getOct());
|
|
|
+ calendar[11] += Long.valueOf(imputationData.getNov());
|
|
|
+ calendar[12] += Long.valueOf(imputationData.getDecb());
|
|
|
+ System.out.println("(" + tuInterfaceinfoList.size() + "-" + (i + 1) + ") " + tuInterfaceinfo.getTableName() + " - " + tuInterfaceinfo.getInterfaceName() + " - " + interval + " ms");
|
|
|
+ tuInterfaceinfo.setRefreshTime(new Date());
|
|
|
+// tuInterfaceinfo.setNeedRefresh("2");
|
|
|
+// tUInterfaceinfoMapper.updateInterfaceCallsuccnum(tuInterfaceinfo);
|
|
|
+ //update t_u_interfaceinfo set callsuccnum = #{callsuccnum} where id = #{id}
|
|
|
+ }
|
|
|
+ ImputationData imputationData = new ImputationData();
|
|
|
+ imputationData.setYear("2020");
|
|
|
+ imputationData.setJan(calendar[1].toString());
|
|
|
+ imputationData.setFeb(calendar[2].toString());
|
|
|
+ imputationData.setMar(calendar[3].toString());
|
|
|
+ imputationData.setApr(calendar[4].toString());
|
|
|
+ imputationData.setMay(calendar[5].toString());
|
|
|
+ imputationData.setJun(calendar[6].toString());
|
|
|
+ imputationData.setJul(calendar[7].toString());
|
|
|
+ imputationData.setAug(calendar[8].toString());
|
|
|
+ imputationData.setSep(calendar[9].toString());
|
|
|
+ imputationData.setOct(calendar[10].toString());
|
|
|
+ imputationData.setNov(calendar[11].toString());
|
|
|
+ imputationData.setDecb(calendar[12].toString());
|
|
|
+ imputationDataMapper.updateImputationData(imputationData);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 查询接口数量
|
|
|
* @return 结果
|
|
|
*/
|