Merge remote-tracking branch 'origin/div' into div
| | |
| | |
|
| | | 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));
|
| | | }
|
| | | |
| | | }
|
| | |
| | | if (goodsPicture.getGoodState() == 1) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | } else {
|
| | | } |
| | | |
| | | TaoBaoGoodsBriefExtra goods = goodsPicture.getGoods();
|
| | | if (goods.getState() != null && goods.getState() == 1) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (!goods.isCoupon()) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | TaoKeApiUtil.getSimpleGoodsInfo(goods.getAuctionId());
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | out.print(JsonUtil.loadFalseResult("该商品已下架"));
|
| | | return;
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | // 分享文字
|
| | |
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarUserService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | */
|
| | | @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>();
|
| | | |
| | | List<HomeNavbar> list = new ArrayList<HomeNavbar>();
|
| | | if (listNavbar != null) {
|
| | | list.addAll(listNavbar);
|
| | | } |
| | | |
| | | if (!VersionUtil.greaterThan_1_6_0(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | 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("sex", deviceSex);
|
| | | 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));
|
| | | }
|
| | |
|
| | |
| | | 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} |
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonOrderGoodsFactory;
|
| | | import com.yeshi.fanli.util.factory.goods.CommonOrderFactory;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | |
| | | hongBaoMap.put("fontColor", hongbaoInfoFontColor);
|
| | | order.setHongBaoInfo(hongBaoMap);
|
| | |
|
| | | Integer sourceType = order.getSourceType();
|
| | | // 非自购的订单 不显示返利、免单详情
|
| | | if (HongBaoV2.TYPE_ZIGOU != hongBaoType) {
|
| | | order.setSignList(signList);
|
| | | } else {
|
| | | Integer sourceType = order.getSourceType();
|
| | | // 奖励订单、免单 使用记录
|
| | | if (sourceType == null) {
|
| | | setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null, signList);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 邀请 隐藏订单号
|
| | | if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType) {
|
| | | String orderNo = order.getOrderNo();
|
| | | orderNo = orderNo.substring(0, orderNo.length() - 6);
|
| | | order.setOrderNo(orderNo + "******");
|
| | | } else if (HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | // 分享、邀请 隐藏订单号
|
| | | if (HongBaoV2.TYPE_SHARE_GOODS == hongBaoType || HongBaoV2.TYPE_YAOQING == hongBaoType || HongBaoV2.TYPE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_ERJI == hongBaoType || HongBaoV2.TYPE_SHARE_YIJI == hongBaoType
|
| | | || HongBaoV2.TYPE_SHARE_ERJI == hongBaoType) {
|
| | | String orderNo = order.getOrderNo();
|
| | | orderNo = orderNo.substring(0, orderNo.length() - 6);
|
| | | order.setOrderNo(orderNo + "******");
|
| | | order.setOrderNo(UserUtil.filterOrderId(order.getOrderNo()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | cidMap.put(15L, "2478");// 文具
|
| | | cidMap.put(16L, "1451");// 运动
|
| | | cidMap.put(17L, "590");// 虚拟
|
| | | cidMap.put(18L, "3297");// 医药
|
| | | cidMap.put(18L, "3279");// 医药
|
| | | }
|
| | |
|
| | |
|
| | |
| | | public static String filterOrderId(String orderId) {
|
| | | if (orderId == null || orderId.length() <= 6)
|
| | | return orderId;
|
| | | if (orderId.length() <= 16) {// 隐藏3位
|
| | | return orderId.substring(0, orderId.length() - 3) + "***";
|
| | | if (orderId.length() <= 16) {// 隐藏2位
|
| | | return orderId.substring(0, orderId.length() - 3) + "**";
|
| | | } else {// 隐藏6位
|
| | | return orderId.substring(0, orderId.length() - 6) + "******";
|
| | | }
|
| | |
| | | goodsInfo.setBaoyou(true);
|
| | | }
|
| | |
|
| | | List<ClientTextStyleVO> labels = goodsInfo.getLabels();
|
| | | // 自营
|
| | | String owner = otherDTO.getOwner();
|
| | | if (!StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
|
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
|
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("京东自营");
|
| | | textStyleVO.setColor("#E42219");
|
| | |
| | | if (pinGouInfo != null) {
|
| | | goods.setPrice(pinGouInfo.getPingouPrice());
|
| | | goodsInfo.setPriceName("拼购价");
|
| | | |
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("拼购");
|
| | | textStyleVO.setColor("#FF9600");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | } else {
|
| | | goodsInfo.setPriceName("京东价");
|
| | | }
|
| | |
| | | }
|
| | | goodsInfo.setSalesCount(salesCountMidea);
|
| | |
|
| | | JDPingouInfo pinGouInfo = goods.getPinGouInfo();
|
| | | if (pinGouInfo != null) {
|
| | | goodsInfo.setZkPrice(pinGouInfo.getPingouPrice());
|
| | | goodsInfo.setPriceName("拼购价");
|
| | | } else {
|
| | | goodsInfo.setZkPrice(goods.getPrice());
|
| | | goodsInfo.setPriceName("京东价");
|
| | | }
|
| | |
|
| | | // 资金信息
|
| | | MoneyInfoVO moneyInfoVO = new MoneyInfoVO();
|
| | |
| | | goodsInfo.setCouponInfo(coupon);
|
| | | }
|
| | |
|
| | | List<ClientTextStyleVO> labels = goodsInfo.getLabels();
|
| | | // 京东自营标签
|
| | | String owner = goods.getOwner();
|
| | | if (!StringUtil.isNullOrEmpty(owner) && "g".equalsIgnoreCase(owner)) {
|
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
|
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("京东自营");
|
| | | textStyleVO.setColor("#E42219");
|
| | |
| | | goodsInfo.setShopType(20); // 京东
|
| | | }
|
| | |
|
| | | |
| | | JDPingouInfo pinGouInfo = goods.getPinGouInfo();
|
| | | if (pinGouInfo != null) {
|
| | | goodsInfo.setZkPrice(pinGouInfo.getPingouPrice());
|
| | | goodsInfo.setPriceName("拼购价");
|
| | | |
| | | if (labels == null) {
|
| | | labels = new ArrayList<ClientTextStyleVO>();
|
| | | }
|
| | | ClientTextStyleVO textStyleVO = new ClientTextStyleVO();
|
| | | textStyleVO.setContent("拼购");
|
| | | textStyleVO.setColor("#FF9600");
|
| | | labels.add(textStyleVO);
|
| | | goodsInfo.setLabels(labels);
|
| | | } else {
|
| | | goodsInfo.setZkPrice(goods.getPrice());
|
| | | goodsInfo.setPriceName("京东价");
|
| | | }
|
| | | |
| | | // 店铺信息
|
| | | JDShopInfo shopInfo = goods.getShopInfo();
|
| | | if (shopInfo != null && !StringUtil.isNullOrEmpty(shopInfo.getShopName())) {
|
| | |
| | | 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;
|
| | | }
|