| @@ -230,23 +230,24 @@ public class WxProjectConfigController extends BaseController { | |||
| } | |||
| } | |||
| @ApiOperation("添加修改特殊商户号信息") | |||
| @ApiOperation("添加修改商户号信息") | |||
| @PostMapping("/init/payAccount") | |||
| @SystemControllerLog(description = "特殊商户号-更新") | |||
| @SystemControllerLog(description = "商户号-更新") | |||
| @TenantIgnore | |||
| public ResultData initPayAccount(@RequestBody WxPayAccount wxPayAccount) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPayAccount"); | |||
| try { | |||
| if(StringUtils.isBlank(wxPayAccount.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxPayAccount getByTenantId = wxPayAccountService.getByTenantId(wxPayAccount.getTenantId()); | |||
| if(wxPayAccount.getId() != null && (getByTenantId == null || !getByTenantId.getId().equals(wxPayAccount.getId()))){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| if(wxPayAccount.getAppInfoId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"小程序Id必传"); | |||
| } | |||
| if(wxPayAccount.getId() == null && getByTenantId != null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| // if(StringUtils.isBlank(wxPayAccount.getTenantId())){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId 必传"); | |||
| // } | |||
| WxAppinfo appinfo = wxAppinfoService.getById(wxPayAccount.getAppInfoId()); | |||
| if(appinfo == null || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"小程序未找到或不是C端小程序"); | |||
| } | |||
| wxPayAccount.updateTenantInfo(appinfo); | |||
| if(StringUtils.isBlank(wxPayAccount.getNotifyUrl())){ | |||
| wxPayAccount.setNotifyUrl(wechatWebProperties.getUrl()+"/wxPay/notify"); | |||
| @@ -261,7 +262,7 @@ public class WxProjectConfigController extends BaseController { | |||
| wxPayAccount.setShare(0);//0: 未分账,1:分账(默认不分账) | |||
| } | |||
| wxProjectConfigService.initPayAccount(wxPayAccount); | |||
| wxProjectConfigService.initPayAccount(appinfo,wxPayAccount); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| @@ -270,6 +271,40 @@ public class WxProjectConfigController extends BaseController { | |||
| } | |||
| } | |||
| @ApiOperation("查询商户号信息") | |||
| @GetMapping("/getinit/payAccount") | |||
| @SystemControllerLog(description = "商户号-查询") | |||
| @TenantIgnore | |||
| public ResultData getinitPayAccount(Long appInfoId) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPayAccount"); | |||
| try { | |||
| if(appInfoId == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"小程序Id必传"); | |||
| } | |||
| // if(StringUtils.isBlank(wxPayAccount.getTenantId())){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId 必传"); | |||
| // } | |||
| WxAppinfo appinfo = wxAppinfoService.getById(appInfoId); | |||
| if(appinfo == null || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"小程序未找到或不是C端小程序"); | |||
| } | |||
| Map<String, Object> map = new HashMap<String, Object>(); | |||
| if(appinfo.getPayId() != null) { | |||
| WxPayAccount wxPayAccount = wxPayAccountService.getById(appinfo.getPayId()); | |||
| map.put("wxPayAccount",wxPayAccount); | |||
| } | |||
| if(appinfo.getPayBillId() != null){ | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getById(appinfo.getPayBillId()); | |||
| map.put("wxPayAccountBill",wxPayAccountBill); | |||
| } | |||
| return new ResultData(map); | |||
| }catch (Exception e){ | |||
| logger.error(e.getMessage(),e); | |||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR); | |||
| } | |||
| } | |||
| @ApiOperation("添加修改小程序信息") | |||
| @PostMapping("/init/appinfo") | |||
| @SystemControllerLog(description = "小程序信息-更新") | |||
| @@ -280,16 +315,16 @@ public class WxProjectConfigController extends BaseController { | |||
| if(StringUtils.isBlank(wxAppinfo.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(wxAppinfo.getId() == null){ | |||
| WxPayAccount byTenantId = wxPayAccountService.getByTenantId(wxAppinfo.getTenantId()); | |||
| if(byTenantId != null){ | |||
| wxAppinfo.setPayId(byTenantId.getId()); | |||
| } | |||
| WxPayAccountBill billByTenantId = wxPayAccountBillService.getByTenantId(wxAppinfo.getTenantId()); | |||
| if(billByTenantId != null){ | |||
| wxAppinfo.setPayBillId(billByTenantId.getId()); | |||
| } | |||
| } | |||
| // if(wxAppinfo.getId() == null){ | |||
| // WxPayAccount byTenantId = wxPayAccountService.getByTenantId(wxAppinfo.getTenantId()); | |||
| // if(byTenantId != null){ | |||
| // wxAppinfo.setPayId(byTenantId.getId()); | |||
| // } | |||
| // WxPayAccountBill billByTenantId = wxPayAccountBillService.getByTenantId(wxAppinfo.getTenantId()); | |||
| // if(billByTenantId != null){ | |||
| // wxAppinfo.setPayBillId(billByTenantId.getId()); | |||
| // } | |||
| // } | |||
| wxAppinfoService.saveOrUpdate(wxAppinfo); | |||
| @@ -629,10 +664,10 @@ public class WxProjectConfigController extends BaseController { | |||
| ResultData wxMallBuildingFloorList = wxMallBuildingService.getBuildingFloorList(tenantEntity); | |||
| map.put("wxMallBuildingFloorList",wxMallBuildingFloorList.data); | |||
| WxPayAccount wxPayAccount = wxPayAccountService.getByTenantId(wxMall.getTenantId()); | |||
| map.put("wxPayAccount",wxPayAccount); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxMall.getTenantId()); | |||
| map.put("wxPayAccountBill",wxPayAccountBill); | |||
| // WxPayAccount wxPayAccount = wxPayAccountService.getByTenantId(wxMall.getTenantId()); | |||
| // map.put("wxPayAccount",wxPayAccount); | |||
| // WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxMall.getTenantId()); | |||
| // map.put("wxPayAccountBill",wxPayAccountBill); | |||
| WxAppinfo wxAppinfo = new WxAppinfo(); | |||
| wxAppinfo.setTenantId(wxMall.getTenantId()); | |||
| @@ -1,6 +1,7 @@ | |||
| package com.iformall.domain.po; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.baomidou.mybatisplus.annotation.TableField; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.douyin.pay.orderQuery.QueryMerchantResult; | |||
| @@ -97,4 +98,7 @@ public class WxPayAccount extends TenantEntity { | |||
| } | |||
| return openPayResult; | |||
| } | |||
| @TableField(exist = false) | |||
| private Long appInfoId; | |||
| } | |||
| @@ -0,0 +1,96 @@ | |||
| package com.iformall.domain.po; | |||
| import com.baomidou.mybatisplus.annotation.TableName; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import java.util.Date; | |||
| @TableName(value = "wx_profit_sharing_receiver_apply") | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxProfitSharingReceiverApply extends TenantEntity { | |||
| protected Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="plat") | |||
| private Integer plat; | |||
| @io.swagger.annotations.ApiModelProperty(value="业务申请编号",name="outRequestNo") | |||
| private String outRequestNo; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverOrganizationType 主体类型",name="organizationType") | |||
| private Integer organizationType; | |||
| @io.swagger.annotations.ApiModelProperty(value="是否金融机构",name="financeInstitution") | |||
| private Integer financeInstitution; | |||
| @io.swagger.annotations.ApiModelProperty(value="营业执照/登记证书信息",name="businessLicenseInfo") | |||
| private String businessLicenseInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="金融机构许可证信息",name="financeInstitutionInfo") | |||
| private String financeInstitutionInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverIdHolderType 证件持有人类型",name="idHolderType") | |||
| private Integer idHolderType; | |||
| @io.swagger.annotations.ApiModelProperty(value="EnumSharingReceiverIdDocType 经营者/法人证件类型",name="idDocType") | |||
| private Integer idDocType; | |||
| @io.swagger.annotations.ApiModelProperty(value="法定代表人说明函(url)",name="authorizeLetter") | |||
| private String authorizeLetter; | |||
| @io.swagger.annotations.ApiModelProperty(value="法定代表人说明函",name="authorizeLetterCopy") | |||
| private String authorizeLetterCopy; | |||
| @io.swagger.annotations.ApiModelProperty(value="经营者/法人身份证信息",name="idCardInfo") | |||
| private String idCardInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="经营者/法人其他类型证件信息",name="idDocInfo") | |||
| private String idDocInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="经营者/法人是否为受益人",name="owner") | |||
| private Integer owner; | |||
| @io.swagger.annotations.ApiModelProperty(value="最终受益人信息列表([])",name="uboInfoList") | |||
| private String uboInfoList; | |||
| @io.swagger.annotations.ApiModelProperty(value="结算账户信息",name="accountInfo") | |||
| private String accountInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="超级管理员信息",name="contactInfo") | |||
| private String contactInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="店铺信息",name="salesSceneInfo") | |||
| private String salesSceneInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="结算规则",name="settlementInfo") | |||
| private String settlementInfo; | |||
| @io.swagger.annotations.ApiModelProperty(value="商户简称",name="merchantShortname") | |||
| private String merchantShortname; | |||
| @io.swagger.annotations.ApiModelProperty(value="特殊资质([])",name="qualifications") | |||
| private String qualifications; | |||
| @io.swagger.annotations.ApiModelProperty(value="补充材料([])",name="businessAdditionPics") | |||
| private String businessAdditionPics; | |||
| @io.swagger.annotations.ApiModelProperty(value="补充说明",name="businessAdditionDesc") | |||
| private String businessAdditionDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信支付申请单号",name="applymentId") | |||
| private Integer applymentId; | |||
| @io.swagger.annotations.ApiModelProperty(value="申请状态",name="applymentState") | |||
| private Integer applymentState; | |||
| @io.swagger.annotations.ApiModelProperty(value="申请状态描述",name="applymentStateDesc") | |||
| private String applymentStateDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value="签约状态",name="signState") | |||
| private Integer signState; | |||
| @io.swagger.annotations.ApiModelProperty(value="签约链接",name="signUrl") | |||
| private String signUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="电商平台二级商户号",name="subMchid") | |||
| private String subMchid; | |||
| @io.swagger.annotations.ApiModelProperty(value="汇款账户验证信息",name="accountValidation") | |||
| private String accountValidation; | |||
| @io.swagger.annotations.ApiModelProperty(value="驳回原因详情",name="auditDetail") | |||
| private String auditDetail; | |||
| @io.swagger.annotations.ApiModelProperty(value="法人验证链接",name="legalValidationUrl") | |||
| private String legalValidationUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="法人验证链接二维码",name="legalValidationQrcode") | |||
| private String legalValidationQrcode; | |||
| @io.swagger.annotations.ApiModelProperty(value="申请状态",name="verifyResult") | |||
| private Integer verifyResult; | |||
| @io.swagger.annotations.ApiModelProperty(value="申请状态描述",name="verifyFailReason") | |||
| private String verifyFailReason; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="createTime") | |||
| private Date createTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="updateTime") | |||
| private Date updateTime; | |||
| } | |||
| @@ -0,0 +1,52 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 结算账户信息 | |||
| * 账户类型 | |||
| */ | |||
| public enum EnumSharingReceiverAccountType { | |||
| ACCOUNT_TYPE_74(74, "74", "对公账户"), | |||
| ACCOUNT_TYPE_75(75, "75", "对私账户"), | |||
| ; | |||
| public static EnumSharingReceiverAccountType getEnum(Integer code) { | |||
| for (EnumSharingReceiverAccountType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverAccountType getEnum(String codeStr) { | |||
| for (EnumSharingReceiverAccountType value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverAccountType(Integer code, String codeStr, String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,65 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 申请状态 | |||
| * CHECKING:资料校验中 | |||
| * ACCOUNT_NEED_VERIFY:待账户验证 | |||
| * AUDITING:审核中 | |||
| * REJECTED:已驳回 | |||
| * NEED_SIGN:待签约 | |||
| * FINISH:完成 | |||
| * FROZEN:已冻结 | |||
| * CANCELED:已作废 | |||
| */ | |||
| public enum EnumSharingReceiverApplymentState { | |||
| CHECKING(1, "CHECKING", "资料校验中"), | |||
| ACCOUNT_NEED_VERIFY(2, "ACCOUNT_NEED_VERIFY", "待账户验证"), | |||
| AUDITING(3, "AUDITING", "审核中"), | |||
| REJECTED(4, "REJECTED", "已驳回"), | |||
| NEED_SIGN(5, "NEED_SIGN", "待签约"), | |||
| FINISH(6, "FINISH", "完成"), | |||
| FROZEN(7, "FROZEN", "已冻结"), | |||
| CANCELED(8, "CANCELED", "已作废"), | |||
| ; | |||
| public static EnumSharingReceiverApplymentState getEnum(Integer code) { | |||
| for (EnumSharingReceiverApplymentState value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverApplymentState getEnum(String codeStr) { | |||
| for (EnumSharingReceiverApplymentState value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverApplymentState(Integer code, String codeStr, String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,70 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 营业执照/登记证书信息 | |||
| * 证书类型 | |||
| * CERTIFICATE_TYPE_2388:事业单位法人证书 | |||
| * CERTIFICATE_TYPE_2389:统一社会信用代码证书 | |||
| * CERTIFICATE_TYPE_2394:社会团体法人登记证书 | |||
| * CERTIFICATE_TYPE_2395:民办非企业单位登记证书 | |||
| * CERTIFICATE_TYPE_2396:基金会法人登记证书 | |||
| * CERTIFICATE_TYPE_2399:宗教活动场所登记证 | |||
| * CERTIFICATE_TYPE_2400:政府部门下发的其他有效证明文件 | |||
| * CERTIFICATE_TYPE_2520:执业许可证/执业证 | |||
| * CERTIFICATE_TYPE_2521:基层群众性自治组织特别法人统一社会信用代码证 | |||
| * CERTIFICATE_TYPE_2522:农村集体经济组织登记证 | |||
| */ | |||
| public enum EnumSharingReceiverBusinessCretType { | |||
| CERTIFICATE_TYPE_2388(2388, "CERTIFICATE_TYPE_2388", "事业单位法人证书"), | |||
| CERTIFICATE_TYPE_2389(2389, "CERTIFICATE_TYPE_2389", "统一社会信用代码证书"), | |||
| CERTIFICATE_TYPE_2394(2394, "CERTIFICATE_TYPE_2394", "社会团体法人登记证书"), | |||
| CERTIFICATE_TYPE_2395(2395, "CERTIFICATE_TYPE_2395", "民办非企业单位登记证书"), | |||
| CERTIFICATE_TYPE_2396(2396, "CERTIFICATE_TYPE_2396", "基金会法人登记证书"), | |||
| CERTIFICATE_TYPE_2399(2399, "CERTIFICATE_TYPE_2399", "宗教活动场所登记证"), | |||
| CERTIFICATE_TYPE_2400(2400, "CERTIFICATE_TYPE_2400", "政府部门下发的其他有效证明文件"), | |||
| CERTIFICATE_TYPE_2520(2520, "CERTIFICATE_TYPE_2520", "执业许可证/执业证"), | |||
| CERTIFICATE_TYPE_2521(2521, "CERTIFICATE_TYPE_2521", "基层群众性自治组织特别法人统一社会信用代码证"), | |||
| CERTIFICATE_TYPE_2522(2522, "CERTIFICATE_TYPE_2522", "农村集体经济组织登记证"), | |||
| ; | |||
| public static EnumSharingReceiverBusinessCretType getEnum(Integer code) { | |||
| for (EnumSharingReceiverBusinessCretType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverBusinessCretType getEnum(String codeStr) { | |||
| for (EnumSharingReceiverBusinessCretType value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverBusinessCretType(Integer code, String codeStr, String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,53 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 证件持有人类型 | |||
| * LEGAL:法人 | |||
| * SUPER:经办人 | |||
| */ | |||
| public enum EnumSharingReceiverContactType { | |||
| LEGAL(65, "65", "法人"), | |||
| SUPER(66, "66", "经办人"), | |||
| ; | |||
| public static EnumSharingReceiverContactType getEnum(Integer code) { | |||
| for (EnumSharingReceiverContactType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverContactType getEnum(String codeStr) { | |||
| for (EnumSharingReceiverContactType value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverContactType(Integer code, String codeStr, String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,59 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 金融机构类型 | |||
| * BANK_AGENT:银行业, 适用于商业银行、政策性银行、农村合作银行、村镇银行、开发性金融机构等 | |||
| * PAYMENT_AGENT:支付机构, 适用于非银行类支付机构 | |||
| * INSURANCE:保险业, 适用于保险、保险中介、保险代理、保险经纪等保险类业务 | |||
| * TRADE_AND_SETTLE:交易及结算类金融机构, 适用于交易所、登记结算类机构、银行卡清算机构、资金清算中心等 | |||
| * OTHER:其他金融机构, 适用于财务公司、信托公司、金融资产管理公司、金融租赁公司、汽车金融公司、贷款公司、货币经纪公司、消费金融公司、证券业、金融控股公司、股票、期货、货币兑换、小额贷款公司、金融资产管理、担保公司、商业保理公司、典当行、融资租赁公司、财经咨询等其他金融业 | |||
| */ | |||
| public enum EnumSharingReceiverFinanceType { | |||
| BANK_AGENT(1, "BANK_AGENT", "银行业"), | |||
| PAYMENT_AGENT(2, "PAYMENT_AGENT", "支付机构"), | |||
| INSURANCE(3, "INSURANCE", "保险业"), | |||
| TRADE_AND_SETTLE(4, "TRADE_AND_SETTLE", "交易及结算类金融机构"), | |||
| OTHER(5, "OTHER", "其他金融机构"), | |||
| ; | |||
| public static EnumSharingReceiverFinanceType getEnum(Integer code) { | |||
| for (EnumSharingReceiverFinanceType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverFinanceType getEnum(String codeStr) { | |||
| for (EnumSharingReceiverFinanceType value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverFinanceType(Integer code, String codeStr, String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,65 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 经营者/法人证件类型 | |||
| * IDENTIFICATION_TYPE_MAINLAND_IDCARD:中国大陆居民-身份证 | |||
| * IDENTIFICATION_TYPE_OVERSEA_PASSPORT:其他国家或地区居民-护照 | |||
| * IDENTIFICATION_TYPE_HONGKONG:中国香港居民--来往内地通行证 | |||
| * IDENTIFICATION_TYPE_MACAO:中国澳门居民--来往内地通行证 | |||
| * IDENTIFICATION_TYPE_TAIWAN:中国台湾居民--来往大陆通行证 | |||
| * IDENTIFICATION_TYPE_FOREIGN_RESIDENT:外国人居留证 | |||
| * IDENTIFICATION_TYPE_HONGKONG_MACAO_RESIDENT:港澳居民证 | |||
| * IDENTIFICATION_TYPE_TAIWAN_RESIDENT:台湾居民证 | |||
| */ | |||
| public enum EnumSharingReceiverIdDocType { | |||
| IDENTIFICATION_TYPE_MAINLAND_IDCARD(1, "IDENTIFICATION_TYPE_MAINLAND_IDCARD", "中国大陆居民-身份证"), | |||
| IDENTIFICATION_TYPE_OVERSEA_PASSPORT(2, "IDENTIFICATION_TYPE_OVERSEA_PASSPORT", "其他国家或地区居民-护照"), | |||
| IDENTIFICATION_TYPE_HONGKONG(3, "IDENTIFICATION_TYPE_HONGKONG", "中国香港居民--来往内地通行证"), | |||
| IDENTIFICATION_TYPE_MACAO(4, "IDENTIFICATION_TYPE_MACAO", "中国澳门居民--来往内地通行证"), | |||
| IDENTIFICATION_TYPE_TAIWAN(5, "IDENTIFICATION_TYPE_TAIWAN", "中国台湾居民--来往大陆通行证"), | |||
| IDENTIFICATION_TYPE_FOREIGN_RESIDENT(6, "IDENTIFICATION_TYPE_FOREIGN_RESIDENT", "外国人居留证"), | |||
| IDENTIFICATION_TYPE_HONGKONG_MACAO_RESIDENT(7, "IDENTIFICATION_TYPE_HONGKONG_MACAO_RESIDENT", "港澳居民证"), | |||
| IDENTIFICATION_TYPE_TAIWAN_RESIDENT(8, "IDENTIFICATION_TYPE_TAIWAN_RESIDENT", "台湾居民证"), | |||
| ; | |||
| public static EnumSharingReceiverIdDocType getEnum(Integer code) { | |||
| for (EnumSharingReceiverIdDocType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverIdDocType getEnum(String codeStr) { | |||
| for (EnumSharingReceiverIdDocType value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverIdDocType(Integer code, String codeStr, String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,53 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 证件持有人类型 | |||
| * LEGAL:法人 | |||
| * SUPER:经办人 | |||
| */ | |||
| public enum EnumSharingReceiverIdHolderType { | |||
| LEGAL(1, "LEGAL", "法人"), | |||
| SUPER(2, "SUPER", "经办人"), | |||
| ; | |||
| public static EnumSharingReceiverIdHolderType getEnum(Integer code) { | |||
| for (EnumSharingReceiverIdHolderType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverIdHolderType getEnum(String codeStr) { | |||
| for (EnumSharingReceiverIdHolderType value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverIdHolderType(Integer code, String codeStr,String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,63 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 进件店铺 主体类型 | |||
| * 2401:小微商户,指无营业执照的个人商家。 | |||
| * 2500:个人卖家,指无营业执照,已持续从事电子商务经营活动满6个月,且期间经营收入累计超过20万元的个人商家。(若选择该主体,请在“补充说明”填写相关描述)。 | |||
| * 4:个体工商户,营业执照上的主体类型一般为个体户、个体工商户、个体经营。 | |||
| * 2:企业,营业执照上的主体类型一般为有限公司、有限责任公司。 | |||
| * 3:事业单位,包括国内各类事业单位,如:医疗、教育、学校等单位。 | |||
| * 2502:政府机关,包括各级、各类政府机关,如机关党委、税务、民政、人社、工商、商务、市监等。 | |||
| * 1708:社会组织,包括社会团体、民办非企业、基金会、基层群众性自治组织、农村集体经济组织等组织。 | |||
| */ | |||
| public enum EnumSharingReceiverOrganizationType { | |||
| XIAOWEI(2401, "2401", "小微商户"), | |||
| GEREN(2500, "2500", "个人卖家"), | |||
| GETI(4, "4", "个体工商户"), | |||
| QIYE(2, "2", "企业"), | |||
| SHIYE(3, "3", "事业单位"), | |||
| ZHENGFU(2502, "2502", "政府机关"), | |||
| SHEHUI(1708, "1708", "社会组织"), | |||
| ; | |||
| public static EnumSharingReceiverOrganizationType getEnum(Integer code) { | |||
| for (EnumSharingReceiverOrganizationType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverOrganizationType getEnum(String codeStr) { | |||
| for (EnumSharingReceiverOrganizationType value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverOrganizationType(Integer code, String codeStr, String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,55 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * 签约状态 | |||
| * 1、UNSIGNED:未签约。该状态下,电商平台可查询获取签约链接,引导二级商户的超级管理员完成签约; | |||
| * 2、SIGNED :已签约。指二级商户的超级管理员已完成签约。注意:若申请单被驳回,商户修改了商户主体名称、法人名称、超级管理员信息、主体类型等信息,则需重新签约。 | |||
| * 3、NOT_SIGNABLE:不可签约。该状态下,暂不支持超级管理员签约。一般为申请单处于已驳回、已冻结、机器校验中状态,无法签约 | |||
| */ | |||
| public enum EnumSharingReceiverSignState { | |||
| UNSIGNED(1, "UNSIGNED", "未签约"), | |||
| SIGNED(2, "SIGNED", "已签约"), | |||
| NOT_SIGNABLE(3, "NOT_SIGNABLE", "不可签约"), | |||
| ; | |||
| public static EnumSharingReceiverSignState getEnum(Integer code) { | |||
| for (EnumSharingReceiverSignState value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| public static EnumSharingReceiverSignState getEnum(String codeStr) { | |||
| for (EnumSharingReceiverSignState value : values()) { | |||
| if (value.getCodeStr().equals(codeStr)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String codeStr; | |||
| private String message; | |||
| EnumSharingReceiverSignState(Integer code, String codeStr, String message) { | |||
| this.code = code; | |||
| this.codeStr = codeStr; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getCodeStr() { | |||
| return codeStr; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -12,6 +12,4 @@ public interface WxPayAccountBillMapper extends CommonMapper<WxPayAccountBill, L | |||
| List<WxPayAccountBill> findList(WxPayAccountBill wxPayAccount); | |||
| WxPayAccountBill getByTenantId(String tenantId); | |||
| } | |||
| @@ -1,9 +1,6 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| @@ -11,6 +8,4 @@ public interface WxPayAccountMapper extends CommonMapper<WxPayAccount, Long> { | |||
| List<WxPayAccount> findList(WxPayAccount wxPayAccount); | |||
| List<WxPayAccount> getByTenantId(@Param("tenantId")String tenantId); | |||
| } | |||
| @@ -0,0 +1,13 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.domain.po.WxProfitSharingReceiverApply; | |||
| import java.util.List; | |||
| public interface WxProfitSharingReceiverApplyMapper extends CommonMapper<WxProfitSharingReceiverApply, Long> { | |||
| List<WxProfitSharingReceiverApply> findList(WxProfitSharingReceiverApply apply); | |||
| } | |||
| @@ -56,6 +56,4 @@ public interface WxPayAccountBillService { | |||
| */ | |||
| void deleteById(Long id); | |||
| WxPayAccountBill getByTenantId(String tenantId); | |||
| } | |||
| @@ -30,7 +30,7 @@ public interface WxProjectConfigService { | |||
| * 初始化新增修改wxPayAccount | |||
| * @param wxPayAccount | |||
| */ | |||
| void initPayAccount(WxPayAccount wxPayAccount); | |||
| void initPayAccount(WxAppinfo appinfo,WxPayAccount wxPayAccount); | |||
| /** | |||
| * 初始化新增userInfo | |||
| @@ -84,10 +84,6 @@ public class WxPayAccountBillServiceImpl implements WxPayAccountBillService { | |||
| wxPayAccountBillMapper.deleteById(id); | |||
| } | |||
| @Override | |||
| public WxPayAccountBill getByTenantId(String tenantId) { | |||
| return wxPayAccountBillMapper.getByTenantId(tenantId); | |||
| } | |||
| } | |||
| @@ -194,14 +194,18 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { | |||
| @Override | |||
| @Transactional(rollbackFor = {Exception.class}) | |||
| public void initPayAccount(WxPayAccount wxPayAccount) { | |||
| public void initPayAccount(WxAppinfo appinfo,WxPayAccount wxPayAccount) { | |||
| if(appinfo.getPayId() != null){ | |||
| wxPayAccount.setId(appinfo.getPayId()); | |||
| } | |||
| wxPayAccountService.saveOrUpdate(wxPayAccount); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxPayAccount.getTenantId()); | |||
| if(wxPayAccountBill == null){ | |||
| wxPayAccountBill = new WxPayAccountBill(); | |||
| wxPayAccountBill.setTenantId(wxPayAccount.getTenantId()); | |||
| wxPayAccountBill.setServiceChargeRate(0); | |||
| 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()); | |||
| @@ -212,15 +216,13 @@ public class WxProjectConfigServiceImpl implements WxProjectConfigService { | |||
| wxPayAccountBill.setRate(wxPayAccount.getRate()); | |||
| wxPayAccountBill.setRealRate(wxPayAccount.getRealRate()); | |||
| wxPayAccountBillService.saveOrUpdate(wxPayAccountBill); | |||
| WxAppinfo wxAppinfo = new WxAppinfo(); | |||
| wxAppinfo.setTenantId(wxPayAccount.getTenantId()); | |||
| List<WxAppinfo> list = wxAppinfoService.getList(wxAppinfo); | |||
| if(list != null && list.size() > 0){ | |||
| for (WxAppinfo wa:list) { | |||
| wa.setPayId(wxPayAccount.getId()); | |||
| wa.setPayBillId(wxPayAccountBill.getId()); | |||
| wxAppinfoService.saveOrUpdate(wa); | |||
| } | |||
| if(appinfo.getPayId() == null){ | |||
| WxAppinfo updApp = new WxAppinfo(); | |||
| updApp.updateTenantInfo(appinfo); | |||
| updApp.setId(appinfo.getId()); | |||
| updApp.setPayId(wxPayAccount.getId()); | |||
| updApp.setPayBillId(wxPayAccountBill.getId()); | |||
| } | |||
| } | |||
| @@ -87,11 +87,4 @@ | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="getByTenantId" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_pay_account_bill where `tenant_id` = #{tenantId} | |||
| </select> | |||
| </mapper> | |||
| @@ -97,11 +97,5 @@ | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="getByTenantId" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_pay_account where `tenant_id` = #{tenantId} | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,125 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxProfitSharingReceiverApplyMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxProfitSharingReceiverApply"> | |||
| <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="merchant_id" jdbcType="BIGINT" property="merchantId" /> | |||
| <result column="plat" jdbcType="INTEGER" property="plat" /> | |||
| <result column="out_request_no" jdbcType="VARCHAR" property="outRequestNo" /> | |||
| <result column="organization_type" jdbcType="INTEGER" property="organizationType" /> | |||
| <result column="finance_institution" jdbcType="INTEGER" property="financeInstitution" /> | |||
| <result column="business_license_info" jdbcType="VARCHAR" property="businessLicenseInfo" /> | |||
| <result column="finance_institution_info" jdbcType="VARCHAR" property="financeInstitutionInfo" /> | |||
| <result column="id_holder_type" jdbcType="INTEGER" property="idHolderType" /> | |||
| <result column="id_doc_type" jdbcType="INTEGER" property="idDocType" /> | |||
| <result column="authorize_letter" jdbcType="VARCHAR" property="authorizeLetter" /> | |||
| <result column="authorize_letter_copy" jdbcType="VARCHAR" property="authorizeLetterCopy" /> | |||
| <result column="id_card_info" jdbcType="VARCHAR" property="idCardInfo" /> | |||
| <result column="id_doc_info" jdbcType="VARCHAR" property="idDocInfo" /> | |||
| <result column="owner" jdbcType="INTEGER" property="owner" /> | |||
| <result column="ubo_info_list" jdbcType="VARCHAR" property="uboInfoList" /> | |||
| <result column="account_info" jdbcType="VARCHAR" property="accountInfo" /> | |||
| <result column="contact_info" jdbcType="VARCHAR" property="contactInfo" /> | |||
| <result column="sales_scene_info" jdbcType="VARCHAR" property="salesSceneInfo" /> | |||
| <result column="settlement_info" jdbcType="VARCHAR" property="settlementInfo" /> | |||
| <result column="merchant_shortname" jdbcType="VARCHAR" property="merchantShortname" /> | |||
| <result column="qualifications" jdbcType="VARCHAR" property="qualifications" /> | |||
| <result column="business_addition_pics" jdbcType="VARCHAR" property="businessAdditionPics" /> | |||
| <result column="business_addition_desc" jdbcType="VARCHAR" property="businessAdditionDesc" /> | |||
| <result column="applyment_id" jdbcType="BIGINT" property="applymentId" /> | |||
| <result column="applyment_state" jdbcType="INTEGER" property="applymentState" /> | |||
| <result column="applyment_state_desc" jdbcType="VARCHAR" property="applymentStateDesc" /> | |||
| <result column="sign_state" jdbcType="INTEGER" property="signState" /> | |||
| <result column="sign_url" jdbcType="VARCHAR" property="signUrl" /> | |||
| <result column="sub_mchid" jdbcType="VARCHAR" property="subMchid" /> | |||
| <result column="account_validation" jdbcType="VARCHAR" property="accountValidation" /> | |||
| <result column="audit_detail" jdbcType="VARCHAR" property="auditDetail" /> | |||
| <result column="legal_validation_url" jdbcType="VARCHAR" property="legalValidationUrl" /> | |||
| <result column="legal_validation_qrcode" jdbcType="VARCHAR" property="legalValidationQrcode" /> | |||
| <result column="verify_result" jdbcType="INTEGER" property="verifyResult" /> | |||
| <result column="verify_fail_reason" jdbcType="VARCHAR" property="verifyFailReason" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`parent_tenant_id`,`merchant_id`,`plat`, | |||
| `out_request_no`,`organization_type`,`finance_institution`,`business_license_info`,`finance_institution_info`, | |||
| `id_holder_type`,`id_doc_type`,`authorize_letter`,`authorize_letter_copy`,`id_card_info`,`id_doc_info`, | |||
| `owner`,`ubo_info_list`,`account_info`,`contact_info`,`sales_scene_info`,`settlement_info`, | |||
| `merchant_shortname`,`qualifications`,`business_addition_pics`,`business_addition_desc`, | |||
| `applyment_id`,`applyment_state`,`applyment_state_desc`,`sign_state`,`sign_url`, | |||
| `sub_mchid`,`account_validation`,`audit_detail`,`legal_validation_url`,`legal_validation_qrcode`, | |||
| `verify_result`,`verify_fail_reason`,`create_time`,`update_time` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId and '' != tenantId"> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != parentTenantId and '' != parentTenantId"> | |||
| and `parent_tenant_id` = #{parentTenantId} | |||
| </if> | |||
| <if test=" null != merchantId "> | |||
| and `merchant_id` = #{merchantId} | |||
| </if> | |||
| <if test=" null != plat "> | |||
| and `plat` = #{plat} | |||
| </if> | |||
| <if test=" null != outRequestNo and '' != outRequestNo"> | |||
| and `out_request_no` = #{outRequestNo} | |||
| </if> | |||
| <if test=" null != organizationType "> | |||
| and `organization_type` = #{organizationType} | |||
| </if> | |||
| <if test=" null != applymentId "> | |||
| and `applyment_id` = #{applymentId} | |||
| </if> | |||
| <if test=" null != applymentState "> | |||
| and `applyment_state` = #{applymentState} | |||
| </if> | |||
| <if test=" null != signState "> | |||
| and `sign_state` = #{signState} | |||
| </if> | |||
| <if test=" null != verifyResult "> | |||
| and `verify_result` = #{verifyResult} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxProfitSharingReceiverApply" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_profit_sharing_receiver_apply | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -10,10 +10,7 @@ import com.iformall.controller.base.BaseController; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.po.base.TenantEntity; | |||
| import com.iformall.domain.vo.WxWeappInfo; | |||
| import com.iformall.enums.EnumGroupSupport; | |||
| import com.iformall.enums.EnumInvestUserType; | |||
| import com.iformall.enums.EnumSaleType; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.enums.*; | |||
| import com.iformall.service.*; | |||
| import com.iformall.shiro.PasswordHelper; | |||
| import com.iformall.utils.Constant; | |||
| @@ -234,16 +231,17 @@ public class WxProjectConfigController extends BaseController { | |||
| public ResultData initPayAccount(@RequestBody WxPayAccount wxPayAccount) { | |||
| logger.debug("[" + getIpAddr() + "] WxProjectConfigController::initPayAccount"); | |||
| try { | |||
| if(StringUtils.isBlank(wxPayAccount.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| WxPayAccount getByTenantId = wxPayAccountService.getByTenantId(wxPayAccount.getTenantId()); | |||
| if(wxPayAccount.getId() != null && (getByTenantId == null || !getByTenantId.getId().equals(wxPayAccount.getId()))){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| if(wxPayAccount.getAppInfoId() == null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"小程序Id必传"); | |||
| } | |||
| if(wxPayAccount.getId() == null && getByTenantId != null){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| // if(StringUtils.isBlank(wxPayAccount.getTenantId())){ | |||
| // return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"tenantId 必传"); | |||
| // } | |||
| WxAppinfo appinfo = wxAppinfoService.getById(wxPayAccount.getAppInfoId()); | |||
| if(appinfo == null || !EnumAppType.C.getCode().equals(appinfo.getType())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"小程序未找到或不是C端小程序"); | |||
| } | |||
| wxPayAccount.updateTenantInfo(appinfo); | |||
| if(StringUtils.isBlank(wxPayAccount.getNotifyUrl())){ | |||
| wxPayAccount.setNotifyUrl(wechatWebProperties.getUrl()+"/wxPay/notify"); | |||
| @@ -258,7 +256,7 @@ public class WxProjectConfigController extends BaseController { | |||
| wxPayAccount.setShare(0);//0: 未分账,1:分账(默认不分账) | |||
| } | |||
| wxProjectConfigService.initPayAccount(wxPayAccount); | |||
| wxProjectConfigService.initPayAccount(appinfo,wxPayAccount); | |||
| return new ResultData(); | |||
| }catch (Exception e){ | |||
| @@ -277,16 +275,16 @@ public class WxProjectConfigController extends BaseController { | |||
| if(StringUtils.isBlank(wxAppinfo.getTenantId())){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| if(wxAppinfo.getId() == null){ | |||
| WxPayAccount byTenantId = wxPayAccountService.getByTenantId(wxAppinfo.getTenantId()); | |||
| if(byTenantId != null){ | |||
| wxAppinfo.setPayId(byTenantId.getId()); | |||
| } | |||
| WxPayAccountBill billByTenantId = wxPayAccountBillService.getByTenantId(wxAppinfo.getTenantId()); | |||
| if(billByTenantId != null){ | |||
| wxAppinfo.setPayBillId(billByTenantId.getId()); | |||
| } | |||
| } | |||
| // if(wxAppinfo.getId() == null){ | |||
| // WxPayAccount byTenantId = wxPayAccountService.getByTenantId(wxAppinfo.getTenantId()); | |||
| // if(byTenantId != null){ | |||
| // wxAppinfo.setPayId(byTenantId.getId()); | |||
| // } | |||
| // WxPayAccountBill billByTenantId = wxPayAccountBillService.getByTenantId(wxAppinfo.getTenantId()); | |||
| // if(billByTenantId != null){ | |||
| // wxAppinfo.setPayBillId(billByTenantId.getId()); | |||
| // } | |||
| // } | |||
| wxAppinfoService.saveOrUpdate(wxAppinfo); | |||
| @@ -591,12 +589,12 @@ public class WxProjectConfigController extends BaseController { | |||
| TenantEntity tenantEntity = new TenantEntity(); | |||
| tenantEntity.setTenantId(wxMall.getTenantId()); | |||
| ResultData wxMallBuildingFloorList = wxMallBuildingService.getBuildingFloorList(tenantEntity); | |||
| map.put("wxMallBuildingFloorList",wxMallBuildingFloorList.data); | |||
| WxPayAccount wxPayAccount = wxPayAccountService.getByTenantId(wxMall.getTenantId()); | |||
| map.put("wxPayAccount",wxPayAccount); | |||
| WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxMall.getTenantId()); | |||
| map.put("wxPayAccountBill",wxPayAccountBill); | |||
| // ResultData wxMallBuildingFloorList = wxMallBuildingService.getBuildingFloorList(tenantEntity); | |||
| // map.put("wxMallBuildingFloorList",wxMallBuildingFloorList.data); | |||
| // WxPayAccount wxPayAccount = wxPayAccountService.getByTenantId(wxMall.getTenantId()); | |||
| // map.put("wxPayAccount",wxPayAccount); | |||
| // WxPayAccountBill wxPayAccountBill = wxPayAccountBillService.getByTenantId(wxMall.getTenantId()); | |||
| // map.put("wxPayAccountBill",wxPayAccountBill); | |||
| WxAppinfo wxAppinfo = new WxAppinfo(); | |||
| wxAppinfo.setTenantId(wxMall.getTenantId()); | |||