Browse Source

支付结果回调支付

yeguodong 3 months ago
parent
commit
b3bb8ecab2

+ 10 - 0
src/main/java/cn/hnthyy/thmz/common/Constants.java

@@ -619,4 +619,14 @@ public class Constants {
     public static final String REFUND_FAILED = "REFUND_FAILED";
     //退款异常
     public static final String REFUND_ABNORMAL = "REFUND_ABNORMAL";
+
+    // -----------药房groupNo------------
+    public static final String YF_GROUP_JZXYF = "81";
+    public static final String YF_GROUP_YPKF = "11";
+    public static final String YF_GROUP_MZXYF = "71";
+    public static final String YF_GROUP_BQYF = "73";
+    public static final String YF_GROUP_JZZCYYF = "82";
+    public static final String YF_GROUP_MZZCYF = "83";
+    public static final String YF_GROUP_JZKLJYF = "84";
+    public static final String YF_GROUP_MZKLJYF = "85";
 }

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -6082,9 +6082,9 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 if (StringUtils.isBlank(m.getPsordnum())) {
                     throw new MzException("银联刷卡或者聚合支付流水号为空");
                 }
-                if (StringUtils.isBlank(m.getParChannel())) {
+                /*if (StringUtils.isBlank(m.getParChannel())) {
                     throw new MzException("银联刷卡或者聚合支付回传支付渠道为空");
-                }
+                }*/
                 if (Constants.JHZF.equals(m.getChequeType()) && StringUtils.isBlank(m.getAgtordnum())) {
                     throw new MzException("银联刷卡或者聚合支付条形码流水号为空");
                 }

+ 10 - 5
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfInventoryListServiceImpl.java

@@ -47,14 +47,19 @@ public class YfInventoryListServiceImpl implements YfInventoryListService {
     @Override
     public List<YpZdBaseVo> queryYpZdBaseYfMultiplePage(String classCode, String searchText, PageBean pageBean) {
         // 门诊西药房
-        String mzXyf = getGroupNo(Constants.XY_ZCY_GROUP_NO);
+        String mzXyf = getGroupNo(Constants.YF_GROUP_MZXYF);
         // 住院西药房
-        String zyXyf = getGroupNo(Constants.ZZY_GROUP_NO);
-        // 门诊医材药房
-        String ycYf = getGroupNo(Constants.YC_GROUP_NO);
+        String zyXyf = getGroupNo(Constants.YF_GROUP_BQYF);
+        String jzXyf = getGroupNo(Constants.YF_GROUP_JZXYF);
+        String ypkf = getGroupNo(Constants.YF_GROUP_YPKF);
+        String jzzcyyf = getGroupNo(Constants.YF_GROUP_JZZCYYF);
+        String mzzcyf = getGroupNo(Constants.YF_GROUP_MZZCYF);
+        String jzkljyf = getGroupNo(Constants.YF_GROUP_JZKLJYF);
+        String mzkljyf = getGroupNo(Constants.YF_GROUP_MZKLJYF);
+
         // 获取可用的西药库
         YpZdGroupNameVo vo = ypZdGroupNameService.getYkGroupNo(Constants.XYK_GROUP_NO);
-        return yfInventoryListMapper.selectYpZdBaseYfMultiplePage(classCode,searchText,pageBean, mzXyf, zyXyf, ycYf, vo.getGroupNo());
+        return yfInventoryListMapper.selectYpZdBaseYfMultiplePage(classCode,searchText,pageBean, mzXyf, zyXyf, jzXyf, vo.getGroupNo());
     }
 
     @Override

+ 9 - 4
src/main/java/cn/hnthyy/thmz/service/pay/NongPayService.java

@@ -76,7 +76,7 @@ public class NongPayService {
 //        body.put("amount", payAmount);
         body.put("subject", body.get("subject"));
         body.put("body", body.get("body"));
-        String notifyUrl = "http://218.93.214.118:6080/NongPay/notify"
+        String notifyUrl = "https://huaihai-tech.com/mzHisPay/thmz/NongPay/notifyCodeImg"
                 .trim()
                 .replaceAll("\\s+", "");
         body.put("notifyUrl", notifyUrl);
@@ -131,15 +131,20 @@ public class NongPayService {
         log.info("body={}", JSONObject.toJSONString(body));
         String payOrderId = (String) body.get("payOrderId");
         String mchOrderNo = (String) body.get("mchOrderNo");
+        String channelOrderNo = (String) body.get("channelOrderNo");
+        String successTime = (String) body.get("successTime");
         String extParam = (String) body.get("extParam");
-        int state = (Integer) body.get("state");
-        if(state == 2) {
+        String state = (String) body.get("state");
+        if("2".equals(state)) {
             JSONObject extraParam = JSONObject.parseObject(extParam);
             List<MzDepositFile> mzDepositFiles = new ArrayList<>();
             MzDepositFile mzDepositFile = new MzDepositFile();
             mzDepositFile.setChequeType("O");
-            mzDepositFile.setAmount(extraParam.getBigDecimal("amount"));
+            mzDepositFile.setPsordnum(payOrderId);
+            mzDepositFile.setAgtordnum(channelOrderNo);
+            mzDepositFile.setAmount(new BigDecimal(extraParam.getString("amount")));
             mzDepositFile.setTraceNo(mchOrderNo);
+            mzDepositFile.setTransDate(successTime);
             mzDepositFiles.add(mzDepositFile);
             MzDepositFileVo mzDepositFileVo = new MzDepositFileVo();
             mzDepositFileVo.setPatientId(extraParam.getString("patientId"));