| @@ -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){ | |||
| @@ -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") | |||
| @@ -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; | |||
| @@ -9,7 +9,8 @@ public enum EnumPayVersion { | |||
| WX_PAY_V3(2, "微信支付3.0,对接电商收付通"), | |||
| DY_PAY_V2(3,"抖音支付2.0,对接商品库"), | |||
| NEU_POS_V1(4,"东软POS支付1.0版本"), | |||
| NO_VERSION(5,"无需支付,无版本") | |||
| NO_VERSION(5,"无需支付,无版本"), | |||
| ALI_PAY_V1(6,"支付宝支付1.0") | |||
| ; | |||
| public static EnumPayVersion getEnum(Integer code) { | |||
| @@ -102,23 +102,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); | |||
| } | |||
| @@ -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(); | |||
| } | |||
| @@ -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); | |||
| } | |||
| @@ -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()); | |||
| } | |||
| } | |||
| @@ -17,7 +17,6 @@ | |||
| <result column="pay_id" jdbcType="BIGINT" property="payId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="mould_type" jdbcType="INTEGER" property="mouldType"/> | |||
| <result column="pay_bill_id" jdbcType="BIGINT" property="payBillId"/> | |||
| <result column="enable" jdbcType="INTEGER" property="enable"/> | |||
| <result column="plat" jdbcType="INTEGER" property="plat"/> | |||
| <result column="sort_url" jdbcType="VARCHAR" property="sortUrl"/> | |||
| @@ -31,7 +30,7 @@ | |||
| <sql id="allColumns"> | |||
| `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` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -90,9 +89,6 @@ | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != payBillId "> | |||
| and `pay_bill_id` = #{payBillId} | |||
| </if> | |||
| <if test=" null != plat "> | |||
| and `plat` = #{plat} | |||
| </if> | |||
| @@ -5,15 +5,6 @@ | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="parent_tenant_id" jdbcType="VARCHAR" property="parentTenantId" /> | |||
| <result column="mch_id" jdbcType="VARCHAR" property="mchId"/> | |||
| <result column="sub_mch_id" jdbcType="VARCHAR" property="subMchId"/> | |||
| <result column="api_key" jdbcType="VARCHAR" property="apiKey"/> | |||
| <result column="notify_url" jdbcType="VARCHAR" property="notifyUrl"/> | |||
| <result column="cert_path" jdbcType="VARCHAR" property="certPath"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="share" jdbcType="INTEGER" property="share"/> | |||
| <result column="rate" jdbcType="INTEGER" property="rate"/> | |||
| <result column="real_rate" jdbcType="INTEGER" property="realRate"/> | |||
| <result column="bank_account_name" jdbcType="VARCHAR" property="bankAccountName"/> | |||
| <result column="bank_card_id" jdbcType="VARCHAR" property="bankCardId"/> | |||
| <result column="social_credit_code" jdbcType="VARCHAR" property="socialCreditCode"/> | |||
| @@ -22,8 +13,7 @@ | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `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` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| @@ -39,38 +29,6 @@ | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != mchId "> | |||
| and `mch_id` = #{mchId} | |||
| </if> | |||
| <if test=" null != subMchId "> | |||
| and `sub_mch_id` = #{subMchId} | |||
| </if> | |||
| <if test=" null != apiKey "> | |||
| and `api_key` like concat('%', #{apiKey},'%') | |||
| </if> | |||
| <if test=" null != notifyUrl "> | |||
| and `notify_url` like concat('%', #{notifyUrl},'%') | |||
| </if> | |||
| <if test=" null != certPath "> | |||
| and `cert_path` like concat('%', #{certPath},'%') | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != share "> | |||
| and `share` = #{share} | |||
| </if> | |||
| <if test=" null != rate "> | |||
| and `rate` = #{rate} | |||
| </if> | |||
| <if test=" null != realRate "> | |||
| and `real_rate` = #{realRate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||