//package com.dsh.guns.modular.system.util;
|
//
|
//import com.alibaba.fastjson.JSON;
|
//import com.alibaba.fastjson.JSONObject;
|
//import com.alipay.api.domain.Shop;
|
//import com.dsh.course.util.UUIDUtil;
|
//import com.dsh.guns.core.util.ToolUtil;
|
//import com.dsh.guns.modular.system.controller.util.UploadUtil;
|
//import com.dsh.guns.modular.system.model.OperatorAuth;
|
//import com.dsh.guns.modular.system.model.TOperator;
|
//import com.dsh.guns.modular.system.model.User;
|
//import com.dsh.guns.modular.system.service.IUserService;
|
//import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsRequest;
|
//import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult;
|
//import com.github.binarywang.wxpay.bean.media.ImageUploadResult;
|
//import com.github.binarywang.wxpay.service.EcommerceService;
|
//import com.github.binarywang.wxpay.service.MerchantMediaService;
|
//import com.github.binarywang.wxpay.service.WxPayService;
|
//import lombok.AllArgsConstructor;
|
//import lombok.NoArgsConstructor;
|
//import org.apache.commons.codec.digest.DigestUtils;
|
//import org.springframework.beans.factory.annotation.Autowired;
|
//import org.springframework.beans.factory.annotation.Value;
|
//import org.springframework.context.annotation.Bean;
|
//import org.springframework.http.*;
|
//import org.springframework.stereotype.Component;
|
//import org.springframework.web.client.RestTemplate;
|
//
|
//import java.io.ByteArrayInputStream;
|
//import java.io.InputStream;
|
//import java.io.UnsupportedEncodingException;
|
//import java.net.URLDecoder;
|
//import java.util.ArrayList;
|
//import java.util.HashMap;
|
//import java.util.List;
|
//import java.util.Map;
|
//
|
///**
|
// * 微信工具类
|
// */
|
//@Component
|
//public class WeChatUtil {
|
//
|
// private WxPayService wxService;
|
//
|
//
|
//
|
// /**
|
// * @description 电商二级商户进件(提交申请单)
|
// * @author jqs
|
// * @date 2023/8/11 10:04
|
// * @param shopAuthentication
|
// * @param applyNumber
|
// * @param operator
|
// * @return ApplymentsResult
|
// */
|
//
|
//
|
// public ApplymentsResult ecommerceApply(OperatorAuth shopAuthentication, String applyNumber, TOperator operator) throws Exception {
|
//
|
// EcommerceService ecommerceService = wxService.getEcommerceService();
|
// MerchantMediaService merchantMediaService = wxService.getMerchantMediaService();
|
// ApplymentsRequest request = new ApplymentsRequest();
|
// //生成提交类
|
// request.setOutRequestNo(applyNumber);
|
// if("ENTERPRISE".equals(shopAuthentication.getBodyType())){
|
// request.setOrganizationType("2");
|
// }else{
|
// request.setOrganizationType("4");
|
// }
|
// //营业执照
|
// ApplymentsRequest.BusinessLicenseInfo business_license_info = new ApplymentsRequest.BusinessLicenseInfo();
|
// InputStream blImageIO = OBSUploadUtil.getOBSStream(shopAuthentication.getBusinessPicture().replace("https://obs.ap-southeast-4.myhuaweicloud.com/",""));
|
// ImageUploadResult blImageIR = merchantMediaService.imageUploadV3(blImageIO,applyNumber+"blimage.jpg");
|
// business_license_info.setBusinessLicenseCopy(blImageIR.getMediaId());
|
// blImageIO.close();
|
// business_license_info.setBusinessLicenseNumber(shopAuthentication.getBusinessNumber());
|
// business_license_info.setMerchantName(shopAuthentication.getBusinessName());
|
// business_license_info.setLegalPerson(shopAuthentication.getLegalPerson());
|
// business_license_info.setCompanyAddress(shopAuthentication.getRegisterAddress());
|
// List<String> businessTimeList = new ArrayList<>();
|
// businessTimeList.add(0,shopAuthentication.getBusinessTerm());
|
// businessTimeList.add(1,shopAuthentication.getBusinessEnd());
|
// if(businessTimeList!=null&&businessTimeList.size()>1){
|
// String businessTime = JSONObject.toJSONString(businessTimeList);
|
// business_license_info.setBusinessTime(businessTime);
|
// }
|
// request.setBusinessLicenseInfo(business_license_info);
|
// //法人证件
|
// request.setIdDocType("IDENTIFICATION_TYPE_MAINLAND_IDCARD");
|
// ApplymentsRequest.IdCardInfo id_card_info = new ApplymentsRequest.IdCardInfo();
|
// InputStream lpIcFrontIO = OBSUploadUtil.getOBSStream(shopAuthentication.getLegalFront().replace("https://obs.ap-southeast-4.myhuaweicloud.com/",""));
|
// ImageUploadResult lpIcFrontIR = merchantMediaService.imageUploadV3(lpIcFrontIO,applyNumber+"lpIcFront.jpg");
|
// id_card_info.setIdCardCopy(lpIcFrontIR.getMediaId());
|
// lpIcFrontIO.close();
|
// InputStream lpIcBackIO = OBSUploadUtil.getOBSStream(shopAuthentication.getLegalBack().replace("https://obs.ap-southeast-4.myhuaweicloud.com/",""));
|
// ImageUploadResult lpIcBackIR = merchantMediaService.imageUploadV3(lpIcBackIO,applyNumber+"lpIcBack.jpg");
|
// id_card_info.setIdCardNational(lpIcBackIR.getMediaId());
|
// lpIcBackIO.close();
|
// id_card_info.setIdCardName(shopAuthentication.getLegalPerson());
|
// id_card_info.setIdCardNumber(shopAuthentication.getLeagleNumber());
|
// if("ENTERPRISE".equals(shopAuthentication.getBodyType())){
|
// id_card_info.setIdCardAddress(shopAuthentication.getLegalAddress());
|
// }
|
// id_card_info.setIdCardValidTimeBegin(shopAuthentication.getLegalTerm());
|
// id_card_info.setIdCardValidTime(shopAuthentication.getLegalEnd());
|
// request.setIdCardInfo(id_card_info);
|
// //企业填写
|
// if("ENTERPRISE".equals(shopAuthentication.getBodyType())){
|
// //受益人
|
// if("true".equals(shopAuthentication.getIsBeneficiary())){
|
// request.setOwner(true);
|
// }else{
|
// request.setOwner(false);
|
// List<ApplymentsRequest.UboInfo> ubo_info_list = new ArrayList<>();
|
// ApplymentsRequest.UboInfo uboInfo = new ApplymentsRequest.UboInfo();
|
// uboInfo.setUboIdDocType("IDENTIFICATION_TYPE_MAINLAND_IDCARD");
|
// InputStream uboIcFrontIO = OBSUploadUtil.getOBSStream(shopAuthentication.getBeneficiaryFront().replace("https://obs.ap-southeast-4.myhuaweicloud.com/",""));
|
// ImageUploadResult uboIcFrontIR = merchantMediaService.imageUploadV3(uboIcFrontIO,applyNumber+"uboIcFront.jpg");
|
// uboInfo.setUboIdDocCopy(uboIcFrontIR.getMediaId());
|
// uboIcFrontIO.close();
|
// InputStream uboIcBackIO = OBSUploadUtil.getOBSStream(shopAuthentication.getBeneficiaryBack().replace("https://obs.ap-southeast-4.myhuaweicloud.com/",""));
|
// ImageUploadResult uboIcBackIR = merchantMediaService.imageUploadV3(uboIcBackIO,applyNumber+"uboIcBack.jpg");
|
// uboInfo.setUboIdDocCopyBack(uboIcBackIR.getMediaId());
|
// uboIcBackIO.close();
|
// uboInfo.setUboIdDocName(shopAuthentication.getBeneficiary());
|
// uboInfo.setUboIdDocNumber(shopAuthentication.getBeneficiaryNumber());
|
// uboInfo.setUboIdDocAddress(shopAuthentication.getBeneficiaryAddress());
|
// uboInfo.setUboIdDocPeriodBegin(shopAuthentication.getBeneficiaryTerm());
|
// ubo_info_list.add(uboInfo);
|
// request.setUboInfoList(ubo_info_list);
|
// }
|
// }
|
// //结算账户信息
|
// ApplymentsRequest.AccountInfo accountInfo = new ApplymentsRequest.AccountInfo();
|
// if(shopAuthentication.getAccountType().equals(1)){
|
// accountInfo.setBankAccountType("74");
|
// }else{
|
// accountInfo.setBankAccountType("75");
|
// }
|
// accountInfo.setAccountBank(shopAuthentication.getBank());
|
// accountInfo.setAccountName(shopAuthentication.getAccountName());
|
// accountInfo.setBankAddressCode(shopAuthentication.getCityCode());
|
// accountInfo.setBankName(shopAuthentication.getBankName());
|
// accountInfo.setAccountNumber(shopAuthentication.getBankNumber());
|
// request.setAccountInfo(accountInfo);
|
// ApplymentsRequest.ContactInfo contactInfo = new ApplymentsRequest.ContactInfo();
|
// contactInfo.setContactType("65");
|
// contactInfo.setContactName(shopAuthentication.getLegalPerson());
|
// contactInfo.setContactIdCardNumber(shopAuthentication.getLeagleNumber());
|
// contactInfo.setMobilePhone(shopAuthentication.getLegalPhone());
|
// contactInfo.setContactEmail(shopAuthentication.getLegalEmail());
|
// request.setContactInfo(contactInfo);
|
// //店铺信息
|
// ApplymentsRequest.SalesSceneInfo salesSceneInfo = new ApplymentsRequest.SalesSceneInfo();
|
// salesSceneInfo.setStoreName(operator.getName());
|
//// InputStream storeQrCodeIO = OBSUploadUtils.getOSSInputStream(operator.getShopCode().replace("https://hongruitang.oss-cn-beijing.aliyuncs.com/",""));
|
//// ImageUploadResult storeQrCodeIR = merchantMediaService.imageUploadV3(storeQrCodeIO,applyNumber+"storeQrCode.jpg");
|
//// salesSceneInfo.setStoreQrCode(storeQrCodeIR.getMediaId());
|
//// storeQrCodeIO.close();
|
// request.setSalesSceneInfo(salesSceneInfo);
|
// request.setMerchantShortname(operator.getName());
|
//// request.setBusinessAdditionPics(shopAuthentication.getBaPics());
|
//// request.setBusinessAdditionDesc(shopAuthentication.getBaDesc());
|
// return ecommerceService.createApply(request);
|
// }
|
//
|
//}
|