@@ -42,8 +42,6 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
WxAppinfoService wxAppinfoService;
@Autowired
WxPayAccountService wxPayAccountService;
@Override
public PageInfo<WxProfitSharingReceiverApply> listAsPage(WxProfitSharingReceiverApply record, Integer pageIndex, Integer pageSize) {
@@ -114,45 +112,7 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
@Transactional(rollbackFor = {Exception.class})
public ResultData handApplymentStates(WxProfitSharingReceiverApply receiverApply) {
if(receiverApply == null || !EnumSharingReceiverApplymentState.getNeedSyncList().contains(receiverApply.getApplymentState())){
// return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "该状态无需同步");
return new ResultData(receiverApply);
}
try {
WxPayService wxPayService = wxPayAccountService.getWxPayService(receiverApply.getTenantId());
ApplymentStateQueryResult applymentStateQueryResult = wxPayService.getApplyment4SubService().queryApplyStatusByBusinessCode(receiverApply.getOutRequestNo());
EnumSharingReceiverApplymentState enumApplymentState = EnumSharingReceiverApplymentState.getEnum(applymentStateQueryResult.getApplymentState());
if(enumApplymentState != null && !enumApplymentState.getCode().equals(receiverApply.getApplymentState())){
WxProfitSharingReceiverApply receiverApplyUpd = new WxProfitSharingReceiverApply();
receiverApplyUpd.updateTenantInfo(receiverApply);
receiverApplyUpd.setId(receiverApply.getId());
if(enumApplymentState.equals(EnumSharingReceiverApplymentState.APPLYMENT_STATE_FINISHED)){
receiverApplyUpd.setSubMchid(applymentStateQueryResult.getSubMchid());
}
receiverApplyUpd.setSignUrl(applymentStateQueryResult.getSignUrl());
receiverApplyUpd.setApplymentState(enumApplymentState.getCode());
receiverApplyUpd.setApplymentStateDesc(applymentStateQueryResult.getApplymentStateMsg());
if(enumApplymentState.equals(EnumSharingReceiverApplymentState.APPLYMENT_STATE_REJECTED)){
receiverApplyUpd.setAuditDetail(JSON.toJSONString(applymentStateQueryResult.getAuditDetail()));
}else{
receiverApplyUpd.setAuditDetail("[]");
}
receiverApplyUpd.setUpdateTime(new Date());
wxProfitSharingReceiverApplyMapper.updateById(receiverApplyUpd);
receiverApply.setSubMchid(receiverApplyUpd.getSubMchid());
receiverApply.setSignUrl(receiverApplyUpd.getSignUrl());
receiverApply.setApplymentState(receiverApplyUpd.getApplymentState());
receiverApply.setApplymentStateDesc(receiverApplyUpd.getApplymentStateDesc());
receiverApply.setAuditDetail(receiverApplyUpd.getAuditDetail());
receiverApply.setUpdateTime(receiverApplyUpd.getUpdateTime());
}
return new ResultData(receiverApply);
} catch (WxPayException e) {
e.printStackTrace();
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage());
}
return null;
}
@Override
@@ -178,31 +138,7 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
@Override
public ResultData handVerifyResult(WxProfitSharingReceiverApply receiverApply) {
if(receiverApply == null || !EnumSharingReceiverVerifyResult.VERIFYING.getCode().equals(receiverApply.getVerifyResult())){
return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "该状态无需同步");
}
WxPayService wxPayService = wxPayAccountService.getWxPayService(receiverApply.getTenantId());
try {
SettlementInfoResult settlementInfoResult = wxPayService.getApplyment4SubService().querySettlementBySubMchid(receiverApply.getSubMchid());
EnumSharingReceiverVerifyResult enumVerifyResult = EnumSharingReceiverVerifyResult.getEnum(settlementInfoResult.getVerifyResult());
if(enumVerifyResult != null && !enumVerifyResult.getCode().equals(receiverApply.getVerifyResult())){
WxProfitSharingReceiverApply receiverApplyUpd = new WxProfitSharingReceiverApply();
receiverApplyUpd.updateTenantInfo(receiverApply);
receiverApplyUpd.setId(receiverApply.getId());
receiverApplyUpd.setVerifyResult(enumVerifyResult.getCode());
if(enumVerifyResult.equals(EnumSharingReceiverVerifyResult.VERIFY_FAIL)){
receiverApplyUpd.setVerifyFailReason(settlementInfoResult.getVerifyFailReason());
}else{
receiverApplyUpd.setVerifyFailReason("");
}
receiverApplyUpd.setUpdateTime(new Date());
wxProfitSharingReceiverApplyMapper.updateById(receiverApplyUpd);
}
return new ResultData();
} catch (WxPayException e) {
e.printStackTrace();
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage());
}
return null;
}
@Override
@@ -1096,270 +1032,10 @@ public class WxProfitSharingReceiverApplyServiceImpl implements WxProfitSharingR
}
private ResultData applyment4subApplyment(WxProfitSharingReceiverApply receiverApply){
WxPayService wxPayService = wxPayAccountService.getWxPayService(receiverApply.getTenantId());
try {
WxPayApplyment4SubCreateRequest request = new WxPayApplyment4SubCreateRequest();
request.setBusinessCode(receiverApply.getOutRequestNo());
WxPayApplyment4SubCreateRequest.SubjectInfo subjectInfo = new WxPayApplyment4SubCreateRequest.SubjectInfo();
EnumSharingReceiverOrganizationType enumOrganizationType = EnumSharingReceiverOrganizationType.getEnum(receiverApply.getOrganizationType());
subjectInfo.setSubjectType(enumOrganizationType.getSubjectTypeEnum());
if(EnumYesOrNo.YES.getCode().equals(receiverApply.getFinanceInstitution())){
//todo 金融机构
// subjectInfo.setFinanceInstitution(true);
}
if(EnumSharingReceiverOrganizationType.GETI.equals(enumOrganizationType) || EnumSharingReceiverOrganizationType.QIYE.equals(enumOrganizationType)){
JSONObject businessLicenseInfoObject = JSONObject.parseObject(receiverApply.getBusinessLicenseInfo());
WxPayApplyment4SubCreateRequest.SubjectInfo.BusinessLicenseInfo businessLicenseInfo = new WxPayApplyment4SubCreateRequest.SubjectInfo.BusinessLicenseInfo();
JSONObject license_copy_info = businessLicenseInfoObject.getJSONObject("license_copy_info");
businessLicenseInfo.setLicenseCopy(this.getMerchantMediaId(license_copy_info));
businessLicenseInfo.setLicenseNumber(businessLicenseInfoObject.getString("license_number"));
businessLicenseInfo.setMerchantName(businessLicenseInfoObject.getString("merchant_name"));
businessLicenseInfo.setLegalPerson(businessLicenseInfoObject.getString("legal_person"));
businessLicenseInfo.setLicenseAddress(businessLicenseInfoObject.getString("license_address"));
businessLicenseInfo.setPeriodBegin(businessLicenseInfoObject.getString("period_begin"));
businessLicenseInfo.setPeriodEnd(businessLicenseInfoObject.getString("period_end"));
subjectInfo.setBusinessLicenseInfo(businessLicenseInfo);
WxPayApplyment4SubCreateRequest.SubjectInfo.IdentityInfo identityInfo = new WxPayApplyment4SubCreateRequest.SubjectInfo.IdentityInfo();
EnumSharingReceiverIdDocType enumIdDocType = EnumSharingReceiverIdDocType.getEnum(receiverApply.getIdDocType());
identityInfo.setIdDocType(enumIdDocType.getIdTypeEnum());
if(EnumSharingReceiverIdDocType.IDENTIFICATION_TYPE_IDCARD.equals(enumIdDocType)){
JSONObject idCardInfoObject = JSONObject.parseObject(receiverApply.getIdCardInfo());
WxPayApplyment4SubCreateRequest.SubjectInfo.IdentityInfo.IdCardInfo idCardInfo = new WxPayApplyment4SubCreateRequest.SubjectInfo.IdentityInfo.IdCardInfo();
JSONObject id_card_copy_info = idCardInfoObject.getJSONObject("id_card_copy_info");
idCardInfo.setIdCardCopy(this.getMerchantMediaId(id_card_copy_info));
JSONObject id_card_national_info = idCardInfoObject.getJSONObject("id_card_national_info");
idCardInfo.setIdCardNational(this.getMerchantMediaId(id_card_national_info));
idCardInfo.setIdCardName(idCardInfoObject.getString("id_card_name"));
idCardInfo.setIdCardNumber(idCardInfoObject.getString("id_card_number"));
idCardInfo.setIdCardAddress(idCardInfoObject.getString("id_card_address"));
idCardInfo.setCardPeriodBegin(idCardInfoObject.getString("card_period_begin"));
idCardInfo.setCardPeriodEnd(idCardInfoObject.getString("card_period_end"));
identityInfo.setIdCardInfo(idCardInfo);
}else{
JSONObject idDocInfoObject = JSONObject.parseObject(receiverApply.getIdDocInfo());
WxPayApplyment4SubCreateRequest.SubjectInfo.IdentityInfo.IdDocInfo idDocInfo = new WxPayApplyment4SubCreateRequest.SubjectInfo.IdentityInfo.IdDocInfo();
JSONObject id_doc_copy_info = idDocInfoObject.getJSONObject("id_doc_copy_info");
idDocInfo.setIdDocCopy(this.getMerchantMediaId(id_doc_copy_info));
if(!EnumSharingReceiverIdDocType.IDENTIFICATION_TYPE_OVERSEA_PASSPORT.equals(enumIdDocType)){
JSONObject id_doc_copy_back_info = idDocInfoObject.getJSONObject("id_doc_copy_back_info");
idDocInfo.setIdDocCopyBack(this.getMerchantMediaId(id_doc_copy_back_info));
}
idDocInfo.setIdDocName(idDocInfoObject.getString("id_doc_name"));
idDocInfo.setIdDocNumber(idDocInfoObject.getString("id_doc_number"));
idDocInfo.setIdDocAddress(idDocInfoObject.getString("id_doc_address"));
idDocInfo.setDocPeriodBegin(idDocInfoObject.getString("doc_period_begin"));
idDocInfo.setDocPeriodEnd(idDocInfoObject.getString("doc_period_end"));
identityInfo.setIdDocInfo(idDocInfo);
}
if(EnumSharingReceiverOrganizationType.QIYE.equals(enumOrganizationType)){
if(EnumYesOrNo.YES.getCode().equals(receiverApply.getOwner())){
identityInfo.setOwner(true);
}else{
identityInfo.setOwner(false);
List<WxPayApplyment4SubCreateRequest.SubjectInfo.UboInfo> uboInfoList = new ArrayList<>();
JSONArray jsonArray = JSONArray.parseArray(receiverApply.getUboInfoList());
for(int i = 0;i < jsonArray.size();i++){
JSONObject uboInfoObject = jsonArray.getJSONObject(i);
WxPayApplyment4SubCreateRequest.SubjectInfo.UboInfo uboInfo = new WxPayApplyment4SubCreateRequest.SubjectInfo.UboInfo();
Integer ubo_id_doc_type = uboInfoObject.getInteger("ubo_id_doc_type");
EnumSharingReceiverIdDocType enumUboIdDocType = EnumSharingReceiverIdDocType.getEnum(ubo_id_doc_type);
uboInfo.setUboIdDocType(enumUboIdDocType.getIdTypeEnum());
JSONObject ubo_id_doc_copy_info = uboInfoObject.getJSONObject("ubo_id_doc_copy_info");
uboInfo.setUboIdDocCopy(this.getMerchantMediaId(ubo_id_doc_copy_info));
if(!EnumSharingReceiverIdDocType.IDENTIFICATION_TYPE_OVERSEA_PASSPORT.equals(enumUboIdDocType)){
JSONObject ubo_id_doc_copy_back_info = uboInfoObject.getJSONObject("ubo_id_doc_copy_back_info");
uboInfo.setUboIdDocCopyBack(this.getMerchantMediaId(ubo_id_doc_copy_back_info));
}
uboInfo.setUboIdDocName(uboInfoObject.getString("ubo_id_doc_name"));
uboInfo.setUboIdDocNumber(uboInfoObject.getString("ubo_id_doc_number"));
uboInfo.setUboIdDocAddress(uboInfoObject.getString("ubo_id_doc_address"));
uboInfo.setUboPeriodBegin(uboInfoObject.getString("ubo_period_begin"));
uboInfo.setUboPeriodEnd(uboInfoObject.getString("ubo_period_end"));
uboInfoList.add(uboInfo);
}
subjectInfo.setUboInfoList(uboInfoList);
}
}
subjectInfo.setIdentityInfo(identityInfo);
} else{
//todo 其他主体
}
request.setSubjectInfo(subjectInfo);
WxPayApplyment4SubCreateRequest.BusinessInfo businessInfo = new WxPayApplyment4SubCreateRequest.BusinessInfo();
businessInfo.setMerchantShortname(receiverApply.getMerchantShortname());
businessInfo.setServicePhone(receiverApply.getServicePhone());
JSONObject salesInfoObject = JSONObject.parseObject(receiverApply.getSalesInfo());
WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo salesInfo = new WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo();
JSONArray sales_scenes_type = salesInfoObject.getJSONArray("sales_scenes_type");
List<Integer> salesScenesTypes = sales_scenes_type.toJavaList(Integer.class);
List<SalesScenesTypeEnum> salesScenesTypeEnumList = EnumSharingReceiverSalesScenesType.getSalesScenesTypeEnumList(salesScenesTypes);
salesInfo.setSalesScenesType(salesScenesTypeEnumList);
if(salesScenesTypes.contains(EnumSharingReceiverSalesScenesType.SALES_SCENES_STORE.getCode())){
JSONObject biz_store_info = salesInfoObject.getJSONObject("biz_store_info");
WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.BizStoreInfo bizStoreInfo = new WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.BizStoreInfo();
bizStoreInfo.setBizStoreName(biz_store_info.getString("biz_store_name"));
bizStoreInfo.setBizAddressCode(biz_store_info.getString("biz_address_code"));
JSONArray store_entrance_pic = biz_store_info.getJSONArray("store_entrance_pic");
bizStoreInfo.setStoreEntrancePic(this.getMerchantMediaIds(store_entrance_pic));
JSONArray indoor_pic = biz_store_info.getJSONArray("indoor_pic");
bizStoreInfo.setIndoorPic(this.getMerchantMediaIds(indoor_pic));
bizStoreInfo.setBizSubAppid(biz_store_info.getString("biz_sub_appid"));
salesInfo.setBizStoreInfo(bizStoreInfo);
}
if(salesScenesTypes.contains(EnumSharingReceiverSalesScenesType.SALES_SCENES_MP.getCode())){
JSONObject mp_info = salesInfoObject.getJSONObject("mp_info");
WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.MpInfo mpInfo = new WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.MpInfo();
mpInfo.setMpAppid(mp_info.getString("mp_appid"));
mpInfo.setMpSubAppid(mp_info.getString("mp_sub_appid"));
JSONArray mp_pics = mp_info.getJSONArray("mp_pics");
mpInfo.setMpPics(this.getMerchantMediaIds(mp_pics));
salesInfo.setMpInfo(mpInfo);
}
if(salesScenesTypes.contains(EnumSharingReceiverSalesScenesType.SALES_SCENES_MINI_PROGRAM.getCode())){
JSONObject mini_program_info = salesInfoObject.getJSONObject("mini_program_info");
WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.MiniProgramInfo miniProgramInfo = new WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.MiniProgramInfo();
miniProgramInfo.setMiniProgramAppid(mini_program_info.getString("mini_program_appid"));
miniProgramInfo.setMiniProgramSubAppid(mini_program_info.getString("mini_program_sub_appid"));
List<String> mediaIds = this.getMerchantMediaIds(mini_program_info.getJSONArray("mini_program_pics"));
if(!mediaIds.isEmpty()){
miniProgramInfo.setMiniProgramPics(mediaIds);
}
salesInfo.setMiniProgramInfo(miniProgramInfo);
}
if(salesScenesTypes.contains(EnumSharingReceiverSalesScenesType.SALES_SCENES_WEB.getCode())){
JSONObject web_info = salesInfoObject.getJSONObject("web_info");
WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.WebInfo webInfo = new WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.WebInfo();
webInfo.setDomain(web_info.getString("domain"));
JSONObject web_authorisation_info = web_info.getJSONObject("web_authorisation_info");
webInfo.setWebAuthorisation(this.getMerchantMediaId(web_authorisation_info));
webInfo.setWebAppid(web_info.getString("web_appid"));
salesInfo.setWebInfo(webInfo);
}
if(salesScenesTypes.contains(EnumSharingReceiverSalesScenesType.SALES_SCENES_APP.getCode())){
JSONObject app_info = salesInfoObject.getJSONObject("app_info");
WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.AppInfo appInfo = new WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.AppInfo();
appInfo.setAppAppid(app_info.getString("app_appid"));
appInfo.setAppSubAppid(app_info.getString("app_sub_appid"));
JSONArray app_pics = app_info.getJSONArray("app_pics");
appInfo.setAppPics(this.getMerchantMediaIds(app_pics));
salesInfo.setAppInfo(appInfo);
}
if(salesScenesTypes.contains(EnumSharingReceiverSalesScenesType.SALES_SCENES_WEWORK.getCode())){
JSONObject wework_info = salesInfoObject.getJSONObject("wework_info");
WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.WeworkInfo weworkInfo = new WxPayApplyment4SubCreateRequest.BusinessInfo.SalesInfo.WeworkInfo();
weworkInfo.setSubCorpId(wework_info.getString("sub_corp_id"));
JSONArray wework_pics = wework_info.getJSONArray("wework_pics");
weworkInfo.setWeworkPics(this.getMerchantMediaIds(wework_pics));
salesInfo.setWeworkInfo(weworkInfo);
}
businessInfo.setSalesInfo(salesInfo);
request.setBusinessInfo(businessInfo);
WxPayApplyment4SubCreateRequest.SettlementInfo settlementInfo = new WxPayApplyment4SubCreateRequest.SettlementInfo();
JSONObject settlementInfoObject = JSONObject.parseObject(receiverApply.getSettlementInfo());
settlementInfo.setSettlementId(settlementInfoObject.getString("settlement_id"));
settlementInfo.setQualificationType(settlementInfoObject.getString("qualification_type"));
JSONArray qualifications = JSONObject.parseArray(receiverApply.getQualifications());
List<String> mediaIds = this.getMerchantMediaIds(qualifications);
if(!mediaIds.isEmpty()){
settlementInfo.setQualifications(mediaIds);
}
settlementInfo.setActivitiesId(settlementInfoObject.getString("activities_id"));
settlementInfo.setActivitiesRate(settlementInfoObject.getString("activities_rate"));
JSONArray activities_additions = settlementInfoObject.getJSONArray("activities_additions");
List<String> mediaIds1 = this.getMerchantMediaIds(activities_additions);
if(!mediaIds1.isEmpty()){
settlementInfo.setActivitiesAdditions(mediaIds1);
}
request.setSettlementInfo(settlementInfo);
WxPayApplyment4SubCreateRequest.BankAccountInfo bankAccountInfo = new WxPayApplyment4SubCreateRequest.BankAccountInfo();
JSONObject accountInfoObject = JSONObject.parseObject(receiverApply.getAccountInfo());
EnumSharingReceiverAccountType enumAccountType = EnumSharingReceiverAccountType.getEnum(accountInfoObject.getInteger("bank_account_type"));
bankAccountInfo.setBankAccountType(enumAccountType.getBankAccountTypeEnum());
bankAccountInfo.setAccountName(accountInfoObject.getString("account_name"));
bankAccountInfo.setAccountBank(accountInfoObject.getString("account_bank"));
boolean need_bank_branch = accountInfoObject.getBooleanValue("need_bank_branch");
if(need_bank_branch){
bankAccountInfo.setBankBranchId(accountInfoObject.getString("bank_branch_id"));
bankAccountInfo.setBankName(accountInfoObject.getString("bank_name"));
}
bankAccountInfo.setBankAddressCode(accountInfoObject.getString("bank_address_code"));
bankAccountInfo.setAccountNumber(accountInfoObject.getString("account_number"));
//todo 1. 当主体类型是“政府机关/事业单位”时或所属行业为“党费”时,支持在有合法资金管理关系的情况下结算账户设置为非同名。
//todo 2. 若结算账户设置为非同名,则需填写非同名证明材料,若结算账户为同名,则无需填写。
request.setBankAccountInfo(bankAccountInfo);
WxPayApplyment4SubCreateRequest.ContactInfo contactInfo = new WxPayApplyment4SubCreateRequest.ContactInfo();
JSONObject contactInfoObject = JSONObject.parseObject(receiverApply.getContactInfo());
Integer contact_type = contactInfoObject.getInteger("contact_type");
EnumSharingReceiverContactType enumContactType = EnumSharingReceiverContactType.getEnum(contact_type);
contactInfo.setContactType(enumContactType.getContactTypeEnum());
contactInfo.setContactName(contactInfoObject.getString("contact_name"));
if(EnumSharingReceiverContactType.SUPER.equals(enumContactType)){
Integer contact_id_doc_type = contactInfoObject.getInteger("contact_id_doc_type");
EnumSharingReceiverIdDocType enumIdDocType = EnumSharingReceiverIdDocType.getEnum(contact_id_doc_type);
contactInfo.setContactIdDocType(enumIdDocType.getIdTypeEnum());
contactInfo.setContactIdNumber(contactInfoObject.getString("contact_id_number"));
JSONObject contact_id_doc_copy_info = contactInfoObject.getJSONObject("contact_id_doc_copy_info");
contactInfo.setContactIdDocCopy(this.getMerchantMediaId(contact_id_doc_copy_info));
if(!EnumSharingReceiverIdDocType.IDENTIFICATION_TYPE_OVERSEA_PASSPORT.equals(enumIdDocType)) {
JSONObject contact_id_doc_copy_back_info = contactInfoObject.getJSONObject("contact_id_doc_copy_back_info");
contactInfo.setContactIdDocCopyBack(this.getMerchantMediaId(contact_id_doc_copy_back_info));
}
contactInfo.setContactPeriodBegin(contactInfoObject.getString("contact_period_begin"));
contactInfo.setContactPeriodEnd(contactInfoObject.getString("contact_period_end"));
JSONObject business_authorization_letter_info = contactInfoObject.getJSONObject("business_authorization_letter_info");
contactInfo.setBusinessAuthorizationLetter(this.getMerchantMediaId(business_authorization_letter_info));
}
contactInfo.setOpenid(contactInfoObject.getString("openid"));
contactInfo.setMobilePhone(contactInfoObject.getString("mobile_phone"));
contactInfo.setContactEmail(contactInfoObject.getString("contact_email"));
request.setContactInfo(contactInfo);
WxPayApplyment4SubCreateRequest.AdditionInfo additionInfo = new WxPayApplyment4SubCreateRequest.AdditionInfo();
if(StringUtils.isNotBlank(receiverApply.getAdditionInfo())){
JSONObject additionInfoObject = JSONObject.parseObject(receiverApply.getAdditionInfo());
JSONObject legal_person_commitment_info = additionInfoObject.getJSONObject("legal_person_commitment_info");
additionInfo.setLegalPersonCommitment(this.getMerchantMediaId(legal_person_commitment_info));
JSONObject legal_person_video_info = additionInfoObject.getJSONObject("legal_person_video_info");
additionInfo.setLegalPersonVideo(this.getMerchantMediaId(legal_person_video_info));
}
if(StringUtils.isNotBlank(receiverApply.getBusinessAdditionPics())){
JSONArray business_addition_pics = JSONObject.parseArray(receiverApply.getBusinessAdditionPics());
List<String> mediaIds2 = this.getMerchantMediaIds(business_addition_pics);
if(!mediaIds2.isEmpty()){
additionInfo.setBusinessAdditionPics(mediaIds2);
}
}
if(StringUtils.isNotBlank(receiverApply.getBusinessAdditionDesc())){
additionInfo.setBusinessAdditionMsg(contactInfoObject.getString("business_addition_msg"));
}
request.setAdditionInfo(additionInfo);
WxPayApplymentCreateResult wxPayApplymentCreateResult = wxPayService.getApplyment4SubService().createApply(request);
return new ResultData(wxPayApplymentCreateResult.getApplymentId());
} catch (WxPayException e) {
e.printStackTrace();
return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(),e.getMessage());
}
return null;
}
private boolean modifySettlement(TenantEntity tenantEntity,String subMchid,String accountInfo){
WxPayService wxPayService = wxPayAccountService.getWxPayService(tenantEntity.getTenantId());
try {
ModifySettlementRequest request = new ModifySettlementRequest();
JSONObject accountInfoObject = JSONObject.parseObject(accountInfo);
EnumSharingReceiverAccountType enumAccountType = EnumSharingReceiverAccountType.getEnum(accountInfoObject.getInteger("bank_account_type"));
request.setAccountType(enumAccountType.getAccountTypeEnum());
request.setAccountName(accountInfoObject.getString("account_name"));
request.setAccountBank(accountInfoObject.getString("account_bank"));
request.setBankAddressCode(accountInfoObject.getString("bank_address_code"));
request.setBankBranchId(accountInfoObject.getString("bank_branch_id"));
request.setBankName(accountInfoObject.getString("bank_name"));
request.setAccountNumber(accountInfoObject.getString("account_number"));
String result = wxPayService.getApplyment4SubService().modifySettlement(subMchid, request);
return true;
} catch (WxPayException e) {
e.printStackTrace();
logger.error("修改结算帐号异常"+subMchid);
}
return false;
}