青羊经侦大队-数据平台
wl
2022-12-26 7560238de78178a8b8ecf21c0b490f2f8c55f967
src/main/java/com/example/jz/controller/WxAppController.java
@@ -17,6 +17,7 @@
import lombok.SneakyThrows;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
@@ -36,9 +37,11 @@
    private final String wxApp_accessToken_verify_url = "https://api.weixin.qq.com/cgi-bin/token";
    private final String appid = "wxebbb232d366dae09";
    @Value("${wx.appid}")
    private  String appid;
    private final String secret = "9a160c97c821eaa163240e8ec9185b77";
    @Value("${wx.secret}")
    private String secret;
    private final String js_code = "";
@@ -118,10 +121,12 @@
            role = user.getRole();
            id = user.getId();
        }
        User user1 = userDao.selectOne(new QueryWrapper<User>().eq("user_mobile", phone_info.getPurePhoneNumber()));
        HashMap<String, Object> loginMessage = new HashMap<>();
        loginMessage.put("id", id);
        loginMessage.put("token", token);
        loginMessage.put("role", role);
        loginMessage.put("time",user1.getUserIdcard());
        return R.ok(loginMessage);
    }
@@ -195,7 +200,7 @@
    @GetMapping("/user/group/list")
    public R getUserMessage(@RequestParam Integer id, @RequestParam String newDate, @RequestParam String lastDate) {
        ArrayList<Map<String, Object>> list = new ArrayList<>();
        reportService.list((new QueryWrapper<Report>().eq("user_id", id)))
        reportService.list((new QueryWrapper<Report>().eq("user_id", id)).groupBy("user_id"))
                .forEach(item ->
                        {
                            GroupUser groupUser = groupUserService.getOne(new QueryWrapper<GroupUser>().eq("user_id", item.getId()));
@@ -389,6 +394,9 @@
    @GetMapping("/group/user/sendMsg")
    public R sendUserMsg(@RequestParam Integer id, @RequestParam Integer groupId, @RequestParam String msg) {
        if (StringUtils.isBlank(msg)){
            return R.failed("msg is blank");
        }
        Message message = new Message();
        message.setUserId(id);
        message.setText(msg);