Merge remote-tracking branch 'origin/div' into div
| | |
| | | <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>
|
| | |
| | | @RequestMapping(value = "countOrderInfo") |
| | | public void countOrderInfo(String callback, Long uid, PrintWriter out) { |
| | | // 自购已到账 |
| | | long selfNumEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY, 1); |
| | | long selfNumEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, null, 1); |
| | | // 分享已到账 |
| | | long shareNumEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY, 2); |
| | | |
| | | long shareNumEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, null, 2); |
| | | // 自购未到账 |
| | | long selfNum = hongBaoV2CountService.countMyDirectOrderByCashNotArrival(uid, Constant.VIP_ORDER_PAY, 1); |
| | | long selfNum = hongBaoV2CountService.countMyDirectOrderByCashNotArrival(uid, null, 1); |
| | | // 分享未到账 |
| | | long shareNum = hongBaoV2CountService.countMyDirectOrderByCashNotArrival(uid, Constant.VIP_ORDER_PAY, 2); |
| | | long shareNum = hongBaoV2CountService.countMyDirectOrderByCashNotArrival(uid, null, 2); |
| | | |
| | | |
| | | // 自购已到账 |
| | | long selfAccountEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY, 1); |
| | | // 分享已到账 |
| | | long shareAccountEnd = hongBaoV2CountService.countMyDirectOrderByCashArrival(uid, Constant.VIP_ORDER_PAY, 2); |
| | | // 自购未到账 |
| | | long selfAccount = hongBaoV2CountService.countMyDirectOrderByCashNotArrival(uid, Constant.VIP_ORDER_PAY, 1); |
| | | // 分享未到账 |
| | | long shareAccount = hongBaoV2CountService.countMyDirectOrderByCashNotArrival(uid, Constant.VIP_ORDER_PAY, 2); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("selfNumEnd", selfNumEnd); |
| | | data.put("shareNumEnd", shareNumEnd); |
| | | data.put("selfNum", selfNum); |
| | | data.put("shareNum", shareNum); |
| | | data.put("selfAccountEnd", selfAccountEnd); |
| | | data.put("shareAccountEnd", shareAccountEnd); |
| | | data.put("selfAccount", selfAccount); |
| | | data.put("shareAccount", shareAccount); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | |
| | | @Resource
|
| | | private UserInviteValidNumService userInviteValidNumService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | | |
| | | /**
|
| | | * 查询用户信息列表 正常用户/异常用户
|
| | | *
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 用户基础信息查询
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key
|
| | | * @param keyType
|
| | | * @param rank
|
| | | * @param userType
|
| | | * @param days
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param type
|
| | | * @param level
|
| | | * @param activeCode
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryInfo")
|
| | | public void queryInfo(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,Integer userType,
|
| | | Integer days, String startTime, String endTime, Integer state,String level,
|
| | | Integer activeCode, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | |
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | String userRank = null;
|
| | | if (rank != null) {
|
| | | switch (rank) {
|
| | | case 1:
|
| | | userRank = "青铜";
|
| | | break;
|
| | | case 2:
|
| | | userRank = "白银";
|
| | | break;
|
| | | case 3:
|
| | | userRank = "黄金";
|
| | | break;
|
| | | case 4:
|
| | | userRank = "铂金";
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | List<UserInfoVO> userList = userInfoService.queryInfo((pageIndex - 1) * pageSize, pageSize, state, key, keyType,
|
| | | userRank, days, startTime, endTime, userType, level, activeCode);
|
| | |
|
| | | if (userList == null || userList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无相关数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = userInfoService.countInfo(state, key, keyType, userRank, days, startTime, endTime,userType, level, activeCode);
|
| | |
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls();
|
| | | Gson gson = gsonBuilder.create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("resultList", gson.toJson(userList));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 统计今日用户总情况
|
| | | *
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("doneFirst", doneFirst);
|
| | | data.put("doneSecond", doneSecond);
|
| | | data.put("first", threeSaleSerivce.countFirstTeam(uid)); |
| | | data.put("second", threeSaleSerivce.countSecondTeam(uid)); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.controller.admin.user.cloud;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloud;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendContent;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendRecord;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGoodsService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGroupService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudManageService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudSendContentService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudSendRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | | import com.yeshi.fanli.service.manger.alipay.UserCloudAlipayManager;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/cloud")
|
| | | public class UserCloudAdminController {
|
| | |
|
| | | @Resource
|
| | | private UserCloudService userCloudService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudOrderService userCloudOrderService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudGroupService userCloudGroupService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudGoodsService userCloudGoodsService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudSendRecordService userCloudSendRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudManageService userCloudManageService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudAlipayManager userCloudAlipayManager;
|
| | | |
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | | |
| | | @Resource
|
| | | private UserCloudSendContentService userCloudSendContentService;
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 订单信息查询
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param key
|
| | | * @param state
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryOrder")
|
| | | public void queryOrder(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | List<UserCloudOrder> list = userCloudOrderService.query(pageIndex, pageSize, key, state);
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("暂无数据")));
|
| | | return;
|
| | | }
|
| | | |
| | | for (UserCloudOrder cloudOrder: list) {
|
| | | UserInfo userInfo = userInfoService.getUserByIdWithMybatis(cloudOrder.getUid());
|
| | | if (userInfo == null)
|
| | | continue;
|
| | | |
| | | cloudOrder.setNickName(userInfo.getNickName());
|
| | | cloudOrder.setPortrait(userInfo.getPortrait());
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); // 重点
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | long count = userCloudOrderService.count(key, state);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 开通成功记录
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param key
|
| | | * @param state
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryCloud")
|
| | | public void queryCloud(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | List<UserCloud> list = userCloudService.query(pageIndex, pageSize, key, state);
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("暂无数据")));
|
| | | return;
|
| | | }
|
| | | |
| | | for (UserCloud userCloud: list) {
|
| | | UserInfo userInfo = userInfoService.getUserByIdWithMybatis(userCloud.getUid());
|
| | | if (userInfo == null)
|
| | | continue;
|
| | | |
| | | userCloud.setNickName(userInfo.getNickName());
|
| | | userCloud.setPortrait(userInfo.getPortrait());
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); // 重点
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | long count = userCloudService.count(key, state);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询发送记录
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key
|
| | | * @param origin
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "querySendRecord")
|
| | | public void querySendRecord(String callback, Integer pageIndex, Integer pageSize, String key, Integer origin, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | List<UserCloudSendRecord> list = userCloudSendRecordService.query(pageIndex, pageSize, key, origin);
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("暂无数据")));
|
| | | return;
|
| | | }
|
| | | |
| | | for (UserCloudSendRecord userCloud: list) {
|
| | | UserInfo userInfo = userInfoService.getUserByIdWithMybatis(userCloud.getUid());
|
| | | if (userInfo == null)
|
| | | continue;
|
| | | |
| | | userCloud.setNickName(userInfo.getNickName());
|
| | | userCloud.setPortrait(userInfo.getPortrait());
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); // 重点
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | long count = userCloudSendRecordService.count(key, origin);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 查询发送内容
|
| | | * @param callback
|
| | | * @param pid
|
| | | * @param origin
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getSendContent")
|
| | | public void getSendContent(String callback, String pid, Integer origin, PrintWriter out) {
|
| | | try {
|
| | | List<UserCloudSendContent> list = userCloudSendContentService.getByPid(pid);
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("暂无数据")));
|
| | | return;
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); // 重点
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | long count = list.size();
|
| | | int totalPage = (int) (count % 20 == 0 ? count / 20 : count / 20 + 1);
|
| | | PageEntity pe = new PageEntity(1, 20, count, totalPage);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 查询用户群信息
|
| | | * @param callback
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getUserGroups")
|
| | | public void getUserGroups(String callback, Long uid, PrintWriter out) {
|
| | | try {
|
| | | List<UserCloudGroup> list = userCloudGroupService.listByUid(uid);
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("暂无数据")));
|
| | | return;
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); // 重点
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | long count = list.size();
|
| | | int totalPage = (int) (count % 20 == 0 ? count / 20 : count / 20 + 1);
|
| | | PageEntity pe = new PageEntity(1, 20, count, totalPage);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 开通成功记录
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param key
|
| | | * @param state
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "queryGoodsList")
|
| | | public void queryGoodsList(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
|
| | | try {
|
| | | if (pageIndex == null)
|
| | | pageIndex = 1;
|
| | | if (pageSize == null)
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | |
| | | List<UserCloudGoods> list = userCloudGoodsService.query(pageIndex, pageSize, key);
|
| | | if (list == null || list.size() == 0) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("暂无数据")));
|
| | | return;
|
| | | }
|
| | | |
| | | for (UserCloudGoods userCloud: list) {
|
| | | UserInfo userInfo = userInfoService.getUserByIdWithMybatis(userCloud.getUid());
|
| | | if (userInfo == null)
|
| | | continue;
|
| | | |
| | | userCloud.setNickName(userInfo.getNickName());
|
| | | userCloud.setPortrait(userInfo.getPortrait());
|
| | | }
|
| | | |
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); // 重点
|
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | long count = userCloudGoodsService.count(key);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(data)));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadFalseResult("操作异常")));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.FloatAD.FloatADTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgDeviceReadState;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | // 云发单链接
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 验证是否开启
|
| | | String cloudState = configService.getByVersion(ConfigKeyEnum.robotCloudOpen.getKey(), acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | if (!StringUtil.isNullOrEmpty(cloudState) && "1".equals(cloudState)) {
|
| | | data.put("cloudLink", configService.get(ConfigKeyEnum.robotCloudLink.getKey())); |
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | } else if (type == Constant.SOURCE_TYPE_VIP) {
|
| | | if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 10 || orderId.length() > 18)) {
|
| | | orderNum = false;
|
| | | }
|
| | | } else if (type == Constant.SOURCE_TYPE_SUNING) {
|
| | | if (!NumberUtil.isNumeric(orderId) || (orderId.length() < 10 || orderId.length() > 15)) {
|
| | | orderNum = false;
|
| | | }
|
| | | }
|
| | |
|
| | | if (lostOrder.getUserInfo() == null || lostOrder.getUserInfo().getId() == null
|
| | |
| | | import com.yeshi.fanli.service.inter.user.QrCodeService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService; |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService; |
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService; |
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService; |
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager; |
| | | import com.yeshi.fanli.util.Constant; |
| | |
| | | |
| | | @Resource |
| | | private CommonShareInfoService commonShareInfoService; |
| | | |
| | | @Resource |
| | | private UserCloudService userCloudService; |
| | | |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | |
| | | if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | listNew.addAll(list); |
| | | } else if (list.size() > 0) { // 活动图片不允许跳转 |
| | | |
| | | // 云发单是否开启 |
| | | String cloudState = configService.getByVersion(ConfigKeyEnum.robotCloudOpen.getKey(), acceptData.getPlatform(), |
| | | Integer.parseInt(acceptData.getVersion())); |
| | | boolean cloudOpen = false; |
| | | if (!StringUtil.isNullOrEmpty(cloudState) && "1".equals(cloudState)) { |
| | | cloudOpen = true; |
| | | } |
| | | |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | if (goodsEvaluate.getType() != EvaluateEnum.activity) { |
| | | EvaluateEnum evaluateEnum = goodsEvaluate.getType(); |
| | | // 单品 活动可以一键云发单 |
| | | if (cloudOpen && evaluateEnum == EvaluateEnum.activity || evaluateEnum == EvaluateEnum.single ) { |
| | | goodsEvaluate.setCloud(true); |
| | | } |
| | | |
| | | if (evaluateEnum != EvaluateEnum.activity) { |
| | | listNew.add(goodsEvaluate); |
| | | continue; |
| | | } |
| | |
| | | } else { |
| | | newText = newText.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + ""); |
| | | } |
| | | newText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | newText = newText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | } |
| | |
| | | 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.dto.pdd.PDDPromotionUrl;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo;
|
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfoRecommend;
|
| | | import com.yeshi.fanli.dto.taobao.DaTaoKeFilterResult;
|
| | | import com.yeshi.fanli.dto.vip.VIPConvertResultDTO;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | |
| | | 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(acceptData, goodsDetail, extraVO); // 云发单文案信息
|
| | | }
|
| | | |
| | | 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(acceptData, goodsDetail, extraVO); // 云发单文案信息
|
| | | }
|
| | |
|
| | | 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(acceptData, goodsDetail, extraVO); // 云发单文案信息
|
| | | }
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | |
| | | ShareVO shareInfoVO = new ShareVO();
|
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShare(shareInfoVO);
|
| | | |
| | | // 云发单文案信息
|
| | | getCloudInfo(acceptData, goodsDetail, extraVO); |
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | |
| | | shareInfoVO.setHelpLink(helpLink);
|
| | | extraVO.setShare(shareInfoVO);
|
| | |
|
| | | // 云发单文案信息
|
| | | getCloudInfo(acceptData, goodsDetail, extraVO); |
| | | |
| | | JSONObject object = new JSONObject();
|
| | | object.put("extra", JsonUtil.getApiCommonGson().toJson(extraVO));
|
| | | object.put("goods", JsonUtil.getApiCommonGson().toJson(goodsDetail));
|
| | |
| | | }
|
| | | });
|
| | | }
|
| | | |
| | | /**
|
| | | * // 云发单文案信息
|
| | | * @param goodsDetail
|
| | | */
|
| | | private void getCloudInfo(AcceptData acceptData, GoodsDetailVO goodsDetail, GoodsDetailExtraVO extraVO) {
|
| | | // 云发单是否开启
|
| | | String cloudState = configService.getByVersion(ConfigKeyEnum.robotCloudOpen.getKey(), acceptData.getPlatform(),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | if (!StringUtil.isNullOrEmpty(cloudState) && "1".equals(cloudState)) {
|
| | | extraVO.setCloudOpen(true);
|
| | | }
|
| | | |
| | | |
| | | 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)) {
|
| | | extraVO.setCloudPic(cloudPic);
|
| | | extraVO.setCloudText(cloudText);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 商品详情推荐(猜你喜欢 + 推荐)
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | // 京东
|
| | | if (goodsType == Constant.SOURCE_TYPE_JD) {
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) {
|
| | | // 猜你喜欢
|
| | |
|
| | | // 唯品会
|
| | | if (goodsType == Constant.SOURCE_TYPE_VIP) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("listGuess", JsonUtil.getApiCommonGson().toJson(new ArrayList<GoodsDetailVO>()));
|
| | | data.put("listQuality", JsonUtil.getApiCommonGson().toJson(new ArrayList<GoodsDetailVO>()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | |
| | | // 苏宁
|
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) {
|
| | | List<SuningGoodsInfo> resultList = null;
|
| | | String[] ids = SuningUtil.getGoodsIdDetail(id);
|
| | | List<SuningGoodsInfoRecommend> list = SuningApiUtil.getRecommendGoods(ids[1], ids[0]);
|
| | | if (list != null && list.size() > 0) {
|
| | | List<String> listId = new ArrayList<>();
|
| | | for (SuningGoodsInfoRecommend goodsInfo: list) {
|
| | | if (goodsInfo != null) {
|
| | | listId.add(goodsInfo.getCommodityCode() + "-" + goodsInfo.getSupplierCode());
|
| | | }
|
| | | }
|
| | | resultList = SuningApiUtil.getGoodsDetailList(listId);
|
| | | }
|
| | | |
| | | List<GoodsDetailVO> listDetailVO = new ArrayList<GoodsDetailVO>();
|
| | | if (resultList != null) {
|
| | | if (resultList != null && resultList.size() > 0) {
|
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (SuningGoodsInfo goods : resultList) {
|
| | | GoodsDetailVO goodsDetailVO = GoodsDetailVOFactory.convertSuningGoods(goods, paramsDTO);
|
| | | listDetailVO.add(goodsDetailVO);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("listQuality", JsonUtil.getApiCommonGson().toJson(listDetailVO));
|
| | | data.put("listGuess", JsonUtil.getApiCommonGson().toJson(new ArrayList<GoodsDetailVO>()));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | |
| | | List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.guessLikeByAuctionId(Long.parseLong(id), 10);
|
| | | // 初始化
|
| | | if (goodsList == null) {
|
| | |
| | | }
|
| | |
|
| | | List<GoodsDetailVO> listExtra = new ArrayList<GoodsDetailVO>();
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | app.setAdzoneId(TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT.split("_")[3]);
|
| | | app.setPid(TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT);
|
| | |
|
| | | List<Long> ids = new ArrayList<>();
|
| | | for (TaoBaoGoodsBrief goods : goodsList)
|
| | | ids.add(goods.getAuctionId());
|
| | |
|
| | | try {
|
| | | goodsList = TaoKeApiUtil.getBatchGoodsInfo(ids);
|
| | | } catch (TaoKeApiException e1) {
|
| | | } catch (TaobaoGoodsDownException e1) {
|
| | | }
|
| | |
|
| | | if (goodsList != null && goodsList.size() > 0) {
|
| | |
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null);
|
| | |
|
| | | goodsList.parallelStream().forEach(goods -> {
|
| | | if (goods != null) {
|
| | | // 获取详情
|
| | | TaoBaoGoodsBrief taoBaoGoodsBrief = null;
|
| | | try {
|
| | | taoBaoGoodsBrief = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(goods.getAuctionId());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (taoBaoGoodsBrief == null) {
|
| | | TaoBaoGoodsBrief newGoods = TaoKeApiUtil.specialConvertCoupon(goods.getAuctionId(), app);
|
| | | goods.setCouponInfo(newGoods.getCouponInfo());
|
| | | goods.setCouponLink(newGoods.getCouponLink());
|
| | | goods.setTkRate(newGoods.getTkRate());
|
| | | taoBaoGoodsBrief = goods;
|
| | | }
|
| | |
|
| | | if (taoBaoGoodsBrief != null) {
|
| | | listExtra.add(GoodsDetailVOFactory.convertTaoBao(taoBaoGoodsBrief, paramsDTO));
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | ConfigParamsDTO paramsDTO = getParamsDTO(acceptData.getPlatform(), acceptData.getVersion(), null);
|
| | | goodsList.parallelStream().forEach(goods -> {
|
| | | if (goods != null) { |
| | | listExtra.add(GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO));
|
| | | }
|
| | | });
|
| | |
|
| | | List<GoodsDetailVO> listQuality = new ArrayList<GoodsDetailVO>();
|
| | | // 取偶数个数据
|
| | |
| | | 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.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | | import com.yeshi.fanli.dto.pdd.PDDSearchFilter;
|
| | | import com.yeshi.fanli.dto.suning.SuningCommodityInfo;
|
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo;
|
| | | import com.yeshi.fanli.dto.suning.SuningQueryModel;
|
| | | import com.yeshi.fanli.dto.vip.VIPSearchFilter;
|
| | |
| | | SuningQueryModel searchFilter = new SuningQueryModel();
|
| | | searchFilter.setKeyword(key);
|
| | | searchFilter.setPageIndex(page);
|
| | | searchFilter.setSize(Constant.PAGE_SIZE);
|
| | | searchFilter.setSize(10);
|
| | |
|
| | | if (order != null) {
|
| | | if (order == 1) { // 销量高到低
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | int count = 0;
|
| | | JSONObject data = new JSONObject();
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | | List<SuningGoodsInfo> resultList = SuningApiUtil.searchGoods(searchFilter);
|
| | | List<SuningGoodsInfo> resultList = null;
|
| | | List<SuningGoodsInfo> list = SuningApiUtil.searchGoodsOld(searchFilter);
|
| | | if (list != null && list.size() > 0) {
|
| | | List<String> listId = new ArrayList<>();
|
| | | for (SuningGoodsInfo goodsInfo: list) {
|
| | | SuningCommodityInfo info = goodsInfo.getCommodityInfo();
|
| | | if (info != null) {
|
| | | listId.add(info.getCommodityCode() + "-" + info.getSupplierCode());
|
| | | }
|
| | | }
|
| | | resultList = SuningApiUtil.getGoodsDetailList(listId);
|
| | | }
|
| | | |
| | | if (resultList != null) {
|
| | | if (resultList.size() == 0)
|
| | | count = 0;
|
| | | else
|
| | | count = resultList.size() + 1;
|
| | | Gson gson = JsonUtil.getApiCommonGson();
|
| | | if (resultList != null && resultList.size() > 0) {
|
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | |
| | | }
|
| | |
|
| | | data.put("result", array);
|
| | | data.put("count", count);
|
| | | data.put("count", 1000);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
| | | shareInfo.setDescText(descText); |
| | | |
| | | // |
| | | String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgs.getKey(), acceptData.getPlatform(), |
| | | String imgs = configService.getByVersion(ConfigKeyEnum.goodsShareNotifyImgsVIP.getKey(), acceptData.getPlatform(), |
| | | Integer.parseInt(acceptData.getVersion())); |
| | | JSONArray array = JSONArray.fromObject(imgs); |
| | | shareInfo.setNotifyPicture(imgs); |
| | | shareInfo.setNotifyPictureNew(imgs); |
| | | |
| | | shareInfo.setNotifyPicture(array.size() > 1 ? array.optString(1) : array.optString(0)); |
| | | |
| | | // 2.0.7版本后的提示图片 |
| | | imgs = configService.get(ConfigKeyEnum.goodsShareNotifyImgs207.getKey()); |
| | | array = JSONArray.fromObject(imgs); |
| | | shareInfo.setNotifyPictureNew(array.size() > 1 ? array.optString(1) : array.optString(0)); |
| | | |
| | | shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotifyPDD.getKey())); |
| | | shareInfo.setNotifyDesc(configService.get(ConfigKeyEnum.goodsShareNotifyVIP.getKey())); |
| | | |
| | | // 添加分享记录 |
| | | BigDecimal shareRate = hongBaoManageService.getShareRate(); |
| | |
| | | String recommendText = ""; |
| | | String qtemplate = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey()); |
| | | recommendText = qtemplate.replace("[商品标题]", goods.getGoodsName()); |
| | | |
| | | recommendText = recommendText.replace("销量:[销量]", ""); |
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", ""); |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickSharePDDCommentText.getKey()); |
| | | commentText = quickCommentText.replace("[原价]", goods.getMarketPrice()); |
| | | commentText = commentText.replace("[链接]", jumpLink.getUrl()); |
| | | |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickShareVIPCommentText.getKey()); |
| | | commentText = commentText.replace("[链接]", jumpLink.getUrl()); |
| | | commentText = quickCommentText.replace("[在售价]", BigDecimalUtil.getWithNoZera(new BigDecimal(goods.getMarketPrice())).toString()); |
| | | commentText = commentText.replace("[折扣价]", "" +MoneyBigDecimalUtil.getWithNoZera(new BigDecimal(goods.getVipPrice()))); |
| | | |
| | | shareInfo.setRecommendText(deleteBlankLine(recommendText)); |
| | | shareInfo.setCommentText(deleteBlankLine(commentText)); |
| | | |
| | |
| | | if (imgList == null) { |
| | | imgList = new ArrayList<>(); |
| | | } |
| | | |
| | | if (imgList.size() > 10) { |
| | | imgList = imgList.subList(0, 9); |
| | | } |
| | | |
| | | history.setPictures(JsonUtil.getGson().toJson(imgList)); |
| | | shareGoodsService.addShareGoodsHistory(history); |
| | | } |
| | |
| | | hongBaoManageService.getFanLiRate(UserLevelEnum.superVIP)))); |
| | | } |
| | | |
| | | String template = shareGoodsTextTemplateService.getTextTemplateByVIP(uid); |
| | | String shareText = shareGoodsTextTemplateService.createContentSuning(template, goods, jumpLink); |
| | | String template = shareGoodsTextTemplateService.getTextTemplateBySuNing(uid); |
| | | //String shareText = shareGoodsTextTemplateService.createQuickShareTextSuNing(template, goods, jumpLink); |
| | | |
| | | String shareText = shareGoodsTextTemplateService.createCommonShareTextSuNing(template, goods, jumpLink); |
| | | shareInfo.setShareText(shareText); |
| | | |
| | | String descText = shareText.replace(goods.getCommodityInfo().getCommodityName(), "").trim(); |
| | |
| | | |
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid); |
| | | |
| | | String commodityPrice = goods.getCommodityInfo().getCommodityPrice(); |
| | | if (StringUtil.isNullOrEmpty(commodityPrice)) { |
| | | commodityPrice = goods.getCommodityInfo().getSnPrice(); |
| | | } |
| | | |
| | | String commentText = ""; |
| | | String recommendText = ""; |
| | | String qtemplate = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey()); |
| | |
| | | |
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", ""); |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickSharePDDCommentText.getKey()); |
| | | commentText = quickCommentText.replace("[原价]", goods.getCommodityInfo().getCommodityPrice()); |
| | | |
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickShareSuNingCommentText.getKey()); |
| | | commentText = quickCommentText.replace("[原价]", BigDecimalUtil.getWithNoZera(new BigDecimal(commodityPrice)).toString()); |
| | | commentText = commentText.replace("[链接]", jumpLink); |
| | | |
| | | |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | |
| | | String salesCountMidea = ""; |
| | | Integer count = Integer.parseInt(goods.getCommodityInfo().getMonthSales()); |
| | | if (count < 10000) { |
| | | salesCountMidea = count + ""; |
| | | } else { |
| | | double sales = count; |
| | | salesCountMidea = String.format("%.1f", sales / 10000); |
| | | salesCountMidea = salesCountMidea + "万"; |
| | | } |
| | | if (StringUtil.isNullOrEmpty(salesCountMidea) || salesCountMidea.equals("0")) { |
| | | recommendText = recommendText.replace("销量:[销量]", ""); |
| | | } else { |
| | | recommendText = recommendText.replace("[销量]", salesCountMidea.replace("万", "w")); |
| | | } |
| | | |
| | | |
| | | if (goods.getCouponInfo() != null && !StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl())) {// 有券 |
| | | BigDecimal amount = new BigDecimal(goods.getCouponInfo().getCouponValue()); |
| | | BigDecimal startFee = new BigDecimal(goods.getCouponInfo().getBounsLimit()); |
| | | BigDecimal zkPrice = new BigDecimal(commodityPrice); |
| | | BigDecimal couponPrice = zkPrice; |
| | | if (zkPrice.compareTo(startFee) >= 0) { |
| | | couponPrice = zkPrice.subtract(amount); |
| | | } |
| | | recommendText = recommendText.replace("[券面额]", |
| | | BigDecimalUtil.getWithNoZera(new BigDecimal(goods.getCouponInfo().getCouponValue())).toString()); |
| | | commentText = commentText.replace("[券后价]",BigDecimalUtil.getWithNoZera(couponPrice).toString()); |
| | | } else { |
| | | commentText = commentText.replace("领券抢购", "抢购"); |
| | | commentText = commentText.replace("【券后价】[券后价]元", ""); |
| | | recommendText = recommendText.replace("优惠券:[券面额]元", ""); |
| | | } |
| | | |
| | | shareInfo.setRecommendText(deleteBlankLine(recommendText)); |
| | | shareInfo.setCommentText(deleteBlankLine(commentText)); |
| | | |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "viewShareTextTemplate", method = RequestMethod.POST) |
| | | public void viewShareTextTemplate(AcceptData acceptData, Long uid, String template, Integer goodsType, Long goodsId, |
| | | public void viewShareTextTemplate(AcceptData acceptData, Long uid, String template, Integer goodsType, String goodsId, |
| | | Long tljId, Boolean hasCoupon, PrintWriter out) { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录")); |
| | |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == null || goodsType > 3 || goodsType < 1) { |
| | | out.print(JsonUtil.loadFalseResult(3, "平台类型不正确")); |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | createTaoBaoViewText(goodsType, uid, template, goodsId, tljId, hasCoupon, out); |
| | | createTaoBaoViewText(goodsType, uid, template,Long.parseLong(goodsId) , tljId, hasCoupon, out); |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | createJDViewText(goodsType, uid, template, goodsId, hasCoupon, out); |
| | | createJDViewText(goodsType, uid, template, Long.parseLong(goodsId), hasCoupon, out); |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | createPDDViewText(goodsType, uid, template, goodsId, hasCoupon, out); |
| | | createPDDViewText(goodsType, uid, template, Long.parseLong(goodsId), hasCoupon, out); |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_VIP) { |
| | | createVIPViewText(goodsType, uid, template, Long.parseLong(goodsId), hasCoupon, out); |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | createSuNingViewText(goodsType, uid, template, goodsId, hasCoupon, out); |
| | | return; |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 唯品会分享 |
| | | * @param goodsType |
| | | * @param uid |
| | | * @param template |
| | | * @param goodsId |
| | | * @param hasCoupon |
| | | * @param out |
| | | */ |
| | | private void createVIPViewText(Integer goodsType, Long uid, String template, Long goodsId, Boolean hasCoupon, |
| | | PrintWriter out) { |
| | | VIPGoodsInfo goods = VipShopApiUtil.getGoodsDetail(goodsId + ""); |
| | | if (goods == null) { |
| | | out.print(JsonUtil.loadFalseResult(4, "商品已下架")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(template)) { |
| | | template = getShareTemplate(goodsType, uid, hasCoupon, null); |
| | | } |
| | | |
| | | // 校验券模板是否正确 |
| | | try { |
| | | shareGoodsTextTemplateService.verifyRightVIP(template); |
| | | } catch (ShareGoodsTextTemplateException e) { |
| | | out.print(JsonUtil.loadFalseResult(5, e.getMsg())); |
| | | return; |
| | | } |
| | | |
| | | VIPConvertResultDTO jumpLink = VipShopApiUtil.convertLink(goodsId + "", VipShopUtil.getShareChanTag(uid)); |
| | | |
| | | // 生成分享内容 |
| | | String content = shareGoodsTextTemplateService.createContentVIP(template, goods, jumpLink.getUrl()); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("content", content); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | |
| | | |
| | | private void createSuNingViewText(Integer goodsType, Long uid, String template, String goodsId, Boolean hasCoupon, |
| | | PrintWriter out) { |
| | | String[] ids = SuningUtil.getGoodsIdDetail(goodsId); |
| | | SuningGoodsInfo goods = SuningApiUtil.getGoodsDetail(ids[1], ids[0]); |
| | | if (goods == null) { |
| | | out.print(JsonUtil.loadFalseResult(4, "商品已下架")); |
| | | return; |
| | | } |
| | | |
| | | if (StringUtil.isNullOrEmpty(template)) { |
| | | template = getShareTemplate(goodsType, uid, hasCoupon, null); |
| | | } |
| | | |
| | | // 校验券模板是否正确 |
| | | try { |
| | | shareGoodsTextTemplateService.verifyRightSuNing(template); |
| | | } catch (ShareGoodsTextTemplateException e) { |
| | | out.print(JsonUtil.loadFalseResult(5, e.getMsg())); |
| | | return; |
| | | } |
| | | |
| | | String couponLink = goods.getCouponInfo().getCouponUrl(); |
| | | String jumpLink = SuningApiUtil.convertLink(SuningUtil.getProductUrl(ids[0], ids[1]), |
| | | StringUtil.isNullOrEmpty(couponLink) ? null : couponLink, SuningApiUtil.PID_SHARE, uid + ""); |
| | | |
| | | // 生成普通分享内容 |
| | | String content = shareGoodsTextTemplateService.createCommonShareTextSuNing(template, goods, jumpLink); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("content", content); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | /** |
| | | * 获取分享模板 |
| | | * |
| | | * @param uid |
| | |
| | | template = shareGoodsTextTemplateService.getTextTemplateByJD(uid); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | template = shareGoodsTextTemplateService.getTextTemplateByPDD(uid); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_VIP) { |
| | | template = shareGoodsTextTemplateService.getTextTemplateByVIP(uid); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | template = shareGoodsTextTemplateService.getTextTemplateBySuNing(uid); |
| | | } |
| | | return template; |
| | | } |
| | |
| | | */ |
| | | @RequestMapping(value = "getShareTextTemplateRules", method = RequestMethod.POST) |
| | | public void getShareTextTemplateRules(AcceptData acceptData, Integer goodsType, Long tljId, PrintWriter out) { |
| | | if (goodsType == null || goodsType > 3 || goodsType < 1) { |
| | | out.print(JsonUtil.loadFalseResult(3, "平台类型不正确")); |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | if (tljId != null) { |
| | | out.print( |
| | |
| | | out.print(JsonUtil.loadTrueResult(configService.get(ConfigKeyEnum.shareGoodsTemplateRulesJD.getKey()))); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | out.print(JsonUtil.loadTrueResult(configService.get(ConfigKeyEnum.shareGoodsTemplateRulesPDD.getKey()))); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_VIP) { |
| | | out.print(JsonUtil.loadTrueResult(configService.get(ConfigKeyEnum.shareGoodsTemplateRulesVIP.getKey()))); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | out.print(JsonUtil.loadTrueResult(configService.get(ConfigKeyEnum.shareGoodsTemplateRulesSuNing.getKey()))); |
| | | } |
| | | } |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == null || goodsType > 3 || goodsType < 1) { |
| | | out.print(JsonUtil.loadFalseResult(3, "平台类型不正确")); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | shareGoodsTextTemplateService.saveTemplateTB(uid, template); |
| | |
| | | shareGoodsTextTemplateService.saveTemplateJD(uid, template); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | shareGoodsTextTemplateService.saveTemplatePDD(uid, template); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_VIP) { |
| | | shareGoodsTextTemplateService.saveTemplateVIP(uid, template); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | shareGoodsTextTemplateService.saveTemplateSuNing(uid, template); |
| | | } |
| | | } catch (ShareGoodsTextTemplateException e) { |
| | | out.print(JsonUtil.loadFalseResult(5, e.getMsg())); |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "resetShareTextTemplate", method = RequestMethod.POST) |
| | | public void resetShareTextTemplate(AcceptData acceptData, Long uid, Long goodsId, Long tljId, Boolean hasCoupon, |
| | | public void resetShareTextTemplate(AcceptData acceptData, Long uid, String goodsId, Long tljId, Boolean hasCoupon, |
| | | Integer goodsType, PrintWriter out) { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | if (goodsType == null || goodsType > 3 || goodsType < 1) { |
| | | out.print(JsonUtil.loadFalseResult(3, "平台类型不正确")); |
| | | return; |
| | | } |
| | | |
| | |
| | | shareGoodsTextTemplateService.resetCommonTemplateJD(uid); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | shareGoodsTextTemplateService.resetCommonTemplatePDD(uid); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_VIP) { |
| | | shareGoodsTextTemplateService.resetCommonTemplateVIP(uid); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | shareGoodsTextTemplateService.resetCommonTemplateSuNing(uid); |
| | | } |
| | | |
| | | if (goodsId != null) { |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "getShareTextQuick", method = RequestMethod.POST) |
| | | public void getShareTextQuick(AcceptData acceptData, Long goodsId, Integer goodsType, Long uid, PrintWriter out) { |
| | | public void getShareTextQuick(AcceptData acceptData, String goodsId, Integer goodsType, Long uid, PrintWriter out) { |
| | | if (uid == null) { |
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录")); |
| | | return; |
| | |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(goodsId); |
| | | TaoBaoGoodsBrief goods = taoBaoGoodsCacheUtil.getCommonTaoBaoGoodsInfo(Long.parseLong(goodsId)); |
| | | if (goods == null) { |
| | | try { |
| | | goods = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | | goods = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); |
| | | } catch (TaobaoGoodsDownException e) { |
| | | goods = null; |
| | | } |
| | |
| | | goodsDetail = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(goodsId); |
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | if (goods != null) { |
| | | goodsDetail = GoodsDetailVOFactory.convertJDGoods(goods, paramsDTO); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId); |
| | | PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(Long.parseLong(goodsId)); |
| | | if (goods != null) { |
| | | goodsDetail = GoodsDetailVOFactory.convertPDDGoods(goods, paramsDTO); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_VIP) { |
| | | VIPGoodsInfo goods = VipShopApiUtil.getGoodsDetail(goodsId + ""); |
| | | if (goods == null) { |
| | | goodsDetail = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_SUNING) { |
| | | String[] ids = SuningUtil.getGoodsIdDetail(goodsId); |
| | | SuningGoodsInfo goods = SuningApiUtil.getGoodsDetail(ids[1], ids[0]); |
| | | if (goods != null) { |
| | | goodsDetail = GoodsDetailVOFactory.convertSuningGoods(goods, paramsDTO); |
| | | } |
| | | } |
| | | |
| | | if (goodsDetail == null) { |
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.JsonElement;
|
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.dto.ConfigParamsDTO;
|
| | | import com.yeshi.fanli.dto.aitaoker.QrcodeLoginDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloud;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods;
|
| | | 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.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGroupException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | 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;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGroupService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudManageService;
|
| | | 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;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.aitaoker.AitaokerApiUtil;
|
| | | import com.yeshi.fanli.util.factory.goods.GoodsDetailVOFactory;
|
| | | import com.yeshi.fanli.util.suning.SuningUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.user.cloud.UserCloudInfoVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("api/v2/user/cloud")
|
| | | public class UserCloudControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private UserCloudService userCloudService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudOrderService userCloudOrderService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudGroupService userCloudGroupService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudGoodsService userCloudGoodsService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudManageService userCloudManageService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudAlipayManager userCloudAlipayManager;
|
| | | |
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | /**
|
| | | * 查询开通记录
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getOrderRecord")
|
| | | public void getOrderRecord(String callback, AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (page == null)
|
| | | page = 1;
|
| | |
|
| | | // 查询成功记录
|
| | | int state = 1;
|
| | | List<UserCloudOrder> list = userCloudOrderService.getOrderRecord(page, Constant.PAGE_SIZE, uid, state);
|
| | | if (list == null)
|
| | | list = new ArrayList<>();
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | gsonBuilder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
|
| | | @Override
|
| | | public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("");
|
| | | } else {
|
| | | // 保留2位小数
|
| | | value = value.setScale(2, BigDecimal.ROUND_DOWN);
|
| | | return new JsonPrimitive(value.toString());
|
| | | }
|
| | | }
|
| | | }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
|
| | | @Override
|
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("");
|
| | | } else {
|
| | | return new JsonPrimitive(TimeUtil.formatDate(value));
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | long count = userCloudOrderService.countOrderRecord(uid, state);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("list", gsonBuilder.create().toJson(list));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取开通信息
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getCloudInfo")
|
| | | public void getCloudInfo(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo userInfo = userInfoService.getUserByIdWithMybatis(uid);
|
| | | if (userInfo == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户信息不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserCloudInfoVO cloudInfoVO = new UserCloudInfoVO();
|
| | | cloudInfoVO.setNickName(userInfo.getNickName());
|
| | | cloudInfoVO.setPortrait(userInfo.getPortrait());
|
| | | cloudInfoVO.setOpenState(0); // 未开通
|
| | |
|
| | | // 是否开通
|
| | | UserCloud userCloud = userCloudService.getLastByUid(uid);
|
| | | if (userCloud == null) {
|
| | | cloudInfoVO.setOpenState(0); // 未开通
|
| | | } else {
|
| | | Date endTime = userCloud.getEndTime();
|
| | | if (endTime != null && endTime.getTime() > java.lang.System.currentTimeMillis()) {
|
| | | cloudInfoVO.setOpenState(1); // 还未过期
|
| | | // 登录微信
|
| | | cloudInfoVO.setWxName(userCloud.getWxName());
|
| | | if (userCloud.getStartTime() != null)
|
| | | cloudInfoVO.setOpenTime(TimeUtil.formatDateDot(userCloud.getStartTime()));
|
| | | if (userCloud.getEndTime() != null) {
|
| | | try {
|
| | | cloudInfoVO.setCountdown(DateUtil.daysBetween2(new Date(), userCloud.getEndTime()) + "");
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | Integer robotId = userCloud.getRobotId();
|
| | | // 检测是否已登录
|
| | | if (AitaokerApiUtil.onlineCheck(robotId)) {
|
| | | boolean circle = false;
|
| | | List<UserCloudGroup> listGroup = new ArrayList<>();
|
| | | List<UserCloudGroup> list = userCloudGroupService.listByUid(uid);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (UserCloudGroup cloudGroup : list) {
|
| | | if (cloudGroup.getType() == UserCloudGroup.TYPE_CIRCLE) {
|
| | | if (cloudGroup.getState() != null)
|
| | | circle = cloudGroup.getState();
|
| | | } else {
|
| | | listGroup.add(cloudGroup);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | cloudInfoVO.setLoginState(true);
|
| | | cloudInfoVO.setCircle(circle);
|
| | | cloudInfoVO.setListGroup(listGroup);
|
| | | }
|
| | | }
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(cloudInfoVO));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取登录二维码
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getQrcodeMaclogin")
|
| | | public void getQrcodeMaclogin(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserCloud userCloud = userCloudService.getValidByUid(uid);
|
| | | if (userCloud == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "未开通云发单"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 机器人ID
|
| | | Integer robotId = userCloud.getRobotId();
|
| | | if (robotId == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "正在开通中,如有疑问请联系客服"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 获取登录URL
|
| | | QrcodeLoginDTO maclogin = AitaokerApiUtil.getQrcodeMaclogin(userCloud.getRobotId());
|
| | | if (maclogin == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "获取登录二维码失败"));
|
| | | return;
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("wId", maclogin.getwId());
|
| | | data.put("qrCodeUrl", maclogin.getQrCodeUrl());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 检测是否微信登录
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param wId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "macloginCheck")
|
| | | public void macloginCheck(String callback, AcceptData acceptData, Long uid, String wId, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserCloud userCloud = userCloudService.getValidByUid(uid);
|
| | | if (userCloud == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "云发单开通已过期"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 机器人ID
|
| | | Integer robotId = userCloud.getRobotId();
|
| | | if (robotId == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "正在开通中,如有疑问请联系客服"));
|
| | | return;
|
| | | }
|
| | |
|
| | | boolean state = false;
|
| | | JSONObject data = new JSONObject();
|
| | | QrcodeLoginDTO dto = AitaokerApiUtil.getQrcodeMacloginCheck(robotId, wId);
|
| | | if (dto != null) {
|
| | | LogHelper.cloudInfo("方法macloginCheck: [uid=" + uid + "][wxID=" + dto.getWcId() + "][ NickName=" + dto.getNickName() + "]" );
|
| | | try {
|
| | | // 更新微信信息
|
| | | userCloudService.updateWXInfo(uid, dto.getWcId(), dto.getNickName(), dto.getHeadUrl());
|
| | | } catch (UserCloudException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | return;
|
| | | }
|
| | |
|
| | | state = true;
|
| | | boolean circle = false;
|
| | | List<UserCloudGroup> listGroup = new ArrayList<>();
|
| | | List<UserCloudGroup> list = userCloudGroupService.listByUid(uid);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (UserCloudGroup cloudGroup : list) {
|
| | | if (cloudGroup.getType() == UserCloudGroup.TYPE_CIRCLE) {
|
| | | if (cloudGroup.getState() != null)
|
| | | circle = cloudGroup.getState();
|
| | | } else {
|
| | | listGroup.add(cloudGroup);
|
| | | }
|
| | | }
|
| | | }
|
| | | data.put("wxName", dto.getNickName());
|
| | | data.put("circle", circle);
|
| | | data.put("listGroup", listGroup);
|
| | | }
|
| | | data.put("state", state);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 退出登录
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "macloginOffline")
|
| | | public void macloginOffline(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserCloud userCloud = userCloudService.getLastByUid(uid);
|
| | | if (userCloud == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("云发单开通已过期"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 机器人ID
|
| | | Integer robotId = userCloud.getRobotId();
|
| | | if (robotId == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "未绑定机器人"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 退出机器人
|
| | | boolean offline = AitaokerApiUtil.macloginOffline(robotId);
|
| | | if (offline) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("退出成功"));
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("退出失败"));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 切换朋友圈状态
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchCircleState")
|
| | | public void switchCircleState(String callback, AcceptData acceptData, Long uid, Boolean state, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | if (state == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "状态不能为空"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | userCloudGroupService.switchCircleState(uid, state);
|
| | | } catch (UserCloudGroupException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 检测是否微信登录
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param wId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "searchGroup")
|
| | | public void searchGroup(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | // 重新获取群列表
|
| | | userCloudService.searchGroup(uid);
|
| | | // 获取最新群
|
| | | List<UserCloudGroup> list = userCloudGroupService.listGroupByUid(uid);
|
| | | if (list == null)
|
| | | list = new ArrayList<>();
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("listGroup", list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (UserCloudException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, e.getMsg()));
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置状态
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchGroupState")
|
| | | public void switchGroupState(String callback, AcceptData acceptData, Long uid, Long id, Boolean state,
|
| | | PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | if (id == null || state == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "参数不能为空"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | userCloudGroupService.switchGroupState(uid, id, state);
|
| | | } catch (UserCloudGroupException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取云发单库商品
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param page
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getGoodsList")
|
| | | public void getGoodsList(String callback, AcceptData acceptData, Long uid, Integer page, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (page == null)
|
| | | page = 1;
|
| | |
|
| | | List<UserCloudGoods> list = userCloudGoodsService.listByUid((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
|
| | | uid);
|
| | | if (list == null)
|
| | | list = new ArrayList<>();
|
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | JSONObject data = new JSONObject();
|
| | | if (list.size() > 0) {
|
| | | List<Long> listGid = new ArrayList<Long>();
|
| | | for (UserCloudGoods cloudGoods : list) {
|
| | | CommonGoods commonGoods = cloudGoods.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | | continue;
|
| | | }
|
| | | listGid.add(commonGoods.getGoodsId());
|
| | | }
|
| | |
|
| | | // API网络接口验证是否在售
|
| | | List<TaoBaoGoodsBrief> listTaoKeGoods = null;
|
| | | try {
|
| | | listTaoKeGoods = TaoKeApiUtil.getBatchGoodsInfo(listGid);
|
| | | } catch (TaoKeApiException e) {
|
| | | e.printStackTrace();
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | Gson gson = JsonUtil.getConvertBigDecimalToStringSubZeroBuilder(new GsonBuilder())
|
| | | .excludeFieldsWithoutExposeAnnotation().setDateFormat("yyyy-MM-dd").create();
|
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate(acceptData.getPlatform(),
|
| | | acceptData.getVersion());
|
| | |
|
| | | for (UserCloudGoods cloudGoods : list) {
|
| | | CommonGoods commonGoods = cloudGoods.getCommonGoods();
|
| | | if (commonGoods == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | // 淘宝商品验证在售
|
| | | if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | if (listTaoKeGoods != null && listTaoKeGoods.size() > 0) {
|
| | | int state = 1; // 默认停售
|
| | | Long goodsId = commonGoods.getGoodsId();
|
| | | for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) {
|
| | | Long auctionId = taoKeGoods.getAuctionId();
|
| | | if (goodsId == auctionId || goodsId.equals(auctionId)) {
|
| | | state = 0; // 在售
|
| | | break;
|
| | | }
|
| | | }
|
| | | commonGoods.setState(state);
|
| | | }
|
| | | }
|
| | |
|
| | | // 判断是否已分享, 已分享显示已下架
|
| | | Integer state = cloudGoods.getState();
|
| | | if (state != null && state == UserCloudGoods.STATE_SHARED) {
|
| | | Integer goodsState = commonGoods.getState();
|
| | | if (goodsState != null && goodsState != 1) {
|
| | | commonGoods.setState(2);
|
| | | }
|
| | | }
|
| | |
|
| | | GoodsDetailVO detailVO = GoodsDetailVOFactory.convertCommonGoods(commonGoods, paramsDTO);
|
| | | detailVO.setId(commonGoods.getId());
|
| | |
|
| | | JSONObject dataObject = new JSONObject();
|
| | | dataObject.put("id", cloudGoods.getId());
|
| | | dataObject.put("goods", gson.toJson(detailVO));
|
| | | array.add(dataObject);
|
| | | }
|
| | | }
|
| | |
|
| | | // 第一页返回设置信息
|
| | | if (page == 1) {
|
| | | boolean custom = false;
|
| | | boolean official = false;
|
| | | UserCloudManage cloudManage = userCloudManageService.selectByPrimaryKey(uid);
|
| | | if (cloudManage != null) {
|
| | | if (cloudManage.getOfficial() != null)
|
| | | official = cloudManage.getOfficial();
|
| | | if (cloudManage.getCustom() != null)
|
| | | custom = cloudManage.getCustom();
|
| | | }
|
| | | data.put("custom", custom);
|
| | | data.put("official", official);
|
| | | }
|
| | | data.put("count", userCloudGoodsService.countByUid(uid));
|
| | | data.put("list", array);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 删除云发单备选库
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteGoods")
|
| | | public void deleteGoods(String callback, AcceptData acceptData, Long uid, Long id, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "参数不完整"));
|
| | | return;
|
| | | }
|
| | | userCloudGoodsService.deleteByPrimaryKeyAndUid(id, uid);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 设置状态
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(String callback, AcceptData acceptData, Long uid, Integer type, Boolean state,
|
| | | PrintWriter out) {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | if (type == 1) {
|
| | | userCloudManageService.save(uid, state, null);
|
| | | } else {
|
| | | userCloudManageService.save(uid, null, state);
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 云发单支付
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param type 机器人类型
|
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "pay")
|
| | | public void pay(String callback, AcceptData acceptData, Long uid, String type, HttpServletResponse response,
|
| | | PrintWriter out) {
|
| | | try {
|
| | | if (uid == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(type)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "请选择云发单套餐"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 创建支付信息
|
| | | String alipayForm = userCloudAlipayManager.getAlipayForm(uid, type);
|
| | |
|
| | | // 返回信息
|
| | | response.setContentType("text/html;charset=utf-8");
|
| | | PrintWriter print = response.getWriter();
|
| | | StringBuilder builder = new StringBuilder();
|
| | | builder.append("<html><head><title>alipay</title></head>");
|
| | | builder.append("<body>" + alipayForm + "</body></html>");
|
| | | JsonUtil.printMode(print, callback, builder.toString());
|
| | | print.close();
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "创建支付信息失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 支付完成
|
| | | * |
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "payEnd")
|
| | | public void payEnd(String callback, AcceptData acceptData, Long id, PrintWriter out) {
|
| | | if (id == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "参数信息缺失"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | userCloudAlipayManager.tradeQueryByOrderId(id);
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "检测失败"));
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 动态一键发单
|
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "sendCircle")
|
| | | public void sendCircle(String callback, AcceptData acceptData, Long uid, String id, PrintWriter out) {
|
| | | if (uid == null || StringUtil.isNullOrEmpty(id)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
|
| | | return;
|
| | | }
|
| | | try {
|
| | | userCloudService.sendByDynamic(uid, id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("一键发单成功"));
|
| | | } catch (UserCloudException e) {
|
| | | if (e.getCode() > 1000 && e.getCode() < 1100) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("link", configService.get(ConfigKeyEnum.robotCloudLink.getKey()));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrue(e.getCode(), data, e.getMsg()).toString());
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(),e.getMsg()));
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 商品详情一键发单
|
| | | * @param callback
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param goodsId
|
| | | * @param goodsType
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "sendGoods")
|
| | | public void sendGoods(String callback, AcceptData acceptData, Long uid, String goodsId, Integer goodsType, PrintWriter out) {
|
| | | if (uid == null || goodsId == null || goodsType == null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("参数不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | GoodsEvaluate evaluate = goodsEvaluateService.queryExistSingle(goodsId, goodsType);
|
| | | if (evaluate != null) {
|
| | | userCloudService.sendByDynamic(uid, evaluate.getId());
|
| | | } else {
|
| | | |
| | | Long gid = null;
|
| | | Long sellerId = null;
|
| | | if (goodsType == Constant.SOURCE_TYPE_SUNING) { // 苏宁
|
| | | String[] ids = SuningUtil.getGoodsIdDetail(goodsId);
|
| | | gid = Long.parseLong(ids[1]);
|
| | | sellerId = Long.parseLong(ids[0]);
|
| | | } else {
|
| | | gid = Long.parseLong(goodsId);
|
| | | }
|
| | | userCloudService.sendCustomGoods(uid, gid, goodsType, sellerId);
|
| | | }
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("加入发单库成功"));
|
| | | } catch (UserCloudException e) {
|
| | | if (e.getCode() > 1000 && e.getCode() < 1100) {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("link", configService.get(ConfigKeyEnum.robotCloudLink.getKey()));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrue(e.getCode(), data, e.getMsg()).toString());
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getCode(),e.getMsg()));
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.money.TeamEincomeRecord;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount.SourceTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.SourceTypeEnum;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | |
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.money.IncomeDetailVO;
|
| | | import com.yeshi.fanli.vo.money.MoneyPredictVO;
|
| | |
| | | if (vo != null) {
|
| | | vo.setLink(configService.get(ConfigKeyEnum.autoExtractHelpUrl.getKey()));
|
| | | vo.setExtractDesc("提现金额就是已成功提现到支付宝的资金");
|
| | | vo.setMoneyArrivalDesc("订单已到账后提现时间和金额均不受限制");
|
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | vo.setMoneyArrivalDesc("尽早确认收货可以促使资金尽早到账");
|
| | | } else {
|
| | | vo.setMoneyArrivalDesc("订单已到账后提现时间和金额均不受限制");
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (vo == null) {
|
| | | vo = createMoneyStatistic(uid);
|
| | | vo = createMoneyStatistic(uid, acceptData);
|
| | | }
|
| | |
|
| | | Gson gson = getGson();
|
| | | out.print(JsonUtil.loadTrueResult(gson.toJson(vo)));
|
| | | }
|
| | |
|
| | | public MoneyStatisticVO createMoneyStatistic(Long uid) {
|
| | | private MoneyStatisticVO createMoneyStatistic(Long uid, AcceptData acceptData) {
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | |
|
| | | MoneyStatisticVO vo = new MoneyStatisticVO();
|
| | | vo.setLink(configService.get(ConfigKeyEnum.autoExtractHelpUrl.getKey()));
|
| | | vo.setBalanceMoney(user.getMyHongBao());
|
| | | vo.setExtractDesc("提现金额就是已成功提现到支付宝的资金");
|
| | | vo.setMoneyArrivalDesc("订单已到账后提现时间和金额均不受限制");
|
| | |
|
| | | // 获取提现中的信息
|
| | | BigDecimal extractingMoney = extractService.sumVerifyingMoney(uid);
|
| | |
| | | vo.setTotalInviteMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | | // 本月收货
|
| | | maxDate = new Date(timeStamp);
|
| | | calendar = Calendar.getInstance();
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | vo.setMonthSettleMoney(hongBaoV2CountService.sumMoneyBySettleTimeAndUid(uid, minDate, maxDate));
|
| | | |
| | | if (VersionUtil.greaterThan_2_1_2(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | vo.setMoneyArrivalDesc("尽早确认收货可以促使资金尽早到账");
|
| | | |
| | | minDate = new Date(TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(timeStamp, "yyyy-MM"), "yyyy-MM"));
|
| | | Calendar ca = Calendar.getInstance();
|
| | | ca.setTime(new Date(timeStamp));
|
| | | ca.add(Calendar.MONTH, 1);
|
| | | maxDate = new Date(
|
| | | TimeUtil.convertToTimeTemp(TimeUtil.getGernalTime(ca.getTimeInMillis(), "yyyy-MM"), "yyyy-MM"));
|
| | | // 本月未到账
|
| | | BigDecimal monthUnRecievedMoney = hongBaoV2Service.getUnRecievedMoneyWithPreGetTime(uid, minDate, maxDate);
|
| | | vo.setMonthUnRecievedMoney(monthUnRecievedMoney);
|
| | | |
| | | // 全部未到账
|
| | | minDate = new Date(0);
|
| | | maxDate = new Date(timeStamp);
|
| | | vo.setTotalUnRecievedMoney(hongBaoV2Service.getUnRecievedMoneyWithCreateTime(uid, minDate, maxDate));
|
| | | } else {
|
| | | vo.setMoneyArrivalDesc("订单已到账后提现时间和金额均不受限制");
|
| | | // 本月收货
|
| | | maxDate = new Date(timeStamp);
|
| | | calendar = Calendar.getInstance();
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | vo.setMonthSettleMoney(hongBaoV2CountService.sumMoneyBySettleTimeAndUid(uid, minDate, maxDate));
|
| | |
|
| | | // 上月收货
|
| | | maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | vo.setLastMonthSettleMoney(hongBaoV2CountService.sumMoneyBySettleTimeAndUid(uid, minDate, maxDate));
|
| | |
|
| | | // 上月收货
|
| | | maxDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | calendar.add(Calendar.MONTH, -1);
|
| | | minDate = new Date(TimeUtil
|
| | | .convertToTimeTemp(calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1), "yyyy-M"));
|
| | | vo.setLastMonthSettleMoney(hongBaoV2CountService.sumMoneyBySettleTimeAndUid(uid, minDate, maxDate));
|
| | | }
|
| | | |
| | | // 待确认收货(180天内)
|
| | | vo.setNotSettleMoney(hongBaoV2CountService.sumMoneyByANotSettleAndUid(uid));
|
| | |
|
| | |
| | | * @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(); |
| | |
| | | |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据起始时间查询 |
| | | * @param date |
| | | * @return |
| | | */ |
| | | 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("activity")))); |
| | | |
| | | Query query = new Query(); |
| | | 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)); |
| | | } |
| | | query.with(new Sort(Sort.Direction.ASC,"startTime")); |
| | | |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */
|
| | | void connectUser(@Param("mainUid") Long mainUid, @Param("lessUid") Long lessUid);
|
| | |
|
| | | |
| | | List<UserInfoVO> queryInfo(@Param("start") long start, @Param("count") int count, @Param("userState") Integer userState,
|
| | | @Param("key") String key, @Param("keyType") Integer keyType, @Param("userRank") String userRank,
|
| | | @Param("days") Integer days, @Param("startTime") String startTime, @Param("endTime") String endTime,
|
| | | @Param("userType") Integer userType, @Param("level")String level, @Param("activeCode") Integer activeCode);
|
| | |
|
| | | long countInfo(@Param("userState") Integer userState, @Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("userRank") String userRank, @Param("days") Integer days, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime,@Param("userType") Integer userType, @Param("level")String level,
|
| | | @Param("activeCode") Integer activeCode);
|
| | |
|
| | | |
| | | /**
|
| | | *
|
| | | * @param start
|
| | |
| | | List<IntegralDetail> listQuery(@Param("start")long start, @Param("count")int count, @Param("key")String key);
|
| | |
|
| | | Long countQuery(@Param("key")String key);
|
| | | |
| | | /**
|
| | | * 共计已消耗金币数
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | Long sumUseGoldCoin(@Param("uid")Long uid);
|
| | | } |
| | |
| | | Long countOrderBySourceAndNearDay(@Param("uid") Long uid, @Param("source") int source, @Param("day") int day); |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 统计历史订单数量 -不区分状态、来源 订单号为主 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Long countHistoryOrderNum(@Param("uid") Long uid); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user.cloud; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods; |
| | | |
| | | public interface UserCloudGoodsMapper extends BaseMapper<UserCloudGoods> { |
| | | |
| | | /** |
| | | * 删除 |
| | | * @param id |
| | | * @param uid |
| | | */ |
| | | void deleteByPrimaryKeyAndUid(@Param("id") Long id, @Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 查询列表 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<UserCloudGoods> query(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key); |
| | | |
| | | long count(@Param("key") String key); |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<UserCloudGoods> listByUid(@Param("start") long start, @Param("count") int count, |
| | | @Param("uid") Long uid); |
| | | |
| | | long countByUid(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 根据商品信息查询 |
| | | * @param uid |
| | | * @param goodsId |
| | | * @param goodsType |
| | | * @return |
| | | */ |
| | | UserCloudGoods getByUidAndGoods(@Param("uid")Long uid,@Param("goodsId") Long goodsId, |
| | | @Param("goodsType") Integer goodsType); |
| | | |
| | | /** |
| | | * 根据简版商品id查询 |
| | | * @param uid |
| | | * @param commonId |
| | | * @return |
| | | */ |
| | | UserCloudGoods getByUidAndCommonGoodsId(@Param("uid")Long uid,@Param("commonId") Long commonId); |
| | | |
| | | /** |
| | | * 查询未分享商品 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | |
| | | List<UserCloudGoods> listByNotShare(@Param("uid")Long uid); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user.cloud; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup; |
| | | |
| | | public interface UserCloudGroupMapper extends BaseMapper<UserCloudGroup> { |
| | | |
| | | /** |
| | | * 根据uid清空群 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | void deleteGroupByUid(@Param("uid") Long uid); |
| | | |
| | | |
| | | /** |
| | | * 根据uid查询 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<UserCloudGroup> listByUidAndType(@Param("uid") Long uid, @Param("type") Integer type); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据uid查询 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<UserCloudGroup> listByUid(@Param("uid") Long uid); |
| | | |
| | | |
| | | /** |
| | | * 根据uid查询 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | List<UserCloudGroup> listGroupByUid(@Param("uid") Long uid); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user.cloud; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage; |
| | | |
| | | public interface UserCloudManageMapper extends BaseMapper<UserCloudManage> { |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user.cloud; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloud; |
| | | |
| | | public interface UserCloudMapper extends BaseMapper<UserCloud> { |
| | | |
| | | /** |
| | | * 查询有效信息 |
| | | * @return |
| | | */ |
| | | UserCloud getValidByUid(@Param("uid") Long uid); |
| | | |
| | | /** |
| | | * 查询有效信息 |
| | | * @return |
| | | */ |
| | | UserCloud getLastByUid(@Param("uid") Long uid); |
| | | |
| | | |
| | | /** |
| | | * 统计所有记录 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | Long countByUid(@Param("uid") Long uid); |
| | | |
| | | |
| | | /** |
| | | * 查询有效信息 |
| | | * @return |
| | | */ |
| | | UserCloud getByOrderId(@Param("orderId") Long orderId); |
| | | |
| | | /** |
| | | * 查询有效 |
| | | * @return |
| | | */ |
| | | List<Long> listValidUid(@Param("start") long start, @Param("count") int count); |
| | | |
| | | |
| | | /** |
| | | * 查询订单记录 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<UserCloud> query(@Param("start") long start, @Param("count") int count, @Param("key")String key, @Param("state")Integer state); |
| | | |
| | | Long count(@Param("key")String key, @Param("state")Integer state); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user.cloud; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder; |
| | | |
| | | public interface UserCloudOrderMapper extends BaseMapper<UserCloudOrder> { |
| | | |
| | | /** |
| | | * 查询用于更新余额-锁定 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | UserCloudOrder selectForUpdate(long id); |
| | | |
| | | /** |
| | | * 查询后一条支付完成的 |
| | | * @param uid |
| | | * @param type |
| | | * @return |
| | | */ |
| | | UserCloudOrder getLastOrderByPayEnd(@Param("uid") Long uid, @Param("type")String type); |
| | | |
| | | /** |
| | | * 查询后一条支付完成的 |
| | | * @param uid |
| | | * @param type |
| | | * @return |
| | | */ |
| | | UserCloudOrder getLastOrderByUnpaid(@Param("uid") Long uid, @Param("type")String type); |
| | | |
| | | |
| | | /** |
| | | * 查询订单记录 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<UserCloudOrder> getOrderRecord(@Param("start") long start, @Param("count") int count, @Param("uid")Long uid, @Param("state")Integer state); |
| | | |
| | | /** |
| | | * 查询订单记录 |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | | */ |
| | | Long countOrderRecord(@Param("uid")Long uid, @Param("state")Integer state); |
| | | |
| | | /** |
| | | * 查询近一个小时未支付 |
| | | * @return |
| | | */ |
| | | List<UserCloudOrder> getLasthourByUnpaid(); |
| | | |
| | | |
| | | /** |
| | | * 查询订单记录 |
| | | * @param start |
| | | * @param count |
| | | * @param uid |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<UserCloudOrder> query(@Param("start") long start, @Param("count") int count, @Param("key")String key, @Param("state")Integer state); |
| | | |
| | | Long count(@Param("key")String key, @Param("state")Integer state); |
| | | |
| | | } |
| | |
| | | import com.mongodb.GroupCommand;
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount.SourceTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.SourceTypeEnum;
|
| | | import com.yeshi.fanli.vo.order.OrderRankingVO;
|
| | |
|
| | | @Repository
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user.cloud;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendContent;
|
| | |
|
| | | @Repository
|
| | | public class UserCloudSendContentDao extends MongodbBaseDao<UserCloudSendContent> {
|
| | |
|
| | | |
| | | /**
|
| | | * 查询发布内容
|
| | | * @param uid
|
| | | * @param pid
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudSendContent> getByPid(String pid) {
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | list.add(Criteria.where("pid").is(pid));
|
| | | Query query = new Query();
|
| | | 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 findList(query);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user.cloud;
|
| | |
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | 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;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendRecord;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Repository
|
| | | public class UserCloudSendRecordDao extends MongodbBaseDao<UserCloudSendRecord> {
|
| | |
|
| | | /**
|
| | | * 查询已发送id
|
| | | * @param uid
|
| | | * @param sendId
|
| | | * @param sendOrigin
|
| | | * @return
|
| | | */
|
| | | 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(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);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param sendOrigin
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudSendRecord> query(int start, int count, String key, Integer sendOrigin){
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | if (sendOrigin != null)
|
| | | list.add(Criteria.where("sendOrigin").is(sendOrigin));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(key)) {
|
| | | list.add(new Criteria().orOperator( Criteria.where("uid")
|
| | | .regex(Pattern.compile("^.*" + key + ".*$",
|
| | | Pattern.CASE_INSENSITIVE))));
|
| | | }
|
| | | |
| | | Query query = new Query();
|
| | | 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));
|
| | | }
|
| | | query.with(new Sort(Sort.Direction.DESC,"sendTime"));
|
| | | query.skip(start).limit(count);
|
| | | return findList(query);
|
| | | }
|
| | | |
| | | |
| | | public long count(String key, Integer sendOrigin){
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | if (sendOrigin != null)
|
| | | list.add(Criteria.where("sendOrigin").is(sendOrigin));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(key)) {
|
| | | list.add(new Criteria().orOperator( Criteria.where("uid")
|
| | | .regex(Pattern.compile("^.*" + key + ".*$",
|
| | | Pattern.CASE_INSENSITIVE))));
|
| | | }
|
| | | |
| | | Query query = new Query();
|
| | | 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 count(query);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.aitaoker;
|
| | |
|
| | | import com.google.gson.annotations.SerializedName;
|
| | |
|
| | | public class QrcodeLoginDTO {
|
| | | |
| | | @SerializedName("wId")
|
| | | private String wId; // 实例Id
|
| | | |
| | | @SerializedName("qrCodeUrl")
|
| | | private String qrCodeUrl; // 二维码链接
|
| | | |
| | | @SerializedName("wcId")
|
| | | private String wcId; // 微信ID
|
| | | |
| | | @SerializedName("nickName")
|
| | | private String nickName;
|
| | | |
| | | @SerializedName("headUrl")
|
| | | private String headUrl;
|
| | | |
| | | @SerializedName("data")
|
| | | private String data;
|
| | |
|
| | | public String getwId() {
|
| | | return wId;
|
| | | }
|
| | |
|
| | | public void setwId(String wId) {
|
| | | this.wId = wId;
|
| | | }
|
| | |
|
| | | public String getQrCodeUrl() {
|
| | | return qrCodeUrl;
|
| | | }
|
| | |
|
| | | public void setQrCodeUrl(String qrCodeUrl) {
|
| | | this.qrCodeUrl = qrCodeUrl;
|
| | | }
|
| | |
|
| | | public String getWcId() {
|
| | | return wcId;
|
| | | }
|
| | |
|
| | | public void setWcId(String wcId) {
|
| | | this.wcId = wcId;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getHeadUrl() {
|
| | | return headUrl;
|
| | | }
|
| | |
|
| | | public void setHeadUrl(String headUrl) {
|
| | | this.headUrl = headUrl;
|
| | | }
|
| | |
|
| | | public String getData() {
|
| | | return data;
|
| | | }
|
| | |
|
| | | public void setData(String data) {
|
| | | this.data = data;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.aitaoker;
|
| | |
|
| | | import com.google.gson.annotations.SerializedName;
|
| | |
|
| | | public class RobotInfoDTO {
|
| | | @SerializedName("id")
|
| | | private Integer id;
|
| | | |
| | | @SerializedName("uid")
|
| | | private String uid;
|
| | | |
| | | @SerializedName("wechatrobot")
|
| | | private String wechatrobot;
|
| | | |
| | | @SerializedName("amount")
|
| | | private String amount;
|
| | | |
| | | @SerializedName("amount_used")
|
| | | private String amountUsed;
|
| | | |
| | | @SerializedName("group_num")
|
| | | private Integer groupNum; //最大群数
|
| | | |
| | | @SerializedName("passwd")
|
| | | private String passwd;
|
| | | |
| | | @SerializedName("nickname")
|
| | | private String nickname;
|
| | | |
| | | @SerializedName("c_uid")
|
| | | private String cUid;
|
| | | |
| | | @SerializedName("login_status")
|
| | | private String loginStatus;
|
| | | |
| | | @SerializedName("end_time")
|
| | | private String endTime; //到期时间 1590139325
|
| | | |
| | | @SerializedName("wId")
|
| | | private String remark;
|
| | | |
| | | @SerializedName("wId")
|
| | | private String wcId; //微信实例id
|
| | | |
| | | @SerializedName("agent_uid")
|
| | | private String agentUid; //代理id
|
| | | |
| | | @SerializedName("is_enabled")
|
| | | private String isEnabled; //0 正常 1暂停
|
| | |
|
| | | public String getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(String uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public String getWechatrobot() {
|
| | | return wechatrobot;
|
| | | }
|
| | |
|
| | | public void setWechatrobot(String wechatrobot) {
|
| | | this.wechatrobot = wechatrobot;
|
| | | }
|
| | |
|
| | | public String getAmountUsed() {
|
| | | return amountUsed;
|
| | | }
|
| | |
|
| | | public void setAmountUsed(String amountUsed) {
|
| | | this.amountUsed = amountUsed;
|
| | | }
|
| | |
|
| | | public Integer getGroupNum() {
|
| | | return groupNum;
|
| | | }
|
| | |
|
| | | public void setGroupNum(Integer groupNum) {
|
| | | this.groupNum = groupNum;
|
| | | }
|
| | |
|
| | | public String getPasswd() {
|
| | | return passwd;
|
| | | }
|
| | |
|
| | | public void setPasswd(String passwd) {
|
| | | this.passwd = passwd;
|
| | | }
|
| | |
|
| | | public String getNickname() {
|
| | | return nickname;
|
| | | }
|
| | |
|
| | | public void setNickname(String nickname) {
|
| | | this.nickname = nickname;
|
| | | }
|
| | |
|
| | | public String getcUid() {
|
| | | return cUid;
|
| | | }
|
| | |
|
| | | public void setcUid(String cUid) {
|
| | | this.cUid = cUid;
|
| | | }
|
| | |
|
| | | public String getLoginStatus() {
|
| | | return loginStatus;
|
| | | }
|
| | |
|
| | | public void setLoginStatus(String loginStatus) {
|
| | | this.loginStatus = loginStatus;
|
| | | }
|
| | |
|
| | | public String getEndTime() {
|
| | | return endTime;
|
| | | }
|
| | |
|
| | | public void setEndTime(String endTime) {
|
| | | this.endTime = endTime;
|
| | | }
|
| | |
|
| | | public String getRemark() {
|
| | | return remark;
|
| | | }
|
| | |
|
| | | public void setRemark(String remark) {
|
| | | this.remark = remark;
|
| | | }
|
| | |
|
| | | public String getWcId() {
|
| | | return wcId;
|
| | | }
|
| | |
|
| | | public void setWcId(String wcId) {
|
| | | this.wcId = wcId;
|
| | | }
|
| | |
|
| | | public String getAgentUid() {
|
| | | return agentUid;
|
| | | }
|
| | |
|
| | | public void setAgentUid(String agentUid) {
|
| | | this.agentUid = agentUid;
|
| | | }
|
| | |
|
| | | public String getIsEnabled() {
|
| | | return isEnabled;
|
| | | }
|
| | |
|
| | | public void setIsEnabled(String isEnabled) {
|
| | | this.isEnabled = isEnabled;
|
| | | }
|
| | |
|
| | | public Integer getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Integer id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getAmount() {
|
| | | return amount;
|
| | | }
|
| | |
|
| | | public void setAmount(String amount) {
|
| | | this.amount = amount;
|
| | | }
|
| | |
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.aitaoker;
|
| | |
|
| | | import com.google.gson.annotations.SerializedName;
|
| | |
|
| | | public class WeiXinGroupDTO {
|
| | | // 群id
|
| | | @SerializedName("userName")
|
| | | private String groupId;
|
| | |
|
| | | // 群昵称
|
| | | @SerializedName("nickName")
|
| | | private String groupName;
|
| | |
|
| | | // 群头像
|
| | | @SerializedName("smallHead")
|
| | | private String groupHead;
|
| | |
|
| | | public String getGroupId() {
|
| | | return groupId;
|
| | | }
|
| | |
|
| | | public void setGroupId(String groupId) {
|
| | | this.groupId = groupId;
|
| | | }
|
| | |
|
| | | public String getGroupName() {
|
| | | return groupName;
|
| | | }
|
| | |
|
| | | public void setGroupName(String groupName) {
|
| | | this.groupName = groupName;
|
| | | }
|
| | |
|
| | | public String getGroupHead() {
|
| | | return groupHead;
|
| | | }
|
| | |
|
| | | public void setGroupHead(String groupHead) {
|
| | | this.groupHead = groupHead;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | 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;
|
New file |
| | |
| | | package com.yeshi.fanli.dto.mq.user.body;
|
| | |
|
| | | import com.yeshi.fanli.dto.mq.BaseMQMsgBody;
|
| | |
|
| | | /**
|
| | | * 用户云发单
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | 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;// 类型
|
| | |
|
| | | public UserCloudMQMsg(Long uid, String id, Integer type) {
|
| | | super();
|
| | | this.uid = uid;
|
| | | this.id = id;
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(Integer type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.suning;
|
| | |
|
| | | public class SuningGoodsInfoRecommend {
|
| | |
|
| | | private String isReserveCommodity;
|
| | | private String commodityName;
|
| | | private String commodityCode;
|
| | | private String supplierCode;
|
| | | private String imgVersion;
|
| | | private String isOwnCommodity;
|
| | | private String commodityType;
|
| | | private String baoyou;
|
| | | private String sellingPoint;
|
| | | private String monthlySales;
|
| | | private String originRate;
|
| | | private String originCommission;
|
| | | private String commodityPrice;
|
| | | private String commissionPrice;
|
| | | private String commissionRate;
|
| | | private String snPrice;
|
| | | private String priceType;
|
| | | private String priceTypeCode;
|
| | | private String pgPrice;
|
| | | private String pgActionId;
|
| | | private String pgNum;
|
| | | private String commodityPriceFlag;
|
| | | private String handwork;
|
| | | private String saleStatus;
|
| | | private String noConponCommision;
|
| | | private String rebateCommissionRate;
|
| | | private String couponAmount;
|
| | | private String couponSpecialPrice;
|
| | | private String couponActiveId;
|
| | | private String activitySecretKey;
|
| | | private String couponPrice;
|
| | | private String picList;
|
| | |
|
| | | public String getIsReserveCommodity() {
|
| | | return isReserveCommodity;
|
| | | }
|
| | |
|
| | | public void setIsReserveCommodity(String isReserveCommodity) {
|
| | | this.isReserveCommodity = isReserveCommodity;
|
| | | }
|
| | |
|
| | | public String getCommodityName() {
|
| | | return commodityName;
|
| | | }
|
| | |
|
| | | public void setCommodityName(String commodityName) {
|
| | | this.commodityName = commodityName;
|
| | | }
|
| | |
|
| | | public String getCommodityCode() {
|
| | | return commodityCode;
|
| | | }
|
| | |
|
| | | public void setCommodityCode(String commodityCode) {
|
| | | this.commodityCode = commodityCode;
|
| | | }
|
| | |
|
| | | public String getSupplierCode() {
|
| | | return supplierCode;
|
| | | }
|
| | |
|
| | | public void setSupplierCode(String supplierCode) {
|
| | | this.supplierCode = supplierCode;
|
| | | }
|
| | |
|
| | | public String getImgVersion() {
|
| | | return imgVersion;
|
| | | }
|
| | |
|
| | | public void setImgVersion(String imgVersion) {
|
| | | this.imgVersion = imgVersion;
|
| | | }
|
| | |
|
| | | public String getIsOwnCommodity() {
|
| | | return isOwnCommodity;
|
| | | }
|
| | |
|
| | | public void setIsOwnCommodity(String isOwnCommodity) {
|
| | | this.isOwnCommodity = isOwnCommodity;
|
| | | }
|
| | |
|
| | | public String getCommodityType() {
|
| | | return commodityType;
|
| | | }
|
| | |
|
| | | public void setCommodityType(String commodityType) {
|
| | | this.commodityType = commodityType;
|
| | | }
|
| | |
|
| | | public String getBaoyou() {
|
| | | return baoyou;
|
| | | }
|
| | |
|
| | | public void setBaoyou(String baoyou) {
|
| | | this.baoyou = baoyou;
|
| | | }
|
| | |
|
| | | public String getSellingPoint() {
|
| | | return sellingPoint;
|
| | | }
|
| | |
|
| | | public void setSellingPoint(String sellingPoint) {
|
| | | this.sellingPoint = sellingPoint;
|
| | | }
|
| | |
|
| | | public String getMonthlySales() {
|
| | | return monthlySales;
|
| | | }
|
| | |
|
| | | public void setMonthlySales(String monthlySales) {
|
| | | this.monthlySales = monthlySales;
|
| | | }
|
| | |
|
| | | public String getOriginRate() {
|
| | | return originRate;
|
| | | }
|
| | |
|
| | | public void setOriginRate(String originRate) {
|
| | | this.originRate = originRate;
|
| | | }
|
| | |
|
| | | public String getOriginCommission() {
|
| | | return originCommission;
|
| | | }
|
| | |
|
| | | public void setOriginCommission(String originCommission) {
|
| | | this.originCommission = originCommission;
|
| | | }
|
| | |
|
| | | public String getCommodityPrice() {
|
| | | return commodityPrice;
|
| | | }
|
| | |
|
| | | public void setCommodityPrice(String commodityPrice) {
|
| | | this.commodityPrice = commodityPrice;
|
| | | }
|
| | |
|
| | | public String getCommissionPrice() {
|
| | | return commissionPrice;
|
| | | }
|
| | |
|
| | | public void setCommissionPrice(String commissionPrice) {
|
| | | this.commissionPrice = commissionPrice;
|
| | | }
|
| | |
|
| | | public String getCommissionRate() {
|
| | | return commissionRate;
|
| | | }
|
| | |
|
| | | public void setCommissionRate(String commissionRate) {
|
| | | this.commissionRate = commissionRate;
|
| | | }
|
| | |
|
| | | public String getSnPrice() {
|
| | | return snPrice;
|
| | | }
|
| | |
|
| | | public void setSnPrice(String snPrice) {
|
| | | this.snPrice = snPrice;
|
| | | }
|
| | |
|
| | | public String getPriceType() {
|
| | | return priceType;
|
| | | }
|
| | |
|
| | | public void setPriceType(String priceType) {
|
| | | this.priceType = priceType;
|
| | | }
|
| | |
|
| | | public String getPriceTypeCode() {
|
| | | return priceTypeCode;
|
| | | }
|
| | |
|
| | | public void setPriceTypeCode(String priceTypeCode) {
|
| | | this.priceTypeCode = priceTypeCode;
|
| | | }
|
| | |
|
| | | public String getPgPrice() {
|
| | | return pgPrice;
|
| | | }
|
| | |
|
| | | public void setPgPrice(String pgPrice) {
|
| | | this.pgPrice = pgPrice;
|
| | | }
|
| | |
|
| | | public String getPgActionId() {
|
| | | return pgActionId;
|
| | | }
|
| | |
|
| | | public void setPgActionId(String pgActionId) {
|
| | | this.pgActionId = pgActionId;
|
| | | }
|
| | |
|
| | | public String getPgNum() {
|
| | | return pgNum;
|
| | | }
|
| | |
|
| | | public void setPgNum(String pgNum) {
|
| | | this.pgNum = pgNum;
|
| | | }
|
| | |
|
| | | public String getCommodityPriceFlag() {
|
| | | return commodityPriceFlag;
|
| | | }
|
| | |
|
| | | public void setCommodityPriceFlag(String commodityPriceFlag) {
|
| | | this.commodityPriceFlag = commodityPriceFlag;
|
| | | }
|
| | |
|
| | | public String getHandwork() {
|
| | | return handwork;
|
| | | }
|
| | |
|
| | | public void setHandwork(String handwork) {
|
| | | this.handwork = handwork;
|
| | | }
|
| | |
|
| | | public String getSaleStatus() {
|
| | | return saleStatus;
|
| | | }
|
| | |
|
| | | public void setSaleStatus(String saleStatus) {
|
| | | this.saleStatus = saleStatus;
|
| | | }
|
| | |
|
| | | public String getNoConponCommision() {
|
| | | return noConponCommision;
|
| | | }
|
| | |
|
| | | public void setNoConponCommision(String noConponCommision) {
|
| | | this.noConponCommision = noConponCommision;
|
| | | }
|
| | |
|
| | | public String getRebateCommissionRate() {
|
| | | return rebateCommissionRate;
|
| | | }
|
| | |
|
| | | public void setRebateCommissionRate(String rebateCommissionRate) {
|
| | | this.rebateCommissionRate = rebateCommissionRate;
|
| | | }
|
| | |
|
| | | public String getCouponAmount() {
|
| | | return couponAmount;
|
| | | }
|
| | |
|
| | | public void setCouponAmount(String couponAmount) {
|
| | | this.couponAmount = couponAmount;
|
| | | }
|
| | |
|
| | | public String getCouponSpecialPrice() {
|
| | | return couponSpecialPrice;
|
| | | }
|
| | |
|
| | | public void setCouponSpecialPrice(String couponSpecialPrice) {
|
| | | this.couponSpecialPrice = couponSpecialPrice;
|
| | | }
|
| | |
|
| | | public String getCouponActiveId() {
|
| | | return couponActiveId;
|
| | | }
|
| | |
|
| | | public void setCouponActiveId(String couponActiveId) {
|
| | | this.couponActiveId = couponActiveId;
|
| | | }
|
| | |
|
| | | public String getActivitySecretKey() {
|
| | | return activitySecretKey;
|
| | | }
|
| | |
|
| | | public void setActivitySecretKey(String activitySecretKey) {
|
| | | this.activitySecretKey = activitySecretKey;
|
| | | }
|
| | |
|
| | | public String getCouponPrice() {
|
| | | return couponPrice;
|
| | | }
|
| | |
|
| | | public void setCouponPrice(String couponPrice) {
|
| | | this.couponPrice = couponPrice;
|
| | | }
|
| | |
|
| | | public String getPicList() {
|
| | | return picList;
|
| | | }
|
| | |
|
| | | public void setPicList(String picList) {
|
| | | this.picList = picList;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.cloud;
|
| | |
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public enum CloudOrderMenuEnum {
|
| | | robotMonth(20.00, 1, 1, "机器人月套餐");
|
| | |
|
| | | private double money;
|
| | | private Integer type;
|
| | | private Integer month;
|
| | | private String desc;
|
| | |
|
| | | private CloudOrderMenuEnum(double money, Integer type, Integer month, String desc) {
|
| | | this.money = money;
|
| | | this.type = type;
|
| | | this.month = month;
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | public double getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public Integer getMonth() {
|
| | | return month;
|
| | | }
|
| | | |
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | | |
| | |
|
| | | public static CloudOrderMenuEnum getMenuEnum(String type) {
|
| | | if (StringUtil.isNullOrEmpty(type)) |
| | | return null;
|
| | | CloudOrderMenuEnum[] array = CloudOrderMenuEnum.values();
|
| | | for (CloudOrderMenuEnum menuEnum: array) {
|
| | | if(menuEnum.name().equals(type))
|
| | | return menuEnum;
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 用户云发单
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_user_cloud")
|
| | | public class UserCloud {
|
| | |
|
| | | @Column(name = "uc_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "uc_uid")
|
| | | private Long uid;
|
| | |
|
| | | @Column(name = "uc_order_id")
|
| | | private Long orderId;
|
| | |
|
| | | @Column(name = "uc_group_num")
|
| | | private Integer groupNum; // 群数量
|
| | | |
| | | @Column(name = "uc_start_time")
|
| | | private Date startTime; // 开始时间
|
| | |
|
| | | @Column(name = "uc_end_time")
|
| | | private Date endTime; // 结束时间
|
| | |
|
| | | @Column(name = "uc_wx_id")
|
| | | private String wxId; // 微信号
|
| | |
|
| | | @Column(name = "uc_wx_name")
|
| | | private String wxName; // 微信昵称
|
| | |
|
| | | @Column(name = "uc_wx_portrait")
|
| | | private String wxPortrait;// 微信头像
|
| | |
|
| | | @Column(name = "uc_robot_id")
|
| | | private Integer robotId; // 机器人id
|
| | |
|
| | | @Column(name = "uc_robot_type")
|
| | | private Integer robotType; // 机器人类型
|
| | |
|
| | | @Column(name = "uc_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "uc_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | private String nickName;// 昵称
|
| | | private String portrait;// 头像
|
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Long getOrderId() {
|
| | | return orderId;
|
| | | }
|
| | |
|
| | | public void setOrderId(Long orderId) {
|
| | | this.orderId = orderId;
|
| | | }
|
| | |
|
| | | public Date getStartTime() {
|
| | | return startTime;
|
| | | }
|
| | |
|
| | | public void setStartTime(Date startTime) {
|
| | | this.startTime = startTime;
|
| | | }
|
| | |
|
| | | public Date getEndTime() {
|
| | | return endTime;
|
| | | }
|
| | |
|
| | | public void setEndTime(Date endTime) {
|
| | | this.endTime = endTime;
|
| | | }
|
| | |
|
| | | public String getWxId() {
|
| | | return wxId;
|
| | | }
|
| | |
|
| | | public void setWxId(String wxId) {
|
| | | this.wxId = wxId;
|
| | | }
|
| | |
|
| | | public String getWxName() {
|
| | | return wxName;
|
| | | }
|
| | |
|
| | | public void setWxName(String wxName) {
|
| | | this.wxName = wxName;
|
| | | }
|
| | |
|
| | | public String getWxPortrait() {
|
| | | return wxPortrait;
|
| | | }
|
| | |
|
| | | public void setWxPortrait(String wxPortrait) {
|
| | | this.wxPortrait = wxPortrait;
|
| | | }
|
| | |
|
| | | public Integer getRobotId() {
|
| | | return robotId;
|
| | | }
|
| | |
|
| | | public void setRobotId(Integer robotId) {
|
| | | this.robotId = robotId;
|
| | | }
|
| | |
|
| | | public Integer getRobotType() {
|
| | | return robotType;
|
| | | }
|
| | |
|
| | | public void setRobotType(Integer robotType) {
|
| | | this.robotType = robotType;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | public Integer getGroupNum() {
|
| | | return groupNum;
|
| | | }
|
| | |
|
| | | public void setGroupNum(Integer groupNum) {
|
| | | this.groupNum = groupNum;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getPortrait() {
|
| | | return portrait;
|
| | | }
|
| | |
|
| | | public void setPortrait(String portrait) {
|
| | | this.portrait = portrait;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | |
|
| | | /**
|
| | | * 发单商品库
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_user_cloud_goods")
|
| | | public class UserCloudGoods {
|
| | |
|
| | | public static int STATE_NORMAL = 0;// 初始
|
| | | public static int STATE_SHARED = 1;// 1已分享
|
| | | |
| | | @Expose
|
| | | @Column(name = "ug_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "ug_uid")
|
| | | private Long uid; // 用户id
|
| | |
|
| | | @Expose
|
| | | @Column(name = "ug_common_id")
|
| | | private CommonGoods commonGoods;
|
| | |
|
| | | @Expose
|
| | | @Column(name = "ug_state")
|
| | | private Integer state; // 状态
|
| | | |
| | | @Column(name = "ug_send_time")
|
| | | private Date sendTime; // 发送时间
|
| | |
|
| | | @Column(name = "ug_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "ug_update_time")
|
| | | private Date updateTime;
|
| | | |
| | | private String nickName;// 昵称
|
| | | private String portrait;// 头像
|
| | | |
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public CommonGoods getCommonGoods() {
|
| | | return commonGoods;
|
| | | }
|
| | |
|
| | | public void setCommonGoods(CommonGoods commonGoods) {
|
| | | this.commonGoods = commonGoods;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | public Date getSendTime() {
|
| | | return sendTime;
|
| | | }
|
| | |
|
| | | public void setSendTime(Date sendTime) {
|
| | | this.sendTime = sendTime;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getPortrait() {
|
| | | return portrait;
|
| | | }
|
| | |
|
| | | public void setPortrait(String portrait) {
|
| | | this.portrait = portrait;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 用户云发单-群
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_user_cloud_group")
|
| | | public class UserCloudGroup {
|
| | |
|
| | | public final static int TYPE_CIRCLE = 1; // 朋友圈
|
| | | public final static int TYPE_GROUP = 2; // 微信群
|
| | |
|
| | | @Column(name = "ucg_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "ucg_uid")
|
| | | private Long uid;
|
| | |
|
| | | @Column(name = "ucg_type")
|
| | | private Integer type;
|
| | |
|
| | | @Column(name = "ucg_state")
|
| | | private Boolean state; // 状态
|
| | |
|
| | | @Column(name = "ucg_group_id")
|
| | | private String groupId; // 群id
|
| | |
|
| | | @Column(name = "ucg_group_name")
|
| | | private String groupName; // 群名称
|
| | |
|
| | | @Column(name = "ucg_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "ucg_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(Integer type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Boolean getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Boolean state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public String getGroupName() {
|
| | | return groupName;
|
| | | }
|
| | |
|
| | | public void setGroupName(String groupName) {
|
| | | this.groupName = groupName;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | public String getGroupId() {
|
| | | return groupId;
|
| | | }
|
| | |
|
| | | public void setGroupId(String groupId) {
|
| | | this.groupId = groupId;
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 发单商品库
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_user_cloud_manage")
|
| | | public class UserCloudManage {
|
| | |
|
| | | @Column(name = "ucm_uid")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "ucm_official")
|
| | | private Boolean official;
|
| | |
|
| | | @Column(name = "ucm_custom")
|
| | | private Boolean custom; // 状态
|
| | |
|
| | | @Column(name = "ucm_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "ucm_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Boolean getOfficial() {
|
| | | return official;
|
| | | }
|
| | |
|
| | | public void setOfficial(Boolean official) {
|
| | | this.official = official;
|
| | | }
|
| | |
|
| | | public Boolean getCustom() {
|
| | | return custom;
|
| | | }
|
| | |
|
| | | public void setCustom(Boolean custom) {
|
| | | this.custom = custom;
|
| | | }
|
| | |
|
| | | 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 |
| | |
| | | package com.yeshi.fanli.entity.bus.user.cloud;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | |
|
| | | /**
|
| | | * 用户云发单
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_user_cloud_order")
|
| | | public class UserCloudOrder {
|
| | |
|
| | | @Column(name = "crd_id")
|
| | | private Long id;
|
| | |
|
| | | @Column(name = "crd_uid")
|
| | | private Long uid;
|
| | |
|
| | | @Expose
|
| | | @Column(name = "crd_money")
|
| | | private BigDecimal money;
|
| | |
|
| | | @Column(name = "crd_type")
|
| | | private CloudOrderMenuEnum type; // 订单类型
|
| | |
|
| | | @Column(name = "crd_state")
|
| | | private Boolean state; // 支付状态
|
| | |
|
| | | @Expose
|
| | | @Column(name = "crd_desc") // 描述
|
| | | private String desc;
|
| | |
|
| | | @Expose
|
| | | @Column(name = "crd_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | @Column(name = "crd_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | private String nickName;// 昵称
|
| | | private String portrait;// 头像
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | public CloudOrderMenuEnum getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(CloudOrderMenuEnum type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Boolean getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Boolean state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | |
|
| | | public void setDesc(String desc) {
|
| | | this.desc = desc;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getPortrait() {
|
| | | return portrait;
|
| | | }
|
| | |
|
| | | public void setPortrait(String portrait) {
|
| | | this.portrait = portrait;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | @Document(collection = "userCloudSendContent")
|
| | | public class UserCloudSendContent {
|
| | |
|
| | | public final static String TYPE_CIRCLE = "circle"; // 朋友圈
|
| | | public final static String TYPE_GROUP = "group"; // 微信群
|
| | |
|
| | | @Id
|
| | | private String id;
|
| | | @Field
|
| | | private String pid;
|
| | | @Field
|
| | | private Long uid;
|
| | | @Field
|
| | | private String type;
|
| | | @Field
|
| | | private String groupId; // 群id
|
| | | @Field
|
| | | private String title;
|
| | | @Field
|
| | | private String videoUrl;
|
| | | @Field
|
| | | private String picUrl;
|
| | | @Field
|
| | | private List<String> comments;
|
| | | @Field
|
| | | private boolean state; // 是否发送成功
|
| | | @Field
|
| | | private Date createTime; // 发送时间
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getPid() {
|
| | | return pid;
|
| | | }
|
| | |
|
| | | public void setPid(String pid) {
|
| | | this.pid = pid;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public String getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(String type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public String getGroupId() {
|
| | | return groupId;
|
| | | }
|
| | |
|
| | | public void setGroupId(String groupId) {
|
| | | this.groupId = groupId;
|
| | | }
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getVideoUrl() {
|
| | | return videoUrl;
|
| | | }
|
| | |
|
| | | public void setVideoUrl(String videoUrl) {
|
| | | this.videoUrl = videoUrl;
|
| | | }
|
| | |
|
| | | public String getPicUrl() {
|
| | | return picUrl;
|
| | | }
|
| | |
|
| | | public void setPicUrl(String picUrl) {
|
| | | this.picUrl = picUrl;
|
| | | }
|
| | |
|
| | | public List<String> getComments() {
|
| | | return comments;
|
| | | }
|
| | |
|
| | | public void setComments(List<String> comments) {
|
| | | this.comments = comments;
|
| | | }
|
| | |
|
| | | public boolean isState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(boolean state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.index.Indexed;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 用户粉丝统计记录-每日
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "userCloudSendRecord")
|
| | | public class UserCloudSendRecord {
|
| | |
|
| | | public final static int SEND_WAY_AUTO = 1; // 官方自动
|
| | | public final static int SEND_WAY_MANUAL = 2; // 手动
|
| | |
|
| | | public final static String ORIGIN_STORE = "store"; // 商品库
|
| | | public final static String ORIGIN_EVALUATE = "evaluate"; // 发圈内容
|
| | |
|
| | | @Id
|
| | | private String id;
|
| | | @Field
|
| | | @Indexed
|
| | | private Long uid;
|
| | | @Field
|
| | | private Integer robotId;
|
| | | @Field
|
| | | private String wxId; // 微信id
|
| | | @Field
|
| | | @Indexed
|
| | | private String sendId; // 发送id
|
| | | @Field
|
| | | private String sendOrigin; // 内容来源
|
| | | @Field
|
| | | private String goodsId; // 商品id
|
| | | @Field
|
| | | private String goodsType; // 商品类型
|
| | | @Field
|
| | | private Integer sendWay; // 发送方式
|
| | | @Field
|
| | | private Date sendTime; // 发送时间
|
| | |
|
| | | |
| | | private String nickName;// 昵称
|
| | | private String portrait;// 头像
|
| | | |
| | | |
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public String getSendId() {
|
| | | return sendId;
|
| | | }
|
| | |
|
| | | public void setSendId(String sendId) {
|
| | | this.sendId = sendId;
|
| | | }
|
| | |
|
| | | public String getSendOrigin() {
|
| | | return sendOrigin;
|
| | | }
|
| | |
|
| | | public void setSendOrigin(String sendOrigin) {
|
| | | this.sendOrigin = sendOrigin;
|
| | | }
|
| | |
|
| | | public Integer getSendWay() {
|
| | | return sendWay;
|
| | | }
|
| | |
|
| | | public void setSendWay(Integer sendWay) {
|
| | | this.sendWay = sendWay;
|
| | | }
|
| | |
|
| | | public Date getSendTime() {
|
| | | return sendTime;
|
| | | }
|
| | |
|
| | | public void setSendTime(Date sendTime) {
|
| | | this.sendTime = sendTime;
|
| | | }
|
| | |
|
| | | public String getGoodsId() {
|
| | | return goodsId;
|
| | | }
|
| | |
|
| | | public void setGoodsId(String goodsId) {
|
| | | this.goodsId = goodsId;
|
| | | }
|
| | |
|
| | | public String getGoodsType() {
|
| | | return goodsType;
|
| | | }
|
| | |
|
| | | public void setGoodsType(String goodsType) {
|
| | | this.goodsType = goodsType;
|
| | | }
|
| | |
|
| | | public Integer getRobotId() {
|
| | | return robotId;
|
| | | }
|
| | |
|
| | | public void setRobotId(Integer robotId) {
|
| | | this.robotId = robotId;
|
| | | }
|
| | |
|
| | | public String getWxId() {
|
| | | return wxId;
|
| | | }
|
| | |
|
| | | public void setWxId(String wxId) {
|
| | | this.wxId = wxId;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getPortrait() {
|
| | | return portrait;
|
| | | }
|
| | |
|
| | | public void setPortrait(String portrait) {
|
| | | this.portrait = portrait;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | private String jumpLink; |
| | | |
| | | |
| | | // 是否云发单 |
| | | @Expose |
| | | 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; |
| | | } |
| | | |
| | | } |
| | |
| | | private String sharePDDTextTemplateCoupon;// 拼多多有券分享模板
|
| | | @Column(name = "st_share_vip_text_template")
|
| | | private String shareVIPTextTemplate;// 唯品会无券分享模板
|
| | | |
| | | |
| | | |
| | | |
| | | @Column(name = "st_share_vip_text_template_coupon")
|
| | | private String shareVIPTextTemplateCoupon;// 唯品会有券分享模板
|
| | | @Column(name = "st_share_suning_text_template")
|
| | | private String shareSuNingTextTemplate;// 苏宁无券分享模板
|
| | | @Column(name = "st_share_suning_text_template_coupon")
|
| | | private String shareSuNingTextTemplateCoupon;// 苏宁有券分享模板
|
| | |
|
| | | public String getShareVIPTextTemplate() {
|
| | | return shareVIPTextTemplate;
|
| | | }
|
| | |
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public String getShareVIPTextTemplateCoupon() {
|
| | | return shareVIPTextTemplateCoupon;
|
| | | }
|
| | |
|
| | | public void setShareVIPTextTemplateCoupon(String shareVIPTextTemplateCoupon) {
|
| | | this.shareVIPTextTemplateCoupon = shareVIPTextTemplateCoupon;
|
| | | }
|
| | |
|
| | | public String getShareSuNingTextTemplate() {
|
| | | return shareSuNingTextTemplate;
|
| | | }
|
| | |
|
| | | public void setShareSuNingTextTemplate(String shareSuNingTextTemplate) {
|
| | | this.shareSuNingTextTemplate = shareSuNingTextTemplate;
|
| | | }
|
| | |
|
| | | public String getShareSuNingTextTemplateCoupon() {
|
| | | return shareSuNingTextTemplateCoupon;
|
| | | }
|
| | |
|
| | | public void setShareSuNingTextTemplateCoupon(String shareSuNingTextTemplateCoupon) {
|
| | | this.shareSuNingTextTemplateCoupon = shareSuNingTextTemplateCoupon;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Document(collection = "order_money_daily_count")
|
| | | public class OrderMoneyDailyCount {
|
| | |
|
| | | public enum SourceTypeEnum {
|
| | | taobao("淘宝", "http://img.flqapp.com/resource/icon/source_type_tb.png"),
|
| | | tmall("天猫", "http://img.flqapp.com/resource/icon/source_type_tm.png"),
|
| | | tmallGlobal("天猫国际", "http://img.flqapp.com/resource/icon/source_type_tm_inter.png"),
|
| | | juHuaSuan("聚划算", "http://img.flqapp.com/resource/icon/source_type_juhuasuan.png"),
|
| | | huangLv("航旅", "http://img.flqapp.com/resource/icon/source_type_hanglv.png"),
|
| | | kouBei("口碑", "http://img.flqapp.com/resource/icon/source_type_koubei.png"),
|
| | | elme("饿了么", "http://img.flqapp.com/resource/icon/source_type_elme.png"),
|
| | | jingDong("京东", "http://img.flqapp.com/resource/icon/source_type_jd.png"),
|
| | | pinDuoDuo("拼多多", "http://img.flqapp.com/resource/icon/source_type_pdd.png");
|
| | |
|
| | | private final String desc;
|
| | | private final String icon;
|
| | |
|
| | | private SourceTypeEnum(String desc, String icon) {
|
| | | this.desc = desc;
|
| | | this.icon = icon;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | |
|
| | | public String getIcon() {
|
| | | return icon;
|
| | | }
|
| | | }
|
| | |
|
| | | @Id
|
| | | @Field
|
| | | private String id;
|
New file |
| | |
| | | package com.yeshi.fanli.entity.order;
|
| | |
|
| | | public enum SourceTypeEnum {
|
| | | taobao("淘宝","淘宝","#FF5000","#FF5000", "http://img.flqapp.com/resource/icon/source_type_tb.png"),
|
| | | tmall("天猫","天猫", "#FE0036", "#FE0036", "http://img.flqapp.com/resource/icon/source_type_tm.png"),
|
| | | tmallGlobal("天猫国际", "天猫国际", "#7C48DB", "#7C48DB", "http://img.flqapp.com/resource/icon/source_type_tm_inter.png"),
|
| | | juHuaSuan("聚划算", "聚划算","#FE0036","#FE0036","http://img.flqapp.com/resource/icon/source_type_juhuasuan.png"),
|
| | | huangLv("航旅","飞猪","#3B3B39","#FDBA07", "http://img.flqapp.com/resource/icon/source_type_hanglv.png"),
|
| | | kouBei("口碑", "口碑", "#EA5421","#EA5421", "http://img.flqapp.com/resource/icon/source_type_koubei.png"),
|
| | | elme("饿了么","饿了么","#018DFF","#018DFF", "http://img.flqapp.com/resource/icon/source_type_elme.png"),
|
| | | jingDong("京东","京东","#E42219","#E42219", "http://img.flqapp.com/resource/icon/source_type_jd.png"),
|
| | | pinDuoDuo("拼多多", "拼多多","#F51E25","#F51E25","http://img.flqapp.com/resource/icon/source_type_pdd.png"),
|
| | | vip("唯品会","唯品会","#E30085", "#E30085", "http://img.flqapp.com/resource/icon/source_type_vip.png"),
|
| | | suNing("苏宁易购","苏宁易购","#010101","#FFA600", "http://img.flqapp.com/resource/icon/source_type_suning.png");
|
| | |
|
| | | private final String desc; // 数据存在名称
|
| | | private final String descShow; // 显示名称
|
| | | private final String fontColor; // 字体颜色
|
| | | private final String borderColor; //边框颜色
|
| | | private final String icon; // 图标
|
| | |
|
| | | private SourceTypeEnum(String desc, String descShow,String fontColor, String borderColor,String icon) {
|
| | | this.desc = desc;
|
| | | this.descShow = descShow;
|
| | | this.fontColor = fontColor;
|
| | | this.borderColor = borderColor;
|
| | | this.icon = icon;
|
| | | }
|
| | |
|
| | | public String getDesc() {
|
| | | return desc;
|
| | | }
|
| | |
|
| | | public String getIcon() {
|
| | | return icon;
|
| | | }
|
| | |
|
| | | public String getDescShow() {
|
| | | return descShow;
|
| | | }
|
| | |
|
| | | public String getFontColor() {
|
| | | return fontColor;
|
| | | }
|
| | |
|
| | | public String getBorderColor() {
|
| | | return borderColor;
|
| | | }
|
| | | |
| | | public static SourceTypeEnum getByDesc(String desc) {
|
| | | if (desc == null || desc.trim().length() == 0) |
| | | return null;
|
| | | for (SourceTypeEnum typeEnum: SourceTypeEnum.values()) {
|
| | | if (typeEnum.getDesc().equalsIgnoreCase(desc))
|
| | | return typeEnum;
|
| | | }
|
| | | |
| | | return null;
|
| | | }
|
| | | } |
| | |
| | | // 内容不同、版本但一样 |
| | | shareGoodsTemplateRulesJD("share_goods_template_rules_jd", "京东模板规则"), |
| | | shareGoodsTemplateRulesPDD("share_goods_template_rules_pdd", "拼多多模板规则"), |
| | | shareGoodsTemplateRulesVIP("share_goods_template_rules_vip", "唯品会模板规则"), |
| | | shareGoodsTemplateRulesSuNing("share_goods_template_rules_suning", "苏宁模板规则"), |
| | | goodsShareNotifyImgs("goods_share_notify_imgs", "单个商品分享的券提示图片"), |
| | | goodsShareMultipleNotify("goods_share_multiple_notify", "多个商品分享提醒"), |
| | | goodsShareNotifyImgs207("goods_share_notify_imgs_207", "单个商品分享的券提示图片(2.0.7及以后)"), |
| | | goodsShareNotifyImgsVIP("goods_share_notify_imgs_vip", "单个商品分享的券提示图片(唯品会)"), |
| | | goodsShareNotify("goods_share_notify", "单个商品分享提醒"), |
| | | goodsShareNotifyJD("goods_share_notify_jd", "京东分享提醒"), |
| | | goodsShareNotifyPDD("goods_share_notify_pdd", "拼多多分享提醒"), |
| | |
| | | quickShareTBCommentText("quick_share_tb_comment_text", "快捷分享商品文本"), |
| | | quickShareJDCommentText("quick_share_jd_comment_text", "快捷分享商品文本"), |
| | | quickSharePDDCommentText("quick_share_pdd_comment_text", "快捷分享商品文本"), |
| | | quickShareVIPCommentText("quick_share_vip_comment_text", "快捷分享商品文本"), |
| | | quickShareSuNingCommentText("quick_share_suning_comment_text", "快捷分享商品文本"), |
| | | |
| | | |
| | | shareCommentTextTB("share_comment_text_tb", "淘宝单图多图分享商品文本"), |
| | | shareCommentTextJD("share_comment_text_jd", "京东单图多图分享商品文本"), |
| | | shareCommentTextPDD("share_comment_text_pdd", "拼多多单图多图分享商品文本"), |
| | | shareCommentTextVIP("share_comment_text_vip", "唯品会单图多图分享商品文本"), |
| | | shareCommentTextSuNing("share_comment_text_suning", "苏宁单图多图分享商品文本"), |
| | | |
| | | |
| | | evaluateEmojis("evaluate_emojis", "发圈评论Emojis"), |
| | | evaluateText("evaluate_text", "发圈评论文本"), |
| | |
| | | // 平台规则 |
| | | platformRule("platform_rule_link", "平台规则"), |
| | | |
| | | showSplashAd("show_splash_ad","是否显示开屏广告"); |
| | | showSplashAd("show_splash_ad","是否显示开屏广告"), |
| | | |
| | | robotCloudOpen("robot_cloud_open","云发单链接"), |
| | | robotCloudLink("robot_cloud_link","云发单链接"); |
| | | |
| | | private final String key; |
| | | private final String desc; |
New file |
| | |
| | | package com.yeshi.fanli.exception.user.cloud;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class UserCloudException extends BaseException {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public UserCloudException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public UserCloudException() {
|
| | | super();
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.user.cloud;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class UserCloudGoodsException extends BaseException {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public UserCloudGoodsException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public UserCloudGoodsException() {
|
| | | super();
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.user.cloud;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class UserCloudGroupException extends BaseException {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public UserCloudGroupException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public UserCloudGroupException() {
|
| | | super();
|
| | | }
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.exception.user.cloud;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class UserCloudOrderException extends BaseException {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public UserCloudOrderException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public UserCloudOrderException() {
|
| | | super();
|
| | | }
|
| | | }
|
| | |
| | | // 自动选品
|
| | | @Scheduled(cron = "0 0 23 * * ? ")
|
| | | public void setShareHotGoods() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | |
| | | String day = TimeUtil.getGernalTime(System.currentTimeMillis() + 1000 * 60 * 60 * 24L, "yyyy-MM-dd");
|
| | | List<TaoBaoGoodsBrief> goodsList = shareHotGoodsService.listPreGoods(1);
|
| | | Collections.shuffle(goodsList);
|
| | |
| | |
|
| | | @Scheduled(cron = "0 30 7,11,18,23 * * ? ")
|
| | | public void syncGoodsBeiYong() {
|
| | | if (!Constant.IS_TASK)
|
| | | return;
|
| | | |
| | | long latestUpdateCount = daTaoKeGoodsDetailV2Service
|
| | | .countByMinUpdateTime(new Date(System.currentTimeMillis() - 1000 * 60 * 60 * 24L));
|
| | | if (latestUpdateCount < 50000L) {// 若每天没有超过5w数据更新就需要重新更新数据
|
New file |
| | |
| | | package com.yeshi.fanli.job;
|
| | |
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | 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() {
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | |
|
| | | List<UserCloudOrder> list = userCloudOrderService.getLasthourByUnpaid();
|
| | | if (list == null || list.size() == 0)
|
| | | return;
|
| | |
|
| | | for (UserCloudOrder cloudOrder : list) {
|
| | | try {
|
| | | userCloudAlipayManager.tradeQueryByOrderId(cloudOrder.getId());
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 定时检测是否存在新的发圈
|
| | | */
|
| | | @Scheduled(cron = "0 0/20 * * * ? ")
|
| | | public void dailyCount() {
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | |
|
| | | // 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;
|
| | |
|
| | | userCloudService.fixedTimeSend(list.get(0).getId());
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private static Logger teamLogger = Logger.getLogger("teamLog");
|
| | |
|
| | |
|
| | | private static Logger cloudLogger = Logger.getLogger("cloudLog");
|
| | | |
| | | |
| | | public static void userProtocolListen(Object obj) {
|
| | | userProtocolListenLog.info(obj);
|
| | | }
|
| | |
| | | vipInfoLogger.info(obj);
|
| | | }
|
| | |
|
| | |
|
| | | public static void cloudInfo(Object info) {
|
| | | if (info != null)
|
| | | cloudLogger.info(info);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 登录信息
|
| | | *
|
| | |
| | | String content = String.format("链接:%s 参数:%s 响应时间:%s", url, paramsStr, time + "");
|
| | | requestTimeLogger.info(content);
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | | <result column="alipayAccountInvalid" property="alipayAccountInvalid"
|
| | | jdbcType="VARCHAR" />
|
| | |
|
| | | <result column="tuls_level" property="userLevel" jdbcType="VARCHAR" />
|
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" />
|
| | | <result column="userLevel" property="userLevel" jdbcType="VARCHAR" />
|
| | | <result column="inviteCode" property="inviteCode" jdbcType="VARCHAR" />
|
| | | <result column="uie_invite_code" property="inviteCode" jdbcType="VARCHAR" />
|
| | | <result column="uie_invite_code_vip" property="inviteCodeVip" jdbcType="VARCHAR" />
|
| | | <result column="uie_weixin" property="wxId" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | |
| | | call procedure_connect_user(#{mainUid},#{lessUid})
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="queryInfo" resultMap="BaseResultMapVO">
|
| | | SELECT * FROM yeshi_ec_user u
|
| | | LEFT JOIN yeshi_ec_user_info_extra ext ON u.`id` = ext.uie_uid
|
| | | LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
|
| | | <if test="keyType == 4">
|
| | | LEFT JOIN yeshi_ec_binding_account b ON u.`id` = b.`uid`
|
| | | </if>
|
| | | WHERE 1=1
|
| | | <if test="userState != null">
|
| | | AND u.`state` = #{userState}
|
| | | </if>
|
| | | <if test="userType!=null">
|
| | | AND u.type=#{userType}
|
| | | </if>
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
|
| | | DATE_FORMAT(#{startTime},'%Y%m%d')
|
| | | </if>
|
| | | <if test="endTime != null and endTime !=''">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[<=]]>
|
| | | DATE_FORMAT(#{endTime},'%Y%m%d')
|
| | | </if>
|
| | | <if test="userRank != null">
|
| | | AND rak.ur_name = #{userRank}
|
| | | </if>
|
| | | <if test = "level != null and level != ''">
|
| | | AND lc.tuls_level = #{level}
|
| | | </if>
|
| | | <if test="activeCode == 0">
|
| | | AND (ext.`uie_invite_code` is null OR ext.`uie_invite_code`='')
|
| | | </if>
|
| | | <if test="activeCode == 1">
|
| | | AND (ext.`uie_invite_code` is not null OR ext.`uie_invite_code`<![CDATA[<>]]>'')
|
| | | </if>
|
| | | <if test="key != null and key !='' ">
|
| | | <if test="keyType == 1">
|
| | | AND u.id = #{key}
|
| | | </if>
|
| | | <if test="keyType == 2">
|
| | | AND u.`nick_name` LIKE '%${key}%'
|
| | | </if>
|
| | | <if test="keyType == 3">
|
| | | AND u.`phone` = #{key}
|
| | | </if>
|
| | | <if test="keyType == 4">
|
| | | AND b.`account` = #{key}
|
| | | </if>
|
| | | <if test="keyType == 5">
|
| | | AND (ext.`uie_invite_code` = #{key} OR ext.`uie_invite_code_vip`= #{key})
|
| | | </if>
|
| | | </if>
|
| | | ORDER BY u.id DESC
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="countInfo" resultType="java.lang.Long">
|
| | | SELECT IFNULL(count(u.id),0) FROM yeshi_ec_user u
|
| | | LEFT JOIN yeshi_ec_user_info_extra ext ON u.`id` = ext.uie_uid
|
| | | LEFT JOIN yeshi_ec_user_rank rak ON rak.ur_id = ext.uie_rank_id
|
| | | LEFT JOIN yeshi_ec_team_user_level_statistic lc ON lc.`tuls_uid` = u.id
|
| | | <if test="keyType == 4">
|
| | | LEFT JOIN yeshi_ec_binding_account b ON u.`id` = b.`uid`
|
| | | </if>
|
| | | where 1=1
|
| | | <if test="userState != null">
|
| | | AND u.`state` = #{userState}
|
| | | </if>
|
| | | <if test="userType!=null">
|
| | | AND u.type=#{userType}
|
| | | </if>
|
| | | <if test="startTime != null and startTime !='' ">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[>=]]>
|
| | | DATE_FORMAT(#{startTime},'%Y%m%d')
|
| | | </if>
|
| | | <if test="endTime != null and endTime !=''">
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(u.createtime/1000),'%Y%m%d')<![CDATA[<=]]>
|
| | | DATE_FORMAT(#{endTime},'%Y%m%d')
|
| | | </if>
|
| | | <if test="userRank != null">
|
| | | AND rak.ur_name = #{userRank}
|
| | | </if>
|
| | | <if test = "level != null and level != ''">
|
| | | AND lc.tuls_level = #{level}
|
| | | </if>
|
| | | <if test="activeCode == 0">
|
| | | AND (ext.`uie_invite_code` is null OR ext.`uie_invite_code`='')
|
| | | </if>
|
| | | <if test="activeCode == 1">
|
| | | AND (ext.`uie_invite_code` is not null OR ext.`uie_invite_code`<![CDATA[<>]]>'')
|
| | | </if>
|
| | | <if test="key != null and key !='' ">
|
| | | <if test="keyType == 1">
|
| | | AND u.id = #{key}
|
| | | </if>
|
| | | <if test="keyType == 2">
|
| | | AND u.`nick_name` LIKE '%${key}%'
|
| | | </if>
|
| | | <if test="keyType == 3">
|
| | | AND u.`phone` = #{key}
|
| | | </if>
|
| | | <if test="keyType == 4">
|
| | | AND b.`account` = #{key}
|
| | | </if>
|
| | | <if test="keyType == 5">
|
| | | AND (ext.`uie_invite_code` = #{key} OR ext.`uie_invite_code_vip`= #{key})
|
| | | </if>
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="query" resultMap="BaseResultMapVO">
|
| | | SELECT *
|
| | | ,(SELECT COUNT(hb.hb_id) FROM `yeshi_ec_hongbao_v2` hb
|
| | |
| | | <!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.goods.ShareGoodsTextTemplateMapper">
|
| | | <resultMap id="BaseResultMap"
|
| | | type="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate">
|
| | | <id column="st_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="st_uid" property="uid" jdbcType="BIGINT" />
|
| | | <result column="st_share_text_template" property="shareTextTemplate"
|
| | | jdbcType="VARCHAR" />
|
| | | <result column="st_share_coupon_text_template" property="shareCouponTextTemplate"
|
| | | jdbcType="VARCHAR" />
|
| | | |
| | | <result column="st_share_taolijin_text_template" property="shareTaoLiJinTextTemplate" jdbcType="VARCHAR" />
|
| | | |
| | | <result column="st_share_jd_text_template" property="shareJDTextTemplate" jdbcType="VARCHAR" />
|
| | | <result column="st_share_jd_text_template_coupon" property="shareJDTextTemplateCoupon" jdbcType="VARCHAR" />
|
| | | <result column="st_share_pdd_text_template" property="sharePDDTextTemplate" jdbcType="VARCHAR" />
|
| | | <result column="st_share_pdd_text_template_coupon" property="sharePDDTextTemplateCoupon" jdbcType="VARCHAR" />
|
| | | |
| | | <result column="st_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | <result column="st_update_time" property="updateTime" jdbcType="TIMESTAMP" />
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_share_taolijin_text_template,st_create_time,st_share_jd_text_template,st_share_jd_text_template_coupon,st_share_pdd_text_template,st_share_pdd_text_template_coupon,st_update_time
|
| | | </sql>
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate">
|
| | | <id column="st_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="st_uid" property="uid" jdbcType="BIGINT"/>
|
| | | <result column="st_share_text_template" property="shareTextTemplate" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_coupon_text_template" property="shareCouponTextTemplate" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_taolijin_text_template" property="shareTaoLiJinTextTemplate" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_jd_text_template" property="shareJDTextTemplate" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_jd_text_template_coupon" property="shareJDTextTemplateCoupon" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_pdd_text_template" property="sharePDDTextTemplate" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_pdd_text_template_coupon" property="sharePDDTextTemplateCoupon" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_vip_text_template" property="shareVIPTextTemplate" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_vip_text_template_coupon" property="shareVIPTextTemplateCoupon" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_suning_text_template" property="shareSuNingTextTemplate" jdbcType="VARCHAR"/>
|
| | | <result column="st_share_suning_text_template_coupon" property="shareSuNingTextTemplateCoupon" jdbcType="VARCHAR"/>
|
| | | <result column="st_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="st_update_time" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_share_taolijin_text_template,st_share_jd_text_template,st_share_jd_text_template_coupon,st_share_pdd_text_template,st_share_pdd_text_template_coupon,st_share_vip_text_template,st_share_vip_text_template_coupon,st_share_suning_text_template,st_share_suning_text_template_coupon,st_create_time,st_update_time</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | |
| | | from yeshi_ec_share_template where st_uid = #{0}
|
| | | </select>
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_share_template where st_id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into
|
| | | yeshi_ec_share_template
|
| | | (st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_share_taolijin_text_template,st_share_jd_text_template,st_share_jd_text_template_coupon,st_share_pdd_text_template,st_share_pdd_text_template_coupon,st_create_time,st_update_time)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{shareTextTemplate,jdbcType=VARCHAR},#{shareCouponTextTemplate,jdbcType=VARCHAR},#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},#{shareJDTextTemplate,jdbcType=VARCHAR},#{shareJDTextTemplateCoupon,jdbcType=VARCHAR},#{sharePDDTextTemplate,jdbcType=VARCHAR},#{sharePDDTextTemplateCoupon,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_share_template
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">st_id,</if>
|
| | | <if test="uid != null">st_uid,</if>
|
| | | <if test="shareTextTemplate != null">st_share_text_template,</if>
|
| | | <if test="shareCouponTextTemplate != null">st_share_coupon_text_template,</if>
|
| | | <if test="shareTaoLiJinTextTemplate != null">st_share_taolijin_text_template,</if>
|
| | | <if test="shareJDTextTemplate != null">st_share_jd_text_template,</if>
|
| | | <if test="shareJDTextTemplateCoupon != null">st_share_jd_text_template_coupon,</if>
|
| | | <if test="sharePDDTextTemplate != null">st_share_pdd_text_template,</if>
|
| | | <if test="sharePDDTextTemplateCoupon != null">st_share_pdd_text_template_coupon,</if>
|
| | | <if test="createTime != null">st_create_time,</if>
|
| | | <if test="updateTime != null">st_update_time,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="shareTextTemplate != null">#{shareTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareCouponTextTemplate != null">#{shareCouponTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareTaoLiJinTextTemplate != null">#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareJDTextTemplate != null">#{shareJDTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareJDTextTemplateCoupon != null">#{shareJDTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="sharePDDTextTemplate != null">#{sharePDDTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="sharePDDTextTemplateCoupon != null">#{sharePDDTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate">update
|
| | | yeshi_ec_share_template set st_uid =
|
| | | #{uid,jdbcType=BIGINT},st_share_text_template =
|
| | | #{shareTextTemplate,jdbcType=VARCHAR},st_share_coupon_text_template =
|
| | | #{shareCouponTextTemplate,jdbcType=VARCHAR},
|
| | | st_share_taolijin_text_template =#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},
|
| | | st_share_jd_text_template =#{shareJDTextTemplate,jdbcType=VARCHAR},
|
| | | st_share_jd_text_template_coupon =#{shareJDTextTemplateCoupon,jdbcType=VARCHAR},
|
| | | st_share_pdd_text_template =#{sharePDDTextTemplate,jdbcType=VARCHAR},
|
| | | st_share_pdd_text_template_coupon =#{sharePDDTextTemplateCoupon,jdbcType=VARCHAR},
|
| | | st_create_time =#{createTime,jdbcType=TIMESTAMP},st_update_time =
|
| | | #{updateTime,jdbcType=TIMESTAMP} where st_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate">
|
| | | update yeshi_ec_share_template
|
| | | <set>
|
| | | <if test="uid != null">st_uid=#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="shareTextTemplate != null">st_share_text_template=#{shareTextTemplate,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="shareCouponTextTemplate != null">st_share_coupon_text_template=#{shareCouponTextTemplate,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="shareTaoLiJinTextTemplate != null">st_share_taolijin_text_template=#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="shareJDTextTemplate != null">st_share_jd_text_template=#{shareJDTextTemplate,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="shareJDTextTemplateCoupon != null">st_share_jd_text_template_coupon=#{shareJDTextTemplateCoupon,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="sharePDDTextTemplate != null">st_share_pdd_text_template=#{sharePDDTextTemplate,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="sharePDDTextTemplateCoupon != null">st_share_pdd_text_template_coupon=#{sharePDDTextTemplateCoupon,jdbcType=VARCHAR},
|
| | | </if>
|
| | | <if test="createTime != null">st_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">st_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set>
|
| | | where st_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_share_template where st_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_share_template (st_id,st_uid,st_share_text_template,st_share_coupon_text_template,st_share_taolijin_text_template,st_share_jd_text_template,st_share_jd_text_template_coupon,st_share_pdd_text_template,st_share_pdd_text_template_coupon,st_share_vip_text_template,st_share_vip_text_template_coupon,st_share_suning_text_template,st_share_suning_text_template_coupon,st_create_time,st_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{shareTextTemplate,jdbcType=VARCHAR},#{shareCouponTextTemplate,jdbcType=VARCHAR},#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},#{shareJDTextTemplate,jdbcType=VARCHAR},#{shareJDTextTemplateCoupon,jdbcType=VARCHAR},#{sharePDDTextTemplate,jdbcType=VARCHAR},#{sharePDDTextTemplateCoupon,jdbcType=VARCHAR},#{shareVIPTextTemplate,jdbcType=VARCHAR},#{shareVIPTextTemplateCoupon,jdbcType=VARCHAR},#{shareSuNingTextTemplate,jdbcType=VARCHAR},#{shareSuNingTextTemplateCoupon,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_share_template
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">st_id,</if>
|
| | | <if test="uid != null">st_uid,</if>
|
| | | <if test="shareTextTemplate != null">st_share_text_template,</if>
|
| | | <if test="shareCouponTextTemplate != null">st_share_coupon_text_template,</if>
|
| | | <if test="shareTaoLiJinTextTemplate != null">st_share_taolijin_text_template,</if>
|
| | | <if test="shareJDTextTemplate != null">st_share_jd_text_template,</if>
|
| | | <if test="shareJDTextTemplateCoupon != null">st_share_jd_text_template_coupon,</if>
|
| | | <if test="sharePDDTextTemplate != null">st_share_pdd_text_template,</if>
|
| | | <if test="sharePDDTextTemplateCoupon != null">st_share_pdd_text_template_coupon,</if>
|
| | | <if test="shareVIPTextTemplate != null">st_share_vip_text_template,</if>
|
| | | <if test="shareVIPTextTemplateCoupon != null">st_share_vip_text_template_coupon,</if>
|
| | | <if test="shareSuNingTextTemplate != null">st_share_suning_text_template,</if>
|
| | | <if test="shareSuNingTextTemplateCoupon != null">st_share_suning_text_template_coupon,</if>
|
| | | <if test="createTime != null">st_create_time,</if>
|
| | | <if test="updateTime != null">st_update_time,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="shareTextTemplate != null">#{shareTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareCouponTextTemplate != null">#{shareCouponTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareTaoLiJinTextTemplate != null">#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareJDTextTemplate != null">#{shareJDTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareJDTextTemplateCoupon != null">#{shareJDTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="sharePDDTextTemplate != null">#{sharePDDTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="sharePDDTextTemplateCoupon != null">#{sharePDDTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="shareVIPTextTemplate != null">#{shareVIPTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareVIPTextTemplateCoupon != null">#{shareVIPTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="shareSuNingTextTemplate != null">#{shareSuNingTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareSuNingTextTemplateCoupon != null">#{shareSuNingTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate">update yeshi_ec_share_template set st_uid = #{uid,jdbcType=BIGINT},st_share_text_template = #{shareTextTemplate,jdbcType=VARCHAR},st_share_coupon_text_template = #{shareCouponTextTemplate,jdbcType=VARCHAR},st_share_taolijin_text_template = #{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},st_share_jd_text_template = #{shareJDTextTemplate,jdbcType=VARCHAR},st_share_jd_text_template_coupon = #{shareJDTextTemplateCoupon,jdbcType=VARCHAR},st_share_pdd_text_template = #{sharePDDTextTemplate,jdbcType=VARCHAR},st_share_pdd_text_template_coupon = #{sharePDDTextTemplateCoupon,jdbcType=VARCHAR},st_share_vip_text_template = #{shareVIPTextTemplate,jdbcType=VARCHAR},st_share_vip_text_template_coupon = #{shareVIPTextTemplateCoupon,jdbcType=VARCHAR},st_share_suning_text_template = #{shareSuNingTextTemplate,jdbcType=VARCHAR},st_share_suning_text_template_coupon = #{shareSuNingTextTemplateCoupon,jdbcType=VARCHAR},st_create_time = #{createTime,jdbcType=TIMESTAMP},st_update_time = #{updateTime,jdbcType=TIMESTAMP} where st_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate">update yeshi_ec_share_template
|
| | | <set>
|
| | | <if test="uid != null">st_uid=#{uid,jdbcType=BIGINT},</if>
|
| | | <if test="shareTextTemplate != null">st_share_text_template=#{shareTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareCouponTextTemplate != null">st_share_coupon_text_template=#{shareCouponTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareTaoLiJinTextTemplate != null">st_share_taolijin_text_template=#{shareTaoLiJinTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareJDTextTemplate != null">st_share_jd_text_template=#{shareJDTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareJDTextTemplateCoupon != null">st_share_jd_text_template_coupon=#{shareJDTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="sharePDDTextTemplate != null">st_share_pdd_text_template=#{sharePDDTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="sharePDDTextTemplateCoupon != null">st_share_pdd_text_template_coupon=#{sharePDDTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="shareVIPTextTemplate != null">st_share_vip_text_template=#{shareVIPTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareVIPTextTemplateCoupon != null">st_share_vip_text_template_coupon=#{shareVIPTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="shareSuNingTextTemplate != null">st_share_suning_text_template=#{shareSuNingTextTemplate,jdbcType=VARCHAR},</if>
|
| | | <if test="shareSuNingTextTemplateCoupon != null">st_share_suning_text_template_coupon=#{shareSuNingTextTemplateCoupon,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">st_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">st_update_time=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where st_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | </mapper>
|
| | |
| | | SELECT COUNT(0) FROM (SELECT co.`co_order_no` FROM yeshi_ec_hongbao_v2 v2
|
| | | LEFT JOIN yeshi_ec_hongbao_order h ON v2.`hb_id` = h.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON h.`ho_order_id` = co.`co_id`
|
| | | WHERE v2.`hb_state` = 3 |
| | | WHERE v2.`hb_state` = 3 AND v2.`hb_uid` = #{uid}
|
| | | <if test="type == 1">AND v2.`hb_type` = 1</if>
|
| | | <if test="type == 2">AND v2.`hb_type` = 20</if>
|
| | | <if test="type == null">AND (v2.`hb_type` = 1 OR v2.`hb_type` = 20)</if>
|
| | | AND v2.`hb_uid` = #{uid} AND co.`co_payment` >= #{payment} |
| | | <if test="payment != null">AND co.`co_payment` >= #{payment}</if>
|
| | | GROUP BY co.`co_order_no`,co.`co_source_type`)A
|
| | | </select>
|
| | |
|
| | |
| | | SELECT COUNT(0) FROM (SELECT co.`co_order_no` FROM yeshi_ec_hongbao_v2 v2
|
| | | LEFT JOIN yeshi_ec_hongbao_order h ON v2.`hb_id` = h.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON h.`ho_order_id` = co.`co_id`
|
| | | WHERE (v2.`hb_state` = 1 or v2.`hb_state` = 2)
|
| | | WHERE v2.`hb_uid` = #{uid} AND (v2.`hb_state` = 1 or v2.`hb_state` = 2)
|
| | | <if test="type == 1">AND v2.`hb_type` = 1</if>
|
| | | <if test="type == 2">AND v2.`hb_type` = 20</if>
|
| | | <if test="type == null">AND (v2.`hb_type` = 1 OR v2.`hb_type` = 20)</if>
|
| | | AND v2.`hb_uid` = #{uid} AND co.`co_payment` >= #{payment} |
| | | <if test="payment != null">AND co.`co_payment` >= #{payment}</if>
|
| | | GROUP BY co.`co_order_no`,co.`co_source_type`)A
|
| | | </select>
|
| | |
|
| | |
| | | SELECT COUNT(d.`td_id`) FROM `yeshi_ec_integral_detail` d
|
| | | <if test="key != null and key != ''">WHERE d.`td_uid` LIKE '%${key}%'</if>
|
| | | </select>
|
| | | |
| | | <select id="sumUseGoldCoin" resultType = "Long">
|
| | | SELECT SUM(d.`td_money`) FROM `yeshi_ec_integral_detail` d
|
| | | WHERE d.`td_uid` = #{uid} AND d.`td_money`<![CDATA[<]]> 0
|
| | | </select>
|
| | | |
| | | |
| | | </mapper>
|
| | |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A |
| | | </select> |
| | | |
| | | <select id="countHistoryOrderNum" resultType="Long"> |
| | | SELECT COUNT(hb_id) FROM (SELECT v2.`hb_id` FROM yeshi_ec_hongbao_v2 v2 |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON IF(v2.hb_pid IS NULL,v2.hb_id,v2.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE v2.hb_uid = #{uid} |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)A |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <result column="co_state_desc" property="stateDesc" jdbcType="VARCHAR" /> |
| | | <result column="co_uid" property="userId" jdbcType="VARCHAR" /> |
| | | <result column="co_urank" property="urank" jdbcType="INTEGER" /> |
| | | <result column="co_child_source_type" property="childSourceType" |
| | | jdbcType="VARCHAR" /> |
| | | <association property="userInfo" column="co_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" /> |
| | | <association property="commonOrderGoods" column="co_order_goods_id" |
| | |
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <result column="co_state_desc" property="stateDesc" jdbcType="VARCHAR" /> |
| | | <result column="co_urank" property="urank" jdbcType="INTEGER" /> |
| | | <result column="co_child_source_type" property="childSourceType" |
| | | jdbcType="VARCHAR" /> |
| | | <association property="userInfo" column="co_uid" |
| | | select="com.yeshi.fanli.dao.mybatis.UserInfoMapper.selectByPrimaryKey" /> |
| | | <association property="commonOrderGoods" column="co_order_goods_id" |
| | |
| | | co_order_goods_id,co_count,co_state,co_state_whole_order, |
| | | co_estimate,co_eIncome,co_payment,co_settlement, co_third_create_time, |
| | | MAX(co_settle_time) AS co_settle_time, co_order_by, co_create_time, |
| | | co_update_time,co_state_desc,co_urank |
| | | co_update_time,co_state_desc,co_urank,co_child_source_type |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
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.cloud.UserCloudGoodsMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods"> |
| | | <id column="ug_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="ug_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="ug_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="ug_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ug_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <association property="commonGoods" column="ug_common_id" javaType="com.yeshi.fanli.entity.goods.CommonGoods" |
| | | select="com.yeshi.fanli.dao.mybatis.goods.CommonGoodsMapper.selectByPrimaryKey" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ug_id,ug_uid,ug_common_id,ug_state,ug_create_time,ug_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_cloud_goods where ug_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_cloud_goods where ug_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_goods (ug_id,ug_uid,ug_common_id,ug_state,ug_create_time,ug_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{commonGoods.id,jdbcType=BIGINT},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_goods |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ug_id,</if> |
| | | <if test="uid != null">ug_uid,</if> |
| | | <if test="commonGoods != null">ug_common_id,</if> |
| | | <if test="state != null">ug_state,</if> |
| | | <if test="createTime != null">ug_create_time,</if> |
| | | <if test="updateTime != null">ug_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="commonGoods != null">#{commonGoods.id,jdbcType=BIGINT},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods">update yeshi_ec_user_cloud_goods set ug_uid = #{uid,jdbcType=BIGINT},ug_common_id = #{commonGoods.id,jdbcType=BIGINT},ug_state = #{state,jdbcType=INTEGER},ug_create_time = #{createTime,jdbcType=TIMESTAMP},ug_update_time = #{updateTime,jdbcType=TIMESTAMP} where ug_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods">update yeshi_ec_user_cloud_goods |
| | | <set> |
| | | <if test="uid != null">ug_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="commonGoods != null">ug_common_id=#{commonGoods.id,jdbcType=BIGINT},</if> |
| | | <if test="state != null">ug_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">ug_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ug_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ug_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteByPrimaryKeyAndUid"> |
| | | delete from yeshi_ec_user_cloud_goods where ug_id = #{id} AND ug_uid = #{uid} |
| | | </delete> |
| | | |
| | | |
| | | <select id="query" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_goods tg |
| | | LEFT JOIN `yeshi_ec_common_goods` cg ON tg.`ug_common_id` = cg.`cg_id` |
| | | WHERE 1=1 |
| | | <if test="key != null and key != ''">AND tg.`ug_uid` = #{key}</if> |
| | | ORDER BY tg.ug_id DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(ug_id),0) FROM yeshi_ec_user_cloud_goods tg |
| | | WHERE 1=1 |
| | | <if test="key != null and key != ''"> AND tg.`ug_uid` = #{key}</if> |
| | | </select> |
| | | |
| | | |
| | | <select id="listByUid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_goods tg |
| | | LEFT JOIN `yeshi_ec_common_goods` cg ON tg.`ug_common_id` = cg.`cg_id` |
| | | WHERE tg.`ug_uid` = #{uid} |
| | | ORDER BY cg.cg_state, tg.ug_state, tg.`ug_update_time` DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countByUid" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(ug_id),0) FROM yeshi_ec_user_cloud_goods tg |
| | | WHERE tg.`ug_uid` = #{uid} |
| | | </select> |
| | | |
| | | <select id="getByUidAndGoods" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_user_cloud_goods` g |
| | | LEFT JOIN `yeshi_ec_common_goods` c ON g.`ug_common_id` = c.`cg_id` |
| | | WHERE g.`ug_uid` = #{uid} AND c.`cg_goods_id`= #{goodsId} AND c.cg_goods_type = #{goodsType} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getByUidAndCommonGoodsId" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_user_cloud_goods` g |
| | | WHERE g.`ug_uid` = #{uid} AND g.ug_common_id = #{commonId} |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | |
| | | <select id="listByNotShare" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_user_cloud_goods` g |
| | | WHERE g.`ug_uid` = #{uid} AND g.ug_state = 0 |
| | | </select> |
| | | </mapper> |
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.cloud.UserCloudGroupMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup"> |
| | | <id column="ucg_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="ucg_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="ucg_type" property="type" jdbcType="INTEGER"/> |
| | | <result column="ucg_state" property="state" jdbcType="BOOLEAN"/> |
| | | <result column="ucg_group_id" property="groupId" jdbcType="VARCHAR"/> |
| | | <result column="ucg_group_name" property="groupName" jdbcType="VARCHAR"/> |
| | | <result column="ucg_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ucg_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ucg_id,ucg_uid,ucg_type,ucg_state,ucg_group_id,ucg_group_name,ucg_create_time,ucg_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_cloud_group where ucg_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_cloud_group where ucg_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_group (ucg_id,ucg_uid,ucg_type,ucg_state,ucg_group_id,ucg_group_name,ucg_create_time,ucg_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{type,jdbcType=INTEGER},#{state,jdbcType=BOOLEAN},#{groupId,jdbcType=VARCHAR},#{groupName,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_group |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ucg_id,</if> |
| | | <if test="uid != null">ucg_uid,</if> |
| | | <if test="type != null">ucg_type,</if> |
| | | <if test="state != null">ucg_state,</if> |
| | | <if test="groupId != null">ucg_group_id,</if> |
| | | <if test="groupName != null">ucg_group_name,</if> |
| | | <if test="createTime != null">ucg_create_time,</if> |
| | | <if test="updateTime != null">ucg_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if> |
| | | <if test="state != null">#{state,jdbcType=BOOLEAN},</if> |
| | | <if test="groupId != null">#{groupId,jdbcType=VARCHAR},</if> |
| | | <if test="groupName != null">#{groupName,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup">update yeshi_ec_user_cloud_group set ucg_uid = #{uid,jdbcType=BIGINT},ucg_type = #{type,jdbcType=INTEGER},ucg_state = #{state,jdbcType=BOOLEAN},ucg_group_id = #{groupId,jdbcType=VARCHAR},ucg_group_name = #{groupName,jdbcType=VARCHAR},ucg_create_time = #{createTime,jdbcType=TIMESTAMP},ucg_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucg_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup">update yeshi_ec_user_cloud_group |
| | | <set> |
| | | <if test="uid != null">ucg_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="type != null">ucg_type=#{type,jdbcType=INTEGER},</if> |
| | | <if test="state != null">ucg_state=#{state,jdbcType=BOOLEAN},</if> |
| | | <if test="groupId != null">ucg_group_id=#{groupId,jdbcType=VARCHAR},</if> |
| | | <if test="groupName != null">ucg_group_name=#{groupName,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">ucg_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ucg_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ucg_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteGroupByUid"> |
| | | delete from yeshi_ec_user_cloud_group where ucg_uid = #{uid} AND ucg_type = 2 |
| | | </delete> |
| | | |
| | | |
| | | <select id="listByUid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_group d |
| | | WHERE d.`ucg_uid` = #{uid} |
| | | </select> |
| | | |
| | | <select id="listGroupByUid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_group d |
| | | WHERE d.`ucg_uid` = #{uid} AND d.ucg_type = 2 |
| | | </select> |
| | | |
| | | <select id="listByUidAndType" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_group d |
| | | WHERE d.`ucg_uid` = #{uid} AND d.ucg_type = #{type} |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
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.cloud.UserCloudManageMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage"> |
| | | <id column="ucm_uid" property="id" jdbcType="BIGINT"/> |
| | | <result column="ucm_official" property="official" jdbcType="BOOLEAN"/> |
| | | <result column="ucm_custom" property="custom" jdbcType="BOOLEAN"/> |
| | | <result column="ucm_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ucm_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ucm_uid,ucm_official,ucm_custom,ucm_create_time,ucm_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_cloud_manage where ucm_uid = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_cloud_manage where ucm_uid = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_manage (ucm_uid,ucm_official,ucm_custom,ucm_create_time,ucm_update_time) values (#{id,jdbcType=BIGINT},#{official,jdbcType=BOOLEAN},#{custom,jdbcType=BOOLEAN},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_manage |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ucm_uid,</if> |
| | | <if test="official != null">ucm_official,</if> |
| | | <if test="custom != null">ucm_custom,</if> |
| | | <if test="createTime != null">ucm_create_time,</if> |
| | | <if test="updateTime != null">ucm_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="official != null">#{official,jdbcType=BOOLEAN},</if> |
| | | <if test="custom != null">#{custom,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage">update yeshi_ec_user_cloud_manage set ucm_official = #{official,jdbcType=BOOLEAN},ucm_custom = #{custom,jdbcType=BOOLEAN},ucm_create_time = #{createTime,jdbcType=TIMESTAMP},ucm_update_time = #{updateTime,jdbcType=TIMESTAMP} where ucm_uid = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage">update yeshi_ec_user_cloud_manage |
| | | <set> |
| | | <if test="official != null">ucm_official=#{official,jdbcType=BOOLEAN},</if> |
| | | <if test="custom != null">ucm_custom=#{custom,jdbcType=BOOLEAN},</if> |
| | | <if test="createTime != null">ucm_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ucm_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ucm_uid = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
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.cloud.UserCloudMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.cloud.UserCloud"> |
| | | <id column="uc_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="uc_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="uc_order_id" property="orderId" jdbcType="BIGINT"/> |
| | | <result column="uc_group_num" property="groupNum" jdbcType="INTEGER"/> |
| | | <result column="uc_start_time" property="startTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uc_end_time" property="endTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uc_wx_id" property="wxId" jdbcType="VARCHAR"/> |
| | | <result column="uc_wx_name" property="wxName" jdbcType="VARCHAR"/> |
| | | <result column="uc_wx_portrait" property="wxPortrait" jdbcType="VARCHAR"/> |
| | | <result column="uc_robot_id" property="robotId" jdbcType="INTEGER"/> |
| | | <result column="uc_robot_type" property="robotType" jdbcType="INTEGER"/> |
| | | <result column="uc_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="uc_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">uc_id,uc_uid,uc_order_id,uc_group_num,uc_start_time,uc_end_time,uc_wx_id,uc_wx_name,uc_wx_portrait,uc_robot_id,uc_robot_type,uc_create_time,uc_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_cloud where uc_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_cloud where uc_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloud" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud (uc_id,uc_uid,uc_order_id,uc_group_num,uc_start_time,uc_end_time,uc_wx_id,uc_wx_name,uc_wx_portrait,uc_robot_id,uc_robot_type,uc_create_time,uc_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{orderId,jdbcType=BIGINT},#{groupNum,jdbcType=INTEGER},#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{wxId,jdbcType=VARCHAR},#{wxName,jdbcType=VARCHAR},#{wxPortrait,jdbcType=VARCHAR},#{robotId,jdbcType=INTEGER},#{robotType,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloud" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">uc_id,</if> |
| | | <if test="uid != null">uc_uid,</if> |
| | | <if test="orderId != null">uc_order_id,</if> |
| | | <if test="groupNum != null">uc_group_num,</if> |
| | | <if test="startTime != null">uc_start_time,</if> |
| | | <if test="endTime != null">uc_end_time,</if> |
| | | <if test="wxId != null">uc_wx_id,</if> |
| | | <if test="wxName != null">uc_wx_name,</if> |
| | | <if test="wxPortrait != null">uc_wx_portrait,</if> |
| | | <if test="robotId != null">uc_robot_id,</if> |
| | | <if test="robotType != null">uc_robot_type,</if> |
| | | <if test="createTime != null">uc_create_time,</if> |
| | | <if test="updateTime != null">uc_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="orderId != null">#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="groupNum != null">#{groupNum,jdbcType=INTEGER},</if> |
| | | <if test="startTime != null">#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="wxId != null">#{wxId,jdbcType=VARCHAR},</if> |
| | | <if test="wxName != null">#{wxName,jdbcType=VARCHAR},</if> |
| | | <if test="wxPortrait != null">#{wxPortrait,jdbcType=VARCHAR},</if> |
| | | <if test="robotId != null">#{robotId,jdbcType=INTEGER},</if> |
| | | <if test="robotType != null">#{robotType,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloud">update yeshi_ec_user_cloud set uc_uid = #{uid,jdbcType=BIGINT},uc_order_id = #{orderId,jdbcType=BIGINT},uc_group_num = #{groupNum,jdbcType=INTEGER},uc_start_time = #{startTime,jdbcType=TIMESTAMP},uc_end_time = #{endTime,jdbcType=TIMESTAMP},uc_wx_id = #{wxId,jdbcType=VARCHAR},uc_wx_name = #{wxName,jdbcType=VARCHAR},uc_wx_portrait = #{wxPortrait,jdbcType=VARCHAR},uc_robot_id = #{robotId,jdbcType=INTEGER},uc_robot_type = #{robotType,jdbcType=INTEGER},uc_create_time = #{createTime,jdbcType=TIMESTAMP},uc_update_time = #{updateTime,jdbcType=TIMESTAMP} where uc_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloud">update yeshi_ec_user_cloud |
| | | <set> |
| | | <if test="uid != null">uc_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="orderId != null">uc_order_id=#{orderId,jdbcType=BIGINT},</if> |
| | | <if test="groupNum != null">uc_group_num=#{groupNum,jdbcType=INTEGER},</if> |
| | | <if test="startTime != null">uc_start_time=#{startTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="endTime != null">uc_end_time=#{endTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="wxId != null">uc_wx_id=#{wxId,jdbcType=VARCHAR},</if> |
| | | <if test="wxName != null">uc_wx_name=#{wxName,jdbcType=VARCHAR},</if> |
| | | <if test="wxPortrait != null">uc_wx_portrait=#{wxPortrait,jdbcType=VARCHAR},</if> |
| | | <if test="robotId != null">uc_robot_id=#{robotId,jdbcType=INTEGER},</if> |
| | | <if test="robotType != null">uc_robot_type=#{robotType,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">uc_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">uc_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where uc_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getLastByUid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud d |
| | | WHERE d.`uc_uid` = #{uid} |
| | | ORDER BY d.uc_id DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getValidByUid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud d |
| | | WHERE d.`uc_uid` = #{uid} AND d.`uc_end_time` > NOW() |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="countByUid" resultType="Long"> |
| | | SELECT COUNT(uc_id) FROM yeshi_ec_user_cloud d |
| | | WHERE d.`uc_uid` = #{uid} |
| | | </select> |
| | | |
| | | <select id="getByOrderId" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud d |
| | | 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> |
| | | |
| | | <select id="query" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud d |
| | | WHERE 1=1 |
| | | <if test="key != null and key !=''"> AND d.`uc_uid` LIKE '%#{key}%' </if> |
| | | <if test="state == 0">AND d.`uc_end_time`<![CDATA[<=]]>NOW()</if> |
| | | <if test="state == 1">AND d.`uc_end_time` > NOW()</if> |
| | | ORDER BY d.`uc_id` DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="Long"> |
| | | SELECT count(d.`uc_id`) FROM yeshi_ec_user_cloud d |
| | | WHERE 1=1 |
| | | <if test="key != null and key !=''"> AND d.`uc_uid` LIKE '%#{key}%' </if> |
| | | <if test="state == 0">AND d.`uc_end_time`<![CDATA[<=]]>NOW()</if> |
| | | <if test="state == 1">AND d.`uc_end_time` > NOW()</if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
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.cloud.UserCloudOrderMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder"> |
| | | <id column="crd_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="crd_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="crd_money" property="money" jdbcType="DECIMAL"/> |
| | | <result column="crd_state" property="state" jdbcType="BOOLEAN"/> |
| | | <result column="crd_desc" property="desc" jdbcType="VARCHAR"/> |
| | | <result column="crd_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="crd_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | <result column="crd_type" property="type" typeHandler="com.yeshi.fanli.util.mybatishandler.CloudOrderMenuEnumHandler"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">crd_id,crd_uid,crd_money,crd_type,crd_state,crd_desc,crd_create_time,crd_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_cloud_order where crd_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_cloud_order where crd_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_order (crd_id,crd_uid,crd_money,crd_type,crd_state,crd_desc,crd_create_time,crd_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{type,jdbcType=VARCHAR},#{state,jdbcType=BOOLEAN},#{desc,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_cloud_order |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">crd_id,</if> |
| | | <if test="uid != null">crd_uid,</if> |
| | | <if test="money != null">crd_money,</if> |
| | | <if test="type != null">crd_type,</if> |
| | | <if test="state != null">crd_state,</if> |
| | | <if test="desc != null">crd_desc,</if> |
| | | <if test="createTime != null">crd_create_time,</if> |
| | | <if test="updateTime != null">crd_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="type != null">#{type,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">#{state,jdbcType=BOOLEAN},</if> |
| | | <if test="desc != null">#{desc,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder">update yeshi_ec_user_cloud_order set crd_uid = #{uid,jdbcType=BIGINT},crd_money = #{money,jdbcType=DECIMAL},crd_type = #{type,jdbcType=VARCHAR},crd_state = #{state,jdbcType=BOOLEAN},crd_desc = #{desc,jdbcType=VARCHAR},crd_create_time = #{createTime,jdbcType=TIMESTAMP},crd_update_time = #{updateTime,jdbcType=TIMESTAMP} where crd_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder">update yeshi_ec_user_cloud_order |
| | | <set> |
| | | <if test="uid != null">crd_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">crd_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="type != null">crd_type=#{type,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">crd_state=#{state,jdbcType=BOOLEAN},</if> |
| | | <if test="desc != null">crd_desc=#{desc,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">crd_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">crd_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where crd_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="selectForUpdate" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | SELECT * from yeshi_ec_user_cloud_order where crd_id = #{id,jdbcType=BIGINT} FOR UPDATE |
| | | </select> |
| | | |
| | | |
| | | <select id="getLastOrderByPayEnd" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_order d |
| | | WHERE d.`crd_uid` = #{uid} AND d.`crd_type` = #{type} AND crd_state = 1 |
| | | ORDER BY d.`crd_id` DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getLastOrderByUnpaid" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List"/> FROM yeshi_ec_user_cloud_order d |
| | | WHERE d.`crd_uid` = #{uid} AND d.`crd_type` = #{type} AND crd_state = 0 |
| | | ORDER BY d.`crd_id` DESC |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getOrderRecord" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_order d |
| | | WHERE d.`crd_uid` = #{uid} <if test="state != null">and d.crd_state = #{state}</if> |
| | | ORDER BY d.`crd_id` DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="countOrderRecord" resultType="Long"> |
| | | SELECT count(d.`crd_id`) FROM yeshi_ec_user_cloud_order d |
| | | WHERE d.`crd_uid` = #{uid} <if test="state != null">and d.crd_state = #{state}</if> |
| | | </select> |
| | | |
| | | <select id="getLasthourByUnpaid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_order |
| | | WHERE crd_state = 0 AND crd_update_time > DATE_SUB(NOW(),INTERVAL 1 HOUR) |
| | | </select> |
| | | |
| | | |
| | | <select id="query" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_cloud_order d |
| | | WHERE 1=1 |
| | | <if test="key != null and key !=''"> AND d.`crd_uid` LIKE '%#{key}%' </if> |
| | | <if test="state != null">AND d.crd_state = #{state}</if> |
| | | ORDER BY d.`crd_id` DESC |
| | | LIMIT #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="count" resultType="Long"> |
| | | SELECT count(d.`crd_id`) FROM yeshi_ec_user_cloud_order d |
| | | WHERE 1=1 |
| | | <if test="key != null and key !='' "> AND d.`crd_uid` LIKE '%#{key}%' </if> |
| | | <if test="state != null">AND d.crd_state = #{state}</if> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | return count; |
| | | } |
| | | |
| | | @Override |
| | | public long countHistoryOrderNum(Long uid) { |
| | | Long count = commonOrderCountMapper.countHistoryOrderNum(uid); |
| | | if (count == null) { |
| | | count = 0L; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public String getTextTemplateByVIP(Long uid) {
|
| | | String template = "";
|
| | | ShareGoodsTextTemplate objct = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (objct != null && !StringUtil.isNullOrEmpty(objct.getSharePDDTextTemplate())) {
|
| | | template = objct.getSharePDDTextTemplate();
|
| | | if (template.contains("{商品原价}") || template.contains("{总销量}") || template.contains("{短链接}")) {
|
| | | template = ""; // 老板分享
|
| | | }
|
| | | if (objct != null && !StringUtil.isNullOrEmpty(objct.getShareVIPTextTemplate())) {
|
| | | template = objct.getShareVIPTextTemplate();
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(template)) {
|
| | | template = configService.get(ConfigKeyEnum.shareCommentTextPDD.getKey());
|
| | | template = configService.get(ConfigKeyEnum.shareCommentTextVIP.getKey());
|
| | | }
|
| | |
|
| | | return template;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String createContentSuning(String template, SuningGoodsInfo goods, String jumpLink) {
|
| | | String commentText = template.replace("{原价}", goods.getCommodityInfo().getCommodityPrice());
|
| | | commentText = commentText.replace("{链接}", jumpLink);
|
| | | public String getTextTemplateBySuNing(Long uid) {
|
| | | String template = "";
|
| | | ShareGoodsTextTemplate objct = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (objct != null && !StringUtil.isNullOrEmpty(objct.getShareSuNingTextTemplate())) {
|
| | | template = objct.getShareSuNingTextTemplate();
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(template)) {
|
| | | template = configService.get(ConfigKeyEnum.shareCommentTextSuNing.getKey());
|
| | | }
|
| | |
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】{券后价}元", "");
|
| | |
|
| | | return deleteBlankLine(commentText);
|
| | | return template;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Override
|
| | | public void saveTemplateTB(Long uid, String template) throws ShareGoodsTextTemplateException {
|
| | | verifyRightTB(template);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void saveTemplateVIP(Long uid, String template) throws ShareGoodsTextTemplateException {
|
| | | verifyRightVIP(template);
|
| | | ShareGoodsTextTemplate old = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (old != null) {
|
| | | ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
|
| | | update.setId(old.getId());
|
| | | update.setShareVIPTextTemplate(template);
|
| | | update.setUpdateTime(new Date());
|
| | | shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
|
| | | } else {
|
| | | ShareGoodsTextTemplate textTemplate = new ShareGoodsTextTemplate();
|
| | | textTemplate.setCreateTime(new Date());
|
| | | textTemplate.setShareVIPTextTemplate(template);
|
| | | textTemplate.setUid(uid);
|
| | | shareGoodsTextTemplateMapper.insertSelective(textTemplate);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void saveTemplateSuNing(Long uid, String template) throws ShareGoodsTextTemplateException {
|
| | | verifyRightSuNing(template);
|
| | | ShareGoodsTextTemplate old = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (old != null) {
|
| | | ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
|
| | | update.setId(old.getId());
|
| | | update.setShareSuNingTextTemplate(template);
|
| | | update.setUpdateTime(new Date());
|
| | | shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
|
| | | } else {
|
| | | ShareGoodsTextTemplate textTemplate = new ShareGoodsTextTemplate();
|
| | | textTemplate.setCreateTime(new Date());
|
| | | textTemplate.setShareSuNingTextTemplate(template);
|
| | | textTemplate.setUid(uid);
|
| | | shareGoodsTextTemplateMapper.insertSelective(textTemplate);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void verifyRightTB(String template) throws ShareGoodsTextTemplateException {
|
| | | String[] keys = new String[] { "{原价}", "{券后价}", "{淘口令}" };
|
| | |
| | | throw new ShareGoodsTextTemplateException(1, "模板格式有误");
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void verifyRightVIP(String template) throws ShareGoodsTextTemplateException {
|
| | | String[] keys = new String[] { "{在售价}", "{折扣价}", "{链接}" };
|
| | | int keysCount = 0;
|
| | | for (String key : keys)
|
| | | if (template != null && template.contains(key))
|
| | | keysCount++;
|
| | | if (keysCount == 0)
|
| | | throw new ShareGoodsTextTemplateException(1, "模板格式有误");
|
| | | }
|
| | | |
| | | @Override
|
| | | public void verifyRightSuNing(String template) throws ShareGoodsTextTemplateException {
|
| | | String[] keys = new String[] { "{原价}", "{券后价}", "{链接}" };
|
| | | int keysCount = 0;
|
| | | for (String key : keys)
|
| | | if (template != null && template.contains(key))
|
| | | keysCount++;
|
| | | if (keysCount == 0)
|
| | | throw new ShareGoodsTextTemplateException(1, "模板格式有误");
|
| | | }
|
| | | |
| | | @Override
|
| | | public String createContentTB(String template, TaoBaoGoodsBrief goods, String token, boolean coupon) {
|
| | | String commentText = template.replace("{原价}", goods.getZkPrice().toString());
|
| | |
| | |
|
| | | @Override
|
| | | public String createContentVIP(String template, VIPGoodsInfo goods, String jumpLink) {
|
| | | String commentText = template.replace("{原价}", goods.getMarketPrice());
|
| | | String commentText = template.replace("{在售价}", ""+BigDecimalUtil.getWithNoZera(new BigDecimal(goods.getMarketPrice())));
|
| | | commentText = commentText.replace("{链接}", jumpLink);
|
| | |
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】{券后价}元", "");
|
| | |
|
| | | commentText = commentText.replace("{折扣价}", "" +MoneyBigDecimalUtil.getWithNoZera(new BigDecimal(goods.getVipPrice())));
|
| | | return deleteBlankLine(commentText);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public void isCommonTemplateRight(String template) throws ShareGoodsTextTemplateException {
|
| | | String[] keys = new String[] { "{标题}", "{店铺类型}", "{商品原价}", "{月销量}", "{短链}", "{淘口令}" };
|
| | |
| | | shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void resetCommonTemplateVIP(Long uid) {
|
| | | ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (template != null) {
|
| | | ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
|
| | | update.setId(template.getId());
|
| | | update.setShareVIPTextTemplate("");
|
| | | update.setUpdateTime(new Date());
|
| | | shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void resetCouponTemplateVIP(Long uid) {
|
| | | ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (template != null) {
|
| | | ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
|
| | | update.setId(template.getId());
|
| | | update.setShareVIPTextTemplateCoupon("");
|
| | | update.setUpdateTime(new Date());
|
| | | shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void resetCommonTemplateSuNing(Long uid) {
|
| | | ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (template != null) {
|
| | | ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
|
| | | update.setId(template.getId());
|
| | | update.setShareSuNingTextTemplate("");
|
| | | update.setUpdateTime(new Date());
|
| | | shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void resetCouponTemplateSuNing(Long uid) {
|
| | | ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | | if (template != null) {
|
| | | ShareGoodsTextTemplate update = new ShareGoodsTextTemplate();
|
| | | update.setId(template.getId());
|
| | | update.setShareSuNingTextTemplateCoupon("");
|
| | | update.setUpdateTime(new Date());
|
| | | shareGoodsTextTemplateMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void resetTaoLijinTemplate(Long uid) {
|
| | | ShareGoodsTextTemplate template = shareGoodsTextTemplateMapper.selectByUid(uid);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public String getRecommendText(boolean coupon, String title, String sales, String couponAmount, String description) {
|
| | | String template = configService.get(ConfigKeyEnum.quickShareGoodsText.getKey());
|
| | | String recommendText = template.replace("[商品标题]", title);
|
| | | if (!coupon) {
|
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", "");
|
| | | recommendText = recommendText.replace("优惠券:[券面额]元", "");
|
| | | } else {
|
| | | recommendText = recommendText.replace("[券面额]", couponAmount);
|
| | | if (!StringUtil.isNullOrEmpty(description)) {
|
| | | recommendText = recommendText.replace("[推荐语]", description);
|
| | | } else {
|
| | | recommendText = recommendText.replace("推荐理由:[推荐语]", "");
|
| | | }
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(sales)|| sales.equals("0")) {
|
| | | recommendText = recommendText.replace("销量:[销量]", "");
|
| | | } else {
|
| | | recommendText = recommendText.replace("[销量]", sales.replace("万", "w"));
|
| | | }
|
| | | return recommendText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public String getCommentTextByTaoToken(boolean coupon, String taoToken, String zkPrice, String quanPrice) {
|
| | | String quickCommentText = configService.get(ConfigKeyEnum.quickShareTBCommentText.getKey());
|
| | | String commentText = quickCommentText.replace("[原价]", zkPrice);
|
| | | commentText = commentText.replace("[淘口令]", TaoBaoUtil.filterTaoToken(taoToken));
|
| | | if (!coupon) {
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】[券后价]元", "");
|
| | | } else {
|
| | | commentText = commentText.replace("[券后价]", quanPrice);
|
| | | }
|
| | | return commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | }
|
| | | |
| | | @Override
|
| | | public String getCommentTextByLink(boolean coupon, String link, String zkPrice, String quanPrice, ConfigKeyEnum keyEnum) {
|
| | | String quickCommentText = configService.get(keyEnum.getKey());
|
| | | String commentText = quickCommentText.replace("[原价]", zkPrice);
|
| | | commentText = commentText.replace("[链接]", link);
|
| | | if (!coupon) {
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】[券后价]元", "");
|
| | | } else {
|
| | | commentText = commentText.replace("[券后价]", quanPrice);
|
| | | }
|
| | | |
| | | return commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public String createQuickShareTextSuNing(String template, SuningGoodsInfo goods, String jumpLink) {
|
| | | String commodityPrice = goods.getCommodityInfo().getCommodityPrice();
|
| | | if (StringUtil.isNullOrEmpty(commodityPrice)) {
|
| | | commodityPrice = goods.getCommodityInfo().getSnPrice();
|
| | | }
|
| | | |
| | | String commentText = template.replace("[原价]", BigDecimalUtil.getWithNoZera(new BigDecimal(commodityPrice)).toString());
|
| | | commentText = commentText.replace("[链接]", jumpLink);
|
| | | if (goods.getCouponInfo() != null && !StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl())) {// 有券
|
| | | BigDecimal amount = new BigDecimal(goods.getCouponInfo().getCouponValue());
|
| | | BigDecimal startFee = new BigDecimal(goods.getCouponInfo().getBounsLimit());
|
| | | BigDecimal zkPrice = new BigDecimal(commodityPrice);
|
| | | BigDecimal couponPrice = zkPrice;
|
| | | if (zkPrice.compareTo(startFee) >= 0) {
|
| | | couponPrice = zkPrice.subtract(amount);
|
| | | commentText = commentText.replace("[券后价]",BigDecimalUtil.getWithNoZera(couponPrice).toString());
|
| | | } else {
|
| | | commentText = commentText.replace("【券后价】[券后价]元", "");
|
| | | }
|
| | | } else {
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】[券后价]元", "");
|
| | | }
|
| | | return deleteBlankLine(commentText);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public String createCommonShareTextSuNing(String template, SuningGoodsInfo goods, String jumpLink) {
|
| | | String commodityPrice = goods.getCommodityInfo().getCommodityPrice();
|
| | | if (StringUtil.isNullOrEmpty(commodityPrice)) {
|
| | | commodityPrice = goods.getCommodityInfo().getSnPrice();
|
| | | }
|
| | | String commentText = template.replace("{原价}", BigDecimalUtil.getWithNoZera(new BigDecimal(commodityPrice)).toString());
|
| | | commentText = commentText.replace("{链接}", jumpLink);
|
| | | if (goods.getCouponInfo() != null && !StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl())) {// 有券
|
| | | BigDecimal amount = new BigDecimal(goods.getCouponInfo().getCouponValue());
|
| | | BigDecimal startFee = new BigDecimal(goods.getCouponInfo().getBounsLimit());
|
| | | BigDecimal zkPrice = new BigDecimal(commodityPrice);
|
| | | BigDecimal couponPrice = zkPrice;
|
| | | if (zkPrice.compareTo(startFee) >= 0) {
|
| | | couponPrice = zkPrice.subtract(amount);
|
| | | commentText = commentText.replace("{券后价}",BigDecimalUtil.getWithNoZera(couponPrice).toString());
|
| | | } else {
|
| | | commentText = commentText.replace("{券后价}", BigDecimalUtil.getWithNoZera(new BigDecimal(commodityPrice)).toString());
|
| | | }
|
| | | } else {
|
| | | commentText = commentText.replace("领券抢购", "抢购");
|
| | | commentText = commentText.replace("【券后价】{券后价}元", "");
|
| | | }
|
| | | return deleteBlankLine(commentText);
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService;
|
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private AppVersionService appVersionService;
|
| | | |
| | | @Resource
|
| | | private ConvertLinkManager convertLinkManager;
|
| | |
|
| | | @Resource
|
| | | private AdActivityVersionControlService adActivityVersionControlService;
|
| | |
| | | String link = configService.get(ConfigKeyEnum.activityDetailLink.getKey()) + "?type=%s&id=%s";
|
| | | link = String.format(link, CommonShareInfoEnum.special.name(),specialVO.getId());
|
| | |
|
| | | // 跳转链接
|
| | | JSONObject params = new JSONObject();
|
| | | params.put("url", link);
|
| | |
|
| | | specialVO.setComment(info.getComment());
|
| | | // 替换淘宝官方活动
|
| | | String comment = info.getComment();
|
| | | List<String> activityIdList = convertLinkManager.getTaoBaoOfficialActivityId(comment);
|
| | | for (String st : activityIdList)
|
| | | comment = comment.replace(st, "");
|
| | |
|
| | | specialVO.setComment(comment);
|
| | | specialVO.setParams(params.toString());
|
| | | specialVO.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.order.ESOrder; |
| | | import com.yeshi.fanli.entity.order.HongBaoOrder; |
| | | import com.yeshi.fanli.entity.order.InviteOrderSubsidy; |
| | | import com.yeshi.fanli.entity.order.SourceTypeEnum; |
| | | import com.yeshi.fanli.entity.pdd.PDDOrder; |
| | | import com.yeshi.fanli.entity.suning.SuningOrderInfo; |
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum; |
| | |
| | | } else if (sourceType == Constant.SOURCE_TYPE_PDD) { |
| | | order.setOrderType(4); |
| | | } |
| | | |
| | | // 子来源类型 |
| | | ClientTextStyleVO shopStyleVO = new ClientTextStyleVO(); |
| | | SourceTypeEnum typeEnum = SourceTypeEnum.getByDesc(order.getChildSourceType()); |
| | | if (typeEnum == null) { |
| | | shopStyleVO.setContent("其他"); |
| | | shopStyleVO.setColor("#FF5000"); |
| | | shopStyleVO.setBorderColor("#FF5000"); |
| | | } else { |
| | | shopStyleVO.setContent(typeEnum.getDescShow()); |
| | | shopStyleVO.setColor(typeEnum.getFontColor()); |
| | | shopStyleVO.setBorderColor(typeEnum.getBorderColor()); |
| | | } |
| | | order.setShopType(shopStyleVO); |
| | | |
| | | |
| | | Date thirdCreateTime = order.getThirdCreateTime(); |
| | | if (thirdCreateTime != null) { |
| | |
| | | |
| | | |
| | | @Override |
| | | public FileUploadResult drawGoodsQuickhShare(String erCodeUrl, String portrait, String inviteCode, |
| | | String mainPic, GoodsDetailVO goods) { |
| | | // 二维码流 |
| | | InputStream erCodeStream = null; |
| | | try { |
| | | erCodeStream = QRCodeUtil.getInstance(250).encodeDeleteWhite(erCodeUrl); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | |
| | | // 头像 |
| | | InputStream portraitStream = null; |
| | | if (!StringUtil.isNullOrEmpty(portrait)) { |
| | | try { |
| | | portraitStream = HttpUtil.getAsInputStream(portrait); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | if (portraitStream == null) { |
| | | portraitStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/official_default_head.jpg"); |
| | | } |
| | | |
| | | // 画图 |
| | | InputStream drawStream = ImageUtil.drawGoodsQuickhShare(erCodeStream, portraitStream,inviteCode,mainPic, goods); |
| | | // 上传位置 |
| | | String uuid = UUID.randomUUID().toString().replace("-", ""); |
| | | String upPath = FilePathEnum.shareGoods.getPath() + uuid + "_" + goods.getGoodsId() + "_" + System.currentTimeMillis() + ".png"; |
| | | // 上传文件 |
| | | return COSManager.getInstance().uploadInputStream(drawStream, upPath); |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public FileUploadResult drawDynamicGoodsPoster(String erCodeUrl, String portrait, String inviteCode, |
| | | String mainPic, GoodsDetailVO goods) { |
| | | // 二维码流 |
| | |
| | | import com.yeshi.fanli.exception.user.UserInfoException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.tb.TaoBaoUnionAuthRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | |
| | |
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | |
| | | @Lazy
|
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | |
|
| | | |
| | | @Lazy
|
| | | @Resource
|
| | | private IntegralDetailService integralDetailService;
|
| | | |
| | | @Lazy
|
| | | @Resource
|
| | | private UserInfoModifyRecordService userInfoModifyRecordService;
|
| | | |
| | | |
| | |
|
| | | public UserInfo getUserByLoginTypeAndOpenId(int loginType, String openid, String appid) {
|
| | | List<UserInfo> list = null;
|
| | |
| | | return UserUtil.filterForClientUser(user);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public long countInfo(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime,Integer userType, String level, Integer activeCode) {
|
| | | return userInfoMapper.countInfo(userState, key, keyType, userRank, days, startTime, endTime,userType, level, activeCode);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserInfoVO> queryInfo(long start, int count, Integer userState, String key, Integer keyType,
|
| | | String userRank, Integer days, String startTime, String endTime, Integer userType, String level, Integer activeCode) {
|
| | |
|
| | | List<UserInfoVO> userList = userInfoMapper.queryInfo(start, count, userState, key, keyType, userRank, days,
|
| | | startTime, endTime, userType, level, activeCode);
|
| | |
|
| | | if (userList == null || userList.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | for (UserInfoVO userInfoVO : userList) {
|
| | | Long uid = userInfoVO.getId();
|
| | | String rankName = userInfoVO.getRankName();
|
| | | if (rankName == null || rankName.trim().length() == 0) {
|
| | | userInfoVO.setRankName("青铜");
|
| | | userInfoVO.setRankPicture("http://img.flqapp.com/resource/rank/rank_picture_new_1.png");
|
| | | }
|
| | |
|
| | | String userLevel = userInfoVO.getUserLevel();
|
| | | if (!StringUtil.isNullOrEmpty(userLevel)) {
|
| | | userInfoVO.setUserLevel(UserLevelUtil.getByEnumName(userLevel).getName());
|
| | | }
|
| | | // 累计提现
|
| | | userInfoVO.setTotalExtract(payInfoMapper.sumMoneyByUid(uid));
|
| | | |
| | | // 累计订单数量
|
| | | userInfoVO.setTotalOrder(commonOrderCountService.countHistoryOrderNum(uid));
|
| | | |
| | | // 累计兑换金币
|
| | | userInfoVO.setTotalGoldCoinUsed(integralDetailService.sumUseGoldCoin(uid));
|
| | | |
| | | // 邀请人
|
| | | UserInfo boss = threeSaleSerivce.getBoss(uid);
|
| | | if (boss == null) {
|
| | | userInfoVO.setBossName("");
|
| | | } else {
|
| | | userInfoVO.setBossName("上级:" + boss.getNickName());
|
| | | }
|
| | | }
|
| | |
|
| | | return userList;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public long queryCount(Integer userState, String key, Integer keyType, String userRank, Integer days,
|
| | | String startTime, String endTime,Integer userType, String level, Integer activeCode) {
|
| | |
| | | userInfoVO.setCountScanHistory(countScanHistory);
|
| | |
|
| | | // 一度队员数量
|
| | | int firstTeamCount = shareMapper.myFirstTeamCount(uid + "");
|
| | | userInfoVO.setCountLevelOne(firstTeamCount);
|
| | | //int firstTeamCount = shareMapper.myFirstTeamCount(uid + "");
|
| | | //userInfoVO.setCountLevelOne(firstTeamCount);
|
| | |
|
| | | // 二度队员数量
|
| | | int secondTeamCount = shareMapper.mySecondTeamCount(uid + "");
|
| | | userInfoVO.setCountLevelTwo(secondTeamCount);
|
| | | //int secondTeamCount = shareMapper.mySecondTeamCount(uid + "");
|
| | | //userInfoVO.setCountLevelTwo(secondTeamCount);
|
| | |
|
| | | String userLevel = userInfoVO.getUserLevel();
|
| | | if (!StringUtil.isNullOrEmpty(userLevel)) {
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.yeshi.fanli.dao.mybatis.user.cloud.UserCloudGoodsMapper;
|
| | | 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.dto.suning.SuningGoodsInfo;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.goods.CommonGoodsException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGoodsException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGoodsService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudManageService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
|
| | | import com.yeshi.fanli.util.factory.CommonGoodsFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | | import com.yeshi.fanli.util.suning.SuningApiUtil;
|
| | | import com.yeshi.fanli.util.vipshop.VipShopApiUtil;
|
| | |
|
| | | @Service
|
| | | public class UserCloudGoodsServiceImpl implements UserCloudGoodsService {
|
| | |
|
| | | @Resource
|
| | | private UserCloudGoodsMapper userCloudGoodsMapper;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private JDGoodsCacheUtil jdGoodsCacheUtil;
|
| | |
|
| | | @Resource
|
| | | private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
|
| | |
|
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudManageService userCloudManageService;
|
| | |
|
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | |
|
| | | @Override
|
| | | public void deleteByPrimaryKeyAndUid(Long id, Long uid) {
|
| | | userCloudGoodsMapper.deleteByPrimaryKeyAndUid(id, uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserCloudGoods selectByPrimaryKey(Long id) {
|
| | | return userCloudGoodsMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateByPrimaryKeySelective(UserCloudGoods record) {
|
| | | userCloudGoodsMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserCloudGoods> query(int page, int pageSize, String key) {
|
| | | return userCloudGoodsMapper.query((page - 1) * pageSize, pageSize, key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long count(String key) {
|
| | | return userCloudGoodsMapper.count(key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserCloudGoods> listByUid(long start, int count, Long uid) {
|
| | | return userCloudGoodsMapper.listByUid(start, count, uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<UserCloudGoods> listByNotShare(Long uid) {
|
| | | return userCloudGoodsMapper.listByNotShare(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByUid(Long uid) {
|
| | | return userCloudGoodsMapper.countByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserCloudGoods getByUidAndGoods(Long uid, Long goodsId, Integer goodsType) {
|
| | | return userCloudGoodsMapper.getByUidAndGoods(uid, goodsId, goodsType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserCloudGoods addGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudGoodsException {
|
| | | if (uid == null)
|
| | | throw new UserCloudGoodsException(1, "用户尚未登录");
|
| | | if (goodsId == null || goodsType == null)
|
| | | throw new UserCloudGoodsException(1, "系统参数不正确");
|
| | | |
| | | CommonGoods commonGoods = null;
|
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { // 淘宝
|
| | | try {
|
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId);
|
| | | commonGoods = CommonGoodsFactory.create(goodsBrief);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | throw new UserCloudGoodsException(1, goodsId + "商品已下架");
|
| | | }
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { // 京东
|
| | | JDGoods goods = jdGoodsCacheUtil.getGoodsInfo(goodsId);
|
| | | if (goods == null)
|
| | | throw new UserCloudGoodsException(1, goodsId + "未找到商品信息");
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { // 拼多多
|
| | | PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId);
|
| | | if (goods == null)
|
| | | throw new UserCloudGoodsException(1, goodsId + "未找到商品信息");
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_VIP) { // 唯品会
|
| | | VIPGoodsInfo goods = VipShopApiUtil.getGoodsDetail(goodsId +"");
|
| | | if (goods == null)
|
| | | throw new UserCloudGoodsException(1, goodsId + "未找到商品信息");
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_SUNING) { // 苏宁
|
| | | SuningGoodsInfo goods = SuningApiUtil.getGoodsDetail(goodsId +"", sellerId + "");
|
| | | if (goods == null)
|
| | | throw new UserCloudGoodsException(1, goodsId + "未找到商品信息");
|
| | | commonGoods = CommonGoodsFactory.create(goods);
|
| | | }
|
| | |
|
| | | if (commonGoods == null) {
|
| | | LogHelper.test("云发单未找到商品详情,id=" + goodsId + "type=" + goodsType);
|
| | | throw new UserCloudGoodsException(1, "商品信息获取失败");
|
| | | }
|
| | |
|
| | | try {
|
| | | commonGoodsService.addOrUpdateCommonGoods(commonGoods);
|
| | | } catch (CommonGoodsException e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new UserCloudGoodsException(1, "商品信息更新失败");
|
| | | }
|
| | | |
| | | UserCloudGoods result = null;
|
| | | UserCloudGoods cloudGoods = userCloudGoodsMapper.getByUidAndCommonGoodsId(uid, commonGoods.getId());
|
| | | if (cloudGoods != null) {
|
| | | result = cloudGoods;
|
| | | |
| | | UserCloudGoods update = new UserCloudGoods();
|
| | | update.setId(cloudGoods.getId());
|
| | | update.setState(UserCloudGoods.STATE_NORMAL);
|
| | | update.setUpdateTime(new Date());
|
| | | userCloudGoodsMapper.updateByPrimaryKeySelective(update);
|
| | | } else {
|
| | | cloudGoods = new UserCloudGoods();
|
| | | cloudGoods.setUid(uid);
|
| | | cloudGoods.setState(UserCloudGoods.STATE_NORMAL);
|
| | | cloudGoods.setCommonGoods(commonGoods);
|
| | | cloudGoods.setCreateTime(new Date());
|
| | | cloudGoods.setUpdateTime(new Date());
|
| | | userCloudGoodsMapper.insertSelective(cloudGoods);
|
| | | |
| | | result = cloudGoods;
|
| | | }
|
| | | return result;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void sendGoodsMQMsg(Long uid) {
|
| | | if (Constant.IS_TEST) {
|
| | | return;
|
| | | }
|
| | |
|
| | | List<UserCloudGoods> list = userCloudGoodsMapper.listByNotShare(uid);
|
| | | if (list == null || list.size() == 0) {
|
| | | return;
|
| | | }
|
| | |
|
| | | long deliverTime = java.lang.System.currentTimeMillis();
|
| | | for (UserCloudGoods cloudGoods : list) {
|
| | | UserCloudMQMsg msg = new UserCloudMQMsg(uid, cloudGoods.getId() + "", UserCloudMQMsg.TYPE_STORE);
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.userCloud, msg);
|
| | | message.setStartDeliverTime(deliverTime);
|
| | | producer.send(message);
|
| | | // 每5分钟查询一次
|
| | | deliverTime = deliverTime + 1000 * 60 * 5;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.cloud.UserCloudGroupMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGroupException;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGroupService;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | |
|
| | |
|
| | | @Service
|
| | | public class UserCloudGroupServiceImpl implements UserCloudGroupService {
|
| | |
|
| | | @Resource
|
| | | private UserCloudGroupMapper userCloudGroupMapper;
|
| | |
|
| | | |
| | | @Override
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | public void addCircle(Long uid) {
|
| | | List<UserCloudGroup> list = userCloudGroupMapper.listByUidAndType(uid, UserCloudGroup.TYPE_CIRCLE);
|
| | | if (list != null && list.size() > 0)
|
| | | return;
|
| | | |
| | | UserCloudGroup cloudGroup = new UserCloudGroup();
|
| | | cloudGroup.setUid(uid);
|
| | | cloudGroup.setType(UserCloudGroup.TYPE_CIRCLE);
|
| | | cloudGroup.setState(false);
|
| | | cloudGroup.setCreateTime(new Date());
|
| | | userCloudGroupMapper.insertSelective(cloudGroup);
|
| | | }
|
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | public void addGroup(Long uid, String groupId, String groupName, int maxNum){
|
| | | List<UserCloudGroup> list = userCloudGroupMapper.listByUidAndType(uid, UserCloudGroup.TYPE_GROUP);
|
| | | if (list != null && list.size() > maxNum)
|
| | | return;
|
| | | |
| | | boolean exist = false;
|
| | | for (UserCloudGroup userCloudGroup: list) {
|
| | | if (groupId.equals(userCloudGroup.getGroupId())) {
|
| | | exist = true;
|
| | | // 群名字变化
|
| | | if (!groupName.equals(userCloudGroup.getGroupName())) {
|
| | | UserCloudGroup update = new UserCloudGroup();
|
| | | update.setGroupName(groupName);
|
| | | update.setUpdateTime(new Date());
|
| | | userCloudGroupMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | break;
|
| | | } |
| | | }
|
| | | |
| | | if (exist) |
| | | return;
|
| | | |
| | | UserCloudGroup cloudGroup = new UserCloudGroup();
|
| | | cloudGroup.setUid(uid);
|
| | | cloudGroup.setType(UserCloudGroup.TYPE_GROUP);
|
| | | cloudGroup.setState(false);
|
| | | cloudGroup.setCreateTime(new Date());
|
| | | cloudGroup.setGroupId(groupId);
|
| | | cloudGroup.setGroupName(groupName);
|
| | | userCloudGroupMapper.insertSelective(cloudGroup);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void switchCircleState(long uid, boolean state) throws UserCloudGroupException{
|
| | | List<UserCloudGroup> list = userCloudGroupMapper.listByUidAndType(uid, UserCloudGroup.TYPE_CIRCLE);
|
| | | if (list == null || list.size() == 0)
|
| | | throw new UserCloudGroupException(1, "该记录已不存在");
|
| | | |
| | | if (list.get(0).getUid() != uid)
|
| | | throw new UserCloudGroupException(1, "该记录已不存在");
|
| | | |
| | | UserCloudGroup update = new UserCloudGroup();
|
| | | update.setId(list.get(0).getId());
|
| | | update.setState(state);
|
| | | update.setUpdateTime(new Date());
|
| | | userCloudGroupMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void switchGroupState(long uid, long id, boolean state) throws UserCloudGroupException{
|
| | | UserCloudGroup cloudGroup = userCloudGroupMapper.selectByPrimaryKey(id);
|
| | | if (cloudGroup == null || cloudGroup.getUid() != uid)
|
| | | throw new UserCloudGroupException(1, "该记录已不存在");
|
| | | |
| | | UserCloudGroup update = new UserCloudGroup();
|
| | | update.setId(id);
|
| | | update.setState(state);
|
| | | update.setUpdateTime(new Date());
|
| | | userCloudGroupMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public void deleteGroupByUid(Long uid){
|
| | | userCloudGroupMapper.deleteGroupByUid(uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<UserCloudGroup> listByUid(Long uid) {
|
| | | return userCloudGroupMapper.listByUid(uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<UserCloudGroup> listGroupByUid(Long uid) {
|
| | | return userCloudGroupMapper.listGroupByUid(uid);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.cloud.UserCloudManageMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGoodsService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudManageService;
|
| | |
|
| | |
|
| | | @Service
|
| | | public class UserCloudManageServiceImpl implements UserCloudManageService {
|
| | |
|
| | | @Resource
|
| | | private UserCloudManageMapper userCloudManageMapper;
|
| | | |
| | | @Lazy
|
| | | @Resource
|
| | | private UserCloudGoodsService userCloudGoodsService;
|
| | | |
| | | @Override
|
| | | public void save(Long uid, Boolean official, Boolean custom) {
|
| | | if (uid == null) |
| | | return;
|
| | | |
| | | boolean send = false;
|
| | | UserCloudManage cloudManage = userCloudManageMapper.selectByPrimaryKey(uid);
|
| | | if (cloudManage != null) {
|
| | | UserCloudManage update = new UserCloudManage();
|
| | | if (official != null)
|
| | | update.setOfficial(official);
|
| | | if (custom != null) {
|
| | | update.setCustom(custom); |
| | | send = custom;
|
| | | }
|
| | | update.setId(uid);
|
| | | update.setUpdateTime(new Date());
|
| | | userCloudManageMapper.updateByPrimaryKeySelective(update);
|
| | | } else {
|
| | | if (official == null)
|
| | | official = false;
|
| | | if (custom == null)
|
| | | custom = true;
|
| | | UserCloudManage manage = new UserCloudManage();
|
| | | manage.setId(uid);
|
| | | manage.setCustom(custom); |
| | | manage.setOfficial(official);
|
| | | manage.setCreateTime(new Date());
|
| | | userCloudManageMapper.insertSelective(manage);
|
| | | |
| | | send = manage.getCustom();
|
| | | }
|
| | | |
| | | if (send) {
|
| | | userCloudGoodsService.sendGoodsMQMsg(uid);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public UserCloudManage selectByPrimaryKey(Long uid) {
|
| | | return userCloudManageMapper.selectByPrimaryKey(uid);
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.cloud;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.cloud.UserCloudOrderMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.CloudOrderMenuEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudOrderException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | |
|
| | |
|
| | | @Service
|
| | | public class UserCloudOrderServiceImpl implements UserCloudOrderService {
|
| | |
|
| | | @Resource
|
| | | private UserCloudOrderMapper userCloudOrderMapper;
|
| | |
|
| | | @Lazy
|
| | | @Resource
|
| | | private UserCloudService userCloudService;
|
| | | |
| | | @Override
|
| | | public UserCloudOrder addCloudOrder(Long uid, String type) throws UserCloudOrderException{
|
| | | if (uid == null) |
| | | throw new UserCloudOrderException(1, "用户未登录");
|
| | | |
| | | CloudOrderMenuEnum menuEnum = CloudOrderMenuEnum.getMenuEnum(type);
|
| | | if (menuEnum == null) |
| | | throw new UserCloudOrderException(1, "请选择正确套餐");
|
| | | |
| | | UserCloudOrder cloudOrder = new UserCloudOrder();
|
| | | cloudOrder.setUid(uid);
|
| | | cloudOrder.setState(false);
|
| | | cloudOrder.setType(menuEnum);
|
| | | cloudOrder.setMoney(BigDecimal.valueOf(menuEnum.getMoney()));
|
| | | cloudOrder.setCreateTime(new Date());
|
| | | cloudOrder.setUpdateTime(new Date());
|
| | | userCloudOrderMapper.insertSelective(cloudOrder);
|
| | | return cloudOrder;
|
| | | }
|
| | | |
| | | @Override
|
| | | public void updateByPrimaryKeySelective(UserCloudOrder cloudOrder) {
|
| | | userCloudOrderMapper.updateByPrimaryKeySelective(cloudOrder);
|
| | | }
|
| | | |
| | | @Override
|
| | | public UserCloudOrder selectByPrimaryKey(Long id) {
|
| | | return userCloudOrderMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void cloudPayCloudSuccess(Long orderId) throws UserCloudOrderException{
|
| | | UserCloudOrder cloudOrder = userCloudOrderMapper.selectForUpdate(orderId);
|
| | | if (cloudOrder == null)
|
| | | throw new UserCloudOrderException(1, "订单信息不存在");
|
| | | |
| | | if (cloudOrder.getState()) |
| | | return; // 已支付成功更新
|
| | | |
| | | UserCloudOrder updateOrder = new UserCloudOrder();
|
| | | updateOrder.setState(true);
|
| | | updateOrder.setId(cloudOrder.getId());
|
| | | updateOrder.setUpdateTime(new Date());
|
| | | userCloudOrderMapper.updateByPrimaryKeySelective(updateOrder);
|
| | | |
| | | // 创建开通信息
|
| | | try {
|
| | | userCloudService.openCloud(cloudOrder.getUid(), cloudOrder.getId(), cloudOrder.getType());
|
| | | } catch (Exception e) {
|
| | | LogHelper.error(e);
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public UserCloudOrder getLastOrderByUnpaid(Long uid, String type) {
|
| | | return userCloudOrderMapper.getLastOrderByUnpaid(uid, type);
|
| | | }
|
| | | |
| | | @Override
|
| | | public UserCloudOrder getLastOrderByPayEnd(Long uid, String type) {
|
| | | return userCloudOrderMapper.getLastOrderByPayEnd(uid, type);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<UserCloudOrder> getOrderRecord(int page, int count, Long uid, Integer state) {
|
| | | return userCloudOrderMapper.getOrderRecord((page-1)* count, count, uid, state);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countOrderRecord(Long uid, Integer state) {
|
| | | Long count = userCloudOrderMapper.countOrderRecord(uid, state);
|
| | | if (count == null)
|
| | | count = 0L;
|
| | | return count;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<UserCloudOrder> getLasthourByUnpaid() {
|
| | | return userCloudOrderMapper.getLasthourByUnpaid();
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<UserCloudOrder> query(int page, int count,String key, Integer state) {
|
| | | return userCloudOrderMapper.query((page-1)* count, count, key, state);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long count(String key, Integer state) {
|
| | | Long count = userCloudOrderMapper.count(key, state);
|
| | | if (count == null)
|
| | | count = 0L;
|
| | | return count;
|
| | | }
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.cloud;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.cloud.UserCloudSendContentDao;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendContent;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudSendContentService;
|
| | |
|
| | | @Service
|
| | | public class UserCloudSendContentServiceImpl implements UserCloudSendContentService {
|
| | |
|
| | | |
| | | @Resource
|
| | | private UserCloudSendContentDao userCloudSendContentDao;
|
| | |
|
| | | |
| | | @Override
|
| | | public UserCloudSendContent save(UserCloudSendContent record){
|
| | | return userCloudSendContentDao.save(record);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<UserCloudSendContent> getByPid(String pid){
|
| | | return userCloudSendContentDao.getByPid(pid);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.cloud.UserCloudSendRecordDao;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendRecord;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudSendRecordService;
|
| | |
|
| | | @Service
|
| | | public class UserCloudSendRecordServiceImpl implements UserCloudSendRecordService {
|
| | |
|
| | | @Resource
|
| | | private UserCloudSendRecordDao userCloudSendRecordDao;
|
| | | |
| | | |
| | | @Override
|
| | | 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; |
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<UserCloudSendRecord> query (int page , int count, String key, Integer sendOrigin){
|
| | | return userCloudSendRecordDao.query((page-1) * count, count, key, sendOrigin);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long count (String key, Integer sendOrigin){
|
| | | return userCloudSendRecordDao.count(key, sendOrigin);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.cloud;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | 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.dto.suning.SuningGoodsImg;
|
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo;
|
| | | import com.yeshi.fanli.dto.vip.VIPConvertResultDTO;
|
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.CloudOrderMenuEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloud;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods;
|
| | | 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.UserCloudSendContent;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendRecord;
|
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate.EvaluateEnum;
|
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException;
|
| | | import com.yeshi.fanli.exception.share.ShareGoodsException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudException;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGoodsException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.goods.CommonGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService;
|
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsTextTemplateService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderHongBaoMoneyComputeService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.user.QrCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGoodsService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGroupService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudManageService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudSendContentService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudSendRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.ImageToBase64;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.aitaoker.AitaokerApiUtil;
|
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.cache.PinDuoDuoCacheUtil;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | 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.suning.SuningApiUtil;
|
| | | import com.yeshi.fanli.util.suning.SuningUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.vipshop.VipShopApiUtil;
|
| | | import com.yeshi.fanli.util.vipshop.VipShopUtil;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | |
|
| | | @Service
|
| | | public class UserCloudServiceImpl implements UserCloudService {
|
| | |
|
| | | @Resource
|
| | | private UserCloudMapper userCloudMapper;
|
| | |
|
| | | @Resource
|
| | | private UserCloudGroupService userCloudGroupService;
|
| | |
|
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | |
|
| | | @Resource
|
| | | private ConvertLinkManager convertLinkManager;
|
| | | |
| | | @Resource
|
| | | private UserCloudGoodsService userCloudGoodsService;
|
| | | |
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | | |
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | | |
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | | |
| | | @Resource
|
| | | private ShareGoodsService shareGoodsService;
|
| | | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | | @Resource
|
| | | private JDGoodsCacheUtil jdGoodsCacheUtil;
|
| | | |
| | | @Resource
|
| | | private PinDuoDuoCacheUtil pinDuoDuoCacheUtil;
|
| | | |
| | | @Resource
|
| | | private QrCodeService qrCodeService;
|
| | | |
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | |
| | | @Resource
|
| | | private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
|
| | | |
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | | |
| | | @Resource
|
| | | private ShareGoodsTextTemplateService shareGoodsTextTemplateService;
|
| | | |
| | | @Resource
|
| | | private CommonGoodsService commonGoodsService;
|
| | | |
| | | @Resource
|
| | | private UserCloudSendRecordService userCloudSendRecordService;
|
| | | |
| | | @Resource
|
| | | private UserCloudSendContentService userCloudSendContentService;
|
| | | |
| | | @Resource
|
| | | private UserCloudManageService userCloudManageService;
|
| | | |
| | | @Resource(name = "producer")
|
| | | private Producer producer;
|
| | | |
| | | |
| | | @Override
|
| | | public UserCloud getValidByUid(Long uid) {
|
| | | return userCloudMapper.getValidByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserCloud getLastByUid(Long uid) {
|
| | | return userCloudMapper.getLastByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countByUid(Long uid) {
|
| | | Long count = userCloudMapper.countByUid(uid);
|
| | | return count;
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<UserCloud> query(int page, int count,String key, Integer state) {
|
| | | return userCloudMapper.query((page-1)* count, count, key, state);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long count(String key, Integer state) {
|
| | | Long count = userCloudMapper.count(key, state);
|
| | | if (count == null)
|
| | | count = 0L;
|
| | | return count;
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void updateWXInfo(Long uid, String wxId, String wxName, String wxPortrait) throws UserCloudException {
|
| | | UserCloud userCloud = userCloudMapper.getValidByUid(uid);
|
| | | if (userCloud == null)
|
| | | throw new UserCloudException(1, "云发单已过期");
|
| | |
|
| | | // 更新信息
|
| | | UserCloud update = new UserCloud();
|
| | | update.setId(userCloud.getId());
|
| | | update.setWxId(wxId);
|
| | | update.setWxName(wxName);
|
| | | update.setWxPortrait(wxPortrait);
|
| | | userCloudMapper.updateByPrimaryKeySelective(update);
|
| | |
|
| | | // 微信号变化-清空群信息
|
| | | if (!wxId.equals(userCloud.getWxId())) {
|
| | | userCloudGroupService.deleteGroupByUid(uid);
|
| | | }
|
| | |
|
| | | // 加入朋友圈
|
| | | if (StringUtil.isNullOrEmpty(userCloud.getWxId())) {
|
| | | userCloudGroupService.addCircle(uid);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void openCloud(Long uid, Long orderId, CloudOrderMenuEnum menuEnum) throws UserCloudException {
|
| | | UserCloud existCloud = userCloudMapper.getByOrderId(orderId);
|
| | | if (existCloud != null) {
|
| | | return; // 该订单已处理完成
|
| | | }
|
| | |
|
| | | boolean renew = false;
|
| | | UserCloud userCloud = userCloudMapper.getLastByUid(uid);
|
| | | if (userCloud != null) {
|
| | | // 续费
|
| | | if (userCloud.getEndTime().getTime() > java.lang.System.currentTimeMillis())
|
| | | renew = true;
|
| | | // 验证套餐是否相同
|
| | | if (renew && userCloud.getRobotType() != menuEnum.getType()) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]已有其他云发单套餐还未结束");
|
| | | throw new UserCloudException(1, "已有其他云发单套餐还未结束");
|
| | | }
|
| | | }
|
| | |
|
| | | RobotInfoDTO dto = null;
|
| | | if (renew) { // 续费
|
| | | dto = AitaokerApiUtil.robotRenewals(userCloud.getRobotId(), menuEnum.getMonth());
|
| | | } else {
|
| | | dto = AitaokerApiUtil.robotCreate(menuEnum.getMonth(), menuEnum.getType(), "wechatrobot", null);
|
| | | }
|
| | |
|
| | | if (dto == null) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回空值");
|
| | | throw new UserCloudException(1, "机器人获取失败");
|
| | | }
|
| | |
|
| | | String endTimeStr = dto.getEndTime();
|
| | | if (StringUtil.isNullOrEmpty(endTimeStr)) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回时间为空");
|
| | | throw new UserCloudException(1, "机器人返回时间为空");
|
| | | }
|
| | |
|
| | | long endTime = 0;
|
| | | try {
|
| | | endTime = Long.parseLong(endTimeStr);
|
| | | } catch (Exception e) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 返回时间格式不正确");
|
| | | throw new UserCloudException(1, "机器人返回时间格式不正确");
|
| | | }
|
| | |
|
| | | Integer robotId = dto.getId();
|
| | | if (robotId == null) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: 机器人ID返回为空");
|
| | | throw new UserCloudException(1, "机器人ID返回为空");
|
| | | }
|
| | |
|
| | | Integer groupNum = dto.getGroupNum();
|
| | | if (groupNum == null) {
|
| | | LogHelper.cloudInfo("方法openCloud: [uid=" + uid + "][订单ID=" + orderId + "]机器人失败: groupNum返回为空");
|
| | | throw new UserCloudException(1, "groupNum返回为空");
|
| | | }
|
| | |
|
| | | UserCloud newCloud = new UserCloud();
|
| | | newCloud.setUid(uid);
|
| | | newCloud.setOrderId(orderId);
|
| | | newCloud.setGroupNum(groupNum);
|
| | | newCloud.setRobotId(robotId);
|
| | | newCloud.setRobotType(menuEnum.getType());
|
| | | if (renew) {
|
| | | newCloud.setStartTime(userCloud.getStartTime());
|
| | | } else {
|
| | | newCloud.setStartTime(new Date());
|
| | | }
|
| | | newCloud.setEndTime(new Date(endTime * 1000)); // Unix 转换 普通时间
|
| | | newCloud.setCreateTime(new Date());
|
| | | userCloudMapper.insertSelective(newCloud);
|
| | | |
| | | // 开启发圈功能
|
| | | userCloudManageService.save(uid, null, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void searchGroup(Long uid) throws UserCloudException {
|
| | | UserCloud userCloud = userCloudMapper.getValidByUid(uid);
|
| | | if (userCloud == null)
|
| | | throw new UserCloudException(1, "云发单已过期");
|
| | |
|
| | | Integer robotId = userCloud.getRobotId();
|
| | | if (robotId == null)
|
| | | throw new UserCloudException(1, "云发单机器人不存在");
|
| | |
|
| | | List<WeiXinGroupDTO> list = AitaokerApiUtil.getContract(robotId);
|
| | | if (list == null || list.size() == 0)
|
| | | throw new UserCloudException(1, "未检索到对应群");
|
| | |
|
| | | for (WeiXinGroupDTO dto : list) {
|
| | | userCloudGroupService.addGroup(uid, dto.getGroupId(), dto.getGroupName(), userCloud.getGroupNum());
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public void sendByDynamic(Long uid, String id) throws UserCloudException{
|
| | | sendCircleByDynamic(uid, id, UserCloudSendRecord.SEND_WAY_MANUAL);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void autoSendByDynamic(Long uid, String id) {
|
| | | boolean official = false;
|
| | | UserCloudManage cloudManage = userCloudManageService.selectByPrimaryKey(uid);
|
| | | if (cloudManage != null) {
|
| | | if (cloudManage.getOfficial() != null)
|
| | | official = cloudManage.getOfficial();
|
| | | }
|
| | | |
| | | if (!official)
|
| | | return;
|
| | | |
| | | try {
|
| | | sendCircleByDynamic(uid, id, UserCloudSendRecord.SEND_WAY_AUTO);
|
| | | } catch (UserCloudException e) {
|
| | | LogHelper.cloudInfo("autoSendByDynamic - [uid:" +uid + " 动态id:"+ id + "]原因:"+ e.getMsg());
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | private void sendCircleByDynamic(Long uid, String id, int way) throws UserCloudException {
|
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
|
| | | if (user == null)
|
| | | throw new UserCloudException(1, "用户信息不存在");
|
| | |
|
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
|
| | | throw new UserCloudException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | | |
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode))
|
| | | throw new UserCloudException(3, "邀请码未激活");
|
| | |
|
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | String relationId = null;
|
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
|
| | | && taoBaoInfo.getRelationValid() == true)
|
| | | relationId = taoBaoInfo.getRelationId();
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | throw new UserCloudException(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号");
|
| | | |
| | | |
| | | // 验证是否开通
|
| | | UserCloud userCloud = userCloudMapper.getValidByUid(uid);
|
| | | if (userCloud == null)
|
| | | throw new UserCloudException(1001, "云发单已过期");
|
| | |
|
| | | Integer robotId = userCloud.getRobotId();
|
| | | if (robotId == null)
|
| | | throw new UserCloudException(1002, "云发单机器人不存在");
|
| | |
|
| | | String wxId = userCloud.getWxId();
|
| | | if (StringUtil.isNullOrEmpty(wxId)) |
| | | throw new UserCloudException(1003, "微信号不存在,请先微信登录");
|
| | | |
| | | // 验证开启状态
|
| | | List<UserCloudGroup> listGroup = userCloudGroupService.listByUid(uid);
|
| | | if (listGroup == null || listGroup.size() == 0)
|
| | | throw new UserCloudException(1004, "请先微信登录");
|
| | |
|
| | | List<UserCloudGroup> listOpen = new ArrayList<>();
|
| | | for (UserCloudGroup cloudGrou : listGroup) {
|
| | | if (cloudGrou.getState()) {
|
| | | listOpen.add(cloudGrou);
|
| | | }
|
| | | }
|
| | | if (listOpen.size() == 0)
|
| | | throw new UserCloudException(1005, "请先开启云发单群功能");
|
| | | |
| | | |
| | | // 验证发圈是否可行
|
| | | GoodsEvaluate evaluate = goodsEvaluateService.getById(id);
|
| | | if (evaluate == null || evaluate.getState() == 0)
|
| | | throw new UserCloudException(1, "该内容已下架");
|
| | |
|
| | | if (evaluate.getType() != EvaluateEnum.single && evaluate.getType() != EvaluateEnum.activity)
|
| | | throw new UserCloudException(1, "该内容不支持云发单");
|
| | |
|
| | | // 验证是否可转链
|
| | | List<CommentInfo> comments = evaluate.getComments();
|
| | | if (comments == null || comments.size() == 0)
|
| | | throw new UserCloudException(1, "该内容不能转链");
|
| | |
|
| | | // 检测微信是否登录状态
|
| | | if (!AitaokerApiUtil.onlineCheck(robotId)) {
|
| | | throw new UserCloudException(1003, "请重新登录微信");
|
| | | }
|
| | | |
| | | |
| | | boolean hasToken = false;
|
| | | List<String> listComment = new ArrayList<>();
|
| | | for (CommentInfo commentInfo : comments) {
|
| | | String comment = null;
|
| | | try {
|
| | | comment = convertLinkManager.convertLinkFromText(commentInfo.getContent(), uid, true);
|
| | | hasToken = true;
|
| | | } catch (ConvertLinkExceptionException e) {
|
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) {
|
| | | throw new UserCloudException(1, e.getMsg());
|
| | | }
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new UserCloudException(1, "该内容包含可转链口令或链接");
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(comment))
|
| | | comment = commentInfo.getContent();
|
| | |
|
| | | // 替换价格
|
| | | if (evaluate.getType() == EvaluateEnum.single) {
|
| | | GoodsDetailVO goods = evaluate.getGoods();
|
| | | comment = comment.replace("[原价]", MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()) + "");
|
| | | if (!goods.isHasCoupon()) {
|
| | | comment = comment.replace("领券抢购", "抢购");
|
| | | comment = comment.replace("【券后价】[券后价]元", "");
|
| | | } else {
|
| | | comment = comment.replace("[券后价]", MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()) + "");
|
| | | }
|
| | | comment = comment.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n");
|
| | | }
|
| | | |
| | | listComment.add(comment);
|
| | | }
|
| | |
|
| | | if (!hasToken)
|
| | | throw new UserCloudException(1, "该内容包含可转链口令或链接");
|
| | | |
| | |
|
| | | String qrCode = null;
|
| | | String cloudPic = null;
|
| | | ImgInfo imgVideo = null;
|
| | | List<String> listImg = new ArrayList<>();
|
| | | |
| | | List<ImgInfo> imgs = evaluate.getImgList();
|
| | | if (imgs != null && imgs.size() > 0) {
|
| | | for (ImgInfo imgInfo : imgs) {
|
| | | if (imgInfo.getType() == ImgEnum.video) {
|
| | | imgVideo = imgInfo;
|
| | | continue;
|
| | | }
|
| | | |
| | | if (imgInfo.getType() == ImgEnum.goods) {
|
| | | cloudPic = imgInfo.getUrl();
|
| | | }
|
| | | listImg.add(imgInfo.getUrl());
|
| | | |
| | | // 取消二维码图
|
| | | // GoodsDetailVO goodsVO = imgInfo.getGoodsVO();
|
| | | // if (goodsVO == null) {
|
| | | // listImg.add(imgInfo.getUrl());
|
| | | // } else {
|
| | | // String jumpLink = getJumpLink(goodsVO, user, relationId, inviteCode, imgInfo.getUrl());
|
| | | // if (!StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | // qrCode = jumpLink;
|
| | | // }
|
| | | // }
|
| | | }
|
| | | |
| | | if (cloudPic == null) {
|
| | | cloudPic = imgs.get(0).getUrl();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | // 保存发送记录
|
| | | UserCloudSendRecord sendRecord = new UserCloudSendRecord();
|
| | | sendRecord.setUid(uid);
|
| | | sendRecord.setSendId(id);
|
| | | sendRecord.setSendWay(way);
|
| | | sendRecord.setWxId(wxId);
|
| | | sendRecord.setRobotId(robotId);
|
| | | sendRecord.setSendTime(new Date());
|
| | | sendRecord.setSendOrigin(UserCloudSendRecord.ORIGIN_STORE);
|
| | | UserCloudSendRecord result = userCloudSendRecordService.save(sendRecord);
|
| | | String pid = result.getId();
|
| | | |
| | | for (UserCloudGroup cloudGroup: listOpen) {
|
| | | String title = evaluate.getTitle();
|
| | | |
| | | UserCloudSendContent sendContent = new UserCloudSendContent();
|
| | | sendContent.setPid(pid);
|
| | | sendContent.setUid(uid);
|
| | | sendContent.setGroupId(cloudGroup.getGroupId());
|
| | | sendContent.setCreateTime(new Date());
|
| | | |
| | | if(cloudGroup.getType() == UserCloudGroup.TYPE_CIRCLE) { // 朋友圈
|
| | | String circleId = null;
|
| | | sendContent.setType(UserCloudSendContent.TYPE_CIRCLE);
|
| | | |
| | | if (imgVideo == null) {
|
| | | String picUrl = "";
|
| | | if (!StringUtil.isNullOrEmpty(qrCode))
|
| | | picUrl += qrCode;
|
| | | |
| | | if (listImg.size() > 0) {
|
| | | for (String img: listImg) {
|
| | | picUrl += "," + img;
|
| | | }
|
| | | }
|
| | | sendContent.setTitle(title);
|
| | | sendContent.setPicUrl(picUrl);
|
| | | // 发送图文
|
| | | circleId = AitaokerApiUtil.macsendCircle(robotId, title, picUrl);
|
| | | } else {
|
| | | sendContent.setPicUrl(imgVideo.getUrl());
|
| | | sendContent.setVideoUrl(imgVideo.getVideoUrl());
|
| | | // 发送视频
|
| | | circleId = AitaokerApiUtil.macsendCircleVideo(robotId, imgVideo.getVideoUrl(), imgVideo.getUrl());
|
| | | }
|
| | | |
| | | // 评论文本
|
| | | if (!StringUtil.isNullOrEmpty(circleId)) {
|
| | | sendContent.setState(true);
|
| | | List<String> list = new ArrayList<>();
|
| | | for (String comment: listComment) {
|
| | | boolean macsend = AitaokerApiUtil.macsendCircleComment(robotId, wxId, circleId, comment);
|
| | | if (macsend) {
|
| | | list.add(comment);
|
| | | }
|
| | | }
|
| | | sendContent.setComments(list);
|
| | | }
|
| | | } else { // 群
|
| | | sendContent.setType(UserCloudSendContent.TYPE_GROUP);
|
| | | |
| | | // 发送文本
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | boolean macsend = AitaokerApiUtil.macsendText(robotId, cloudGroup.getGroupId(), title);
|
| | | if (macsend)
|
| | | sendContent.setTitle(title);
|
| | | }
|
| | | |
| | | // 发送图片
|
| | | if (!StringUtil.isNullOrEmpty(cloudPic)) {
|
| | | try {
|
| | | String imgBase64 = ImageToBase64.NetImageToBase64(cloudPic);
|
| | | boolean macsend = AitaokerApiUtil.macsendImgBase64(robotId, cloudGroup.getGroupId(), imgBase64);
|
| | | if (macsend)
|
| | | sendContent.setPicUrl(cloudPic);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | | |
| | | // 评论文本
|
| | | List<String> list = new ArrayList<>();
|
| | | for (String comment: listComment) {
|
| | | boolean macsend = AitaokerApiUtil.macsendText(robotId, cloudGroup.getGroupId(), comment);
|
| | | if (macsend) {
|
| | | list.add(comment);
|
| | | }
|
| | | }
|
| | | sendContent.setState(true);
|
| | | sendContent.setComments(list);
|
| | | }
|
| | | userCloudSendContentService.save(sendContent);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void sendCustomGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudException{
|
| | | sendCircleByGoods(uid, goodsId, goodsType, null, sellerId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public void autoSendCustomGoods(Long uid, Long id) {
|
| | | boolean custom = false;
|
| | | UserCloudManage cloudManage = userCloudManageService.selectByPrimaryKey(uid);
|
| | | if (cloudManage != null) {
|
| | | if (cloudManage.getCustom() != null)
|
| | | custom = cloudManage.getCustom();
|
| | | }
|
| | | |
| | | if (!custom) {
|
| | | return;
|
| | | }
|
| | | |
| | | UserCloudGoods cloudGoods = userCloudGoodsService.selectByPrimaryKey(id);
|
| | | if (cloudGoods == null) {
|
| | | return;
|
| | | }
|
| | | CommonGoods cgoods = cloudGoods.getCommonGoods();
|
| | | if (cgoods == null) |
| | | return;
|
| | | |
| | | try {
|
| | | // 发送商品
|
| | | sendCircleByGoods(uid, cgoods.getGoodsId(), cgoods.getGoodsType(), id, cgoods.getSellerId());
|
| | | } catch (UserCloudException e) {
|
| | | LogHelper.cloudInfo("autoSendCustomGoods - [uid:" +uid + " 库id:"+ id + "]原因:"+ e.getMsg());
|
| | | }
|
| | | }
|
| | |
|
| | | private void sendCircleByGoods(Long uid, Long goodsId, Integer goodsType, Long storeId, Long sellerId) throws UserCloudException {
|
| | | // 验证是否授权
|
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
|
| | | if (user == null)
|
| | | throw new UserCloudException(1, "用户信息不存在");
|
| | |
|
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
|
| | | throw new UserCloudException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | | |
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode))
|
| | | throw new UserCloudException(3, "邀请码未激活");
|
| | |
|
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | String relationId = null;
|
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
|
| | | && taoBaoInfo.getRelationValid() == true)
|
| | | relationId = taoBaoInfo.getRelationId();
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | throw new UserCloudException(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号");
|
| | |
|
| | | // 验证是否开通
|
| | | UserCloud userCloud = userCloudMapper.getValidByUid(uid);
|
| | | if (userCloud == null)
|
| | | throw new UserCloudException(1001, "云发单已过期");
|
| | |
|
| | | |
| | | // 加入我的备选库
|
| | | if (storeId == null) {
|
| | | try {
|
| | | UserCloudGoods cloudGoods = userCloudGoodsService.addGoods(uid, goodsId, goodsType, sellerId);
|
| | | if (cloudGoods != null)
|
| | | storeId =cloudGoods.getId();
|
| | | } catch (UserCloudGoodsException e) {
|
| | | LogHelper.cloudInfo("sendCustomGoods - [uid:" +uid + "goodsId:"+ goodsId + "goodsType" + goodsType +"]原因:"+ e.getMsg());
|
| | | throw new UserCloudException(1, "加入云发单备选库失败");
|
| | | }
|
| | | }
|
| | | |
| | | // 自选库商品是否打开
|
| | | boolean custom = false;
|
| | | UserCloudManage cloudManage = userCloudManageService.selectByPrimaryKey(uid);
|
| | | if (cloudManage != null) {
|
| | | if (cloudManage.getCustom() != null)
|
| | | custom = cloudManage.getCustom();
|
| | | }
|
| | | if (!custom) {
|
| | | throw new UserCloudException(0, "成功加入云发单库");
|
| | | }
|
| | | |
| | | Integer robotId = userCloud.getRobotId();
|
| | | if (robotId == null)
|
| | | throw new UserCloudException(1, "云发单机器人不存在");
|
| | |
|
| | | String wxId = userCloud.getWxId();
|
| | | if (StringUtil.isNullOrEmpty(wxId)) |
| | | throw new UserCloudException(1002, "请先登录微信");
|
| | | |
| | | // 验证开启状态
|
| | | List<UserCloudGroup> listGroup = userCloudGroupService.listByUid(uid);
|
| | | if (listGroup == null || listGroup.size() == 0)
|
| | | throw new UserCloudException(1003, "请先登录微信");
|
| | |
|
| | | List<UserCloudGroup> listOpen = new ArrayList<>();
|
| | | for (UserCloudGroup cloudGrou : listGroup) {
|
| | | if (cloudGrou.getState()) {
|
| | | listOpen.add(cloudGrou);
|
| | | }
|
| | | }
|
| | | |
| | | if (listOpen.size() == 0)
|
| | | throw new UserCloudException(1004, "请先开启云发单群功能");
|
| | | |
| | | |
| | | // 检测微信是否登录状态
|
| | | if (!AitaokerApiUtil.onlineCheck(robotId)) {
|
| | | throw new UserCloudException(1003, "请重新登录微信");
|
| | | }
|
| | | |
| | | |
| | | // 保存发送记录
|
| | | UserCloudSendRecord sendRecord = new UserCloudSendRecord();
|
| | | sendRecord.setUid(uid);
|
| | | sendRecord.setGoodsId(goodsId + "");
|
| | | sendRecord.setGoodsType(goodsType + "");
|
| | | sendRecord.setWxId(wxId);
|
| | | sendRecord.setRobotId(robotId);
|
| | | sendRecord.setSendTime(new Date());
|
| | | if (storeId != null) {
|
| | | sendRecord.setSendId(storeId + "");
|
| | | sendRecord.setSendOrigin(UserCloudSendRecord.ORIGIN_STORE);
|
| | | sendRecord.setSendWay(UserCloudSendRecord.SEND_WAY_AUTO);
|
| | | } else {
|
| | | sendRecord.setSendWay(UserCloudSendRecord.SEND_WAY_MANUAL);
|
| | | }
|
| | | UserCloudSendRecord result = userCloudSendRecordService.save(sendRecord);
|
| | | |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | sendTaoBaoGoods(user, robotId, wxId, goodsId, relationId, listOpen, result.getId());
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) {
|
| | | sendJDGoods(user, robotId, wxId, goodsId, relationId, listOpen, result.getId());
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) {
|
| | | sendPDDGoods(user, robotId, wxId, goodsId, relationId, listOpen, result.getId());
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_VIP) {
|
| | | sendVIPGoods(user, robotId, wxId, goodsId, relationId, listOpen, result.getId());
|
| | | } else if (goodsType == Constant.SOURCE_TYPE_SUNING) {
|
| | | sendSuNingGoods(user, robotId, wxId, goodsId, sellerId, relationId, listOpen, result.getId());
|
| | | }
|
| | | |
| | | // 更新发单记录
|
| | | if (storeId != null) {
|
| | | UserCloudGoods record = new UserCloudGoods();
|
| | | record.setId(storeId);
|
| | | record.setState(UserCloudGoods.STATE_SHARED);
|
| | | record.setSendTime(new Date());
|
| | | record.setUpdateTime(new Date());
|
| | | userCloudGoodsService.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 淘宝商品信息处理
|
| | | * @param user
|
| | | * @param inviteCode
|
| | | * @param robotId
|
| | | * @param wxId
|
| | | * @param goodsId
|
| | | * @param relationId
|
| | | * @param listOpen
|
| | | * @throws UserCloudException
|
| | | */
|
| | | private void sendTaoBaoGoods(UserInfo user, int robotId, String wxId, Long goodsId, String relationId, |
| | | List<UserCloudGroup> listOpen, String pid) throws UserCloudException {
|
| | | TaoBaoLink taoBaoLink = null;
|
| | | try {
|
| | | taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), goodsId, relationId);
|
| | | } catch (ShareGoodsException e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | throw new UserCloudException(1, "该商品已下架");
|
| | | }
|
| | | if (taoBaoLink == null)
|
| | | throw new UserCloudException(1, "该商品已下架");
|
| | | |
| | | TaoBaoGoodsBrief goods = taoBaoLink.getGoods();
|
| | | boolean coupon = false;
|
| | | if (!StringUtil.isNullOrEmpty(goods.getCouponInfo())) {
|
| | | coupon = true;
|
| | | }
|
| | | |
| | | String quanPrice = "";
|
| | | String description = "";
|
| | | String couponAmount = "";
|
| | | if (coupon) {
|
| | | description = goods.getDescription();
|
| | | quanPrice = TaoBaoUtil.getAfterUseCouplePrice(goods) + "";
|
| | | couponAmount = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponAmount()).toString();
|
| | | }
|
| | | String sales = TaoBaoUtil.getSaleCount(goods.getBiz30day());
|
| | | |
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getTitle(), sales, |
| | | couponAmount, description);
|
| | | // 获取评论语
|
| | | String commentText = shareGoodsTextTemplateService.getCommentTextByTaoToken(coupon, taoBaoLink.getTaoToken(),
|
| | | goods.getZkPrice().toString(), quanPrice);
|
| | | |
| | | // 云发单
|
| | | sendGoods(robotId, wxId, listOpen, recommendText, commentText, goods.getImgList(), user.getId(), pid);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 京东商品云发单
|
| | | * @param user
|
| | | * @param robotId
|
| | | * @param wxId
|
| | | * @param goodsId
|
| | | * @param relationId
|
| | | * @param listOpen
|
| | | * @throws UserCloudException
|
| | | */
|
| | | private void sendJDGoods(UserInfo user, int robotId, String wxId, Long goodsId, String relationId, |
| | | List<UserCloudGroup> listOpen, String pid) throws UserCloudException {
|
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsId);
|
| | | if (jdGoods == null)
|
| | | throw new UserCloudException(1, "该商品已下架");
|
| | | |
| | | |
| | | String couponUrl = null;
|
| | | JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods);
|
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | String materialId = "https://item.jd.com/" + goodsId + ".html";
|
| | | String jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",user.getId() + "");
|
| | | |
| | | boolean coupon = false;
|
| | | if (couponInfo != null) {
|
| | | coupon = true;
|
| | | }
|
| | | |
| | | String quanPrice = "";
|
| | | String couponAmount = "";
|
| | | if (coupon) {
|
| | | quanPrice = BigDecimalUtil.getWithNoZera(JDUtil.getQuanPrice(jdGoods)).toString() + "";
|
| | | couponAmount = BigDecimalUtil.getWithNoZera(couponInfo.getDiscount()).toString();
|
| | | }
|
| | | |
| | | String sales = JDUtil.getSaleCount(jdGoods.getInOrderCount30Days());
|
| | | |
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, jdGoods.getSkuName(), sales, |
| | | couponAmount, null);
|
| | | |
| | | // 获取评论语
|
| | | BigDecimal price = jdGoods.getPrice();
|
| | | JDPingouInfo pinGouInfo = jdGoods.getPinGouInfo();
|
| | | if (pinGouInfo != null) {
|
| | | price = pinGouInfo.getPingouPrice();
|
| | | }
|
| | | String zkPrice = BigDecimalUtil.getWithNoZera(price).toString();
|
| | | String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink, zkPrice, quanPrice, |
| | | ConfigKeyEnum.quickShareJDCommentText);
|
| | | |
| | | // 云发单
|
| | | sendGoods(robotId, wxId, listOpen, recommendText, commentText, jdGoods.getImageList(), user.getId(), pid);
|
| | | }
|
| | | |
| | | /**
|
| | | * 京东商品云发单
|
| | | * @param user
|
| | | * @param robotId
|
| | | * @param wxId
|
| | | * @param goodsId
|
| | | * @param relationId
|
| | | * @param listOpen
|
| | | * @throws UserCloudException
|
| | | */
|
| | | private void sendPDDGoods(UserInfo user, int robotId, String wxId, Long goodsId, String relationId, |
| | | List<UserCloudGroup> listOpen, String pid) throws UserCloudException {
|
| | | PDDGoodsDetail goods = pinDuoDuoCacheUtil.getGoodsInfo(goodsId);
|
| | | if (goods == null)
|
| | | throw new UserCloudException(1, "该商品已下架");
|
| | | |
| | | String jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsId, PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + "");
|
| | | |
| | | boolean coupon = true;
|
| | | if (goods.getHasCoupon() == null || !goods.getHasCoupon()) {
|
| | | coupon = false;
|
| | | }
|
| | | |
| | | String quanPrice = "";
|
| | | String couponAmount = "";
|
| | | if (coupon) {
|
| | | BigDecimal hundred = new BigDecimal(100);
|
| | | BigDecimal amount = MoneyBigDecimalUtil.div(new BigDecimal(goods.getCouponDiscount()), hundred);
|
| | | quanPrice = BigDecimalUtil.getWithNoZera(amount).toString();
|
| | | couponAmount = BigDecimalUtil.getWithNoZera(PinDuoDuoUtil.getQuanPrice(goods)).toString();
|
| | | }
|
| | | |
| | | String sales = goods.getSalesTip();
|
| | | if (StringUtil.isNullOrEmpty(sales)) {
|
| | | sales = "0";
|
| | | }
|
| | | |
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getGoodsName(), sales, |
| | | couponAmount, null);
|
| | | |
| | | // 获取评论语
|
| | | String zkPrice = MoneyBigDecimalUtil.div(new BigDecimal(goods.getMinGroupPrice()), new BigDecimal(100)).setScale(2).toString();
|
| | | String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink, zkPrice, quanPrice, |
| | | ConfigKeyEnum.quickSharePDDCommentText);
|
| | | |
| | | List<String> list = null;
|
| | | String[] goodsGalleryUrls = goods.getGoodsGalleryUrls();
|
| | | if (goodsGalleryUrls != null && goodsGalleryUrls.length > 0) {
|
| | | list = Arrays.asList(goodsGalleryUrls);
|
| | | }
|
| | | // 云发单
|
| | | sendGoods(robotId, wxId, listOpen, recommendText, commentText, list, user.getId(), pid );
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 唯品会商品
|
| | | * @param user
|
| | | * @param robotId
|
| | | * @param wxId
|
| | | * @param goodsId
|
| | | * @param relationId
|
| | | * @param listOpen
|
| | | * @param pid
|
| | | * @throws UserCloudException
|
| | | */
|
| | | private void sendVIPGoods(UserInfo user, int robotId, String wxId, Long goodsId, String relationId, |
| | | List<UserCloudGroup> listOpen, String pid) throws UserCloudException {
|
| | | VIPGoodsInfo goods = VipShopApiUtil.getGoodsDetail(goodsId + "");
|
| | | if (goods == null)
|
| | | throw new UserCloudException(1, "该商品已下架");
|
| | |
|
| | | VIPConvertResultDTO resultDTO = VipShopApiUtil.convertLink(goodsId + "", VipShopUtil.getShareChanTag(user.getId()));
|
| | | String jumpLink = resultDTO.getUrl();
|
| | | |
| | | boolean coupon = false;
|
| | | String quanPrice = "";
|
| | | String couponAmount = "";
|
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getGoodsName(), null,
|
| | | couponAmount, null);
|
| | | // 获取评论语
|
| | | String commentText = shareGoodsTextTemplateService.getCommentTextByLink(coupon, jumpLink, goods.getMarketPrice(), |
| | | quanPrice, ConfigKeyEnum.quickShareVIPCommentText);
|
| | | |
| | | // 云发单
|
| | | sendGoods(robotId, wxId, listOpen, recommendText, commentText, goods.getGoodsDetailPictures(), user.getId(), pid);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 京东商品云发单
|
| | | * @param user
|
| | | * @param robotId
|
| | | * @param wxId
|
| | | * @param goodsId
|
| | | * @param relationId
|
| | | * @param listOpen
|
| | | * @throws UserCloudException
|
| | | */
|
| | | private void sendSuNingGoods(UserInfo user, int robotId, String wxId, Long goodsId, Long sellerId, String relationId, |
| | | List<UserCloudGroup> listOpen, String pid) throws UserCloudException {
|
| | | SuningGoodsInfo goods = SuningApiUtil.getGoodsDetail(goodsId +"", sellerId +"");
|
| | | if (goods == null)
|
| | | throw new UserCloudException(1, "该商品已下架");
|
| | | |
| | | |
| | | String couponLink = goods.getCouponInfo().getCouponUrl();
|
| | | String jumpLink = SuningApiUtil.convertLink(SuningUtil.getProductUrl(sellerId +"", goodsId +""),
|
| | | StringUtil.isNullOrEmpty(couponLink) ? null : couponLink, SuningApiUtil.PID_SHARE, user.getId() + "");
|
| | | |
| | | |
| | | boolean coupon = false;
|
| | | String couponAmount = "";
|
| | | String sales = null;
|
| | | if (goods.getCouponInfo() != null && !StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl())) {// 有券
|
| | | couponAmount = new BigDecimal(goods.getCouponInfo().getCouponValue()).toString();
|
| | | coupon = true;
|
| | | } |
| | | |
| | | // 获取推荐语
|
| | | String recommendText = shareGoodsTextTemplateService.getRecommendText(coupon, goods.getCommodityInfo().getCommodityName(), sales, |
| | | couponAmount, null);
|
| | | |
| | | // 生成快捷分享内容
|
| | | String template = configService.get(ConfigKeyEnum.quickShareSuNingCommentText.getKey());
|
| | | String commentText = shareGoodsTextTemplateService.createQuickShareTextSuNing(template, goods, jumpLink);
|
| | | |
| | | |
| | | List<String> imgList = new ArrayList<>();
|
| | | for (SuningGoodsImg img : goods.getCommodityInfo().getPictureUrl()) {
|
| | | imgList.add(img.getPicUrl());
|
| | | }
|
| | | |
| | | // 云发单
|
| | | sendGoods(robotId, wxId, listOpen, recommendText, commentText, imgList, user.getId(), pid);
|
| | | }
|
| | | |
| | | /**
|
| | | * 发送商品
|
| | | * @param robotId
|
| | | * @param title
|
| | | * @param comment
|
| | | * @param listImg
|
| | | * @param wxId
|
| | | * @param listOpen
|
| | | */
|
| | | private void sendGoods(int robotId,String wxId, List<UserCloudGroup> listOpen, String title,
|
| | | String comment, List<String> listImg, Long uid, String pid) {
|
| | | // 遍历群-朋友圈
|
| | | for (UserCloudGroup cloudGroup: listOpen) {
|
| | | UserCloudSendContent sendContent = new UserCloudSendContent();
|
| | | sendContent.setPid(pid);
|
| | | sendContent.setUid(uid);
|
| | | sendContent.setGroupId(cloudGroup.getGroupId());
|
| | | sendContent.setCreateTime(new Date());
|
| | | |
| | | if(cloudGroup.getType() == UserCloudGroup.TYPE_CIRCLE) { // 朋友圈
|
| | | sendContent.setType(UserCloudSendContent.TYPE_CIRCLE);
|
| | | String picUrl = "";
|
| | | if (listImg.size() > 0) {
|
| | | for (String img: listImg) {
|
| | | picUrl += "," + img;
|
| | | }
|
| | | }
|
| | | sendContent.setTitle(title);
|
| | | sendContent.setPicUrl(picUrl);
|
| | | |
| | | // 发圈内容
|
| | | String circleId = AitaokerApiUtil.macsendCircle(robotId, title, picUrl);
|
| | | // 评论文本
|
| | | if (!StringUtil.isNullOrEmpty(circleId)) {
|
| | | sendContent.setState(true);
|
| | | List<String> list = new ArrayList<>();
|
| | | boolean macsend = AitaokerApiUtil.macsendCircleComment(robotId, wxId, circleId, comment);
|
| | | if (macsend) {
|
| | | list.add(comment);
|
| | | }
|
| | | sendContent.setComments(list);
|
| | | }
|
| | | } else {
|
| | | sendContent.setType(UserCloudSendContent.TYPE_GROUP);
|
| | | // 发送文本
|
| | | if (!StringUtil.isNullOrEmpty(title)) {
|
| | | boolean macsend = AitaokerApiUtil.macsendText(robotId, cloudGroup.getGroupId(), title);
|
| | | if (macsend)
|
| | | sendContent.setTitle(title);
|
| | | }
|
| | | |
| | | // 发送图片
|
| | | String picurl = listImg.get(0);
|
| | | if (!StringUtil.isNullOrEmpty(picurl)) {
|
| | | try {
|
| | | String imgBase64 = ImageToBase64.NetImageToBase64(picurl);
|
| | | boolean macsend = AitaokerApiUtil.macsendImgBase64(robotId, cloudGroup.getGroupId(), imgBase64);
|
| | | if (macsend)
|
| | | sendContent.setPicUrl(picurl);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | |
| | | }
|
| | | // 评论文本
|
| | | List<String> list = new ArrayList<>();
|
| | | boolean macsend = AitaokerApiUtil.macsendText(robotId, cloudGroup.getGroupId(), comment);
|
| | | if (macsend) {
|
| | | list.add(comment);
|
| | | }
|
| | | sendContent.setState(true);
|
| | | sendContent.setComments(list);
|
| | | }
|
| | | userCloudSendContentService.save(sendContent);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void fixedTimeSend(String id) {
|
| | | if (StringUtil.isNullOrEmpty(id)) |
| | | return;
|
| | | |
| | | // 一个小时之前
|
| | | long time = java.lang.System.currentTimeMillis() - 1000 * 60 * 60 ;
|
| | | 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;
|
| | | |
| | | boolean official = false;
|
| | | UserCloudManage cloudManage = userCloudManageService.selectByPrimaryKey(uid);
|
| | | if (cloudManage != null) {
|
| | | if (cloudManage.getOfficial() != null)
|
| | | official = cloudManage.getOfficial();
|
| | | }
|
| | | |
| | | if (!Constant.IS_TEST && official) {
|
| | | 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);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | | } |
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.integral.IntegralDetailMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.integral.IntegralDetail;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
|
| | |
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long sumUseGoldCoin(Long uid) {
|
| | | Long count = integralDetailMapper.sumUseGoldCoin(uid);
|
| | | if (count == null) {
|
| | | count = 0L;
|
| | | }
|
| | | return count;
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | |
| | | */ |
| | | 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); |
| | | |
| | | } |
| | |
| | | import com.yeshi.fanli.dto.vip.goods.VIPGoodsInfo;
|
| | | import com.yeshi.fanli.entity.goods.ShareGoodsTextTemplate;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.goods.ShareGoodsTextTemplateException;
|
| | |
|
| | |
| | |
|
| | | public String createContentVIP(String template, VIPGoodsInfo goods, String jumpLink);
|
| | |
|
| | | public String createContentSuning(String template, SuningGoodsInfo goods, String jumpLink);
|
| | |
|
| | | public String getTextTemplateByJD(Long uid);
|
| | |
|
| | |
| | |
|
| | | public void saveTemplatePDD(Long uid, String template) throws ShareGoodsTextTemplateException;
|
| | |
|
| | | /**
|
| | | * 获取推荐语文本
|
| | | * @param coupon
|
| | | * @param title
|
| | | * @param sales
|
| | | * @param couponAmount
|
| | | * @param description
|
| | | */
|
| | | public String getRecommendText(boolean coupon, String title, String sales, String couponAmount, String description);
|
| | |
|
| | | /**
|
| | | * 根据淘口令获取评论语
|
| | | * @param coupon
|
| | | * @param taoToken
|
| | | * @param zkPrice
|
| | | * @param quanPrice
|
| | | */
|
| | | public String getCommentTextByTaoToken(boolean coupon, String taoToken, String zkPrice, String quanPrice);
|
| | |
|
| | | /**
|
| | | * 根据链接获取评论语
|
| | | * @param coupon
|
| | | * @param link
|
| | | * @param zkPrice
|
| | | * @param quanPrice
|
| | | * @param keyEnum
|
| | | */
|
| | | public String getCommentTextByLink(boolean coupon, String link, String zkPrice, String quanPrice, ConfigKeyEnum keyEnum);
|
| | |
|
| | | public void resetCommonTemplateVIP(Long uid);
|
| | |
|
| | | public void resetCouponTemplateVIP(Long uid);
|
| | |
|
| | | public void resetCommonTemplateSuNing(Long uid);
|
| | |
|
| | | public void resetCouponTemplateSuNing(Long uid);
|
| | |
|
| | | public String getTextTemplateBySuNing(Long uid);
|
| | |
|
| | | public void verifyRightVIP(String template) throws ShareGoodsTextTemplateException;
|
| | |
|
| | | public void verifyRightSuNing(String template) throws ShareGoodsTextTemplateException;
|
| | |
|
| | | /**
|
| | | * 苏宁快捷分享
|
| | | * @param template
|
| | | * @param goods
|
| | | * @param jumpLink
|
| | | * @return
|
| | | */
|
| | | public String createQuickShareTextSuNing(String template, SuningGoodsInfo goods, String jumpLink);
|
| | | |
| | | |
| | | /**
|
| | | * 苏宁普通分享
|
| | | * @param template
|
| | | * @param goods
|
| | | * @param jumpLink
|
| | | * @return
|
| | | */
|
| | | public String createCommonShareTextSuNing(String template, SuningGoodsInfo goods, String jumpLink);
|
| | |
|
| | | public void saveTemplateVIP(Long uid, String template) throws ShareGoodsTextTemplateException;
|
| | |
|
| | | public void saveTemplateSuNing(Long uid, String template) throws ShareGoodsTextTemplateException;
|
| | |
|
| | | }
|
| | |
| | | * @return |
| | | */ |
| | | public long countOrderBySourceAndNearDay(Long uid, int source, int day); |
| | | |
| | | /** |
| | | * 统计历史订单数量 -不区分状态、来源 订单号为主 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | public long countHistoryOrderNum(Long uid); |
| | | } |
| | |
| | | public FileUploadResult drawGoodsPosterXCX(InputStream erCodeStream, UserInfo user, GoodsDetailVO goods); |
| | | |
| | | public FileUploadResult drawDynamicGoodsPoster(String erCodeUrl, String portrait, String inviteCode, String mainPic, GoodsDetailVO goods); |
| | | |
| | | /** |
| | | * 单个商品快速分享图 |
| | | * @param erCodeUrl |
| | | * @param portrait |
| | | * @param inviteCode |
| | | * @param mainPic |
| | | * @param goods |
| | | * @return |
| | | */ |
| | | public FileUploadResult drawGoodsQuickhShare(String erCodeUrl, String portrait, String inviteCode, String mainPic, |
| | | GoodsDetailVO goods); |
| | | } |
| | |
| | | */
|
| | | public UserInfo selectAvailableByPrimaryKey(Long uid);
|
| | |
|
| | | |
| | | |
| | | public long countInfo(Integer userState, String key, Integer keyType, String userRank, Integer days, String startTime,
|
| | | String endTime, Integer userType, String level, Integer activeCode);
|
| | |
|
| | | public List<UserInfoVO> queryInfo(long start, int count, Integer userState, String key, Integer keyType, String userRank,
|
| | | Integer days, String startTime, String endTime, Integer userType, String level, Integer activeCode);
|
| | |
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.cloud;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGoods;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGoodsException;
|
| | |
|
| | | public interface UserCloudGoodsService {
|
| | |
|
| | | public List<UserCloudGoods> listByUid(long start, int count, Long uid);
|
| | |
|
| | | public long countByUid(Long uid);
|
| | | |
| | | /**
|
| | | * 根据商品信息查询
|
| | | * @param uid
|
| | | * @param goodsId
|
| | | * @param goodsType
|
| | | * @return
|
| | | */
|
| | | public UserCloudGoods getByUidAndGoods(Long uid, Long goodsId, Integer goodsType);
|
| | |
|
| | |
|
| | | /**
|
| | | * 添加发单库商品
|
| | | * @param uid
|
| | | * @param set
|
| | | * @param goodsType
|
| | | * @throws UserCloudGoodsException
|
| | | */
|
| | | public UserCloudGoods addGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudGoodsException;
|
| | |
|
| | | |
| | | /**
|
| | | * 用户删除商品
|
| | | * @param id
|
| | | * @param uid
|
| | | */
|
| | | public void deleteByPrimaryKeyAndUid(Long id, Long uid);
|
| | |
|
| | | /**
|
| | | * 查询未分享的商品
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudGoods> listByNotShare(Long uid);
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * @param id
|
| | | */
|
| | | public UserCloudGoods selectByPrimaryKey(Long id);
|
| | |
|
| | | |
| | | /**
|
| | | * 更新信息
|
| | | * @param record
|
| | | */
|
| | | public void updateByPrimaryKeySelective(UserCloudGoods record);
|
| | |
|
| | | |
| | | /**
|
| | | * 查询
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @param key
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudGoods> query(int page, int pageSize, String key);
|
| | |
|
| | | public long count(String key);
|
| | |
|
| | | /**
|
| | | * 选品库
|
| | | * @param uid
|
| | | */
|
| | | public void sendGoodsMQMsg(Long uid);
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.cloud;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudGroupException;
|
| | |
|
| | | public interface UserCloudGroupService {
|
| | |
|
| | | /**
|
| | | * 根据uid查询
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudGroup> listByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 首次添加朋友圈状态
|
| | | * @param uid
|
| | | */
|
| | | public void addCircle(Long uid);
|
| | |
|
| | | /**
|
| | | * 创建群信息
|
| | | * @param uid
|
| | | * @throws UserCloudGroupException
|
| | | */
|
| | | public void addGroup(Long uid, String groupId, String groupName, int maxNum);
|
| | |
|
| | | |
| | | /**
|
| | | * 根据uid删除
|
| | | * @param uid
|
| | | */
|
| | | public void deleteGroupByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 切换群状态
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param state
|
| | | */
|
| | | public void switchGroupState(long uid, long id, boolean state) throws UserCloudGroupException;
|
| | |
|
| | | /**
|
| | | * 切换朋友圈状态
|
| | | * @param uid
|
| | | * @param state
|
| | | * @throws UserCloudGroupException
|
| | | */
|
| | | public void switchCircleState(long uid, boolean state) throws UserCloudGroupException;
|
| | |
|
| | | |
| | | /**
|
| | | * 获取群列表
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudGroup> listGroupByUid(Long uid);
|
| | |
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.cloud;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudManage;
|
| | |
|
| | | public interface UserCloudManageService {
|
| | |
|
| | | /**
|
| | | * 保存信息
|
| | | * @param uid
|
| | | * @param official
|
| | | * @param custom
|
| | | */
|
| | | public void save(Long uid, Boolean official, Boolean custom);
|
| | |
|
| | | /**
|
| | | * 根据id查询
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserCloudManage selectByPrimaryKey(Long uid);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.cloud;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudOrderException;
|
| | |
|
| | | public interface UserCloudOrderService {
|
| | |
|
| | | /**
|
| | | * 创建未付款订单
|
| | | * @param uid
|
| | | * @param type
|
| | | * @throws UserCloudOrderException
|
| | | */
|
| | | public UserCloudOrder addCloudOrder(Long uid, String type) throws UserCloudOrderException;
|
| | |
|
| | | /**
|
| | | * 查询后一条订单 -未支付的
|
| | | * @param uid
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public UserCloudOrder getLastOrderByUnpaid(Long uid, String type);
|
| | | |
| | | /**
|
| | | * 查询后一条订单 -支付完成的
|
| | | * @param uid
|
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | public UserCloudOrder getLastOrderByPayEnd(Long uid, String type);
|
| | |
|
| | | /**
|
| | | * 查询订单记录
|
| | | * @param page
|
| | | * @param count
|
| | | * @param uid
|
| | | * @param state 1-成功 -未支付
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudOrder> getOrderRecord(int page, int count, Long uid, Integer state);
|
| | |
|
| | | /**
|
| | | * 统计状态
|
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | public long countOrderRecord(Long uid, Integer state);
|
| | |
|
| | | public UserCloudOrder selectByPrimaryKey(Long id);
|
| | |
|
| | | /**
|
| | | * 更新
|
| | | * @param cloudOrder
|
| | | */
|
| | | public void updateByPrimaryKeySelective(UserCloudOrder cloudOrder);
|
| | |
|
| | | /**
|
| | | * 支付成功更新订单状态
|
| | | * @param orderId
|
| | | * @throws UserCloudOrderException
|
| | | */
|
| | | public void cloudPayCloudSuccess(Long orderId) throws UserCloudOrderException;
|
| | |
|
| | | /**
|
| | | * 查询最近更新但未付款的
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudOrder> getLasthourByUnpaid();
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * @param page
|
| | | * @param count
|
| | | * @param key
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudOrder> query(int page, int count, String key, Integer state);
|
| | |
|
| | | long count(String key, Integer state);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.cloud;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendContent;
|
| | |
|
| | | public interface UserCloudSendContentService {
|
| | | |
| | |
|
| | | /**
|
| | | * 保存
|
| | | * @param record
|
| | | * @return
|
| | | */
|
| | | public UserCloudSendContent save(UserCloudSendContent record);
|
| | |
|
| | | /**
|
| | | * 查询具体内容
|
| | | * @param uid
|
| | | * @param pid
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudSendContent> getByPid(String pid);
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.cloud;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudSendRecord;
|
| | |
|
| | | public interface UserCloudSendRecordService {
|
| | | |
| | | /**
|
| | | * 查询已发送记录
|
| | | * @param uid
|
| | | * @param sendId
|
| | | * @param sendOrigin
|
| | | * @return
|
| | | */
|
| | | public UserCloudSendRecord getByUidAndSendId(Long uid, String sendId);
|
| | |
|
| | | /**
|
| | | * 保存
|
| | | * @param record
|
| | | * @return
|
| | | */
|
| | | public UserCloudSendRecord save(UserCloudSendRecord record);
|
| | |
|
| | | /**
|
| | | * 查询最后一次
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserCloudSendRecord getLastByUid(Long uid, Date lastTime);
|
| | |
|
| | | /**
|
| | | * 后台查询
|
| | | * @param page
|
| | | * @param count
|
| | | * @param key
|
| | | * @param sendOrigin
|
| | | * @return
|
| | | */
|
| | | public List<UserCloudSendRecord> query(int page, int count, String key, Integer sendOrigin);
|
| | |
|
| | | public long count(String key, Integer sendOrigin);
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.cloud;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.CloudOrderMenuEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloud;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudException;
|
| | |
|
| | | public interface UserCloudService {
|
| | |
|
| | | /**
|
| | | * 查询有效
|
| | | * @return
|
| | | */
|
| | | public UserCloud getValidByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 统计所有
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 最后一条
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public UserCloud getLastByUid(Long uid);
|
| | |
|
| | | /**
|
| | | * 更新登录微信信息
|
| | | * @param uid
|
| | | * @param wxId
|
| | | * @param wxName
|
| | | * @param wxPortrait
|
| | | */
|
| | | public void updateWXInfo(Long uid, String wxId, String wxName, String wxPortrait) throws UserCloudException;
|
| | |
|
| | | /**
|
| | | * 支付完成开通云发单信息
|
| | | * @param uid
|
| | | * @param orderId
|
| | | * @param menuEnum
|
| | | * @throws UserCloudException
|
| | | */
|
| | | public void openCloud(Long uid, Long orderId, CloudOrderMenuEnum menuEnum) throws UserCloudException;
|
| | |
|
| | | |
| | | /**
|
| | | * 刷新群
|
| | | * @param uid
|
| | | * @throws UserCloudException
|
| | | */
|
| | | public void searchGroup(Long uid) throws UserCloudException;
|
| | |
|
| | | |
| | | /**
|
| | | * 发送自定义商品
|
| | | * @param uid
|
| | | * @param id
|
| | | */
|
| | | public void autoSendCustomGoods(Long uid, Long id);
|
| | |
|
| | | /**
|
| | | * 自动发送动态
|
| | | * @param uid
|
| | | * @param id
|
| | | */
|
| | | public void autoSendByDynamic(Long uid, String id);
|
| | |
|
| | | /**
|
| | | * 手动云发单 - 动态
|
| | | * @param uid
|
| | | * @param id
|
| | | * @throws UserCloudException
|
| | | */
|
| | | public void sendByDynamic(Long uid, String id) throws UserCloudException;
|
| | |
|
| | | /**
|
| | | * 手动云发单 - 商品
|
| | | * @param uid
|
| | | * @param goodsId
|
| | | * @param goodsType
|
| | | * @throws UserCloudException
|
| | | */
|
| | | public void sendCustomGoods(Long uid, Long goodsId, Integer goodsType, Long sellerId) throws UserCloudException;
|
| | |
|
| | | /**
|
| | | * 定时发送云发单
|
| | | * @param id
|
| | | */
|
| | | public void fixedTimeSend(String id);
|
| | |
|
| | | public List<UserCloud> query(int page, int count, String key, Integer state);
|
| | |
|
| | | public long count(String key, Integer state);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | public long countQuery(String key);
|
| | |
|
| | | /**
|
| | | * 统计用户消耗金币数量
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long sumUseGoldCoin(Long uid);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.manger.alipay;
|
| | |
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.CloudOrderMenuEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudOrder;
|
| | | import com.yeshi.fanli.exception.user.cloud.UserCloudException;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudGroupService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudManageService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | | import com.yeshi.fanli.util.alipay.AlipayApi;
|
| | | import com.yeshi.fanli.util.alipay.AlipayWapConfig;
|
| | |
|
| | | /**
|
| | | * 云发单支付管理
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Component
|
| | | public class UserCloudAlipayManager {
|
| | |
|
| | | @Resource
|
| | | private UserCloudService userCloudService;
|
| | |
|
| | | @Resource
|
| | | private UserCloudOrderService userCloudOrderService;
|
| | | |
| | | @Resource
|
| | | private UserCloudGroupService userCloudGroupService;
|
| | | |
| | | @Resource
|
| | | private UserCloudManageService userCloudManageService;
|
| | | |
| | | public static final String TRADE_INDEX = "yufadan-";
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 创建支付订单
|
| | | * @param uid
|
| | | * @param type
|
| | | * @return
|
| | | * @throws Exception
|
| | | * @throws UserCloudException
|
| | | */
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | public String getAlipayForm(Long uid, String type) throws Exception, UserCloudException{
|
| | | CloudOrderMenuEnum menuEnum = CloudOrderMenuEnum.getMenuEnum(type);
|
| | | if (menuEnum == null) |
| | | throw new UserCloudException(1, "套餐类型不匹配");
|
| | | |
| | | // 订单信息
|
| | | UserCloudOrder cloudOrder = userCloudOrderService.getLastOrderByUnpaid(uid, type);
|
| | | if (cloudOrder == null)
|
| | | cloudOrder = userCloudOrderService.addCloudOrder(uid, type); |
| | | |
| | | if (cloudOrder == null || cloudOrder.getId() == null)
|
| | | throw new UserCloudException(1, "创建订单信息失败");
|
| | | |
| | | // 待请求参数数组
|
| | | Map<String, String> map = new HashMap<String, String>();
|
| | | map.put("seller_id", AlipayWapConfig.SELLER_ID);// 收款方账号
|
| | | // 订单号
|
| | | map.put("out_trade_no", TRADE_INDEX + cloudOrder.getId());
|
| | | // 订单金额:0.01元,精准到分
|
| | | map.put("total_amount", menuEnum.getMoney() + "");
|
| | | // 订单标题
|
| | | map.put("subject", "云发单充值");
|
| | | // 销售产品码,商家和支付宝签约的产品码
|
| | | map.put("product_code", type);
|
| | | // 该笔订单允许的最晚付款时间,逾期将关闭交易 15分钟
|
| | | map.put("timeout_express", "15m");
|
| | | |
| | | // 支付成功后返回哪个前端页面
|
| | | String returnUrl = "http://apph5.banliapp.com";
|
| | | // 支付成功后回调地址
|
| | | String notifyUrl = "http://192.168.1.253:8080/fanli/api/v2/user/cloud/payEnd?id=" +cloudOrder.getId();
|
| | | // 获取支付form
|
| | | return AlipayApi.tradeWapPayRequest(map, returnUrl, notifyUrl);
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查询订单交易是否支付成功
|
| | | * @param orderId
|
| | | * @throws Exception
|
| | | */
|
| | | public void tradeQueryByOrderId(Long orderId) throws Exception {
|
| | | boolean result = AlipayApi.tradeQuery(TRADE_INDEX + orderId, null, null, null);
|
| | | // 支付成功
|
| | | if (result) {
|
| | | userCloudOrderService.cloudPayCloudSuccess(orderId);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.UserOrderDailyStatisticMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleDetail;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount.SourceTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.SourceTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.dividents.TeamDividentsSourceOrderUserMap;
|
| | | import com.yeshi.fanli.service.inter.order.OrderMoneyDailyCountService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleDetailService;
|
New file |
| | |
| | | package com.yeshi.fanli.util;
|
| | |
|
| | | import java.io.ByteArrayOutputStream;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.net.HttpURLConnection;
|
| | | import java.net.URL;
|
| | |
|
| | | import Decoder.BASE64Encoder;
|
| | |
|
| | | public class ImageToBase64 {
|
| | |
|
| | | public static void main(String[] args) {
|
| | | // 第一个:把网络图片装换成Base64
|
| | | String netImagePath = "http://ec-1255749512.file.myqcloud.com/swiperPic/c7847b574a79400298bc63706fd89faf.jpeg";
|
| | | // 下面是网络图片转换Base64的方法
|
| | | String netImageToBase64 = NetImageToBase64(netImagePath);
|
| | |
|
| | | System.out.println(netImageToBase64);
|
| | | // 下面是本地图片转换Base64的方法
|
| | | //String imagePath = "本地图片路径";
|
| | | // ImageToBase64(imagePath);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 网络图片转换Base64的方法
|
| | | *
|
| | | * @param netImagePath
|
| | | */
|
| | | public static String NetImageToBase64(String netImagePath) {
|
| | | try {
|
| | | // 创建URL
|
| | | URL url = new URL(netImagePath);
|
| | | byte[] by = new byte[1024];
|
| | | // 创建链接
|
| | | HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
| | | conn.setRequestMethod("GET");
|
| | | conn.setConnectTimeout(5000);
|
| | |
|
| | | InputStream is = conn.getInputStream();
|
| | | ByteArrayOutputStream data = new ByteArrayOutputStream();
|
| | | // 将内容读取内存中
|
| | | int len = -1;
|
| | | while ((len = is.read(by)) != -1) {
|
| | | data.write(by, 0, len);
|
| | | }
|
| | | // 关闭流
|
| | | is.close();
|
| | | // 对字节数组Base64编码
|
| | | BASE64Encoder encoder = new BASE64Encoder();
|
| | | return encoder.encode(data.toByteArray());
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 本地图片转换Base64的方法
|
| | | *
|
| | | * @param imgPath
|
| | | */
|
| | | public static String ImageToBase64(String imgPath) {
|
| | | try {
|
| | | InputStream in = new FileInputStream(imgPath);
|
| | | byte[] data = new byte[in.available()];
|
| | | in.read(data);
|
| | | in.close();
|
| | | |
| | | // 对字节数组Base64编码
|
| | | BASE64Encoder encoder = new BASE64Encoder();
|
| | | return encoder.encode(data);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
| | | |
| | | public class ImageUtil { |
| | | |
| | | |
| | | /** |
| | | * 分析海报图 |
| | | * @param qrcode |
| | | * @param portraitStream |
| | | * @param goods |
| | | * @return |
| | | */ |
| | | public static InputStream drawGoodsQuickhShare(InputStream qrcode, InputStream portraitStream, String inviteCode, |
| | | String mainPic, GoodsDetailVO goods) { |
| | | try { |
| | | String fontPath = "/usr/share/fonts/PingFang_Medium.ttf"; |
| | | String os = System.getProperty("os.name"); |
| | | if (os.toLowerCase().startsWith("win")) { |
| | | fontPath = "D:/PingFang_Medium.ttf"; |
| | | } |
| | | |
| | | String fontBoldPath = "/usr/share/fonts/PingFang_Heavy_0.ttf"; |
| | | if (os.toLowerCase().startsWith("win")) { |
| | | fontBoldPath = "D:/PingFang_Heavy_0.ttf"; |
| | | } |
| | | Font font24 = Font.createFont(Font.PLAIN, new File(fontPath)).deriveFont(24.0f); |
| | | Font font26 = Font.createFont(Font.PLAIN, new File(fontPath)).deriveFont(26.0f); |
| | | Font boldFont36 = Font.createFont(Font.PLAIN, new File(fontBoldPath)).deriveFont(36.0f); |
| | | |
| | | int px = 640; // 图片宽度 |
| | | // int py = 1154; // 图片高度 显示邀请码 |
| | | int py = 1060; // 图片高度 |
| | | final BufferedImage targetImg = new BufferedImage(px, py, BufferedImage.TYPE_INT_RGB); |
| | | HashMap<Key, Object> mapH = new HashMap<Key, Object>(); |
| | | mapH.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);// 抗锯齿 (抗锯齿总开关) |
| | | mapH.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_GASP);// 文字抗锯齿 |
| | | |
| | | final Graphics2D g2d = (Graphics2D) targetImg.getGraphics(); |
| | | g2d.setRenderingHints(mapH); |
| | | g2d.setColor(Color.WHITE); |
| | | g2d.fillRect(0, 0, px, py); |
| | | |
| | | int x = 640; |
| | | int y = 640; |
| | | int spacing = 20; // 右边距 |
| | | |
| | | // 1、画商品主图 |
| | | InputStream picStream = HttpUtil.getAsInputStream(mainPic); |
| | | // InputStream picStream = |
| | | // ImageUtil.class.getClassLoader().getResourceAsStream("image/share/test_pic1.jpg"); |
| | | g2d.drawImage(ImageIO.read(picStream), 0, 0, x, y, null); |
| | | |
| | | // 2、画来源图标 |
| | | int length = 10; |
| | | int row1 = 450; |
| | | int iconWidth = 72; |
| | | String source = ""; |
| | | InputStream icon = null; |
| | | int goodsType = goods.getGoodsType(); |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | source = "淘宝"; |
| | | if (goods.getShopType() == 10) { |
| | | icon = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_tb.png"); |
| | | } else { |
| | | icon = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_tm.png"); |
| | | } |
| | | } else if (goodsType == Constant.SOURCE_TYPE_JD) { |
| | | source = "京东"; |
| | | icon = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_jd.png"); |
| | | } else if (goodsType == Constant.SOURCE_TYPE_PDD) { |
| | | source = "拼多多"; |
| | | length = 9; |
| | | row1 = row1 - 26; |
| | | iconWidth = iconWidth + 28; |
| | | icon = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_pdd.png"); |
| | | } else { |
| | | return null; |
| | | } |
| | | g2d.drawImage(ImageIO.read(icon), spacing, y + 20, iconWidth, 34, null); |
| | | |
| | | // 3、商品标题内容 |
| | | int row = 0; |
| | | String title = goods.getTitle(); |
| | | length = ImageUtil.getTextLengthByWidth(g2d, font26, title, row1, length); |
| | | g2d.setFont(font26); |
| | | g2d.setColor(new Color(0, 0, 0)); |
| | | g2d.drawString(title.substring(0, length), spacing + iconWidth + 5, y + 45 + row * 36); |
| | | |
| | | row++; |
| | | title = title.substring(length); |
| | | int length2 = ImageUtil.getTextLengthByWidth(g2d, font26, title, 600, 11); |
| | | if (length2 > 24) { |
| | | g2d.drawString(title.substring(0, 21) + "...", spacing, y + 45 + row * 36); |
| | | } else { |
| | | g2d.drawString(title.substring(0, length2), spacing, y + 45 + row * 36); |
| | | } |
| | | |
| | | int baoYouLength = spacing; |
| | | if (!goods.isHasCoupon()) { |
| | | // 无券 |
| | | g2d.setColor(new Color(229, 0, 92)); |
| | | g2d.drawString("¥ ", spacing, y + 125); |
| | | g2d.setFont(boldFont36); |
| | | g2d.drawString(MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()).toString(), spacing + 21, y + 125); |
| | | } else { |
| | | // 券后价 |
| | | g2d.setFont(font26); |
| | | g2d.setColor(new Color(229, 0, 92)); |
| | | g2d.drawString("券后价 ¥ ", spacing, y + 125); |
| | | |
| | | g2d.setFont(boldFont36); |
| | | String couponPrice = MoneyBigDecimalUtil.getWithNoZera(goods.getCouponPrice()).toString(); |
| | | g2d.drawString(couponPrice, spacing + 116, y + 125); |
| | | |
| | | FontMetrics fm2 = g2d.getFontMetrics(boldFont36); |
| | | int textLength1 = 116 + fm2.stringWidth(couponPrice); |
| | | |
| | | // 渠道原价 |
| | | g2d.setColor(new Color(153, 153, 153)); |
| | | g2d.setFont(font24); |
| | | g2d.drawString(goods.getPriceName() + " ¥ " + MoneyBigDecimalUtil.getWithNoZera(goods.getZkPrice()), |
| | | spacing + textLength1 + 10, y + 125); |
| | | |
| | | // 券字 |
| | | InputStream quan = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_quan.png"); |
| | | g2d.drawImage(ImageIO.read(quan), spacing, y + 140, 47, 40, null); |
| | | // 券面额 |
| | | String quanAmount = "¥ " + goods.getCouponInfo().getAmount(); |
| | | FontMetrics fm = g2d.getFontMetrics(font26); |
| | | int textLength = fm.stringWidth(quanAmount); |
| | | |
| | | g2d.setFont(font26); |
| | | g2d.setColor(new Color(229, 0, 92)); |
| | | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| | | g2d.drawRoundRect(spacing + 42, y + 140, textLength + 20, 39, 10, 10); |
| | | g2d.drawString(quanAmount, spacing + 55, y + 170); |
| | | |
| | | baoYouLength = spacing + 42 + textLength + 20 + 20; |
| | | } |
| | | |
| | | // 自营 、包邮 |
| | | InputStream ziying = null; |
| | | if (goods.getShopType() == 21) { |
| | | ziying = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_ziying.png"); |
| | | g2d.drawImage(ImageIO.read(ziying), baoYouLength, y + 150, 60, 30, null); |
| | | } else if (goods.isBaoyou()) { |
| | | ziying = ImageUtil.class.getClassLoader().getResourceAsStream("image/icon_baoyou.png"); |
| | | g2d.drawImage(ImageIO.read(ziying), baoYouLength, y + 150, 60, 30, null); |
| | | } |
| | | |
| | | // 销量 |
| | | String sale = null; |
| | | int salesType = goods.getSalesType(); |
| | | if (salesType == 1) { |
| | | sale = "月销"; |
| | | } else if (salesType == 2) { |
| | | sale = "2小时销量"; |
| | | } else if (salesType == 3) { |
| | | sale = "今日销量"; |
| | | } else if (salesType == 4) { |
| | | sale = "总销量"; |
| | | } else { |
| | | sale = "月销"; |
| | | } |
| | | sale = sale + " " + goods.getSalesCount(); |
| | | FontMetrics fm = g2d.getFontMetrics(font24); |
| | | int textLength = fm.stringWidth(sale); |
| | | g2d.setFont(font24); |
| | | g2d.setColor(new Color(153, 153, 153)); |
| | | g2d.drawString(sale, spacing + 605 - textLength, y + 125); |
| | | |
| | | // 下单提示 |
| | | InputStream downTip = null; |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | downTip = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/down_tip_tb.png"); |
| | | } else { |
| | | downTip = ImageUtil.class.getClassLoader().getResourceAsStream("image/share/down_tip_jd_pdd.png"); |
| | | } |
| | | g2d.drawImage(ImageIO.read(downTip), spacing, y + 200, 382, 203, null); |
| | | |
| | | // 二维码图框 |
| | | InputStream codeFrame = ImageUtil.class.getClassLoader() |
| | | .getResourceAsStream("image/share/qr_code_frame01.png"); |
| | | g2d.drawImage(ImageIO.read(codeFrame), spacing + 405, y + 200, 200, 203, null); |
| | | |
| | | // 画二维码 |
| | | int codeSize = 170; |
| | | int pX = spacing + 422; |
| | | int pY = y + 217; |
| | | g2d.drawImage(ImageIO.read(qrcode), pX, pY, codeSize, codeSize, null); |
| | | |
| | | int portraitSize = 200 * 5 / 23; |
| | | int pPX = pX + codeSize / 2 - portraitSize / 2; |
| | | int pPY = pY + codeSize / 2 - portraitSize / 2; |
| | | // 头像白色边框 |
| | | g2d.setColor(Color.WHITE); |
| | | g2d.fillRoundRect(pPX - 4, pPY - 4, portraitSize + 8, portraitSize + 8, 5, 5); |
| | | g2d.setRenderingHints(mapH); |
| | | // 画头像 |
| | | BufferedImage portraitImg = ImageIO.read(portraitStream); |
| | | portraitImg = ImageUtil.zoomInImage(portraitImg, portraitSize, portraitSize); |
| | | portraitImg = ImageUtil.roundImage(portraitImg, 10); |
| | | g2d.drawImage(portraitImg, pPX, pPY, portraitSize, portraitSize, null); |
| | | |
| | | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| | | g2d.setColor(new Color(255, 231, 224)); |
| | | g2d.fillRoundRect(spacing, y + 420, 607, 79, 10, 10); |
| | | |
| | | InputStream banliStream = ImageUtil.class.getClassLoader().getResourceAsStream("image/banlikuaisheng.png"); |
| | | g2d.drawImage(ImageIO.read(banliStream), spacing + 20, y + 440, 170, 38, null); |
| | | |
| | | inviteCode = "邀请码:" + inviteCode; |
| | | Font font26d28 = Font.createFont(Font.PLAIN, new File(fontPath)).deriveFont(26.28f); |
| | | FontMetrics fmcode = g2d.getFontMetrics(font26d28); |
| | | int codeLength = fmcode.stringWidth(inviteCode); |
| | | // 邀请码背景 |
| | | g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); |
| | | g2d.setColor(new Color(229, 71, 27)); |
| | | g2d.fillRoundRect(spacing + (600 - (int) (codeLength * 1.1)), y + 440, 10 + codeLength, 37, 10, 10); |
| | | // 邀请码文字 |
| | | g2d.setFont(font26d28); |
| | | g2d.setColor(new Color(255, 255, 255)); |
| | | g2d.drawString(inviteCode, spacing + (600 - (int) (codeLength * 1.1) + 5), y + 468); |
| | | |
| | | g2d.dispose(); |
| | | |
| | | ByteArrayOutputStream aos = new ByteArrayOutputStream(); |
| | | ImageIO.write(targetImg, "JPEG", aos); |
| | | return new ByteArrayInputStream(aos.toByteArray()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | try { |
| | | LogHelper.errorDetailInfo(e); |
| | | } catch (Exception e1) { |
| | | e1.printStackTrace(); |
| | | } |
| | | } |
| | | return null; |
| | | |
| | | } |
| | | |
| | | // 画商品分享图 |
| | | public static InputStream drawGoodsShareXCX(InputStream qrcode, UserInfo user, GoodsDetailVO goods) { |
| | | try { |
New file |
| | |
| | | package com.yeshi.fanli.util.aitaoker;
|
| | |
|
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.lang.reflect.Type;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Collections;
|
| | | import java.util.HashMap;
|
| | | import java.util.Iterator;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.aitaoker.QrcodeLoginDTO;
|
| | | import com.yeshi.fanli.dto.aitaoker.RobotInfoDTO;
|
| | | import com.yeshi.fanli.dto.aitaoker.WeiXinGroupDTO;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class AitaokerApiUtil {
|
| | | |
| | | public static String APP_KEY = "1077080250";
|
| | | public static String SECRET_KEY = "7c6118bd-7aa5-65b8-c6d4-058728e9446f";
|
| | | |
| | | // 请求连接
|
| | | private static String SERVER_URL = "http://router.itaoke.org/api";
|
| | | |
| | | |
| | | |
| | | |
| | | private static String baseRequest(String method, Map<String, String> param) {
|
| | | Map<String, String> baseMap = new HashMap<>();
|
| | | baseMap.put("app_key", APP_KEY);
|
| | | baseMap.put("v", "1.0");
|
| | | baseMap.put("format", "json");
|
| | | baseMap.put("sign_method", "md5");
|
| | | baseMap.put("timestamp", System.currentTimeMillis()+ "");
|
| | | baseMap.put("method", method);
|
| | | baseMap.put("domain", "hi.flqapp.com");
|
| | | baseMap.put("client", "113.249.194.232");
|
| | | baseMap.put("partner_id", "top-sdk-php-20190618");
|
| | | String url = combinedUrl(baseMap);
|
| | | |
| | | if (param != null) {
|
| | | Iterator<String> its = param.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | baseMap.put(key, param.get(key));
|
| | | }
|
| | | }
|
| | | |
| | | url+= "sign=" + getSign(baseMap);
|
| | | |
| | | return HttpUtil.post(url, param);
|
| | | }
|
| | | |
| | | /**
|
| | | * 拼接所有系统参数包括sign的url
|
| | | * @param params
|
| | | * @return
|
| | | */
|
| | | private static String combinedUrl (Map<String, String> params) {
|
| | | String url = SERVER_URL + "?";
|
| | | Iterator<String> its = params.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | try {
|
| | | url += String.format("%s=%s&", key, URLEncoder.encode(params.get(key), "UTF-8"));
|
| | | } catch (UnsupportedEncodingException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | return url;
|
| | | }
|
| | | |
| | | /**
|
| | | * 获取签名
|
| | | * @param params
|
| | | * @return
|
| | | */
|
| | | private static String getSign(Map<String, String> params) {
|
| | | List<String> list = new ArrayList<>();
|
| | | Iterator<String> its = params.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String key = its.next();
|
| | | list.add(key + params.get(key));
|
| | | }
|
| | | Collections.sort(list);
|
| | | |
| | | String str = "";
|
| | | for (String st : list) {
|
| | | str += st;
|
| | | }
|
| | | return StringUtil.Md5(SECRET_KEY + str + SECRET_KEY).toUpperCase();
|
| | | }
|
| | | |
| | | /**
|
| | | * 获取登录二维码
|
| | | * @param robotId
|
| | | * @return
|
| | | */
|
| | | public static QrcodeLoginDTO getQrcodeMaclogin(int robotId) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.qrcode.maclogin", map);
|
| | | |
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | if (resultJson != null) {
|
| | | Type type = new TypeToken<QrcodeLoginDTO>() {}.getType();
|
| | | return new Gson().fromJson(resultJson.toString(), type);
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | /**
|
| | | * 检查是否扫码
|
| | | * @param robotId
|
| | | * @return
|
| | | */
|
| | | public static Boolean getQrcodeStatus(int robotId) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.qrcode.status", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | if (resultJson != null && !StringUtil.isNullOrEmpty(resultJson.optString("status"))) {
|
| | | int optInt = resultJson.optInt("status");
|
| | | if (optInt == 1) {
|
| | | return true;
|
| | | } else {
|
| | | return false;
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 检查是否登陆(真正的登录接口)
|
| | | * @param robotId 机器人id
|
| | | * @param wId 获取二维码接口返回的微信实例id
|
| | | * @return
|
| | | */
|
| | | public static QrcodeLoginDTO getQrcodeMacloginCheck(int robotId, String wId) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("uuid", wId);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.check.maclogin", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | if (resultJson != null && !StringUtil.isNullOrEmpty(resultJson.optString("wcId"))) {
|
| | | Type type = new TypeToken<QrcodeLoginDTO>() {}.getType();
|
| | | return new Gson().fromJson(resultJson.toString(), type);
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | /**
|
| | | * 检查是否在线
|
| | | * @param robotId 机器人id
|
| | | * @return
|
| | | */
|
| | | public static boolean onlineCheck(int robotId) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.check.online", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 4.强制下线
|
| | | * @param robotId 机器人id
|
| | | * @return
|
| | | */
|
| | | public static boolean macloginOffline(int robotId) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.force.offline", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 掉线重连
|
| | | * @param robotId 机器人id
|
| | | * @return
|
| | | */
|
| | | public static boolean loseReconnet(int robotId) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.lose.reconnet", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | /**
|
| | | * 创建机器人
|
| | | * @param month 月数
|
| | | * @param robotType 机器人类型 1 发单机器人 2转发机器人 3 返利机器人 4全能机器人 5小型机器人 6发圈机器人
|
| | | * @param wechatrobot 微信号
|
| | | * @param agentUid 代理id
|
| | | * @return
|
| | | */
|
| | | public static RobotInfoDTO robotCreate(int month , int robotType, String wechatrobot, String agentUid) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("month", month +"");
|
| | | map.put("robot_type", robotType + "");
|
| | | map.put("wechatrobot", wechatrobot);
|
| | | if(!StringUtil.isNullOrEmpty(agentUid)) |
| | | map.put("agent_uid", agentUid);
|
| | | |
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.create.get", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | Type type = new TypeToken<RobotInfoDTO>() {}.getType();
|
| | | return new Gson().fromJson(resultJson.toString(), type);
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 机器人更换微信号
|
| | | * @param robotId 机器人id
|
| | | * @param wxid 微信号
|
| | | * @return
|
| | | */
|
| | | public static RobotInfoDTO robotChangeWeiXin(int robotId, String wxid) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("wechatrobot", wxid);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.change.get", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | Type type = new TypeToken<RobotInfoDTO>() {}.getType();
|
| | | return new Gson().fromJson(resultJson.toString(), type);
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 机器人续费
|
| | | * @param robotId 机器人id
|
| | | * @param wxid 微信号
|
| | | * @return
|
| | | */
|
| | | public static RobotInfoDTO robotRenewals(int robotId, int month) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("month", month +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.change.get", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | Type type = new TypeToken<RobotInfoDTO>() {}.getType();
|
| | | return new Gson().fromJson(resultJson.toString(), type);
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 删除机器人
|
| | | * @param robotId
|
| | | * @return
|
| | | */
|
| | | public static boolean robotDelete(int robotId) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.delete.get", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 获取好友-群列表
|
| | | * @param robotId
|
| | | * @return
|
| | | */
|
| | | public static List<WeiXinGroupDTO> getContract(int robotId) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.get.contract", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("0000".equals(resultJson.optString("code"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | // 订阅号
|
| | | //JSONArray publicArray = resultJson.optJSONArray("public");
|
| | | |
| | | // 好友列表
|
| | | //JSONArray friendArray = resultJson.optJSONArray("friend");
|
| | | |
| | | // 群列表
|
| | | JSONArray groupArray = resultJson.optJSONArray("group");
|
| | | if (groupArray != null && groupArray.size() > 0) {
|
| | | List<WeiXinGroupDTO> listGroup = new ArrayList<>();
|
| | | Type type = new TypeToken<RobotInfoDTO>() {}.getType();
|
| | | Gson gson = new Gson();
|
| | | for (int i = 0 ;i < groupArray.size(); i ++) {
|
| | | listGroup.add(gson.fromJson(groupArray.get(i).toString(), type));
|
| | | }
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 发朋友圈 |
| | | * @param robotId
|
| | | * @param content
|
| | | * @param picUrl 图片url,多个请用;分隔
|
| | | * @return
|
| | | */
|
| | | public static String macsendCircle(int robotId, String content, String picUrl) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("pic_url", picUrl);
|
| | | map.put("content", content);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.circle", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("1000".equals(resultJson.optString("code"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | return resultJson.optString("id");
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 朋友圈发送视频
|
| | | * @param robotId
|
| | | * @param videoPath 视频地址
|
| | | * @param thumbPath 封面url
|
| | | * @return
|
| | | */
|
| | | public static String macsendCircleVideo(int robotId, String videoPath, String thumbPath) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("video_path", videoPath);
|
| | | map.put("thumb_path", thumbPath);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.videocircle", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("1000".equals(resultJson.optString("code"))) {
|
| | | resultJson = resultJson.optJSONObject("data");
|
| | | return resultJson.optString("id");
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 朋友圈发送视频
|
| | | * @param robotId
|
| | | * @param videoPath 视频地址
|
| | | * @param thumbPath 封面url
|
| | | * @return
|
| | | */
|
| | | public static boolean macsendCircleComment(int robotId, String wxId, String msgId, String content) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("wx_id", wxId);
|
| | | map.put("msg_id", msgId);
|
| | | map.put("content", content);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.circlecomment", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if ("1000".equals(resultJson.optString("code"))) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 发文本消息
|
| | | * @param robotId
|
| | | * @param wxId 微信群ID
|
| | | * @param content 内容
|
| | | * @return
|
| | | */
|
| | | public static boolean macsendText(int robotId, String toWxId, String content) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("toWxId", toWxId );
|
| | | map.put("content", content);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.text", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if (resultJson.optInt("code") == 1000) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 发base64图
|
| | | * @param robotId
|
| | | * @param wxId
|
| | | * @param imgBase64
|
| | | * @return
|
| | | */
|
| | | public static boolean macsendImgBase64(int robotId, String toWxId, String imgBase64) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("toWxId", toWxId );
|
| | | map.put("base64_data", imgBase64);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.base64", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if (resultJson.optInt("code") == 1000) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | /**
|
| | | * 发链接消息
|
| | | * @param robotId
|
| | | * @param wxId 微信群ID
|
| | | * @param title 标题 |
| | | * @param url 链接
|
| | | * @param description 描述
|
| | | * @param thumbUrl 图片
|
| | | * @return
|
| | | */
|
| | | public static boolean macsendCard(int robotId, String wxId, String title, String url,
|
| | | String description ,String thumbUrl) {
|
| | | // 请求参数
|
| | | Map<String, String> map = new HashMap<>();
|
| | | map.put("robot_id", robotId +"");
|
| | | map.put("wx_id", wxId);
|
| | | map.put("title", title);
|
| | | map.put("url", url);
|
| | | map.put("description", description);
|
| | | map.put("thumbUrl", thumbUrl);
|
| | | // 请求结果
|
| | | String result = baseRequest("itaoke.robot.macsend.card", map);
|
| | | JSONObject resultJson = JSONObject.fromObject(result);
|
| | | if (resultJson.optInt("code") == 1000) {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.alipay;
|
| | |
|
| | | import org.apache.commons.lang3.ArrayUtils;
|
| | | import org.apache.commons.lang3.StringUtils;
|
| | | |
| | | import java.lang.reflect.Field;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Enumeration;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.TreeMap;
|
| | | |
| | | import javax.servlet.http.HttpServletRequest;
|
| | | |
| | | |
| | | public class AliPaySignUtil {
|
| | | |
| | | /**
|
| | | * 连接Map键值对
|
| | | *
|
| | | * @param map
|
| | | * Map
|
| | | * @param prefix
|
| | | * 前缀
|
| | | * @param suffix
|
| | | * 后缀
|
| | | * @param separator
|
| | | * 连接符
|
| | | * @param ignoreEmptyValue
|
| | | * 忽略空值
|
| | | * @param ignoreKeys
|
| | | * 忽略Key
|
| | | * @return 字符串
|
| | | */
|
| | | public static String joinKeyValue(Map<String, Object> map, String prefix, String suffix, String separator,
|
| | | boolean ignoreEmptyValue, String... ignoreKeys) {
|
| | | List<String> list = new ArrayList<String>();
|
| | | if (map != null) {
|
| | | for (Map.Entry<String, Object> entry : map.entrySet()) {
|
| | | String key = entry.getKey();
|
| | | String value = String.valueOf(entry.getValue());
|
| | | if (StringUtils.isNotEmpty(key) && !ArrayUtils.contains(ignoreKeys, key)
|
| | | && (!ignoreEmptyValue || StringUtils.isNotEmpty(value))) {
|
| | | list.add(key + "=" + (value != null ? value : ""));
|
| | | }
|
| | | }
|
| | | }
|
| | | return (prefix != null ? prefix : "") + StringUtils.join(list, separator) + (suffix != null ? suffix : "");
|
| | | }
|
| | | |
| | | /**
|
| | | * 把request请求参数转换为Map<String,String>
|
| | | * @param request 该请求
|
| | | * @return Map<String,String>格式的参数
|
| | | */
|
| | | public static Map<String,String> request2Map(HttpServletRequest request){
|
| | | Enumeration<String> names = request.getParameterNames();
|
| | | Map<String, String> resData = new HashMap<String, String>();
|
| | | while (names.hasMoreElements()) {
|
| | | String name = names.nextElement();
|
| | | resData.put(name, request.getParameter(name));
|
| | | }
|
| | | return resData;
|
| | | }
|
| | | |
| | | /**
|
| | | * Bean转map
|
| | | * @param bean 要转的bean
|
| | | * @return 返回一个TreeMap
|
| | | */
|
| | | public static TreeMap<String, String> bean2TreeMap(Object bean) {
|
| | | TreeMap<String, String> requestMap = new TreeMap<String, String>();
|
| | | Class<?> cls = bean.getClass();
|
| | | Field[] fields = cls.getDeclaredFields();
|
| | | try {
|
| | | for (int i = 0; i < fields.length; i++) {
|
| | | String key = fields[i].getName();
|
| | | fields[i].setAccessible(true);
|
| | | Object value = fields[i].get(bean);
|
| | | if ("sign".equals(key) || value == null || StringUtils.isEmpty(value.toString())) {
|
| | | continue;
|
| | | }
|
| | | requestMap.put(key, value.toString());
|
| | | }
|
| | | } catch (IllegalAccessException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return requestMap;
|
| | | }
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.util.alipay;
|
| | |
|
| | | import java.net.URLEncoder;
|
| | | import java.util.HashMap;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.alibaba.fastjson.JSON;
|
| | | import com.alipay.api.AlipayClient;
|
| | | import com.alipay.api.DefaultAlipayClient;
|
| | | import com.alipay.api.request.AlipayTradeQueryRequest;
|
| | | import com.alipay.api.request.AlipayTradeWapPayRequest;
|
| | | import com.alipay.api.response.AlipayTradeQueryResponse;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public class AlipayApi {
|
| | |
|
| | | /**
|
| | | * 创建支付请求
|
| | | * @param map
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public static String tradeWapPayRequest(Map<String, String> map, String payNotify, String backUrl) throws Exception{
|
| | | AlipayTradeWapPayRequest alipayRequest = new AlipayTradeWapPayRequest();
|
| | | // 前台回调地址
|
| | | alipayRequest.setReturnUrl(backUrl);
|
| | | // 成功付款回调
|
| | | alipayRequest.setNotifyUrl(payNotify);
|
| | | |
| | | alipayRequest.setBizContent(URLEncoder.encode(JSON.toJSONString(map), "UTF-8"));
|
| | | |
| | | return AlipayWapConfig.getInstance().pageExecute(alipayRequest).getBody();
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 查询是否交易完成
|
| | | * @param outTradeNo
|
| | | * @param tradeNo
|
| | | * @param orgPid
|
| | | * @param queryOptions
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public static boolean tradeQuery (String outTradeNo, String tradeNo, String orgPid, String queryOptions) throws Exception {
|
| | | // 订单支付时传入的商户订单号,和支付宝交易号不能同时为空
|
| | | if (StringUtil.isNullOrEmpty(outTradeNo) || StringUtil.isNullOrEmpty(outTradeNo)) {
|
| | | return false;
|
| | | }
|
| | | |
| | | // 待请求参数数组
|
| | | Map<String, String> map = new HashMap<String, String>();
|
| | | if (!StringUtil.isNullOrEmpty(outTradeNo))
|
| | | map.put("out_trade_no", outTradeNo);
|
| | | if (!StringUtil.isNullOrEmpty(tradeNo))
|
| | | map.put("trade_no", tradeNo);
|
| | | if (!StringUtil.isNullOrEmpty(orgPid))
|
| | | map.put("org_pid", orgPid);
|
| | | if (!StringUtil.isNullOrEmpty(queryOptions))
|
| | | map.put("query_options", queryOptions);
|
| | | |
| | | |
| | | AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
|
| | | request.setBizContent(URLEncoder.encode(JSON.toJSONString(map), "UTF-8"));
|
| | | |
| | | // 支付宝查询
|
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", AlipayWapConfig.APP_ID,
|
| | | AlipayWapConfig.APP_PRIVATE_KEY, AlipayWapConfig.PARAM_TYPE, AlipayWapConfig.CHARSET,
|
| | | AlipayWapConfig.ALIPAY_PUBLIC_KEY, AlipayWapConfig.SIGNTYPE);
|
| | | |
| | | AlipayTradeQueryResponse response = alipayClient.execute(request);
|
| | | if(response.isSuccess()){
|
| | | // 相应成功
|
| | | if ("TRADE_SUCCESS".equals(response.getTradeStatus())) { |
| | | return true; // 交易支付成功
|
| | | } else if ("TRADE_FINISHED".equals(response.getTradeStatus())) {
|
| | | return true; // (交易结束,不可退款)
|
| | | } |
| | | } |
| | | return false;
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.alipay;
|
| | |
|
| | | import com.alipay.api.AlipayClient;
|
| | | import com.alipay.api.DefaultAlipayClient;
|
| | | |
| | |
|
| | | public class AlipayWapConfig {
|
| | | // 商户appid
|
| | | //public static String APP_ID = "2021001164655513";
|
| | | |
| | | //沙箱环境
|
| | | public static String APP_ID = "2016102100734118";
|
| | | |
| | | /**
|
| | | * 你的私钥 私钥 pkcs8格式的
|
| | | */
|
| | | public static String APP_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDtWSMDXc3O7HcWcWiDzbmYyZDAEkVK2arOoPGwPLlxDXXpfPv6s2P9qRmXub6rrpbrKtIRpdbjbAJAwyDfIDBHiQzwWBqAPMk+G+1mrhU/NQEWcu0IT410j0MVODpz3X2zlb4UN7bzmkCkmLS7+/1fhKRQTql+2RXpeDuBvSdYlitVxNoXscPwm+xE7zZ84qS2agOUJHA+HGvb5mpEzA3kNPdGMm6hx0CzcEbNeI9AmbFJyXf6vZuHaQRcAe68MZObECIt/RwJfg+YnKwuDJYW+9+iMEUPbfg9ZjQB8062uPC8mddSPcxslP8//svmTXu+bz1Pl4v2FftErO1w/m5tAgMBAAECggEAXpTawwiqbv8EJcljoMJmZ2BLcn7VZhJ/Yn/4UAaiz05R4o2PzEOYYQj1zeSS+s9EDMqvk6DGlTIBY9VeUAv/sUIICe7SALA4caunWvecN+fjWxLJKjqpX/2G+fnCMVHeOaY+bMgW+9RIVk8UFqVAPsQYxnfSS14uwS7MZ9L8zuukNcYXdfZk030usztQaVkZWAddukUjA0YmquTUArZ63uEcU+LlfOpmWZ7JSiX2H7lIn6Fwilo3N3/J3eqTgTlw5N4V2Dvr962xlIzlJ+d5OuH9tRCEHcNaru2GYa/+trVGzbXwsGuCrtLxeFPQOb5HVmh77IMJbESGMe6V3U/BgQKBgQD6ZYSkrYBIdGGewQkPIFcdHa+ElpT5fCuA1ZamCeeOMKM+08r3dRfhxHWY9RuZDEULzcmHU8X44zA6uxU0qVU6Q07KIGWFUf85G4qcbrL+VV1yHGL3t8vbwRljaAZ6hTeEI/2Vfl8UgsvfV4goc7avvxRM2uYjYb5I5mEakTQIVQKBgQDyqN3b0faP5SIWxkLjXYy4Am5LX97FwtTdNm1DUCi1San/wnBQPb4K3iWp4DZgcjWWxZN8AWWkbabV9oPdwaXxxHRZSPo9AkqPGt2A+iiHxl7xCotM95Mg+OgIe5e9bN5+QBtZ9Sg0xe6bMMDlbBhLvGMIZzcOKzPLtoKkDw/FuQKBgQD367YmuycOFjVl02ld0b6PNIpJdDLyxq/oMxKjOaFMVvn7RgZrd0N7JWLuXJnDsrNWmZ3VYOven0tsiznW12ZsdqI3XVZHZ8WVTKC0fKK7UdhhGJwg+5lb71hs5V2sx+QM8Pmun94SV+L2Mxu8Ob4DSuUVp5NAKxIV6gzxGh3ztQKBgH94e8ssucQPTt/92EdN7kz/YecQfpsOZPmrzKvuoOPSxY3IG23bcUiON+TMFmSFumbwdTBQH4/H1jtRmyXTwxOE6sW4U1PXL0mLiE5nmwDwERG4Q0L0TwKkHmfOXQCx/xL9JCEWar+GNnipnLsoFH88gB168u3rffMGdgwuqU9pAoGATKuOiyHqe8mE5xezVqD3R/yaUo/yjGfV6WedsUEI9Dh1T1MJaehdOyzuxe7h5IVwlsPwy29l0wJ80L0+oO9O9CL9OsxiwNO6QK7nyqI0JfSJc0VhettXxWexVq3eSj0CnFd5ksiDwmmBgCs2r2zEmhyKt/fNmI7yn6djuyVjWT4=";
|
| | | |
| | | /**
|
| | | * 编码
|
| | | */
|
| | | public static String CHARSET = "UTF-8";
|
| | | /**
|
| | | * 支付宝公钥
|
| | | */
|
| | | public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzPpFDjI0B1O7S3WDNsUPK1UerFzP+6VGUDVYWDnmU4UcEVYc9/McD8w7+3D2P16achvYF7Xk9gE1TbRTbWkMvIKtwj3MKU+zdevwOTwbvV46UQ3L1DdpFNFx89fYNMf81HTr9oQROIUwSIz2yP0i/CuMW/Tqnb5EWnaz5Ws4m1+ioKKq41oTx6kzF5SxFfvkcRq95KTXgcoNauemUncbjV+Rh2G3ZDBy7sLXKaoY8a5M0jtf1f53MPJJ9LEnJE5oCRj2AHsOMJ4ECjoRTGVJvn2mREoyW8SCDfaT7dPD4bagrspwB/kB2j6P0HnddspB7BfdkuKGSz5YviOhdW3TuwIDAQAB";
|
| | | |
| | | /**
|
| | | * 支付宝网关地址
|
| | | */
|
| | | //private static String GATEWAY = "https://openapi.alipay.com/gateway.do";//正式环境
|
| | |
|
| | | // 请求网关地址
|
| | | public static String GATEWAY = "https://openapi.alipaydev.com/gateway.do";
|
| | | |
| | | |
| | | //private static String GATEWAY = "https://openapi.alipay.com/gateway.do";//沙箱环境
|
| | | /**
|
| | | * 成功付款回调
|
| | | */
|
| | | public static String PAY_NOTIFY = "http://apph5.banliapp.com";//验签
|
| | | /**
|
| | | * 支付成功回调
|
| | | */
|
| | | public static String REFUND_NOTIFY = "";//姑且没用到
|
| | | /**
|
| | | * 前台通知地址
|
| | | */
|
| | | public static String RETURN_URL = "http://apph5.banliapp.com";//支付成功后返回哪个前端页面
|
| | | /**
|
| | | * 参数类型
|
| | | */
|
| | | public static String PARAM_TYPE = "json";
|
| | | /**
|
| | | * 成功标识
|
| | | */
|
| | | public static final String SUCCESS_REQUEST = "TRADE_SUCCESS";
|
| | | /**
|
| | | * 交易关闭回调(当该笔订单全部退款完毕,则交易关闭)
|
| | | */
|
| | | public static final String TRADE_CLOSED = "TRADE_CLOSED";
|
| | | /**
|
| | | * 支付宝开发平台中的支付宝账号(企业)
|
| | | */
|
| | | // public static final String SELLER_ID = "2088231353656741";
|
| | | |
| | | public static final String SELLER_ID = "2088102180556545"; //沙箱环境
|
| | | |
| | | |
| | | |
| | | //签名算法类型(根据生成私钥的算法,RSA2或RSA)
|
| | | public static final String SIGNTYPE = "RSA2";
|
| | | |
| | | /**
|
| | | * 支付宝请求客户端入口
|
| | | */
|
| | | private volatile static AlipayClient alipayClient = null;
|
| | | |
| | | |
| | | /**
|
| | | * 不可实例化
|
| | | */
|
| | | private AlipayWapConfig(){};
|
| | | |
| | | /**
|
| | | * 双重锁单例
|
| | | * @return 支付宝请求客户端实例
|
| | | */
|
| | | public static AlipayClient getInstance(){
|
| | | if (alipayClient == null){
|
| | | synchronized (AlipayWapConfig.class){
|
| | | if (alipayClient == null){
|
| | | alipayClient = new DefaultAlipayClient(GATEWAY,APP_ID,APP_PRIVATE_KEY,PARAM_TYPE,CHARSET,ALIPAY_PUBLIC_KEY,SIGNTYPE);
|
| | | }
|
| | | }
|
| | | }
|
| | | return alipayClient;
|
| | | }
|
| | | } |
| | |
| | | cg.setCouponInfo(String.format("满%s元减%s元", goods.getCouponInfo().getBounsLimit(),
|
| | | goods.getCouponInfo().getCouponValue()));
|
| | | cg.setCouponAmount(new BigDecimal(goods.getCouponInfo().getCouponValue()));
|
| | | cg.setCouponLeftCount(Integer.parseInt(goods.getCouponInfo().getCouponCount()));
|
| | | cg.setCouponTotalCount(Integer.parseInt(goods.getCouponInfo().getCouponCount()));
|
| | | |
| | | if (goods.getCouponInfo().getCouponCount() == null) {
|
| | | cg.setCouponLeftCount(500000);
|
| | | cg.setCouponTotalCount(500000);
|
| | | } else {
|
| | | cg.setCouponLeftCount(Integer.parseInt(goods.getCouponInfo().getCouponCount()));
|
| | | cg.setCouponTotalCount(Integer.parseInt(goods.getCouponInfo().getCouponCount()));
|
| | | }
|
| | | |
| | | cg.setCouponStartPrice(new BigDecimal(goods.getCouponInfo().getBounsLimit()));
|
| | | } else {
|
| | | cg.setCouponLeftCount(0);
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | public class CommonOrderGoodsFactory {
|
| | |
|
| | |
| | | goods.setGoodsType(Constant.SOURCE_TYPE_SUNING);
|
| | | if (suningGoods.getCommodityInfo().getPictureUrl().size() > 0)
|
| | | goods.setPicture(suningGoods.getCommodityInfo().getPictureUrl().get(0).getPicUrl());
|
| | | goods.setPrice(new BigDecimal(suningGoods.getCommodityInfo().getCommodityPrice()));
|
| | | |
| | | String commodityPrice = suningGoods.getCommodityInfo().getCommodityPrice();
|
| | | if (StringUtil.isNullOrEmpty(commodityPrice)) {
|
| | | commodityPrice = suningGoods.getCommodityInfo().getSnPrice();
|
| | | }
|
| | | goods.setPrice(new BigDecimal(commodityPrice));
|
| | | goods.setShopId(Long.parseLong(suningGoods.getCommodityInfo().getSupplierCode()));
|
| | | goods.setShopName(suningGoods.getCommodityInfo().getSupplierName());
|
| | | goods.setShopType("苏宁");
|
| | |
| | | goodsInfo.setPriceName("原价");
|
| | | if (goods.getCommodityInfo().getPictureUrl().size() > 0)
|
| | | goodsInfo.setPicUrl(goods.getCommodityInfo().getPictureUrl().get(0).getPicUrl()); // 缩略图
|
| | | goodsInfo.setZkPrice(
|
| | | MoneyBigDecimalUtil.getWithNoZera(new BigDecimal(goods.getCommodityInfo().getCommodityPrice())));
|
| | | |
| | | |
| | | String commodityPrice = goods.getCommodityInfo().getCommodityPrice();
|
| | | if (StringUtil.isNullOrEmpty(commodityPrice)) {
|
| | | commodityPrice = goods.getCommodityInfo().getSnPrice();
|
| | | }
|
| | | goodsInfo.setZkPrice(MoneyBigDecimalUtil.getWithNoZera(new BigDecimal(commodityPrice)));
|
| | | goodsInfo.setShopType(CommonGoods.SHOP_TYPE_SUNING);
|
| | |
|
| | | List<String> imgList = new ArrayList<>();
|
| | |
| | | moneyInfoVO
|
| | | .setMaxMoney("¥" + commission.add(MoneyBigDecimalUtil.mul(commission, params.getMaxRewardRate())));
|
| | | else {
|
| | | BigDecimal price = new BigDecimal(goods.getCommodityInfo().getCommodityPrice());
|
| | | BigDecimal price = new BigDecimal(commodityPrice);
|
| | | BigDecimal rate = MoneyBigDecimalUtil.div(commission.multiply(new BigDecimal(100)), price);
|
| | | moneyInfoVO.setRateInfo("返利比 " + rate + "%");
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.util.mybatishandler;
|
| | |
|
| | | import java.sql.CallableStatement;
|
| | | import java.sql.PreparedStatement;
|
| | | import java.sql.ResultSet;
|
| | | import java.sql.SQLException;
|
| | |
|
| | | import org.apache.ibatis.type.BaseTypeHandler;
|
| | | import org.apache.ibatis.type.JdbcType;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.CloudOrderMenuEnum;
|
| | |
|
| | | public class CloudOrderMenuEnumHandler extends BaseTypeHandler<CloudOrderMenuEnum> {
|
| | |
|
| | | @Override
|
| | | public CloudOrderMenuEnum getNullableResult(ResultSet arg0, String arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | return CloudOrderMenuEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public CloudOrderMenuEnum getNullableResult(ResultSet arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return CloudOrderMenuEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public CloudOrderMenuEnum getNullableResult(CallableStatement arg0, int arg1) throws SQLException {
|
| | | String key = arg0.getString(arg1);
|
| | | if (arg0.wasNull()) {
|
| | | return null;
|
| | | } else {
|
| | | // 根据数据库中的key值,定位SexEnum子类
|
| | | return CloudOrderMenuEnum.valueOf(key);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void setNonNullParameter(PreparedStatement arg0, int arg1, CloudOrderMenuEnum arg2, JdbcType arg3)
|
| | | throws SQLException {
|
| | | arg0.setString(arg1, arg2.name());
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.util.rocketmq.consumer.user;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Component;
|
| | |
|
| | | import com.aliyun.openservices.ons.api.Action;
|
| | | import com.aliyun.openservices.ons.api.ConsumeContext;
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.MessageListener;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.mq.order.OrderTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderConfirmMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.order.body.OrderMoneyRecievedMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserCloudMQMsg;
|
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | /**
|
| | | * 用户云发单
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Component
|
| | | public class UserCloudMessageListener implements MessageListener {
|
| | |
|
| | | @Resource
|
| | | private UserCloudService userCloudService;
|
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | | LogHelper.mqInfo("consumer-UserCloudMessageListener", message.getMsgID(), message.getTopic(), message.getTag(),
|
| | | new String(message.getBody()));
|
| | | String tag = message.getTag();
|
| | | if (tag == null)
|
| | | tag = "";
|
| | |
|
| | | if (java.lang.System.currentTimeMillis() <= Constant.NEW_ORDER_FANLI_RULE_TIME) {
|
| | | return Action.CommitMessage;
|
| | | }
|
| | |
|
| | | // 邀请相关
|
| | | if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(UserTopicTagEnum.userCloud.name())) {// 用户等级发生变化
|
| | | UserCloudMQMsg msg = new Gson().fromJson(new String(message.getBody()),UserCloudMQMsg.class);
|
| | | if (msg.getType() == UserCloudMQMsg.TYPE_EVALUATE) {
|
| | | userCloudService.autoSendByDynamic(msg.getUid(), msg.getId());
|
| | | } else {
|
| | | userCloudService.autoSendCustomGoods(msg.getUid(), Long.parseLong(msg.getId()));
|
| | | }
|
| | | } |
| | | }
|
| | |
|
| | | return Action.CommitMessage;
|
| | | }
|
| | | }
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfo;
|
| | | import com.yeshi.fanli.dto.suning.SuningGoodsInfoRecommend;
|
| | | import com.yeshi.fanli.dto.suning.SuningOrderQueryResultDTO;
|
| | | import com.yeshi.fanli.dto.suning.SuningQueryModel;
|
| | | import com.yeshi.fanli.entity.suning.SuningOrderInfo;
|
| | |
| | | model.setPicHeight(320);
|
| | | String key = "querySearchcommoditynew";
|
| | | String json = new Gson().toJson(model);
|
| | | //String result = baseRequest("suning.netalliance.searchcommoditynew.query", key, JSONObject.fromObject(json));
|
| | | String result = baseRequest("suning.netalliance.searchcommoditynew.query", key, JSONObject.fromObject(json));
|
| | | JSONObject resultJSON = JSONObject.fromObject(result);
|
| | | JSONArray array = resultJSON.optJSONObject("sn_responseContent").optJSONObject("sn_body").optJSONObject(key)
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 查询商品
|
| | | * @Title: searchGoods
|
| | | * @Description: |
| | | * @param model
|
| | | * @return |
| | | * List<SuningGoodsInfo> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static List<SuningGoodsInfo> searchGoodsOld(SuningQueryModel model) {
|
| | | model.setPicWidth(320);
|
| | | model.setPicHeight(320);
|
| | | String key = "querySearchcommodity";
|
| | | String json = new Gson().toJson(model);
|
| | | String result = baseRequest("suning.netalliance.searchcommodity.query", key, JSONObject.fromObject(json));
|
| | | JSONObject resultJSON = JSONObject.fromObject(result);
|
| | | JSONObject responseContent = resultJSON.optJSONObject("sn_responseContent");
|
| | | if (responseContent != null) {
|
| | | JSONObject snBody = responseContent.optJSONObject("sn_body");
|
| | | if (snBody != null) {
|
| | | JSONArray array = snBody.optJSONArray(key);
|
| | | if (array != null) {
|
| | | Type type = new TypeToken<ArrayList<SuningGoodsInfo>>() {
|
| | | }.getType();
|
| | | List<SuningGoodsInfo> goodsList = new Gson().fromJson(array.toString(), type);
|
| | | return goodsList;
|
| | | }
|
| | | }
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | public static SuningGoodsInfo getGoodsDetail(String goodsCode, String supplierCode) {
|
| | | JSONObject model = new JSONObject();
|
| | | model.put("commodityStr", goodsCode + "-" + supplierCode);
|
| | |
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询关联商品
|
| | | * @Title: searchGoods
|
| | | * @Description: |
| | | * @param model
|
| | | * @return |
| | | * List<SuningGoodsInfo> 返回类型
|
| | | * @throws
|
| | | */
|
| | | public static List<SuningGoodsInfoRecommend> getRecommendGoods(String goodsCode, String supplierCode) {
|
| | | JSONObject model = new JSONObject();
|
| | | model.put("commodityCode", goodsCode);
|
| | | model.put("supplierCode", supplierCode);
|
| | | model.put("picWidth", 320);
|
| | | model.put("picHeight", 320);
|
| | | |
| | | String key = "getMorerecommend";
|
| | | String json = new Gson().toJson(model);
|
| | | String result = baseRequest("suning.netalliance.morerecommend.get", key, JSONObject.fromObject(json));
|
| | | JSONObject resultJSON = JSONObject.fromObject(result);
|
| | | JSONArray array = resultJSON.optJSONObject("sn_responseContent").optJSONObject("sn_body").optJSONObject(key)
|
| | | .optJSONArray("commodityList");
|
| | | if (array != null) {
|
| | | Type type = new TypeToken<ArrayList<SuningGoodsInfoRecommend>>() {
|
| | | }.getType();
|
| | | List<SuningGoodsInfoRecommend> goodsList = new Gson().fromJson(array.toString(), type);
|
| | | return goodsList;
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | public static List<SuningGoodsInfo> getGoodsDetailList(List<String> list) {
|
| | | String sts = "";
|
| | |
| | |
|
| | | BigDecimal hundred = new BigDecimal(100);
|
| | | rate = MoneyBigDecimalUtil.div(rate, hundred);
|
| | | |
| | | String commodityPrice = goods.getCommodityInfo().getCommodityPrice();
|
| | | if (StringUtil.isNullOrEmpty(commodityPrice)) {
|
| | | commodityPrice = goods.getCommodityInfo().getSnPrice();
|
| | | }
|
| | |
|
| | | BigDecimal afterUseCouponPrice = new BigDecimal(goods.getCommodityInfo().getCommodityPrice());
|
| | | BigDecimal afterUseCouponPrice = new BigDecimal(commodityPrice);
|
| | | if (goods.getCouponInfo() != null && !StringUtil.isNullOrEmpty(goods.getCouponInfo().getCouponUrl())) {
|
| | | // 有券
|
| | | BigDecimal startPrice = new BigDecimal(goods.getCouponInfo().getBounsLimit());
|
| | |
| | | if (resultJson.optInt("returnCode") == 0) {
|
| | | resultJson = resultJson.optJSONObject("result");
|
| | | int count = resultJson.optInt("total");
|
| | | |
| | | JSONArray array = resultJson.optJSONArray("goodsInfoList");
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | VIPGoodsInfo info = gson.fromJson(array.optJSONObject(i).toString(), VIPGoodsInfo.class);
|
| | | if (info != null)
|
| | | goodsList.add(info);
|
| | | if (array != null && array.size() > 0) {
|
| | | for (int i = 0; i < array.size(); i++) {
|
| | | JSONObject optJSONObject = array.optJSONObject(i);
|
| | | if (optJSONObject == null) {
|
| | | continue;
|
| | | }
|
| | | VIPGoodsInfo info = gson.fromJson(array.optJSONObject(i).toString(), VIPGoodsInfo.class);
|
| | | if (info != null)
|
| | | goodsList.add(info);
|
| | | }
|
| | | }
|
| | | |
| | | return new VIPSearchResult(goodsList, count);
|
| | | }
|
| | | return null;
|
| | |
| | | *
|
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | |
|
| | | // 是否IOS上线
|
| | | @Expose
|
| | | private boolean iosOnling;
|
| | |
| | | // 是否跳转原生APP
|
| | | @Expose
|
| | | private Boolean isNative;
|
| | | |
| | |
|
| | | // 图文详情链接
|
| | | @Expose
|
| | | private String detailUrl;
|
| | |
| | | @Expose
|
| | | private List<ShamUser> listCouponUser;
|
| | | @Expose
|
| | | private String couponJumpLink;//券跳转链接,拼多多专用
|
| | | private String couponJumpLink;// 券跳转链接,拼多多专用
|
| | | @Expose
|
| | | private String nativeCouponJumpLink;//原生券跳转链接,拼多多专用
|
| | | private String nativeCouponJumpLink;// 原生券跳转链接,拼多多专用
|
| | | @Expose
|
| | | private Boolean vip;//是否为VIP
|
| | | private Boolean vip;// 是否为VIP
|
| | |
|
| | | // 云发单文字
|
| | | @Expose
|
| | | private boolean cloudOpen;
|
| | | @Expose
|
| | | private String cloudPic;
|
| | | // 云发单文字
|
| | | @Expose
|
| | | private String cloudText;
|
| | | |
| | | |
| | | |
| | |
|
| | | public Boolean getVip() {
|
| | | return vip;
|
| | |
| | | this.listCouponUser = listCouponUser;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | public boolean isCloudOpen() {
|
| | | return cloudOpen;
|
| | | }
|
| | |
|
| | | public void setCloudOpen(boolean cloudOpen) {
|
| | | this.cloudOpen = cloudOpen;
|
| | | }
|
| | | |
| | | }
|
| | |
| | |
|
| | | @Expose
|
| | | private RewardCouponVO rewardCoupon;
|
| | | |
| | |
|
| | | @Expose
|
| | | private String fanliMoneyPlus;
|
| | | |
| | | |
| | |
|
| | | public RewardCouponVO getRewardCoupon() {
|
| | | return rewardCoupon;
|
| | |
| | | public void setFanliMoneyPlus(String fanliMoneyPlus) {
|
| | | this.fanliMoneyPlus = fanliMoneyPlus;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | private BigDecimal lastMonthSettleMoney;// 上月已收货
|
| | | private BigDecimal notSettleMoney;// 待确认收货
|
| | |
|
| | | private BigDecimal monthUnRecievedMoney; // 本月未到账
|
| | | private BigDecimal totalUnRecievedMoney; // 全部未到账
|
| | |
|
| | | private MoneyPredictVO todayPredict;// 今日预估
|
| | | private MoneyPredictVO monthPredict;// 本月预估
|
| | | |
| | |
|
| | |
|
| | | public BigDecimal getBalanceMoney() {
|
| | | return balanceMoney;
|
| | |
| | | public void setLink(String link) {
|
| | | this.link = link;
|
| | | }
|
| | |
|
| | | public BigDecimal getMonthUnRecievedMoney() {
|
| | | return monthUnRecievedMoney;
|
| | | }
|
| | |
|
| | | public void setMonthUnRecievedMoney(BigDecimal monthUnRecievedMoney) {
|
| | | this.monthUnRecievedMoney = monthUnRecievedMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getTotalUnRecievedMoney() {
|
| | | return totalUnRecievedMoney;
|
| | | }
|
| | |
|
| | | public void setTotalUnRecievedMoney(BigDecimal totalUnRecievedMoney) {
|
| | | this.totalUnRecievedMoney = totalUnRecievedMoney;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | @Expose
|
| | | private String content;
|
| | | @Expose
|
| | | private String color;
|
| | | private String color; // 字颜色
|
| | | @Expose
|
| | | private String bottomColor;
|
| | | private String bottomColor; // 背景颜色
|
| | | @Expose
|
| | | private String img;
|
| | | private String borderColor; // 边框颜色
|
| | | @Expose
|
| | | private String img; // 图片
|
| | | @Expose
|
| | | private String fontSize = "1"; // 字体倍数
|
| | |
|
| | |
| | | public void setFontSize(String fontSize) {
|
| | | this.fontSize = fontSize;
|
| | | }
|
| | |
|
| | | public String getBorderColor() {
|
| | | return borderColor;
|
| | | }
|
| | |
|
| | | public void setBorderColor(String borderColor) {
|
| | | this.borderColor = borderColor;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | @Expose
|
| | | private String orderDesc;// 订单描述
|
| | |
|
| | | |
| | | // 店铺类型 2.1.2新增
|
| | | @Expose
|
| | | private ClientTextStyleVO shopType;
|
| | |
|
| | | |
| | |
|
| | | public String getVipOrderDesc() {
|
| | | return vipOrderDesc;
|
| | |
| | | public void setRebateLink(String rebateLink) {
|
| | | this.rebateLink = rebateLink;
|
| | | }
|
| | |
|
| | | public ClientTextStyleVO getShopType() {
|
| | | return shopType;
|
| | | }
|
| | |
|
| | | public void setShopType(ClientTextStyleVO shopType) {
|
| | | this.shopType = shopType;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | // 用户VIP等级
|
| | | private String userLevel;
|
| | |
|
| | | // 邀请人
|
| | | private String bossName;
|
| | | // 邀请码
|
| | | private String inviteCode;
|
| | | // 邀请码
|
| | | private String inviteCodeVip;
|
| | | // 微信号
|
| | | private String wxId;
|
| | |
|
| | | // 总消耗金币
|
| | | private long totalGoldCoinUsed;
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | public String getRankId() {
|
| | |
| | | public void setInviteCode(String inviteCode) {
|
| | | this.inviteCode = inviteCode;
|
| | | }
|
| | |
|
| | | public String getInviteCodeVip() {
|
| | | return inviteCodeVip;
|
| | | }
|
| | |
|
| | | public void setInviteCodeVip(String inviteCodeVip) {
|
| | | this.inviteCodeVip = inviteCodeVip;
|
| | | }
|
| | |
|
| | | public long getTotalGoldCoinUsed() {
|
| | | return totalGoldCoinUsed;
|
| | | }
|
| | |
|
| | | public void setTotalGoldCoinUsed(long totalGoldCoinUsed) {
|
| | | this.totalGoldCoinUsed = totalGoldCoinUsed;
|
| | | }
|
| | |
|
| | | public String getBossName() {
|
| | | return bossName;
|
| | | }
|
| | |
|
| | | public void setBossName(String bossName) {
|
| | | this.bossName = bossName;
|
| | | }
|
| | |
|
| | | public String getWxId() {
|
| | | return wxId;
|
| | | }
|
| | |
|
| | | public void setWxId(String wxId) {
|
| | | this.wxId = wxId;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.user.cloud;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.cloud.UserCloudGroup;
|
| | |
|
| | | public class UserCloudInfoVO {
|
| | |
|
| | | private String nickName;// 昵称
|
| | |
|
| | | private String portrait;// 头像
|
| | |
|
| | | private String wxName;// 微信昵称
|
| | |
|
| | | private String openTime;// 开通时间
|
| | |
|
| | | private String countdown;// 倒计时间
|
| | |
|
| | | private Integer openState;// 开通状态
|
| | |
|
| | | private boolean loginState;// 登录状态
|
| | |
|
| | | private boolean circle;// 开通状态
|
| | |
|
| | | private List<UserCloudGroup> listGroup;// 群信息
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getPortrait() {
|
| | | return portrait;
|
| | | }
|
| | |
|
| | | public void setPortrait(String portrait) {
|
| | | this.portrait = portrait;
|
| | | }
|
| | |
|
| | | public String getWxName() {
|
| | | return wxName;
|
| | | }
|
| | |
|
| | | public void setWxName(String wxName) {
|
| | | this.wxName = wxName;
|
| | | }
|
| | |
|
| | | public String getOpenTime() {
|
| | | return openTime;
|
| | | }
|
| | |
|
| | | public void setOpenTime(String openTime) {
|
| | | this.openTime = openTime;
|
| | | }
|
| | |
|
| | | public String getCountdown() {
|
| | | return countdown;
|
| | | }
|
| | |
|
| | | public void setCountdown(String countdown) {
|
| | | this.countdown = countdown;
|
| | | }
|
| | |
|
| | | public Integer getOpenState() {
|
| | | return openState;
|
| | | }
|
| | |
|
| | | public void setOpenState(Integer openState) {
|
| | | this.openState = openState;
|
| | | }
|
| | |
|
| | | public boolean isLoginState() {
|
| | | return loginState;
|
| | | }
|
| | |
|
| | | public void setLoginState(boolean loginState) {
|
| | | this.loginState = loginState;
|
| | | }
|
| | |
|
| | | public boolean isCircle() {
|
| | | return circle;
|
| | | }
|
| | |
|
| | | public void setCircle(boolean circle) {
|
| | | this.circle = circle;
|
| | | }
|
| | |
|
| | | public List<UserCloudGroup> getListGroup() {
|
| | | return listGroup;
|
| | | }
|
| | |
|
| | | public void setListGroup(List<UserCloudGroup> listGroup) {
|
| | | this.listGroup = listGroup;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | log4j.appender.teamLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.teamLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|
| | | log4j.logger.tljLog=info,cloudLog
|
| | | log4j.appender.tljLog=org.apache.log4j.DailyRollingFileAppender
|
| | | log4j.appender.tljLog.File=logs/request/cloudLog.log
|
| | | log4j.appender.tljLog.MaxFileSize=20MB
|
| | | log4j.appender.tljLog.MaxBackupIndex=100
|
| | | log4j.appender.tljLog.layout=org.apache.log4j.PatternLayout
|
| | | log4j.appender.tljLog.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
|
| | |
|
| | |
|
| | | log4j.appender.mongodb=org.apache.log4j.ConsoleAppender
|
| | | log4j.appender.mongodb.Target=System.out
|
| | |
| | | </bean>
|
| | |
|
| | |
|
| | | <!-- 云发单消息接收 -->
|
| | | <bean id="userCloudMessageListener"
|
| | | class="com.yeshi.fanli.util.rocketmq.consumer.user.UserCloudMessageListener"></bean>
|
| | |
|
| | | <bean id="userCloudConsumer" class="com.aliyun.openservices.ons.api.bean.ConsumerBean"
|
| | | init-method="start" destroy-method="shutdown">
|
| | | <property name="properties"> <!--消费者配置信息 -->
|
| | | <props>
|
| | | <prop key="AccessKey">${rocketmq.AccessKey}</prop>
|
| | | <prop key="SecretKey">${rocketmq.SecretKey}</prop>
|
| | | <prop key="GROUP_ID">GID_USER_CLOUD</prop>
|
| | | <prop key="NAMESRV_ADDR">${rocketmq.NAMESRV_ADDR}</prop>
|
| | | <prop key="ConsumeThreadNums">50</prop>
|
| | | </props>
|
| | | </property>
|
| | | <property name="subscriptionTable">
|
| | | <map>
|
| | | <entry value-ref="userCloudMessageListener">
|
| | | <key>
|
| | | <bean class="com.aliyun.openservices.ons.api.bean.Subscription">
|
| | | <property name="topic" value="TOPIC_USER" />
|
| | | <property name="expression" value="userCloud" />
|
| | | </bean>
|
| | | </key>
|
| | | </entry>
|
| | | </map>
|
| | | </property>
|
| | | </bean>
|
| | |
|
| | |
|
| | |
|
| | |
| | | <version>2.11.2</version>
|
| | | </dependency>
|
| | |
|
| | | <dependency>
|
| | | <!-- <dependency>
|
| | | <groupId>org.bouncycastle</groupId>
|
| | | <artifactId>bcprov-jdk16</artifactId>
|
| | | <version>1.46</version>
|
| | | </dependency>
|
| | | </dependency> -->
|
| | | |
| | | <!-- 支付宝相关 -->
|
| | | <dependency>
|
| | | <groupId>com.alipay.sdk</groupId>
|
| | | <artifactId>alipay-sdk-java</artifactId>
|
| | | <version>4.9.71.ALL</version>
|
| | | </dependency>
|
| | | <!--StringUtils-->
|
| | | <!-- <dependency>
|
| | | <groupId>org.apache.commons</groupId>
|
| | | <artifactId>commons-lang3</artifactId>
|
| | | <version>3.8.1</version>
|
| | | </dependency> -->
|
| | |
|
| | | </dependencies>
|
| | |
|
| | | <build>
|