| | |
| | | import cn.exrick.xboot.your.util.HttpUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import cn.hutool.json.JSONUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | if(one==null){ |
| | | return ResultUtil.error(openid);//首次登陆需绑定零售许可证 |
| | | }else { |
| | | one.setLoginNum(one.getLoginNum()+1); |
| | | iCustomerService.saveOrUpdate(one); |
| | | return ResultUtil.data(one,"登录成功"); |
| | | } |
| | | } |
| | |
| | | public static JSONObject getSessionKeyOrOpenId(String code){ |
| | | //微信端登录code |
| | | String wxCode = code; |
| | | String requestUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=wx0f10f6d253f3ee6b&secret=4d4cbc8da31a96559114ad693de70631&grant_type=authorization_code&js_code="+code; |
| | | String requestUrl = "https://api.weixin.qq.com/sns/jscode2session?appid=wx77c0d2c54010b7e4&secret=2282710e890670e916c189347d70a7c5&grant_type=authorization_code&js_code="+code; |
| | | JSONObject jsonObject = JSONUtil.parseObj( HttpUtil.get(requestUrl)); |
| | | return jsonObject; |
| | | } |
| | |
| | | String latestGps = haiKangPost.findLatestGps(carids); |
| | | JSONObject jsonObject = JSONUtil.parseObj(latestGps); |
| | | String data = jsonObject.getStr("data"); |
| | | JSONObject jsonObject2 = JSONUtil.parseObj(data); |
| | | JSONArray objects = JSONUtil.parseArray(data); |
| | | JSONObject jsonObject2 = objects.getJSONObject(0); |
| | | Integer lng = jsonObject2.getInt("longitude"); |
| | | Integer lat = jsonObject2.getInt("latitude"); |
| | | |