| | |
| | | result = jedis.setnx(cacheKey, "1");
|
| | | if (result <= 0) {
|
| | | try {
|
| | | System.out.println("__________已有线程在执行");
|
| | | Thread.sleep(50);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (System.currentTimeMillis() - startTime > 1000 * 60L) {
|
| | | Constant.waitingThreadSet.remove(Thread.currentThread().getId());
|
| | | System.out.println("__________删除线程");
|
| | | return null;
|
| | | }
|
| | | } else {
|
| | |
| | |
|
| | | if (result > 0) {
|
| | | try {
|
| | | System.out.println("__________放行执行");
|
| | | return joinPoint.proceed();
|
| | | } catch (Throwable e) {
|
| | | e.printStackTrace();
|
| | |
| | | } catch (SecurityException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | return joinPoint.proceed();
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | |
| | | innerList.put("name", "驳回数");
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countAuditTotal(state, dateType, year,
|
| | | List<ChartTDO> list = extractAuditRecordService.countAuditTotal(state, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | @RequestMapping(value = "getExtractApplyMoney")
|
| | | public void getExtractApplyMoney(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));
|
| | |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | Gson gson = new Gson();
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countExtractApplyMoney(null, dateType, year,
|
| | | List<ChartTDO> list = extractAuditRecordService.countExtractApplyMoney(null, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | |
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | @RequestMapping(value = "getExtractApplyNumber")
|
| | | public void getExtractApplyNumber(String callback, Integer state, 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));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | Object objectDate = null;
|
| | | Gson gson = new Gson();
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | Gson gson = new Gson();
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countExtractApplyNumber(null, dateType, year,
|
| | | List<ChartTDO> list = extractAuditRecordService.countExtractApplyNumber(null, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | |
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | @RequestMapping(value = "getLostNum")
|
| | | public void getLostNum(String callback, Integer dateType, String stateArray, 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));
|
| | |
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | |
|
| | | List<Integer> channelList = null;
|
| | | if (stateArray != null && stateArray.trim().length() > 0) {
|
| | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | | try {
|
| | |
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | |
|
| | | } else {
|
| | | for (Integer state : channelList) {
|
| | | |
| | | List<Map<String, Object>> list = lostOrderService.countLostNum(dateType, state, year, |
| | | List<ChartTDO> list = lostOrderService.countLostNum(dateType, state, year, |
| | | startTime, endTime);
|
| | | |
| | | |
| | | JSONObject innerList = new JSONObject();
|
| | | if (state == 1) {
|
| | | innerList.put("name", "未处理");
|
| | |
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | |
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | | try {
|
| | |
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | |
| | | List<Map<String, Object>> list = lostOrderService.countAppealMoney(dateType, year, startTime, endTime);
|
| | | |
| | | |
| | | List<ChartTDO> list = lostOrderService.countAppealMoney(dateType, year, startTime, endTime);
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | | line_list.add(innerList);
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | |
| | | } 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();
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | |
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | for (String channel : channelList) {
|
| | | List<Map<String, Object>> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year,
|
| | | List<ChartTDO> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | |
| | | */
|
| | | public JSONObject countHistoryHongBao(String channelArray, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime, int countType) throws Exception {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | |
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | | List<Map<String, Object>> list = null;
|
| | | List<ChartTDO> list = null;
|
| | | if (countType == 1) {
|
| | | list = hongBaoV2CountService.countHongBaoNum(channel, dateType, state, year, startTime, endTime);
|
| | | } else if (countType == 2) {
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | return data;
|
| | | }
|
| | |
|
| | |
| | | @RequestMapping(value = "getTypeNumber")
|
| | | public void getTypeNumber(String callback, Integer dateType, String typeArray, 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));
|
| | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | try {
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | for (Integer type : channelList) {
|
| | |
|
| | | List<Map<String, Object>> list = hongBaoV2CountService.countHongBaoType(dateType, type, year, startTime,
|
| | | List<ChartTDO> list = hongBaoV2CountService.countHongBaoType(dateType, type, year, startTime,
|
| | | endTime);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | if (type == 1) {
|
| | | innerList.put("name", "返利订单");
|
| | |
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | List<Map<String, Object>> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime,
|
| | | List<ChartTDO> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime,
|
| | | endTime, sourceType);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | List<Map<String, Object>> list = null;
|
| | | List<ChartTDO> list = null;
|
| | | if (countType == 1) {
|
| | | list = commonOrderCountService.countWeiQaunOrderNumber(dateType, year, startTime, endTime);
|
| | | } else if (countType == 2) {
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | |
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | |
|
| | | List<Map<String, Object>> list = userInfoCountService.countNewUserByDate(channel, dateType, year,
|
| | | List<ChartTDO> list = userInfoCountService.countNewUserByDate(channel, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | |
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | |
|
| | | List<Map<String, Object>> list = userInfoCountService.getTodayBuyRate(channel, dateType, year,
|
| | | List<ChartTDO> list = userInfoCountService.getTodayBuyRate(channel, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.service.inter.count.UserSystemCouponCountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponGiveRecordService;
|
| | |
| | | public void getFreeCouponMoneyCharts(String callback, Integer dateType, String year, String startTime,
|
| | | String endTime, Integer coupon, PrintWriter out){
|
| | | try {
|
| | | |
| | | if (coupon == null || (coupon.intValue() < 0 && coupon.intValue() > 4)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("券类型不正确"));
|
| | | return;
|
| | |
| | | couponType = "freeCouponBuy";
|
| | | }
|
| | |
|
| | | |
| | | JSONObject data = getChartsData(dateType, year, startTime, endTime, 3, couponType);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | |
| | |
|
| | | public JSONObject getChartsData(Integer dateType, String year, String startTime,
|
| | | String endTime, int source, String couponType) throws Exception {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | List<Map<String, Object>> list = null;
|
| | | List<ChartTDO> list = null;
|
| | | if (source == 1) {
|
| | | // 奖励券数量
|
| | | innerList.put("name", "数量");
|
| | |
| | | startTime, endTime, couponType);
|
| | | }
|
| | |
|
| | | |
| | | Object objectDate = null;
|
| | | |
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
|
| | | public class AdminUtils {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public static Map<String, Object> yearsDataFactory(List<Map<String, Object>> list) {
|
| | | public static Map<String, Object> yearsDataFactory(List<ChartTDO> list) {
|
| | |
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | | List<Object> listDate = new ArrayList<Object>();
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object showValue = map.get("showValue");
|
| | | Object showDate = map.get("showDate");
|
| | | |
| | | for (ChartTDO chart: list) {
|
| | | String showDate = chart.getShowDate();
|
| | | String showValue = chart.getShowValue();
|
| | | if (showValue == null) {
|
| | | showValue = 0;
|
| | | showValue = "0";
|
| | | }
|
| | | |
| | | resultList.add(showValue);
|
| | | listDate.add(showDate);
|
| | | }
|
| | |
| | |
|
| | |
|
| | | public static List<Object> dayOrMonthDataFactory(Integer dateType, List<String> listDate ,
|
| | | List<Map<String, Object>> list) throws Exception {
|
| | |
|
| | | List<ChartTDO> list) throws Exception {
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | | |
| | | if (list != null && list.size() > 0) {
|
| | | for (int i = 0; i < listDate.size(); i++) {
|
| | | |
| | | Object showValue = null;
|
| | | if (list != null && list.size() > 0) {
|
| | | String showValue = null;
|
| | | // 日期匹配赋值
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | |
| | | for (ChartTDO chart: list) {
|
| | | String showDate = listDate.get(i);
|
| | | if (dateType == 2 && Integer.parseInt(showDate) < 10 ) {
|
| | | showDate = "0" + showDate;
|
| | | }
|
| | | |
| | | Object reslutDate = map.get("showDate");
|
| | | String reslutTime = reslutDate.toString();
|
| | | |
| | | String reslutTime = chart.getShowDate();
|
| | | if (showDate.equalsIgnoreCase(reslutTime)) {
|
| | | showValue = map.get("showValue");
|
| | | showValue = chart.getShowValue();
|
| | | break;
|
| | | }
|
| | | |
| | | }
|
| | | }
|
| | | |
| | |
|
| | | if (showValue == null) {
|
| | | showValue = 0;
|
| | | showValue = "0";
|
| | | }
|
| | | resultList.add(showValue);
|
| | | }
|
| | | }
|
| | | |
| | | return resultList;
|
| | | }
|
| | |
|
| | |
| | | * @throws Exception
|
| | | */
|
| | | public static JSONObject chartDataFactory(Integer dateType, String year, String startTime, String endTime,
|
| | | List<Map<String, Object>> list) throws Exception{
|
| | | List<ChartTDO> list) throws Exception{
|
| | |
|
| | | Object objectDate = null;
|
| | | List<String> dateList = getDateList(dateType, startTime, endTime, year);
|
| | |
| | | case 4:
|
| | | break;
|
| | | case 5:
|
| | | list.add(new GoodsClass(0L, "全部"));
|
| | | list.add(new GoodsClass(1L, "淘宝"));
|
| | | list.add(new GoodsClass(2L, "京东"));
|
| | | list.add(new GoodsClass(3L, "拼多多"));
|
| | | break;
|
| | | default:
|
| | | break;
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.jd.JDCategoryInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ShamUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.jd.JDGoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyExtraService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | |
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | | @Resource
|
| | | private JDGoodsClassService jdGoodsClassService;
|
| | | |
| | |
|
| | | /**
|
| | | * 淘宝商品详情
|
| | |
| | |
|
| | | // 附加信息
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | |
| | | // 京东plus返利
|
| | | String maxMoneyPlus = null;
|
| | | JDCategoryInfo categoryInfo = jdGoods.getCategoryInfo();
|
| | | if (categoryInfo != null && categoryInfo.getCid3() != null && jdGoods.getCommissionInfo() != null) {
|
| | | Long cid3 = categoryInfo.getCid3();
|
| | | JDGoodsClass threeClass = jdGoodsClassService.getThreeClassByCid(Integer.parseInt(cid3.toString()));
|
| | | if (threeClass != null && threeClass.getSelfComm() != null && threeClass.getSelfComm().compareTo(new BigDecimal(0)) > 0) {
|
| | | BigDecimal commissionShare = jdGoods.getCommissionInfo().getCommissionShare();
|
| | | // plus比例 小于正常比例
|
| | | if (commissionShare != null && commissionShare.compareTo(threeClass.getSelfComm()) > 0) {
|
| | | jdGoods.setCommissionPlus(threeClass.getSelfComm());
|
| | | // plus返利
|
| | | BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods, fanLiRate);
|
| | | otherInfo.setFanliMoneyPlus("京东plus会员返¥" + fanliMoneyPlus);
|
| | | // 使用奖励券最高返
|
| | | maxMoneyPlus = "(京东plus会员最高返¥"+ fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))+")";
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | // 奖励券返利
|
| | | RewardCouponVO rewardCoupon = new RewardCouponVO();
|
| | | rewardCoupon.setMaxMoneyPlus(maxMoneyPlus);
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("integralExchange"));
|
| | | JSONObject params1=new JSONObject();
|
| | | params1.put("balanceMore", true);
|
| | |
| | | } else {
|
| | | long rebateOrder = hongBaoV2CountService.countRebateOrder(uid);
|
| | | long shareOrInviteOrder = hongBaoV2CountService.countShareOrInviteOrder(uid);
|
| | | if (rebateOrder <= 0 && shareOrInviteOrder <= 0) {
|
| | | if (rebateOrder + shareOrInviteOrder >= 3) {
|
| | | // 熟客版
|
| | | } else if (rebateOrder <= 0 && shareOrInviteOrder <= 0) {
|
| | | // 新人版
|
| | | tips = configService.get("tip_guide_new_user");
|
| | | } else if (rebateOrder > 0 && shareOrInviteOrder <= 0) {
|
| | | // 省钱版
|
| | | tips = configService.get("tip_guide_save_money");
|
| | | } else if (shareOrInviteOrder > 0) {
|
| | | } else {
|
| | | // 赚钱版
|
| | | tips = configService.get("tip_guide_share_invite");
|
| | | } else {
|
| | | // 熟客版
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.douyin.DouYinGoods;
|
| | | import com.yeshi.fanli.dto.jd.JDFilter;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchFilter;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.DouYinUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | |
| | | type = 4;
|
| | | tb = TaoBaoUtil.getTmallGoodsInfo(id);
|
| | | }
|
| | | } else if (text.contains("v.douyin.com")) { // 抖音
|
| | | analysisDouYin(acceptData, text, out);
|
| | | return;
|
| | | } else {
|
| | | tb = TaoBaoUtil.parsePhoneShareUrlByTB(text);
|
| | | if (tb == null)// 淘宝是空值
|
| | |
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 解析抖音链接
|
| | | * @param acceptData
|
| | | * @param text
|
| | | * @param out
|
| | | * @return
|
| | | */
|
| | | private void analysisDouYin(AcceptData acceptData, String text, PrintWriter out) {
|
| | | String location = HttpUtil.getLocation(text);
|
| | | if (!StringUtil.isNullOrEmpty(location)) {
|
| | | if (location.contains("taobao.com")) { // 淘宝商品
|
| | | String realUrl = TaoBaoUtil.getRealUrl(location);
|
| | | if (!StringUtil.isNullOrEmpty(realUrl)) {
|
| | | getRecommendInfo(acceptData, realUrl, null, out);
|
| | | return;
|
| | | }
|
| | | } else if (location.contains("haohuo.jinritemai.com")) { // 抖音商品
|
| | | DouYinGoods goods = DouYinUtil.getGoodsInfo(location);
|
| | | JSONObject goodsJSON = new JSONObject();
|
| | | goodsJSON.put("title", goods.getName());
|
| | | goodsJSON.put("pictUrl", goods.getImg());
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("type", 4);
|
| | | data.put("desc", "该商品无推广信息");
|
| | | data.put("goods", goodsJSON);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | }
|
| | | out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
|
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 解析淘口令
|
| | | * @param acceptData
|
| | | * @param text
|
| | | * @param out
|
| | | * @return
|
| | | */
|
| | | private boolean analysisTaoToken(AcceptData acceptData, String text, PrintWriter out) {
|
| | | String token = StringUtil.picUpTaoToken(text);
|
| | | if (!StringUtil.isNullOrEmpty(token)) {
|
| | |
| | | package com.yeshi.fanli.dao.mybatis;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | |
|
| | | public interface ExtractAuditRecordMapper {
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countAuditTotal(@Param("state")Integer state, @Param("type")Integer type,
|
| | | List<ChartTDO> countAuditTotal(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countExtractMoney(@Param("state")Integer state, @Param("type")Integer type,
|
| | | List<ChartTDO> countExtractMoney(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countExtractApplyNumber(@Param("state")Integer state, @Param("type")Integer type,
|
| | | List<ChartTDO> countExtractApplyNumber(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | |
|
| | | }
|
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO; |
| | | |
| | | public interface HongBaoV2CountMapper { |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoMoney(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | List<ChartTDO> countHongBaoMoney(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoNum(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | List<ChartTDO> countHongBaoNum(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoType(@Param("dateType") Integer dateType, @Param("type") Integer type, |
| | | List<ChartTDO> countHongBaoType(@Param("dateType") Integer dateType, @Param("type") Integer type, |
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoTotalNum(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countHongBaoTotalNum(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | // 累计提成订单数量(包含无效订单) |
| | |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> count24HOderByChannel(@Param("channel") String channel, @Param("type") Integer type, |
| | | List<ChartTDO> count24HOderByChannel(@Param("channel") String channel, @Param("type") Integer type, |
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | List<HongBaoV2VO> listShareAndInviteMoney(@Param("start") long start, @Param("count") int count, |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.vo.user.UserInfoVO; |
| | | |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countNewUserByDate(@Param("channel") String channel, @Param("type") Integer type, |
| | | List<ChartTDO> countNewUserByDate(@Param("channel") String channel, @Param("type") Integer type,
|
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getTodayHasOrder(@Param("channel") String channel, @Param("type") Integer type, |
| | | List<ChartTDO> getTodayHasOrder(@Param("channel") String channel, @Param("type") Integer type,
|
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | Map<String, Object> getWeekHasOrder(@Param("channel") String channel, @Param("startTime") String startTime, |
| | | ChartTDO getWeekHasOrder(@Param("channel") String channel, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime, @Param("orderNum") Integer orderNum); |
| | | |
| | | /** |
| | |
| | | package com.yeshi.fanli.dao.mybatis.jd; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.entity.jd.JDOrderItem; |
| | | |
| | | public interface JDOrderItemMapper extends BaseMapper<JDOrderItem> { |
| | |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | } |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | |
| | | |
| | | public interface CommonOrderCountMapper { |
| | | |
| | |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime,@Param("sourceType") int sourceType); |
| | | |
| | | |
| | |
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | |
|
| | | public interface LostOrderMapper extends BaseMapper<LostOrder> {
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countLostNum(@Param("dateType") Integer dateType, @Param("resultCode") Integer resultCode,
|
| | | List<ChartTDO> countLostNum(@Param("dateType") Integer dateType, @Param("resultCode") Integer resultCode,
|
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countAppealMoney(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | List<ChartTDO> countAppealMoney(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | |
| | | package com.yeshi.fanli.dao.mybatis.pdd; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.entity.pdd.PDDOrder; |
| | | |
| | | public interface PDDOrderMapper extends BaseMapper<PDDOrder> { |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder; |
| | | |
| | | public interface TaoBaoOrderMapper { |
| | |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; |
| | | |
| | | public interface TaoBaoWeiQuanOrderMapper { |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countWeiQaunOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countWeiQaunOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countWeiQaunOrderMoney(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countWeiQaunOrderMoney(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord; |
| | | import com.yeshi.fanli.vo.user.SystemCouponVO; |
| | | import com.yeshi.fanli.vo.user.UserSystemCouponCountVO; |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getRebateCouponUsedNumToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> getRebateCouponUsedNumToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getRebateCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> getRebateCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getFreeCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> getFreeCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("couponType")String couponType); |
| | | |
| | | } |
| | |
| | | private Long totalCount;// 有效商品总数量
|
| | | private Integer isFreeShipping; // 是否包邮(1:是,0:否,2:自营商品遵从主站包邮规则)
|
| | |
|
| | | private BigDecimal commissionPlus;// 佣金比例 : 京东plus会员 |
| | |
|
| | | public JDCategoryInfo getCategoryInfo() {
|
| | | return categoryInfo;
|
| | |
| | | public void setIsFreeShipping(Integer isFreeShipping) {
|
| | | this.isFreeShipping = isFreeShipping;
|
| | | }
|
| | |
|
| | | public BigDecimal getCommissionPlus() {
|
| | | return commissionPlus;
|
| | | }
|
| | |
|
| | | public void setCommissionPlus(BigDecimal commissionPlus) {
|
| | | this.commissionPlus = commissionPlus;
|
| | | }
|
| | | }
|
| | |
| | | <association property="extract" column="extractId" |
| | | select="com.yeshi.fanli.dao.mybatis.ExtractMapper.selectByPrimaryKey"> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">id,aid,extractId,beforeMoney,afterMoney,countMoney,countNum,orderNum,cancelOrderNum,auditTime,auditRole,extraInfo |
| | | </sql> |
| | | |
| | |
| | | |
| | | |
| | | |
| | | <select id="countAuditTotal" resultType="java.util.HashMap"> |
| | | <select id="countAuditTotal" resultMap="ChartMap">
|
| | | SELECT COALESCE(COUNT(tr.id),0) AS 'showValue', |
| | | <if test="type == 1"> |
| | | FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d') AS |
| | |
| | | ORDER BY tr.`auditTime` |
| | | </select> |
| | | |
| | | <select id="countExtractMoney" resultType="java.util.HashMap"> |
| | | <select id="countExtractMoney" resultMap="ChartMap">
|
| | | SELECT CAST(SUM(t.`money`)AS DECIMAL(19,2)) AS showValue, |
| | | <if test="type == 1"> |
| | | FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') AS |
| | |
| | | ORDER BY t.`extractTime` |
| | | </select> |
| | | |
| | | <select id="countExtractApplyNumber" resultType="java.util.HashMap"> |
| | | <select id="countExtractApplyNumber" resultMap="ChartMap">
|
| | | SELECT COUNT(t.id) AS showValue, |
| | | <if test="type == 1"> |
| | | FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') AS |
| | |
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
|
| | | </sql>
|
| | | <!-- 不能查询缓存 -->
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countNewUserByDate" resultType="java.util.HashMap">
|
| | | <select id="countNewUserByDate" resultMap="ChartMap">
|
| | | SELECT COUNT(DISTINCT h.`id`) AS showValue,
|
| | | <if test="type == 1">
|
| | | FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') AS
|
| | |
| | | ORDER BY h.`createtime`
|
| | | </select>
|
| | |
|
| | | <select id="getTodayHasOrder" resultType="java.util.HashMap">
|
| | | <select id="getTodayHasOrder" resultMap="ChartMap">
|
| | | SELECT COALESCE(COUNT(DISTINCT u.`id`),0) AS 'showValue',
|
| | | <if test="type == 1">
|
| | | FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS
|
| | |
| | |
|
| | |
|
| | |
|
| | | <select id="getWeekHasOrder" resultType="java.util.HashMap">
|
| | | <select id="getWeekHasOrder" resultMap="ChartMap">
|
| | | SELECT COUNT(DISTINCT hb.uid) AS
|
| | | showValue,FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS 'showDate'
|
| | | FROM (SELECT COUNT(v2.`hb_id`) AS num,v2.hb_uid AS uid
|
| | |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Column_DateType"> |
| | | <if test="dateType == 1"> |
| | | DATE_FORMAT(t.`hb_create_time`,'%Y-%m-%d') AS 'showDate' |
| | |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="countHongBaoMoney" resultType="java.util.HashMap"> |
| | | <select id="countHongBaoMoney" resultMap="ChartMap"> |
| | | SELECT CAST(SUM(t.`hb_money`)AS DECIMAL(19,2)) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | |
| | | ORDER BY t.`hb_create_time` |
| | | </select> |
| | | |
| | | <select id="countHongBaoNum" resultType="java.util.HashMap"> |
| | | <select id="countHongBaoNum" resultMap="ChartMap"> |
| | | SELECT COUNT(t.`hb_id`)AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="countHongBaoType" resultType="java.util.HashMap"> |
| | | <select id="countHongBaoType" resultMap="ChartMap"> |
| | | SELECT COUNT(t.`hb_id`)AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | |
| | | ORDER BY t.`hb_create_time` |
| | | </select> |
| | | |
| | | <select id="countHongBaoTotalNum" resultType="java.util.HashMap"> |
| | | <select id="countHongBaoTotalNum" resultMap="ChartMap"> |
| | | SELECT COUNT(t.`hb_id`)AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="count24HOderByChannel" resultType="java.util.HashMap"> |
| | | <select id="count24HOderByChannel" resultMap="ChartMap"> |
| | | SELECT <!-- COALESCE(SUM(b.money*2),0) AS 'commision', --> |
| | | COALESCE(COUNT(b.hb_id),0) AS 'showValue', |
| | | <!-- COALESCE(SUM(b.payMoney),0) AS 'payMoney', --> |
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="joi_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">joi_id,joi_order_id,joi_actual_cos_price,joi_actual_fee,joi_commission_rate,joi_estimate_cos_price,joi_estimate_fee,joi_final_rate,joi_cid1,joi_frozen_sku_num,joi_pid,joi_position_id,joi_price,joi_cid2,joi_site_id,joi_sku_id,joi_sku_name,joi_sku_num,joi_sku_return_num,joi_sub_side_rate,joi_sub_sidy_rate,joi_cid3,joi_union_alias,joi_union_tag,joi_union_traffic_group,joi_valid_code,joi_sub_union_id,joi_trace_type,joi_pay_month,joi_pop_id,joi_ext1,joi_trade_id,joi_create_time,joi_update_time,joi_order_by |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | |
| | | </sql> |
| | | |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | <select id="countOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(`joi_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM `yeshi_ec_jd_order_item` left join yeshi_ec_jd_order on jo_order_id=joi_order_id WHERE jo_order_time IS NOT NULL |
| | |
| | | <!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.order.CommonOrderCountMapper"> |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Column_DateType"> |
| | | <if test="dateType == 1"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | <select id="countOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(t.`co_id`),0) AS showValue,<include refid="Column_DateType"/> |
| | | FROM `yeshi_ec_common_order` t |
| | | WHERE t.co_source_type=#{sourceType} and t.`co_third_create_time` IS NOT NULL <include refid="Count_Select_DateType"/> |
| | |
| | | <association property="order" column="oid"
|
| | | select="com.yeshi.fanli.dao.mybatis.order.OrderMapper.selectByPrimaryKey" />
|
| | | </resultMap>
|
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_lost_order where id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | |
| | | <if test="handleType != null and handleType != 0">AND (d.state = 1 or d.state = 2)</if>
|
| | | <if test="type != null">AND d.type = #{type}</if>
|
| | | </select>
|
| | | <select id="countLostNum" resultType="java.util.HashMap">
|
| | | <select id="countLostNum" resultMap="ChartMap">
|
| | | SELECT COUNT(t.`id`) AS showValue,
|
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | |
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if>
|
| | | ORDER BY t.`createTime`
|
| | | </select>
|
| | | <select id="countAppealMoney" resultType="java.util.HashMap">
|
| | | <select id="countAppealMoney" resultMap="ChartMap">
|
| | | SELECT CAST(SUM(v.`hb_money`)AS DECIMAL(19,2)) AS showValue,
|
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | |
| | | <result column="po_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="po_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time,po_order_receive_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | |
| | | |
| | | |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | <select id="countOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(`po_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM `yeshi_ec_pdd_order` t WHERE po_order_create_time IS NOT NULL |
| | |
| | | <result column="to_special_id" property="specialId" jdbcType="VARCHAR" />
|
| | | <result column="to_trade_id" property="tradeId" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_pay_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | |
| | | <if test="dateType == 2">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m')</if>
|
| | | <if test="dateType == 3">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y')</if>
|
| | | </sql>
|
| | | <select id="countOrderNumber" resultType="java.util.HashMap">
|
| | | <select id="countOrderNumber" resultMap="ChartMap">
|
| | | SELECT IFNULL(COUNT(t.`to_id`),0) AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM `yeshi_ec_taobao_order` t WHERE t.`to_create_time` IS NOT NULL
|
| | |
| | | <result column="tmo_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="tmo_settlement" property="settlement" jdbcType="DECIMAL" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">tmo_id,tmo_order_id,tmo_order_item_id,tmo_goods_name,tmo_money,tmo_fan_money,tmo_state,tmo_jiesuan_time,tmo_weiquan_time,tmo_weiquan_finish_time,tmo_createtime,tmo_updatetime,tmo_settlement |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | |
| | | <if test="dateType == 2">GROUP BY DATE_FORMAT(t.`tmo_weiquan_time`,'%Y-%m')</if> |
| | | <if test="dateType == 3">GROUP BY DATE_FORMAT(t.`tmo_weiquan_time`,'%Y')</if> |
| | | </sql> |
| | | <select id="countWeiQaunOrderNumber" resultType="java.util.HashMap"> |
| | | <select id="countWeiQaunOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(t.`tmo_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_taobao_weiqaun_order t WHERE t.`tmo_createtime`IS NOT |
| | |
| | | <include refid="Count_Group_DateType" /> |
| | | ORDER BY t.`tmo_weiquan_time` |
| | | </select> |
| | | <select id="countWeiQaunOrderMoney" resultType="java.util.HashMap"> |
| | | <select id="countWeiQaunOrderMoney" resultMap="ChartMap"> |
| | | SELECT CAST(SUM(t.`tmo_fan_money`)AS DECIMAL(19,2)) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_taobao_weiqaun_order t WHERE t.`tmo_createtime` IS NOT |
| | |
| | |
|
| | | <association property="userSystemCoupon" column="ucr_user_coupon_id"
|
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper.BaseResultMap"/>
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <select id="listRebateCoupon" resultMap="BaseResultMap">
|
| | |
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="getRebateCouponUsedNumToCharts" resultType="java.util.HashMap">
|
| | | <select id="getRebateCouponUsedNumToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(COUNT(c.`usc_id`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(c.`usc_use_time`,'%Y-%m-%d') AS 'showDate'
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="getRebateCouponMoneyToCharts" resultType="java.util.HashMap">
|
| | | <select id="getRebateCouponMoneyToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(SUM(c.`hb_money`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(c.`hb_get_time`,'%Y-%m-%d') AS 'showDate'
|
| | |
| | | ORDER BY c.`hb_get_time`
|
| | | </select>
|
| | |
|
| | | <select id="getFreeCouponMoneyToCharts" resultType="java.util.HashMap">
|
| | | <select id="getFreeCouponMoneyToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(SUM(v2.`hb_money`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(v2.`hb_get_time`,'%Y-%m-%d') AS 'showDate'
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.pdd.PDDOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | |
| | | return commonOrderCountMapper.countByState(state);
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list)
|
| | | public List<ChartTDO> dayFactory(String startTime, String endTime, List<ChartTDO> list)
|
| | | throws Exception {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | if (startTime.equals(endTime)) {
|
| | |
|
| | | Map<String, Object> map = list.get(0);
|
| | | Object total = map.get("showValue");
|
| | | if (total == null) {
|
| | | map.put("showValue", 0);
|
| | | ChartTDO chartTDO = list.get(0);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | listObject.add(map);
|
| | | listObject.add(chartTDO);
|
| | | return listObject;
|
| | | }
|
| | |
|
| | |
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | if (plusDay.equalsIgnoreCase(month)) {
|
| | | total = map.get("showValue");
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | if (plusDay.equalsIgnoreCase(showDate)) {
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | mapObject.put("showDate", plusDay);
|
| | |
|
| | | listObject.add(mapObject);
|
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowDate(plusDay);
|
| | | chartTDO.setShowValue(total);
|
| | | listObject.add(chartTDO);
|
| | |
|
| | | if (plusDay.equals(endTime)) {
|
| | | break; // 时间结束
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> monthFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | public List<ChartTDO> monthFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | // 12 个月处理
|
| | | for (int i = 1; i <= 12; i++) {
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String month =chartTDO.getShowDate();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowValue(total);
|
| | | if (i < 10) {
|
| | | mapObject.put("showDate", "0" + i);
|
| | | chartTDO.setShowDate("0" + i);
|
| | | } else {
|
| | | mapObject.put("showDate", i);
|
| | | chartTDO.setShowDate(i + "");
|
| | | }
|
| | |
|
| | | listObject.add(mapObject);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> yearFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | public List<ChartTDO> yearFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object total = map.get("showValue");
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | ChartTDO chartTDO = list.get(i);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | map.put("showValue", total);
|
| | |
|
| | | listObject.add(map);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getTrackAccuracyRate(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime,
|
| | | String endTime, int sourceType) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> result_list = null;
|
| | | List<ChartTDO> result_list = null;
|
| | |
|
| | | // 用户订单
|
| | | List<Map<String, Object>> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year, startTime,
|
| | | List<ChartTDO> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year, startTime,
|
| | | endTime, sourceType);
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | // 淘宝联盟
|
| | | List<Map<String, Object>> type_list = null;
|
| | | List<ChartTDO> type_list = null;
|
| | | switch (sourceType) {
|
| | | case Constant.SOURCE_TYPE_TAOBAO:
|
| | | type_list = taoBaoOrderMapper.countOrderNumber(dateType, year, startTime, endTime);
|
| | |
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | |
|
| | | double proportion = 0;
|
| | | Map<String, Object> resultMap = result_list.get(i);
|
| | |
|
| | | Object showDate = resultMap.get("showDate");
|
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listTotal.size(); j++) {
|
| | | Map<String, Object> innerMap = listTotal.get(j);
|
| | | Object innerDate = innerMap.get("showDate");
|
| | |
|
| | | ChartTDO innerChartTDO = listTotal.get(j);
|
| | | String innerDate = innerChartTDO.getShowDate();
|
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | | Object innerValue = innerMap.get("showValue");
|
| | | long innerData = Long.parseLong(innerValue.toString());
|
| | | String innerValue = innerChartTDO.getShowValue();
|
| | | long innerData = Long.parseLong(innerValue);
|
| | |
|
| | | Object showValue = resultMap.get("showValue");
|
| | | long showData = Long.parseLong(showValue.toString());
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | |
|
| | | if (showData > 0) {
|
| | | proportion = innerData / (double) showData;
|
| | | }
|
| | |
|
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | |
|
| | | resultMap.put("showValue", Double.parseDouble(df.format(proportion * 100)));
|
| | | chartTDO.setShowValue(Double.parseDouble(df.format(proportion * 100)) + "");
|
| | | }
|
| | |
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return taoBaoWeiQuanOrderMapper.countWeiQaunOrderMoney(dateType, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countWeiQaunOrderNumber(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> countWeiQaunOrderNumber(Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return taoBaoWeiQuanOrderMapper.countWeiQaunOrderNumber(dateType, year, startTime, endTime);
|
| | | }
|
| | |
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | |
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
|
| | |
|
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list)
|
| | | public List<ChartTDO> dayFactory(String startTime, String endTime, List<ChartTDO> list)
|
| | | throws Exception {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | |
|
| | | if (startTime.equals(endTime)) {
|
| | |
|
| | | Map<String, Object> map = list.get(0);
|
| | | Object total = map.get("showValue");
|
| | | ChartTDO chartTDO = list.get(0);
|
| | | String total = chartTDO.getShowValue();
|
| | | if (total == null) {
|
| | | map.put("showValue", 0);
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | listObject.add(map);
|
| | | listObject.add(chartTDO);
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | String plusDay = "";
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd");
|
| | | for (int i = 0; i < 1000; i++) {
|
| | | if (i == 0) {
|
| | | plusDay = startTime;
|
| | |
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | ChartTDO chart = new ChartTDO();
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String createDate = chartTDO.getShowDate();
|
| | | String month = createDate.toString();
|
| | | if (plusDay.equalsIgnoreCase(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd");
|
| | | chart.setShowValue(total);
|
| | | Date parseDate = sdf.parse(plusDay.toString());
|
| | |
|
| | | mapObject.put("showDate", sdf2.format(parseDate));
|
| | |
|
| | | listObject.add(mapObject);
|
| | | chart.setShowDate(sdf2.format(parseDate));
|
| | | listObject.add(chart);
|
| | |
|
| | | if (plusDay.equals(endTime)) {
|
| | | break; // 时间结束
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> monthFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | public List<ChartTDO> monthFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | // 12 个月处理
|
| | | for (int i = 1; i <= 12; i++) {
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String createDate = chartTDO.getShowDate();
|
| | | String month = createDate.toString();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | mapObject.put("showDate", i + "月");
|
| | |
|
| | | ChartTDO mapObject = new ChartTDO();
|
| | | mapObject.setShowValue(total);
|
| | | mapObject.setShowDate(i + "月");
|
| | | listObject.add(mapObject);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> yearFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | public List<ChartTDO> yearFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object total = map.get("showValue");
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | ChartTDO chartTDO = list.get(i);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | showValue = "0";
|
| | | }
|
| | | map.put("showValue", total);
|
| | |
|
| | | listObject.add(map);
|
| | | chartTDO.setShowValue(showValue);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | public List<ChartTDO> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoMoney(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | public List<ChartTDO> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoNum(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | public List<ChartTDO> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | public List<ChartTDO> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> result_list = null;
|
| | | List<ChartTDO> result_list = null;
|
| | |
|
| | | List<Map<String, Object>> listTotal = hongBaoV2CountMapper.countHongBaoTotalNum(dateType, year, startTime,
|
| | | List<ChartTDO> listTotal = hongBaoV2CountMapper.countHongBaoTotalNum(dateType, year, startTime,
|
| | | endTime);
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> type_list = hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime,
|
| | | List<ChartTDO> type_list = hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if (type_list == null || type_list.size() == 0) {
|
| | |
| | | }
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | |
|
| | | float proportion = 0;
|
| | | Map<String, Object> resultMap = result_list.get(i);
|
| | |
|
| | | Object showDate = resultMap.get("showDate");
|
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listTotal.size(); j++) {
|
| | | Map<String, Object> innerMap = result_list.get(j);
|
| | | Object innerDate = innerMap.get("showDate");
|
| | |
|
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | | Object innerValue = innerMap.get("showValue");
|
| | | long innerData = Long.parseLong(innerValue.toString());
|
| | |
|
| | | Object showValue = resultMap.get("showValue");
|
| | | long showData = Long.parseLong(showValue.toString());
|
| | |
|
| | | ChartTDO innerChart = result_list.get(j);
|
| | | String innerDate = innerChart.getShowDate();
|
| | | if (innerDate != null && innerDate.equals(showDate)) {
|
| | | String innerValue = innerChart.getShowValue();
|
| | | long innerData = Long.parseLong(innerValue);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | | if (showData > 0) {
|
| | | proportion = innerData / showData;
|
| | | }
|
| | |
|
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | |
|
| | | resultMap.put("showValue", proportion);
|
| | | chartTDO.setShowValue(proportion+"");
|
| | | }
|
| | |
|
| | | return result_list;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.count24HOderByChannel(channel, type, years, startTime, endTime);
|
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoCountMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.service.inter.count.UserInfoCountService;
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countNewUserByDate(String channel,Integer type,String years, String startTime, |
| | | public List<ChartTDO> countNewUserByDate(String channel,Integer type,String years, String startTime, |
| | | String endTime) throws Exception {
|
| | | return userInfoMapper.countNewUserByDate(channel, type, years, startTime, endTime);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getTodayBuyRate(String channel, Integer dateType,String years, String startTime, |
| | | public List<ChartTDO> getTodayBuyRate(String channel, Integer dateType,String years, String startTime, |
| | | String endTime) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> result_list = null;
|
| | | List<ChartTDO> result_list = null;
|
| | |
|
| | | List<Map<String, Object>> listToday = |
| | | List<ChartTDO> listToday = |
| | | userInfoMapper.getTodayHasOrder(channel, dateType, years, startTime, endTime);
|
| | |
|
| | | if (listToday == null || listToday.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> listTotal = |
| | | userInfoMapper.countNewUserByDate(channel, dateType, years, startTime, endTime);
|
| | | List<ChartTDO> listTotal = userInfoMapper.countNewUserByDate(channel, dateType, years, startTime, endTime);
|
| | |
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | |
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | | |
| | | double proportion = 0;
|
| | | Map<String, Object> resultMap = result_list.get(i);
|
| | | Object showDate = resultMap.get("showDate");
|
| | | |
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listToday.size(); j++) {
|
| | | ChartTDO innerTDO = listToday.get(j);
|
| | | String innerDate = innerTDO.getShowDate();
|
| | | if (innerDate != null && innerDate.equals(showDate)) {
|
| | | String innerValue = innerTDO.getShowValue();
|
| | | long innerData = Long.parseLong(innerValue);
|
| | |
|
| | | Map<String, Object> innerMap = listToday.get(j);
|
| | | Object innerDate = innerMap.get("showDate");
|
| | | |
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | | Object innerValue = innerMap.get("showValue");
|
| | | long innerData = Long.parseLong(innerValue.toString());
|
| | | |
| | | Object showValue = resultMap.get("showValue");
|
| | | long showData = Long.parseLong(showValue.toString());
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | |
|
| | | if (showData > 0) {
|
| | | proportion = innerData/(double)showData;
|
| | | }
|
| | | |
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | | |
| | | resultMap.put("showValue", Double.parseDouble(df.format(proportion *100)));
|
| | | chartTDO.setShowValue(Double.parseDouble(df.format(proportion *100)) + "");
|
| | | }
|
| | | |
| | | return result_list;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<Object> getWeekBuyRate(String channel, String startTime, String endTime,
|
| | | Integer orderNum, List<String> dateList)
|
| | | throws Exception {
|
| | |
|
| | | Integer orderNum, List<String> dateList) throws Exception {
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | |
|
| | | if (dateList == null || dateList.size() == 0) {
|
| | | return resultList;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> totalList = userInfoMapper.countNewUserByDate(channel, 1, null, startTime, endTime);
|
| | | List<ChartTDO> totalList = userInfoMapper.countNewUserByDate(channel, 1, null, startTime, endTime);
|
| | | if (totalList == null || totalList.size() == 0) {
|
| | | return resultList;
|
| | | }
|
| | |
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | | for (int i = 0; i < dateList.size(); i++) {
|
| | | double proportion = 0;
|
| | |
|
| | | String showDate = dateList.get(i);
|
| | | String plusDay = DateUtil.plusDay(7, showDate);
|
| | | Map<String, Object> map = userInfoMapper.getWeekHasOrder(channel, showDate, plusDay, orderNum);
|
| | | ChartTDO chartTDO = userInfoMapper.getWeekHasOrder(channel, showDate, plusDay, orderNum);
|
| | |
|
| | | Object showValue = null;
|
| | | if (map != null) {
|
| | | showValue = map.get("showValue");
|
| | |
|
| | | String showValue = null;
|
| | | if (chartTDO != null) {
|
| | | showValue = chartTDO.getShowValue();
|
| | | if (showValue != null) {
|
| | | for (int j = 0; j < totalList.size(); j++) {
|
| | | Map<String, Object> mapTotal = totalList.get(j);
|
| | | String reslutTime = mapTotal.get("showDate").toString();
|
| | | ChartTDO chart = totalList.get(j);
|
| | | String reslutTime = chart.getShowDate();
|
| | | if (showDate.equalsIgnoreCase(reslutTime)) {
|
| | | Object totalObject = mapTotal.get("showValue");
|
| | |
|
| | | long hasCount = Long.parseLong(showValue.toString());
|
| | | long total = Long.parseLong(totalObject.toString());
|
| | | String totalObject = chart.getShowValue();
|
| | | long hasCount = Long.parseLong(showValue);
|
| | | long total = Long.parseLong(totalObject);
|
| | |
|
| | | if (total > 0) {
|
| | | proportion = hasCount / (double) total;
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | public List<ChartTDO> dayFactory(String startTime, String endTime, List<ChartTDO> list) throws Exception {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | if (startTime.equals(endTime)) {
|
| | |
|
| | | Map<String, Object> map = list.get(0);
|
| | | Object total = map.get("showValue");
|
| | | if (total == null) {
|
| | | map.put("showValue", 0);
|
| | | ChartTDO chartTDO = list.get(0);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | listObject.add(map);
|
| | | listObject.add(chartTDO);
|
| | | return listObject;
|
| | | }
|
| | |
|
| | |
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String month = chartTDO.getShowDate();
|
| | | if (plusDay.equalsIgnoreCase(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | mapObject.put("showDate", plusDay);
|
| | |
|
| | | listObject.add(mapObject);
|
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowValue(total);
|
| | | chartTDO.setShowDate(plusDay);
|
| | | listObject.add(chartTDO);
|
| | |
|
| | | if (plusDay.equals(endTime)) {
|
| | | break; // 时间结束
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> monthFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | public List<ChartTDO> monthFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | // 12 个月处理
|
| | | for (int i = 1; i <= 12; i++) {
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String month = chartTDO.getShowDate();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | | |
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowValue(total);
|
| | |
|
| | | if (i <10) {
|
| | | mapObject.put("showDate", "0"+ i);
|
| | | chartTDO.setShowDate( "0"+ i);
|
| | | } else {
|
| | | mapObject.put("showDate", i);
|
| | | chartTDO.setShowDate( ""+ i);
|
| | | }
|
| | |
|
| | | listObject.add(mapObject);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> yearFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | public List<ChartTDO> yearFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object total = map.get("showValue");
|
| | |
|
| | | ChartTDO chartTDO = list.get(i);
|
| | | String total = chartTDO.getShowValue();
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | map.put("showValue", total);
|
| | |
|
| | | listObject.add(map);
|
| | | chartTDO.setShowValue(total);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponCountMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getRebateCouponUsedNumToCharts(Integer dateType, String year, |
| | | public List<ChartTDO> getRebateCouponUsedNumToCharts(Integer dateType, String year, |
| | | String startTime, String endTime){
|
| | | return userSystemCouponCountMapper.getRebateCouponUsedNumToCharts(dateType, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getRebateCouponMoneyToCharts(Integer dateType, String year, |
| | | public List<ChartTDO> getRebateCouponMoneyToCharts(Integer dateType, String year, |
| | | String startTime, String endTime){
|
| | | return userSystemCouponCountMapper.getRebateCouponMoneyToCharts(dateType, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime, |
| | | public List<ChartTDO> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime, |
| | | String endTime, String couponType){
|
| | | return userSystemCouponCountMapper.getFreeCouponMoneyToCharts(dateType, year, startTime, endTime, couponType);
|
| | | }
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.ExtractAuditRecordMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.dto.money.ExtractOrderStatisticDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractAuditRecordService;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countAuditTotal(state, type, years, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countExtractMoney(state, type, years, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countExtractApplyNumber(Integer state, Integer type, String years,
|
| | | public List<ChartTDO> countExtractApplyNumber(Integer state, Integer type, String years,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countExtractApplyNumber(state, type, years, startTime, endTime);
|
| | | }
|
| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.LostOrderMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | public List<ChartTDO> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return lostOrderMapper.countLostNum(dateType, resultCode, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | public List<ChartTDO> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception {
|
| | | return lostOrderMapper.countAppealMoney(dateType, year, startTime, endTime);
|
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | | public interface HongBaoV2CountService {
|
| | |
| | | * 结束时间
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | public List<ChartTDO> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * 结束时间
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | public List<ChartTDO> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | public List<ChartTDO> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | public Date getLastHongBaoTime(Long uid);
|
| | |
|
| | | public List<Map<String, Object>> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | public List<ChartTDO> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | |
|
| | |
| | | * 统计新增用户
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countNewUserByDate(String channel,Integer type,String years, String startTime, String endTime) throws Exception;
|
| | | public List<ChartTDO> countNewUserByDate(String channel,Integer type,String years, String startTime, String endTime) throws Exception;
|
| | |
|
| | |
|
| | |
|
| | | public List<Map<String, Object>> getTodayBuyRate(String channel, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> getTodayBuyRate(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.inter.count;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.vo.user.SystemCouponVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponCountVO;
|
| | |
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> getRebateCouponUsedNumToCharts(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getRebateCouponUsedNumToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> getRebateCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getRebateCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param couponType
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime, String couponType);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.money.extract;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | |
|
| | | public interface ExtractAuditRecordService {
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>>countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO>countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | |
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countExtractApplyNumber(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> countExtractApplyNumber(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | |
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | |
|
| | |
|
| | | public interface CommonOrderCountService {
|
| | |
|
| | |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> getTrackAccuracyRate(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime,
|
| | | String endTime,int sourceType) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> countWeiQaunOrderNumber(Integer dateType, String year, String startTime, String endTime)
|
| | | public List<ChartTDO> countWeiQaunOrderNumber(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | import java.util.Map;
|
| | | import java.util.concurrent.locks.ReentrantReadWriteLock;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | |
|
| | | public interface LostOrderService {
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | public List<ChartTDO> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | public List<Map<String, Object>> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | public List<ChartTDO> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.select.Elements;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.StringUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.douyin.DouYinGoods;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class DouYinUtil {
|
| | |
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 通过链接获取商品标题,图片信息
|
| | | * @param url
|
| | | * @return
|
| | | */
|
| | | public static DouYinGoods getGoodsInfo(String url) {
|
| | | if (StringUtil.isNullOrEmpty(url)) |
| | | return null;
|
| | | |
| | | try {
|
| | | String id = null;
|
| | | int indexOf = url.indexOf("?");
|
| | | url = url.substring(indexOf + 1, url.length()-1);
|
| | | String[] temp = url.split("&");
|
| | | for (int i =0; i < temp.length; i ++) {
|
| | | String content = temp[i];
|
| | | if (content.startsWith("id")) {
|
| | | id = content.split("=")[content.split("=").length-1];
|
| | | break;
|
| | | } |
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(id)) |
| | | return null;
|
| | | |
| | | // 请求地址
|
| | | String requestUrl = "https://ec.snssdk.com/product/fxgajaxstaticitem?b_type_new=0&id=%s";
|
| | | // 执行请求
|
| | | String result = HttpUtil.get(String.format(requestUrl,id));
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject data = json.getJSONObject("data");
|
| | | |
| | | DouYinGoods goods = new DouYinGoods();
|
| | | goods.setId(id);
|
| | | goods.setName(data.optString("name"));
|
| | | goods.setImg(data.optString("img"));
|
| | | return goods;
|
| | | |
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.GoodsClassDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDCommissionInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo;
|
| | |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | return BigDecimalUtil.getWithNoZera(MoneyBigDecimalUtil.mul(money, new BigDecimal("0.9")));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 商品佣金计算
|
| | | * |
| | | * @param goods
|
| | | * @param rate
|
| | | * @return
|
| | | */
|
| | | public static BigDecimal getGoodsFanLiMoneyPlus(JDGoods goods, BigDecimal rate) {
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | BigDecimal commissionPlus = goods.getCommissionPlus();
|
| | | if (commissionPlus == null) {
|
| | | return money;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | BigDecimal price = null;
|
| | | JDPingouInfo pinGouInfo = goods.getPinGouInfo();
|
| | | if (pinGouInfo == null) {
|
| | | price = goods.getPrice();
|
| | | } else {
|
| | | price = pinGouInfo.getPingouPrice();
|
| | | }
|
| | |
|
| | | JDCouponInfo couponInfo = goods.getCouponInfo();
|
| | | if (couponInfo == null) {
|
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil
|
| | | .mul(MoneyBigDecimalUtil.mul(price, commissionPlus), new BigDecimal("0.01")),
|
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | } else {
|
| | | BigDecimal quota = couponInfo.getQuota();
|
| | | BigDecimal discount = couponInfo.getDiscount();
|
| | | if (quota.compareTo(price) <= 0 && price.compareTo(discount) > 0) {
|
| | |
|
| | | BigDecimal finalPrice = price.subtract(discount);
|
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(
|
| | | MoneyBigDecimalUtil.mul(finalPrice, commissionPlus),
|
| | | new BigDecimal("0.01")), MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | |
|
| | | } else {// 不能用券
|
| | | money = MoneyBigDecimalUtil.mul(
|
| | | MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(price,commissionPlus),
|
| | | new BigDecimal("0.01")),
|
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | }
|
| | | }
|
| | | // 返利比例为原来的90%
|
| | | return BigDecimalUtil.getWithNoZera(MoneyBigDecimalUtil.mul(money, new BigDecimal("0.9")));
|
| | | }
|
| | | |
| | | /**
|
| | | * 计算商品券后价,没有券则返回原价
|
| | | *
|
| | |
| | | return jdGoods;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 获取类目
|
| | | * @param level 等级
|
| | | * @param parentId 上级id
|
| | | * @return
|
| | | */
|
| | | public static List<GoodsClassDTO> getCategoryList(int level, int parentId) {
|
| | | try {
|
| | | // 请求地址
|
| | | String requestUrl = "https://union.jd.com/api/help/getCategoryList?level=%s&parentId=%s";
|
| | | // 执行请求
|
| | | String result = HttpUtil.get(String.format(requestUrl, level, parentId));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONArray jsonArray = json.getJSONArray("data");
|
| | | if (jsonArray != null && jsonArray.size() > 0) {
|
| | | List<GoodsClassDTO> list = new ArrayList<GoodsClassDTO>();
|
| | | for (int i=0;i <jsonArray.size() ;i ++ ) {
|
| | | Object object = jsonArray.get(i);
|
| | | if (object == null)
|
| | | continue;
|
| | | JSONObject jsonClass = JSONObject.fromObject(object);
|
| | | |
| | | GoodsClassDTO goodsClass = new GoodsClassDTO();
|
| | | goodsClass.setId(jsonClass.optString("id"));
|
| | | goodsClass.setName(jsonClass.optString("categoryName"));
|
| | | list.add(goodsClass);
|
| | | }
|
| | | return list;
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取类目
|
| | | * @param level 等级
|
| | | * @param parentId 上级id
|
| | | * @return
|
| | | */
|
| | | public static List<GoodsClassDTO> getCategoryCommiPlus(int level, int parentId) {
|
| | | try {
|
| | | // 请求地址
|
| | | String requestUrl = "https://union.jd.com/api/help/getCategoryCommiPlus?level=%s&parentId=%s";
|
| | | // 执行请求
|
| | | String result = HttpUtil.get(String.format(requestUrl, level, parentId));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONArray jsonArray = json.getJSONArray("data");
|
| | | if (jsonArray != null && jsonArray.size() > 0) {
|
| | | List<GoodsClassDTO> list = new ArrayList<GoodsClassDTO>();
|
| | | for (int i=0;i <jsonArray.size() ;i ++ ) {
|
| | | Object object = jsonArray.get(i);
|
| | | if (object == null)
|
| | | continue;
|
| | | JSONObject jsonClass = JSONObject.fromObject(object);
|
| | | |
| | | GoodsClassDTO goodsClass = new GoodsClassDTO();
|
| | | goodsClass.setId(jsonClass.optString("id"));
|
| | | goodsClass.setName(jsonClass.optString("name"));
|
| | | |
| | | String selfMobileComm = jsonClass.optString("selfMobileComm");
|
| | | if (!StringUtil.isNullOrEmpty(selfMobileComm)) |
| | | goodsClass.setSelfComm(new BigDecimal(selfMobileComm));
|
| | | |
| | | String popMobileComm = jsonClass.optString("popMobileComm");
|
| | | if (!StringUtil.isNullOrEmpty(popMobileComm)) |
| | | goodsClass.setPopComm(new BigDecimal(popMobileComm));
|
| | | |
| | | list.add(goodsClass);
|
| | | }
|
| | | return list;
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.net.URLDecoder;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | |
| | | import javax.xml.parsers.DocumentBuilderFactory;
|
| | |
|
| | | import org.apache.commons.httpclient.HttpClient;
|
| | | import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
|
| | | import org.apache.commons.httpclient.methods.GetMethod;
|
| | | import org.apache.commons.httpclient.params.HttpMethodParams;
|
| | | import org.jsoup.Connection;
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | |
| | | return taoBaoGoodsBrief;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 抖音返利local 获取真实淘宝链接
|
| | | * @param url https://s.click.taobao.com/t?e=m%3D2%26s%3DT9DFpHQCT7Rw4vFB6t2Z2ueEDrYVVa64XoO8tOebS+dRAdhuF14FMR8
|
| | | * @return
|
| | | */
|
| | | public static String getRealUrl(String url) {
|
| | | if (StringUtil.isNullOrEmpty(url))
|
| | | return null;
|
| | | |
| | | try {
|
| | | HttpClient client = new HttpClient(new MultiThreadedHttpConnectionManager());
|
| | | client.getHttpConnectionManager().getParams().setConnectionTimeout(10000);
|
| | | client.getParams().setParameter(HttpMethodParams.USER_AGENT,"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"); // 让服务器认为是IE
|
| | | GetMethod get = new GetMethod(url);
|
| | | get.setFollowRedirects(false); // 禁止自动重定向
|
| | | int iGetResultCode = client.executeMethod(get);
|
| | | String location = get.getResponseHeader("location").getValue(); // 打印地址
|
| | | GetMethod get2 = new GetMethod(URLDecoder.decode(location.split("tu=")[1]));
|
| | | get2.addRequestHeader("Referer", location);
|
| | | get2.setFollowRedirects(false); // 禁止自动重定向
|
| | | int iGetResultCode2 = client.executeMethod(get2);
|
| | | return get2.getResponseHeader("location").getValue(); // 真实地址
|
| | | } catch (Exception ex) {
|
| | | ex.printStackTrace();
|
| | | } |
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | |
| | | @Expose
|
| | | private RewardCouponVO rewardCoupon;
|
| | |
|
| | | @Expose
|
| | | private String fanliMoneyPlus;
|
| | | |
| | | |
| | |
|
| | | public RewardCouponVO getRewardCoupon() {
|
| | | return rewardCoupon;
|
| | | }
|
| | |
| | | this.reduceHongBao = reduceHongBao;
|
| | | }
|
| | |
|
| | | public String getFanliMoneyPlus() {
|
| | | return fanliMoneyPlus;
|
| | | }
|
| | |
|
| | | public void setFanliMoneyPlus(String fanliMoneyPlus) {
|
| | | this.fanliMoneyPlus = fanliMoneyPlus;
|
| | | }
|
| | | }
|
| | |
| | | private JumpDetailV2 jumpDetail;
|
| | | @Expose
|
| | | private String params;
|
| | | @Expose
|
| | | private String maxMoneyPlus;
|
| | |
|
| | | public String getMaxMoney() {
|
| | | return maxMoney;
|
| | |
| | | this.params = params;
|
| | | }
|
| | |
|
| | | public String getMaxMoneyPlus() {
|
| | | return maxMoneyPlus;
|
| | | }
|
| | |
|
| | | public void setMaxMoneyPlus(String maxMoneyPlus) {
|
| | | this.maxMoneyPlus = maxMoneyPlus;
|
| | | }
|
| | |
|
| | | }
|