Commit c25e3234 by liuys

新增统计模型接口功能,统计TB_ST_LOGINLOG、TB_ST_SPLOG、TRACK、TB_ST_IDCARDPHONECAR,TB_ST_PHONEQQ…

新增统计模型接口功能,统计TB_ST_LOGINLOG、TB_ST_SPLOG、TRACK、TB_ST_IDCARDPHONECAR,TB_ST_PHONEQQWECHAT、RELATION该六张表的访问统计功能
parent 526b8bd9
......@@ -2,7 +2,15 @@ package com.founder.interservice.loginlog.controller;
import com.founder.interservice.loginlog.model.LoginLog;
import com.founder.interservice.loginlog.service.LoginLogService;
import com.founder.interservice.querymodel.RelationFilter;
import com.founder.interservice.querymodel.TrackFilter;
import com.founder.interservice.service.DataService;
import com.founder.interservice.service.IphoneTrackService;
import com.founder.interservice.service.TrackService;
import com.founder.interservice.splog.model.SpLog;
import com.founder.interservice.splog.service.SpLogService;
import com.founder.interservice.util.EasyUIPage;
import com.alibaba.fastjson.JSONArray;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
......@@ -26,6 +34,14 @@ import java.util.Map;
public class LoginLogController {
@Autowired
LoginLogService loginLogService;
@Autowired
private SpLogService spLogService;
@Autowired
private TrackService trackService;
@Autowired
private IphoneTrackService iphoneTrackService;
@Autowired
private DataService dataService;
/**
* 登录日志记录
......@@ -104,4 +120,66 @@ public class LoginLogController {
public String getToSplog(){
return "splog/spLog";
}
/**
统计模型接口
* */
@RequestMapping(value = "/tjmxInterface")
@ResponseBody
public JSONArray tjmxInterface(String startTime,String endTime){
List numList = new ArrayList();
JSONArray array = new JSONArray();
LoginLog loginLog = new LoginLog();
SpLog spLog = new SpLog();
TrackFilter trackFilter = new TrackFilter();
RelationFilter relationFilter = new RelationFilter();
try{
//IdcardPhoneCarRalation idcard= new IdcardPhoneCarRalation();
//1.智慧侦查脑图访问量TB_ST_LOGINLOG
loginLog.setCxrKssj(startTime);
loginLog.setCxrJssj(endTime);
int loginNum = loginLogService.selectLoginNum(loginLog);
Map<Object,Object> tjMap = new HashMap<Object,Object>();
tjMap.put("total",loginNum);
tjMap.put("model","1.智慧侦查脑图访问量");
array.add(tjMap);
//2.请求审批统计 TB_ST_SPLOG
spLog.setStartT(startTime);
spLog.setEndT(endTime);
int splogNum = spLogService.selectSplogNum(spLog);
Map<Object,Object> spMap = new HashMap<Object,Object>();
spMap.put("total",splogNum);
spMap.put("model","审批统计");
array.add(spMap);
//3.时空轨迹模型 TRACK
trackFilter.setKssj(startTime);
trackFilter.setJssj(endTime);
int trackNum = trackService.selectTrackNum(trackFilter);
Map<Object,Object> trackMap = new HashMap<Object,Object>();
trackMap.put("total",trackNum);
trackMap.put("model","时空轨迹模型");
array.add(trackMap);
//4.虚实关系转换模型 TB_ST_IDCARDPHONECAR,TB_ST_PHONEQQWECHAT
int idCardNum = iphoneTrackService.selectIdCardNum();
int phoneQqNum = iphoneTrackService.selectPhoneQqNum();
int phonecardNum = idCardNum+phoneQqNum;
Map<Object,Object> phonecardMap = new HashMap<Object,Object>();
phonecardMap.put("total",phonecardNum);
phonecardMap.put("model","虚实关系转换模型");
array.add(phonecardMap);
//5.关联关系模型 RELATION
relationFilter.setKssj(startTime);
relationFilter.setJssj(endTime);
int relatNum = dataService.selectRelatNum(relationFilter);
Map<Object,Object> relatMap = new HashMap<Object,Object>();
relatMap.put("total",relatNum);
relatMap.put("model","关联关系模型");
array.add(relatMap);
}catch (Exception e){
e.printStackTrace();
}
//JSONArray jsonArray = JSONArray.parseArray(numList.toString());
System.out.print("jsonArray=="+array);
return array;
}
}
......@@ -21,4 +21,7 @@ public interface LoginLogService {
public String saveLoginLog(LoginLog loginLog);
public Map<String,Object> selectLoginLog(LoginLog loginLog);
//查询一段时间内登录人数
public int selectLoginNum(LoginLog loginLog);
}
......@@ -44,4 +44,11 @@ public class LoginLogServiceImpl implements LoginLogService {
return resultMap;
}
@Override
public int selectLoginNum(LoginLog loginLog){
int total = loginLogMapper.getLoginLogCount(loginLog);
System.out.print("total==="+total);
return total;
}
}
......@@ -22,5 +22,7 @@ public interface ObjectRelationMapper {
//条件查询是否已经录入库
public List<String> queryIdRelationLocal(RelationLocalFilter filter) throws Exception;
public List<String> queryPhoneRelationLocal(RelationLocalFilter filter) throws Exception;
public int selectIdCardNum() throws Exception;
public int selectPhoneQqNum() throws Exception;
}
......@@ -37,4 +37,12 @@ public interface RelationMapper {
* @throws Exception
*/
public List<String> getRelationImsiList (RelationFilter relationFilter) throws Exception;
/**
* 查询relation表中数据数量和
* @param relationFilter
* @return
* @throws Exception
*/
public int selectRelatNum(RelationFilter relationFilter) throws Exception;
}
package com.founder.interservice.mapper.xzxt;
import com.founder.interservice.splog.model.SpLog;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* Created by zhulinying on 2019/3/22.
*/
@Mapper
@Repository
public interface SpLogmapper {
/**
* 查询审批日志表信息总数
* @return
* @throws
*/
int selectSplogNum(SpLog spLog);
}
......@@ -27,4 +27,6 @@ public class Track {
private String w; //纬度
@Column(insertable = false)
private Date djsj;
@Transient
private String djsjj;
}
......@@ -33,4 +33,6 @@ public interface DataService {
public List<Track> queryTrackByRSD(TrackFilter trackFilter) throws Exception;
public List<String> getRelationImsiList(RelationFilter relationFilter) throws InterServiceException;
public int selectRelatNum(RelationFilter relationFilter) throws Exception;
}
......@@ -3,10 +3,8 @@ package com.founder.interservice.service;
import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.model.ResultObj;
import com.founder.interservice.model.Track;
import com.founder.interservice.querymodel.RelationLocalFilter;
import java.util.List;
import java.util.Map;
/**
......@@ -22,4 +20,6 @@ public interface IphoneTrackService {
public void saveObjectRelationLocal(ResultObj resultObj,String asjbh,String sfzh,String jh);
public boolean queryObjectRelationLocal(RelationLocalFilter filter) throws InterServiceException;
public int selectIdCardNum() throws Exception;
public int selectPhoneQqNum() throws Exception;
}
package com.founder.interservice.service;
import com.founder.interservice.querymodel.TrackFilter;
/**
* Created by zhulinying on 2019/3/25.
*/
public interface TrackService {
public int selectTrackNum(TrackFilter trackFilter) throws Exception;
}
......@@ -131,4 +131,9 @@ public class DataServiceImpl implements DataService {
public List<Track> queryTrackByRSD(TrackFilter trackFilter) throws Exception {
return trackMapper.queryTrackByRSD(trackFilter);
}
@Override
public int selectRelatNum(RelationFilter relationFilter) throws Exception{
int total = relationMapper.selectRelatNum(relationFilter);
return total;
}
}
package com.founder.interservice.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.VO.TrackVO;
import com.founder.interservice.enums.ResultEnum;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.mapper.xzxt.ObjectRelationMapper;
import com.founder.interservice.model.*;
import com.founder.interservice.querymodel.RelationLocalFilter;
import com.founder.interservice.repository.RelationRepository;
......@@ -21,7 +21,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Example;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import com.founder.interservice.mapper.xzxt.ObjectRelationMapper;
import java.util.*;
import java.util.concurrent.ExecutorService;
......@@ -766,6 +765,24 @@ public class IphoneTrackServiceImpl implements IphoneTrackService {
}
return tempList;
}
/**
* 查询TB_ST_IDCARDPHONECAR表数据总数
* @return
*/
@Override
public int selectIdCardNum() throws Exception {
int total = objectRelationMapper.selectIdCardNum();
return total;
}
/**
* 查询TB_ST_PHONEQQWECHAT表数据总数
* @return
*/
@Override
public int selectPhoneQqNum() throws Exception {
int total = objectRelationMapper.selectPhoneQqNum();
return total;
}
}
package com.founder.interservice.service.impl;
import com.founder.interservice.mapper.xzxt.TrackMapper;
import com.founder.interservice.querymodel.TrackFilter;
import com.founder.interservice.service.TrackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Created by lenovo on 2019/3/25.
*/
@Service
public class TrackServiceImpl implements TrackService {
@Autowired
private TrackMapper trackMapper;
/**
* 查询track表数据总数
* @returntotal
* @throws Exception
*/
@Override
public int selectTrackNum(TrackFilter trackFilter) throws Exception {
int total = trackMapper.getTracksTotalCount(trackFilter);
return total;
}
}
......@@ -42,4 +42,8 @@ public class SpLog {
@Transient
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endTime;
@Transient
private String endT;
@Transient
private String startT;
}
......@@ -4,9 +4,8 @@ import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.splog.model.SpLog;
import org.springframework.data.domain.Page;
import java.util.List;
public interface SpLogService {
public void saveSpLog(SpLog spLog) throws Exception;
public Page<SpLog> querySpLogs(SpLog spLog) throws InterServiceException;
public int selectSplogNum(SpLog spLog) throws InterServiceException;
}
package com.founder.interservice.splog.service.impl;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.mapper.xzxt.SpLogmapper;
import com.founder.interservice.splog.model.SpLog;
import com.founder.interservice.splog.repository.SpLogRepository;
import com.founder.interservice.splog.service.SpLogService;
......@@ -13,17 +14,19 @@ import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;
import javax.persistence.criteria.*;
import java.util.ArrayList;
import java.util.Arrays;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Predicate;
import javax.persistence.criteria.Root;
import java.util.Date;
import java.util.List;
@Service
public class SpLogServiceImpl implements SpLogService {
@Autowired
private SpLogRepository spLogRepository;
@Autowired
private SpLogmapper spLogmapper;
@Override
public void saveSpLog(SpLog spLog) throws Exception {
try{
......@@ -55,6 +58,16 @@ public class SpLogServiceImpl implements SpLogService {
},pageable);
return resultPage;
}
/**
* 查询审批日志表中数据总量
* @returntotal
* @throws InterServiceException
*/
@Override
public int selectSplogNum(SpLog spLog){
int total = spLogmapper.selectSplogNum(spLog);
return total;
}
private Predicate getPredicate(Predicate predicate,Root<SpLog> root,CriteriaBuilder cb,SpLog spLog){
if (!StringUtil.ckeckEmpty(spLog.getAsjbh())) {
......
......@@ -225,5 +225,12 @@
</if>
</where>
</select>
<select id="selectIdCardNum" parameterType="com.founder.interservice.model.IdcardPhoneCarRalation" resultType="java.lang.Integer">
select count(*)
from TB_ST_IDCARDPHONECAR
</select>
<select id="selectPhoneQqNum" parameterType="com.founder.interservice.querymodel.RelationLocalFilter" resultType="java.lang.Integer">
select count(*)
from TB_ST_PHONEQQWECHAT
</select>
</mapper>
\ No newline at end of file
......@@ -45,4 +45,16 @@
<include refid="getRelation_where" />
</where>
</select>
<select id = "selectRelatNum" parameterType="com.founder.interservice.querymodel.RelationFilter" resultType="java.lang.Integer">
select count(*)
from RELATION t
<where>
<if test="kssj != null and kssj != ''">
and to_date(t.djsj,'yyyy-MM-dd HH24:mi:ss') <![CDATA[>=]]> to_date(#{kssj},'yyyy-MM-dd HH24:mi:ss')
</if>
<if test="jssj != null and jssj != ''">
and to_date(t.djsj,'yyyy-MM-dd HH24:mi:ss') <![CDATA[<=]]> to_date(#{jssj},'yyyy-MM-dd HH24:mi:ss')
</if>
</where>
</select>
</mapper>
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.founder.interservice.mapper.xzxt.SpLogmapper">
<select id="selectSplogNum" parameterType="com.founder.interservice.splog.model.SpLog" resultType="java.lang.Integer">
SELECT COUNT(*) FROM TB_ST_SPLOG t
<where>
<if test="startT != null and startT != ''">
and t.DJSJ <![CDATA[>=]]> to_date(#{startT},'yyyy-MM-dd')
</if>
<if test="endT != null and endT != ''">
and t.DJSJ <![CDATA[<=]]> to_date(#{endT},'yyyy-MM-dd')
</if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -174,4 +174,15 @@
)
where rownum <![CDATA[ <= ]]> 5
</select>
<select id="selectTrackNum" parameterType="com.founder.interservice.querymodel.TrackFilter" resultType="java.lang.Integer">
SELECT COUNT(*) FROM track t
<where>
<if test="kssj != null and kssj != ''">
and t.DJSJ <![CDATA[>=]]> to_date(#{kssj},'yyyy-MM-dd')
</if>
<if test="jssj != null and jssj != ''">
and t.DJSJ <![CDATA[<=]]> to_date(#{jssj},'yyyy-MM-dd')
</if>
</where>
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment