新增人员信息查询功能。

This commit is contained in:
Renpc-kilig 2021-07-13 17:47:21 +08:00
parent e5b661cb37
commit ef6ce3c352
6 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,44 @@
package com.cm.population.controller.resources.personmsg;
import com.cm.common.base.AbstractController;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.result.ErrorResult;
import com.cm.common.result.SuccessResultData;
import com.cm.population.service.personmsg.IPersonMsgService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.mail.search.SearchException;
import java.util.Map;
/**
* @ClassName: PersonMsgController
* @Description: 人员信息
* @Author: WenG
* @Date: 2021-07-12 10:14
* @Version: 1.0
**/
@Api(tags = ISystemConstant.API_TAGS_RESOURCE_PREFIX + "人员信息")
@RestController
@RequestMapping(ISystemConstant.RESOURCE_PREFIX + "/personMsg")
public class PersonMsgController extends AbstractController {
@Autowired
private IPersonMsgService personMsgService;
@ApiOperation(value = "通过身份证号码,查询人员信息", notes = "通过身份证号码,查询人员信息接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("userMsg/{idCard}")
SuccessResultData<Map<String, Object>> userMsg(@PathVariable("idCard") String idCard) throws SearchException {
Map<String, Object> params = requestParams();
params.put("idCardNumber", idCard);
return new SuccessResultData<>(personMsgService.userMsg(params));
}
}

View File

@ -0,0 +1,33 @@
package com.cm.population.dao.personmsg;
import org.springframework.stereotype.Repository;
import javax.mail.search.SearchException;
import java.util.Map;
/**
* @ClassName: IPersonMsgDao
* @Description: 人员信息
* @Author: WenG
* @Date: 2021-07-12 10:10
* @Version: 1.0
**/
@Repository
public interface IPersonMsgDao {
/**
* 基础人员信息
* @param params
* @return
* @throws SearchException
*/
Map<String, Object> baseUserData(Map<String, Object> params) throws SearchException;
/**
* 境外人员信息
* @param params
* @return
*/
Map<String, Object> overseaData(Map<String, Object> params);
}

View File

@ -0,0 +1,21 @@
package com.cm.population.service.personmsg;
import javax.mail.search.SearchException;
import java.util.Map;
/**
* @ClassName: IPersonMsgService
* @Description: 人员信息
* @Author: WenG
* @Date: 2021-07-12 10:10
* @Version: 1.0
**/
public interface IPersonMsgService {
/**
* 通过身份证号码查询人员信息
* @param params
* @return
*/
Map<String, Object> userMsg(Map<String, Object> params) throws SearchException;
}

View File

@ -0,0 +1,57 @@
package com.cm.population.service.personmsg.impl;
import com.cm.common.base.AbstractService;
import com.cm.population.dao.basepopulationinfo.IBasePopulationInfoDao;
import com.cm.population.dao.overseaspersonnel.IOverseasPersonnelDao;
import com.cm.population.dao.personmsg.IPersonMsgDao;
import com.cm.population.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO;
import com.cm.population.pojo.dtos.overseaspersonnel.OverseasPersonnelDTO;
import com.cm.population.service.personmsg.IPersonMsgService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.mail.search.SearchException;
import java.util.HashMap;
import java.util.Map;
/**
* @ClassName: PersonMsgServiceImpl
* @Description: 人员信息
* @Author: WenG
* @Date: 2021-07-12 10:10
* @Version: 1.0
**/
@Service
public class PersonMsgServiceImpl extends AbstractService implements IPersonMsgService {
@Autowired
private IPersonMsgDao personMsgDao;
@Autowired
private IBasePopulationInfoDao basePopulationInfoDao;
@Autowired
private IOverseasPersonnelDao overseasPersonnelDao;
@Override
public Map<String, Object> userMsg(Map<String, Object> params) throws SearchException {
Map<String, Object> backMap = new HashMap<>();
// 留守人员信息
BasePopulationInfoDTO basePopulationInfoDTO = basePopulationInfoDao.getBasePopulationInfo(params);
if(null != basePopulationInfoDTO) {
backMap.put("name", basePopulationInfoDTO.getFullName());
backMap.put("sex", basePopulationInfoDTO.getGenderDictionaryName());
backMap.put("phone", basePopulationInfoDTO.getTelephone());
backMap.put("idCard", basePopulationInfoDTO.getIdCardNumber());
backMap.put("type", "普通人员");
}
// 境外人员
OverseasPersonnelDTO overseasPersonnelDTO = overseasPersonnelDao.getOverseasPersonnel(params);
if(null != overseasPersonnelDTO) {
backMap.put("name", overseasPersonnelDTO.getSex());
backMap.put("sex", overseasPersonnelDTO.getName() + overseasPersonnelDTO.getSurname());
backMap.put("phone", overseasPersonnelDTO.getPhone());
backMap.put("idCard", overseasPersonnelDTO.getCardNumber());
backMap.put("type", "海外人员");
}
return backMap;
}
}

View File

@ -300,6 +300,10 @@
AND
t1.overseas_personnel_id = #{overseasPersonnelId}
</if>
<if test="idCardNumber != null and idCardNumber != ''">
AND
t1.card_number = #{idCardNumber}
</if>
</select>
<!-- 境外人员列表 -->

View File

@ -0,0 +1,5 @@
<?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.cm.population.dao.personmsg.IPersonMsgDao">
</mapper>