Commit ea3a77e0 by 雷紫添

Merge remote-tracking branch 'remotes/origin/master'

parents 0153f47e 97bd1935
......@@ -383,11 +383,5 @@ public class StAsjXxtqController extends BladeController {
}
}
@RequestMapping("/addSjjc")
@ResponseBody
public R addSjjc(){
xxtqService.getMyCzrz();
return R.ok();
}
}
......@@ -506,52 +506,67 @@
and (now() - la.SPSJ) <![CDATA[>]]> '5'
</if>
</if>
<!--案件业务状态查询条件-->
<if test="ajzt!=null and ajzt!=''" >
<if test="laywsjztList !=null and zczjywsjztList == null" >
AND (
and ((
<foreach collection="laywsjztList" item="item" open="(" separator="or" close=")">
<if test="item == '00'">
asjcz.laywsjzt is null or asjcz.laywsjzt = '' or asjcz.laywsjzt = #{item , jdbcType=VARCHAR }
</if>
<if test=" item != null and item != null and item != '00'">
<if test=" item != null and item != '' and item != '00' and item != '05'">
asjcz.laywsjzt = #{item , jdbcType=VARCHAR }
</if>
</foreach>
and (asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = ''))
<if test=" sfcxajPdbz != null and sfcxajPdbz != ''">
or asjcz.laywsjzt = '05'
</if>
)
</if>
<if test="laywsjztList ==null and zczjywsjztList == null and sfcxajPdbz !=null and sfcxajPdbz != ''" >
and asjcz.laywsjzt = '05'
</if>
<if test="zczjywsjztList != null and laywsjztList == null" >
AND asjcz.laywsjzt = '02' and
and (( asjcz.laywsjzt = '02' and
<foreach collection="zczjywsjztList" item="item" open="(" separator="or" close=")">
<if test="item == '00'">
asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '' or asjcz.zczjywsjzt = #{item , jdbcType=VARCHAR }
asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '' or asjcz.zczjywsjzt =
#{item , jdbcType=VARCHAR }
</if>
<if test=" item != null and item != null and item != '00'">
<if test=" item != null and item != '' and item != '00'">
asjcz.zczjywsjzt = #{item , jdbcType=VARCHAR }
</if>
</foreach>
</foreach>)
<if test=" sfcxajPdbz != null and sfcxajPdbz != ''">
or asjcz.laywsjzt = '05'
</if>
)
</if>
<if test="zczjywsjztList != null and laywsjztList != null" >
AND ((
and ((
<foreach collection="laywsjztList" item="item" open="(" separator="or" close=")">
<if test="item == '00'">
asjcz.laywsjzt is null or asjcz.laywsjzt = '' or asjcz.laywsjzt = #{item , jdbcType=VARCHAR }
</if>
<if test=" item != null and item != null and item != '00'">
<if test=" item != null and item != '' and item != '00' and item != '05'">
asjcz.laywsjzt = #{item , jdbcType=VARCHAR }
</if>
</foreach>
and (asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = ''))
<if test=" sfcxajPdbz != null and sfcxajPdbz != ''">
or asjcz.laywsjzt = '05'
</if>
or (asjcz.laywsjzt = '02' and
<foreach collection="zczjywsjztList" item="item" open="(" separator="or" close=")">
<if test="item == '00'">
asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '' or asjcz.zczjywsjzt = #{item , jdbcType=VARCHAR }
</if>
<if test=" item != null and item != null and item != '00'">
<if test=" item != null and item != '' and item != '00'">
asjcz.zczjywsjzt = #{item , jdbcType=VARCHAR }
</if>
</foreach>))
</if>
</if>
<if test="typeFlag=='toSq'" ><!--涉枪信息查询列表 -->
......
......@@ -14,15 +14,23 @@ import org.springblade.founder.glasjry.service.ITbGlAsjRyService;
import org.springblade.founder.rybh.entity.XwRybh;
import org.springblade.founder.rybh.service.IXwRybhService;
import org.springblade.founder.utils.HttpClientUtil;
import org.springblade.founder.utils.HttpUtil;
import org.springblade.founder.utils.R;
import org.springblade.founder.xtrz.entity.SysGnsyrz;
import org.springblade.founder.xtrz.mapper.XtrzMapper;
import org.springblade.founder.xtrz.service.IXtrzService;
import org.springblade.founder.zbfzxyr.entity.XwZbfzxyr;
import org.springblade.founder.zbfzxyr.service.IXwZbfzxyrService;
import org.springblade.modules.auth.utils.TokenUtil;
import org.springblade.modules.system.entity.XzxtUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.awt.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.List;
import org.springblade.founder.utils.DataFormatUtil;
......@@ -35,6 +43,8 @@ public class StAsjXxtqService {
@Autowired
private ITbXwBaService tbXwBaService;
@Autowired
private IXtrzService xtrzService;
@Autowired
private IXwRybhService xwRybhService;
@Autowired
private ITbGlAsjRyService glAsjRyService;
......@@ -192,6 +202,8 @@ public class StAsjXxtqService {
String token = getToken();
TbStAsj tbStAsj = getTbStAsj(asjbh);
if (tbStAsj==null){
XzxtUser user = SecureUtil.getUserXzxt();
xtrzService.addAjtqGnsyrz(user,"01","提取案件基本信息",asjbh);
getSysjjcUrl(asjbh,token);
}
if(data!=null){
......@@ -207,7 +219,7 @@ public class StAsjXxtqService {
}
return R.ok().data("data",data);
}else{
String detailUrl = getDetailUrl(asjbh,token);
String detailUrl = getDetailUrl(asjbh);
return R.error().data("detailUrl",detailUrl).message("案件信息为空,无法提取。"+getLxrAndLxfs());
}
}
......@@ -222,6 +234,8 @@ public class StAsjXxtqService {
String token = getToken();
TbStAsj tbStAsj = getTbStAsj(asjbh);
if (tbStAsj!=null){
XzxtUser user = SecureUtil.getUserXzxt();
xtrzService.addAjtqGnsyrz(user,"01","提取犯罪嫌疑人信息信息",asjbh);
getSysjjcUrl(asjbh,token);
}
if(data!=null && !data.isEmpty()){
......@@ -283,7 +297,7 @@ public class StAsjXxtqService {
if(!StringUtils.isEmpty(errorMsg)){
msg += "<br/>"+errorMsg;
}
String detailUrl = getDetailUrl(asjbh,token);
String detailUrl = getDetailUrl(asjbh);
return R.error().data("detailUrl",detailUrl).message(msg);
}else{
if(!StringUtils.isEmpty(errorMsg)){
......@@ -294,7 +308,7 @@ public class StAsjXxtqService {
}
}
}else{
String detailUrl = getDetailUrl(asjbh,token);
String detailUrl = getDetailUrl(asjbh);
return R.error().data("detailUrl",detailUrl).message("全国基础库抓捕犯罪嫌疑人信息无数据,暂时无法提取。"+getLxrAndLxfs());
}
}
......@@ -309,6 +323,8 @@ public class StAsjXxtqService {
String token = getToken();
TbStAsj tbStAsj = getTbStAsj(asjbh);
if (tbStAsj!=null){
XzxtUser user = SecureUtil.getUserXzxt();
xtrzService.addAjtqGnsyrz(user,"01","提取案件基本信息",asjbh);
getSysjjcUrl(asjbh,token);
}
if(data!=null && !data.isEmpty()){
......@@ -370,7 +386,7 @@ public class StAsjXxtqService {
if(!StringUtils.isEmpty(errorMsg)){
msg += "<br/>"+errorMsg;
}
String detailUrl = getDetailUrl(asjbh,token);
String detailUrl = getDetailUrl(asjbh);
return R.error().data("detailUrl",detailUrl).message(msg);
}else{
if(!StringUtils.isEmpty(errorMsg)){
......@@ -381,7 +397,7 @@ public class StAsjXxtqService {
}
}
}else{
String detailUrl = getDetailUrl(asjbh,token);
String detailUrl = getDetailUrl(asjbh);
return R.error().data("detailUrl",detailUrl).message("全国基础库被害人信息无数据,暂时无法提取。"+getLxrAndLxfs());
}
}
......@@ -438,14 +454,64 @@ public class StAsjXxtqService {
}
//获取思悦数据详情页面地址
private String getDetailUrl(String asjbh,String token) {
private String getDetailUrl(String asjbh) {
String url = "http://10.2.164.178:8058/db/fzAj/"+asjbh;
System.out.println("url*************:"+url);
String upid = getUpid(url);
for (int i = 1; i < 5; i++){
if (!StringUtils.isEmpty(upid)) {
if ("0".equals(upid)) {
System.out.println("upid正在入库:" + upid);
upid = getUpid(url);
}else {
System.out.println("upid已获取到:" + upid);
break;
}
}else {
System.out.println("获取upid失败");
break;
}
}
System.out.println("upid-------------------------------"+upid);
String detailUrl = "";
if (token!=null){
detailUrl = "http://10.2.164.178:8086/dataDetection/#/testing?ajbh="+asjbh+"&token="+token;
if (upid!=null&&!"0".equals(upid)){
detailUrl = "http://10.2.164.178:8086/dataDetection/#/testing?upid="+upid;
System.out.println("============================get upid success:"+detailUrl+"===========================");
}
return detailUrl;
}
//获取思悦日志快照的upid
private String getUpid(String url){
String resultStr = null;
try {
Thread.sleep(1000);
resultStr = HttpUtil.doGet(url);
} catch (Exception e) {
e.printStackTrace();
}
String upid = null;
if(!StringUtils.isEmpty(resultStr)){
try {
JSONObject result = JSON.parseObject(resultStr);
System.out.println("result**************:"+result);
if(result!=null){
upid = result.getString("data");
}else{
System.out.println("获取思悦数据详情页面upid返回值没有data。返回结果:"+resultStr);
}
} catch (Exception e) {
System.out.println("解析思悦数据详情页面upid返回值发生异常。"+resultStr);
e.printStackTrace();
}
}else{
System.out.println("获取思悦数据详情页面upid没有返回值。");
}
return upid;
}
//根据思悦给的地址生成Token
private String getToken(){
XzxtUser xzxtUser = SecureUtil.getUserXzxt();
......@@ -479,7 +545,7 @@ public class StAsjXxtqService {
}
//请求思悦数据检测详情页面地址
//请求思悦记录数据检测日志接口
public void getSysjjcUrl(String asjbh,String token){
String url = "http://10.2.164.178:8058/db/fzAj";
String json = "{\"ajbh\":\""+asjbh+"\"}";
......@@ -577,31 +643,4 @@ public class StAsjXxtqService {
return ajDetailService.getAsjByAsjbh(asjbh);
}
public void getMyCzrz(){
List<TbStAsj> list = ajDetailService.getAsjByRsksj();
for (TbStAsj tbStAsj:list) {
String asjbh = tbStAsj.getAsjbh();
String zjhm = tbStAsj.getXxdjryGmsfhm();
String tokenYrl="http://10.2.164.178:8058/sys/oauth2/token";
Map<String,String> param = new HashMap<>();
param.put("username",zjhm);
String resultStr = null;
try {
resultStr = HttpClientUtil.doGet(tokenYrl,param);
} catch (Exception e) {
e.printStackTrace();
}
String token = null;
JSONObject result = JSON.parseObject(resultStr);
if(result!=null){
token = result.getString("data");
}else{
System.out.println("获取思悦数据详情页面token返回值没有data。返回结果:"+resultStr);
}
getSysjjcUrl(asjbh,token);
}
}
}
......@@ -160,13 +160,13 @@ public class AjspServiceImpl implements IAjspService {
deteilMap.put("zczjyj",sfNotNull(tbStAsj.getZczjZcxwyjms()));
deteilMap.put("pasd",sfNotNull(tbStAsj.getPasddm()));
String fayy = tbStAsj.getZadjdm();//发案原因
if(StringUtils.isNotEmpty(fayy) && !"待定".equals(fayy)&&!"其他".equals(fayy)){
if(StringUtils.isNotEmpty(fayy) && !"待定".equals(fayy)){
deteilMap.put("fayy","1");
}else {
deteilMap.put("fayy","0");
}
String zasd = tbStAsj.getTssddm();//作案手段(作案工具)
if(StringUtils.isNotEmpty(zasd) && !"待定".equals(zasd)&&!"其他".equals(zasd)){
if(StringUtils.isNotEmpty(zasd) && !"待定".equals(zasd)){
deteilMap.put("zasd","1");
}else {
deteilMap.put("zasd","0");
......@@ -194,7 +194,7 @@ public class AjspServiceImpl implements IAjspService {
deteilMap.put("ajdy",sfNotNull(tbStAsj.getAsjfsddDylbdm()));
deteilMap.put("sacs",sfNotNull(tbStAsj.getAsjfsddSacsSacslbdm()));
String zasd = tbStAsj.getTssddm();//作案手段(作案工具)
if(StringUtils.isNotEmpty(zasd) && !"待定".equals(zasd)&&!"其他".equals(zasd)){
if(StringUtils.isNotEmpty(zasd) && !"待定".equals(zasd)){
deteilMap.put("zasd","1");
}else {
deteilMap.put("zasd","0");
......@@ -224,7 +224,7 @@ public class AjspServiceImpl implements IAjspService {
deteilMap.put("pasd",sfNotNull(tbStAsj.getPasddm()));
String fayy = tbStAsj.getZadjdm();//发案原因
if(StringUtils.isNotEmpty(fayy) && !"待定".equals(fayy)&&!"其他".equals(fayy)){
if(StringUtils.isNotEmpty(fayy) && !"待定".equals(fayy)){
deteilMap.put("fayy","1");
}else {
deteilMap.put("fayy","0");
......
......@@ -74,8 +74,13 @@ public class MaAsjglServiceImpl implements IMaAsjglService {
}
String[] ajzt = tbStAsj.getAjzt();
Map<String, List<String>> map = StringUtil.getAjzt(ajzt);
List<String> ycxajList = map.get("ycxajList");
tbStAsj.setLaywsjztList(map.get("laztList"));
tbStAsj.setZczjywsjztList(map.get("zczjztList"));
if (ycxajList!=null&&ycxajList.size()>0){
tbStAsj.setSfcxajPdbz("1");
}
Integer totalCount=queryAllMaAsjxxTotalCount(tbStAsj);
List<TbStAsj> maAsjList=tbStAsjMapper.queryAllMaAsjxx(tbStAsj);
Map<String, Object> resultMapHtml = new HashMap<>();
......@@ -164,6 +169,15 @@ public class MaAsjglServiceImpl implements IMaAsjglService {
/*tbStAsj.setXxdjdwGajgjgdm(null);*/
tbStAsj.setDefaultGajgjgdm(xzxtUser.getUnitcode());
}
String[] ajzt = tbStAsj.getAjzt();
Map<String, List<String>> map = StringUtil.getAjzt(ajzt);
List<String> ycxajList = map.get("ycxajList");
tbStAsj.setLaywsjztList(map.get("laztList"));
tbStAsj.setZczjywsjztList(map.get("zczjztList"));
if (ycxajList!=null&&ycxajList.size()>0){
tbStAsj.setSfcxajPdbz("1");
}
List<TbStAsj> ryAsjxx = tbStAsjMapper.queryDupliRyAsjxx(tbStAsj);
Integer count = tbStAsjMapper.queryDupliRyAsjxxTotalCount(tbStAsj);
Map<String, Object> resultMapHtml = new HashMap<>();
......
......@@ -142,10 +142,13 @@ public class StringUtil {
List<String> ajztList = Arrays.asList(ajzt);
List<String> laztList = new ArrayList<>();
List<String> zczjztList = new ArrayList<>();
List<String> ycxajList = new ArrayList<>();
for (String ajywzt : ajztList) {
if ("00".equals(ajywzt) || "01".equals(ajywzt) || "02".equals(ajywzt) || "03".equals(ajywzt) || "05".equals(ajywzt)) {
if ("00".equals(ajywzt) || "01".equals(ajywzt) || "02".equals(ajywzt) || "03".equals(ajywzt)) {
laztList.add(ajywzt);
} else if ("06".equals(ajywzt)){
}else if ("05".equals(ajywzt)){
ycxajList.add("05");
}else if ("06".equals(ajywzt)){
zczjztList.add("00");
}else if ("07".equals(ajywzt)){
zczjztList.add("01");
......@@ -163,6 +166,7 @@ public class StringUtil {
}
map.put("laztList", laztList);
map.put("zczjztList", zczjztList);
map.put("ycxajList", ycxajList);
}
return map;
}
......
......@@ -50,7 +50,9 @@ import org.springblade.core.boot.ctrl.BladeController;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 控制器
......@@ -160,7 +162,10 @@ public class XwRybhController extends BladeController {
QueryWrapper queryWrapper = new QueryWrapper();
//queryWrapper.eq("asjbh",xwRybh.getAsjbh());
//queryWrapper.eq("bhrAsjxgrybh",xwRybh.getBhrAsjxgrybh());
queryWrapper.eq("xxzjbh",xwRybh.getXxzjbh());
Map<String , Object> map = new HashMap<>();
map.put("xxzjbh",xwRybh.getXxzjbh());
map.put("xxscPdbz" , "0");
queryWrapper.allEq(map);
int r = xwRybhService.count(queryWrapper);
if(r>0){
UpdateWrapper wrapper = new UpdateWrapper();
......
......@@ -30,8 +30,8 @@ public class HttpUtil {
// Prepare a request object
HttpGet httpget = new HttpGet(uri);
RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(5000).setConnectionRequestTimeout(5000).setSocketTimeout(5000).build();
httpget.setConfig(requestConfig);
// RequestConfig requestConfig = RequestConfig.custom().setConnectTimeout(5000).setConnectionRequestTimeout(5000).setSocketTimeout(5000).build();
// httpget.setConfig(requestConfig);
// Execute the request
HttpResponse response = null;
try {
......
......@@ -4,15 +4,13 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springblade.core.secure.utils.SecureUtil;
import org.springblade.founder.utils.R;
import org.springblade.founder.xtrz.service.xtrzService;
import org.springblade.founder.xtrz.service.IXtrzService;
import org.springblade.modules.system.entity.XzxtUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* Created by libin on 2018/4/12.
* 登录控制类
......@@ -22,7 +20,7 @@ public class XtrzController {
private Logger log= LoggerFactory.getLogger(this.getClass());
@Autowired
private xtrzService loginService;
private IXtrzService loginService;
@RequestMapping("/addSysDlrz")
@ResponseBody
......
......@@ -6,7 +6,9 @@ import org.springblade.modules.system.entity.XzxtUser;
/**
* Created by libin on 2018/4/12.
*/
public interface xtrzService {
public interface IXtrzService {
String saveSysDlrz(XzxtUser user) throws Exception;
void addAjtqGnsyrz(XzxtUser user,String czxxLbdm,String yymcJyqk,String czxxParam);
}
package org.springblade.founder.xtrz.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.springblade.founder.xtrz.entity.SysDlrz;
import org.springblade.founder.xtrz.entity.SysGnsyrz;
import org.springblade.founder.xtrz.mapper.XtrzMapper;
import org.springblade.founder.xtrz.service.xtrzService;
import org.springblade.founder.xtrz.service.IXtrzService;
import org.springblade.modules.auth.utils.TokenUtil;
import org.springblade.modules.system.entity.XzxtUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -18,7 +17,7 @@ import java.util.*;
* Created by libin on 2018/4/12.
*/
@Service
public class XtrzServiceImpl implements xtrzService {
public class IXtrzServiceImpl implements IXtrzService {
@Autowired
private XtrzMapper loginDao;
......@@ -63,6 +62,68 @@ public class XtrzServiceImpl implements xtrzService {
return rzlsh;
}
//记录功能使用日志
@Override
@DS("db1")
public void addAjtqGnsyrz(XzxtUser user,
String czxxLbdm,
String yymcJyqk, String czxxParam) {
//拼接日志流水号
//公安机关机构代码(前6位)
String qlw = user.getUnitcode().substring(0, 6);
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
//8位年月日
String sjdate = formatter.format(new Date());
String lsh = getOrderIdByUUId();
String yrzlsh = qlw + sjdate + lsh;
String rzlsh = yrzlsh.replace(" ", "");
SysGnsyrz sysGnsyrz = new SysGnsyrz();
sysGnsyrz.setRzlsh(rzlsh);
sysGnsyrz.setYymcJyqk(yymcJyqk);
sysGnsyrz.setYhGmsfhm(user.getIdentitycard());
// 1.6新增字段
sysGnsyrz.setYhXm(user.getRealname());
sysGnsyrz.setYymcdm("");
sysGnsyrz.setYwbhlxdm("");
sysGnsyrz.setYwbh("");
sysGnsyrz.setCxnrlbdm("");
sysGnsyrz.setCxnrbh("");
sysGnsyrz.setCxxxjg("");
String ip = "";
try {
ip = TokenUtil.getIp();
}catch (Exception e) {
e.printStackTrace();
}
sysGnsyrz.setYhIp(ip);
sysGnsyrz.setYhdwGajgjgdm(user.getUnitcode());
sysGnsyrz.setYhdwGajgmc(user.getUnitname());
sysGnsyrz.setCzlxdm(czxxLbdm);
sysGnsyrz.setCzxxJyqk(czxxParam);
sysGnsyrz.setXxscPdbz("0");
sysGnsyrz.setXxdjdwGajgjgdm(user.getUnitcode());
sysGnsyrz.setXxdjdwGajgmc(user.getUnitname());
sysGnsyrz.setXxdjryXm(user.getRealname());
sysGnsyrz.setXxdjryGmsfhm(user.getIdentitycard());
sysGnsyrz.setXxdjryLxdh(user.getPhone());
sysGnsyrz.setXxczdwGajgjgdm(user.getUnitcode());
sysGnsyrz.setXxczdwGajgmc(user.getUnitname());
sysGnsyrz.setXxczryXm(user.getRealname());
sysGnsyrz.setXxczryGmsfhm(user.getIdentitycard());
sysGnsyrz.setXxlyms("系统功能日志");
sysGnsyrz.setXtlx("MAXT");
try {
loginDao.addGnsyrz(sysGnsyrz);
} catch (Exception e) {
e.printStackTrace();
}
}
public static String getOrderIdByUUId() {
int machineId = 1;//最大支持1-9个集群机器部署
int hashCodeV = UUID.randomUUID().toString().hashCode();
......
......@@ -50,7 +50,9 @@ import org.springblade.core.boot.ctrl.BladeController;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 控制器
......@@ -87,7 +89,10 @@ public class XwZbfzxyrController extends BladeController {
xwZbfzxyr.setXxscPdbz("0");
boolean flag = false;
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("xxzjbh",xwZbfzxyr.getXxzjbh());
Map<String , Object> map = new HashMap<>();
map.put("xxzjbh",xwZbfzxyr.getXxzjbh());
map.put("xxscPdbz" , "0");
queryWrapper.allEq(map);
int r = xwZbfzxyrService.count(queryWrapper);
if(r>0){
UpdateWrapper wrapper = new UpdateWrapper();
......
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