Commit bf8baab4 by chentian

Merge remote-tracking branch 'origin/dev' into dev

parents edc63157 8f00814c
......@@ -17,6 +17,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
public class SwaggerConfig {
public static final String asjApi = "com.founder.asj";
public static final String esApi = "com.founder.eszy";
public static final String publicApi = "com.founder.publicapi";
//public static final String carApi = "com.founder.asj.controller2";
@Bean
public Docket asjApi(){
......@@ -40,7 +41,17 @@ public class SwaggerConfig {
.paths(Predicates.not(PathSelectors.regex("/admin/.*")))
.paths(Predicates.not(PathSelectors.regex("/error.*")))
.build();
}
@Bean
public Docket publicApi(){
return new Docket(DocumentationType.SWAGGER_2)
.groupName("publicApi")
.apiInfo(webApiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage(publicApi))
.paths(Predicates.not(PathSelectors.regex("/admin/.*")))
.paths(Predicates.not(PathSelectors.regex("/error.*")))
.build();
}
private ApiInfo webApiInfo(){
......
package com.founder.pulicapi;
package com.founder.publicapi;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
......
package com.founder.pulicapi.controller;
package com.founder.publicapi.controller;
import com.founder.commonutils.peopleEntity.TbStRy;
import com.founder.commonutils.publicEntity.R;
......@@ -7,7 +7,10 @@ import com.founder.commonutils.carEntity.CarReceiving;
import com.founder.commonutils.carEntity.CarRy;
import com.founder.commonutils.carEntity.QgjdcModel;
import com.founder.commonutils.util.HttpUtil;
import com.founder.pulicapi.service.SysDictitemService;
import com.founder.publicapi.service.SysDictitemService;
import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
......@@ -25,12 +28,16 @@ import java.util.List;
* 全国人员常口接口
*
*/
@Api(description = "全国人员常口接口")
@RestController
@RequestMapping(value="/ryRedis")
public class RyController {
@Autowired
private SysDictitemService sysDictitemService ;
@ApiOperation(value = "获取全国常住人口信息")
@OperLog(message = "获取全国常住人口信息",operation = OperationType.QUERY)
@PostMapping("/ryxxQg")
public R getQgckAllxxXml(@RequestBody RyReceiving receiving){
TbStRy ryxx=new TbStRy();
......@@ -47,24 +54,6 @@ public class RyController {
return R.ok().code(200).message("成功获取全国常口人员信息").data("ryxx",ryxx);
}
@PostMapping("/ryxxQgInfo")
public TbStRy getQgckAllxxXmlInfo(@RequestBody RyReceiving receiving){
TbStRy ryxx=new TbStRy();
String esbServiceReturn="";
//String url="http://10.100.17.115:8080/NmgEsbQueryService/QueryLocalPersonForOther?conditions=sfzh="+"'"+zjhm+"'";
String url=getConn()+"'"+receiving.getSfzh()+"'";
HttpUtil hu=new HttpUtil();
try {
esbServiceReturn=hu.doGet(url);
} catch (Exception e) {
// TODO: handle exception
}
ryxx=getryJbxxxmls(esbServiceReturn);
//XzxtRestResult result = XzxtRestResult.build(200,"成功获取全国常口人员信息",null,ryxx);
return ryxx;
}
public TbStRy getryJbxxxmls(String esb_result){
TbStRy resulryxx=new TbStRy();
/* esb_result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
......@@ -211,7 +200,9 @@ public class RyController {
return url;
}
@ApiOperation(value = "查询车辆基本信息-公安部机动车数据查询服务返回")
@OperLog(message = "查询车辆基本信息-公安部机动车数据查询服务返回",operation = OperationType.QUERY)
//查询车辆基本信息-公安部机动车数据查询服务返回
@PostMapping("/getCarxx")
public R getVehicleTrackCarxx(@RequestBody CarReceiving carReceiving){
......@@ -256,50 +247,7 @@ public class RyController {
return R.error().code(500).message("请求失败").data(null);
}
}
//查询车辆基本信息-公安部机动车数据查询服务返回
@PostMapping("/getCarxxInfo")
public CarRy getVehicleTrackCarxxInfo(@RequestBody CarReceiving carReceiving){
String carNum = carReceiving.getObjectValue();//车牌号
HashMap<String,String> codeMap = new HashMap<String,String>();
try{
// 全国机动车信息
QgjdcModel qgjdc = new QgjdcModel();
// 全国人员常口
TbStRy ry = new TbStRy();
CarRy carRy = new CarRy();
// 调用全国机动车信息根据号牌号码查询所有人身份证号
qgjdc=getQgclAllxxXml(carNum);
// 调用全国常口接口 根据zjhm查询人员的基本信息
ry=getQgckAllxxXml(qgjdc.getSfzh());
carRy.setXm(ry.getXm());// 人员姓名
// 名族转为汉字
codeMap.put("groupid", "CODE_MZ");
codeMap.put("code", ry.getMz());
String mz = sysDictitemService.getNameByCode(codeMap);
carRy.setMz(mz);// 民族
// 性别转为汉字
codeMap.put("groupid", "CODE_XB");
codeMap.put("code", ry.getXb());
String xb = sysDictitemService.getNameByCode(codeMap);
carRy.setXb(xb);// 性别
carRy.setSfzhm(qgjdc.getSfzh());//证件号码set
carRy.setCsdzmc(ry.getCsdzmc());//出生地址名称
carRy.setXzzdzmc(ry.getXzzdzmc());//现住址地址名称
carRy.setImg(ry.getImg());// 人员照片
carRy.setPhone(qgjdc.getLxfs()); // 联系电话
carRy.setObjValue(qgjdc.getHphm());// 值为车牌号
carRy.setCarType(qgjdc.getClpp1());// 车辆_品牌型号
carRy.setHjdqhdz(ry.getHjdqhdz());// 户籍地地址
carRy.setCsrq(ry.getCsrq());// 出生日期
return carRy;
}catch (Exception e){
return null;
}
}
/**
* 根据ajhm查询人员的基本信息
* @param zjhm
......@@ -319,6 +267,7 @@ public class RyController {
ryxx=getryJbxxxml(esbServiceReturn);
return ryxx;
}
public TbStRy getryJbxxxml(String esb_result){
TbStRy resulryxx=new TbStRy();
/* esb_result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
......@@ -472,6 +421,7 @@ public class RyController {
qgjdc=getclJbxxxml(esbServiceReturn);
return qgjdc;
}
public static QgjdcModel getclJbxxxml(String esb_result){
QgjdcModel qgjdc=new QgjdcModel();
/*esb_result ="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+
......
package com.founder.pulicapi.mapper;
package com.founder.publicapi.mapper;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import java.util.Map;
@Mapper
public interface SysDictitemMapper {
String getNameByCode(Map<String, String> map);
}
package com.founder.pulicapi.service.serviceimpl;
package com.founder.publicapi.service.serviceimpl;
import com.founder.pulicapi.mapper.SysDictitemMapper;
import com.founder.pulicapi.service.SysDictitemService;
import com.founder.publicapi.mapper.SysDictitemMapper;
import com.founder.publicapi.service.SysDictitemService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.founder.pulicapi.mapper.SysDictitemMapper">
<mapper namespace="com.founder.publicapi.mapper.SysDictitemMapper">
<!-- 根据code和groupid查询name值-->
<select id="getNameByCode" parameterType="java.util.Map" resultType="java.lang.String">
......
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