| | |
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Collections;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.common.JumpDetail;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.goods.ScanHistoryV2;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | | import com.yeshi.fanli.entity.taobao.ScanHistory;
|
| | | import com.yeshi.fanli.entity.taobao.SearchFilter;
|
| | | import com.yeshi.fanli.entity.taobao.TBPid;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoShopInfo;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.goods.CommonGoodsException;
|
| | | import com.yeshi.fanli.exception.goods.ScanHistoryException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsUpdateException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.HonestService;
|
| | | import com.yeshi.fanli.service.inter.goods.RecommendBannerService;
|
| | | import com.yeshi.fanli.service.inter.goods.RecommendSectionGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerService;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendBannerV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.SuperRecommendSectionService;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.OrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.ScanHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.ShareManageService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | |
| | | private OrderService orderService;
|
| | |
|
| | | @Resource
|
| | | private ScanHistoryService scanHistoryService;
|
| | | private ScanHistoryV2Service scanHistoryV2Service;
|
| | |
|
| | | @Resource
|
| | | private ShareManageService shareManageService;
|
| | |
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 添加浏览记录
|
| | |
|
| | | ScanHistory sh = TaoBaoUtil.getScanHistory(tbb);
|
| | | sh.setDevice(acceptData.getDevice());
|
| | | sh.setSystem(systemService.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | sh.setCreatetime(new Date());
|
| | | if (uid != null && !uid.equals("")) {
|
| | | sh.setUid(Long.parseLong(uid));
|
| | | }
|
| | | try {
|
| | | scanHistoryService.addScanHistory(sh);
|
| | | scanHistoryV2Service.addScanHistory(StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid),
|
| | | acceptData.getDevice(), tbb);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 添加浏览记录
|
| | | ScanHistory sh = TaoBaoUtil.getScanHistory(goodsInfo);
|
| | | sh.setId(0);
|
| | | sh.setDevice(acceptData.getDevice());
|
| | | sh.setSystem(systemService.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | sh.setCreatetime(new Date());
|
| | | if (!StringUtil.isNullOrEmpty(tempUid)) {
|
| | | sh.setUid(Long.parseLong(tempUid));
|
| | | }
|
| | | try {
|
| | | scanHistoryService.addScanHistory(sh);
|
| | | } catch (Exception e) {
|
| | | scanHistoryV2Service.addScanHistory(
|
| | | StringUtil.isNullOrEmpty(tempUid) ? null : Long.parseLong(tempUid), acceptData.getDevice(),
|
| | | goodsInfo);
|
| | | } catch (NumberFormatException e) {
|
| | | e.printStackTrace();
|
| | | } catch (CommonGoodsException e) {
|
| | | e.printStackTrace();
|
| | | } catch (ScanHistoryException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // try {
|
| | | // taoBaoGoodsBriefService.updateTBGoodsWithNewInfo(goodsInfo);
|
| | | // } catch (Exception e) {
|
| | | //
|
| | | // }
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadFalseResult(1, "不存在该系统"));
|
| | | return;
|
| | | }
|
| | | boolean b = NumberUtil.isNumeric(uid);
|
| | | long id = 0;
|
| | | if (b) {
|
| | | id = Long.parseLong(uid);
|
| | | }
|
| | | List<ScanHistory> list = scanHistoryService.getScanHistory(sys.getId(), acceptData.getDevice(), page, 20, id);
|
| | | long count = scanHistoryService.getScanHistoryCount(sys.getId(), acceptData.getDevice(), id);
|
| | | List<ScanHistoryV2> list = scanHistoryV2Service.getScanHistoryByDeviceOrUid(
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(), page, 20);
|
| | | long count = scanHistoryV2Service.getCountByDeviceOrUid(
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice());
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | JSONArray array = new JSONArray();
|
| | |
| | | Map<String, String> map = hongBaoManageService.convertMap();
|
| | | String proportion = map.get("hongbao_goods_proportion");
|
| | | String fcRate = map.get("hongbao_fc_ratio");
|
| | | for (ScanHistory sh : list) {
|
| | | sh.setSalesCount(TaoBaoUtil.getSaleCount(sh.getBiz30day()));
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(TaoBaoUtil.getTaoBaoGoodsBrief(sh),
|
| | | proportion, fcRate, "")));
|
| | | for (ScanHistoryV2 sh : list) {
|
| | | TaoBaoGoodsBrief goods = TaoBaoUtil.convert(sh.getCommonGoods());
|
| | | goods.setId(sh.getId());
|
| | | array.add(gson.toJson(TaoBaoUtil.getTaoBaoGoodsBriefExtra(goods, proportion, fcRate, "")));
|
| | | }
|
| | | }
|
| | | data.put("data", array);
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | long id = 0;
|
| | | if (NumberUtil.isNumeric(uid)) {
|
| | | id = Long.parseLong(uid);
|
| | | }
|
| | |
|
| | | if ("0".equals(type)) {
|
| | | String[] idStr = ids.split(",");
|
| | | for (String auctionIdStr : idStr) {
|
| | | scanHistoryService.deleteScanHistory(acceptData.getDevice(), sys, Long.parseLong(auctionIdStr), id);
|
| | | scanHistoryV2Service.deleteByAuctionIdAndDeviceOrUid(
|
| | | StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid), acceptData.getDevice(),
|
| | | Long.parseLong(auctionIdStr));
|
| | | }
|
| | | } else {
|
| | | scanHistoryService.deleteScanHistory(acceptData.getDevice(), sys, id);
|
| | | scanHistoryV2Service.deleteByDeviceOrUid(StringUtil.isNullOrEmpty(uid) ? null : Long.parseLong(uid),
|
| | | acceptData.getDevice());
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | |
|
| | |
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 添加浏览记录
|
| | | ScanHistory sh = TaoBaoUtil.getScanHistory(goodsInfo);
|
| | | sh.setId(0);
|
| | | sh.setDevice(acceptData.getDevice());
|
| | | sh.setSystem(systemService.getSystem(acceptData.getPlatform(), acceptData.getPackages()));
|
| | | sh.setCreatetime(new Date());
|
| | | if (!StringUtil.isNullOrEmpty(tempUid)) {
|
| | | sh.setUid(Long.parseLong(tempUid));
|
| | | }
|
| | | try {
|
| | | scanHistoryService.addScanHistory(sh);
|
| | | scanHistoryV2Service.addScanHistory(
|
| | | StringUtil.isNullOrEmpty(tempUid) ? null : Long.parseLong(tempUid), acceptData.getDevice(),
|
| | | goodsInfo);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | |
| | | /** |
| | | * 查询一度队员集合 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<ThreeSale> queryMyFirstTeamList(@Param("start") int start, @Param("count") int count, |
| | | @Param("key") String key,@Param("bossId") Long bossId); |
| | | List<ThreeSale> queryMyFirstTeamList(@Param("start") int start, @Param("count") int count, @Param("key") String key, |
| | | @Param("bossId") Long bossId); |
| | | |
| | | long queryCountMyFirstTeamList(@Param("key") String key,@Param("bossId") Long bossId); |
| | | |
| | | |
| | | /** |
| | | * 查询二度队员集合 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | |
| | | long queryCountMySecondTeamList(@Param("key") String key,@Param("bossId") Long bossId); |
| | | |
| | | |
| | | /** |
| | | * 长时间未邀请成功用户 |
| | | * |
| | | * @param daysNum |
| | | * @return |
| | | */ |
| | | List<Long> queryLongTimeFailed(@Param("daysNum") int daysNum); |
| | | |
| | | |
| | | /** |
| | | * 长时间 邀请成功用户 |
| | | * |
| | | * @param daysNum |
| | | * @return |
| | | */ |
| | | List<ThreeSale> queryLongTimeSuccess(@Param("daysNum") int daysNum); |
| | | |
| | | |
| | | /** |
| | | * 设置对应邀请过期 |
| | | * |
| | | * @param list |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 一级查询 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | List<ThreeSale> listFirstTeamQuery(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid, |
| | | @Param("state")Integer state, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | long countFirstTeamQuery(@Param("uid") Long uid, @Param("state")Integer state, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | long countFirstTeamQuery(@Param("uid") Long uid, @Param("state") Integer state, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 二级查询 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | |
| | | List<ThreeSale> listSecondTeamQuery(@Param("start")long start, @Param("count")int count, @Param("uid")Long uid, |
| | | @Param("state")Integer state, @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | long countSecondTeamQuery(@Param("uid")Long uid, @Param("state")Integer state, @Param("startTime")String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | |
| | | long countSecondTeamQuery(@Param("uid") Long uid, @Param("state") Integer state, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 上级查询 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | |
| | | |
| | | long countSuperiorQuery(@Param("state")Integer state, @Param("uid") Long uid); |
| | | |
| | | |
| | | /** |
| | | * 查询一级队员 |
| | | * |
| | | * @param paramLong |
| | | * @param paramInt |
| | | * @param paramLong1 |
| | |
| | | |
| | | /** |
| | | * 统计一级队员 |
| | | * |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 查询二级队员 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | |
| | | |
| | | /** |
| | | * 统计二级队员 |
| | | * |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 根据id、uid查询 |
| | | * |
| | | * @param id |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listbyIdAndBossId(@Param("id")Long id, @Param("uid") Long uid, @Param("expire") Integer expire); |
| | | |
| | | /** |
| | | * 根据邀请者ID查询关系 |
| | | * |
| | | * @param workerId |
| | | * @return |
| | | */ |
| | | List<ThreeSale> listByWorkerId(Long workerId); |
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.goods; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.goods.ScanHistoryV2; |
| | | |
| | | public interface ScanHistoryV2Mapper extends BaseMapper<ScanHistoryV2> { |
| | | |
| | | /** |
| | | * 根据UID或者设备号获取浏览记录 |
| | | * |
| | | * @param uid |
| | | * @param device |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<ScanHistoryV2> selectByDeviceOrUid(@Param("uid") Long uid, @Param("device") String device, |
| | | @Param("start") long start, @Param("count") int count); |
| | | |
| | | /** |
| | | * 根据UID或者设备号获取浏览记录条数 |
| | | * |
| | | * @param uid |
| | | * @param device |
| | | * @return |
| | | */ |
| | | Long selectCountByDeviceOrUid(@Param("uid") Long uid, @Param("device") String device); |
| | | |
| | | /** |
| | | * 根据设备或用户ID删除 |
| | | * |
| | | * @param uid |
| | | * @param device |
| | | * @return |
| | | */ |
| | | int deleteByDeviceOrUid(@Param("uid") Long uid, @Param("device") String device); |
| | | |
| | | /** |
| | | * 根据设备或用户ID与商品信息检索 |
| | | * |
| | | * @param uid |
| | | * @param device |
| | | * @param goodsId |
| | | * @param goodsType |
| | | * @return |
| | | */ |
| | | List<ScanHistoryV2> selectByDeviceOrUidAndGoodsIdAndGoodsType(@Param("uid") Long uid, |
| | | @Param("device") String device, @Param("goodsId") long goodsId, @Param("goodsType") int goodsType); |
| | | |
| | | } |
| | |
| | | @org.yeshi.utils.mybatis.Table("yeshi_ec_threeSale")
|
| | | public class ThreeSale {
|
| | |
|
| | | public static int EXPIRE_NORMAL = 0;// 正常状态
|
| | | public static int EXPIRE_OUTOFDATE = 1;// 过期状态
|
| | |
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Column(name = "id")
|
| | |
| | | |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">id,boss_id,worker_id,state,expire,succeedTime,createTime,updateTime</sql> |
| | | <sql id="Base_Column_List">id,boss_id,worker_id,state,expire,succeedTime,createTime,updateTime |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | |
| | | |
| | | |
| | | |
| | | <!-- 根据邀请者ID查询关系 --> |
| | | <select id="listByWorkerId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_threeSale s where worker_id = #{0} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_threeSale where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSale" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_threeSale |
| | | (id,boss_id,worker_id,state,expire,succeedTime,createTime,updateTime) values |
| | | (id,boss_id,worker_id,state,expire,succeedTime,createTime,updateTime) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{boss.id,jdbcType=BIGINT},#{worker.id,jdbcType=BIGINT},#{state,jdbcType=BOOLEAN},#{expire,jdbcType=INTEGER},#{succeedTime,jdbcType=BIGINT},#{createTime,jdbcType=BIGINT},#{updateTime,jdbcType=BIGINT}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSale" |
| | |
| | | update yeshi_ec_threeSale t set t.state=1, |
| | | t.succeedTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]>, |
| | | t.updateTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]> |
| | | where t.state=0 and t.worker_id=#{0} AND (t.expire = 0 OR t.expire IS NULL) |
| | | where t.state=0 and t.worker_id=#{0} AND (t.expire = 0 OR t.expire IS |
| | | NULL) |
| | | </update> |
| | | |
| | | <!-- 查询一度队员集合 --> |
| | | <select id="queryMyFirstTeamList" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_threesale` yet |
| | | WHERE yet.`state` = '1' AND yet.`boss_id` = #{bossId} AND (yet.expire = 0 OR yet.expire IS NULL) |
| | | WHERE yet.`state` = '1' AND yet.`boss_id` = #{bossId} AND (yet.expire = 0 |
| | | OR yet.expire IS NULL) |
| | | <if test="key != null and key !='' "> |
| | | and yet.`worker_id` like '%${key}%' |
| | | </if> |
| | |
| | | |
| | | <select id="queryCountMyFirstTeamList" resultType="java.lang.Long"> |
| | | SELECT count(yet.id) FROM `yeshi_ec_threesale` yet |
| | | WHERE yet.`state` = '1' AND yet.`boss_id` = #{bossId} AND (yet.expire = 0 OR yet.expire IS NULL) |
| | | WHERE yet.`state` = '1' AND yet.`boss_id` = #{bossId} AND (yet.expire = 0 |
| | | OR yet.expire IS NULL) |
| | | <if test="key != null and key !='' "> |
| | | and yet.`worker_id` like '%${key}%' |
| | | </if> |
| | |
| | | <!-- 查询二度队员集合 --> |
| | | <select id="queryMySecondTeamList" resultMap="BaseResultMap"> |
| | | SELECT yet.* FROM ( |
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts |
| | | SELECT DISTINCT(ts.`id`) AS id FROM |
| | | `yeshi_ec_threesale` ts |
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id` |
| | | WHERE ts.`state` = '1' AND tf.`boss_id`=#{bossId} AND (ts.expire = 0 OR ts.expire IS NULL) |
| | | WHERE ts.`state` = '1' AND tf.`boss_id`=#{bossId} AND (ts.expire = 0 OR |
| | | ts.expire IS NULL) |
| | | <if test="key != null and key !='' "> |
| | | and ts.`worker_id` like '%${key}%' |
| | | </if> |
| | |
| | | SELECT COUNT(A.id) FROM ( |
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts |
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id` |
| | | WHERE ts.`state` = '1' AND tf.`boss_id`=#{bossId} AND (ts.expire = 0 OR ts.expire IS NULL) |
| | | WHERE ts.`state` = '1' AND tf.`boss_id`=#{bossId} AND (ts.expire = 0 OR |
| | | ts.expire IS NULL) |
| | | <if test="key != null and key !='' "> |
| | | and ts.`worker_id` like '%${key}%' |
| | | </if> |
| | |
| | | update |
| | | yeshi_ec_threeSale t |
| | | set t.expire = 1, t.updateTime = <![CDATA[UNIX_TIMESTAMP(CURRENT_TIMESTAMP()) * 1000]]> |
| | | where t.`id` IN <foreach item="item" collection="list" open="(" separator="," |
| | | where t.`id` IN |
| | | <foreach item="item" collection="list" open="(" separator="," |
| | | close=")">#{item}</foreach> |
| | | </update> |
| | | |
| | |
| | | |
| | | <select id="listSecondTeamQuery" resultMap="AllResultMap"> |
| | | SELECT yet.* FROM ( |
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts |
| | | SELECT DISTINCT(ts.`id`) AS id FROM |
| | | `yeshi_ec_threesale` ts |
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id` |
| | | WHERE 1=1 |
| | | <if test="uid != null"> |
| | |
| | | <select id="listFirstTeam" resultMap="AllResultMap"> |
| | | SELECT * FROM `yeshi_ec_threesale` ts |
| | | LEFT JOIN `yeshi_ec_threesale_extra_info` ff |
| | | ON ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id` = ff.`tf_worker_id` |
| | | ON ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id` = |
| | | ff.`tf_worker_id` |
| | | WHERE ts.`boss_id` = #{uid} |
| | | ORDER BY ts.state DESC, ts.expire, ts.createTime DESC |
| | | LIMIT ${start},${count} |
| | |
| | | |
| | | <select id="listSecondTeam" resultMap="AllResultMap"> |
| | | SELECT yet.* FROM ( |
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts |
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` |
| | | ts |
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id` |
| | | WHERE tf.`boss_id` = #{uid} |
| | | ORDER BY ts.state DESC, ts.expire, ts.createTime DESC |
| | | LIMIT ${start},${count})A |
| | | LIMIT |
| | | ${start},${count})A |
| | | LEFT JOIN yeshi_ec_threesale yet ON yet.id = A.id |
| | | LEFT JOIN `yeshi_ec_threesale_extra_info` ff |
| | | ON yet.`boss_id` = ff.`tf_boss_id` AND yet.`worker_id` = ff.`tf_worker_id` |
| | | ON yet.`boss_id` = ff.`tf_boss_id` AND yet.`worker_id` = |
| | | ff.`tf_worker_id` |
| | | |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="getMyBoss" resultMap="AllResultMap"> |
| | | select <include refid="Base_Column_List" /> from yeshi_ec_threeSale where |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_threeSale where |
| | | state = 1 and worker_id=#{uid} |
| | | </select> |
| | | |
| | | |
| | | <select id="listbyIdAndBossId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM yeshi_ec_threeSale |
| | | SELECT |
| | | <include refid="Base_Column_List" /> |
| | | FROM yeshi_ec_threeSale |
| | | WHERE id = #{id} AND boss_id=#{uid} |
| | | <if test="expire != null and expire == 1"> |
| | | AND `expire` = 1 <!-- 失效 --> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_scanhistory_v2 where s_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <!-- 根据UID或者设备号获取浏览记录 --> |
| | | <select id="selectByDeviceOrUid" resultMap="BaseResultMap"> |
| | | SELECT s.*,MAX(s.`s_id`) AS orderid FROM yeshi_ec_scanhistory_v2 s |
| | | WHERE |
| | | <trim prefix="(" suffix=")" suffixOverrides="or"> |
| | | <if test="uid != null"> s.`s_uid`=#{uid,jdbcType=BIGINT} or</if> |
| | | <if test="device != null">s.`s_device`=#{device,jdbcType=VARCHAR} or</if> |
| | | </trim> |
| | | GROUP BY s.`s_common_goods_id` ORDER BY orderid DESC limit |
| | | #{start},#{count} |
| | | </select> |
| | | |
| | | |
| | | <!-- 根据UID或者设备号获取浏览记录条数 --> |
| | | |
| | | <select id="selectCountByDeviceOrUid" resultType="java.lang.Long"> |
| | | SELECT count(s.`s_id`) FROM yeshi_ec_scanhistory_v2 s |
| | | WHERE |
| | | <trim prefix="(" suffix=")" suffixOverrides="or"> |
| | | <if test="uid != null"> s.`s_uid`=#{uid,jdbcType=BIGINT} or</if> |
| | | <if test="device != null">s.`s_device`=#{device,jdbcType=VARCHAR} or</if> |
| | | </trim> |
| | | GROUP BY s.`s_common_goods_id` |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_scanhistory_v2 where s_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <!-- 根据设备或用户ID删除 --> |
| | | |
| | | <delete id="deleteByDeviceOrUid"> |
| | | delete from |
| | | yeshi_ec_scanhistory_v2 where |
| | | <trim prefix="(" suffix=")" suffixOverrides="or"> |
| | | <if test="uid != null"> `s_uid`=#{uid,jdbcType=BIGINT} or</if> |
| | | <if test="device != null">`s_device`=#{device,jdbcType=VARCHAR} or</if> |
| | | </trim> |
| | | </delete> |
| | | |
| | | |
| | | <!-- 根据设备或用户ID与商品信息检索 --> |
| | | <select id="selectByDeviceOrUidAndGoodsIdAndGoodsType" |
| | | resultMap="BaseResultMap"> |
| | | SELECT s.* FROM yeshi_ec_scanhistory_v2 s left join |
| | | yeshi_ec_common_goods g on g.cg_id=s.s_common_goods_id |
| | | WHERE |
| | | <trim prefix="(" suffix=")" suffixOverrides="or"> |
| | | <if test="uid != null"> s.`s_uid`=#{uid,jdbcType=BIGINT} or</if> |
| | | <if test="device != null">s.`s_device`=#{device,jdbcType=VARCHAR} or</if> |
| | | </trim> |
| | | and g.cg_goods_id=#{goodsId} and g.cg_goods_type=#{goodsType} |
| | | </select> |
| | | |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.ScanHistoryV2" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_scanhistory_v2 |
| | |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{device,jdbcType=VARCHAR},#{userInfo.id,jdbcType=BIGINT},#{commonGoods.id,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.ScanHistoryV2" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_scanhistory_v2 |
| | |
| | | <set> |
| | | <if test="device != null">s_device=#{device,jdbcType=VARCHAR},</if> |
| | | <if test="userInfo != null">s_uid=#{userInfo.id,jdbcType=BIGINT},</if> |
| | | <if test="commonGoods != null">s_common_goods_id=#{commonGoods.id,jdbcType=BIGINT},</if> |
| | | <if test="commonGoods != null">s_common_goods_id=#{commonGoods.id,jdbcType=BIGINT}, |
| | | </if> |
| | | <if test="createTime != null">s_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">s_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | |
| | | commonGoodsMapper.insertSelective(commonGoods);
|
| | | return commonGoods;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public CommonGoods addCommonGoods(CommonGoods commonGoods) throws CommonGoodsException {
|
| | | filterCommonGoods(commonGoods);
|
| | | CommonGoods goods = commonGoodsMapper.selectByGoodsIdAndGoodsType(commonGoods.getGoodsId(),
|
| | | commonGoods.getGoodsType());
|
| | | if (goods != null) {
|
| | | commonGoods.setId(goods.getId());
|
| | | return commonGoods;
|
| | | }
|
| | | commonGoods.setCreateTime(new Date());
|
| | | commonGoods.setUpdateTime(new Date());
|
| | | commonGoodsMapper.insertSelective(commonGoods);
|
| | | return commonGoods;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public void updateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException {
|
| | |
| | | package com.yeshi.fanli.service.impl.goods;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | if (history.getUserInfo() == null && StringUtil.isNullOrEmpty(history.getDevice()))
|
| | | throw new ScanHistoryException(1, "设备或用户信息缺失");
|
| | |
|
| | | CommonGoods commonGoods = commonGoodsService.addOrUpdateCommonGoods(history.getCommonGoods());
|
| | | CommonGoods commonGoods = commonGoodsService.addCommonGoods(history.getCommonGoods());
|
| | | if (commonGoods == null)
|
| | | throw new CommonGoodsException(2, "商品信息不完整");
|
| | | history.setCommonGoods(commonGoods);
|
| | | scanHistoryV2Mapper.insertSelective(history);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ScanHistoryV2> getScanHistoryByDeviceOrUid(Long uid, String device, int page, int pageSize) {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device))
|
| | | return null;
|
| | | return scanHistoryV2Mapper.selectByDeviceOrUid(uid, device, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long getCountByDeviceOrUid(Long uid, String device) {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device))
|
| | | return 0;
|
| | | Long count = scanHistoryV2Mapper.selectCountByDeviceOrUid(uid, device);
|
| | | return count == null ? 0 : count;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteByDeviceOrUid(Long uid, String device) {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device))
|
| | | return;
|
| | | scanHistoryV2Mapper.deleteByDeviceOrUid(uid, device);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void deleteByAuctionIdAndDeviceOrUid(Long uid, String device, Long auctionId) {
|
| | | if (uid == null && StringUtil.isNullOrEmpty(device))
|
| | | return;
|
| | | List<ScanHistoryV2> list = scanHistoryV2Mapper.selectByDeviceOrUidAndGoodsIdAndGoodsType(uid, device, auctionId,
|
| | | CommonGoods.GOODS_TYPE_TB);
|
| | | if (list != null)
|
| | | for (ScanHistoryV2 sv : list)
|
| | | scanHistoryV2Mapper.deleteByPrimaryKey(sv.getId());
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.ThreeSaleException;
|
| | | import com.yeshi.fanli.service.inter.config.InviteGetMoneyService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
|
| | |
| | |
|
| | | @Resource
|
| | | private ThreeSaleMapper threeSaleMapper;
|
| | | |
| | | |
| | | |
| | |
|
| | | public UserInfo getBoss(final long uid) {
|
| | | return (UserInfo) dao.excute(new HibernateCallback<UserInfo>() {
|
| | |
| | | }
|
| | |
|
| | | @Transactional
|
| | | public void bind(UserInfo invitee, UserInfo inviter) {
|
| | | public void bind(UserInfo invitee, UserInfo inviter) throws ThreeSaleException {
|
| | | if (invitee == null || inviter == null)
|
| | | throw new ThreeSaleException(1, "用户信息为空");
|
| | | if (invitee.getId() == null)// 该用户还不存在
|
| | | {
|
| | | // 保存用户
|
| | | UserInfo inviteeUser = userInfoService.addUser(invitee, Constant.APPID);
|
| | | if (inviteeUser == null)
|
| | | throw new ThreeSaleException(2, "创建用户失败");
|
| | | // 保存关系
|
| | | ThreeSale threeSale = new ThreeSale();
|
| | | threeSale.setBoss(inviter);
|
| | | threeSale.setWorker(invitee);
|
| | | threeSale.setCreateTime(java.lang.System.currentTimeMillis());
|
| | | threeSale.setExpire(ThreeSale.EXPIRE_NORMAL);
|
| | | threeSale.setState(false);
|
| | | threeSale.setCreateTime(System.currentTimeMillis());
|
| | | dao.save(threeSale);
|
| | | threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
|
| | | threeSale.setWorker(inviteeUser);
|
| | | threeSaleMapper.insertSelective(threeSale);
|
| | | } else {// 是已经存在的用户
|
| | |
|
| | | // 用户已经存在我们的用户库中
|
| | | if (invitee.getLastLoginTime() == null || invitee.getLastLoginTime() == 0L) {
|
| | | // 用户未登录
|
| | | int outOfDateCount = 0;// 过期数量
|
| | | // 查询邀请关系
|
| | | List<ThreeSale> list = listByWorkerId(invitee.getId());
|
| | | if (list != null && list.size() > 0) {
|
| | | for (ThreeSale ts : list) {
|
| | | if (!ts.getState() && ts.getExpire() == ThreeSale.EXPIRE_OUTOFDATE) {
|
| | | outOfDateCount++;
|
| | | }
|
| | | }
|
| | | // 全部是失效状态
|
| | | if (outOfDateCount == list.size()) {
|
| | | // 可以确定关系
|
| | | ThreeSale threeSale = new ThreeSale();
|
| | | threeSale.setBoss(inviter);
|
| | | threeSale.setCreateTime(java.lang.System.currentTimeMillis());
|
| | | threeSale.setExpire(ThreeSale.EXPIRE_NORMAL);
|
| | | threeSale.setState(false);
|
| | | threeSale.setUpdateTime(java.lang.System.currentTimeMillis());
|
| | | threeSale.setWorker(invitee);
|
| | | threeSaleMapper.insertSelective(threeSale);
|
| | |
|
| | | // threeSaleSerivce.bind(invitee, inviter);
|
| | |
|
| | | } else {
|
| | | // 还存在有效的邀请,则不做处理
|
| | | }
|
| | | } else {
|
| | | // 用户未登录,又不存在邀请关系,不做处理
|
| | | }
|
| | | } else {
|
| | | // 已经登录,不做处理
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | public void effective(UserInfo invitee) {
|
| | | List<ThreeSale> list = dao.list("from ThreeSale ts where ts.worker.id = ? ",
|
| | | List<ThreeSale> list = dao.list("from ThreeSale ts where ts.worker.id = ? and ts.state=0 and ts.expire=0",
|
| | | new Serializable[] { invitee.getId() });
|
| | | if (list.size() > 0) {
|
| | | ThreeSale threeSale = list.get(0);
|
| | |
| | | return threeSaleMapper.queryCountMySecondTeamList(key, bossId);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public int deleteByPrimaryKey(Long id){
|
| | | return threeSaleMapper.deleteByPrimaryKey(id);
|
| | |
| | | public List<Long> queryLongTimeFailed(int daysNum){
|
| | | return threeSaleMapper.queryLongTimeFailed(daysNum);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<ThreeSale> queryLongTimeSuccess(int daysNum){
|
| | |
| | | return threeSaleMapper.getMyBoss(uid);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public ThreeSale selectByPrimaryKey(Long id) {
|
| | | return threeSaleMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listbyIdAndBossId(Long id, Long uid, Integer expire) {
|
| | |
| | | return organizeTeam(countTotal, list);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | public JSONObject organizeTeam(long count, List<ThreeSale> list) {
|
| | |
|
| | | JSONObject result = new JSONObject();
|
| | |
| | | Long createTime = threeSale.getCreateTime();
|
| | | Date inviteTime = new Date(createTime);
|
| | | object.put("inviteTime", format.format(inviteTime) + " 加入");
|
| | | |
| | |
|
| | | String memoName = "";
|
| | | ThreeSaleExtraInfo threeSaleExtraInfo = threeSale.getThreeSaleExtraInfo();
|
| | |
| | |
|
| | | array.add(contentJson);
|
| | |
|
| | | } else if ( threeSale.getExpire()!= null && (threeSale.getExpire() == 1 || threeSale.getExpire().equals(1))) {
|
| | | } else if (threeSale.getExpire() != null
|
| | | && (threeSale.getExpire() == 1 || threeSale.getExpire().equals(1))) {
|
| | | state = 2;
|
| | | JSONObject contentJson = new JSONObject();
|
| | | contentJson.put("color", fontColor1);
|
| | |
| | | Calendar c = Calendar.getInstance();
|
| | | c.setTime(inviteTime);
|
| | | c.add(Calendar.DAY_OF_MONTH, 60);// 邀请不超过60天
|
| | | |
| | |
|
| | | long days = (c.getTimeInMillis() -todayTime.getTime()) / (1000*3600*24);
|
| | | if (days < 0) {
|
| | |
| | | return result;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listByWorkerId(Long workerId) {
|
| | | return threeSaleMapper.listByWorkerId(workerId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Propagation;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.BindingAccountMapper;
|
| | |
| | | import com.yeshi.fanli.entity.admin.UserInfoAdmin;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.InviteUser;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.exception.ThreeSaleException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.hongbao.HongBaoService;
|
| | |
| | | import com.yeshi.fanli.util.Utils;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | @Service
|
| | | public class UserInfoServiceImpl implements UserInfoService {
|
| | |
| | |
|
| | | @Resource
|
| | | private ShareMapper shareMapper;
|
| | | |
| | | |
| | |
|
| | | public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid) {
|
| | | List<UserInfo> list = null;
|
| | |
| | | }
|
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | UserInfo find = getUserByLoginTypeAndOpenId(Constant.WEIXIN, wxUnionId, Constant.APPID);
|
| | |
|
| | | if (find == null) {
|
| | | find = new UserInfo();
|
| | | find.setAppId(Constant.APPID);
|
| | | find.setWxUnionId(weiXinUser.getUnionid());
|
| | | String wxHeadImg = COSManager.getInstance().uploadFile(
|
| | | HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl()),
|
| | | Constant.WXHEADURL + UUID.randomUUID().toString()).getUrl();
|
| | | String wxHeadImg = COSManager.getInstance()
|
| | | .uploadFile(HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl()),
|
| | | Constant.WXHEADURL + UUID.randomUUID().toString())
|
| | | .getUrl();
|
| | | find.setPortrait(wxHeadImg);
|
| | | find.setWxPic(wxHeadImg);
|
| | | find.setNickName(weiXinUser.getNickname());
|
| | |
| | | System system = new System(Constant.FANLI);
|
| | | system.setPlatform(1);
|
| | | find.setSystem(system);
|
| | | UserInfo addUser = null;
|
| | | synchronized (UserInfo.class) {
|
| | | addUser = addUser(find, Constant.APPID);
|
| | | if (addUser != null && addUser.getId() > 1) {
|
| | | threeSaleSerivce.bind(find, inviter);
|
| | | return true;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | try {
|
| | | threeSaleSerivce.bind(find, inviter);
|
| | | return true;
|
| | | } catch (ThreeSaleException e) {
|
| | | e.printStackTrace();
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | |
| | | @Override
|
| | | public long getFriendsListCount(long id, int type) {
|
| | | if (type == 1)
|
| | | return userInfoDao
|
| | | .getCountSQL("SELECT COUNT(t.`id`) FROM `yeshi_ec_threesale` t WHERE t.`boss_id`= " + id +" AND (t.expire = 0 OR t.expire IS NULL)");
|
| | | return userInfoDao.getCountSQL("SELECT COUNT(t.`id`) FROM `yeshi_ec_threesale` t WHERE t.`boss_id`= " + id
|
| | | + " AND (t.expire = 0 OR t.expire IS NULL)");
|
| | | else
|
| | | return userInfoDao.getCountSQL(
|
| | | "SELECT COUNT(tt.id) FROM `yeshi_ec_threesale` t LEFT JOIN yeshi_ec_threesale tt ON tt.`boss_id`=t.`worker_id` WHERE t.`boss_id`="
|
| | |
| | | return UserUtil.filterForClientUser(user);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<UserInfoAdmin> query(long start, int count, String key, Integer userType, |
| | | Integer days, String startTime, String endTime, Integer orderField,Integer orderMode) {
|
| | | public List<UserInfoAdmin> query(long start, int count, String key, Integer userType, Integer days,
|
| | | String startTime, String endTime, Integer orderField, Integer orderMode) {
|
| | |
|
| | | List<UserInfoAdmin> adminList = new ArrayList<UserInfoAdmin>();
|
| | |
|
| | | List<UserInfo> userList = userInfoMapper.query(start, count, key, userType, days,
|
| | | startTime, endTime, orderField,orderMode);
|
| | | List<UserInfo> userList = userInfoMapper.query(start, count, key, userType, days, startTime, endTime,
|
| | | orderField, orderMode);
|
| | | if (userList == null || userList.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
| | | if (lastLoginTime == null) {
|
| | | userInfo.setLastLoginTime(0L);
|
| | | }
|
| | | |
| | |
|
| | | userInfoAdmin.setUserInfo(userInfo);
|
| | |
|
| | |
| | | userInfoAdmin.setTbNameState(2);
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | Long uid = userInfo.getId();
|
| | |
|
| | | /* 绑定账号信息 */
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | // 最后一次下单时间
|
| | | Long lastOrderTime = hongBaoService.getLastOrderTime(uid);
|
| | | if (lastOrderTime == null) {
|
| | |
| | | } else {
|
| | | userInfoAdmin.setLastOrderTime(lastOrderTime);
|
| | | }
|
| | | |
| | |
|
| | | // 历史总订单
|
| | | long totalOrder = hongBaoService.countByUidSelf(uid, null, null);
|
| | |
| | | // 历史总收益
|
| | | double totalMoneyHistory = hongBaoService.countReceiveMoneysByUid(uid);
|
| | | userInfoAdmin.setTotalMoneyHistory(totalMoneyHistory);
|
| | | |
| | |
|
| | | // 统计分享个数
|
| | | long countUserShares = userShareGoodsHistoryMapper.countUserShares(uid);
|
| | |
| | |
|
| | | userInfoMapper.updateByPrimaryKeySelective(user);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<Long> longTimeNoLogin(int daysNum, List<Long> list ) {
|
| | |
| | | * @throws CommonGoodsException
|
| | | */
|
| | | public CommonGoods addOrUpdateCommonGoods(CommonGoods commonGoods) throws CommonGoodsException;
|
| | | |
| | | |
| | | /**
|
| | | * 添加商品(无就添加,有则返回)
|
| | | * |
| | | * @param commonGoods
|
| | | * @return
|
| | | * @throws CommonGoodsException
|
| | | */
|
| | | public CommonGoods addCommonGoods(CommonGoods commonGoods) throws CommonGoodsException;
|
| | |
|
| | | /**
|
| | | * 更新商品信息
|
| | |
| | | package com.yeshi.fanli.service.inter.goods;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.goods.ScanHistoryV2;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.goods.CommonGoodsException;
|
| | |
| | | * @throws ScanHistoryException
|
| | | */
|
| | | public void addScanHistory(ScanHistoryV2 history) throws CommonGoodsException, ScanHistoryException;
|
| | |
|
| | | /**
|
| | | * 根据设备或者用户ID获取浏览记录
|
| | | * |
| | | * @param uid
|
| | | * @param device
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @return
|
| | | */
|
| | | public List<ScanHistoryV2> getScanHistoryByDeviceOrUid(Long uid, String device, int page, int pageSize);
|
| | |
|
| | | /**
|
| | | * 根据设备或者用户ID获取浏览记录数量
|
| | | * |
| | | * @param uid
|
| | | * @param device
|
| | | * @return
|
| | | */
|
| | | public long getCountByDeviceOrUid(Long uid, String device);
|
| | |
|
| | | /**
|
| | | * 根据用户或者设备删除浏览记录
|
| | | * |
| | | * @param uid
|
| | | * @param device
|
| | | */
|
| | | public void deleteByDeviceOrUid(Long uid, String device);
|
| | |
|
| | | /**
|
| | | * 根据用户或者设备和淘宝商品ID删除浏览记录
|
| | | * |
| | | * @param uid
|
| | | * @param device
|
| | | * @param auctionId
|
| | | */
|
| | | public void deleteByAuctionIdAndDeviceOrUid(Long uid, String device, Long auctionId);
|
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.exception.ThreeSaleException;
|
| | |
|
| | | public interface ThreeSaleSerivce {
|
| | |
|
| | |
| | |
|
| | | int findInviteCount(long id);
|
| | |
|
| | | void bind(UserInfo invitee, UserInfo inviter);
|
| | | void bind(UserInfo invitee, UserInfo inviter) throws ThreeSaleException;
|
| | |
|
| | | void effective(UserInfo find);
|
| | |
|
| | |
| | | //邀请关系
|
| | | int getLastestThreeSaleCount(String key);
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询一度队员集合
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | |
| | |
|
| | | /**
|
| | | * 查询二度队员集合
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | |
| | |
|
| | | /**
|
| | | * 删除邀请关系id
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public int deleteByPrimaryKey(Long id);
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 长时间未邀请成功用户
|
| | | * |
| | | * @param daysNum
|
| | | * @return
|
| | | */
|
| | | public List<Long> queryLongTimeFailed(int daysNum);
|
| | |
|
| | | |
| | | /**
|
| | | * 长时间 邀请成功用户
|
| | | * |
| | | * @param daysNum
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> queryLongTimeSuccess(int daysNum);
|
| | |
|
| | | |
| | | /**
|
| | | * 设置对应邀请过期
|
| | | * |
| | | * @param list
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 一级查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, |
| | | String startTime, String endTime);
|
| | | public List<ThreeSale> listFirstTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
| | | String endTime);
|
| | |
|
| | | public long countFirstTeamQuery(Long uid, Integer state, String startTime, String endTime);
|
| | |
|
| | | /**
|
| | | * 二级查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, |
| | | String startTime,String endTime);
|
| | | public List<ThreeSale> listSecondTeamQuery(long start, int count, Long uid, Integer state, String startTime,
|
| | | String endTime);
|
| | |
|
| | | public long countSecondTeamQuery(Long uid, Integer state, String startTime, String endTime);
|
| | |
|
| | | |
| | | /**
|
| | | * 上级查询
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | |
| | |
|
| | | /**
|
| | | * app端一级查询1.4.1
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | |
| | |
|
| | | /**
|
| | | * 统计所有一级队员
|
| | | * |
| | | * @param uid
|
| | | * @param state 状态,值 为空时则统计所有
|
| | | * @param state
|
| | | * 状态,值 为空时则统计所有
|
| | | * @return
|
| | | */
|
| | | public long countFirstTeam(Long uid, Integer state);
|
| | |
|
| | | |
| | | /**
|
| | | * app端二级查询1.4.1
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | |
| | |
|
| | | /**
|
| | | * 统计二级队员
|
| | | * |
| | | * @param uid
|
| | | * @param state 状态,值 为空时则统计所有
|
| | | * @param state
|
| | | * 状态,值 为空时则统计所有
|
| | | * @return
|
| | | */
|
| | | public long countSecondTeam(Long uid, Integer state);
|
| | |
|
| | |
|
| | | /**
|
| | | * 前端查询一级队员
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | |
| | | */
|
| | | public JSONObject getMyFirstTeam(long start, int count, Long uid);
|
| | |
|
| | | |
| | | /**
|
| | | * 前端查询二级队员
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | |
| | |
|
| | | /**
|
| | | * 获取上级
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 查询队员记录 id+uid
|
| | | * |
| | | * @param id
|
| | | * @param uid
|
| | | * @param expire 是否失效状态
|
| | | * @param expire
|
| | | * 是否失效状态
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listbyIdAndBossId(Long id, Long uid, Integer expire);
|
| | |
|
| | | /**
|
| | | * 根据邀请者查询关系
|
| | | * |
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listByWorkerId(Long workerId);
|
| | |
|
| | | }
|