| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.brand.BrandClass;
|
| | | import com.yeshi.fanli.entity.brand.TaoBaoShopHistory;
|
| | | import com.yeshi.fanli.entity.bus.lable.QualityFactory;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShop;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | |
| | | import com.yeshi.fanli.service.inter.brand.BrandClassService;
|
| | | import com.yeshi.fanli.service.inter.brand.BrandClassShopService;
|
| | | import com.yeshi.fanli.service.inter.brand.TaoBaoShopHistoryService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.lable.QualityGoodsService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoShopService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | @Resource
|
| | | private HongBaoManageService manageService;
|
| | |
|
| | | |
| | | @Resource
|
| | | private QualityGoodsService qualityGoodsService;
|
| | | private TaoBaoGoodsBriefService taoBaoGoodsBriefService;
|
| | |
|
| | | /**
|
| | | * 获取品牌分类
|
| | |
| | | }
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | | List<QualityFactory> listQuery = qualityGoodsService.listByShopId((page - 1) * pageSize, pageSize, sid);
|
| | | List<TaoBaoGoodsBrief> listGoods = taoBaoGoodsBriefService.listByShopId((page - 1) * pageSize, pageSize, sid);
|
| | |
|
| | | long count = 0;
|
| | | JSONArray array = new JSONArray();
|
| | | if (listQuery != null && listQuery.size() > 0) {
|
| | | if (listGoods != null && listGoods.size() > 0) {
|
| | | List<Long> listGid = new ArrayList<Long>();
|
| | | for (QualityFactory qualityFactory : listQuery) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = qualityFactory.getTaoBaoGoodsBrief();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoods) {
|
| | | listGid.add(taoBaoGoodsBrief.getAuctionId());
|
| | | }
|
| | |
|
| | |
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | |
|
| | | BigDecimal proportion = manageService.getFanLiRate();
|
| | | for (QualityFactory selectionGoods : listQuery) {
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = selectionGoods.getTaoBaoGoodsBrief();
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | for (TaoBaoGoodsBrief taoBaoGoodsBrief : listGoods) {
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | boolean stateSale = false; // 默认停售
|
| | | Long goodsId = taoBaoGoodsBrief.getAuctionId();
|
| | |
| | | }
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(taoBaoGoodsBrief, proportion.toString(), null)));
|
| | | }
|
| | | count = qualityGoodsService.countByShopId(sid);
|
| | | count = taoBaoGoodsBriefService.countByShopId(sid);
|
| | | }
|
| | | data.put("count", count);
|
| | | data.put("list", array);
|
| | |
| | | import com.yeshi.fanli.service.inter.user.BindingAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.MaskKeyService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | |
| | |
|
| | | @Resource
|
| | | private AccountMessageService accountMessageService;
|
| | | |
| | | @Resource
|
| | | private MaskKeyService maskKeyService;
|
| | | |
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | |
| | | out.print(JsonUtil.loadFalseResult("昵称过长"));
|
| | | return;
|
| | | }
|
| | | |
| | | if(maskKeyService.examineContent(nickName)) {
|
| | | out.print(JsonUtil.loadFalseResult("不能包含敏感词汇"));
|
| | | return;
|
| | | }
|
| | | |
| | | userInfoService.saveUserInfo(nickName, uid);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; |
| | | |
| | | public interface TaoBaoGoodsBriefMapper { |
| | | public interface TaoBaoGoodsBriefMapper extends BaseMapper<TaoBaoGoodsBrief>{ |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int deleteByAuctionId(Long auctionId); |
| | | |
| | | int insert(TaoBaoGoodsBrief record); |
| | | |
| | | int insertSelective(TaoBaoGoodsBrief record); |
| | | |
| | | TaoBaoGoodsBrief selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(TaoBaoGoodsBrief record); |
| | | |
| | | int updateByPrimaryKey(TaoBaoGoodsBrief record); |
| | | |
| | | /** |
| | | * 根据auctionId 查询商品信息 |
| | |
| | | List<Long> queryCanDeleteGoods(@Param("maxTime") Date maxTime,@Param("start")int start,@Param("count")int count); |
| | | |
| | | Long queryCanDeleteGoodsCount(@Param("maxTime") Date maxTime); |
| | | |
| | | |
| | | /** |
| | | * 根据店铺信息获取商品 |
| | | * @param start |
| | | * @param count |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | | List<TaoBaoGoodsBrief> listByShopId(@Param("start") long start, @Param("count") int count, |
| | | @Param("shopId") Long shopId); |
| | | |
| | | long countByShopId(@Param("shopId") Long shopId); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.recommend.MaskKey; |
| | | |
| | | public interface MaskKeyMapper extends BaseMapper<MaskKey> { |
| | | |
| | | /** |
| | | * 验证内容是否存在敏感词汇 |
| | | * @param content |
| | | * @return |
| | | */ |
| | | int examineContent(@Param("content") String content); |
| | | } |
| | |
| | | package com.yeshi.fanli.entity.bus.recommend;
|
| | |
|
| | | import javax.persistence.Column;
|
| | | import javax.persistence.Entity;
|
| | | import javax.persistence.GeneratedValue;
|
| | | import javax.persistence.GenerationType;
|
| | | import javax.persistence.Id;
|
| | | import javax.persistence.Table;
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 铭感词库
|
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Entity
|
| | | @Table(name = "yeshi_ec_mask_key")
|
| | | @Table("yeshi_ec_mask_key")
|
| | | public class MaskKey {
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Column(name = "`id`")
|
| | | |
| | | @Column(name = "id")
|
| | | private long id;
|
| | | @Column(name = "content")
|
| | | private String content;
|
| | | |
| | |
|
| | | public MaskKey() {
|
| | |
|
| | |
| | | @org.yeshi.utils.mybatis.Column(name = "sellerId")
|
| | | private Long sellerId;// 卖家Id
|
| | |
|
| | | @Expose
|
| | | @org.yeshi.utils.mybatis.Column(name = "userType")
|
| | | private Integer userType;// 0,
|
| | |
|
| | |
| | | @Scheduled(cron = "0 0/10 6-23 * * ?")
|
| | | public void insetDynamicInfo() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | // if (!Constant.IS_TASK) {
|
| | | // return;
|
| | | // }
|
| | |
|
| | | try {
|
| | | dynamicInfoService.insertTimeHotSale();
|
| | |
| | | @Scheduled(cron = "0 0 6,7,15,16,21,22,23 * * ? ")
|
| | | public void insetShopInfo1() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | // if (!Constant.IS_TASK) {
|
| | | // return;
|
| | | // }
|
| | |
|
| | | try {
|
| | | dynamicInfoService.insertShopInfo();
|
| | |
| | | @Scheduled(cron = "0 0/30 8,9,10 * * ?")
|
| | | public void insetShopInfo2() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | // if (!Constant.IS_TASK) {
|
| | | // return;
|
| | | // }
|
| | |
|
| | | try {
|
| | | dynamicInfoService.insertShopInfo();
|
| | |
| | | @Scheduled(cron = "0 0/30 11,12,13,14 * * ?")
|
| | | public void insetShopInfo3() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | // if (!Constant.IS_TASK) {
|
| | | // return;
|
| | | // }
|
| | |
|
| | | try {
|
| | | dynamicInfoService.insertShopInfo();
|
| | |
| | | @Scheduled(cron = "0 0/30 17,18,19,20 * * ? ")
|
| | | public void insetShopInfo4() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | // if (!Constant.IS_TASK) {
|
| | | // return;
|
| | | // }
|
| | |
|
| | | try {
|
| | | dynamicInfoService.insertShopInfo();
|
| | |
| | | @Scheduled(cron = "0 0 0 * * ?")
|
| | | public void remove() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | |
| | | // if (!Constant.IS_TASK) {
|
| | | // return;
|
| | | // }
|
| | | // |
| | | try {
|
| | | dynamicInfoService.removeByDate(DateUtil.reduceDay(3, new Date()));
|
| | | } catch (Exception e) {
|
| | |
| | | @Scheduled(cron = "0 0/3 * * * ?")
|
| | | public void activityNeedPublish() {
|
| | |
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | |
| | | // if (!Constant.IS_TASK) {
|
| | | // return;
|
| | | // }
|
| | | // |
| | | try {
|
| | | List<RecommendActivity> list = activityService.getNeedPublish();
|
| | | if (list == null || list.size() == 0) {
|
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="listByShopId" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_taobao_goods` t |
| | | WHERE t.`sellerId` = #{shopId} |
| | | ORDER BY t.`biz30day` DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countByShopId" resultType="java.lang.Long"> |
| | | SELECT ifnull(count(id),0) FROM `yeshi_ec_taobao_goods` |
| | | WHERE `sellerId` = #{shopId} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_taobao_goods where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
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.user.MaskKeyMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.recommend.MaskKey"> |
| | | <id column="id" property="id" jdbcType="VARCHAR"/> |
| | | <result column="content" property="content" jdbcType="VARCHAR"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,content</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_mask_key where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_mask_key where id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.recommend.MaskKey" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_mask_key (id,content) values (#{id,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.recommend.MaskKey" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_mask_key |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="content != null">content,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=VARCHAR},</if> |
| | | <if test="content != null">#{content,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.recommend.MaskKey">update yeshi_ec_mask_key set content = #{content,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.recommend.MaskKey">update yeshi_ec_mask_key |
| | | <set> |
| | | <if test="content != null">content=#{content,jdbcType=VARCHAR},</if> |
| | | </set> where id = #{id,jdbcType=VARCHAR} |
| | | </update> |
| | | |
| | | <select id="examineContent" resultType="Integer"> |
| | | SELECT COUNT(t.id) FROM `yeshi_ec_mask_key` t |
| | | WHERE INSTR(#{content},t.`content`) <![CDATA[>]]> 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | |
|
| | | return taoBaoGoodsBrief;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<TaoBaoGoodsBrief> listByShopId(long start, int count, Long shopId) {
|
| | | return taoBaoGoodsBriefMapper.listByShopId(start, count, shopId);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public long countByShopId(Long shopId) {
|
| | | return taoBaoGoodsBriefMapper.countByShopId(shopId);
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.MaskKeyMapper;
|
| | | import com.yeshi.fanli.service.inter.user.MaskKeyService;
|
| | |
|
| | | @Service
|
| | | public class MaskKeyServiceImpl implements MaskKeyService {
|
| | |
|
| | | @Resource
|
| | | private MaskKeyMapper maskKeyMapper;
|
| | |
|
| | | @Override
|
| | | public boolean examineContent(String content) {
|
| | | boolean isValid = true;
|
| | | int count = maskKeyMapper.examineContent(content);
|
| | | if (count > 0) {
|
| | | isValid = false;
|
| | | }
|
| | |
|
| | | return isValid;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public List<TaoBaoGoodsBrief> listQueryByAuctionId(List<Long> list);
|
| | | |
| | | /**
|
| | | * 根据店铺id查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param shopId
|
| | | * @return
|
| | | */
|
| | | public List<TaoBaoGoodsBrief> listByShopId(long start, int count, Long shopId);
|
| | |
|
| | |
|
| | | |
| | | public long countByShopId(Long shopId);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | public interface MaskKeyService {
|
| | |
|
| | | /**
|
| | | * 验证内容是否存在敏感词汇
|
| | | * @param content
|
| | | * @return
|
| | | */
|
| | | public boolean examineContent(String content);
|
| | | }
|