| | |
| | | <systemPath>${basedir}/libs/vpush-server-sdk-2.0.jar</systemPath>
|
| | | </dependency>
|
| | |
|
| | |
|
| | | |
| | | <dependency>
|
| | | <groupId>BASE64Decoder</groupId>
|
| | | <artifactId>BASE64Decoder</artifactId>
|
| | | <version>1.0</version>
|
| | | <scope>system</scope>
|
| | | <systemPath>${basedir}/libs/sun.misc.BASE64Decoder.jar</systemPath>
|
| | | </dependency>
|
| | | |
| | | |
| | | </dependencies>
|
| | | <build>
|
| | | <plugins>
|
| | |
| | | listNew.addAll(list); |
| | | } else if (list.size() > 0) { // 活动图片不允许跳转 |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | if (goodsEvaluate.getType() != EvaluateEnum.activity) { |
| | | EvaluateEnum evaluateEnum = goodsEvaluate.getType(); |
| | | // 单品 活动可以一键云发单 |
| | | if (evaluateEnum == EvaluateEnum.activity || evaluateEnum == EvaluateEnum.single ) { |
| | | goodsEvaluate.setCloud(true); |
| | | } |
| | | |
| | | |
| | | if (evaluateEnum != EvaluateEnum.activity) { |
| | | listNew.add(goodsEvaluate); |
| | | continue; |
| | | } |
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | |
| | | couponInfoList.add(goodsDetail.getCouponInfo());
|
| | | goodsDetail.setCouponInfoList(couponInfoList);
|
| | | }
|
| | | |
| | | |
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getCloudInfo(goodsDetail); // 云发单文案信息
|
| | | }
|
| | | |
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | | object.put("goods", JsonUtil.getApiCommonGson().toJson(goodsDetail));
|
| | |
| | | ShareVO shareInfoVO = new ShareVO();
|
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShare(shareInfoVO);
|
| | | |
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getCloudInfo(goodsDetail); // 云发单文案信息
|
| | | }
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | |
| | | extraVO.setCouponJumpLink(convertUrl.getUrl());
|
| | | extraVO.setNativeCouponJumpLink(PinDuoDuoUtil.getAndroidNativeURI(convertUrl.getUrl()));
|
| | | }
|
| | | |
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getCloudInfo(goodsDetail); // 云发单文案信息
|
| | | }
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | |
| | | ShareVO shareInfoVO = new ShareVO();
|
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShare(shareInfoVO);
|
| | | |
| | | // 云发单文案信息
|
| | | getCloudInfo(goodsDetail); |
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | |
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShare(shareInfoVO);
|
| | |
|
| | | // 云发单文案信息
|
| | | getCloudInfo(goodsDetail); |
| | | |
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | | object.put("goods", JsonUtil.getApiCommonGson().toJson(goodsDetail));
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | /**
|
| | | * // 云发单文案信息
|
| | | * @param goodsDetail
|
| | | */
|
| | | private void getCloudInfo(GoodsDetailVO goodsDetail) {
|
| | | if (!goodsDetail.isHasCoupon()) {
|
| | | return;
|
| | | }
|
| | | GoodsEvaluate evaluate = goodsEvaluateService.queryExistSingle(goodsDetail.getGoodsId() +"", goodsDetail.getGoodsType());
|
| | | if (evaluate != null) {
|
| | | String cloudText = null;
|
| | | List<CommentInfo> comments = evaluate.getComments();
|
| | | if (comments != null && comments.size() > 0) {
|
| | | cloudText = comments.get(0).getContent();
|
| | | }
|
| | | |
| | | String cloudPic = null;
|
| | | List<ImgInfo> imgList = evaluate.getImgList();
|
| | | if (imgList != null && imgList.size() > 0) {
|
| | | for (ImgInfo imgInfo: imgList) {
|
| | | ImgEnum type = imgInfo.getType();
|
| | | if (type == ImgEnum.goods) {
|
| | | cloudPic = imgInfo.getUrl();
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(cloudText) && !StringUtil.isNullOrEmpty(cloudPic)) {
|
| | | OtherInfo otherInfo = goodsDetail.getOtherInfo();
|
| | | if (otherInfo == null)
|
| | | otherInfo = new OtherInfo();
|
| | | otherInfo.setCloudPic(cloudPic);
|
| | | otherInfo.setCloudText(cloudText);
|
| | | goodsDetail.setOtherInfo(otherInfo);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 商品详情推荐(猜你喜欢 + 推荐)
|
| | |
| | | int darenMonth = 0;
|
| | | int highVIPMonth = 0;
|
| | | int superVIPMonth = 0;
|
| | | Date date = new Date();
|
| | | Date minTime = TimeUtil.parseYYYYMMDD(firstday);
|
| | | Date maxTime = TimeUtil.parseYYYYMMDD_HHMMSS(lastday + " 23:59:59");
|
| | | List<TeamDailyRecord> listMonth = teamDailyRecordService.sumGroupByYearMonth(uid, minTime, maxTime);
|
| | |
| | | if (directNum > 0) {
|
| | | indirectNum = threeSaleSerivce.countSecondTeam(workerId);
|
| | | }
|
| | |
|
| | | data.put("fansNum", "直接粉丝: " + directNum + "人\n" + "间接粉丝: " + indirectNum + "人");
|
| | | |
| | | // 订单统计
|
| | | long countTB = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_TAOBAO, 60);
|
| | | long countJD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_JD, 60);
|
| | | long countPDD = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_PDD, 60);
|
| | |
|
| | | data.put("fansNum", "直接粉丝: " + directNum + "人\n" + "间接粉丝: " + indirectNum + "人");
|
| | | data.put("orderInfo", "淘宝 (" + countTB + "笔)\n" + "京东 (" + countJD + "笔)\n" + "拼多多 (" + countPDD + "笔)");
|
| | | |
| | | StringBuilder builder = new StringBuilder();
|
| | | builder.append("淘宝 (" + countTB + "笔)");
|
| | | builder.append("\n京东 (" + countJD + "笔)");
|
| | | builder.append("\n拼多多 (" + countPDD + "笔)");
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | long countVip = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_VIP, 60);
|
| | | long countSL = commonOrderCountService.countOrderBySourceAndNearDay(workerId, Constant.SOURCE_TYPE_SUNING, 60);
|
| | | builder.append("\n唯品会 (" + countVip + "笔)");
|
| | | builder.append("\n苏宁 (" + countSL + "笔)");
|
| | | }
|
| | | data.put("orderInfo", builder.toString());
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | if (directNum > 0) {
|
| | | indirectNum = threeSaleSerivce.countSecondTeam(fansId);
|
| | | }
|
| | | data.put("fansNum", "直接粉丝: " + directNum + "人\n" + "间接粉丝: " + indirectNum + "人");
|
| | |
|
| | | // 订单统计
|
| | | long countTB = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_TAOBAO, 60);
|
| | | long countJD = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_JD, 60);
|
| | | long countPDD = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_PDD, 60);
|
| | |
|
| | | data.put("fansNum", "直接粉丝: " + directNum + "人\n" + "间接粉丝: " + indirectNum + "人");
|
| | | data.put("orderInfo", "淘宝 (" + countTB + "笔)\n" + "京东 (" + countJD + "笔)\n" + "拼多多 (" + countPDD + "笔)");
|
| | | StringBuilder builder = new StringBuilder();
|
| | | builder.append("淘宝 (" + countTB + "笔)");
|
| | | builder.append("\n京东 (" + countJD + "笔)");
|
| | | builder.append("\n拼多多 (" + countPDD + "笔)");
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | long countVip = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_VIP, 60);
|
| | | long countSL = commonOrderCountService.countOrderBySourceAndNearDay(fansId, Constant.SOURCE_TYPE_SUNING, 60);
|
| | | builder.append("\n唯品会 (" + countVip + "笔)");
|
| | | builder.append("\n苏宁 (" + countSL + "笔)");
|
| | | }
|
| | | data.put("orderInfo", builder.toString());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | |
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGoodsException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGroupException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGoodsService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserCloudAlipayManager userCloudAlipayManager;
|
| | | |
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 查询开通记录
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "sendGoods")
|
| | | public void sendCircle(String callback, AcceptData acceptData, Long uid, Long goodsId, Integer goodsType, PrintWriter out) {
|
| | | public void sendGoods(String callback, AcceptData acceptData, Long uid, Long goodsId, Integer goodsType, PrintWriter out) {
|
| | | if (uid == null || goodsId == null || goodsType == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | userCloudService.sendCustomGoods(uid, goodsId, goodsType);
|
| | | GoodsEvaluate evaluate = goodsEvaluateService.queryExistSingle(goodsId +"", goodsType);
|
| | | if (evaluate != null) {
|
| | | userCloudService.sendByDynamic(uid, evaluate.getId());
|
| | | } else {
|
| | | userCloudService.sendCustomGoods(uid, goodsId, goodsType);
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("一键发单成功"));
|
| | | } catch (UserCloudException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(),e.getMsg()));
|
| | |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public List<GoodsEvaluate> queryExistSingle(int goodsType, String goodsId) { |
| | | Query query = new Query(); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | list.add(Criteria.where("dynamicType").is(1)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | list.add(Criteria.where("type").is("single")); |
| | | list.add(Criteria.where("imgList.goods.goodsId").is(goodsId)); |
| | | list.add(Criteria.where("imgList.goods.goodsType").is(goodsType)); |
| | | |
| | | if (list.size() > 0) { |
| | | Criteria[] cas = new Criteria[list.size()]; |
| | | for (int i = 0; i < list.size(); i++) |
| | | cas[i] = list.get(i); |
| | | query.addCriteria(new Criteria().andOperator(cas)); |
| | | } |
| | | |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询有效 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public List<GoodsEvaluate> queryOverdue() { |
| | | Date now = new Date(); |
| | | Query query = new Query(); |
| | |
| | | */ |
| | | public List<GoodsEvaluate> listByStartTime(Date date) { |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | list.add(Criteria.where("dynamicType").is(1)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | list.add(Criteria.where("startTime").gt(new Date())); |
| | | list.add(Criteria.where("startTime").lte(date)); |
| | | list.add(new Criteria().orOperator(Criteria.where("type").is("single"), |
| | | new Criteria().andOperator(Criteria.where("type").is("single")))); |
| | | new Criteria().andOperator(Criteria.where("type").is("activity")))); |
| | | |
| | | Query query = new Query(); |
| | | if (list.size() > 0) { |
| | |
| | | cas[i] = list.get(i); |
| | | query.addCriteria(new Criteria().andOperator(cas)); |
| | | } |
| | | query.with(new Sort(Sort.Direction.ASC,"startTime")); |
| | | |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user.cloud; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | |
| | | */ |
| | | UserCloud getByOrderId(@Param("orderId") Long orderId); |
| | | |
| | | /** |
| | | * 查询有效 |
| | | * @return |
| | | */ |
| | | List<Long> listValidUid(@Param("start") long start, @Param("count") int count); |
| | | } |
| | |
| | | package com.yeshi.fanli.dao.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
| | | * @param sendOrigin
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudSendRecord> listByUidAndSendId(Long uid, String sendId, String sendOrigin){
|
| | | public List<UserCloudSendRecord> listByUidAndSendId(Long uid, String sendId){
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("uid").is(uid));
|
| | | query.addCriteria(Criteria.where("sendId").is(sendId));
|
| | | query.addCriteria(Criteria.where("sendOrigin").is(sendOrigin));
|
| | | query.addCriteria(Criteria.where("sendOrigin").is(UserCloudSendRecord.ORIGIN_EVALUATE));
|
| | | return findList(query);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查询已发送id
|
| | | * @param uid
|
| | | * @param sendId
|
| | | * @param sendOrigin
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudSendRecord> getLastByUid(Long uid, Date lastTime){
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("uid").is(uid));
|
| | | query.addCriteria(Criteria.where("sendWay").is(UserCloudSendRecord.SEND_WAY_AUTO));
|
| | | query.addCriteria(Criteria.where("sendOrigin").is(UserCloudSendRecord.ORIGIN_EVALUATE));
|
| | | query.addCriteria(Criteria.where("sendTime").gt(lastTime));
|
| | | query.with(new Sort(Sort.Direction.ASC,"sendTime"));
|
| | | |
| | | return findList(query);
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.dto.mq.user.body.InterTokenMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.InviteCodeActiveMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.TaoBaoBindSuccessMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.ThreeSaleSeparateMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserAccountBindingMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserActiveMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserCloudMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserForbiddenMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInviteMQMsg;
|
| | |
| | | userMoneyAdd(UserMoneyChangeMQMsg.class), // 用户资金增加
|
| | | taobaoBindSuccess(TaoBaoBindSuccessMQMsg.class),
|
| | | becomeValidUser(BeComeValidUserMQMsg.class), // 成为有效用户
|
| | | userCloud(UserCloudMQMsg.class), //云发单
|
| | | userPhoneOpen(UserPhoneOpenMQMsg.class);// 电话号码公开情况变化
|
| | |
|
| | | private final Class<?> clazz;
|
| | |
| | | *
|
| | | */
|
| | | public class UserCloudMQMsg extends BaseMQMsgBody {
|
| | | |
| | | public final static int TYPE_STORE = 1; // 商品库
|
| | | public final static int TYPE_EVALUATE = 2; // 发圈内容
|
| | | |
| | | private Long uid;// 用户ID
|
| | | private String id;// 发圈id 、 商品库id
|
| | | private Integer type;// 类型
|
| | |
| | | private String jumpLink; |
| | | |
| | | |
| | | // 是否云发单 |
| | | private boolean cloud; |
| | | |
| | | |
| | | |
| | | private String startTimeChar; |
| | | private String endTimeChar; |
| | | |
| | |
| | | public void setJumpLink(String jumpLink) { |
| | | this.jumpLink = jumpLink; |
| | | } |
| | | |
| | | public boolean isCloud() { |
| | | return cloud; |
| | | } |
| | | |
| | | public void setCloud(boolean cloud) { |
| | | this.cloud = cloud; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.job;
|
| | |
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | | import com.yeshi.fanli.service.manger.alipay.UserCloudAlipayManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | @Component
|
| | | public class UserCloudJob {
|
| | | @Resource
|
| | | private UserCloudService userCloudService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudOrderService userCloudOrderService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserCloudAlipayManager userCloudAlipayManager;
|
| | | |
| | |
|
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | |
|
| | | |
| | | /**
|
| | | * 每十分钟检测是否付款
|
| | | */
|
| | | @Scheduled(cron = "0 0/10 * * * ? ")
|
| | | public void tradeQuery() {
|
| | | public void tradeQuery() {
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | List<UserCloudOrder> list = userCloudOrderService.getLasthourByUnpaid();
|
| | | if (list == null || list.size() == 0)
|
| | | return;
|
| | | |
| | | for (UserCloudOrder cloudOrder: list) {
|
| | |
|
| | | for (UserCloudOrder cloudOrder : list) {
|
| | | try {
|
| | | userCloudAlipayManager.tradeQueryByOrderId(cloudOrder.getId());
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 定时检测是否存在新的发圈
|
| | | */
|
| | | @Scheduled(cron = "0 0/20 * * * ? ")
|
| | | public void dailyCount() {
|
| | | public void dailyCount() {
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | |
| | | goodsEvaluateService.getById(id)
|
| | | |
| | | List<UserCloudOrder> list = userCloudOrderService.getLasthourByUnpaid();
|
| | |
|
| | | // 9-21 执行云发单
|
| | | Calendar nowCalendar = Calendar.getInstance();
|
| | | nowCalendar.setTimeInMillis(java.lang.System.currentTimeMillis());
|
| | | int hour = nowCalendar.get(Calendar.HOUR_OF_DAY);
|
| | | if (hour < 9 && hour > 21)
|
| | | return;
|
| | |
|
| | | // 一个小时之内最新发圈
|
| | | long rand = 1000 * 60 * 60;
|
| | | long time = java.lang.System.currentTimeMillis() - rand;
|
| | | Date lastTime = new Date(time);
|
| | |
|
| | | List<GoodsEvaluate> list = goodsEvaluateService.listByStartTime(lastTime);
|
| | | if (list == null || list.size() == 0)
|
| | | return;
|
| | | |
| | | for (UserCloudOrder cloudOrder: list) {
|
| | | try {
|
| | | userCloudAlipayManager.tradeQueryByOrderId(cloudOrder.getId());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | userCloudService.fixedTimeSend(list.get(0).getId());
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | vipInfoLogger.info(obj);
|
| | | }
|
| | |
|
| | | public static void cloudInfo(String info) {
|
| | | public static void cloudInfo(Object info) {
|
| | | if (info != null)
|
| | | cloudLogger.info(info);
|
| | | }
|
| | |
| | | WHERE d.`uc_order_id` = #{orderId} |
| | | </select> |
| | | |
| | | |
| | | <select id="listValidUid" resultType="Long"> |
| | | SELECT * FROM (SELECT DISTINCT d.`uc_uid` FROM yeshi_ec_user_cloud d |
| | | WHERE d.`uc_end_time` > NOW() AND d.uc_wx_id IS NOT NULL)A |
| | | LIMIT #{start},{count} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | public GoodsEvaluate getById(String id) { |
| | | return goodsEvaluateDao.getById(id); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<GoodsEvaluate> listByStartTime(Date date) { |
| | | return goodsEvaluateDao.listByStartTime(date); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveComment(String pid, CommentInfo commentInfo) throws GoodsEvaluateException { |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateDao.getById(pid); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public GoodsEvaluate queryExistSingle(String goodsId, int goodsType) { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryExistSingle(goodsType, goodsId); |
| | | if (list != null && list.size() > 0) |
| | | return list.get(0); |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.service.impl.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<UserCloudSendRecord> listByUidAndSendId(Long uid, String sendId, String sendOrigin){
|
| | | return userCloudSendRecordDao.listByUidAndSendId(uid, sendId, sendOrigin);
|
| | | public UserCloudSendRecord getByUidAndSendId(Long uid, String sendId){
|
| | | List<UserCloudSendRecord> list = userCloudSendRecordDao.listByUidAndSendId(uid, sendId);
|
| | | if (list != null & list.size() > 0) {
|
| | | return list.get(0);
|
| | | }
|
| | | return null; |
| | | }
|
| | |
|
| | | @Override
|
| | | public UserCloudSendRecord save(UserCloudSendRecord record){
|
| | | return userCloudSendRecordDao.save(record);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public UserCloudSendRecord getLastByUid (Long uid, Date lastTime){
|
| | | List<UserCloudSendRecord> list = userCloudSendRecordDao.getLastByUid(uid, lastTime);
|
| | | if (list != null & list.size() > 0) {
|
| | | return list.get(0);
|
| | | }
|
| | | return null; |
| | | }
|
| | | }
|
| | |
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.controller.client.v2.ShareControllerV2;
|
| | | import com.yeshi.fanli.dao.mybatis.user.cloud.UserCloudMapper;
|
| | | import com.yeshi.fanli.dto.aitaoker.RobotInfoDTO;
|
| | | import com.yeshi.fanli.dto.aitaoker.WeiXinGroupDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserCloudMQMsg;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | |
| | | @Resource
|
| | | private UserCloudSendContentService userCloudSendContentService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | |
|
| | | String qrCode = null;
|
| | | String cloudPic = null;
|
| | | ImgInfo imgVideo = null;
|
| | | List<String> listImg = new ArrayList<>();
|
| | |
|
| | |
| | | imgVideo = imgInfo;
|
| | | continue;
|
| | | }
|
| | | |
| | | if (imgInfo.getType() == ImgEnum.goods) {
|
| | | cloudPic = imgInfo.getUrl();
|
| | | }
|
| | | |
| | | GoodsDetailVO goodsVO = imgInfo.getGoodsVO();
|
| | | if (goodsVO == null) {
|
| | | listImg.add(imgInfo.getUrl());
|
| | |
| | | qrCode = jumpLink;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if (cloudPic == null) {
|
| | | cloudPic = imgs.get(0).getUrl();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | // 发送图片
|
| | | String picurl = null;
|
| | | if (!StringUtil.isNullOrEmpty(qrCode)) {
|
| | | picurl = qrCode;
|
| | | } else if (listImg.size() > 0) {
|
| | | picurl = listImg.get(0);
|
| | | }
|
| | | if (!StringUtil.isNullOrEmpty(picurl)) {
|
| | | String imgBase64 = ImageToBase64.NetImageToBase64(picurl);
|
| | | if (!StringUtil.isNullOrEmpty(cloudPic)) {
|
| | | String imgBase64 = ImageToBase64.NetImageToBase64(cloudPic);
|
| | | boolean macsend = AitaokerApiUtil.macsendImgBase64(robotId, cloudGroup.getGroupId(), imgBase64);
|
| | | if (macsend)
|
| | | sendContent.setPicUrl(picurl);
|
| | | sendContent.setPicUrl(cloudPic);
|
| | | }
|
| | |
|
| | | // 评论文本
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 商品分享跳转链接
|
| | | * @param goodsVO
|
| | | * @param user
|
| | | * @param relationId
|
| | | * @param inviteCode
|
| | | * @param mainPic
|
| | | * @return
|
| | | */
|
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user, String relationId, String inviteCode,
|
| | | String mainPic) {
|
| | | String jumpLink = null;
|
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | TaoBaoLink taoBaoLink = null;
|
| | | try {
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), goodsVO.getGoodsId(), relationId);
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), Long.parseLong(goodsVO.getGoodsId()), relationId);
|
| | | } catch (ShareGoodsException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | | configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), taoBaoLink.getGoods(),
|
| | | TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
|
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) {
|
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId());
|
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsVO.getGoodsId()));
|
| | | if (jdGoods == null) {
|
| | | return null;
|
| | | }
|
| | |
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
|
| | | user.getId() + "");
|
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
|
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "",
|
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(Long.parseLong(goodsVO.getGoodsId()), PinDuoDuoApiUtil.PID_SHARE + "",
|
| | | user.getId() + "");
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | | @Override
|
| | | public void fixedTimeSend(String id) {
|
| | | if (StringUtil.isNullOrEmpty(id)) |
| | | return;
|
| | | |
| | | // 一个小时之前
|
| | | long rand = 1000 * 60 * 60 ;
|
| | | long time = java.lang.System.currentTimeMillis() - rand;
|
| | | Date lastTime = new Date(time);
|
| | | |
| | | |
| | | for (int i = 0; i < 1000; i ++) {
|
| | | List<Long> list = userCloudMapper.listValidUid((i-1)*1000, 1000);
|
| | | if (list == null || list.size() == 0) {
|
| | | break;
|
| | | }
|
| | | |
| | | for (Long uid: list) {
|
| | | try {
|
| | | UserCloudSendRecord record = userCloudSendRecordService.getByUidAndSendId(uid, id);
|
| | | if (record != null) |
| | | continue;
|
| | | |
| | | UserCloudSendRecord last = userCloudSendRecordService.getLastByUid(uid, lastTime);
|
| | | if (last != null)
|
| | | continue;
|
| | | |
| | | if (!Constant.IS_TEST) {
|
| | | UserCloudMQMsg msg = new UserCloudMQMsg(uid, id, UserCloudMQMsg.TYPE_EVALUATE);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud, msg);
|
| | | producer.send(message);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | } |
| | |
| | | */ |
| | | public void switchState(String id) throws GoodsEvaluateException; |
| | | |
| | | /** |
| | | * 查询 |
| | | * @param date |
| | | * @return |
| | | */ |
| | | public List<GoodsEvaluate> listByStartTime(Date date); |
| | | |
| | | |
| | | /** |
| | | * 根据商品id、类型查询 |
| | | * @param goodsId |
| | | * @param goodsType |
| | | * @return |
| | | */ |
| | | public GoodsEvaluate queryExistSingle(String goodsId, int goodsType); |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.service.inter.user.cloud;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Date;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendRecord;
|
| | |
|
| | |
| | | * @param sendOrigin
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudSendRecord> listByUidAndSendId(Long uid, String sendId, String sendOrigin);
|
| | | public UserCloudSendRecord getByUidAndSendId(Long uid, String sendId);
|
| | |
|
| | | /**
|
| | | * 保存
|
| | |
| | | * @return
|
| | | */
|
| | | public UserCloudSendRecord save(UserCloudSendRecord record);
|
| | |
|
| | | /**
|
| | | * 查询最后一次
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserCloudSendRecord getLastByUid(Long uid, Date lastTime);
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void sendCustomGoods(Long uid, Long goodsId, Integer goodsType) throws UserCloudException;
|
| | |
|
| | | /**
|
| | | * 定时发送云发单
|
| | | * @param id
|
| | | */
|
| | | public void fixedTimeSend(String id);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Expose
|
| | | private RewardCouponVO rewardCoupon;
|
| | | |
| | |
|
| | | @Expose
|
| | | private String fanliMoneyPlus;
|
| | | |
| | | |
| | |
|
| | | // 云发单图片
|
| | | @Expose
|
| | | private String cloudPic;
|
| | | // 云发单文字
|
| | | @Expose
|
| | | private String cloudText;
|
| | |
|
| | | public RewardCouponVO getRewardCoupon() {
|
| | | return rewardCoupon;
|
| | |
| | | public void setFanliMoneyPlus(String fanliMoneyPlus) {
|
| | | this.fanliMoneyPlus = fanliMoneyPlus;
|
| | | }
|
| | |
|
| | | public String getCloudPic() {
|
| | | return cloudPic;
|
| | | }
|
| | |
|
| | | public void setCloudPic(String cloudPic) {
|
| | | this.cloudPic = cloudPic;
|
| | | }
|
| | |
|
| | | public String getCloudText() {
|
| | | return cloudText;
|
| | | }
|
| | |
|
| | | public void setCloudText(String cloudText) {
|
| | | this.cloudText = cloudText;
|
| | | }
|
| | |
|
| | | }
|