Merge remote-tracking branch 'origin/master'
| | |
| | | Integer isForbidden = dao.queryForObject(" select COALESCE(STATUS,0) from Member where id = ?", Integer.class, memberId); |
| | | if(isForbidden== Constants.ONE){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已禁用,请联系管理员"); |
| | | } |
| | | if(isForbidden == Constants.TWO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户已注销,请联系管理员"); |
| | | } |
| | | Integer count = dao.queryForObject("select count(1) from Member where id = ?", Integer.class, memberId); |
| | | if (count != null && count > 0) { |
| | |
| | | |
| | | |
| | | |
| | | //对象类型 0商城订单 1积分流水 2优惠券发放 3过期提醒 4社区消息 |
| | | public enum NoticeType{ |
| | | NOTICE_ORDER_SEND(10,"商城订单",0,0,"订单已发货","您购买的商品订单:{param} 已发货"), |
| | | NOTICE_ORDER_WRITE_OFF(11,"商城订单",0,0,"订单已核销","您购买的商品订单:{param} 已核销"), |
| | | NOTICE_ORDER_REFUND(12,"商城订单",0,0,"订单已退款","您购买的商品订单:{param} 已退款"), |
| | | |
| | | // 0订单通知 1系统消息 2互动消息 3优惠券提醒 4官方客服 5活动推荐 6我的关注 |
| | | INTEGRAL_INVITE(20,"积分流水",1,0,"积分变动通知","邀请好友成功,获得{param}积分"), |
| | | |
| | | NOTICE_ORDER(0,"0订单通知","0订单通知"), |
| | | NOTICE_SYSTEM(1,"1系统消息","1系统消息"), |
| | | NOTICE_INTERACTION(2,"互动消息","互动消息"), |
| | | NOTICE_MEMBER_COUPON(3,"优惠券提醒","优惠券提醒"), |
| | | NOTICE_ACTIVITY(5,"活动推荐","活动推荐"), |
| | | NOTICE_MEMBER_FOLLOW(6,"我的关注","我的关注") |
| | | COUPON(30,"优惠券发放",2,0,"优惠券发放","已获得优惠券,{param}"), |
| | | |
| | | |
| | | EXPIRE_INTEGRAL(40,"积分过期提醒",3,0,"积分即将过期","您有{param}积分即将过期"), |
| | | EXPIRE_COUPON(41,"优惠券发放",3,0,"优惠券发放","您有{param}张优惠券将在{param2}过期"), |
| | | |
| | | COMMENT(50,"社区消息",4,1,"收到评论","{param}回复了您的评论"), |
| | | |
| | | ; |
| | | |
| | | private Integer key; |
| | | private String info; //消息名称 |
| | | private Integer objType; //对象类型 0商城订单 1积分流水 2优惠券发放 3过期提醒 4社区消息 |
| | | private Integer noticeType; //消息类型 0=系统消息;1=社区消息 |
| | | private String title;//标题 |
| | | private String content; //提示文案 |
| | | |
| | | private String type; |
| | | |
| | | private String content; |
| | | |
| | | NoticeType(Integer key, String type, String content) { |
| | | NoticeType(Integer key,String info, Integer objType, Integer noticeType,String title,String content) { |
| | | this.key = key; |
| | | this.type = type; |
| | | this.objType = objType; |
| | | this.noticeType = noticeType; |
| | | this.info = info; |
| | | this.title = title; |
| | | this.content = content; |
| | | } |
| | | |
| | | |
| | | public Integer getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(Integer key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | |
| | | public Integer getObjType() { |
| | | return objType; |
| | | } |
| | | |
| | | public void setObjType(Integer objType) { |
| | | this.objType = objType; |
| | | } |
| | | |
| | | |
| | | public Integer getNoticeType() { |
| | | return noticeType; |
| | | } |
| | | |
| | | public void setNoticeType(Integer noticeType) { |
| | | this.noticeType = noticeType; |
| | | } |
| | | |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | |
| | | |
| | | public String getContent() { |
| | | return content; |
| | | } |
| | | |
| | | public void setContent(String content) { |
| | | this.content = content; |
| | | } |
| | | |
| | | |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | + ")"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | insert.setApplyIds(coupon.getApplyIds()); |
| | | insert.setApplyType(coupon.getApplyType()); |
| | | insert.setCouponId(coupon.getId()); |
| | | insert.setMaxPrice(coupon.getMaxPrice()); |
| | | return insert; |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.core.utils.Constants; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | @ExcelColumn(name="对象编码") |
| | | private Integer objId; |
| | | |
| | | @ApiModelProperty(value = "对象类型 0商城订单 1积分流水 2互动评价 3优惠券 4现金流水", example = "1") |
| | | @ExcelColumn(name="对象类型 0商城订单 1积分流水 2互动评价 3优惠券 4现金流水") |
| | | @ApiModelProperty(value = "对象类型 0商城订单 1积分流水 2优惠券发放 3过期提醒 4社区消息", example = "1") |
| | | @ExcelColumn(name="对象类型 0商城订单 1积分流水 2优惠券发放 3过期提醒 4社区消息") |
| | | private Integer objType; |
| | | |
| | | @ApiModelProperty(value = "消息类型 0消费者消息;1=经销商消息;", example = "1") |
| | | @ExcelColumn(name="消息类型 0消费者消息;1=经销商消息;") |
| | | @ApiModelProperty(value = "消息类型 0=系统消息;1=社区消息", example = "1") |
| | | @ExcelColumn(name="消息类型 0=系统消息;1=社区消息") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "状态 0未读 1已读", example = "1") |
| | |
| | | @ApiModelProperty(value = "查询类型:0=系统消息;1=社区消息;", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer queryType; |
| | | |
| | | |
| | | |
| | | public Notice notice(Constants.NoticeType noticeType,Integer memberId,Integer objId){ |
| | | Notice notice = new Notice(); |
| | | notice.setCreateDate(new Date()); |
| | | notice.setIsdeleted(Constants.ZERO); |
| | | notice.setMemberId(memberId); |
| | | notice.setTitle(noticeType.getTitle()); |
| | | notice.setContent(noticeType.getContent()); |
| | | notice.setType(noticeType.getNoticeType()); |
| | | notice.setObjId(objId); |
| | | notice.setObjType(noticeType.getObjType()); |
| | | |
| | | |
| | | return notice; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.doumee.dao.web.request; |
| | | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.utils.Constants; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty(value = "备注") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "后端登录人") |
| | | private LoginUserInfo user; |
| | | |
| | | |
| | | } |
| | |
| | | * @param memberName |
| | | */ |
| | | void commonNotice(Integer memberId, Integer objId,String memberName ); |
| | | |
| | | |
| | | void autoRead(Integer memberId,Integer noticeType); |
| | | } |
| | |
| | | .selectAs(Labels::getParam,Activity::getParam) |
| | | .leftJoin(Labels.class,Labels::getId,Activity::getLabelId) |
| | | .eq(Activity::getIsdeleted,Constants.ZERO) |
| | | .eq(Activity::getStatus,Constants.ZERO) |
| | | .eq(Objects.nonNull(model.getLabelId()),Activity::getLabelId,model.getLabelId()) |
| | | .eq(Objects.nonNull(model.getBrandId()),Activity::getBrandId,model.getBrandId()) |
| | | .like(StringUtils.isNotBlank(model.getInfo()),Activity::getContent,model.getInfo()) |
| | |
| | | @Override |
| | | public List<BannerDTO> findShopBanner() { |
| | | Banner banner = new Banner(); |
| | | banner.setPosition(Constants.TWO); |
| | | banner.setPosition(Constants.ZERO); |
| | | banner.setIsdeleted(Constants.ZERO); |
| | | QueryWrapper<Banner> wrapper = new QueryWrapper<>(banner); |
| | | wrapper.lambda().orderByDesc(Banner::getSortnum); |
| | | List<Banner> banners = bannerMapper.selectList(wrapper); |
| | |
| | | List<MemberCoupon> memberCouponList = new ArrayList<>(); |
| | | List<CouponNoticeRequest> requestList = new ArrayList<>(); |
| | | for (JSONObject jsonObject:shareCouponRewardList) { |
| | | if(!jsonObject.containsKey("couponId")||!jsonObject.containsKey("num")){ |
| | | continue; |
| | | } |
| | | Integer couponId = jsonObject.getInteger("couponId"); |
| | | Integer num = jsonObject.getInteger("num"); |
| | | Coupon coupon = couponMapper.selectById(couponId); |
| | |
| | | } |
| | | MemberCoupon memberCoupon = MemberCoupon.couponToBean(coupon,inviteMember,new Date(),Constants.ONE,null); |
| | | for (int i = 0; i < num; i++) { |
| | | //满减卷不会生成maxPrice 需要根据优惠券减少金额设置 |
| | | if(Constants.equalsInteger(coupon.getCouponType(),Constants.ZERO)){ |
| | | memberCoupon.setMaxPrice(coupon.getPrice()); |
| | | } |
| | | memberCouponList.add(memberCoupon); |
| | | } |
| | | couponIds = couponIds + (StringUtils.isBlank(couponIds)? ",":"" )+ couponId ; |
| | |
| | | integral.setOrderCode(dealIntegralRequest.getOrderCode()); |
| | | integral.setUserType(Constants.ZERO); |
| | | integralMapper.insert(integral); |
| | | LoginUserInfo user =(LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | LoginUserInfo user = dealIntegralRequest.getUser(); |
| | | memberMapper.update(null,new UpdateWrapper<Member>().lambda() |
| | | .eq(Member::getId,member.getId()) |
| | | .set(Member::getEditDate,new Date()) |
| | |
| | | dealIntegralRequest.setMemberId(model.getId()); |
| | | dealIntegralRequest.setRemark(param.getRemark()); |
| | | dealIntegralRequest.setIntegralObjType(integralObjType); |
| | | dealIntegralRequest.setUser(user); |
| | | this.dealIntegral(dealIntegralRequest,model); |
| | | |
| | | }else{//经销商账户 |
| | |
| | | for(Member member : memberList){ |
| | | for (int i = 0; i < Constants.formatLongNum(param.getNum()); i++) { |
| | | MemberCoupon memberCoupon = MemberCoupon.couponToBean(coupon,member,now,Constants.TWO,loginUserInfo); |
| | | //满减卷不会生成maxPrice 需要根据优惠券减少金额设置 |
| | | if(Constants.equalsInteger(coupon.getCouponType(),Constants.ZERO)){ |
| | | memberCoupon.setMaxPrice(coupon.getPrice()); |
| | | } |
| | | //挨个送 |
| | | addList.add(memberCoupon); |
| | | } |
| | |
| | | AccountResponse accountResponse = new AccountResponse(); |
| | | if(Objects.nonNull(member)){ |
| | | memberMapper.updateById(member); |
| | | member.setImgFullUrl(systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.MEMBER_FILE).getCode()+member.getImgurl()); |
| | | //创建token |
| | | // JwtPayLoad payLoad = new JwtPayLoad(Constants.MEMBER_PREFIX+member.getId()); |
| | | // String token = JwtTokenUtil.generateToken(payLoad); |
| | | member.setImgFullUrl(StringUtils.isNotBlank(member.getImgurl())?systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.MEMBER_FILE).getCode()+member.getImgurl():null); |
| | | String token = JwtTokenUtil.generateTokenForRedis(member.getId(), Constants.ZERO, JSONObject.toJSONString(member), redisTemplate); |
| | | accountResponse.setToken(token); |
| | | accountResponse.setOpenid(openId); |
| | |
| | | } |
| | | |
| | | |
| | | // @Override |
| | | // public AccountResponse wxLoginTest( Integer memberId){ |
| | | // //创建token |
| | | //// JwtPayLoad payLoad = new JwtPayLoad(Constants.MEMBER_PREFIX+memberId); |
| | | //// String token = JwtTokenUtil.generateToken(payLoad); |
| | | // String token = JwtTokenUtil.generateTokenForRedis(memberId, Constants.ZERO, JSONObject.toJSONString(null), redisTemplate); |
| | | // AccountResponse accountResponse = new AccountResponse(); |
| | | // accountResponse.setToken(token); |
| | | // return accountResponse; |
| | | // } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public AccountResponse wxPhone(WxPhoneRequest wxPhoneRequest){ |
| | | try { |
| | | WxMaPhoneNumberInfo userPhoneInfo = WxMiniConfig.wxMaService.getUserService().getPhoneNumber(wxPhoneRequest.getCode()); |
| | |
| | | } |
| | | member.setIntegral(BigDecimal.ZERO); |
| | | member.setPhone(phone); |
| | | member.setStatus(Constants.ZERO); |
| | | } |
| | | member.setOpenId(wxPhoneRequest.getOpenid()); |
| | | member.setEditDate(new Date()); |
| | | member.setImgFullUrl(systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.MEMBER_FILE).getCode()+member.getImgurl()); |
| | | member.setImgFullUrl(StringUtils.isNotBlank(member.getImgurl())?systemDictDataBiz.queryByCode(Constants.OSS,Constants.RESOURCE_PATH).getCode()+ |
| | | systemDictDataBiz.queryByCode(Constants.OSS,Constants.MEMBER_FILE).getCode()+member.getImgurl():null); |
| | | if(Objects.isNull(member.getId())){ |
| | | memberMapper.insert(member); |
| | | PlatformConfigDTO platformConfigDTO = systemDictDataService.getPlatformConfigDTO(); |
| | | this.createRegionReward(member,platformConfigDTO); |
| | | //创建邀请记录 |
| | | this.createInviteRecord(member,platformConfigDTO); |
| | | // member.setSharingCode(this.createShareCode(member.getId())); |
| | | memberMapper.updateById(member); |
| | | }else{ |
| | | // if(StringUtils.isBlank(member.getSharingCode())){ |
| | | // member.setSharingCode(this.createShareCode(member.getId())); |
| | | // } |
| | | memberMapper.updateById(member); |
| | | } |
| | | if(Objects.nonNull(wxPhoneRequest.getShopId())){ |
| | |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(regCouponRewardList)){ |
| | | List<MemberCoupon> memberCouponList = new ArrayList<>(); |
| | | for (JSONObject jsonObject:regCouponRewardList) { |
| | | if(!jsonObject.containsKey("couponId")||!jsonObject.containsKey("num")){ |
| | | continue; |
| | | } |
| | | Integer couponId = jsonObject.getInteger("couponId"); |
| | | Integer num = jsonObject.getInteger("num"); |
| | | Coupon coupon = couponMapper.selectById(couponId); |
| | |
| | | } |
| | | MemberCoupon memberCoupon = MemberCoupon.couponToBean(coupon,member,new Date(),Constants.ZERO,null); |
| | | for (int i = 0; i < num; i++) { |
| | | //满减卷不会生成maxPrice 需要根据优惠券减少金额设置 |
| | | if(Constants.equalsInteger(coupon.getCouponType(),Constants.ZERO)){ |
| | | memberCoupon.setMaxPrice(coupon.getPrice()); |
| | | } |
| | | memberCouponList.add(memberCoupon); |
| | | } |
| | | } |
| | |
| | | dealIntegralRequest.setIntegralObjType(Constants.IntegralObjType.INVITENEWUSER); |
| | | dealIntegralRequest.setParam1(member.getNickname()); |
| | | integralService.dealIntegral(dealIntegralRequest,null); |
| | | //添加消息记录 |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.NoticeMapper; |
| | | import com.doumee.dao.business.join.MemberJoinMapper; |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void autoRead(Integer memberId,Integer noticeType){ |
| | | noticeMapper.update(new UpdateWrapper<Notice>().lambda() |
| | | .set(Notice::getStatus,Constants.ONE) |
| | | .set(Notice::getEditDate, DateUtil.getCurrDateTime()) |
| | | .eq(Notice::getMemberId,memberId) |
| | | .ne(Objects.nonNull(noticeType)&&Constants.equalsInteger(noticeType,Constants.ZERO),Notice::getObjType,Constants.TWO) |
| | | .eq(Objects.nonNull(noticeType)&&Constants.equalsInteger(noticeType,Constants.ONE),Notice::getObjType,Constants.TWO) |
| | | .eq(Notice::getStatus,Constants.ZERO) |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | * @param pageWrap 分页对象 |
| | | * @return PageData<Comment> |
| | | */ |
| | | @LoginRequired |
| | | @ApiOperation("分页活动探店评论回复查询") |
| | | @PostMapping("/findActivityReplyCommentDTOPage") |
| | | public ApiResponse<PageData<ActivityReplyCommentDTO>> findActivityReplyCommentDTOPage(@RequestBody PageWrap<CommentDTO> pageWrap){ |
| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "用户更新阅读状态", notes = "小程序端") |
| | | @GetMapping("/autoRead") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "用户token值", required = true), |
| | | @ApiImplicitParam(paramType = "query", dataType = "String", name = "noticeType", value = "消息类型:0=系统消息;1=社区消息", required = true) |
| | | }) |
| | | public ApiResponse autoRead(@RequestParam Integer noticeType){ |
| | | noticeService.autoRead(getMemberId(),noticeType); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | |
| | | |
| | | } |