admin
2019-02-27 e260d06750811a6be0ad1abb85634ced13cc7d94
其他消息表结构修改
4个文件已修改
124 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgOtherDetailMapper.xml 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/msg/MsgOtherDetail.java
@@ -41,6 +41,8 @@
    private String beiZhu;// 备注
    @Column(name = "mo_read")
    private Boolean read;
    @Column(name = "mo_source_id") // 源主键ID
    private Long sourceId;
    @Column(name = "mo_create_time")
    private Date createTime;
    @Column(name = "mo_update_time")
@@ -120,4 +122,12 @@
    public void setBeiZhu(String beiZhu) {
        this.beiZhu = beiZhu;
    }
    public Long getSourceId() {
        return sourceId;
    }
    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }
}
fanli/src/main/java/com/yeshi/fanli/mapping/msg/MsgOtherDetailMapper.xml
@@ -9,14 +9,16 @@
        <result column="mo_content" property="content" jdbcType="VARCHAR" />
        <result column="mo_beizhu" property="beiZhu" jdbcType="VARCHAR" />
        <result column="mo_read" property="read" jdbcType="BOOLEAN" />
        <result column="mo_source_id" property="sourceId" jdbcType="BIGINT" />
        <result column="mo_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="mo_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <association property="user" column="mo_uid"
            javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
            <id column="mo_uid" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">mo_id,mo_uid,mo_type,mo_content,mo_beizhu,mo_read,mo_create_time,mo_update_time
    <sql id="Base_Column_List">mo_id,mo_uid,mo_type,mo_content,mo_beizhu,mo_read,mo_create_time,mo_update_time,mo_source_id
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -24,34 +26,22 @@
        <include refid="Base_Column_List" />
        from yeshi_ec_msg_other where mo_id = #{id,jdbcType=BIGINT}
    </select>
    <select id="listByUid" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_msg_other where mo_uid = #{uid,jdbcType=BIGINT} order by
        mo_create_time desc limit #{start},#{count}
    </select>
    <select id="countByUid" resultType="java.lang.Long"
        parameterType="java.lang.Long">
        select
        count(mo_id)
        from yeshi_ec_msg_other where mo_uid =
        #{uid,jdbcType=BIGINT}
    </select>
        parameterType="java.lang.Long">select count(mo_id) from yeshi_ec_msg_other where mo_uid
        = #{uid,jdbcType=BIGINT}</select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_msg_other where mo_id = #{id,jdbcType=BIGINT}
    </delete>
        yeshi_ec_msg_other where mo_id = #{id,jdbcType=BIGINT}</delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOtherDetail"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_msg_other
        (mo_id,mo_uid,mo_type,mo_content,mo_beizhu,mo_read,mo_create_time,mo_update_time)
        (mo_id,mo_uid,mo_type,mo_content,mo_beizhu,mo_read,mo_create_time,mo_update_time,mo_source_id)
        values
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{read,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
        (#{id,jdbcType=BIGINT},#{user.id,jdbcType=BIGINT},#{type,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{beiZhu,jdbcType=VARCHAR},#{read,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{sourceId,jdbcType=BIGINT})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOtherDetail"
        useGeneratedKeys="true" keyProperty="id">
@@ -65,6 +55,7 @@
            <if test="read != null">mo_read,</if>
            <if test="createTime != null">mo_create_time,</if>
            <if test="updateTime != null">mo_update_time,</if>
            <if test="sourceId != null">mo_source_id,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -76,6 +67,7 @@
            <if test="read != null">#{read,jdbcType=BOOLEAN},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="sourceId != null">#{sourceId,jdbcType=BIGINT}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOtherDetail">update
@@ -85,7 +77,8 @@
        #{beiZhu,jdbcType=VARCHAR},mo_read =
        #{read,jdbcType=BOOLEAN},mo_create_time =
        #{createTime,jdbcType=TIMESTAMP},mo_update_time =
        #{updateTime,jdbcType=TIMESTAMP} where mo_id = #{id,jdbcType=BIGINT}
        #{updateTime,jdbcType=TIMESTAMP} ,mo_source_id
        =#{sourceId,jdbcType=BIGINT} where mo_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.msg.MsgOtherDetail">
        update yeshi_ec_msg_other
@@ -97,15 +90,11 @@
            <if test="read != null">mo_read=#{read,jdbcType=BOOLEAN},</if>
            <if test="createTime != null">mo_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">mo_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="sourceId !=null">mo_source_id =#{sourceId,jdbcType=BIGINT},</if>
        </set>
        where mo_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="setMsgReadByUid" parameterType="java.lang.Long">
        update
        yeshi_ec_msg_other
        set mo_read=1
        where mo_uid = #{uid,jdbcType=BIGINT}
    <update id="setMsgReadByUid" parameterType="java.lang.Long">update
        yeshi_ec_msg_other set mo_read=1 where mo_uid = #{uid,jdbcType=BIGINT}
    </update>
</mapper>
fanli/src/main/java/com/yeshi/fanli/service/impl/msg/UserOtherMsgNotificationServiceImpl.java
@@ -40,8 +40,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponGet(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -54,8 +54,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponActive(getLeftDay(coupon),
                coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -68,8 +68,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsing(coupon.getStartTime(),
                coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -82,8 +82,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createWelfareCouponUsed(getLeftDay(coupon),
                coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -96,8 +96,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
                .createWelfareCouponWillOutOfDate(getLeftDay(coupon), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -110,8 +110,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
                .createWelfareCouponAlreadyOutOfDate(coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponWelfareMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -124,8 +124,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponGet(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -138,8 +138,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponActive(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -152,8 +152,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponUsing(coupon.getSource(),
                coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -166,8 +166,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponUsed(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -180,8 +180,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponWillOutOfDate(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -194,8 +194,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createCouponAlreadyOutOfDate(coupon.getSource(),
                coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponMianDan, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponMianDan, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -208,8 +208,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponGet(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponReward, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -222,8 +222,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponActive(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponReward, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -236,8 +236,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponUsed(getLeftDay(coupon),
                coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponReward, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -250,8 +250,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory.createRewardCouponWillOutOfDate(
                getLeftDay(coupon), coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponReward, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
@@ -264,8 +264,8 @@
        MsgOtherCouponContentDTO dto = MsgOtherCouponContentDTOFactory
                .createRewardCouponAlreadyOutOfDate(coupon.getSource(), coupon.getStartTime(), coupon.getEndTime());
        try {
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(), dto,
                    MsgTypeOtherTypeEnum.couponReward, null));
            msgOtherDetailService.addMsgOtherDetail(MsgOtherDetailFactory.createCouponMsg(coupon.getUid(),
                    coupon.getId(), dto, MsgTypeOtherTypeEnum.couponReward, null));
        } catch (MsgOtherDetailException e) {
            e.printStackTrace();
        }
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/MsgOtherDetailFactory.java
@@ -18,8 +18,8 @@
     * @param beiZhu
     * @return
     */
    public static MsgOtherDetail createCouponMsg(Long uid, MsgOtherCouponContentDTO content, MsgTypeOtherTypeEnum type,
            String beiZhu) {
    public static MsgOtherDetail createCouponMsg(Long uid, Long userCouponId, MsgOtherCouponContentDTO content,
            MsgTypeOtherTypeEnum type, String beiZhu) {
        if (uid == null)
            return null;
        MsgOtherDetail detail = new MsgOtherDetail();
@@ -29,6 +29,7 @@
        detail.setUser(new UserInfo(uid));
        detail.setCoupnContent(content);
        detail.setType(type);
        detail.setSourceId(userCouponId);
        return detail;
    }