ソースを参照

Merge remote-tracking branch 'origin/Payment-Configuration' into Payment-Configuration

yfh 1 日 前
コミット
53f64402a9

+ 2 - 2
fs-admin/src/main/java/com/fs/his/controller/MerchantAppConfigController.java

@@ -100,8 +100,8 @@ public class MerchantAppConfigController extends BaseController
     @PreAuthorize("@ss.hasPermi('his:merchantAppConfig:remove')")
     @Log(title = "商户应用配置", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
+    public AjaxResult remove(@PathVariable Long ids)
     {
-        return toAjax(merchantAppConfigService.deleteMerchantAppConfigByIds(ids));
+        return toAjax(merchantAppConfigService.deleteMerchantAppConfigById(ids));
     }
 }

+ 29 - 1
fs-service/src/main/java/com/fs/his/service/impl/MerchantAppConfigServiceImpl.java

@@ -120,12 +120,15 @@ public class MerchantAppConfigServiceImpl extends ServiceImpl<MerchantAppConfigM
                 break;
             case "tz": // 台州
                 merchantAppConfig.setMerchantId(fsPayConfig.getTzPlatMerCstNo());
+                merchantAppConfig.setCallbackUrl(fsPayConfig.getTzPayDecrypt());
                 break;
             case "wx": // 微信
                 merchantAppConfig.setMerchantId(fsPayConfig.getWxMchId());
+                merchantAppConfig.setCallbackUrl(fsPayConfig.getNotifyUrlScrm());
                 break;
             case "hf": // 汇付
                 merchantAppConfig.setMerchantId(fsPayConfig.getHuifuId());
+                merchantAppConfig.setCallbackUrl(fsPayConfig.getHfPayNotifyUrl());
                 break;
             default:
                 throw new RuntimeException("商户类型错误");
@@ -143,6 +146,28 @@ public class MerchantAppConfigServiceImpl extends ServiceImpl<MerchantAppConfigM
     @Override
     public int updateMerchantAppConfig(MerchantAppConfig merchantAppConfig)
     {
+        FsPayConfig fsPayConfig = JSON.parseObject(merchantAppConfig.getDataJson(), FsPayConfig.class);
+        switch (merchantAppConfig.getMerchantType()){
+            case "yb": // 易宝
+                merchantAppConfig.setMerchantId(fsPayConfig.getYbAccount());
+                merchantAppConfig.setCallbackUrl(fsPayConfig.getYbNotifyUrl());
+
+                break;
+            case "tz": // 台州
+                merchantAppConfig.setMerchantId(fsPayConfig.getTzPlatMerCstNo());
+                merchantAppConfig.setCallbackUrl(fsPayConfig.getTzPayDecrypt());
+                break;
+            case "wx": // 微信
+                merchantAppConfig.setMerchantId(fsPayConfig.getWxMchId());
+                merchantAppConfig.setCallbackUrl(fsPayConfig.getNotifyUrlScrm());
+                break;
+            case "hf": // 汇付
+                merchantAppConfig.setMerchantId(fsPayConfig.getHuifuId());
+                merchantAppConfig.setCallbackUrl(fsPayConfig.getHfPayNotifyUrl());
+                break;
+            default:
+                throw new RuntimeException("商户类型错误");
+        }
         return baseMapper.updateMerchantAppConfig(merchantAppConfig);
     }
 
@@ -167,6 +192,9 @@ public class MerchantAppConfigServiceImpl extends ServiceImpl<MerchantAppConfigM
     @Override
     public int deleteMerchantAppConfigById(Long id)
     {
-        return baseMapper.deleteMerchantAppConfigById(id);
+        MerchantAppConfig merchantAppConfig = new MerchantAppConfig();
+        merchantAppConfig.setId( id);
+        merchantAppConfig.setIsDeleted(1L);
+        return baseMapper.updateMerchantAppConfig(merchantAppConfig);
     }
 }