yujian
2019-11-11 6d9d496f0877105eb4ff68d0ee05b469489820f0
红包  + 广告类型
8个文件已修改
1个文件已添加
200 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java 61 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsMapper.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsPayMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/FloatADTypeEnumHandler.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/ConfigControllerV2.java
@@ -14,6 +14,7 @@
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum;
import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
import com.yeshi.fanli.entity.bus.user.UserActiveLog;
import com.yeshi.fanli.entity.common.JumpDetailV2;
@@ -156,36 +157,40 @@
            uid = null;
        // 活动弹框
        List<FloatAD> listAD = null;
        if (redPackWinNewUserService.verifyHasReward(uid)) {
            listAD = floatADService.getValidByPosition(FloatAD.POSITION_INDEX);
        } else {
            listAD = floatADService.getValidCommonByPosition(FloatAD.POSITION_INDEX);
        }
        List<FloatAD> listAD = new ArrayList<FloatAD>();
        List<FloatImgDetailVO> listVO = new ArrayList<FloatImgDetailVO>();
        if (listAD != null && !listAD.isEmpty()) {
            for (FloatAD floatAD : listAD) {
                JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
                if (jumpDetail != null) {
                    jumpDetail = jumpDetailV2Service.selectByPrimaryKey(jumpDetail.getId());
                    if (jumpDetail != null) {
                        jumpDetail.setNeedLogin(floatAD.isJumpNeedLogin());
                    }
                }
                FloatImgDetailVO floatImgVO = new FloatImgDetailVO();
                floatImgVO.setId(floatAD.getId().toString());
                floatImgVO.setImg(floatAD.getPicture());
                floatImgVO.setParams(floatAD.getParams());
                floatImgVO.setJumpDetail(jumpDetail);
                floatImgVO.setShowTime(floatAD.getShowMode());
                floatImgVO.setAccountLogin(floatAD.isJumpNeedLogin());
                if (floatAD.getPlaySound() != null)
                    floatImgVO.setPlaySound(floatAD.getPlaySound());// 默认都播放音效
                else
                    floatImgVO.setPlaySound(false);
                listVO.add(floatImgVO);
        List<FloatAD> list = floatADService.getValidByPosition(FloatAD.POSITION_INDEX);
        if (list != null && !list.isEmpty())
            listAD.addAll(list);
        for (int i = 0; i < listAD.size(); i++) {
            FloatAD floatAD = listAD.get(i);
            FloatADTypeEnum typeEnum = floatAD.getTypeEnum();
            if (typeEnum == FloatADTypeEnum.newUserRedPack && !redPackWinNewUserService.verifyHasReward(uid)) {
                listAD.remove(i);
                i--;
            }
            JumpDetailV2 jumpDetail = floatAD.getJumpDetail();
            if (jumpDetail != null) {
                jumpDetail = jumpDetailV2Service.selectByPrimaryKey(jumpDetail.getId());
                if (jumpDetail != null) {
                    jumpDetail.setNeedLogin(floatAD.isJumpNeedLogin());
                }
            }
            FloatImgDetailVO floatImgVO = new FloatImgDetailVO();
            floatImgVO.setId(floatAD.getId().toString());
            floatImgVO.setImg(floatAD.getPicture());
            floatImgVO.setParams(floatAD.getParams());
            floatImgVO.setJumpDetail(jumpDetail);
            floatImgVO.setShowTime(floatAD.getShowMode());
            floatImgVO.setAccountLogin(floatAD.isJumpNeedLogin());
            if (floatAD.getPlaySound() != null)
                floatImgVO.setPlaySound(floatAD.getPlaySound());// 默认都播放音效
            else
                floatImgVO.setPlaySound(false);
            listVO.add(floatImgVO);
        }
        JSONObject data = new JSONObject();
fanli/src/main/java/com/yeshi/fanli/entity/bus/homemodule/FloatAD.java
@@ -28,6 +28,21 @@
    public static String POSITION_INDEX = "index";
    // 展示位置 - 消息中心
    public static String POSITION_MSGCENTER = "msgCenter";
    public enum FloatADTypeEnum {
        activity("活动"), newUserRedPack("新人红包");
        private final String desc;
        private FloatADTypeEnum(String desc) {
            this.desc = desc;
        }
        public String getDesc() {
            return desc;
        }
    }
        
    
    @Column(name = "fa_id")
@@ -84,6 +99,9 @@
    @Column(name = "fa_type")
    private Integer type;
    @Column(name = "fa_type_enum")
    private FloatADTypeEnum typeEnum;
    // 启用状态
    @Column(name = "fa_state")
    private Integer state;
@@ -104,6 +122,8 @@
    // 结束时间
    private String endTime_str;
    
    // 结束时间
    private String typeName;
    
    
    public Long getId() {
@@ -249,5 +269,21 @@
    public void setPlaySound(Boolean playSound) {
        this.playSound = playSound;
    }
    public FloatADTypeEnum getTypeEnum() {
        return typeEnum;
    }
    public void setTypeEnum(FloatADTypeEnum typeEnum) {
        this.typeEnum = typeEnum;
    }
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    
}
fanli/src/main/java/com/yeshi/fanli/mapping/homemodule/FloatADMapper.xml
@@ -19,13 +19,14 @@
        <result column="fa_create_time" property="createTime" jdbcType="TIMESTAMP" />
        <result column="fa_update_time" property="updateTime" jdbcType="TIMESTAMP" />
        <result column="fa_play_sound" property="playSound" jdbcType="BOOLEAN" />
        <result column="fa_type_enum" property="typeEnum" typeHandler="com.yeshi.fanli.util.mybatishandler.FloatADTypeEnumHandler"/>
        <association property="jumpDetail" column="fa_jumpid"
            javaType="com.yeshi.fanli.entity.common.JumpDetailV2">
            <id column="fa_jumpid" property="id" jdbcType="BIGINT" />
        </association>
    </resultMap>
    <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time,fa_play_sound
    <sql id="Base_Column_List">fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time,fa_play_sound,fa_type_enum
    </sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
@@ -38,9 +39,9 @@
    </delete>
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_float_ad
        (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time,fa_id,fa_play_sound)
        (fa_id,fa_name,fa_picture,fa_show_mode,fa_jumpid,fa_params,fa_jump_need_login,fa_start_time,fa_end_time,fa_position,fa_order,fa_type,fa_state,fa_create_time,fa_update_time,fa_id,fa_play_sound,fa_type_enum)
        values
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT},#{playSound,jdbcType=BOOLEAN})
        (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{showMode,jdbcType=VARCHAR},#{jumpDetail.id,jdbcType=BIGINT},#{params,jdbcType=VARCHAR},#{jumpNeedLogin,jdbcType=VARCHAR},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{position,jdbcType=VARCHAR},#{order,jdbcType=INTEGER},#{type,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{id,jdbcType=BIGINT},#{playSound,jdbcType=BOOLEAN},#{typeEnum,jdbcType=VARCHAR})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD"
        useGeneratedKeys="true" keyProperty="id">
@@ -62,6 +63,7 @@
            <if test="createTime != null">fa_create_time,</if>
            <if test="updateTime != null">fa_update_time,</if>
            <if test="playSound != null">fa_play_sound,</if>
            <if test="typeEnum != null">fa_type_enum,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -80,7 +82,8 @@
            <if test="state != null">#{state,jdbcType=INTEGER},</if>
            <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="playSound != null">#{playSound,jdbcType=BOOLEAN}</if>
            <if test="playSound != null">#{playSound,jdbcType=BOOLEAN},</if>
            <if test="typeEnum != null">#{typeEnum,jdbcType=VARCHAR}</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">update
@@ -97,7 +100,8 @@
        = #{state,jdbcType=INTEGER},fa_create_time =
        #{createTime,jdbcType=TIMESTAMP},fa_update_time =
        #{updateTime,jdbcType=TIMESTAMP} ,fa_play_sound
        =#{playSound,jdbcType=BOOLEAN} where fa_id = #{id,jdbcType=BIGINT}
        =#{playSound,jdbcType=BOOLEAN},fa_type_enum
        =#{typeEnum,jdbcType=VARCHAR} where fa_id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.FloatAD">
        update yeshi_ec_float_ad
@@ -118,6 +122,7 @@
            <if test="createTime != null">fa_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
            <if test="updateTime != null">fa_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
            <if test="playSound !=null">fa_play_sound =#{playSound,jdbcType=BOOLEAN},</if>
            <if test="typeEnum !=null">fa_type_enum =#{typeEnum,jdbcType=VARCHAR},</if>
        </set>
        where fa_id = #{id,jdbcType=BIGINT}
    </update>
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsMapper.xml
@@ -58,12 +58,18 @@
    <select id="listGoods" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_shop_goods where sg_title like '${key}%'
        from yeshi_ec_shop_goods where 1=1
        <if test="key != null and key != ''">
            and sg_title like '%${key}%'
        </if>
        <if test="state!=null">and sg_state=#{state}</if>
        order by sg_weight desc limit #{start},#{count}
    </select>
    <select id="countGoods" resultType="java.lang.Long">
        select count(*) from yeshi_ec_shop_goods where sg_title like '${key}%'
        select count(*) from yeshi_ec_shop_goods where 1=1
        <if test="key != null and key != ''">
            and sg_title like '%${key}%'
        </if>
        <if test="state!=null">and sg_state=#{state}</if>
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsMapper.xml
@@ -87,7 +87,7 @@
    
    <select id="listQuery" resultMap="BaseResultMap">
        select    <include refid="Base_Column_List" /> from yeshi_ec_shop_goods_set 
        where sgs_name like '${key}%'
        where 1=1 <if test="key != null and key != ''">AND sgs_name like '%${key}%'</if>
            <if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
        order by sgs_weight desc 
        limit #{start},#{count}
@@ -95,7 +95,8 @@
    <select id="countQuery" resultType="java.lang.Long">
        select count(sgs_id) from yeshi_ec_shop_goods_set 
        where sgs_name like '${key}%' <if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
        where 1=1 <if test="key != null and key != ''">AND sgs_name like '%${key}%'</if>
             <if test="goodsId != null">AND sgs_goods_id = #{goodsId}</if>
    </select>
    
    
fanli/src/main/java/com/yeshi/fanli/mapping/shop/BanLiShopGoodsSetsPayMapper.xml
@@ -45,7 +45,7 @@
    
    <select id="listQuery" resultMap="BaseResultMap">
        select    <include refid="Base_Column_List" /> from yeshi_ec_shop_goods_set_pay 
        where sp_tag like '${key}%'
        where 1=1
        <if test="payType != null">
            and sp_pay_type=#{payType}
        </if>
@@ -58,7 +58,7 @@
    <select id="countQuery" resultType="java.lang.Long">
        select count(sp_id) from yeshi_ec_shop_goods_set_pay 
        where sp_tag like '${key}%'
        where 1=1
        <if test="payType != null">
            and sp_pay_type=#{payType}
        </if>
fanli/src/main/java/com/yeshi/fanli/service/impl/homemodule/FloatADServiceImpl.java
@@ -16,6 +16,7 @@
import com.yeshi.fanli.dao.mybatis.homemodule.FloatADMapper;
import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum;
import com.yeshi.fanli.entity.common.JumpDetailV2;
import com.yeshi.fanli.exception.homemodule.FloatADException;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
@@ -221,6 +222,11 @@
        
        for (FloatAD floatAD : listQuery) {
            
            FloatADTypeEnum typeEnum = floatAD.getTypeEnum();
            if (typeEnum != null) {
                floatAD.setTypeName(typeEnum.getDesc());
            }
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
            Date startTime = floatAD.getStartTime();
            if (startTime == null) {
fanli/src/main/java/com/yeshi/fanli/util/factory/msg/UserMsgVOFactory.java
@@ -772,7 +772,7 @@
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备       注", COLOR_TITLE), contentList));
            return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png",
                    dto.getTitle(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
@@ -1312,13 +1312,13 @@
            if (!StringUtil.isNullOrEmpty(dto.getExplain())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getExplain() + "", COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("原因", COLOR_TITLE), contentList));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("原        因", COLOR_TITLE), contentList));
            }
            if (dto.getTotal() != null) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getTotal(), COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("可则算额", COLOR_TITLE), contentList));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("可折算额", COLOR_TITLE), contentList));
            }
            if (!StringUtil.isNullOrEmpty(dto.getNum())) {
@@ -1330,13 +1330,13 @@
            if (!StringUtil.isNullOrEmpty(dto.getSource())) {
                contentList = new ArrayList<>();
                contentList.add(new ClientTextStyleVO(dto.getSource(), COLOR_CONTENT));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("状态", COLOR_TITLE), contentList));
                items.add(new CommonMsgItemVO(new ClientTextStyleVO("状        态", COLOR_TITLE), contentList));
            }
            contentList = new ArrayList<>();
            contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
                    COLOR_CONTENT));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
            items.add(new CommonMsgItemVO(new ClientTextStyleVO("备        注", COLOR_TITLE), contentList));
            UserMsgVO userMsgVO = new UserMsgVO();
            userMsgVO.setIcon(icon);
fanli/src/main/java/com/yeshi/fanli/util/mybatishandler/FloatADTypeEnumHandler.java
New file
@@ -0,0 +1,53 @@
package com.yeshi.fanli.util.mybatishandler;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum;
public class FloatADTypeEnumHandler extends BaseTypeHandler<FloatADTypeEnum> {
    @Override
    public FloatADTypeEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            return FloatADTypeEnum.valueOf(key);
        }
    }
    @Override
    public FloatADTypeEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return FloatADTypeEnum.valueOf(key);
        }
    }
    @Override
    public FloatADTypeEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
        String key = arg0.getString(arg1);
        if (arg0.wasNull()) {
            return null;
        } else {
            // 根据数据库中的key值,定位SexEnum子类
            return FloatADTypeEnum.valueOf(key);
        }
    }
    @Override
    public void setNonNullParameter(PreparedStatement arg0, int arg1, FloatADTypeEnum arg2, JdbcType arg3)
            throws SQLException {
        arg0.setString(arg1, arg2.name());
    }
}