|
@@ -18,6 +18,7 @@ import thyyxxk.wxservice_server.entity.analyzeidcard.UploadIdCardParam;
|
|
|
import thyyxxk.wxservice_server.entity.hrgresponse.CreateCardResponse;
|
|
|
import thyyxxk.wxservice_server.entity.patientcards.BindPatientIdParam;
|
|
|
import thyyxxk.wxservice_server.entity.patientcards.CreatCardParam;
|
|
|
+import thyyxxk.wxservice_server.utils.DateUtil;
|
|
|
import thyyxxk.wxservice_server.utils.ResultVoUtil;
|
|
|
import thyyxxk.wxservice_server.utils.StringUtil;
|
|
|
|
|
@@ -66,8 +67,10 @@ public class IdCardAnalyzeService {
|
|
|
if (1 == res.getInt("idcard_number_type")) {
|
|
|
IdCardAnalyzeResult idCard = new IdCardAnalyzeResult();
|
|
|
JSONObject result = res.getJSONObject("words_result");
|
|
|
+ String socialNo = result.getJSONObject("公民身份号码").getString("words");
|
|
|
idCard.setName(result.getJSONObject("姓名").getString("words"));
|
|
|
- idCard.setSocialNo(result.getJSONObject("公民身份号码").getString("words"));
|
|
|
+ idCard.setSocialNo(socialNo);
|
|
|
+ idCard.setSex(calculateSex(socialNo));
|
|
|
String districtCode = idCard.getSocialNo().substring(0, 6);
|
|
|
String districtName = dao.selectRegionName(districtCode);
|
|
|
if (null != districtName) {
|
|
@@ -92,6 +95,15 @@ public class IdCardAnalyzeService {
|
|
|
|
|
|
@Async("asyncTask")
|
|
|
public CompletableFuture<ResultVo<Object>> readInput(IdCardAnalyzeResult param) throws Exception {
|
|
|
+ if (StringUtil.isBlank(param.getSocialNo())) {
|
|
|
+ String birth = DateUtil.matchDate(param.getBirthday(), "yyyyMMdd");
|
|
|
+ if (null == birth) {
|
|
|
+ return CompletableFuture.completedFuture(ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR,
|
|
|
+ "儿童出生日期格式错误,请检查!(例:20180601)"));
|
|
|
+ }
|
|
|
+ param.setBirthday(birth);
|
|
|
+ }
|
|
|
+
|
|
|
CreatCardParam card = new CreatCardParam();
|
|
|
card.setPatName(param.getName());
|
|
|
card.setPatIdType(1);
|