Commit a724ae4b by chang_chao@founder.com.cn
parents 19d09eb2 053e7f81
......@@ -6,10 +6,15 @@ import com.founder.interservice.dzgz.model.DzgzTask;
import com.founder.interservice.dzgz.service.DzgzService;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.service.PushWaDataService;
import com.founder.interservice.tracktraveltogether.model.TrackTogetherTask;
import com.founder.interservice.tracktraveltogether.service.TrackTogetherService;
import com.founder.interservice.user.controller.UserContoller;
import com.founder.interservice.user.model.User;
import com.founder.interservice.util.DateUtil;
import com.founder.interservice.util.KeyUtil;
import com.founder.interservice.util.ResultVOUtil;
import com.founder.interservice.util.StringUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
......@@ -32,6 +37,8 @@ public class PushWaDataController {
private UserContoller userContoller;
@Autowired
private DzgzService dzgzService;
@Autowired
private TrackTogetherService trackTogetherService;
/**
* 获取对象时间段内的轨迹
......@@ -136,6 +143,7 @@ public class PushWaDataController {
ResultVO resultVO = null;
try{
String result = pushWaDataService.sendTogetherTask(taskCaseId,taskName,username,startTime,endTime,objectType,objectValue);
saveTogetherTask(result,taskCaseId,taskName,username,startTime,endTime,objectType,objectValue);
resultVO = ResultVOUtil.success(JSONObject.parseObject(result));
}catch (InterServiceException e){
e.printStackTrace();
......@@ -144,6 +152,46 @@ public class PushWaDataController {
return resultVO;
}
/**
* 时空伴随-任务保存
* @param result
* @param taskCaseId
* @param taskName
* @param username
* @param startTime
* @param endTime
* @param objectType
* @param objectValue
*/
public void saveTogetherTask(String result,String taskCaseId,String taskName,String username,String startTime,String endTime,String objectType,String objectValue) {
try {
TrackTogetherTask trackParam = new TrackTogetherTask();
if (!StringUtils.isEmpty(result) && result.contains("{")) {
JSONObject resultObject = JSONObject.parseObject(result);
if (null != resultObject && resultObject.containsKey("data") && null != resultObject.get("data")) {
String taskId = resultObject.get("data").toString();
trackParam.setTaskId(taskId);
trackParam.setProgress("0");
trackParam.setState("QUEUEING");
trackParam.setTaskName(taskName);//设置任务名称
trackParam.setTaskCaseId(taskCaseId); //设置案件编号
trackParam.setObjectValue(objectValue); //设置需要伴随的标识号
if (!StringUtil.ckeckEmpty(objectType) && !StringUtil.ckeckEmpty(objectValue)
&& !StringUtil.ckeckEmpty(startTime) && !StringUtil.ckeckEmpty(endTime)) {
trackParam.setObjectType(objectType);//设置标识号类型
trackParam.setObjectValue(objectValue); //设置需要伴随的标识号
Date kssj = startTime.contains(" ") ? DateUtil.convertStringToDateTime(startTime) : DateUtil.convertStringToDate(startTime);
trackParam.setStartTime(kssj);
Date jssj = endTime.contains(" ") ? DateUtil.convertStringToDateTime(endTime) : DateUtil.convertStringToDate(endTime);
trackParam.setEndTime(jssj);
}
trackTogetherService.saveTogetherTask(trackParam);//任务保存入库
}
}
}catch (Exception e){
e.printStackTrace();
}
}
/**
* 获取时空伴随任务结果
* @param taskId 任务编号
* @return
......
......@@ -255,6 +255,8 @@ public class DzgzController {
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println("需要发送的个数++++++++++++++++++++++:"+listStartTime.size());
String glxxXxzlbh = KeyUtil.getUniqueKey("GL");
for(int i=0;i<listStartTime.size();i++){
String paramStr = null;
//发送电子固证任务
......@@ -291,27 +293,29 @@ public class DzgzController {
objectParam.put("taskName",taskName);
objectParam.put("username",jh);
paramStr = objectParam.toJSONString();
System.out.println("model++++++++++++++++++++++++++++"+paramStr);
try{
String result = pushWaDataService.sendDzgzTask(paramStr,0);
JSONObject resultObject = JSONObject.parseObject(result);
System.out.println("发送电子固证接口返回数据++++++++++++++++++++++++++++"+resultObject);
String success = resultObject.getString("success");
//String success = "true";
if("true".equals(success)){//发送任务成功
String taskId = resultObject.getString("data");//拿到任务编号
//String taskId = node.getString("startTime");//拿到任务编号
System.out.println("taskId++++++++++++++++++++++++++++"+taskId);
DzgzTask dzgzTask = new DzgzTask();
dzgzTask.setRwsd(""+i);
dzgzTask.setTaskId(taskId);
dzgzTask.setTaskCaseId(asjbh);
dzgzTask.setTaskName("案件名称");
dzgzTask.setTaskName(taskName);
dzgzTask.setQyName(node.getString("name"));
dzgzTask.setStartTime(new Date(node.getLongValue("startTime")));
dzgzTask.setEndTime(new Date(node.getLongValue("endTime")));
dzgzTask.setLc(node.getJSONArray("lc").toString());
dzgzTask.setProgress("0");
dzgzTask.setState("QUEUEING");
dzgzTask.setGlxxXxzjbh(KeyUtil.getUniqueKey("GL"));
dzgzTask.setGlxxXxzjbh(glxxXxzlbh);
if(null != user){
dzgzTask.setFsrJh(user.getUsername());
dzgzTask.setFsrSfzh(user.getCard_id());
......@@ -327,6 +331,7 @@ public class DzgzController {
}
}
System.out.println("成功发送的个数+++++++++++++++++++++++++:"+dzgzTaskList.size());
if(dzgzTaskList!=null&&dzgzTaskList.size()==7){//全部任务发送成功--启动线程进行电子固证具体信息的存储
resultVO.setCode(0);
resultVO.setMsg("成功!");
......
......@@ -45,7 +45,7 @@ public class DzgzScheduledServer{
private PushWaDataService pushWaDataService;
@Scheduled(initialDelay = 60000,fixedDelay = 180000) //项目启动后延迟1分钟执行,每次执行完后三分钟后再次执行
@Scheduled(initialDelay = 60000,fixedDelay = 60000) //项目启动后延迟1分钟执行,每次执行完后一分钟后再次执行
public void queryTaskResult(){
System.out.println("=============DZGZ Thread startting ===============");
System.out.println("=============DZGZ Thread startting ===============");
......@@ -65,7 +65,7 @@ public class DzgzScheduledServer{
if("2".equals(progress)){//已经拿到查询结果,未解析完成,继续解析
String result_str = task.getRwresult();
getAndSaveInfo(result_str,task);
updateTaskStates(taskId,"1","FINISHED",null);
//updateTaskStates(taskId,"1","FINISHED",null);
System.out.println("电子固证信息保存成功++++++++++++++++++++++++++");
}else{
//查询比对结果状态
......@@ -78,8 +78,8 @@ public class DzgzScheduledServer{
//拿到数据,保存数据
updateTaskStates(taskId,"2","STARTING",result_str);
getAndSaveInfo(result_str,task);
updateTaskStates(taskId,"1",state,null);
taskResultMapper.deleteRepeatDzgzTaskResult(taskId);//删除指定task_id重复的电子固证结果数据
//updateTaskStates(taskId,"1",state,null);
System.out.println("电子固证信息保存成功++++++++++++++++++++++++++");
}
}
......@@ -146,11 +146,11 @@ public class DzgzScheduledServer{
System.out.println("电子固证返回的数量:"+taskResults.size());
//多线程处理 chent
int limit = 120;//批处理量
int limit = 5000;//批处理量
int size = taskResults.size();
long threadNum = size / limit;
for (int i = 0; i < threadNum + 1; i++) {
HandleThread thread = new HandleThread(taskResults, i * limit, ((i + 1) * limit));
HandleThread thread = new HandleThread(taskResults, i * limit, ((i + 1) * limit),result_str,task.getTaskId(),size);
thread.start();
}
//taskResultMapper.saveDzgzTaskResultBatch(taskResults);
......@@ -174,11 +174,18 @@ public class DzgzScheduledServer{
private List<DzgzTaskResult> data;
private int start;
private int end;
private String result_str;
private String taskId;
private int size;
public HandleThread(List<DzgzTaskResult> data, int start, int end) {
public HandleThread(List<DzgzTaskResult> data, int start, int end,String result_str,String taskId,int size) {
this.data = data;
this.start = start;
this.end = end;
this.result_str = result_str;
this.taskId = taskId;
this.size = size;
}
public void run() {
System.out.println("进入电子固证保存的线程");
......@@ -199,8 +206,15 @@ public class DzgzScheduledServer{
if (paramDzgzTaskResults != null && paramDzgzTaskResults.size() > 0){
try {
taskResultMapper.saveDzgzTaskResultBatch(paramDzgzTaskResults);
//查询保存的数量,如果数量与list的数量相等,则更新保存的状态
int count = taskResultMapper.getAllResultsByTaskid(taskId);
if(count==size){
updateTaskStates(taskId,"1","FINISHED",null);
taskResultMapper.deleteRepeatDzgzTaskResult(taskId);//删除指定task_id重复的电子固证结果数据
}
} catch (Exception e) {
System.out.println("电子固证数据保存失败!!!");
updateTaskStates(taskId,"2","STARTING",result_str);//保存失败将标志位置为2---表示正在入库
e.printStackTrace();
}
}
......@@ -347,7 +361,7 @@ public class DzgzScheduledServer{
/**
* 进行案前踩点与案后分析模型的分析
*/
@Scheduled(initialDelay = 60000,fixedDelay = 180000) //项目启动后延迟1分钟执行,每次执行完后三分钟后再次执行
@Scheduled(initialDelay = 60000,fixedDelay = 60000) //项目启动后延迟1分钟执行,每次执行完后一分钟后再次执行
public void getTaskResult(){
System.out.println("=============AJDZGZ Thread startting ===============");
System.out.println("=============AJDZGZ Thread startting ===============");
......
......@@ -24,4 +24,6 @@ public interface DzgzTaskResultMapper {
List<String> getAllImsiResultsByTaskid(String taskId);
void deleteRepeatDzgzTaskResult(String type);
int getAllResultsByTaskid(String taskId);
}
......@@ -7,13 +7,18 @@ import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
import com.founder.interservice.ryhx.model.TbStCqhotelData;
import java.util.List;
import java.util.Map;
@Mapper
@Repository
public interface RyhxMapper {
TbStCqhotel queryHotelAddr(String hotelno) throws Exception;
TbStCqhotelData queryHotelDetail(String hotelno) throws Exception;
List<TbStCqhotelData> queryHotelDetail(Map map) throws Exception;
List<TbStCqwbdata> queryWbxxList(String zjhm) throws Exception;
TbStCqwbdataVOS queryWbxx(String zjhm) throws Exception;
List<TbStCqhotelData> queryHotelRzxx(String zjhm);
}
......@@ -7,11 +7,16 @@ import com.founder.interservice.VO.ResultVO;
import com.founder.interservice.enums.ResultEnum;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.protogenesis.service.ProtoService;
import com.founder.interservice.regionalanalysis.model.Regional;
import com.founder.interservice.regionalanalysis.model.RegionalTask;
import com.founder.interservice.regionalanalysis.service.RegionalAnalysisService;
import com.founder.interservice.util.DateUtil;
import com.founder.interservice.util.KeyUtil;
import com.founder.interservice.util.ResultVOUtil;
import com.founder.interservice.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -19,6 +24,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
......@@ -31,6 +37,8 @@ public class ProtoController {
@Autowired
private ProtoService protoService;
@Autowired
private RegionalAnalysisService regionalAnalysisService;
/**
* 获取关联关系接口
......@@ -265,12 +273,69 @@ public class ProtoController {
ResultVO resultVO = null;
try{
String result = protoService.doPostWaData("multiRegionalsAnalyseTask",param);
saveRegionalTask(param,result);
resultVO = ResultVOUtil.success(result);
}catch (InterServiceException e){
resultVO = ResultVOUtil.error(e.getCode(),e.getMessage(),null);
}
return resultVO;
}
/**
* 保存多区域任务信息
* @param param
* @param result
*/
public void saveRegionalTask(String param,String result){
try {
if (!StringUtils.isEmpty(result) && result.contains("{")) {
JSONObject resultObject = JSONObject.parseObject(result);
if (null != resultObject && resultObject.containsKey("data")&&null!=resultObject.get("data")) {
String taskId = resultObject.get("data").toString();
JSONObject paramObject = JSONObject.parseObject(param);
RegionalTask regionalTask = new RegionalTask();
List<Regional> regionalList = null;
regionalTask.setTaskId(taskId);
regionalTask.setTaskName(paramObject.getString("taskName"));
regionalTask.setTaskCaseId(paramObject.getString("taskCaseId"));
regionalTask.setDjsj(new Date());
regionalTask.setProgress("0");
regionalTask.setState("QUEUEING");
if (paramObject != null) {
JSONObject jsonObject1 = paramObject.getJSONObject("perform");
if (jsonObject1 != null) {
regionalTask.setExpression(jsonObject1.getString("expression"));
JSONArray jsonArray = jsonObject1.getJSONArray("regional");
if (jsonArray != null && !jsonArray.isEmpty()) {
regionalList = new ArrayList<>();
for (int i = 0; i <= jsonArray.size() - 1; i++) {
JSONObject object = jsonArray.getJSONObject(i);
if (object != null) {
Regional regional = new Regional();
regional.setTaskId(taskId);
regional.setDjsj(new Date());
regional.setRegionalId(KeyUtil.getUniqueKey("RT"));
regional.setName(object.getString("name"));
regional.setLc(object.getJSONArray("lc").toJSONString());
regional.setSource(object.getJSONArray("source").toJSONString());
regional.setStartTime(new Date(object.getLong("startTime")));
regional.setEndTime(new Date(object.getLong("endTime")));
regionalList.add(regional);
}
}
}
regionalTask.setRegionals(regionalList);
}
}
if (regionalTask != null) {
regionalAnalysisService.saveRegionalTask(regionalTask);
}
}
}
}catch (Exception e){
e.printStackTrace();
}
}
//多区域碰撞分析统计-获取结果
@RequestMapping(value = "/getMultiRegionalsAnalyTask",method = {RequestMethod.GET,RequestMethod.POST})
@ResponseBody
......
......@@ -9,10 +9,9 @@ import com.founder.interservice.regionalanalysis.model.RegionalTaskResultDetail;
import com.founder.interservice.regionalanalysis.repository.RegionalTaskRepository;
import com.founder.interservice.regionalanalysis.repository.RegionalTaskResultRepository;
import com.founder.interservice.regionalanalysis.service.RegionalAnalysisService;
import com.founder.interservice.service.IphoneTrackService;
import com.founder.interservice.service.PushWaDataService;
import com.founder.interservice.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
......@@ -32,19 +31,14 @@ import java.util.*;
@Async
public class ScheduledService {
@Value(value = "${wabigdata.regionalAnalysisTaskStatus.url}")
private String REGIONAL_ANALYSIS_TASK_STATUS; //获取任务状态
@Value(value = "${wabigdata.regionalAnalysisTaskInfo.url}")
private String REGIONAL_ANALYSIS_TASK_INFO; //获取任务结果
@Autowired
private PushWaDataService pushWaDataService;
@Autowired
private RegionalAnalysisService regionalAnalysisService;
@Autowired
private RegionalTaskRepository regionalTaskRepository;
@Autowired
private RegionalTaskResultRepository taskResultRepository;
@Autowired
private IphoneTrackService iphoneTrackService; //调取网安数据接口
/**
*
......@@ -76,17 +70,14 @@ public class ScheduledService {
System.out.println("taskList====================================="+taskList);
if(taskList != null && !taskList.isEmpty()){
String taskId = null,progress=null,state=null,result=null;Map<String,String> taskMap=null;
for (RegionalTask task:taskList) {
taskId = task.getTaskId();
//查询比对结果状态
taskMap = queryTaskStates(taskId);
taskMap = this.queryTaskStates(taskId);
progress = taskMap.get("progress");
state = taskMap.get("state");
if("1".equals(progress) && "FINISHED".equals(state)){
String info_url = REGIONAL_ANALYSIS_TASK_INFO + "&taskId=" + taskId;
String taskInfoResult = HttpUtil.getWaData(info_url);
//String taskInfoResult = "{\"results\":[],\"status\":\"ok\"}";
String taskInfoResult = pushWaDataService.getRegionalTaskInfo(taskId);
//调取结果成功 然后将结果保存入库
if(!taskInfoResult.startsWith("Rate")){
if(null != taskInfoResult && taskInfoResult.startsWith("{")){
......@@ -103,6 +94,30 @@ public class ScheduledService {
}
/**
* 调用新版接口获取任务状态
* @param taskId
* @return
*/
public Map<String,String> queryTaskStates(String taskId){
JSONObject jsonObject = null;
String progress=null ,state=null;
Map<String,String> map = new HashMap();
String result = pushWaDataService.pushTaskStatus(taskId,0);
if(null != result && result.startsWith("{")){
jsonObject = JSONObject.parseObject(result);
}
if(jsonObject!=null){
JSONObject JSONObjectData = jsonObject.getJSONObject("data");
progress = JSONObjectData.getString("progress"); //进度
state = JSONObjectData.getString("state"); //状态
}
map.put("progress",progress);
map.put("state",state);
return map;
}
/**
* 第二步,调取标识号的关联信息
* 1.将比对碰撞首次调取标识号成功的任务过滤出来即状态位为FINISHED的
* 2.开启新线程调取标识号的关联数据
......@@ -123,9 +138,6 @@ public class ScheduledService {
return criteriaQuery.getRestriction();
}
});
System.out.println("开始查询ddddd============================================================");
System.out.println(taskList);
if(taskList != null && !taskList.isEmpty()){
for (RegionalTask task:taskList) {
List<RegionalTaskResult> taskResults = taskResultRepository.findAllByTaskId(task.getTaskId());
......@@ -138,14 +150,6 @@ public class ScheduledService {
e.printStackTrace();
}
}
/**
* 通过区域碰撞的结果 使用第四个接口调取关联数据
*/
......@@ -159,8 +163,13 @@ public class ScheduledService {
if (objValue != null && !"".equals(objValue)) {
//MAC地址、用户名、淘宝旺旺号不去调取关联数据,其它类型都使用第四个接口调取
if (!Arrays.asList("4329", "4342","45282").contains(objType)) {
JSONObject jsonObj = iphoneTrackService.getObjectRelationAll(objValue);//使用网安第三个接口调取关联数据
if (jsonObj != null && !jsonObj.isEmpty()) { //说明根节点是身份证号
JSONObject jsonObj = null;
String relationAll = pushWaDataService.pushRelationAll(DateUtil.getYYYYMMDDHHMM(), DateUtil.getYYYYMMDDHHMM(), "admin", objValue,3);
if(null != relationAll && relationAll.startsWith("{")){
JSONObject json = JSONObject.parseObject(relationAll);
jsonObj = json.getJSONObject("data");
}
if (jsonObj != null && !jsonObj.isEmpty()) {
RegionalTaskResultDetail detail = new RegionalTaskResultDetail();
detail.setTaskResultId(result.getXXZJBH());
detail.setXXZJBH(KeyUtil.getUniqueKey("EDZ"));
......@@ -235,7 +244,7 @@ public class ScheduledService {
public void getAndSaveInfo(String taskInfoResult, RegionalTask task) throws RuntimeException{
try{
JSONObject o = JSONObject.parseObject(taskInfoResult);
JSONArray jsonArray = o.getJSONArray("results");
JSONArray jsonArray = o.getJSONObject("data").getJSONArray("results");
if(jsonArray != null && jsonArray.size() > 0){
List<RegionalTaskResult> taskResults = jsonArray.toJavaList(RegionalTaskResult.class);
taskResults = removeDuplicate(taskResults);
......@@ -260,33 +269,6 @@ public class ScheduledService {
}
}
/**
* 查询任务状态
* @param taskId
* @return
*/
public Map<String,String> queryTaskStates(String taskId){
JSONObject jsonObject = null;
String progress=null ,state=null;
Map<String,String> map = new HashMap();
String status_url = REGIONAL_ANALYSIS_TASK_STATUS + "&taskId="+taskId;
String result = HttpUtil.getWaData(status_url);
//String statusStr = "{\"progress\":0.8,\"state\":\"TIMEOUT\"}";
if(null != result && result.startsWith("{")){
jsonObject = JSONObject.parseObject(result);
}
if(jsonObject!=null){
progress = jsonObject.getString("progress"); //进度
state = jsonObject.getString("state"); //状态
}
map.put("progress",progress);
map.put("state",state);
return map;
}
/**
* 去除重复数据
* @param list
......
......@@ -9,6 +9,7 @@ import com.founder.interservice.model.SysDictitem;
import com.founder.interservice.ryhx.model.TbStAsjAssist;
import com.founder.interservice.ryhx.model.TbStCqhotel;
import com.founder.interservice.ryhx.model.TbStCqhotelData;
import com.founder.interservice.ryhx.model.TbStCqwbdata;
import com.founder.interservice.ryhx.service.RyhxService;
import com.founder.interservice.ryhx.vo.TbStCqwbdataVOS;
import com.founder.interservice.service.DataService;
......@@ -121,47 +122,69 @@ public class RyhxController {
modelAndView.addObject("zjhm",zjhm);
return modelAndView;
}
/*旅店信息查询
查询表为TB_ST_CQHOTELDATA
网吧信息查询
查询表为TB_ST_CQWBDATA
* */
/**
* 旅店信息查询
* 查询表为TB_ST_CQHOTELDATA
* 网吧信息查询
* 查询表为TB_ST_CQWBDATA
*
* 同房间人,查询当天,同住一个房间的人
* 网吧信息,查所有上网记录
* @param zjhm 身份证号
* @return
*/
@RequestMapping(value = "/getLdjbxx",method = {RequestMethod.GET,RequestMethod.POST})
public ModelAndView getLdjbxx(String zjhm){
TbStCqhotelData tbStCqhotelData = null;
TbStCqhotel tbStCqhotel = null;
List<TbStCqhotel> listHotel = new ArrayList<>();
SysDictitem sysDictitem = new SysDictitem();
TbStCqwbdataVOS tbStCqwbdataVOS = null;
List<TbStCqwbdata> tbStCqwbdataList = null;//本人上网信息
List<TbStCqhotelData> listHotelData = null;//本人住店信息
List<TbStCqhotelData> listOtherHotelData = null;//本人同住人信息
try{
if(zjhm != null && !"".equals(zjhm)){
String idcode = zjhm;
//旅店信息
tbStCqhotelData = ryhxService.queryHotelxx(idcode);
String hotelno = tbStCqhotelData.getHotelno();
//疑似落脚点
if(hotelno != null && !"".equals(hotelno)){
tbStCqhotel = ryhxService.queryHotelAddr(hotelno);
//旅店住宿信息
listHotelData = ryhxService.queryHotelRzxx(zjhm);
if (listHotelData != null && listHotelData.size() > 0) {
for (TbStCqhotelData tbStCqhotelData: listHotelData) {
String hotelno = tbStCqhotelData.getHotelno();
String rzsj = tbStCqhotelData.getRzsj();
String roomno = tbStCqhotelData.getRoomno();
//疑似落脚点(旅店信息)
if(null != hotelno && !"".equals(hotelno)) {
tbStCqhotel = ryhxService.queryHotelAddr(hotelno);
listHotel.add(tbStCqhotel);
}
//根据旅店信息,查询同住人员信息
if (null != tbStCqhotel) {
listOtherHotelData = ryhxService.queryHotelxx(zjhm,hotelno,rzsj,roomno);
}
}
}
//网吧信息
tbStCqwbdataVOS = ryhxService.queryWbxx(zjhm);
if(tbStCqwbdataVOS != null) {
String wbxzqh = tbStCqwbdataVOS.getWbxzqh();
sysDictitem.setCode(wbxzqh);
sysDictitem.setGroupid("CODE_UNIT");
if (wbxzqh != null && !"".equals(wbxzqh)) {
String wbxzqhmc = sysDictService.getCodeName(sysDictitem);
tbStCqwbdataVOS.setWbxzqhmc(wbxzqhmc);
tbStCqwbdataList = ryhxService.queryWbxxList(zjhm);
if(tbStCqwbdataList != null && tbStCqwbdataList.size() > 0) {
for (TbStCqwbdata tbStCqwbdata : tbStCqwbdataList) {
String wbxzqh = tbStCqwbdata.getWbxzqh();
sysDictitem.setCode(wbxzqh);
sysDictitem.setGroupid("CODE_UNIT");
if (wbxzqh != null && !"".equals(wbxzqh)) {
String wbxzqhmc = sysDictService.getCodeName(sysDictitem);
tbStCqwbdata.setWbxzqhmc(wbxzqhmc);
}
}
}
}
}catch (Exception e){
e.printStackTrace();
}
ModelAndView modelAndView = new ModelAndView("ryhx/gjxx");
ModelAndView modelAndView = new ModelAndView();
modelAndView.setViewName("ryhx/gjxx");
modelAndView.addObject("zjhm",zjhm);
modelAndView.addObject("hotel",tbStCqhotelData);
modelAndView.addObject("hotela",tbStCqhotel);
modelAndView.addObject("wbxx",tbStCqwbdataVOS);
modelAndView.addObject("listOtherHotelData",listOtherHotelData);//同住人员住宿信息
modelAndView.addObject("listHotel",listHotel);//本人住宿的酒店信息
modelAndView.addObject("listHotelData",listHotelData);//本人住宿信息
modelAndView.addObject("wbxxList",tbStCqwbdataList);//本人网吧信息
return modelAndView;
}
......
......@@ -38,4 +38,7 @@ public class TbStCqhotelData {
private String gxsj;//更新时间
private String rzsj;//入住时间
private String ldsj;//离店时间
}
\ No newline at end of file
......@@ -6,6 +6,9 @@ import com.founder.interservice.ryhx.model.TbStCqwbdata;
import com.founder.interservice.ryhx.vo.TbStCqwbdataVOS;
import org.apache.poi.ss.formula.functions.T;
import java.util.List;
import java.util.Map;
/**
* @ClassName: RyhxService
* @Auther: 朱琳瑛
......@@ -17,9 +20,11 @@ public interface RyhxService {
TbStCqhotel queryHotelAddr(String hotelno) throws Exception;
TbStCqhotelData queryHotelxx(String idcode) throws Exception;
List<TbStCqhotelData> queryHotelxx(String zjhm, String hotelno, String rzsj, String roomno) throws Exception;
TbStCqwbdataVOS queryWbxx(String zjhm) throws Exception;
List<TbStCqwbdata> queryWbxxList(String zjhm) throws Exception;
String getAsjxxList(String ryhxSaxxUrl, String zjhm);
List<TbStCqhotelData> queryHotelRzxx(String zjhm);
}
......@@ -10,29 +10,41 @@ import com.founder.interservice.util.HttpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class RyhxServiceImpl implements RyhxService {
@Autowired
private RyhxMapper ryhxMapper;
/*根据旅店编号查询旅店地址*/
/*根据旅店编号查询旅店地址*/
@Override
public TbStCqhotel queryHotelAddr(String hotelno)throws Exception {
TbStCqhotel tbStCqhotel = ryhxMapper.queryHotelAddr(hotelno);
return tbStCqhotel;
}
/*根据旅店编号查找旅店详细信息*/
/*根据旅店编号查找旅店所有同房间人员住宿信息*/
@Override
public TbStCqhotelData queryHotelxx(String idcode) throws Exception{
TbStCqhotelData tbStCqhotelData = ryhxMapper.queryHotelDetail(idcode);
return tbStCqhotelData;
public List<TbStCqhotelData> queryHotelxx(String zjhm, String hotelno, String rzsj, String roomno) throws Exception{
Map<String, String> map = new HashMap<>();
map.put("zjhm",zjhm);
map.put("hotelno",hotelno);
if(null != rzsj && !"".equals(rzsj)){
rzsj = rzsj.substring(0,10);
}
map.put("rzsj",rzsj);
map.put("roomno",roomno);
List<TbStCqhotelData> tbStCqhotelDataList = ryhxMapper.queryHotelDetail(map);
return tbStCqhotelDataList;
}
/*根据证件号码查询网吧表网吧信息*/
@Override
public TbStCqwbdataVOS queryWbxx(String zjhm) throws Exception{
TbStCqwbdataVOS tbStCqwbdataVOS = ryhxMapper.queryWbxx(zjhm);
return tbStCqwbdataVOS;
public List<TbStCqwbdata> queryWbxxList(String zjhm) throws Exception{
List<TbStCqwbdata> tbStCqwbdataList = ryhxMapper.queryWbxxList(zjhm);
return tbStCqwbdataList;
}
@Override
......@@ -47,4 +59,10 @@ public class RyhxServiceImpl implements RyhxService {
}
return jsonStr;
}
@Override
public List<TbStCqhotelData> queryHotelRzxx(String zjhm) {
List<TbStCqhotelData> tbStCqhotelDataRzxxList = ryhxMapper.queryHotelRzxx(zjhm);
return tbStCqhotelDataRzxxList;
}
}
......@@ -177,4 +177,10 @@
group by TASK_ID, OBJECT_TYPE, OBJECT_VALUE
having count(*) > 1 )
</delete>
<select id = "getAllResultsByTaskid" parameterType = "String" resultType="int" >
select count(*)
from TB_ST_DZGZTASKRESULT
where TASK_ID = #{taskId}
</select>
</mapper>
\ No newline at end of file
......@@ -3,34 +3,34 @@
<mapper namespace="com.founder.interservice.mapper.xzxt.RyhxMapper">
<sql id = "getHoteldetail_where">
<if test="xxzjbh != null and xxzjbh != ''">
and xxzjbh = #{xxzjbh}
and xxzjbh = #{xxzjbh, jdbcType=VARCHAR}
</if>
<if test="xm != null and xm != ''">
and xm = #{xm}
and xm = #{xm, jdbcType=VARCHAR}
</if>
<if test="py != null and py != ''">
and py = #{py}
and py = #{py, jdbcType=VARCHAR}
</if>
<if test="idcode != null and idcode != ''">
and idcode = #{idcode}
and idcode = #{idcode, jdbcType=VARCHAR}
</if>
<if test="csrq != null and csrq != ''">
and csrq = #{csrq}
</if>
<if test="xb != null and xb != ''">
and xb = #{xb}
and xb = #{xb, jdbcType=VARCHAR}
</if>
<if test="mz != null and mz != ''">
and mz = #{mz}
and mz = #{mz, jdbcType=VARCHAR}
</if>
<if test="address != null and address != ''">
and address = #{address}
and address = #{address, jdbcType=VARCHAR}
</if>
<if test="hotelno != null and hotelno != ''">
and hotelno = #{hotelno}
and hotelno = #{hotelno, jdbcType=VARCHAR}
</if>
<if test="roomno != null and roomno != ''">
and roomno = #{roomno}
and roomno = #{roomno, jdbcType=VARCHAR}
</if>
<if test="createtime != null and createtime != ''">
and createtime = #{createtime}
......@@ -60,23 +60,70 @@
gxsj as gxsj,
rksj as rksj
from TB_ST_CQHOTEL
where HNO = #{hotelno}
where HNO = #{hotelno, jdbcType=VARCHAR}
</select>
<select id="queryHotelDetail" parameterType="String" resultType="com.founder.interservice.ryhx.model.TbStCqhotelData">
select
<!-- 查询某旅店所有同住人员住店信息 -->
<select id="queryHotelDetail" parameterType="java.util.Map" resultType="com.founder.interservice.ryhx.model.TbStCqhotelData">
select xxzjbh as xxzjbh,
xm as xm,
py as py,
idcode as idcode,
to_char(csrq,'yyyy-MM-dd hh24:mi:ss') as csrq,
xb as xb,
mz as mz,
address as address,
hotelno as hotelno,
roomno as roomno,
to_char(createtime,'yyyy-MM-dd hh24:mi:ss') as createtime,
to_char(rksj,'yyyy-MM-dd hh24:mi:ss') as rksj,
to_char(gxsj,'yyyy-MM-dd hh24:mi:ss') as gxsj,
to_char(rzsj,'yyyy-MM-dd hh24:mi:ss') as rzsj,
to_char(ldsj,'yyyy-MM-dd hh24:mi:ss') as ldsj
from TB_ST_CQHOTELDATA
where 1=1
<if test="zjhm != null and zjhm != ''">
and IDCODE <![CDATA[!=]]> #{zjhm, jdbcType=VARCHAR}
</if>
<if test="hotelno != null and hotelno != ''">
and HOTELNO = #{hotelno, jdbcType=VARCHAR}
</if>
<if test="roomno != null and roomno != ''">
and ROOMNO = #{roomno, jdbcType=VARCHAR}
</if>
<if test="rzsj!=null and rzsj!=''">
and RZSJ <![CDATA[>=]]> (to_date(#{rzsj, jdbcType=VARCHAR},'yyyy-MM-dd') - numtodsinterval(10,'hour'))
and RZSJ <![CDATA[<=]]> (to_date(#{rzsj, jdbcType=VARCHAR},'yyyy-MM-dd') + numtodsinterval(14,'hour'))
</if>
</select>
<!-- 查询本人所有旅店入住信息-->
<select id="queryHotelRzxx" parameterType="java.util.Map" resultType="com.founder.interservice.ryhx.model.TbStCqhotelData">
select xxzjbh as xxzjbh,
xm as xm,
py as py,
idcode as idcode,
to_char(csrq,'yyyy-MM-dd hh24:mi:ss') as csrq,
xb as xb,
mz as mz,
address as address,
hotelno as hotelno,
createtime as createtime,
rksj as rksj,
gxsj as gxsj
roomno as roomno,
to_char(createtime,'yyyy-MM-dd hh24:mi:ss') as createtime,
to_char(rksj,'yyyy-MM-dd hh24:mi:ss') as rksj,
to_char(gxsj,'yyyy-MM-dd hh24:mi:ss') as gxsj,
to_char(rzsj,'yyyy-MM-dd hh24:mi:ss') as rzsj,
to_char(ldsj,'yyyy-MM-dd hh24:mi:ss') as ldsj
from TB_ST_CQHOTELDATA
where IDCODE = #{idcode}
where IDCODE = #{zjhm, jdbcType=VARCHAR}
</select>
<select id="queryWbxx" parameterType="String" resultType="com.founder.interservice.ryhx.vo.TbStCqwbdataVOS">
<select id="queryWbxxList" parameterType="String" resultType="com.founder.interservice.ryhx.model.TbStCqwbdata">
select
wbmc as wbmc,
wbxzqh as wbxzqh,
wbdz as wbdz
from TB_ST_CQWBDATA
where ZJHM = #{zjhm}
where ZJHM = #{zjhm, jdbcType=VARCHAR}
</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