| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.*; |
| | | import com.alipay.api.request.AlipayMerchantIndirectAuthorderCreateRequest; |
| | | import com.alipay.api.request.AlipayMerchantIndirectAuthorderQuerystatusRequest; |
| | | import com.alipay.api.request.AntMerchantExpandIndirectImageUploadRequest; |
| | | import com.alipay.api.response.AlipayMerchantIndirectAuthorderCreateResponse; |
| | | import com.alipay.api.response.AlipayMerchantIndirectAuthorderQuerystatusResponse; |
| | | import com.alipay.api.response.AntMerchantExpandIndirectImageUploadResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.CoachClient; |
| | | import com.dsh.course.feignClient.account.CoachTypeClient; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | |
| | | import com.dsh.course.feignClient.account.model.Coach; |
| | | import com.dsh.course.feignClient.account.model.CoachSerchVO; |
| | | import com.dsh.course.feignClient.account.model.CoachType; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.SinataUtil; |
| | | import com.dsh.guns.modular.system.controller.util.MD5; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.service.impl.TOperatorUserServiceImpl; |
| | | |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.catalina.valves.RemoteIpValve; |
| | | |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private IUserService userService; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | @Autowired |
| | | private IOperatorAuthService operatorAuthService; |
| | | |
| | | |
| | | /** |
| | | * 根据运营商ID 获取运营商管理的省市 |
| | | */ |
| | | @RequestMapping(value = "/getCityByOperatorId") |
| | | @ResponseBody |
| | | public List<TOperatorCity> getCityByOperatorId(@RequestBody Integer operatorId) { |
| | | return operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId",operatorId)); |
| | | } |
| | | |
| | | /** |
| | | * 跳转运营商管理首页 |
| | | */ |
| | |
| | | */ |
| | | @RequestMapping("/proportionAuth/{id}") |
| | | public String proportionAuth(Model model,@PathVariable("id") Integer id) { |
| | | model.addAttribute("operatorId",id); |
| | | model.addAttribute("id",id); |
| | | TOperator data = operatorService.getById(id); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("provinceList",list); |
| | | model.addAttribute("data",data); |
| | | return PREFIX + "OperatorUser_proportionAuth.html"; |
| | | } |
| | | |
| | | /** |
| | | * 商户认证提交 |
| | | */ |
| | | @RequestMapping(value = "/auth") |
| | | @ResponseBody |
| | | public Object auth(Integer alipayType,Integer wechatType,String alipayNum,String wechatNum,Integer operatorId ) { |
| | | TOperator id = operatorService.getOne(new QueryWrapper<TOperator>().eq("id", operatorId)); |
| | | OperatorUser operatorUser = new OperatorUser(); |
| | | operatorUser.setUserId(id.getUserId()); |
| | | operatorUser.setAlipay("支付宝"); |
| | | operatorUser.setWechat("微信"); |
| | | operatorUser.setWechatType(wechatType); |
| | | operatorUser.setAlipayType(alipayType); |
| | | operatorUser.setAlipayNum(alipayNum); |
| | | operatorUser.setWechatNum(wechatNum); |
| | | operatorUser.setOperatorId(operatorId); |
| | | operatorUserService.save(operatorUser); |
| | | // 修改运营商状态为 已认证 |
| | | id.setStatus(2); |
| | | operatorService.updateById(id); |
| | | public Object auth(String beneficiaryEnd,String businessEnd,String legalEnd, String name,String phone,String number,Integer operatorId,String bodyType,Integer type,String businessName,String businessNumber, |
| | | String legalRepresentative,String registerAddress,String businessTerm,String businessPicture, |
| | | String legalPerson,String legalNumber,String legalPhone,String legalEmail,String legalTerm, |
| | | String legalAddress,String legalFront,String legalBack,Integer accountType,String bank, |
| | | String accountName,String province,String provinceCode,String city,String cityCode, |
| | | String bankName,String bankNumber,String isBeneficiary,String beneficiary,String beneficiaryPhone, |
| | | String beneficiaryNumber,String beneficiaryAddress,String beneficiaryTerm,String beneficiaryFront,String beneficiaryBack, |
| | | String remark) { |
| | | UUID uuid = UUID.randomUUID(); |
| | | String numericUUID = uuid.toString().replaceAll("-", ""); |
| | | OperatorAuth operatorAuth = new OperatorAuth(); |
| | | operatorAuth.setName(name); |
| | | operatorAuth.setPhone(phone); |
| | | operatorAuth.setNumber(number); |
| | | operatorAuth.setBusinessEnd(businessEnd); |
| | | operatorAuth.setLegalEnd(legalEnd); |
| | | operatorAuth.setBeneficiaryEnd(beneficiaryEnd); |
| | | operatorAuth.setOperatorId(operatorId); |
| | | operatorAuth.setBodyType(bodyType); |
| | | operatorAuth.setType(type); |
| | | operatorAuth.setBusinessName(businessName); |
| | | operatorAuth.setBusinessNumber(businessNumber); |
| | | operatorAuth.setLegalRepresentative(legalRepresentative); |
| | | operatorAuth.setRegisterAddress(registerAddress); |
| | | operatorAuth.setBusinessTerm(businessTerm); |
| | | operatorAuth.setOutBizNo(numericUUID); |
| | | operatorAuth.setBusinessPicture(businessPicture); |
| | | operatorAuth.setLegalPerson(legalPerson); |
| | | operatorAuth.setLeagleNumber(legalNumber); |
| | | operatorAuth.setLegalPhone(legalPhone); |
| | | operatorAuth.setLegalEmail(legalEmail); |
| | | operatorAuth.setLegalTerm(legalTerm); |
| | | operatorAuth.setLegalAddress(legalAddress); |
| | | operatorAuth.setLegalFront(legalFront); |
| | | operatorAuth.setLegalBack(legalBack); |
| | | operatorAuth.setAccountType(accountType); |
| | | operatorAuth.setBank(bank); |
| | | operatorAuth.setAccountName(accountName); |
| | | operatorAuth.setProvince(province); |
| | | operatorAuth.setProvinceCode(provinceCode); |
| | | operatorAuth.setCity(city); |
| | | operatorAuth.setCityCode(cityCode); |
| | | operatorAuth.setBankName(bankName); |
| | | operatorAuth.setBankNumber(bankNumber); |
| | | operatorAuth.setAuditState(0); |
| | | operatorAuth.setIsBeneficiary(isBeneficiary); |
| | | operatorAuth.setBeneficiary(beneficiary); |
| | | operatorAuth.setBeneficiaryNumber(beneficiaryNumber); |
| | | operatorAuth.setBeneficiaryAddress(beneficiaryAddress); |
| | | operatorAuth.setBeneficiaryTerm(beneficiaryTerm); |
| | | operatorAuth.setBeneficiaryFront(beneficiaryFront); |
| | | operatorAuth.setBeneficiaryBack(beneficiaryBack); |
| | | operatorAuth.setRefuseReason(""); |
| | | operatorAuth.setRemark(remark); |
| | | |
| | | |
| | | // 将图片上传至阿里存储 |
| | | // 营业执照 |
| | | String string = uploadImg(businessPicture).toString(); |
| | | // 法人身份证正面照 |
| | | legalFront = uploadImg(legalFront).toString(); |
| | | // 法人身份证背面照 |
| | | legalBack = uploadImg(legalBack).toString(); |
| | | |
| | | if (bodyType.equals("ENTERPRISE")){ |
| | | // 受益人身份证正面照 |
| | | beneficiaryFront=uploadImg(beneficiaryFront).toString(); |
| | | // 受益人身份证背面照 |
| | | beneficiaryBack=uploadImg(beneficiaryBack).toString(); |
| | | } |
| | | |
| | | |
| | | //第二步:提交申请单 |
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do","2021004123692417", |
| | | "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDe188UHA8lR8CjG6KeKIYjYw6UfpJOl7nyklpiZKfbJ1q70D+LEdEZbWrzZ2eSwqeD+7B/ZV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kLTaKDbgLSqlmAbBj2lfdJaQJvHjBnF+jnVCspKCXUaoA/uJlix6/iAfeXxrk/cidR9mv4Aa4mDjiQKBgG2+SKyfoT3KrzFC/gVymM7SeDwlJZ4oJ4M1sN2Q8yr4b+LUMuCTQVkF/jiVgCDYprsVGgFGIGmbkkC7n/MN7w+u1ORYLxtaLnird21ellPlinmjq3c85O1CmuyLyUUju0bD5jMDnExrx3Tg7B/yk1xp4rR70fm4OCoukvWilYdDAoGBAK3Y77tqbno+D6W95fb8xb4xUUd1tEWgSY6CgjaqTRzbJ38cGuo92gBjKhDGLwaztcCw4yKPhEOum7nBGKKyxFfs8Z4vsG+m19JSdBfHf3PLModZwnjrRpatAnjTUW0DbPz+sfAwMgLnTCpElcSRQwjmioVAucCyd2FlMmqP5xB4","json","GBK", |
| | | "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApCzq4BIE4gMdEXxIAAUbiMpSytkzp+LVLVsBtji87rFGfWUcnrr3NKftaw0WtRu+36d1nDVOWW4CmgsOPyj1GOFoTcJOR/BqyIriwyLxpuMS8qgOqGJZXi+W4Nw2AJL6iMVwY2eI8F1G10gACK2I9TNJRzHh3tMTA6ItysbGoekRDtn6Xrkh5V6cyHQjLw0Q6MJK/68XT6/LWzarDEEYrSnIevOydMY32ptAgm5fp/h08M2khCmI6CuMWKmc87dPpd2krGVTALqprAQvB74AIqO+5DE0fN4LoitOYXAtWDCEF4kHN0hQUygIEGCwtMgEVzkf92VLlCX35YtDhWd1yQIDAQAB","RSA2"); |
| | | AlipayMerchantIndirectAuthorderCreateRequest request = new AlipayMerchantIndirectAuthorderCreateRequest(); |
| | | String param = "{" + |
| | | " \"out_biz_no\":\""+uuid+"\"," + |
| | | " \"contact_person_info\":{" + |
| | | " \"contact_name\":\""+name+"\"," + |
| | | " \"contact_phone_no\":\""+phone+"\"," + |
| | | " \"contact_card_no\":\""+number+"\"," + |
| | | " \"contact_cert_type\":\"RESIDENT\"" + |
| | | " }," + |
| | | " \"auth_identity_info\":{" + |
| | | " \"identity_type\":\""+bodyType+"\"," + |
| | | " \"is_financial_org\":false," + |
| | | " \"certificate_type\":\"BUSINESS_CERT\"," + |
| | | " \"certificate_info\":{" + |
| | | " \"cert_no\":\""+businessNumber+"\"," + |
| | | " \"cert_image\":\""+string+"\"," + |
| | | " \"merchant_name\":\""+businessName+"\"," + |
| | | " \"legal_person_name\":\""+legalRepresentative+"\"," + |
| | | " \"register_address\":\""+registerAddress+"\"," + |
| | | " \"effect_time\":\""+businessTerm+"\"," + |
| | | " \"expire_time\":\""+businessEnd+"\"" + |
| | | " }," + |
| | | " }," + |
| | | " \"legal_person_info\":{" + |
| | | " \"card_type\":\"RESIDENT\"," + |
| | | " \"person_name\":\""+legalRepresentative+"\"," + |
| | | " \"card_no\":\""+legalNumber+"\"," + |
| | | " \"effect_time\":\""+legalTerm+"\"," + |
| | | " \"expire_time\":\""+legalEnd+"\"," + |
| | | " \"card_front_img\":\""+legalFront+"\"," + |
| | | " \"card_back_img\":\""+legalBack+"\"," + |
| | | " \"is_benefit_person\":"+isBeneficiary+"" + |
| | | " },"; |
| | | String bene = " \"benefit_person_info\":{" + |
| | | " \"person_name\":\""+beneficiary+"\"," + |
| | | " \"card_no\":\""+beneficiaryNumber+"\"," + |
| | | " \"card_type\":\"RESIDENT\"," + |
| | | " \"effect_time\":\""+beneficiaryTerm+"\"," + |
| | | " \"expire_time\":\""+beneficiaryEnd+"\"," + |
| | | " \"card_front_img\":\""+beneficiaryFront+"\"," + |
| | | " \"card_back_img\":\""+beneficiaryBack+"\"" + |
| | | " },"; |
| | | if (bodyType.equals("ENTERPRISE")){ |
| | | request.setBizContent(param |
| | | + bene+ |
| | | "}"); |
| | | }else{ |
| | | request.setBizContent(param |
| | | + |
| | | "}"); |
| | | } |
| | | |
| | | AlipayMerchantIndirectAuthorderCreateResponse response = null; |
| | | try { |
| | | response = alipayClient.execute(request); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if(response.isSuccess()){ |
| | | System.out.println("上传认证单"); |
| | | JSONObject json = JSONObject.parseObject(response.getBody()); |
| | | JSONObject json1 = json.getJSONObject("alipay_merchant_indirect_authorder_create_response"); |
| | | String order_no = json1.getString("order_no"); |
| | | String order_status = json1.getString("order_status"); |
| | | // // 申请单号 |
| | | // String orderNo = r.getString("order_no"); |
| | | /** |
| | | * 状态 审核中(AUDITING)、待联系人确认(CONTACT_CONFIRM), |
| | | * 待法人确认(LEGAL_CONFIRM)、审核通过(AUDIT_PASS)、 |
| | | * 审核失败(AUDIT_REJECT)、已冻结(AUDIT_FREEZE)、 |
| | | * 已撤回(CANCELED)、联系人处理中(CONTACT_PROCESSING) |
| | | */ |
| | | // String orderStatus = r.getString("order_status"); |
| | | operatorAuth.setOrderNo(order_no); |
| | | operatorAuth.setOrderStatus(order_status); |
| | | operatorAuthService.save(operatorAuth); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | public static Object uploadImg(String img){ |
| | | String privateKey = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCSsmylIHe0j0pRQrB9p5ljryk9Qg2Z/JgIh+gtZES1TDo35YVw24aRRt7pkY7oHIZqpMRmSsWND1t63LVuNlpq532LG0iEJVJS53GzpRoHDD3iD01GmUoNjkCL36NCrbY0hTDDw7GZnYuJ8194Sss7OEoi7Mghg/XUreX4awwpWngTepCF7zs0S4YJQWyGY4JI6ooGraW23siBVY5MUI9XXLL6UKIExUfKe7zRihs8SrTHNnXtDT6EKYYo8P6M90Xuk173QsK2Xguk1FQ5Blh2ts7UvZVjP+WoQwDvrnqruve5kzDD9gwnAYUvhY66mtlxeub9nf5LLTtCliXeUZpNAgMBAAECggEAaPShSM9e9d9jM5p8PZqw4yJKZhqhMqAHgmsCUZ+gjPn52U4s198oez5ydDgBP85Q2XIDVpB+oPrw34mTgUQAEuaG6wTdMDannMscjYQ9h/dZOyj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3LRubx0ryLGR/tpUJzxp+9luanU/WgSRFKiEZJZqFjjDzw=="; |
| | | String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApCzq4BIE4gMdEXxIAAUbiMpSytkzp+LVLVsBtji87rFGfWUcnrr3NKftaw0WtRu+36d1nDVOWW4CmgsOPyj1GOFoTcJOR/BqyIriwyLxpuMS8qgOqGJZXi+W4Nw2AJL6iMVwY2eI8F1G10gACK2I9TNJRzHh3tMTA6ItysbGoekRDtn6Xrkh5V6cyHQjLw0Q6MJK/68XT6/LWzarDEEYrSnIevOydMY32ptAgm5fp/h08M2khCmI6CuMWKmc87dPpd2krGVTALqprAQvB74AIqO+5DE0fN4LoitOYXAtWDCEF4kHN0hQUygIEGCwtMgEVzkf92VLlCX35YtDhWd1yQIDAQAB"; |
| | | AlipayConfig alipayConfig = new AlipayConfig(); |
| | | alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do"); |
| | | alipayConfig.setAppId("2021004123692417"); |
| | | alipayConfig.setPrivateKey(privateKey); |
| | | alipayConfig.setFormat("json"); |
| | | alipayConfig.setAlipayPublicKey(alipayPublicKey); |
| | | alipayConfig.setCharset("UTF8"); |
| | | alipayConfig.setSignType("RSA2"); |
| | | AlipayClient alipayClient = null; |
| | | try { |
| | | alipayClient = new DefaultAlipayClient(alipayConfig); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | // 这是一个1x1像素的图片流 |
| | | String imageBase64 = "iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAEUlEQVR42mP4TyRgGFVIX4UAI/uOgGWVNeQAAAAASUVORK5CYII="; |
| | | // 下列FileItem中也可用直接读取本地文件的方式来获取文件 |
| | | // FileItem imageContent = new FileItem("本地文件的绝对路径"); |
| | | AntMerchantExpandIndirectImageUploadRequest request = new AntMerchantExpandIndirectImageUploadRequest(); |
| | | FileItem imageContent = new FileItem(img, Base64.getDecoder().decode(imageBase64)); |
| | | request.setImageContent(imageContent); |
| | | request.setImageType("jpg"); |
| | | AntMerchantExpandIndirectImageUploadResponse response = null; |
| | | try { |
| | | response = alipayClient.execute(request); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.out.println(response.getBody()); |
| | | if (response.isSuccess()) { |
| | | System.out.println("调用成功"); |
| | | } else { |
| | | System.out.println("调用失败"); |
| | | } |
| | | JSONObject json = JSONObject.parseObject(response.getBody()); |
| | | String sign = json.getString("ant_merchant_expand_indirect_image_upload_response"); |
| | | JSONObject r = JSONObject.parseObject(sign); |
| | | String image_id = r.getString("image_id"); |
| | | return image_id; |
| | | } |
| | | |
| | | /** |
| | | * 分账比例提交 |
| | | */ |
| | |
| | | user.setName(userName); |
| | | user.setPhone(phone); |
| | | user.setObjectType(2); |
| | | String s = MD5.md5("a123456"); |
| | | user.setPassword(s); |
| | | user.setAccount(phone); |
| | | user.setRoleid("2"); |
| | | user.setObjectType(2); |
| | | user.setStatus(1); |
| | | userService.save(user); |
| | | TOperator data = new TOperator(); |
| | | data.setUserId(user.getId()); |
| | |
| | | data.setStatus(1); |
| | | data.setState(1); |
| | | operatorService.save(data); |
| | | // 添加运营商认证数据 |
| | | OperatorUser operatorUser = new OperatorUser(); |
| | | operatorUser.setUserId(user.getId()); |
| | | operatorUser.setAlipay("支付宝"); |
| | | operatorUser.setWechat("微信"); |
| | | operatorUser.setAlipayType(3); |
| | | operatorUser.setWechatType(3); |
| | | operatorUser.setOperatorId(data.getId()); |
| | | operatorUserService.save(operatorUser); |
| | | user.setObjectId(data.getId()); |
| | | userService.updateById(user); |
| | | if (SinataUtil.isNotEmpty(comArr)){ |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | /** |
| | |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/updateOperator") |
| | | public ResultUtil updateOperator(Integer id,String name,String userName,String phone,Integer type ,@RequestParam String comArr) { |
| | | public ResultUtil updateOperator(Integer id,String name,String userName |
| | | ,String phone,Integer type ,@RequestParam String comArr) { |
| | | User one = userService.getOne(new QueryWrapper<User>().eq("name", name).eq("phone", phone)); |
| | | if (one!=null){ |
| | | return ResultUtil.error("当前管理员名称和电话已存在!"); |
| | | } |
| | | operatorCityService.remove(new QueryWrapper<TOperatorCity>().eq("operatorId",id)); |
| | | User user = new User(); |
| | | User user = userService.getOne(new QueryWrapper<User>().eq("objectId", id). |
| | | eq("objectType", 2)); |
| | | user.setName(userName); |
| | | user.setAccount(phone); |
| | | user.setPhone(phone); |
| | | user.setObjectType(2); |
| | | String a123456 = SecureUtil.md5("a123456"); |
| | | user.setPassword(a123456); |
| | | userService.save(user); |
| | | userService.updateById(user); |
| | | TOperator data = new TOperator(); |
| | | data.setId(id); |
| | | data.setUserId(user.getId()); |