| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.TNoticesMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TUseMoneyMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | @Autowired |
| | | private IInviteService inviteService; |
| | | @Autowired |
| | | private TNoticesMapper noticesMapper; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/user/allert") |
| | | @ApiOperation(value = "获取公告弹窗", tags = {"司机端-2.0新增"}, notes = "") |
| | | public ResultUtil<List<TNotices>> allert(){ |
| | | try { |
| | | List<TNotices> tNotices = noticesMapper.selectList(new EntityWrapper<TNotices>() |
| | | .eq("type", 2).eq("isDriver",2) |
| | | .eq("isShow", 1).ne("flag", 3).eq("isAlert",1).eq("isDelete", 1) |
| | | ); |
| | | return ResultUtil.success(tNotices); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | /** |
| | | * 获取用户邀请二维码 |
| | | * @param request |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/api/auser/testCode") |
| | | @ApiOperation(value = "测试小程序二维码", tags = {"司机端-2.0新增"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil testCode(){ |
| | | String s = driverService.generateQrCodeTemp(); |
| | | return ResultUtil.success(s); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 获取用户邀请二维码 |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 通知 |
| | | * <p> |
| | | * 发布公告和滚动消息 |
| | | * </p> |
| | | * |
| | | * @author 吕雪 |
| | | * @since 2020-06-10 |
| | | */ |
| | | @TableName("t_notices") |
| | | public class TNotices extends BaseBean { |
| | | @Data |
| | | public class TNotices extends Model<TNotices> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 标题 |
| | | */ |
| | | @TableField("title") |
| | | private String title; |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @TableField("content") |
| | | private String content; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | @TableField("sort") |
| | | private Integer sort; |
| | | /** |
| | | * 是否显示/发布(1=是,2=否) |
| | | */ |
| | | @TableField("isShow") |
| | | private Integer isShow; |
| | | /** |
| | | * 是否首页弹框(1=否,2=是) |
| | | */ |
| | | private Integer isAlert; |
| | | /** |
| | | * 是否播报(1=是,2=否) |
| | | */ |
| | | @TableField("isBroadcast") |
| | | private Integer isBroadcast; |
| | | /** |
| | | * 公告类型(1=滚动消息,2=公告) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 图片地址 |
| | | * 图片路径 |
| | | */ |
| | | @TableField("imgUrl") |
| | | private String imgUrl; |
| | | /** |
| | | * 1:创建,2:修改,3:删除 |
| | | */ |
| | | private String flag; |
| | | private Date insertTime; |
| | | private Integer insertUser; |
| | | private Date updateTime; |
| | | private Integer updateUser; |
| | | /** |
| | | * 是否删除 1=否 2=是 |
| | | */ |
| | | private Integer isDelete; |
| | | /** |
| | | * 是否发布用户 1=否 2=是 |
| | | */ |
| | | private Integer isUser; |
| | | /** |
| | | * 是否发布司机 1=否 2=是 |
| | | */ |
| | | private Integer isDriver; |
| | | |
| | | public Integer getIsUser() { |
| | | return isUser; |
| | | } |
| | | |
| | | public void setIsUser(Integer isUser) { |
| | | this.isUser = isUser; |
| | | } |
| | | |
| | | public Integer getIsDriver() { |
| | | return isDriver; |
| | | } |
| | | |
| | | public void setIsDriver(Integer isDriver) { |
| | | this.isDriver = isDriver; |
| | | } |
| | | |
| | | public Integer getIsDelete() { |
| | | return isDelete; |
| | | } |
| | | |
| | | public void setIsDelete(Integer isDelete) { |
| | | this.isDelete = isDelete; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | |
| | | this.imgUrl = imgUrl; |
| | | } |
| | | |
| | | public String getFlag() { |
| | | return flag; |
| | | } |
| | | |
| | | public void setFlag(String flag) { |
| | | this.flag = flag; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | public Integer getInsertUser() { |
| | | return insertUser; |
| | | } |
| | | |
| | | public void setInsertUser(Integer insertUser) { |
| | | this.insertUser = insertUser; |
| | | } |
| | | |
| | | public Date getUpdateTime() { |
| | | return updateTime; |
| | | } |
| | | |
| | | public void setUpdateTime(Date updateTime) { |
| | | this.updateTime = updateTime; |
| | | } |
| | | |
| | | public Integer getUpdateUser() { |
| | | return updateUser; |
| | | } |
| | | |
| | | public void setUpdateUser(Integer updateUser) { |
| | | this.updateUser = updateUser; |
| | | } |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "TNotice{" + |
| | | "title='" + title + '\'' + |
| | | ", content='" + content + '\'' + |
| | | return "TNotices{" + |
| | | "id=" + id + |
| | | ", title=" + title + |
| | | ", content=" + content + |
| | | ", sort=" + sort + |
| | | ", isShow=" + isShow + |
| | | ", isBroadcast=" + isBroadcast + |
| | | ", type=" + type + |
| | | ", imgUrl='" + imgUrl + '\'' + |
| | | '}'; |
| | | ", imgUrl=" + imgUrl + |
| | | ", flag=" + flag + |
| | | ", insertTime=" + insertTime + |
| | | ", insertUser=" + insertUser + |
| | | ", updateTime=" + updateTime + |
| | | ", updateUser=" + updateUser + |
| | | "}"; |
| | | } |
| | | } |
| | |
| | | param.put("check_path", false); |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+userInfo.getId()+"userType=2"); |
| | | param.put("env_version", "trial"); |
| | | param.put("env_version", "release"); |
| | | param.put("width", 200); //二维码尺寸 |
| | | param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | | param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效 |
| | |
| | | InputStream inputStream = null; |
| | | OutputStream outputStream = null; |
| | | try { |
| | | String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken; |
| | | String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken; |
| | | Map<String, Object> param = new HashMap<>(); |
| | | // param.put("page", "pageA/houseDetail"); |
| | | param.put("check_path", false); |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+1+"userType=1"); |
| | | // param.put("env_version", "trial"); |
| | | // param.put("width", 200); //二维码尺寸 |
| | | // param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | | // param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效 |
| | | // Map<String, Object> line_color = new HashMap<>(); |
| | | // line_color.put("r", 0); |
| | | // line_color.put("g", 0); |
| | | // line_color.put("b", 0); |
| | | // param.put("line_color", line_color); |
| | | param.put("path", "pages/home/home?uid=1userType=2"); |
| | | System.err.println("调用生成微信URL接口传参:" + param); |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | |
| | | MultipartFile file = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(), byteArrayInputStream); |
| | | String pictureName = OssUploadUtil.ossUploadCode(file,finalFileName); |
| | | System.err.println(pictureName); |
| | | return Base64.encodeBase64String(result); |
| | | return pictureName; |
| | | |
| | | } catch (Exception e) { |
| | | System.err.println("调用小程序生成微信永久小程序码URL接口异常" + e); |
| | |
| | | public class OssUploadUtil { |
| | | //OSS图片访问域名 |
| | | public static String oss_domain = "https://xv95128.oss-cn-wuhan-lr.aliyuncs.com/"; |
| | | public static String oss_domain_cdn = "http://cdn.xn95128.cn/"; |
| | | public static String oss_domain_cdn = "https://cdn.xn95128.cn/"; |
| | | public static String accessKeyId = "LTAI5tEQarpMqRDNnSuj2mCE"; |
| | | public static String accessKeySecret = "6lBQHFh4XRaIytR5mQ6wDjAbIWmDok"; |
| | | public static String bucketName="xv95128"; |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TSystemNotice; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | import com.stylefeng.guns.modular.system.util.JpushUtil; |
| | | import com.stylefeng.guns.modular.system.util.task.base.QuartzManager; |
| | | import com.stylefeng.guns.modular.system.util.task.base.TimeJobType; |
| | | import com.stylefeng.guns.modular.system.util.task.jobs.AddNotice; |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | @Autowired |
| | | private ITUserService tUserService; |
| | | |
| | | @Autowired |
| | | private ITSystemNoticeService noticeService; |
| | | /** |
| | | * 新增系统公告 |
| | | */ |
| | |
| | | tNotices.setIsUser(isUser); |
| | | tNotices.setIsDriver(isDriver); |
| | | tNoticesService.insert(tNotices); |
| | | if (tNotices.getIsUser() == 2){ |
| | | List<TUser> tUsers = tUserService.selectList(new EntityWrapper<TUser>().eq("state",1) |
| | | .ne("flag",3)); |
| | | //发送公告给用户 |
| | | for (TUser user : tUsers){ |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(1); |
| | | notice.setUserType(1); |
| | | notice.setNoticesId(tNotices.getId()); |
| | | notice.setContent(tNotices.getContent()); |
| | | notice.setUserId(user.getId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | noticeService.insert(notice); |
| | | |
| | | /*Map<String,Object> map = new HashMap<String,Object>(); |
| | | map.put("sound", userInfo.getIsVoice()); //是否有声音 1=否 2=是 |
| | | map.put("vibrate", userInfo.getIsShake()); //是否有震动 1=否 2=是 |
| | | map.put("type", 2); //消息类型 1=互动 2=公告 |
| | | map.put("id", record.getId()); //对象ID |
| | | JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ |
| | | } |
| | | } |
| | | if (tNotices.getIsDriver() == 2){ |
| | | List<TDriver> tDrivers = driverService.selectList(new EntityWrapper<TDriver>().eq("authState",2) |
| | | .ne("flag",3)); |
| | | //发送公告给用户 |
| | | for (TDriver driver : tDrivers){ |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(1); |
| | | notice.setUserType(2); |
| | | notice.setNoticesId(tNotices.getId()); |
| | | notice.setContent(tNotices.getContent()); |
| | | notice.setUserId(driver.getId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | noticeService.insert(notice); |
| | | |
| | | /*Map<String,Object> map = new HashMap<String,Object>(); |
| | | map.put("sound", userInfo.getIsVoice()); //是否有声音 1=否 2=是 |
| | | map.put("vibrate", userInfo.getIsShake()); //是否有震动 1=否 2=是 |
| | | map.put("type", 2); //消息类型 1=互动 2=公告 |
| | | map.put("id", record.getId()); //对象ID |
| | | JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ |
| | | |
| | | // if (tNotices.getIsBroadcast() == 1){ |
| | | // //增加极光推送 |
| | | // JpushUtil.SendPushWithCustomForSh("DRIVER"+driver.getId().toString(),tNotices.getTitle(),"通知消息",null); |
| | | // } |
| | | |
| | | } |
| | | } |
| | | if (tNotices.getIsShow() == 1){ //发布 |
| | | //定时1秒后执行 |
| | | Map<String,Object> maps=new HashMap<>(); |
| | |
| | | System.err.println(("----定时1秒后生成公告记录-----")); |
| | | TNotices tNotices = tNoticesService.selectById(noticeId); |
| | | if (SinataUtil.isNotEmpty(tNotices)){ |
| | | if (tNotices.getIsUser() == 2){ |
| | | List<TUser> tUsers = tUserService.selectList(new EntityWrapper<TUser>().eq("state",1)); |
| | | //发送公告给用户 |
| | | for (TUser user : tUsers){ |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(1); |
| | | notice.setUserType(1); |
| | | notice.setNoticesId(noticeId); |
| | | notice.setContent(tNotices.getContent()); |
| | | notice.setUserId(user.getId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | tSystemNoticeService.insert(notice); |
| | | |
| | | /*Map<String,Object> map = new HashMap<String,Object>(); |
| | | map.put("sound", userInfo.getIsVoice()); //是否有声音 1=否 2=是 |
| | | map.put("vibrate", userInfo.getIsShake()); //是否有震动 1=否 2=是 |
| | | map.put("type", 2); //消息类型 1=互动 2=公告 |
| | | map.put("id", record.getId()); //对象ID |
| | | JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ |
| | | } |
| | | } |
| | | if (tNotices.getIsDriver() == 2){ |
| | | List<TDriver> tDrivers = tDriverService.selectList(new EntityWrapper<TDriver>().eq("authState",2)); |
| | | //发送公告给用户 |
| | | for (TDriver driver : tDrivers){ |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(1); |
| | | notice.setUserType(2); |
| | | notice.setNoticesId(noticeId); |
| | | notice.setContent(tNotices.getContent()); |
| | | notice.setUserId(driver.getId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | tSystemNoticeService.insert(notice); |
| | | |
| | | /*Map<String,Object> map = new HashMap<String,Object>(); |
| | | map.put("sound", userInfo.getIsVoice()); //是否有声音 1=否 2=是 |
| | | map.put("vibrate", userInfo.getIsShake()); //是否有震动 1=否 2=是 |
| | | map.put("type", 2); //消息类型 1=互动 2=公告 |
| | | map.put("id", record.getId()); //对象ID |
| | | JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ |
| | | |
| | | if (tNotices.getIsBroadcast() == 1){ |
| | | //增加极光推送 |
| | | JpushUtil.SendPushWithCustomForSh("DRIVER"+driver.getId().toString(),tNotices.getTitle(),"通知消息",null); |
| | | } |
| | | |
| | | } |
| | | } |
| | | // if (tNotices.getIsUser() == 2){ |
| | | // List<TUser> tUsers = tUserService.selectList(new EntityWrapper<TUser>().eq("state",1)); |
| | | // //发送公告给用户 |
| | | // for (TUser user : tUsers){ |
| | | // TSystemNotice notice = new TSystemNotice(); |
| | | // notice.setType(1); |
| | | // notice.setUserType(1); |
| | | // notice.setNoticesId(noticeId); |
| | | // notice.setContent(tNotices.getContent()); |
| | | // notice.setUserId(user.getId()); |
| | | // notice.setInsertTime(new Date()); |
| | | // notice.setRead(1); |
| | | // tSystemNoticeService.insert(notice); |
| | | // |
| | | // /*Map<String,Object> map = new HashMap<String,Object>(); |
| | | // map.put("sound", userInfo.getIsVoice()); //是否有声音 1=否 2=是 |
| | | // map.put("vibrate", userInfo.getIsShake()); //是否有震动 1=否 2=是 |
| | | // map.put("type", 2); //消息类型 1=互动 2=公告 |
| | | // map.put("id", record.getId()); //对象ID |
| | | // JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ |
| | | // } |
| | | // } |
| | | // if (tNotices.getIsDriver() == 2){ |
| | | // List<TDriver> tDrivers = tDriverService.selectList(new EntityWrapper<TDriver>().eq("authState",2)); |
| | | // //发送公告给用户 |
| | | // for (TDriver driver : tDrivers){ |
| | | // TSystemNotice notice = new TSystemNotice(); |
| | | // notice.setType(1); |
| | | // notice.setUserType(2); |
| | | // notice.setNoticesId(noticeId); |
| | | // notice.setContent(tNotices.getContent()); |
| | | // notice.setUserId(driver.getId()); |
| | | // notice.setInsertTime(new Date()); |
| | | // notice.setRead(1); |
| | | // tSystemNoticeService.insert(notice); |
| | | // |
| | | // /*Map<String,Object> map = new HashMap<String,Object>(); |
| | | // map.put("sound", userInfo.getIsVoice()); //是否有声音 1=否 2=是 |
| | | // map.put("vibrate", userInfo.getIsShake()); //是否有震动 1=否 2=是 |
| | | // map.put("type", 2); //消息类型 1=互动 2=公告 |
| | | // map.put("id", record.getId()); //对象ID |
| | | // JpushUtil.SendPushWithCustomForTransmission(String.valueOf(userInfo.getId()),"【超级过客】提醒您,您有一条新的公告消息。","通知消息",map);*/ |
| | | // |
| | | // if (tNotices.getIsBroadcast() == 1){ |
| | | // //增加极光推送 |
| | | // JpushUtil.SendPushWithCustomForSh("DRIVER"+driver.getId().toString(),tNotices.getTitle(),"通知消息",null); |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | @ApiImplicitParam(value = "头像", name = "avatar", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "昵称", name = "nickName", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "登录端口-小程序传Applets", name = "loginType", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "性别(1=男,2=女)", name = "sex", required = false, dataType = "int") |
| | | @ApiImplicitParam(value = "性别(1=男,2=女)", name = "sex", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "手机号 获取微信号用", name = "phone", required = false, dataType = "String") |
| | | |
| | | }) |
| | | public ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, String registAreaCode, Integer sex, String nickName, String avatar,String loginType |
| | | ,Integer uid,Integer userType){ |
| | | ,Integer uid,Integer userType,String phone){ |
| | | try { |
| | | return userInfoService.wxLogin(type, openid, unionid, jscode, registIp, registAreaCode, sex, nickName, avatar,loginType,uid,userType); |
| | | return userInfoService.wxLogin(type, openid, unionid, jscode, registIp, registAreaCode, sex, nickName, avatar,loginType,uid,userType,phone); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | * @return |
| | | */ |
| | | ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, String registAreaCode, Integer sex, String nickName, String avatar,String loginType |
| | | ,Integer uid ,Integer userType |
| | | ,Integer uid ,Integer userType,String phone |
| | | ) throws Exception; |
| | | |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.LinkedMultiValueMap; |
| | | import org.springframework.util.MultiValueMap; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | @Override |
| | | public ResultUtil<LoginWarpper> wxLogin(Integer type, String openid, String unionid, String jscode, String registIp, |
| | | String registAreaCode, Integer sex, String nickName, String avatar,String loginType, |
| | | Integer uid,Integer userType) throws Exception { |
| | | Integer uid,Integer userType,String phone) throws Exception { |
| | | System.err.println("手机号+++++"+phone); |
| | | UserInfo userInfo = null; |
| | | if(type == 2){//小程序 |
| | | if(ToolUtil.isEmpty(jscode)){ |
| | |
| | | System.out.println("unionid===="+unionid); |
| | | userInfo = userInfoMapper.queryByOpenid2(openid); |
| | | |
| | | |
| | | }else{//APP |
| | | userInfo = userInfoMapper.queryByOpenid(openid); |
| | | } |
| | | if (StringUtils.hasLength(phone)){ |
| | | UserInfo userInfo1 = userInfoMapper.queryByPhone(phone); |
| | | if (null != userInfo1){ |
| | | userInfo = userInfo1; |
| | | userInfo.setAppletsOpenId(openid); |
| | | } |
| | | } |
| | | if(null == userInfo){ |
| | | |
| | | // 如果为空 需要生成小程序二维码并携带用户id |
| | | userInfo = new UserInfo(); |
| | | userInfo.setPassWord(ShiroKit.md5("", salt)); |
| | |
| | | // 用户id 用于分享 |
| | | param.put("scene", "uid="+userInfo.getId()+"userType=1"); |
| | | |
| | | param.put("env_version", "trial");// 体验版 |
| | | // param.put("env_version", "release");// 正式版 |
| | | // param.put("env_version", "trial");// 体验版 |
| | | param.put("env_version", "release");// 正式版 |
| | | param.put("width", 200); //二维码尺寸 |
| | | param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效 |
| | | param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效 |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 设置手机号码操作 |
| | | * @param uid |
| | |
| | | this.updateById(userInfo); |
| | | |
| | | smsrecordService.saveData(2, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | | List<Invite> invites = inviteMapper.selectList(null); |
| | | List<UserInfo> userInfos = this.selectList(null); |
| | | List<Integer> integers = new ArrayList<>(); |
| | | for (Invite invite : invites) { |
| | | UserInfo userInfo2 = userInfos.stream().filter(e -> e.getId().equals(invite.getUserId())).findFirst().orElse(null); |
| | | if (userInfo2==null){ |
| | | integers.add(invite.getId()); |
| | | } |
| | | } |
| | | if (!integers.isEmpty()){ |
| | | inviteMapper.deleteBatchIds(integers); |
| | | } |
| | | return ResultUtil.success(new LoginWarpper()); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | public String getDefaultName(){ |
| | | int num = this.selectCount(new EntityWrapper<UserInfo>().ne("flag", 3)) + 1000001; |
| | | int num = this.selectCount(new EntityWrapper<UserInfo>()) + 1000001; |
| | | return "XN" + String.valueOf(num).substring(1); |
| | | } |
| | | |
| | |
| | | public class OssUploadUtil { |
| | | //OSS图片访问域名 |
| | | public static String oss_domain = "https://xv95128.oss-cn-wuhan-lr.aliyuncs.com/"; |
| | | public static String oss_domain_cdn = "http://cdn.xn95128.cn/"; |
| | | public static String oss_domain_cdn = "https://cdn.xn95128.cn/"; |
| | | public static String accessKeyId = "LTAI5tEQarpMqRDNnSuj2mCE"; |
| | | public static String accessKeySecret = "6lBQHFh4XRaIytR5mQ6wDjAbIWmDok"; |
| | | public static String bucketName="xv95128"; |