فهرست منبع

医保移动支付

lighter 1 سال پیش
والد
کامیت
bfc6748e83
37فایلهای تغییر یافته به همراه1894 افزوده شده و 643 حذف شده
  1. 2 1
      pom.xml
  2. 62 0
      src/main/java/thyyxxk/simzfeeoprnsystm/controller/MobilePayApiController.java
  3. 103 0
      src/main/java/thyyxxk/simzfeeoprnsystm/dao/MobilePayDao.java
  4. 1 17
      src/main/java/thyyxxk/simzfeeoprnsystm/dao/SiMzDao.java
  5. 81 0
      src/main/java/thyyxxk/simzfeeoprnsystm/dicts/Insutype.java
  6. 63 0
      src/main/java/thyyxxk/simzfeeoprnsystm/dicts/PsnType.java
  7. 8 0
      src/main/java/thyyxxk/simzfeeoprnsystm/dicts/SiFunction.java
  8. 1 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/CodeName.java
  9. 2 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/FundDetail.java
  10. 3 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/SiPatInfo.java
  11. 21 24
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/Diseinfo.java
  12. 81 79
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/Feedetail.java
  13. 36 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/IdetInfo.java
  14. 71 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/InsuInfo.java
  15. 24 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/InsuinfoRequest.java
  16. 36 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/MobileOrderQuery.java
  17. 87 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/MobilePay.java
  18. 96 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/PsnBaseInfo.java
  19. 296 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/Upload6201.java
  20. 14 0
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/VisitTableIcd.java
  21. 0 84
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/EcTokenParams.java
  22. 0 62
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/payment/CreatePayOrder.java
  23. 0 60
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/payment/EcTokenRefund.java
  24. 0 189
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/upload/EcTokenUpldDetl.java
  25. 0 28
      src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/upload/EcTokenUpldRslt.java
  26. 6 0
      src/main/java/thyyxxk/simzfeeoprnsystm/service/ExecService.java
  27. 308 0
      src/main/java/thyyxxk/simzfeeoprnsystm/service/MobilePayService.java
  28. 16 21
      src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java
  29. 1 0
      src/main/java/thyyxxk/simzfeeoprnsystm/utils/SiUtil.java
  30. 141 0
      src/main/java/thyyxxk/simzfeeoprnsystm/utils/mobilepay/CommonUtil.java
  31. 85 0
      src/main/java/thyyxxk/simzfeeoprnsystm/utils/mobilepay/EncryptUtil.java
  32. 172 0
      src/main/java/thyyxxk/simzfeeoprnsystm/utils/mobilepay/SM2Util.java
  33. 58 0
      src/main/java/thyyxxk/simzfeeoprnsystm/utils/mobilepay/SM4Util.java
  34. 0 30
      src/main/java/thyyxxk/simzfeeoprnsystm/utils/rxsign/EasyGmUtils.java
  35. 5 38
      src/main/java/thyyxxk/simzfeeoprnsystm/utils/rxsign/HseEncAndDecUtil.java
  36. 14 10
      src/main/resources/application.yml
  37. BIN
      src/main/resources/lib/med-request-data-sdk-2.1.4.jar

+ 2 - 1
pom.xml

@@ -57,10 +57,11 @@
             <artifactId>spring-boot-starter-test</artifactId>
             <scope>test</scope>
         </dependency>
+        <!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
         <dependency>
             <groupId>com.alibaba</groupId>
             <artifactId>fastjson</artifactId>
-            <version>1.2.83</version>
+            <version>2.0.52</version>
         </dependency>
         <dependency>
             <groupId>org.apache.httpcomponents</groupId>

+ 62 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/controller/MobilePayApiController.java

@@ -0,0 +1,62 @@
+package thyyxxk.simzfeeoprnsystm.controller;
+
+import com.alibaba.fastjson.JSONObject;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import thyyxxk.simzfeeoprnsystm.pojo.MzPatientInfo;
+import thyyxxk.simzfeeoprnsystm.pojo.ResultVo;
+import thyyxxk.simzfeeoprnsystm.pojo.mobilepay.InsuinfoRequest;
+import thyyxxk.simzfeeoprnsystm.pojo.mobilepay.MobilePay;
+import thyyxxk.simzfeeoprnsystm.pojo.mobilepay.Upload6201;
+import thyyxxk.simzfeeoprnsystm.service.MobilePayService;
+
+@RestController
+@RequestMapping("/mobilePayApi")
+public class MobilePayApiController {
+    private final MobilePayService service;
+
+    @Autowired
+    public MobilePayApiController(MobilePayService service) {
+        this.service = service;
+    }
+
+    @PostMapping("/queryInsuInfo")
+    public ResultVo<String> queryInsuInfo(@RequestBody InsuinfoRequest request) {
+        return service.obtainBasicPersonInfo(request);
+    }
+
+    @PostMapping("/register")
+    public ResultVo<String> register(@RequestBody MzPatientInfo request) {
+        return service.register(request);
+    }
+
+    @PostMapping("/upload6201")
+    public ResultVo<MobilePay> upload6201(@RequestBody InsuinfoRequest request) throws Exception {
+        return service.upload6201(request);
+    }
+
+    @PostMapping("/preSettle")
+    public ResultVo<MobilePay> preSettle(@RequestBody MobilePay request) throws Exception {
+        return service.preSettle(request);
+    }
+
+    @GetMapping("/orderQuery")
+    public ResultVo<JSONObject> orderQuery(@RequestParam("id") String id) throws Exception {
+        return service.orderQuery(id);
+    }
+
+    @GetMapping("/preSettle2")
+    public ResultVo<MobilePay> preSettle2(@RequestParam("id") String id) throws Exception {
+        return service.preSettle2(id);
+    }
+
+    @GetMapping("/writeMtReceipt")
+    public String writeMtReceipt(@RequestParam("hisOrdNum") String hisOrdNum) {
+       return service.writeMtReceipt(hisOrdNum);
+    }
+
+    @PostMapping("/getUpload6201")
+    public Upload6201 getUpload6201(@RequestBody InsuinfoRequest request) throws Exception {
+        return service.getUpload6201(request);
+    }
+}

+ 103 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/dao/MobilePayDao.java

@@ -0,0 +1,103 @@
+package thyyxxk.simzfeeoprnsystm.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.*;
+import thyyxxk.simzfeeoprnsystm.pojo.SiPatInfo;
+import thyyxxk.simzfeeoprnsystm.pojo.mobilepay.*;
+
+import java.util.List;
+
+@Mapper
+public interface MobilePayDao extends BaseMapper<MobilePay> {
+    @Select("select psn_no from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
+    String selectPsnNofoForMz(@Param("patNo") String patNo,
+                              @Param("times") int times);
+
+    @Select("select mdtrt_id from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
+    String selectMdtrtIdForMz(@Param("patNo") String patNo,
+                              @Param("times") int times);
+
+    @Select("select count(1) from t_si_pat_info where pat_no=#{patNo} and times=#{times} ")
+    int selectSiMzInfoCount(@Param("patNo") String patNo,
+                            @Param("times") int times);
+
+    @Insert("insert into t_si_pat_info (pat_no, times, ledger_sn, psn_no, psn_cert_type, insutype, insuplc_admdvs, " +
+            "certno, psn_name, gend, naty, brdy, age, med_type, psn_idet_type,psn_type,emp_name, create_datetime, balc) " +
+            "values (#{patNo},#{times},#{ledgerSn},#{psnNo},#{psnCertType},#{insutype},#{insuplc},#{certno}," +
+            "#{psnName},#{gend},#{naty},#{brdy},#{age},#{medType},#{psnIdetType},#{psnType},#{empName},getdate(),#{balc})")
+    void insertSiMzInfoPsnNo(PsnBaseInfo psnBaseinfo);
+
+    @Update("update t_si_pat_info set insutype=#{insutype},balc=#{balc},insuplc_admdvs=#{admdvs} " +
+            "where pat_no=#{patNo} and times=#{times}")
+    void updateSiZyInfoPsnNo(@Param("patNo") String patNo,
+                             @Param("times") int times,
+                             @Param("insutype") String insutype,
+                             @Param("balc") String balc,
+                             @Param("admdvs") String admdvs);
+
+    @Select("select psn_no,insutype, " +
+            "medOrgOrd=pat_no+'_'+cast(a.times as varchar)+'_1', " +
+            "begntime=b.visit_date, " +
+            "idNo=a.certno, " +
+            "userName=a.psn_name, " +
+            "idType='01', " +
+            "ecToken='', " +
+            "insuCode=a.insuplc_admdvs, " +
+            "iptOtpNo=a.pat_no, " +
+            "deptCode=rtrim(b.visit_dept_code)," +
+            "deptName=(select rtrim(d.name) from zd_unit_code d where d.code=b.visit_dept_code), " +
+            "caty=(select rtrim(d.si_caty) from zd_unit_code d where d.code=b.visit_dept_code), " +
+            "a.mdtrt_id,a.med_type, " +
+            "feeType='01', " +
+            "medfeeSumamt=(select sum(d.charge_fee) from t_mt_receipt d where d.patient_id=a.pat_no and d.times=a.times), " +
+            "acctUsedFlag='1', " +
+            "psnSetlway='01', " +
+            "diseCodg=a.dise_code," +
+            "diseName=a.dise_name," +
+            "chrgBchno=pat_no+'_'+a.mdtrt_id " +
+            "from t_si_pat_info a,mz_visit_table b " +
+            "where a.pat_no=#{patNo} and a.times=#{times} " +
+            "and b.patient_id=a.pat_no and b.times=a.times")
+    Upload6201 selectUpload6201(@Param("patNo") String patNo, @Param("times") int times);
+
+    @Select("select diag_type,diag_srt_no,diag_code,diag_name," +
+            "diag_dept,dise_dor_no,dise_dor_name," +
+            "diag_time,vali_flag from t_si_mz_diag " +
+            "where pat_no=#{patNo} and times=#{times}")
+    List<Diseinfo> selectMpDiseinfos(@Param("patNo") String patNo, @Param("times") int times);
+
+    @Select("select " +
+            "feedetlSn=(a.patient_id + '_' + cast(a.times as varchar) + '_' + cast(a.receipt_no as varchar) + '_' + " +
+            "cast(a.order_no as varchar) + '_' + cast(a.item_no as varchar)), " +
+            "b.mdtrt_id,b.psn_no,chrgBchno=b.pat_no+'_'+b.mdtrt_id, " +
+            "rxCircFlag='0',input_date as feeOcurTime, " +
+            "medListCodg=isnull((select max(national_code) from yp_zd_dict where code=his_item_code), " +
+            "(select max(national_code) from zd_charge_item where code=his_item_code)), " +
+            "his_item_code as medinsListCodg, " +
+            "charge_fee as detItemFeeSumamt, " +
+            "quantity as cnt, price as pric, " +
+            "b.med_type,hospApprFlag='1', " +
+            "bilgDrCodg=(select rtrim(yb_code) from a_employee_mi where code=input_staff), " +
+            "input_man as bilgDrName, " +
+            "bilgDeptCodg=rtrim(c.visit_dept_code), " +
+            "bilgDeptName=(select rtrim(d.name) from zd_unit_code d where d.code=c.visit_dept_code) " +
+            "from t_mt_receipt a, t_si_pat_info b, mz_visit_table c " +
+            "where a.patient_id=#{patNo} and a.times=#{times} " +
+            "and b.pat_no=a.patient_id and b.times=a.times " +
+            "and c.patient_id=a.patient_id and c.times=a.times")
+    List<Feedetail> selectMpFees(@Param("patNo") String patNo, @Param("times") int times);
+
+    @Select("select icd_code_new as icdCode,icd_text_new as icdName," +
+            "visit_date,drCode=rtrim(doctor_code)," +
+            "drName=(select rtrim(d.name) from a_employee_mi d where d.code=doctor_code) " +
+            "from mz_visit_table where patient_id=#{patNo} and times=#{times}")
+    VisitTableIcd selectMzVisitIcd(@Param("patNo") String patNo, @Param("times") int times);
+
+    @Select("select * from t_si_pat_info where pat_no=#{patNo} and times=#{times}")
+    SiPatInfo selectSiPatInfoForMz(@Param("patNo") String patNo,
+                                   @Param("times") int times);
+
+    @Select("select pay_ord_id,orgCodg='H43010500370',pay_token,id_no," +
+            "user_name,id_type from t_mobile_pay where mdtrt_id=#{mdtrtId} ")
+    MobileOrderQuery selectOrderQueryData(@Param("mdtrtId") String mdtrtId);
+}

+ 1 - 17
src/main/java/thyyxxk/simzfeeoprnsystm/dao/SiMzDao.java

@@ -2,8 +2,7 @@ package thyyxxk.simzfeeoprnsystm.dao;
 
 import thyyxxk.simzfeeoprnsystm.pojo.*;
 import org.apache.ibatis.annotations.*;
-import thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.upload.EcTokenDiseinfo;
-import thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.upload.EcTokenUpldDetl;
+import thyyxxk.simzfeeoprnsystm.pojo.mobilepay.*;
 
 import java.util.Date;
 import java.util.List;
@@ -174,19 +173,4 @@ public interface SiMzDao {
 
     @Select("select rtrim(social_no) from mz_patient_mi where patient_id=#{patNo}")
     String selectSocialNo(@Param("patNo") String patNo);
-
-    @Select("select a.psn_no,a.insutype,chrgBchno=a.pat_no+'_'+cast(a.times as varchar)+'_1', " +
-            "medOrgOrd=a.pat_no+'_'+cast(a.times as varchar)+'_'+a.mdtrt_id, " +
-            "b.visit_date as begntime,a.mdtrt_id,a.med_type,acctUsedFlag='0', " +
-            "caty=(select t.si_caty from zd_unit_code t where t.code=b.visit_dept_code), " +
-            "deptName=(select rtrim(t.name) from zd_unit_code t where t.code=b.visit_dept_code), " +
-            "medfeeSumamt=(select sum(t.charge_fee) from t_mt_receipt t where t.patient_id=a.pat_no and t.times=a.times), " +
-            "a.dise_code as diseCodg,a.dise_name,psnSetlway='01' " +
-            "from t_si_pat_info a,mz_visit_table b where a.pat_no=#{patNo} and a.times=#{times} " +
-            "and a.pat_no=b.patient_id and a.times=b.times")
-    EcTokenUpldDetl selectEcTokenUpldDetl(@Param("patNo") String patNo, @Param("times") int times);
-
-    @Select("select diag_type,diag_srt_no,diag_code,diag_name,diag_dept,dise_dor_no,dise_dor_name," +
-            "diag_time,vali_flag from t_si_mz_diag where pat_no=#{patNo} and times=#{times}")
-    List<EcTokenDiseinfo> selectEcTokenDiseinfos(@Param("patNo") String patNo, @Param("times") int times);
 }

+ 81 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/dicts/Insutype.java

@@ -0,0 +1,81 @@
+package thyyxxk.simzfeeoprnsystm.dicts;
+
+import thyyxxk.simzfeeoprnsystm.utils.StringUtil;
+
+/**
+ * @description: 险种类型
+ * @author: DingJie
+ * @create: 2021/7/129:12
+ */
+public enum Insutype {
+
+    ZGJBYLBX("310", "职工基本医疗保险"),
+
+    GWYYLBZ("320", "公务员医疗补助"),
+
+    DEYLFYBZ("330", "大额医疗费用补助"),
+
+    LXRYYLBZ("340", "离休人员医疗保障"),
+
+    GZLJCFJRYLBZ("350", "一至六级残废军人医疗补助"),
+
+    LHJYLBZ("360", "老红军医疗保障"),
+
+    QYBCYLBX("370", "企业补充医疗保险"),
+
+    XXNCHZYL("380", "新型农村合作医疗"),
+
+    CXJMJBYLBX("390", "城乡居民基本医疗保险"),
+
+    CZJMJBYLBX("391", "城镇居民基本医疗保险"),
+
+    CXJMDBYLBX("392", "城乡居民大病医疗保险"),
+
+    QTTSYYYLBZ("399", "其他特殊人员医疗保障"),
+
+    CQHZBX("410", "长期照护保险"),
+
+    SYBX("510", "生育保险"),
+
+    NONE("0", "无");
+
+    private final String code;
+    private final String name;
+
+    Insutype(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public static Insutype get(String code) {
+        if (StringUtil.isBlank(code)) {
+            return NONE;
+        }
+        for (Insutype insutype : Insutype.values()) {
+            if (code.trim().equals(insutype.getCode())) {
+                return insutype;
+            }
+        }
+        return NONE;
+    }
+
+    public static String getName(String code) {
+        if (StringUtil.isBlank(code)) {
+            return null;
+        }
+        for (Insutype insutype : Insutype.values()) {
+            if (code.trim().equals(insutype.getCode())) {
+                return insutype.getName();
+            }
+        }
+        return null;
+    }
+}

+ 63 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/dicts/PsnType.java

@@ -0,0 +1,63 @@
+package thyyxxk.simzfeeoprnsystm.dicts;
+
+import thyyxxk.simzfeeoprnsystm.utils.StringUtil;
+
+/**
+ * @description: 人员类别
+ * @author: DingJie
+ * @create: 2021/7/916:01
+ */
+public enum PsnType {
+
+    ON_THE_JOB("11", "在职"),
+
+    RETIRED("12", "退休"),
+
+    EARLY_RETIRED("1204", "提前退休"),
+
+    DISCHARGE("13", "离休"),
+
+    NEW_BORN("1401", "新生儿"),
+
+    PRESCHOOL_CHILDREN("1402", "学龄前儿童"),
+
+    PRIMARY_AND_SECONDARY_SCHOOL_STUDENTS("1403", "中小学生"),
+
+    COLLEGE_STUDENT("1404", "大学生"),
+
+    MINOR_UNDERAGE("1405", "未成年(未入学)"),
+
+    ADULT_RESIDENTS("15", "居民(成年)"),
+
+    ELDERLY_RESIDENTS("16", "居民(老年)"),
+
+    URBAN_AND_RURAL_RESIDENTS("1701", "城乡居民");
+
+    private final String code;
+    private final String name;
+
+    PsnType(String code, String name) {
+        this.code = code;
+        this.name = name;
+    }
+
+    public String getCode() {
+        return code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public static PsnType get(String code) {
+        if (StringUtil.isBlank(code)) {
+            return null;
+        }
+        for (PsnType psnType : PsnType.values()) {
+            if (code.trim().equals(psnType.getCode())) {
+                return psnType;
+            }
+        }
+        return null;
+    }
+}

+ 8 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/dicts/SiFunction.java

@@ -7,6 +7,12 @@ package thyyxxk.simzfeeoprnsystm.dicts;
  **/
 public enum SiFunction {
 
+    /* ============================================ 人员信息 ============================================ */
+    /**
+     * 通过此交易获取人员信息(人员基本信息获取)
+     */
+    OBTAIN_BASIC_PERSON_INFO("1101"),
+
     /**
      * 通过此交易进行门诊挂号(门诊挂号)
      */
@@ -85,6 +91,8 @@ public enum SiFunction {
      * */
     ECTOKEN_SYNCHRONIZE_PAY_ORDER("6204"),
 
+    MOBILE_PAY_QUERY("6301"),
+
     /* =========================================== 电子处方 ========================================== */
     /**
      * 通过此交易,定点医疗机构实现医师开方时的医保电子处方信息预核验,

+ 1 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/CodeName.java

@@ -4,6 +4,7 @@ import lombok.Data;
 
 @Data
 public class CodeName {
+    private String code;
     private String codeRs;
     private String name;
 

+ 2 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/FundDetail.java

@@ -9,6 +9,8 @@ import lombok.Data;
  */
 @Data
 public class FundDetail {
+    private String payOrdId;
+    private String ordStas;
     private String totalCost;
     private String fundPay;
     private String acctPay;

+ 3 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/SiPatInfo.java

@@ -165,6 +165,9 @@ public class SiPatInfo implements Serializable {
 	 */
 	private Date visitDatetime;
 
+	private String diseCode;
+	private String diseName;
+
 	private Boolean fromDirectReg;
 
 	public Boolean getFromDirectReg() {

+ 21 - 24
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/upload/EcTokenDiseinfo.java → src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/Diseinfo.java

@@ -1,54 +1,51 @@
-package thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.upload;
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
 
 import lombok.Data;
 
-import java.util.Date;
-
 @Data
-public class EcTokenDiseinfo {
+public class Diseinfo {
     /**
      * 诊断类别
-     * */
+     */
     private String diagType;
-    
+
     /**
      * 诊断排序号
-     * */
-    private Integer diagSrtNo;
-    
+     */
+    private int diagSrtNo;
+
     /**
      * 诊断代码
-     * */
+     */
     private String diagCode;
-    
+
     /**
      * 诊断名称
-     * */
+     */
     private String diagName;
-    
+
     /**
      * 诊断科室
-     * */
+     */
     private String diagDept;
-    
+
     /**
      * 诊断医生编码
-     * */
+     */
     private String diseDorNo;
-    
+
     /**
      * 诊断医生姓名
-     * */
+     */
     private String diseDorName;
-    
+
     /**
      * 诊断时间
-     * */
-    private Date diagTime;
-    
+     */
+    private String diagTime;
+
     /**
      * 有效标志
-     * */
+     */
     private String valiFlag;
-
 }

+ 81 - 79
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/upload/EcTokenFeeDetail.java → src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/Feedetail.java

@@ -1,187 +1,189 @@
-package thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.upload;
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
 
 import lombok.Data;
 
+import java.math.BigDecimal;
+import java.util.Date;
+
 @Data
-public class EcTokenFeeDetail {
+public class Feedetail {
     /**
      * 费用明细流水号
-     * */
+     */
     private String feedetlSn;
-    
+
     /**
      * 就诊ID
-     * */
+     */
     private String mdtrtId;
-    
+
     /**
      * 人员编号
-     * */
+     */
     private String psnNo;
-    
+
     /**
      * 收费批次号
-     * */
+     */
     private String chrgBchno;
-    
+
     /**
      * 病种编码
-     * */
+     */
     private String diseCodg;
-    
+
     /**
      * 处方号
-     * */
+     */
     private String rxno;
-    
+
     /**
      * 外购处方标志
-     * */
+     */
     private String rxCircFlag;
-    
+
     /**
      * 费用发生时间
-     * */
-    private String feeOcurTime;
-    
+     */
+    private Date feeOcurTime;
+
     /**
      * 医疗目录编码
-     * */
+     */
     private String medListCodg;
-    
+
     /**
      * 医药机构目录编码
-     * */
+     */
     private String medinsListCodg;
-    
+
     /**
      * 明细项目费用总额
-     * */
-    private String detItemFeeSumamt;
-    
+     */
+    private BigDecimal detItemFeeSumamt;
+
     /**
      * 数量
-     * */
-    private String cnt;
-    
+     */
+    private BigDecimal cnt;
+
     /**
      * 单价
-     * */
-    private String pric;
-    
+     */
+    private BigDecimal pric;
+
     /**
      * 单次剂量描述
-     * */
+     */
     private String sinDosDscr;
-    
+
     /**
      * 使用频次描述
-     * */
+     */
     private String usedFrquDscr;
-    
+
     /**
      * 周期天数
-     * */
-    private String prdDays;
-    
+     */
+    private BigDecimal prdDays;
+
     /**
      * 用药途径描述
-     * */
+     */
     private String medcWayDscr;
-    
+
     /**
      * 开单科室编码
-     * */
+     */
     private String bilgDeptCodg;
-    
+
     /**
      * 开单科室名称
-     * */
+     */
     private String bilgDeptName;
-    
+
     /**
      * 开单医生编码
-     * */
+     */
     private String bilgDrCodg;
-    
+
     /**
      * 开单医师姓名
-     * */
+     */
     private String bilgDrName;
-    
+
     /**
      * 受单科室编码
-     * */
+     */
     private String acordDeptCodg;
-    
+
     /**
      * 受单科室名称
-     * */
+     */
     private String acordDeptName;
-    
+
     /**
      * 受单医生编码
-     * */
+     */
     private String ordersDrCode;
-    
+
     /**
      * 受单医生姓名
-     * */
+     */
     private String ordersDrName;
-    
+
     /**
      * 医院审批标志
-     * */
+     */
     private String hospApprFlag;
-    
+
     /**
      * 中药使用方式
-     * */
+     */
     private String tcmdrugUsedWay;
-    
+
     /**
      * 外检标志
-     * */
+     */
     private String etipFlag;
-    
+
     /**
      * 外检医院编码
-     * */
+     */
     private String etipHospCode;
-    
+
     /**
      * 出院带药标志
-     * */
+     */
     private String dscgTkdrugFlag;
-    
+
     /**
      * 生育费用标志
-     * */
+     */
     private String matnFeeFlag;
-    
+
     /**
      * 原费用流水号
-     * */
+     */
     private String initFeedetlSn;
-    
+
     /**
      * 医嘱号
-     * */
+     */
     private String drordNo;
-    
+
     /**
      * 医疗类别
-     * */
+     */
     private String medType;
-    
+
     /**
      * 备注
-     * */
+     */
     private String memo;
-    
+
     /**
      * 扩展字段
-     * */
+     */
     private String extData;
-
 }

+ 36 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/IdetInfo.java

@@ -0,0 +1,36 @@
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
+
+import lombok.Data;
+
+/**
+ * 人员身份信息
+ * */
+@Data
+public class IdetInfo {
+    /**
+     * 人员身份类别
+     * */
+    private String psnIdetType;
+
+    /**
+     * 人员类别等级
+     * */
+    private String psnTypeLv;
+
+    /**
+     * 备注
+     * */
+    private String memo;
+
+    /**
+     * 开始时间
+     * */
+    private String begntime;
+
+    /**
+     * 结束时间
+     * */
+    private String endtime;
+
+    private String psnIdetTypeName;
+}

+ 71 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/InsuInfo.java

@@ -0,0 +1,71 @@
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+
+/**
+ * @description: 人员参保信息
+ * @author: DingJie
+ * @create: 2021/7/2814:04
+ */
+@Data
+public class InsuInfo {
+    /**
+     * 余额
+     * */
+    private String balc;
+    
+    /**
+     * 险种类型
+     * */
+    private String insutype;
+    
+    /**
+     * 人员类别
+     * */
+    private String psnType;
+    
+    /**
+     * 人员参保状态
+     * */
+    private String psnInsuStas;
+
+    /**
+     * 个人参保日期
+     * */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date psnInsuDate;
+
+    /**
+     * 暂停参保日期
+     * */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date pausInsuDate;
+    
+    /**
+     * 公务员标志
+     * */
+    private String cvlservFlag;
+    
+    /**
+     * 参保地医保区划
+     * */
+    private String insuplcAdmdvs;
+    
+    /**
+     * 单位名称
+     * */
+    private String empName;
+
+    private String insutypeName;
+    private String psnTypeName;
+    private String psnInsuStasName;
+    private String cvlservFlagName;
+    private String insuplcAdmdvsName;
+    
+}

+ 24 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/InsuinfoRequest.java

@@ -0,0 +1,24 @@
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
+
+import lombok.Data;
+
+/**
+ * @description: 查询患者基本信息参数
+ * @author: DingJie
+ * @create: 2021/7/2211:36
+ */
+@Data
+public class InsuinfoRequest {
+    private String patNo;
+    private Integer times;
+    private String medType;
+    private String socialNo;
+    private String name;
+    private String insuplcAdmdvs;
+    private String staffId;
+    private String payAuthNo;
+    private String uldLatlnt;
+    private String payOrdId;
+    private String payToken;
+    private String mdtrtId;
+}

+ 36 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/MobileOrderQuery.java

@@ -0,0 +1,36 @@
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
+
+import lombok.Data;
+
+@Data
+public class MobileOrderQuery {
+    /**
+     * 支付订单号
+     */
+    private String payOrdId;
+
+    /**
+     * 定点机构编码
+     */
+    private String orgCodg;
+
+    /**
+     * 支付token
+     */
+    private String payToken;
+
+    /**
+     * 证件号码
+     */
+    private String idNo;
+
+    /**
+     * 用户姓名
+     */
+    private String userName;
+
+    /**
+     * 证件类别
+     */
+    private String idType;
+}

+ 87 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/MobilePay.java

@@ -0,0 +1,87 @@
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
+
+import java.io.Serializable;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import java.util.Date;
+
+@Data
+@TableName(value = "t_mobile_pay")
+public class MobilePay  implements Serializable {
+
+	private static final long serialVersionUID =  773637852517881008L;
+
+	/**
+	 * 门诊号
+	 */
+	private String patNo;
+
+	/**
+	 * 就诊次数
+	 */
+	private Integer times;
+
+	/**
+	 * 医保就诊ID
+	 */
+	@TableId(type = IdType.INPUT)
+	private String mdtrtId;
+
+	private String userName;
+	private String idNo;
+	private String idType;
+
+	/**
+	 * 支付授权码
+	 */
+	private String payAuthNo;
+
+	/**
+	 * 支付订单号
+	 */
+	private String payOrdId;
+
+	/**
+	 * 支付token
+	 */
+	private String payToken;
+
+	/**
+	 * 订单状态
+	 */
+	private String ordStas;
+
+	/**
+	 * 费用总额
+	 */
+	private String feeSumamt;
+
+	/**
+	 * 现金支付
+	 */
+	private String ownPayAmt;
+
+	/**
+	 * 个人账户支出
+	 */
+	private String psnAcctPay;
+
+	/**
+	 * 医保基金支付
+	 */
+	private String fundPay;
+
+	/**
+	 * 记录生成时间
+	 */
+	private Date createTime;
+
+	/**
+	 * 记录更新时间
+	 */
+	private Date updateTime;
+
+}

+ 96 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/PsnBaseInfo.java

@@ -0,0 +1,96 @@
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @description: 人员基本信息
+ * @author: DingJie
+ * @create: 2021/7/2110:21
+ */
+@Data
+public class PsnBaseInfo {
+    /**
+     * 住院号/门诊号
+     */
+    private String patNo;
+
+    /**
+     * 住院次数/门诊次数
+     */
+    private Integer times;
+
+    /**
+     * 账页号(门诊为receiptNo)
+     */
+    private Integer ledgerSn;
+
+    /**
+     * 人员编号
+     * */
+    private String psnNo;
+
+    /**
+     * 人员证件类型
+     * */
+    private String psnCertType;
+
+    /**
+     * 证件号码
+     * */
+    private String certno;
+
+    /**
+     * 人员姓名
+     * */
+    private String psnName;
+
+    /**
+     * 性别
+     * */
+    private String gend;
+
+    /**
+     * 民族
+     * */
+    private String naty;
+    
+    /**
+     * 出生日期
+     * */
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    private Date brdy;
+
+    /**
+     * 年龄 
+     * */
+    private Double age;
+
+    /**
+     * 医疗类别
+     * */
+    private String medType;
+
+    /**
+     * 民族名称
+     * */
+    private String natyName;
+
+    /**
+     * 人员身份
+     * */
+    private String psnIdetType;
+
+    private String insutype;
+    private String insuplc;
+    private String balc;
+    private String psnType;
+    private String empName;
+    private String gendName;
+    private String psnCertTypeName;
+}

+ 296 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/Upload6201.java

@@ -0,0 +1,296 @@
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+@Data
+public class Upload6201 {
+    /**
+     * 机构编码
+     */
+    private String orgCodg = "H43010500370";
+
+    private String payAuthNo;
+    private String uldLatlnt;
+    private String mdtrtCertType = "02";
+
+    /**
+     * 电子凭证机构号
+     */
+    private String orgId;
+
+    /**
+     * 人员编号
+     */
+    private String psnNo;
+
+    /**
+     * 险种类型
+     */
+    private String insutype;
+
+    /**
+     * 医疗机构订单号
+     */
+    private String medOrgOrd;
+
+    /**
+     * 要续方的原处方流水
+     */
+    private String initRxOrd;
+
+    /**
+     * 电子处方流转标志
+     */
+    private String rxCircFlag;
+
+    /**
+     * 开始时间
+     */
+    private Date begntime;
+
+    /**
+     * 证件号码
+     */
+    private String idNo;
+
+    /**
+     * 用户姓名
+     */
+    private String userName;
+
+    /**
+     * 证件类别
+     */
+    private String idType;
+
+    /**
+     * 电子凭证授权ecToken
+     */
+    private String ecToken = "";
+
+    /**
+     * 参保地
+     */
+    private String insuCode;
+
+    /**
+     * 住院/门诊号
+     */
+    private String iptOtpNo;
+
+    /**
+     * 医师编码
+     */
+    private String atddrNo;
+
+    /**
+     * 医师姓名
+     */
+    private String drName;
+
+    /**
+     * 科室编码
+     */
+    private String deptCode;
+
+    /**
+     * 科室名称
+     */
+    private String deptName;
+
+    /**
+     * 科别
+     */
+    private String caty;
+
+    /**
+     * 就诊ID
+     */
+    private String mdtrtId;
+
+    /**
+     * 医疗类别
+     */
+    private String medType;
+
+    /**
+     * 费用类别
+     */
+    private String feeType;
+
+    /**
+     * 医疗费总额
+     */
+    private BigDecimal medfeeSumamt;
+
+    /**
+     * 个人账户使用标志
+     */
+    private String acctUsedFlag;
+
+    /**
+     * 主要病情描述
+     */
+    private String mainCondDscr;
+
+    /**
+     * 病种编码
+     */
+    private String diseCodg;
+
+    /**
+     * 病种名称
+     */
+    private String diseName;
+
+    /**
+     * 个人结算方式
+     */
+    private String psnSetlway;
+
+    /**
+     * 收费批次号
+     */
+    private String chrgBchno;
+
+    /**
+     * 发票号
+     */
+    private String invono;
+
+    /**
+     * 出院时间
+     */
+    private String endtime;
+
+    /**
+     * 全自费金额
+     */
+    private BigDecimal fulamtOwnpayAmt;
+
+    /**
+     * 超限价金额
+     */
+    private BigDecimal overlmtSelfpay;
+
+    /**
+     * 先行自付金额
+     */
+    private BigDecimal preselfpayAmt;
+
+    /**
+     * 符合政策范围金额
+     */
+    private BigDecimal inscpScpAmt;
+
+    /**
+     * 手术操作代码
+     */
+    private String oprnOprtCode;
+
+    /**
+     * 手术操作名称
+     */
+    private String oprnOprtName;
+
+    /**
+     * 计划生育服务证号
+     */
+    private String fpscNo;
+
+    /**
+     * 晚育标志
+     */
+    private String latechbFlag;
+
+    /**
+     * 孕周数
+     */
+    private Integer gesoVal;
+
+    /**
+     * 胎次
+     */
+    private Integer fetts;
+
+    /**
+     * 胎儿数
+     */
+    private Integer fetusCnt;
+
+    /**
+     * 早产标志
+     */
+    private String pretFlag;
+
+    /**
+     * 计划生育手术类别
+     */
+    private String birctrlType;
+
+    /**
+     * 计划生育手术或生育日期
+     */
+    private String birctrlMatnDate;
+
+    /**
+     * 伴有并发症标志
+     */
+    private String copFlag;
+
+    /**
+     * 出院科室编码
+     */
+    private String dscgDeptCodg;
+
+    /**
+     * 出院科室名称
+     */
+    private String dscgDeptName;
+
+    /**
+     * 出院床位
+     */
+    private String dscgDed;
+
+    /**
+     * 离院方式
+     */
+    private String dscgWay;
+
+    /**
+     * 死亡日期
+     */
+    private String dieDate;
+
+    /**
+     * 生育类别
+     */
+    private String matnType;
+
+    /**
+     * 扩展字段
+     */
+    private String extData;
+
+    /**
+     * 中途结算标志
+     */
+    private String midSetlFlag;
+
+    private String pubHospRfomFlag = "0";
+
+    /**
+     * 诊断或症状明细
+     */
+    private List<Diseinfo> diseinfoList;
+
+    /**
+     * 费用明细
+     */
+    private List<Feedetail> feedetailList;
+}

+ 14 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/VisitTableIcd.java

@@ -0,0 +1,14 @@
+package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class VisitTableIcd {
+    private String icdCode;
+    private String icdName;
+    private Date visitDate;
+    private String drCode;
+    private String drName;
+}

+ 0 - 84
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/EcTokenParams.java

@@ -1,84 +0,0 @@
-package thyyxxk.simzfeeoprnsystm.pojo.onlinepayment;
-
-import lombok.Data;
-import thyyxxk.simzfeeoprnsystm.utils.StringUtil;
-
-@Data
-public class EcTokenParams {
-
-    /**
-     * 操作员ID
-     * */
-    private String staffId;
-
-    /**
-     * 门诊ID
-     */
-    private String patientId;
-
-    /**
-     * 就诊次数
-     */
-    private Integer times;
-
-    /**
-     * 用户姓名
-     */
-    private String userName;
-
-    /**
-     * 证件号码
-     */
-    private String idNo;
-
-    /**
-     * 证件类型
-     */
-    private String idType;
-
-    /**
-     * 身份核验令牌
-     */
-    private String ecToken;
-
-    /**
-     * 参保地行政区划
-     */
-    private String insuOrg;
-
-    /**
-     * 授权流水号
-     */
-    private String authNo;
-
-    /**
-     * 外部索引号
-     */
-    private String ecIndexNo;
-
-    /**
-     * 性别
-     */
-    private String gender;
-
-    /**
-     * 出生日期
-     */
-    private String birthday;
-
-    /**
-     * 国籍
-     */
-    private String nationality;
-
-    /**
-     * 电子邮箱
-     */
-    private String email;
-
-    private Integer acctUsedFlag;
-
-    public Integer getAcctUsedFlag() {
-        return null == acctUsedFlag ? 0 : acctUsedFlag;
-    }
-}

+ 0 - 62
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/payment/CreatePayOrder.java

@@ -1,62 +0,0 @@
-package thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.payment;
-
-import lombok.Data;
-
-@Data
-public class CreatePayOrder {
-
-    /**
-     * 支付授权码(电子凭证线上渠道授权返回,与电子凭证三要素不可同时为空)
-     */
-    private String payAuthNo;
-
-    /**
-     * 待支付订单号(费用上传返回)
-     */
-    private String payOrdId;
-
-    /**
-     * 支付订单对应的token(费用上传返回)
-     */
-    private String payToken;
-
-    /**
-     * 定点机构编码
-     */
-    private String orgCodg;
-
-    /**
-     * 业务流水号(每一次请求唯一)
-     */
-    private String orgBizSer;
-
-    /**
-     * 电子凭证授权码(以下三条与payAuthNo不可同时为空)
-     */
-    private String ecAuthCode;
-
-    /**
-     * 电子凭证渠道ID
-     */
-    private String ecChnlAppId;
-
-    /**
-     * 电子凭证用户ID
-     */
-    private String ecChnlUserId;
-
-    /**
-     * 就诊ID
-     */
-    private String mdtrtId;
-
-    /**
-     * 收费批次号(与费用上传一致)
-     */
-    private String chrgBchno;
-
-    /**
-     * 扩展数据
-     */
-    private String extData;
-}

+ 0 - 60
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/payment/EcTokenRefund.java

@@ -1,60 +0,0 @@
-package thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.payment;
-
-import lombok.Data;
-
-import java.util.Date;
-
-@Data
-public class EcTokenRefund {
-
-    /**
-     * 支付订单号(处方上传的出参订单号)
-     */
-    private String payOrdId;
-
-    /**
-     * 应用退款流水号
-     */
-    private String appRefdSn;
-
-    /**
-     * 应用退费时间
-     */
-    private Date appRefdTime;
-
-    /**
-     * 总退费金额
-     */
-    private String totlRefdAmt;
-
-    /**
-     * 医保个人账户支付
-     */
-    private String psnAcctRefdAmt;
-
-    /**
-     * 基金支付
-     */
-    private String fundRefdAmt;
-
-    /**
-     * 现金退费金额
-     */
-    private String cashRefdAmt;
-
-    /**
-     * 电子凭证授权Token
-     */
-    private String ecToken;
-
-    /**
-     * 退费类型(ALL:全部,CASH:只退现金 HI:只退医保)
-     */
-    private String refdType;
-
-    /**
-     * 医保扩展数据
-     */
-    private String extData;
-
-}

+ 0 - 189
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/upload/EcTokenUpldDetl.java

@@ -1,189 +0,0 @@
-package thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.upload;
-
-import lombok.Data;
-
-import java.util.List;
-
-@Data
-public class EcTokenUpldDetl {
-    /**
-     * 机构编码
-     * */
-    private String orgCodg = "H43010500370";
-    
-    /**
-     * 电子凭证机构号
-     * */
-    private String orgId;
-    
-    /**
-     * 人员编号
-     * */
-    private String psnNo;
-    
-    /**
-     * 险种类型
-     * */
-    private String insutype;
-    
-    /**
-     * 医疗机构订单号
-     * */
-    private String medOrgOrd;
-    
-    /**
-     * 要续方的原处方流水
-     * */
-    private String initRxOrd;
-    
-    /**
-     * 电子处方流转标志
-     * */
-    private String rxCircFlag;
-    
-    /**
-     * 开始时间
-     * */
-    private String begntime;
-    
-    /**
-     * 证件号码
-     * */
-    private String idNo;
-    
-    /**
-     * 用户姓名
-     * */
-    private String userName;
-    
-    /**
-     * 证件类别
-     * */
-    private String idType;
-    
-    /**
-     * 电子凭证授权ecToken
-     * */
-    private String ecToken;
-    
-    /**
-     * 参保地
-     * */
-    private String insuCode;
-    
-    /**
-     * 住院/门诊号
-     * */
-    private String iptOtpNo;
-    
-    /**
-     * 医师编码
-     * */
-    private String atddrNo;
-    
-    /**
-     * 医师姓名
-     * */
-    private String drName;
-    
-    /**
-     * 科室编码
-     * */
-    private String deptCode;
-    
-    /**
-     * 科室名称
-     * */
-    private String deptName;
-    
-    /**
-     * 科别
-     * */
-    private String caty;
-    
-    /**
-     * 就诊ID
-     * */
-    private String mdtrtId;
-    
-    /**
-     * 医疗类别
-     * */
-    private String medType;
-    
-    /**
-     * 费用类别
-     * */
-    private String feeType;
-    
-    /**
-     * 医疗费总额
-     * */
-    private String medfeeSumamt;
-    
-    /**
-     * 个人账户使用标志
-     * */
-    private String acctUsedFlag;
-    
-    /**
-     * 主要病情描述
-     * */
-    private String mainCondDscr;
-    
-    /**
-     * 病种编码
-     * */
-    private String diseCodg;
-    
-    /**
-     * 病种名称
-     * */
-    private String diseName;
-    
-    /**
-     * 个人结算方式
-     * */
-    private String psnSetlway;
-    
-    /**
-     * 收费批次号
-     * */
-    private String chrgBchno;
-    
-    /**
-     * 发票号
-     * */
-    private String invono;
-    
-    /**
-     * 出院时间
-     * */
-    private String endtime;
-    
-    /**
-     * 计划生育手术类别
-     * */
-    private String birctrlType;
-    
-    /**
-     * 计划生育手术或生育日期
-     * */
-    private String birctrlMatnDate;
-    
-    /**
-     * 扩展字段
-     * */
-    private String extData;
-    
-    /**
-     * 诊断或症状明细
-     * */
-    private List<EcTokenDiseinfo> diseinfoList;
-    
-    /**
-     * 费用明细
-     * */
-    private List<EcTokenFeeDetail> feedetailList;
-
-}

+ 0 - 28
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/onlinepayment/upload/EcTokenUpldRslt.java

@@ -1,28 +0,0 @@
-package thyyxxk.simzfeeoprnsystm.pojo.onlinepayment.upload;
-
-import lombok.Data;
-
-@Data
-public class EcTokenUpldRslt {
-
-    /**
-     * 支付订单号(医保结算中心订单号)
-     */
-    private String payOrdId;
-
-    /**
-     * 支付token(下单支付使用)
-     */
-    private String payToken;
-
-    /**
-     * 医保支付收银台h5地址(使用收银台模式时,h5地址带上电子凭证线上授权支付返回payAuthNo打开即可,
-     * 如:返回收银台的h5地址拼上&chnlAppId=appid的值&chnlEncData=(payAuthNo对应的加密值))
-     */
-    private String cashierUrl;
-
-    /**
-     * 医保扩展数据(根据各地方医保要求传不同数据内容)
-     */
-    private String extData;
-}

+ 6 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/service/ExecService.java

@@ -125,4 +125,10 @@ public class ExecService {
                 new HttpEntity<>(input, SiUtil.getHttpHeaders(function)), String.class);
         return JSONObject.parseObject(result);
     }
+
+    public String executeTrade(String input, SiFunction function) {
+        RestTemplate template = new RestTemplate();
+        return template.postForObject(siApiUrl,
+                new HttpEntity<>(input, SiUtil.getHttpHeaders(function)), String.class);
+    }
 }

+ 308 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/service/MobilePayService.java

@@ -0,0 +1,308 @@
+package thyyxxk.simzfeeoprnsystm.service;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.tencent.mip.DataHandler;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import thyyxxk.simzfeeoprnsystm.dao.MobilePayDao;
+import thyyxxk.simzfeeoprnsystm.dicts.Insutype;
+import thyyxxk.simzfeeoprnsystm.dicts.SiFunction;
+import thyyxxk.simzfeeoprnsystm.pojo.*;
+import thyyxxk.simzfeeoprnsystm.pojo.mobilepay.*;
+import thyyxxk.simzfeeoprnsystm.utils.DateUtil;
+import thyyxxk.simzfeeoprnsystm.utils.ExceptionEnum;
+import thyyxxk.simzfeeoprnsystm.utils.ResultVoUtil;
+import thyyxxk.simzfeeoprnsystm.utils.StringUtil;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.List;
+import java.util.UUID;
+
+@Slf4j
+@Service
+public class MobilePayService {
+    private final MobilePayDao dao;
+    private final ExecService exec;
+    private final SiMzFeeService mzService;
+
+    // 移动支付测试环境
+    private final static String chnlId = "1I14E7CSC05E4460C80A0000D6788E13";
+    private final static String sm4key = "1I14E7CSC05F4460C80A000070CF4673";
+    private final static String prvKey = "AOyLayJnHqXC56ENBW2vdfd5aPrncBOA3TK27LkvXHfI";
+    private final static String pubKey = "BBVwpoYbrrguE9NEpi0PDKYqJKS5w7lksW1nLtNmVctgrli+B/sKs83tZQBlV3FTvTSaaHbxNidsBjsdisd0XDE=";
+    private final DataHandler dataHandler = DataHandler.newInstance(chnlId, sm4key, pubKey, prvKey);
+
+    @Autowired
+    public MobilePayService(MobilePayDao dao, ExecService exec, SiMzFeeService mzService) throws IOException {
+        this.dao = dao;
+        this.exec = exec;
+        this.mzService = mzService;
+        dataHandler.setSkipVerify(true);
+    }
+
+    public String writeMtReceipt(String hisOrdNum) {
+        String[] arr = hisOrdNum.split("_");
+        if (arr.length != 3) {
+            return "hisOrdNum[" + hisOrdNum + "]不正确!";
+        }
+        MzPatientInfo mzptnt = new MzPatientInfo();
+        mzptnt.setPatNo(arr[0]);
+        mzptnt.setTimes(Integer.parseInt(arr[1]));
+        return mzService.generateSiMzFees(mzptnt);
+    }
+
+    public String getExistMdtrtId(MzPatientInfo mzptnt) {
+        return dao.selectMdtrtIdForMz(mzptnt.getPatNo(), mzptnt.getTimes());
+    }
+
+    public ResultVo<String> obtainBasicPersonInfo(InsuinfoRequest request) {
+        String psnNo = dao.selectPsnNofoForMz(request.getPatNo(), request.getTimes());
+        if (StringUtil.notBlank(psnNo)) {
+            return ResultVoUtil.success(psnNo);
+        }
+        JSONObject input = exec.makeTradeHeaderWithInsureArea(
+                SiFunction.OBTAIN_BASIC_PERSON_INFO, request.getInsuplcAdmdvs(), request.getStaffId());
+        JSONObject data = new JSONObject();
+        data.put("psn_cert_type", "01");
+        data.put("mdtrt_cert_type", "02");
+        data.put("mdtrt_cert_no", request.getSocialNo());
+        data.put("certno", request.getSocialNo());
+        data.put("psn_name", request.getName());
+        input.getJSONObject("input").put("data", data);
+        JSONObject result = exec.executeTrade(input, SiFunction.OBTAIN_BASIC_PERSON_INFO);
+        log.info("【操作员:{}】,人员基本信息获取:\n参数:{},\n结果:{}", request.getStaffId(), input, result);
+        if (null == result) {
+            return ResultVoUtil.fail(ExceptionEnum.NETWORK_ERROR);
+        }
+        if (null == result.getInteger("infcode")) {
+            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "医保中心报错:" + result.getString("message"));
+        }
+        if (result.getIntValue("infcode") == 0) {
+            JSONObject output = result.getJSONObject("output");
+            JSONObject baseinfo = output.getJSONObject("baseinfo");
+            PsnBaseInfo psninfo = JSONObject.parseObject(baseinfo.toJSONString(), PsnBaseInfo.class);
+            psninfo.setPatNo(request.getPatNo());
+            psninfo.setTimes(request.getTimes());
+            psninfo.setLedgerSn(0);
+            psninfo.setMedType(request.getMedType());
+            JSONArray insuinfo = output.getJSONArray("insuinfo");
+            InsuInfo psnInsuInfo = null;
+            for (int i = 0; i < insuinfo.size(); i++) {
+                JSONObject item = insuinfo.getJSONObject(i);
+                InsuInfo insuInfo = JSONObject.parseObject(item.toJSONString(), InsuInfo.class);
+                Insutype insutype = Insutype.get(insuInfo.getInsutype());
+                if (insutype == Insutype.ZGJBYLBX || insutype == Insutype.CXJMJBYLBX) {
+                    psnInsuInfo = insuInfo;
+                    break;
+                }
+            }
+            if (null == psnInsuInfo) {
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "没有查询到符合医保移动支付条件的参保信息。");
+            }
+            int count = dao.selectSiMzInfoCount(request.getPatNo(), request.getTimes());
+            if (count == 0) {
+                psninfo.setMedType("11");
+                psninfo.setLedgerSn(0);
+                psninfo.setInsuplc(psnInsuInfo.getInsuplcAdmdvs());
+                psninfo.setInsutype(psnInsuInfo.getInsutype());
+                psninfo.setPsnType(psnInsuInfo.getPsnType());
+                psninfo.setEmpName(psnInsuInfo.getEmpName());
+                psninfo.setInsuplc(psnInsuInfo.getInsuplcAdmdvs());
+                psninfo.setBalc(psnInsuInfo.getBalc());
+                dao.insertSiMzInfoPsnNo(psninfo);
+            } else {
+                dao.updateSiZyInfoPsnNo(request.getPatNo(), request.getTimes(),
+                        psnInsuInfo.getInsutype(), psnInsuInfo.getBalc(), psnInsuInfo.getInsuplcAdmdvs());
+            }
+            // 生成医保费用
+            MzPatientInfo mzptnt = new MzPatientInfo();
+            mzptnt.setPatNo(request.getPatNo());
+            mzptnt.setTimes(request.getTimes());
+            String mzReceipts = mzService.generateSiMzFees(mzptnt);
+            if (!mzReceipts.equals("SUCCESS")) {
+                return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, mzReceipts);
+            }
+
+            return ResultVoUtil.success(psninfo.getPsnNo());
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString("err_msg"));
+    }
+
+    public ResultVo<String> register(MzPatientInfo mzptnt) {
+        String mdtrtId = getExistMdtrtId(mzptnt);
+        if (StringUtil.notBlank(mdtrtId)) {
+            mzService.revokeOutpatientRegistration(mzptnt);
+        }
+        ResultVo<String> mdtrtRes = mzService.outpatientRegistration(mzptnt);
+        if (mdtrtRes.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+            return mdtrtRes;
+        }
+
+        SiPatInfo siPatInfo = dao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
+        SpcChrDiseAcct spcChrDiseAcct = new SpcChrDiseAcct();
+        spcChrDiseAcct.setStaffId("99999");
+        spcChrDiseAcct.setOpspDiseCode(siPatInfo.getDiseCode());
+        spcChrDiseAcct.setOpspDiseName(siPatInfo.getDiseName());
+        ResultVo<String> upRes = mzService.uploadOutpatientInfo(spcChrDiseAcct, siPatInfo);
+        if (upRes.getCode() != ExceptionEnum.SUCCESS.getCode()) {
+            return upRes;
+        }
+
+        return mdtrtRes;
+    }
+
+    public Upload6201 getUpload6201(InsuinfoRequest request) throws Exception {
+        Upload6201 upload6201 = dao.selectUpload6201(request.getPatNo(), request.getTimes());
+        if (null == upload6201) {
+            throw new Exception("mz_visit_table患者信息为空,请联系医生重开处方。");
+        }
+        upload6201.setPayAuthNo(request.getPayAuthNo());
+        upload6201.setUldLatlnt(request.getUldLatlnt());
+        List<Diseinfo> diseinfoList = dao.selectMpDiseinfos(request.getPatNo(), request.getTimes());
+        if (diseinfoList.isEmpty()) {
+            VisitTableIcd icd = dao.selectMzVisitIcd(request.getPatNo(), request.getTimes());
+            if (null == icd || StringUtil.isBlank(icd.getIcdCode())) {
+                throw new Exception("医保标准诊断不能为空,请联系医生填写。");
+            }
+            String[] icdCodeArr = icd.getIcdCode().split(",");
+            String[] icdNameArr = icd.getIcdName().split(",");
+            for (int i = 0; i < icdCodeArr.length; i++) {
+                Diseinfo diseinfo = new Diseinfo();
+                diseinfo.setDiagType("1");
+                diseinfo.setDiagSrtNo(i + 1);
+                diseinfo.setDiagCode(icdCodeArr[i]);
+                diseinfo.setDiagName(icdNameArr[i]);
+                diseinfo.setDiagDept(upload6201.getDeptName());
+                diseinfo.setDiseDorNo(icd.getDrCode());
+                diseinfo.setDiseDorName(icd.getDrName());
+                diseinfo.setDiagTime(DateUtil.formatDatetime(icd.getVisitDate()));
+                diseinfo.setValiFlag("1");
+                diseinfoList.add(diseinfo);
+            }
+        }
+        upload6201.setDiseinfoList(diseinfoList);
+        upload6201.setFeedetailList(dao.selectMpFees(request.getPatNo(), request.getTimes()));
+        return upload6201;
+    }
+
+    public ResultVo<MobilePay> upload6201(InsuinfoRequest request) throws Exception {
+        Upload6201 upload6201 = getUpload6201(request);
+        String ref = JSONObject.toJSONStringWithDateFormat(upload6201, "yyyy-MM-dd HH:mm:ss");
+        String input = dataHandler.buildReqData(ref);
+        String result = exec.executeTrade(input, SiFunction.ECTOKEN_UPLOAD_FEE_DETAIL);
+        String d = dataHandler.processRspData(result);
+        JSONObject decrypt = JSONObject.parseObject(d);
+
+        log.info("医保移动支付上传费用:\n参数明文:{},\n参数加密:{},\n结果:{}", ref, input, decrypt);
+        Integer infcode = decrypt.getInteger("code");
+        if (infcode == 0) {
+            decrypt = decrypt.getJSONObject("data");
+            MobilePay mobilePay = new MobilePay();
+            mobilePay.setPatNo(request.getPatNo());
+            mobilePay.setTimes(request.getTimes());
+            mobilePay.setMdtrtId(upload6201.getMdtrtId());
+            mobilePay.setPayAuthNo(request.getPayAuthNo());
+            mobilePay.setPayOrdId(decrypt.getString("payOrdId"));
+            mobilePay.setPayToken(decrypt.getString("payToken"));
+            mobilePay.setCreateTime(new Date());
+            mobilePay.setUserName(upload6201.getUserName());
+            mobilePay.setIdNo(upload6201.getIdNo());
+            mobilePay.setIdType("01");
+            dao.insert(mobilePay);
+
+            return ResultVoUtil.success(mobilePay);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, decrypt.getString("message"));
+    }
+
+    public ResultVo<MobilePay> preSettle(MobilePay request) throws Exception {
+        JSONObject data = new JSONObject();
+        data.put("payAuthNo", request.getPayAuthNo());
+        data.put("payOrdId", request.getPayOrdId());
+        data.put("payToken", request.getPayToken());
+        data.put("orgCodg", "H43010500370");
+        data.put("orgBizSer", UUID.randomUUID().toString().replaceAll("-", ""));
+        data.put("mdtrtId", request.getMdtrtId());
+        data.put("chrgBchno", request.getPatNo() + "_" + request.getMdtrtId());
+        data.put("extData", null);
+
+        String input = dataHandler.buildReqData(data.toJSONString());
+        String result = exec.executeTrade(input, SiFunction.ECTOKEN_CREATE_PAY_ORDER);
+        String d = dataHandler.processRspData(result);
+        JSONObject decrypt = JSONObject.parseObject(d);
+
+        log.info("医保移动支付下单:\n参数明文:{},\n参数加密:{},\n结果:{}", data, input, decrypt);
+        Integer infcode = decrypt.getInteger("code");
+        if (infcode == 0) {
+            JSONObject response = decrypt.getJSONObject("data");
+            request.setOrdStas(response.getString("ordStas"));
+            request.setFeeSumamt(response.getString("feeSumamt"));
+            request.setOwnPayAmt(response.getString("ownPayAmt"));
+            request.setPsnAcctPay(response.getString("psnAcctPay"));
+            request.setFundPay(response.getString("fundPay"));
+            request.setUpdateTime(new Date());
+            dao.updateById(request);
+            return ResultVoUtil.success(request);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, decrypt.getString("message"));
+    }
+
+    public ResultVo<JSONObject> orderQuery(String id) throws Exception {
+        MobileOrderQuery query = dao.selectOrderQueryData(id);
+        String ref = JSONObject.toJSONString(query);
+//        JSONObject input = encryptUtil.buildReqData(JSONObject.parseObject(ref));
+//        JSONObject result = exec.executeTrade(input, SiFunction.MOBILE_PAY_QUERY);
+//        JSONObject decrypt = encryptUtil.processRspData(result);
+
+        String input = dataHandler.buildReqData(ref);
+        String result = exec.executeTrade(input, SiFunction.MOBILE_PAY_QUERY);
+        String d = dataHandler.processRspData(result);
+        JSONObject decrypt = JSONObject.parseObject(d);
+
+        log.info("医保订单结算结果查询:\n参数:{},\n结果:{}", ref, decrypt);
+        Integer infcode = decrypt.getInteger("code");
+        if (null != infcode && infcode == 0) {
+            return ResultVoUtil.success(decrypt.getJSONObject("data"));
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, decrypt.getString("message"));
+    }
+
+    public ResultVo<MobilePay> preSettle2(String id) throws Exception {
+        MobilePay request = dao.selectById(id);
+        JSONObject data = new JSONObject();
+        data.put("payAuthNo", request.getPayAuthNo());
+        data.put("payOrdId", request.getPayOrdId());
+        data.put("payToken", request.getPayToken());
+        data.put("orgCodg", "H43010500370");
+        data.put("orgBizSer", UUID.randomUUID().toString().replaceAll("-", ""));
+        data.put("mdtrtId", request.getMdtrtId());
+        data.put("chrgBchno", request.getPatNo() + "_" + request.getMdtrtId());
+        data.put("extData", null);
+//        JSONObject input = encryptUtil.buildReqData(data);
+//        JSONObject result = exec.executeTrade(input, SiFunction.ECTOKEN_CREATE_PAY_ORDER);
+//        JSONObject decrypt = encryptUtil.processRspData(result);
+
+        String input = dataHandler.buildReqData(data);
+        String result = exec.executeTrade(input, SiFunction.ECTOKEN_CREATE_PAY_ORDER);
+        String d = dataHandler.processRspData(result);
+        JSONObject decrypt = JSONObject.parseObject(d);
+
+        log.info("【操作员:99999】,医保移动支付下单:\n参数:{},\n结果:{}", data, decrypt);
+        Integer infcode = decrypt.getInteger("code");
+        if (infcode == 0) {
+            JSONObject response = decrypt.getJSONObject("data");
+            request.setOrdStas(response.getString("ordStas"));
+            request.setFeeSumamt(response.getString("feeSumamt"));
+            request.setOwnPayAmt(response.getString("ownPayAmt"));
+            request.setPsnAcctPay(response.getString("psnAcctPay"));
+            request.setFundPay(response.getString("fundPay"));
+            request.setUpdateTime(new Date());
+            dao.updateById(request);
+            return ResultVoUtil.success(request);
+        }
+        return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, decrypt.getString("message"));
+    }
+}

+ 16 - 21
src/main/java/thyyxxk/simzfeeoprnsystm/service/SiMzFeeService.java

@@ -16,10 +16,7 @@ import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
+import java.util.*;
 import java.util.concurrent.TimeUnit;
 
 @Slf4j
@@ -67,6 +64,15 @@ public class SiMzFeeService {
             return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, "未找到收费明细,请先生成医保处方。");
         }
 
+        if (null == p.getInsutype()) {
+            SiPatInfo siPatInfo = mzDao.selectSiPatInfoForMz(p.getPatNo(), p.getTimes());
+            p.setInsuplcAdmdvs(siPatInfo.getInsuplcAdmdvs());
+            p.setInsutype(siPatInfo.getInsutype());
+            p.setPsnType(siPatInfo.getPsnType());
+            p.setName(siPatInfo.getPsnName());
+            p.setSocialNo(siPatInfo.getCertno());
+        }
+
         // 查询处方是否有折扣
         String discount = queryDiscount(p.getPatNo(), p.getTimes(), chargeCodeList);
         if (!discount.equals("OK")) {
@@ -116,7 +122,7 @@ public class SiMzFeeService {
             p.setMdtrtId(output.getString("mdtrt_id"));
             p.setVisitDate(regstrtn.getBegntime());
             mzDao.afterRegistrtn(p);
-            return ResultVoUtil.success("挂号成功。");
+            return ResultVoUtil.success(p.getMdtrtId());
         }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
@@ -160,7 +166,7 @@ public class SiMzFeeService {
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
 
-    private ResultVo<String> uploadOutpatientInfo(SpcChrDiseAcct spcChrDiseAcct, SiPatInfo siPatInfo) {
+    public ResultVo<String> uploadOutpatientInfo(SpcChrDiseAcct spcChrDiseAcct, SiPatInfo siPatInfo) {
         JSONObject input = exec.makeTradeHeaderWithInsureArea(SiFunction.UPLOAD_OUTPATIENT_INFO,
                 siPatInfo.getInsuplcAdmdvs(), spcChrDiseAcct.getStaffId());
         JSONObject mdtrtinfo = new JSONObject();
@@ -570,16 +576,13 @@ public class SiMzFeeService {
         log.info("【操作员:{}】门诊结算撤销:\n参数:{},\n结果:{}", p.getStaffId(), input, result);
         Integer infcode = result.getInteger(RESULT_CODE);
         logDao.insert(new SiLog(input, result, p.getPatNo(), p.getTimes(), infcode, setlinfo.getPsnNo()));
+        if (p.needRevokeRegistration()) {
+            deletePresettleInfoAndRevokeYb(p);
+        }
         if (infcode == 0) {
             afterRevokeSetl(p.getPatNo(), p.getTimes(), input.getString("msgid"));
-            if (p.needRevokeRegistration()) {
-                deletePresettleInfoAndRevokeYb(p);
-            }
             return getFundDetailFromSetlinfo(setlinfo);
         }
-        if (p.needRevokeRegistration()) {
-            deletePresettleInfoAndRevokeYb(p);
-        }
         return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, result.getString(ERROR_MESSAGE));
     }
 
@@ -662,12 +665,6 @@ public class SiMzFeeService {
         mzptnt.setAcctUsedFlag(param.getAcctUsedFlag());
         mzptnt.setStraitSettle(param.getStraitSettle());
 
-        // 生成医保费用
-        String mzReceipts = generateSiMzFees(mzptnt);
-        if (!mzReceipts.equals("SUCCESS")) {
-            return ResultVoUtil.fail(ExceptionEnum.LOGICAL_ERROR, mzReceipts);
-        }
-
         // 填充医保基本信息
         SiPatInfo siPatInfo = mzDao.selectSiPatInfoForMz(mzptnt.getPatNo(), mzptnt.getTimes());
         mzptnt.setInsuplcAdmdvs(siPatInfo.getInsuplcAdmdvs());
@@ -741,7 +738,7 @@ public class SiMzFeeService {
         return presetlResponse;
     }
 
-    private String generateSiMzFees(MzPatientInfo mzptnt) {
+    public String generateSiMzFees(MzPatientInfo mzptnt) {
         ResultVo<List<Map<String, Object>>> getMzRcptRes = webHisService.getMzReceipts(webHisUrl, mzptnt);
         if (null == getMzRcptRes) {
             return ExceptionEnum.NETWORK_ERROR.getMessage();
@@ -831,8 +828,6 @@ public class SiMzFeeService {
             if (null != item.getPayCount() && item.getPayCount() > 0) {
                 scheduledDao.updateMzSaved(item.getSetlId());
             } else {
-//                log.info("【结算ID: {}】有未支付的医保结算,发起撤销结算。", item.getSetlId());
-//                revokeOutpatientSettlementForTask(item);
                 return true;
             }
         }

+ 1 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/utils/SiUtil.java

@@ -68,6 +68,7 @@ public class SiUtil {
         headers.add("_api_version", API_VERSION);
         headers.add("_api_timestamp", timestamp);
         headers.add("_api_signature", getSignature(timestamp, function.getCode()));
+        headers.add("Content-Type", "application/json");
         return headers;
     }
 

+ 141 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/utils/mobilepay/CommonUtil.java

@@ -0,0 +1,141 @@
+package thyyxxk.simzfeeoprnsystm.utils.mobilepay;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.PropertyFilter;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import jdk.nashorn.internal.objects.NativeString;
+
+public class CommonUtil {
+    private static final SerializerFeature[] defaultFeatures;
+    private static final SerializerFeature[] stringFeatures;
+    private static PropertyFilter filter;
+
+    public CommonUtil() {
+    }
+
+    private static boolean isBaseDataType(Class clazz) {
+        return clazz.equals(String.class) || clazz.equals(Integer.class) || clazz.equals(Byte.class) || clazz.equals(Long.class) || clazz.equals(Double.class) || clazz.equals(Float.class) || clazz.equals(Character.class) || clazz.equals(Short.class) || clazz.equals(BigDecimal.class) || clazz.equals(BigInteger.class) || clazz.equals(Boolean.class) || clazz.equals(Date.class) || clazz.isPrimitive();
+    }
+
+    public static String getSignStr(String appSecret, Map<String, Object> param) {
+        return getSignStr(appSecret, param, true);
+    }
+
+    public static String getSignStr(String appSecret, Map<String, Object> param, boolean stringValue) {
+        JSONObject jsonObject = new JSONObject(param);
+        return getSignStr(appSecret, jsonObject, stringValue);
+    }
+
+    public static String getSignStr(String appSecret, JSONObject param, boolean stringValue) {
+        StringBuilder sb = new StringBuilder();
+        String[] sortKeys = (String[])param.keySet().stream().sorted().toArray((x$0) -> {
+            return new String[x$0];
+        });
+        String[] var5 = sortKeys;
+        int var6 = sortKeys.length;
+
+        for(int var7 = 0; var7 < var6; ++var7) {
+            String key = var5[var7];
+            Object val = param.get(key);
+            if (null != val && !Objects.equals(key, "signData") && !Objects.equals(key, "encData") && !Objects.equals(key, "extra")) {
+                String value;
+                if (isBaseDataType(val.getClass())) {
+                    value = val.toString();
+                } else {
+                    value = JSON.toJSONString(val, filter, stringValue ? stringFeatures : defaultFeatures);
+                }
+
+                if (!value.trim().equals("")) {
+                    if (sb.length() > 0) {
+                        sb.append("&");
+                    }
+
+                    sb.append(key);
+                    sb.append("=");
+                    sb.append(value);
+                }
+            }
+        }
+
+        sb.append("&key=" + appSecret);
+        String sortStr = sb.toString();
+        return sortStr;
+    }
+
+    public static String stringToHexString(String s) {
+        String str = "";
+
+        for(int i = 0; i < s.length(); ++i) {
+            int ch = s.charAt(i);
+            String s4 = Integer.toHexString(ch);
+            str = str + s4;
+        }
+
+        return str;
+    }
+
+    public static String byteArrayToHex(byte[] byteArray) {
+        char[] hexDigits = new char[]{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};
+        char[] resultCharArray = new char[byteArray.length * 2];
+        int index = 0;
+        byte[] var4 = byteArray;
+        int var5 = byteArray.length;
+
+        for(int var6 = 0; var6 < var5; ++var6) {
+            byte b = var4[var6];
+            resultCharArray[index++] = hexDigits[b >>> 4 & 15];
+            resultCharArray[index++] = hexDigits[b & 15];
+        }
+
+        return (new String(resultCharArray)).toUpperCase();
+    }
+
+    public static String byteToHex(byte[] b) {
+        if (b == null) {
+            throw new IllegalArgumentException("Argument b ( byte array ) is null! ");
+        } else {
+            String hs = "";
+            String stmp = "";
+
+            for(int n = 0; n < b.length; ++n) {
+                stmp = Integer.toHexString(b[n] & 255);
+                if (stmp.length() == 1) {
+                    hs = hs + "0" + stmp;
+                } else {
+                    hs = hs + stmp;
+                }
+            }
+
+            return hs.toUpperCase();
+        }
+    }
+
+    public static List<String> getStrList(String inputString, int length, int size) {
+        List<String> list = new ArrayList();
+
+        for(int index = 0; index < size; ++index) {
+            String childStr = NativeString.substring(inputString, index * length, (index + 1) * length);
+            list.add(childStr);
+        }
+
+        return list;
+    }
+
+    static {
+        defaultFeatures = new SerializerFeature[]{SerializerFeature.MapSortField};
+        stringFeatures = new SerializerFeature[]{SerializerFeature.MapSortField, SerializerFeature.WriteNonStringValueAsString};
+        filter = new PropertyFilter() {
+            public boolean apply(Object source, String name, Object value) {
+                return !Objects.equals(value, (Object)null) && (!value.getClass().equals(String.class) || !Objects.equals(value, ""));
+            }
+        };
+    }
+}

+ 85 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/utils/mobilepay/EncryptUtil.java

@@ -0,0 +1,85 @@
+package thyyxxk.simzfeeoprnsystm.utils.mobilepay;
+
+import com.alibaba.fastjson.JSONObject;
+import com.alibaba.fastjson.serializer.SerializerFeature;
+import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
+
+import java.nio.charset.StandardCharsets;
+import java.rmi.ServerException;
+import java.util.Base64;
+
+public class EncryptUtil {
+    // 移动支付测试环境
+    private final static String chnlId = "1I14E7CSC05E4460C80A0000D6788E13";
+    private final static String sm4key = "1I14E7CSC05F4460C80A000070CF4673";
+    private final static String prvKey = "AOyLayJnHqXC56ENBW2vdfd5aPrncBOA3TK27LkvXHfI";
+    private final static String pubKey = "BBVwpoYbrrguE9NEpi0PDKYqJKS5w7lksW1nLtNmVctgrli+B/sKs83tZQBlV3FTvTSaaHbxNidsBjsdisd0XDE=";
+
+    private final byte[] encryptKeys;
+    private final String publicKeys;
+    private final String privateKeys;
+    private boolean skipVerify = false;
+    Base64.Decoder decoder = Base64.getDecoder();
+    SM2Util sm2 = new SM2Util();
+
+    private EncryptUtil() {
+        this.encryptKeys = SM4Util.encryptEcb(CommonUtil.stringToHexString(chnlId.substring(0, 16)), sm4key).substring(0, 16).toUpperCase().getBytes();
+        this.publicKeys = CommonUtil.byteArrayToHex(this.decoder.decode(pubKey));
+        this.privateKeys = CommonUtil.byteArrayToHex(this.decoder.decode(prvKey));
+    }
+
+    public static EncryptUtil newInstance() {
+        return new EncryptUtil();
+    }
+
+    public JSONObject buildReqData(JSONObject data) throws Exception {
+        JSONObject reqJSON = new JSONObject();
+        String version = "2.0.1";
+        reqJSON.put("version", version);
+        reqJSON.put("encType", "SM4");
+        reqJSON.put("signType", "SM2");
+        reqJSON.put("appId", chnlId);
+        reqJSON.put("timestamp", System.currentTimeMillis());
+        reqJSON.put("extra", null);
+        reqJSON.put("data", data);
+        String signStr = CommonUtil.getSignStr(sm4key, reqJSON, true);
+        String signData = sm2.sign(signStr, this.privateKeys);
+        reqJSON.put("signData", signData);
+        byte[] dataBytes = data.toString(SerializerFeature.WriteMapNullValue).getBytes(StandardCharsets.UTF_8);
+        byte[] encDataBytes = SM4Util.encrypt_Ecb_Padding(this.encryptKeys, dataBytes);
+        String encData = ByteUtils.toHexString(encDataBytes);
+        reqJSON.put("encData", encData);
+        reqJSON.remove("data");
+        return reqJSON;
+    }
+
+    public JSONObject processRspData(JSONObject rspJSON) throws Exception {
+        Integer codeObj = rspJSON.getInteger("code");
+        if (codeObj != null && codeObj == 0) {
+            String encData = rspJSON.get("encData").toString();
+
+            JSONObject dataObject;
+            try {
+                byte[] cipherData = ByteUtils.fromHexString(encData);
+                byte[] cipherByte = SM4Util.decrypt_Ecb_Padding(this.encryptKeys, cipherData);
+                String dEncData = new String(cipherByte, StandardCharsets.UTF_8);
+                dataObject = JSONObject.parseObject(dEncData);
+            } catch (Exception var9) {
+                throw new ServerException(var9.getMessage());
+            }
+
+            rspJSON.put("data", dataObject);
+//            if (!this.skipVerify) {
+//                String signStr = CommonUtil.getSignStr(sm4key, rspJSON);
+//                if (!this.sm2.verify(signStr, rspJSON.get("signData").toString(), this.publicKeys)) {
+//                    throw new ServerException("签名出错。");
+//                }
+//            }
+
+            rspJSON.remove("encData");
+            rspJSON.remove("signData");
+        }
+
+        return rspJSON;
+    }
+}

+ 172 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/utils/mobilepay/SM2Util.java

@@ -0,0 +1,172 @@
+package thyyxxk.simzfeeoprnsystm.utils.mobilepay;
+
+import java.io.IOException;
+import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
+import java.security.InvalidKeyException;
+import java.security.KeyFactory;
+import java.security.NoSuchAlgorithmException;
+import java.security.Signature;
+import java.security.SignatureException;
+import java.security.spec.InvalidKeySpecException;
+import java.util.Base64;
+import java.util.List;
+
+import org.bouncycastle.asn1.ASN1Encodable;
+import org.bouncycastle.asn1.ASN1EncodableVector;
+import org.bouncycastle.asn1.ASN1InputStream;
+import org.bouncycastle.asn1.ASN1Integer;
+import org.bouncycastle.asn1.ASN1Object;
+import org.bouncycastle.asn1.ASN1Primitive;
+import org.bouncycastle.asn1.ASN1Sequence;
+import org.bouncycastle.asn1.ASN1SequenceParser;
+import org.bouncycastle.asn1.DERSequence;
+import org.bouncycastle.asn1.gm.GMNamedCurves;
+import org.bouncycastle.asn1.gm.GMObjectIdentifiers;
+import org.bouncycastle.asn1.x9.X9ECParameters;
+import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPrivateKey;
+import org.bouncycastle.jcajce.provider.asymmetric.ec.BCECPublicKey;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.jce.spec.ECParameterSpec;
+import org.bouncycastle.jce.spec.ECPrivateKeySpec;
+import org.bouncycastle.jce.spec.ECPublicKeySpec;
+import org.bouncycastle.math.ec.ECPoint;
+import org.bouncycastle.util.encoders.Hex;
+
+public class SM2Util {
+    private BouncyCastleProvider provider;
+    private X9ECParameters parameters;
+    private ECParameterSpec ecParameterSpec;
+    private KeyFactory keyFactory;
+    Base64.Decoder decoder = Base64.getDecoder();
+    Base64.Encoder encoder = Base64.getEncoder();
+
+    public SM2Util() {
+        try {
+            this.provider = new BouncyCastleProvider();
+            this.parameters = GMNamedCurves.getByName("sm2p256v1");
+            this.ecParameterSpec = new ECParameterSpec(this.parameters.getCurve(), this.parameters.getG(), this.parameters.getN(), this.parameters.getH());
+            this.keyFactory = KeyFactory.getInstance("EC", this.provider);
+        } catch (Exception var2) {
+            Exception e = var2;
+            e.printStackTrace();
+        }
+
+    }
+
+    public String sign(String plainText, String prvKey) throws NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, SignatureException, IOException {
+        Signature signature = Signature.getInstance(GMObjectIdentifiers.sm2sign_with_sm3.toString(), this.provider);
+        BigInteger bigInteger = new BigInteger(prvKey, 16);
+        BCECPrivateKey privateKey = (BCECPrivateKey)this.keyFactory.generatePrivate(new ECPrivateKeySpec(bigInteger, this.ecParameterSpec));
+        signature.initSign(privateKey);
+        signature.update(plainText.getBytes(StandardCharsets.UTF_8));
+        String signStr = Base64.getEncoder().encodeToString(signature.sign());
+        signStr = (new BigInteger(this.decoder.decode(signStr))).toString(16);
+        String derStr = SM2Util.SM2SignAsn1.parseSm2SignAsn1Object(signStr);
+        byte[] hexStr = Hex.decode(derStr);
+        return this.encoder.encodeToString(hexStr);
+    }
+
+    public boolean verify(String plainText, String signatureValue, String pubKey) throws NoSuchAlgorithmException {
+        Signature signature = Signature.getInstance(GMObjectIdentifiers.sm2sign_with_sm3.toString(), this.provider);
+
+        try {
+            ECPoint ecPoint = this.parameters.getCurve().decodePoint(Hex.decode(pubKey));
+            BCECPublicKey key = (BCECPublicKey)this.keyFactory.generatePublic(new ECPublicKeySpec(ecPoint, this.ecParameterSpec));
+            signature.initVerify(key);
+            signature.update(plainText.getBytes(StandardCharsets.UTF_8));
+            byte[] signDataByte = this.decoder.decode(signatureValue);
+            String sigDataHex = Hex.toHexString(signDataByte);
+            List<String> list = CommonUtil.getStrList(sigDataHex, 64, 2);
+            String sm2SignAsn1 = SM2Util.SM2SignAsn1.buildSm2SignAsn1Object(new BigInteger((String)list.get(0), 16), new BigInteger((String)list.get(1), 16));
+            byte[] sm2SignAsn1Byte = Hex.decode(sm2SignAsn1);
+            String sm2SignAsn1ByteText = this.encoder.encodeToString(sm2SignAsn1Byte);
+            return signature.verify(this.decoder.decode(sm2SignAsn1ByteText));
+        } catch (Exception var13) {
+            Exception e = var13;
+            System.out.println(e.toString());
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    public static class SM2SignAsn1 extends ASN1Object {
+        private ASN1Integer int1;
+        private ASN1Integer int2;
+
+        public ASN1Integer getInt1() {
+            return this.int1;
+        }
+
+        public void setInt1(ASN1Integer int1) {
+            this.int1 = int1;
+        }
+
+        public ASN1Integer getInt2() {
+            return this.int2;
+        }
+
+        public void setInt2(ASN1Integer int2) {
+            this.int2 = int2;
+        }
+
+        public SM2SignAsn1(ASN1Integer int1, ASN1Integer int2) {
+            this.int1 = int1;
+            this.int2 = int2;
+        }
+
+        public ASN1Primitive toASN1Primitive() {
+            ASN1EncodableVector vector = new ASN1EncodableVector();
+            vector.add(this.int1);
+            vector.add(this.int2);
+            return new DERSequence(vector);
+        }
+
+        public static String buildSm2SignAsn1Object(BigInteger int1, BigInteger int2) {
+            String res = null;
+
+            try {
+                SM2Util.SM2SignAsn1 sm2SignAsn1 = new SM2Util.SM2SignAsn1(new ASN1Integer(int1), new ASN1Integer(int2));
+                byte[] encoded = sm2SignAsn1.getEncoded();
+                res = CommonUtil.byteToHex(encoded);
+            } catch (Exception var5) {
+                Exception e = var5;
+                e.printStackTrace();
+            }
+
+            return res;
+        }
+
+        public static String parseSm2SignAsn1Object(String hexStr) {
+            byte[] hexByte = Hex.decode(hexStr);
+            String encodedText = Base64.getEncoder().encodeToString(hexByte);
+            StringBuilder sb = new StringBuilder();
+            byte[] data = org.bouncycastle.util.encoders.Base64.decode(encodedText);
+            ASN1InputStream ais = new ASN1InputStream(data);
+
+            try {
+                while(true) {
+                    ASN1Primitive primitive;
+                    do {
+                        if ((primitive = ais.readObject()) == null) {
+                            return sb.toString().replace("#", "");
+                        }
+                    } while(!(primitive instanceof ASN1Sequence));
+
+                    ASN1Sequence sequence = (ASN1Sequence)primitive;
+                    ASN1SequenceParser parser = sequence.parser();
+
+                    ASN1Encodable encodable;
+                    while((encodable = parser.readObject()) != null) {
+                        primitive = encodable.toASN1Primitive();
+                        String temp = String.valueOf(primitive);
+                        String s = String.format("%064x", new BigInteger(temp));
+                        sb.append(s);
+                    }
+                }
+            } catch (Exception var12) {
+                throw new SecurityException(var12);
+            }
+        }
+    }
+}

+ 58 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/utils/mobilepay/SM4Util.java

@@ -0,0 +1,58 @@
+package thyyxxk.simzfeeoprnsystm.utils.mobilepay;
+
+import java.security.Key;
+import java.security.Security;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.pqc.math.linearalgebra.ByteUtils;
+
+public class SM4Util {
+
+    public SM4Util() {
+    }
+
+    private static Cipher generateEcbCipher(String algorithmName, int mode, byte[] key) throws Exception {
+        Cipher cipher = Cipher.getInstance(algorithmName, "BC");
+        Key sm4Key = new SecretKeySpec(key, "SM4");
+        cipher.init(mode, sm4Key);
+        return cipher;
+    }
+
+    public static String encryptEcb(String hexKey, String paramStr) {
+        try {
+            String cipherText = "";
+            byte[] keyData = ByteUtils.fromHexString(hexKey);
+            byte[] srcData = paramStr.getBytes("UTF-8");
+            byte[] cipherArray = encrypt_Ecb_Padding(keyData, srcData);
+            cipherText = ByteUtils.toHexString(cipherArray);
+            return cipherText;
+        } catch (Exception var6) {
+            return paramStr;
+        }
+    }
+
+    public static byte[] encrypt_Ecb_Padding(byte[] key, byte[] data) throws Exception {
+        Cipher cipher = generateEcbCipher("SM4/ECB/PKCS7Padding", 1, key);
+        return cipher.doFinal(data);
+    }
+
+    public static String decryptEcb(String hexKey, String cipherText) throws Exception {
+        String decryptStr = "";
+        byte[] keyData = ByteUtils.fromHexString(hexKey);
+        byte[] cipherData = ByteUtils.fromHexString(cipherText);
+        byte[] srcData = decrypt_Ecb_Padding(keyData, cipherData);
+        decryptStr = new String(srcData, "UTF-8");
+        return decryptStr;
+    }
+
+    public static byte[] decrypt_Ecb_Padding(byte[] key, byte[] cipherText) throws Exception {
+        Cipher cipher = generateEcbCipher("SM4/ECB/PKCS7Padding", 2, key);
+        return cipher.doFinal(cipherText);
+    }
+
+    static {
+        Security.addProvider(new BouncyCastleProvider());
+    }
+}
+

+ 0 - 30
src/main/java/thyyxxk/simzfeeoprnsystm/utils/rxsign/EasyGmUtils.java

@@ -300,9 +300,7 @@ public class EasyGmUtils {
     }
 
     public static byte[] sm4Decrypt(byte[] keyBytes, byte[] cipher) {
-//        if (keyBytes.length != 16) throw new RuntimeException("err key length");
         if (cipher.length % 16 != 0) throw new RuntimeException("err data length");
-
         try {
             Key key = new SecretKeySpec(keyBytes, "SM4");
             Cipher in = BCUtils.getCipher("SM4/ECB/PKCS7Padding");
@@ -314,32 +312,4 @@ public class EasyGmUtils {
         }
     }
 
-    public static void main(String[] args) {
-        byte[] msg = "1234567890".getBytes();
-        byte[] userId = "D91CEB11EE62219CD91CEB11EE62219C".getBytes();
-        byte[] prvkey = Hex.decode("5B015D0B2C0B6BEBB27EA8");
-        byte[] pubkey = Hex.decode("409AEFE32E150677FC2372B758178ECBAD3BBED494975596B3CD603C36F9ED7E690A5B052AFDBD86D46288FA9919BA05F3D48F6532EB28DC02D0DAA35689A50C");
-
-        prvkey = Base64.getDecoder().decode("JShsBOJL0RgPAoPttEB1hgtPAvCikOl0V1oTOYL7k5U=");
-        pubkey = Base64.getDecoder().decode("BE8d9gaaCGrE4dHErWCjqyahm6X8l6Rd7fOGx0gNyrGPp0XDoPbbpu1pk9A2fZ9rEsBtwB1Aecnto/gH4h+T7cY=");
-        byte[] asig = signSm3WithSm2(msg, userId, prvkey);
-        System.out.println(Hex.toHexString(asig));
-        boolean verified = verifySm3WithSm2(msg, userId, asig, pubkey);
-        System.out.println(verified);
-
-
-        String plainString = "1234567890abcdef";
-        byte[] plain = plainString.getBytes();
-        System.out.println(new String(plain));
-//        byte[] key = Hex.decode("0123456789abcdeffedcba9876543210");
-        byte[] sm4key = "0123456789abcdef".getBytes();
-//        byte[] cipher = Hex.decode("595298c7c6fd271f0402f804c33d3f66");
-        byte[] bs = sm4Encrypt(sm4key, plain);
-        System.out.println(Hex.toHexString(bs));
-        ;
-        bs = sm4Decrypt(sm4key, bs);
-        System.out.println(new String(bs));
-        System.out.println(Hex.toHexString(bs));
-    }
-
 }

+ 5 - 38
src/main/java/thyyxxk/simzfeeoprnsystm/utils/rxsign/HseEncAndDecUtil.java

@@ -13,17 +13,20 @@ import com.alibaba.fastjson.JSONObject;
 import thyyxxk.simzfeeoprnsystm.utils.StringUtil;
 
 public class HseEncAndDecUtil {
+    // 电子处方正式环境
     private final static String chnlId = "7304C76CE4184A00A3DA1460BE84E816";
     private final static String sm4key = "44EAE9EE423045BCBA92E8A3C69E7480";
     private final static String prvKey = "SpPKV8JZc3AWgGjx6KX++qYBp5R3zjqlw1a7k2RERMA=";
     private final static String pubKey = "BFH4M003lE5DsI/o8r8AQ/14Q2Z/yx+LJU0VV/gtRCqSFdyJFWNwuCOuQqGsbsEIVZUKJOEQ39H/NirfpFVFRCA=";
-//    测试环境
+//    电子处方测试环境
 //    private final static String chnlId = "BABDC3CDA4CE434A9F5887FC31B6415F";
 //    private final static String sm4key = "2809E305E2AA4438B751409C5AF1E9DD";
 //    private final static String prvKey = "ANhQT/Ok+ANQjSl3hmG/a9PmMXZS7SG91bm82mFx1h2Y";
 //    private final static String pubKey = "BEkfB7YO51rtfLV0HrfuvWTXgUmNSHgksdPPDQUTbiRacf+rPlvO2+TXDR7qi8UKxCxjZ1wLjoP0u80dvGVgNQE=";
 
 
+
+
     /**
      * sm2签名
      * @param message 未加密报文
@@ -35,7 +38,7 @@ public class HseEncAndDecUtil {
         try {
             JSONObject jsonObject = JSON.parseObject(message);
             removeEmpty(jsonObject);
-            messageByte = SignUtil.getSignText(jsonObject, sm4key).getBytes("UTF-8");
+            messageByte = SignUtil.getSignText(jsonObject, sm4key).getBytes(StandardCharsets.UTF_8);
         }catch (Exception e){
             messageByte = message.getBytes();
         }
@@ -205,40 +208,4 @@ public class HseEncAndDecUtil {
         }
     }
 
-    public static void main(String[] args) throws Exception{
-        String t = "{\"mdtrtCertNo\":\"430105199305143511\",\"mdtrtCertType\":\"02\"," +
-                "\"insuPlcNo\":\"430199\",\"valiEndTime\":\"2024-07-14 08:36:17\"," +
-                "\"diseinfo\":[{\"diagDept\":\"内分泌与代谢疾病专科\",\"diagTime\"" +
-                ":\"2024-07-11 08:36:17\",\"diagSrtNo\":1,\"diagType\":\"1\"," +
-                "\"maindiagFlag\":\"1\",\"diagName\":\"痛风性关节炎\",\"diagCode\":" +
-                "\"M10.002\",\"diagDrName\":\"周伟\",\"diagDrNo\":\"D430105015806\"}]," +
-                "\"valiDays\":3,\"mdtrtinfo\":{\"patnAge\":31,\"maindiagName\":" +
-                "\"痛风性关节炎\",\"psnCertType\":\"01\",\"gend\":\"1\",\"drProfttlCodg\"" +
-                ":\"231\",\"drProfttlName\":\"主任医师\",\"iptOtpNo\":\"1001090-6\"," +
-                "\"drDeptName\":\"内分泌与代谢疾病专科\",\"psnNo\":\"43000020100037050543\"," +
-                "\"caty\":\"A03.07\",\"medType\":\"11\",\"prscDeptCode\":\"1020700\"," +
-                "\"drCode\":\"D430105015806\",\"drDeptCode\":\"1020700\",\"certno\":" +
-                "\"430105199305143511\",\"mdtrtTime\":\"2024-07-11 08:36:17\"," +
-                "\"prscDeptName\":\"内分泌与代谢疾病专科\",\"fixmedinsCode\":" +
-                "\"H43010500370\",\"patnName\":\"李文轩\",\"prscDrName\":\"周伟\"," +
-                "\"maindiagCode\":\"M10.002\",\"spDiseFlag\":\"0\",\"fixmedinsName\":" +
-                "\"长沙泰和医院\",\"mdtrtId\":\"3657046138\"},\"rxTypeCode\":1," +
-                "\"bizTypeCode\":\"01\",\"rxCotnFlag\":\"0\",\"rxDrugCnt\":1,\"hospRxno\":" +
-                "\"1001090-6_14_1\",\"rxExraAttrCode\":\"99\",\"rxdrugdetail\":" +
-                "[{\"drugTotlcntEmp\":\"盒\",\"medcBegntime\":\"2024-07-11 08:36:17\"," +
-                "\"medcWayDscr\":\"口服\",\"drugTotlcnt\":4.0,\"drugDosunt\":\"盒\"," +
-                "\"medcDays\":3,\"usedFrquCodg\":\"12\",\"drugGenname\":\"头孢克肟分散片\"," +
-                "\"medListCodg\":\"XJ01DDT073A006010102138\",\"sinDosunt\":\"盒\"," +
-                "\"drugDosform\":\"分散片\",\"drugSpec\":\" 100mg x6片/盒\",\"drugCnt\":4.0," +
-                "\"hospApprFlag\":\"1\",\"medcWayCodg\":\"1\",\"medcEndtime\":\"2024-07" +
-                "-14 08:36:17\",\"fixmedinsHilistId\":\"05360\",\"rxItemTypeCode\":\"11\"," +
-                "\"sinDoscnt\":1.0,\"usedFrquName\":\"BID\"}],\"prscTime\":\"2024-07-1" +
-                "1 08:36:17\"}";
-        System.out.println(
-                "=====================\n"+
-                Base64.getEncoder().encodeToString(t.getBytes(StandardCharsets.UTF_8))
-        +"\n======================="
-        );
-    }
-
 }

+ 14 - 10
src/main/resources/application.yml

@@ -45,6 +45,10 @@ spring:
   jackson:
     time-zone: GMT+8
     date-format: yyyy-MM-dd HH:mm:ss
+  mvc:
+    format:
+      date: yyyy-MM-dd
+      date-time: yyyy-MM-dd HH:mm:ss
 forest:
   timeout: 0
   read-timeout: 0
@@ -56,15 +60,15 @@ mybatis-plus:
     map-underscore-to-camel-case: true
 
 #正式环境
-si-api-url: http://dms.hun.hsip.gov.cn/isp-api/powercsb/1101
-si-access-key: 04eMGRg7beAO6vqwrZiLacV8Uy3jNn7QGDUcBO
-si-secret-key: SK3Oip3a2R3NLz2xm58Mpmi69oFu96KrdKNRKglN
-web-his-url: http://172.16.32.160:8077
-thmz-url: http://172.16.32.160:81/thmz
+#si-api-url: http://dms.hun.hsip.gov.cn/isp-api/powercsb/1101
+#si-access-key: 04eMGRg7beAO6vqwrZiLacV8Uy3jNn7QGDUcBO
+#si-secret-key: SK3Oip3a2R3NLz2xm58Mpmi69oFu96KrdKNRKglN
+#web-his-url: http://172.16.32.160:8077
+#thmz-url: http://172.16.32.160:81/thmz
 
 #测试环境
-#si-api-url: http://10.93.28.242:80/isp-api/powercsb/
-#si-access-key: ohksRseHwPk9JAVGAQ5lghF5euo6NQZjiv8O2V
-#si-secret-key: SKQgruu508MeFbQmLZs4Oyj5Qk0GjLstGVtWJB3Y
-#web-his-url: http://localhost:8706
-#thmz-url: http://demo.hnthyy.cn:8089/thmz
+si-api-url: http://10.93.28.242:80/isp-api/powercsb/
+si-access-key: ohksRseHwPk9JAVGAQ5lghF5euo6NQZjiv8O2V
+si-secret-key: SKQgruu508MeFbQmLZs4Oyj5Qk0GjLstGVtWJB3Y
+web-his-url: http://172.16.30.26:8706
+thmz-url: http://demo.hnthyy.cn:8089/thmz

BIN
src/main/resources/lib/med-request-data-sdk-2.1.4.jar