| | |
| | | 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.admin.count.CountUserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | @RequestMapping(value = "getAuditTotal")
|
| | | public void getAuditTotal(String callback, String stateArray, Integer dateType, String year, String startTime,
|
| | | String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | try {
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | Date beginDate = null;
|
| | | Date endDate = null;
|
| | | |
| | | if (dateType == 1) {
|
| | | beginDate = TimeUtil.parse(startTime);
|
| | | endDate = TimeUtil.parse(endTime);
|
| | | } else if (dateType == 2) {
|
| | | Calendar calendar=Calendar.getInstance(); |
| | | int currentYear = calendar.get(Calendar.YEAR);
|
| | | if (!StringUtil.isNullOrEmpty(year)) {
|
| | | currentYear = Integer.parseInt(year);
|
| | | }
|
| | | calendar.clear();
|
| | | calendar.set(Calendar.YEAR, currentYear);
|
| | | beginDate =calendar.getTime();
|
| | | |
| | | calendar.clear();
|
| | | calendar.set(Calendar.YEAR, currentYear);
|
| | | calendar.roll(Calendar.DAY_OF_YEAR, -1);
|
| | | endDate=calendar.getTime(); |
| | | } else if (dateType == 3) {
|
| | | beginDate = TimeUtil.parse("2018-01-01");
|
| | | endDate = new Date();
|
| | | }
|
| | | Gson gson = new Gson();
|
| | | List<Integer> stateList = gson.fromJson(stateArray, new TypeToken<ArrayList<Integer>>() {
|
| | | }.getType());
|
| | |
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | | String substring = stateArray.substring(1, stateArray.length()-1);
|
| | | List<Integer> channelList = null;
|
| | | if (stateArray != null && stateArray.trim().length() > 4) {
|
| | | channelList = gson.fromJson(stateArray, new TypeToken<ArrayList<Integer>>() {}.getType());
|
| | | }
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | for (Integer state : stateList) {
|
| | | JSONObject innerList = new JSONObject();
|
| | | if (state == null || state == 3) {
|
| | | innerList.put("name", "总计");
|
| | | } else if (state == 1) {
|
| | | innerList.put("name", "通过数");
|
| | | } else if (state == 2) {
|
| | | innerList.put("name", "驳回数");
|
| | | }
|
| | |
|
| | | List<ChartTDO> list = extractAuditRecordService.countAuditTotal(state, dateType, year, startTime,
|
| | | endTime);
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | |
| | | if (channelList != null && channelList.size() > 0) {
|
| | | for (Integer state : channelList) {
|
| | | List<Object> list = getAuditData(dateList, dateType, beginDate, endDate, state);
|
| | | String name = "";
|
| | | if (state == 1) {
|
| | | name = "通过";
|
| | | } else if (state == 2) {
|
| | | name = "驳回";
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", name);
|
| | | innerList.put("data", gson.toJson(list));
|
| | | line_list.add(innerList);
|
| | | }
|
| | | } else {
|
| | | List<Object> list = getAuditData(dateList, dateType, beginDate, endDate, null);
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "全部");
|
| | | innerList.put("data", gson.toJson(list));
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | private List<Object> getAuditData(List<String> dateList, Integer dateType, Date beginDate, Date endDate, |
| | | Integer state) throws Exception{
|
| | | List<Object> list = new ArrayList<>();
|
| | | List<CountUserInfo> listHistory = extractAuditRecordService.getAuditCount(beginDate, endDate, state);
|
| | | for (String date: dateList) {
|
| | | int value = 0;
|
| | | if (listHistory != null) {
|
| | | for (CountUserInfo history: listHistory) {
|
| | | if (dateType == 1) {
|
| | | String gernalTime = TimeUtil.getGernalTime(history.getDay().getTime());
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | } else if (dateType == 2){
|
| | | String gernalTime = TimeUtil.getMonthOnlyMM(history.getDay());
|
| | | if(gernalTime.startsWith("0")) {
|
| | | gernalTime = gernalTime.substring(1, 2);
|
| | | }
|
| | | |
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | } else if (dateType == 3) {
|
| | | String gernalTime = TimeUtil.getYearOnlyYYYY(history.getDay());
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | list.add(value + "");
|
| | | }
|
| | | |
| | | return list;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | @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));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | Gson gson = new Gson();
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | List<ChartTDO> list = extractAuditRecordService.countExtractApplyMoney(null, dateType, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | Date beginDate = null;
|
| | | Date endDate = null;
|
| | | if (dateType == 1) {
|
| | | beginDate = TimeUtil.parse(startTime);
|
| | | endDate = TimeUtil.parse(endTime);
|
| | | } else if (dateType == 2) {
|
| | | Calendar calendar=Calendar.getInstance(); |
| | | int currentYear = calendar.get(Calendar.YEAR);
|
| | | if (!StringUtil.isNullOrEmpty(year)) {
|
| | | currentYear = Integer.parseInt(year);
|
| | | }
|
| | | |
| | | calendar.clear();
|
| | | calendar.set(Calendar.YEAR, currentYear);
|
| | | beginDate =calendar.getTime();
|
| | | |
| | | calendar.clear();
|
| | | calendar.set(Calendar.YEAR, currentYear);
|
| | | calendar.roll(Calendar.DAY_OF_YEAR, -1);
|
| | | endDate=calendar.getTime(); |
| | | } else if (dateType == 3) {
|
| | | beginDate = TimeUtil.parse("2018-01-01");
|
| | | endDate = new Date();
|
| | | }
|
| | | Gson gson = new Gson();
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | | List<String> list = new ArrayList<>();
|
| | | List<CountUserInfo> listHistory = extractAuditRecordService.getApplyMoney(beginDate, endDate);
|
| | | for (String date: dateList) {
|
| | | BigDecimal money = new BigDecimal("0");
|
| | | if (listHistory == null) {
|
| | | list.add(money.toString());
|
| | | continue;
|
| | | }
|
| | | |
| | | for (CountUserInfo history: listHistory) {
|
| | | if (dateType == 1) {
|
| | | String gernalTime = TimeUtil.getGernalTime(history.getDay().getTime());
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | money = MoneyBigDecimalUtil.add(money, history.getMoney());
|
| | | continue;
|
| | | }
|
| | | } else if (dateType == 2){
|
| | | String gernalTime = TimeUtil.getMonthOnlyMM(history.getDay());
|
| | | if(gernalTime.startsWith("0")) {
|
| | | gernalTime = gernalTime.substring(1, 2);
|
| | | }
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | money = MoneyBigDecimalUtil.add(money, history.getMoney());
|
| | | continue;
|
| | | }
|
| | | } else if (dateType == 3) {
|
| | | String gernalTime = TimeUtil.getYearOnlyYYYY(history.getDay());
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | money = MoneyBigDecimalUtil.add(money, history.getMoney());
|
| | | continue;
|
| | | }
|
| | | }
|
| | | }
|
| | | list.add(money.toString());
|
| | | }
|
| | | |
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "金额");
|
| | | innerList.put("data", gson.toJson(list));
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | data.put("line_list", line_list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | |
| | | @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));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | try {
|
| | | Object objectDate = null;
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | |
| | | Date beginDate = null;
|
| | | Date endDate = null;
|
| | | |
| | | if (dateType == 1) {
|
| | | beginDate = TimeUtil.parse(startTime);
|
| | | endDate = TimeUtil.parse(endTime);
|
| | | } else if (dateType == 2) {
|
| | | Calendar calendar=Calendar.getInstance(); |
| | | int currentYear = calendar.get(Calendar.YEAR);
|
| | | if (!StringUtil.isNullOrEmpty(year)) {
|
| | | currentYear = Integer.parseInt(year);
|
| | | }
|
| | | |
| | | calendar.clear();
|
| | | calendar.set(Calendar.YEAR, currentYear);
|
| | | beginDate =calendar.getTime();
|
| | | |
| | | calendar.clear();
|
| | | calendar.set(Calendar.YEAR, currentYear);
|
| | | calendar.roll(Calendar.DAY_OF_YEAR, -1);
|
| | | endDate=calendar.getTime(); |
| | | } else if (dateType == 3) {
|
| | | beginDate = TimeUtil.parse("2018-01-01");
|
| | | endDate = new Date();
|
| | | }
|
| | | Gson gson = new Gson();
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | List<ChartTDO> list = extractAuditRecordService.countExtractApplyNumber(null, dateType, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | |
| | | List<Object> list = new ArrayList<>();
|
| | | List<CountUserInfo> listHistory = extractAuditRecordService.geApplyNumber(beginDate, endDate);
|
| | | for (String date: dateList) {
|
| | | int value = 0;
|
| | | if (listHistory == null) {
|
| | | list.add(value + "");
|
| | | continue;
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | |
| | | for (CountUserInfo history: listHistory) {
|
| | | if (dateType == 1) {
|
| | | String gernalTime = TimeUtil.getGernalTime(history.getDay().getTime());
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | } else if (dateType == 2){
|
| | | String gernalTime = TimeUtil.getMonthOnlyMM(history.getDay());
|
| | | if(gernalTime.startsWith("0")) {
|
| | | gernalTime = gernalTime.substring(1, 2);
|
| | | }
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | } else if (dateType == 3) {
|
| | | String gernalTime = TimeUtil.getYearOnlyYYYY(history.getDay());
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | }
|
| | | }
|
| | | list.add(value + "");
|
| | | }
|
| | | |
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "数量");
|
| | | innerList.put("data", gson.toJson(list));
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("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("操作异常"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.controller.admin;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | 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;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | |
| | |
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | /**
|
| | | * 统计提现申请总次数
|
| | | * @param callback
|
| | | * @param dateType 显示视图:日-1 、月-2、 年-3
|
| | | * @param state 状态: 1-未处理 2-成功 3-失败
|
| | | * @param year |
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @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));
|
| | | return;
|
| | | }
|
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | List<Integer> channelList = null;
|
| | | if (stateArray != null && stateArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(stateArray, new TypeToken<ArrayList<Integer>>() {}.getType());
|
| | | }
|
| | |
|
| | | |
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | }
|
| | | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | try {
|
| | | JSONArray line_list = new JSONArray();
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | | |
| | | } else {
|
| | | for (Integer state : channelList) {
|
| | | List<ChartTDO> list = lostOrderService.countLostNum(dateType, state, year, |
| | | startTime, endTime);
|
| | | JSONObject innerList = new JSONObject();
|
| | | if (state == 1) {
|
| | | innerList.put("name", "未处理");
|
| | | } else if (state == 2) {
|
| | | innerList.put("name", "成功");
|
| | | } else if (state == 3) {
|
| | | innerList.put("name", "失败");
|
| | | }
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | | line_list.add(innerList);
|
| | | }
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | |
| | | data.put("line_list", line_list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | }
|
| | | |
| | | /**
|
| | | * 统计申诉金额总数
|
| | | * @param callback
|
| | | * @param dateType 显示视图:日-1 、月-2、 年-3
|
| | | * @param year |
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getAppealMoney")
|
| | | public void getAppealMoney(String callback, Integer dateType, String year, String startTime, String endTime,
|
| | | PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | |
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | |
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null; |
| | | |
| | | if (startTime != null) |
| | | startTime = null; |
| | | |
| | | if (endTime != null) |
| | | endTime = null; |
| | | }
|
| | | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | try {
|
| | | JSONArray line_list = new JSONArray();
|
| | | List<ChartTDO> list = lostOrderService.countAppealMoney(dateType, year, startTime, endTime);
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | data.put("line_list", line_list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 统计历史渠道产生订单的金额
|
| | | * |
| | | * @param callback
|
| | | * @param channelArray
|
| | | * 名字数组
|
| | | * @param type
|
| | | * 统计类型 1-24小时 2-所有
|
| | | * @param dateType
|
| | | * 类型 1日 2月 3年
|
| | | * @param year
|
| | | * 2018
|
| | | * @param startTime
|
| | | * 2018-12-01
|
| | | * @param endTime
|
| | | * 2018-12-01
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "get24HOderChannelCharts")
|
| | | public void get24HOderChannelCharts(String callback, String channelArray, Integer dateType, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {
|
| | | }.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | | channelList = new ArrayList<String>();
|
| | | channelList.add("all");
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | for (String channel : channelList) {
|
| | | List<ChartTDO> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | | channel = "总计";
|
| | | }
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", channel);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 统计提现申请总次数
|
| | | * |
| | | * @param callback
|
| | | * @param channelArray
|
| | | * 渠道名 为空是统计所有
|
| | | * @param dateType
|
| | | * 显示视图:日-1 、月-2、 年-3
|
| | | * @param state
|
| | | * 状态: 1-未到账 2-已到账 3-已失效
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getHongBaoNum")
|
| | | public void getHongBaoNum(String callback, String channelArray, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | |
|
| | | try {
|
| | | JSONObject data = countHistoryHongBao(channelArray, dateType, state, year, startTime, endTime, 1);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /**
|
| | | * 统计提现申请总金额
|
| | | *
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 订单跟踪准确率(板栗快省用户订单/淘宝联盟订单)
|
| | | * |
| | | * @param callback
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getTrackAccuracyRate")
|
| | | public void getTrackAccuracyRate(String callback, Integer dateType, String year, String startTime, String endTime,
|
| | | int sourceType, PrintWriter out) {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | List<ChartTDO> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime, endTime,
|
| | | sourceType);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 当前未收货订单数
|
| | |
| | | package com.yeshi.fanli.controller.admin;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.net.URLDecoder;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | |
| | | 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.admin.count.CountUserInfo;
|
| | | 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;
|
| | |
| | | @RequestMapping(value = "getNewUserCharts")
|
| | | public void getNewUserCharts(String callback, String channelArray, Integer dateType, String year, String startTime,
|
| | | String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {
|
| | | }.getType());
|
| | | }
|
| | |
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | | channelList = new ArrayList<String>();
|
| | | channelList.add("all");
|
| | | }
|
| | |
|
| | | if (dateType == 1 && year != null) {
|
| | | year = null; // 设置为空
|
| | | } else if (dateType == 2) {
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | |
|
| | | } else if (dateType == 3) {
|
| | | if (year != null)
|
| | | year = null;
|
| | |
|
| | | if (startTime != null)
|
| | | startTime = null;
|
| | |
|
| | | if (endTime != null)
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | try {
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | | return;
|
| | | }
|
| | | |
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | | }
|
| | |
|
| | | Date beginDate = null;
|
| | | Date endDate = null;
|
| | | |
| | | if (dateType == 1) {
|
| | | beginDate = TimeUtil.parse(startTime);
|
| | | endDate = TimeUtil.parse(endTime);
|
| | | } else if (dateType == 2) {
|
| | | Calendar calendar=Calendar.getInstance(); |
| | | int currentYear = calendar.get(Calendar.YEAR);
|
| | | if (!StringUtil.isNullOrEmpty(year)) {
|
| | | currentYear = Integer.parseInt(year);
|
| | | }
|
| | | calendar.clear();
|
| | | calendar.set(Calendar.YEAR, currentYear);
|
| | | beginDate =calendar.getTime();
|
| | | |
| | | calendar.clear();
|
| | | calendar.set(Calendar.YEAR, currentYear);
|
| | | calendar.roll(Calendar.DAY_OF_YEAR, -1);
|
| | | endDate=calendar.getTime(); |
| | | } else if (dateType == 3) {
|
| | | beginDate = TimeUtil.parse("2018-01-01");
|
| | | endDate = new Date();
|
| | | }
|
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | |
| | | // 渠道
|
| | | List<String> channelList = null;
|
| | | if (channelArray != null && channelArray.trim().length() > 0) {
|
| | | channelList = gson.fromJson(channelArray, new TypeToken<ArrayList<String>>() {
|
| | | }.getType());
|
| | | }
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | |
|
| | | List<ChartTDO> list = userInfoCountService.countNewUserByDate(channel, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | | channel = "总计";
|
| | | |
| | | if (channelList != null && channelList.size() > 0) {
|
| | | for (String channel : channelList) {
|
| | | List<Object> list = getNewUserData(dateList, dateType, beginDate, endDate, channel);
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", channel);
|
| | | innerList.put("data", gson.toJson(list));
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | | } else {
|
| | | List<Object> list = getNewUserData(dateList, dateType, beginDate, endDate, null);
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", channel);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | innerList.put("name", "全部");
|
| | | innerList.put("data", gson.toJson(list));
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | | data.put("xAxis_list", gson.toJson(objectDate));
|
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("系统异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | private List<Object> getNewUserData(List<String> dateList, Integer dateType, Date beginDate, Date endDate, String channel) {
|
| | | List<Object> list = new ArrayList<>();
|
| | | List<CountUserInfo> listHistory = userInfoCountService.getNewUserData(beginDate, endDate, channel);
|
| | | for (String date: dateList) {
|
| | | int value = 0;
|
| | | if (listHistory != null) {
|
| | | for (CountUserInfo history: listHistory) {
|
| | | if (dateType == 1) {
|
| | | String gernalTime = TimeUtil.getGernalTime(history.getDay().getTime());
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | } else if (dateType == 2){
|
| | | String gernalTime = TimeUtil.getMonthOnlyMM(history.getDay());
|
| | | if(gernalTime.startsWith("0")) {
|
| | | gernalTime = gernalTime.substring(1, 2);
|
| | | }
|
| | | |
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | } else if (dateType == 3) {
|
| | | String gernalTime = TimeUtil.getYearOnlyYYYY(history.getDay());
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | list.add(value + "");
|
| | | }
|
| | | |
| | | return list;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | }
|
| | | } else if (dateType == 2){
|
| | | String gernalTime = TimeUtil.getMonthOnlyMM(history.getDay());
|
| | | if(gernalTime.startsWith("0")) {
|
| | | gernalTime = gernalTime.substring(1, 2);
|
| | | }
|
| | | if (gernalTime.equalsIgnoreCase(date)) {
|
| | | value += history.getNum();
|
| | | continue;
|
| | |
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Calendar;
|
| | | import java.util.Date;
|
| | |
| | | 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.entity.FileUploadResult;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.google.gson.JsonPrimitive;
|
| | | import com.google.gson.JsonSerializationContext;
|
| | | import com.google.gson.JsonSerializer;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SwiperPicture;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.common.JumpDetailV2;
|
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.CommentInfo.CommentInfoEnum;
|
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsEvaluate;
|
| | | import com.yeshi.fanli.entity.dynamic.GoodsPicture;
|
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo;
|
| | | import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum;
|
| | | import com.yeshi.fanli.entity.dynamic.SimpleGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.system.ConfigKeyEnum;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.ArticleOfficialService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
|
| | | import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SwiperPictureService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.user.QrCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.tb.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.cache.JDGoodsCacheUtil;
|
| | | import com.yeshi.fanli.util.jd.JDApiUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | | import com.yeshi.fanli.util.pinduoduo.PinDuoDuoApiUtil;
|
| | | import com.yeshi.fanli.util.taobao.DaTaoKeUtil;
|
| | | import com.yeshi.fanli.vo.dynamic.ArticleVO;
|
| | | import com.yeshi.fanli.vo.goods.GoodsDetailVO;
|
| | | import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | |
|
| | | @Resource
|
| | | private ArticleOfficialService articleOfficialService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private SwiperPictureService swiperPictureService;
|
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | | |
| | |
|
| | | @Resource
|
| | | private GoodsEvaluateService goodsEvaluateService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private UserExtraTaoBaoInfoService userExtraTaoBaoInfoService;
|
| | |
|
| | | @Resource
|
| | | private JDGoodsCacheUtil jdGoodsCacheUtil;
|
| | |
|
| | | @Resource
|
| | | private QrCodeService qrCodeService;
|
| | |
|
| | | /**
|
| | | * 查询顶部分类
|
| | |
| | |
|
| | | // 2.0.6版本增加 学院栏目
|
| | | if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | //list.add(menu6);
|
| | | // list.add(menu6);
|
| | | }
|
| | | list.add(menu4);
|
| | |
|
| | |
| | | data.put("list", JsonUtil.getApiCommonGson().toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 动态商品列表
|
| | | *
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 时间处理
|
| | | *
|
| | |
| | | Gson gson = gb.create();
|
| | | return gson;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 活动列表
|
| | | *
|
| | |
| | | * @param out
|
| | | */
|
| | | private void getArticleList(AcceptData acceptData, Integer page, String key, boolean search, PrintWriter out) {
|
| | | List<ArticleVO> list = articleOfficialService.queryValid((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, key);
|
| | | List<ArticleVO> list = articleOfficialService.queryValid((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
|
| | | key);
|
| | | if (list != null) {
|
| | | for (ArticleVO article: list) {
|
| | | for (ArticleVO article : list) {
|
| | | String tags = article.getTags();
|
| | | if (StringUtil.isNullOrEmpty(tags)) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | String[] arrayTags = tags.split("\\s+");
|
| | | if (arrayTags == null || arrayTags.length == 0) {
|
| | | continue;
|
| | | }
|
| | | |
| | |
|
| | | String[] arrayTagsColour = null;
|
| | | String tagsColour = article.getTagsColour();
|
| | | if (!StringUtil.isNullOrEmpty(tagsColour)) {
|
| | | arrayTagsColour = tagsColour.split("\\s+");
|
| | | }
|
| | | |
| | |
|
| | | String color = "#FE0014";
|
| | | List<ClientTextStyleVO> labels = new ArrayList<ClientTextStyleVO>();
|
| | | for (int i = 0; i < arrayTags.length;i ++) {
|
| | | for (int i = 0; i < arrayTags.length; i++) {
|
| | | String tag = arrayTags[i];
|
| | | if (arrayTagsColour != null && arrayTagsColour.length == arrayTags.length) {
|
| | | color = arrayTagsColour[i];
|
| | |
| | | article.setLabels(labels);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | Gson gson = gsonBuilder.create();
|
| | | |
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (page == 1 && !search) {
|
| | | List<SwiperPicture> banners = swiperPictureService.getByBannerCardAndVersion("article_banners",acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | List<SwiperPicture> banners = swiperPictureService.getByBannerCardAndVersion("article_banners",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (banners == null)
|
| | | banners = new ArrayList<>();
|
| | | data.put("banners", gson.toJson(banners));
|
| | | |
| | |
|
| | | List<Special> listSpecial = specialService.listByVersion(0, Integer.MAX_VALUE, "article_specials",
|
| | | acceptData.getPlatform(), Integer.parseInt(acceptData.getVersion()));
|
| | | if (listSpecial == null)
|
| | | listSpecial = new ArrayList<>();
|
| | | |
| | |
|
| | | for (Special special : listSpecial) {
|
| | | boolean needLogin = special.isJumpLogin();
|
| | | JumpDetailV2 jumpDetail = special.getJumpDetail();
|
| | |
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 文章搜索
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param key
|
| | |
| | | */
|
| | | @RequestMapping(value = "readArticle", method = RequestMethod.POST)
|
| | | public void readArticle(AcceptData acceptData, String id, PrintWriter out) {
|
| | | if(StringUtil.isNullOrEmpty(id)) {
|
| | | if (StringUtil.isNullOrEmpty(id)) {
|
| | | out.print(JsonUtil.loadFalseResult("id不能为空"));
|
| | | return;
|
| | | }
|
| | | articleOfficialService.updateReadNum(id);
|
| | | out.print(JsonUtil.loadTrueResult("操作成功"));
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 文章搜索
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param key
|
| | |
| | | public void searchArticle(AcceptData acceptData, Integer page, String key, PrintWriter out) {
|
| | | getArticleList(acceptData, page, key, true, out);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 文章搜索
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param key
|
| | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 发圈列表
|
| | | * |
| | | * @param acceptData
|
| | | * @param page
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "evaluate", method = RequestMethod.POST)
|
| | | public void evaluate(AcceptData acceptData, Integer page, PrintWriter out) {
|
| | | long cid = 1;
|
| | | long subId = 1;
|
| | | List<DynamicInfo> listd = dynamicInfoService.queryV2(2, 74, (page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
|
| | | cid, subId);
|
| | | if (listd == null) {
|
| | | listd = new ArrayList<DynamicInfo>();
|
| | | }
|
| | |
|
| | | List<GoodsEvaluate> list = new ArrayList<>();
|
| | |
|
| | | for (DynamicInfo info : listd) {
|
| | | GoodsEvaluate goodsEvaluate = new GoodsEvaluate();
|
| | | goodsEvaluate.setId(info.getId());
|
| | | ActivityUser user = info.getUser();
|
| | | user.setTag("烧烤达人");
|
| | | goodsEvaluate.setUser(user);
|
| | | goodsEvaluate.setTitle(info.getTitle().get(0).getContent());
|
| | | goodsEvaluate.setShareNum(info.getShareCount());
|
| | | goodsEvaluate.setPublishTime(info.getCreateTime());
|
| | | goodsEvaluate.setLineNum(2);
|
| | | List<GoodsPicture> imgs = info.getImgs();
|
| | |
|
| | | List<ImgInfo> imgList = new ArrayList<>();
|
| | | int i = 0;
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | ImgInfo imgInfo = new ImgInfo();
|
| | | GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
|
| | | imgInfo.setH(100);
|
| | | imgInfo.setW(100);
|
| | | if (goodsVO != null) {
|
| | | imgInfo.setType(ImgEnum.goods);
|
| | |
|
| | | SimpleGoods simpleGoods = new SimpleGoods();
|
| | | simpleGoods.setPrice(goodsVO.getZkPrice());
|
| | | simpleGoods.setAmount(new BigDecimal(115));
|
| | | simpleGoods.setGoodsId(goodsVO.getGoodsId());
|
| | | simpleGoods.setGoodsType(1);
|
| | | simpleGoods.setState(1);
|
| | | imgInfo.setGoods(simpleGoods);
|
| | |
|
| | | goodsEvaluate.setGoods(goodsVO);
|
| | | } else {
|
| | | imgInfo.setType(ImgEnum.img);
|
| | | }
|
| | |
|
| | | imgInfo.setLarge(false);
|
| | | imgInfo.setUrl(goodsPicture.getUrl());
|
| | | imgInfo.setUrlHD(goodsPicture.getUrl());
|
| | |
|
| | | // if (i == 0) {
|
| | | // imgInfo.setUrl(goodsPicture.getUrl());
|
| | | // imgInfo.setType(ImgEnum.video);
|
| | | // imgInfo.setLarge(true);
|
| | | // imgInfo.setVideoUrl(
|
| | | // "http://pgcvideo.cdn.xiaodutv.com/754825344_367171606_2020010816001720200108174342.mp4?Cache-Control=max-age%3D8640000&responseExpires=Fri%2C+17+Apr+2020+18%3A11%3A55+GMT&xcode=0b0f3962eddaf66837d4af61a22c57bae3a5055540c75232&time=1579077845&_=1578992502888");
|
| | | // } else {
|
| | | // imgInfo.setType(ImgEnum.img);
|
| | | // imgInfo.setLarge(true);
|
| | | // imgInfo.setUrl(goodsPicture.getUrl());
|
| | | // }
|
| | | // i++;
|
| | |
|
| | | imgList.add(imgInfo);
|
| | | }
|
| | |
|
| | | goodsEvaluate.setImgList(imgList);
|
| | |
|
| | | CommentInfo commentInfo = new CommentInfo();
|
| | | commentInfo.setId(info.getId() + "09");
|
| | | commentInfo.setContent("😆7.9元🉐1只儿童牙刷!!安妮贝拉卡通版儿童牙⭕PBT材质,毛刷细腻柔⭕外观卡通人物造型设计");
|
| | | commentInfo.setType(CommentInfoEnum.goodsCoupon);
|
| | |
|
| | | // ClientTextStyleVO text1 = new ClientTextStyleVO();
|
| | | // text1.setContent("猫超");
|
| | | // text1.setColor("#1D9B31");
|
| | | // |
| | | // ClientTextStyleVO text2 = new ClientTextStyleVO();
|
| | | // text2.setContent("满150减15");
|
| | | // text2.setColor("#E5005C");
|
| | | // List<ClientTextStyleVO> tagList = new ArrayList<>(); |
| | | // tagList.add(text1);
|
| | | // tagList.add(text2);
|
| | | // commentInfo.setTagList(tagList);
|
| | | // commentInfo.setTagDesc("除生鲜及部分酒水除生鲜及除生鲜及");
|
| | |
|
| | | CommentInfo commentInfo2 = new CommentInfo();
|
| | | commentInfo2.setContent("😆7.9元🉐1只儿童牙刷!!安妮贝拉卡通版儿童牙⭕PBT材质,毛刷细腻柔⭕外观卡通人物造型设计");
|
| | | commentInfo2.setType(CommentInfoEnum.goodsCoupon);
|
| | |
|
| | | ClientTextStyleVO text1 = new ClientTextStyleVO();
|
| | | text1.setContent("猫超");
|
| | | text1.setColor("#1D9B31");
|
| | |
|
| | | ClientTextStyleVO text2 = new ClientTextStyleVO();
|
| | | text2.setContent("满150减15");
|
| | | text2.setColor("#E5005C");
|
| | | List<ClientTextStyleVO> tagList = new ArrayList<>();
|
| | | tagList.add(text1);
|
| | | tagList.add(text2);
|
| | | commentInfo2.setTagList(tagList);
|
| | | commentInfo2.setTagDesc("除生鲜及部分酒水除生鲜及除生鲜及");
|
| | | commentInfo.setTagUrl("http://www.baidu.com");
|
| | |
|
| | | List<CommentInfo> commentList = new ArrayList<>();
|
| | | commentList.add(commentInfo);
|
| | | commentList.add(commentInfo2);
|
| | |
|
| | | goodsEvaluate.setComments(commentList);
|
| | | list.add(goodsEvaluate);
|
| | | }
|
| | |
|
| | | // List<GoodsEvaluate> list = goodsEvaluateService.queryValidEvaluateCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE);
|
| | | // if (list == null) {
|
| | | // list = new ArrayList<>();
|
| | | // }
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
|
| | | gsonBuilder.registerTypeAdapter(CommentInfoEnum.class, new JsonSerializer<CommentInfoEnum>() {
|
| | | @Override
|
| | | public JsonElement serialize(CommentInfoEnum value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive(1);
|
| | | } else {
|
| | | return new JsonPrimitive(value.getDesc());
|
| | | }
|
| | | }
|
| | | }).registerTypeAdapter(ImgEnum.class, new JsonSerializer<ImgEnum>() {
|
| | | @Override
|
| | | public JsonElement serialize(ImgEnum value, Type theType, JsonSerializationContext context) {
|
| | | if (value == null) {
|
| | | return new JsonPrimitive("");
|
| | | } else {
|
| | | return new JsonPrimitive(value.getVlaue());
|
| | | }
|
| | | }
|
| | | }).registerTypeAdapter(Date.class, new JsonSerializer<Date>() {
|
| | | @Override
|
| | | public JsonElement serialize(Date value, Type theType, JsonSerializationContext context) {
|
| | | String desc = "";
|
| | | if (value != null) {
|
| | | // 判断是否是同一天
|
| | |
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTime(value);
|
| | | int y1 = calendar.get(Calendar.YEAR);// 获取年份
|
| | | int d1 = calendar.get(Calendar.DAY_OF_YEAR);// 获取年中第几天
|
| | |
|
| | | Date nowDate = new Date();
|
| | | Calendar calendar2 = Calendar.getInstance();
|
| | | calendar2.setTime(nowDate);
|
| | | int y2 = calendar2.get(Calendar.YEAR);// 获取年份
|
| | | int d2 = calendar2.get(Calendar.DAY_OF_YEAR);// 获取年中第几天
|
| | |
|
| | | long old = value.getTime();
|
| | | long now = nowDate.getTime();
|
| | | if (y1 == y2) {
|
| | | if (d1 == d2) {
|
| | | long cha = now - old;
|
| | | if (cha < 1000 * 60 * 2L) {
|
| | | desc = "刚刚";
|
| | | } else if (cha < 1000 * 60 * 60L) {
|
| | | desc = (cha / (1000 * 60)) + "分钟前";
|
| | | } else {
|
| | | desc = (cha / (1000 * 60 * 60)) + "小时前";
|
| | | }
|
| | | } else if (d2 - d1 == 1) {
|
| | | desc = "昨天";
|
| | | } else {
|
| | | desc = (d2 - d1) + "天前";
|
| | | }
|
| | | } else {
|
| | | int timeDistance = 0;
|
| | | for (int i = y1; i < y2; i++) {
|
| | | if (i % 4 == 0 && i % 100 != 0 || i % 400 == 0) {
|
| | | timeDistance += 366; // 闰年
|
| | | } else {
|
| | | timeDistance += 365; // 不是闰年
|
| | | }
|
| | | }
|
| | | desc = timeDistance + (d2 - d1) + "天前";
|
| | | }
|
| | |
|
| | | return new JsonPrimitive(desc);
|
| | | }
|
| | |
|
| | | return new JsonPrimitive("");
|
| | | }
|
| | | });
|
| | | Gson gson = gsonBuilder.create();
|
| | | long count = dynamicInfoService.count(cid, subId); // goodsEvaluateService.countValid()
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", count);
|
| | | data.put("list", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | @RequestMapping(value = "evaluateShare", method = RequestMethod.POST)
|
| | | public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, Long goodsId, Integer goodsType, PrintWriter out) {
|
| | | if (uid == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(id) || type == null) {
|
| | | out.print(JsonUtil.loadFalseResult("传递参数不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (type == 1 && (goodsId == null || goodsType == null)) {
|
| | | out.print(JsonUtil.loadFalseResult("商品参数不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | DynamicInfo dynamicInfo = dynamicInfoService.getById(id);
|
| | | if (dynamicInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
|
| | | if (user == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
|
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | String relationId = null;
|
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
|
| | | && taoBaoInfo.getRelationValid() == true)
|
| | | relationId = taoBaoInfo.getRelationId();
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(relationId)) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号"));
|
| | | return;
|
| | | }
|
| | |
|
| | | List<GoodsPicture> imgs = dynamicInfo.getImgs();
|
| | | if (imgs == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该图片内容已不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | int total = 0;
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
|
| | | if (goodsVO != null) {
|
| | | total ++;
|
| | | }
|
| | | }
|
| | |
|
| | | List<String> list = new ArrayList<>();
|
| | | for (GoodsPicture goodsPicture : imgs) {
|
| | | GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
|
| | | if (goodsVO == null && total <= 1) {
|
| | | list.add(goodsPicture.getUrl());
|
| | | continue;
|
| | | }
|
| | | |
| | | if (type == 1) {
|
| | | if (goodsVO.getGoodsId().longValue() == goodsId.longValue() && goodsVO.getGoodsType() == goodsType.intValue()) {
|
| | | String jumpLink = getJumpLink(goodsVO, user);
|
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | list.add(jumpLink);
|
| | | }
|
| | | }
|
| | | } else {
|
| | | String jumpLink = getJumpLink(goodsVO, user);
|
| | | if (!StringUtil.isNullOrEmpty(jumpLink)) {
|
| | | list.add(jumpLink);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | Integer shareCount = dynamicInfo.getShareCount();
|
| | | if (shareCount == null) {
|
| | | shareCount = 0;
|
| | | }
|
| | |
|
| | | if (type == 3) {
|
| | | shareCount++;
|
| | | dynamicInfoService.updateShareCount(dynamicInfo);
|
| | | }
|
| | |
|
| | | if (list.size() == 0) {
|
| | | out.print(JsonUtil.loadFalseResult("该信息已下架"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("count", shareCount);
|
| | | data.put("list", list);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | |
|
| | | private String getJumpLink(GoodsDetailVO goodsVO, UserInfo user) {
|
| | | String jumpLink = null;
|
| | | if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
|
| | | String url = String.format("http://%s%s?uid=%s&id=%s&appType=flq", configService.getH5Host(),
|
| | | Constant.systemCommonConfig.getShareGoodsPagePath(),
|
| | | AESUtil.encrypt(user.getId() + "", Constant.UIDAESKEY), goodsVO.getGoodsId() + "");
|
| | | String shortLink = HttpUtil.getShortLink(url);
|
| | | if (!StringUtil.isNullOrEmpty(shortLink)) {
|
| | | url = shortLink;
|
| | | }
|
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) {
|
| | | JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId());
|
| | | if (jdGoods == null ) {
|
| | | return null;
|
| | | }
|
| | | |
| | | String couponUrl = null;
|
| | | JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods);
|
| | | if (couponInfo != null) {
|
| | | couponUrl = couponInfo.getLink();
|
| | | }
|
| | | String materialId = "https://item.jd.com/" + goodsVO.getGoodsId() + ".html";
|
| | | jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
|
| | | user.getId() + "");
|
| | | } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
|
| | | jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + "");
|
| | | }
|
| | | FileUploadResult uploadResult = qrCodeService.drawGoodsPoster(jumpLink, user.getPortrait(), goodsVO);
|
| | | if (uploadResult != null) {
|
| | | return uploadResult.getUrl();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 评论复制
|
| | | * @param acceptData
|
| | | * @param id
|
| | | * @param cid 评论id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "evaluateComment", method = RequestMethod.POST)
|
| | | public void evaluateComment(AcceptData acceptData, Long uid, String id, String cid, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(id)) {
|
| | | out.print(JsonUtil.loadFalseResult("id不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | DynamicInfo dynamicInfo = dynamicInfoService.getById(id);
|
| | | if (dynamicInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("该内容已不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
|
| | | if (user == null) {
|
| | | out.print(JsonUtil.loadFalseResult("用户未登录"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (user != null && user.getState() != UserInfo.STATE_NORMAL) {
|
| | | out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
|
| | | return;
|
| | | }
|
| | | |
| | | UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
|
| | | String relationId = null;
|
| | | if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
|
| | | && taoBaoInfo.getRelationValid() == true)
|
| | | relationId = taoBaoInfo.getRelationId();
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(relationId)) {
|
| | | out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("text", "安妮贝拉卡通版儿拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版");
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | }
|
| | | }
|
| | |
| | | package com.yeshi.fanli.dao.mybatis;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
| | | /**
|
| | | * 统计审核次数
|
| | | * @param state
|
| | | * @param type
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countAuditTotal(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | int countAuditTotal(@Param("state")Integer state, @Param("preDay") String preDay);
|
| | |
|
| | | /**
|
| | | * 统计申请提的现总金额
|
| | | * @param state
|
| | | * @param type
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countExtractMoney(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | BigDecimal countApplyExtractMoney(@Param("preDay") String preDay);
|
| | |
|
| | | /**
|
| | | * 统计申请提的现总次数
|
| | | * @param state
|
| | | * @param type
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countExtractApplyNumber(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | int countApplyNumberByDay(@Param("preDay") String preDay);
|
| | |
|
| | | }
|
| | |
| | | @Param("type") Integer hbType, @Param("orderState") Integer orderState,
|
| | | @Param("orderNo") String orderNo, @Param("moneyState") Integer moneyState,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime,@Param("listSource") List<Integer> listSource);
|
| | |
|
| | | /**
|
| | | * 统计各个订单类型 有效个数
|
| | | * @param orderType
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | Integer countOrderByTypeAndDate(@Param("orderType") Integer orderType, @Param("preDay") String preDay);
|
| | | |
| | | |
| | | } |
| | |
| | |
|
| | |
|
| | | long countByHasGoldCoin(@Param("key") String key);
|
| | | |
| | | } |
| | |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | | Long countOrderByDay(@Param("preDay") String preDay);
|
| | |
|
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order;
|
| | |
|
| | | 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.dto.order.CountOrderDTO;
|
| | |
|
| | | public interface CommonOrderCountMapper {
|
| | |
|
| | |
| | | */
|
| | | Long countByState(@Param("state") Integer state);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计所有订单
|
| | | *
|
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime,
|
| | | @Param("sourceType") int sourceType);
|
| | | Long countOrderBySourceTypeAndDay(@Param("preDay") String preDay, @Param("sourceType") int sourceType);
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 奖金统计
|
| | | *
|
| | |
| | | */
|
| | | List<Long> getSameGoodsOrderByUidAndHongBaoType(@Param("typeList") List<Integer> typeList, @Param("uid") Long uid,
|
| | | @Param("minSameGoodsOrderCount") int minSameGoodsOrderCount);
|
| | | |
| | | |
| | | /**
|
| | | * 通过uid 日期筛选 下单数量
|
| | | * @param preDay
|
| | | * @param uid |
| | | * @return
|
| | | */
|
| | | Integer countOderByUidAndDate(@Param("preDay") Date preDay,@Param("uid") Long uid);
|
| | | |
| | | /**
|
| | | * 日期筛选 每个用户下单数量
|
| | | * @param preDay
|
| | | * @param uid |
| | | * @return
|
| | | */
|
| | | List<CountOrderDTO> countValidOrderByDay(@Param("preDay") String preDay);
|
| | | |
| | | /**
|
| | | * 通过多个uid 日期筛选 下单用户数量
|
| | | * @param preDay
|
| | | * @param uid |
| | | * @return
|
| | | */
|
| | | Integer countDownOrderUserByUidAndDate(@Param("preDay") Date preDay,@Param("list") List<Long> list);
|
| | | |
| | | /**
|
| | | * 统计订单产生佣金
|
| | | * @param preDay
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | List<CountOrderDTO> countCommissionByDay(@Param("preDay") String preDay);
|
| | | |
| | | /**
|
| | | * 通过uid 日期筛选 下单数量
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | Integer countOderByDate(@Param("preDay") String preDay);
|
| | | |
| | | /**
|
| | | * 统计订单产生佣金
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | BigDecimal countCommissionByDate(@Param("preDay") String preDay);
|
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | 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.bus.user.LostOrder;
|
| | |
|
| | | public interface LostOrderMapper extends BaseMapper<LostOrder> {
|
| | |
| | | /**
|
| | | * 统计申诉订单数量
|
| | | *
|
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countLostNum(@Param("dateType") Integer dateType, @Param("resultCode") Integer resultCode,
|
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | | Integer countLostOrderNum(@Param("preDay") String preDay);
|
| | |
|
| | | /**
|
| | | * 统计申诉成功订单金额
|
| | | *
|
| | | * @param type
|
| | | * @param state
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countAppealMoney(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | | BigDecimal countAppealMoney(@Param("preDay") String preDay);
|
| | |
|
| | | /**
|
| | | * 根据用户删除
|
| | |
| | | package com.yeshi.fanli.dao.mybatis.order; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | |
| | | * @return |
| | | */ |
| | | public UserOrderWeiQuanRecord selectByOrderInfoAndUid(@Param("uid") Long uid,@Param("tradeId") String tradeId,@Param("sourceType") int sourceType); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 统计维权订单数量-根据日期 |
| | | * @param preDay |
| | | * @return |
| | | */ |
| | | Integer countWeiQaunOrderNumberByDate(@Param("preDay") String preDay); |
| | | |
| | | |
| | | /** |
| | | * 统计维权订单金额-根据日期 |
| | | * @param preDay |
| | | * @return |
| | | */ |
| | | BigDecimal countWeiQaunOrderMoneyByDate(@Param("preDay") String preDay); |
| | | |
| | | } |
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | Long countOrderByDay(@Param("preDay") String preDay);
|
| | | |
| | | /**
|
| | | * 根据状态查询数据
|
| | | *
|
| | |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | | Long countOrderByDay(@Param("preDay") String preDay);
|
| | | |
| | |
|
| | | /**
|
| | | * 获取长期未更新的订单
|
| | |
| | | private String portrait;
|
| | | @Column(name = "au_create_time")
|
| | | private Date createTime;
|
| | | |
| | | // 标签
|
| | | @Expose
|
| | | @Column(name = "au_tag")
|
| | | private String tag;
|
| | | |
| | |
|
| | | public String getNickName() {
|
| | | return nickName;
|
| | |
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public String getTag() {
|
| | | return tag;
|
| | | }
|
| | |
|
| | | public void setTag(String tag) {
|
| | | this.tag = tag;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | |
|
| | |
|
| | | <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
|
| | | 'showDate'
|
| | | </if>
|
| | | <if test="type == 2">
|
| | | FROM_UNIXTIME(tr.`auditTime`/1000,'%m') AS 'showDate'
|
| | | </if>
|
| | | <if test="type == 3">
|
| | | FROM_UNIXTIME(tr.`auditTime`/1000,'%Y') AS 'showDate'
|
| | | </if>
|
| | | FROM `yeshi_ec_extract_audit_record` tr
|
| | | <if test="state != null and state != 0">
|
| | | LEFT JOIN `yeshi_ec_extract` t ON t.`id` = tr.`extractId`
|
| | | </if>
|
| | | WHERE tr.`auditTime` IS NOT NULL
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
|
| | | '${endTime}'
|
| | | </if>
|
| | | <if test="years != null and years != '' ">
|
| | | AND FROM_UNIXTIME(tr.`auditTime`/1000,'%Y') = '${years}'
|
| | | </if>
|
| | | <if test="state != null and state != 3">
|
| | | AND t.`state` = ${state}
|
| | | </if>
|
| | | <if test="type == 1">
|
| | | GROUP BY FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="type == 2">
|
| | | GROUP BY FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m')
|
| | | </if>
|
| | | <if test="type == 3">
|
| | | GROUP BY FROM_UNIXTIME(tr.`auditTime`/1000,'%Y')
|
| | | </if>
|
| | | ORDER BY tr.`auditTime`
|
| | | <select id="countAuditTotal" resultType="Integer">
|
| | | SELECT IFNULL(COUNT(tr.id),0) FROM `yeshi_ec_extract_audit_record` tr
|
| | | LEFT JOIN `yeshi_ec_extract` t ON t.`id` = tr.`extractId`
|
| | | WHERE t.`state` = #{state} AND FROM_UNIXTIME(tr.`auditTime`/1000,'%Y-%m-%d') = #{preDay} |
| | | </select>
|
| | |
|
| | | <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
|
| | | 'showDate'
|
| | | </if>
|
| | | <if test="type == 2">
|
| | | FROM_UNIXTIME(t.`extractTime`/1000,'%m') AS 'showDate'
|
| | | </if>
|
| | | <if test="type == 3">
|
| | | FROM_UNIXTIME(t.`extractTime`/1000,'%Y') AS 'showDate'
|
| | | </if>
|
| | | FROM `yeshi_ec_extract` t
|
| | | WHERE t.`extractTime` IS NOT NULL
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
|
| | | '${endTime}'
|
| | | </if>
|
| | | <if test="years != null and years != '' ">
|
| | | AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y') = '${years}'
|
| | | </if>
|
| | | <if test="state != null">
|
| | | AND t.`state` = ${state}
|
| | | </if>
|
| | | <if test="type == 1">
|
| | | GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="type == 2">
|
| | | GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m')
|
| | | </if>
|
| | | <if test="type == 3">
|
| | | GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y')
|
| | | </if>
|
| | | ORDER BY t.`extractTime`
|
| | | <select id="countApplyExtractMoney" resultType="BigDecimal">
|
| | | SELECT SUM(t.`money`) FROM `yeshi_ec_extract` t
|
| | | WHERE FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') = #{preDay} |
| | | </select>
|
| | |
|
| | | <select id="countExtractApplyNumber" resultMap="ChartMap">
|
| | | SELECT COUNT(t.id) AS showValue,
|
| | | <if test="type == 1">
|
| | | FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | | </if>
|
| | | <if test="type == 2">
|
| | | FROM_UNIXTIME(t.`extractTime`/1000,'%m') AS 'showDate'
|
| | | </if>
|
| | | <if test="type == 3">
|
| | | FROM_UNIXTIME(t.`extractTime`/1000,'%Y') AS 'showDate'
|
| | | </if>
|
| | | FROM `yeshi_ec_extract` t
|
| | | WHERE t.`extractTime` IS NOT NULL
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
|
| | | '${endTime}'
|
| | | </if>
|
| | | <if test="years != null and years != '' ">
|
| | | AND FROM_UNIXTIME(t.`extractTime`/1000,'%Y') = '${years}'
|
| | | </if>
|
| | | <if test="state != null">
|
| | | AND t.`state` = ${state}
|
| | | </if>
|
| | | <if test="type == 1">
|
| | | GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="type == 2">
|
| | | GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m')
|
| | | </if>
|
| | | <if test="type == 3">
|
| | | GROUP BY FROM_UNIXTIME(t.`extractTime`/1000,'%Y')
|
| | | </if>
|
| | | ORDER BY t.`extractTime`
|
| | | <select id="countApplyNumberByDay" resultType="Integer">
|
| | | SELECT IFNULL(COUNT(t.id),0) FROM `yeshi_ec_extract` t
|
| | | WHERE FROM_UNIXTIME(t.`extractTime`/1000,'%Y-%m-%d') = #{preDay} |
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | <result column="goldCoin" property="goldCoin" jdbcType="INTEGER" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.UserInfo">
|
| | | <id column="id" property="id" jdbcType="BIGINT" />
|
| | | <result column="identifycode" property="openid" jdbcType="VARCHAR" />
|
| | | <result column="login_type" property="loginType" jdbcType="INTEGER" />
|
| | | <result column="wx_open_id" property="wxOpenId" jdbcType="VARCHAR" />
|
| | | <result column="wx_union_id" property="wxUnionId" jdbcType="VARCHAR" />
|
| | | <result column="nick_name" property="nickName" jdbcType="VARCHAR" />
|
| | | <result column="tbName" property="tbName" jdbcType="VARCHAR" />
|
| | | <result column="tbPic" property="tbPic" jdbcType="VARCHAR" />
|
| | | <result column="wxName" property="wxName" jdbcType="VARCHAR" />
|
| | | <result column="wxPic" property="wxPic" jdbcType="VARCHAR" />
|
| | | <result column="portrait" property="portrait" jdbcType="VARCHAR" />
|
| | | <result column="createtime" property="createtime" jdbcType="BIGINT" />
|
| | | <result column="last_logintime" property="lastLoginTime"
|
| | | jdbcType="BIGINT" />
|
| | | <result column="loginip" property="lastLoginIp" jdbcType="VARCHAR" />
|
| | | <result column="type" property="type" jdbcType="INTEGER" />
|
| | | <result column="appid" property="appId" jdbcType="VARCHAR" />
|
| | | <result column="my_hongBao" property="myHongBao" jdbcType="DECIMAL" />
|
| | | <result column="pay_password" property="payPassword" jdbcType="VARCHAR" />
|
| | | <result column="rank" property="rank" jdbcType="INTEGER" />
|
| | | <result column="phone" property="phone" jdbcType="VARCHAR" />
|
| | | <result column="state" property="state" jdbcType="INTEGER" />
|
| | | <result column="state_desc" property="stateDesc" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | |
|
| | | <select id="listByUserGoldCoin" resultMap="UserGoldCoinMapVO">
|
| | | SELECT IFNULL(SUM(d.`td_money`),0) AS goldCoin,u.`id`,u.`nick_name`,u.`portrait`
|
| | |
| | | <!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.activity.ActivityUserMapper">
|
| | | <resultMap id="BaseResultMap"
|
| | | type="com.yeshi.fanli.entity.bus.activity.ActivityUser">
|
| | | <id column="au_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="au_nick_name" property="nickName" jdbcType="VARCHAR" />
|
| | | <result column="au_portrait" property="portrait" jdbcType="VARCHAR" />
|
| | | <result column="au_create_time" property="createTime" jdbcType="TIMESTAMP" />
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">au_id,au_nick_name,au_portrait,au_create_time</sql>
|
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.activity.ActivityUser">
|
| | | <id column="au_id" property="id" jdbcType="BIGINT"/>
|
| | | <result column="au_nick_name" property="nickName" jdbcType="VARCHAR"/>
|
| | | <result column="au_portrait" property="portrait" jdbcType="VARCHAR"/>
|
| | | <result column="au_create_time" property="createTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="au_tag" property="tag" jdbcType="VARCHAR"/>
|
| | | </resultMap>
|
| | | <sql id="Base_Column_List">au_id,au_nick_name,au_portrait,au_create_time,au_tag</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | |
| | |
|
| | |
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_activity_user where au_id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.activity.ActivityUser"
|
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_activity_user
|
| | | (au_id,au_nick_name,au_portrait,au_create_time) values
|
| | | (#{id,jdbcType=BIGINT},#{nickName,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.activity.ActivityUser"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_activity_user
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">au_id,</if>
|
| | | <if test="nickName != null">au_nick_name,</if>
|
| | | <if test="portrait != null">au_portrait,</if>
|
| | | <if test="createTime != null">au_create_time,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="nickName != null">#{nickName,jdbcType=VARCHAR},</if>
|
| | | <if test="portrait != null">#{portrait,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.activity.ActivityUser">update
|
| | | yeshi_ec_activity_user set au_nick_name =
|
| | | #{nickName,jdbcType=VARCHAR},au_portrait =
|
| | | #{portrait,jdbcType=VARCHAR},au_create_time =
|
| | | #{createTime,jdbcType=TIMESTAMP} where au_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.activity.ActivityUser">
|
| | | update yeshi_ec_activity_user
|
| | | <set>
|
| | | <if test="nickName != null">au_nick_name=#{nickName,jdbcType=VARCHAR},</if>
|
| | | <if test="portrait != null">au_portrait=#{portrait,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">au_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | </set>
|
| | | where au_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.activity.ActivityUser" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_activity_user (au_id,au_nick_name,au_portrait,au_create_time,au_tag) values (#{id,jdbcType=BIGINT},#{nickName,jdbcType=VARCHAR},#{portrait,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{tag,jdbcType=VARCHAR})</insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.activity.ActivityUser" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_activity_user
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">au_id,</if>
|
| | | <if test="nickName != null">au_nick_name,</if>
|
| | | <if test="portrait != null">au_portrait,</if>
|
| | | <if test="createTime != null">au_create_time,</if>
|
| | | <if test="tag != null">au_tag,</if>
|
| | | </trim>values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="nickName != null">#{nickName,jdbcType=VARCHAR},</if>
|
| | | <if test="portrait != null">#{portrait,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="tag != null">#{tag,jdbcType=VARCHAR},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.activity.ActivityUser">update yeshi_ec_activity_user set au_nick_name = #{nickName,jdbcType=VARCHAR},au_portrait = #{portrait,jdbcType=VARCHAR},au_create_time = #{createTime,jdbcType=TIMESTAMP},au_tag = #{tag,jdbcType=VARCHAR} where au_id = #{id,jdbcType=BIGINT}</update>
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.activity.ActivityUser">update yeshi_ec_activity_user
|
| | | <set>
|
| | | <if test="nickName != null">au_nick_name=#{nickName,jdbcType=VARCHAR},</if>
|
| | | <if test="portrait != null">au_portrait=#{portrait,jdbcType=VARCHAR},</if>
|
| | | <if test="createTime != null">au_create_time=#{createTime,jdbcType=TIMESTAMP},</if>
|
| | | <if test="tag != null">au_tag=#{tag,jdbcType=VARCHAR},</if>
|
| | | </set> where au_id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | | </mapper>
|
| | |
| | | </foreach>
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | | |
| | | |
| | | <select id="countOrderByTypeAndDate" resultType="Integer">
|
| | | SELECT COUNT(co.`co_id`) FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE 1=1
|
| | | <if test="orderType == 1"> <!-- 自购订单 -->
|
| | | AND (v2.hb_type =1 or v2.hb_type =2)
|
| | | </if>
|
| | | <if test="orderType == 2"> <!-- 分享订单 -->
|
| | | AND v2.`hb_type` = 20
|
| | | </if>
|
| | | <if test="orderType == 3"> <!-- 邀请订单 -->
|
| | | AND v2.`hb_type` = 6
|
| | | </if>
|
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id`
|
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
|
| | | WHERE hb.hb_id IS NOT NULL AND (co.`co_state`=1 OR co.`co_state`=2) |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y-%m-%d') = #{preDay}
|
| | | GROUP BY co.`co_order_no`, co.`co_source_type`
|
| | | </select>
|
| | | |
| | | </mapper>
|
| | |
| | | </sql>
|
| | |
|
| | |
|
| | | <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 and joi_valid_code!=2
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY jo_order_time
|
| | | <select id="countOrderByDay" resultType="Long">
|
| | | SELECT COUNT(`joi_id`) FROM `yeshi_ec_jd_order_item` |
| | | left join yeshi_ec_jd_order on jo_order_id=joi_order_id |
| | | WHERE joi_valid_code!=2 AND FROM_UNIXTIME(jo_order_time/1000,'%Y-%m-%d')=#{preDay}
|
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | |
|
| | | <resultMap id="CountOrderMap" type="com.yeshi.fanli.dto.order.CountOrderDTO">
|
| | | <result column="uid" property="uid" jdbcType="BIGINT" />
|
| | | <result column="totalOrder" property="totalOrder" jdbcType="INTEGER" />
|
| | | <result column="commission" property="commission" jdbcType="DECIMAL" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Column_DateType">
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(t.`co_third_create_time`,'%Y-%m-%d') AS 'showDate'
|
| | |
| | | </if>
|
| | | </select>
|
| | |
|
| | | <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"/> |
| | | <include refid="Count_Group_DateType"/>
|
| | | ORDER BY t.`co_third_create_time`
|
| | | <select id="countOrderBySourceTypeAndDay" resultType="java.lang.Long">
|
| | | SELECT COUNT(t.`co_id`) FROM `yeshi_ec_common_order` t |
| | | WHERE t.co_source_type=#{sourceType} AND DATE_FORMAT(t.`co_third_create_time`,'%Y-%m-%d') = #{preDay}
|
| | | </select>
|
| | |
|
| | |
|
| | |
| | | ) b WHERE b.c>=#{minSameGoodsOrderCount}
|
| | | </select>
|
| | |
|
| | | <select id="countOderByUidAndDate" resultType="Integer">
|
| | | SELECT COUNT(1) FROM (SELECT d.`co_id` FROM `yeshi_ec_common_order` d
|
| | | WHERE d.`co_third_create_time`<![CDATA[<=]]> #{preDay} AND d.`co_uid` = #{uid} |
| | | AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A
|
| | | </select>
|
| | |
|
| | | <select id="countValidOrderByDay" resultMap="CountOrderMap">
|
| | | SELECT co_uid AS uid ,totalOrder FROM (
|
| | | SELECT COUNT(d.`co_id`) AS totalOrder,d.`co_uid` FROM `yeshi_ec_common_order` d
|
| | | WHERE DATE_FORMAT(d.`co_third_create_time`,'%Y-%m-%d') = '2019-11-11' AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A
|
| | | GROUP BY co_uid
|
| | | </select>
|
| | | |
| | | <select id="countDownOrderUserByUidAndDate" resultType="Integer">
|
| | | SELECT COUNT(DISTINCT d.`co_uid`) FROM `yeshi_ec_common_order` d
|
| | | WHERE d.`co_third_create_time`<![CDATA[<=]]> #{preDay} AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | <foreach collection="list" item="uid" open="AND (" separator="OR" close=")" >
|
| | | d.`co_uid` = #{uid} |
| | | </foreach>
|
| | | </select>
|
| | | |
| | | <select id="countCommissionByDay" resultMap="CountOrderMap">
|
| | | SELECT co_uid AS uid ,commission FROM (
|
| | | SELECT SUM(IFNULL(d.`co_eIncome`,d.`co_estimate`)) AS commission,d.`co_uid` FROM `yeshi_ec_common_order` d
|
| | | WHERE DATE_FORMAT(d.`co_third_create_time`,'%Y-%m-%d') = '2019-11-11' AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A
|
| | | GROUP BY co_uid
|
| | | </select>
|
| | | |
| | | <select id="countOderByDate" resultType="Integer">
|
| | | SELECT COUNT(1) FROM (SELECT d.`co_id` FROM `yeshi_ec_common_order` d
|
| | | WHERE DATE_FORMAT(d.`co_third_create_time`,'%Y-%m-%d') = #{preDay} AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | GROUP BY d.`co_order_no`,d.`co_source_type`)A
|
| | | </select>
|
| | | |
| | | |
| | | <select id="countCommissionByDate" resultType="BigDecimal">
|
| | | SELECT SUM(IFNULL(d.`co_eIncome`,d.`co_estimate`)) FROM `yeshi_ec_common_order` d
|
| | | WHERE d.`co_third_create_time`= #{preDay} AND (d.`co_state`=1 OR d.`co_state`=2) |
| | | </select>
|
| | |
|
| | | </mapper>
|
| | |
| | | <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" resultMap="ChartMap">
|
| | | SELECT COUNT(t.`id`) AS showValue,
|
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | | </if>
|
| | | <if test="dateType == 2">FROM_UNIXTIME(t.`createTime`/1000,'%m') AS 'showDate'</if>
|
| | | <if test="dateType == 3">FROM_UNIXTIME(t.`createTime`/1000,'%Y') AS 'showDate'</if>
|
| | | FROM `yeshi_ec_lost_order` t WHERE t.`createTime`IS NOT NULL
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
|
| | | '${endTime}'
|
| | | </if>
|
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(t.`createTime`/1000,'%Y') = '${year}'
|
| | | </if>
|
| | | <if test="resultCode != null and resultCode != 0 ">AND t.`result_code` = ${resultCode}</if>
|
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="dateType == 2">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m')</if>
|
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if>
|
| | | ORDER BY t.`createTime`
|
| | | |
| | | <select id="countLostOrderNum" resultType="Integer">
|
| | | SELECT COUNT(1) FROM (SELECT COUNT(t.`id`) FROM `yeshi_ec_lost_order` t |
| | | WHERE FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') = #{preDay}
|
| | | GROUP BY t.`orderId`,t.`orderType`)A
|
| | | </select>
|
| | | <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'
|
| | | </if>
|
| | | <if test="dateType == 2">FROM_UNIXTIME(t.`createTime`/1000,'%m') AS 'showDate'</if>
|
| | | <if test="dateType == 3">FROM_UNIXTIME(t.`createTime`/1000,'%Y') AS 'showDate'</if>
|
| | | FROM `yeshi_ec_lost_order` t LEFT JOIN `yeshi_ec_common_order` tc ON
|
| | | tc.`co_order_no` = t.`orderId` LEFT JOIN `yeshi_ec_hongbao_order` h ON
|
| | | h.`ho_order_id` = tc.`co_id` LEFT JOIN `yeshi_ec_hongbao_v2`v ON
|
| | | h.`ho_hongbao_id` = v.`hb_id` WHERE t.`createTime`IS NOT NULL AND
|
| | | t.`result_code` = 2 AND (v.`hb_type` =1 OR v.`hb_type` = 2)
|
| | | <if test="startTime != null and startTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')<![CDATA[ >= ]]>'${startTime}'
|
| | | </if>
|
| | | <if test="endTime != null and endTime != '' ">
|
| | | AND FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') <![CDATA[ <= ]]>
|
| | | '${endTime}'
|
| | | </if>
|
| | | <if test="year != null and year != '' ">AND FROM_UNIXTIME(t.`createTime`/1000,'%Y') = '${year}'
|
| | | </if>
|
| | | <if test="dateType == 1">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d')
|
| | | </if>
|
| | | <if test="dateType == 2">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m')</if>
|
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if>
|
| | | ORDER BY t.`createTime`
|
| | | |
| | | <select id="countAppealMoney" resultType="BigDecimal">
|
| | | SELECT SUM(IFNULL(co.`co_eIncome`,co.`co_estimate`)) FROM `yeshi_ec_lost_order` t |
| | | LEFT JOIN yeshi_ec_common_order co ON (co.`co_order_no` = t.`orderId` AND co.`co_source_type` = t.`orderType`)
|
| | | WHERE FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') = #{preDay} AND (co.`co_state`=1 OR co.`co_state`=2) |
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | | <select id="listByMaxHandleTimeAndStateAndResultCode" resultMap="BaseResultMap">
|
| | |
| | | </set> |
| | | where wr_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | <select id="countWeiQaunOrderNumberByDate" resultType="Integer"> |
| | | SELECT COUNT(1) FROM (SELECT co.`co_id` FROM `yeshi_ec_user_order_weiquan_record` w |
| | | LEFT JOIN `yeshi_ec_common_order` co ON (w.`wr_trade_id` = co.`co_trade_id` AND w.`wr_source_type` = co.`co_source_type`) |
| | | WHERE DATE_FORMAT(w.`wr_create_time`,'%Y-%m-%d') = #{preDay} |
| | | GROUP BY co.`co_order_no`,co.`co_source_type`)A |
| | | </select> |
| | | |
| | | <select id="countWeiQaunOrderMoneyByDate" resultType="BigDecimal"> |
| | | SELECT SUM(w.`wr_money`) FROM `yeshi_ec_user_order_weiquan_record` w |
| | | WHERE DATE_FORMAT(w.`wr_create_time`,'%Y-%m-%d') = #{preDay} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(po_order_create_time,'%Y')</if>
|
| | | </sql>
|
| | |
|
| | |
|
| | |
|
| | | <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
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY po_order_create_time
|
| | | <select id="countOrderByDay" resultType="Long">
|
| | | SELECT COUNT(`po_id`) FROM `yeshi_ec_pdd_order`
|
| | | WHERE FROM_UNIXTIME(po_order_create_time,'%Y-%m-%d') = #{preDay}
|
| | | </select>
|
| | |
|
| | |
|
| | |
| | | <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" 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
|
| | | <include refid="Count_Select_DateType" />
|
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`to_create_time`
|
| | | |
| | | <select id="countOrderByDay" resultType="Long">
|
| | | SELECT COUNT(t.`to_id`) FROM `yeshi_ec_taobao_order` t
|
| | | WHERE DATE_FORMAT(t.`to_create_time`,'%Y-%m-%d') = #{preDay}
|
| | | </select>
|
| | | </mapper>
|
| | |
| | | <include refid="Count_Group_DateType" />
|
| | | ORDER BY t.`tmo_weiquan_time`
|
| | | </select>
|
| | | |
| | | |
| | | </mapper>
|
| | |
| | | package com.yeshi.fanli.service.impl.activity;
|
| | |
|
| | | import java.io.InputStream;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.UUID;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.activity.ActivityRuleUserMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.activity.ActivityUserMapper;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | | import com.yeshi.fanli.exception.dynamic.ActivityUserException;
|
| | | import com.yeshi.fanli.service.inter.activity.ActivityUserService;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class ActivityUserServiceImpl implements ActivityUserService {
|
| | |
| | | activityRuleUserMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public ActivityUser getActivityUserByNickName(ActivityUser record, MultipartFile file) throws ActivityUserException{
|
| | | if (record == null || StringUtil.isNullOrEmpty(record.getNickName()))
|
| | | throw new ActivityUserException(1, "昵称不能为空");
|
| | | try {
|
| | | ActivityUser userExist = activityUserMapper.selectByName(record.getNickName().trim());
|
| | | if (userExist != null) {
|
| | | return userExist;
|
| | | }
|
| | | |
| | | // 不存在则新增
|
| | | if (file == null) {
|
| | | throw new ActivityUserException(1, "头像不能为空");
|
| | | }
|
| | | String portrait = uploadPicture(file);
|
| | | record.setPortrait(portrait);
|
| | | record.setCreateTime(new Date());
|
| | | activityUserMapper.insertSelective(record);
|
| | | |
| | | return record;
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | throw new ActivityUserException(1, "用户信息保存异常");
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 上传图片
|
| | | * @param file
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public String uploadPicture(MultipartFile file) throws Exception {
|
| | | // 文件解析 |
| | | InputStream inputStream = file.getInputStream();
|
| | | String contentType = file.getContentType();
|
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | | // 文件路径
|
| | | String filePath= FilePathEnum.activityUser.getPath() +UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | // 执行上传
|
| | | String fileLink= COSManager.getInstance().uploadFile(inputStream, filePath).getUrl();
|
| | | |
| | | return fileLink;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<ActivityRuleUser> listByRuleCode(Integer ruleCode, int page, int pageSize) {
|
| | | return activityRuleUserMapper.listByRuleCode(ruleCode, (page - 1) * pageSize, pageSize);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ActivityUser selectByName(String nickName) {
|
| | | return activityUserMapper.selectByName(nickName);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public long countByRuleCode(Integer ruleCode) {
|
| | | return activityRuleUserMapper.countByRuleCode(ruleCode);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void deleteByRuleUserId(Long id) {
|
| | | ActivityRuleUser user = activityRuleUserMapper.selectByPrimaryKey(id);
|
| | |
| | | package com.yeshi.fanli.service.impl.count;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | 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.dao.user.count.CountOrderInfoDao;
|
| | | import com.yeshi.fanli.dao.user.count.CountOrderTrackRateDao;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.dto.order.CountOrderDTO;
|
| | | import com.yeshi.fanli.entity.admin.count.CountOrderTrackRate;
|
| | | import com.yeshi.fanli.entity.admin.count.CountOrderTrackRate.OrderTrackRateEnum;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | @Service
|
| | | public class CommonOrderCountServiceImpl implements CommonOrderCountService {
|
| | |
| | |
|
| | | @Resource
|
| | | private CommonOrderCountMapper commonOrderCountMapper;
|
| | | |
| | | |
| | | @Resource
|
| | | private CountOrderInfoDao countOrderInfoDao;
|
| | | |
| | | |
| | | @Resource
|
| | | private CountOrderTrackRateDao countOrderTrackRateDao;
|
| | | |
| | |
|
| | | @Override
|
| | | public Long countByState(Integer state) {
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime, String endTime,
|
| | | int sourceType) throws Exception {
|
| | |
|
| | | List<ChartTDO> result_list = null;
|
| | |
|
| | | // 用户订单
|
| | | List<ChartTDO> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year, startTime, endTime,
|
| | | sourceType);
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | // 淘宝联盟
|
| | | List<ChartTDO> type_list = null;
|
| | | switch (sourceType) {
|
| | | case Constant.SOURCE_TYPE_TAOBAO:
|
| | | type_list = taoBaoOrderMapper.countOrderNumber(dateType, year, startTime, endTime);
|
| | | break;
|
| | | case Constant.SOURCE_TYPE_JD:
|
| | | type_list = jdOrderItemMapper.countOrderNumber(dateType, year, startTime, endTime);
|
| | | break;
|
| | | case Constant.SOURCE_TYPE_PDD:
|
| | | type_list = pddOrderMapper.countOrderNumber(dateType, year, startTime, endTime);
|
| | | break;
|
| | | }
|
| | | if (type_list == null || type_list.size() == 0) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | switch (dateType) {
|
| | | case 1: // 按天处理
|
| | | result_list = dayFactory(startTime, endTime, type_list);
|
| | | break;
|
| | | case 2: // 按月处理
|
| | | result_list = monthFactory(type_list);
|
| | | break;
|
| | | case 3:
|
| | | result_list = yearFactory(type_list);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | |
|
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | | double proportion = 0;
|
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listTotal.size(); j++) {
|
| | | ChartTDO innerChartTDO = listTotal.get(j);
|
| | | String innerDate = innerChartTDO.getShowDate();
|
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | | String innerValue = innerChartTDO.getShowValue();
|
| | | long innerData = Long.parseLong(innerValue);
|
| | |
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | |
|
| | | if (showData > 0) {
|
| | | proportion = innerData / (double) showData;
|
| | | }
|
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | | chartTDO.setShowValue(Double.parseDouble(df.format(proportion * 100)) + "");
|
| | | }
|
| | |
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ChartTDO> countWeiQaunOrderMoney(Integer dateType, String year, String startTime, String endTime)
|
| | |
| | | public List<Long> getSameGoodsOrderByUidAndHongBaoType(List<Integer> typeList, Long uid, int minSameGoodsOrderCount) {
|
| | | return commonOrderCountMapper.getSameGoodsOrderByUidAndHongBaoType(typeList, uid, minSameGoodsOrderCount);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public Integer countOderByUidAndDate(Date preDay, Long uid) {
|
| | | return commonOrderCountMapper.countOderByUidAndDate(preDay, uid);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<CountOrderDTO> countValidOrderByDay(String preDay) {
|
| | | return commonOrderCountMapper.countValidOrderByDay(preDay);
|
| | | }
|
| | | |
| | | @Override
|
| | | public Integer countDownOrderUserByUidAndDate(Date preDay, List<Long> list) {
|
| | | return commonOrderCountMapper.countDownOrderUserByUidAndDate(preDay, list);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<CountOrderDTO> countCommissionByDay(String preDay) {
|
| | | return commonOrderCountMapper.countCommissionByDay(preDay);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public Integer countOderByDate(String preDay) {
|
| | | return commonOrderCountMapper.countOderByDate(preDay);
|
| | | }
|
| | | |
| | | @Override
|
| | | public BigDecimal countCommissionByDate(String preDay) {
|
| | | return commonOrderCountMapper.countCommissionByDate(preDay);
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public List<CountOrderTrackRate> getOrderTrackRate(int type, Date startTime, Date endTime) {
|
| | | |
| | | OrderTrackRateEnum trackRateEnum = null;
|
| | | if (type == 1) {
|
| | | trackRateEnum = OrderTrackRateEnum.taobao;
|
| | | } else if (type == 2) {
|
| | | trackRateEnum = OrderTrackRateEnum.jd;
|
| | | } else if (type == 3) {
|
| | | trackRateEnum = OrderTrackRateEnum.pdd;
|
| | | } else {
|
| | | trackRateEnum = OrderTrackRateEnum.taobao;
|
| | | }
|
| | |
|
| | | // 重新查询统计今日以及空缺
|
| | | initOrderTrackRate(trackRateEnum);
|
| | | |
| | | return countOrderTrackRateDao.query(trackRateEnum, startTime, endTime);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initOrderTrackRate(OrderTrackRateEnum trackRateEnum) {
|
| | | try {
|
| | | CountOrderTrackRate lastRecord = countOrderTrackRateDao.getMaxDate(trackRateEnum);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2018-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addOrderTrackRateCount(DateUtil.plusDay(i, lastDay), trackRateEnum);
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addOrderTrackRateCount(DateUtil.reduceDay2(1, lastDay), trackRateEnum);
|
| | | // 重新统计今日
|
| | | addOrderTrackRateCount(TimeUtil.getGernalTime(today.getTime()), trackRateEnum);
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | |
|
| | | private void addOrderTrackRateCount(String preDay, OrderTrackRateEnum trackRateEnum) throws Exception {
|
| | | int value = trackRateEnum.getValue();
|
| | | Long count = commonOrderCountMapper.countOrderBySourceTypeAndDay(preDay,value);
|
| | | if (count == null) {
|
| | | count = 0L;
|
| | | }
|
| | | |
| | | Long total = null;
|
| | | switch (value) {
|
| | | case Constant.SOURCE_TYPE_TAOBAO:
|
| | | total = taoBaoOrderMapper.countOrderByDay(preDay);
|
| | | break;
|
| | | case Constant.SOURCE_TYPE_JD:
|
| | | total = jdOrderItemMapper.countOrderByDay(preDay);
|
| | | break;
|
| | | case Constant.SOURCE_TYPE_PDD:
|
| | | total = pddOrderMapper.countOrderByDay(preDay);
|
| | | break;
|
| | | }
|
| | | |
| | | if(total == null)
|
| | | total = 0L;
|
| | | |
| | | CountOrderTrackRate record = new CountOrderTrackRate();
|
| | | record.setNum(count);
|
| | | record.setTotalNum(total);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(trackRateEnum.name());
|
| | | record.setId(StringUtil.Md5(preDay + trackRateEnum.name()));
|
| | | countOrderTrackRateDao.save(record);
|
| | | }
|
| | | |
| | | |
| | | }
|
| | |
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | |
| | | return hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @Override
|
| | | public Integer countOrderByTypeAndDate(Integer orderType, String preDay) {
|
| | | return hongBaoV2CountMapper.countOrderByTypeAndDate(orderType, preDay);
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public List<ChartTDO> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | |
| | | package com.yeshi.fanli.service.impl.count;
|
| | |
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoCountMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dao.user.count.CountOrderInfoDao;
|
| | | import com.yeshi.fanli.dao.user.count.CountUserInfoDao;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.dto.order.CountOrderDTO;
|
| | | import com.yeshi.fanli.entity.admin.count.CountOrderInfo;
|
| | | import com.yeshi.fanli.entity.admin.count.CountOrderInfo.CountOrderEnum;
|
| | | import com.yeshi.fanli.entity.admin.count.CountUserInfo;
|
| | | import com.yeshi.fanli.entity.admin.count.CountUserInfo.CountUserEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoRegister;
|
| | | import com.yeshi.fanli.entity.system.ChannelEnum;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.count.UserInfoCountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.UserOrderWeiQuanRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoRegisterService;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | | @Service
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoMapper userInfoMapper;
|
| | | |
| | |
|
| | | @Resource
|
| | | private UserInfoCountMapper userInfoCountMapper;
|
| | |
|
| | | @Resource
|
| | | private CountUserInfoDao countUserInfoDao;
|
| | |
|
| | | @Resource
|
| | | private CountOrderInfoDao countOrderInfoDao;
|
| | |
|
| | | @Resource
|
| | | private CommonOrderCountService commonOrderCountService;
|
| | | |
| | | @Resource
|
| | | private HongBaoV2CountService hongBaoV2CountService;
|
| | |
|
| | | @Resource
|
| | | private UserOrderWeiQuanRecordService userOrderWeiQuanRecordService;
|
| | | |
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | | |
| | | @Resource
|
| | | private UserInfoRegisterService userInfoRegisterService;
|
| | | |
| | | |
| | | |
| | | |
| | | @Override
|
| | | public long countNewUser(Integer isToday, Integer isMonth) {
|
| | | return userInfoMapper.countNewUser(isToday, isMonth);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public long countRank(Integer rank) {
|
| | | return userInfoMapper.countRank(rank);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public BigDecimal countAllMoney(Double rank) {
|
| | | return userInfoMapper.countAllMoney(rank);
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public long countLoseUser(int daysNum) {
|
| | |
| | | public long countHasOrderUser() {
|
| | | return userInfoMapper.countHasOrderUser();
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public List<ChartTDO> 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<ChartTDO> 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<ChartTDO> result_list = null;
|
| | | |
| | | List<ChartTDO> listToday = |
| | | userInfoMapper.getTodayHasOrder(channel, dateType, years, startTime, endTime);
|
| | | |
| | |
|
| | | List<ChartTDO> listToday = userInfoMapper.getTodayHasOrder(channel, dateType, years, startTime, endTime);
|
| | |
|
| | | if (listToday == null || listToday.size() == 0) {
|
| | | return result_list;
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | List<ChartTDO> listTotal = userInfoMapper.countNewUserByDate(channel, dateType, years, startTime, endTime);
|
| | | |
| | |
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | | |
| | | switch (dateType){
|
| | | case 1: // 按天处理
|
| | | result_list = dayFactory(startTime, endTime, listTotal);
|
| | | break;
|
| | | case 2: // 按月处理
|
| | | result_list = monthFactory(listTotal);
|
| | | break;
|
| | | case 3: |
| | | result_list = yearFactory(listTotal);
|
| | | break;
|
| | | default: |
| | | break;
|
| | |
|
| | | switch (dateType) {
|
| | | case 1: // 按天处理
|
| | | result_list = dayFactory(startTime, endTime, listTotal);
|
| | | break;
|
| | | case 2: // 按月处理
|
| | | result_list = monthFactory(listTotal);
|
| | | break;
|
| | | case 3:
|
| | | result_list = yearFactory(listTotal);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | | }
|
| | | |
| | |
|
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | | |
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | | double proportion = 0;
|
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listToday.size(); j++) {
|
| | | ChartTDO innerTDO = listToday.get(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);
|
| | | |
| | |
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | | |
| | |
|
| | | if (showData > 0) {
|
| | | proportion = innerData/(double)showData;
|
| | | proportion = innerData / (double) showData;
|
| | | }
|
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | | chartTDO.setShowValue(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 {
|
| | | public List<Object> getWeekBuyRate(String channel, String startTime, String endTime, Integer orderNum,
|
| | | List<String> dateList) throws Exception {
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | | if (dateList == null || dateList.size() == 0) {
|
| | | return resultList;
|
| | |
| | |
|
| | | return resultList;
|
| | | }
|
| | | |
| | |
|
| | | public List<ChartTDO> dayFactory(String startTime, String endTime, List<ChartTDO> list) throws Exception {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | |
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | |
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | ChartTDO chartTDO = list.get(j);
|
| | |
| | | for (int i = 1; i <= 12; i++) {
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String month = chartTDO.getShowDate();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = chartTDO.getShowValue();
|
| | |
| | | if (total == null) {
|
| | | total = "0";
|
| | | }
|
| | | |
| | |
|
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowValue(total);
|
| | | |
| | | if (i <10) {
|
| | | chartTDO.setShowDate( "0"+ i);
|
| | |
|
| | | if (i < 10) {
|
| | | chartTDO.setShowDate("0" + i);
|
| | | } else {
|
| | | chartTDO.setShowDate( ""+ i);
|
| | | chartTDO.setShowDate("" + i);
|
| | | }
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | |
| | | public long countByUserGoldCoin(int type, String key) {
|
| | | return userInfoCountMapper.countByUserGoldCoin(type, key);
|
| | | }
|
| | | |
| | | |
| | |
|
| | | @Override
|
| | | public List<UserGoldCoinVO> listByHasGoldCoin(long start, int count, String key) {
|
| | | return userInfoCountMapper.listByHasGoldCoin(start, count, key);
|
| | |
| | | public long countByHasGoldCoin(String key) {
|
| | | return userInfoCountMapper.countByHasGoldCoin(key);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CountUserInfo> getNewUserData(Date startTime, Date endTime, String channel) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initChannelUserCount();
|
| | |
|
| | | return countUserInfoDao.query(CountUserEnum.newUser, startTime, endTime, channel);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | @Override
|
| | | public void initChannelUserCount() {
|
| | | CountUserInfo lastRecord = countUserInfoDao.getMaxDate(CountUserEnum.newUser);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | | try {
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2017-05-14");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | // 统计今日之前的
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | }
|
| | | // 重新统计今日
|
| | | addRecordCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordCount(String preDay) throws Exception {
|
| | | ChannelEnum[] channels = ChannelEnum.values();
|
| | | for (int i = 0; i < channels.length; i++) {
|
| | | Integer count = userInfoRegisterService.countByChannelAndDay(channels[i].getVlaue(), preDay);
|
| | | if (count == null) {
|
| | | count = 0;
|
| | | }
|
| | | CountUserInfo record = new CountUserInfo();
|
| | | record.setNum(count);
|
| | | record.setChannel(channels[i].name());
|
| | | record.setId(StringUtil.Md5(preDay + channels[i].name() + CountUserEnum.newUser.name()));
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountUserEnum.newUser);
|
| | | countUserInfoDao.save(record);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> countOderByChannel(String channel, Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initOrderCount();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.channelTotal, startTime, endTime, channel);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initOrderCount() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.channelTotal);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2018-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordOrderCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordOrderCount(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordOrderCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | private void addRecordOrderCount(String preDay) throws Exception {
|
| | | ChannelEnum[] channels = ChannelEnum.values();
|
| | | for (int i = 0; i < channels.length; i++) {
|
| | | int count = 0;
|
| | | String channelVlaue = channels[i].getVlaue();
|
| | | |
| | | List<CountOrderDTO> listOrder = commonOrderCountService.countValidOrderByDay(preDay);
|
| | | if (listOrder != null && listOrder.size() > 0) {
|
| | | List<Long> listUid = new ArrayList<>();
|
| | | for (CountOrderDTO countOrderDTO: listOrder) {
|
| | | listUid.add(countOrderDTO.getUid());
|
| | | }
|
| | | |
| | | List<UserInfoRegister> listRegister = userInfoRegisterService.listByMultipleUids(listUid);
|
| | | if (listRegister != null && listRegister.size() > 0) {
|
| | | for (int m = 0; m <listRegister.size(); m ++) {
|
| | | boolean reduce = false;
|
| | | Long uid = listRegister.get(m).getId();
|
| | | String vlaue = listRegister.get(m).getChannel().getVlaue();
|
| | | |
| | | for (int n = 0; n <listOrder.size(); n ++) {
|
| | | if (channelVlaue.equalsIgnoreCase(vlaue) && uid.longValue() == listOrder.get(n).getUid()) {
|
| | | Integer totalOrder = listOrder.get(n).getTotalOrder();
|
| | | if (totalOrder != null)
|
| | | count += totalOrder;
|
| | | |
| | | listOrder.remove(n);
|
| | | n--;
|
| | | reduce = true;
|
| | | }
|
| | | }
|
| | | |
| | | if (reduce) {
|
| | | listRegister.remove(m);
|
| | | m--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setNum(count);
|
| | | record.setChannel(channels[i].name());
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.channelTotal.name());
|
| | | record.setId(StringUtil.Md5(preDay + channels[i].name() + CountOrderEnum.channelTotal.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> count24HOderByChannel(String channel, Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | init24HOrderCount();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.oder24H, startTime, endTime, channel);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void init24HOrderCount() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.oder24H);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2018-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecord24HOrderCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecord24HOrderCount(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecord24HOrderCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecord24HOrderCount(String preDay) throws Exception {
|
| | | ChannelEnum[] channels = ChannelEnum.values();
|
| | | for (int i = 0; i < channels.length; i++) {
|
| | | int count = 0;
|
| | | List<UserInfoRegister> list = userInfoRegisterService.listByChannelAndDay(channels[i].getVlaue(), preDay);
|
| | | if (list != null && list.size() > 0) {
|
| | | // 统计24小时产生订单数量
|
| | | for (UserInfoRegister user : list) {
|
| | | Date limitDay = DateUtil.plusDayDate(1, user.getCreateTime());
|
| | | Integer total = commonOrderCountService.countOderByUidAndDate(limitDay, user.getId());
|
| | | if (total != null)
|
| | | count += total;
|
| | | }
|
| | | }
|
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setNum(count);
|
| | | record.setChannel(channels[i].name());
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.oder24H.name());
|
| | | record.setId(StringUtil.Md5(preDay + channels[i].name() + CountOrderEnum.oder24H.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> countHongBaoByChannel(String channel, Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initHongBaoCount();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.channelCommission, startTime, endTime, channel);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initHongBaoCount() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.channelCommission);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2018-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordHongBaoCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordHongBaoCount(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordHongBaoCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordHongBaoCount(String preDay) throws Exception {
|
| | | ChannelEnum[] channels = ChannelEnum.values();
|
| | | for (int i = 0; i < channels.length; i++) {
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | String channelVlaue = channels[i].getVlaue();
|
| | | |
| | | List<CountOrderDTO> listOrder = commonOrderCountService.countCommissionByDay(preDay);
|
| | | if (listOrder != null && listOrder.size() > 0) {
|
| | | List<Long> listUid = new ArrayList<>();
|
| | | for (CountOrderDTO countOrderDTO: listOrder) {
|
| | | listUid.add(countOrderDTO.getUid());
|
| | | }
|
| | | |
| | | List<UserInfoRegister> listRegister = userInfoRegisterService.listByMultipleUids(listUid);
|
| | | if (listRegister != null && listRegister.size() > 0) {
|
| | | for (int m = 0; m <listRegister.size(); m ++) {
|
| | | boolean reduce = false;
|
| | | Long uid = listRegister.get(m).getId();
|
| | | String vlaue = listRegister.get(m).getChannel().getVlaue();
|
| | | |
| | | for (int n = 0; n <listOrder.size(); n ++) {
|
| | | if (channelVlaue.equalsIgnoreCase(vlaue) && uid.longValue() == listOrder.get(n).getUid()) {
|
| | | BigDecimal commission = listOrder.get(n).getCommission();
|
| | | if (commission != null)
|
| | | MoneyBigDecimalUtil.add(money, commission);
|
| | | |
| | | listOrder.remove(n);
|
| | | n--;
|
| | | reduce = true;
|
| | | }
|
| | | }
|
| | | |
| | | if (reduce) {
|
| | | listRegister.remove(m);
|
| | | m--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setMoney(money);
|
| | | record.setChannel(channels[i].name());
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.channelCommission.name());
|
| | | record.setId(StringUtil.Md5(preDay + channels[i].name() + CountOrderEnum.channelCommission.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> countWeiQuanOrder(Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initWeiQuanCount();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.weiQuanNum, startTime, endTime);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initWeiQuanCount() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.weiQuanNum);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2019-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordWeiQuanCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordWeiQuanCount(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordWeiQuanCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordWeiQuanCount(String preDay) throws Exception {
|
| | | Integer count = userOrderWeiQuanRecordService.countWeiQaunOrderNumberByDate(preDay);
|
| | | if (count == null)
|
| | | count = 0;
|
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setNum(count);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.weiQuanNum.name());
|
| | | record.setId(StringUtil.Md5(preDay + CountOrderEnum.weiQuanNum.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> countWeiQuanOrderMoney(Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initWeiQuanMoneyCount();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.weiQuanMoney, startTime, endTime);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initWeiQuanMoneyCount() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.weiQuanMoney);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2019-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordWeiQuanMoneyCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordWeiQuanMoneyCount(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordWeiQuanMoneyCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordWeiQuanMoneyCount(String preDay) throws Exception {
|
| | | BigDecimal money = userOrderWeiQuanRecordService.countWeiQaunOrderMoneyByDate(preDay);
|
| | | if (money == null)
|
| | | money = new BigDecimal(0);
|
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setMoney(money);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.weiQuanMoney.name());
|
| | | record.setId(StringUtil.Md5(preDay + CountOrderEnum.weiQuanMoney.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> counOrderTotalNum(Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initOrderTotalNum();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.totalNum, startTime, endTime);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initOrderTotalNum() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.totalNum);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2019-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordOrderTotalNum(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordOrderTotalNum(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordOrderTotalNum(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordOrderTotalNum(String preDay) throws Exception {
|
| | | Integer num = commonOrderCountService.countOderByDate(preDay);
|
| | | if (num == null)
|
| | | num = 0;
|
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setNum(num);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.totalNum.name());
|
| | | record.setId(StringUtil.Md5(preDay + CountOrderEnum.totalNum.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | |
| | | |
| | | |
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> counOrderTotalCommission(Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initTotalCommission();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.totalCommission, startTime, endTime);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initTotalCommission() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.totalCommission);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2019-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordTotalCommission(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordTotalCommission(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordTotalCommission(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordTotalCommission(String preDay) throws Exception {
|
| | | BigDecimal money = commonOrderCountService.countCommissionByDate(preDay);
|
| | | if (money == null)
|
| | | money = new BigDecimal("0");
|
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setMoney(money);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.totalCommission.name());
|
| | | record.setId(StringUtil.Md5(preDay + CountOrderEnum.totalCommission.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> counOrderLastNum(Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initOrderLastNum();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.lastNum, startTime, endTime);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initOrderLastNum() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.lastNum);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2019-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordOrderLastNum(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordOrderLastNum(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordOrderLastNum(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordOrderLastNum(String preDay) throws Exception {
|
| | | Integer num = lostOrderService.countLostOrderNum(preDay);
|
| | | if (num == null)
|
| | | num = 0;
|
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setNum(num);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.lastNum.name());
|
| | | record.setId(StringUtil.Md5(preDay + CountOrderEnum.lastNum.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> counOrderLastMoney(Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initOrderLastMoney();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.lastMoney, startTime, endTime);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initOrderLastMoney() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.lastMoney);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2019-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordOrderLastMoney(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordOrderLastMoney(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordOrderLastMoney(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordOrderLastMoney(String preDay) throws Exception {
|
| | | BigDecimal money = lostOrderService.countAppealMoney(preDay);
|
| | | if (money == null)
|
| | | money = new BigDecimal("0");
|
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setMoney(money);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.lastMoney.name());
|
| | | record.setId(StringUtil.Md5(preDay + CountOrderEnum.lastMoney.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public List<CountOrderInfo> countOrderType(Integer state, Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initOrderTypeCount();
|
| | |
|
| | | return countOrderInfoDao.query(CountOrderEnum.orderType, startTime, endTime, state);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initOrderTypeCount() {
|
| | | try {
|
| | | CountOrderInfo lastRecord = countOrderInfoDao.getMaxDate(CountOrderEnum.orderType);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | |
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2018-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordOrderTypeCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordOrderTypeCount(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordOrderTypeCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordOrderTypeCount(String preDay) throws Exception {
|
| | | for (int i = 1; i < 4; i++) {
|
| | | Integer count = hongBaoV2CountService.countOrderByTypeAndDate(i, preDay);
|
| | | if (count == null)
|
| | | count = 0;
|
| | | CountOrderInfo record = new CountOrderInfo();
|
| | | record.setNum(count);
|
| | | record.setState(i);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountOrderEnum.orderType.name());
|
| | | record.setId(StringUtil.Md5(preDay + CountOrderEnum.orderType.name()));
|
| | | countOrderInfoDao.save(record);
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public List<CountUserInfo> countUserDownOrderByChannelAndToday(String channel, Date startTime, Date endTime) {
|
| | | // 重新查询统计今日以及空缺
|
| | | initTodayDownOrderCount();
|
| | |
|
| | | return countUserInfoDao.query(CountUserEnum.todayOrder, startTime, endTime, channel);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | private void initTodayDownOrderCount() {
|
| | | try {
|
| | | CountUserInfo lastRecord = countUserInfoDao.getMaxDate(CountUserEnum.todayOrder);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2018-01-01");
|
| | | }
|
| | |
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordTodayDownOrderCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordTodayDownOrderCount(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordTodayDownOrderCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordTodayDownOrderCount(String preDay) throws Exception {
|
| | | ChannelEnum[] channels = ChannelEnum.values();
|
| | | for (int i = 0; i < channels.length; i++) {
|
| | | int count = 0;
|
| | | String channelVlaue = channels[i].getVlaue();
|
| | | |
| | | List<CountOrderDTO> listOrder = commonOrderCountService.countValidOrderByDay(preDay);
|
| | | if (listOrder != null && listOrder.size() > 0) {
|
| | | List<Long> listUid = new ArrayList<>();
|
| | | for (CountOrderDTO countOrderDTO: listOrder) {
|
| | | listUid.add(countOrderDTO.getUid());
|
| | | }
|
| | | |
| | | List<UserInfoRegister> listRegister = userInfoRegisterService.listByMultipleUidAndDay(listUid, preDay);
|
| | | if (listRegister != null && listRegister.size() > 0) {
|
| | | for (int m = 0; m <listRegister.size(); m ++) {
|
| | | boolean reduce = false;
|
| | | Long uid = listRegister.get(m).getId();
|
| | | String vlaue = listRegister.get(m).getChannel().getVlaue();
|
| | | |
| | | for (int n = 0; n <listOrder.size(); n ++) {
|
| | | if (channelVlaue.equalsIgnoreCase(vlaue) && uid.longValue() == listOrder.get(n).getUid()) {
|
| | | Integer totalOrder = listOrder.get(n).getTotalOrder();
|
| | | if (totalOrder != null)
|
| | | count += totalOrder;
|
| | | |
| | | listOrder.remove(n);
|
| | | n--;
|
| | | reduce = true;
|
| | | }
|
| | | }
|
| | | |
| | | if (reduce) {
|
| | | listRegister.remove(m);
|
| | | m--;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | CountUserInfo record = new CountUserInfo();
|
| | | record.setNum(count);
|
| | | record.setChannel(channels[i].name());
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountUserEnum.todayOrder);
|
| | | record.setId(StringUtil.Md5(preDay + channels[i].name() + CountUserEnum.todayOrder.name()));
|
| | | countUserInfoDao.save(record);
|
| | | }
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CountUserInfo> countUseByChannelAndWeekOrder(String channel, Date startTime, Date endTime) {
|
| | | return countUserInfoDao.query(CountUserEnum.weekOrder, startTime, endTime, channel);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<CountUserInfo> countUseByChannelAndWeekThreeOrder(String channel, Date startTime, Date endTime) {
|
| | | return countUserInfoDao.query(CountUserEnum.weekThreeOrder, startTime, endTime, channel);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | @Override
|
| | | public void initCountUserWeekOrder() {
|
| | | try {
|
| | | CountUserInfo lastRecord = countUserInfoDao.getMaxDate(CountUserEnum.weekOrder);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2018-01-01");
|
| | | }
|
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++) {
|
| | | addRecordWeekOrderCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | } else {
|
| | | // 重新统计昨日
|
| | | addRecordWeekOrderCount(DateUtil.reduceDay2(1, lastDay));
|
| | | // 重新统计今日
|
| | | addRecordWeekOrderCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | private void addRecordWeekOrderCount(String preDay) throws Exception {
|
| | | ChannelEnum[] channels = ChannelEnum.values();
|
| | | for (int i = 0; i < channels.length; i++) {
|
| | | int count = 0;
|
| | | int count3 = 0;
|
| | | List<UserInfoRegister> list = userInfoRegisterService.listByChannelAndDay(channels[i].getVlaue(), preDay);
|
| | | if (list != null && list.size() > 0) {
|
| | | Date startDay = new Date(TimeUtil.convertDateToTemp2(preDay + " 23:59:59"));
|
| | | Date limitDay = DateUtil.plusDayDate(6, startDay);
|
| | | for (UserInfoRegister user : list) {
|
| | | Integer total = commonOrderCountService.countOderByUidAndDate(limitDay, user.getId());
|
| | | if (total != null && total > 0) {
|
| | | count++;
|
| | | if (total >= 3) {
|
| | | count3++;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | // 7天内产生有效订单
|
| | | CountUserInfo record = new CountUserInfo();
|
| | | record.setNum(count);
|
| | | record.setChannel(channels[i].name());
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountUserEnum.weekOrder);
|
| | | record.setId(StringUtil.Md5(preDay + channels[i].name() + CountUserEnum.weekOrder.name()));
|
| | | countUserInfoDao.save(record);
|
| | |
|
| | | // 7天内产生3单以上有效订单
|
| | | CountUserInfo record3 = new CountUserInfo();
|
| | | record3.setNum(count3);
|
| | | record3.setChannel(channels[i].name());
|
| | | record3.setDay(TimeUtil.parse(preDay));
|
| | | record3.setType(CountUserEnum.weekThreeOrder);
|
| | | record3.setId(StringUtil.Md5(preDay + channels[i].name() + CountUserEnum.weekThreeOrder.name()));
|
| | | countUserInfoDao.save(record);
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.money.extract;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.ExtractAuditRecordMapper;
|
| | | import com.yeshi.fanli.dao.user.count.CountUserInfoDao;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.dto.money.ExtractOrderStatisticDTO;
|
| | | import com.yeshi.fanli.entity.admin.count.CountUserInfo;
|
| | | import com.yeshi.fanli.entity.admin.count.CountUserInfo.CountUserEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractAuditRecordService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | @Service
|
| | | public class ExtractAuditRecordServiceImpl implements ExtractAuditRecordService {
|
| | |
|
| | | @Resource
|
| | | private ExtractAuditRecordMapper extractAuditRecordMapper;
|
| | | |
| | | @Resource
|
| | | private CountUserInfoDao countUserInfoDao;
|
| | |
|
| | | @Override
|
| | | public List<ExtractAuditRecord> getList(int pageIndex, int pageSize, String key, String startTime, String endTime) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ChartTDO> countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countAuditTotal(state, type, years, startTime, endTime);
|
| | | public List<CountUserInfo> getAuditCount(Date startTime, Date endTime, Integer state) throws Exception {
|
| | | // 重新查询统计今日以及空缺
|
| | | initAuditCount();
|
| | | |
| | | return countUserInfoDao.query(CountUserEnum.extractAuditNumber, startTime, endTime, state);
|
| | | }
|
| | |
|
| | | // 初始化统计
|
| | | @Override
|
| | | public List<ChartTDO> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countExtractMoney(state, type, years, startTime, endTime);
|
| | | public void initAuditCount() {
|
| | | try {
|
| | | CountUserInfo lastRecord = countUserInfoDao.getMaxDate(CountUserEnum.extractAuditNumber);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | | |
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2017-07-19");
|
| | | }
|
| | | |
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++ ) {
|
| | | addRecordAuditCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | }
|
| | | // 重新统计今日
|
| | | addRecordAuditCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | private void addRecordAuditCount(String preDay) throws Exception{
|
| | | for (int i = 1; i < 3; i++) {
|
| | | int count = extractAuditRecordMapper.countAuditTotal(i, preDay);
|
| | | CountUserInfo record = new CountUserInfo();
|
| | | record.setState(i);
|
| | | record.setNum(count);
|
| | | record.setId(StringUtil.Md5(preDay + CountUserEnum.extractAuditNumber.name())+ "-" + i);
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountUserEnum.extractAuditNumber);
|
| | | countUserInfoDao.save(record);
|
| | | }
|
| | | } |
| | |
|
| | | |
| | | @Override
|
| | | public List<CountUserInfo> getApplyMoney(Date startTime, Date endTime) throws Exception {
|
| | | // 重新查询统计今日以及空缺
|
| | | initApplyMoneyCount();
|
| | | |
| | | return countUserInfoDao.query(CountUserEnum.extractApplyMoney, startTime, endTime);
|
| | | }
|
| | | |
| | | // 初始化统计
|
| | | @Override
|
| | | public void initApplyMoneyCount() {
|
| | | try {
|
| | | CountUserInfo lastRecord = countUserInfoDao.getMaxDate(CountUserEnum.extractApplyMoney);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | | |
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2017-07-19");
|
| | | }
|
| | | |
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++ ) {
|
| | | addRecordApplyMoneyCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | }
|
| | | // 重新统计今日
|
| | | addRecordApplyMoneyCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | private void addRecordApplyMoneyCount(String preDay) throws Exception{
|
| | | BigDecimal money = extractAuditRecordMapper.countApplyExtractMoney(preDay);
|
| | | if (money == null)
|
| | | money = new BigDecimal(0);
|
| | | CountUserInfo record = new CountUserInfo();
|
| | | record.setMoney(money);
|
| | | record.setId(StringUtil.Md5(preDay + CountUserEnum.extractApplyMoney.name()));
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountUserEnum.extractApplyMoney);
|
| | | countUserInfoDao.save(record);
|
| | | } |
| | |
|
| | | @Override
|
| | | public List<ChartTDO> countExtractApplyNumber(Integer state, Integer type, String years,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countExtractApplyNumber(state, type, years, startTime, endTime);
|
| | | public List<CountUserInfo> geApplyNumber(Date startTime, Date endTime) throws Exception {
|
| | | // 重新查询统计今日以及空缺
|
| | | initApplyNumberCount();
|
| | | |
| | | return countUserInfoDao.query(CountUserEnum.extractApplyNumber, startTime, endTime);
|
| | | }
|
| | |
|
| | | |
| | | // 初始化统计
|
| | | @Override
|
| | | public void initApplyNumberCount() {
|
| | | try {
|
| | | CountUserInfo lastRecord = countUserInfoDao.getMaxDate(CountUserEnum.extractApplyNumber);
|
| | | Date lastDay = null;
|
| | | if (lastRecord != null && lastRecord.getDay() != null) {
|
| | | lastDay = lastRecord.getDay();
|
| | | }
|
| | | |
| | | if (lastDay == null) {
|
| | | lastDay = TimeUtil.parse("2017-07-19");
|
| | | }
|
| | | |
| | | Date today = new Date();
|
| | | int betweenDays = DateUtil.daysBetween2(lastDay, today);
|
| | | if (betweenDays > 0) {
|
| | | for (int i = 0; i <= betweenDays; i++ ) {
|
| | | addRecordCount(DateUtil.plusDay(i, lastDay));
|
| | | }
|
| | | }
|
| | | // 重新统计今日
|
| | | addRecordCount(TimeUtil.getGernalTime(today.getTime()));
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | private void addRecordCount(String preDay) throws Exception{
|
| | | int count = extractAuditRecordMapper.countApplyNumberByDay(preDay);
|
| | | CountUserInfo record = new CountUserInfo();
|
| | | record.setNum(count);
|
| | | record.setId(StringUtil.Md5(preDay + CountUserEnum.extractApplyNumber.name()));
|
| | | record.setDay(TimeUtil.parse(preDay));
|
| | | record.setType(CountUserEnum.extractApplyNumber);
|
| | | countUserInfoDao.save(record);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.impl.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
| | | 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<ChartTDO> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return lostOrderMapper.countLostNum(dateType, resultCode, year, startTime, endTime);
|
| | | public Integer countLostOrderNum(String preDay) {
|
| | | return lostOrderMapper.countLostOrderNum(preDay);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<ChartTDO> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception {
|
| | | return lostOrderMapper.countAppealMoney(dateType, year, startTime, endTime);
|
| | | public BigDecimal countAppealMoney(String preDay) {
|
| | | return lostOrderMapper.countAppealMoney(preDay);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | | return record;
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public Integer countWeiQaunOrderNumberByDate(String preDay) {
|
| | | return userOrderWeiQuanRecordMapper.countWeiQaunOrderNumberByDate(preDay);
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public BigDecimal countWeiQaunOrderMoneyByDate(String preDay) {
|
| | | return userOrderWeiQuanRecordMapper.countWeiQaunOrderMoneyByDate(preDay);
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityRuleUser;
|
| | | import com.yeshi.fanli.entity.bus.activity.ActivityUser;
|
| | | import com.yeshi.fanli.exception.dynamic.ActivityUserException;
|
| | |
|
| | | /**
|
| | | * 动态服务
|
| | |
| | | * @return
|
| | | */
|
| | | public ActivityUser getRandomHaoHuo();
|
| | |
|
| | | /**
|
| | | * 根据名称查询发布用户
|
| | | * @param nickName
|
| | | * @return
|
| | | */
|
| | | public ActivityUser selectByName(String nickName);
|
| | |
|
| | | public ActivityUser getActivityUserByNickName(ActivityUser record, MultipartFile file) throws ActivityUserException;
|
| | | }
|
| | |
| | | * @return
|
| | | */
|
| | | public BigDecimal getRewardMoneyByToSearch(Long uid, Integer dateType, Integer hbType, Integer orderState, String orderNo,
|
| | | Integer moneyState, String startTime, String endTime, List<Integer> listSource); |
| | | Integer moneyState, String startTime, String endTime, List<Integer> listSource);
|
| | |
|
| | | |
| | | public Integer countOrderByTypeAndDate(Integer orderType, String preDay); |
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.count;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.admin.count.CountOrderInfo;
|
| | | import com.yeshi.fanli.entity.admin.count.CountUserInfo;
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | |
|
| | |
| | | public List<UserGoldCoinVO> listByHasGoldCoin(long start, int count, String key);
|
| | |
|
| | | public long countByHasGoldCoin(String key);
|
| | |
|
| | | public List<CountUserInfo> getNewUserData(Date startTime, Date endTime, String channel);
|
| | |
|
| | | public void initChannelUserCount();
|
| | |
|
| | | |
| | | /**
|
| | | * 新用户查询24内下单数量 -有效数量
|
| | | * @param channel
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> count24HOderByChannel(String channel, Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 新用户当日下单数量 -有效
|
| | | * @param channel
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountUserInfo> countUserDownOrderByChannelAndToday(String channel, Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 新用户7天内下单数量- 有效
|
| | | * @param channel
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountUserInfo> countUseByChannelAndWeekOrder(String channel, Date startTime, Date endTime);
|
| | | |
| | | /**
|
| | | * 新用户7天内下3单数量- 有效
|
| | | * @param channel
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountUserInfo> countUseByChannelAndWeekThreeOrder(String channel, Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 初始化用户7天订单统计
|
| | | */
|
| | | public void initCountUserWeekOrder();
|
| | |
|
| | | /**
|
| | | * 统计订单总数量 -分渠道 有效的
|
| | | * @param channel
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> countOderByChannel(String channel, Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 统计订单佣金
|
| | | * @param channel
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> countHongBaoByChannel(String channel, Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 统计订单数量-根据类型
|
| | | * @param channel
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> countOrderType(Integer state, Date startTime, Date endTime);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计维权订单数量
|
| | | * @param state
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> countWeiQuanOrder(Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 统计维权金额
|
| | | * @param state
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> countWeiQuanOrderMoney(Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 统计订单找回金额
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> counOrderLastMoney(Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 统计订单找回个数
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> counOrderLastNum(Date startTime, Date endTime);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计订单总佣金
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> counOrderTotalCommission(Date startTime, Date endTime);
|
| | |
|
| | | /**
|
| | | * 订单总单数
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderInfo> counOrderTotalNum(Date startTime, Date endTime);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.money.extract;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.admin.count.CountUserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | |
|
| | | public interface ExtractAuditRecordService {
|
| | |
| | | public List<ExtractAuditRecord> getbyExtractId(Long extractId);
|
| | |
|
| | |
|
| | | /**
|
| | | * 统计审核次数 |
| | | * @param state
|
| | | * @param type
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO>countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 统计申请提的现总金额
|
| | | * @param state
|
| | | * @param type
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | public List<CountUserInfo> getApplyMoney(Date startTime, Date endTime) throws Exception;
|
| | | |
| | | public void initApplyMoneyCount();
|
| | | |
| | | /**
|
| | | * 统计申请提的现总次数
|
| | | * @param state
|
| | | * @param type
|
| | | * @param years
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO> countExtractApplyNumber(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | | |
| | | List<CountUserInfo> geApplyNumber(Date startTime, Date endTime) throws Exception;
|
| | |
|
| | | public void initApplyNumberCount();
|
| | |
|
| | | public void initAuditCount();
|
| | |
|
| | | public List<CountUserInfo> getAuditCount(Date startTime, Date endTime, Integer state) throws Exception;
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | 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.dto.order.CountOrderDTO;
|
| | | import com.yeshi.fanli.entity.admin.count.CountOrderTrackRate;
|
| | |
|
| | | public interface CommonOrderCountService {
|
| | |
|
| | |
| | | */
|
| | | public Long countByState(Integer state);
|
| | |
|
| | | /**
|
| | | * 统计所有订单
|
| | | * |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime, String endTime,
|
| | | int sourceType) throws Exception;
|
| | |
|
| | | /**
|
| | | * 统计总金额
|
| | |
| | | */
|
| | | List<Long> getSameGoodsOrderByUidAndHongBaoType(List<Integer> typeList, Long uid, int minSameGoodsOrderCount);
|
| | |
|
| | | /**
|
| | | * 统计日期内产生有效订单数量(返利 + 分享)
|
| | | * @param preDay
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public Integer countOderByUidAndDate(Date preDay, Long uid);
|
| | | |
| | | /**
|
| | | * 统计日期内产生有效订单数量(返利 + 分享) 多个uid
|
| | | * @param preDay
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | //public Integer countOrderByUidsAndDate(Date preDay, List<Long> list);
|
| | | /**
|
| | | * 统计再此时间内 产生订单的用户数量
|
| | | * @param preDay
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | public Integer countDownOrderUserByUidAndDate(Date preDay, List<Long> list);
|
| | |
|
| | | /**
|
| | | * 统计订单佣金
|
| | | * @param preDay
|
| | | * @param list
|
| | | * @return
|
| | | */
|
| | | List<CountOrderDTO> countCommissionByDay(String preDay);
|
| | | |
| | | /**
|
| | | * 总订单数 每-天
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | public Integer countOderByDate(String preDay);
|
| | |
|
| | | /**
|
| | | * 统计订单佣金
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | public BigDecimal countCommissionByDate(String preDay);
|
| | |
|
| | | /**
|
| | | * 当日每个用户下单数量
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderDTO> countValidOrderByDay(String preDay);
|
| | |
|
| | | /**
|
| | | * 统计跟踪率
|
| | | * @param type
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<CountOrderTrackRate> getOrderTrackRate(int type, Date startTime, Date endTime);
|
| | |
|
| | | |
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | | 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 {
|
| | |
| | |
|
| | | public long countQuery(String key, Integer state, Integer handleType, Integer type);
|
| | |
|
| | | /**
|
| | | * 本月申诉订单数 统计
|
| | | * |
| | | * @param dateType
|
| | | * @param resultCode
|
| | | * (未处理: 成功 失败)
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<ChartTDO> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | public List<ChartTDO> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception;
|
| | |
|
| | |
|
| | | /**
|
| | | * 根据状态与处理结果过去值
|
| | |
| | | */
|
| | | public List<LostOrder> listByStateAndResultCode(int state, int resultCode, int page, int pageSize);
|
| | |
|
| | | |
| | | /**
|
| | | * 统计申诉订单数量
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | public Integer countLostOrderNum(String preDay);
|
| | | |
| | | /**
|
| | | * 统计申诉找回佣金
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | public BigDecimal countAppealMoney(String preDay);
|
| | |
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.order;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | import com.yeshi.fanli.entity.order.UserOrderWeiQuanRecord;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder;
|
| | |
|
| | |
| | |
|
| | | public UserOrderWeiQuanRecord selectByOrderInfoAndUid(Long uid, String tradeId, int sourceType);
|
| | |
|
| | | /**
|
| | | * 统计数量 订单分组 日期筛选
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | public Integer countWeiQaunOrderNumberByDate(String preDay);
|
| | |
|
| | | /**
|
| | | * 订单维权金额
|
| | | * @param preDay
|
| | | * @return
|
| | | */
|
| | | public BigDecimal countWeiQaunOrderMoneyByDate(String preDay);
|
| | |
|
| | | }
|
| | |
| | | specialCard("/editor/img/special_card/", "专题管理图片"),
|
| | | special("/editor/img/special/", "专题图片"),
|
| | | swiper("/editor/img/swiper_pic/", "轮播图片"),
|
| | | activityUser("/editor/img/activityUser/", "动态用户"),
|
| | | goodsEvaluate("/editor/img/evaluate/", "动态发圈"),
|
| | | banLiShopClass("/editor/img/shop/goods_class/", "板栗商城分类图片"),
|
| | | banLiShopGoods("/editor/img/shop/goods/", "板栗商城商品图片");
|
| | |
|
| | |
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Arrays;
|
| | | import java.util.Collections;
|
| | | import java.util.Comparator;
|
| | | import java.util.Date;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | |
| | | return goodsInfo;
|
| | | }
|
| | |
|
| | | |
| | | }
|