| | |
| | | KEY = Constant.systemCommonConfig.getSignKey();
|
| | | }
|
| | |
|
| | | @Around(EDP)
|
| | | // @Around(EDP)
|
| | | public Object testAround(ProceedingJoinPoint joinPoint) throws IOException {
|
| | | Object[] args = joinPoint.getArgs();
|
| | | PrintWriter out = null;
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.tlj; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin; |
| | | |
| | | public interface ConfigTaoLiJinMapper extends BaseMapper<ConfigTaoLiJin> { |
| | | |
| | | /** |
| | | * 根据key值查询 |
| | | * @param key |
| | | * @return |
| | | */ |
| | | ConfigTaoLiJin getByKey(@Param("key") String key); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.tlj;
|
| | |
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
|
| | |
|
| | | @Repository
|
| | | public class DeviceTaoLiJinRecordDao extends MongodbBaseDao<DeviceTaoLiJinRecord> {
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.tlj;
|
| | |
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.bus.tlj.GoodsTaoLiJinRate;
|
| | |
|
| | | @Repository
|
| | | public class GoodsTaoLiJinRateDao extends MongodbBaseDao<GoodsTaoLiJinRate> {
|
| | | |
| | | |
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user;
|
| | |
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.DeviceSex;
|
| | |
|
| | | @Repository
|
| | | public class DeviceSexDao extends MongodbBaseDao<DeviceSex> {
|
| | | |
| | | }
|
| | |
|
| | |
| | | public enum CommonContentTypeEnum {
|
| | |
|
| | | _9k9("9块9"), haoQuan("高额好券"), chaoSheng("超级省钱"), muYin("母婴精选"), reMai("潮品热卖"), meiShi("优选美食"), juJia(
|
| | | "居家生活"), chuanYiDaPei("穿衣搭配"), meiZhuangGehu("美妆个护"), jingPinXieBao(
|
| | | "精品鞋包"), chaoNanReMai("潮男热卖"), shuMaShouJi("数码手机"), yunDongKuXie("运动酷鞋"), qiCheHuWai("汽车户外");
|
| | | "居家生活"), chuanYiDaPei("穿衣搭配"), meiZhuangGehu("美妆个护"), jingPinXieBao("精品鞋包"), chaoNanReMai(
|
| | | "潮男热卖"), shuMaShouJi("数码手机"), yunDongKuXie("运动酷鞋"), qiCheHuWai("汽车户外"), chaoPinReMai("潮品热卖");
|
| | | private final String desc;
|
| | |
|
| | | private CommonContentTypeEnum(String desc) {
|
New file |
| | |
| | | package com.yeshi.fanli.dto.msg;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | /**
|
| | | * 其他消息里面的淘礼金相关的内容
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class MsgOtherTaoLiJinContentDTO {
|
| | | private String state;
|
| | | private String source;// 来源
|
| | | private BigDecimal money;// 面额
|
| | | |
| | | public String getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(String state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public String getSource() {
|
| | | return source;
|
| | | }
|
| | |
|
| | | public void setSource(String source) {
|
| | | this.source = source;
|
| | | }
|
| | |
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.homemodule;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 设备性别
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "device_sex")
|
| | | public class DeviceSex {
|
| | | |
| | | @Id
|
| | | private String id; |
| | |
|
| | | @Field("sex")
|
| | | private Integer sex; //男女 1-女 2-男
|
| | | |
| | | @Field("createTime")
|
| | | private Date createTime;
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Integer getSex() {
|
| | | return sex;
|
| | | }
|
| | |
|
| | | public void setSex(Integer sex) {
|
| | | this.sex = sex;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.tlj;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 淘礼金参数
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_config_taolijin")
|
| | | public class ConfigTaoLiJin {
|
| | |
|
| | | |
| | | @Column(name = "ct_id")
|
| | | private Long id; |
| | |
|
| | | @Column(name = "ct_name")
|
| | | private String name; // 名称
|
| | |
|
| | | @Column(name = "ct_key")
|
| | | private String key; // 唯一值
|
| | |
|
| | | @Column(name = "ct_value")
|
| | | private String value; // 值
|
| | |
|
| | | @Column(name = "ct_beizhu")
|
| | | private String beizhu; // 备注
|
| | |
|
| | | @Column(name = "ct_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public String getKey() {
|
| | | return key;
|
| | | }
|
| | |
|
| | | public void setKey(String key) {
|
| | | this.key = key;
|
| | | }
|
| | |
|
| | | public String getValue() {
|
| | | return value;
|
| | | }
|
| | |
|
| | | public void setValue(String value) {
|
| | | this.value = value;
|
| | | }
|
| | |
|
| | | public String getBeizhu() {
|
| | | return beizhu;
|
| | | }
|
| | |
|
| | | public void setBeizhu(String beizhu) {
|
| | | this.beizhu = beizhu;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.tlj;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 设备新人红包领取记录
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "device_taolijin_record")
|
| | | public class DeviceTaoLiJinRecord {
|
| | |
|
| | | @Id
|
| | | private String id; // 设备信息
|
| | |
|
| | | @Field("money")
|
| | | private BigDecimal money; // 金额
|
| | |
|
| | | @Field("createTime")
|
| | | private Date createTime;
|
| | |
|
| | | |
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.tlj;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 淘礼金参数
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "goods_taolijin_rate")
|
| | | public class GoodsTaoLiJinRate {
|
| | |
|
| | | @Id
|
| | | private String goodId; |
| | |
|
| | | @Field("rate")
|
| | | private Integer rate; // 比例
|
| | |
|
| | | @Field("createTime")
|
| | | private Date createTime;
|
| | | |
| | | @Field("updateTime")
|
| | | private Date updateTime;
|
| | | |
| | | public String getGoodId() {
|
| | | return goodId;
|
| | | }
|
| | |
|
| | | public void setGoodId(String goodId) {
|
| | | this.goodId = goodId;
|
| | | }
|
| | |
|
| | | public Integer getRate() {
|
| | | return rate;
|
| | | }
|
| | |
|
| | | public void setRate(Integer rate) {
|
| | | this.rate = rate;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.tlj.ConfigTaoLiJinMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin"> |
| | | <id column="ct_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="ct_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="ct_key" property="key" jdbcType="VARCHAR"/> |
| | | <result column="ct_value" property="value" jdbcType="VARCHAR"/> |
| | | <result column="ct_beizhu" property="beizhu" jdbcType="VARCHAR"/> |
| | | <result column="ct_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ct_id,ct_name,ct_key,ct_value,ct_beizhu,ct_create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_config_taolijin where ct_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_config_taolijin where ct_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_config_taolijin (ct_id,ct_name,ct_key,ct_value,ct_beizhu,ct_create_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{key,jdbcType=VARCHAR},#{value,jdbcType=VARCHAR},#{beizhu,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_config_taolijin |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ct_id,</if> |
| | | <if test="name != null">ct_name,</if> |
| | | <if test="key != null">ct_key,</if> |
| | | <if test="value != null">ct_value,</if> |
| | | <if test="beizhu != null">ct_beizhu,</if> |
| | | <if test="createTime != null">ct_create_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="key != null">#{key,jdbcType=VARCHAR},</if> |
| | | <if test="value != null">#{value,jdbcType=VARCHAR},</if> |
| | | <if test="beizhu != null">#{beizhu,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin">update yeshi_ec_config_taolijin set ct_name = #{name,jdbcType=VARCHAR},ct_key = #{key,jdbcType=VARCHAR},ct_value = #{value,jdbcType=VARCHAR},ct_beizhu = #{beizhu,jdbcType=VARCHAR},ct_create_time = #{createTime,jdbcType=TIMESTAMP} where ct_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin">update yeshi_ec_config_taolijin |
| | | <set> |
| | | <if test="name != null">ct_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="key != null">ct_key=#{key,jdbcType=VARCHAR},</if> |
| | | <if test="value != null">ct_value=#{value,jdbcType=VARCHAR},</if> |
| | | <if test="beizhu != null">ct_beizhu=#{beizhu,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">ct_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ct_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getByKey" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_config_taolijin t |
| | | WHERE t.`ct_key` = #{key} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import com.yeshi.fanli.dto.dataoke.DaTaoKeGoodsResult;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaobaoMeterial;
|
| | | import com.yeshi.fanli.entity.taobao.dataoke.DaTaoKeDetailV2;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonTemplateContentService;
|
| | | import com.yeshi.fanli.service.inter.lable.TaoKeGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaobaoMeterialService;
|
| | | import com.yeshi.fanli.service.inter.taobao.dataoke.DaTaoKeGoodsDetailService;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private DaTaoKeGoodsDetailService daTaoKeGoodsDetailService;
|
| | |
|
| | | @Resource
|
| | | private TaobaoMeterialService taobaoMeterialService;
|
| | |
|
| | | @Resource
|
| | | private TaoKeGoodsService taoKeGoodsService;
|
| | |
|
| | | private static List<CommonContentNav> getCommonNav() {
|
| | | List<CommonContentNav> navList = new ArrayList<>();
|
| | |
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.muYin) {
|
| | | navList.add(new CommonContentNav("1", "精选"));
|
| | | navList.add(new CommonContentNav("2", "备孕"));
|
| | | navList.add(new CommonContentNav("3", "0~6月"));
|
| | | navList.add(new CommonContentNav("4", "7~12月"));
|
| | | navList.add(new CommonContentNav("5", "1~3岁"));
|
| | | navList.add(new CommonContentNav("6", "4~6岁"));
|
| | | navList.add(new CommonContentNav("7", "7~12岁"));
|
| | | navList.add(new CommonContentNav("备孕", "备孕"));
|
| | | navList.add(new CommonContentNav("0至6个月", "0~6月"));
|
| | | navList.add(new CommonContentNav("7至12个月", "7~12月"));
|
| | | navList.add(new CommonContentNav("1至3岁", "1~3岁"));
|
| | | navList.add(new CommonContentNav("4至6岁", "4~6岁"));
|
| | | navList.add(new CommonContentNav("7至12岁", "7~12岁"));
|
| | | } else if (type == CommonContentTypeEnum.reMai) {
|
| | | navList = getCommonNav();
|
| | | } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
|
| | |
| | | public CommonContentResult getContentList(CommonContentTypeEnum type, String cid, int page, int pageSize) {
|
| | | if (type == CommonContentTypeEnum._9k9) {
|
| | | return get9K9Content(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.juJia) {
|
| | | return getJuJiaShengHuoContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.muYin) {
|
| | | return getMuYinJingXuanContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.meiShi) {
|
| | | return getYouXuanMeiShiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chuanYiDaPei) {
|
| | | return getChuanYiDaPeiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.meiZhuangGehu) {
|
| | |
| | | return getYunDongKuXieContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.qiCheHuWai) {
|
| | | return getQiCheHuWaiContent(cid, page, pageSize);
|
| | | } else if (type == CommonContentTypeEnum.chaoPinReMai) {
|
| | | return getChaoPinReMaiContent(cid, page, pageSize);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 居家生活
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getJuJiaShengHuoContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(4);// 居家生活
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 优选美食
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getYouXuanMeiShiContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(6);// 美食
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("", cidList, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 潮品热卖
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getChaoPinReMaiContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | |
|
| | | int sort = getCommonSort(cid);
|
| | | result = DaTaoKeApiUtil.search("潮", null, null, null, page, pageSize, sort);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | return new CommonContentResult(goodsList, count);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取母婴精选
|
| | | * |
| | | * @param cid
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | private CommonContentResult getMuYinJingXuanContent(String cid, int page, int pageSize) {
|
| | | DaTaoKeGoodsResult result = null;
|
| | | if ("1".equalsIgnoreCase(cid)) {// 大淘客数据
|
| | | List<Integer> cidList = new ArrayList<>();
|
| | | cidList.add(2);// 母婴
|
| | | result = DaTaoKeApiUtil.search("", null, null, null, page, pageSize, DaTaoKeApiUtil.SORT_DEFAULT);
|
| | | List<TaoBaoGoodsBrief> goodsList = new ArrayList<>();
|
| | | long count = 0;
|
| | | if (result != null) {
|
| | | count = result.getTotalCount();
|
| | | if (result.getGoodsList() != null)
|
| | | for (DaTaoKeDetailV2 detail : result.getGoodsList())
|
| | | goodsList.add(TaoBaoUtil.convert(detail));
|
| | | }
|
| | | return new CommonContentResult(goodsList, count);
|
| | |
|
| | | } else {//
|
| | | List<TaobaoMeterial> taobaoMeterials = taobaoMeterialService.selectByClassNameAndSuperNameCache("母婴_" + cid,
|
| | | "母婴主题");
|
| | |
|
| | | if (taobaoMeterials == null || taobaoMeterials.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | TaobaoMeterial meterial = taobaoMeterials.get(0);
|
| | | Integer materialId = meterial.getMaterialId();
|
| | | if (materialId != null) {
|
| | | List<TaoBaoGoodsBrief> listBrands = new ArrayList<>();
|
| | | try {
|
| | | listBrands = taoKeGoodsService.listByMaterial(materialId, page, pageSize);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return new CommonContentResult(listBrands, 1000);
|
| | | }
|
| | | return new CommonContentResult(new ArrayList<>(), 0);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 穿衣搭配
|
| | | *
|
| | | * @param cid
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.homemodule;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.DeviceSexDao;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.DeviceSex;
|
| | | import com.yeshi.fanli.service.inter.homemodule.DeviceSexService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class DeviceSexServiceImpl implements DeviceSexService {
|
| | |
|
| | | @Resource
|
| | | private DeviceSexDao deviceSexDao;
|
| | |
|
| | | @Override
|
| | | public void save(String device, Integer sex) {
|
| | | if (StringUtil.isNullOrEmpty(device) || sex == null) {
|
| | | return;
|
| | | }
|
| | | DeviceSex deviceSex = new DeviceSex();
|
| | | deviceSex.setId(device);
|
| | | deviceSex.setSex(sex);
|
| | | deviceSex.setCreateTime(new Date());
|
| | | deviceSexDao.save(deviceSex);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public Integer getSex(String device) {
|
| | | DeviceSex deviceSex = deviceSexDao.get(device);
|
| | | if (deviceSex != null) {
|
| | | return deviceSex.getSex();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteSex(String device) {
|
| | | deviceSexDao.delete(device);
|
| | | }
|
| | | |
| | | @Override
|
| | | public int changeDeviceSex(Integer sex, String device) {
|
| | | if (sex == null || sex < 0 || sex > 2) {
|
| | | sex = 0;
|
| | | }
|
| | | |
| | | Integer sexDevice = getSex(device);
|
| | | if (sexDevice == null) {
|
| | | sexDevice = 0;
|
| | | }
|
| | | |
| | | if (sex == 0 && sexDevice != 0) {
|
| | | deleteSex(device);
|
| | | } |
| | | |
| | | if(sex > 0 && sex != sexDevice) {
|
| | | save(device, sex);
|
| | | }
|
| | | return sex;
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public int getDeviceSex(String device) {
|
| | | Integer sexDevice = getSex(device);
|
| | | if (sexDevice == null) {
|
| | | sexDevice = 0;
|
| | | }
|
| | | return sexDevice;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.tlj;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.tlj.ConfigTaoLiJinMapper;
|
| | | import com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | |
|
| | | @Service
|
| | | public class ConfigTaoLiJinServiceImpl implements ConfigTaoLiJinService{
|
| | |
|
| | | @Resource
|
| | | private ConfigTaoLiJinMapper configTaoLiJinMapper;
|
| | |
|
| | | @Override
|
| | | public ConfigTaoLiJin getByKey(String key) {
|
| | | return configTaoLiJinMapper.getByKey(key);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @Cacheable(value = "config", key = "'getValueByKey-' + #key")
|
| | | public String getValueByKey(String key) {
|
| | | ConfigTaoLiJin config = configTaoLiJinMapper.getByKey(key);
|
| | | if(config != null) {
|
| | | return config.getValue();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.tlj;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.tlj.DeviceTaoLiJinRecordDao;
|
| | | import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
|
| | | import com.yeshi.fanli.service.inter.tlj.DeviceTaoLiJinRecordService;
|
| | |
|
| | | @Service
|
| | | public class DeviceTaoLiJinRecordServiceImpl implements DeviceTaoLiJinRecordService{
|
| | |
|
| | | @Resource
|
| | | private DeviceTaoLiJinRecordDao deviceTaoLiJinRecordDao;
|
| | | |
| | | |
| | | @Override
|
| | | public DeviceTaoLiJinRecord getByDevice(String device) {
|
| | | return deviceTaoLiJinRecordDao.get(device);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void save(String device, BigDecimal money) {
|
| | | DeviceTaoLiJinRecord deviceRecord = new DeviceTaoLiJinRecord();
|
| | | deviceRecord.setId(device);
|
| | | deviceRecord.setMoney(money);
|
| | | deviceRecord.setCreateTime(new Date());
|
| | | deviceTaoLiJinRecordDao.save(deviceRecord);
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.tlj;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.tlj.GoodsTaoLiJinRateDao;
|
| | | import com.yeshi.fanli.entity.bus.tlj.GoodsTaoLiJinRate;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.service.inter.tlj.ConfigTaoLiJinService;
|
| | | import com.yeshi.fanli.service.inter.tlj.GoodsTaoLiJinRateService;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | @Service
|
| | | public class GoodsTaoLiJinRateServiceImpl implements GoodsTaoLiJinRateService{
|
| | |
|
| | | @Resource
|
| | | private GoodsTaoLiJinRateDao goodsTaoLiJinRateDao;
|
| | | |
| | | @Resource
|
| | | private ConfigTaoLiJinService configTaoLiJinService;
|
| | |
|
| | | @Override
|
| | | public GoodsTaoLiJinRate getById(Long goodId) {
|
| | | return goodsTaoLiJinRateDao.get(goodId.toString());
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public BigDecimal getGoodsSpreadMoney(TaoBaoGoodsBrief goods){
|
| | | // 商品本身的总返利
|
| | | BigDecimal goodsHongBao = TaoBaoUtil.getGoodsHongBaoMoney(goods,new BigDecimal(100));
|
| | | |
| | | // 随机比例 % {5、6、7、8}
|
| | | int randomRate = 5;
|
| | | GoodsTaoLiJinRate taoLiJinRate = getById(goods.getAuctionId());
|
| | | if (taoLiJinRate == null) {
|
| | | randomRate = 5 + (int) (Math.random() * 4);
|
| | | taoLiJinRate = new GoodsTaoLiJinRate();
|
| | | taoLiJinRate.setGoodId(goods.getAuctionId().toString());
|
| | | taoLiJinRate.setRate(randomRate);
|
| | | taoLiJinRate.setCreateTime(new Date());
|
| | | taoLiJinRate.setUpdateTime(new Date());
|
| | | goodsTaoLiJinRateDao.save(taoLiJinRate); |
| | | |
| | | } else {
|
| | | randomRate = taoLiJinRate.getRate();
|
| | | }
|
| | | BigDecimal spreadMoney = MoneyBigDecimalUtil.mul(new BigDecimal(randomRate * 0.1), goodsHongBao);
|
| | | |
| | | // 预警值
|
| | | String warningValue = configTaoLiJinService.getValueByKey("warning_value");
|
| | | // 计算公式: 淘礼金面额=(返利*利润预警值)*{0.5、0.6、0.7、0.8}≥1元
|
| | | spreadMoney = MoneyBigDecimalUtil.mul(new BigDecimal(Integer.parseInt(warningValue) * 0.01), spreadMoney);
|
| | | |
| | | return spreadMoney;
|
| | | }
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.homemodule;
|
| | |
|
| | | public interface DeviceSexService {
|
| | |
|
| | | /**
|
| | | * 保存设置
|
| | | * @param device
|
| | | * @param sex
|
| | | */
|
| | | public void save(String device, Integer sex);
|
| | |
|
| | | /**
|
| | | * 获取设置
|
| | | * @param device
|
| | | * @return
|
| | | */
|
| | | public Integer getSex(String device);
|
| | |
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | * @param device
|
| | | */
|
| | | public void deleteSex(String device);
|
| | |
|
| | | /**
|
| | | * 获取设备性别
|
| | | * @param sex
|
| | | * @param device
|
| | | * @return
|
| | | */
|
| | | public int getDeviceSex(String device);
|
| | |
|
| | | /**
|
| | | * 改变设备信息
|
| | | * @param sex
|
| | | * @param device
|
| | | * @return
|
| | | */
|
| | | public int changeDeviceSex(Integer sex, String device);
|
| | |
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.tlj;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.tlj.ConfigTaoLiJin;
|
| | |
|
| | | public interface ConfigTaoLiJinService {
|
| | | |
| | | /**
|
| | | * 根据key值查询
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public ConfigTaoLiJin getByKey(String key);
|
| | |
|
| | | /**
|
| | | * 根据key值 获取value
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public String getValueByKey(String key);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.tlj;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.tlj.DeviceTaoLiJinRecord;
|
| | |
|
| | | public interface DeviceTaoLiJinRecordService {
|
| | | |
| | | /**
|
| | | * 根据key值查询
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public DeviceTaoLiJinRecord getByDevice(String device);
|
| | |
|
| | | /**
|
| | | * 保存
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public void save(String device, BigDecimal money);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.tlj;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.tlj.GoodsTaoLiJinRate;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
|
| | | public interface GoodsTaoLiJinRateService {
|
| | | |
| | | /**
|
| | | * 根据key值查询
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public GoodsTaoLiJinRate getById(Long goodId);
|
| | |
|
| | |
|
| | | /**
|
| | | * 获取商品推广红包
|
| | | * @param goods
|
| | | * @return
|
| | | */
|
| | | public BigDecimal getGoodsSpreadMoney(TaoBaoGoodsBrief goods);
|
| | |
|
| | | }
|
| | |
| | | public class Constant {
|
| | | public static boolean IS_TASK = false;
|
| | | // 外网环境
|
| | | public static boolean IS_OUTNET = true;
|
| | | public static boolean IS_OUTNET = false;
|
| | |
|
| | | public static boolean IS_TEST = false;
|
| | | public static boolean IS_TEST = true;
|
| | |
|
| | | public static int PAGE_SIZE = 20;
|
| | |
|
| | |
| | | else
|
| | | return false;
|
| | | }
|
| | | |
| | | public static boolean greaterThan_1_5_60(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 43))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 54)))
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | |
|
| | | public static boolean smallerThan_1_5_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 36))
|
New file |
| | |
| | | package com.yeshi.fanli.util.factory.goods;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.jd.JDOrderItem;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | | import com.yeshi.fanli.entity.pdd.PDDOrder;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | |
|
| | | public class CommonOrderFactory {
|
| | |
|
| | | public static CommonOrder create(PDDOrder order) {
|
| | | CommonOrder commonOrder = new CommonOrder();
|
| | | commonOrder.setCount(order.getGoodsQuantity());
|
| | | commonOrder.setCreateTime(new Date());
|
| | | if (order.getOrderStatus() == 3) {
|
| | | commonOrder.seteIncome(
|
| | | MoneyBigDecimalUtil.div(new BigDecimal(order.getPromotionAmount()), new BigDecimal(100)));
|
| | | commonOrder.setSettlement(
|
| | | MoneyBigDecimalUtil.div(new BigDecimal(order.getOrderAmount()), new BigDecimal(100)));// 结算金额
|
| | | commonOrder.setSettleTime(new Date(order.getOrderVerifyTime() * 1000));
|
| | | } else {
|
| | | commonOrder.seteIncome(new BigDecimal(0));
|
| | | commonOrder.setSettlement(new BigDecimal(0));
|
| | | }
|
| | | commonOrder
|
| | | .setEstimate(MoneyBigDecimalUtil.div(new BigDecimal(order.getPromotionAmount()), new BigDecimal(100)));
|
| | | commonOrder.setOrderNo(order.getOrderSn());
|
| | | commonOrder.setPayment(MoneyBigDecimalUtil.div(new BigDecimal(order.getOrderAmount()), new BigDecimal(100)));
|
| | | commonOrder.setSourcePosition(order.getpId());
|
| | | commonOrder.setSourceType(Constant.SOURCE_TYPE_PDD);
|
| | | int state = 0;
|
| | |
|
| | | if (-1 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_SX;
|
| | | } else if (0 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_FK;
|
| | | } else if (1 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_FK;
|
| | | } else if (2 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_FK;
|
| | | } else if (3 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_FK;
|
| | | } else if (4 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_WQ;
|
| | | } else if (5 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_JS;
|
| | | } else if (8 == order.getOrderStatus()) {
|
| | | state = CommonOrder.STATE_SX;
|
| | | }
|
| | | commonOrder.setOrderBy(1);
|
| | | commonOrder.setState(state);
|
| | | commonOrder.setThirdCreateTime(new Date(order.getOrderCreateTime() * 1000));
|
| | | commonOrder.setUpdateTime(new Date());
|
| | | commonOrder.setTradeId(order.getOrderId());
|
| | | return commonOrder;
|
| | | }
|
| | |
|
| | | public static CommonOrder create(JDOrderItem order) {
|
| | | if (order.getOrder() == null)
|
| | | return null;
|
| | | CommonOrder commonOrder = new CommonOrder();
|
| | | commonOrder.setCount(Integer.parseInt(order.getSkuNum() + ""));
|
| | | commonOrder.setCreateTime(new Date());
|
| | | if (order.getValidCode() == 17) {
|
| | | commonOrder.seteIncome(order.getActualFee());
|
| | | commonOrder.setSettlement(order.getActualCosPrice());
|
| | | commonOrder.setSettleTime(new Date(order.getOrder().getFinishTime()));
|
| | | } else {
|
| | | commonOrder.seteIncome(order.getActualFee());
|
| | | commonOrder.setSettlement(order.getActualCosPrice());
|
| | | }
|
| | | commonOrder.setOrderNo(order.getOrderId() + "");
|
| | | commonOrder.setPayment(order.getEstimateCosPrice());
|
| | | commonOrder.setSourcePosition(order.getPositionId() + "");
|
| | | commonOrder.setSourceType(Constant.SOURCE_TYPE_JD);
|
| | | int state = 0;
|
| | | if (order.getValidCode() < 16) {
|
| | | state = CommonOrder.STATE_SX;
|
| | | } else if (order.getValidCode() == 16) {
|
| | | state = CommonOrder.STATE_FK;
|
| | | } else if (order.getValidCode() == 17) {
|
| | | state = CommonOrder.STATE_JS;
|
| | | }
|
| | | commonOrder.setOrderBy(order.getOrderBy());
|
| | | commonOrder.setState(state);
|
| | | commonOrder.setThirdCreateTime(new Date(order.getOrder().getOrderTime()));
|
| | | commonOrder.setUpdateTime(new Date());
|
| | | commonOrder.setTradeId(order.getTradeId());
|
| | | commonOrder.setEstimate(order.getEstimateFee());
|
| | | return commonOrder;
|
| | | }
|
| | |
|
| | | }
|