diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java index 8a08b5943..fbcccfbbb 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/basic/WxProjectConfigController.java @@ -293,10 +293,9 @@ public class WxProjectConfigController extends BaseController { WxPayAccount wxPayAccount = wxPayAccountService.getById(appinfo.getPayId()); map.put("wxPayAccount",wxPayAccount); } - if(appinfo.getPayBillId() != null){ - WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getById(appinfo.getPayBillId()); - map.put("wxPayAccountBill",wxPayAccountBill); - } + + WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantInfo(this.getTenantInfo()); + map.put("wxPayAccountBill",wxPayAccountBill); return new ResultData(map); }catch (Exception e){ diff --git a/mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql b/mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql index 1fcae5a1b..c500a918d 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V2022080800001_pay_v3.sql @@ -2023,4 +2023,17 @@ UPDATE wx_batch_order_97 SET pay_version=5 WHERE pay_vendor IN (13,90,91,92, UPDATE wx_batch_order_98 SET pay_version=5 WHERE pay_vendor IN (13,90,91,92,93,94,95,55,96,97,98,99,100); UPDATE wx_batch_order_99 SET pay_version=5 WHERE pay_vendor IN (13,90,91,92,93,94,95,55,96,97,98,99,100); +alter table wx_pay_account_bill drop column mch_id; +alter table wx_pay_account_bill drop column sub_mch_id; +alter table wx_pay_account_bill drop column api_key; +alter table wx_pay_account_bill drop column notify_url; +alter table wx_pay_account_bill drop column cert_path; +alter table wx_pay_account_bill drop column type; +alter table wx_pay_account_bill drop column share; +alter table wx_pay_account_bill drop column rate; +alter table wx_pay_account_bill drop column real_rate; + +alter table wx_appinfo drop column pay_bill_id; + + redis清除token diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxAppinfo.java b/mallinkService/src/main/java/com/iformall/domain/po/WxAppinfo.java index 09d657684..2eeea5809 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxAppinfo.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxAppinfo.java @@ -40,8 +40,6 @@ public class WxAppinfo extends BaseTenantEntity { private Integer type; @io.swagger.annotations.ApiModelProperty(value="模板类型",name="mouldType") private Integer mouldType; - @io.swagger.annotations.ApiModelProperty(value="支付ID,参看wx_pay_account_bill",name="payBillId") - private Long payBillId; @io.swagger.annotations.ApiModelProperty(value="是否启用(0:启用,1禁用)",name="enable") private Integer enable; @io.swagger.annotations.ApiModelProperty(value="app平台 EnumAppPlat ",name="plat") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java b/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java index 4b31320aa..0bb06ca89 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxPayAccountBill.java @@ -15,26 +15,6 @@ import lombok.EqualsAndHashCode; public class WxPayAccountBill extends TenantEntity { protected Long id; - - @io.swagger.annotations.ApiModelProperty(value="微信商户号/特约服务商号",name="mchId") - private String mchId; - @io.swagger.annotations.ApiModelProperty(value="微信服务商号",name="subMchId") - private String subMchId; - @io.swagger.annotations.ApiModelProperty(value="支付密钥",name="apiKey") - private String apiKey; - @io.swagger.annotations.ApiModelProperty(value="微信回调,支持3种回调,(1.url/pay 2.url/refund3.url/separate)",name="notifyUrl") - private String notifyUrl; - @io.swagger.annotations.ApiModelProperty(value="证书本地存放位置",name="certPath") - private String certPath; - @io.swagger.annotations.ApiModelProperty(value="商户模式-0:普通商户模式1:服务商模式",name="type") - private Integer type; - @io.swagger.annotations.ApiModelProperty(value="是否开启分账(0:未开启分账1:开启分账)",name="type") - private Boolean share; - @io.swagger.annotations.ApiModelProperty(value="手续费(万分之几,默认60)",name="rate") - private Integer rate; - @io.swagger.annotations.ApiModelProperty(value="实际手续费(万分之几,默认60)",name="realRate") - private Integer realRate; - @io.swagger.annotations.ApiModelProperty(value="接收账户名",name="bankAccountName") private String bankAccountName; @io.swagger.annotations.ApiModelProperty(value="接收银行卡号",name="bankCardId") @@ -44,13 +24,6 @@ public class WxPayAccountBill extends TenantEntity { // 甲方开户银行 private String bankName; - public String getPayNotifyUrl() { - return notifyUrl + "/pay"; - } - public String getRefundNotifyUrl() { - return notifyUrl + "/refund"; - } - @io.swagger.annotations.ApiModelProperty(value="手续费费率",name="serviceChargeRate") private Integer serviceChargeRate; diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java index 3823f0930..66abbb03f 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxAppinfoServiceImpl.java @@ -87,23 +87,21 @@ public class WxAppinfoServiceImpl implements WxAppinfoService { public void wxAppinfoInit(String tenantId, Long payId, Long payBillId, WxProjectConfig wxProjectConfig) { WxAppinfo wxAppinfo = new WxAppinfo(); wxAppinfo.setTenantId(tenantId); - wxAppinfo.setType(1); + wxAppinfo.setType(EnumAppType.B.getCode()); wxAppinfo.setAppId(wxProjectConfig.getAppIdB()); wxAppinfo.setParentAppId(wxProjectConfig.getParentAppId()); wxAppinfo.setName(wxProjectConfig.getAppNameB()); wxAppinfo.setSecret(wxProjectConfig.getAppSecretB()); wxAppinfo.setPayId(payId); - wxAppinfo.setPayBillId(payBillId); wxAppinfoMapper.insert(wxAppinfo); wxAppinfo = new WxAppinfo(); wxAppinfo.setTenantId(tenantId); - wxAppinfo.setType(2); + wxAppinfo.setType(EnumAppType.C.getCode()); wxAppinfo.setAppId(wxProjectConfig.getAppIdC()); wxAppinfo.setParentAppId(wxProjectConfig.getParentAppId()); wxAppinfo.setName(wxProjectConfig.getAppNameC()); wxAppinfo.setSecret(wxProjectConfig.getAppSecretC()); wxAppinfo.setPayId(payId); - wxAppinfo.setPayBillId(payBillId); wxAppinfoMapper.insert(wxAppinfo); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java index 575998dd6..13d7f2eac 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPayAccountBillServiceImpl.java @@ -32,16 +32,8 @@ public class WxPayAccountBillServiceImpl implements WxPayAccountBillService { @Override public Long wxPayAccountInit(WxPayAccount wxPayAccount) { WxPayAccountBill wxPayAccountBill = new WxPayAccountBill(); + wxPayAccountBill.setParentTenantId(wxPayAccount.getParentTenantId()); wxPayAccountBill.setTenantId(wxPayAccount.getTenantId()); - wxPayAccountBill.setMchId(wxPayAccount.getMchId()); - wxPayAccountBill.setSubMchId(wxPayAccount.getSubMchId()); - wxPayAccountBill.setApiKey(wxPayAccount.getApiKey()); - wxPayAccountBill.setNotifyUrl(wxPayAccount.getNotifyUrl()); - wxPayAccountBill.setCertPath(wxPayAccount.getCertPath()); - wxPayAccountBill.setType(wxPayAccount.getType()); - wxPayAccountBill.setShare(!(wxPayAccount.getShare() == 0)); - wxPayAccountBill.setRate(wxPayAccount.getRate()); - wxPayAccountBill.setRealRate(wxPayAccount.getRealRate()); wxPayAccountBillMapper.insert(wxPayAccountBill); return wxPayAccountBill.getId(); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java index a5303be6a..4d3e55546 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxPayBillServiceImpl.java @@ -11,6 +11,7 @@ import com.iformall.domain.po.WxAppinfo; import com.iformall.domain.po.WxBillSettle; import com.iformall.domain.po.WxMerchant; import com.iformall.domain.po.WxMerchantBUser; +import com.iformall.domain.po.WxPayAccount; import com.iformall.domain.po.WxPayAccountBill; import com.iformall.domain.po.WxPayBill; import com.iformall.domain.vo.WxBillAll; @@ -48,6 +49,9 @@ public class WxPayBillServiceImpl implements WxPayBillService { @Autowired WxPayAccountBillMapper wxPayAccountBillMapper; + + @Autowired + WxPayAccountMapper wxPayAccountMapper; @Autowired WxPayBillMapper wxPayBillMapper; @@ -128,7 +132,7 @@ public class WxPayBillServiceImpl implements WxPayBillService { return new ResultData(ErrorCode.BILL_OWE_ZERO); } //获取支付账户信息 - WxPayAccountBill payAccount = wxPayAccountBillMapper.selectById(appInfo.getPayBillId()); + WxPayAccount payAccount = wxPayAccountMapper.selectById(appInfo.getPayId()); Date currentDate = new Date(); String payBillNo; WxPayBill billParam= new WxPayBill(); @@ -358,7 +362,7 @@ public class WxPayBillServiceImpl implements WxPayBillService { private String wechatPayBillQuery(WxAppinfo appInfo, WxPayBill record) { // get payAccount - WxPayAccountBill payAccount = wxPayAccountBillMapper.selectById(appInfo.getPayBillId()); + WxPayAccount payAccount = wxPayAccountMapper.selectById(appInfo.getPayId()); if (payAccount.getType().equals(EnumPayMode.MCH.getCode())) { // 普通商户号模式 WxPayOrderQ payBillQ = new WxPayOrderQ(); @@ -455,7 +459,7 @@ public class WxPayBillServiceImpl implements WxPayBillService { private String wechatPayBillClose(WxAppinfo appInfo, WxPayBill record) { // get payAccount - WxPayAccountBill payAccount = wxPayAccountBillMapper.selectById(appInfo.getPayBillId()); + WxPayAccount payAccount = wxPayAccountMapper.selectById(appInfo.getPayId()); if (payAccount.getType().equals(EnumPayMode.MCH.getCode())) { // 普通商户号模式 WxPayOrderQ payBillC = new WxPayOrderQ(); @@ -480,7 +484,7 @@ public class WxPayBillServiceImpl implements WxPayBillService { } } - private String closeOrderServer(WxPayAccountBill payAccount, WxPayOrderSQ payBillSC) { + private String closeOrderServer(WxPayAccount payAccount, WxPayOrderSQ payBillSC) { try { Map map = BeanUtils.toStringMap(payBillSC); payBillSC.setSign(WxPayment.createSignHMAC(map, payAccount.getApiKey())); @@ -494,7 +498,7 @@ public class WxPayBillServiceImpl implements WxPayBillService { } } - private String closeOrderNormal(WxPayAccountBill payAccount, WxPayOrderQ payBillC) { + private String closeOrderNormal(WxPayAccount payAccount, WxPayOrderQ payBillC) { try { Map map = BeanUtils.toStringMap(payBillC); payBillC.setSign(WxPayment.createSign(map, payAccount.getApiKey())); @@ -599,7 +603,7 @@ public class WxPayBillServiceImpl implements WxPayBillService { isNormal = false; } - WxPayAccountBill payAccount = wxPayAccountBillMapper.selectById(appinfo.getPayBillId()); + WxPayAccount payAccount = wxPayAccountMapper.selectById(appinfo.getPayId()); if (payAccount == null) { throw new MallinkException(ErrorCode.MCH_INFO_NOT_FOUND); } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java index 150d673b6..72d67f167 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxProjectConfigServiceImpl.java @@ -201,20 +201,8 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { wxPayAccountService.saveOrUpdate(wxPayAccount); WxPayAccountBill wxPayAccountBill = new WxPayAccountBill(); - if(appinfo.getPayBillId() != null){ - wxPayAccountBill.setId(appinfo.getPayBillId()); - } wxPayAccountBill.updateTenantInfo(wxPayAccount); wxPayAccountBill.setServiceChargeRate(0); - wxPayAccountBill.setMchId(wxPayAccount.getMchId()); - wxPayAccountBill.setSubMchId(wxPayAccount.getSubMchId()); - wxPayAccountBill.setApiKey(wxPayAccount.getApiKey()); - wxPayAccountBill.setNotifyUrl(wxPayAccount.getNotifyUrl().replaceAll("/wxPay/","/wxPayBill/")); - wxPayAccountBill.setCertPath(wxPayAccount.getCertPath()); - wxPayAccountBill.setType(wxPayAccount.getType()); - wxPayAccountBill.setShare(!(wxPayAccount.getShare() == 0)); - wxPayAccountBill.setRate(wxPayAccount.getRate()); - wxPayAccountBill.setRealRate(wxPayAccount.getRealRate()); wxPayAccountBillService.saveOrUpdate(wxPayAccountBill); if(appinfo.getPayId() == null){ @@ -222,7 +210,6 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { updApp.updateTenantInfo(appinfo); updApp.setId(appinfo.getId()); updApp.setPayId(wxPayAccount.getId()); - updApp.setPayBillId(wxPayAccountBill.getId()); } } diff --git a/mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml b/mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml index 91b8845ab..1cd3622fe 100644 --- a/mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml @@ -17,7 +17,6 @@ - @@ -31,7 +30,7 @@ `id`,`tenant_id`,`app_id`,`parent_app_id`,`name`, `secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in`, - `pay_id`,`type`,`mould_type`,`pay_bill_id`,`enable`,`plat`,`sort_url`,`business_license`,`icp` + `pay_id`,`type`,`mould_type`,`enable`,`plat`,`sort_url`,`business_license`,`icp` @@ -90,9 +89,6 @@ and `type` = #{type} - - and `pay_bill_id` = #{payBillId} - and `plat` = #{plat} diff --git a/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml b/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml index b22286de6..d16076bd4 100644 --- a/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxPayAccountBillMapper.xml @@ -5,15 +5,6 @@ - - - - - - - - - @@ -22,8 +13,7 @@ - `id`,`tenant_id`,`parent_tenant_id`,`mch_id`,`sub_mch_id`,`api_key`,`notify_url`,`cert_path`, - `type`,`share`,`rate`,`real_rate`,`service_charge_rate` + `id`,`tenant_id`,`parent_tenant_id`,`bank_account_name`,`bank_card_id`,`social_credit_code`,`bank_name`,`service_charge_rate` @@ -39,38 +29,6 @@ and `parent_tenant_id` = #{parentTenantId} - - - and `mch_id` = #{mchId} - - - - and `sub_mch_id` = #{subMchId} - - - - and `api_key` like concat('%', #{apiKey},'%') - - - - and `notify_url` like concat('%', #{notifyUrl},'%') - - - - and `cert_path` like concat('%', #{certPath},'%') - - - and `type` = #{type} - - - and `share` = #{share} - - - and `rate` = #{rate} - - - and `real_rate` = #{realRate} - and id in