| | |
| | |
|
| | | 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;
|
| | |
| | | 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();
|
| | |
| | | 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")
|
| | |
| | | @Column(name = "fa_type")
|
| | | private Integer type;
|
| | |
|
| | | @Column(name = "fa_type_enum")
|
| | | private FloatADTypeEnum typeEnum;
|
| | | |
| | | // 启用状态
|
| | | @Column(name = "fa_state")
|
| | | private Integer state;
|
| | |
| | | // 结束时间
|
| | | private String endTime_str;
|
| | |
|
| | | // 结束时间
|
| | | private String typeName;
|
| | |
|
| | |
|
| | | public Long getId() {
|
| | |
| | | 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;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | <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">
|
| | |
| | | </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">
|
| | |
| | | <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=",">
|
| | |
| | | <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
|
| | |
| | | = #{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
|
| | |
| | | <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>
|
| | |
| | | <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 |
| | |
| | |
|
| | | <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}
|
| | |
| | |
|
| | | <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>
|
| | |
|
| | |
|
| | |
| | |
|
| | | <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>
|
| | |
| | |
|
| | | <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>
|
| | |
| | |
|
| | | 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;
|
| | |
| | |
|
| | | 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) {
|
| | |
| | | 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(),
|
| | |
| | | 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())) {
|
| | |
| | | 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);
|
New file |
| | |
| | | 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());
|
| | | }
|
| | |
|
| | | }
|