| | |
| | | import com.doumee.dao.business.NoticeMapper; |
| | | import com.doumee.dao.business.join.MemberJoinMapper; |
| | | import com.doumee.dao.business.join.NoticeJoinMapper; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.MemberCoupon; |
| | | import com.doumee.dao.business.model.Notice; |
| | | import com.doumee.dao.business.model.Shop; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.web.dto.NoticeCardDTO; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.dao.web.request.CouponNoticeRequest; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | |
| | | /** |
| | | * |
| | | * @param type 0消费者;1=经销商积分;2=经销商结算金额 |
| | | * @param type 0消费者;1=经销商; |
| | | * @param objType 0商城订单 1积分流水 2互动评价 3优惠券 |
| | | * |
| | | */ |
| | |
| | | notice.setObjType(objType); |
| | | notice.setObjId(objId); |
| | | notice.setMemberId(memberId); |
| | | notice.setStatus(Constants.ZERO); |
| | | noticeMapper.insert(notice); |
| | | } |
| | | |
| | |
| | | * @param objId 关联对象主键 - 积分流水变动记录主键 |
| | | * @param param1 param2 |
| | | */ |
| | | public void saveMemberIntegralNotice(Constants.IntegralObjType integralObjType,Integer type, Integer memberId, Integer integral, Integer objId,String param1){ |
| | | @Override |
| | | public void saveMemberIntegralNotice(Constants.IntegralObjType integralObjType,Integer type, |
| | | Integer memberId, |
| | | BigDecimal integral, |
| | | Integer objId,String param1){ |
| | | String title = integralObjType.getName(); |
| | | String info = integralObjType.getNoteinfo(); |
| | | info = info.replace("${param}",integral.toString()).replace("${param1}",param1); |
| | |
| | | ); |
| | | } |
| | | |
| | | /** |
| | | * 发放优惠券 |
| | | * @param memberId |
| | | * @param couponList |
| | | */ |
| | | public void couponNotice(Integer memberId,List<CouponNoticeRequest> couponList){ |
| | | String info = "恭喜您获得【优惠规则】【优惠券类型】"; |
| | | String noticeInfo = "恭喜您获得${param}"; |
| | | //恭喜您获得 满50减10抵扣券 |
| | | String replaceInfo = ""; |
| | | for (CouponNoticeRequest c:couponList) { |
| | | MemberCoupon mc = c.getMemberCoupon(); |
| | | Constants.equalsInteger(mc.getCouponType(),Constants.ZERO)? |
| | | String info = Constants.equalsInteger(mc.getCouponType(),Constants.ZERO)? |
| | | "满"+mc.getLimitPrice()+"元减"+mc.getPrice()+"元抵扣券*"+c.getNum(): |
| | | "满"+mc.getLimitPrice()+"元享"+mc.getPrice()+"折券"; |
| | | replaceInfo = replaceInfo + (StringUtils.isBlank(replaceInfo)? |
| | | info:","+info); |
| | | } |
| | | noticeInfo.replace("${param}",replaceInfo); |
| | | |
| | | |
| | | |
| | | |
| | | this.saveNoticeInfo( |
| | | Constants.ZERO, |
| | | Constants.ONE, |
| | | memberId, |
| | | "获得系统发放的优惠券", |
| | | noticeInfo, |
| | | null |
| | | ); |
| | | } |
| | | |
| | | |
| | | // this.saveNoticeInfo( |
| | | // type, |
| | | // Constants.ONE, |
| | | // memberId, |
| | | // "获得系统发放的优惠券", |
| | | // info, |
| | | // objId |
| | | // ); |
| | | // |
| | | |
| | | |
| | | public void expireNotice(Integer memberId, BigDecimal integral,Integer expireDateNum){ |
| | | //您有1000积分30天后过期,请尽快使用 |
| | | String noticeInfo = "您有${param}积分即将过期,请尽快使用"; |
| | | if(integral.compareTo(BigDecimal.ZERO)<=Constants.ZERO){ |
| | | return; |
| | | } |
| | | noticeInfo.replace("${param}",integral.toString()); |
| | | this.saveNoticeInfo( |
| | | Constants.ZERO, |
| | | Constants.ONE, |
| | | memberId, |
| | | "您的积分将在"+expireDateNum+"天后清空,请尽快使用", |
| | | noticeInfo, |
| | | null |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | public void commonNotice(Integer memberId, Integer objId,String memberName ){ |
| | | //您有1000积分30天后过期,请尽快使用 |
| | | String noticeInfo = "${param}回复了您的评论"; |
| | | noticeInfo.replace("${param}",memberName); |
| | | this.saveNoticeInfo( |
| | | Constants.ZERO, |
| | | Constants.TWO, |
| | | memberId, |
| | | noticeInfo, |
| | | noticeInfo, |
| | | null |
| | | ); |
| | | } |
| | | |
| | | public void orderPayNotice(Integer shopId, Integer objId,Integer receiveType){ |
| | | if(Constants.equalsInteger(receiveType,Constants.ZERO)){ |
| | | return; |
| | | } |
| | | //您有新的【发货方式】订单待处理 |
| | | String noticeInfo = "您有新的${param}订单待处理"; |
| | | noticeInfo.replace("${param}",Constants.equalsInteger(receiveType,Constants.ZERO)?"物流发货":"门店自提"); |
| | | this.saveNoticeInfo( |
| | | Constants.ONE, |
| | | Constants.ZERO, |
| | | shopId, |
| | | noticeInfo, |
| | | noticeInfo, |
| | | objId |
| | | ); |
| | | } |
| | | |
| | | |
| | | public void orderCancelNotice(Integer shopId, Integer objId,String orderNo){ |
| | | // 您的订单{订单号},已由客户手动取消,请知悉 |
| | | String noticeInfo = " 您的订单${param},已由客户手动取消,请知悉"; |
| | | noticeInfo.replace("${param}",orderNo); |
| | | this.saveNoticeInfo( |
| | | Constants.ONE, |
| | | Constants.ZERO, |
| | | shopId, |
| | | noticeInfo, |
| | | noticeInfo, |
| | | objId |
| | | ); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |