| | |
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar.NavbarTypeEnum;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | */
|
| | | @RequestMapping(value = "gethomenavbar", method = RequestMethod.POST)
|
| | | public void gethomenavbar(AcceptData acceptData, PrintWriter out) {
|
| | | |
| | | List<HomeNavbar> list = new ArrayList<HomeNavbar>();
|
| | | |
| | | List<HomeNavbar> listNavbar = homeNavbarService.listQueryDefaultNavbar(0);
|
| | | if (listNavbar == null) {
|
| | | listNavbar = new ArrayList<HomeNavbar>();
|
| | | if (listNavbar != null) {
|
| | | list.addAll(listNavbar);
|
| | | }
|
| | | |
| | | for (int i = 0; i < list.size(); i ++) {
|
| | | NavbarTypeEnum type = list.get(i).getType();
|
| | | if (type == NavbarTypeEnum.commonTemplate) {
|
| | | list.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", listNavbar.size());
|
| | | data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(listNavbar));
|
| | | |
| | | data.put("count", list.size());
|
| | | data.put("listNavbar", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | | }
|
| | |
| | | */
|
| | | @RequestMapping(value = "getHomeItems", method = RequestMethod.POST)
|
| | | public void getHomeItems(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | |
| | | // 获取设备定义性别
|
| | | int deviceSex = deviceSexService.getDeviceSex(acceptData.getDevice());
|
| | | |
| | | List<HomeNavbar> listNavbar = homeNavbarUserService.listEffectiveNavbar(uid, acceptData.getDevice(), deviceSex);
|
| | | if (listNavbar == null) {
|
| | | listNavbar = new ArrayList<HomeNavbar>();
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("sex", deviceSex);
|
| | | data.put("count", listNavbar.size());
|
| | |
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | public enum NavbarTypeEnum {
|
| | | category("分类"), weex("阿里百川"), web("网页");
|
| | | category("分类"), weex("阿里百川"), web("网页") , commonTemplate("通用模板");
|
| | | private final String desc;
|
| | |
|
| | | private NavbarTypeEnum(String desc) {
|
| | |
| | | @Column(name = "br_updatetime")
|
| | | private Date updatetime;
|
| | |
|
| | | |
| | | // 跳转参数 json 字符串
|
| | | @Expose
|
| | | @Column(name = "br_params")
|
| | | private String params;
|
| | |
|
| | | // 是否定时
|
| | | private boolean timeTask;
|
| | |
| | | public void setOrderWoman(Integer orderWoman) {
|
| | | this.orderWoman = orderWoman;
|
| | | }
|
| | |
|
| | | |
| | | public String getParams() {
|
| | | return params;
|
| | | }
|
| | |
|
| | | public void setParams(String params) {
|
| | | this.params = params;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | <result column="br_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="br_is_default" property="isDefault" jdbcType="VARCHAR"/> |
| | | <result column="br_is_fixed" property="isFixed" jdbcType="VARCHAR"/> |
| | | <result column="br_params" property="params" jdbcType="VARCHAR"/>
|
| | | <result column="br_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> |
| | | <result column="br_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.NavbarTypeEnumHandler"/> |
| | |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime</sql> |
| | | <sql id="Base_Column_List">br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_params,br_createtime,br_updatetime</sql>
|
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT} |
| | |
| | | delete from yeshi_ec_home_navbar where br_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar (br_id,br_name,br_picture,br_class_id,br_swiper_banner_id,br_url,br_type,br_orderby,br_order_man,br_order_woman,br_start_time,br_end_time,br_state,br_is_default,br_is_fixed,br_params,br_createtime,br_updatetime) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{classId,jdbcType=BIGINT},#{swiperBannerId,jdbcType=BIGINT},#{url,jdbcType=VARCHAR},#{type,jdbcType=VARCHAR},#{orderby,jdbcType=INTEGER},#{orderMan,jdbcType=INTEGER},#{orderWoman,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{isDefault,jdbcType=VARCHAR},#{isFixed,jdbcType=VARCHAR},#{params,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert>
|
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_home_navbar |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="state != null">br_state,</if> |
| | | <if test="isDefault != null">br_is_default,</if> |
| | | <if test="isFixed != null">br_is_fixed,</if> |
| | | <if test="params != null">br_params,</if>
|
| | | <if test="createtime != null">br_createtime,</if> |
| | | <if test="updatetime != null">br_updatetime,</if> |
| | | </trim>values |
| | |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="isDefault != null">#{isDefault,jdbcType=VARCHAR},</if> |
| | | <if test="isFixed != null">#{isFixed,jdbcType=VARCHAR},</if> |
| | | <if test="params != null">#{params,jdbcType=VARCHAR},</if>
|
| | | <if test="createtime != null">#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_order_man = #{orderMan,jdbcType=INTEGER},br_order_woman = #{orderWoman,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar set br_name = #{name,jdbcType=VARCHAR},br_picture = #{picture,jdbcType=VARCHAR},br_class_id = #{classId,jdbcType=BIGINT},br_swiper_banner_id = #{swiperBannerId,jdbcType=BIGINT},br_url = #{url,jdbcType=VARCHAR},br_type = #{type,jdbcType=VARCHAR},br_orderby = #{orderby,jdbcType=INTEGER},br_order_man = #{orderMan,jdbcType=INTEGER},br_order_woman = #{orderWoman,jdbcType=INTEGER},br_start_time = #{startTime,jdbcType=TIMESTAMP},br_end_time = #{endTime,jdbcType=TIMESTAMP},br_state = #{state,jdbcType=INTEGER},br_is_default = #{isDefault,jdbcType=VARCHAR},br_is_fixed = #{isFixed,jdbcType=VARCHAR},br_params = #{params,jdbcType=VARCHAR},br_createtime = #{createtime,jdbcType=TIMESTAMP},br_updatetime = #{updatetime,jdbcType=TIMESTAMP} where br_id = #{id,jdbcType=BIGINT}</update>
|
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.HomeNavbar">update yeshi_ec_home_navbar |
| | | <set> |
| | |
| | | <if test="state != null">br_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="isDefault != null">br_is_default=#{isDefault,jdbcType=VARCHAR},</if> |
| | | <if test="isFixed != null">br_is_fixed=#{isFixed,jdbcType=VARCHAR},</if> |
| | | <if test="params != null">br_params=#{params,jdbcType=VARCHAR},</if>
|
| | | <if test="createtime != null">br_createtime=#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatetime != null">br_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | </set> where br_id = #{id,jdbcType=BIGINT} |
| | |
| | | cidMap.put(15L, "2478");// 文具
|
| | | cidMap.put(16L, "1451");// 运动
|
| | | cidMap.put(17L, "590");// 虚拟
|
| | | cidMap.put(18L, "3297");// 医药
|
| | | cidMap.put(18L, "3279");// 医药
|
| | | }
|
| | |
|
| | |
|
| | |
| | | public static String getPromotionUrl(Long goodsId, String pid, String customParams) {
|
| | | PDDPromotionUrl promotion = convert(goodsId, pid, customParams);
|
| | | if (promotion != null) {
|
| | | return promotion.getUrl();
|
| | | return promotion.getShortUrl();
|
| | | }
|
| | | return null;
|
| | | }
|