Commit 8d47562a by 雷紫添

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

parents 64d79fc0 b807e852
......@@ -71,19 +71,6 @@ public class AjDetailController {
int end = easyUIPage.getEnd();
List<TbXwZbfzxyr> xyrs = ajDetailService.getFzxyrxxByAsjbh(tbStAsj.getAsjbh(),begin,end);
if(xyrs != null){
QgckzpUtil getzp = new QgckzpUtil(); //全国常用库查人员照片
for(TbXwZbfzxyr tbXwXyr : xyrs){
//数据库中没有嫌疑人的正面照片,则调用全国常口
if (StringUtils.isEmpty(tbXwXyr.getRyzpZjhm())) {
String zjhm = tbXwXyr.getZjhm();
if (!StringUtils.isEmpty(zjhm)) {
String ryzp = getzp.getQgckZpXml(zjhm);//获取人员照片
tbXwXyr.setRyzpZjhm(ryzp);
}
}
}
}
Map<String,Object> map=new HashedMap();
map.put("rows",xyrs);
map.put("total",ajDetailService.getFzxyrxxByAsjbhTotalCount(tbStAsj.getAsjbh()));
......@@ -93,6 +80,7 @@ public class AjDetailController {
throw new RuntimeException(e);
}
}
/**
* 根据案事件编号查询案件下的被害人集合
* @return
......@@ -109,20 +97,6 @@ public class AjDetailController {
int end = easyUIPage.getEnd();
List<TbXwRybh> tbXwRybhList= ajDetailService.getRybhxxByAsjbh(tbStAsj.getAsjbh(),begin,end);//根据案件编号查询人员被害信息
if(tbXwRybhList != null){
QgckzpUtil getzp = new QgckzpUtil(); //全国常用库查人员照片
for(TbXwRybh tbXwBhr : tbXwRybhList){
//数据库中没有被害人的照片,则调用全国常口
if (StringUtils.isEmpty(tbXwBhr.getRyzpZjhm())) {
String zjhm = tbXwBhr.getBhrCyzjZjhm();
if (!StringUtils.isEmpty(zjhm)) {
String ryzp = getzp.getQgckZpXml(zjhm);//获取人员照片
tbXwBhr.setRyzpZjhm(ryzp);
}
}
}
}
Map<String,Object> map=new HashedMap();
map.put("rows",tbXwRybhList);
map.put("total",ajDetailService.getRybhxxByAsjbhTotalCount(tbStAsj.getAsjbh()));
......@@ -133,6 +107,23 @@ public class AjDetailController {
}
}
/**
* 根据案事件编号查询案件下的嫌疑人集合
* @return
*/
@RequestMapping("/getQgryckzp")
@ResponseBody
public R getQgryckzp(String zjhm){
try {
QgckzpUtil getzp = new QgckzpUtil(); //全国常用库查人员照片
String ryzp = getzp.getQgckZpXml(zjhm);//获取人员照片
return R.ok().data("ryzpZjhm",ryzp);
}catch (Exception e){
e.printStackTrace();
return R.ok().data("ryzpZjhm","");
}
}
// 报案人列表接口
@RequestMapping(value = "/ryxxBar")
@ResponseBody
......@@ -365,5 +356,4 @@ public class AjDetailController {
}
......@@ -382,4 +382,12 @@ public class StAsjXxtqController extends BladeController {
return true;
}
}
@RequestMapping("/addSjjc")
@ResponseBody
public R addSjjc(){
xxtqService.getMyCzrz();
return R.ok();
}
}
......@@ -18,6 +18,7 @@ public interface AjDetailMapper {
public TbStAsj getTbStAsjByAsjbh(String asjbh);
public TbStAsj getAsjByAsjbh(String asjbh);
public List<TbStAsj> getAsjByRsksj();
public List<TbXwZbfzxyr> getFzxyrxxByAsjbh(Map map);
public Integer getFzxyrxxByAsjbhTotalCount(String asjbh);
public List<TbXwRybh> getRybhxxByAsjbh(Map map);
......
......@@ -212,7 +212,16 @@
from TB_ST_ASJ asj
WHERE asj.asjbh=#{asjbh,jdbcType=VARCHAR}
and asj.xxsc_pdbz='0'
</select>
<select id="getAsjByRsksj" resultType="org.springblade.founder.asj.entity.TbStAsj" >
select
xxrsksj as xxrsksj,
asjbh as asjbh,
xxdjry_gmsfhm as xxdjryGmsfhm
from TB_ST_ASJ
WHERE xxrsksj <![CDATA[>=]]> DATE_FORMAT('2021-07-29','%Y%m%d')
and xxsc_pdbz='0'
</select>
<select id="getFzxyrxxByAsjbh" parameterType="java.util.Map" resultType="org.springblade.founder.asj.entity.TbXwZbfzxyr">
......
......@@ -520,7 +520,7 @@
and (asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = ''))
</if>
<if test="zczjywsjztList != null and laywsjztList == null" >
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 }
......@@ -541,7 +541,7 @@
</if>
</foreach>
and (asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = ''))
or
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 }
......@@ -549,7 +549,7 @@
<if test=" item != null and item != null and item != '00'">
asjcz.zczjywsjzt = #{item , jdbcType=VARCHAR }
</if>
</foreach>)
</foreach>))
</if>
</if>
......
......@@ -329,7 +329,7 @@
WHERE asj.xxsc_pdbz = '0'
AND asj.sfma_pdbz = '1'
AND year(asj.larq)=year(now())
AND (((asjcz.laywsjzt is not null or asjcz.laywsjzt != '') and asjcz.laywsjzt!='02') or asjcz.laywsjzt is null or asjcz.laywsjzt='' )
AND (((asjcz.laywsjzt is not null and asjcz.laywsjzt != '') and asjcz.laywsjzt!='02' and asjcz.laywsjzt!='05') or asjcz.laywsjzt is null or asjcz.laywsjzt='' )
<if test="unitcode != null and unitcode !=''">
and asj.LADW_GAJGJGDM in (SELECT code FROM code_gxs WHERE CODE_LEV1 =#{unitcode, jdbcType=VARCHAR} or CODE_LEV2 =#{unitcode, jdbcType=VARCHAR} or CODE_LEV3 =#{unitcode, jdbcType=VARCHAR} or CODE_LEV4 =#{unitcode, jdbcType=VARCHAR} or CODE_LEV5 =#{unitcode, jdbcType=VARCHAR})
</if>
......@@ -361,7 +361,7 @@
FROM tb_st_asj asj LEFT JOIN tb_xw_asjcz asjcz on asj.asjbh = asjcz.asjbh
<include refid="common-condition"/>
AND year(asj.larq)=year(now())
AND (((asjcz.zczjywsjzt is not null or asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND (((asjcz.zczjywsjzt is not null and asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
</select>
......
......@@ -1424,18 +1424,18 @@
AND asjcz.laywsjzt = '02' and asjcz.zczjywsjzt='03'
</if>
<if test="gzt_type == '06'"><!--立案即将超期-->
AND (((asjcz.laywsjzt is not null or asjcz.laywsjzt != '') and asjcz.laywsjzt!='02') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND (((asjcz.laywsjzt is not null and asjcz.laywsjzt != '') and asjcz.laywsjzt!='02' and asjcz.laywsjzt!='05') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,now())<![CDATA[>=]]>21 and TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,now())<![CDATA[<]]>24
AND year(asj.larq)=year(now())
</if>
<if test="gzt_type == '07'"><!--立案已超期-->
AND (((asjcz.laywsjzt is not null or asjcz.laywsjzt != '') and asjcz.laywsjzt!='02') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND (((asjcz.laywsjzt is not null and asjcz.laywsjzt != '') and asjcz.laywsjzt!='02' and asjcz.laywsjzt!='05') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,now())<![CDATA[>=]]>24
AND year(asj.larq)=year(now())
</if>
<if test="gzt_type == '08'"><!--侦查终结即将超期-->
AND asjcz.laywsjzt = '02'
AND (((asjcz.zczjywsjzt is not null or asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND (((asjcz.zczjywsjzt is not null and asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND blgc.sp_type='00'
AND blgc.SPSFTG_PDBZ='1'
AND TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,now())<![CDATA[>=]]>21 and TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,now())<![CDATA[<]]>24
......@@ -1443,13 +1443,13 @@
</if>
<if test="gzt_type == '09'"><!--侦查终结已超期-->
AND asjcz.laywsjzt = '02'
AND (((asjcz.zczjywsjzt is not null or asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND (((asjcz.zczjywsjzt is not null and asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,now())<![CDATA[>=]]>24
AND year(asj.larq)=year(now())
</if>
<if test="gzt_type == '10'"><!--立案超期总数-->
AND year(asj.larq)=year(now())
AND (((((asjcz.laywsjzt is not null or asjcz.laywsjzt != '') and asjcz.laywsjzt!='02') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND (((((asjcz.laywsjzt is not null and asjcz.laywsjzt != '') and asjcz.laywsjzt!='02' and asjcz.laywsjzt!='05') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,now())<![CDATA[>=]]>24)
or
(asjcz.laywsjzt='02' AND TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,blgc.spsj)<![CDATA[>=]]>24) )
......@@ -1457,7 +1457,7 @@
<if test="gzt_type == '11'"><!--侦查终结超期总数-->
AND year(asj.larq)=year(now())
AND asjcz.laywsjzt = '02'
AND (((((asjcz.zczjywsjzt is not null or asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND (((((asjcz.zczjywsjzt is not null and asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,now())<![CDATA[>=]]>24)
or
(asjcz.zczjywsjzt='02' and TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,blgc.spsj)<![CDATA[>=]]>24)
......@@ -1499,29 +1499,29 @@
</if>
<if test="gzt_type == '06'"><!--立案即将超期-->
AND year(asj.larq)=year(now())
AND (((asjcz.laywsjzt is not null or asjcz.laywsjzt != '') and asjcz.laywsjzt!='02') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND (((asjcz.laywsjzt is not null and asjcz.laywsjzt != '') and asjcz.laywsjzt!='02' and asjcz.laywsjzt!='05') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,now())<![CDATA[>=]]>21 and TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,now())<![CDATA[<]]>24
</if>
<if test="gzt_type == '07'"><!--立案超期待办理-->
AND year(asj.larq)=year(now())
AND (((asjcz.laywsjzt is not null or asjcz.laywsjzt != '') and asjcz.laywsjzt!='02') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND (((asjcz.laywsjzt is not null and asjcz.laywsjzt != '') and asjcz.laywsjzt!='02' and asjcz.laywsjzt!='05') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,now())<![CDATA[>=]]>24
</if>
<if test="gzt_type == '08'"><!--侦查终结即将超期-->
AND asjcz.laywsjzt = '02'
AND year(asj.larq)=year(now())
AND (((asjcz.zczjywsjzt is not null or asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND (((asjcz.zczjywsjzt is not null and asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,now())<![CDATA[>=]]>21 and TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,now())<![CDATA[<]]>24
</if>
<if test="gzt_type == '09'"><!--侦查超期待办理-->
AND asjcz.laywsjzt = '02'
AND year(asj.larq)=year(now())
AND (((asjcz.zczjywsjzt is not null or asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND (((asjcz.zczjywsjzt is not null and asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,now())<![CDATA[>=]]>24
</if>
<if test="gzt_type == '10'"><!--立案超期总数-->
AND year(asj.larq)=year(now())
AND (((((asjcz.laywsjzt is not null or asjcz.laywsjzt != '') and asjcz.laywsjzt!='02') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND (((((asjcz.laywsjzt is not null and asjcz.laywsjzt != '') and asjcz.laywsjzt!='02' and asjcz.laywsjzt!='05') or asjcz.laywsjzt is null or asjcz.laywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,now())<![CDATA[>=]]>24)
or
(asjcz.laywsjzt='02' AND TIMESTAMPDIFF(HOUR,asj.ASJFSSJ_ASJFSJSSJ,blgc.spsj)<![CDATA[>=]]>24) )
......@@ -1529,7 +1529,7 @@
<if test="gzt_type == '11'"><!--侦查终结超期总数-->
AND year(asj.larq)=year(now())
AND asjcz.laywsjzt = '02'
AND (((((asjcz.zczjywsjzt is not null or asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND (((((asjcz.zczjywsjzt is not null and asjcz.zczjywsjzt != '') and asjcz.zczjywsjzt!='02') or asjcz.zczjywsjzt is null or asjcz.zczjywsjzt = '')
AND TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,now())<![CDATA[>=]]>24)
or
(asjcz.zczjywsjzt='02' and TIMESTAMPDIFF(HOUR,asj.ZCZJ_ZXSJ01,blgc.spsj)<![CDATA[>=]]>24)
......
......@@ -14,6 +14,7 @@ import java.util.Map;
public interface IAjDetailService {
public TbStAsj getTbStAsjByAsjbh(String asjbh);
public TbStAsj getAsjByAsjbh(String asjbh);
public List<TbStAsj> getAsjByRsksj();
//抓捕犯罪嫌疑人信息
public List<TbXwZbfzxyr> getFzxyrxxByAsjbh(String asjbh, Integer begin, Integer end);
public Integer getFzxyrxxByAsjbhTotalCount(String asjbh);
......
......@@ -481,13 +481,12 @@ public class StAsjXxtqService {
//请求思悦数据检测详情页面地址
public void getSysjjcUrl(String asjbh,String token){
String detailUrl = getDetailUrl(asjbh,token);
String url = "http://10.2.164.178:8058/db/fzAj";
String json = "{\"ajbh\":\""+asjbh+"\"}";
try {
if (!StringUtils.isEmpty(detailUrl)){
String url = HttpClientUtil.doGet(detailUrl);
System.out.println("******************** success 1234566789 *****************************");
System.out.println(url);
}
String message = HttpClientUtil.doPostJson(url, json, token);
System.out.println("******************** success 1234566789 *****************************");
System.out.println(message);
} catch (Exception e) {
e.printStackTrace();
}
......@@ -578,4 +577,31 @@ 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);
}
}
}
......@@ -44,6 +44,12 @@ public class AjDetailServiceImpl implements IAjDetailService {
TbStAsj tbStAsj=ajDetailDao.getAsjByAsjbh(asjbh);
return tbStAsj;
}
@Override
@DS("db1")
public List<TbStAsj> getAsjByRsksj(){
List<TbStAsj> list = ajDetailDao.getAsjByRsksj();
return list;
}
@Override
public List<TbXwZbfzxyr> getFzxyrxxByAsjbh(String asjbh, Integer begin, Integer end) {
......@@ -273,13 +279,6 @@ public class AjDetailServiceImpl implements IAjDetailService {
}
if (bhrZp!=null&&bhrZp.getRyzpDzwjnr()!=null){
bhrxxByxxzjbh.setRyzpZjhm(Base64.getEncoder().encodeToString(bhrZp.getRyzpDzwjnr()));
}else {
QgckzpUtil getzp = new QgckzpUtil(); //全国常用库查人员照片
String zjhm = bhrxxByxxzjbh.getBhrCyzjZjhm();
if(!StringUtils.isEmpty(zjhm)){
String ryzp =getzp.getQgckZpXml(zjhm);//获取人员照片
bhrxxByxxzjbh.setRyzpZjhm(ryzp);
}
}
Map<String,Object> map=new HashedMap();
......@@ -301,14 +300,7 @@ public class AjDetailServiceImpl implements IAjDetailService {
}
}
}
if (StringUtils.isEmpty(xyrxxByxxzjbh.getRyzpZjhm())) {
QgckzpUtil getzp = new QgckzpUtil(); //全国常用库查人员照片
String zjhm = xyrxxByxxzjbh.getZhfzxyrCyzjZjhm();
if (!StringUtils.isEmpty(zjhm)) {
String ryzp = getzp.getQgckZpXml(zjhm);//获取人员照片
xyrxxByxxzjbh.setRyzpZjhm(ryzp);
}
}
Map<String,Object> map=new HashedMap();
map.put("jbxx",xyrxxByxxzjbh);
map.put("flws",flws);
......
......@@ -148,6 +148,8 @@ public class AjspServiceImpl implements IAjspService {
//若该案件是现案则检测现勘编号
if (year.equals(larqYear)) {
deteilMap.put("xkbh", sfNotNull(tbStAsj.getXckybh()));
}else {
deteilMap.put("xkbh", "1");
}
} catch (Exception e) {
e.printStackTrace();
......@@ -158,17 +160,18 @@ 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)){
if(StringUtils.isNotEmpty(fayy) && !"待定".equals(fayy)&&!"其他".equals(fayy)){
deteilMap.put("fayy","1");
}else {
deteilMap.put("fayy","0");
}
String zasd = tbStAsj.getTssddm();//作案手段(作案工具)
if(StringUtils.isNotEmpty(zasd) && !"待定".equals(zasd)){
if(StringUtils.isNotEmpty(zasd) && !"待定".equals(zasd)&&!"其他".equals(zasd)){
deteilMap.put("zasd","1");
}else {
deteilMap.put("zasd","0");
}
}
retMap.putAll(deteilMap);
retMap.put("result",!retMap.containsValue("0"));
......@@ -191,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)){
if(StringUtils.isNotEmpty(zasd) && !"待定".equals(zasd)&&!"其他".equals(zasd)){
deteilMap.put("zasd","1");
}else {
deteilMap.put("zasd","0");
......@@ -208,6 +211,8 @@ public class AjspServiceImpl implements IAjspService {
//若该案件是现案则检测现勘编号
if (year.equals(larqYear)) {
deteilMap.put("xkbh", sfNotNull(tbStAsj.getXckybh()));
}else {
deteilMap.put("xkbh", "1");
}
} catch (Exception e) {
e.printStackTrace();
......@@ -219,7 +224,7 @@ public class AjspServiceImpl implements IAjspService {
deteilMap.put("pasd",sfNotNull(tbStAsj.getPasddm()));
String fayy = tbStAsj.getZadjdm();//发案原因
if(StringUtils.isNotEmpty(fayy) && !"待定".equals(fayy)){
if(StringUtils.isNotEmpty(fayy) && !"待定".equals(fayy)&&!"其他".equals(fayy)){
deteilMap.put("fayy","1");
}else {
deteilMap.put("fayy","0");
......
......@@ -128,7 +128,8 @@ public class HttpClientUtil {
return doPost(url, null);
}
public static String doPostJson(String url, String json) {
//请求美亚数据监测接口的的post请求
public static String doPostJson(String url, String json,String token) {
// 创建Httpclient对象
CloseableHttpClient httpClient = HttpClients.createDefault();
CloseableHttpResponse response = null;
......@@ -136,6 +137,8 @@ public class HttpClientUtil {
try {
// 创建Http Post请求
HttpPost httpPost = new HttpPost(url);
httpPost.setHeader("Content-Type","application/json");
httpPost.setHeader("token",token);
// 创建请求内容
StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON);
httpPost.setEntity(entity);
......
......@@ -5,6 +5,7 @@ import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
......@@ -22,7 +23,6 @@ import java.util.*;
import java.util.Map.Entry;
public class HttpUtil {
private static final Logger logger = Logger.getLogger(HttpUtil.class.getName());
public static String doGet(String uri) {
......@@ -30,7 +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);
// Execute the request
HttpResponse response = null;
try {
......
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