Selaa lähdekoodia

修复姓名不一致问题

lighter_217 2 viikkoa sitten
vanhempi
commit
fdd2731a1f

+ 4 - 3
src/main/java/thyyxxk/webserver/service/medicalinsurance/ExecService.java

@@ -108,9 +108,10 @@ public class ExecService {
     }
 
     public String getInstitutionArea(String insureArea) {
-        String hospArea = cfg.getHospArea();
-        String prefix = hospArea.substring(0, 4);
-        return insureArea.startsWith(prefix) ? hospArea : prefix.substring(0, 2) + "9900";
+//        String hospArea = cfg.getHospArea();
+//        String prefix = hospArea.substring(0, 4);
+//        return insureArea.startsWith(prefix) ? hospArea : prefix.substring(0, 2) + "9900";
+        return cfg.getHospArea();
     }
 
     private JSONObject makeSignHeader(SiFunction function) {

+ 5 - 2
src/main/java/thyyxxk/webserver/service/medicalinsurance/SiZyService.java

@@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.yaml.snakeyaml.util.UriEncoder;
 import thyyxxk.webserver.config.envionment.MedinsurConfig;
 import thyyxxk.webserver.config.exception.BizException;
 import thyyxxk.webserver.config.exception.ExceptionEnum;
@@ -105,7 +106,8 @@ public class SiZyService {
                 admMdtrtinfo.setCardSn(out[3]);
             } else if (mdtrtCertType.getCode().equals(MdtrtCertType.MEDICAL_INSURANCE_ELECTRONIC_VOUCHER.getCode())) {
                 JSONObject qrinfo = JSONObject.parseObject(p.getReadCardResult());
-                if (!p.getName().trim().equals(qrinfo.getString("userName").trim())) {
+                String userName = UriEncoder.decode(qrinfo.getString("userName"));
+                if (!p.getName().trim().equals(userName.trim())) {
                     throw new BizException(ExceptionEnum.LOGICAL_ERROR, "电子医保凭证姓名与HIS姓名不一致,请确认是否人证相符。");
                 }
                 if (!p.getSocialNo().trim().equals(qrinfo.getString("idNo").trim())) {
@@ -531,7 +533,8 @@ public class SiZyService {
                 preSetlmt.setCardSn(out[3]);
             } else if (mdtrtCertType.getCode().equals(MdtrtCertType.MEDICAL_INSURANCE_ELECTRONIC_VOUCHER.getCode())) {
                 JSONObject qrinfo = JSONObject.parseObject(p.getReadCardResult());
-                if (!p.getName().trim().equals(qrinfo.getString("userName").trim())) {
+                String userName = UriEncoder.decode(qrinfo.getString("userName"));
+                if (!p.getName().trim().equals(userName.trim())) {
                     revokeDischarge(p);
                     throw new BizException(ExceptionEnum.LOGICAL_ERROR, "电子医保凭证姓名与HIS姓名不一致,请确认是否人证相符。");
                 }