44323
2023-12-07 a52403161590d16c98c776639efc929868c71a27
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/OperatorController.java
@@ -156,6 +156,8 @@
    public String proportionAuth(Model model,@PathVariable("id") Integer id) {
        model.addAttribute("id",id);
        TOperator data = operatorService.getById(id);
        User byId = userService.getById(data.getUserId());
        model.addAttribute("user",byId);
        List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0));
        model.addAttribute("provinceList",list);
        model.addAttribute("data",data);
@@ -188,7 +190,8 @@
     */
    @RequestMapping(value = "/auth")
    @ResponseBody
    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,
    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,
@@ -272,9 +275,9 @@
        // 营业执照
        String string = uploadImg(businessPicture).toString();
        // 法人身份证正面照
         legalFront = uploadImg(legalFront).toString();
        legalFront = uploadImg(legalFront).toString();
        // 法人身份证背面照
         legalBack = uploadImg(legalBack).toString();
        legalBack = uploadImg(legalBack).toString();
        if (bodyType.equals("ENTERPRISE")){
            // 受益人身份证正面照
@@ -363,6 +366,8 @@
//            String orderStatus = r.getString("order_status");
            operatorAuth.setOrderNo(order_no);
            operatorAuth.setOrderStatus(order_status);
            operatorAuthService.saveOrUpdate(operatorAuth);
            // 通过运营商id找到用户id
            TOperator byId = operatorService.getById(operatorId);
@@ -372,7 +377,10 @@
                if (userId1!=null){
                    // 设置为审核中状态
                    userId1.setAlipayAudit(1);
                    userId1.setWechatAudit(1);
//                    userId1.setWechatAudit(1);
                    operatorUserService.updateById(userId1);
                    operatorAuth.setQrCode(null);
                    operatorAuthService.saveOrUpdate(operatorAuth);
                }
            }
        } else {
@@ -610,47 +618,47 @@
        data.setState(1);
        operatorService.updateById(data);
        if (type != 1){
        if (SinataUtil.isNotEmpty(comArr)){
            JSONArray jsonArray = JSON.parseArray(comArr);
            int size = jsonArray.size();
            for (int i = 0; i < size; i++) {
                JSONObject jsonObject = jsonArray.getJSONObject(i);
                TOperatorCity province = new TOperatorCity();
                TOperatorCity city = new TOperatorCity();
                TOperatorCity one1 = operatorCityService.getOne(new QueryWrapper<TOperatorCity>()
                        .eq("name", jsonObject.getString("province"))
                        .eq("operatorId", data.getId()));
                // 省
                if (one1==null){
                    province.setName(jsonObject.getString("province"));
                    province.setCode(jsonObject.getInteger("provinceCode"));
                    province.setPid(0);
                    province.setType(jsonObject.getInteger("areaType"));
                    province.setOperatorId(data.getId());
                    city.setPid(province.getId());
                    operatorCityService.save(province);
                    // 市
                    if (!jsonObject.getString("city").equals("")){
                        city.setName(jsonObject.getString("city"));
                        city.setCode(jsonObject.getInteger("cityCode"));
            if (SinataUtil.isNotEmpty(comArr)){
                JSONArray jsonArray = JSON.parseArray(comArr);
                int size = jsonArray.size();
                for (int i = 0; i < size; i++) {
                    JSONObject jsonObject = jsonArray.getJSONObject(i);
                    TOperatorCity province = new TOperatorCity();
                    TOperatorCity city = new TOperatorCity();
                    TOperatorCity one1 = operatorCityService.getOne(new QueryWrapper<TOperatorCity>()
                            .eq("name", jsonObject.getString("province"))
                            .eq("operatorId", data.getId()));
                    // 省
                    if (one1==null){
                        province.setName(jsonObject.getString("province"));
                        province.setCode(jsonObject.getInteger("provinceCode"));
                        province.setPid(0);
                        province.setType(jsonObject.getInteger("areaType"));
                        province.setOperatorId(data.getId());
                        city.setPid(province.getId());
                        city.setType(jsonObject.getInteger("areaType"));
                        city.setOperatorId(data.getId());
                        operatorCityService.save(city);
                    }
                }else{
                    // 市
                    if (!jsonObject.getString("city").equals("")){
                        city.setName(jsonObject.getString("city"));
                        city.setCode(jsonObject.getInteger("cityCode"));
                        city.setPid(one1.getId());
                        city.setType(jsonObject.getInteger("areaType"));
                        city.setOperatorId(data.getId());
                        operatorCityService.save(city);
                        operatorCityService.save(province);
                        // 市
                        if (!jsonObject.getString("city").equals("")){
                            city.setName(jsonObject.getString("city"));
                            city.setCode(jsonObject.getInteger("cityCode"));
                            city.setPid(province.getId());
                            city.setType(jsonObject.getInteger("areaType"));
                            city.setOperatorId(data.getId());
                            operatorCityService.save(city);
                        }
                    }else{
                        // 市
                        if (!jsonObject.getString("city").equals("")){
                            city.setName(jsonObject.getString("city"));
                            city.setCode(jsonObject.getInteger("cityCode"));
                            city.setPid(one1.getId());
                            city.setType(jsonObject.getInteger("areaType"));
                            city.setOperatorId(data.getId());
                            operatorCityService.save(city);
                        }
                    }
                }
            }
        }
        }
        return ResultUtil.success("添加成功");
    }