admin
2019-02-27 7d294e1e04095eb4f1c0807406d1ccb8461850cb
券消息修改
6个文件已修改
199 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgOtherCouponContentDTO.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherCouponContentDTOFactory.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dto/msg/MsgOtherCouponContentDTO.java
@@ -1,5 +1,7 @@
package com.yeshi.fanli.dto.msg;
import java.math.BigDecimal;
/**
 * 其他消息里面的券相关的内容
 * 
@@ -9,6 +11,12 @@
public class MsgOtherCouponContentDTO {
    private String state;
    private String source;// 来源
    private String orderId;// 订单号
    private String desc;// 说明
    private BigDecimal fanLiMoney;
    private String startTime;
    private String endTime;
    private Integer leftDay;
@@ -53,4 +61,28 @@
        this.leftDay = leftDay;
    }
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    public String getDesc() {
        return desc;
    }
    public void setDesc(String desc) {
        this.desc = desc;
    }
    public BigDecimal getFanLiMoney() {
        return fanLiMoney;
    }
    public void setFanLiMoney(BigDecimal fanLiMoney) {
        this.fanLiMoney = fanLiMoney;
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.service.impl.msg;
import java.math.BigDecimal;
import java.util.Date;
import javax.annotation.Resource;
@@ -8,6 +9,7 @@
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
import com.yeshi.fanli.entity.bus.msg.MsgOtherDetail.MsgTypeOtherTypeEnum;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.exception.msg.MsgOtherDetailException;
import com.yeshi.fanli.service.inter.msg.MsgOtherDetailService;
@@ -41,49 +43,49 @@
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "至少成功邀请1个队员后可激活"));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
    @Override
    public void welfareCouponActive(UserSystemCoupon coupon) {
    public void welfareCouponActive(UserSystemCoupon coupon, UserInfo worker) {
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponActive(getLeftDay(coupon),
                coupon.getStartTime(), coupon.getEndTime());
                "成功邀请队员:" + worker.getNickName(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "可在首页-免单商品-选择商品-使用"));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
    @Override
    public void welfareCouponUsing(UserSystemCoupon coupon) {
    public void welfareCouponUsing(UserSystemCoupon coupon,String orderId,BigDecimal money) {
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsing(coupon.getStartTime(),
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsing(orderId,money,coupon.getStartTime(),
                coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "实付款-返利=0元购(免单)"));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
    @Override
    public void welfareCouponUsed(UserSystemCoupon coupon) {
    public void welfareCouponUsed(UserSystemCoupon coupon,String orderId) {
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsed(getLeftDay(coupon),
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsed(getLeftDay(coupon),"实付款-返利=0元购(免单)",
                coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "参与其他活动可获得更多免单券"));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -97,7 +99,7 @@
                .createWelfareCouponWillOutOfDate(getLeftDay(coupon), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "至少成功邀请1个队员后可激活"));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -111,7 +113,21 @@
                .createWelfareCouponAlreadyOutOfDate(coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "参与其他活动可获得更多免单券"));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
    @Override
    public void welfareCouponDrawBack(UserSystemCoupon coupon,String orderId) {
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
                .createWelfareCouponAlreadyOutOfDate(coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, "退回后依然可在有效期内使用"));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -122,20 +138,6 @@
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponGet(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
    @Override
    public void freeSheetCouponActive(UserSystemCoupon coupon) {
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponActive(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
@@ -216,20 +218,6 @@
    }
    @Override
    public void rewardCouponActive(UserSystemCoupon coupon) {
        if (coupon == null || coupon.getUid() == null)
            return;
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponActive(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
    }
    @Override
    public void rewardCouponUsed(UserSystemCoupon coupon) {
        if (coupon == null || coupon.getUid() == null)
            return;
@@ -271,4 +259,10 @@
        }
    }
    @Override
    public void freeSheetCouponDrawBack(UserSystemCoupon coupon) {
        // TODO Auto-generated method stub
    }
}
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -570,7 +570,7 @@
        // 消息推送
        try {
            if (baseCoupon.getType() != CouponTypeEnum.welfareFreeCoupon) {
                userOtherMsgNotificationService.welfareCouponUsing(userSystemCoupon);
//                userOtherMsgNotificationService.welfareCouponUsing(userSystemCoupon,order);
            } else if (baseCoupon.getType() != CouponTypeEnum.freeCoupon) {
                userOtherMsgNotificationService.freeSheetCouponUsing(userSystemCoupon);
            }
@@ -1205,7 +1205,7 @@
                    // 券已使用
                    userOtherMsgNotificationService.freeSheetCouponUsed(userSystemCoupon);
                } else     if (baseCoupon.getType() != CouponTypeEnum.welfareFreeCoupon) {
                    userOtherMsgNotificationService.welfareCouponUsed(userSystemCoupon);
                    userOtherMsgNotificationService.welfareCouponUsing(userSystemCoupon,orderNo,payment);
                } else if (baseCoupon.getType() != CouponTypeEnum.freeCoupon) {
                    userOtherMsgNotificationService.freeSheetCouponUsed(userSystemCoupon);
                } 
fanli/src/main/java/com/yeshi/fanli/service/inter/msg/UserOtherMsgNotificationService.java
@@ -1,5 +1,8 @@
package com.yeshi.fanli.service.inter.msg;
import java.math.BigDecimal;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
/**
@@ -29,7 +32,7 @@
     * @param startTime
     * @param endTime
     */
    public void welfareCouponActive(UserSystemCoupon coupon);
    public void welfareCouponActive(UserSystemCoupon coupon,UserInfo worker);
    /**
     * 福利免单券使用中
@@ -37,7 +40,7 @@
     * @param startTime
     * @param endTime
     */
    public void welfareCouponUsing(UserSystemCoupon coupon);
    public void welfareCouponUsing(UserSystemCoupon coupon,String orderId,BigDecimal money);
    /**
     * 福利免单券已被使用
@@ -46,7 +49,7 @@
     * @param startTime
     * @param endTime
     */
    public void welfareCouponUsed(UserSystemCoupon coupon);
    public void welfareCouponUsed(UserSystemCoupon coupon,String orderId);
    /**
     * 福利免单券即将过期
@@ -60,10 +63,16 @@
    /**
     * 福利免单券已经过期
     * 
     * @param startTime
     * @param endTime
     * @param coupon
     */
    public void welfareCouponAlreadyOutOfDate(UserSystemCoupon coupon);
    /**
     * 福利免单券已经退回
     * @param coupon
     */
    public void welfareCouponDrawBack(UserSystemCoupon coupon,String orderId);
    // 免单券
@@ -76,16 +85,6 @@
     * @param endTime
     */
    public void freeSheetCouponGet(UserSystemCoupon coupon);
    /**
     * 免单券激活
     *
     * @param leftDay
     * @param source
     * @param startTime
     * @param endTime
     */
    public void freeSheetCouponActive(UserSystemCoupon coupon);
    /**
     * 免单券正在使用
@@ -124,6 +123,12 @@
     * @param endTime
     */
    public void freeSheetCouponAlreadyOutOfDate(UserSystemCoupon coupon);
    /**
     * 已退回
     * @param coupon
     */
    public void freeSheetCouponDrawBack(UserSystemCoupon coupon);
    // 奖励券
@@ -136,16 +141,6 @@
     * @param endTime
     */
    public void rewardCouponGet(UserSystemCoupon coupon);
    /**
     * 奖励券激活
     *
     * @param leftDay
     * @param source
     * @param startTime
     * @param endTime
     */
    public void rewardCouponActive(UserSystemCoupon coupon);
    /**
     * 奖励券已经使用
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherCouponContentDTOFactory.java
@@ -1,5 +1,6 @@
package com.yeshi.fanli.util.factory.msg;
import java.math.BigDecimal;
import java.util.Date;
import com.yeshi.fanli.dto.msg.MsgOtherCouponContentDTO;
@@ -10,9 +11,9 @@
    private static MsgOtherCouponContentDTO getGeneral(Integer leftDay, String source, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = new MsgOtherCouponContentDTO();
        if (endTime != null)
            dto.setEndTime(TimeUtil.getGernalTime(endTime.getTime(), "yyyy.MM.dd HH:mm"));
            dto.setEndTime(TimeUtil.getGernalTime(endTime.getTime(), "yyyy.MM.dd"));
        if (startTime != null)
            dto.setStartTime(TimeUtil.getGernalTime(startTime.getTime(), "yyyy.MM.dd HH:mm"));
            dto.setStartTime(TimeUtil.getGernalTime(startTime.getTime(), "yyyy.MM.dd"));
        dto.setLeftDay(leftDay);
        dto.setSource(source);
        return dto;
@@ -27,21 +28,24 @@
        return dto;
    }
    public static MsgOtherCouponContentDTO createWelfareCouponActive(Integer leftDay, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, "成功邀请1个队员", startTime, endTime);
    public static MsgOtherCouponContentDTO createWelfareCouponActive(Integer leftDay, String source, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(leftDay, source, startTime, endTime);
        dto.setState("已被激活");
        return dto;
    }
    public static MsgOtherCouponContentDTO createWelfareCouponUsing(Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, "成功邀请1个队员", startTime, endTime);
        dto.setState("使用中,等待系统同步订单");
    public static MsgOtherCouponContentDTO createWelfareCouponUsing(String orderId,BigDecimal money, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, null, startTime, endTime);
        dto.setOrderId(orderId);
        dto.setState("已经使用");
        dto.setFanLiMoney(money);
        return dto;
    }
    public static MsgOtherCouponContentDTO createWelfareCouponUsed(Integer leftDay, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, "成功邀请1个队员", startTime, endTime);
        dto.setState("已被使用");
    public static MsgOtherCouponContentDTO createWelfareCouponUsed(Integer leftDay,String desc, Date startTime, Date endTime) {
        MsgOtherCouponContentDTO dto = getGeneral(null, null, startTime, endTime);
        dto.setState("完成免单");
        dto.setDesc(desc);
        return dto;
    }
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -461,6 +461,19 @@
            contentList.add(new ClientTextStyleVO(dto.getState(), COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
            if (!StringUtil.isNullOrEmpty(dto.getOrderId())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getOrderId() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("订单号", COLOR_TITLE), contentList));
            }
            if (dto.getFanLiMoney() != null) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(MoneyBigDecimalUtil.getWithNoZera(dto.getFanLiMoney()) + "",
                        COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("预估返利", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getSource())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getSource() + "", COLOR_CONTENT));
@@ -479,6 +492,13 @@
                contentList.add(new ClientTextStyleVO("天", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("剩余天数", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getDesc())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getDesc(), COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("说明", COLOR_TITLE), contentList));
            }
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));