瀏覽代碼

医保移动支付接口

lighter 10 月之前
父節點
當前提交
14b80625d1

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

@@ -1,12 +1,8 @@
 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;
 
@@ -20,36 +16,6 @@ public class MobilePayApiController {
         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);

+ 24 - 68
src/main/java/thyyxxk/simzfeeoprnsystm/dao/MobilePayDao.java

@@ -2,62 +2,28 @@ 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, " +
+    @Select("select " +
+            "medOrgOrd=rtrim(patient_id)+'_'+cast(times as varchar)+'_1', " +
+            "begntime=convert(varchar(19), visit_date, 21), " +
+            "iptOtpNo=rtrim(patient_id), " +
+            "atddrNo=rtrim(doctor_code), " +
+            "drName=(select rtrim(d.name) from a_employee_mi d where d.code=doctor_code), " +
+            "deptId=rtrim(visit_dept_code), " +
+            "deptName=(select rtrim(d.name) from zd_unit_code d where d.code=visit_dept_code), " +
+            "caty=(select rtrim(d.si_caty) from zd_unit_code d where d.code=visit_dept_code), " +
             "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), " +
+            "medfeeSumamt=(select cast(sum(d.charge_fee) as decimal(16,2)) from t_mt_receipt d where d.patient_id=#{patNo} and d.times=#{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")
+            "chrgBchno=rtrim(patient_id)+'_'+cast(times as varchar) " +
+            "from mz_visit_table " +
+            "where patient_id=#{patNo} and times=#{times}")
     Upload6201 selectUpload6201(@Param("patNo") String patNo, @Param("times") int times);
 
     @Select("select diag_type,diag_srt_no,diag_code,diag_name," +
@@ -69,22 +35,20 @@ public interface MobilePayDao extends BaseMapper<MobilePay> {
     @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, " +
+            "chrgBchno=a.patient_id+'_'+cast(a.times as varchar), " +
             "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', " +
+            "medListCodg=case when a.medi_item_type=0 then " +
+            "(select max(national_code) from zd_charge_item where code=his_item_code) else " +
+            "(select max(national_code) from yp_zd_dict where code=his_item_code) end, " +
+            "his_item_code as medinsListCodg,charge_fee as detItemFeeSumamt, " +
+            "quantity as cnt, price as pric,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 " +
+            "input_man as bilgDrName,medListName=a.his_item_name, " +
+            "bilgDeptCodg=rtrim(b.visit_dept_code), " +
+            "bilgDeptName=(select rtrim(d.name) from zd_unit_code d where d.code=b.visit_dept_code) " +
+            "from t_mt_receipt a, mz_visit_table b " +
             "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")
+            "and b.patient_id=a.patient_id and b.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," +
@@ -92,12 +56,4 @@ public interface MobilePayDao extends BaseMapper<MobilePay> {
             "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);
 }

+ 5 - 0
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/Feedetail.java

@@ -7,6 +7,11 @@ import java.util.Date;
 
 @Data
 public class Feedetail {
+    /**
+     * 医疗目录名称
+     * */
+    private String medListName;
+
     /**
      * 费用明细流水号
      */

+ 2 - 3
src/main/java/thyyxxk/simzfeeoprnsystm/pojo/mobilepay/Upload6201.java

@@ -3,7 +3,6 @@ package thyyxxk.simzfeeoprnsystm.pojo.mobilepay;
 import lombok.Data;
 
 import java.math.BigDecimal;
-import java.util.Date;
 import java.util.List;
 
 @Data
@@ -50,7 +49,7 @@ public class Upload6201 {
     /**
      * 开始时间
      */
-    private Date begntime;
+    private String begntime;
 
     /**
      * 证件号码
@@ -95,7 +94,7 @@ public class Upload6201 {
     /**
      * 科室编码
      */
-    private String deptCode;
+    private String deptId;
 
     /**
      * 科室名称

+ 2 - 240
src/main/java/thyyxxk/simzfeeoprnsystm/service/MobilePayService.java

@@ -1,46 +1,27 @@
 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 {
+    public MobilePayService(MobilePayDao dao, SiMzFeeService mzService) throws IOException {
         this.dao = dao;
-        this.exec = exec;
         this.mzService = mzService;
-        dataHandler.setSkipVerify(true);
     }
 
     public String writeMtReceipt(String hisOrdNum) {
@@ -54,113 +35,12 @@ public class MobilePayService {
         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());
+        upload6201.setMedType("11");
         List<Diseinfo> diseinfoList = dao.selectMpDiseinfos(request.getPatNo(), request.getTimes());
         if (diseinfoList.isEmpty()) {
             VisitTableIcd icd = dao.selectMzVisitIcd(request.getPatNo(), request.getTimes());
@@ -187,122 +67,4 @@ public class MobilePayService {
         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"));
-    }
 }

+ 1 - 1
src/main/resources/application.yml

@@ -17,7 +17,7 @@ spring:
       strict: false
       datasource:
         his:
-          url: "jdbc:sqlserver://172.16.32.168:1433;databaseName=thxyhisdb"
+          url: "jdbc:sqlserver://172.16.32.179:1433;databaseName=thxyhisdb"
           username: "sa"
           password:
           type: "com.zaxxer.hikari.HikariDataSource"