Merge remote-tracking branch 'origin/div' into div
Conflicts:
fanli/src/main/java/com/yeshi/fanli/mapping/ThreeSaleMapper.xml
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "saveActivityPic") |
| | | public void saveActivityPic(String callback, String pid, ImgInfo imgInfo, HttpServletRequest request, |
| | | public void saveActivityPic(String callback, String pid, ImgInfo imgInfo, String picUrls, HttpServletRequest request, |
| | | PrintWriter out) { |
| | | try { |
| | | MultipartHttpServletRequest fileRequest = null; |
| | | if (request instanceof MultipartHttpServletRequest) { |
| | | fileRequest = (MultipartHttpServletRequest) request; |
| | | } |
| | | goodsEvaluateService.saveActivityPic(pid, imgInfo, fileRequest); |
| | | goodsEvaluateService.saveActivityPic(pid, imgInfo,picUrls, fileRequest); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功")); |
| | | } catch (GoodsEvaluateException e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); |
| | |
| | | try { |
| | | String videoPic = ""; |
| | | String videoUrl = ""; |
| | | String activityPic = ""; |
| | | String activityUrl = ""; |
| | | List<String> list = new ArrayList<String>(); |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid); |
| | | if (goodsEvaluate != null && goodsEvaluate.getImgList() != null && goodsEvaluate.getImgList().size() > 0) { |
| | | activityUrl = goodsEvaluate.getJumpLink(); |
| | | List<ImgInfo> imgList = goodsEvaluate.getImgList(); |
| | | for (ImgInfo imgInfo : imgList) { |
| | | ImgEnum type = imgInfo.getType(); |
| | | if (type == ImgEnum.video) { |
| | | videoPic = imgInfo.getUrl(); |
| | | videoUrl = imgInfo.getVideoUrl(); |
| | | } else if (type == ImgEnum.activity) { |
| | | activityPic = imgInfo.getUrl(); |
| | | activityUrl = imgInfo.getActivityUrl(); |
| | | } else { |
| | | list.add(imgInfo.getUrl()); |
| | | } |
| | | } |
| | | } |
| | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("videoUrl", videoUrl); |
| | | data.put("videoPic", videoPic); |
| | | data.put("activityPic", activityPic); |
| | | data.put("listPic", list); |
| | | data.put("activityUrl", activityUrl); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "query") |
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, |
| | | PrintWriter out) { |
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, String typeEnum, PrintWriter out) { |
| | | if (pageIndex == null || pageIndex < 1) { |
| | | pageIndex = 1; |
| | | } |
| | |
| | | } |
| | | |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 1); |
| | | List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 1, typeEnum); |
| | | if (list == null || list.size() == 0) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据")); |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | long count = goodsEvaluateService.count(key, state, 1); |
| | | long count = goodsEvaluateService.count(key, state, 1, typeEnum); |
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); |
| | |
| | | } |
| | | |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 2); |
| | | List<GoodsEvaluate> list = goodsEvaluateService.query((pageIndex - 1) * pageSize, pageSize, key, state, 2, null); |
| | | if (list == null || list.size() == 0) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据")); |
| | | return; |
| | |
| | | } |
| | | } |
| | | |
| | | long count = goodsEvaluateService.count(key, state, 2); |
| | | long count = goodsEvaluateService.count(key, state, 2, null); |
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); |
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 维权订单数 |
| | | * |
| | | * @param callback |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getWeiQaunOrderNumber") |
| | | public void getWeiQaunOrderNumber(String callback, Integer dateType, String year, String startTime, String endTime, |
| | | PrintWriter out) { |
| | | |
| | | |
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime); |
| | | if (validateMsg != null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg)); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 1); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 维权订单金额 |
| | | * |
| | | * @param callback |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getWeiQaunOrderMoney") |
| | | public void getWeiQaunOrderMoney(String callback, Integer dateType, String year, String startTime, String endTime, |
| | | PrintWriter out) { |
| | | |
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime); |
| | | if (validateMsg != null) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg)); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | JSONObject data = countWeiQaunOrder(dateType, year, startTime, endTime, 2); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 统计红包信息 |
| | | * |
| | | * @param channelArray |
| | | * @param dateType |
| | | * @param state |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public JSONObject countWeiQaunOrder(Integer dateType, String year, String startTime, String endTime, int countType) |
| | | throws Exception { |
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) { |
| | | startTime = null; |
| | | endTime = null; |
| | | } |
| | | |
| | | if (dateType == 1 && year != null) { |
| | | year = null; // 设置为空 |
| | | } else if (dateType == 2) { |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) { |
| | | if (year != null) |
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | } |
| | | |
| | | Gson gson = new Gson(); |
| | | Object objectDate = null; |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year); |
| | | |
| | | JSONArray line_list = new JSONArray(); |
| | | List<ChartTDO> list = null; |
| | | if (countType == 1) { |
| | | list = commonOrderCountService.countWeiQaunOrderNumber(dateType, year, startTime, endTime); |
| | | } else if (countType == 2) { |
| | | list = commonOrderCountService.countWeiQaunOrderMoney(dateType, year, startTime, endTime); |
| | | } |
| | | |
| | | JSONObject innerList = new JSONObject(); |
| | | innerList.put("name", "总计"); |
| | | |
| | | if (dateType != 3) { |
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list))); |
| | | } else { |
| | | // 年视图 |
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list); |
| | | |
| | | if (objectDate == null) { |
| | | objectDate = map.get("date"); |
| | | } |
| | | innerList.put("data", gson.toJson(map.get("value"))); |
| | | } |
| | | |
| | | line_list.add(innerList); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (objectDate != null) { |
| | | data.put("xAxis_list", gson.toJson(objectDate)); |
| | | } else { |
| | | data.put("xAxis_list", gson.toJson(dateList)); |
| | | } |
| | | |
| | | data.put("line_list", line_list); |
| | | |
| | | return data; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "uploadTaoBaoWeiQuanOrder") |
| | | public void uploadWeiQuanOrder(String callback, HttpServletRequest request, PrintWriter out) { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 订单跟踪准确率(板栗快省用户订单/淘宝联盟订单) |
| | | * |
| | | * @param callback |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "getTrackAccuracyRate") |
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType, PrintWriter out) { |
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) { |
| | | startTime = null; |
| | | endTime = null; |
| | | } |
| | | |
| | | if (dateType == 1 && year != null) { |
| | | year = null; // 设置为空 |
| | | } else if (dateType == 2) { |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) { |
| | | if (year != null) |
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | } |
| | | |
| | | try { |
| | | |
| | | Gson gson = new Gson(); |
| | | Object objectDate = null; |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year); |
| | | |
| | | JSONArray line_list = new JSONArray(); |
| | | |
| | | List<ChartTDO> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime, endTime, |
| | | sourceType); |
| | | |
| | | JSONObject innerList = new JSONObject(); |
| | | innerList.put("name", "总计"); |
| | | |
| | | if (dateType != 3) { |
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list))); |
| | | } else { |
| | | // 年视图 |
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list); |
| | | |
| | | if (objectDate == null) { |
| | | objectDate = map.get("date"); |
| | | } |
| | | innerList.put("data", gson.toJson(map.get("value"))); |
| | | } |
| | | |
| | | line_list.add(innerList); |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | if (objectDate != null) { |
| | | data.put("xAxis_list", gson.toJson(objectDate)); |
| | | } else { |
| | | data.put("xAxis_list", gson.toJson(dateList)); |
| | | } |
| | | |
| | | data.put("line_list", line_list); |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); |
| | | |
| | | } catch (Exception e) { |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常")); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 新增/修改
|
| | | * |
| | | * @param callback
|
| | | * @param special
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveInfo")
|
| | | public void saveInfo(String callback, PushGoods pushGoods, String arrayIOS, String arrayAndroid, PrintWriter out) {
|
| | | try {
|
| | | // 版本处理
|
| | | convertVersion(pushGoods, arrayIOS, arrayAndroid);
|
| | | // 保存
|
| | | pushGoodsService.saveInfo(pushGoods);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("添加成功"));
|
| | | } catch (PushGoodsException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 删除
|
| | | *
|
| | |
| | | Date controlTime = pushGoods.getControlTime();
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
| | | if (controlTime == null) {
|
| | | pushGoods.setTimeTask(false);
|
| | | pushGoods.setControlTime_str("");
|
| | | } else {
|
| | | pushGoods.setTimeTask(true);
|
| | | pushGoods.setControlTime_str(sdf.format(controlTime));
|
| | | }
|
| | |
|
| | |
| | | try {
|
| | |
|
| | | List<PushGoods> list = pushGoodsService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state);
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
| | | for (PushGoods pushGoods : list) {
|
| | |
|
| | | Date controlTime = pushGoods.getControlTime();
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
| | | if (controlTime == null) {
|
| | | pushGoods.setTimeTask(false);
|
| | | pushGoods.setControlTime_str("");
|
| | | } else {
|
| | | pushGoods.setTimeTask(true);
|
| | | pushGoods.setControlTime_str(sdf.format(controlTime));
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialCard;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialCardException;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | | import com.yeshi.fanli.service.inter.config.AppVersionService;
|
| | |
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveSpecial")
|
| | | public void saveSpecial(String callback, Special record, String jumpType, HttpServletRequest request,
|
| | | public void saveSpecial(String callback, Special record, String jumpType, SpecialExtra extra, HttpServletRequest request,
|
| | | PrintWriter out) {
|
| | | try {
|
| | | // 1. 先判断httpRequest 是否含有文件类型
|
| | | if (request instanceof MultipartHttpServletRequest) {
|
| | | MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
|
| | | specialService.saveObject(fileRequest.getFile("file"), fileRequest.getFile("file2"),
|
| | | fileRequest.getFile("file3"), record, jumpType);
|
| | | fileRequest.getFile("file3"), record, jumpType, extra);
|
| | | } else {
|
| | | specialService.saveObject(null, null, null, record, jumpType);
|
| | | specialService.saveObject(null, null, null, record, jumpType, extra);
|
| | | }
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | |
| | |
|
| | | try {
|
| | |
|
| | | List<Special> list = specialService.listQueryByCard((pageIndex - 1) * pageSize, pageSize, cardId, key, sex);
|
| | | long count = specialService.countlistQueryByCard(cardId, key, sex);
|
| | | // 获取有效的专题
|
| | |
|
| | | List<SpecialVO> list = specialService.listQueryByCard((pageIndex - 1) * pageSize, pageSize, cardId, key, sex);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = specialService.countlistQueryByCard(cardId, key, sex);
|
| | | // 过滤
|
| | | if (versionList != null) {
|
| | | if (versionList.size() > 0) {
|
| | | List<Long> sourceIdList = new ArrayList<>();
|
| | | for (Special special : list) {
|
| | | for (SpecialVO special : list) {
|
| | | sourceIdList.add(special.getId());
|
| | | }
|
| | | List<Long> versionIdList = new ArrayList<>();
|
| | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | package com.yeshi.fanli.controller.client.v1;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | |
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenOPPO;
|
| | |
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.util.factory.JumpDetailParamsFactory;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | | import com.yeshi.fanli.vo.push.PushRecommendVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private DeviceTokenXMService deviceTokenXMService;
|
| | | |
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | | |
| | |
|
| | | @RequestMapping(value = "callback", method = RequestMethod.POST)
|
| | | public void callback(AcceptData acceptData, String pushId, PrintWriter out) {
|
| | |
| | | */
|
| | | @RequestMapping(value = "/gethistory", method = RequestMethod.POST)
|
| | | public void getHistory(AcceptData acceptData, Long uid, String deviceToken, int page, PrintWriter out) {
|
| | |
|
| | | long count = 0;
|
| | | List<PushGoods> list = null;
|
| | | JSONArray resultList = new JSONArray();
|
| | |
|
| | | DeviceActive deviceActive = deviceActiveService.getDeviceByDeviceAndPlatform(acceptData.getDevice(),
|
| | | deviceToken, acceptData.getPlatform());
|
| | |
|
| | | if (deviceActive != null) {
|
| | |
|
| | | // 设备注册时间
|
| | | Date createTime = deviceActive.getCreateTime();
|
| | | count = pushGoodsService.countHistoryByPushTime(uid, createTime);
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | |
|
| | | list = pushGoodsService.listHistoryByPushTime((page - 1) * pageSize, pageSize, uid, createTime);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (PushGoods pushGoods : list) {
|
| | | JSONObject result = new JSONObject();
|
| | |
|
| | | Long pushId = pushGoods.getId();
|
| | | String picture = pushGoods.getPicture();
|
| | | String alertContent = pushGoods.getAlertContent();
|
| | | Date pushTime = pushGoods.getPushTime();
|
| | |
|
| | | result.put("content", alertContent);
|
| | | result.put("pushtime", pushTime.getTime());
|
| | |
|
| | | // 统计商品数量
|
| | | long totalgoods = 0;
|
| | | // 商品id
|
| | | CommonGoods commonGoods = null;
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(picture)) {
|
| | | try {
|
| | | List<PushGoodsGroup> listGroup = pushGoodsGroupService.getAllInfoByPushId(pushId);
|
| | |
|
| | | if (listGroup != null && listGroup.size() > 0) {
|
| | |
|
| | | totalgoods = listGroup.size();
|
| | |
|
| | | PushGoodsGroup pushGoodsGroup = listGroup.get(0);
|
| | | if (pushGoodsGroup != null) {
|
| | | commonGoods = pushGoodsGroup.getCommonGoods();
|
| | | if (commonGoods != null) {
|
| | | picture = commonGoods.getPicture();
|
| | | }
|
| | | }
|
| | | }
|
| | | } catch (PushGoodsGroupException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | result.put("picture", TbImgUtil.getTBSize320Img(picture));
|
| | |
|
| | | String fontColor1 = "#666666";
|
| | | String fontColor2 = "#E5005C";
|
| | | JSONArray array = new JSONArray();
|
| | |
|
| | | JSONObject contentJson1 = new JSONObject();
|
| | | contentJson1.put("color", fontColor1);
|
| | | contentJson1.put("content", "本次推荐共");
|
| | |
|
| | | JSONObject contentJson2 = new JSONObject();
|
| | | contentJson2.put("color", fontColor2);
|
| | | contentJson2.put("content", totalgoods);
|
| | |
|
| | | JSONObject contentJson3 = new JSONObject();
|
| | | contentJson3.put("color", fontColor1);
|
| | | contentJson3.put("content", "个商品");
|
| | |
|
| | | array.add(contentJson1);
|
| | | array.add(contentJson2);
|
| | | array.add(contentJson3);
|
| | |
|
| | | result.put("totalwords", array);
|
| | |
|
| | | String params = "";
|
| | |
|
| | | JumpDetailV2 jumpDetail = null;
|
| | | if (totalgoods == 1) {
|
| | | params = JumpDetailParamsFactory.createGoodsParams(commonGoods.getGoodsId(),
|
| | | commonGoods.getGoodsType());
|
| | | // 单个商品跳转商品详情
|
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("goodsdetail",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | } else {
|
| | | String url = configService.get(ConfigKeyEnum.pushGoodsDetails.getKey());
|
| | | if (url == null) {
|
| | | url = "";
|
| | | }
|
| | | url = url + "?id=" + pushId;
|
| | |
|
| | | params = JumpDetailParamsFactory.createWEBParams(url);
|
| | |
|
| | | // 跳转推荐详情
|
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | }
|
| | | result.put("params", params);
|
| | | result.put("jumpDetail", jumpDetail);
|
| | |
|
| | | resultList.add(result);
|
| | | }
|
| | | }
|
| | | if (deviceActive == null) {
|
| | | JSONObject resultJson = new JSONObject();
|
| | | resultJson.put("count", count);
|
| | | resultJson.put("result_list", resultList);
|
| | | out.print(JsonUtil.loadTrueResult(resultJson));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 设备注册时间
|
| | | Date createTime = deviceActive.getCreateTime();
|
| | | count = pushGoodsService.countHistoryByPushTime(uid, createTime);
|
| | |
|
| | | int pageSize = Constant.PAGE_SIZE;
|
| | | List<PushGoods> list = pushGoodsService.listHistoryByPushTime((page - 1) * pageSize, pageSize, uid, createTime);
|
| | | if (list == null)
|
| | | list = new ArrayList<>();
|
| | |
|
| | | for (PushGoods pushGoods : list) {
|
| | | Long id = pushGoods.getId();
|
| | |
|
| | | PushRecommendVO vo = new PushRecommendVO();
|
| | | vo.setTitle(pushGoods.getTitle());
|
| | | vo.setContent(pushGoods.getContent());
|
| | | vo.setPicture(pushGoods.getPicture());
|
| | | vo.setPushtime(pushGoods.getPushTime().getTime());
|
| | | |
| | | Integer scanNum = pushGoods.getScanNum();
|
| | | if (scanNum == null) {
|
| | | vo.setScanNum("0");
|
| | | } else if (scanNum >= 10000) {
|
| | | double num = scanNum;
|
| | | String numMidea = String.format("%.1f", num / 10000);
|
| | | vo.setScanNum(numMidea + "万");
|
| | | } else {
|
| | | vo.setScanNum(scanNum +"");
|
| | | }
|
| | | |
| | |
|
| | | String params = "";
|
| | | String nickName = "";
|
| | | JumpDetailV2 jumpDetail = null;
|
| | | List<ClientTextStyleVO> totalwords = new ArrayList<ClientTextStyleVO>();
|
| | |
|
| | | Integer type = pushGoods.getType();
|
| | | if (type == null || type == PushGoods.TYPE_GOODS) {
|
| | | long totalgoods = 0;
|
| | | CommonGoods goods = null;
|
| | | try {
|
| | | List<PushGoodsGroup> listGroup = pushGoodsGroupService.getAllInfoByPushId(id);
|
| | | if (listGroup != null && listGroup.size() > 0) {
|
| | | totalgoods = listGroup.size();
|
| | | PushGoodsGroup pushGoodsGroup = listGroup.get(0);
|
| | | if (pushGoodsGroup != null) {
|
| | | goods = pushGoodsGroup.getCommonGoods();
|
| | | }
|
| | | }
|
| | | } catch (PushGoodsGroupException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | if (goods != null && StringUtil.isNullOrEmpty(vo.getPicture())) {
|
| | | vo.setPicture(TbImgUtil.getTBSize320Img(goods.getPicture()));
|
| | | }
|
| | |
|
| | | if (totalgoods == 1) {
|
| | | params = JumpDetailParamsFactory.createGoodsParams(goods.getGoodsId(), goods.getGoodsType());
|
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("goodsdetail",Constant.getPlatformCode(acceptData.getPlatform()),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | } else {
|
| | | String url = configService.get(ConfigKeyEnum.pushGoodsDetails.getKey());
|
| | | if (url == null) {
|
| | | url = "";
|
| | | }
|
| | | url = url + "?id=" + id;
|
| | |
|
| | | params = JumpDetailParamsFactory.createWEBParams(url);
|
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web",Constant.getPlatformCode(acceptData.getPlatform()),
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | | }
|
| | |
|
| | | totalwords.add(new ClientTextStyleVO("本次推荐共", "#666666"));
|
| | | totalwords.add(new ClientTextStyleVO(totalgoods + "", "#E5005C"));
|
| | | totalwords.add(new ClientTextStyleVO("个商品", "#666666"));
|
| | | } else if (type == PushGoods.TYPE_ACTIVITY) {
|
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pushGoods.getOtherId());
|
| | | if (goodsEvaluate != null) {
|
| | | ActivityUser user = goodsEvaluate.getUser();
|
| | | if (user != null) {
|
| | | nickName = user.getNickName();
|
| | | }
|
| | | }
|
| | |
|
| | | String url = configService.get(ConfigKeyEnum.pushActivityLink.getKey());
|
| | | if (url == null) {
|
| | | url = "";
|
| | | }
|
| | | url = url + "?id=" + id + "&otherId=" + pushGoods.getOtherId();
|
| | | params = JumpDetailParamsFactory.createWEBParams(url);
|
| | | jumpDetail = jumpDetailV2Service.getByTypeCache("web",
|
| | | Constant.getPlatformCode(acceptData.getPlatform()), Integer.parseInt(acceptData.getVersion()));
|
| | | } else {
|
| | | continue;
|
| | | }
|
| | | vo.setNickName(nickName);
|
| | | vo.setParams(params);
|
| | | vo.setJumpDetail(jumpDetail);
|
| | | vo.setTotalwords(totalwords);
|
| | | resultList.add(vo);
|
| | | }
|
| | | |
| | | JSONObject resultJson = new JSONObject();
|
| | | resultJson.put("count", count);
|
| | | resultJson.put("result_list", resultList);
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(resultJson));
|
| | |
|
| | | // 列表参数、设备参数信息不为空
|
| | | if (list != null && list.size() > 0 && deviceActive != null) {
|
| | |
|
| | | if (list != null && list.size() > 0 && deviceActive != null) {
|
| | | final List<PushGoods> listPush = list;
|
| | | // 记录访问信息
|
| | | executor.execute(new Runnable() {
|
| | |
| | | public void run() {
|
| | | try {
|
| | | Long deviceId = deviceActive.getId();
|
| | |
|
| | | for (PushGoods pushGoods : listPush) {
|
| | | List<PushGoodsRecord> listRecord = pushGoodsRecordService
|
| | | .listByPushIdAndDeviceId(pushGoods.getId(), deviceId);
|
| | |
| | | pushGoodsRecord.setDeviceActive(deviceActive);
|
| | | pushGoodsRecordService.insert(pushGoodsRecord);
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | | inviteLevel.put("link", level.getLink());
|
| | | data.put("inviteLevel", inviteLevel);
|
| | | }
|
| | | |
| | | if (VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | data.put("fansCountLink", configService.get(ConfigKeyEnum.teamStatisticsLink.getKey()));
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | |
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("获取失败"));
|
| | | e.printStackTrace();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | import com.google.gson.stream.JsonWriter;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDetailService;
|
| | |
| | | vo.setBindingWX(true);
|
| | | } else
|
| | | vo.setBindingWX(false);
|
| | |
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | // 如果绑定了微信而且未开通自动提现就先开通自动提现
|
| | | if (extra.getAutoExtract() == null && !StringUtil.isNullOrEmpty(user.getWxUnionId())) {
|
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(extra.getId());
|
| | | update.setAutoExtract(true);
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(update);// 设置自动提现开启
|
| | | extra.setAutoExtract(true);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | if (extra != null && extra.getAutoExtract() != null && extra.getAutoExtract() == true)
|
| | | vo.setAutoExtract(true);
|
| | | else
|
| | | vo.setAutoExtract(false);
|
| | |
|
| | | vo.setAutoExtract(false);
|
| | | vo.setAutoExtractHelpUrl(configService.get(ConfigKeyEnum.autoExtractHelpUrl.getKey()));
|
| | | vo.setOpenAutoExtractMsg("自动提现必须要微信授权,当账户中的余额≥2元时,系统在保障你资金安全的情况下,以微信红包的形式完成提现");
|
| | | vo.setCloseAutoExtractMsg("关闭自动提现后,60天以内将不自动提现,60天后系统将会自动开启,敬请知晓");
|
| | |
| | | */
|
| | | @RequestMapping("autoExtract")
|
| | | public void autoExtract(AcceptData acceptData, Long uid, Integer type, PrintWriter out) {
|
| | | if (type == null) {
|
| | | out.print(JsonUtil.loadFalseResult("请上传type"));
|
| | | return;
|
| | | }
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用戶未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfoExtra userExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | UserInfo user = userInfoService.selectByPKey(uid);
|
| | | if (user == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用戶不存在"));
|
| | | return;
|
| | | }
|
| | | if (type == 1)// 开启
|
| | | {
|
| | | if (userExtra.getAutoExtract() == null || userExtra.getAutoExtract() == false) {
|
| | | if (StringUtil.isNullOrEmpty(user.getWxUnionId()))// 尚未綁定微信
|
| | | {
|
| | | out.print(JsonUtil.loadFalseResult("未綁定微信"));
|
| | | return;
|
| | | }
|
| | | // 设置自动提现
|
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(userExtra.getId());
|
| | | update.setAutoExtract(true);
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(update);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | return;
|
| | | } else {
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | return;
|
| | | }
|
| | | } else {// 关闭
|
| | | UserInfoExtra update = new UserInfoExtra();
|
| | | update.setId(userExtra.getId());
|
| | | update.setAutoExtract(false);
|
| | | update.setCloseTimeExtract(new Date());
|
| | | try {
|
| | | userInfoExtraService.saveUserInfoExtra(update);
|
| | | } catch (UserInfoExtraException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | return;
|
| | | }
|
| | |
|
| | | out.print(JsonUtil.loadFalseResult("该功能已下架"));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | @RequestMapping(value = "getMsgList", method = RequestMethod.POST)
|
| | | public void getMsgList(AcceptData acceptData, Long uid, int page, String type, PrintWriter out) {
|
| | |
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | |
| | | params.put("orderNo", detail.getOrderId());
|
| | | if (detail.getType() == MsgTypeOrderTypeEnum.invite || detail.getType() == MsgTypeOrderTypeEnum.orderInvite)
|
| | | params.put("orderHideNo", UserUtil.filterOrderId(detail.getOrderId()));
|
| | | list.add(UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"),
|
| | | params));
|
| | | |
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail, jumpDetailV2Service.getByTypeCache("order_search"), params);
|
| | | msgVO.setType(MSG_TYPE_ORDER);
|
| | | list.add(msgVO);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_MONEY:
|
| | |
| | | List<MsgMoneyDetail> detailList1 = msgMoneyDetailService.listMsgMoneyDetail(uid, page);
|
| | | count = msgMoneyDetailService.countMsgMoneyDetail(uid);
|
| | | if (detailList1 != null)
|
| | | for (MsgMoneyDetail detail : detailList1)
|
| | | list.add(UserMsgVOFactory.create(detail));
|
| | | for (MsgMoneyDetail detail : detailList1) {
|
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail);
|
| | | msgVO.setType(MSG_TYPE_MONEY);
|
| | | list.add(msgVO);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_ACCOUNT:
|
| | | userMsgReadStateService.readAccountMsg(uid);
|
| | | List<MsgAccountDetail> detailList2 = msgAccountDetailService.listMsgAccountDetail(uid, page);
|
| | | count = msgAccountDetailService.countMsgAccountDetail(uid);
|
| | | if (detailList2 != null)
|
| | | for (MsgAccountDetail detail : detailList2)
|
| | | list.add(UserMsgVOFactory.create(detail));
|
| | | for (MsgAccountDetail detail : detailList2) {
|
| | | UserMsgVO msgVO = UserMsgVOFactory.create(detail);
|
| | | msgVO.setType(MSG_TYPE_ACCOUNT);
|
| | | list.add(msgVO);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_INVITE:
|
| | | userMsgReadStateService.readInviteMsg(uid);
|
| | |
| | | if (detailList3 != null)
|
| | | for (MsgInviteDetail detail : detailList3) {
|
| | | UserMsgVO vo = UserMsgVOFactory.create(detail);
|
| | | if (vo != null)
|
| | | if (vo != null) {
|
| | | vo.setType(MSG_TYPE_INVITE);
|
| | | list.add(vo);
|
| | | else
|
| | | } else {
|
| | | count--;
|
| | | }
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_OTHER:
|
| | |
| | | if (detailList4 != null)
|
| | | for (MsgOtherDetail detail : detailList4) {
|
| | | UserMsgVO vo = UserMsgVOFactory.create(detail);
|
| | | if (vo != null)
|
| | | if (vo != null) {
|
| | | vo.setType(MSG_TYPE_OTHER);
|
| | | list.add(vo);
|
| | | else
|
| | | } else {
|
| | | count--;
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | |
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 删除消息
|
| | | * @param acceptData
|
| | | * @param type
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "deleteMsg", method = RequestMethod.POST)
|
| | | public void deleteMsg(AcceptData acceptData, String type, Long id, Long uid, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(type) || id == null || uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("参数不完整"));
|
| | | return;
|
| | | }
|
| | | |
| | | switch (type) {
|
| | | case MSG_TYPE_ORDER:
|
| | | MsgOrderDetail msgOrderDetail = msgOrderDetailService.selectByPrimaryKey(id);
|
| | | if (msgOrderDetail != null && msgOrderDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgOrderDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_MONEY:
|
| | | MsgMoneyDetail moneyDetail = msgMoneyDetailService.selectByPrimaryKey(id);
|
| | | if (moneyDetail != null && moneyDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgMoneyDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_ACCOUNT:
|
| | | MsgAccountDetail accountDetail = msgAccountDetailService.selectByPrimaryKey(id);
|
| | | if (accountDetail != null && accountDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgAccountDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_INVITE:
|
| | | MsgInviteDetail inviteDetail = msgInviteDetailService.selectByPrimaryKey(id);
|
| | | if (inviteDetail != null && inviteDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgInviteDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | case MSG_TYPE_OTHER:
|
| | | MsgOtherDetail otherDetail = msgOtherDetailService.selectByPrimaryKey(id);
|
| | | if (otherDetail != null && otherDetail.getUser().getId().longValue() == uid.longValue()) {
|
| | | msgOtherDetailService.deleteByPrimaryKey(id);
|
| | | }
|
| | | break;
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(""));
|
| | | }
|
| | | |
| | | }
|
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.apache.commons.beanutils.PropertyUtils; |
| | | import org.springframework.core.task.TaskExecutor; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData; |
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass; |
| | | import com.yeshi.fanli.entity.bus.homemodule.Special; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture; |
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo; |
| | |
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService; |
| | | import com.yeshi.fanli.service.inter.goods.ShareGoodsService; |
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialExtraService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService; |
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService; |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService; |
| | |
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil; |
| | | import com.yeshi.fanli.vo.dynamic.ArticleVO; |
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO; |
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO; |
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO; |
| | | |
| | | import net.sf.json.JSONArray; |
| | |
| | | |
| | | @Resource |
| | | private DailyCountMomentsService dailyCountMomentsService; |
| | | |
| | | @Resource |
| | | private SpecialExtraService specialExtraService; |
| | | |
| | | |
| | | |
| | | @Resource(name = "taskExecutor") |
| | | private TaskExecutor executor; |
| | |
| | | long time = System.currentTimeMillis(); |
| | | |
| | | // 删除尚未启用的过期的 |
| | | List<SpecialVO> listVo = new ArrayList<SpecialVO>(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | Special special = list.get(i); |
| | | if (special.getState() == 1L) { |
| | | list.remove(i--); |
| | | } else { |
| | | if (special.getStartTime() != null && special.getEndTime() != null) { |
| | | if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) { |
| | | list.remove(i--); |
| | | } else// 设置倒计时 |
| | | { |
| | | special.setCountDownTime((special.getEndTime().getTime() - time) / 1000); |
| | | } |
| | | } |
| | | |
| | | List<SpecialLabel> listLabels = special.getListLabels(); |
| | | if (listLabels != null && !listLabels.isEmpty()) { |
| | | List<ClientTextStyleVO> labels = new ArrayList<>(); |
| | | for (SpecialLabel specialLabel : listLabels) { |
| | | labels.add(new ClientTextStyleVO(specialLabel.getName(), specialLabel.getBgColor())); |
| | | } |
| | | special.setLabels(labels); |
| | | continue; |
| | | } |
| | | |
| | | // 是否活动已过期 |
| | | if (special.getStartTime() != null && special.getEndTime() != null) { |
| | | if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) { |
| | | continue; |
| | | } else { |
| | | special.setCountDownTime((special.getEndTime().getTime() - time) / 1000); |
| | | } |
| | | } |
| | | |
| | | SpecialVO specialVO = new SpecialVO(); |
| | | try { |
| | | PropertyUtils.copyProperties(specialVO, special); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | continue; |
| | | } |
| | | |
| | | // 设置标签 |
| | | List<SpecialLabel> listLabels = specialVO.getListLabels(); |
| | | if (listLabels != null && !listLabels.isEmpty()) { |
| | | List<ClientTextStyleVO> labels = new ArrayList<>(); |
| | | for (SpecialLabel specialLabel : listLabels) { |
| | | labels.add(new ClientTextStyleVO(specialLabel.getName(), specialLabel.getBgColor())); |
| | | } |
| | | specialVO.setLabels(labels); |
| | | } |
| | | |
| | | // 评论信息 |
| | | if (VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) { |
| | | SpecialExtra extra = specialExtraService.selectByPrimaryKey(specialVO.getId()); |
| | | if (extra != null && !StringUtil.isNullOrEmpty(extra.getComment())) { |
| | | specialVO.setComment(extra.getComment()); |
| | | } |
| | | } |
| | | listVo.add(specialVO); |
| | | } |
| | | |
| | | long count = specialService.countByPlaceKeyList(listKey, platformCode, |
| | |
| | | Gson gson = gsonBuilder.create(); |
| | | JSONObject data = new JSONObject(); |
| | | data.put("count", count); |
| | | data.put("list", gson.toJson(list)); |
| | | data.put("list", gson.toJson(listVo)); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 评论复制-专题 |
| | | * |
| | | * @param acceptData |
| | | * @param id |
| | | * @param out |
| | | */ |
| | | @RequestMapping(value = "copySpecialComment", method = RequestMethod.POST) |
| | | public void copySpecialComment(AcceptData acceptData, Long uid, Long id, PrintWriter out) { |
| | | if (uid == null || id == null) { |
| | | out.print(JsonUtil.loadFalseResult("参数不能为空")); |
| | | return; |
| | | } |
| | | |
| | | SpecialExtra extra = specialExtraService.selectByPrimaryKey(id); |
| | | if (extra == null || StringUtil.isNullOrEmpty(extra.getComment())) { |
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在")); |
| | | return; |
| | | } |
| | | |
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid); |
| | | if (user == null) { |
| | | out.print(JsonUtil.loadFalseResult("用户未登录")); |
| | | return; |
| | | } |
| | | |
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) { |
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC)); |
| | | return; |
| | | } |
| | | |
| | | 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)) { |
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号")); |
| | | return; |
| | | } |
| | | |
| | | String text = extra.getComment(); |
| | | String newText = text; |
| | | if (extra.getNeedSpin() != null && extra.getNeedSpin()) { |
| | | try { |
| | | newText = convertLinkManager.convertLinkFromText(text, uid, true); |
| | | } catch (ConvertLinkExceptionException e) { |
| | | if (e.getCode() != ConvertLinkExceptionException.CODE_NONE) { |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | out.print(JsonUtil.loadFalseResult("评论生成失败")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | JSONObject data = new JSONObject(); |
| | | data.put("text", newText); |
| | | out.print(JsonUtil.loadTrueResult(data)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import java.io.PrintWriter;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO;
|
| | | import com.yeshi.fanli.dto.vip.UserVIPLevel;
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsgTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.TeamFansInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidNum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInviteValidRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamUserLevelStatistic;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TearcherInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.SpreadImgService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.push.PushService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.UserCustomSettingsService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.TeamFansInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidNumService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.UserInviteValidRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamDailyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamUserLevelStatisticService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TearcherService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.vip.UserVIPPreInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.util.user.UserLevelUtil;
|
| | |
| | |
|
| | | @Resource
|
| | | private SpreadImgService spreadImgService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SystemClientParamsService systemClientParamsService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteService userInviteService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteValidRecordService userInviteValidRecordService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInviteValidNumService userInviteValidNumService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | |
|
| | | @Resource
|
| | | private TeamFansInfoService teamFansInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserCustomSettingsService userCustomSettingsService;
|
| | |
|
| | | @Resource
|
| | | private TearcherService tearcherService;
|
| | |
|
| | | @Resource
|
| | | private TeamUserLevelStatisticService teamUserLevelStatisticService;
|
| | |
|
| | | @Resource
|
| | | private UserVIPPreInfoService userVIPPreInfoService;
|
| | |
|
| | | @Resource
|
| | | private TeamDailyRecordService teamDailyRecordService;
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 邀请码验证
|
| | | *
|
| | |
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0)
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | |
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, StringUtil.Md5("activeWX:" + weiXinUser.getUnionid()));
|
| | | String key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey,
|
| | | StringUtil.Md5("activeWX:" + weiXinUser.getUnionid()));
|
| | | redisManager.cacheCommonString(key, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
|
| | |
|
| | | // 邀请关系用户信息
|
| | |
| | | *
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param key
|
| | | * 验证返回的key
|
| | | * @param key 验证返回的key
|
| | | * @param out
|
| | | */
|
| | | @RequestSerializableByKey(key = "'activeInviteWX-'+#uid")
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 用户队员列表查询 1.5.3查询有效队员
|
| | | * 用户队员列表查询
|
| | | *
|
| | | * @param acceptData
|
| | | * @param id
|
| | |
| | | out.print(JsonUtil.loadFalseResult("粉丝类型不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | getMyTeamNew(acceptData, page, uid, type, out);
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = 0;
|
| | | List<ThreeSale> listTeam = null;
|
| | | if (type == 1) {
|
| | |
| | | count = threeSaleSerivce.countSecondTeam(uid);
|
| | | }
|
| | |
|
| | | boolean needVIPInfo = false;
|
| | | if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | needVIPInfo = true;
|
| | | // 数据加工
|
| | | JSONArray array = null;
|
| | | if (VersionUtil.greaterThan_2_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | array = organizeTeamNew(acceptData, listTeam, uid, type, true);
|
| | | } else {
|
| | | boolean needVIPInfo = false;
|
| | | if (VersionUtil.greaterThan_2_0_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | needVIPInfo = true;
|
| | | array = organizeTeam(listTeam, uid, type, needVIPInfo);
|
| | | }
|
| | |
|
| | | // 组织数据
|
| | | JSONObject resultData = organizeTeam(count, listTeam, uid, type,needVIPInfo);
|
| | | JSONObject result = new JSONObject();
|
| | | result.put("count", count);
|
| | | result.put("list", array);
|
| | |
|
| | | // 第一页判断是否激活 是否有队员
|
| | | if (type == 1 && page == 1) {
|
| | | boolean hasCode = false;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | |
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode()))
|
| | | hasCode = true;
|
| | | }
|
| | | resultData.put("hasCode", hasCode);
|
| | | resultData.put("hasTeam", count > 0 ? true : false);
|
| | | result.put("hasCode", hasCode);
|
| | | result.put("hasTeam", count > 0 ? true : false);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(resultData));
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | * @param type
|
| | | * @return
|
| | | */
|
| | | private JSONObject organizeTeam(long count, List<ThreeSale> list, Long uid, int type, boolean needVipInfo) {
|
| | | JSONObject result = new JSONObject();
|
| | | private JSONArray organizeTeam(List<ThreeSale> list, Long uid, int type, boolean needVipInfo) {
|
| | | JSONArray resultArray = new JSONArray();
|
| | |
|
| | | Date todayTime = new Date();
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("MM.dd HH:mm");
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm");
|
| | |
| | | object.put("recentMsg", array);
|
| | | resultArray.add(object);
|
| | | }
|
| | |
|
| | | result.put("count", count);
|
| | | result.put("list", resultArray);
|
| | | return result;
|
| | | return resultArray;
|
| | | }
|
| | |
|
| | | |
| | | private void getMyTeamNew(AcceptData acceptData, long page, long uid, int type, PrintWriter out) {
|
| | | if (type != 1 && type != 2) {
|
| | | out.print(JsonUtil.loadFalseResult("粉丝类型不正确"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = 0;
|
| | | List<ThreeSale> listTeam = null;
|
| | | if (type == 1) {
|
| | | listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | | count = threeSaleSerivce.countFirstTeam(uid);
|
| | | } else if (type == 2) {
|
| | | listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | | count = threeSaleSerivce.countSecondTeam(uid);
|
| | | }
|
| | | |
| | | JSONObject result = new JSONObject();
|
| | | result.put("count", count);
|
| | | result.put("list", organizeTeamNew(count, listTeam, uid, type, true));
|
| | | |
| | | // 第一页判断是否激活 是否有队员
|
| | | if (type == 1 && page == 1) {
|
| | | boolean hasCode = false;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
|
| | | if (userInfoExtra != null) {
|
| | | if (!StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode()))
|
| | | hasCode = true;
|
| | | }
|
| | | result.put("hasCode", hasCode);
|
| | | result.put("hasTeam", count > 0 ? true : false);
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | }
|
| | | |
| | | /**
|
| | | * 加工数据
|
| | | * 加工数据
|
| | | * |
| | | * @param count
|
| | | * @param list
|
| | | * @param uid
|
| | | * @param type 查询粉丝类型 1直接 2间接
|
| | | * @param type 查询粉丝类型 1直接 2间接
|
| | | * @param wxtip 是需要微信提示
|
| | | * @return
|
| | | */
|
| | | private JSONArray organizeTeamNew(long count, List<ThreeSale> list, Long uid, int type, boolean wxtip) {
|
| | | private JSONArray organizeTeamNew(AcceptData acceptData, List<ThreeSale> list, Long uid, int type, boolean wxtip) {
|
| | | JSONArray resultArray = new JSONArray();
|
| | | if (list == null || list.size() == 0) {
|
| | | return resultArray;
|
| | |
| | | for (ThreeSale threeSale : list) {
|
| | | listWid.add(threeSale.getWorker().getId());
|
| | | }
|
| | | |
| | |
|
| | | // 查询有效粉丝id
|
| | | int validType = UserInviteValidRecord.TYPE_TWO;
|
| | | if (type == 1) {
|
| | | validType = UserInviteValidRecord.TYPE_ONE;
|
| | | }
|
| | | |
| | |
|
| | | List<Long> listVid = userInviteValidRecordService.getValidWorkerIdsByUid(uid, listWid, validType);
|
| | | |
| | |
|
| | | for (ThreeSale threeSale : list) {
|
| | | UserInfo worker = threeSale.getWorker();
|
| | | Long workerId = worker.getId();
|
| | |
|
| | | // 邀请成功时间
|
| | | Long succeedTime = threeSale.getSucceedTime(); |
| | | Long succeedTime = threeSale.getSucceedTime();
|
| | | if (succeedTime == null) {
|
| | | succeedTime = threeSale.getCreateTime();
|
| | | }
|
| | | |
| | |
|
| | | // 有效粉丝
|
| | | boolean validFans = false; |
| | | boolean validFans = false;
|
| | | if (listVid != null && listVid.size() > 0 && listVid.contains(workerId)) {
|
| | | validFans = true;
|
| | | }
|
| | | |
| | |
|
| | | // 最近粉丝登录时间
|
| | | Date lastLoginTime = new Date(threeSale.getCreateTime());
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(workerId);
|
| | | if (userInfoExtra != null && userInfoExtra.getActiveTime() != null) {
|
| | | lastLoginTime = userInfoExtra.getActiveTime();
|
| | | } |
| | | }
|
| | | JSONObject loginJson = new JSONObject();
|
| | | if (formatYears.format(todayTime).equals(formatYears.format(lastLoginTime))) {
|
| | | loginJson.put("content", "最近登录 " + sdf.format(lastLoginTime)); // 本年
|
| | |
| | | loginJson.put("content", "最近登录 " + format.format(lastLoginTime)); // 往年
|
| | | }
|
| | | loginJson.put("color", "#888888");
|
| | | |
| | |
|
| | | JSONArray array = new JSONArray();
|
| | | array.add(loginJson);
|
| | |
|
| | |
| | | if (vipLevel != null && vipLevel.getLevel() != null) {
|
| | | level = UserLevelUtil.getByLevel(vipLevel.getLevel());
|
| | | }
|
| | | if(level == null) {
|
| | | if (level == null) {
|
| | | level = UserLevelEnum.daRen;
|
| | | }
|
| | | level = UserLevelUtil.getShowLevel(level);
|
| | | |
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("workerId", workerId);
|
| | | object.put("nickName", worker.getNickName());
|
| | |
| | | object.put("recentMsg", array);
|
| | | object.put("level", level.name());
|
| | | object.put("validFans", validFans);
|
| | | |
| | |
|
| | | if (wxtip && type == 1 && threeSale.getState() != null && threeSale.getState()) {
|
| | | // 一级队员 查询昵称备注
|
| | | String memoName = null;
|
| | |
| | | }
|
| | | }
|
| | | object.put("memoName", memoName);
|
| | | |
| | | // 添加微信信息
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) {
|
| | | object.put("weiXin", userInfoExtra.getWeiXin());
|
| | | object.put("weiXinState", 3);
|
| | | object.put("weiXinTip", "添加TA的微信,你可教授TA如何通过板栗快省赚钱技巧。");
|
| | | } else {
|
| | | if (!threeSaleExtraInfoSerivce.isRemindWorker(uid, workerId)) {
|
| | | object.put("weiXinState", 1);
|
| | | object.put("weiXinTip", "点击提醒,系统会发送一封站内信,提醒其添加微信号。");
|
| | |
|
| | | if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | // 添加微信信息
|
| | | if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getWeiXin())) {
|
| | | object.put("weiXin", userInfoExtra.getWeiXin());
|
| | | object.put("weiXinState", 3);
|
| | | object.put("weiXinTip", "添加TA的微信,你可教授TA如何通过板栗快省赚钱技巧。");
|
| | | } else {
|
| | | object.put("weiXinState", 2);
|
| | | object.put("weiXinTip", "系统已发送提醒,邀请人添加微信后你可复制,如对方迟迟不添加,你可联系人工客服寻求帮助");
|
| | | if (!threeSaleExtraInfoSerivce.isRemindWorker(uid, workerId)) {
|
| | | object.put("weiXinState", 1);
|
| | | object.put("weiXinTip", "点击提醒,系统会发送一封站内信,提醒其添加微信号。");
|
| | | } else {
|
| | | object.put("weiXinState", 2);
|
| | | object.put("weiXinTip", "系统已发送提醒,邀请人添加微信后你可复制,如对方迟迟不添加,你可联系人工客服寻求帮助");
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | return resultArray;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 查看下级的直接粉丝
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param uid 当前UId
|
| | | * @param tid 下级UId
|
| | | * @param uid 当前UId
|
| | | * @param tid 下级UId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getOthersTeam", method = RequestMethod.POST)
|
| | | public void getOthersTeam(AcceptData acceptData, long page, Long uid, Long tid, PrintWriter out) {
|
| | | public void getOthersTeam(AcceptData acceptData, long page, Long uid, Long tid, PrintWriter out) {
|
| | | if (tid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("传递参数不正确"));
|
| | | return;
|
| | | }
|
| | | |
| | | List<ThreeSale> listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, tid);
|
| | |
|
| | | List<ThreeSale> listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
|
| | | tid);
|
| | | long count = threeSaleSerivce.countFirstTeam(tid);
|
| | |
|
| | | JSONObject result = new JSONObject();
|
| | | result.put("count", count);
|
| | | result.put("list", organizeTeamNew(count, listTeam, tid, 1, false));
|
| | | result.put("list", organizeTeamNew(acceptData, listTeam, tid, 1, false));
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 用户队员统计- IOS
|
| | | *
|
| | |
| | |
|
| | | /**
|
| | | * 获取用户信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | |
| | | JSONObject bossData = getBossInfo(uid, threeSaleSerivce.getMyBoss(uid));
|
| | | out.print(JsonUtil.loadTrueResult(bossData));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 上级信息组织
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadFalseResult("提醒失败"));
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @RequestSerializableByKey(key = "'getInviteImgs-'+#uid")
|
| | | @RequestMapping(value = "/getInviteImgs", method = RequestMethod.POST)
|
| | | public void getInviteImgs(AcceptData acceptData, Long uid, Integer page, PrintWriter out, HttpServletRequest request) {
|
| | | public void getInviteImgs(AcceptData acceptData, Long uid, Integer page, PrintWriter out,
|
| | | HttpServletRequest request) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | |
| | |
|
| | | if (page == null || page < 1)
|
| | | page = 1;
|
| | | |
| | |
|
| | | try {
|
| | | String inviteCode = userInfoExtraService.getInviteCodeByUid(uid);
|
| | | if (StringUtil.isNullOrEmpty(inviteCode)) {
|
| | | out.print(JsonUtil.loadFalseResult("邀请码未激活"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | int count = 3;
|
| | | if (page > 1) |
| | | if (page > 1)
|
| | | count = Integer.MAX_VALUE;
|
| | | |
| | |
|
| | | // 邀请图
|
| | | List<String> imgList = spreadUserImgService.getUserSpreadImgToPage(uid, page, count, request);
|
| | | |
| | |
|
| | | // 邀请规则
|
| | | BusinessSystem system = new BusinessSystem();
|
| | | system.setId(4L);
|
| | | system.setPlatform(1);
|
| | | system.setCreatetime(java.lang.System.currentTimeMillis());
|
| | | SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system, "inviteRules");
|
| | | |
| | | SystemClientParams values = systemClientParamsService.getSystemClientParamsBySystemAndKey(system,
|
| | | "inviteRules");
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", spreadImgService.countAll());
|
| | | data.put("inviteCode", inviteCode);
|
| | | data.put("helpLink", configService.get(ConfigKeyEnum.inviteHelpLink.getKey()));
|
| | | data.put("inviteRules", values.getValue().replace("\n", "<br><br>"));
|
| | | data.put("inviteRules", values.getValue().replace("\n", "<br><br>"));
|
| | | data.put("imgUrlList", JsonUtil.getSimpleGsonWithDate().toJson(imgList));
|
| | | data.put("inviteLink", Constant.YINGYONGBAO_LINK);
|
| | | out.print(JsonUtil.loadTrue(0, JsonUtil.getSimpleGson().toJson(data), "成功"));
|
| | |
| | | out.print(JsonUtil.loadFalseResult("邀请信息获取失败"));
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 站内信提醒队员添加微信号
|
| | | *
|
| | |
| | | if (userInviteValidNum != null) {
|
| | | doneFirst = userInviteValidNum.getNumFirst() == null ? 0 : userInviteValidNum.getNumFirst();
|
| | | }
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("num", doneFirst);
|
| | | data.put("limit", Constant.INVITE_CODRE_TAILOR_LIMIT);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 用户队员列表查询
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMyTeamV2", method = RequestMethod.POST)
|
| | | public void getMyTeamV2(AcceptData acceptData, int page, long uid, int type, ThreeSaleFocusDTO focus,
|
| | | PrintWriter out) {
|
| | | if (type != 1 && type != 2) {
|
| | | out.print(JsonUtil.loadFalseResult("粉丝类型不正确"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long firstTeam = 0;
|
| | | long countSecond = 0;
|
| | | List<ThreeSale> listTeam = null;
|
| | | if (!existScreen(focus)) { // 普通查询
|
| | | if (type == 1) {
|
| | | listTeam = threeSaleSerivce.listFirstTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | | } else if (type == 2) {
|
| | | listTeam = threeSaleSerivce.listSecondTeam((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, uid);
|
| | | }
|
| | | firstTeam = threeSaleSerivce.countFirstTeam(uid);
|
| | | countSecond = threeSaleSerivce.countSecondTeam(uid);
|
| | | } else { // 筛选条件
|
| | | List<Long> listId = null;
|
| | | List<TeamFansInfo> listfocus = teamFansInfoService.query((page - 1) * Constant.PAGE_SIZE,
|
| | | Constant.PAGE_SIZE, type, uid, focus);
|
| | | if (listfocus != null && listfocus.size() > 0) {
|
| | | listId = new ArrayList<Long>();
|
| | | for (TeamFansInfo focusInfo : listfocus) {
|
| | | listId.add(focusInfo.getWorkerId());
|
| | | }
|
| | | }
|
| | | |
| | | if (listId != null && listId.size() > 0) {
|
| | | if (type == 1) {
|
| | | listTeam = threeSaleSerivce.listFirstTeam(0, Constant.PAGE_SIZE, uid, listId);
|
| | | } else if (type == 2) {
|
| | | listTeam = threeSaleSerivce.listSecondTeam(0, Constant.PAGE_SIZE, uid, listId);
|
| | | }
|
| | | }
|
| | | firstTeam = teamFansInfoService.count(1, uid, focus);
|
| | | countSecond = teamFansInfoService.count(2, uid, focus);
|
| | | }
|
| | | JSONArray array = organizeTeamNew(acceptData, listTeam, uid, type, true);
|
| | | |
| | | long count = (type == 1) ? firstTeam : countSecond;
|
| | | |
| | | JSONObject result = new JSONObject();
|
| | | result.put("firstTeam", firstTeam);
|
| | | result.put("secondTeam", countSecond);
|
| | | result.put("count", count);
|
| | | result.put("list", array);
|
| | | |
| | | // 统计H5链接
|
| | | if (page == 1) {
|
| | | result.put("link", configService.get(ConfigKeyEnum.teamStatisticsLink.getKey()));
|
| | | }
|
| | | out.print(JsonUtil.loadTrueResult(result));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 验证是否存在筛选条件
|
| | | * @param focus
|
| | | * @return
|
| | | */
|
| | | private boolean existScreen(ThreeSaleFocusDTO focus) {
|
| | | if (focus.getStateValid() != null || focus.getTaobaoBind() != null || focus.getWeixinBind() != null
|
| | | || focus.getMinFansNum() != null || focus.getMinFansNum() != null
|
| | | || focus.getMinActiveTime() != null || focus.getMaxActiveTime() != null
|
| | | || focus.getMinIncome() != null || focus.getMaxIncome() != null || !StringUtil.isNullOrEmpty(focus.getKey()))
|
| | | return true;
|
| | | |
| | | return false;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 用户队员统计
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countMyTeamV2")
|
| | | public void countMyTeamV2(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | JSONObject bossObject = new JSONObject();
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
|
| | | if (threeSale == null) {
|
| | | bossObject.put("exist", false);
|
| | | bossObject.put("desc", "恭喜你!板栗快省优质用户;\r\n\r\n你并没有邀请人,但你的邀请能力默认是开启的;\r\n你拥有独特的无邀请人激活码。");
|
| | | } else {
|
| | | // 上级基本信息
|
| | | Long bossId = threeSale.getBoss().getId();
|
| | | UserInfo userInfo = userInfoService.selectByPKey(bossId);
|
| | | boolean phoneCopy = true;
|
| | | String phone = userInfo.getPhone();
|
| | | if (StringUtil.isNullOrEmpty(phone)) {
|
| | | phone = "";
|
| | | } else {
|
| | | if (!userCustomSettingsService.validateDisplayPhoneByUid(bossId)) {
|
| | | phoneCopy = false;
|
| | | phone = phone.substring(0, 7) + "****";
|
| | | }
|
| | | }
|
| | |
|
| | | // 微信号
|
| | | UserInfoExtra extra = userInfoExtraService.getUserInfoExtra(bossId);
|
| | | if (extra != null) {
|
| | | bossObject.put("weixin", StringUtil.isNullOrEmpty(extra.getWeiXin()) ? "" : extra.getWeiXin());
|
| | | }
|
| | |
|
| | | // 当前等级
|
| | | UserLevelEnum level = null;
|
| | | UserVIPLevel vipLevel = userInviteService.getVIPLevelByUid(bossId);
|
| | | if (vipLevel != null && vipLevel.getLevel() != null) {
|
| | | level = UserLevelUtil.getByLevel(vipLevel.getLevel());
|
| | | }
|
| | | if (level == null) {
|
| | | level = UserLevelEnum.daRen;
|
| | | }
|
| | | level = UserLevelUtil.getShowLevel(level);
|
| | |
|
| | | bossObject.put("exist", true);
|
| | | bossObject.put("nickName", userInfo.getNickName());
|
| | | bossObject.put("portrait", userInfo.getPortrait());
|
| | | bossObject.put("phone", phone);
|
| | | bossObject.put("phoneCopy", phoneCopy);
|
| | | bossObject.put("level", level.name());
|
| | | }
|
| | |
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("boss", bossObject);
|
| | |
|
| | | TearcherInfo tearcherInfo = tearcherService.selectByUid(uid);
|
| | | if (tearcherInfo != null) {
|
| | | JSONObject tearcherObject = new JSONObject();
|
| | | tearcherObject.put("nickName", tearcherInfo.getNickName());
|
| | | tearcherObject.put("portrait", tearcherInfo.getPortrait());
|
| | | tearcherObject.put("phone", tearcherInfo.getPhone());
|
| | | tearcherObject.put("weixin", tearcherInfo.getWxID());
|
| | | tearcherObject.put("level", UserLevelEnum.tearcher);
|
| | | json.put("tearcher", tearcherObject);
|
| | | }
|
| | |
|
| | | JSONObject daren = new JSONObject();
|
| | | JSONObject highVIP = new JSONObject();
|
| | | JSONObject superVIP = new JSONObject();
|
| | |
|
| | | TeamUserLevelStatistic statistic = teamUserLevelStatisticService.selectByUid(uid);
|
| | | if (statistic == null) {
|
| | | daren.put("total", 0);
|
| | | highVIP.put("total", 0);
|
| | | superVIP.put("total", 0);
|
| | | } else {
|
| | | int totalDaren = statistic.getDaRenFirstCount() + statistic.getDaRenSecondCount()
|
| | | + statistic.getNormalFirstCount() + statistic.getNormalSecondCount();
|
| | | daren.put("total", totalDaren);
|
| | | highVIP.put("total", statistic.getHighFirstCount() + statistic.getHighSecondCount());
|
| | | superVIP.put("total", statistic.getSuperFirstCount() + statistic.getSuperSecondCount());
|
| | | }
|
| | | // 统计达人
|
| | | long darenToday = threeSaleSerivce.countFirstTeamByDate(uid, 1) + threeSaleSerivce.countSecondTeamByDate(uid, 1);
|
| | | long darenMonth = threeSaleSerivce.countFirstTeamByDate(uid, 2) + threeSaleSerivce.countSecondTeamByDate(uid, 2);
|
| | | daren.put("today", darenToday);
|
| | | daren.put("month", darenMonth);
|
| | |
|
| | | SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd");
|
| | | String today = sd.format(new Date());
|
| | | // 当月1号
|
| | | Calendar calendar1 = Calendar.getInstance();
|
| | | calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
| | | Date minTime = sd.parse(sd.format(calendar1.getTime()));
|
| | |
|
| | | int highVIPToday = 0;
|
| | | int highVIPMonth = 0;
|
| | | // TODO 统计高级会员数量
|
| | | highVIP.put("today", highVIPToday);
|
| | | highVIP.put("month", highVIPMonth);
|
| | | |
| | | |
| | | int superVIPToday = 0;
|
| | | int superVIPMonth = 0;
|
| | | // 统计超级会员数量
|
| | | superVIP.put("today", superVIPToday);
|
| | | superVIP.put("month", superVIPMonth);
|
| | | |
| | | json.put("daren", daren);
|
| | | json.put("highVIP", highVIP);
|
| | | json.put("superVIP", superVIP);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(json));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取粉丝信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param workerId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getFansInfo")
|
| | | public void getFansInfo(AcceptData acceptData, Long uid, Long workerId, PrintWriter out) {
|
| | | if (uid == null || workerId == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户id缺失"));
|
| | | return;
|
| | | }
|
| | |
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(workerId);
|
| | | if (threeSale == null) {
|
| | | out.print(JsonUtil.loadFalseResult("邀请关系不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo user = userInfoService.selectByPKey(workerId);
|
| | | if (user == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | // 上级
|
| | | UserInfo boss = userInfoService.selectByPKey(threeSale.getBoss().getId());
|
| | | |
| | | |
| | | JSONArray tagArray = new JSONArray();
|
| | | String memoName = user.getNickName();
|
| | | Long succeedTime = threeSale.getSucceedTime();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | String phone = user.getPhone();
|
| | | boolean phoneCopy = true;
|
| | | if (StringUtil.isNullOrEmpty(phone)) {
|
| | | phone = "";
|
| | | } else {
|
| | | if (!userCustomSettingsService.validateDisplayPhoneByUid(workerId)) {
|
| | | phoneCopy = false;
|
| | | phone = phone.substring(0, 7) + "****";
|
| | | }
|
| | | }
|
| | |
|
| | | data.put("bossNickName", boss.getNickName());
|
| | | data.put("nickName", user.getNickName());
|
| | | data.put("phone", phone);
|
| | | data.put("phoneCopy", phoneCopy);
|
| | | data.put("joinTime", TimeUtil.formatDate(succeedTime == null ? threeSale.getCreateTime() : succeedTime));
|
| | |
|
| | | ThreeSaleExtraInfo saleExtraInfo = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(uid, workerId);
|
| | | if (saleExtraInfo != null) {
|
| | | if (!StringUtil.isNullOrEmpty(saleExtraInfo.getNickname())) {
|
| | | memoName = saleExtraInfo.getNickname();
|
| | | }
|
| | | String tags = saleExtraInfo.getTags();
|
| | | if (!StringUtil.isNullOrEmpty(tags)) {
|
| | | tagArray = JSONArray.fromObject(tags);
|
| | | }
|
| | | }
|
| | | data.put("memoName", memoName);
|
| | | data.put("tags", tagArray);
|
| | |
|
| | | Date activeTime = null;
|
| | | String weixin = null;
|
| | | UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(workerId);
|
| | | if (userInfoExtra != null) {
|
| | | weixin = userInfoExtra.getWeiXin();
|
| | | activeTime = userInfoExtra.getActiveTime();
|
| | | }
|
| | | |
| | | if (activeTime == null) {
|
| | | activeTime = new Date(user.getCreatetime());
|
| | | }
|
| | | |
| | | data.put("weixin", StringUtil.isNullOrEmpty(weixin) ? "" : weixin);
|
| | | data.put("loginTime", TimeUtil.formatDate(activeTime));
|
| | |
|
| | | UserExtraTaoBaoInfo userExtraTaoBaoInfo = userExtraTaoBaoInfoService.getByUid(workerId);
|
| | | if (userExtraTaoBaoInfo != null && !StringUtil.isNullOrEmpty(userExtraTaoBaoInfo.getRelationId())
|
| | | && !StringUtil.isNullOrEmpty(userExtraTaoBaoInfo.getSpecialId())) {
|
| | | data.put("taobao", true);
|
| | | } else {
|
| | | data.put("taobao", false);
|
| | | }
|
| | |
|
| | | String levelName = null;
|
| | | UserVIPPreInfo userVIPPreInfo = userVIPPreInfoService.getLatestProcessInfo(workerId);
|
| | | if (userVIPPreInfo != null) {
|
| | | Integer process = userVIPPreInfo.getProcess();
|
| | | if (process == UserVIPPreInfo.PROCESS_1) {
|
| | | levelName = "快省达人";
|
| | | } else if (process == UserVIPPreInfo.PROCESS_2) {
|
| | | levelName = "高级会员";
|
| | | } else if (process == UserVIPPreInfo.PROCESS_3) {
|
| | | levelName = "超级会员";
|
| | | } else if (process == UserVIPPreInfo.PROCESS_4) {
|
| | | levelName = "资深导师";
|
| | | }
|
| | |
|
| | | Integer sourceType = userVIPPreInfo.getSourceType();
|
| | | if (sourceType != null) {
|
| | | if (sourceType == UserVIPPreInfo.SOURCE_TYPE_ORDER) {
|
| | | levelName += "(自购分享型)";
|
| | | } else {
|
| | | levelName += "(邀请团队型)";
|
| | | }
|
| | | }
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(levelName)) {
|
| | | levelName = "快省达人";
|
| | | }
|
| | | data.put("level", levelName);
|
| | |
|
| | | // 粉丝统计
|
| | | long indirectNum = 0;
|
| | | long directNum = threeSaleSerivce.countFirstTeam(workerId);
|
| | | if (directNum > 0) {
|
| | | indirectNum = threeSaleSerivce.countSecondTeam(workerId);
|
| | | }
|
| | | // 订单统计
|
| | | 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+"笔)");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取粉丝信息
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param workerId
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "saveTags")
|
| | | public void saveTags(AcceptData acceptData, Long uid, Long workerId, String tags, PrintWriter out) {
|
| | | if (uid == null || workerId == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户id缺失"));
|
| | | return;
|
| | | }
|
| | |
|
| | | int type = 1;
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(workerId);
|
| | | if (threeSale == null) {
|
| | | type = 2;
|
| | | }
|
| | |
|
| | | ThreeSaleExtraInfo saleExtraInfo = threeSaleExtraInfoSerivce.getbyBossIdAndWorkerId(uid, workerId);
|
| | | if (saleExtraInfo != null) {
|
| | | ThreeSaleExtraInfo upObject = new ThreeSaleExtraInfo();
|
| | | upObject.setTags(tags);
|
| | | upObject.setId(saleExtraInfo.getId());
|
| | | upObject.setUpdateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.updateByPrimaryKeySelective(upObject);
|
| | | } else {
|
| | | saleExtraInfo = new ThreeSaleExtraInfo();
|
| | | saleExtraInfo.setBoss(new UserInfo(uid));
|
| | | saleExtraInfo.setWorker(new UserInfo(workerId));
|
| | | saleExtraInfo.setTags(tags);
|
| | | saleExtraInfo.setType(type);
|
| | | saleExtraInfo.setCreateTime(new Date());
|
| | | threeSaleExtraInfoSerivce.insertSelective(saleExtraInfo);
|
| | | }
|
| | |
|
| | | teamFansInfoService.updateTags(workerId, type, tags);
|
| | | out.print(JsonUtil.loadTrueResult("保存成功"));
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 用户队员统计-h5
|
| | | * |
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "countTeamH5")
|
| | | public void countTeamH5(String callback, AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | try {
|
| | | Date now = new Date();
|
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM");
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | // 今日
|
| | | String todayStr = sdf.format(now);
|
| | | // 昨日
|
| | | Date reduceDay = DateUtil.reduceDay(1, now);
|
| | | // 本月
|
| | | String monthStr = sdf1.format(now);
|
| | | |
| | | TeamDailyRecord todayRecord = new TeamDailyRecord(0,0,0);
|
| | | TeamDailyRecord yesterdayRecord = new TeamDailyRecord(0,0,0);
|
| | | TeamDailyRecord monthRecord = new TeamDailyRecord(0,0,0);
|
| | | TeamDailyRecord totalityRecord = new TeamDailyRecord(0,0,0);
|
| | | |
| | | List<TeamDailyRecord> list = teamDailyRecordService.getbyUid(uid);
|
| | | if (list != null && list.size() > 0) {
|
| | | for (TeamDailyRecord record: list) {
|
| | | Date statisticDay = record.getCountDay();
|
| | | if (todayStr.equals(sdf.format(statisticDay))) {
|
| | | todayRecord = record;
|
| | | }
|
| | | |
| | | if (sdf.format(reduceDay).equals(sdf.format(statisticDay))) {
|
| | | yesterdayRecord = record;
|
| | | }
|
| | | |
| | | if (monthStr.equals(sdf1.format(statisticDay))) {
|
| | | monthRecord.setFirstNum(monthRecord.getFirstNum() + record.getFirstNum());
|
| | | monthRecord.setSecondNum(monthRecord.getSecondNum() + record.getSecondNum());
|
| | | monthRecord.setBeyondNum(monthRecord.getBeyondNum() + record.getBeyondNum());
|
| | | }
|
| | | |
| | | totalityRecord.setFirstNum(totalityRecord.getFirstNum() + record.getFirstNum());
|
| | | totalityRecord.setSecondNum(totalityRecord.getSecondNum() + record.getSecondNum());
|
| | | totalityRecord.setBeyondNum(totalityRecord.getBeyondNum() + record.getBeyondNum());
|
| | | }
|
| | | } |
| | | |
| | | |
| | | JSONObject today = new JSONObject();
|
| | | today.put("direct", todayRecord.getFirstNum());
|
| | | today.put("indirect", todayRecord.getSecondNum());
|
| | | today.put("beyond", todayRecord.getBeyondNum());
|
| | | |
| | | JSONObject yesterday = new JSONObject();
|
| | | yesterday.put("direct", yesterdayRecord.getFirstNum());
|
| | | yesterday.put("indirect", yesterdayRecord.getSecondNum());
|
| | | yesterday.put("beyond", yesterdayRecord.getBeyondNum());
|
| | | |
| | | JSONObject month = new JSONObject();
|
| | | month.put("direct", monthRecord.getFirstNum());
|
| | | month.put("indirect", monthRecord.getSecondNum());
|
| | | month.put("beyond", monthRecord.getBeyondNum());
|
| | | |
| | | JSONObject totality = new JSONObject();
|
| | | totality.put("direct", totalityRecord.getFirstNum());
|
| | | totality.put("indirect", totalityRecord.getSecondNum());
|
| | | totality.put("beyond", totalityRecord.getBeyondNum());
|
| | | |
| | | |
| | | JSONObject json = new JSONObject();
|
| | | json.put("today", today);
|
| | | json.put("yesterday", yesterday);
|
| | | json.put("month", month);
|
| | | json.put("totality", totality);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(json));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("统计失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
| | | } else if (s > 0) {
|
| | | leftTime = s + "秒";
|
| | | leftTime = "还剩" + leftTime;
|
| | | } else {
|
| | | leftTime = "还剩0秒";
|
| | | }
|
| | | }
|
| | | json.put("leftTime", leftTime);
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(callback)) {
|
| | | out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(json)));
|
| | | } else {
|
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.math.RoundingMode;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | 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.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.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | 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.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyDetailService;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.order.HongBaoV2Service;
|
| | | import com.yeshi.fanli.service.inter.order.OrderMoneyDailyCountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.vo.money.IncomeDetailVO;
|
| | | import com.yeshi.fanli.vo.money.MoneyPredictVO;
|
| | | import com.yeshi.fanli.vo.money.MoneyStatisticVO;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 账户系统
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v2/usermoney")
|
| | | public class UserMoneyControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private UserMoneyDetailService userMoneyDetailService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2Service hongBaoV2Service;
|
| | |
|
| | | @Resource
|
| | | private ExtractService extractService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoExtraService userInfoExtraService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | @Resource
|
| | | private OrderMoneyDailyCountService orderMoneyDailyCountService;
|
| | |
|
| | | /**
|
| | | * 用户资金统计
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getMoneyStatistic")
|
| | | public void getMoneyStatistic(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | | 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);
|
| | | if (extractingMoney.compareTo(new BigDecimal(0)) > 0)
|
| | | vo.setExtractingMoneyInfo("提现中:¥" + extractingMoney.setScale(2, RoundingMode.HALF_UP));
|
| | |
|
| | | Date minDate = null;
|
| | | Date maxDate = null;
|
| | | long timeStamp = System.currentTimeMillis();
|
| | | List<UserMoneyDetailTypeEnum> typeList = new ArrayList<>();
|
| | |
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTimeInMillis(timeStamp);
|
| | |
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.extract);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractVerify);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractVerifyNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractReject);
|
| | | typeList.add(UserMoneyDetailTypeEnum.extractAutoWX);
|
| | |
|
| | | // 本月提现
|
| | | 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.setMonthExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | |
|
| | | // 上月提现
|
| | | 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.setLastMonthExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | |
|
| | | minDate = new Date(0L);
|
| | | maxDate = new Date(timeStamp);
|
| | | // 累计成功提现
|
| | | vo.setTotalExtractMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate, 1).abs());
|
| | |
|
| | | // 累计自购返利
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanli);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.fanliWeiQuanNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.orderReward);
|
| | | typeList.add(UserMoneyDetailTypeEnum.orderRewardNew);
|
| | | vo.setTotalFanLiMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | | // 累计分享赚
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.share);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareNew);
|
| | | typeList.add(UserMoneyDetailTypeEnum.shareWeiQuan);
|
| | | vo.setTotalShareMoney(
|
| | | userMoneyDetailService.statisticUserTypeMoneyWithDate(uid, typeList, minDate, maxDate).abs());
|
| | |
|
| | | // 累计邀请赚
|
| | | typeList.clear();
|
| | | typeList.add(UserMoneyDetailTypeEnum.invite);
|
| | | typeList.add(UserMoneyDetailTypeEnum.inviteWeiQuan);
|
| | | typeList.add(UserMoneyDetailTypeEnum.inviteAndShare);
|
| | | typeList.add(UserMoneyDetailTypeEnum.subsidy);
|
| | | typeList.add(UserMoneyDetailTypeEnum.teamReward);
|
| | | 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));
|
| | |
|
| | | // 上月收货
|
| | | 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));
|
| | |
|
| | | // 今日预估
|
| | | calendar.add(Calendar.DAY_OF_YEAR, -1);
|
| | | minDate = new Date(TimeUtil.convertDateToTemp(TimeUtil.getGernalTime(timeStamp)));
|
| | | vo.setTodayPredict(cratePredictVO(orderMoneyDailyCountService.query(uid, minDate, null)));
|
| | |
|
| | | // 本月预估
|
| | | 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.setMonthPredict(cratePredictVO(orderMoneyDailyCountService.query(uid, minDate, maxDate)));
|
| | |
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.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);
|
| | | return new JsonPrimitive(value.toString());
|
| | | }
|
| | | }
|
| | | });
|
| | | out.print(JsonUtil.loadTrueResult(builder.create().toJson(vo)));
|
| | | }
|
| | |
|
| | | private MoneyPredictVO cratePredictVO(List<OrderMoneyDailyCount> list) {
|
| | | MoneyPredictVO predictVO = new MoneyPredictVO();
|
| | | predictVO.setMineNum(0);
|
| | | predictVO.setTeamNum(0);
|
| | | predictVO.setMineMoney(BigDecimal.valueOf(0));
|
| | | predictVO.setTeamMoney(BigDecimal.valueOf(0));
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | for (OrderMoneyDailyCount dailyCount : list) {
|
| | | if (dailyCount.getOrderNum() != null) {
|
| | | predictVO.setMineNum(predictVO.getMineNum() + dailyCount.getOrderNum());
|
| | | }
|
| | |
|
| | | if (dailyCount.getOrderNumTeam() != null) {
|
| | | predictVO.setTeamNum(predictVO.getTeamNum() + dailyCount.getOrderNumTeam());
|
| | | }
|
| | |
|
| | | if (dailyCount.getIncome() != null) {
|
| | | predictVO.setMineMoney(predictVO.getMineMoney().add(dailyCount.getIncome()));
|
| | | }
|
| | |
|
| | | if (dailyCount.getIncomeTeam() != null) {
|
| | | predictVO.setTeamMoney(predictVO.getTeamMoney().add(dailyCount.getIncomeTeam()));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | predictVO.setTotalNum(predictVO.getTeamNum() + predictVO.getMineNum());
|
| | | predictVO.setTotalMoney(predictVO.getMineMoney().add(predictVO.getTeamMoney()));
|
| | | return predictVO;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 历史详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param datetype 1-天 - 2月
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHistoryDetail")
|
| | | public void getHistoryDetail(AcceptData acceptData, Long uid, String date, Integer datetype, PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(date) || datetype == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "参数不完整"));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | Date minDay = new Date();
|
| | | Date maxDay = new Date();
|
| | | BigDecimal zero = new BigDecimal(0);
|
| | | List<OrderMoneyDailyCount> listDailyCount = null;
|
| | | List<MoneyPredictVO> list = new ArrayList<>();
|
| | | SimpleDateFormat formatMonth = new SimpleDateFormat("yyyy年MM月");
|
| | | SimpleDateFormat formatDay = new SimpleDateFormat("yyyy年MM月dd日");
|
| | | if (datetype == 1) {
|
| | | // 后退7个月
|
| | | int countNum = 7;
|
| | | Date day = TimeUtil.parseYYYYMMDD(date);
|
| | | for (int i = 0; i < countNum; i++) {
|
| | | MoneyPredictVO predictVO = new MoneyPredictVO(zero, 0, zero, 0);
|
| | | if (i == 0) {
|
| | | predictVO.setCountDate(formatDay.format(day));
|
| | | } else {
|
| | | predictVO.setCountDate(formatDay.format(DateUtil.reduceDay(i, day)));
|
| | | }
|
| | | list.add(predictVO);
|
| | |
|
| | | if (i == countNum - 1) {
|
| | | minDay = DateUtil.reduceDay(i, day);
|
| | | }
|
| | | }
|
| | | maxDay = TimeUtil.parseYYYYMMDD_HHMMSS(date + " 23:59:59");
|
| | | listDailyCount = orderMoneyDailyCountService.sumGroupByCountDay(uid, minDay, maxDay);
|
| | | } else if (datetype == 2) {
|
| | | // 后退3个月
|
| | | int countNum = 3;
|
| | | Date day = TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(date));
|
| | | for (int i = 0; i < countNum; i++) {
|
| | | MoneyPredictVO predictVO = new MoneyPredictVO(zero, 0, zero, 0);
|
| | | if (i == 0) {
|
| | | predictVO.setCountDate(formatMonth.format(day));
|
| | | } else {
|
| | | predictVO.setCountDate(formatMonth.format(DateUtil.reduceMonth(day, i)));
|
| | | }
|
| | | list.add(predictVO);
|
| | |
|
| | | if (i == countNum - 1) {
|
| | | minDay = DateUtil.reduceMonth(day, i);
|
| | | }
|
| | | }
|
| | | maxDay = TimeUtil.parseYYYYMMDD_HHMMSS(DateUtil.getLastDayOfMonth(date) + " 23:59:59");
|
| | | listDailyCount = orderMoneyDailyCountService.sumGroupByYearMonth(uid, minDay, maxDay);
|
| | | }
|
| | |
|
| | | for (MoneyPredictVO predictVO : list) {
|
| | | String countDate = predictVO.getCountDate();
|
| | |
|
| | | if (listDailyCount != null && listDailyCount.size() > 0) {
|
| | | for (OrderMoneyDailyCount dailyCount : listDailyCount) {
|
| | | Date countDay = dailyCount.getCountDay();
|
| | | if (datetype == 1 && countDay != null && countDate.equals(formatDay.format(countDay))) {
|
| | | predictVO.setMineNum(dailyCount.getOrderNum());
|
| | | predictVO.setMineMoney(dailyCount.getIncome());
|
| | | predictVO.setTeamNum(dailyCount.getOrderNumTeam());
|
| | | predictVO.setTeamMoney(dailyCount.getIncomeTeam());
|
| | | break;
|
| | | }
|
| | |
|
| | | String yearMonth = dailyCount.getYearMonth();
|
| | | if (datetype == 2 && !StringUtil.isNullOrEmpty(yearMonth)
|
| | | && countDate.equals(formatMonth.format(TimeUtil.parseYYYYMMDD(DateUtil.getFirstDayOfMonth(yearMonth))))) {
|
| | | predictVO.setMineNum(dailyCount.getOrderNum());
|
| | | predictVO.setMineMoney(dailyCount.getIncome());
|
| | | predictVO.setTeamNum(dailyCount.getOrderNumTeam());
|
| | | predictVO.setTeamMoney(dailyCount.getIncomeTeam());
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | predictVO.setTotalNum(predictVO.getTeamNum() + predictVO.getMineNum());
|
| | | predictVO.setTotalMoney(predictVO.getMineMoney().add(predictVO.getTeamMoney()));
|
| | | }
|
| | |
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
|
| | | @Override
|
| | | public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("0.00");
|
| | | } else {
|
| | | // 保留2位小数
|
| | | value = value.setScale(2);
|
| | | return new JsonPrimitive(value.toString());
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("count", list.size());
|
| | | object.put("list", builder.create().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(object));
|
| | | } catch (ParseException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 收益详情
|
| | | * |
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param datetype
|
| | | * @param type
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getIncomeDetail")
|
| | | public void getIncomeDetail(AcceptData acceptData, Long uid, String date, Integer datetype, Integer type,
|
| | | PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(date) || datetype == null || type == null) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "参数不完整"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Date minDay = new Date();
|
| | | Date maxDay = new Date();
|
| | | if (datetype == 1) {
|
| | | minDay = TimeUtil.parseYYYYMMDD(date);
|
| | | maxDay = TimeUtil.parseYYYYMMDD_HHMMSS(date + " 23:59:59");
|
| | | } else if (datetype == 2) {
|
| | | String firstDay = DateUtil.getFirstDayOfMonth(date);
|
| | | String lastDay = DateUtil.getLastDayOfMonth(date);
|
| | | minDay = TimeUtil.parseYYYYMMDD(firstDay);
|
| | | maxDay = TimeUtil.parseYYYYMMDD_HHMMSS(lastDay + " 23:59:59");
|
| | | }
|
| | |
|
| | | List<OrderMoneyDailyCount> listDailyCount = null;
|
| | | if (type == 1) {
|
| | | listDailyCount = orderMoneyDailyCountService.sumGroupBySourceType(uid, minDay, maxDay);
|
| | | } else if (type == 1) {
|
| | | listDailyCount = orderMoneyDailyCountService.sumTeamGroupBySourceType(uid, minDay, maxDay);
|
| | | }
|
| | |
|
| | | BigDecimal zero = new BigDecimal(0);
|
| | | List<IncomeDetailVO> list = new ArrayList<>();
|
| | |
|
| | | SourceTypeEnum[] arrayEnun = SourceTypeEnum.values();
|
| | | for (int m = 0; m < arrayEnun.length; m++) {
|
| | | SourceTypeEnum typeEnum = arrayEnun[m];
|
| | | IncomeDetailVO detail = new IncomeDetailVO(typeEnum.getIcon(), 0, zero);
|
| | | if (listDailyCount != null && listDailyCount.size() > 0) {
|
| | | for (OrderMoneyDailyCount dailyCount : listDailyCount) {
|
| | | if (dailyCount.getSourceType() == typeEnum) {
|
| | | detail.setNum(detail.getNum() + dailyCount.getOrderNum());
|
| | | detail.setMoney(detail.getMoney().add(dailyCount.getIncome()));
|
| | | }
|
| | | }
|
| | | }
|
| | | list.add(detail);
|
| | | }
|
| | |
|
| | | GsonBuilder builder = new GsonBuilder();
|
| | | builder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
|
| | | @Override
|
| | | public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("0.00");
|
| | | } else {
|
| | | // 保留2位小数
|
| | | value = value.setScale(2);
|
| | | return new JsonPrimitive(value.toString());
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("count", list.size());
|
| | | object.put("list", builder.create().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(object));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "getExtractRecord")
|
| | | public void getExtractRecord(AcceptData acceptData, Integer page, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<Extract> list = extractService.getExtractSucceedRecord(page, Constant.PAGE_SIZE, uid);
|
| | | if (list == null) {
|
| | | list = new ArrayList<>();
|
| | | }
|
| | |
|
| | | JSONArray JSONArray = new JSONArray();
|
| | | for (Extract extract : list) {
|
| | | Date receiveTime = extract.getReceiveTime();
|
| | | if (receiveTime == null) {
|
| | | receiveTime = new Date(extract.getExtractTime());
|
| | | }
|
| | | String account = "支付宝:" + UserUtil.filterAlipayAccount(extract.getAccount());
|
| | | account = account + "-姓名:" + UserUtil.filterAlipayName(extract.getName());
|
| | |
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("title", "你于" + TimeUtil.formatDate(receiveTime) + "提现成功");
|
| | | object.put("account", account);
|
| | | object.put("money", "¥" + extract.getMoney().setScale(2).toString());
|
| | | JSONArray.add(object);
|
| | | }
|
| | |
|
| | | JSONObject json = new JSONObject();
|
| | | json.put("count", extractService.countExtractSucceedRecord(uid));
|
| | | json.put("list", JSONArray);
|
| | | out.print(JsonUtil.loadTrueResult(json));
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.dao.dynamic; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.regex.Pattern; |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType) { |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType, String typeEnum) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("dynamicType").is(dynamicType)); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | list.add(Criteria.where("dynamicType").is(dynamicType)); |
| | | |
| | | if (state != null) { |
| | | query.addCriteria(Criteria.where("state").is(state)); |
| | | list.add(Criteria.where("state").is(state)); |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(typeEnum)) |
| | | list.add(Criteria.where("type").is(typeEnum)); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(key)) |
| | | query.addCriteria(new Criteria().orOperator( |
| | | list.add(new Criteria().orOperator( |
| | | Criteria.where("title").regex(Pattern.compile("^.*" + key + ".*$", Pattern.CASE_INSENSITIVE)))); |
| | | |
| | | |
| | | 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.skip(start).limit(count); |
| | | query.with(new Sort(Sort.Direction.DESC,"weight")).with(new Sort(Sort.Direction.DESC,"createTime")); |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | | public long count(String key, Integer state, int dynamicType) { |
| | | public long count(String key, Integer state, int dynamicType, String typeEnum) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("dynamicType").is(dynamicType)); |
| | | |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | list.add(Criteria.where("dynamicType").is(dynamicType)); |
| | | |
| | | if (state != null) { |
| | | query.addCriteria(Criteria.where("state").is(state)); |
| | | list.add(Criteria.where("state").is(state)); |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(typeEnum)) |
| | | list.add(Criteria.where("type").is(typeEnum)); |
| | | |
| | | if (!StringUtil.isNullOrEmpty(key)) |
| | | query.addCriteria(new Criteria().orOperator( |
| | | list.add(new Criteria().orOperator( |
| | | Criteria.where("title").regex(Pattern.compile("^.*" + key + ".*$", Pattern.CASE_INSENSITIVE)))); |
| | | |
| | | 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.count(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | |
| | | public List<GoodsEvaluate> queryValid(int start, int count, int dynamicType) { |
| | | Date now = new Date(); |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("dynamicType").is(dynamicType)); |
| | | query.addCriteria(Criteria.where("state").is(1)); |
| | | query.addCriteria(Criteria.where("startTime").lte(now)); |
| | | query.addCriteria(Criteria.where("endTime").gte(now)); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | |
| | | list.add(Criteria.where("dynamicType").is(dynamicType)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | list.add(Criteria.where("startTime").lte(now)); |
| | | list.add(Criteria.where("endTime").gte(now)); |
| | | |
| | | 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.skip(start).limit(count); |
| | | query.with(new Sort(Sort.Direction.DESC,"weight")).with(new Sort(Sort.Direction.DESC,"startTime")); |
| | | return mongoTemplate.find(query, GoodsEvaluate.class); |
| | |
| | | public long countValid(int dynamicType) { |
| | | Date now = new Date(); |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("dynamicType").is(dynamicType)); |
| | | query.addCriteria(Criteria.where("state").is(1)); |
| | | query.addCriteria(Criteria.where("startTime").lte(now)); |
| | | query.addCriteria(Criteria.where("endTime").gte(now)); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | |
| | | list.add(Criteria.where("dynamicType").is(dynamicType)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | list.add(Criteria.where("startTime").lte(now)); |
| | | list.add(Criteria.where("endTime").gte(now)); |
| | | |
| | | 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.count(query, GoodsEvaluate.class); |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<GoodsEvaluate> querySingleExist() { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("dynamicType").is(1)); |
| | | query.addCriteria(Criteria.where("state").is(1)); |
| | | query.addCriteria(Criteria.where("goods.goodsType").is(1)); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | |
| | | list.add(Criteria.where("dynamicType").is(1)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | list.add(Criteria.where("goods.goodsType").is(1)); |
| | | |
| | | 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); |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<GoodsEvaluate> queryExist(int goodsType, Long goodsId) { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("dynamicType").is(1)); |
| | | query.addCriteria(Criteria.where("state").is(1)); |
| | | query.addCriteria(Criteria.where("imgList.goods.goodsId").is(goodsId)); |
| | | query.addCriteria(Criteria.where("imgList.goods.goodsType").is(goodsType)); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | list.add(Criteria.where("dynamicType").is(1)); |
| | | list.add(Criteria.where("state").is(1)); |
| | | 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); |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<GoodsEvaluate> removeDownGoods() { |
| | | Query query = new Query(); |
| | | query.addCriteria(Criteria.where("type").is("single")); |
| | | query.addCriteria(Criteria.where("goods.state").is(1)); |
| | | List<Criteria> list = new ArrayList<Criteria>(); |
| | | list.add(Criteria.where("type").is("single")); |
| | | list.add(Criteria.where("goods.state").is(1)); |
| | | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | * @return
|
| | | */
|
| | | BigDecimal sumMoneyByUidAndState(@Param("uid") Long uid,@Param("stateList")List<Integer> stateList);
|
| | | |
| | | |
| | | /**
|
| | | * 查询提现成功记录
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<Extract> getExtractSucceedRecord(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
|
| | |
|
| | | |
| | | Long countExtractSucceedRecord(@Param("uid") Long uid);
|
| | |
|
| | | } |
| | |
| | | Long countOrderByTypeAndDate(@Param("orderType") Integer orderType, @Param("preDay") String preDay);
|
| | |
|
| | |
|
| | | /**
|
| | | * 统计近日到账收入金额
|
| | | * @param uid
|
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | BigDecimal sumMoneyArrivalByUidAndNearDay(@Param("uid") Long uid, @Param("day") int day);
|
| | | |
| | | |
| | | /**
|
| | | * 统计结算金额
|
| | | * @param uid
|
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | BigDecimal sumMoneyBySettleTimeAndUid(@Param("uid") Long uid, @Param("minDate") Date minDate, @Param("maxDate") Date maxDate);
|
| | |
|
| | | /**
|
| | | * 180内未收货的金额
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | BigDecimal sumMoneyByANotSettleAndUid(@Param("uid") Long uid);
|
| | | |
| | | |
| | | } |
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
|
| | | List<ThreeSale> listFirstTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
|
| | | @Param("listId")List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 查询二级队员
|
| | |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid);
|
| | | List<ThreeSale> listSecondTeam(@Param("start") long start, @Param("count") int count, @Param("uid") Long uid,
|
| | | @Param("listId")List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 统计一级队员
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countFirstTeam(@Param("uid") Long uid);
|
| | | long countFirstTeam(@Param("uid") Long uid, @Param("listId")List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 统计二级队员
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countSecondTeam(@Param("uid") Long uid);
|
| | | long countSecondTeam(@Param("uid") Long uid, @Param("listId")List<Long> listId);
|
| | |
|
| | |
|
| | | |
| | | /**
|
| | | * 统计一级队员
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countFirstTeamByDate(@Param("uid") Long uid, @Param("dayType")int dayType);
|
| | | |
| | | /**
|
| | | * 统计二级队员
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | long countSecondTeamByDate(@Param("uid") Long uid, @Param("dayType")int dayType);
|
| | | |
| | | /**
|
| | | * 根据id、uid查询
|
| | | *
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.homemodule; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra; |
| | | |
| | | public interface SpecialExtraMapper extends BaseMapper<SpecialExtra> { |
| | | |
| | | } |
| | |
| | | |
| | | List<Long> getDownOrderUserByListUidAndDate(@Param("preDay") Date preDay,@Param("list") List<Long> list); |
| | | |
| | | |
| | | /** |
| | | * 统计近 day天有效订单数量 |
| | | * @param uid |
| | | * @param source |
| | | * @param day |
| | | * @return |
| | | */ |
| | | Long countOrderBySourceAndNearDay(@Param("uid") Long uid, @Param("source") int source, @Param("day") int day); |
| | | |
| | | |
| | | } |
| | |
| | | */
|
| | | void addGoldCoinByUid(@Param("uid")Long uid, @Param("goldCoin")Integer goldCoin);
|
| | |
|
| | | /**
|
| | | * 开启提现:超过60天关闭
|
| | | * @param days
|
| | | */
|
| | | void updateAutoExtract(@Param("days")Integer days);
|
| | | |
| | |
|
| | | /**
|
| | | * 根据邀请码+ vip邀请码查询
|
New file |
| | |
| | | package com.yeshi.fanli.dao.order;
|
| | |
|
| | | public enum DateTypeEnum {
|
| | | DATE("1", "%Y-%m-%d"),
|
| | | MONTH("2", "%Y-%m"),
|
| | | YEAR("3", "%Y");
|
| | | |
| | | private String name;
|
| | | private String value;
|
| | |
|
| | | private DateTypeEnum(String name, String value) {
|
| | | this.name = name;
|
| | | this.value = value;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public String getValue() {
|
| | | return value;
|
| | | }
|
| | |
|
| | | public void setValue(String value) {
|
| | | this.value = value;
|
| | | }
|
| | |
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Locale;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.mongodb.BasicDBList;
|
| | | import com.mongodb.BasicDBObject;
|
| | | import com.mongodb.DBCollection;
|
| | | import com.mongodb.DBObject;
|
| | | import com.mongodb.GroupCommand;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount;
|
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount.SourceTypeEnum;
|
| | |
|
| | | @Repository
|
| | | public class OrderMoneyDailyCountDao {
|
| | |
|
| | | private static String collectionName = "order_money_daily_count";
|
| | |
|
| | | @Resource
|
| | | private MongoTemplate mongoTemplate;
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void save(OrderMoneyDailyCount record) {
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | | mongoTemplate.save(record);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询ID
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public OrderMoneyDailyCount getById(String id) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("id").is(id));
|
| | | return mongoTemplate.findOne(query, OrderMoneyDailyCount.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 选择更新
|
| | | * |
| | | * @param info
|
| | | */
|
| | | public void updateSelective(OrderMoneyDailyCount info) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("id").is(info.getId()));
|
| | | Update update = new Update();
|
| | | if (info.getIncome() != null)
|
| | | update.set("income", info.getIncome());
|
| | | if (info.getIncomeTeam() != null)
|
| | | update.set("incomeTeam", info.getIncomeTeam());
|
| | | if (info.getOrderNum() != null)
|
| | | update.set("orderNum", info.getOrderNum());
|
| | | if (info.getOrderNumTeam() != null)
|
| | | update.set("orderNumTeam", info.getOrderNumTeam());
|
| | | update.set("updateTime", new Date());
|
| | | mongoTemplate.updateMulti(query, update, OrderMoneyDailyCount.class);
|
| | | }
|
| | |
|
| | | // 查询
|
| | | public List<OrderMoneyDailyCount> query(Long uid, Date minDay, Date maxDay) {
|
| | | Query query = new Query();
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | list.add(Criteria.where("uid").is(uid));
|
| | |
|
| | | if (minDay != null) {
|
| | | list.add(Criteria.where("bossSuperId").lte(uid));
|
| | | }
|
| | |
|
| | | if (maxDay != null) {
|
| | | list.add(Criteria.where("bossSuperId").gte(uid));
|
| | | }
|
| | |
|
| | | 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, "countDay"));
|
| | | return mongoTemplate.find(query, OrderMoneyDailyCount.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 统计我的金额订单数量-- 来源分组统计
|
| | | * |
| | | * @param uid
|
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | public List<OrderMoneyDailyCount> sumGroupBySourceType(Long uid, Date minDate, Date maxDate) {
|
| | | String collectionName = "order_money_daily_count";
|
| | | List<OrderMoneyDailyCount> listDailyCount = new ArrayList<>();
|
| | |
|
| | | // 统计方法
|
| | | String reduce = "function(doc, aggr){"
|
| | | + " aggr.totalIncome += parseFloat((Math.round((doc.income)*100)/100).toFixed(2));"
|
| | | + " aggr.totalNum += doc.orderNum;" + "}";
|
| | |
|
| | | // 查询条件
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | list.add(Criteria.where("uid").is(uid));
|
| | | if (minDate != null)
|
| | | list.add(Criteria.where("countDay").gte(minDate));
|
| | | if (maxDate != null)
|
| | | list.add(Criteria.where("countDay").lte(maxDate));
|
| | |
|
| | | 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));
|
| | | }
|
| | |
|
| | | BasicDBObject agg = new BasicDBObject("sourceType", "");
|
| | |
|
| | | Map<String, Object> map = new HashMap<>();
|
| | | map.put("totalIncome", 0);
|
| | | map.put("totalNum", 0);
|
| | | BasicDBObject dbObject = new BasicDBObject(map);
|
| | | // BasicDBObject basicDBObject2 = new BasicDBObject("total", 0);
|
| | |
|
| | | DBObject result = mongoTemplate.getCollection(collectionName).group(agg, query.getQueryObject(), dbObject,
|
| | | reduce);
|
| | | Map<String, BasicDBObject> mapResult = result.toMap();
|
| | | if (mapResult.size() > 0) {
|
| | | SourceTypeEnum[] arrayEnun = SourceTypeEnum.values();
|
| | |
|
| | | for (int i = 0; i < mapResult.size(); i++) {
|
| | | BasicDBObject object = mapResult.get(i + "");
|
| | | SourceTypeEnum sourceTypeEnum = null;
|
| | | for (int m = 0; m < arrayEnun.length; m++) {
|
| | | if (arrayEnun[m].name().equals(object.get("sourceType").toString())) {
|
| | | sourceTypeEnum = arrayEnun[m];
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | OrderMoneyDailyCount dailyCount = new OrderMoneyDailyCount();
|
| | | dailyCount.setSourceType(sourceTypeEnum);
|
| | | dailyCount.setIncome(new BigDecimal(object.get("totalIncome").toString()));
|
| | | dailyCount.setOrderNum(new BigDecimal(object.get("totalNum").toString()).intValue());
|
| | | listDailyCount.add(dailyCount);
|
| | | }
|
| | | }
|
| | | return listDailyCount;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 统计团队金额订单数量-- 来源分组统计
|
| | | * |
| | | * @param uid
|
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | public List<OrderMoneyDailyCount> sumTeamGroupBySourceType(Long uid, Date minDate, Date maxDate) {
|
| | | String collectionName = "order_money_daily_count";
|
| | | List<OrderMoneyDailyCount> listDailyCount = new ArrayList<>();
|
| | |
|
| | | // 统计方法
|
| | | String reduce = "function(doc, aggr){"
|
| | | + " aggr.totalIncome += parseFloat((Math.round((doc.incomeTeam)*100)/100).toFixed(2));"
|
| | | + " aggr.totalNum += doc.orderNumTeam;" + "}";
|
| | |
|
| | | // 查询条件
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | list.add(Criteria.where("uid").is(uid));
|
| | | if (minDate != null)
|
| | | list.add(Criteria.where("countDay").gte(minDate));
|
| | | if (maxDate != null)
|
| | | list.add(Criteria.where("countDay").lte(maxDate));
|
| | |
|
| | | 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));
|
| | | }
|
| | |
|
| | | BasicDBObject agg = new BasicDBObject("sourceType", "");
|
| | |
|
| | | Map<String, Object> map = new HashMap<>();
|
| | | map.put("totalIncome", 0);
|
| | | map.put("totalNum", 0);
|
| | | BasicDBObject dbObject = new BasicDBObject(map);
|
| | | // BasicDBObject basicDBObject2 = new BasicDBObject("total", 0);
|
| | |
|
| | | DBObject result = mongoTemplate.getCollection(collectionName).group(agg, query.getQueryObject(), dbObject,
|
| | | reduce);
|
| | | Map<String, BasicDBObject> mapResult = result.toMap();
|
| | | if (mapResult.size() > 0) {
|
| | | SourceTypeEnum[] arrayEnun = SourceTypeEnum.values();
|
| | | for (int i = 0; i < mapResult.size(); i++) {
|
| | | BasicDBObject object = mapResult.get(i + "");
|
| | | OrderMoneyDailyCount dailyCount = new OrderMoneyDailyCount();
|
| | |
|
| | | SourceTypeEnum sourceTypeEnum = null;
|
| | | for (int m = 0; m < arrayEnun.length; m++) {
|
| | | if (arrayEnun[m].name().equals(object.get("sourceType").toString())) {
|
| | | sourceTypeEnum = arrayEnun[m];
|
| | | break;
|
| | | }
|
| | | }
|
| | | dailyCount.setSourceType(sourceTypeEnum);
|
| | | dailyCount.setIncome(new BigDecimal(object.get("totalIncome").toString()));
|
| | | dailyCount.setOrderNum(new BigDecimal(object.get("totalNum").toString()).intValue());
|
| | | listDailyCount.add(dailyCount);
|
| | | }
|
| | | }
|
| | | return listDailyCount;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 统计每天订单收入、数量
|
| | | * @param uid
|
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | public List<OrderMoneyDailyCount> sumGroupByCountDay(Long uid, Date minDate, Date maxDate) {
|
| | | // 查询条件
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | list.add(Criteria.where("uid").is(uid));
|
| | | if (minDate != null)
|
| | | list.add(Criteria.where("countDay").gte(minDate));
|
| | | if (maxDate != null)
|
| | | list.add(Criteria.where("countDay").lte(maxDate));
|
| | |
|
| | | 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));
|
| | | }
|
| | |
|
| | | Map<String, Object> map = new HashMap<>();
|
| | | map.put("totalIncome", 0);
|
| | | map.put("totalNum", 0);
|
| | | map.put("totalIncomeTeam", 0);
|
| | | map.put("totalNumTeam", 0);
|
| | | BasicDBObject initial = new BasicDBObject(map);
|
| | |
|
| | | // 进行按天、周、月分组
|
| | | BasicDBObject agg = new BasicDBObject("countDay", "");
|
| | | DBCollection collection = mongoTemplate.getCollection(collectionName);
|
| | | GroupCommand xx = new GroupCommand(collection, agg, query.getQueryObject(), initial, getReduce(), null);
|
| | | BasicDBList objects = (BasicDBList) collection.group(xx);
|
| | |
|
| | | List<OrderMoneyDailyCount> results = new ArrayList<>();
|
| | | if (objects != null) {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy", Locale.US);
|
| | | for (int i = 0; i < objects.size(); i++) {
|
| | | BasicDBObject dbObject = (BasicDBObject) objects.get(i);
|
| | | if (dbObject == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | Object object = dbObject.get("countDay");
|
| | | if (object == null) {
|
| | | continue;
|
| | | }
|
| | |
|
| | | try {
|
| | | String date = object.toString();
|
| | | Date dtime = sdf.parse(date);
|
| | | OrderMoneyDailyCount dailyCount = new OrderMoneyDailyCount();
|
| | | dailyCount.setCountDay(dtime);
|
| | | dailyCount.setIncome(new BigDecimal(dbObject.get("totalIncome").toString()));
|
| | | dailyCount.setOrderNum(new BigDecimal(dbObject.get("totalNum").toString()).intValue());
|
| | | dailyCount.setIncomeTeam(new BigDecimal(dbObject.get("totalIncomeTeam").toString()));
|
| | | dailyCount.setOrderNumTeam(new BigDecimal(dbObject.get("totalNumTeam").toString()).intValue());
|
| | | results.add(dailyCount);
|
| | | } catch (ParseException e) {
|
| | | e.printStackTrace();
|
| | | continue;
|
| | | }
|
| | | }
|
| | | }
|
| | | return results;
|
| | | }
|
| | |
|
| | | |
| | | private String getReduce() {
|
| | | StringBuilder builder = new StringBuilder();
|
| | | builder.append("function(doc, aggr){ ");
|
| | | builder.append(" aggr.totalIncome += parseFloat((Math.round((doc.income)*100)/100).toFixed(2));");
|
| | | builder.append(" aggr.totalNum += doc.orderNum;");
|
| | | builder.append(" aggr.totalIncomeTeam += parseFloat((Math.round((doc.incomeTeam)*100)/100).toFixed(2));");
|
| | | builder.append(" aggr.totalNumTeam += doc.orderNumTeam;");
|
| | | builder.append(" }");
|
| | | return builder.toString();
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 统计每月订单收入、数量
|
| | | * @param uid
|
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | public List<OrderMoneyDailyCount> sumGroupByYearMonth(Long uid, Date minDate, Date maxDate) {
|
| | | // 查询条件
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | | list.add(Criteria.where("uid").is(uid));
|
| | | if (minDate != null)
|
| | | list.add(Criteria.where("countDay").gte(minDate));
|
| | | if (maxDate != null)
|
| | | list.add(Criteria.where("countDay").lte(maxDate));
|
| | |
|
| | | 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));
|
| | | }
|
| | |
|
| | | Map<String, Object> map = new HashMap<>();
|
| | | map.put("totalIncome", 0);
|
| | | map.put("totalNum", 0);
|
| | | map.put("totalIncomeTeam", 0);
|
| | | map.put("totalNumTeam", 0);
|
| | | BasicDBObject initial = new BasicDBObject(map);
|
| | |
|
| | | // 进行按天、周、月分组
|
| | | BasicDBObject agg = new BasicDBObject("yearMonth", "");
|
| | | DBCollection collection = mongoTemplate.getCollection(collectionName);
|
| | | GroupCommand xx = new GroupCommand(collection, agg, query.getQueryObject(), initial, getReduce(), null);
|
| | | BasicDBList objects = (BasicDBList) collection.group(xx);
|
| | |
|
| | | List<OrderMoneyDailyCount> results = new ArrayList<>();
|
| | | if (objects != null) {
|
| | | for (int i = 0; i < objects.size(); i++) {
|
| | | BasicDBObject dbObject = (BasicDBObject) objects.get(i);
|
| | | if (dbObject == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | Object object = dbObject.get("yearMonth");
|
| | | if (object == null) {
|
| | | continue;
|
| | | }
|
| | | |
| | | OrderMoneyDailyCount dailyCount = new OrderMoneyDailyCount();
|
| | | dailyCount.setYearMonth(object.toString());
|
| | | dailyCount.setIncome(new BigDecimal(dbObject.get("totalIncome").toString()));
|
| | | dailyCount.setOrderNum(new BigDecimal(dbObject.get("totalNum").toString()).intValue());
|
| | | dailyCount.setIncomeTeam(new BigDecimal(dbObject.get("totalIncomeTeam").toString()));
|
| | | dailyCount.setOrderNumTeam(new BigDecimal(dbObject.get("totalNumTeam").toString()).intValue());
|
| | | results.add(dailyCount);
|
| | | }
|
| | | }
|
| | | return results;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user.invite;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | 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.entity.bus.user.vip.TeamDailyRecord;
|
| | |
|
| | | @Repository
|
| | | public class TeamDailyRecordDao {
|
| | |
|
| | | @Resource
|
| | | private MongoTemplate mongoTemplate;
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void save(TeamDailyRecord record) {
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | | mongoTemplate.save(record);
|
| | | }
|
| | | |
| | | /**
|
| | | * 根据id查询数据
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public TeamDailyRecord getById(String id) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("id").is(id));
|
| | | return mongoTemplate.findOne(query, TeamDailyRecord.class);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询
|
| | | * @return
|
| | | */
|
| | | public List<TeamDailyRecord> getbyUid(Long uid) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("uid").is(uid));
|
| | | return mongoTemplate.find(query, TeamDailyRecord.class);
|
| | | }
|
| | | |
| | | /**
|
| | | * 查询
|
| | | * @return
|
| | | */
|
| | | public List<TeamDailyRecord> getbyUid(Long uid, Date minTime) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("uid").is(uid));
|
| | | query.addCriteria(Criteria.where("statisticDay").lte(minTime));
|
| | | return mongoTemplate.find(query, TeamDailyRecord.class);
|
| | | }
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dao.user.invite;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.regex.Pattern;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.data.domain.Sort;
|
| | | import org.springframework.data.mongodb.core.MongoTemplate;
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.TeamFansInfo;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Repository
|
| | | public class TeamFansInfoDao {
|
| | |
|
| | | @Resource
|
| | | private MongoTemplate mongoTemplate;
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void save(TeamFansInfo record) {
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | | mongoTemplate.save(record);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新标签
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void updateMemoName(Long workerId, int type, String memoName) {
|
| | | if (memoName == null) {
|
| | | memoName = "";
|
| | | }
|
| | |
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | |
|
| | | Update update = null;
|
| | | if (type == 1) {
|
| | | update = Update.update("memoName", memoName);
|
| | | } else {
|
| | | update = Update.update("memoNameSup", memoName);
|
| | | }
|
| | | mongoTemplate.updateFirst(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新标签
|
| | | * |
| | | * @param record
|
| | | */
|
| | | public void updateTags(Long workerId, int type, String tags) {
|
| | | if (tags == null) {
|
| | | tags = "";
|
| | | }
|
| | |
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | |
|
| | | Update update = null;
|
| | | if (type == 1) {
|
| | | update = Update.update("tags", tags);
|
| | | } else {
|
| | | update = Update.update("tagsSup", tags);
|
| | | }
|
| | | mongoTemplate.updateFirst(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新昵称
|
| | | * |
| | | * @param workerId
|
| | | * @param nickName
|
| | | */
|
| | | public void updateNickName(Long workerId, String nickName) {
|
| | | if (nickName == null) {
|
| | | nickName = "";
|
| | | }
|
| | |
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("nickName", nickName);
|
| | | mongoTemplate.updateFirst(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新是否有效粉丝
|
| | | * |
| | | * @param workerId
|
| | | * @param stateValid
|
| | | */
|
| | | public void updateStateValid(Long workerId, boolean stateValid) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("stateValid", stateValid);
|
| | | mongoTemplate.updateFirst(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新淘宝绑定
|
| | | * |
| | | * @param workerId
|
| | | * @param taobaoBind
|
| | | */
|
| | | public void updateTaobaoBind(Long workerId, boolean taobaoBind) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("taobaoBind", taobaoBind);
|
| | | mongoTemplate.updateFirst(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新微信绑定
|
| | | * |
| | | * @param workerId
|
| | | * @param weixinBind
|
| | | */
|
| | | public void updateWeixinBind(Long workerId, boolean weixinBind) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("weixinBind", weixinBind);
|
| | | mongoTemplate.updateFirst(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新活跃时间
|
| | | * |
| | | * @param workerId
|
| | | * @param activeTime
|
| | | */
|
| | | public void updateActiveTime(Long workerId, Date activeTime) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("activeTime", activeTime);
|
| | | mongoTemplate.updateFirst(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新粉丝数量
|
| | | * |
| | | * @param workerId
|
| | | * @param fansNum
|
| | | */
|
| | | public void updateFansNum(Long workerId, int fansNum) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("fansNum", fansNum);
|
| | | mongoTemplate.updateFirst(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 更新收入
|
| | | * |
| | | * @param workerId
|
| | | * @param income
|
| | | */
|
| | | public void updateIncome(Long workerId, BigDecimal income) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | Update update = Update.update("income", income).set("incomeTime", new Date());
|
| | | mongoTemplate.updateMulti(query, update, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 统计
|
| | | * |
| | | * @return
|
| | | */
|
| | | public TeamFansInfo getbyWorkerId(Long workerId) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("workerId").is(workerId));
|
| | | return mongoTemplate.findOne(query, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * |
| | | * @return
|
| | | */
|
| | | public List<TeamFansInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO) {
|
| | | Query query = createQuery(type, uid, focusDTO);
|
| | | query.skip(start).limit(count);
|
| | | query.with(new Sort(Sort.Direction.DESC, "weight"));
|
| | | return mongoTemplate.find(query, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 统计
|
| | | * |
| | | * @return
|
| | | */
|
| | | public long count(int type, Long uid, ThreeSaleFocusDTO focusDTO) {
|
| | | Query query = createQuery(type, uid, focusDTO);
|
| | | return mongoTemplate.count(query, TeamFansInfo.class);
|
| | | }
|
| | |
|
| | | private Query createQuery(int type, Long uid, ThreeSaleFocusDTO focusDTO) {
|
| | | Query query = new Query();
|
| | | List<Criteria> list = new ArrayList<Criteria>();
|
| | |
|
| | | if (type == 1) {
|
| | | list.add(Criteria.where("bossId").is(uid));
|
| | | } else {
|
| | | list.add(Criteria.where("bossSuperId").is(uid));
|
| | | }
|
| | |
|
| | | if (focusDTO != null) {
|
| | | if (focusDTO.getStateValid() != null)
|
| | | list.add(Criteria.where("stateValid").is(focusDTO.getStateValid()));
|
| | |
|
| | | if (focusDTO.getTaobaoBind() != null)
|
| | | list.add(Criteria.where("taobaoBind").is(focusDTO.getTaobaoBind()));
|
| | |
|
| | | if (focusDTO.getWeixinBind() != null)
|
| | | list.add(Criteria.where("weixinBind").is(focusDTO.getWeixinBind()));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(focusDTO.getLevel()))
|
| | | list.add(Criteria.where("level").is(focusDTO.getLevel()));
|
| | |
|
| | | if (focusDTO.getMinFansNum() != null)
|
| | | list.add(Criteria.where("fansNum").gte(focusDTO.getMinFansNum()));
|
| | |
|
| | | if (focusDTO.getMaxFansNum() != null)
|
| | | list.add(Criteria.where("fansNum").lte(focusDTO.getMaxFansNum()));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(focusDTO.getMinJoinTime()))
|
| | | list.add(Criteria.where("joinTime").gte(focusDTO.getMinJoinTime()));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(focusDTO.getMaxJoinTime()))
|
| | | list.add(Criteria.where("joinTime").lte(focusDTO.getMaxJoinTime()));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(focusDTO.getMinActiveTime()))
|
| | | list.add(Criteria.where("activeTime").gte(focusDTO.getMinActiveTime()));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(focusDTO.getMaxActiveTime()))
|
| | | list.add(Criteria.where("activeTime").lte(focusDTO.getMaxActiveTime()));
|
| | |
|
| | | if (focusDTO.getMinIncome() != null)
|
| | | list.add(Criteria.where("income").gte(focusDTO.getMinIncome()));
|
| | |
|
| | | if (focusDTO.getMaxIncome() != null)
|
| | | list.add(Criteria.where("income").lte(focusDTO.getMaxIncome()));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(focusDTO.getKey())) {
|
| | | if (type == 1) {
|
| | | list.add(new Criteria().orOperator( Criteria.where("nickName")
|
| | | .regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$",
|
| | | Pattern.CASE_INSENSITIVE)),
|
| | | new Criteria().andOperator(Criteria.where("memoName")
|
| | | .regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$",
|
| | | Pattern.CASE_INSENSITIVE))),
|
| | | new Criteria().andOperator(Criteria.where("tags").regex(Pattern
|
| | | .compile("^.*" + focusDTO.getKey() + ".*$", Pattern.CASE_INSENSITIVE)))));
|
| | | } else {
|
| | | list.add(new Criteria().orOperator(Criteria.where("nickName")
|
| | | .regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$",
|
| | | Pattern.CASE_INSENSITIVE)),
|
| | | new Criteria().andOperator(Criteria.where("memoNameSup")
|
| | | .regex(Pattern.compile("^.*" + focusDTO.getKey() + ".*$",
|
| | | Pattern.CASE_INSENSITIVE))),
|
| | | new Criteria().andOperator(Criteria.where("tagsSup").regex(Pattern
|
| | | .compile("^.*" + focusDTO.getKey() + ".*$", Pattern.CASE_INSENSITIVE)))));
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | 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 query;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class ThreeSaleFocusDTO {
|
| | | private String key;
|
| | | private String level;
|
| | | private Boolean stateValid;
|
| | | private Boolean taobaoBind;
|
| | | private Boolean weixinBind;
|
| | | private Integer minFansNum;
|
| | | private Integer maxFansNum;
|
| | | private String minJoinTime;
|
| | | private String maxJoinTime;
|
| | | private String minActiveTime;
|
| | | private String maxActiveTime;
|
| | | private BigDecimal minIncome;
|
| | | private BigDecimal maxIncome;
|
| | |
|
| | |
|
| | | public String getKey() {
|
| | | return key;
|
| | | }
|
| | |
|
| | | public void setKey(String key) {
|
| | | this.key = key;
|
| | | }
|
| | |
|
| | | public Boolean getStateValid() {
|
| | | return stateValid;
|
| | | }
|
| | |
|
| | | public void setStateValid(Boolean stateValid) {
|
| | | this.stateValid = stateValid;
|
| | | }
|
| | |
|
| | | public Boolean getTaobaoBind() {
|
| | | return taobaoBind;
|
| | | }
|
| | |
|
| | | public void setTaobaoBind(Boolean taobaoBind) {
|
| | | this.taobaoBind = taobaoBind;
|
| | | }
|
| | |
|
| | | public Boolean getWeixinBind() {
|
| | | return weixinBind;
|
| | | }
|
| | |
|
| | | public void setWeixinBind(Boolean weixinBind) {
|
| | | this.weixinBind = weixinBind;
|
| | | }
|
| | |
|
| | | public Integer getMinFansNum() {
|
| | | return minFansNum;
|
| | | }
|
| | |
|
| | | public void setMinFansNum(Integer minFansNum) {
|
| | | this.minFansNum = minFansNum;
|
| | | }
|
| | |
|
| | | public Integer getMaxFansNum() {
|
| | | return maxFansNum;
|
| | | }
|
| | |
|
| | | public void setMaxFansNum(Integer maxFansNum) {
|
| | | this.maxFansNum = maxFansNum;
|
| | | }
|
| | |
|
| | | public String getMinActiveTime() {
|
| | | return minActiveTime;
|
| | | }
|
| | |
|
| | | public void setMinActiveTime(String minActiveTime) {
|
| | | this.minActiveTime = minActiveTime;
|
| | | }
|
| | |
|
| | | public String getMaxActiveTime() {
|
| | | return maxActiveTime;
|
| | | }
|
| | |
|
| | | public void setMaxActiveTime(String maxActiveTime) {
|
| | | this.maxActiveTime = maxActiveTime;
|
| | | }
|
| | |
|
| | | public BigDecimal getMinIncome() {
|
| | | return minIncome;
|
| | | }
|
| | |
|
| | | public void setMinIncome(BigDecimal minIncome) {
|
| | | this.minIncome = minIncome;
|
| | | }
|
| | |
|
| | | public BigDecimal getMaxIncome() {
|
| | | return maxIncome;
|
| | | }
|
| | |
|
| | | public void setMaxIncome(BigDecimal maxIncome) {
|
| | | this.maxIncome = maxIncome;
|
| | | }
|
| | |
|
| | | public String getMinJoinTime() {
|
| | | return minJoinTime;
|
| | | }
|
| | |
|
| | | public void setMinJoinTime(String minJoinTime) {
|
| | | this.minJoinTime = minJoinTime;
|
| | | }
|
| | |
|
| | | public String getMaxJoinTime() {
|
| | | return maxJoinTime;
|
| | | }
|
| | |
|
| | | public void setMaxJoinTime(String maxJoinTime) {
|
| | | this.maxJoinTime = maxJoinTime;
|
| | | }
|
| | |
|
| | | public String getLevel() {
|
| | | return level;
|
| | | }
|
| | |
|
| | | public void setLevel(String level) {
|
| | | this.level = level;
|
| | | }
|
| | |
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.homemodule;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 专题管理
|
| | | * |
| | | */
|
| | | @Table("yeshi_ec_special_extra")
|
| | | public class SpecialExtra {
|
| | |
|
| | | //专题id
|
| | | @Column(name = "se_id")
|
| | | private Long id;
|
| | |
|
| | | // 是否转链
|
| | | @Column(name = "se_need_spin")
|
| | | private Boolean needSpin;
|
| | |
|
| | | // 评论语
|
| | | @Column(name = "se_comment")
|
| | | private String comment;
|
| | |
|
| | | // 创建时间
|
| | | @Column(name = "se_createtime")
|
| | | private Date createtime;
|
| | |
|
| | | // 更新时间
|
| | | @Column(name = "se_updatetime")
|
| | | private Date updatetime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Boolean getNeedSpin() {
|
| | | return needSpin;
|
| | | }
|
| | |
|
| | | public void setNeedSpin(Boolean needSpin) {
|
| | | this.needSpin = needSpin;
|
| | | }
|
| | |
|
| | | public String getComment() {
|
| | | return comment;
|
| | | }
|
| | |
|
| | | public void setComment(String comment) {
|
| | | this.comment = comment;
|
| | | }
|
| | |
|
| | | 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;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserLevelEnum;
|
| | |
|
| | | @Document(collection = "team_fans_info")
|
| | | public class TeamFansInfo {
|
| | |
|
| | | @Id
|
| | | @Field("id")
|
| | | private String id;
|
| | |
|
| | | @Field("bossId")
|
| | | private Long bossId; // 上级id
|
| | |
|
| | | @Field("bossSuperId")
|
| | | private Long bossSuperId; // 上上级id
|
| | |
|
| | | @Field("workerId")
|
| | | private Long workerId; // 下级id
|
| | |
|
| | | @Field("nickName")
|
| | | private String nickName; // 昵称
|
| | | |
| | | @Field("level")
|
| | | private UserLevelEnum level; // 当前等级
|
| | |
|
| | | @Field("stateValid")
|
| | | private Boolean stateValid; // 有效粉丝
|
| | |
|
| | | @Field("taobaoBind")
|
| | | private Boolean taobaoBind; // 绑定淘宝
|
| | |
|
| | | @Field("weixinBind")
|
| | | private Boolean weixinBind; // 绑定微信
|
| | |
|
| | | @Field("activeTime")
|
| | | private Date activeTime; // 活跃时间
|
| | |
|
| | | @Field("fansNum")
|
| | | private Integer fansNum; // 粉丝数量
|
| | |
|
| | | @Field("income")
|
| | | private BigDecimal income; // 账户收入
|
| | |
|
| | | @Field("incomeTime")
|
| | | private Date incomeTime; // 账户收入统计时间
|
| | |
|
| | | @Field("joinTime")
|
| | | private Date joinTime; // 邀请成功时间
|
| | |
|
| | | @Field("memoName")
|
| | | private String memoName; // 直接上级备注名
|
| | |
|
| | | @Field("tags")
|
| | | private String tags; // 直接上级标签
|
| | |
|
| | | @Field("memoNameSup")
|
| | | private String memoNameSup; // 间接上级备注名
|
| | | |
| | | |
| | |
|
| | | @Field("tagsSup")
|
| | | private String tagsSup; // 间接上级标签
|
| | |
|
| | | @Field("updateTime")
|
| | | private Date updateTime; // 更新时间
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getBossId() {
|
| | | return bossId;
|
| | | }
|
| | |
|
| | | public void setBossId(Long bossId) {
|
| | | this.bossId = bossId;
|
| | | }
|
| | |
|
| | | public Long getBossSuperId() {
|
| | | return bossSuperId;
|
| | | }
|
| | |
|
| | | public void setBossSuperId(Long bossSuperId) {
|
| | | this.bossSuperId = bossSuperId;
|
| | | }
|
| | |
|
| | | public Long getWorkerId() {
|
| | | return workerId;
|
| | | }
|
| | |
|
| | | public void setWorkerId(Long workerId) {
|
| | | this.workerId = workerId;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getMemoName() {
|
| | | return memoName;
|
| | | }
|
| | |
|
| | | public void setMemoName(String memoName) {
|
| | | this.memoName = memoName;
|
| | | }
|
| | |
|
| | | public String getTags() {
|
| | | return tags;
|
| | | }
|
| | |
|
| | | public void setTags(String tags) {
|
| | | this.tags = tags;
|
| | | }
|
| | |
|
| | | public Boolean getStateValid() {
|
| | | return stateValid;
|
| | | }
|
| | |
|
| | | public void setStateValid(Boolean stateValid) {
|
| | | this.stateValid = stateValid;
|
| | | }
|
| | |
|
| | | public Boolean getTaobaoBind() {
|
| | | return taobaoBind;
|
| | | }
|
| | |
|
| | | public void setTaobaoBind(Boolean taobaoBind) {
|
| | | this.taobaoBind = taobaoBind;
|
| | | }
|
| | |
|
| | | public Boolean getWeixinBind() {
|
| | | return weixinBind;
|
| | | }
|
| | |
|
| | | public void setWeixinBind(Boolean weixinBind) {
|
| | | this.weixinBind = weixinBind;
|
| | | }
|
| | |
|
| | | public Date getActiveTime() {
|
| | | return activeTime;
|
| | | }
|
| | |
|
| | | public void setActiveTime(Date activeTime) {
|
| | | this.activeTime = activeTime;
|
| | | }
|
| | |
|
| | | public Integer getFansNum() {
|
| | | return fansNum;
|
| | | }
|
| | |
|
| | | public void setFansNum(Integer fansNum) {
|
| | | this.fansNum = fansNum;
|
| | | }
|
| | |
|
| | | public BigDecimal getIncome() {
|
| | | return income;
|
| | | }
|
| | |
|
| | | public void setIncome(BigDecimal income) {
|
| | | this.income = income;
|
| | | }
|
| | |
|
| | | public Date getIncomeTime() {
|
| | | return incomeTime;
|
| | | }
|
| | |
|
| | | public void setIncomeTime(Date incomeTime) {
|
| | | this.incomeTime = incomeTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public Date getJoinTime() {
|
| | | return joinTime;
|
| | | }
|
| | |
|
| | | public void setJoinTime(Date joinTime) {
|
| | | this.joinTime = joinTime;
|
| | | }
|
| | |
|
| | | public String getMemoNameSup() {
|
| | | return memoNameSup;
|
| | | }
|
| | |
|
| | | public void setMemoNameSup(String memoNameSup) {
|
| | | this.memoNameSup = memoNameSup;
|
| | | }
|
| | |
|
| | | public String getTagsSup() {
|
| | | return tagsSup;
|
| | | }
|
| | |
|
| | | public void setTagsSup(String tagsSup) {
|
| | | this.tagsSup = tagsSup;
|
| | | }
|
| | |
|
| | | public UserLevelEnum getLevel() {
|
| | | return level;
|
| | | }
|
| | |
|
| | | public void setLevel(UserLevelEnum level) {
|
| | | this.level = level;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @org.yeshi.utils.mybatis.Column(name = "tf_id")
|
| | | private Long id;
|
| | |
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name = "tf_boss_id")
|
| | | private UserInfo boss;//邀请者
|
| | | |
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name = "tf_worker_id")
|
| | | private UserInfo worker; //被邀请者
|
| | |
| | | @org.yeshi.utils.mybatis.Column(name = "tf_remind_worker")
|
| | | private Integer remindWorker; // 提示worker绑定微信 1 已提醒
|
| | |
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name = "tf_type")
|
| | | private Integer type; // 1-一级 2二级
|
| | | |
| | | @org.yeshi.utils.mybatis.Column(name = "tf_tags")
|
| | | private String tags; // 标签
|
| | | |
| | | @org.yeshi.utils.mybatis.Column(name = "tf_createtime")
|
| | | private Date createTime; // 创建时间
|
| | |
|
| | |
| | | public void setRemindBoss(Integer remindBoss) {
|
| | | this.remindBoss = remindBoss;
|
| | | }
|
| | | |
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(Integer type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public String getTags() {
|
| | | return tags;
|
| | | }
|
| | |
|
| | | public void setTags(String tags) {
|
| | | this.tags = tags;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Column(name = "uie_invite_code_vip")
|
| | | private String inviteCodeVip;
|
| | |
|
| | | // 新人抽奖次数
|
| | | @Column(name = "uie_lottery_newbies")
|
| | | private Integer lotteryNewbies;
|
| | |
|
| | | // 券未读数量
|
| | | @Column(name = "uie_coupon_news")
|
| | |
| | | @Column(name = "uie_gold_coin")
|
| | | private Integer goldCoin;
|
| | |
|
| | | // 是否微信自動提現
|
| | | @Column(name = "uie_auto_extract")
|
| | | private Boolean autoExtract;
|
| | |
|
| | | // 微信自动提现关闭日期
|
| | | @Column(name = "uie_close_time_extract")
|
| | | private Date closeTimeExtract;
|
| | |
|
| | | // 用户标识
|
| | | @Column(name = "uie_mark")
|
| | | private String mark;
|
| | |
| | | @Column(name = "uie_ercode")
|
| | | private String erCode;
|
| | |
|
| | | // 是淘宝授权
|
| | | @Column(name = "uie_bind_taobao")
|
| | | private Boolean bindTaoBao;
|
| | | |
| | | // 创建时间
|
| | | @Column(name = "uie_create_time")
|
| | | private Date createTime;
|
| | |
| | | this.userRank = userRank;
|
| | | }
|
| | |
|
| | | public Date getRankUpdateTime() {
|
| | | return rankUpdateTime;
|
| | | }
|
| | |
|
| | | public void setRankUpdateTime(Date rankUpdateTime) {
|
| | | this.rankUpdateTime = rankUpdateTime;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | |
| | |
|
| | | public void setInviteCode(String inviteCode) {
|
| | | this.inviteCode = inviteCode;
|
| | | }
|
| | |
|
| | | public Integer getLotteryNewbies() {
|
| | | return lotteryNewbies;
|
| | | }
|
| | |
|
| | | public void setLotteryNewbies(Integer lotteryNewbies) {
|
| | | this.lotteryNewbies = lotteryNewbies;
|
| | | }
|
| | |
|
| | | public Integer getCouponNews() {
|
| | |
| | | this.goldCoin = goldCoin;
|
| | | }
|
| | |
|
| | | public Boolean getAutoExtract() {
|
| | | return autoExtract;
|
| | | }
|
| | |
|
| | | public void setAutoExtract(Boolean autoExtract) {
|
| | | this.autoExtract = autoExtract;
|
| | | }
|
| | |
|
| | | public Date getCloseTimeExtract() {
|
| | | return closeTimeExtract;
|
| | | }
|
| | |
|
| | | public void setCloseTimeExtract(Date closeTimeExtract) {
|
| | | this.closeTimeExtract = closeTimeExtract;
|
| | | }
|
| | |
|
| | | public String getMark() {
|
| | | return mark;
|
| | | }
|
| | |
| | | this.erCode = erCode;
|
| | | }
|
| | |
|
| | | public Date getRankUpdateTime() {
|
| | | return rankUpdateTime;
|
| | | }
|
| | |
|
| | | public void setRankUpdateTime(Date rankUpdateTime) {
|
| | | this.rankUpdateTime = rankUpdateTime;
|
| | | }
|
| | |
|
| | | public Boolean getBindTaoBao() {
|
| | | return bindTaoBao;
|
| | | }
|
| | |
|
| | | public void setBindTaoBao(Boolean bindTaoBao) {
|
| | | this.bindTaoBao = bindTaoBao;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user.vip;
|
| | |
|
| | | 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 = "team_daily_Record")
|
| | | public class TeamDailyRecord {
|
| | |
|
| | | @Id
|
| | | private String id;
|
| | | @Field
|
| | | @Indexed
|
| | | private Long uid;
|
| | | @Field
|
| | | private Date countDay; // 统计日期: 年-月-日
|
| | | @Field
|
| | | private String yearMonth; // 统计日期: 年-月
|
| | | @Field
|
| | | private Integer firstNum; // 一级
|
| | | @Field
|
| | | private Integer firstDaRen;
|
| | | @Field
|
| | | private Integer firstHighVIP;
|
| | | @Field
|
| | | private Integer firstSuperVIP;
|
| | | @Field
|
| | | private Integer secondNum; // 二级
|
| | | @Field
|
| | | private Integer secondDaRen;
|
| | | @Field
|
| | | private Integer secondHighVIP;
|
| | | @Field
|
| | | private Integer secondSuperVIP;
|
| | | @Field
|
| | | private Integer beyondNum; // 二级以外
|
| | | @Field
|
| | | private Integer beyondDaRen;
|
| | | @Field
|
| | | private Integer beyondHighVIP;
|
| | | @Field
|
| | | private Integer beyondSuperVIP;
|
| | |
|
| | | public TeamDailyRecord() {}
|
| | | |
| | | public TeamDailyRecord(Integer firstNum, Integer secondNum, Integer beyondNum) {
|
| | | this.firstNum = firstNum;
|
| | | this.secondNum = secondNum;
|
| | | this.beyondNum = beyondNum;
|
| | | }
|
| | | |
| | | |
| | | |
| | | 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 Date getCountDay() {
|
| | | return countDay;
|
| | | }
|
| | |
|
| | | public void setCountDay(Date countDay) {
|
| | | this.countDay = countDay;
|
| | | }
|
| | |
|
| | | public String getYearMonth() {
|
| | | return yearMonth;
|
| | | }
|
| | |
|
| | | public void setYearMonth(String yearMonth) {
|
| | | this.yearMonth = yearMonth;
|
| | | }
|
| | |
|
| | | public Integer getFirstNum() {
|
| | | return firstNum;
|
| | | }
|
| | |
|
| | | public void setFirstNum(Integer firstNum) {
|
| | | this.firstNum = firstNum;
|
| | | }
|
| | |
|
| | | public Integer getFirstDaRen() {
|
| | | return firstDaRen;
|
| | | }
|
| | |
|
| | | public void setFirstDaRen(Integer firstDaRen) {
|
| | | this.firstDaRen = firstDaRen;
|
| | | }
|
| | |
|
| | | public Integer getFirstHighVIP() {
|
| | | return firstHighVIP;
|
| | | }
|
| | |
|
| | | public void setFirstHighVIP(Integer firstHighVIP) {
|
| | | this.firstHighVIP = firstHighVIP;
|
| | | }
|
| | |
|
| | | public Integer getFirstSuperVIP() {
|
| | | return firstSuperVIP;
|
| | | }
|
| | |
|
| | | public void setFirstSuperVIP(Integer firstSuperVIP) {
|
| | | this.firstSuperVIP = firstSuperVIP;
|
| | | }
|
| | |
|
| | | public Integer getSecondNum() {
|
| | | return secondNum;
|
| | | }
|
| | |
|
| | | public void setSecondNum(Integer secondNum) {
|
| | | this.secondNum = secondNum;
|
| | | }
|
| | |
|
| | | public Integer getSecondDaRen() {
|
| | | return secondDaRen;
|
| | | }
|
| | |
|
| | | public void setSecondDaRen(Integer secondDaRen) {
|
| | | this.secondDaRen = secondDaRen;
|
| | | }
|
| | |
|
| | | public Integer getSecondHighVIP() {
|
| | | return secondHighVIP;
|
| | | }
|
| | |
|
| | | public void setSecondHighVIP(Integer secondHighVIP) {
|
| | | this.secondHighVIP = secondHighVIP;
|
| | | }
|
| | |
|
| | | public Integer getSecondSuperVIP() {
|
| | | return secondSuperVIP;
|
| | | }
|
| | |
|
| | | public void setSecondSuperVIP(Integer secondSuperVIP) {
|
| | | this.secondSuperVIP = secondSuperVIP;
|
| | | }
|
| | |
|
| | | public Integer getBeyondNum() {
|
| | | return beyondNum;
|
| | | }
|
| | |
|
| | | public void setBeyondNum(Integer beyondNum) {
|
| | | this.beyondNum = beyondNum;
|
| | | }
|
| | |
|
| | | public Integer getBeyondDaRen() {
|
| | | return beyondDaRen;
|
| | | }
|
| | |
|
| | | public void setBeyondDaRen(Integer beyondDaRen) {
|
| | | this.beyondDaRen = beyondDaRen;
|
| | | }
|
| | |
|
| | | public Integer getBeyondHighVIP() {
|
| | | return beyondHighVIP;
|
| | | }
|
| | |
|
| | | public void setBeyondHighVIP(Integer beyondHighVIP) {
|
| | | this.beyondHighVIP = beyondHighVIP;
|
| | | }
|
| | |
|
| | | public Integer getBeyondSuperVIP() {
|
| | | return beyondSuperVIP;
|
| | | }
|
| | |
|
| | | public void setBeyondSuperVIP(Integer beyondSuperVIP) {
|
| | | this.beyondSuperVIP = beyondSuperVIP;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 导师信息
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | |
| | | @Field
|
| | | private Integer type;
|
| | | @Field
|
| | | private String nickName;// 昵称
|
| | | @Field
|
| | | private String portrait;// 头像
|
| | | @Field
|
| | | private String wxID;// 微信号
|
| | | @Field
|
| | | private String phone;// 手机号
|
| | |
|
| | | public TearcherInfo(String id) {
|
| | | super();
|
| | |
| | | public TearcherInfo() {
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
| | | public void setType(Integer type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | |
| | | 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;
|
| | | }
|
| | |
|
| | | public String getPhone() {
|
| | | return phone;
|
| | | }
|
| | |
|
| | | public void setPhone(String phone) {
|
| | | this.phone = phone;
|
| | | }
|
| | | }
|
| | |
| | | @Field("endTime") |
| | | private Date endTime; // 结束时间 |
| | | |
| | | |
| | | @Field("createTime") |
| | | private Date createTime; // 创建时间 |
| | | |
| | |
| | | |
| | | @Field("dynamicType") |
| | | private Integer dynamicType; // 1发圈 2素材 |
| | | |
| | | @Expose |
| | | @Field("jumpLink") |
| | | private String jumpLink; |
| | | |
| | | |
| | | private String startTimeChar; |
| | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | |
| | | public String getJumpLink() { |
| | | return jumpLink; |
| | | } |
| | | |
| | | public void setJumpLink(String jumpLink) { |
| | | this.jumpLink = jumpLink; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.entity.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.annotation.Id;
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 订单相关资金统计
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "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_tb.png"),
|
| | | juHuaSuan("聚划算", "http://img.flqapp.com/resource/icon/source_type_tb.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("id")
|
| | | private String id;
|
| | |
|
| | | @Field("uid")
|
| | | private Long uid; // 上级id
|
| | | |
| | | @Field("sourceType")
|
| | | private SourceTypeEnum sourceType; // 来源类型
|
| | | |
| | | @Field("yearMonth")
|
| | | private String yearMonth; // 统计日期-字符串
|
| | | |
| | | @Field("countDay")
|
| | | private Date countDay; // 统计日期
|
| | | |
| | | @Field("income")
|
| | | private BigDecimal income; // 收入-我的
|
| | |
|
| | | @Field("incomeTeam")
|
| | | private BigDecimal incomeTeam; // 收入-团队-
|
| | |
|
| | | @Field("orderNum")
|
| | | private Integer orderNum; // 订单数量-我的
|
| | |
|
| | | @Field("orderNumTeam")
|
| | | private Integer orderNumTeam; // 订单数量-团队
|
| | |
|
| | | @Field("updateTime")
|
| | | private Date updateTime; // 更新时间
|
| | | |
| | | |
| | |
|
| | | 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 BigDecimal getIncome() {
|
| | | return income;
|
| | | }
|
| | |
|
| | | public void setIncome(BigDecimal income) {
|
| | | this.income = income;
|
| | | }
|
| | |
|
| | | public BigDecimal getIncomeTeam() {
|
| | | return incomeTeam;
|
| | | }
|
| | |
|
| | | public void setIncomeTeam(BigDecimal incomeTeam) {
|
| | | this.incomeTeam = incomeTeam;
|
| | | }
|
| | |
|
| | | public Integer getOrderNum() {
|
| | | return orderNum;
|
| | | }
|
| | |
|
| | | public void setOrderNum(Integer orderNum) {
|
| | | this.orderNum = orderNum;
|
| | | }
|
| | |
|
| | | public Integer getOrderNumTeam() {
|
| | | return orderNumTeam;
|
| | | }
|
| | |
|
| | | public void setOrderNumTeam(Integer orderNumTeam) {
|
| | | this.orderNumTeam = orderNumTeam;
|
| | | }
|
| | |
|
| | | public Date getCountDay() {
|
| | | return countDay;
|
| | | }
|
| | |
|
| | | public void setCountDay(Date countDay) {
|
| | | this.countDay = countDay;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | public SourceTypeEnum getSourceType() {
|
| | | return sourceType;
|
| | | }
|
| | |
|
| | | public void setSourceType(SourceTypeEnum sourceType) {
|
| | | this.sourceType = sourceType;
|
| | | }
|
| | |
|
| | | public String getYearMonth() {
|
| | | return yearMonth;
|
| | | }
|
| | |
|
| | | public void setYearMonth(String yearMonth) {
|
| | | this.yearMonth = yearMonth;
|
| | | }
|
| | | }
|
| | |
| | | public final static int STATE_INIT = 0;
|
| | | public final static int STATE_SUCCESS = 1;
|
| | | public final static int STATE_FAIL = 2;
|
| | |
|
| | | |
| | | public final static int TYPE_GOODS = 1;
|
| | | public final static int TYPE_ACTIVITY = 2;
|
| | | |
| | | |
| | | @Column(name = "pg_id")
|
| | | private Long id;
|
| | |
|
| | |
| | |
|
| | | @Column(name = "pg_updatetime")
|
| | | private Date updateTime;
|
| | |
|
| | | // 是否定时
|
| | | private Boolean timeTask;
|
| | | |
| | | // 类型
|
| | | @Column(name = "pg_type")
|
| | | private Integer type;
|
| | | // 其他参数
|
| | | @Column(name = "pg_other_id")
|
| | | private String otherId;
|
| | | // 浏览次数
|
| | | @Column(name = "pg_scan_num")
|
| | | private Integer scanNum;
|
| | | |
| | | // 定时时间
|
| | | private String controlTime_str;
|
| | |
|
| | |
| | | public PushGoods(Long id){
|
| | | this.id = id;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | |
| | | this.controlTime = controlTime;
|
| | | }
|
| | |
|
| | | public Boolean isTimeTask() {
|
| | | return timeTask;
|
| | | }
|
| | |
|
| | | public void setTimeTask(Boolean timeTask) {
|
| | | this.timeTask = timeTask;
|
| | | }
|
| | |
|
| | | public String getControlTime_str() {
|
| | | return controlTime_str;
|
| | |
| | | public void setRemark(String remark) {
|
| | | this.remark = remark;
|
| | | }
|
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(Integer type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Integer getScanNum() {
|
| | | return scanNum;
|
| | | }
|
| | |
|
| | | public void setScanNum(Integer scanNum) {
|
| | | this.scanNum = scanNum;
|
| | | }
|
| | |
|
| | | public String getOtherId() {
|
| | | return otherId;
|
| | | }
|
| | |
|
| | | public void setOtherId(String otherId) {
|
| | | this.otherId = otherId;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | openSpeicalAndRelationApply("open_speical_and_relation_apply", "开启会员运营ID与渠道ID申请"), |
| | | hotFunctionUrl("hot_function_url", "热门功能链接"), // 存在2个相同 存在版本区分 |
| | | pushGoodsDetails("push_goods_details", "推送页面"), |
| | | pushActivityLink("push_activity_link", "推送发圈活动页面"), |
| | | brandBackgroundPicture("brand_background_picture", "品牌背景图片"), |
| | | articleHotWords("article_hot_words", "动态-学院文章热搜词"), |
| | | inviteRules("invite_rules", "动态-学院文章热搜词"), |
| | |
| | | vipUpgradeLink("vip_upgrade_link", "我的界面-会员升级链接"), |
| | | |
| | | orderRebateDescLink("order_rebate_desc_link", "订单返利计算说明链接"), |
| | | |
| | | teamStatisticsLink("team_statistics_link", "推送发圈活动页面"), |
| | | |
| | | // 平台规则 |
| | | platformRule("platform_rule_link", "平台规则"); |
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | /**
|
| | | * 自动提现服务端规则,关闭后,第60天系统会自动开启(从关闭日起)
|
| | | */
|
| | | @Scheduled(cron = "0 50 0 * * ? ")
|
| | | public void updateAutoExtract() {
|
| | | if (!Constant.IS_TASK) {
|
| | | return;
|
| | | }
|
| | | userInfoExtraService.updateAutoExtract(60);
|
| | | }
|
| | | }
|
| | |
| | | <association property="system" column="sid"
|
| | | select="com.yeshi.fanli.dao.mybatis.BusinessSystemMapper.selectByPrimaryKey">
|
| | | </association>
|
| | |
|
| | | </resultMap>
|
| | | |
| | | |
| | | <resultMap id="SimplMap" type="com.yeshi.fanli.entity.bus.user.Extract">
|
| | | <id column="id" property="id" jdbcType="BIGINT" />
|
| | | <result column="account" property="account" jdbcType="VARCHAR" />
|
| | | <result column="extractTime" property="extractTime" jdbcType="BIGINT" />
|
| | | <result column="receiveTime" property="receiveTime" jdbcType="TIMESTAMP" />
|
| | | <result column="ip" property="ip" jdbcType="VARCHAR" />
|
| | | <result column="money" property="money" jdbcType="DECIMAL" />
|
| | | <result column="name" property="name" jdbcType="VARCHAR" />
|
| | | <result column="reason" property="reason" jdbcType="VARCHAR" />
|
| | | <result column="state" property="state" jdbcType="INTEGER" />
|
| | | <result column="type" property="type" jdbcType="INTEGER" />
|
| | | <result column="adminId" property="adminId" jdbcType="BIGINT" />
|
| | |
|
| | | <association column="uid" property="userInfo" javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="uid" property="id" jdbcType="BIGINT" /> |
| | | </association>
|
| | | |
| | | <association column="sid" property="system" javaType="com.yeshi.fanli.entity.system.BusinessSystem">
|
| | | <id column="sid" property="id" jdbcType="BIGINT" /> |
| | | </association>
|
| | | </resultMap>
|
| | | |
| | | |
| | | |
| | | <sql id="Base_Column_List">
|
| | | id,account,extractTime,ip,money,name,reason,state,type,uid,sid,adminId,receiveTime
|
| | | </sql>
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="getExtractSucceedRecord" resultMap="SimplMap">
|
| | | SELECT * FROM yeshi_ec_extract t
|
| | | WHERE t.`uid` = #{uid} AND t.`state` = 1
|
| | | ORDER BY t.`id` DESC
|
| | | LIMIT #{start},#{count}
|
| | | </select>
|
| | | |
| | | |
| | | <select id="countExtractSucceedRecord" resultType="Long">
|
| | | SELECT COUNT(t.`id`) FROM yeshi_ec_extract t
|
| | | WHERE t.`uid` = #{uid} AND t.`state` = 1
|
| | | </select>
|
| | | |
| | | </mapper> |
| | |
| | | <result column="tf_remind_worker" property="remindWorker" jdbcType="INTEGER"/>
|
| | | <result column="tf_createtime" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="tf_updatetime" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="tf_type" property="type" jdbcType="INTEGER"/>
|
| | | <result column="tf_tags" property="tags" jdbcType="VARCHAR"/>
|
| | |
|
| | | <association property="boss" column="tf_boss_id"
|
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | |
| | | </association>
|
| | |
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">tf_id,tf_boss_id,tf_worker_id,tf_nickname,tf_remind_boss,tf_remind_worker,tf_createtime,tf_updatetime</sql>
|
| | | <sql id="Base_Column_List">tf_id,tf_boss_id,tf_worker_id,tf_nickname,tf_remind_boss,tf_remind_worker,tf_type,tf_tags,tf_createtime,tf_updatetime</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_threesale_extra_info where tf_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_threesale_extra_info where tf_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_threesale_extra_info (tf_id,tf_boss_id,tf_worker_id,tf_nickname,tf_remind_boss,tf_remind_worker,tf_createtime,tf_updatetime) values (#{id,jdbcType=BIGINT},#{boss.id,jdbcType=BIGINT},#{worker.id,jdbcType=BIGINT},#{nickname,jdbcType=VARCHAR},#{remindBoss,jdbcType=INTEGER},#{remindWorker,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_threesale_extra_info (tf_id,tf_boss_id,tf_worker_id,tf_nickname,tf_remind_boss,tf_remind_worker,tf_type,tf_tags,tf_createtime,tf_updatetime) values (#{id,jdbcType=BIGINT},#{boss.id,jdbcType=BIGINT},#{worker.id,jdbcType=BIGINT},#{nickname,jdbcType=VARCHAR},#{remindBoss,jdbcType=INTEGER},#{remindWorker,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{type,jdbcType=INTEGER},#{tags,jdbcType=VARCHAR})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_threesale_extra_info
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">tf_id,</if>
|
| | |
| | | <if test="remindWorker != null">tf_remind_worker,</if>
|
| | | <if test="createTime != null">tf_createtime,</if>
|
| | | <if test="updateTime != null">tf_updatetime,</if>
|
| | | <if test="type != null">tf_type,</if>
|
| | | <if test="tags != null">tf_tags,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | |
| | | <if test="remindWorker != null">#{remindWorker,jdbcType=INTEGER},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if>
|
| | | <if test="tags != null">#{tags,jdbcType=VARCHAR},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo">update yeshi_ec_threesale_extra_info set tf_boss_id = #{boss.id,jdbcType=BIGINT},tf_worker_id = #{worker.id,jdbcType=BIGINT},tf_nickname = #{nickname,jdbcType=VARCHAR},tf_remind_boss = #{remindBoss,jdbcType=INTEGER},tf_remind_worker = #{remindWorker,jdbcType=INTEGER},tf_createtime = #{createTime,jdbcType=TIMESTAMP},tf_updatetime = #{updateTime,jdbcType=TIMESTAMP} where tf_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo">update yeshi_ec_threesale_extra_info set tf_boss_id = #{boss.id,jdbcType=BIGINT},tf_worker_id = #{worker.id,jdbcType=BIGINT},tf_nickname = #{nickname,jdbcType=VARCHAR},tf_remind_boss = #{remindBoss,jdbcType=INTEGER},tf_remind_worker = #{remindWorker,jdbcType=INTEGER},tf_createtime = #{createTime,jdbcType=TIMESTAMP},tf_updatetime = #{updateTime,jdbcType=TIMESTAMP},tf_type = #{type,jdbcType=INTEGER},tf_tags = #{tags,jdbcType=VARCHAR} where tf_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo">update yeshi_ec_threesale_extra_info
|
| | | <set>
|
| | | <if test="boss != null">tf_boss_id=#{boss.id,jdbcType=BIGINT},</if>
|
| | |
| | | <if test="nickname != null">tf_nickname=#{nickname,jdbcType=VARCHAR},</if>
|
| | | <if test="remindBoss != null">tf_remind_boss=#{remindBoss,jdbcType=INTEGER},</if>
|
| | | <if test="remindWorker != null">tf_remind_worker=#{remindWorker,jdbcType=INTEGER},</if>
|
| | | <if test="type != null">tf_type=#{type,jdbcType=INTEGER},</if>
|
| | | <if test="tags != null">tf_tags=#{tags,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">tf_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">tf_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | </set> where tf_id = #{id,jdbcType=BIGINT}
|
| | |
| | |
|
| | |
|
| | | <select id="listFirstTeam" resultMap="AllResultMap">
|
| | | SELECT * FROM
|
| | | `yeshi_ec_threesale` ts
|
| | | LEFT JOIN `yeshi_ec_threesale_extra_info` ff ON
|
| | | (ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id`)
|
| | | SELECT * FROM `yeshi_ec_threesale` ts
|
| | | LEFT JOIN
|
| | | `yeshi_ec_threesale_extra_info` ff ON (ts.`boss_id` = ff.`tf_boss_id`
|
| | | AND ts.`worker_id`=ff.`tf_worker_id`)
|
| | | WHERE ts.`boss_id` = #{uid}
|
| | | <if test="listId != null and listId.size > 0">
|
| | | AND ts.worker_id in
|
| | | <foreach collection="listId" item="item" open="(" separator=","
|
| | | close=")">#{item}</foreach>
|
| | | </if>
|
| | | ORDER BY ts.createTime DESC
|
| | | LIMIT
|
| | | ${start},${count}
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="countFirstTeam" resultType="java.lang.Long">
|
| | | SELECT
|
| | | IFNULL(count(id),0) FROM `yeshi_ec_threesale`
|
| | | WHERE `boss_id` = #{uid}
|
| | | SELECT IFNULL(count(id),0) FROM `yeshi_ec_threesale`
|
| | | WHERE `boss_id` =
|
| | | #{uid}
|
| | | <if test="listId != null and listId.size > 0">
|
| | | AND worker_id in
|
| | | <foreach collection="listId" item="item" open="(" separator=","
|
| | | close=")">#{item}</foreach>
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="listSecondTeam" resultMap="AllResultMap">
|
| | |
| | | WHERE tf.`boss_id` = #{uid})A
|
| | | LEFT JOIN yeshi_ec_threesale yet ON yet.id =
|
| | | A.id
|
| | | <if test="listId != null and listId.size > 0">
|
| | | WHERE yet.worker_id in
|
| | | <foreach collection="listId" item="item" open="(" separator=","
|
| | | close=")">#{item}</foreach>
|
| | | </if>
|
| | | ORDER BY yet.createTime DESC
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="countSecondTeam" resultType="java.lang.Long">
|
| | | SELECT COUNT(A.id) FROM
|
| | | (
|
| | | SELECT COUNT(A.id) FROM (
|
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
|
| | | WHERE tf.`boss_id` = #{uid}
|
| | | <if test="listId != null and listId.size > 0">
|
| | | AND tf.worker_id in
|
| | | <foreach collection="listId" item="item" open="(" separator=","
|
| | | close=")">#{item}</foreach>
|
| | | </if>
|
| | | )A
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countFirstTeamByDate" resultType="java.lang.Long">
|
| | | SELECT IFNULL(count(id),0) FROM `yeshi_ec_threesale`
|
| | | WHERE `boss_id` =
|
| | | #{uid}
|
| | | <if test="dayType == 1"> <!-- 今日 -->
|
| | | AND TO_DAYS(FROM_UNIXTIME(createTime/1000)) = TO_DAYS(NOW())
|
| | | </if>
|
| | | <if test="dayType == 2"> <!-- 本月 -->
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(createTime/1000),'%Y%m') = DATE_FORMAT(
|
| | | CURDATE(),'%Y%m')
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="countSecondTeamByDate" resultType="java.lang.Long">
|
| | | SELECT COUNT(A.id) FROM (
|
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts
|
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id`
|
| | | WHERE tf.`boss_id` = #{uid}
|
| | | <if test="dayType == 1"> <!-- 今日 -->
|
| | | AND TO_DAYS(FROM_UNIXTIME(ts.createTime/1000)) = TO_DAYS(NOW())
|
| | | </if>
|
| | | <if test="dayType == 2"> <!-- 本月 -->
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(ts.createTime/1000),'%Y%m') =
|
| | | DATE_FORMAT( CURDATE(),'%Y%m')
|
| | | </if>
|
| | | )A
|
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | | <select id="getMyBoss" resultMap="AllResultMap">
|
| | | select
|
| | |
| | | `yeshi_ec_threesale` limit #{start},#{count}
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | | </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.homemodule.SpecialExtraMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SpecialExtra"> |
| | | <id column="se_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="se_need_spin" property="needSpin" jdbcType="BOOLEAN"/> |
| | | <result column="se_comment" property="comment" jdbcType="VARCHAR"/> |
| | | <result column="se_createtime" property="createtime" jdbcType="TIMESTAMP"/> |
| | | <result column="se_updatetime" property="updatetime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">se_id,se_need_spin,se_comment,se_createtime,se_updatetime</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_special_extra where se_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special_extra where se_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_extra (se_id,se_need_spin,se_comment,se_createtime,se_updatetime) values (#{id,jdbcType=BIGINT},#{needSpin,jdbcType=BOOLEAN},#{comment,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{updatetime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialExtra" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_extra |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">se_id,</if> |
| | | <if test="needSpin != null">se_need_spin,</if> |
| | | <if test="comment != null">se_comment,</if> |
| | | <if test="createtime != null">se_createtime,</if> |
| | | <if test="updatetime != null">se_updatetime,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="needSpin != null">#{needSpin,jdbcType=BOOLEAN},</if> |
| | | <if test="comment != null">#{comment,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.homemodule.SpecialExtra">update yeshi_ec_special_extra set se_need_spin = #{needSpin,jdbcType=BOOLEAN},se_comment = #{comment,jdbcType=VARCHAR},se_createtime = #{createtime,jdbcType=TIMESTAMP},se_updatetime = #{updatetime,jdbcType=TIMESTAMP} where se_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialExtra">update yeshi_ec_special_extra |
| | | <set> |
| | | <if test="needSpin != null">se_need_spin=#{needSpin,jdbcType=BOOLEAN},</if> |
| | | <if test="comment != null">se_comment=#{comment,jdbcType=VARCHAR},</if> |
| | | <if test="createtime != null">se_createtime=#{createtime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updatetime != null">se_updatetime=#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | </set> where se_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)A
|
| | | </select>
|
| | |
|
| | | |
| | | <select id="sumMoneyArrivalByUidAndNearDay" resultType="BigDecimal">
|
| | | SELECT SUM(v2.`hb_money`) FROM yeshi_ec_hongbao_v2 v2
|
| | | WHERE v2.`hb_uid` = #{uid} AND v2.`hb_state` = 3
|
| | | AND DATE_SUB(CURDATE(), INTERVAL #{day} DAY) <![CDATA[<=]]> DATE(v2.`hb_get_time`) |
| | | </select>
|
| | | |
| | | <select id="sumMoneyBySettleTimeAndUid" resultType="BigDecimal">
|
| | | SELECT SUM(v2.hb_money) FROM `yeshi_ec_hongbao_order` h |
| | | LEFT JOIN (SELECT * FROM `yeshi_ec_hongbao_v2` v WHERE v.`hb_uid` = #{uid}) v2 ON IFNULL(v2.`hb_pid`,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_id` IS NOT NULL AND co.`co_settle_time`>=#{minDate} AND co.`co_settle_time`<![CDATA[<]]>#{maxDate}
|
| | | </select>
|
| | | |
| | | <select id="sumMoneyByANotSettleAndUid" resultType="BigDecimal">
|
| | | SELECT SUM(v2.hb_money) FROM `yeshi_ec_hongbao_order` h |
| | | LEFT JOIN (SELECT * FROM `yeshi_ec_hongbao_v2` v WHERE v.`hb_uid` = #{uid}) v2 ON IFNULL(v2.`hb_pid`,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_id` IS NOT NULL AND co.co_state = 1 |
| | | AND DATE_SUB(CURDATE(), INTERVAL 180 DAY) <![CDATA[<=]]> DATE(co.`co_third_create_time`)
|
| | | </select>
|
| | | |
| | | |
| | | </mapper>
|
| | |
| | | </select> |
| | | |
| | | <select id="countOderByDate" resultType="Integer"> |
| | | SELECT COUNT(1) FROM (SELECT d.`co_id` FROM `yeshi_ec_common_order` d |
| | | SELECT COUNT(co_id) FROM (SELECT d.`co_id` FROM `yeshi_ec_common_order` d |
| | | WHERE TO_DAYS(d.`co_third_create_time`)= TO_DAYS(#{preDay}) AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A |
| | | </select> |
| | |
| | | limit 100)A where A.payment<![CDATA[<]]> 10 |
| | | </select> |
| | | |
| | | |
| | | <select id="countOrderBySourceAndNearDay" resultType="Long"> |
| | | SELECT COUNT(co_id) FROM (SELECT d.`co_id` FROM `yeshi_ec_common_order` d |
| | | WHERE d.co_uid = #{uid} AND d.`co_source_type` = #{source} AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | AND DATE_SUB(CURDATE(), INTERVAL #{day} DAY) <![CDATA[<=]]> DATE(d.`co_third_create_time`) |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A |
| | | </select> |
| | | |
| | | |
| | | |
| | | </mapper> |
| | |
| | | <result column="pg_push_time" property="pushTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="pg_createtime" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="pg_updatetime" property="updateTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="pg_type" property="type" jdbcType="INTEGER"/>
|
| | | <result column="pg_other_id" property="otherId" jdbcType="VARCHAR"/>
|
| | | <result column="pg_scan_num" property="scanNum" jdbcType="INTEGER"/>
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">pg_id,pg_alert_title,pg_alert_content,pg_title,pg_content,pg_picture,pg_uid,pg_versions,pg_remark,pg_is_push,pg_control_time,pg_push_time,pg_createtime,pg_updatetime</sql>
|
| | | <sql id="Base_Column_List">pg_id,pg_alert_title,pg_alert_content,pg_title,pg_content,pg_picture,pg_uid,pg_versions,pg_remark,pg_is_push,pg_control_time,pg_push_time,pg_createtime,pg_updatetime,pg_type,pg_other_id,pg_scan_num</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select
|
| | | <include refid="Base_Column_List"/>from yeshi_ec_push_goods where pg_id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_push_goods where pg_id = #{id,jdbcType=BIGINT}</delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.PushGoods" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_push_goods (pg_id,pg_alert_title,pg_alert_content,pg_title,pg_content,pg_picture,pg_uid,pg_versions,pg_remark,pg_is_push,pg_control_time,pg_push_time,pg_createtime,pg_updatetime) values (#{id,jdbcType=BIGINT},#{alertTitle,jdbcType=VARCHAR},#{alertContent,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{versions,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{isPush,jdbcType=INTEGER},#{controlTime,jdbcType=TIMESTAMP},#{pushTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.PushGoods" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_push_goods (pg_id,pg_alert_title,pg_alert_content,pg_title,pg_content,pg_picture,pg_uid,pg_versions,pg_remark,pg_is_push,pg_control_time,pg_push_time,pg_createtime,pg_updatetime,pg_type,pg_other_id,pg_scan_num) values (#{id,jdbcType=BIGINT},#{alertTitle,jdbcType=VARCHAR},#{alertContent,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{content,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{uid,jdbcType=BIGINT},#{versions,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{isPush,jdbcType=INTEGER},#{controlTime,jdbcType=TIMESTAMP},#{pushTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{type,jdbcType=INTEGER},#{otherId,jdbcType=VARCHAR},#{scanNum,jdbcType=INTEGER})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.PushGoods" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_push_goods
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">pg_id,</if>
|
| | |
| | | <if test="pushTime != null">pg_push_time,</if>
|
| | | <if test="createTime != null">pg_createtime,</if>
|
| | | <if test="updateTime != null">pg_updatetime,</if>
|
| | | <if test="type != null">pg_type,</if>
|
| | | <if test="otherId != null">pg_other_id,</if>
|
| | | <if test="scanNum != null">pg_scan_num,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | |
| | | <if test="pushTime != null">#{pushTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="type != null">#{type,jdbcType=INTEGER},</if>
|
| | | <if test="otherId != null">#{otherId,jdbcType=VARCHAR},</if>
|
| | | <if test="scanNum != null">#{scanNum,jdbcType=INTEGER},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.PushGoods">update yeshi_ec_push_goods set pg_alert_title = #{alertTitle,jdbcType=VARCHAR},pg_alert_content = #{alertContent,jdbcType=VARCHAR},pg_title = #{title,jdbcType=VARCHAR},pg_content = #{content,jdbcType=VARCHAR},pg_picture = #{picture,jdbcType=VARCHAR},pg_uid = #{uid,jdbcType=BIGINT},pg_versions = #{versions,jdbcType=VARCHAR},pg_remark = #{remark,jdbcType=VARCHAR},pg_is_push = #{isPush,jdbcType=INTEGER},pg_control_time = #{controlTime,jdbcType=TIMESTAMP},pg_push_time = #{pushTime,jdbcType=TIMESTAMP},pg_createtime = #{createTime,jdbcType=TIMESTAMP},pg_updatetime = #{updateTime,jdbcType=TIMESTAMP} where pg_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.PushGoods">update yeshi_ec_push_goods set pg_alert_title = #{alertTitle,jdbcType=VARCHAR},pg_alert_content = #{alertContent,jdbcType=VARCHAR},pg_title = #{title,jdbcType=VARCHAR},pg_content = #{content,jdbcType=VARCHAR},pg_picture = #{picture,jdbcType=VARCHAR},pg_uid = #{uid,jdbcType=BIGINT},pg_versions = #{versions,jdbcType=VARCHAR},pg_remark = #{remark,jdbcType=VARCHAR},pg_is_push = #{isPush,jdbcType=INTEGER},pg_control_time = #{controlTime,jdbcType=TIMESTAMP},pg_push_time = #{pushTime,jdbcType=TIMESTAMP},pg_createtime = #{createTime,jdbcType=TIMESTAMP},pg_updatetime = #{updateTime,jdbcType=TIMESTAMP},pg_type = #{type,jdbcType=INTEGER},pg_other_id = #{otherId,jdbcType=VARCHAR},pg_scan_num = #{scanNum,jdbcType=INTEGER} where pg_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.PushGoods">update yeshi_ec_push_goods
|
| | | <set>
|
| | | <if test="alertTitle != null">pg_alert_title=#{alertTitle,jdbcType=VARCHAR},</if>
|
| | |
| | | <if test="pushTime != null">pg_push_time=#{pushTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="createTime != null">pg_createtime=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="updateTime != null">pg_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="type != null">pg_type=#{type,jdbcType=INTEGER},</if>
|
| | | <if test="otherId != null">pg_other_id=#{otherId,jdbcType=VARCHAR},</if>
|
| | | <if test="scanNum != null">pg_scan_num=#{scanNum,jdbcType=INTEGER},</if>
|
| | | </set> where pg_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <delete id="deleteBatchByPrimaryKey" parameterType="java.util.List">
|
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_invite_code" property="inviteCode" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" |
| | | jdbcType="INTEGER" /> |
| | | <result column="uie_coupon_news" property="couponNews" |
| | | jdbcType="INTEGER" /> |
| | | <result column="uie_synch_navbar" property="synchNavbar" |
| | |
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" /> |
| | | <result column="uie_ercode" property="erCode" jdbcType="VARCHAR" /> |
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" /> |
| | | <result column="uie_auto_extract" property="autoExtract" |
| | | jdbcType="BOOLEAN" /> |
| | | <result column="uie_close_time_extract" property="closeTimeExtract" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_active_time" property="activeTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" /> |
| | | <result column="uie_invite_code_vip" property="inviteCodeVip" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="uie_invite_code_vip" property="inviteCodeVip" jdbcType="VARCHAR" /> |
| | | <result column="uie_bind_taobao" property="bindTaoBao" jdbcType="BOOLEAN"/> |
| | | <association property="userInfo" column="uie_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" /> |
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_invite_code" property="inviteCode" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" |
| | | jdbcType="INTEGER" /> |
| | | <result column="uie_coupon_news" property="couponNews" |
| | | jdbcType="INTEGER" /> |
| | | <result column="uie_synch_navbar" property="synchNavbar" |
| | |
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" /> |
| | | <result column="uie_ercode" property="erCode" jdbcType="VARCHAR" /> |
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" /> |
| | | <result column="uie_auto_extract" property="autoExtract" |
| | | jdbcType="BOOLEAN" /> |
| | | <result column="uie_close_time_extract" property="closeTimeExtract" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_active_time" property="activeTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" /> |
| | | <result column="uie_invite_code_vip" property="inviteCodeVip" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="uie_invite_code_vip" property="inviteCodeVip" jdbcType="VARCHAR" /> |
| | | <result column="uie_bind_taobao" property="bindTaoBao" jdbcType="BOOLEAN"/> |
| | | <association property="userInfo" column="uie_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" /> |
| | | <association property="userRank" column="uie_rank_id" |
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_invite_code" property="inviteCode" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="uie_lottery_newbies" property="lotteryNewbies" |
| | | jdbcType="INTEGER" /> |
| | | <result column="uie_coupon_news" property="couponNews" |
| | | jdbcType="INTEGER" /> |
| | | <result column="uie_synch_navbar" property="synchNavbar" |
| | |
| | | <result column="uie_weixin" property="weiXin" jdbcType="VARCHAR" /> |
| | | <result column="uie_ercode" property="erCode" jdbcType="VARCHAR" /> |
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" /> |
| | | <result column="uie_auto_extract" property="autoExtract" |
| | | jdbcType="BOOLEAN" /> |
| | | <result column="uie_close_time_extract" property="closeTimeExtract" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_active_time" property="activeTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="uie_mark" property="mark" jdbcType="VARCHAR" /> |
| | | <result column="uie_invite_code_vip" property="inviteCodeVip" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="uie_invite_code_vip" property="inviteCodeVip" jdbcType="VARCHAR" /> |
| | | <result column="uie_bind_taobao" property="bindTaoBao" jdbcType="BOOLEAN"/> |
| | | <association property="userInfo" column="uie_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="uie_uid" property="id" jdbcType="BIGINT" /> |
| | |
| | | <association property="userRank" column="uie_rank_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserRankMapper.BaseResultMap" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time,uie_auto_extract,uie_close_time_extract,uie_active_time,uie_mark,uie_invite_code_vip,uie_ercode |
| | | <sql id="Base_Column_List">uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time,uie_active_time,uie_mark,uie_invite_code_vip,uie_ercode,uie_bind_taobao |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_user_info_extra |
| | | (uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_lottery_newbies,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time,uie_auto_extract,uie_close_time_extract,uie_active_time,uie_mark,uie_invite_code_vip,uie_ercode) |
| | | (uie_id,uie_uid,uie_rank_id,uie_rank_source,uie_rank_order_num,uie_rank_update_time,uie_invite_code,uie_coupon_news,uie_synch_navbar,uie_first_login_time,uie_sex,uie_weixin,uie_gold_coin,uie_create_time,uie_update_time,uie_active_time,uie_mark,uie_invite_code_vip,uie_ercode,uie_bind_taobao) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{lotteryNewbies,jdbcType=INTEGER},#{couponNews,jdbcType=INTEGER},#{synchNavbar,jdbcType=VARCHAR},#{firstLoginTime,jdbcType=TIMESTAMP},#{sex,jdbcType=INTEGER},#{weiXin,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{autoExtract,jdbcType=BOOLEAN},#{closeTimeExtract,jdbcType=TIMESTAMP},#{activeTime,jdbcType=TIMESTAMP},#{mark,jdbcType=VARCHAR},#{inviteCodeVip,jdbcType=VARCHAR},#{erCode,jdbcType=VARCHAR}) |
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{userRank.id,jdbcType=BIGINT},#{rankSource,jdbcType=INTEGER},#{rankOrderNum,jdbcType=INTEGER},#{rankUpdateTime,jdbcType=TIMESTAMP},#{inviteCode,jdbcType=VARCHAR},#{couponNews,jdbcType=INTEGER},#{synchNavbar,jdbcType=VARCHAR},#{firstLoginTime,jdbcType=TIMESTAMP},#{sex,jdbcType=INTEGER},#{weiXin,jdbcType=VARCHAR},#{goldCoin,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{activeTime,jdbcType=TIMESTAMP},#{mark,jdbcType=VARCHAR},#{inviteCodeVip,jdbcType=VARCHAR},#{erCode,jdbcType=VARCHAR},#{bindTaoBao,jdbcType=BOOLEAN}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="rankOrderNum != null">uie_rank_order_num,</if> |
| | | <if test="rankUpdateTime != null">uie_rank_update_time,</if> |
| | | <if test="inviteCode != null">uie_invite_code,</if> |
| | | <if test="lotteryNewbies != null">uie_lottery_newbies,</if> |
| | | <if test="couponNews != null">uie_coupon_news,</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar,</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time,</if> |
| | |
| | | <if test="goldCoin != null">uie_gold_coin,</if> |
| | | <if test="createTime != null">uie_create_time,</if> |
| | | <if test="updateTime != null">uie_update_time,</if> |
| | | <if test="autoExtract != null">uie_auto_extract,</if> |
| | | <if test="closeTimeExtract != null">uie_close_time_extract,</if> |
| | | <if test="activeTime != null">uie_active_time,</if> |
| | | <if test="mark != null">uie_mark,</if> |
| | | <if test="inviteCodeVip != null">uie_invite_code_vip,</if> |
| | | <if test="bindTaoBao != null">uie_bind_taobao,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="rankOrderNum != null">#{rankOrderNum,jdbcType=INTEGER},</if> |
| | | <if test="rankUpdateTime != null">#{rankUpdateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="inviteCode != null">#{inviteCode,jdbcType=VARCHAR},</if> |
| | | <if test="lotteryNewbies != null">#{lotteryNewbies,jdbcType=INTEGER},</if> |
| | | <if test="couponNews != null">#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="firstLoginTime != null">#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | |
| | | <if test="goldCoin != null">#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="autoExtract != null">#{autoExtract,jdbcType=BOOLEAN},</if> |
| | | <if test="closeTimeExtract != null">#{closeTimeExtract,jdbcType=TIMESTAMP},</if> |
| | | <if test="activeTime != null">#{activeTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="mark != null">#{mark,jdbcType=VARCHAR},</if> |
| | | <if test="inviteCodeVip != null">#{inviteCodeVip,jdbcType=VARCHAR}</if> |
| | | <if test="inviteCodeVip != null">#{inviteCodeVip,jdbcType=VARCHAR},</if> |
| | | <if test="bindTaoBao != null">#{bindTaoBao,jdbcType=BOOLEAN},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra">update |
| | |
| | | #{rankSource,jdbcType=INTEGER},uie_rank_order_num = |
| | | #{rankOrderNum,jdbcType=INTEGER},uie_rank_update_time = |
| | | #{rankUpdateTime,jdbcType=TIMESTAMP},uie_invite_code = |
| | | #{inviteCode,jdbcType=VARCHAR},uie_lottery_newbies = |
| | | #{lotteryNewbies,jdbcType=INTEGER},uie_coupon_news = |
| | | #{inviteCode,jdbcType=VARCHAR},uie_coupon_news = |
| | | #{couponNews,jdbcType=INTEGER},uie_synch_navbar = |
| | | #{synchNavbar,jdbcType=VARCHAR},uie_first_login_time = |
| | | #{firstLoginTime,jdbcType=TIMESTAMP},uie_sex = |
| | |
| | | #{erCode,jdbcType=VARCHAR},uie_gold_coin = |
| | | #{goldCoin,jdbcType=INTEGER},uie_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},uie_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP},uie_auto_extract = |
| | | #{autoExtract,jdbcType=BOOLEAN},uie_close_time_extract = |
| | | #{closeTimeExtract,jdbcType=TIMESTAMP},uie_active_time = |
| | | #{updateTime,jdbcType=TIMESTAMP},uie_active_time = |
| | | #{activeTime,jdbcType=TIMESTAMP},uie_mark = #{mark,jdbcType=VARCHAR} |
| | | ,uie_invite_code_vip =#{inviteCodeVip,jdbcType=VARCHAR} where |
| | | uie_id = #{id,jdbcType=BIGINT} |
| | | ,uie_invite_code_vip =#{inviteCodeVip,jdbcType=VARCHAR}, |
| | | uie_bind_taobao = #{bindTaoBao,jdbcType=BOOLEAN} |
| | | where uie_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.UserInfoExtra"> |
| | | update yeshi_ec_user_info_extra |
| | |
| | | <if test="userRank != null">uie_rank_id=#{userRank.id,jdbcType=BIGINT},</if> |
| | | <if test="rankSource != null">uie_rank_source=#{rankSource,jdbcType=INTEGER},</if> |
| | | <if test="rankOrderNum != null">uie_rank_order_num=#{rankOrderNum,jdbcType=INTEGER},</if> |
| | | <if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if> |
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if> |
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if> |
| | | <if test="erCode != null">uie_ercode=#{erCode,jdbcType=VARCHAR},</if> |
| | | <if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="autoExtract != null">uie_auto_extract=#{autoExtract,jdbcType=BOOLEAN},</if> |
| | | <if test="closeTimeExtract != null">uie_close_time_extract=#{closeTimeExtract,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="activeTime != null">uie_active_time=#{activeTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="mark != null">uie_mark=#{mark,jdbcType=VARCHAR},</if> |
| | | <if test="inviteCodeVip !=null">uie_invite_code_vip=#{inviteCodeVip,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="bindTaoBao != null">uie_bind_taobao=#{bindTaoBao,jdbcType=BOOLEAN},</if> |
| | | </set> |
| | | where uie_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | <if test="userRank != null">uie_rank_id=#{userRank.id,jdbcType=BIGINT},</if> |
| | | <if test="rankSource != null">uie_rank_source=#{rankSource,jdbcType=INTEGER},</if> |
| | | <if test="rankOrderNum != null">uie_rank_order_num=#{rankOrderNum,jdbcType=INTEGER},</if> |
| | | <if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="rankUpdateTime != null">uie_rank_update_time=#{rankUpdateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="inviteCode != null">uie_invite_code=#{inviteCode,jdbcType=VARCHAR},</if> |
| | | <if test="lotteryNewbies != null">uie_lottery_newbies=#{lotteryNewbies,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="couponNews != null">uie_coupon_news=#{couponNews,jdbcType=INTEGER},</if> |
| | | <if test="synchNavbar != null">uie_synch_navbar=#{synchNavbar,jdbcType=VARCHAR},</if> |
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="firstLoginTime != null">uie_first_login_time=#{firstLoginTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="sex != null">uie_sex=#{sex,jdbcType=INTEGER},</if> |
| | | <if test="weiXin != null">uie_weixin=#{weiXin,jdbcType=VARCHAR},</if> |
| | | <if test="erCode != null">uie_ercode=#{erCode,jdbcType=VARCHAR},</if> |
| | | <if test="goldCoin != null">uie_gold_coin=#{goldCoin,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">uie_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">uie_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="autoExtract != null">uie_auto_extract=#{autoExtract,jdbcType=BOOLEAN},</if> |
| | | <if test="closeTimeExtract != null">uie_close_time_extract=#{closeTimeExtract,jdbcType=TIMESTAMP}, |
| | | </if> |
| | | <if test="activeTime != null">uie_active_time=#{activeTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="mark != null">uie_mark=#{mark,jdbcType=VARCHAR},</if> |
| | | <if test="bindTaoBao != null">uie_bind_taobao=#{bindTaoBao,jdbcType=BOOLEAN},</if> |
| | | </set> |
| | | where uie_uid = #{userInfo.id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | yeshi_ec_user_info_extra ue LEFT JOIN yeshi_ec_user_rank rk ON |
| | | rk.`ur_id` = ue.`uie_rank_id` WHERE ue.`uie_uid` = #{uid} |
| | | </select> |
| | | <update id="updateAutoExtract">UPDATE |
| | | yeshi_ec_user_info_extra SET uie_auto_extract = 1 WHERE |
| | | uie_auto_extract = 0 AND DATEDIFF(NOW(),uie_close_time_extract) <![CDATA[>]]> |
| | | #{days} |
| | | </update> |
| | | </mapper> |
| | |
| | | package com.yeshi.fanli.service.impl.count; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | countOrderTrackRateDao.save(record); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType) throws Exception { |
| | | |
| | | List<ChartTDO> result_list = null; |
| | | |
| | | // 用户订单 |
| | | List<ChartTDO> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year, startTime, endTime, |
| | | sourceType); |
| | | if (listTotal == null || listTotal.size() == 0) { |
| | | return result_list; |
| | | } |
| | | |
| | | // 淘宝联盟 |
| | | List<ChartTDO> type_list = null; |
| | | switch (sourceType) { |
| | | case Constant.SOURCE_TYPE_TAOBAO: |
| | | type_list = taoBaoOrderMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | case Constant.SOURCE_TYPE_JD: |
| | | type_list = jdOrderItemMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | case Constant.SOURCE_TYPE_PDD: |
| | | type_list = pddOrderMapper.countOrderNumber(dateType, year, startTime, endTime); |
| | | break; |
| | | } |
| | | if (type_list == null || type_list.size() == 0) { |
| | | return null; |
| | | } |
| | | |
| | | switch (dateType) { |
| | | case 1: // 按天处理 |
| | | result_list = dayFactory(startTime, endTime, type_list); |
| | | break; |
| | | case 2: // 按月处理 |
| | | result_list = monthFactory(type_list); |
| | | break; |
| | | case 3: |
| | | result_list = yearFactory(type_list); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | DecimalFormat df = new DecimalFormat("#.00"); |
| | | |
| | | for (int i = 0; i < result_list.size(); i++) { |
| | | double proportion = 0; |
| | | ChartTDO chartTDO = result_list.get(i); |
| | | String showDate = chartTDO.getShowDate(); |
| | | for (int j = 0; j < listTotal.size(); j++) { |
| | | ChartTDO innerChartTDO = listTotal.get(j); |
| | | String innerDate = innerChartTDO.getShowDate(); |
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) { |
| | | String innerValue = innerChartTDO.getShowValue(); |
| | | long innerData = Long.parseLong(innerValue); |
| | | |
| | | String showValue = chartTDO.getShowValue(); |
| | | long showData = Long.parseLong(showValue); |
| | | |
| | | if (showData > 0) { |
| | | proportion = innerData / (double) showData; |
| | | } |
| | | break; // 结束内部循环 |
| | | } |
| | | } |
| | | chartTDO.setShowValue(Double.parseDouble(df.format(proportion * 100)) + ""); |
| | | } |
| | | |
| | | return result_list; |
| | | } |
| | | |
| | | @Override |
| | | public Long countOrderBySourceTypeAndDay(int source, String preDay) { |
| | | return commonOrderCountMapper.countOrderBySourceTypeAndDay(preDay, source); |
| | | } |
| | | |
| | | @Override |
| | | public long countOrderBySourceAndNearDay(Long uid, int source, int day) { |
| | | Long count = commonOrderCountMapper.countOrderBySourceAndNearDay(uid, source, day); |
| | | if (count == null) { |
| | | count = 0L; |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | startTime, endTime, listSource);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public BigDecimal sumMoneyArrivalByUidAndNearDay(Long uid, int day) {
|
| | | return hongBaoV2CountMapper.sumMoneyArrivalByUidAndNearDay(uid, day);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public BigDecimal sumMoneyBySettleTimeAndUid(Long uid, Date minDate, Date maxDate) {
|
| | | BigDecimal money = hongBaoV2CountMapper.sumMoneyBySettleTimeAndUid(uid, minDate, maxDate);
|
| | | if (money == null) {
|
| | | money = new BigDecimal(0);
|
| | | }
|
| | | return money;
|
| | | }
|
| | | |
| | | @Override
|
| | | public BigDecimal sumMoneyByANotSettleAndUid(Long uid) {
|
| | | BigDecimal money = hongBaoV2CountMapper.sumMoneyByANotSettleAndUid(uid);
|
| | | if (money == null) {
|
| | | money = new BigDecimal(0);
|
| | | }
|
| | | return money;
|
| | | }
|
| | | |
| | | |
| | | |
| | | }
|
| | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | private ImgInfo uploadOriginalPicture(MultipartFile file) { |
| | | try { |
| | | InputStream inputStream = file.getInputStream(); |
| | | String contentType = file.getContentType(); |
| | | String type = contentType.substring(contentType.indexOf("/") + 1); |
| | | String filePath = FilePathEnum.goodsEvaluate.getPath() + UUID.randomUUID().toString().replace("-", "") + "."+ type; |
| | | |
| | | BufferedImage sourceImg = ImageIO.read(inputStream); |
| | | ImgInfo info = new ImgInfo(); |
| | | int width = sourceImg.getWidth(); |
| | | int height = sourceImg.getHeight(); |
| | | String picLink = COSManager.getInstance().uploadFile(inputStream, filePath).getUrl(); |
| | | |
| | | info.setH(height); |
| | | info.setW(width); |
| | | info.setUrl(picLink); |
| | | return info; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | private String uploadPicture(File file, String contentType) throws Exception { |
| | | InputStream inputStream = new FileInputStream(file); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void saveActivityPic(String pid, ImgInfo imgInfo, MultipartHttpServletRequest fileRequest) |
| | | public void saveActivityPic(String pid, ImgInfo imgInfo, String picUrls, MultipartHttpServletRequest fileRequest) |
| | | throws GoodsEvaluateException, Exception { |
| | | if (StringUtil.isNullOrEmpty(pid)) { |
| | | throw new GoodsEvaluateException(1, "请保存第一部分信息"); |
| | |
| | | GoodsEvaluate resultObj = goodsEvaluateDao.getById(pid); |
| | | if (resultObj == null) |
| | | throw new GoodsEvaluateException(1, "第一部分信息缺失"); |
| | | |
| | | if (imgInfo == null || StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) { |
| | | throw new GoodsEvaluateException(1, "活动链接不能为空"); |
| | | } |
| | | |
| | | String videoPic = null; |
| | | String activityPic = null; |
| | | ImgInfo imgVideo = null; |
| | | ImgInfo imgactivity = null; |
| | | List<String> listDel = new ArrayList<String>(); |
| | | List<ImgInfo> listOld = new ArrayList<ImgInfo>(); |
| | | List<ImgInfo> resultList = resultObj.getImgList(); |
| | | if (resultList != null && resultList.size() > 0) { |
| | | for (ImgInfo info : resultList) { |
| | | if (info.getType() == ImgEnum.activity) { |
| | | activityPic = info.getActivityPic(); |
| | | imgactivity = info; |
| | | } else { |
| | | if (info.getType() == ImgEnum.video) { |
| | | imgVideo = info; |
| | | videoPic = info.getUrl(); |
| | | } else { |
| | | listOld.add(info); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 视频部分 |
| | | if (fileRequest != null) { |
| | | MultipartFile filevideo = fileRequest.getFile("filevideo"); |
| | | if (filevideo != null) { |
| | | if (StringUtil.isNullOrEmpty(imgInfo.getVideoUrl())) { |
| | | throw new GoodsEvaluateException(1, "视频链接不能为空"); |
| | | } |
| | | ImgInfo info = uploadVideoPicture(filevideo); |
| | | if (info == null) |
| | | throw new GoodsEvaluateException(2, "视频图片上传失败"); |
| | | if (imgVideo != null) { |
| | | String url = imgVideo.getUrl(); |
| | | if (!StringUtil.isNullOrEmpty(url)) { |
| | | listDel.add(url); |
| | | } |
| | | imgVideo.setUrl(info.getUrl()); |
| | | imgVideo.setUrlHD(info.getUrl()); |
| | | } else { |
| | | imgVideo = new ImgInfo(); |
| | | imgVideo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | imgVideo.setLarge(true); |
| | | imgVideo.setPid(pid); |
| | | imgVideo.setUrl(info.getUrl()); |
| | | imgVideo.setUrlHD(info.getUrl()); |
| | | imgVideo.setVideoUrl(imgInfo.getVideoUrl()); |
| | | imgVideo.setType(ImgEnum.video); |
| | | } |
| | | imgVideo.setW(info.getW()); |
| | | imgVideo.setH(info.getH()); |
| | | } |
| | | } |
| | | |
| | | |
| | | List<ImgInfo> listImg = new ArrayList<ImgInfo>(); |
| | | if (imgVideo != null) { |
| | | if (!StringUtil.isNullOrEmpty(imgInfo.getVideoUrl())) { |
| | | if (imgVideo != null && StringUtil.isNullOrEmpty(imgVideo.getUrl())) { |
| | | throw new GoodsEvaluateException(1, "视频封面图不能为空"); |
| | | } |
| | | imgVideo.setVideoUrl(imgInfo.getVideoUrl()); |
| | | listImg.add(imgVideo); |
| | | } else { |
| | | String url = imgVideo.getUrl(); |
| | | if (!StringUtil.isNullOrEmpty(url)) { |
| | | listDel.add(url); |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 编辑图片 |
| | | List<ImgInfo> tempList = new ArrayList<ImgInfo>(); |
| | | if (!StringUtil.isNullOrEmpty(picUrls)) { |
| | | String[] pics = picUrls.split(","); |
| | | if (pics != null) { |
| | | for (int i = 0; i < pics.length; i++) { |
| | | String picLink = pics[i]; |
| | | if (picLink.startsWith("http")) { |
| | | if (listOld != null) { |
| | | for (ImgInfo info: listOld) { |
| | | if (info.getUrl().equals(picLink)) { |
| | | tempList.add(info); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int width = 0; |
| | | int height = 0; |
| | | int width2 = 0; |
| | | int height2 = 0; |
| | | List<ImgInfo> listImg = new ArrayList<ImgInfo>(); |
| | | // 上传文件替换 |
| | | if (fileRequest != null) { |
| | | MultipartFile filevideo = fileRequest.getFile("filevideo"); |
| | | if (filevideo != null) { |
| | | removePicture(videoPic); |
| | | |
| | | ImgInfo info = uploadVideoPicture(filevideo); |
| | | if (info == null) |
| | | throw new GoodsEvaluateException(2, "视频图片上传失败"); |
| | | videoPic = info.getUrl(); |
| | | width = info.getW(); |
| | | height = info.getH(); |
| | | } |
| | | |
| | | MultipartFile activityfile = fileRequest.getFile("activityfile"); |
| | | if (activityfile != null) { |
| | | removePicture(activityPic); |
| | | InputStream inputStream = activityfile.getInputStream(); |
| | | BufferedImage sourceImg = ImageIO.read(inputStream); |
| | | width2 = sourceImg.getWidth(); |
| | | height2 = sourceImg.getHeight(); |
| | | String picLink = uploadPicture(activityfile); |
| | | activityPic = picLink; |
| | | for (int i = 0; i < 9; i++) { |
| | | MultipartFile file = fileRequest.getFile("file" + i); |
| | | if (file != null) { |
| | | ImgInfo info = uploadOriginalPicture(file); |
| | | ImgInfo imgInfo0 = new ImgInfo(); |
| | | imgInfo0.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | imgInfo0.setLarge(false); |
| | | imgInfo0.setPid(pid); |
| | | imgInfo0.setUrl(info.getUrl()); |
| | | imgInfo0.setUrlHD(info.getUrl()); |
| | | imgInfo0.setType(ImgEnum.img); |
| | | imgInfo0.setW(info.getW()); |
| | | imgInfo0.setH(info.getH()); |
| | | |
| | | if (i < tempList.size()) { |
| | | tempList.set(i, imgInfo0); |
| | | } else { |
| | | tempList.add(imgInfo0); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (!StringUtil.isNullOrEmpty(videoPic) || !StringUtil.isNullOrEmpty(imgInfo.getVideoUrl())) { |
| | | if (imgVideo != null) { |
| | | imgVideo.setUrl(videoPic); |
| | | imgVideo.setUrlHD(videoPic); |
| | | imgVideo.setVideoUrl(imgInfo.getVideoUrl()); |
| | | } else { |
| | | imgVideo = new ImgInfo(); |
| | | imgVideo.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | imgVideo.setLarge(true); |
| | | imgVideo.setPid(pid); |
| | | imgVideo.setUrl(videoPic); |
| | | imgVideo.setUrlHD(videoPic); |
| | | imgVideo.setVideoUrl(imgInfo.getVideoUrl()); |
| | | imgVideo.setType(ImgEnum.video); |
| | | } |
| | | if (width > 0) { |
| | | imgVideo.setW(width); |
| | | imgVideo.setH(height); |
| | | } else { |
| | | imgVideo.setW(imgVideo.getW()); |
| | | imgVideo.setH(imgVideo.getH()); |
| | | } |
| | | listImg.add(imgVideo); |
| | | } |
| | | |
| | | int totalImg = 0; |
| | | if (!StringUtil.isNullOrEmpty(activityPic) || !StringUtil.isNullOrEmpty(imgInfo.getActivityUrl())) { |
| | | if (imgactivity != null) { |
| | | imgactivity.setUrl(activityPic); |
| | | imgactivity.setUrlHD(activityPic); |
| | | imgactivity.setActivityUrl(imgInfo.getActivityUrl()); |
| | | } else { |
| | | imgactivity = new ImgInfo(); |
| | | imgactivity.setId(UUID.randomUUID().toString().replace("-", "")); |
| | | imgactivity.setLarge(true); |
| | | imgactivity.setPid(pid); |
| | | imgactivity.setUrl(activityPic); |
| | | imgactivity.setUrlHD(activityPic); |
| | | imgactivity.setActivityUrl(imgInfo.getActivityUrl()); |
| | | imgactivity.setType(ImgEnum.activity); |
| | | } |
| | | if (width2 > 0) { |
| | | imgactivity.setW(width2); |
| | | imgactivity.setH(height2); |
| | | } else { |
| | | imgactivity.setW(imgactivity.getW()); |
| | | imgactivity.setH(imgactivity.getH()); |
| | | } |
| | | listImg.add(imgactivity); |
| | | totalImg++; |
| | | } |
| | | |
| | | |
| | | int lineNum = 0; |
| | | int totalImg = tempList.size(); |
| | | if (totalImg > 0) { |
| | | if (totalImg == 1) { |
| | | lineNum = 1; |
| | |
| | | lineNum = 3; |
| | | } |
| | | } |
| | | |
| | | |
| | | if (tempList.size() > 0) { |
| | | listImg.addAll(tempList); |
| | | } |
| | | |
| | | // 清理老图片 |
| | | if (listOld != null && listOld.size() > 0) { |
| | | for (ImgInfo infoOld: listOld) { |
| | | boolean del = true; |
| | | String oldPic = infoOld.getUrl(); |
| | | for (ImgInfo info : listImg) { |
| | | if (info.getUrl().equals(oldPic)) { |
| | | del = false; |
| | | } |
| | | } |
| | | if (del) |
| | | listDel.add(infoOld.getUrl()); |
| | | } |
| | | } |
| | | |
| | | resultObj.setJumpLink(imgInfo.getActivityUrl()); |
| | | resultObj.setLineNum(lineNum); |
| | | resultObj.setImgList(listImg); |
| | | goodsEvaluateDao.save(resultObj); |
| | | |
| | | // 删除图片 |
| | | if (listDel.size() > 0) { |
| | | for (String url : listDel) { |
| | | if (url.contains(FilePathEnum.goodsEvaluate.getPath())) { |
| | | removePicture(url); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType) { |
| | | return goodsEvaluateDao.query(start, count, key, state, dynamicType); |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType, String typeEnum) { |
| | | return goodsEvaluateDao.query(start, count, key, state, dynamicType, typeEnum); |
| | | } |
| | | |
| | | @Override |
| | | public long count(String key, Integer state, int dynamicType) { |
| | | return goodsEvaluateDao.count(key, state, dynamicType); |
| | | public long count(String key, Integer state, int dynamicType, String typeEnum) { |
| | | return goodsEvaluateDao.count(key, state, dynamicType, typeEnum); |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | package com.yeshi.fanli.service.impl.homemodule;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.SpecialExtraMapper;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialExtraService;
|
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class SpecialExtraServiceImpl implements SpecialExtraService {
|
| | |
|
| | | @Resource
|
| | | private SpecialExtraMapper specialExtraMapper;
|
| | | |
| | | @Resource
|
| | | private ConvertLinkManager convertLinkManager;
|
| | |
|
| | | @Override
|
| | | public void saveExtraInfo(SpecialExtra record) throws SpecialException {
|
| | | if (record == null || record.getId() == null)
|
| | | return;
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(record.getComment())) {
|
| | | if (record.getNeedSpin() == null)
|
| | | record.setNeedSpin(false);
|
| | | |
| | | if (record.getNeedSpin()) {
|
| | | try {
|
| | | convertLinkManager.convertLinkFromText(record.getComment(), Constant.LINK_TOKEN_VERIFY_UID, true);
|
| | | } catch (ConvertLinkExceptionException e) {
|
| | | if (ConvertLinkExceptionException.CODE_NONE != e.getCode()) {
|
| | | throw new SpecialException(1, "包含不可转链的口令与链接");
|
| | | }
|
| | | } catch (Exception e) {
|
| | | throw new SpecialException(1, "包含不可转链的口令与链接");
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | SpecialExtra extra = specialExtraMapper.selectByPrimaryKey(record.getId());
|
| | | if (extra == null) {
|
| | | specialExtraMapper.insertSelective(record);
|
| | | } else {
|
| | | specialExtraMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public SpecialExtra selectByPrimaryKey(Long id) {
|
| | | return specialExtraMapper.selectByPrimaryKey(id);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.commons.beanutils.PropertyUtils;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.exception.banner.SwiperPictureException;
|
| | |
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialCardService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialExtraService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialPlaceService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | @Resource
|
| | | private SpecialCardService specialCardService;
|
| | |
|
| | | @Resource
|
| | | private SpecialExtraService specialExtraService;
|
| | | |
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record,
|
| | | String jumpType) throws SpecialException, Exception {
|
| | | String jumpType, SpecialExtra extra) throws SpecialException, Exception {
|
| | |
|
| | | Long cardId = record.getCardId();
|
| | | if (cardId == null) {
|
| | |
| | | record.setUpdatetime(new Date());
|
| | | specialMapper.insert(record);
|
| | |
|
| | | extra.setId(record.getId());
|
| | | |
| | | Special s = new Special();
|
| | | s.setId(record.getId());
|
| | | s.setOrderby(Integer.parseInt(s.getId() + ""));
|
| | |
| | |
|
| | | record.setUpdatetime(new Date());
|
| | | specialMapper.updateByPrimaryKey(record);
|
| | | |
| | | extra.setId(record.getId());
|
| | | }
|
| | | |
| | | // 添加补充信息
|
| | | specialExtraService.saveExtraInfo(extra);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Special> listQueryByCard(long start, int count, Long card, String key, Integer sex) {
|
| | |
|
| | | public List<SpecialVO> listQueryByCard(long start, int count, Long card, String key, Integer sex) {
|
| | | List<Special> list = specialMapper.listQueryByCard(start, count, card, key, sex);
|
| | | if (list == null || list.size() == 0) {
|
| | | return list;
|
| | | if (list == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | // 跳转链接
|
| | | List<SpecialVO> listvo = new ArrayList<SpecialVO>();
|
| | | for (Special special : list) {
|
| | | if (special.getState() != null && special.getState().longValue() == 0) {
|
| | | special.setState(1L);
|
| | | } else {
|
| | | special.setState(0L);
|
| | | SpecialVO specialVO = new SpecialVO();
|
| | | try {
|
| | | PropertyUtils.copyProperties(specialVO, special);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | continue;
|
| | | }
|
| | |
|
| | | Date startTime = special.getStartTime();
|
| | | Date endTime = special.getEndTime();
|
| | | if (specialVO.getState() != null && specialVO.getState().longValue() == 0) {
|
| | | specialVO.setState(1L);
|
| | | } else {
|
| | | specialVO.setState(0L);
|
| | | }
|
| | | |
| | | Date startTime = specialVO.getStartTime();
|
| | | Date endTime = specialVO.getEndTime();
|
| | | if (startTime == null && endTime == null) {
|
| | | special.setStartTime_str("");
|
| | | special.setEndTime_str("");
|
| | | specialVO.setStartTime_str("");
|
| | | specialVO.setEndTime_str("");
|
| | | } else {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm");
|
| | | if (startTime == null) {
|
| | | special.setStartTime_str("");
|
| | | specialVO.setStartTime_str("");
|
| | | } else {
|
| | | special.setStartTime_str(sdf.format(startTime));
|
| | | specialVO.setStartTime_str(sdf.format(startTime));
|
| | | }
|
| | |
|
| | | if (endTime == null) {
|
| | | special.setEndTime_str("");
|
| | | specialVO.setEndTime_str("");
|
| | | } else {
|
| | | special.setEndTime_str(sdf.format(endTime));
|
| | | specialVO.setEndTime_str(sdf.format(endTime));
|
| | | }
|
| | | }
|
| | |
|
| | | String params = special.getParams();
|
| | | String params = specialVO.getParams();
|
| | | if (StringUtil.isNullOrEmpty(params)) {
|
| | | special.setParams("");
|
| | | specialVO.setParams("");
|
| | | }
|
| | |
|
| | | String remark = special.getRemark();
|
| | | String remark = specialVO.getRemark();
|
| | | if (StringUtil.isNullOrEmpty(remark)) {
|
| | | special.setRemark("");
|
| | | specialVO.setRemark("");
|
| | | }
|
| | |
|
| | | JumpDetailV2 jumpDetail = special.getJumpDetail();
|
| | | JumpDetailV2 jumpDetail = specialVO.getJumpDetail();
|
| | | if (jumpDetail == null) {
|
| | | // 默认未选择
|
| | | JumpDetailV2 jumpDetailV2 = new JumpDetailV2();
|
| | | jumpDetailV2.setName("-未选择-");
|
| | | jumpDetailV2.setType("default");
|
| | | special.setJumpDetail(jumpDetailV2);
|
| | | specialVO.setJumpDetail(jumpDetailV2);
|
| | | }
|
| | | |
| | | // 补充信息
|
| | | SpecialExtra extra = specialExtraService.selectByPrimaryKey(specialVO.getId());
|
| | | if (extra == null) {
|
| | | specialVO.setNeedSpin(false);
|
| | | specialVO.setComment("");
|
| | | } else {
|
| | | specialVO.setNeedSpin(extra.getNeedSpin());
|
| | | if (StringUtil.isNullOrEmpty(extra.getComment())) {
|
| | | specialVO.setComment("");
|
| | | } else {
|
| | | specialVO.setComment(extra.getComment());
|
| | | }
|
| | | }
|
| | | |
| | | listvo.add(specialVO);
|
| | | }
|
| | | return list;
|
| | | return listvo;
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<Extract> getExtractSucceedRecord(int page, int pageSize, Long uid) {
|
| | | return extractMapper.getExtractSucceedRecord((page-1)*pageSize, pageSize, uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countExtractSucceedRecord(Long uid) {
|
| | | Long count = extractMapper.countExtractSucceedRecord(uid);
|
| | | return count== null? 0 : count;
|
| | | }
|
| | | }
|
| | |
| | | msgMoneyDetailMapper.setMsgReadByUid(uid);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public MsgMoneyDetail selectByPrimaryKey(Long id) {
|
| | | return msgMoneyDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgMoneyDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_MONEY);
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void deleteByPidAndType(Long rid, String type) {
|
| | | MsgExtra msgExtra = msgExtraMapper.getByRidAndType(rid, type);
|
| | | if (msgExtra == null) {
|
| | | return;
|
| | | }
|
| | | msgExtraMapper.deleteByPrimaryKey(msgExtra.getId());
|
| | | }
|
| | | |
| | | }
|
| | |
| | | msgOtherDetailMapper.setMsgReadByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public MsgOtherDetail selectByPrimaryKey(Long id) {
|
| | | return msgOtherDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgOtherDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_OTHER);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.order; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.order.OrderMoneyDailyCountDao; |
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount; |
| | | import com.yeshi.fanli.service.inter.order.OrderMoneyDailyCountService; |
| | | import com.yeshi.fanli.util.StringUtil; |
| | | import com.yeshi.fanli.util.TimeUtil; |
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService; |
| | | |
| | | @Service |
| | | public class OrderMoneyDailyCountServiceImpl implements OrderMoneyDailyCountService { |
| | | |
| | | @Resource |
| | | private OrderMoneyDailyCountDao orderMoneyDailyCountDao; |
| | | |
| | | |
| | | @Override |
| | | @RequestSerializableByKeyService(key = "#record.uid") |
| | | public void saveDailyCount(OrderMoneyDailyCount record) { |
| | | if (record.getUid() == null || record.getCountDay() == null || record.getSourceType() == null) { |
| | | return; // 参数不全 |
| | | } |
| | | String gernalTime = TimeUtil.getGernalTime(record.getCountDay().getTime()); |
| | | String id = StringUtil.Md5(record.getUid() + record.getSourceType().name() + gernalTime); |
| | | |
| | | // id |
| | | record.setId(id); |
| | | // 统计日期-年月日 |
| | | record.setCountDay(new Date(TimeUtil.convertDateToTemp(gernalTime))); |
| | | |
| | | SimpleDateFormat formatMonth = new SimpleDateFormat("yyyy-MM"); |
| | | record.setYearMonth(formatMonth.format(record.getCountDay()) ); |
| | | |
| | | OrderMoneyDailyCount dailyCount = orderMoneyDailyCountDao.getById(id); |
| | | if (dailyCount == null) { |
| | | // 选择性更新 |
| | | orderMoneyDailyCountDao.save(record); |
| | | } else { |
| | | // 选择性插入 |
| | | orderMoneyDailyCountDao.updateSelective(record); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderMoneyDailyCount> query(Long uid, Date minDay, Date maxDay) { |
| | | return orderMoneyDailyCountDao.query(uid, minDay, maxDay); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderMoneyDailyCount> sumGroupBySourceType(Long uid, Date minDay, Date maxDay) { |
| | | return orderMoneyDailyCountDao.sumGroupBySourceType(uid, minDay, maxDay); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderMoneyDailyCount> sumTeamGroupBySourceType(Long uid, Date minDay, Date maxDay) { |
| | | return orderMoneyDailyCountDao.sumTeamGroupBySourceType(uid, minDay, maxDay); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderMoneyDailyCount> sumGroupByCountDay(Long uid, Date minDay, Date maxDay) { |
| | | return orderMoneyDailyCountDao.sumGroupByCountDay(uid, minDay, maxDay); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderMoneyDailyCount> sumGroupByYearMonth(Long uid, Date minDay, Date maxDay) { |
| | | return orderMoneyDailyCountDao.sumGroupByYearMonth(uid, minDay, maxDay); |
| | | } |
| | | } |
| | |
| | | return msgOrderDetailMapper.listByOrderId(orderId);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public MsgOrderDetail selectByPrimaryKey(Long id) {
|
| | | return msgOrderDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgOrderDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_ORDER);
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.push.PushGoodsMapper;
|
| | | 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.push.PushGoods;
|
| | | import com.yeshi.fanli.entity.push.PushGoodsGroup;
|
| | |
| | | import com.yeshi.fanli.exception.push.PushException;
|
| | | import com.yeshi.fanli.exception.push.PushGoodsException;
|
| | | 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.push.PushGoodsGroupService;
|
| | | import com.yeshi.fanli.service.inter.push.PushGoodsService;
|
| | |
| | |
|
| | | @Resource
|
| | | private PushGoodsGroupService pushGoodsGroupService;
|
| | | |
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public int deleteByPrimaryKey(Long id) throws PushGoodsException {
|
| | |
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void save(PushGoods record, List<Long> goodsIds) throws PushGoodsException, Exception {
|
| | |
|
| | | // 定时时间
|
| | | Boolean timeTask = record.isTimeTask();
|
| | | if (timeTask != null && timeTask) {
|
| | | String controlTime_str = record.getControlTime_str();
|
| | | if (controlTime_str == null || controlTime_str.trim().length() == 0) {
|
| | | throw new PushGoodsException(1, "预设时间不能为空");
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(record.getControlTime_str())) {
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
| | | controlTime_str = controlTime_str.replaceAll("T", " ");
|
| | | record.setControlTime(format.parse(controlTime_str));
|
| | | } else {
|
| | | record.setControlTime(null);
|
| | | record.setControlTime(format.parse(record.getControlTime_str().replaceAll("T", " ")));
|
| | | }
|
| | |
|
| | | record.setIsPush(PushGoods.STATE_INIT);
|
| | | record.setType(PushGoods.TYPE_GOODS);
|
| | |
|
| | | boolean isAdd = false;
|
| | | // 推送id
|
| | |
| | |
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void saveGoodsInfo(boolean isAdd, Long pushId, List<Long> goodsIds) throws Exception {
|
| | |
|
| | | if (goodsIds == null || goodsIds.size() == 0) {
|
| | | if (!isAdd) {
|
| | | pushGoodsGroupService.deleteByPushId(pushId);
|
| | |
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | /* 修改时删除 部分 */
|
| | | if (!isAdd) {
|
| | |
|
| | | List<Long> listdelete = new ArrayList<Long>();
|
| | |
|
| | | List<PushGoodsGroup> listGroup = pushGoodsGroupService.selectByPushId(pushId);
|
| | |
|
| | | if (listGroup != null && listGroup.size() > 0) {
|
| | | for (PushGoodsGroup group : listGroup) {
|
| | | Long groupId = group.getId();
|
| | |
| | | pushGoodsGroup.setCommonGoods(new CommonGoods(cid));
|
| | | listAdd.add(pushGoodsGroup);
|
| | | }
|
| | | |
| | | pushGoodsGroupService.insertBatch(listAdd);
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void saveInfo(PushGoods record) throws PushGoodsException, Exception {
|
| | | if (StringUtil.isNullOrEmpty(record.getOtherId())) {
|
| | | throw new PushGoodsException(1, "相关内容ID不能为空");
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(record.getTitle())) {
|
| | | throw new PushGoodsException(1, "标题不能为空");
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(record.getContent())) {
|
| | | throw new PushGoodsException(1, "内容不能为空");
|
| | | }
|
| | | |
| | | if (record.getType() == null) {
|
| | | throw new PushGoodsException(1, "推送类型不能为空");
|
| | | }
|
| | | |
| | | if (record.getType() == PushGoods.TYPE_ACTIVITY) {
|
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(record.getOtherId());
|
| | | if (goodsEvaluate == null) {
|
| | | throw new PushGoodsException(1, "发圈活动信息不存在");
|
| | | }
|
| | | |
| | | if (goodsEvaluate.getType() != EvaluateEnum.activity) {
|
| | | throw new PushGoodsException(1, "该内容非发圈活动信息");
|
| | | }
|
| | | |
| | | String picUrl = null;
|
| | | List<ImgInfo> imgList = goodsEvaluate.getImgList();
|
| | | if (imgList != null && imgList.size() > 0) {
|
| | | for (ImgInfo imgInfo: imgList) {
|
| | | if (imgInfo.getType() == ImgEnum.img && !StringUtil.isNullOrEmpty(imgInfo.getUrl())) {
|
| | | picUrl = imgInfo.getUrl();
|
| | | }
|
| | | }
|
| | | }
|
| | | if (StringUtil.isNullOrEmpty(picUrl)) {
|
| | | throw new PushGoodsException(1, "该非发圈活动无图片信息");
|
| | | }
|
| | | record.setPicture(picUrl);
|
| | | }
|
| | | |
| | | |
| | | // 定时时间
|
| | | if (StringUtil.isNullOrEmpty(record.getControlTime_str())) {
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
| | | record.setControlTime(format.parse(record.getControlTime_str().replaceAll("T", " ")));
|
| | | }
|
| | | // 浏览数量随机
|
| | | if (record.getScanNum() == null || record.getScanNum() <= 0)
|
| | | record.setScanNum((int) (Math.random() * 5000) + 1000);
|
| | | |
| | | record.setIsPush(PushGoods.STATE_INIT);
|
| | | record.setAlertTitle(record.getTitle());
|
| | | record.setAlertContent(record.getContent());
|
| | | |
| | | Long id = record.getId();
|
| | | if (id == null) {
|
| | | record.setCreateTime(new Date());
|
| | | pushGoodsMapper.insert(record);
|
| | | } else {
|
| | | PushGoods current = pushGoodsMapper.selectByPrimaryKey(id);
|
| | | if (current == null) {
|
| | | throw new PushGoodsException(1, "该记录已不存在");
|
| | | }
|
| | | record.setCreateTime(current.getCreateTime());
|
| | | record.setScanNum(current.getScanNum());
|
| | | record.setUpdateTime(new Date());
|
| | | pushGoodsMapper.updateByPrimaryKey(record);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | |
| | |
|
| | | @Override
|
| | | public void executePush(PushGoods pushGoods) throws Exception, PushGoodsException, PushException {
|
| | |
|
| | | Long id = pushGoods.getId();
|
| | |
|
| | | String alertTitle = pushGoods.getAlertTitle();
|
| | | String alertContent = pushGoods.getAlertContent();
|
| | | if (StringUtil.isNullOrEmpty(alertTitle) || StringUtil.isNullOrEmpty(alertContent)) {
|
| | | if (StringUtil.isNullOrEmpty(pushGoods.getTitle()) || StringUtil.isNullOrEmpty(pushGoods.getContent())) {
|
| | | throw new PushGoodsException(1, "推送标题及内容不能为空");
|
| | | }
|
| | |
|
| | | |
| | | if (StringUtil.isNullOrEmpty(pushGoods.getVersions())) {
|
| | | throw new PushGoodsException(1, "推送版本不能为空");
|
| | | }
|
| | | |
| | | if (pushGoods.getType() == null || pushGoods.getType() == PushGoods.TYPE_GOODS) {
|
| | | executePushGoods(pushGoods); // 推送商品
|
| | | } else if (pushGoods.getType() == PushGoods.TYPE_ACTIVITY) {
|
| | | executePushActivity(pushGoods); // 推送活动
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 推送活动
|
| | | * @param pushGoods
|
| | | * @throws Exception
|
| | | * @throws PushGoodsException
|
| | | * @throws PushException
|
| | | */
|
| | | private void executePushActivity(PushGoods pushGoods) throws Exception, PushGoodsException, PushException {
|
| | | String otherId = pushGoods.getOtherId();
|
| | | if (StringUtil.isNullOrEmpty(otherId)) {
|
| | | throw new PushGoodsException(1, "活动id不能为空");
|
| | | }
|
| | | |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(otherId);
|
| | | if (goodsEvaluate == null) {
|
| | | throw new PushGoodsException(1, "发圈活动信息不存在");
|
| | | }
|
| | | |
| | | if (goodsEvaluate.getType() != EvaluateEnum.activity) {
|
| | | throw new PushGoodsException(1, "该内容非发圈活动信息");
|
| | | }
|
| | | |
| | | String picUrl = null;
|
| | | List<ImgInfo> imgList = goodsEvaluate.getImgList();
|
| | | if (imgList != null && imgList.size() > 0) {
|
| | | for (ImgInfo imgInfo: imgList) {
|
| | | if (imgInfo.getType() == ImgEnum.img && !StringUtil.isNullOrEmpty(imgInfo.getUrl())) {
|
| | | picUrl = imgInfo.getUrl();
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(picUrl)) {
|
| | | throw new PushGoodsException(1, "该非发圈活动无图片信息");
|
| | | }
|
| | | |
| | | |
| | | String versions = pushGoods.getVersions();
|
| | | JSONObject json = JSONObject.fromObject(versions);
|
| | | |
| | | String versionsIOS = json.getString("IOS");
|
| | | List<String> listIOS = new ArrayList<String>();
|
| | | if (versionsIOS != null && versionsIOS.trim().length() > 0) {
|
| | | if (versionsIOS.contains("全推")) {
|
| | | listIOS = null;
|
| | | } else {
|
| | | listIOS = Arrays.asList(versionsIOS.split(","));
|
| | | }
|
| | | }
|
| | | |
| | | List<String> listAndroid = new ArrayList<String>();
|
| | | String versionsAndroid = json.getString("Android");
|
| | | if (versionsAndroid != null && versionsAndroid.trim().length() > 0) {
|
| | | if (versionsAndroid.contains("全推")) {
|
| | | listAndroid = null;
|
| | | } else {
|
| | | listAndroid = Arrays.asList(versionsAndroid.split(","));
|
| | | }
|
| | | }
|
| | | |
| | | String url = configService.get(ConfigKeyEnum.pushActivityLink.getKey());
|
| | | if (StringUtil.isNullOrEmpty(url)) {
|
| | | throw new PushGoodsException(1, "推送页面链接不存在");
|
| | | }
|
| | | url = url + "?id=" + pushGoods.getId() + "&otherId=" + pushGoods.getOtherId();
|
| | | |
| | | // h活动全推
|
| | | pushService.pushUrl(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url, listIOS, listAndroid);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 推送商品
|
| | | * @param pushGoods
|
| | | * @throws Exception
|
| | | * @throws PushGoodsException
|
| | | * @throws PushException
|
| | | */
|
| | | private void executePushGoods(PushGoods pushGoods) throws Exception, PushGoodsException, PushException {
|
| | | Long id = pushGoods.getId();
|
| | | List<PushGoodsGroup> goodsList = pushGoodsGroupService.getAllInfoByPushId(id);
|
| | | if (goodsList == null || goodsList.size() == 0) {
|
| | | throw new PushGoodsException(1, "推送无商品,请完善数据");
|
| | |
| | |
|
| | | Long goodsId = commonGoods.getGoodsId();
|
| | | String url = "https://item.taobao.com/item.htm?id=" + goodsId;
|
| | | |
| | | pushService.pushGoods(pushGoods.getUid(), alertTitle, alertContent, url,listIOS, listAndroid);
|
| | | |
| | | pushService.pushGoods(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url,listIOS, listAndroid);
|
| | | } else {
|
| | | /* 多个商品推送 */
|
| | | String url = configService.get(ConfigKeyEnum.pushGoodsDetails.getKey());
|
| | |
| | | }
|
| | | // 生成链接
|
| | | url = url + "?id=" + id;
|
| | |
|
| | | pushService.pushUrl(pushGoods.getUid(), alertTitle, alertContent, url, listIOS, listAndroid);
|
| | | pushService.pushUrl(pushGoods.getUid(), pushGoods.getTitle(), pushGoods.getContent(), url, listIOS, listAndroid);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserCustomSettingsMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.UserCustomSettings;
|
| | |
| | | private UserCustomSettingsMapper userCustomSettingsMapper;
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void saveModuleState(Long uid, String type, Integer state) throws UserCustomSettingsException {
|
| | | if (uid == null || type == null || state == null || state > 1 || state < 0) {
|
| | | throw new UserCustomSettingsException(1, "传递参数不正确");
|
| | |
| | | } else if (type.equals(UserSettingTypeEnum.openSpreadHongBao.name())) {
|
| | | mineTypeNum = UserSettingTypeEnum.openSpreadHongBao;
|
| | | } else if (type.equals(UserSettingTypeEnum.noDisplayPhoneNum.name())) {
|
| | | mineTypeNum = UserSettingTypeEnum.noDisplayPhoneNum;
|
| | | mineTypeNum = UserSettingTypeEnum.noDisplayPhoneNum;
|
| | | } else {
|
| | | throw new UserCustomSettingsException(1, "参数类型不匹配");
|
| | | }
|
| | |
| | | settings.setCreateTime(new Date());
|
| | | userCustomSettingsMapper.insertSelective(settings);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | if (uid == null) {
|
| | | throw new UserCustomSettingsException(1, "uid不能为空");
|
| | | }
|
| | |
|
| | | return userCustomSettingsMapper.getSettingsByUid(uid);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public UserCustomSettings getSettingsByUidAndType(Long uid, String type) throws UserCustomSettingsException {
|
| | |
|
| | | if (uid == null || type == null || type.trim().length() == 0) {
|
| | | throw new UserCustomSettingsException(1, "传递的参数不能为空");
|
| | | }
|
| | |
| | | } else if (typeEnum.equals(UserSettingTypeEnum.openSpreadHongBao)) {
|
| | | userSettingsVO.setOpenSpreadHongBao(state);
|
| | | } else if (typeEnum.equals(UserSettingTypeEnum.noDisplayPhoneNum)) {
|
| | | userSettingsVO.setOpenSpreadHongBao(state);
|
| | | userSettingsVO.setNoDisplayPhoneNum(state);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public List<UserCustomSettings> listByUidListAndTypeAndState(List<Long> uidList, String type, Integer state) {
|
| | | return userCustomSettingsMapper.listByUidListAndTypeAndState(uidList, type, state);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public boolean validateDisplayPhoneByUid(Long uid) {
|
| | | UserCustomSettings settings = userCustomSettingsMapper.getSettingsByUidAndType(uid,
|
| | | UserSettingTypeEnum.noDisplayPhoneNum.name());
|
| | | if (settings != null && settings.getState() != null && settings.getState() == 1) {
|
| | | return false;
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import com.aliyun.openservices.ons.api.Message;
|
| | | import com.aliyun.openservices.ons.api.Producer;
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserRankRecordMapper;
|
| | | import com.yeshi.fanli.dto.mq.user.UserTopicTagEnum;
|
| | |
| | |
|
| | | userActivedRecordService.add(new UserActivedRecord(uid));
|
| | |
|
| | | // if (!Constant.IS_TEST) { // 发送激活成功消息
|
| | | if (!Constant.IS_TEST) { // 发送激活成功消息
|
| | | Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.inviteCodeActive,
|
| | | new InviteCodeActiveMQMsg(uid, new Date()));
|
| | | producer.send(message);
|
| | | // }
|
| | | }
|
| | |
|
| | | return inviteCode;
|
| | | }
|
| | |
| | | return inviter;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateAutoExtract(Integer days) {
|
| | | userInfoExtraMapper.updateAutoExtract(days);
|
| | | }
|
| | |
|
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | |
| | | userMsgReadStateService.addInviteMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public MsgInviteDetail selectByPrimaryKey(Long id) {
|
| | | return msgInviteDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgInviteDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_INVITE);
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.invite; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.yeshi.fanli.dao.user.invite.TeamFansInfoDao; |
| | | import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO; |
| | | import com.yeshi.fanli.entity.bus.user.TeamFansInfo; |
| | | import com.yeshi.fanli.service.inter.user.invite.TeamFansInfoService; |
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce; |
| | | |
| | | @Service |
| | | public class TeamFansInfoServiceImpl implements TeamFansInfoService { |
| | | |
| | | @Resource |
| | | private TeamFansInfoDao teamFansInfoDao; |
| | | |
| | | @Resource |
| | | private ThreeSaleSerivce threeSaleSerivce; |
| | | |
| | | @Override |
| | | public void save(TeamFansInfo record) { |
| | | teamFansInfoDao.save(record); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateMemoName(Long workerId, int type, String memoName) { |
| | | teamFansInfoDao.updateMemoName(workerId, type, memoName); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTags(Long workerId, int type, String tags) { |
| | | teamFansInfoDao.updateTags(workerId, type, tags); |
| | | } |
| | | |
| | | @Override |
| | | public void updateNickName(Long workerId, String nickName) { |
| | | teamFansInfoDao.updateNickName(workerId, nickName); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateStateValid(Long workerId, boolean stateValid) { |
| | | teamFansInfoDao.updateStateValid(workerId, stateValid); |
| | | } |
| | | |
| | | @Override |
| | | public void updateTaobaoBind(Long workerId, boolean taobaoBind) { |
| | | teamFansInfoDao.updateTaobaoBind(workerId, taobaoBind); |
| | | } |
| | | |
| | | @Override |
| | | public void updateWeixinBind(Long workerId, boolean weixinBind) { |
| | | teamFansInfoDao.updateWeixinBind(workerId, weixinBind); |
| | | } |
| | | |
| | | @Override |
| | | public void updateActiveTime(Long workerId, Date activeTime) { |
| | | teamFansInfoDao.updateActiveTime(workerId, activeTime); |
| | | } |
| | | |
| | | @Override |
| | | public void updateFansNum(Long workerId) { |
| | | long firstTeam = threeSaleSerivce.countFirstTeam(workerId); |
| | | long secondTeam = threeSaleSerivce.countSecondTeam(workerId); |
| | | int fansNum = (int) (firstTeam + secondTeam); |
| | | teamFansInfoDao.updateFansNum(workerId, fansNum); |
| | | } |
| | | |
| | | @Override |
| | | public void updateIncome(Long workerId, BigDecimal income) { |
| | | teamFansInfoDao.updateIncome(workerId, income); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<TeamFansInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO) { |
| | | return teamFansInfoDao.query(start, count, type, uid, focusDTO); |
| | | } |
| | | |
| | | @Override |
| | | public long count(int type, Long uid, ThreeSaleFocusDTO focusDTO) { |
| | | return teamFansInfoDao.count(type, uid, focusDTO); |
| | | } |
| | | |
| | | @Override |
| | | public TeamFansInfo getbyWorkerId(Long workerId) { |
| | | return teamFansInfoDao.getbyWorkerId(workerId); |
| | | } |
| | | } |
| | |
| | |
|
| | | @Override
|
| | | public JSONObject getMyFirstTeam(long start, int count, Long uid) {
|
| | | List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid);
|
| | | List<ThreeSale> list = threeSaleMapper.listFirstTeam(start, count, uid,null);
|
| | | if (list == null) {
|
| | | list = new ArrayList<ThreeSale>();
|
| | | }
|
| | | long countTotal = threeSaleMapper.countFirstTeam(uid);
|
| | | long countTotal = threeSaleMapper.countFirstTeam(uid, null);
|
| | | return organizeTeam(countTotal, list);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public JSONObject getMySecondTeam(long start, int count, Long uid) {
|
| | | List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid);
|
| | | List<ThreeSale> list = threeSaleMapper.listSecondTeam(start, count, uid, null);
|
| | | if (list == null) {
|
| | | list = new ArrayList<ThreeSale>();
|
| | | }
|
| | | long countTotal = threeSaleMapper.countSecondTeam(uid);
|
| | | long countTotal = threeSaleMapper.countSecondTeam(uid, null);
|
| | | return organizeTeam(countTotal, list);
|
| | | }
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listFirstTeam(long start, int count, Long uid) {
|
| | | return threeSaleMapper.listFirstTeam(start, count, uid);
|
| | | return threeSaleMapper.listFirstTeam(start, count, uid, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listSecondTeam(long start, int count, Long uid) {
|
| | | return threeSaleMapper.listSecondTeam(start, count, uid);
|
| | | return threeSaleMapper.listSecondTeam(start, count, uid, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listFirstTeam(long start, int count, Long uid, List<Long> listId) {
|
| | | return threeSaleMapper.listFirstTeam(start, count, uid, listId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ThreeSale> listSecondTeam(long start, int count, Long uid, List<Long> listId) {
|
| | | return threeSaleMapper.listSecondTeam(start, count, uid, listId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countFirstTeam(Long uid) {
|
| | | return threeSaleMapper.countFirstTeam(uid);
|
| | | return threeSaleMapper.countFirstTeam(uid, null);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSecondTeam(Long uid) {
|
| | | return threeSaleMapper.countSecondTeam(uid);
|
| | | return threeSaleMapper.countSecondTeam(uid, null);
|
| | | }
|
| | | |
| | | @Override
|
| | | public long countFirstTeam(Long uid, List<Long> listId) {
|
| | | return threeSaleMapper.countFirstTeam(uid, listId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSecondTeam(Long uid, List<Long> listId) {
|
| | | return threeSaleMapper.countSecondTeam(uid, listId);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countFirstTeamByDate(Long uid, int dayType) {
|
| | | return threeSaleMapper.countFirstTeamByDate(uid, dayType);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long countSecondTeamByDate(Long uid, int dayType) {
|
| | | return threeSaleMapper.countSecondTeamByDate(uid, dayType);
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public ThreeSale selectLatestByWorkerIdAndState(Long workerId, int state) {
|
| | | return threeSaleMapper.selectLatestByWorkerIdAndState(workerId, state);
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | int countTeam2 = 0;
|
| | | List<ThreeSale> listSecondTeam = threeSaleSerivce.listSecondTeam(0, Integer.MAX_VALUE, superUid);
|
| | | List<ThreeSale> listSecondTeam = threeSaleSerivce.listSecondTeam(0, Integer.MAX_VALUE, superUid);
|
| | | if (listSecondTeam != null && listSecondTeam.size() > 0) {
|
| | | for (ThreeSale team: listSecondTeam) {
|
| | | if (team.getWorker() == null || team.getWorker().getId() == null) {
|
| | |
| | |
|
| | | userMsgReadStateService.addAccountMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public MsgAccountDetail selectByPrimaryKey(Long id) {
|
| | | return msgAccountDetailMapper.selectByPrimaryKey(id);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void deleteByPrimaryKey(Long id) {
|
| | | msgAccountDetailMapper.deleteByPrimaryKey(id);
|
| | | msgExtraService.deleteByPidAndType(id, MsgExtra.MSG_TYPE_ACCOUNT);
|
| | | }
|
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.invite.TeamDailyRecordDao;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.vip.TeamDailyRecordService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
|
| | |
|
| | | @Service
|
| | | public class TeamDailyRecordServiceImpl implements TeamDailyRecordService {
|
| | |
|
| | | @Resource
|
| | | private TeamDailyRecordDao TeamDailyRecordDao;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | |
|
| | | @Override
|
| | | @RequestSerializableByKeyService(key = "#uid")
|
| | | public void addDailyRecord(Long uid) {
|
| | | // 重新统计队员等级数量
|
| | | recountRecord(uid);
|
| | |
|
| | | // 统计上级队员数量
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
|
| | | if (threeSale != null) {
|
| | | recountRecord(threeSale.getBoss().getId());
|
| | | }
|
| | | }
|
| | |
|
| | | private void recountRecord(Long uid) {
|
| | | try {
|
| | | // 直接粉丝
|
| | | int firstCount = (int) threeSaleSerivce.countFirstTeamByDate(uid, 1);
|
| | | // 间接粉丝
|
| | | int secondCount = (int) threeSaleSerivce.countSecondTeamByDate(uid, 1);
|
| | |
|
| | | int secondBeyond = 0;
|
| | | |
| | | // 每天只记录一次统计
|
| | | String time = TimeUtil.getGernalTime(java.lang.System.currentTimeMillis());
|
| | | String id = StringUtil.Md5(uid + "#" + time);
|
| | | TeamDailyRecord record = TeamDailyRecordDao.getById(id);
|
| | | // if (record == null) {
|
| | | // record = new TeamDailyRecord();
|
| | | // } else if (record.getSecondCount() != null) {
|
| | | // secondBeyond = record.getSecondCount();
|
| | | // }
|
| | | //
|
| | | // record.setId(id);
|
| | | // record.setUid(uid);
|
| | | // record.setFirstCount(firstCount);
|
| | | // record.setSecondCount(secondCount);
|
| | | // record.setSecondBeyond(secondBeyond);
|
| | | // record.setStatisticDay(TimeUtil.parse(time));
|
| | | // record.setUpdateTime(new Date());
|
| | | TeamDailyRecordDao.save(record);
|
| | | } catch (Exception e) {
|
| | | e.getSuppressed();
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<TeamDailyRecord> getbyUid(Long uid) {
|
| | | return TeamDailyRecordDao.getbyUid(uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<TeamDailyRecord> getbyUid(Long uid, Date minTime) {
|
| | | return TeamDailyRecordDao.getbyUid(uid, minTime);
|
| | | }
|
| | | |
| | | }
|
| | |
| | |
|
| | | for (UserInviteValidRecord ts : list) {
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorkerId());
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | if (level == UserLevelEnum.daRen || level == UserLevelEnum.normalVIP) {
|
| | | daRenFirstCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highFirstCount++;
|
| | |
| | |
|
| | | for (UserInviteValidRecord ts : list) {
|
| | | UserLevelEnum level = userLevelManager.getUserLevel(ts.getWorkerId());
|
| | | if (level == UserLevelEnum.daRen) {
|
| | | if (level == UserLevelEnum.daRen || level == UserLevelEnum.normalVIP) {
|
| | | daRenSecondCount++;
|
| | | } else if (level == UserLevelEnum.highVIP) {
|
| | | highSecondCount++;
|
| | |
| | | public long countMyDirectOrderByCashArrival(Long uid, BigDecimal payment);
|
| | |
|
| | |
|
| | | public BigDecimal geBonusByuid(Long uid, Integer dateType, Integer hbType, Integer moneyState); |
| | | public BigDecimal geBonusByuid(Long uid, Integer dateType, Integer hbType, Integer moneyState);
|
| | |
|
| | | /**
|
| | | * 统计近日到账收入金额
|
| | | * @param uid
|
| | | * @param day
|
| | | * @return
|
| | | */
|
| | | public BigDecimal sumMoneyArrivalByUidAndNearDay(Long uid, int day);
|
| | |
|
| | | /**
|
| | | * 统计收货金额
|
| | | * @param uid
|
| | | * @param minDate
|
| | | * @param maxDate
|
| | | * @return
|
| | | */
|
| | | public BigDecimal sumMoneyBySettleTimeAndUid(Long uid, Date minDate, Date maxDate);
|
| | |
|
| | | |
| | | /**
|
| | | * 180天内未收货的金额
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public BigDecimal sumMoneyByANotSettleAndUid(Long uid); |
| | |
|
| | | }
|
| | |
| | | * @param state |
| | | * @return |
| | | */ |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType); |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType, String typeEnum); |
| | | |
| | | public long count(String key, Integer state,int dynamicType); |
| | | public long count(String key, Integer state,int dynamicType, String typeEnum); |
| | | |
| | | |
| | | /** |
| | |
| | | public void saveCurrencyCoupon(String pid, int kind, CommentInfo commentInfo) throws GoodsEvaluateException, Exception; |
| | | |
| | | |
| | | public void saveActivityPic(String pid, ImgInfo imgInfo, MultipartHttpServletRequest fileRequest) |
| | | public void saveActivityPic(String pid, ImgInfo imgInfo, String picUrls, MultipartHttpServletRequest fileRequest) |
| | | throws GoodsEvaluateException, Exception; |
| | | |
| | | |
New file |
| | |
| | | package com.yeshi.fanli.service.inter.homemodule;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | |
|
| | | /**
|
| | | * 专题额外
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface SpecialExtraService{
|
| | |
|
| | | /**
|
| | | * 保存信息
|
| | | * @param record
|
| | | */
|
| | | public void saveExtraInfo(SpecialExtra record) throws SpecialException;
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | public SpecialExtra selectByPrimaryKey(Long id);
|
| | | |
| | | }
|
| | |
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialExtra;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialException;
|
| | | import com.yeshi.fanli.vo.homemodule.SpecialVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | | public Special selectByPrimaryKey(Long id);
|
| | |
|
| | |
|
| | | public List<Special> listQueryByCard(long start, int count, Long card, String key, Integer sex);
|
| | | public List<SpecialVO> listQueryByCard(long start, int count, Long card, String key, Integer sex);
|
| | |
|
| | | public long countlistQueryByCard(Long card, String key, Integer sex);
|
| | |
|
| | |
| | | * @throws SpecialException
|
| | | * @throws Exception
|
| | | */
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record, String jumpType) throws SpecialException, Exception;
|
| | | public void saveObject(MultipartFile file, MultipartFile file2, MultipartFile file3, Special record, String jumpType, SpecialExtra extra) throws SpecialException, Exception;
|
| | |
|
| | | /**
|
| | | * 更换顺序
|
| | |
| | | public List<String> getAutoExtractOpenIdsTo1212() throws Exception;
|
| | |
|
| | | public List<UserInfo> preAutoUserTo1212() throws Exception;
|
| | |
|
| | | /**
|
| | | * 获取提现成功记录
|
| | | * @param page
|
| | | * @param pageSize
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<Extract> getExtractSucceedRecord(int page, int pageSize, Long uid);
|
| | |
|
| | | /**
|
| | | * 统计提现成功记录
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countExtractSucceedRecord(Long uid);
|
| | |
|
| | | }
|
| | |
| | | * @param uid
|
| | | */
|
| | | public void readMsgByUid(Long uid);
|
| | |
|
| | | public MsgMoneyDetail selectByPrimaryKey(Long id);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | | }
|
| | |
| | |
|
| | | public void addMsgExtra(long rid, String content, String type);
|
| | |
|
| | | /**
|
| | | * 根据上级id类型删除
|
| | | * @param rid
|
| | | * @param type
|
| | | */
|
| | | public void deleteByPidAndType(Long rid, String type);
|
| | |
|
| | | }
|
| | |
| | | * @param uid
|
| | | */
|
| | | public void readMsgByUid(Long uid);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | |
|
| | | public MsgOtherDetail selectByPrimaryKey(Long id);
|
| | | }
|
| | |
| | | */ |
| | | public Integer countOderByUidAndLess10(Long uid); |
| | | |
| | | /** |
| | | * 统计所有订单 |
| | | * |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime, String endTime, |
| | | int sourceType) throws Exception; |
| | | |
| | | |
| | | public Long countOrderBySourceTypeAndDay(int source, String preDay); |
| | |
| | | * @return |
| | | */ |
| | | public List<Long> getUidByValidOrderByDay(String preDay); |
| | | |
| | | |
| | | /** |
| | | * 统计最近day天有效订单数量 |
| | | * @param uid |
| | | * @param source |
| | | * @param day |
| | | * @return |
| | | */ |
| | | public long countOrderBySourceAndNearDay(Long uid, int source, int day); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.service.inter.order; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.yeshi.fanli.entity.order.OrderMoneyDailyCount; |
| | | |
| | | public interface OrderMoneyDailyCountService { |
| | | |
| | | /** |
| | | * 查询 |
| | | * @param uid |
| | | * @param minDay 可为空 |
| | | * @param maxDay 可为空 |
| | | * @return |
| | | */ |
| | | public List<OrderMoneyDailyCount> query(Long uid, Date minDay, Date maxDay); |
| | | |
| | | /** |
| | | * 保存-更新信息 |
| | | * @param record |
| | | */ |
| | | public void saveDailyCount(OrderMoneyDailyCount record); |
| | | |
| | | |
| | | /** |
| | | * 根据来源渠道进行分组统计数据 |
| | | * @param uid |
| | | * @param minDay |
| | | * @param maxDay |
| | | * @return |
| | | */ |
| | | public List<OrderMoneyDailyCount> sumGroupBySourceType(Long uid, Date minDay, Date maxDay); |
| | | |
| | | /** |
| | | * 根据来源分组统计团队信息 |
| | | * @param uid |
| | | * @param minDay |
| | | * @param maxDay |
| | | * @return |
| | | */ |
| | | public List<OrderMoneyDailyCount> sumTeamGroupBySourceType(Long uid, Date minDay, Date maxDay); |
| | | |
| | | |
| | | /** |
| | | * 统计每天 |
| | | * @param uid |
| | | * @param minDay |
| | | * @param maxDay |
| | | * @return |
| | | */ |
| | | public List<OrderMoneyDailyCount> sumGroupByCountDay(Long uid, Date minDay, Date maxDay); |
| | | |
| | | /** |
| | | * 统计每月 |
| | | * @param uid |
| | | * @param minDay |
| | | * @param maxDay |
| | | * @return |
| | | */ |
| | | public List<OrderMoneyDailyCount> sumGroupByYearMonth(Long uid, Date minDay, Date maxDay); |
| | | |
| | | } |
| | |
| | | * @param uid
|
| | | */
|
| | | public void readMsgByUid(Long uid);
|
| | |
|
| | | public MsgOrderDetail selectByPrimaryKey(Long id);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | | }
|
| | |
| | | * @throws PushException
|
| | | */
|
| | | public void handPush(Long id) throws Exception, PushGoodsException, PushException;
|
| | |
|
| | | /**
|
| | | * 保存信息
|
| | | * @param record
|
| | | * @throws PushGoodsException
|
| | | * @throws Exception
|
| | | */
|
| | | public void saveInfo(PushGoods record) throws PushGoodsException, Exception;
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public List<UserCustomSettings> listByUidListAndTypeAndState(List<Long> uidList, String type, Integer state);
|
| | |
|
| | | /**
|
| | | * 是否对外显示手机号
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public boolean validateDisplayPhoneByUid(Long uid);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.UserInviteLevelEnum;
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | |
| | | */
|
| | | public void updateActiveTime(Long uid, Date date);
|
| | |
|
| | | /**
|
| | | * 开启自动提现: 更新超过期限的
|
| | | * |
| | | * @param days
|
| | | */
|
| | | public void updateAutoExtract(@Param("days") Integer days);
|
| | |
|
| | | /**
|
| | | * 返回用户所有相关额外信息
|
| | |
| | | public void deleteByThreeSale(ThreeSale sale);
|
| | |
|
| | | public void insertSelective(MsgInviteDetail detail);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | |
|
| | | public MsgInviteDetail selectByPrimaryKey(Long id);
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.invite;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.user.ThreeSaleFocusDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.TeamFansInfo;
|
| | |
|
| | | public interface TeamFansInfoService {
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * @param start
|
| | | * @param count
|
| | | * @param type
|
| | | * @param uid
|
| | | * @param focusDTO
|
| | | * @return
|
| | | */
|
| | | public List<TeamFansInfo> query(int start, int count, int type, Long uid, ThreeSaleFocusDTO focusDTO);
|
| | |
|
| | | public long count(int type, Long uid, ThreeSaleFocusDTO focusDTO);
|
| | |
|
| | | /**
|
| | | * 根据下级id查询
|
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | public TeamFansInfo getbyWorkerId(Long workerId);
|
| | |
|
| | | public void updateMemoName(Long workerId, int type, String memoName);
|
| | |
|
| | | public void updateTags(Long workerId, int type, String tags);
|
| | |
|
| | | public void updateNickName(Long workerId, String nickName);
|
| | |
|
| | | public void updateStateValid(Long workerId, boolean stateValid);
|
| | |
|
| | | public void updateTaobaoBind(Long workerId, boolean taobaoBind);
|
| | |
|
| | | public void updateWeixinBind(Long workerId, boolean weixinBind);
|
| | |
|
| | | public void updateActiveTime(Long workerId, Date activeTime);
|
| | |
|
| | | public void updateFansNum(Long workerId);
|
| | |
|
| | | public void updateIncome(Long workerId, BigDecimal income);
|
| | |
|
| | | /**
|
| | | * 添加
|
| | | * @param record
|
| | | */
|
| | | public void save(TeamFansInfo record);
|
| | |
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listSecondTeam(long start, int count, Long uid);
|
| | | |
| | | /**
|
| | | * 一级队员
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listFirstTeam(long start, int count, Long uid, List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 二级队员
|
| | | * @param start
|
| | | * @param count
|
| | | * @param uid
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listSecondTeam(long start, int count, Long uid, List<Long> listId);
|
| | |
|
| | | public long countFirstTeam(Long uid);
|
| | |
|
| | | public long countSecondTeam(Long uid);
|
| | | |
| | | /**
|
| | | * 统计直接粉丝数量
|
| | | *
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countFirstTeam(Long uid);
|
| | | public long countFirstTeam(Long uid, List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 统计间接粉丝数量
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public long countSecondTeam(Long uid);
|
| | | public long countSecondTeam(Long uid, List<Long> listId);
|
| | |
|
| | | /**
|
| | | * 查询邀请关系 时间筛选
|
| | |
| | | */
|
| | | public List<ThreeSale> listAll(int page,int pageSize);
|
| | |
|
| | | /**
|
| | | * 根日期类型进行统计直接
|
| | | */
|
| | | public long countFirstTeamByDate(Long uid, int dayType);
|
| | |
|
| | | /**
|
| | | * 根日期类型进行统计间接
|
| | | * @param uid
|
| | | * @param dayType
|
| | | * @return
|
| | | */
|
| | | public long countSecondTeamByDate(Long uid, int dayType);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | */
|
| | | public void addMsgVIP(Long uid, String title, String beiZhu, MsgAccountVipDTO dto);
|
| | |
|
| | | public void deleteByPrimaryKey(Long id);
|
| | |
|
| | | public MsgAccountDetail selectByPrimaryKey(Long id);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user.vip;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamDailyRecord;
|
| | |
|
| | | public interface TeamDailyRecordService {
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 初始化统计粉丝等级数量
|
| | | * @param uid
|
| | | */
|
| | | public void addDailyRecord(Long uid);
|
| | |
|
| | | /**
|
| | | * 查询所有
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public List<TeamDailyRecord> getbyUid(Long uid);
|
| | | |
| | | /**
|
| | | * 查询数据
|
| | | * @param uid
|
| | | * @param level
|
| | | * @param minTime
|
| | | * @return
|
| | | */
|
| | | public List<TeamDailyRecord> getbyUid(Long uid, Date minTime);
|
| | | }
|
| | |
| | | date = sdf.parse(st);
|
| | | return date.getTime();
|
| | | } catch (Exception e) {
|
| | | // e.printStackTrace();
|
| | | e.printStackTrace();
|
| | | return 0;
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | public static Date parseYYYYMM(String st) {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
| | | try {
|
| | | return sdf.parse(st);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | return null;
|
| | | }
|
| | | }
|
| | | |
| | | public static Date parseYYYYMMDD_HHMMSS(String st) {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
| | | try {
|
| | | return sdf.parse(st);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | return null;
|
| | | }
|
| | | }
|
| | | |
| | | public static Date parseYYYYMMDD(String st) {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | try {
|
| | | return sdf.parse(st);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | return null;
|
| | | }
|
| | | }
|
| | | |
| | | public static long convertAllTimeToTemp(String st) {
|
| | | Date date = new Date();
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
| | |
| | | return false;
|
| | | }
|
| | |
|
| | | public static boolean greaterThan_2_1_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 57))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) >= 80)))
|
| | | return true;
|
| | | else
|
| | | return false;
|
| | | }
|
| | | |
| | | public static boolean smallerThan_1_5_1(String platform, String versionCode) {
|
| | | if ((("android".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 36))
|
| | | || (("ios".equalsIgnoreCase(platform) && Integer.parseInt(versionCode) < 44)))
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | }
|
| | |
|
| | |
|
| | | UserMsgVO vo = new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_order.png", "订单消息",
|
| | | UserMsgVO vo = new UserMsgVO(msg.getId(), "http://img.flqapp.com/resource/msg/icon_msg_order.png", "订单消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), null);
|
| | | |
| | | List<ClientTextStyleVO> contentList = new ArrayList<>();
|
| | | if (msg.getType() == MsgTypeOrderTypeEnum.found) {
|
| | | contentList = new ArrayList<>();
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getMsgType().getIcon());
|
| | | userMsgVO.setTitle(msg.getMsgType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_extract.png", "提现",
|
| | | |
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_extract.png", "提现",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.extractValid) {
|
| | | BindingAccount ba = new BindingAccount();
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_extract.png", "提现账号验证",
|
| | | return new UserMsgVO(msg.getId(), "http://img.flqapp.com/resource/msg/icon_msg_extract.png", "提现账号验证",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.fanli) {
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.fanliElme) {
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_fanli.png", "返利到账",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.invite || msg.getMsgType() == MsgTypeMoneyTypeEnum.share) {
|
| | |
| | | String date = ca.get(Calendar.YEAR) + "年" + (ca.get(Calendar.MONTH) + 1) + "月";
|
| | |
|
| | | if (msg.getMsgType() == MsgTypeMoneyTypeEnum.share)
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_share_money.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_share_money.png",
|
| | | date + msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | else
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | date + msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_fanli.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_fanli.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.shareWeiQuan) {
|
| | | contentList = new ArrayList<>();
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_share_money.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_share_money.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.inviteWeiQuan) {
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_invite_money.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.orderReward) {// 奖励订单
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_order_reward.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_order_reward.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.systemEqualize) {// 系统补偿
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.extractAutoWX) { // 微信自动提现
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/money_detail/icon_system.png",
|
| | | msg.getMsgType().getDesc(), msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(),
|
| | | items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.subSidy) { // 额外补贴
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_subsidy.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.orderTeamReward) { // 团队奖励
|
| | | contentList = new ArrayList<>();
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_team_reward.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_team_reward.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackReceiveOff) { // 红包成功领取
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveOff) { // 红包被成功领取
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_give.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackGiveBack) { // 红包未被领取退回
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_give.png",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_give.png",
|
| | | MsgTypeMoneyTypeEnum.redPackGiveBack.getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangePass) { // 红包提现成功
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackExchangeReject) { // 红包提现拒绝
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_hongbao_tixian.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | |
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackForbid) { // 红包封禁消息
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackForbidRemove) { // 红包封禁解除消息
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackDeduct) { // 红包扣除消息
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackOneStageReward
|
| | | || msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackTwoStageReward
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", "红包提醒",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", "红包提醒",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackUseSuccess) { // 红包使用成功
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", "红包消息",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", "红包消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msg.getMsgType() == MsgTypeMoneyTypeEnum.redPackUseFail) { // 红包使用失败
|
| | | if (StringUtil.isNullOrEmpty(msg.getContent()))
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu(),
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | return new UserMsgVO("http://img.flqapp.com/img/tlj/icon_tlj.png", "红包消息",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/img/tlj/icon_tlj.png", "红包消息",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | | return null;
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | contentList.add(new ClientTextStyleVO(StringUtil.isNullOrEmpty(msg.getBeiZhu()) ? "无" : msg.getBeiZhu() + "",
|
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_account.png", msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getMsgType().getIcon());
|
| | | userMsgVO.setTitle(msg.getMsgType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite.png", dto.getTitle(),
|
| | | return new UserMsgVO(msg.getId(), "http://img.flqapp.com/resource/msg/icon_msg_invite.png", dto.getTitle(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | } else if (msgType == MsgTypeInviteTypeEnum.inviteSucceed) {
|
| | | if (msg.getInviteUser() == null || msg.getInviteUser().getWorker() == null)
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite.png", "邀请提醒 ",
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_invite.png", "邀请提醒 ",
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | COLOR_CONTENT));
|
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | return new UserMsgVO("http://img.flqapp.com/resource/msg/icon_msg_invite.png", msg.getMsgType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),"http://img.flqapp.com/resource/msg/icon_msg_invite.png", msg.getMsgType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | items.addAll(gson.fromJson(msg.getExtraInfo(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(icon);
|
| | | userMsgVO.setTitle(dto.getTitle());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon("http://img.flqapp.com/resource/msg/icon_msg_vip.png");
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon("http://img.flqapp.com/resource/msg/icon_msg_notify.png");
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.add(new CommonMsgItemVO(new ClientTextStyleVO("备 注", COLOR_TITLE), contentList));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon("http://img.flqapp.com/resource/msg/icon_msg_invite_break.png");
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | items.addAll(gson.fromJson(msg.getContent(), new TypeToken<ArrayList<CommonMsgItemVO>>() {}.getType()));
|
| | |
|
| | | UserMsgVO userMsgVO = new UserMsgVO();
|
| | | userMsgVO.setId(msg.getId());
|
| | | userMsgVO.setIcon(msg.getType().getIcon());
|
| | | userMsgVO.setTitle(msg.getType().getDesc());
|
| | | userMsgVO.setTime(msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime());
|
| | |
| | | return userMsgVO;
|
| | | }
|
| | |
|
| | | return new UserMsgVO(icon, msg.getType().getDesc(),
|
| | | return new UserMsgVO(msg.getId(),icon, msg.getType().getDesc(),
|
| | | msg.getUpdateTime() == null ? msg.getCreateTime() : msg.getUpdateTime(), items);
|
| | | }
|
| | |
|
| | |
| | | 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.user.UserTopicTagEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.BeComeValidUserMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.TaoBaoBindSuccessMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserActiveMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInfoUpdateMQMsg.UserInfoUpdateTypeEnum;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserInviteMQMsg;
|
| | | import com.yeshi.fanli.dto.mq.user.body.UserMoneyChangeMQMsg;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.user.invite.TeamFansInfoService;
|
| | | import com.yeshi.fanli.util.rocketmq.MQTopicName;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 用户粉丝消息
|
| | |
| | | @Component
|
| | | public class UserTeamMessageListener implements MessageListener {
|
| | |
|
| | | @Resource
|
| | | private TeamFansInfoService teamFansInfoService;
|
| | | |
| | | |
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
|
| | |
| | |
|
| | | if (MQTopicName.TOPIC_USER.name().equalsIgnoreCase(message.getTopic())) {
|
| | | if (tag.equalsIgnoreCase(UserTopicTagEnum.userActve.name())) {// 用户活跃
|
| | | // TODO 更改用户活跃时间
|
| | |
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserActiveMQMsg userActiveMQMsg = new Gson().fromJson(json.toString(),UserActiveMQMsg.class);
|
| | | if (userActiveMQMsg != null) {
|
| | | // 更改用户活跃时间
|
| | | teamFansInfoService.updateActiveTime(userActiveMQMsg.getUid(), userActiveMQMsg.getCreateTime());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.userInfoUpdate.name())) {// 用户信息更新
|
| | |
|
| | | // TODO 更改微信号绑定
|
| | |
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserInfoUpdateMQMsg mqMsg = new Gson().fromJson(json.toString(),UserInfoUpdateMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | if (UserInfoUpdateTypeEnum.nickName == mqMsg.getType()) { // 更改昵称
|
| | | teamFansInfoService.updateNickName(mqMsg.getUid(), mqMsg.getValue());
|
| | | } else if (UserInfoUpdateTypeEnum.wxId == mqMsg.getType()) { // 微信号绑定
|
| | | teamFansInfoService.updateWeixinBind(mqMsg.getUid(), true);
|
| | | }
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.taobaoBindSuccess.name())) {// 淘宝绑定成功
|
| | |
|
| | | // TODO 更改淘宝绑定状态与原用户淘宝绑定状态
|
| | |
|
| | | // 更改淘宝绑定状态与原用户淘宝绑定状态
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | TaoBaoBindSuccessMQMsg mqMsg = new Gson().fromJson(json.toString(),TaoBaoBindSuccessMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | // 更新淘宝绑定
|
| | | teamFansInfoService.updateWeixinBind(mqMsg.getUid(), true);
|
| | | Long fromUid = mqMsg.getFromUid();
|
| | | if (fromUid != null) { // 淘宝被解绑
|
| | | teamFansInfoService.updateWeixinBind(fromUid, false);
|
| | | }
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.inviteSuccess.name())) {// 邀请成功
|
| | |
|
| | | // TODO 更新粉丝数量
|
| | |
|
| | | // 更新粉丝数量
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserInviteMQMsg mqMsg = new Gson().fromJson(json.toString(),UserInviteMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | teamFansInfoService.updateFansNum(mqMsg.getBossId());
|
| | | |
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.userMoneyAdd.name())) {// 资金到账
|
| | |
|
| | | // TODO 更新近60天到账
|
| | |
|
| | | // 更新近60天到账
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | UserMoneyChangeMQMsg mqMsg = new Gson().fromJson(json.toString(),UserMoneyChangeMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | teamFansInfoService.updateIncome(mqMsg.getUid(), mqMsg.getChangeMoney());
|
| | | }
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.becomeValidUser.name())) {// 成为有效用户
|
| | |
|
| | | // TODO 有效用户标识
|
| | | // 有效用户标识
|
| | | JSONObject json = JSONObject.fromObject(new String(message.getBody()));
|
| | | BeComeValidUserMQMsg mqMsg = new Gson().fromJson(json.toString(),BeComeValidUserMQMsg.class);
|
| | | if (mqMsg != null) {
|
| | | // 更新成为有效粉丝
|
| | | teamFansInfoService.updateStateValid(mqMsg.getUid(), true);
|
| | | }
|
| | | }
|
| | | }
|
| | | return Action.CommitMessage;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserActiveLogService userActiveLogService;
|
| | | |
| | |
|
| | | @Override
|
| | | public Action consume(Message message, ConsumeContext context) {
|
| | |
| | | if (boss != null) {
|
| | | teamUserLevelStatisticService.initData(boss.getId());
|
| | | }
|
| | | |
| | | }
|
| | | return Action.CommitMessage;
|
| | | } else if (tag.equalsIgnoreCase(UserTopicTagEnum.threeSaleSeparate.name())) {// 邀请关系脱离
|
New file |
| | |
| | | package com.yeshi.fanli.vo.homemodule;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | |
|
| | | public class SpecialVO extends Special{
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | private Boolean needSpin;
|
| | | |
| | | @Expose
|
| | | private String comment;
|
| | |
|
| | | public String getComment() {
|
| | | return comment;
|
| | | }
|
| | |
|
| | | public void setComment(String comment) {
|
| | | this.comment = comment;
|
| | | }
|
| | |
|
| | | public Boolean getNeedSpin() {
|
| | | return needSpin;
|
| | | }
|
| | |
|
| | | public void setNeedSpin(Boolean needSpin) {
|
| | | this.needSpin = needSpin;
|
| | | }
|
| | | |
| | | |
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class IncomeDetailVO {
|
| | | private String icon;// 渠道图标
|
| | | private Integer num; // 订单数量
|
| | | private BigDecimal money;// 金额
|
| | |
|
| | | public IncomeDetailVO() {}
|
| | | |
| | | |
| | | public IncomeDetailVO(String icon) {
|
| | | this.icon = icon;
|
| | | }
|
| | | |
| | | public IncomeDetailVO(String icon, Integer num, BigDecimal money) {
|
| | | this.icon = icon;
|
| | | this.num = num;
|
| | | this.money = money;
|
| | | }
|
| | | |
| | | public String getIcon() {
|
| | | return icon;
|
| | | }
|
| | |
|
| | | public void setIcon(String icon) {
|
| | | this.icon = icon;
|
| | | }
|
| | |
|
| | | public Integer getNum() {
|
| | | return num;
|
| | | }
|
| | |
|
| | | public void setNum(Integer num) {
|
| | | this.num = num;
|
| | | }
|
| | |
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | |
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class MoneyPredictVO {
|
| | | // 总的
|
| | | private BigDecimal totalMoney; // 总预估收益
|
| | | private Integer totalNum; // 总付款订单数(笔)
|
| | | // 我的
|
| | | private BigDecimal mineMoney;// 预估我的收益
|
| | | private Integer mineNum;// 付款订单数(笔)
|
| | | // 团队
|
| | | private BigDecimal teamMoney;// 累计提现
|
| | | private Integer teamNum;// 累计提现
|
| | |
|
| | | private String countDate; // 统计日期
|
| | | |
| | | |
| | | public MoneyPredictVO() {}
|
| | | |
| | | |
| | | public MoneyPredictVO(BigDecimal mineMoney, Integer mineNum, BigDecimal teamMoney,Integer teamNum) {
|
| | | this.mineMoney = mineMoney;
|
| | | this.mineNum = mineNum;
|
| | | this.teamMoney = teamMoney;
|
| | | this.teamNum = teamNum;
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | public BigDecimal getTotalMoney() {
|
| | | return totalMoney;
|
| | | }
|
| | |
|
| | | public void setTotalMoney(BigDecimal totalMoney) {
|
| | | this.totalMoney = totalMoney;
|
| | | }
|
| | |
|
| | | public Integer getTotalNum() {
|
| | | return totalNum;
|
| | | }
|
| | |
|
| | | public void setTotalNum(Integer totalNum) {
|
| | | this.totalNum = totalNum;
|
| | | }
|
| | |
|
| | | public BigDecimal getMineMoney() {
|
| | | return mineMoney;
|
| | | }
|
| | |
|
| | | public void setMineMoney(BigDecimal mineMoney) {
|
| | | this.mineMoney = mineMoney;
|
| | | }
|
| | |
|
| | | public Integer getMineNum() {
|
| | | return mineNum;
|
| | | }
|
| | |
|
| | | public void setMineNum(Integer mineNum) {
|
| | | this.mineNum = mineNum;
|
| | | }
|
| | |
|
| | | public BigDecimal getTeamMoney() {
|
| | | return teamMoney;
|
| | | }
|
| | |
|
| | | public void setTeamMoney(BigDecimal teamMoney) {
|
| | | this.teamMoney = teamMoney;
|
| | | }
|
| | |
|
| | | public Integer getTeamNum() {
|
| | | return teamNum;
|
| | | }
|
| | |
|
| | | public void setTeamNum(Integer teamNum) {
|
| | | this.teamNum = teamNum;
|
| | | }
|
| | |
|
| | | public String getCountDate() {
|
| | | return countDate;
|
| | | }
|
| | |
|
| | | public void setCountDate(String countDate) {
|
| | | this.countDate = countDate;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | public class MoneyStatisticVO {
|
| | | private String link;// 链接
|
| | | private BigDecimal balanceMoney;// 账户余额
|
| | | private String extractingMoneyInfo;// 提现中的资金信息
|
| | | |
| | | private String extractDesc; // 提现说明文字
|
| | | private String moneyArrivalDesc; // 资金到账说明文字
|
| | |
|
| | | // 提现
|
| | | private BigDecimal monthExtractMoney;// 本月提现
|
| | | private BigDecimal lastMonthExtractMoney;// 上月提现
|
| | | private BigDecimal totalExtractMoney;// 累计提现
|
| | |
|
| | | // 累计
|
| | | private BigDecimal totalFanLiMoney;// 累计自购返利
|
| | | private BigDecimal totalShareMoney;// 累计分享奖金
|
| | | private BigDecimal totalInviteMoney;// 累计邀请奖金
|
| | | |
| | | // 收货详情
|
| | | private BigDecimal monthSettleMoney;// 本月已收货
|
| | | private BigDecimal lastMonthSettleMoney;// 上月已收货
|
| | | private BigDecimal notSettleMoney;// 待确认收货
|
| | |
|
| | | |
| | | private MoneyPredictVO todayPredict;// 今日预估
|
| | | private MoneyPredictVO monthPredict;// 本月预估
|
| | |
|
| | | public BigDecimal getBalanceMoney() {
|
| | | return balanceMoney;
|
| | | }
|
| | |
|
| | | public void setBalanceMoney(BigDecimal balanceMoney) {
|
| | | this.balanceMoney = balanceMoney;
|
| | | }
|
| | |
|
| | | public String getExtractingMoneyInfo() {
|
| | | return extractingMoneyInfo;
|
| | | }
|
| | |
|
| | | public void setExtractingMoneyInfo(String extractingMoneyInfo) {
|
| | | this.extractingMoneyInfo = extractingMoneyInfo;
|
| | | }
|
| | |
|
| | | public BigDecimal getMonthExtractMoney() {
|
| | | return monthExtractMoney;
|
| | | }
|
| | |
|
| | | public void setMonthExtractMoney(BigDecimal monthExtractMoney) {
|
| | | this.monthExtractMoney = monthExtractMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getLastMonthExtractMoney() {
|
| | | return lastMonthExtractMoney;
|
| | | }
|
| | |
|
| | | public void setLastMonthExtractMoney(BigDecimal lastMonthExtractMoney) {
|
| | | this.lastMonthExtractMoney = lastMonthExtractMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getTotalExtractMoney() {
|
| | | return totalExtractMoney;
|
| | | }
|
| | |
|
| | | public void setTotalExtractMoney(BigDecimal totalExtractMoney) {
|
| | | this.totalExtractMoney = totalExtractMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getTotalFanLiMoney() {
|
| | | return totalFanLiMoney;
|
| | | }
|
| | |
|
| | | public void setTotalFanLiMoney(BigDecimal totalFanLiMoney) {
|
| | | this.totalFanLiMoney = totalFanLiMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getTotalShareMoney() {
|
| | | return totalShareMoney;
|
| | | }
|
| | |
|
| | | public void setTotalShareMoney(BigDecimal totalShareMoney) {
|
| | | this.totalShareMoney = totalShareMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getTotalInviteMoney() {
|
| | | return totalInviteMoney;
|
| | | }
|
| | |
|
| | | public void setTotalInviteMoney(BigDecimal totalInviteMoney) {
|
| | | this.totalInviteMoney = totalInviteMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getMonthSettleMoney() {
|
| | | return monthSettleMoney;
|
| | | }
|
| | |
|
| | | public void setMonthSettleMoney(BigDecimal monthSettleMoney) {
|
| | | this.monthSettleMoney = monthSettleMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getLastMonthSettleMoney() {
|
| | | return lastMonthSettleMoney;
|
| | | }
|
| | |
|
| | | public void setLastMonthSettleMoney(BigDecimal lastMonthSettleMoney) {
|
| | | this.lastMonthSettleMoney = lastMonthSettleMoney;
|
| | | }
|
| | |
|
| | | public BigDecimal getNotSettleMoney() {
|
| | | return notSettleMoney;
|
| | | }
|
| | |
|
| | | public void setNotSettleMoney(BigDecimal notSettleMoney) {
|
| | | this.notSettleMoney = notSettleMoney;
|
| | | }
|
| | |
|
| | | public String getExtractDesc() {
|
| | | return extractDesc;
|
| | | }
|
| | |
|
| | | public void setExtractDesc(String extractDesc) {
|
| | | this.extractDesc = extractDesc;
|
| | | }
|
| | |
|
| | | public String getMoneyArrivalDesc() {
|
| | | return moneyArrivalDesc;
|
| | | }
|
| | |
|
| | | public void setMoneyArrivalDesc(String moneyArrivalDesc) {
|
| | | this.moneyArrivalDesc = moneyArrivalDesc;
|
| | | }
|
| | |
|
| | | public MoneyPredictVO getTodayPredict() {
|
| | | return todayPredict;
|
| | | }
|
| | |
|
| | | public void setTodayPredict(MoneyPredictVO todayPredict) {
|
| | | this.todayPredict = todayPredict;
|
| | | }
|
| | |
|
| | | public MoneyPredictVO getMonthPredict() {
|
| | | return monthPredict;
|
| | | }
|
| | |
|
| | | public void setMonthPredict(MoneyPredictVO monthPredict) {
|
| | | this.monthPredict = monthPredict;
|
| | | }
|
| | |
|
| | | public String getLink() {
|
| | | return link;
|
| | | }
|
| | |
|
| | | public void setLink(String link) {
|
| | | this.link = link;
|
| | | }
|
| | | }
|
| | |
| | | private List<CommonMsgItemVO> contentItems;
|
| | | private JumpDetailV2 jumpDetail;// 跳转详情
|
| | | private String params;// 跳转参数
|
| | | private Long id;
|
| | |
|
| | | public JumpDetailV2 getJumpDetail() {
|
| | | return jumpDetail;
|
| | |
| | | this.params = params;
|
| | | }
|
| | |
|
| | | public UserMsgVO(String icon, String title, Date time, List<CommonMsgItemVO> contentItems) {
|
| | | public UserMsgVO(Long id, String icon, String title, Date time, List<CommonMsgItemVO> contentItems) {
|
| | | this.id = id;
|
| | | this.icon = icon;
|
| | | this.title = title;
|
| | | this.time = time;
|
| | |
| | | public void setType(String type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.vo.push;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.google.gson.annotations.Expose;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | public class PushRecommendVO {
|
| | | // 推送时间
|
| | | @Expose
|
| | | private Long pushtime;
|
| | | // 标题
|
| | | @Expose
|
| | | private String title;
|
| | | // 内容
|
| | | @Expose
|
| | | private String content;
|
| | | // 图片
|
| | | @Expose
|
| | | private String picture;
|
| | | // 名称
|
| | | @Expose
|
| | | private String nickName;
|
| | | // 浏览数量
|
| | | @Expose
|
| | | private String scanNum;
|
| | | // 参数
|
| | | @Expose
|
| | | private String params;
|
| | | // 跳转
|
| | | @Expose
|
| | | private JumpDetailV2 jumpDetail;
|
| | |
|
| | | @Expose
|
| | | private List<ClientTextStyleVO> totalwords;
|
| | |
|
| | | public Long getPushtime() {
|
| | | return pushtime;
|
| | | }
|
| | |
|
| | | public void setPushtime(Long pushtime) {
|
| | | this.pushtime = pushtime;
|
| | | }
|
| | |
|
| | | public String getTitle() {
|
| | | return title;
|
| | | }
|
| | |
|
| | | public void setTitle(String title) {
|
| | | this.title = title;
|
| | | }
|
| | |
|
| | | public String getContent() {
|
| | | return content;
|
| | | }
|
| | |
|
| | | public void setContent(String content) {
|
| | | this.content = content;
|
| | | }
|
| | |
|
| | | public String getPicture() {
|
| | | return picture;
|
| | | }
|
| | |
|
| | | public void setPicture(String picture) {
|
| | | this.picture = picture;
|
| | | }
|
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | | }
|
| | |
|
| | | public void setNickName(String nickName) {
|
| | | this.nickName = nickName;
|
| | | }
|
| | |
|
| | | public String getScanNum() {
|
| | | return scanNum;
|
| | | }
|
| | |
|
| | | public void setScanNum(String scanNum) {
|
| | | this.scanNum = scanNum;
|
| | | }
|
| | |
|
| | | public String getParams() {
|
| | | return params;
|
| | | }
|
| | |
|
| | | public void setParams(String params) {
|
| | | this.params = params;
|
| | | }
|
| | |
|
| | | public JumpDetailV2 getJumpDetail() {
|
| | | return jumpDetail;
|
| | | }
|
| | |
|
| | | public void setJumpDetail(JumpDetailV2 jumpDetail) {
|
| | | this.jumpDetail = jumpDetail;
|
| | | }
|
| | |
|
| | | public List<ClientTextStyleVO> getTotalwords() {
|
| | | return totalwords;
|
| | | }
|
| | |
|
| | | public void setTotalwords(List<ClientTextStyleVO> totalwords) {
|
| | | this.totalwords = totalwords;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import org.yeshi.utils.mybatis.ColumnParseUtil;
|
| | | import org.yeshi.utils.mybatis.MyBatisMapperUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.user.vip.TeamUserLevelStatistic;
|
| | | import com.yeshi.fanli.entity.bus.user.vip.UserVIPPreInfo;
|
| | | import com.yeshi.fanli.entity.money.TeamEincomeRecord;
|
| | |
|
| | | //@Ignore
|
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | ColumnParseUtil.parseColumn(TeamUserLevelStatistic.class,
|
| | | "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/user/vip/TeamUserLevelStatisticMapper.xml");
|
| | | ColumnParseUtil.parseColumn(UserVIPPreInfo.class,
|
| | | "D:/workspace/fanli/fanli-server/fanli/src/main/java/com/yeshi/fanli/mapping/user/vip/UserVIPPreInfoMapper.xml");
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package org.fanli;
|
| | |
|
| | | import org.junit.Test;
|
| | | import org.yeshi.utils.mybatis.MyBatisMapperUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.push.PushGoods;
|
| | |
|
| | | //@Ignore
|
| | | public class MyBatisProduce2 {
|
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | MyBatisMapperUtil.createMapper(PushGoods.class);
|
| | | }
|
| | |
|
| | |
|
| | | }
|
| | |
| | | import java.io.InputStreamReader;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Scanner;
|
| | |
|
| | | import org.junit.Test;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.service.manger.goods.ConvertLinkManager;
|
| | | import com.yeshi.fanli.util.BeanUtil;
|
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.dataoke.DaTaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
|
| | |
| | | System.out.println(result);
|
| | |
|
| | | String token = TaoKeApiUtil.getTKToken("http://", "口碑外卖红包", result);
|
| | | |
| | |
|
| | | System.out.println(token);
|
| | | }
|
| | |
|
| | |
| | | TaoKeApiUtil.specialConvertCoupon(579875678934L, new TaoKeAppInfo(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET, TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT));
|
| | | try {
|
| | | TaoKeApiUtil.getSimpleGoodsInfo(573867930843L);
|
| | | TaoKeApiUtil.getSimpleGoodsInfo(556371219169L);
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Test
|
| | | public void test14() {
|
| | | TaoKeApiUtil.getCouponListByItemId(614089154947L);
|
| | |
|
| | | Long[] ids = new Long[] {
|
| | | 547050481823L,612971793223L
|
| | | };
|
| | | try {
|
| | | for (Long id : ids) {
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.getSimpleGoodsInfo(id);
|
| | | System.out.println(goods.getMaterialLibType());
|
| | | }
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | // DaTaoKeApiUtil.convertLink(614847140426L,
|
| | | // TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | dateInfo.setSecond(second);
|
| | | return dateInfo;
|
| | | }
|
| | | |
| | |
|
| | | public static String dateDiff4(Date startTime, Date endTime) throws Exception {
|
| | |
|
| | | String datatime = "0分";
|
| | |
| | | long hour = diff % nd / nh;// 计算差多少小时
|
| | | long min = diff % nd % nh / nm;// 计算差多少分钟
|
| | | long second = (diff / 1000 - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60); // 计算差多少秒
|
| | | |
| | |
|
| | | String datatime = "";
|
| | | if (day > 0) {
|
| | | datatime = day + "天";
|
| | |
| | | datatime = hour + "小时";
|
| | | } else if (min > 0) {
|
| | | datatime = min + "分钟";
|
| | | } else if(second > 0) {
|
| | | } else if (second > 0) {
|
| | | datatime = second + "秒";
|
| | | }
|
| | | return datatime;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | public static long dateDiffMin(Date startTime, Date endTime) throws Exception {
|
| | | long nm = 1000 * 60;// 一分钟的毫秒数
|
| | | long nh = 1000 * 60 * 60;// 一小时的毫秒数
|
| | |
| | | long diff = endTime.getTime() - startTime.getTime();
|
| | | long day = diff / nd;// 计算差多少天
|
| | | long hour = diff % nd / nh;// 计算差多少小时
|
| | | long min = diff % nd % nh / nm + day * 24 * 60 + hour * 60;// 计算差多少分钟
|
| | | long min = diff % nd % nh / nm + day * 24 * 60 + hour * 60;// 计算差多少分钟
|
| | | return min;
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 通过时间秒毫秒数判断两个时间的间隔
|
| | | *
|
| | |
| | |
|
| | | return format.format(ca.getTime());
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 指定日期加上天数后的日期
|
| | | *
|
| | |
| | | return format.format(ca.getTime());
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 指定日期加上天数后的日期
|
| | | *
|
| | |
| | | ca.add(Calendar.DATE, num);
|
| | | return ca.getTime();
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 加上月份
|
| | | * |
| | | * @param currdate
|
| | | * @param num
|
| | | * @return
|
| | |
| | | ca.add(Calendar.MONTH, num);
|
| | | return ca.getTime();
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 加上年份
|
| | | * |
| | | * @param currdate
|
| | | * @param num
|
| | | * @return
|
| | |
| | | return ca.getTime();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 减去月份
|
| | | * |
| | | * @param currdate
|
| | | * @param num
|
| | | * @return
|
| | | */
|
| | | public static Date reduceMonth(Date currdate, int num) {
|
| | | Calendar ca = Calendar.getInstance();
|
| | | ca.setTime(currdate);
|
| | | ca.add(Calendar.MONTH, -num);
|
| | | return ca.getTime();
|
| | | }
|
| | |
|
| | | /**
|
| | | * 指定日期减去天数后的日期
|
| | |
| | |
|
| | | return format.format(ca.getTime());
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 指定日期减去天数后的日期
|
| | | *
|
| | |
| | | * 计算两时间月差
|
| | | *
|
| | | * @param startDate <String>
|
| | | * @param endDate <String>
|
| | | * @param endDate <String>
|
| | | * @return int
|
| | | * @throws ParseException
|
| | | */
|
| | | public static int getMonthSpace(String startDate, String endDate) throws ParseException {
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
| | | return getMonthSpace(sdf.parse(startDate), sdf.parse(endDate));
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
|
| | | return getMonthSpace(sdf.parse(startDate), sdf.parse(endDate));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 计算两时间月差
|
| | | *
|
| | | * @param startDate <String>
|
| | | * @param endDate <String>
|
| | | * @param endDate <String>
|
| | | * @return int
|
| | | * @throws ParseException
|
| | | */
|
| | |
| | | start.setTime(startDate);
|
| | | end.setTime(endDate);
|
| | | int result = end.get(Calendar.MONTH) - start.get(Calendar.MONTH);
|
| | | int month = (end.get(Calendar.YEAR) - start.get(Calendar.YEAR)) * 12;
|
| | | int month = (end.get(Calendar.YEAR) - start.get(Calendar.YEAR)) * 12;
|
| | | return Math.abs(month + result);
|
| | | }
|
| | | |
| | |
|
| | | public static Date getTodayStartTime() {
|
| | | Calendar todayStart = Calendar.getInstance();
|
| | | todayStart.set(Calendar.HOUR_OF_DAY,0);
|
| | | todayStart.set(Calendar.MINUTE,0);
|
| | | todayStart.set(Calendar.SECOND,0);
|
| | | todayStart.set(Calendar.MILLISECOND,0);
|
| | | todayStart.set(Calendar.HOUR_OF_DAY, 0);
|
| | | todayStart.set(Calendar.MINUTE, 0);
|
| | | todayStart.set(Calendar.SECOND, 0);
|
| | | todayStart.set(Calendar.MILLISECOND, 0);
|
| | | return todayStart.getTime();
|
| | | }
|
| | | |
| | |
|
| | | public static Date getTodayEndTime() {
|
| | | Calendar todayEnd = Calendar.getInstance();
|
| | | todayEnd.set(Calendar.HOUR_OF_DAY,23);
|
| | | todayEnd.set(Calendar.MINUTE,59);
|
| | | todayEnd.set(Calendar.SECOND,59);
|
| | | todayEnd.set(Calendar.MILLISECOND,999);
|
| | | todayEnd.set(Calendar.HOUR_OF_DAY, 23);
|
| | | todayEnd.set(Calendar.MINUTE, 59);
|
| | | todayEnd.set(Calendar.SECOND, 59);
|
| | | todayEnd.set(Calendar.MILLISECOND, 999);
|
| | | return todayEnd.getTime();
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 获取指定年月的第一天
|
| | | * |
| | | * @param yearMonth
|
| | | * @return
|
| | | */
|
| | | public static String getFirstDayOfMonth(String yearMonth) {
|
| | | int year = Integer.parseInt(yearMonth.split("-")[0]); // 年
|
| | | int month = Integer.parseInt(yearMonth.split("-")[1]); // 月
|
| | | return getFirstDayOfMonth(year, month);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取指定年月的第一天
|
| | | * |
| | | * @param year
|
| | | * @param month
|
| | | * @return
|
| | | */
|
| | | public static String getFirstDayOfMonth(int year, int month) {
|
| | | Calendar cal = Calendar.getInstance();
|
| | | // 设置年份
|
| | | cal.set(Calendar.YEAR, year);
|
| | | // 设置月份
|
| | | cal.set(Calendar.MONTH, month - 1);
|
| | | // 获取某月最小天数
|
| | | int firstDay = cal.getMinimum(Calendar.DATE);
|
| | | // 设置日历中月份的最小天数
|
| | | cal.set(Calendar.DAY_OF_MONTH, firstDay);
|
| | | // 格式化日期
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | return sdf.format(cal.getTime());
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取指定年月的最后一天
|
| | | * |
| | | * @param yearMonth
|
| | | * @return
|
| | | */
|
| | | public static String getLastDayOfMonth(String yearMonth) {
|
| | | int year = Integer.parseInt(yearMonth.split("-")[0]); // 年
|
| | | int month = Integer.parseInt(yearMonth.split("-")[1]); // 月
|
| | | return getLastDayOfMonth(year, month);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取指定年月的最后一天
|
| | | * |
| | | * @param year
|
| | | * @param month
|
| | | * @return
|
| | | */
|
| | | public static String getLastDayOfMonth(int year, int month) {
|
| | | Calendar cal = Calendar.getInstance();
|
| | | // 设置年份
|
| | | cal.set(Calendar.YEAR, year);
|
| | | // 设置月份
|
| | | cal.set(Calendar.MONTH, month - 1);
|
| | | // 获取某月最大天数
|
| | | int lastDay = cal.getActualMaximum(Calendar.DATE);
|
| | | // 设置日历中月份的最大天数
|
| | | cal.set(Calendar.DAY_OF_MONTH, lastDay);
|
| | | // 格式化日期
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | return sdf.format(cal.getTime());
|
| | | }
|
| | |
|
| | | public static void main(String[] args) throws ParseException {
|
| | | System.out.println(getMonthSpace("2012-02", "2012-02")); |
| | | }
|
| | | System.out.println(getMonthSpace("2012-02", "2012-02"));
|
| | | }
|
| | |
|
| | | } |