zjh
3 天以前 9cf381f93354a5f0fcaf14bd3ab118886d589f80
ltkj-admin/src/main/java/com/ltkj/web/controller/app/WxloginController.java
@@ -1,6 +1,7 @@
package com.ltkj.web.controller.app;
import cn.hutool.core.date.DateTime;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -135,6 +136,7 @@
        Wxuser wxuser = UserHoder.getWxuser();
        LambdaQueryWrapper<Wxuser> wq = new LambdaQueryWrapper<>();
        wq.eq(Wxuser::getOpenid, wxuser.getOpenid());
//        System.out.println("获取 ->"+wxuser.getOpenid());
        Wxuser one = wxuserService.getOne(wq);
        return AjaxResult.success(one);
    }
@@ -191,6 +193,23 @@
            }
        }
        return AjaxResult.success();
    }
    @PostMapping("/wx/bindPhoneV2")
    public AjaxResult bindPhoneV2(@RequestBody String json) {
        cn.hutool.json.JSONObject entries = JSONUtil.parseObj(json);
        String phone = entries.getStr("phone");
        Wxuser wxuser = UserHoder.getWxuser();
        LambdaQueryWrapper<Wxuser> wq = new LambdaQueryWrapper<>();
        wq.eq(Wxuser::getOpenid, wxuser.getOpenid());
        Wxuser one = wxuserService.getOne(wq);
//        System.out.println("绑定 ->"+wxuser.getOpenid()+",json = "+json);
        if (one != null){
            one.setPhone(phone);
            wxuserService.updateById(one);
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    /**
@@ -369,7 +388,7 @@
                LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>();
                qw.eq(TjCustomer::getCusPhone, phone);
                List<TjCustomer> tjCustomer1 = customerService.list(qw);
                if (tjCustomer1 != null && tjCustomer1.size()>0) {
                if (tjCustomer1 != null && !tjCustomer1.isEmpty()) {
                    for (TjCustomer tjCustomer : tjCustomer1) {
                        tjCustomer.setConnect(openId);
                        customerService.updateById(tjCustomer);