Merge remote-tracking branch 'origin/div' into div
Conflicts:
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/GoodsControllerV2.java
| | |
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="lib" path="libs/opush-server-sdk-1.0.3.jar"/>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_131"/>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_181"/>
|
| | | <classpathentry kind="output" path="target/classes"/>
|
| | | </classpath>
|
| | |
| | | result = jedis.setnx(cacheKey, "1");
|
| | | if (result <= 0) {
|
| | | try {
|
| | | System.out.println("__________已有线程在执行");
|
| | | Thread.sleep(50);
|
| | | } catch (InterruptedException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | if (System.currentTimeMillis() - startTime > 1000 * 60L) {
|
| | | Constant.waitingThreadSet.remove(Thread.currentThread().getId());
|
| | | System.out.println("__________删除线程");
|
| | | return null;
|
| | | }
|
| | | } else {
|
| | |
| | |
|
| | | if (result > 0) {
|
| | | try {
|
| | | System.out.println("__________放行执行");
|
| | | return joinPoint.proceed();
|
| | | } catch (Throwable e) {
|
| | | e.printStackTrace();
|
| | |
| | | } catch (SecurityException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | return joinPoint.proceed();
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | |
| | | innerList.put("name", "驳回数");
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countAuditTotal(state, dateType, year,
|
| | | List<ChartTDO> list = extractAuditRecordService.countAuditTotal(state, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | @RequestMapping(value = "getExtractApplyMoney")
|
| | | public void getExtractApplyMoney(String callback, Integer dateType, String year, String startTime, String endTime,
|
| | | PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | Gson gson = new Gson();
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countExtractApplyMoney(null, dateType, year,
|
| | | List<ChartTDO> list = extractAuditRecordService.countExtractApplyMoney(null, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | |
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | @RequestMapping(value = "getExtractApplyNumber")
|
| | | public void getExtractApplyNumber(String callback, Integer state, Integer dateType, String year, String startTime,
|
| | | String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | |
|
| | | Object objectDate = null;
|
| | | Gson gson = new Gson();
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | Gson gson = new Gson();
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | List<Map<String, Object>> list = extractAuditRecordService.countExtractApplyNumber(null, dateType, year,
|
| | | List<ChartTDO> list = extractAuditRecordService.countExtractApplyNumber(null, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if (dateType != 3) {
|
| | |
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | line_list.add(innerList);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | |
| | | @RequestMapping(value = "getLostNum")
|
| | | public void getLostNum(String callback, Integer dateType, String stateArray, String year,
|
| | | String startTime, String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | |
| | | endTime = null;
|
| | | }
|
| | |
|
| | | |
| | | List<Integer> channelList = null;
|
| | | if (stateArray != null && stateArray.trim().length() > 0) {
|
| | | Gson gson = new Gson();
|
| | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | | try {
|
| | |
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | if (channelList == null || channelList.size() == 0) {
|
| | |
|
| | | } else {
|
| | | for (Integer state : channelList) {
|
| | | |
| | | List<Map<String, Object>> list = lostOrderService.countLostNum(dateType, state, year, |
| | | List<ChartTDO> list = lostOrderService.countLostNum(dateType, state, year, |
| | | startTime, endTime);
|
| | | |
| | | |
| | | JSONObject innerList = new JSONObject();
|
| | | if (state == 1) {
|
| | | innerList.put("name", "未处理");
|
| | |
| | | } else {
|
| | | // 年视图
|
| | | Map<String, Object> map = AdminUtils.yearsDataFactory(list);
|
| | |
|
| | | if (objectDate == null) {
|
| | | objectDate = map.get("date");
|
| | | }
|
| | |
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | |
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | | |
| | | try {
|
| | |
|
| | | |
| | | JSONArray line_list = new JSONArray();
|
| | | |
| | | List<Map<String, Object>> list = lostOrderService.countAppealMoney(dateType, year, startTime, endTime);
|
| | | |
| | | |
| | | List<ChartTDO> list = lostOrderService.countAppealMoney(dateType, year, startTime, endTime);
|
| | | JSONObject innerList = new JSONObject();
|
| | | innerList.put("name", "总计");
|
| | | innerList.put("name", "总计");
|
| | |
|
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | | |
| | | line_list.add(innerList);
|
| | |
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | if (objectDate != null) {
|
| | |
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | | |
| | | data.put("line_list", line_list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDebt.UserMoneyDebtTypeEnum;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail;
|
| | | import com.yeshi.fanli.entity.money.UserMoneyDetail.UserMoneyDetailTypeEnum;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | |
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | for (String channel : channelList) {
|
| | | List<Map<String, Object>> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year,
|
| | | List<ChartTDO> list = hongBaoV2CountService.count24HOderByChannel(channel, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | |
| | | */
|
| | | public JSONObject countHistoryHongBao(String channelArray, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime, int countType) throws Exception {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | |
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | | List<Map<String, Object>> list = null;
|
| | | List<ChartTDO> list = null;
|
| | | if (countType == 1) {
|
| | | list = hongBaoV2CountService.countHongBaoNum(channel, dateType, state, year, startTime, endTime);
|
| | | } else if (countType == 2) {
|
| | |
| | | }
|
| | | innerList.put("data", gson.toJson(map.get("value")));
|
| | | }
|
| | |
|
| | | line_list.add(innerList);
|
| | | }
|
| | |
|
| | |
| | | } else {
|
| | | data.put("xAxis_list", gson.toJson(dateList));
|
| | | }
|
| | |
|
| | | data.put("line_list", line_list);
|
| | |
|
| | | return data;
|
| | | }
|
| | |
|
| | |
| | | @RequestMapping(value = "getTypeNumber")
|
| | | public void getTypeNumber(String callback, Integer dateType, String typeArray, String year, String startTime,
|
| | | String endTime, PrintWriter out) {
|
| | |
|
| | | String validateMsg = AdminUtils.validateParams(dateType, startTime, endTime);
|
| | | if (validateMsg != null) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(validateMsg));
|
| | |
| | | Gson gson = new Gson();
|
| | | Object objectDate = null;
|
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | try {
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | for (Integer type : channelList) {
|
| | |
|
| | | List<Map<String, Object>> list = hongBaoV2CountService.countHongBaoType(dateType, type, year, startTime,
|
| | | List<ChartTDO> list = hongBaoV2CountService.countHongBaoType(dateType, type, year, startTime,
|
| | | endTime);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | if (type == 1) {
|
| | | innerList.put("name", "返利订单");
|
| | |
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | |
|
| | | List<Map<String, Object>> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime,
|
| | | List<ChartTDO> list = commonOrderCountService.getTrackAccuracyRate(dateType, year, startTime,
|
| | | endTime, sourceType);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONArray line_list = new JSONArray();
|
| | | List<Map<String, Object>> list = null;
|
| | | List<ChartTDO> list = null;
|
| | | if (countType == 1) {
|
| | | list = commonOrderCountService.countWeiQaunOrderNumber(dateType, year, startTime, endTime);
|
| | | } else if (countType == 2) {
|
| | |
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
|
| | | import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
|
| | |
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | |
|
| | | List<Map<String, Object>> list = userInfoCountService.countNewUserByDate(channel, dateType, year,
|
| | | List<ChartTDO> list = userInfoCountService.countNewUserByDate(channel, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | |
| | | JSONArray line_list = new JSONArray();
|
| | | for (String channel : channelList) {
|
| | |
|
| | | List<Map<String, Object>> list = userInfoCountService.getTodayBuyRate(channel, dateType, year,
|
| | | List<ChartTDO> list = userInfoCountService.getTodayBuyRate(channel, dateType, year,
|
| | | startTime, endTime);
|
| | |
|
| | | if ("all".equalsIgnoreCase(channel)) {
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.controller.admin.utils.AdminUtils;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponGiveRecord;
|
| | | import com.yeshi.fanli.service.inter.count.UserSystemCouponCountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponGiveRecordService;
|
| | |
| | | public void getFreeCouponMoneyCharts(String callback, Integer dateType, String year, String startTime,
|
| | | String endTime, Integer coupon, PrintWriter out){
|
| | | try {
|
| | | |
| | | if (coupon == null || (coupon.intValue() < 0 && coupon.intValue() > 4)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("券类型不正确"));
|
| | | return;
|
| | |
| | | couponType = "freeCouponBuy";
|
| | | }
|
| | |
|
| | | |
| | | JSONObject data = getChartsData(dateType, year, startTime, endTime, 3, couponType);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | |
| | |
|
| | | public JSONObject getChartsData(Integer dateType, String year, String startTime,
|
| | | String endTime, int source, String couponType) throws Exception {
|
| | |
|
| | | if (dateType != 1 && (!StringUtil.isNullOrEmpty(startTime) || !StringUtil.isNullOrEmpty(endTime))) {
|
| | | startTime = null;
|
| | | endTime = null;
|
| | |
| | | List<String> dateList = AdminUtils.getDateList(dateType, startTime, endTime, year);
|
| | |
|
| | | JSONObject innerList = new JSONObject();
|
| | | List<Map<String, Object>> list = null;
|
| | | List<ChartTDO> list = null;
|
| | | if (source == 1) {
|
| | | // 奖励券数量
|
| | | innerList.put("name", "数量");
|
| | |
| | | startTime, endTime, couponType);
|
| | | }
|
| | |
|
| | | |
| | | Object objectDate = null;
|
| | | |
| | | if (dateType != 3) {
|
| | | innerList.put("data", gson.toJson(AdminUtils.dayOrMonthDataFactory(dateType, dateList, list)));
|
| | | } else {
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
|
| | | public class AdminUtils {
|
| | |
| | | }
|
| | |
|
| | |
|
| | | public static Map<String, Object> yearsDataFactory(List<Map<String, Object>> list) {
|
| | | public static Map<String, Object> yearsDataFactory(List<ChartTDO> list) {
|
| | |
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | | List<Object> listDate = new ArrayList<Object>();
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object showValue = map.get("showValue");
|
| | | Object showDate = map.get("showDate");
|
| | | |
| | | for (ChartTDO chart: list) {
|
| | | String showDate = chart.getShowDate();
|
| | | String showValue = chart.getShowValue();
|
| | | if (showValue == null) {
|
| | | showValue = 0;
|
| | | showValue = "0";
|
| | | }
|
| | | |
| | | resultList.add(showValue);
|
| | | listDate.add(showDate);
|
| | | }
|
| | |
| | |
|
| | |
|
| | | public static List<Object> dayOrMonthDataFactory(Integer dateType, List<String> listDate ,
|
| | | List<Map<String, Object>> list) throws Exception {
|
| | |
|
| | | List<ChartTDO> list) throws Exception {
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | | |
| | | if (list != null && list.size() > 0) {
|
| | | for (int i = 0; i < listDate.size(); i++) {
|
| | | |
| | | Object showValue = null;
|
| | | if (list != null && list.size() > 0) {
|
| | | // 日期匹配赋值
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | |
| | | String showDate = listDate.get(i);
|
| | | if (dateType == 2 && Integer.parseInt(showDate) < 10 ) {
|
| | | showDate = "0" + showDate;
|
| | | }
|
| | | |
| | | Object reslutDate = map.get("showDate");
|
| | | String reslutTime = reslutDate.toString();
|
| | | |
| | | if (showDate.equalsIgnoreCase(reslutTime)) {
|
| | | showValue = map.get("showValue");
|
| | | break;
|
| | | }
|
| | | |
| | | String showValue = null;
|
| | | // 日期匹配赋值
|
| | | for (ChartTDO chart: list) {
|
| | | String showDate = listDate.get(i);
|
| | | if (dateType == 2 && Integer.parseInt(showDate) < 10 ) {
|
| | | showDate = "0" + showDate;
|
| | | }
|
| | | String reslutTime = chart.getShowDate();
|
| | | if (showDate.equalsIgnoreCase(reslutTime)) {
|
| | | showValue = chart.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | if (showValue == null) {
|
| | | showValue = 0;
|
| | | showValue = "0";
|
| | | }
|
| | | resultList.add(showValue);
|
| | | }
|
| | | }
|
| | | |
| | | return resultList;
|
| | | }
|
| | |
|
| | |
| | | * @throws Exception
|
| | | */
|
| | | public static JSONObject chartDataFactory(Integer dateType, String year, String startTime, String endTime,
|
| | | List<Map<String, Object>> list) throws Exception{
|
| | | List<ChartTDO> list) throws Exception{
|
| | |
|
| | | Object objectDate = null;
|
| | | List<String> dateList = getDateList(dateType, startTime, endTime, year);
|
| | |
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.SMSService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | |
| | | return;
|
| | | }
|
| | | phone = phone.replaceAll(" ", "");
|
| | | |
| | | if (Constant.IS_TEST) {
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | | return;
|
| | | }
|
| | |
|
| | | sendMSNnew(phone, slideVerify, 1, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (Constant.IS_TEST) {
|
| | | out.print(JsonUtil.loadTrueResult("发送成功"));
|
| | | return;
|
| | | }
|
| | | |
| | | sendMSNnew(phone, slideVerify, 2, StringUtil.Md5(phone + "-" + acceptData.getDevice()), out);
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.AppVersionInfo;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.AccountMessage;
|
| | | import com.yeshi.fanli.entity.bus.user.BindRemind;
|
| | | import com.yeshi.fanli.entity.bus.user.BindingAccount;
|
| | | import com.yeshi.fanli.entity.bus.user.Extract;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractRecord;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserActiveLog;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoModifyRecord.ModifyTypeEnum;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.common.Config;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | |
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinDetailService;
|
| | | import com.yeshi.fanli.service.inter.user.AccountMessageService;
|
| | | import com.yeshi.fanli.service.inter.user.BindRemindService;
|
| | | import com.yeshi.fanli.service.inter.user.MaskKeyService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | |
| | |
|
| | | @Resource
|
| | | private UserInfoModifyRecordService userInfoModifyRecordService;
|
| | | |
| | | @Resource
|
| | | private BindRemindService bindRemindService;
|
| | |
|
| | | private static final String PASSWORD_MAX_ERROR = "password_max_error";
|
| | | private static final String EXTRACT_MIN_MONEY = "extract_min_money";
|
| | |
| | | // 1.6.5 之后返回 微信号提示
|
| | | if (VersionUtil.greaterThan_1_6_5(acceptData.getPlatform(), acceptData.getVersion()))
|
| | | userInfo.setWeiXinTip("添加微信号后,你的邀请人和一级队员可以通过微信与你建立联系。");
|
| | |
|
| | | |
| | | data.put("user", JsonUtil.getConvertBigDecimalToStringBuilder(gsonBuilder).create().toJson(userInfo));
|
| | | data.put("invitCode", invitCode); // 邀请码
|
| | | data.put("welfareCenterNews", welfareCenterNews);// 福利中心消息
|
| | | |
| | | // 2.0.1之后绑定手机号
|
| | | if (VersionUtil.greaterThan_2_0_1(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | boolean bindPhone = false;
|
| | | if (StringUtil.isNullOrEmpty(userInfo.getPhone())) |
| | | bindPhone = bindRemindService.bindRemind(uid, BindRemind.TYPE_PHONE);
|
| | | data.put("bindPhone", bindPhone);
|
| | | }
|
| | | |
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | |
| | | final UserInfo uuser = userInfo;
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | |
| | | case 4:
|
| | | break;
|
| | | case 5:
|
| | | list.add(new GoodsClass(0L, "全部"));
|
| | | list.add(new GoodsClass(1L, "淘宝"));
|
| | | list.add(new GoodsClass(2L, "京东"));
|
| | | list.add(new GoodsClass(3L, "拼多多"));
|
| | | break;
|
| | | default:
|
| | | break;
|
| | |
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.jd.JDCategoryInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsDetail;
|
| | | import com.yeshi.fanli.dto.pdd.PDDGoodsResult;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserMoneyExtra;
|
| | | import com.yeshi.fanli.entity.goods.CollectionGoodsV2;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.entity.taobao.ClientTBPid;
|
| | |
| | | import com.yeshi.fanli.service.inter.goods.CollectionGoodsV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.ScanHistoryV2Service;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | | import com.yeshi.fanli.service.inter.jd.JDGoodsClassService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyExtraService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TLJBuyGoodsService;
|
| | |
| | |
|
| | | @Resource
|
| | | private JumpDetailV2Service jumpDetailV2Service;
|
| | | |
| | | @Resource
|
| | | private JDGoodsClassService jdGoodsClassService;
|
| | | |
| | |
|
| | | /**
|
| | | * 淘宝商品详情
|
| | |
| | |
|
| | | // 附加信息
|
| | | OtherInfo otherInfo = new OtherInfo();
|
| | | |
| | | // 京东plus返利
|
| | | String maxMoneyPlus = null;
|
| | | JDCategoryInfo categoryInfo = jdGoods.getCategoryInfo();
|
| | | if (categoryInfo != null && categoryInfo.getCid3() != null && jdGoods.getCommissionInfo() != null) {
|
| | | Long cid3 = categoryInfo.getCid3();
|
| | | JDGoodsClass threeClass = jdGoodsClassService.getThreeClassByCid(Integer.parseInt(cid3.toString()));
|
| | | if (threeClass != null && threeClass.getSelfComm() != null && threeClass.getSelfComm().compareTo(new BigDecimal(0)) > 0) {
|
| | | BigDecimal commissionShare = jdGoods.getCommissionInfo().getCommissionShare();
|
| | | // plus比例 小于正常比例
|
| | | if (commissionShare != null && commissionShare.compareTo(threeClass.getSelfComm()) > 0) {
|
| | | jdGoods.setCommissionPlus(threeClass.getSelfComm());
|
| | | // plus返利
|
| | | BigDecimal fanliMoneyPlus = JDUtil.getGoodsFanLiMoneyPlus(jdGoods, fanLiRate);
|
| | | otherInfo.setFanliMoneyPlus("京东plus会员返¥" + fanliMoneyPlus);
|
| | | // 使用奖励券最高返
|
| | | maxMoneyPlus = "(京东plus会员最高返¥"+ fanliMoneyPlus.add(MoneyBigDecimalUtil.mul(fanliMoneyPlus, Constant.MAX_REWARD_RATE))+")";
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | // 奖励券返利
|
| | | RewardCouponVO rewardCoupon = new RewardCouponVO();
|
| | | rewardCoupon.setMaxMoneyPlus(maxMoneyPlus);
|
| | | rewardCoupon.setJumpDetail(jumpDetailV2Service.getByTypeCache("web"));
|
| | | JSONObject params1=new JSONObject();
|
| | | params1.put("url", configService.get("special_guide_reward_coupon_link"));
|
| | |
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsg;
|
| | | import com.yeshi.fanli.entity.bus.msg.UserSystemMsgTypeEnum;
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.exception.user.UserAccountException;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.msg.UserSystemMsgService;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | @RequestMapping("api/v2/invite")
|
| | | public class InviteControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | | |
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 邀请码微信
|
| | | * 邀请码微信验证
|
| | | *
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "verifyWX")
|
| | | public void verifyWX(AcceptData acceptData, Long uid, String code, PrintWriter out) {
|
| | | try {
|
| | | UserInfo userInfo = userInfoExtraService.getInviterInfo(
|
| | | Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion()), uid, code);
|
| | | WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
|
| | | // 获取微信信息
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, wxAccount.getAppId(), wxAccount.getAppSecret());
|
| | | if (weiXinUser == null)
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | |
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0)
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | |
| | | String activeWX = StringUtil.Md5("activeWX:" + weiXinUser.getUnionid());
|
| | | redisManager.cacheCommonString(activeWX, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
|
| | | |
| | | // 邀请关系用户信息
|
| | | UserInfo userInfo = userInfoExtraService.getInviterInfo(uid, wxUnionId);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("nickName", userInfo.getNickName());
|
| | | data.put("portrait", userInfo.getPortrait());
|
| | | data.put("tips", "确认要成为TA的一级队员吗?邀请关系一旦建立不可更改。");
|
| | | data.put("key", activeWX);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 微信激活
|
| | | * @param acceptData
|
| | | * @param uid
|
| | | * @param key 验证返回的key
|
| | | * @param out
|
| | | */
|
| | | @RequestSerializableByKey(key = "'activeInviteWX-'+#uid")
|
| | | @RequestMapping(value = "activeInviteWX")
|
| | | public void activeInviteWX(AcceptData acceptData, Long uid, String key, PrintWriter out) {
|
| | | try {
|
| | | String value = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(value))
|
| | | throw new UserAccountException(1, "微信授权失效");
|
| | | |
| | | WeiXinUser weiXinUser = JsonUtil.getSimpleGson().fromJson(value, WeiXinUser.class);
|
| | | if (weiXinUser == null)
|
| | | throw new UserAccountException(1, "微信授权失效");
|
| | | |
| | | userInfoExtraService.activeInviteWX(uid, weiXinUser);
|
| | | // 删除缓存
|
| | | redisManager.removeCommonString(key);
|
| | | |
| | | out.print(JsonUtil.loadTrueResult("邀请码激活成功"));
|
| | | } catch (UserInfoExtraException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("邀请码激活失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 用户队员列表查询 1.5.3查询有效队员
|
| | | *
|
| | | * @param acceptData
|
| | |
| | | } else {
|
| | | long rebateOrder = hongBaoV2CountService.countRebateOrder(uid);
|
| | | long shareOrInviteOrder = hongBaoV2CountService.countShareOrInviteOrder(uid);
|
| | | if (rebateOrder <= 0 && shareOrInviteOrder <= 0) {
|
| | | if (rebateOrder + shareOrInviteOrder >= 3) {
|
| | | // 熟客版
|
| | | } else if (rebateOrder <= 0 && shareOrInviteOrder <= 0) {
|
| | | // 新人版
|
| | | tips = configService.get("tip_guide_new_user");
|
| | | } else if (rebateOrder > 0 && shareOrInviteOrder <= 0) {
|
| | | // 省钱版
|
| | | tips = configService.get("tip_guide_save_money");
|
| | | } else if (shareOrInviteOrder > 0) {
|
| | | } else {
|
| | | // 赚钱版
|
| | | tips = configService.get("tip_guide_share_invite");
|
| | | } else {
|
| | | // 熟客版
|
| | | }
|
| | | } |
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(tips)) {
|
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.NumberUtil;
|
| | | import org.yeshi.utils.taobao.TbImgUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.dto.douyin.DouYinGoods;
|
| | | import com.yeshi.fanli.dto.jd.JDFilter;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchFilter;
|
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.integral.IntegralGetService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.DouYinUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.Utils;
|
| | |
| | | type = 4;
|
| | | tb = TaoBaoUtil.getTmallGoodsInfo(id);
|
| | | }
|
| | | } else if (text.contains("v.douyin.com")) { // 抖音
|
| | | analysisDouYin(acceptData, text, out);
|
| | | return;
|
| | | } else {
|
| | | tb = TaoBaoUtil.parsePhoneShareUrlByTB(text);
|
| | | |
| | | if (tb == null) {
|
| | | String goodsId = TaoBaoUtil.getGoodsIdByPhoneShareUrl(text);
|
| | | if (!StringUtil.isNullOrEmpty(goodsId)) {
|
| | | tb = TaoBaoUtil.getTmallGoodsInfo(goodsId);
|
| | | if (tb != null) |
| | | type = 4;
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | if (tb == null)// 淘宝是空值
|
| | | {
|
| | | String jdId = JDUtil.getJDGoodsId(text);
|
| | |
| | | root.put("data", data);
|
| | | out.print(JsonUtil.loadTrueResult(root));
|
| | | }
|
| | | |
| | | /**
|
| | | * 解析抖音链接
|
| | | * @param acceptData
|
| | | * @param text
|
| | | * @param out
|
| | | * @return
|
| | | */
|
| | | private void analysisDouYin(AcceptData acceptData, String text, PrintWriter out) {
|
| | | String location = HttpUtil.getLocation(text);
|
| | | if (!StringUtil.isNullOrEmpty(location)) {
|
| | | if (location.contains("taobao.com")) { // 淘宝商品
|
| | | String realUrl = TaoBaoUtil.getRealUrl(location);
|
| | | if (!StringUtil.isNullOrEmpty(realUrl)) {
|
| | | getRecommendInfo(acceptData, realUrl, null, out);
|
| | | return;
|
| | | }
|
| | | } else if (location.contains("haohuo.jinritemai.com")) { // 抖音商品
|
| | | DouYinGoods goods = DouYinUtil.getGoodsInfo(location);
|
| | | JSONObject goodsJSON = new JSONObject();
|
| | | goodsJSON.put("title", goods.getName());
|
| | | goodsJSON.put("pictUrl", goods.getImg());
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("type", 4);
|
| | | data.put("desc", "该商品无推广信息");
|
| | | data.put("goods", goodsJSON);
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | return;
|
| | | }
|
| | | }
|
| | | out.println(JsonUtil.loadFalseResult("暂未找到该商品,请稍后再试!"));
|
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 解析淘口令
|
| | | * @param acceptData
|
| | | * @param text
|
| | | * @param out
|
| | | * @return
|
| | | */
|
| | | private boolean analysisTaoToken(AcceptData acceptData, String text, PrintWriter out) {
|
| | | String token = StringUtil.picUpTaoToken(text);
|
| | | if (!StringUtil.isNullOrEmpty(token)) {
|
New file |
| | |
| | | package com.yeshi.fanli.controller.client.v2;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.user.SMSHistory;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.system.BusinessSystem;
|
| | | import com.yeshi.fanli.exception.user.UserAccountException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarUserService;
|
| | | import com.yeshi.fanli.service.inter.money.UserMoneyService;
|
| | | import com.yeshi.fanli.service.inter.order.LostOrderService;
|
| | | import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenOPPOService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.tlj.UserTaoLiJinOriginService;
|
| | | import com.yeshi.fanli.service.inter.user.BindRemindService;
|
| | | import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
|
| | | import com.yeshi.fanli.service.inter.user.ShamUserService;
|
| | | import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountBindingHistoryService;
|
| | | import com.yeshi.fanli.service.inter.user.UserAccountService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoDeleteRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoModifyRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserShareGoodsRecordService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | | import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.VersionUtil;
|
| | | import com.yeshi.fanli.util.account.UserUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestSerializableByKey;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | /**
|
| | | * 账户系统
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Controller
|
| | | @RequestMapping("api/v2/user")
|
| | | public class UserAccountControllerV2 {
|
| | |
|
| | | @Resource
|
| | | private UserInfoService userInfoService;
|
| | |
|
| | | @Resource
|
| | | private BusinessSystemService businessSystemService;
|
| | |
|
| | | @Resource
|
| | | private ShamUserService shamUserService;
|
| | |
|
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private LostOrderService lostOrderService;
|
| | |
|
| | | @Resource
|
| | | private HongBaoManageService hongBaoManageService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountService userAccountService;
|
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private TBPidService tbPidService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenHWService deviceTokenHWService;
|
| | |
|
| | | @Resource
|
| | | private DeviceTokenOPPOService deviceTokenOPPOService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoUnionConfigService taoBaoUnionConfigService;
|
| | |
|
| | | @Resource
|
| | | private SpreadUserImgService spreadUserImgService;
|
| | |
|
| | | @Resource
|
| | | private UserShareGoodsRecordService userShareGoodsRecordService;
|
| | |
|
| | | @Resource
|
| | | private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
|
| | |
|
| | | @Resource
|
| | | private UserSystemCouponService userSystemCouponService;
|
| | |
|
| | | @Resource
|
| | | private UserMoneyService userMoneyService;
|
| | |
|
| | | @Resource
|
| | | private UserAccountBindingHistoryService userAccountBindingHistoryService;
|
| | |
|
| | | @Resource
|
| | | private HomeNavbarUserService homeNavbarUserService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoDeleteRecordService userInfoDeleteRecordService;
|
| | |
|
| | | @Resource
|
| | | private UserTaoLiJinOriginService userTaoLiJinOriginService;
|
| | |
|
| | | @Resource
|
| | | private UserInfoModifyRecordService userInfoModifyRecordService;
|
| | |
|
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | | |
| | | @Resource
|
| | | private BindRemindService bindRemindService;
|
| | |
|
| | |
|
| | |
|
| | | /**
|
| | | * 新版登录 V1.5.3
|
| | | * |
| | | * @param acceptData
|
| | | * @param vcode
|
| | | * @param phone
|
| | | * @param code
|
| | | * @param loginType
|
| | | * 登录方式: 1-手机登录 2-微信登录
|
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "login", method = RequestMethod.POST)
|
| | | public void login(AcceptData acceptData, int loginType, String vcode, String phone, String code, |
| | | HttpServletRequest request, PrintWriter out) {
|
| | | try {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo userInfo = null;
|
| | | // 手机登录
|
| | | if (loginType == 1) {
|
| | | userInfo = userAccountService.loginPhone(request, loginType, vcode, phone, system.getAppid());
|
| | | }
|
| | |
|
| | | // 微信登录
|
| | | if (loginType == 2) {
|
| | | userInfo = userAccountService.loginWeiXinNew(request, acceptData, loginType, code, system.getAppid());
|
| | | }
|
| | |
|
| | | if (userInfo == null) {
|
| | | out.print(JsonUtil.loadFalseResult("登录失败"));
|
| | | } else {
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("userInfo", UserUtil.filterForClientUser(userInfo));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | |
|
| | | final UserInfo uuser = userInfo;
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | String device = acceptData.getDevice();
|
| | | try {
|
| | | // 同步自定义导航
|
| | | homeNavbarUserService.synchroDeviceToUser(uuser.getId(), device);
|
| | | } catch (Exception e) {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | }
|
| | |
|
| | | if (VersionUtil.greaterThan_1_5_60(acceptData.getPlatform(), acceptData.getVersion())) {
|
| | | /* 新人红包 */
|
| | | try {
|
| | | userTaoLiJinOriginService.synchDeviceHongbao(uuser.getId(), device);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | // 绑定oppo推送
|
| | | DeviceActive active = deviceActiveService.getFirstActiveInfo(acceptData.getDevice());
|
| | | if (active != null) {
|
| | | deviceTokenOPPOService.bindUid(uuser.getId(), active.getId());
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | } catch (UserAccountException e) {
|
| | | int errorCode = e.getCode();
|
| | | if (errorCode == 101) { // 需要绑定手机号
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("key", e.getMsg());
|
| | | JSONObject object = new JSONObject();
|
| | | object.put("code", errorCode);
|
| | | object.put("data", data);
|
| | | out.print(object.toString());
|
| | | } else {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | try {
|
| | | LogHelper.cookieLog("登录出错:" + e.getCode() + "-" + e.getMessage());
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("登录失败"));
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 绑定电话号码 V2.0.1 微信登录
|
| | | * |
| | | * @param acceptData
|
| | | * @param vcode
|
| | | * @param phone
|
| | | * @param out
|
| | | */
|
| | | @RequestSerializableByKey(key = "'bindPhoneLogin-'+#phone")
|
| | | @RequestMapping(value = "bindPhoneLogin")
|
| | | public void bindPhoneLogin(AcceptData acceptData,String vcode, String phone, String key, HttpServletRequest request, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(vcode)) {
|
| | | out.print(JsonUtil.loadFalseResult("验证码不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(phone)) {
|
| | | out.print(JsonUtil.loadFalseResult("电话号码不能为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(key)) {
|
| | | out.print(JsonUtil.loadFalseResult("key值不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | phone = phone.replaceAll(" ", "");
|
| | |
|
| | | String oldVCode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_BIND);
|
| | | if (Constant.IS_OUTNET) {
|
| | | if (!vcode.equalsIgnoreCase(oldVCode)) {
|
| | | out.print(JsonUtil.loadFalseResult(9001, "验证码错误,重新输入"));
|
| | | return;
|
| | | }
|
| | | redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_BIND);
|
| | | }
|
| | |
|
| | | try {
|
| | | UserInfo userInfo = userAccountService.bindPhoneToLogin(phone, key, system.getAppid(), request);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("userInfo", UserUtil.filterForClientUser(userInfo));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | } catch (UserAccountException e) {
|
| | | out.print(JsonUtil.loadFalseResult(e.getCode(), e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "绑定失败"));
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 绑定电话号码 V2.0.1 微信登录
|
| | | * |
| | | * @param acceptData
|
| | | * @param vcode
|
| | | * @param phone
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "recordBind")
|
| | | public void recordBind(AcceptData acceptData, Long uid, PrintWriter out) {
|
| | | if (uid == null || uid <= 0) {
|
| | | out.print(JsonUtil.loadFalseResult("用户id为空"));
|
| | | return;
|
| | | }
|
| | |
|
| | | bindRemindService.addBindPhone(uid);
|
| | | out.print(JsonUtil.loadTrueResult("记录成功"));
|
| | | }
|
| | | |
| | | }
|
| | |
| | | package com.yeshi.fanli.dao.mybatis;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | |
|
| | | public interface ExtractAuditRecordMapper {
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countAuditTotal(@Param("state")Integer state, @Param("type")Integer type,
|
| | | List<ChartTDO> countAuditTotal(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countExtractMoney(@Param("state")Integer state, @Param("type")Integer type,
|
| | | List<ChartTDO> countExtractMoney(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countExtractApplyNumber(@Param("state")Integer state, @Param("type")Integer type,
|
| | | List<ChartTDO> countExtractApplyNumber(@Param("state")Integer state, @Param("type")Integer type,
|
| | | @Param("years")String years, @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | |
|
| | | }
|
| | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO; |
| | | |
| | | public interface HongBaoV2CountMapper { |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoMoney(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | List<ChartTDO> countHongBaoMoney(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoNum(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | List<ChartTDO> countHongBaoNum(@Param("channel") String channel, @Param("dateType") Integer dateType, |
| | | @Param("state") Integer state, @Param("year") String year, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoType(@Param("dateType") Integer dateType, @Param("type") Integer type, |
| | | List<ChartTDO> countHongBaoType(@Param("dateType") Integer dateType, @Param("type") Integer type, |
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countHongBaoTotalNum(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countHongBaoTotalNum(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | // 累计提成订单数量(包含无效订单) |
| | |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> count24HOderByChannel(@Param("channel") String channel, @Param("type") Integer type, |
| | | List<ChartTDO> count24HOderByChannel(@Param("channel") String channel, @Param("type") Integer type, |
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | List<HongBaoV2VO> listShareAndInviteMoney(@Param("start") long start, @Param("count") int count, |
| | |
| | | package com.yeshi.fanli.dao.mybatis; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo; |
| | | import com.yeshi.fanli.vo.user.UserInfoVO; |
| | | |
| | | public interface UserInfoMapper { |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(UserInfo record); |
| | | |
| | | int insertSelective(UserInfo record); |
| | | |
| | | UserInfo selectByPrimaryKey(Long id); |
| | | |
| | | /** |
| | | * 查询有效的 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | UserInfo selectAvailableByPrimaryKey(Long id); |
| | | |
| | | UserInfo selectByPrimaryKeyForUpdate(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(UserInfo record); |
| | | |
| | | int updateByPrimaryKey(UserInfo record); |
| | | |
| | | // 减掉用户红包金额 |
| | | int subHongBaoByUid(@Param("uid") long uid, @Param("money") BigDecimal money); |
| | | |
| | | // 增加用户红包金额 |
| | | int addHongBaoByUid(@Param("uid") long uid, @Param("money") BigDecimal money); |
| | | |
| | | void cleanPassword(long id); |
| | | |
| | | BigDecimal getNewPeopleHB(Long id); |
| | | |
| | | BigDecimal getMyHB(Long id); |
| | | |
| | | // 根据AppId与微信unionID获取用户 |
| | | List<UserInfo> listByAppIdAndWXUnionId(@Param("appId") String appId, @Param("unionId") String unionId); |
| | | |
| | | // 根据AppId与淘宝OpenId获取用户 |
| | | List<UserInfo> listByAppIdAndTaoBaoOpenId(@Param("appId") String appId, @Param("openId") String openId); |
| | | |
| | | // 根据AppId与电话号码获取用户 |
| | | List<UserInfo> listByAppIdAndPhone(@Param("appId") String appId, @Param("phone") String phone); |
| | | |
| | | // 根据获取电话号码有效用户 |
| | | UserInfo getEffectiveUserInfoByPhone(@Param("phone") String phone); |
| | | |
| | | // 根据获WXUnionId有效用户 |
| | | UserInfo getEffectiveUserInfoByWXUnionId(@Param("unionId") String unionId); |
| | | |
| | | Long getMaxUid(); |
| | | |
| | | /** |
| | | * 融合账号 |
| | | * |
| | | * @param mainUid-主账号 |
| | | * @param lessUid-副账号 |
| | | */ |
| | | void connectUser(@Param("mainUid") Long mainUid, @Param("lessUid") Long lessUid); |
| | | |
| | | /** |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * 查询条件 |
| | | * @param userType |
| | | * 用户类型 |
| | | * @param days |
| | | * 天数 |
| | | * @param startTime |
| | | * 注册时间 -小 |
| | | * @param endTime |
| | | * 注册时间 -大 |
| | | * @param orderMode |
| | | * 排序方式 |
| | | * @return |
| | | */ |
| | | List<UserInfoVO> query(@Param("start") long start, @Param("count") int count, @Param("userState") Integer userState, |
| | | @Param("key") String key, @Param("keyType") Integer keyType, @Param("userRank") String userRank, |
| | | @Param("days") Integer days, @Param("startTime") String startTime, @Param("endTime") String endTime, |
| | | @Param("orderField") Integer orderField, @Param("orderMode") Integer orderMode); |
| | | |
| | | long queryCount(@Param("userState") Integer userState, @Param("key") String key, @Param("keyType") Integer keyType, |
| | | @Param("userRank") String userRank, @Param("days") Integer days, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计当前查询结果总金额 |
| | | * |
| | | * @param title |
| | | * @param userType |
| | | * @param days |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | double querySumMoney(@Param("key") String key, @Param("userType") Integer userType, @Param("days") Integer days, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计用户数量 |
| | | * |
| | | * @param isToday |
| | | * 统计今日 |
| | | * @param isMonth |
| | | * 统计当月 二则不可同时存在 |
| | | * @return |
| | | */ |
| | | long countNewUser(@Param("isToday") Integer isToday, @Param("isMonth") Integer isMonth); |
| | | |
| | | /** |
| | | * 根据等级统计用户数量 |
| | | * |
| | | * @param rank |
| | | * @return |
| | | */ |
| | | long countRank(@Param("rank") Integer rank); |
| | | |
| | | /** |
| | | * 统计所有用户总金额 或 可提现金额 |
| | | * |
| | | * @param minMoney |
| | | * @return |
| | | */ |
| | | BigDecimal countAllMoney(@Param("minMoney") Double minMoney); |
| | | |
| | | /** |
| | | * 超过 daysNum 天未登陆的用户 |
| | | * |
| | | * @param minMoney |
| | | * @return |
| | | */ |
| | | List<Long> longTimeNoLogin(@Param("daysNum") int daysNum, @Param("list") List<Long> list); |
| | | |
| | | /** |
| | | * 统计流失用户数量:( num 天未使用登录并且无任何资金流动的账号数量) |
| | | * |
| | | * @param num |
| | | * 180 |
| | | * @return |
| | | */ |
| | | long countLoseUser(@Param("num") int num); |
| | | |
| | | /** |
| | | * 累计有购买用户数 |
| | | * |
| | | * @return |
| | | */ |
| | | long countHasOrderUser(); |
| | | |
| | | /** |
| | | * 统计新增用户 |
| | | * |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countNewUserByDate(@Param("channel") String channel, @Param("type") Integer type, |
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计新增用户当日产生订单用户数量 |
| | | * |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getTodayHasOrder(@Param("channel") String channel, @Param("type") Integer type, |
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 统计新增用户一周产生订单用户数量 |
| | | * |
| | | * @return |
| | | */ |
| | | Map<String, Object> getWeekHasOrder(@Param("channel") String channel, @Param("startTime") String startTime, |
| | | @Param("endTime") String endTime, @Param("orderNum") Integer orderNum); |
| | | |
| | | /** |
| | | * 根据电话号码、邀请码获取邀请用户 |
| | | * |
| | | * @param phone |
| | | * @param inviteCode |
| | | * @return |
| | | */ |
| | | UserInfo getInfoByPhoneOrInviteCode(@Param("phone") String phone, @Param("inviteCode") String inviteCode); |
| | | |
| | | // 根据AppId与电话号码获取用户 |
| | | List<UserInfo> listByClosed(@Param("appId") String appId, @Param("phone") String phone); |
| | | |
| | | long countAvaiableUser(); |
| | | package com.yeshi.fanli.dao.mybatis;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.vo.user.UserInfoVO;
|
| | |
|
| | | public interface UserInfoMapper {
|
| | |
|
| | | int deleteByPrimaryKey(Long id);
|
| | |
|
| | | int insert(UserInfo record);
|
| | |
|
| | | int insertSelective(UserInfo record);
|
| | |
|
| | | UserInfo selectByPrimaryKey(Long id);
|
| | |
|
| | | /**
|
| | | * 查询有效的
|
| | | * |
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | UserInfo selectAvailableByPrimaryKey(Long id);
|
| | |
|
| | | UserInfo selectByPrimaryKeyForUpdate(Long id);
|
| | |
|
| | | int updateByPrimaryKeySelective(UserInfo record);
|
| | |
|
| | | int updateByPrimaryKey(UserInfo record);
|
| | |
|
| | | // 减掉用户红包金额
|
| | | int subHongBaoByUid(@Param("uid") long uid, @Param("money") BigDecimal money);
|
| | |
|
| | | // 增加用户红包金额
|
| | | int addHongBaoByUid(@Param("uid") long uid, @Param("money") BigDecimal money);
|
| | |
|
| | | void cleanPassword(long id);
|
| | |
|
| | | BigDecimal getNewPeopleHB(Long id);
|
| | |
|
| | | BigDecimal getMyHB(Long id);
|
| | |
|
| | | // 根据AppId与微信unionID获取用户
|
| | | List<UserInfo> listByAppIdAndWXUnionId(@Param("appId") String appId, @Param("unionId") String unionId);
|
| | |
|
| | | // 根据AppId与淘宝OpenId获取用户
|
| | | List<UserInfo> listByAppIdAndTaoBaoOpenId(@Param("appId") String appId, @Param("openId") String openId);
|
| | |
|
| | | // 根据AppId与电话号码获取用户
|
| | | List<UserInfo> listByAppIdAndPhone(@Param("appId") String appId, @Param("phone") String phone);
|
| | |
|
| | | // 根据获取电话号码有效用户
|
| | | UserInfo getEffectiveUserInfoByPhone(@Param("phone") String phone);
|
| | |
|
| | | // 根据获WXUnionId有效用户
|
| | | UserInfo getEffectiveUserInfoByWXUnionId(@Param("unionId") String unionId);
|
| | |
|
| | | Long getMaxUid();
|
| | |
|
| | | /**
|
| | | * 融合账号
|
| | | * |
| | | * @param mainUid-主账号
|
| | | * @param lessUid-副账号
|
| | | */
|
| | | void connectUser(@Param("mainUid") Long mainUid, @Param("lessUid") Long lessUid);
|
| | |
|
| | | /**
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * 查询条件
|
| | | * @param userType
|
| | | * 用户类型
|
| | | * @param days
|
| | | * 天数
|
| | | * @param startTime
|
| | | * 注册时间 -小
|
| | | * @param endTime
|
| | | * 注册时间 -大
|
| | | * @param orderMode
|
| | | * 排序方式
|
| | | * @return
|
| | | */
|
| | | List<UserInfoVO> query(@Param("start") long start, @Param("count") int count, @Param("userState") Integer userState,
|
| | | @Param("key") String key, @Param("keyType") Integer keyType, @Param("userRank") String userRank,
|
| | | @Param("days") Integer days, @Param("startTime") String startTime, @Param("endTime") String endTime,
|
| | | @Param("orderField") Integer orderField, @Param("orderMode") Integer orderMode);
|
| | |
|
| | | long queryCount(@Param("userState") Integer userState, @Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("userRank") String userRank, @Param("days") Integer days, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 统计当前查询结果总金额
|
| | | * |
| | | * @param title
|
| | | * @param userType
|
| | | * @param days
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | double querySumMoney(@Param("key") String key, @Param("userType") Integer userType, @Param("days") Integer days,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 统计用户数量
|
| | | * |
| | | * @param isToday
|
| | | * 统计今日
|
| | | * @param isMonth
|
| | | * 统计当月 二则不可同时存在
|
| | | * @return
|
| | | */
|
| | | long countNewUser(@Param("isToday") Integer isToday, @Param("isMonth") Integer isMonth);
|
| | |
|
| | | /**
|
| | | * 根据等级统计用户数量
|
| | | * |
| | | * @param rank
|
| | | * @return
|
| | | */
|
| | | long countRank(@Param("rank") Integer rank);
|
| | |
|
| | | /**
|
| | | * 统计所有用户总金额 或 可提现金额
|
| | | * |
| | | * @param minMoney
|
| | | * @return
|
| | | */
|
| | | BigDecimal countAllMoney(@Param("minMoney") Double minMoney);
|
| | |
|
| | | /**
|
| | | * 超过 daysNum 天未登陆的用户
|
| | | * |
| | | * @param minMoney
|
| | | * @return
|
| | | */
|
| | | List<Long> longTimeNoLogin(@Param("daysNum") int daysNum, @Param("list") List<Long> list);
|
| | |
|
| | | /**
|
| | | * 统计流失用户数量:( num 天未使用登录并且无任何资金流动的账号数量)
|
| | | * |
| | | * @param num
|
| | | * 180
|
| | | * @return
|
| | | */
|
| | | long countLoseUser(@Param("num") int num);
|
| | |
|
| | | /**
|
| | | * 累计有购买用户数
|
| | | * |
| | | * @return
|
| | | */
|
| | | long countHasOrderUser();
|
| | |
|
| | | /**
|
| | | * 统计新增用户
|
| | | * |
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countNewUserByDate(@Param("channel") String channel, @Param("type") Integer type,
|
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 统计新增用户当日产生订单用户数量
|
| | | * |
| | | * @return
|
| | | */
|
| | | List<ChartTDO> getTodayHasOrder(@Param("channel") String channel, @Param("type") Integer type,
|
| | | @Param("years") String years, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 统计新增用户一周产生订单用户数量
|
| | | * |
| | | * @return
|
| | | */
|
| | | ChartTDO getWeekHasOrder(@Param("channel") String channel, @Param("startTime") String startTime,
|
| | | @Param("endTime") String endTime, @Param("orderNum") Integer orderNum);
|
| | |
|
| | | /**
|
| | | * 根据电话号码、邀请码获取邀请用户
|
| | | * |
| | | * @param phone
|
| | | * @param inviteCode
|
| | | * @return
|
| | | */
|
| | | UserInfo getInfoByPhoneOrInviteCode(@Param("phone") String phone, @Param("inviteCode") String inviteCode);
|
| | |
|
| | | // 根据AppId与电话号码获取用户
|
| | | List<UserInfo> listByClosed(@Param("appId") String appId, @Param("phone") String phone);
|
| | |
|
| | | long countAvaiableUser();
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.jd; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass; |
| | | |
| | | public interface JDGoodsClassMapper extends BaseMapper<JDGoodsClass> { |
| | | |
| | | |
| | | /** |
| | | * 删除小于当前时间分类 |
| | | * @param level |
| | | * @param date |
| | | */ |
| | | void deleteByDate(@Param("level")Integer level, @Param("date")String date); |
| | | |
| | | |
| | | /** |
| | | * 查询各级分类 |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | List<JDGoodsClass> getByLevel(@Param("level")Integer level); |
| | | |
| | | |
| | | /** |
| | | * 查询下级分类 |
| | | * @param pid |
| | | * @return |
| | | */ |
| | | List<JDGoodsClass> getByPid(@Param("pid")Integer pid); |
| | | |
| | | |
| | | /** |
| | | * 查询最新分类 |
| | | * @param level |
| | | * @param cid |
| | | * @return |
| | | */ |
| | | JDGoodsClass getByCid(@Param("level")Integer level, @Param("cid")Integer cid); |
| | | |
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.jd; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.entity.jd.JDOrderItem; |
| | | |
| | | public interface JDOrderItemMapper extends BaseMapper<JDOrderItem> { |
| | |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.money; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.money.UserBalance; |
| | | |
| | | public interface UserBalanceMapper extends BaseMapper<UserBalance> { |
| | | |
| | | /** |
| | | * 根据用户id查询 |
| | | * @param uid |
| | | * @return |
| | | */ |
| | | UserBalance getByUid(Long uid); |
| | | } |
| | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | |
| | | |
| | | public interface CommonOrderCountMapper { |
| | | |
| | |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime,@Param("sourceType") int sourceType); |
| | | |
| | | |
| | |
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dao.BaseMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | |
|
| | | public interface LostOrderMapper extends BaseMapper<LostOrder> {
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countLostNum(@Param("dateType") Integer dateType, @Param("resultCode") Integer resultCode,
|
| | | List<ChartTDO> countLostNum(@Param("dateType") Integer dateType, @Param("resultCode") Integer resultCode,
|
| | | @Param("year") String year, @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<Map<String, Object>> countAppealMoney(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | List<ChartTDO> countAppealMoney(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | |
| | | package com.yeshi.fanli.dao.mybatis.pdd; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.entity.pdd.PDDOrder; |
| | | |
| | | public interface PDDOrderMapper extends BaseMapper<PDDOrder> { |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder; |
| | | |
| | | public interface TaoBaoOrderMapper { |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(TaoBaoOrder record); |
| | | |
| | | int insertSelective(TaoBaoOrder record); |
| | | |
| | | TaoBaoOrder selectByPrimaryKey(Long id); |
| | | |
| | | // 通过订单号获取订单列表 |
| | | List<TaoBaoOrder> selectTaoBaoOrderByOrderId(String orderId); |
| | | |
| | | // 通过交易ID获取订单 |
| | | TaoBaoOrder selectTaoBaoOrderByTradeId(String tradeId); |
| | | |
| | | List<TaoBaoOrder> listByTradeId(String tradeId); |
| | | |
| | | int updateByPrimaryKeySelective(TaoBaoOrder record); |
| | | |
| | | int updateByPrimaryKey(TaoBaoOrder record); |
| | | |
| | | // 根据订单号删除数据 |
| | | int deleteByOrderId(String orderId); |
| | | |
| | | /** |
| | | * 统计--订单类型区分 |
| | | * |
| | | * @return |
| | | */ |
| | | Map<String, Object> countByOdrerType(); |
| | | |
| | | /** |
| | | * 统计今日订单 |
| | | * |
| | | * @return |
| | | */ |
| | | int countToday(); |
| | | |
| | | /** |
| | | * 统计昨日订单 |
| | | * |
| | | * @return |
| | | */ |
| | | int countYesterday(); |
| | | |
| | | /** |
| | | * 统计当日预估收益 |
| | | * |
| | | * @param date |
| | | * 2018-09-01 |
| | | * @return |
| | | */ |
| | | double countEstimate(@Param("date") String date); |
| | | |
| | | List<TaoBaoOrder> getStateByOrderIdAndPayment(@Param("orderId") String orderId, @Param("payment") String payment); |
| | | |
| | | TaoBaoOrder selectLatestByAuctionId(long auctionId); |
| | | |
| | | /** |
| | | * 统计所有订单 |
| | | * |
| | | * @param channel |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | | * 获取长期未更新的订单 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<TaoBaoOrder> listLongTimeNoUpdateOrders(@Param("start") long start, @Param("count") int count); |
| | | |
| | | /** |
| | | * 获取所有订单列表 |
| | | * |
| | | * @param orderNo |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<TaoBaoOrder> listAllOrder(@Param("orderNo") String orderNo, @Param("start") long start, |
| | | @Param("count") int count); |
| | | |
| | | /** |
| | | * 所有订单数量 |
| | | * |
| | | * @param orderNo |
| | | * @return |
| | | */ |
| | | long countAllOrder(@Param("orderNo") String orderNo); |
| | | |
| | | /** |
| | | * 根据结算时间拼排序 |
| | | * |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<TaoBaoOrder> listBySettlementTime(@Param("minTime") Long minTime, @Param("maxTime") Long maxTime, |
| | | @Param("start") long start, @Param("count") int count); |
| | | |
| | | /** |
| | | * 根据结算时间计数 |
| | | * |
| | | * @param minTime |
| | | * @param maxTime |
| | | * @return |
| | | */ |
| | | Long countBySettlementTime(@Param("minTime") Long minTime, @Param("maxTime") Long maxTime); |
| | | |
| | | /** |
| | | * 根据状态与创建时间检索 |
| | | * |
| | | * @param state |
| | | * @param minCreateTime |
| | | * @param maxCreateTime |
| | | * @return |
| | | */ |
| | | List<TaoBaoOrder> listByStateAndCreateTime(@Param("state") String state, @Param("minCreateTime") Long minCreateTime, |
| | | @Param("maxCreateTime") Long maxCreateTime); |
| | | package com.yeshi.fanli.dao.mybatis.taobao;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | |
|
| | | public interface TaoBaoOrderMapper {
|
| | |
|
| | | int deleteByPrimaryKey(Long id);
|
| | |
|
| | | int insert(TaoBaoOrder record);
|
| | |
|
| | | int insertSelective(TaoBaoOrder record);
|
| | |
|
| | | TaoBaoOrder selectByPrimaryKey(Long id);
|
| | |
|
| | | // 通过订单号获取订单列表
|
| | | List<TaoBaoOrder> selectTaoBaoOrderByOrderId(String orderId);
|
| | |
|
| | | // 通过交易ID获取订单
|
| | | TaoBaoOrder selectTaoBaoOrderByTradeId(String tradeId);
|
| | |
|
| | | List<TaoBaoOrder> listByTradeId(String tradeId);
|
| | |
|
| | | int updateByPrimaryKeySelective(TaoBaoOrder record);
|
| | |
|
| | | int updateByPrimaryKey(TaoBaoOrder record);
|
| | |
|
| | | // 根据订单号删除数据
|
| | | int deleteByOrderId(String orderId);
|
| | |
|
| | | /**
|
| | | * 统计--订单类型区分
|
| | | * |
| | | * @return
|
| | | */
|
| | | Map<String, Object> countByOdrerType();
|
| | |
|
| | | /**
|
| | | * 统计今日订单
|
| | | * |
| | | * @return
|
| | | */
|
| | | int countToday();
|
| | |
|
| | | /**
|
| | | * 统计昨日订单
|
| | | * |
| | | * @return
|
| | | */
|
| | | int countYesterday();
|
| | |
|
| | | /**
|
| | | * 统计当日预估收益
|
| | | * |
| | | * @param date
|
| | | * 2018-09-01
|
| | | * @return
|
| | | */
|
| | | double countEstimate(@Param("date") String date);
|
| | |
|
| | | List<TaoBaoOrder> getStateByOrderIdAndPayment(@Param("orderId") String orderId, @Param("payment") String payment);
|
| | |
|
| | | TaoBaoOrder selectLatestByAuctionId(long auctionId);
|
| | |
|
| | | /**
|
| | | * 统计所有订单
|
| | | * |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> countOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year,
|
| | | @Param("startTime") String startTime, @Param("endTime") String endTime);
|
| | |
|
| | | /**
|
| | | * 获取长期未更新的订单
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<TaoBaoOrder> listLongTimeNoUpdateOrders(@Param("start") long start, @Param("count") int count);
|
| | |
|
| | | /**
|
| | | * 获取所有订单列表
|
| | | * |
| | | * @param orderNo
|
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<TaoBaoOrder> listAllOrder(@Param("orderNo") String orderNo, @Param("start") long start,
|
| | | @Param("count") int count);
|
| | |
|
| | | /**
|
| | | * 所有订单数量
|
| | | * |
| | | * @param orderNo
|
| | | * @return
|
| | | */
|
| | | long countAllOrder(@Param("orderNo") String orderNo);
|
| | |
|
| | | /**
|
| | | * 根据结算时间拼排序
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<TaoBaoOrder> listBySettlementTime(@Param("minTime") Long minTime, @Param("maxTime") Long maxTime,
|
| | | @Param("start") long start, @Param("count") int count);
|
| | |
|
| | | /**
|
| | | * 根据结算时间计数
|
| | | * |
| | | * @param minTime
|
| | | * @param maxTime
|
| | | * @return
|
| | | */
|
| | | Long countBySettlementTime(@Param("minTime") Long minTime, @Param("maxTime") Long maxTime);
|
| | |
|
| | | /**
|
| | | * 根据状态与创建时间检索
|
| | | * |
| | | * @param state
|
| | | * @param minCreateTime
|
| | | * @param maxCreateTime
|
| | | * @return
|
| | | */
|
| | | List<TaoBaoOrder> listByStateAndCreateTime(@Param("state") String state, @Param("minCreateTime") Long minCreateTime,
|
| | | @Param("maxCreateTime") Long maxCreateTime);
|
| | | } |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dto.ChartTDO; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoWeiQuanOrder; |
| | | |
| | | public interface TaoBaoWeiQuanOrderMapper { |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countWeiQaunOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countWeiQaunOrderNumber(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> countWeiQaunOrderMoney(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | List<ChartTDO> countWeiQaunOrderMoney(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | /** |
| | |
| | | package com.yeshi.fanli.dao.mybatis.user; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord; |
| | | import com.yeshi.fanli.vo.user.SystemCouponVO; |
| | | import com.yeshi.fanli.vo.user.UserSystemCouponCountVO; |
| | | |
| | | public interface UserSystemCouponCountMapper { |
| | | |
| | | /** |
| | | * 奖励券统计 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param keyType |
| | | * @param state |
| | | * @param percent |
| | | * @return |
| | | */ |
| | | List<UserSystemCouponCountVO> listRebateCoupon(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("keyType") Integer keyType, |
| | | @Param("state") Integer state, @Param("percent") Integer percent); |
| | | |
| | | Long countRebateCoupon(@Param("key") String key, @Param("keyType") Integer keyType, |
| | | @Param("state") Integer state, @Param("percent") Integer percent); |
| | | |
| | | |
| | | /** |
| | | * 系统奖励券统计 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param keyType |
| | | * @param state |
| | | * @param percent |
| | | * @return |
| | | */ |
| | | List<SystemCouponVO> listSystemCouponByRebate(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("sort") Integer sort); |
| | | |
| | | Long countSystemCouponRebate(@Param("key") String key); |
| | | |
| | | /** |
| | | * 统计奖励金额 |
| | | * @return |
| | | */ |
| | | BigDecimal countRebateMoneyByCouponId(@Param("couponId") Long couponId); |
| | | |
| | | |
| | | /** |
| | | * 系统奖励券统计 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param keyType |
| | | * @param state |
| | | * @param percent |
| | | * @return |
| | | */ |
| | | List<SystemCouponVO> listSystemCouponByFree(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("sort") Integer sort); |
| | | |
| | | Long countSystemCouponFree(@Param("key") String key); |
| | | |
| | | /** |
| | | * 统计免单金额 |
| | | * @return |
| | | */ |
| | | BigDecimal countFreeMoneyByCouponId(@Param("couponId") Long couponId); |
| | | |
| | | |
| | | /** |
| | | * 免单券 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param keyType |
| | | * @param state |
| | | * @param percent |
| | | * @return |
| | | */ |
| | | List<UserSystemCouponCountVO> listFreeCoupon(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("keyType") Integer keyType, |
| | | @Param("state") Integer state, @Param("activated") Integer activated); |
| | | |
| | | Long countFreeCoupon(@Param("key") String key, @Param("keyType") Integer keyType, |
| | | @Param("state") Integer state, @Param("activated") Integer activated); |
| | | |
| | | |
| | | /** |
| | | * 免单券使用记录 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param keyType |
| | | * @param state |
| | | * @param percent |
| | | * @return |
| | | */ |
| | | List<UserSystemCouponRecord> listFreeCouponRecord(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("keyType") Integer keyType, |
| | | @Param("state") Integer state); |
| | | |
| | | Long countFreeCouponRecord(@Param("key") String key, @Param("keyType") Integer keyType, |
| | | @Param("state") Integer state); |
| | | |
| | | /** |
| | | * 奖励券使用数量曲线图 |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getRebateCouponUsedNumToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | |
| | | /** |
| | | * 奖励券使用成功金额曲线图 |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getRebateCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | |
| | | /** |
| | | * 奖励券使用成功金额曲线图 |
| | | * @param dateType |
| | | * @param year |
| | | * @param startTime |
| | | * @param endTime |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> getFreeCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("couponType")String couponType); |
| | | |
| | | package com.yeshi.fanli.dao.mybatis.user;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | |
|
| | | import org.apache.ibatis.annotations.Param;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | | import com.yeshi.fanli.vo.user.SystemCouponVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponCountVO;
|
| | |
|
| | | public interface UserSystemCouponCountMapper {
|
| | | |
| | | /**
|
| | | * 奖励券统计
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param keyType
|
| | | * @param state
|
| | | * @param percent
|
| | | * @return
|
| | | */
|
| | | List<UserSystemCouponCountVO> listRebateCoupon(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("state") Integer state, @Param("percent") Integer percent);
|
| | | |
| | | Long countRebateCoupon(@Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("state") Integer state, @Param("percent") Integer percent);
|
| | | |
| | | |
| | | /**
|
| | | * 系统奖励券统计
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param keyType
|
| | | * @param state
|
| | | * @param percent
|
| | | * @return
|
| | | */
|
| | | List<SystemCouponVO> listSystemCouponByRebate(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("sort") Integer sort);
|
| | | |
| | | Long countSystemCouponRebate(@Param("key") String key);
|
| | | |
| | | /**
|
| | | * 统计奖励金额
|
| | | * @return
|
| | | */
|
| | | BigDecimal countRebateMoneyByCouponId(@Param("couponId") Long couponId);
|
| | | |
| | | |
| | | /**
|
| | | * 系统奖励券统计
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param keyType
|
| | | * @param state
|
| | | * @param percent
|
| | | * @return
|
| | | */
|
| | | List<SystemCouponVO> listSystemCouponByFree(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("sort") Integer sort);
|
| | | |
| | | Long countSystemCouponFree(@Param("key") String key);
|
| | | |
| | | /**
|
| | | * 统计免单金额
|
| | | * @return
|
| | | */
|
| | | BigDecimal countFreeMoneyByCouponId(@Param("couponId") Long couponId);
|
| | | |
| | | |
| | | /**
|
| | | * 免单券
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param keyType
|
| | | * @param state
|
| | | * @param percent
|
| | | * @return
|
| | | */
|
| | | List<UserSystemCouponCountVO> listFreeCoupon(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("state") Integer state, @Param("activated") Integer activated);
|
| | | |
| | | Long countFreeCoupon(@Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("state") Integer state, @Param("activated") Integer activated);
|
| | | |
| | | |
| | | /**
|
| | | * 免单券使用记录
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param keyType
|
| | | * @param state
|
| | | * @param percent
|
| | | * @return
|
| | | */
|
| | | List<UserSystemCouponRecord> listFreeCouponRecord(@Param("start") long start, @Param("count") int count, |
| | | @Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("state") Integer state);
|
| | | |
| | | Long countFreeCouponRecord(@Param("key") String key, @Param("keyType") Integer keyType,
|
| | | @Param("state") Integer state);
|
| | | |
| | | /**
|
| | | * 奖励券使用数量曲线图
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> getRebateCouponUsedNumToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | |
| | | |
| | | /**
|
| | | * 奖励券使用成功金额曲线图
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> getRebateCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime);
|
| | | |
| | | |
| | | /**
|
| | | * 奖励券使用成功金额曲线图
|
| | | * @param dateType
|
| | | * @param year
|
| | | * @param startTime
|
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | List<ChartTDO> getFreeCouponMoneyToCharts(@Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime, @Param("couponType")String couponType);
|
| | | |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.user;
|
| | |
|
| | | import org.springframework.data.mongodb.core.query.Criteria;
|
| | | import org.springframework.data.mongodb.core.query.Query;
|
| | | import org.springframework.data.mongodb.core.query.Update;
|
| | | import org.springframework.stereotype.Repository;
|
| | |
|
| | | import com.yeshi.fanli.dao.MongodbBaseDao;
|
| | | import com.yeshi.fanli.entity.bus.user.BindRemind;
|
| | |
|
| | | @Repository
|
| | | public class BindRemindDao extends MongodbBaseDao<BindRemind> {
|
| | | |
| | | public BindRemind getByUidAndType(Long uid, Integer type) {
|
| | | Query query = new Query();
|
| | | query.addCriteria(
|
| | | new Criteria().andOperator(
|
| | | Criteria.where("uid").is(uid),
|
| | | Criteria.where("type").is(type)
|
| | | )
|
| | | );
|
| | | return mongoTemplate.findOne(query, BindRemind.class);
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 更新分享次数
|
| | | * @param record
|
| | | */
|
| | | public void updateInfo(BindRemind record) {
|
| | | if (record == null) {
|
| | | return;
|
| | | }
|
| | | // 查询数据是存在
|
| | | Query query = new Query();
|
| | | query.addCriteria(Criteria.where("id").is(record.getId()));
|
| | | |
| | | Update update = Update.update("createTime", record.getRemindTime());
|
| | | mongoTemplate.updateMulti(query, update, BindRemind.class);
|
| | | }
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.dto;
|
| | |
|
| | | public class ChartTDO {
|
| | | // 日期
|
| | | private String showDate;
|
| | | // 显示值
|
| | | private String showValue;
|
| | | |
| | | public String getShowDate() {
|
| | | return showDate;
|
| | | }
|
| | | public void setShowDate(String showDate) {
|
| | | this.showDate = showDate;
|
| | | }
|
| | | public String getShowValue() {
|
| | | return showValue;
|
| | | }
|
| | | public void setShowValue(String showValue) {
|
| | | this.showValue = showValue;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | |
|
| | | /**
|
| | | * 商品分类dto
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public class GoodsClassDTO implements Serializable {
|
| | | /**
|
| | | * |
| | | */
|
| | | private static final long serialVersionUID = 1L;
|
| | |
|
| | | private String id;
|
| | | private String name;
|
| | | private BigDecimal selfComm; // plus订单类目佣金比例-自营
|
| | | private BigDecimal popComm; // plus订单类目佣金比例-pop
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public BigDecimal getSelfComm() {
|
| | | return selfComm;
|
| | | }
|
| | |
|
| | | public void setSelfComm(BigDecimal selfComm) {
|
| | | this.selfComm = selfComm;
|
| | | }
|
| | |
|
| | | public BigDecimal getPopComm() {
|
| | | return popComm;
|
| | | }
|
| | |
|
| | | public void setPopComm(BigDecimal popComm) {
|
| | | this.popComm = popComm;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.dto.douyin;
|
| | |
|
| | | public class DouYinGoods {
|
| | | private String id;
|
| | | private String name;
|
| | | private String img;
|
| | | |
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | | public String getImg() {
|
| | | return img;
|
| | | }
|
| | | public void setImg(String img) {
|
| | | this.img = img;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.user;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.springframework.data.mongodb.core.mapping.Document;
|
| | | import org.springframework.data.mongodb.core.mapping.Field;
|
| | |
|
| | | /**
|
| | | * 绑定提示时间
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Document(collection = "bind_remind")
|
| | | public class BindRemind implements Serializable{
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | // 手机号
|
| | | public static int TYPE_PHONE = 1;
|
| | | // 微信
|
| | | public static int TYPE_WEIXXIN = 2;
|
| | | |
| | | @Field("id")
|
| | | private String id;
|
| | | |
| | | @Field("uid")
|
| | | private Long uid;
|
| | | |
| | | @Field("type")
|
| | | private Integer type;
|
| | | |
| | | @Field("createTime")
|
| | | private Date remindTime;
|
| | |
|
| | |
|
| | | public String getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(String id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | |
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | |
|
| | | public Integer getType() {
|
| | | return type;
|
| | | }
|
| | |
|
| | | public void setType(Integer type) {
|
| | | this.type = type;
|
| | | }
|
| | |
|
| | | public Date getRemindTime() {
|
| | | return remindTime;
|
| | | }
|
| | |
|
| | | public void setRemindTime(Date remindTime) {
|
| | | this.remindTime = remindTime;
|
| | | }
|
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | |
|
| | | import javax.persistence.Column;
|
| | | import javax.persistence.JoinColumn;
|
| | | import javax.persistence.ManyToOne;
|
| | | import javax.persistence.Transient;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
| | | private String rankNamePicture;// 等级名称图片
|
| | | @Transient
|
| | | private String taoBaoUid;// 淘宝的用户ID
|
| | |
|
| | | |
| | | public String getTaoBaoUid() {
|
| | | return taoBaoUid;
|
| | | }
|
| | |
| | | private Long totalCount;// 有效商品总数量
|
| | | private Integer isFreeShipping; // 是否包邮(1:是,0:否,2:自营商品遵从主站包邮规则)
|
| | |
|
| | |
|
| | | private BigDecimal commissionPlus;// 佣金比例 : 京东plus会员 |
| | | |
| | | public JDCategoryInfo getCategoryInfo() {
|
| | | return categoryInfo;
|
| | | }
|
| | |
| | | public void setIsFreeShipping(Integer isFreeShipping) {
|
| | | this.isFreeShipping = isFreeShipping;
|
| | | }
|
| | |
|
| | | public BigDecimal getCommissionPlus() {
|
| | | return commissionPlus;
|
| | | }
|
| | |
|
| | | public void setCommissionPlus(BigDecimal commissionPlus) {
|
| | | this.commissionPlus = commissionPlus;
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.jd;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 商品分类
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_class_jd")
|
| | | public class JDGoodsClass {
|
| | | @Column(name = "cjd_id")
|
| | | private Long id;
|
| | | @Column(name = "cjd_cid")
|
| | | private Integer cid; // 分类id
|
| | | @Column(name = "cjd_name")
|
| | | private String name; // 分类名
|
| | | @Column(name = "cjd_level")
|
| | | private Integer level; // 等级
|
| | | @Column(name = "cjd_super_id")
|
| | | private Integer superId; // 上级id
|
| | | @Column(name = "cjp_self_comm")
|
| | | private BigDecimal selfComm; // plus订单类目佣金比例-自营
|
| | | @Column(name = "cjp_pop_comm")
|
| | | private BigDecimal popComm; // plus订单类目佣金比例-pop
|
| | | @Column(name = "cjd_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "cjd_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Integer getCid() {
|
| | | return cid;
|
| | | }
|
| | |
|
| | | public void setCid(Integer cid) {
|
| | | this.cid = cid;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public Integer getLevel() {
|
| | | return level;
|
| | | }
|
| | |
|
| | | public void setLevel(Integer level) {
|
| | | this.level = level;
|
| | | }
|
| | |
|
| | | public Integer getSuperId() {
|
| | | return superId;
|
| | | }
|
| | |
|
| | | public void setSuperId(Integer superId) {
|
| | | this.superId = superId;
|
| | | }
|
| | | |
| | | public BigDecimal getSelfComm() {
|
| | | return selfComm;
|
| | | }
|
| | |
|
| | | public void setSelfComm(BigDecimal selfComm) {
|
| | | this.selfComm = selfComm;
|
| | | }
|
| | |
|
| | | public BigDecimal getPopComm() {
|
| | | return popComm;
|
| | | }
|
| | |
|
| | | public void setPopComm(BigDecimal popComm) {
|
| | | this.popComm = popComm;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.money;
|
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 用户余额
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_user_balance")
|
| | | public class UserBalance {
|
| | | @Column(name = "ub_id")
|
| | | private Long id;
|
| | | @Column(name = "ub_uid")
|
| | | private Long uid;
|
| | | @Column(name = "ub_money")
|
| | | private BigDecimal money;
|
| | | @Column(name = "ub_create_time")
|
| | | private Date createTime;
|
| | | @Column(name = "ub_update_time")
|
| | | private Date updateTime;
|
| | | |
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | | public Long getUid() {
|
| | | return uid;
|
| | | }
|
| | | public void setUid(Long uid) {
|
| | | this.uid = uid;
|
| | | }
|
| | | public BigDecimal getMoney() {
|
| | | return money;
|
| | | }
|
| | | public void setMoney(BigDecimal money) {
|
| | | this.money = money;
|
| | | }
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | }
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.ExtractAuditRecordMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord"> |
| | | <id column="id" property="id" jdbcType="BIGINT" /> |
| | | <result column="beforeMoney" property="beforeMoney" jdbcType="DECIMAL" /> |
| | | <result column="afterMoney" property="afterMoney" jdbcType="DECIMAL" /> |
| | | <result column="countMoney" property="countMoney" jdbcType="DECIMAL" /> |
| | | <result column="countNum" property="countNum" jdbcType="BIGINT" /> |
| | | <result column="orderNum" property="orderNum" jdbcType="BIGINT" /> |
| | | <result column="auditRole" property="auditRole" jdbcType="VARCHAR" /> |
| | | <result column="cancelOrderNum" property="cancelOrderNum" |
| | | jdbcType="BIGINT" /> |
| | | <result column="auditTime" property="auditTime" jdbcType="BIGINT" /> |
| | | <result column="extraInfo" property="extraInfoStr" jdbcType="VARCHAR" /> |
| | | <association property="adminUser" column="aid" |
| | | select="com.yeshi.fanli.dao.mybatis.AdminUserMapper.selectByPrimaryKey"> |
| | | </association> |
| | | <association property="extract" column="extractId" |
| | | select="com.yeshi.fanli.dao.mybatis.ExtractMapper.selectByPrimaryKey"> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,aid,extractId,beforeMoney,afterMoney,countMoney,countNum,orderNum,cancelOrderNum,auditTime,auditRole,extraInfo |
| | | </sql> |
| | | |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_extract_audit_record where id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long"> |
| | | delete from |
| | | yeshi_ec_extract_audit_record where id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into |
| | | yeshi_ec_extract_audit_record |
| | | (id,aid,extractId,beforeMoney,afterMoney,countMoney,countNum,auditTime,extraInfo) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{adminUser.id,jdbcType=BIGINT},#{extract.id,jdbcType=BIGINT}, |
| | | #{beforeMoney,jdbcType=DECIMAL},#{afterMoney,jdbcType=DECIMAL},#{countMoney,jdbcType=DECIMAL},#{auditRole,jdbcType=VARCHAR}) |
| | | #{countNum,jdbcType=BIGINT},#{orderNum,jdbcType=BIGINT},#{cancelOrderNum,jdbcType=BIGINT},#{auditTime,jdbcType=BIGINT},#{extraInfoStr,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_extract_audit_record |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">id,</if> |
| | | <if test="adminUser != null">aid,</if> |
| | | <if test="extract != null">extractId,</if> |
| | | <if test="beforeMoney != null">beforeMoney,</if> |
| | | <if test="afterMoney != null">afterMoney,</if> |
| | | <if test="countMoney != null">countMoney,</if> |
| | | <if test="countNum != null">countNum,</if> |
| | | <if test="orderNum != null">orderNum,</if> |
| | | <if test="cancelOrderNum != null">cancelOrderNum,</if> |
| | | <if test="auditTime != null">auditTime,</if> |
| | | <if test="auditRole != null">auditRole,</if> |
| | | <if test="extraInfoStr != null">extraInfo,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="adminUser != null">#{adminUser.id,jdbcType=BIGINT},</if> |
| | | <if test="extract != null">#{extract.id,jdbcType=BIGINT},</if> |
| | | <if test="beforeMoney != null">#{beforeMoney,jdbcType=DECIMAL},</if> |
| | | <if test="afterMoney != null">#{afterMoney,jdbcType=DECIMAL},</if> |
| | | <if test="countMoney != null">#{countMoney,jdbcType=DECIMAL},</if> |
| | | <if test="countNum != null">#{countNum,jdbcType=BIGINT},</if> |
| | | <if test="orderNum != null">#{orderNum,jdbcType=BIGINT},</if> |
| | | <if test="cancelOrderNum != null">#{cancelOrderNum,jdbcType=BIGINT},</if> |
| | | <if test="auditTime != null">#{auditTime,jdbcType=BIGINT},</if> |
| | | <if test="auditRole != null">#{auditRole,jdbcType=VARCHAR},</if> |
| | | <if test="extraInfoStr != null">#{extraInfoStr,jdbcType=VARCHAR},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord"> |
| | | update |
| | | yeshi_ec_extract_audit_record set aid = |
| | | #{adminUser.id,jdbcType=BIGINT}, |
| | | extractId = |
| | | #{extract.id,jdbcType=BIGINT},beforeMoney = |
| | | #{beforeMoney,jdbcType=DECIMAL}, |
| | | afterMoney = |
| | | #{afterMoney,jdbcType=DECIMAL},countMoney = |
| | | #{countMoney,jdbcType=DECIMAL}, |
| | | countNum = |
| | | #{countNum,jdbcType=BIGINT},auditRole = |
| | | #{auditRole,jdbcType=VARCHAR}, |
| | | orderNum = #{orderNum,jdbcType=BIGINT},cancelOrderNum = |
| | | #{cancelOrderNum,jdbcType=BIGINT}, |
| | | auditTime = |
| | | #{auditTime,jdbcType=BIGINT}, |
| | | extraInfo = |
| | | #{extraInfoStr,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord"> |
| | | update yeshi_ec_extract_audit_record |
| | | <set> |
| | | <if test="adminUser != null">aid=#{adminUser.id,jdbcType=BIGINT},</if> |
| | | <if test="extract != null">extractId=#{extract.id,jdbcType=BIGINT},</if> |
| | | <if test="beforeMoney != null">beforeMoney=#{beforeMoney,jdbcType=DECIMAL},</if> |
| | | <if test="afterMoney != null">afterMoney=#{afterMoney,jdbcType=DECIMAL},</if> |
| | | <if test="countMoney != null">countMoney=#{countMoney,jdbcType=DECIMAL},</if> |
| | | <if test="countNum != null">countNum=#{countNum,jdbcType=BIGINT},</if> |
| | | <if test="orderNum != null">orderNum=#{orderNum,jdbcType=BIGINT},</if> |
| | | <if test="cancelOrderNum != null">cancelOrderNum=#{cancelOrderNum,jdbcType=BIGINT},</if> |
| | | <if test="auditTime != null">auditTime=#{auditTime,jdbcType=BIGINT},</if> |
| | | <if test="auditRole != null">auditRole=#{auditRole,jdbcType=VARCHAR},</if> |
| | | <if test="extraInfoStr != null">extraInfo=#{extraInfoStr,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getListbyExtractId" resultMap="BaseResultMap"> |
| | | <!-- 查询最近一次提现记录 --> |
| | | SELECT * FROM yeshi_ec_extract_audit_record ear |
| | | WHERE ear.`extractId` = |
| | | #{extractId,jdbcType=BIGINT} |
| | | and auditTime is not null and auditTime > |
| | | 0 ORDER BY ear.`auditTime` |
| | | </select> |
| | | |
| | | <select id="getbyExtractId" resultMap="BaseResultMap"> |
| | | <!-- 查询提现时已记录信息 --> |
| | | SELECT * FROM yeshi_ec_extract_audit_record ear |
| | | WHERE ear.`extractId` = |
| | | #{extractId,jdbcType=BIGINT} |
| | | and (auditTime is null or auditTime = 0) |
| | | ORDER BY ear.`auditTime` desc |
| | | </select> |
| | | |
| | | <select id="getList" resultMap="BaseResultMap"> |
| | | |
| | | SELECT * FROM yeshi_ec_extract_audit_record ar |
| | | LEFT JOIN |
| | | yeshi_ec_extract ex ON ar.extractId=ex.id |
| | | WHERE |
| | | <![CDATA[ |
| | | auditTime is not null and auditTime > 0 AND |
| | | FROM_UNIXTIME(ex.extractTime/1000) >= #{startTime} |
| | | AND FROM_UNIXTIME(ex.extractTime/1000) <= #{endTime} |
| | | ]]> |
| | | <if test='key != null and key != ""'> |
| | | AND (ex.uid like '%${key}%' OR ar.aid like '%${key}%') |
| | | </if> |
| | | ORDER BY ex.extractTime DESC LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="getCount" resultType="java.lang.Integer"> |
| | | SELECT count(ar.id) FROM yeshi_ec_extract_audit_record ar |
| | | LEFT JOIN |
| | | yeshi_ec_extract ex ON ar.extractId=ex.id |
| | | WHERE |
| | | <![CDATA[ |
| | | auditTime is not null and auditTime > 0 AND |
| | | FROM_UNIXTIME(ex.`extractTime`/1000) >= #{startTime} |
| | | AND FROM_UNIXTIME(ex.`extractTime`/1000) <= #{endTime} |
| | | ]]> |
| | | <if test='key != null and key != ""'> |
| | | AND (ex.uid like '%${key}%' OR ar.aid like '%${key}%') |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <select id="getMyAuditedAllList" resultMap="BaseResultMap"> |
| | | |
| | | SELECT * FROM yeshi_ec_extract_audit_record ar |
| | | LEFT JOIN |
| | | yeshi_ec_extract ex ON ar.extractId=ex.id |
| | | WHERE ar.aid = ${adminId} |
| | | <if test='key != null and key != ""'> |
| | | AND ex.uid like '%${key}%' |
| | | </if> |
| | | <if test='state != null'> |
| | | AND ex.state = #{state} |
| | | </if> |
| | | ORDER BY ex.extractTime DESC LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="getMyAuditedAllCount" resultType="java.lang.Integer"> |
| | | |
| | | SELECT count(ar.id) FROM yeshi_ec_extract_audit_record ar |
| | | LEFT JOIN |
| | | yeshi_ec_extract ex ON ar.extractId=ex.id |
| | | WHERE ar.aid = ${adminId} |
| | | <if test='key != null and key != ""'> |
| | | AND ex.uid like '%${key}%' |
| | | </if> |
| | | <if test='state != null'> |
| | | AND ex.state = #{state} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getMyAuditedTimeSlotList" resultMap="BaseResultMap"> |
| | | SELECT ar.*,(CASE WHEN ex.state = 2 THEN 1 WHEN ex.state =1 THEN 1 |
| | | ELSE 0 END) AS stateOrde FROM yeshi_ec_extract_audit_record ar |
| | | LEFT |
| | | JOIN yeshi_ec_extract ex ON ar.extractId=ex.id |
| | | WHERE <![CDATA[1>0]]> |
| | | <if test="adminId != null"> |
| | | AND ar.aid = ${adminId} |
| | | </if> |
| | | |
| | | <if test='key != null and key != ""'> |
| | | AND ex.uid like '%${key}%' |
| | | </if> |
| | | |
| | | <if test="days != null"> |
| | | <![CDATA[ AND DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(ex.extractTime/1000) ]]> |
| | | </if> |
| | | |
| | | <if test='state != null'> |
| | | AND ex.state = #{state} |
| | | </if> |
| | | ORDER BY stateOrde,ex.`extractTime` DESC LIMIT ${start},${count} |
| | | |
| | | </select> |
| | | |
| | | <select id="getMyAuditedTimeSlotCount" resultType="java.lang.Integer"> |
| | | SELECT count(ar.id) FROM yeshi_ec_extract_audit_record ar |
| | | LEFT JOIN |
| | | yeshi_ec_extract ex ON ar.extractId=ex.id |
| | | WHERE <![CDATA[1>0]]> |
| | | <if test="adminId != null"> |
| | | AND ar.aid = ${adminId} |
| | | </if> |
| | | |
| | | <if test='key != null and key != ""'> |
| | | AND ex.uid like '%${key}%' |
| | | </if> |
| | | |
| | | <if test="days != null"> |
| | | <![CDATA[ AND DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(ex.extractTime/1000) ]]> |
| | | </if> |
| | | |
| | | <if test='state != null'> |
| | | AND ex.state = #{state} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getMyAuditedCountWeek" resultType="java.lang.Integer"> |
| | | SELECT COUNT(id) FROM yeshi_ec_extract_audit_record WHERE aid = |
| | | ${adminId} |
| | | <![CDATA[ |
| | | AND YEARWEEK(DATE_FORMAT(FROM_UNIXTIME(auditTime/1000),'%Y-%m-%d')) = YEARWEEK(NOW()); |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="getMyAuditedCountMonth" resultType="java.lang.Integer"> |
| | | SELECT COUNT(id) FROM yeshi_ec_extract_audit_record WHERE aid = |
| | | ${adminId} |
| | | <![CDATA[ |
| | | AND DATE_FORMAT(FROM_UNIXTIME(auditTime/1000),'%Y-%m')=DATE_FORMAT(NOW(),'%Y-%m') |
| | | ]]> |
| | | </select> |
| | | |
| | | <select id="getMyAuditedCountToday" resultType="java.lang.Integer"> |
| | | SELECT COUNT(id) FROM yeshi_ec_extract_audit_record WHERE aid = |
| | | ${adminId} |
| | | <![CDATA[ |
| | | AND TO_DAYS(FROM_UNIXTIME(auditTime/1000)) = TO_DAYS(NOW()) |
| | | ]]> |
| | | </select> |
| | | |
| | | <!-- 查询历史提现申请记录 --> |
| | | <select id="getByUidList" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_extract_audit_record ar |
| | | LEFT JOIN |
| | | yeshi_ec_extract ex ON ar.extractId=ex.id |
| | | WHERE ex.uid = ${uid} |
| | | <![CDATA[and ar.auditTime > 0 and ar.auditTime is not null ]]> |
| | | ORDER BY ex.extractTime DESC LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="getByUidCount" resultType="java.lang.Integer"> |
| | | SELECT COUNT(ar.id) FROM yeshi_ec_extract_audit_record ar |
| | | LEFT JOIN |
| | | yeshi_ec_extract ex ON ar.extractId=ex.id |
| | | WHERE ex.uid = ${uid} <![CDATA[and ar.auditTime > 0 and ar.auditTime is not null ]]> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="countAuditTotal" resultType="java.util.HashMap"> |
| | | 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> |
| | | |
| | | <select id="countExtractMoney" resultType="java.util.HashMap"> |
| | | 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> |
| | | |
| | | <select id="countExtractApplyNumber" resultType="java.util.HashMap"> |
| | | 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> |
| | | |
| | | </mapper> |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
| | |
|
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.ExtractAuditRecordMapper">
|
| | | <resultMap id="BaseResultMap"
|
| | | type="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord">
|
| | | <id column="id" property="id" jdbcType="BIGINT" />
|
| | | <result column="beforeMoney" property="beforeMoney" jdbcType="DECIMAL" />
|
| | | <result column="afterMoney" property="afterMoney" jdbcType="DECIMAL" />
|
| | | <result column="countMoney" property="countMoney" jdbcType="DECIMAL" />
|
| | | <result column="countNum" property="countNum" jdbcType="BIGINT" />
|
| | | <result column="orderNum" property="orderNum" jdbcType="BIGINT" />
|
| | | <result column="auditRole" property="auditRole" jdbcType="VARCHAR" />
|
| | | <result column="cancelOrderNum" property="cancelOrderNum"
|
| | | jdbcType="BIGINT" />
|
| | | <result column="auditTime" property="auditTime" jdbcType="BIGINT" />
|
| | | <result column="extraInfo" property="extraInfoStr" jdbcType="VARCHAR" />
|
| | | <association property="adminUser" column="aid"
|
| | | select="com.yeshi.fanli.dao.mybatis.AdminUserMapper.selectByPrimaryKey">
|
| | | </association>
|
| | | <association property="extract" column="extractId"
|
| | | select="com.yeshi.fanli.dao.mybatis.ExtractMapper.selectByPrimaryKey">
|
| | | </association>
|
| | | </resultMap>
|
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">id,aid,extractId,beforeMoney,afterMoney,countMoney,countNum,orderNum,cancelOrderNum,auditTime,auditRole,extraInfo
|
| | | </sql>
|
| | |
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | <include refid="Base_Column_List" />
|
| | | from yeshi_ec_extract_audit_record where id = #{id,jdbcType=BIGINT}
|
| | | </select>
|
| | |
|
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
| | | delete from
|
| | | yeshi_ec_extract_audit_record where id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | |
|
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into
|
| | | yeshi_ec_extract_audit_record
|
| | | (id,aid,extractId,beforeMoney,afterMoney,countMoney,countNum,auditTime,extraInfo)
|
| | | values
|
| | | (#{id,jdbcType=BIGINT},#{adminUser.id,jdbcType=BIGINT},#{extract.id,jdbcType=BIGINT},
|
| | | #{beforeMoney,jdbcType=DECIMAL},#{afterMoney,jdbcType=DECIMAL},#{countMoney,jdbcType=DECIMAL},#{auditRole,jdbcType=VARCHAR})
|
| | | #{countNum,jdbcType=BIGINT},#{orderNum,jdbcType=BIGINT},#{cancelOrderNum,jdbcType=BIGINT},#{auditTime,jdbcType=BIGINT},#{extraInfoStr,jdbcType=VARCHAR})
|
| | | </insert>
|
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord"
|
| | | useGeneratedKeys="true" keyProperty="id">
|
| | | insert into yeshi_ec_extract_audit_record
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">id,</if>
|
| | | <if test="adminUser != null">aid,</if>
|
| | | <if test="extract != null">extractId,</if>
|
| | | <if test="beforeMoney != null">beforeMoney,</if>
|
| | | <if test="afterMoney != null">afterMoney,</if>
|
| | | <if test="countMoney != null">countMoney,</if>
|
| | | <if test="countNum != null">countNum,</if>
|
| | | <if test="orderNum != null">orderNum,</if>
|
| | | <if test="cancelOrderNum != null">cancelOrderNum,</if>
|
| | | <if test="auditTime != null">auditTime,</if>
|
| | | <if test="auditRole != null">auditRole,</if>
|
| | | <if test="extraInfoStr != null">extraInfo,</if>
|
| | | </trim>
|
| | | values
|
| | | <trim prefix="(" suffix=")" suffixOverrides=",">
|
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if>
|
| | | <if test="adminUser != null">#{adminUser.id,jdbcType=BIGINT},</if>
|
| | | <if test="extract != null">#{extract.id,jdbcType=BIGINT},</if>
|
| | | <if test="beforeMoney != null">#{beforeMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="afterMoney != null">#{afterMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="countMoney != null">#{countMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="countNum != null">#{countNum,jdbcType=BIGINT},</if>
|
| | | <if test="orderNum != null">#{orderNum,jdbcType=BIGINT},</if>
|
| | | <if test="cancelOrderNum != null">#{cancelOrderNum,jdbcType=BIGINT},</if>
|
| | | <if test="auditTime != null">#{auditTime,jdbcType=BIGINT},</if>
|
| | | <if test="auditRole != null">#{auditRole,jdbcType=VARCHAR},</if>
|
| | | <if test="extraInfoStr != null">#{extraInfoStr,jdbcType=VARCHAR},</if>
|
| | | </trim>
|
| | | </insert>
|
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord">
|
| | | update
|
| | | yeshi_ec_extract_audit_record set aid =
|
| | | #{adminUser.id,jdbcType=BIGINT},
|
| | | extractId =
|
| | | #{extract.id,jdbcType=BIGINT},beforeMoney =
|
| | | #{beforeMoney,jdbcType=DECIMAL},
|
| | | afterMoney =
|
| | | #{afterMoney,jdbcType=DECIMAL},countMoney =
|
| | | #{countMoney,jdbcType=DECIMAL},
|
| | | countNum =
|
| | | #{countNum,jdbcType=BIGINT},auditRole =
|
| | | #{auditRole,jdbcType=VARCHAR},
|
| | | orderNum = #{orderNum,jdbcType=BIGINT},cancelOrderNum =
|
| | | #{cancelOrderNum,jdbcType=BIGINT},
|
| | | auditTime =
|
| | | #{auditTime,jdbcType=BIGINT},
|
| | | extraInfo =
|
| | | #{extraInfoStr,jdbcType=VARCHAR} |
| | | where id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
|
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.ExtractAuditRecord">
|
| | | update yeshi_ec_extract_audit_record
|
| | | <set>
|
| | | <if test="adminUser != null">aid=#{adminUser.id,jdbcType=BIGINT},</if>
|
| | | <if test="extract != null">extractId=#{extract.id,jdbcType=BIGINT},</if>
|
| | | <if test="beforeMoney != null">beforeMoney=#{beforeMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="afterMoney != null">afterMoney=#{afterMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="countMoney != null">countMoney=#{countMoney,jdbcType=DECIMAL},</if>
|
| | | <if test="countNum != null">countNum=#{countNum,jdbcType=BIGINT},</if>
|
| | | <if test="orderNum != null">orderNum=#{orderNum,jdbcType=BIGINT},</if>
|
| | | <if test="cancelOrderNum != null">cancelOrderNum=#{cancelOrderNum,jdbcType=BIGINT},</if>
|
| | | <if test="auditTime != null">auditTime=#{auditTime,jdbcType=BIGINT},</if>
|
| | | <if test="auditRole != null">auditRole=#{auditRole,jdbcType=VARCHAR},</if>
|
| | | <if test="extraInfoStr != null">extraInfo=#{extraInfoStr,jdbcType=VARCHAR},</if>
|
| | | </set>
|
| | | where id = #{id,jdbcType=BIGINT}
|
| | | </update>
|
| | |
|
| | | <select id="getListbyExtractId" resultMap="BaseResultMap">
|
| | | <!-- 查询最近一次提现记录 -->
|
| | | SELECT * FROM yeshi_ec_extract_audit_record ear
|
| | | WHERE ear.`extractId` =
|
| | | #{extractId,jdbcType=BIGINT}
|
| | | and auditTime is not null and auditTime >
|
| | | 0 ORDER BY ear.`auditTime`
|
| | | </select>
|
| | |
|
| | | <select id="getbyExtractId" resultMap="BaseResultMap">
|
| | | <!-- 查询提现时已记录信息 -->
|
| | | SELECT * FROM yeshi_ec_extract_audit_record ear
|
| | | WHERE ear.`extractId` =
|
| | | #{extractId,jdbcType=BIGINT}
|
| | | and (auditTime is null or auditTime = 0)
|
| | | ORDER BY ear.`auditTime` desc
|
| | | </select>
|
| | |
|
| | | <select id="getList" resultMap="BaseResultMap">
|
| | |
|
| | | SELECT * FROM yeshi_ec_extract_audit_record ar
|
| | | LEFT JOIN
|
| | | yeshi_ec_extract ex ON ar.extractId=ex.id
|
| | | WHERE |
| | | <![CDATA[
|
| | | auditTime is not null and auditTime > 0 AND
|
| | | FROM_UNIXTIME(ex.extractTime/1000) >= #{startTime}
|
| | | AND FROM_UNIXTIME(ex.extractTime/1000) <= #{endTime} |
| | | ]]>
|
| | | <if test='key != null and key != ""'>
|
| | | AND (ex.uid like '%${key}%' OR ar.aid like '%${key}%')
|
| | | </if>
|
| | | ORDER BY ex.extractTime DESC LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="getCount" resultType="java.lang.Integer">
|
| | | SELECT count(ar.id) FROM yeshi_ec_extract_audit_record ar
|
| | | LEFT JOIN
|
| | | yeshi_ec_extract ex ON ar.extractId=ex.id
|
| | | WHERE
|
| | | <![CDATA[
|
| | | auditTime is not null and auditTime > 0 AND
|
| | | FROM_UNIXTIME(ex.`extractTime`/1000) >= #{startTime}
|
| | | AND FROM_UNIXTIME(ex.`extractTime`/1000) <= #{endTime} |
| | | ]]>
|
| | | <if test='key != null and key != ""'>
|
| | | AND (ex.uid like '%${key}%' OR ar.aid like '%${key}%')
|
| | | </if>
|
| | | </select>
|
| | |
|
| | |
|
| | | <select id="getMyAuditedAllList" resultMap="BaseResultMap">
|
| | |
|
| | | SELECT * FROM yeshi_ec_extract_audit_record ar
|
| | | LEFT JOIN
|
| | | yeshi_ec_extract ex ON ar.extractId=ex.id
|
| | | WHERE ar.aid = ${adminId}
|
| | | <if test='key != null and key != ""'>
|
| | | AND ex.uid like '%${key}%'
|
| | | </if>
|
| | | <if test='state != null'>
|
| | | AND ex.state = #{state}
|
| | | </if>
|
| | | ORDER BY ex.extractTime DESC LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="getMyAuditedAllCount" resultType="java.lang.Integer">
|
| | |
|
| | | SELECT count(ar.id) FROM yeshi_ec_extract_audit_record ar
|
| | | LEFT JOIN
|
| | | yeshi_ec_extract ex ON ar.extractId=ex.id
|
| | | WHERE ar.aid = ${adminId}
|
| | | <if test='key != null and key != ""'>
|
| | | AND ex.uid like '%${key}%'
|
| | | </if>
|
| | | <if test='state != null'>
|
| | | AND ex.state = #{state}
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="getMyAuditedTimeSlotList" resultMap="BaseResultMap">
|
| | | SELECT ar.*,(CASE WHEN ex.state = 2 THEN 1 WHEN ex.state =1 THEN 1
|
| | | ELSE 0 END) AS stateOrde FROM yeshi_ec_extract_audit_record ar
|
| | | LEFT
|
| | | JOIN yeshi_ec_extract ex ON ar.extractId=ex.id
|
| | | WHERE <![CDATA[1>0]]>
|
| | | <if test="adminId != null">
|
| | | AND ar.aid = ${adminId}
|
| | | </if>
|
| | |
|
| | | <if test='key != null and key != ""'>
|
| | | AND ex.uid like '%${key}%'
|
| | | </if>
|
| | |
|
| | | <if test="days != null">
|
| | | <![CDATA[ AND DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(ex.extractTime/1000) ]]>
|
| | | </if>
|
| | |
|
| | | <if test='state != null'>
|
| | | AND ex.state = #{state}
|
| | | </if>
|
| | | ORDER BY stateOrde,ex.`extractTime` DESC LIMIT ${start},${count}
|
| | |
|
| | | </select>
|
| | |
|
| | | <select id="getMyAuditedTimeSlotCount" resultType="java.lang.Integer">
|
| | | SELECT count(ar.id) FROM yeshi_ec_extract_audit_record ar
|
| | | LEFT JOIN
|
| | | yeshi_ec_extract ex ON ar.extractId=ex.id
|
| | | WHERE <![CDATA[1>0]]>
|
| | | <if test="adminId != null">
|
| | | AND ar.aid = ${adminId}
|
| | | </if>
|
| | |
|
| | | <if test='key != null and key != ""'>
|
| | | AND ex.uid like '%${key}%'
|
| | | </if>
|
| | |
|
| | | <if test="days != null">
|
| | | <![CDATA[ AND DATE_SUB(CURDATE(), INTERVAL ${days} DAY) <= FROM_UNIXTIME(ex.extractTime/1000) ]]>
|
| | | </if>
|
| | |
|
| | | <if test='state != null'>
|
| | | AND ex.state = #{state}
|
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="getMyAuditedCountWeek" resultType="java.lang.Integer">
|
| | | SELECT COUNT(id) FROM yeshi_ec_extract_audit_record WHERE aid =
|
| | | ${adminId} |
| | | <![CDATA[
|
| | | AND YEARWEEK(DATE_FORMAT(FROM_UNIXTIME(auditTime/1000),'%Y-%m-%d')) = YEARWEEK(NOW());
|
| | | ]]>
|
| | | </select>
|
| | |
|
| | | <select id="getMyAuditedCountMonth" resultType="java.lang.Integer">
|
| | | SELECT COUNT(id) FROM yeshi_ec_extract_audit_record WHERE aid =
|
| | | ${adminId} |
| | | <![CDATA[
|
| | | AND DATE_FORMAT(FROM_UNIXTIME(auditTime/1000),'%Y-%m')=DATE_FORMAT(NOW(),'%Y-%m')
|
| | | ]]>
|
| | | </select>
|
| | |
|
| | | <select id="getMyAuditedCountToday" resultType="java.lang.Integer">
|
| | | SELECT COUNT(id) FROM yeshi_ec_extract_audit_record WHERE aid =
|
| | | ${adminId} |
| | | <![CDATA[
|
| | | AND TO_DAYS(FROM_UNIXTIME(auditTime/1000)) = TO_DAYS(NOW())
|
| | | ]]>
|
| | | </select>
|
| | |
|
| | | <!-- 查询历史提现申请记录 -->
|
| | | <select id="getByUidList" resultMap="BaseResultMap">
|
| | | SELECT * FROM yeshi_ec_extract_audit_record ar
|
| | | LEFT JOIN
|
| | | yeshi_ec_extract ex ON ar.extractId=ex.id
|
| | | WHERE ex.uid = ${uid} |
| | | <![CDATA[and ar.auditTime > 0 and ar.auditTime is not null ]]>
|
| | | ORDER BY ex.extractTime DESC LIMIT ${start},${count}
|
| | | </select>
|
| | |
|
| | | <select id="getByUidCount" resultType="java.lang.Integer">
|
| | | SELECT COUNT(ar.id) FROM yeshi_ec_extract_audit_record ar
|
| | | LEFT JOIN
|
| | | yeshi_ec_extract ex ON ar.extractId=ex.id
|
| | | WHERE ex.uid = ${uid} <![CDATA[and ar.auditTime > 0 and ar.auditTime is not null ]]>
|
| | | </select>
|
| | |
|
| | |
|
| | |
|
| | | <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>
|
| | |
|
| | | <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>
|
| | |
|
| | | <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>
|
| | |
|
| | | </mapper>
|
| | |
| | | <result column="uie_gold_coin" property="goldCoin" jdbcType="INTEGER" />
|
| | | </resultMap>
|
| | |
|
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">id,identifycode,login_type,wx_open_id,wx_union_id,nick_name,tbName,tbPic,wxName,wxPic,portrait,createtime,last_logintime,loginip,tuiguang_code,appid,my_hongBao,pay_password,sid,rank,phone,state,state_desc
|
| | | </sql>
|
| | | <!-- 不能查询缓存 -->
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="countNewUserByDate" resultType="java.util.HashMap">
|
| | | <select id="countNewUserByDate" resultMap="ChartMap">
|
| | | SELECT COUNT(DISTINCT h.`id`) AS showValue,
|
| | | <if test="type == 1">
|
| | | FROM_UNIXTIME(h.`createtime`/1000,'%Y-%m-%d') AS
|
| | |
| | | ORDER BY h.`createtime`
|
| | | </select>
|
| | |
|
| | | <select id="getTodayHasOrder" resultType="java.util.HashMap">
|
| | | <select id="getTodayHasOrder" resultMap="ChartMap">
|
| | | SELECT COALESCE(COUNT(DISTINCT u.`id`),0) AS 'showValue',
|
| | | <if test="type == 1">
|
| | | FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS
|
| | |
| | |
|
| | |
|
| | |
|
| | | <select id="getWeekHasOrder" resultType="java.util.HashMap">
|
| | | <select id="getWeekHasOrder" resultMap="ChartMap">
|
| | | SELECT COUNT(DISTINCT hb.uid) AS
|
| | | showValue,FROM_UNIXTIME(u.`createtime`/1000,'%Y-%m-%d') AS 'showDate'
|
| | | FROM (SELECT COUNT(v2.`hb_id`) AS num,v2.hb_uid AS uid
|
| | |
| | | <id column="hb_pid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Column_DateType"> |
| | |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="countHongBaoMoney" resultType="java.util.HashMap"> |
| | | <select id="countHongBaoMoney" resultMap="ChartMap"> |
| | | SELECT CAST(SUM(t.`hb_money`)AS DECIMAL(19,2)) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | |
| | | ORDER BY t.`hb_create_time` |
| | | </select> |
| | | |
| | | <select id="countHongBaoNum" resultType="java.util.HashMap"> |
| | | <select id="countHongBaoNum" resultMap="ChartMap"> |
| | | SELECT COUNT(t.`hb_id`)AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <select id="countHongBaoType" resultType="java.util.HashMap"> |
| | | <select id="countHongBaoType" resultMap="ChartMap"> |
| | | SELECT COUNT(t.`hb_id`)AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | |
| | | ORDER BY t.`hb_create_time` |
| | | </select> |
| | | |
| | | <select id="countHongBaoTotalNum" resultType="java.util.HashMap"> |
| | | <select id="countHongBaoTotalNum" resultMap="ChartMap"> |
| | | SELECT COUNT(t.`hb_id`)AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_hongbao_v2 t |
| | |
| | | </select> |
| | | |
| | | |
| | | <select id="count24HOderByChannel" resultType="java.util.HashMap"> |
| | | <select id="count24HOderByChannel" resultMap="ChartMap"> |
| | | SELECT <!-- COALESCE(SUM(b.money*2),0) AS 'commision', --> |
| | | COALESCE(COUNT(b.hb_id),0) AS 'showValue', |
| | | <!-- COALESCE(SUM(b.payMoney),0) AS 'payMoney', --> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.jd.JDGoodsClassMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.jd.JDGoodsClass"> |
| | | <id column="cjd_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="cjd_cid" property="cid" jdbcType="INTEGER"/> |
| | | <result column="cjd_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="cjd_level" property="level" jdbcType="INTEGER"/> |
| | | <result column="cjd_super_id" property="superId" jdbcType="INTEGER"/> |
| | | <result column="cjp_self_comm" property="selfComm" jdbcType="DECIMAL"/> |
| | | <result column="cjp_pop_comm" property="popComm" jdbcType="DECIMAL"/> |
| | | <result column="cjd_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="cjd_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">cjd_id,cjd_cid,cjd_name,cjd_level,cjd_super_id,cjp_self_comm,cjp_pop_comm,cjd_create_time,cjd_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_class_jd where cjd_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_class_jd where cjd_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.jd.JDGoodsClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_class_jd (cjd_id,cjd_cid,cjd_name,cjd_level,cjd_super_id,cjp_self_comm,cjp_pop_comm,cjd_create_time,cjd_update_time) values (#{id,jdbcType=BIGINT},#{cid,jdbcType=INTEGER},#{name,jdbcType=VARCHAR},#{level,jdbcType=INTEGER},#{superId,jdbcType=INTEGER},#{selfComm,jdbcType=DECIMAL},#{popComm,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.jd.JDGoodsClass" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_class_jd |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">cjd_id,</if> |
| | | <if test="cid != null">cjd_cid,</if> |
| | | <if test="name != null">cjd_name,</if> |
| | | <if test="level != null">cjd_level,</if> |
| | | <if test="superId != null">cjd_super_id,</if> |
| | | <if test="selfComm != null">cjp_self_comm,</if> |
| | | <if test="popComm != null">cjp_pop_comm,</if> |
| | | <if test="createTime != null">cjd_create_time,</if> |
| | | <if test="updateTime != null">cjd_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="cid != null">#{cid,jdbcType=INTEGER},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="level != null">#{level,jdbcType=INTEGER},</if> |
| | | <if test="superId != null">#{superId,jdbcType=INTEGER},</if> |
| | | <if test="selfComm != null">#{selfComm,jdbcType=DECIMAL},</if> |
| | | <if test="popComm != null">#{popComm,jdbcType=DECIMAL},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.jd.JDGoodsClass">update yeshi_ec_class_jd set cjd_cid = #{cid,jdbcType=INTEGER},cjd_name = #{name,jdbcType=VARCHAR},cjd_level = #{level,jdbcType=INTEGER},cjd_super_id = #{superId,jdbcType=INTEGER},cjp_self_comm = #{selfComm,jdbcType=DECIMAL},cjp_pop_comm = #{popComm,jdbcType=DECIMAL},cjd_create_time = #{createTime,jdbcType=TIMESTAMP},cjd_update_time = #{updateTime,jdbcType=TIMESTAMP} where cjd_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.jd.JDGoodsClass">update yeshi_ec_class_jd |
| | | <set> |
| | | <if test="cid != null">cjd_cid=#{cid,jdbcType=INTEGER},</if> |
| | | <if test="name != null">cjd_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="level != null">cjd_level=#{level,jdbcType=INTEGER},</if> |
| | | <if test="superId != null">cjd_super_id=#{superId,jdbcType=INTEGER},</if> |
| | | <if test="selfComm != null">cjp_self_comm=#{selfComm,jdbcType=DECIMAL},</if> |
| | | <if test="popComm != null">cjp_pop_comm=#{popComm,jdbcType=DECIMAL},</if> |
| | | <if test="createTime != null">cjd_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">cjd_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where cjd_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteByDate"> |
| | | DELETE FROM yeshi_ec_class_jd |
| | | WHERE cjd_level = #{level} AND cjd_create_time <![CDATA[<]]>#{date} |
| | | </delete> |
| | | |
| | | |
| | | <select id="getByLevel" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_class_jd d |
| | | WHERE d.`cjd_level`= #{level} |
| | | </select> |
| | | |
| | | <select id="getByPid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_class_jd d |
| | | WHERE d.`cjd_super_id`= #{pid} |
| | | </select> |
| | | |
| | | |
| | | <select id="getByCid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_class_jd d |
| | | WHERE d.`cjd_level` = #{level} AND d.`cjd_cid` = #{cid} |
| | | ORDER BY d.`cjd_create_time` DESC |
| | | LIMIT 1 |
| | | </select> |
| | | </mapper> |
| | |
| | | jdbcType="TIMESTAMP" /> |
| | | <result column="joi_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">joi_id,joi_order_id,joi_actual_cos_price,joi_actual_fee,joi_commission_rate,joi_estimate_cos_price,joi_estimate_fee,joi_final_rate,joi_cid1,joi_frozen_sku_num,joi_pid,joi_position_id,joi_price,joi_cid2,joi_site_id,joi_sku_id,joi_sku_name,joi_sku_num,joi_sku_return_num,joi_sub_side_rate,joi_sub_sidy_rate,joi_cid3,joi_union_alias,joi_union_tag,joi_union_traffic_group,joi_valid_code,joi_sub_union_id,joi_trace_type,joi_pay_month,joi_pop_id,joi_ext1,joi_trade_id,joi_create_time,joi_update_time,joi_order_by |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | |
| | | </sql> |
| | | |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | <select id="countOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(`joi_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM `yeshi_ec_jd_order_item` left join yeshi_ec_jd_order on jo_order_id=joi_order_id WHERE jo_order_time IS NOT NULL and joi_valid_code!=2 |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.money.UserBalanceMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.money.UserBalance"> |
| | | <id column="ub_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="ub_uid" property="uid" jdbcType="BIGINT"/> |
| | | <result column="ub_money" property="money" jdbcType="DECIMAL"/> |
| | | <result column="ub_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="ub_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">ub_id,ub_uid,ub_money,ub_create_time,ub_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_user_balance where ub_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_user_balance where ub_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.money.UserBalance" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_balance (ub_id,ub_uid,ub_money,ub_create_time,ub_update_time) values (#{id,jdbcType=BIGINT},#{uid,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.money.UserBalance" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_user_balance |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">ub_id,</if> |
| | | <if test="uid != null">ub_uid,</if> |
| | | <if test="money != null">ub_money,</if> |
| | | <if test="createTime != null">ub_create_time,</if> |
| | | <if test="updateTime != null">ub_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="uid != null">#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">#{money,jdbcType=DECIMAL},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.money.UserBalance">update yeshi_ec_user_balance set ub_uid = #{uid,jdbcType=BIGINT},ub_money = #{money,jdbcType=DECIMAL},ub_create_time = #{createTime,jdbcType=TIMESTAMP},ub_update_time = #{updateTime,jdbcType=TIMESTAMP} where ub_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.money.UserBalance">update yeshi_ec_user_balance |
| | | <set> |
| | | <if test="uid != null">ub_uid=#{uid,jdbcType=BIGINT},</if> |
| | | <if test="money != null">ub_money=#{money,jdbcType=DECIMAL},</if> |
| | | <if test="createTime != null">ub_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">ub_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where ub_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <select id="getByUid" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_user_balance |
| | | WHERE ub_uid = #{uid,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.order.CommonOrderCountMapper"> |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Column_DateType"> |
| | | <if test="dateType == 1"> |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | <select id="countOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(t.`co_id`),0) AS showValue,<include refid="Column_DateType"/> |
| | | FROM `yeshi_ec_common_order` t |
| | | WHERE t.co_source_type=#{sourceType} and t.`co_third_create_time` IS NOT NULL <include refid="Count_Select_DateType"/> |
| | |
| | | <association property="order" column="oid"
|
| | | select="com.yeshi.fanli.dao.mybatis.order.OrderMapper.selectByPrimaryKey" />
|
| | | </resultMap>
|
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
|
| | | yeshi_ec_lost_order where id = #{id,jdbcType=BIGINT}
|
| | | </delete>
|
| | |
| | | <if test="handleType != null and handleType != 0">AND (d.state = 1 or d.state = 2)</if>
|
| | | <if test="type != null">AND d.type = #{type}</if>
|
| | | </select>
|
| | | <select id="countLostNum" resultType="java.util.HashMap">
|
| | | <select id="countLostNum" resultMap="ChartMap">
|
| | | SELECT COUNT(t.`id`) AS showValue,
|
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | |
| | | <if test="dateType == 3">GROUP BY FROM_UNIXTIME(t.`createTime`/1000,'%Y')</if>
|
| | | ORDER BY t.`createTime`
|
| | | </select>
|
| | | <select id="countAppealMoney" resultType="java.util.HashMap">
|
| | | <select id="countAppealMoney" resultMap="ChartMap">
|
| | | SELECT CAST(SUM(v.`hb_money`)AS DECIMAL(19,2)) AS showValue,
|
| | | <if test="dateType == 1">FROM_UNIXTIME(t.`createTime`/1000,'%Y-%m-%d') AS
|
| | | 'showDate'
|
| | |
| | | <result column="po_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="po_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | <sql id="Base_Column_List">po_id,po_order_sn,po_goods_id,po_group_id,po_goods_name,po_goods_thumbnail_url,po_goods_quantity,po_goods_price,po_order_amount,po_p_id,po_promotion_rate,po_promotion_amount,po_order_status,po_order_status_desc,po_order_create_time,po_order_pay_time,po_order_group_success_time,po_order_verify_time,po_order_modify_at,po_custom_parameters,po_order_settle_time,po_order_id,po_create_time,po_update_time,po_order_receive_time |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | |
| | | |
| | | |
| | | |
| | | <select id="countOrderNumber" resultType="java.util.HashMap"> |
| | | <select id="countOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(`po_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM `yeshi_ec_pdd_order` t WHERE po_order_create_time IS NOT NULL |
| | |
| | | <result column="to_special_id" property="specialId" jdbcType="VARCHAR" />
|
| | | <result column="to_trade_id" property="tradeId" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | | |
| | | <sql id="Base_Column_List">to_id,to_create_time,to_click_time,to_pay_time,to_title,to_auction_id,to_manager_wangwang,to_shop,to_count,to_price,to_order_state,to_order_type,to_iratio,to_sratio,to_payment,to_estimate,to_settlement,to_eIncome,to_settlement_time,to_tk_rate,to_tk_money,to_technology_support_percent,to_subsidy_ratio,to_subsidy,to_subsidy_type,to_transaction_platform,to_third_service,to_order_id,to_class_name,to_source_media_id,to_source_media_name,to_ad_position_id,to_ad_position_name,to_latest_updatetime,to_orderby,to_relation_id,to_special_id,to_trade_id
|
| | | </sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | |
| | | <if test="dateType == 2">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y-%m')</if>
|
| | | <if test="dateType == 3">GROUP BY DATE_FORMAT(t.`to_create_time`,'%Y')</if>
|
| | | </sql>
|
| | | <select id="countOrderNumber" resultType="java.util.HashMap">
|
| | | <select id="countOrderNumber" resultMap="ChartMap">
|
| | | SELECT IFNULL(COUNT(t.`to_id`),0) AS showValue,
|
| | | <include refid="Column_DateType" />
|
| | | FROM `yeshi_ec_taobao_order` t WHERE t.`to_create_time` IS NOT NULL
|
| | |
| | | <result column="tmo_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="tmo_settlement" property="settlement" jdbcType="DECIMAL" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO"> |
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" /> |
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">tmo_id,tmo_order_id,tmo_order_item_id,tmo_goods_name,tmo_money,tmo_fan_money,tmo_state,tmo_jiesuan_time,tmo_weiquan_time,tmo_weiquan_finish_time,tmo_createtime,tmo_updatetime,tmo_settlement |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | |
| | | <if test="dateType == 2">GROUP BY DATE_FORMAT(t.`tmo_weiquan_time`,'%Y-%m')</if> |
| | | <if test="dateType == 3">GROUP BY DATE_FORMAT(t.`tmo_weiquan_time`,'%Y')</if> |
| | | </sql> |
| | | <select id="countWeiQaunOrderNumber" resultType="java.util.HashMap"> |
| | | <select id="countWeiQaunOrderNumber" resultMap="ChartMap"> |
| | | SELECT IFNULL(COUNT(t.`tmo_id`),0) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_taobao_weiqaun_order t WHERE t.`tmo_createtime`IS NOT |
| | |
| | | <include refid="Count_Group_DateType" /> |
| | | ORDER BY t.`tmo_weiquan_time` |
| | | </select> |
| | | <select id="countWeiQaunOrderMoney" resultType="java.util.HashMap"> |
| | | <select id="countWeiQaunOrderMoney" resultMap="ChartMap"> |
| | | SELECT CAST(SUM(t.`tmo_fan_money`)AS DECIMAL(19,2)) AS showValue, |
| | | <include refid="Column_DateType" /> |
| | | FROM yeshi_ec_taobao_weiqaun_order t WHERE t.`tmo_createtime` IS NOT |
| | |
| | |
|
| | | <association property="userSystemCoupon" column="ucr_user_coupon_id"
|
| | | resultMap="com.yeshi.fanli.dao.mybatis.user.UserSystemCouponMapper.BaseResultMap"/>
|
| | | |
| | | </resultMap>
|
| | | |
| | | <resultMap id="ChartMap" type="com.yeshi.fanli.dto.ChartTDO">
|
| | | <result column="showDate" property="showDate" jdbcType="VARCHAR" />
|
| | | <result column="showValue" property="showValue" jdbcType="VARCHAR" />
|
| | | </resultMap>
|
| | |
|
| | | <select id="listRebateCoupon" resultMap="BaseResultMap">
|
| | | SELECT * FROM `yeshi_ec_user_system_coupon` uc
|
| | |
| | | </if>
|
| | | </select>
|
| | |
|
| | | <select id="getRebateCouponUsedNumToCharts" resultType="java.util.HashMap">
|
| | | <select id="getRebateCouponUsedNumToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(COUNT(c.`usc_id`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(c.`usc_use_time`,'%Y-%m-%d') AS 'showDate'
|
| | |
| | | </select>
|
| | |
|
| | |
|
| | | <select id="getRebateCouponMoneyToCharts" resultType="java.util.HashMap">
|
| | | <select id="getRebateCouponMoneyToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(SUM(c.`hb_money`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(c.`hb_get_time`,'%Y-%m-%d') AS 'showDate'
|
| | |
| | | ORDER BY c.`hb_get_time`
|
| | | </select>
|
| | |
|
| | | <select id="getFreeCouponMoneyToCharts" resultType="java.util.HashMap">
|
| | | <select id="getFreeCouponMoneyToCharts" resultMap="ChartMap">
|
| | | SELECT IFNULL(SUM(v2.`hb_money`),0) AS showValue,
|
| | | <if test="dateType == 1">
|
| | | DATE_FORMAT(v2.`hb_get_time`,'%Y-%m-%d') AS 'showDate'
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.pdd.PDDOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderCountService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | |
|
| | |
| | | return commonOrderCountMapper.countByState(state);
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list)
|
| | | public List<ChartTDO> dayFactory(String startTime, String endTime, List<ChartTDO> list)
|
| | | throws Exception {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | if (startTime.equals(endTime)) {
|
| | |
|
| | | Map<String, Object> map = list.get(0);
|
| | | Object total = map.get("showValue");
|
| | | if (total == null) {
|
| | | map.put("showValue", 0);
|
| | | ChartTDO chartTDO = list.get(0);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | listObject.add(map);
|
| | | listObject.add(chartTDO);
|
| | | return listObject;
|
| | | }
|
| | |
|
| | |
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | if (plusDay.equalsIgnoreCase(month)) {
|
| | | total = map.get("showValue");
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | if (plusDay.equalsIgnoreCase(showDate)) {
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | mapObject.put("showDate", plusDay);
|
| | |
|
| | | listObject.add(mapObject);
|
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowDate(plusDay);
|
| | | chartTDO.setShowValue(total);
|
| | | listObject.add(chartTDO);
|
| | |
|
| | | if (plusDay.equals(endTime)) {
|
| | | break; // 时间结束
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> monthFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | public List<ChartTDO> monthFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | // 12 个月处理
|
| | | for (int i = 1; i <= 12; i++) {
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String month =chartTDO.getShowDate();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | |
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowValue(total);
|
| | | if (i < 10) {
|
| | | mapObject.put("showDate", "0" + i);
|
| | | chartTDO.setShowDate("0" + i);
|
| | | } else {
|
| | | mapObject.put("showDate", i);
|
| | | chartTDO.setShowDate(i + "");
|
| | | }
|
| | |
|
| | | listObject.add(mapObject);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> yearFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | public List<ChartTDO> yearFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object total = map.get("showValue");
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | ChartTDO chartTDO = list.get(i);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | map.put("showValue", total);
|
| | |
|
| | | listObject.add(map);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getTrackAccuracyRate(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime,
|
| | | String endTime, int sourceType) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> result_list = null;
|
| | | List<ChartTDO> result_list = null;
|
| | |
|
| | | // 用户订单
|
| | | List<Map<String, Object>> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year, startTime,
|
| | | List<ChartTDO> listTotal = commonOrderCountMapper.countOrderNumber(dateType, year, startTime,
|
| | | endTime, sourceType);
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | // 淘宝联盟
|
| | | List<Map<String, Object>> type_list = null;
|
| | | List<ChartTDO> type_list = null;
|
| | | switch (sourceType) {
|
| | | case Constant.SOURCE_TYPE_TAOBAO:
|
| | | type_list = taoBaoOrderMapper.countOrderNumber(dateType, year, startTime, endTime);
|
| | |
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | |
|
| | | double proportion = 0;
|
| | | Map<String, Object> resultMap = result_list.get(i);
|
| | |
|
| | | Object showDate = resultMap.get("showDate");
|
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listTotal.size(); j++) {
|
| | | Map<String, Object> innerMap = listTotal.get(j);
|
| | | Object innerDate = innerMap.get("showDate");
|
| | |
|
| | | ChartTDO innerChartTDO = listTotal.get(j);
|
| | | String innerDate = innerChartTDO.getShowDate();
|
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | | Object innerValue = innerMap.get("showValue");
|
| | | long innerData = Long.parseLong(innerValue.toString());
|
| | | String innerValue = innerChartTDO.getShowValue();
|
| | | long innerData = Long.parseLong(innerValue);
|
| | |
|
| | | Object showValue = resultMap.get("showValue");
|
| | | long showData = Long.parseLong(showValue.toString());
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | |
|
| | | if (showData > 0) {
|
| | | proportion = innerData / (double) showData;
|
| | | }
|
| | |
|
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | |
|
| | | resultMap.put("showValue", Double.parseDouble(df.format(proportion * 100)));
|
| | | chartTDO.setShowValue(Double.parseDouble(df.format(proportion * 100)) + "");
|
| | | }
|
| | |
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return taoBaoWeiQuanOrderMapper.countWeiQaunOrderMoney(dateType, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countWeiQaunOrderNumber(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> countWeiQaunOrderNumber(Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return taoBaoWeiQuanOrderMapper.countWeiQaunOrderNumber(dateType, year, startTime, endTime);
|
| | | }
|
| | |
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import com.yeshi.fanli.dao.mybatis.order.OrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoWeiQuanOrderMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
|
| | | import com.yeshi.fanli.service.inter.order.CommonOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | |
| | | @Resource
|
| | | private TaoBaoWeiQuanOrderMapper taoBaoWeiQuanOrderMapper;
|
| | |
|
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list)
|
| | | public List<ChartTDO> dayFactory(String startTime, String endTime, List<ChartTDO> list)
|
| | | throws Exception {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | |
|
| | | if (startTime.equals(endTime)) {
|
| | |
|
| | | Map<String, Object> map = list.get(0);
|
| | | Object total = map.get("showValue");
|
| | | ChartTDO chartTDO = list.get(0);
|
| | | String total = chartTDO.getShowValue();
|
| | | if (total == null) {
|
| | | map.put("showValue", 0);
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | listObject.add(map);
|
| | | listObject.add(chartTDO);
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | String plusDay = "";
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd");
|
| | | for (int i = 0; i < 1000; i++) {
|
| | | if (i == 0) {
|
| | | plusDay = startTime;
|
| | |
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | ChartTDO chart = new ChartTDO();
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String createDate = chartTDO.getShowDate();
|
| | | String month = createDate.toString();
|
| | | if (plusDay.equalsIgnoreCase(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy/MM/dd");
|
| | | chart.setShowValue(total);
|
| | | Date parseDate = sdf.parse(plusDay.toString());
|
| | |
|
| | | mapObject.put("showDate", sdf2.format(parseDate));
|
| | |
|
| | | listObject.add(mapObject);
|
| | | chart.setShowDate(sdf2.format(parseDate));
|
| | | listObject.add(chart);
|
| | |
|
| | | if (plusDay.equals(endTime)) {
|
| | | break; // 时间结束
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> monthFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | public List<ChartTDO> monthFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | // 12 个月处理
|
| | | for (int i = 1; i <= 12; i++) {
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | |
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String createDate = chartTDO.getShowDate();
|
| | | String month = createDate.toString();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | mapObject.put("showDate", i + "月");
|
| | |
|
| | | |
| | | ChartTDO mapObject = new ChartTDO();
|
| | | mapObject.setShowValue(total);
|
| | | mapObject.setShowDate(i + "月");
|
| | | listObject.add(mapObject);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> yearFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | public List<ChartTDO> yearFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object total = map.get("showValue");
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | ChartTDO chartTDO = list.get(i);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | showValue = "0";
|
| | | }
|
| | | map.put("showValue", total);
|
| | |
|
| | | listObject.add(map);
|
| | | chartTDO.setShowValue(showValue);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | public List<ChartTDO> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoMoney(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | public List<ChartTDO> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoNum(channel, dateType, state, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | public List<ChartTDO> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | public List<ChartTDO> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> result_list = null;
|
| | | List<ChartTDO> result_list = null;
|
| | |
|
| | | List<Map<String, Object>> listTotal = hongBaoV2CountMapper.countHongBaoTotalNum(dateType, year, startTime,
|
| | | List<ChartTDO> listTotal = hongBaoV2CountMapper.countHongBaoTotalNum(dateType, year, startTime,
|
| | | endTime);
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> type_list = hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime,
|
| | | List<ChartTDO> type_list = hongBaoV2CountMapper.countHongBaoType(dateType, type, year, startTime,
|
| | | endTime);
|
| | |
|
| | | if (type_list == null || type_list.size() == 0) {
|
| | |
| | | }
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | |
|
| | | float proportion = 0;
|
| | | Map<String, Object> resultMap = result_list.get(i);
|
| | |
|
| | | Object showDate = resultMap.get("showDate");
|
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listTotal.size(); j++) {
|
| | | Map<String, Object> innerMap = result_list.get(j);
|
| | | Object innerDate = innerMap.get("showDate");
|
| | |
|
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | | Object innerValue = innerMap.get("showValue");
|
| | | long innerData = Long.parseLong(innerValue.toString());
|
| | |
|
| | | Object showValue = resultMap.get("showValue");
|
| | | long showData = Long.parseLong(showValue.toString());
|
| | |
|
| | | ChartTDO innerChart = result_list.get(j);
|
| | | String innerDate = innerChart.getShowDate();
|
| | | if (innerDate != null && innerDate.equals(showDate)) {
|
| | | String innerValue = innerChart.getShowValue();
|
| | | long innerData = Long.parseLong(innerValue);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | | if (showData > 0) {
|
| | | proportion = innerData / showData;
|
| | | }
|
| | |
|
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | |
|
| | | resultMap.put("showValue", proportion);
|
| | | chartTDO.setShowValue(proportion+"");
|
| | | }
|
| | |
|
| | | return result_list;
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return hongBaoV2CountMapper.count24HOderByChannel(channel, type, years, startTime, endTime);
|
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.text.DecimalFormat;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | |
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoCountMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.UserInfoMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.service.inter.count.UserInfoCountService;
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countNewUserByDate(String channel,Integer type,String years, String startTime, |
| | | public List<ChartTDO> countNewUserByDate(String channel,Integer type,String years, String startTime, |
| | | String endTime) throws Exception {
|
| | | return userInfoMapper.countNewUserByDate(channel, type, years, startTime, endTime);
|
| | |
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getTodayBuyRate(String channel, Integer dateType,String years, String startTime, |
| | | public List<ChartTDO> getTodayBuyRate(String channel, Integer dateType,String years, String startTime, |
| | | String endTime) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> result_list = null;
|
| | | List<ChartTDO> result_list = null;
|
| | |
|
| | | List<Map<String, Object>> listToday = |
| | | List<ChartTDO> listToday = |
| | | userInfoMapper.getTodayHasOrder(channel, dateType, years, startTime, endTime);
|
| | |
|
| | | if (listToday == null || listToday.size() == 0) {
|
| | | return result_list;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> listTotal = |
| | | userInfoMapper.countNewUserByDate(channel, dateType, years, startTime, endTime);
|
| | | List<ChartTDO> listTotal = userInfoMapper.countNewUserByDate(channel, dateType, years, startTime, endTime);
|
| | |
|
| | | if (listTotal == null || listTotal.size() == 0) {
|
| | | return result_list;
|
| | |
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | |
|
| | | for (int i = 0; i < result_list.size(); i++) {
|
| | | |
| | | double proportion = 0;
|
| | | Map<String, Object> resultMap = result_list.get(i);
|
| | | Object showDate = resultMap.get("showDate");
|
| | | |
| | | ChartTDO chartTDO = result_list.get(i);
|
| | | String showDate = chartTDO.getShowDate();
|
| | | for (int j = 0; j < listToday.size(); j++) {
|
| | | |
| | | Map<String, Object> innerMap = listToday.get(j);
|
| | | Object innerDate = innerMap.get("showDate");
|
| | | |
| | | if (innerDate != null && innerDate.toString().equals(showDate.toString())) {
|
| | | Object innerValue = innerMap.get("showValue");
|
| | | long innerData = Long.parseLong(innerValue.toString());
|
| | | ChartTDO innerTDO = listToday.get(j);
|
| | | String innerDate = innerTDO.getShowDate();
|
| | | if (innerDate != null && innerDate.equals(showDate)) {
|
| | | String innerValue = innerTDO.getShowValue();
|
| | | long innerData = Long.parseLong(innerValue);
|
| | |
|
| | | Object showValue = resultMap.get("showValue");
|
| | | long showData = Long.parseLong(showValue.toString());
|
| | | String showValue = chartTDO.getShowValue();
|
| | | long showData = Long.parseLong(showValue);
|
| | |
|
| | | if (showData > 0) {
|
| | | proportion = innerData/(double)showData;
|
| | | }
|
| | | |
| | | break; // 结束内部循环
|
| | | }
|
| | | }
|
| | | |
| | | resultMap.put("showValue", Double.parseDouble(df.format(proportion *100)));
|
| | | chartTDO.setShowValue(Double.parseDouble(df.format(proportion *100)) + "");
|
| | | }
|
| | | |
| | | return result_list;
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<Object> getWeekBuyRate(String channel, String startTime, String endTime,
|
| | | Integer orderNum, List<String> dateList)
|
| | | throws Exception {
|
| | |
|
| | | Integer orderNum, List<String> dateList) throws Exception {
|
| | | List<Object> resultList = new ArrayList<Object>();
|
| | |
|
| | | if (dateList == null || dateList.size() == 0) {
|
| | | return resultList;
|
| | | }
|
| | |
|
| | | List<Map<String, Object>> totalList = userInfoMapper.countNewUserByDate(channel, 1, null, startTime, endTime);
|
| | | List<ChartTDO> totalList = userInfoMapper.countNewUserByDate(channel, 1, null, startTime, endTime);
|
| | | if (totalList == null || totalList.size() == 0) {
|
| | | return resultList;
|
| | | }
|
| | |
| | | DecimalFormat df = new DecimalFormat("#.00");
|
| | | for (int i = 0; i < dateList.size(); i++) {
|
| | | double proportion = 0;
|
| | |
|
| | | String showDate = dateList.get(i);
|
| | | String plusDay = DateUtil.plusDay(7, showDate);
|
| | | Map<String, Object> map = userInfoMapper.getWeekHasOrder(channel, showDate, plusDay, orderNum);
|
| | | ChartTDO chartTDO = userInfoMapper.getWeekHasOrder(channel, showDate, plusDay, orderNum);
|
| | |
|
| | | Object showValue = null;
|
| | | if (map != null) {
|
| | | showValue = map.get("showValue");
|
| | |
|
| | | String showValue = null;
|
| | | if (chartTDO != null) {
|
| | | showValue = chartTDO.getShowValue();
|
| | | if (showValue != null) {
|
| | | for (int j = 0; j < totalList.size(); j++) {
|
| | | Map<String, Object> mapTotal = totalList.get(j);
|
| | | String reslutTime = mapTotal.get("showDate").toString();
|
| | | ChartTDO chart = totalList.get(j);
|
| | | String reslutTime = chart.getShowDate();
|
| | | if (showDate.equalsIgnoreCase(reslutTime)) {
|
| | | Object totalObject = mapTotal.get("showValue");
|
| | |
|
| | | long hasCount = Long.parseLong(showValue.toString());
|
| | | long total = Long.parseLong(totalObject.toString());
|
| | | String totalObject = chart.getShowValue();
|
| | | long hasCount = Long.parseLong(showValue);
|
| | | long total = Long.parseLong(totalObject);
|
| | |
|
| | | if (total > 0) {
|
| | | proportion = hasCount / (double) total;
|
| | |
| | | return resultList;
|
| | | }
|
| | |
|
| | | |
| | | public List<Map<String, Object>> dayFactory(String startTime, String endTime, List<Map<String, Object>> list) throws Exception {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | public List<ChartTDO> dayFactory(String startTime, String endTime, List<ChartTDO> list) throws Exception {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | if (startTime.equals(endTime)) {
|
| | |
|
| | | Map<String, Object> map = list.get(0);
|
| | | Object total = map.get("showValue");
|
| | | if (total == null) {
|
| | | map.put("showValue", 0);
|
| | | ChartTDO chartTDO = list.get(0);
|
| | | String showValue = chartTDO.getShowValue();
|
| | | if (showValue == null) {
|
| | | chartTDO.setShowValue("0");
|
| | | }
|
| | | listObject.add(map);
|
| | | listObject.add(chartTDO);
|
| | | return listObject;
|
| | | }
|
| | |
|
| | |
| | | plusDay = DateUtil.plusDay(i, startTime);
|
| | | }
|
| | |
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | |
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String month = chartTDO.getShowDate();
|
| | | if (plusDay.equalsIgnoreCase(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | |
|
| | | mapObject.put("showDate", plusDay);
|
| | |
|
| | | listObject.add(mapObject);
|
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowValue(total);
|
| | | chartTDO.setShowDate(plusDay);
|
| | | listObject.add(chartTDO);
|
| | |
|
| | | if (plusDay.equals(endTime)) {
|
| | | break; // 时间结束
|
| | |
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> monthFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | | public List<ChartTDO> monthFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | // 12 个月处理
|
| | | for (int i = 1; i <= 12; i++) {
|
| | | Map<String, Object> mapObject = new HashMap<String, Object>();
|
| | | Object total = null;
|
| | |
|
| | | String total = null;
|
| | | for (int j = 0; j < list.size(); j++) {
|
| | | Map<String, Object> map = list.get(j);
|
| | | Object createDate = map.get("showDate");
|
| | | String month = createDate.toString();
|
| | | ChartTDO chartTDO = list.get(j);
|
| | | String month = chartTDO.getShowDate();
|
| | | if ((i + "").equalsIgnoreCase(month) || i == Integer.parseInt(month)) {
|
| | | total = map.get("showValue");
|
| | | total = chartTDO.getShowValue();
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | mapObject.put("showValue", total);
|
| | | |
| | | ChartTDO chartTDO = new ChartTDO();
|
| | | chartTDO.setShowValue(total);
|
| | |
|
| | | if (i <10) {
|
| | | mapObject.put("showDate", "0"+ i);
|
| | | chartTDO.setShowDate( "0"+ i);
|
| | | } else {
|
| | | mapObject.put("showDate", i);
|
| | | chartTDO.setShowDate( ""+ i);
|
| | | }
|
| | |
|
| | | listObject.add(mapObject);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | | return listObject;
|
| | | }
|
| | |
|
| | | public List<Map<String, Object>> yearFactory(List<Map<String, Object>> list) {
|
| | |
|
| | | List<Map<String, Object>> listObject = new ArrayList<Map<String, Object>>();
|
| | |
|
| | | public List<ChartTDO> yearFactory(List<ChartTDO> list) {
|
| | | List<ChartTDO> listObject = new ArrayList<ChartTDO>();
|
| | | for (int i = 0; i < list.size(); i++) {
|
| | | Map<String, Object> map = list.get(i);
|
| | | Object total = map.get("showValue");
|
| | |
|
| | | ChartTDO chartTDO = list.get(i);
|
| | | String total = chartTDO.getShowValue();
|
| | | if (total == null) {
|
| | | total = 0;
|
| | | total = "0";
|
| | | }
|
| | | map.put("showValue", total);
|
| | |
|
| | | listObject.add(map);
|
| | | chartTDO.setShowValue(total);
|
| | | listObject.add(chartTDO);
|
| | | }
|
| | |
|
| | | return listObject;
|
| | | }
|
| | |
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | |
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserSystemCouponCountMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
|
| | | import com.yeshi.fanli.entity.bus.user.UserSystemCouponRecord;
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getRebateCouponUsedNumToCharts(Integer dateType, String year, |
| | | public List<ChartTDO> getRebateCouponUsedNumToCharts(Integer dateType, String year, |
| | | String startTime, String endTime){
|
| | | return userSystemCouponCountMapper.getRebateCouponUsedNumToCharts(dateType, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getRebateCouponMoneyToCharts(Integer dateType, String year, |
| | | public List<ChartTDO> getRebateCouponMoneyToCharts(Integer dateType, String year, |
| | | String startTime, String endTime){
|
| | | return userSystemCouponCountMapper.getRebateCouponMoneyToCharts(dateType, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime, |
| | | public List<ChartTDO> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime, |
| | | String endTime, String couponType){
|
| | | return userSystemCouponCountMapper.getFreeCouponMoneyToCharts(dateType, year, startTime, endTime, couponType);
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.jd;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.jd.JDGoodsClassMapper;
|
| | | import com.yeshi.fanli.dto.GoodsClassDTO;
|
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass;
|
| | | import com.yeshi.fanli.service.inter.jd.JDGoodsClassService;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.jd.JDUtil;
|
| | |
|
| | | @Service
|
| | | public class JDGoodsClassServiceImpl implements JDGoodsClassService {
|
| | |
|
| | | @Resource
|
| | | private JDGoodsClassMapper jdGoodsClassMapper;
|
| | |
|
| | |
|
| | | @Override
|
| | | public void insertSelective(JDGoodsClass record) {
|
| | | jdGoodsClassMapper.insertSelective(record);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void updateByPrimaryKeySelective(JDGoodsClass record) {
|
| | | jdGoodsClassMapper.updateByPrimaryKeySelective(record);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<JDGoodsClass> getByLevel(Integer level) {
|
| | | return jdGoodsClassMapper.getByLevel(level);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public List<JDGoodsClass> getByPid(Integer pid) {
|
| | | return jdGoodsClassMapper.getByPid(pid);
|
| | | }
|
| | | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | @Override
|
| | | public void insertClass() {
|
| | | // 增加一级分类
|
| | | boolean addOneClass = addOneClass();
|
| | | if (addOneClass) {
|
| | | // 增加二级分类
|
| | | addTwoClass();
|
| | | // 增加三级分类
|
| | | addThreeClass();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 增加一级分类
|
| | | */
|
| | | @Transactional
|
| | | private boolean addOneClass() {
|
| | | Date date = new Date();
|
| | | List<GoodsClassDTO> listDTO = JDUtil.getCategoryList(1, 0);
|
| | | if (listDTO != null && listDTO.size() > 0) {
|
| | | for (GoodsClassDTO goodsClassDTO: listDTO) {
|
| | | JDGoodsClass record = new JDGoodsClass();
|
| | | record.setLevel(1);
|
| | | record.setCid(Integer.parseInt(goodsClassDTO.getId()));
|
| | | record.setName(goodsClassDTO.getName());
|
| | | record.setSuperId(0);
|
| | | record.setCreateTime(date);
|
| | | record.setUpdateTime(date);
|
| | | jdGoodsClassMapper.insertSelective(record);
|
| | | }
|
| | | jdGoodsClassMapper.deleteByDate(1, TimeUtil.getWholeTime(date.getTime()));
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 增加二级分类
|
| | | */
|
| | | @Transactional
|
| | | private void addTwoClass() {
|
| | | Date date = new Date();
|
| | | List<JDGoodsClass> list = jdGoodsClassMapper.getByLevel(1);
|
| | | for (JDGoodsClass jdGoodsClass: list) {
|
| | | Integer superId = jdGoodsClass.getCid();
|
| | | List<GoodsClassDTO> listDTO = JDUtil.getCategoryList(2, superId);
|
| | | if (listDTO != null && listDTO.size() > 0) {
|
| | | for (GoodsClassDTO goodsClassDTO: listDTO) {
|
| | | JDGoodsClass record = new JDGoodsClass();
|
| | | record.setLevel(2);
|
| | | record.setCid(Integer.parseInt(goodsClassDTO.getId()));
|
| | | record.setName(goodsClassDTO.getName());
|
| | | record.setCreateTime(date);
|
| | | record.setUpdateTime(date);
|
| | | record.setSuperId(superId);
|
| | | jdGoodsClassMapper.insertSelective(record);
|
| | | }
|
| | | }
|
| | | }
|
| | | jdGoodsClassMapper.deleteByDate(2, TimeUtil.getWholeTime(date.getTime()));
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 增加三级分类
|
| | | */
|
| | | @Transactional
|
| | | private void addThreeClass() {
|
| | | Date date = new Date();
|
| | | List<JDGoodsClass> list = jdGoodsClassMapper.getByLevel(2);
|
| | | for (JDGoodsClass jdGoodsClass: list) {
|
| | | Integer superId = jdGoodsClass.getCid();
|
| | | List<GoodsClassDTO> listDTO = JDUtil.getCategoryCommiPlus(3, superId);
|
| | | if (listDTO != null && listDTO.size() > 0) {
|
| | | for (GoodsClassDTO goodsClassDTO: listDTO) {
|
| | | JDGoodsClass record = new JDGoodsClass();
|
| | | record.setLevel(3);
|
| | | record.setCid(Integer.parseInt(goodsClassDTO.getId()));
|
| | | record.setName(goodsClassDTO.getName());
|
| | | record.setSelfComm(goodsClassDTO.getSelfComm());
|
| | | record.setPopComm(goodsClassDTO.getPopComm());
|
| | | record.setCreateTime(date);
|
| | | record.setUpdateTime(date);
|
| | | record.setSuperId(superId);
|
| | | jdGoodsClassMapper.insertSelective(record);
|
| | | }
|
| | | }
|
| | | }
|
| | | jdGoodsClassMapper.deleteByDate(3, TimeUtil.getWholeTime(date.getTime()));
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public JDGoodsClass getThreeClassByCid(Integer cid) {
|
| | | return jdGoodsClassMapper.getByCid(3, cid);
|
| | | }
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.money;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.money.UserBalanceMapper;
|
| | | import com.yeshi.fanli.entity.money.UserBalance;
|
| | | import com.yeshi.fanli.service.inter.money.UserBalanceService;
|
| | |
|
| | | @Service
|
| | | public class UserBalanceServiceImpl implements UserBalanceService {
|
| | |
|
| | | @Resource
|
| | | private UserBalanceMapper userBalanceMapper;
|
| | |
|
| | | @Override
|
| | | public UserBalance getByUid(Long uid) {
|
| | | return userBalanceMapper.getByUid(uid);
|
| | | }
|
| | |
|
| | | |
| | | }
|
| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.ExtractAuditRecordMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.dto.money.ExtractOrderStatisticDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | | import com.yeshi.fanli.service.inter.money.extract.ExtractAuditRecordService;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countAuditTotal(state, type, years, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countExtractMoney(state, type, years, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countExtractApplyNumber(Integer state, Integer type, String years,
|
| | | public List<ChartTDO> countExtractApplyNumber(Integer state, Integer type, String years,
|
| | | String startTime, String endTime) throws Exception {
|
| | | return extractAuditRecordMapper.countExtractApplyNumber(state, type, years, startTime, endTime);
|
| | | }
|
| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.order.LostOrderMapper;
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | public List<ChartTDO> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | String endTime) throws Exception {
|
| | | return lostOrderMapper.countLostNum(dateType, resultCode, year, startTime, endTime);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Map<String, Object>> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | public List<ChartTDO> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception {
|
| | | return lostOrderMapper.countAppealMoney(dateType, year, startTime, endTime);
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.DateUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.user.BindRemindDao;
|
| | | import com.yeshi.fanli.entity.bus.user.BindRemind;
|
| | | import com.yeshi.fanli.service.inter.user.BindRemindService;
|
| | |
|
| | | @Service
|
| | | public class BindRemindServiceImpl implements BindRemindService {
|
| | | |
| | | @Resource
|
| | | private BindRemindDao bindRemindDao;
|
| | | |
| | | @Override
|
| | | public boolean bindRemind(Long uid, int type){
|
| | | BindRemind bindRemind = bindRemindDao.getByUidAndType(uid, type);
|
| | | if (bindRemind == null) {
|
| | | return true;
|
| | | } |
| | | |
| | | Date date = new Date();
|
| | | Date remindTime = bindRemind.getRemindTime();
|
| | | return !DateUtil.isSameMonth(remindTime, date);
|
| | | }
|
| | | |
| | | @Override
|
| | | public void addBindPhone(Long uid){
|
| | | BindRemind bindRemind = bindRemindDao.getByUidAndType(uid, BindRemind.TYPE_PHONE);
|
| | | if (bindRemind == null) {
|
| | | bindRemind = new BindRemind();
|
| | | bindRemind.setType(BindRemind.TYPE_PHONE);
|
| | | bindRemind.setUid(uid);
|
| | | bindRemind.setRemindTime(new Date());
|
| | | bindRemindDao.save(bindRemind);
|
| | | } else {
|
| | | bindRemind.setRemindTime(new Date());
|
| | | bindRemindDao.updateInfo(bindRemind);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | import java.io.File;
|
| | | import java.io.FileWriter;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.Date;
|
| | |
| | | import org.springframework.context.annotation.Lazy;
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.msg.MsgAccountDetailFactory;
|
| | | import com.yeshi.fanli.util.wx.WXLoginUtil;
|
| | |
| | | @Lazy
|
| | | @Resource
|
| | | private UserInfoModifyRecordService userInfoModifyRecordService;
|
| | |
|
| | | |
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public LoginResult login(HttpServletRequest request, AcceptData acceptData, Boolean first, String appId,
|
| | |
| | |
|
| | | // 通过Code换取信息
|
| | | WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, wxAccount.getAppId(),
|
| | | wxAccount.getAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserAccountException(1, "微信帐号授权失败");
|
| | |
| | | spreadUserImgService.deleteImgUrl(userInfo.getId());
|
| | | } else {
|
| | | LogHelper.test("微信unionID不存在:" + weiXinUser.getUnionid());
|
| | | |
| | | String portrait = null;
|
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl())) {
|
| | | InputStream asInputStream = HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl());
|
| | | if (asInputStream != null) {
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
|
| | | String.format("/portrait/wx/%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
|
| | | if (result != null && !StringUtil.isNullOrEmpty(result.getUrl()))
|
| | | portrait = result.getUrl();
|
| | | } else {
|
| | | portrait = weiXinUser.getHeadimgurl();
|
| | | }
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(portrait))
|
| | | portrait = Constant.systemCommonConfig.getDefaultPortrait();
|
| | | |
| | | // 创建新账户
|
| | | userInfo = new UserInfo();
|
| | | userInfo.setPortrait(weiXinUser.getHeadimgurl());
|
| | | userInfo.setPortrait(portrait);
|
| | | userInfo.setAppId(appId);
|
| | | userInfo.setNickName(weiXinUser.getNickname());
|
| | | userInfo.setWxName(weiXinUser.getNickname());
|
| | |
| | | throw new UserAccountException(10, "请稍后再试");
|
| | | }
|
| | |
|
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public UserInfo loginWeiXinNew(HttpServletRequest request, AcceptData acceptData, int loginType, String wxCode, String appId) throws UserAccountException {
|
| | | // 日志信息
|
| | | JSONObject logInfo = new JSONObject();
|
| | | logInfo.put("appId", appId);
|
| | | logInfo.put("wxCode", wxCode);
|
| | | logInfo.put("loginType", loginType);
|
| | | LogHelper.lgoinInfo(logInfo.toString());
|
| | |
|
| | | // 通过Code换取信息
|
| | | WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(wxCode, wxAccount.getAppId(),
|
| | | wxAccount.getAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserAccountException(1, "微信帐号授权失败");
|
| | | }
|
| | | LogHelper.test("微信授权用户信息:" + new Gson().toJson(weiXinUser));
|
| | |
|
| | | // 判断微信unionid是否被封禁
|
| | | ForbiddenUserIdentifyCode identifyCode = forbiddenUserIdentifyCodeService
|
| | | .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, weiXinUser.getUnionid());
|
| | | if (identifyCode != null && identifyCode.getEffective() != null && identifyCode.getEffective()) {
|
| | | throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | }
|
| | |
|
| | | |
| | | UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
|
| | | if (userInfo == null) {
|
| | | String longinKey = StringUtil.Md5("WXLogin:" + weiXinUser.getUnionid());
|
| | | redisManager.cacheCommonString(longinKey, JsonUtil.getSimpleGson().toJson(weiXinUser), 60 * 20);
|
| | | throw new UserAccountException(101, longinKey);
|
| | | }
|
| | | // 更新账户登录信息
|
| | | updateLonginInfo(userInfo, loginType, request);
|
| | | Long uid = userInfo.getId();
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | // 删除邀请分享图
|
| | | spreadUserImgService.deleteImgUrl(uid);
|
| | | }
|
| | | });
|
| | | return userInfo;
|
| | | }
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 更新账户登录信息
|
| | | *
|
| | |
| | | throw new UserAccountException(1, "用户不存在");
|
| | | }
|
| | | WXAccountInfoDTO wxAccount = Constant.getWXAccount(acceptData.getPlatform(), acceptData.getVersion());
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, wxAccount.getAppId(),
|
| | | wxAccount.getAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserAccountException(2, "微信帐号授权失败");
|
| | |
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait();
|
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait)
|
| | | && defaultPortrait.equals(user.getPortrait())) {
|
| | | updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
|
| | | String headimgurl = weiXinUser.getHeadimgurl();
|
| | | InputStream asInputStream = HttpUtil.getAsInputStream(headimgurl);
|
| | | if (asInputStream == null) {
|
| | | LogHelper.test("微信头像下载失败: " +weiXinUser.getUnionid()+ " " + headimgurl);
|
| | | } else {
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
|
| | | String.format("/portrait/wx/%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
|
| | | if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
|
| | | headimgurl = result.getUrl();
|
| | | } else {
|
| | | LogHelper.test("微信头像上传失败: " +weiXinUser.getUnionid()+ " " + headimgurl);
|
| | | }
|
| | | }
|
| | | updateUserInfo.setPortrait(headimgurl);
|
| | | }
|
| | | userInfoMapper.updateByPrimaryKeySelective(updateUserInfo);
|
| | |
|
| | |
| | |
|
| | | userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, wxUnionId);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | public UserInfo bindPhoneToLogin(String phone, String key, String appId, HttpServletRequest request) throws UserAccountException {
|
| | | UserInfo phoneUser = userInfoMapper.getEffectiveUserInfoByPhone(phone);
|
| | | if (phoneUser != null) |
| | | throw new UserAccountException(1, "号码已经被占用");
|
| | | |
| | | // 判断手机号码是否被封禁
|
| | | ForbiddenUserIdentifyCode identifyCode1 = forbiddenUserIdentifyCodeService
|
| | | .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, phone);
|
| | | if (identifyCode1 != null && identifyCode1.getEffective() != null && identifyCode1.getEffective())
|
| | | throw new UserAccountException(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC);
|
| | | |
| | | String value = redisManager.getCommonString(key);
|
| | | if (StringUtil.isNullOrEmpty(value))
|
| | | throw new UserAccountException(1, "微信授权失效,请使用微信重新登录");
|
| | | |
| | | WeiXinUser weiXinUser = JsonUtil.getSimpleGson().fromJson(value, WeiXinUser.class);
|
| | | if (weiXinUser == null)
|
| | | throw new UserAccountException(1, "微信授权失效,请使用微信重新登录");
|
| | | |
| | | UserInfo userInfo = userInfoMapper.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
|
| | | // 直接用的微信登录
|
| | | if (userInfo != null) |
| | | throw new UserAccountException(10, "该微信号已被占用");
|
| | | |
| | | String portrait = null;
|
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl())) {
|
| | | InputStream asInputStream = HttpUtil.getAsInputStream(weiXinUser.getHeadimgurl());
|
| | | if (asInputStream != null) {
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
|
| | | String.format("/portrait/wx/%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
|
| | | if (result != null && !StringUtil.isNullOrEmpty(result.getUrl()))
|
| | | portrait = result.getUrl();
|
| | | } else {
|
| | | portrait = weiXinUser.getHeadimgurl();
|
| | | }
|
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(portrait))
|
| | | portrait = Constant.systemCommonConfig.getDefaultPortrait();
|
| | | |
| | | // 创建新账户
|
| | | userInfo = new UserInfo();
|
| | | userInfo.setPhone(phone);
|
| | | userInfo.setPortrait(portrait);
|
| | | userInfo.setAppId(appId);
|
| | | userInfo.setNickName(weiXinUser.getNickname());
|
| | | userInfo.setWxName(weiXinUser.getNickname());
|
| | | userInfo.setWxOpenId(weiXinUser.getOpenid());
|
| | | userInfo.setWxUnionId(weiXinUser.getUnionid());
|
| | | userInfo.setWxPic(weiXinUser.getHeadimgurl());
|
| | | userInfo.setLastLoginTime(System.currentTimeMillis());
|
| | | userInfo.setLoginType(2);
|
| | | userInfo.setLastLoginIp(request.getRemoteHost());
|
| | | userInfo.setState(UserInfo.STATE_NORMAL);
|
| | | addUser(userInfo);
|
| | | |
| | | Long uid = userInfo.getId();
|
| | | ThreadUtil.run(new Runnable() {
|
| | | public void run() {
|
| | | try {
|
| | | // 第一次登录时创建用户额外信息
|
| | | userInfoExtraService.createUserInfoExtra(uid);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | |
| | | // 加入绑定记录
|
| | | UserAccountBindingHistory history = new UserAccountBindingHistory();
|
| | | history.setContent(phone);
|
| | | history.setType(UserAccountBindingHistory.TYPE_PHONE);
|
| | | history.setUid(uid);
|
| | | history.setFirst(true);
|
| | | userAccountBindingHistoryService.addUserAccountBindingHistory(history);
|
| | |
|
| | | userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindPhone, phone);
|
| | | userInfoModifyRecordService.addModifyRecord(uid, ModifyTypeEnum.bindWeiXin, weiXinUser.getUnionid());
|
| | | }
|
| | | });
|
| | | // 删除缓存
|
| | | redisManager.removeCommonString(key);
|
| | | |
| | | return userInfo;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public void forbiddenUserAll(Long uid, String reason) {
|
| | |
| | | package com.yeshi.fanli.service.impl.user;
|
| | |
|
| | | import java.io.InputStream;
|
| | | import java.text.ParseException;
|
| | | import java.text.SimpleDateFormat;
|
| | | import java.util.ArrayList;
|
| | |
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.yeshi.utils.DateUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.entity.FileUploadResult;
|
| | | import org.yeshi.utils.tencentcloud.COSManager;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserInfoExtraMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.user.UserRankRecordMapper;
|
| | |
| | | }
|
| | |
|
| | | // 获取微信信息
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUserWithSavePortrait(code, wxAccount.getAppId(),
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, wxAccount.getAppId(),
|
| | | wxAccount.getAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | |
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait();
|
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait)
|
| | | && defaultPortrait.equals(invitee.getPortrait())) {
|
| | | updateUserInfo.setPortrait(weiXinUser.getHeadimgurl());
|
| | | String headimgurl = weiXinUser.getHeadimgurl();
|
| | | InputStream asInputStream = HttpUtil.getAsInputStream(headimgurl);
|
| | | if (asInputStream == null) {
|
| | | LogHelper.test("微信头像下载失败: " +weiXinUser.getUnionid()+ " " + headimgurl);
|
| | | } else {
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
|
| | | String.format("/portrait/wx/%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
|
| | | if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
|
| | | headimgurl = result.getUrl();
|
| | | } else {
|
| | | LogHelper.test("微信头像上传失败: " +weiXinUser.getUnionid()+ " " + headimgurl);
|
| | | }
|
| | | }
|
| | | updateUserInfo.setPortrait(headimgurl);
|
| | | }
|
| | |
|
| | | userInfoService.updateByPrimaryKeySelective(updateUserInfo);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | public void activeInviteWX(Long uid, WeiXinUser weiXinUser) throws UserInfoExtraException {
|
| | | if (uid == null || weiXinUser == null) {
|
| | | throw new UserInfoExtraException(1, "激活信息不完整");
|
| | | }
|
| | |
|
| | | // 用户信息
|
| | | UserInfo invitee = userInfoService.selectByPKey(uid);
|
| | | if (invitee == null) {
|
| | | throw new UserInfoExtraException(1, "用户不存在");
|
| | | }
|
| | |
|
| | | // 用户额外信息
|
| | | UserInfoExtra extra = userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | | if (extra != null) {
|
| | | String inviteCodeHas = extra.getInviteCode();
|
| | | if (inviteCodeHas != null && inviteCodeHas.trim().length() > 0) {
|
| | | throw new UserInfoExtraException(1, "已经激活, 无需再次激活");
|
| | | }
|
| | | }
|
| | |
|
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | |
|
| | | // 验证数据
|
| | | String wxUnionIdExist = invitee.getWxUnionId();
|
| | | if (StringUtil.isNullOrEmpty(wxUnionIdExist)) {
|
| | | UserInfo newUser = userInfoService.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
|
| | | if (newUser != null) {
|
| | | throw new UserInfoExtraException(1, "此微信已被其他帐号绑定");
|
| | | }
|
| | |
|
| | | // 自动绑定微信
|
| | | UserInfo updateUserInfo = new UserInfo(uid);
|
| | | updateUserInfo.setWxOpenId(weiXinUser.getOpenid());
|
| | | updateUserInfo.setWxUnionId(weiXinUser.getUnionid());
|
| | | updateUserInfo.setWxName(weiXinUser.getNickname());
|
| | | updateUserInfo.setWxPic(weiXinUser.getHeadimgurl());
|
| | |
|
| | | // 将默认昵称替换成微信昵称
|
| | | String defaultNickName = Constant.systemCommonConfig.getDefaultNickName();
|
| | | if (!StringUtil.isNullOrEmpty(defaultNickName) && !StringUtil.isNullOrEmpty(weiXinUser.getNickname())) {
|
| | | defaultNickName = defaultNickName + uid;
|
| | | if ((defaultNickName.equals(invitee.getNickName()) || "返利券".equals(invitee.getNickName())
|
| | | || invitee.getNickName().startsWith(Constant.systemCommonConfig.getDefaultNickName()))) {
|
| | | updateUserInfo.setNickName(weiXinUser.getNickname());
|
| | | }
|
| | | }
|
| | |
|
| | | // 将默认头像替换成微信头像
|
| | | String defaultPortrait = Constant.systemCommonConfig.getDefaultPortrait();
|
| | | if (!StringUtil.isNullOrEmpty(weiXinUser.getHeadimgurl()) && !StringUtil.isNullOrEmpty(defaultPortrait)
|
| | | && defaultPortrait.equals(invitee.getPortrait())) {
|
| | | String headimgurl = weiXinUser.getHeadimgurl();
|
| | | InputStream asInputStream = HttpUtil.getAsInputStream(headimgurl);
|
| | | if (asInputStream == null) {
|
| | | LogHelper.test("微信头像下载失败: " +weiXinUser.getUnionid()+ " " + headimgurl);
|
| | | } else {
|
| | | FileUploadResult result = COSManager.getInstance().uploadFile(asInputStream,
|
| | | String.format("/portrait/wx/%s_%s.jpg", weiXinUser.getUnionid(), System.currentTimeMillis() + ""));
|
| | | if (result != null && !StringUtil.isNullOrEmpty(result.getUrl())) {
|
| | | headimgurl = result.getUrl();
|
| | | } else {
|
| | | LogHelper.test("微信头像上传失败: " +weiXinUser.getUnionid()+ " " + headimgurl);
|
| | | }
|
| | | }
|
| | | updateUserInfo.setPortrait(headimgurl);
|
| | | }
|
| | |
|
| | | userInfoService.updateByPrimaryKeySelective(updateUserInfo);
|
| | |
|
| | | } else if (!wxUnionId.equals(wxUnionIdExist)) {
|
| | | throw new UserInfoExtraException(1, "绑定微信与激活微信不一致");
|
| | | }
|
| | |
|
| | | // 邀请人ID -1.5.3新版
|
| | | Long inviterId = userInviteRecordService.getNewestInviterId(wxUnionId);
|
| | |
|
| | | // 兼容1.5.3 之前版本
|
| | | ThreeSale threeSale = threeSaleSerivce.getByWorkerId(uid);
|
| | | if (inviterId == null && threeSale != null) {
|
| | | Long bossId = threeSale.getBoss().getId();
|
| | | UserInfoExtra inviterExtra = userInfoExtraMapper.getInfoExtraByUid(bossId);
|
| | | if (inviterExtra != null && inviterExtra.getInviteCode() == null) {
|
| | | // 更新邀请码
|
| | | UserInfoExtra inviterInfoExtra = new UserInfoExtra();
|
| | | inviterInfoExtra.setId(inviterExtra.getId());
|
| | | inviterInfoExtra.setInviteCode(UserUtil.getInviteCode(bossId));
|
| | | userInfoExtraMapper.updateByPrimaryKeySelective(inviterInfoExtra);
|
| | | }
|
| | | }
|
| | |
|
| | | // 没有被邀请过
|
| | | if (inviterId == null && threeSale == null) {
|
| | | throw new UserInfoExtraException(1, "没有对应的邀请关系");
|
| | | }
|
| | |
|
| | | // 绑定关系
|
| | | try {
|
| | | threeSaleSerivce.bindRelationshipByWX(invitee, inviterId, threeSale);
|
| | | } catch (ThreeSaleException e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | throw new UserInfoExtraException(1, "关系绑定时失败");
|
| | | }
|
| | |
|
| | | // 邀请码有效、生成邀请码
|
| | | String inviteCode = UserUtil.getInviteCode(uid);
|
| | | if (inviteCode == null || inviteCode.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "激活码生成失败");
|
| | | }
|
| | | // 保存邀请码
|
| | | UserInfoExtra userInfoExtra = new UserInfoExtra();
|
| | | userInfoExtra.setUserInfo(invitee);
|
| | | userInfoExtra.setInviteCode(inviteCode);
|
| | | userInfoExtra.setUpdateTime(new Date());
|
| | | if (extra != null) {
|
| | | userInfoExtra.setId(extra.getId());
|
| | | userInfoExtraMapper.updateByPrimaryKeySelective(userInfoExtra);
|
| | | } else {
|
| | | userInfoExtra.setCreateTime(new Date());
|
| | | userInfoExtraMapper.insertSelective(userInfoExtra);
|
| | | }
|
| | | }
|
| | | |
| | | @Override
|
| | | public UserInfoExtra getUserInfoExtra(Long uid) {
|
| | | return userInfoExtraMapper.getInfoExtraByUid(uid);
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public UserInfo getInviterInfo(WXAccountInfoDTO wxAccount, Long uid, String code) throws UserInfoExtraException {
|
| | | if (code == null) {
|
| | | throw new UserInfoExtraException(1, "code信息不完整");
|
| | | public UserInfo getInviterInfo(Long uid, String wxUnionId) throws UserInfoExtraException {
|
| | | if (wxUnionId == null) {
|
| | | throw new UserInfoExtraException(1, "unionId信息不完整");
|
| | | }
|
| | |
|
| | | // 用户信息
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | // 获取微信信息
|
| | | WeiXinUser weiXinUser = WXLoginUtil.getWeiXinUser(code, wxAccount.getAppId(), wxAccount.getAppSecret());
|
| | | if (weiXinUser == null) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | | String wxUnionId = weiXinUser.getUnionid();
|
| | | if (wxUnionId == null || wxUnionId.trim().length() == 0) {
|
| | | throw new UserInfoExtraException(1, "微信授权失败");
|
| | | }
|
| | |
|
| | | // 验证数据
|
| | | String wxUnionIdExist = invitee.getWxUnionId();
|
| | | if (StringUtil.isNullOrEmpty(wxUnionIdExist)) {
|
| | | UserInfo newUser = userInfoService.getEffectiveUserInfoByWXUnionId(weiXinUser.getUnionid());
|
| | | UserInfo newUser = userInfoService.getEffectiveUserInfoByWXUnionId(wxUnionId);
|
| | | if (newUser != null) {
|
| | | throw new UserInfoExtraException(1, "此微信已被其他帐号绑定");
|
| | | }
|
| | |
| | | import java.math.BigDecimal;
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.vo.order.HongBaoV2VO;
|
| | |
|
| | | public interface HongBaoV2CountService {
|
| | |
| | | * 结束时间
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | public List<ChartTDO> countHongBaoMoney(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * 结束时间
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | public List<ChartTDO> countHongBaoNum(String channel, Integer dateType, Integer state, String year,
|
| | | String startTime, String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | public List<ChartTDO> getProportionByType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | */
|
| | | public Date getLastHongBaoTime(Long uid);
|
| | |
|
| | | public List<Map<String, Object>> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> count24HOderByChannel(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | public List<ChartTDO> countHongBaoType(Integer dateType, Integer type, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | |
|
| | | import java.math.BigDecimal;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.vo.user.UserGoldCoinVO;
|
| | |
|
| | |
|
| | |
| | | * 统计新增用户
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countNewUserByDate(String channel,Integer type,String years, String startTime, String endTime) throws Exception;
|
| | | public List<ChartTDO> countNewUserByDate(String channel,Integer type,String years, String startTime, String endTime) throws Exception;
|
| | |
|
| | |
|
| | |
|
| | | public List<Map<String, Object>> getTodayBuyRate(String channel, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> getTodayBuyRate(String channel, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | |
|
| | |
| | | package com.yeshi.fanli.service.inter.count;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.vo.user.SystemCouponVO;
|
| | | import com.yeshi.fanli.vo.user.UserSystemCouponCountVO;
|
| | |
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> getRebateCouponUsedNumToCharts(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getRebateCouponUsedNumToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> getRebateCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getRebateCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime);
|
| | |
|
| | | /**
|
| | |
| | | * @param couponType
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getFreeCouponMoneyToCharts(Integer dateType, String year, String startTime,
|
| | | String endTime, String couponType);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.jd;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.jd.JDGoodsClass;
|
| | |
|
| | | public interface JDGoodsClassService {
|
| | |
|
| | | public void insertSelective(JDGoodsClass record);
|
| | | |
| | | public void updateByPrimaryKeySelective(JDGoodsClass record);
|
| | | |
| | | |
| | | /**
|
| | | * 查询各级分类
|
| | | * @param pid
|
| | | * @return
|
| | | */
|
| | | List<JDGoodsClass> getByLevel(Integer level);
|
| | | |
| | | |
| | | /**
|
| | | * 查询下级分类
|
| | | * @param pid
|
| | | * @return
|
| | | */
|
| | | List<JDGoodsClass> getByPid(Integer pid);
|
| | |
|
| | | /**
|
| | | * 更新分类
|
| | | */
|
| | | void insertClass();
|
| | |
|
| | | |
| | | /**
|
| | | * 查询三级分类信息
|
| | | * @param cid
|
| | | * @return
|
| | | */
|
| | | JDGoodsClass getThreeClassByCid(Integer cid);
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.money;
|
| | |
|
| | | import com.yeshi.fanli.entity.money.UserBalance;
|
| | |
|
| | | /**
|
| | | * 用户余额服务
|
| | | * |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | public interface UserBalanceService {
|
| | | |
| | | /**
|
| | | * 根据用户id查询
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | UserBalance getByUid(Long uid);
|
| | | }
|
| | |
| | | package com.yeshi.fanli.service.inter.money.extract;
|
| | |
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.ExtractAuditRecord;
|
| | |
|
| | | public interface ExtractAuditRecordService {
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>>countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO>countAuditTotal(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | |
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> countExtractApplyMoney(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @param endTime
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> countExtractApplyNumber(Integer state, Integer type, String years, String startTime,
|
| | | public List<ChartTDO> countExtractApplyNumber(Integer state, Integer type, String years, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | |
|
| | |
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | |
|
| | |
|
| | | public interface CommonOrderCountService {
|
| | |
|
| | |
| | | * @param channel
|
| | | * @return
|
| | | */
|
| | | public List<Map<String, Object>> getTrackAccuracyRate(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> getTrackAccuracyRate(Integer dateType, String year, String startTime,
|
| | | String endTime,int sourceType) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | public List<ChartTDO> countWeiQaunOrderMoney(Integer dateType, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> countWeiQaunOrderNumber(Integer dateType, String year, String startTime, String endTime)
|
| | | public List<ChartTDO> countWeiQaunOrderNumber(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception;
|
| | |
|
| | | /**
|
| | |
| | | import java.util.Map;
|
| | | import java.util.concurrent.locks.ReentrantReadWriteLock;
|
| | |
|
| | | import com.yeshi.fanli.dto.ChartTDO;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | |
|
| | | public interface LostOrderService {
|
| | |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<Map<String, Object>> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | public List<ChartTDO> countLostNum(Integer dateType, Integer resultCode, String year, String startTime,
|
| | | String endTime) throws Exception;
|
| | |
|
| | | public List<Map<String, Object>> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | public List<ChartTDO> countAppealMoney(Integer dateType, String year, String startTime, String endTime)
|
| | | throws Exception;
|
| | |
|
| | | /**
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.user;
|
| | |
|
| | | public interface BindRemindService {
|
| | |
|
| | | /**
|
| | | * 查询是否需要提示
|
| | | * @param type
|
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | | public boolean bindRemind(Long uid, int type);
|
| | |
|
| | | /**
|
| | | * 添加修改记录
|
| | | * @param uid
|
| | | */
|
| | | public void addBindPhone(Long uid);
|
| | | }
|
| | |
| | | * @param reason
|
| | | */
|
| | | public void DeleteUserOutOfDate(Long uid, String reason);
|
| | |
|
| | | /**
|
| | | * 2.0.1 新登录方式 -微信
|
| | | * @param request
|
| | | * @param acceptData
|
| | | * @param loginType
|
| | | * @param wxCode
|
| | | * @param appId
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo loginWeiXinNew(HttpServletRequest request, AcceptData acceptData, int loginType, String wxCode, String appId) throws UserAccountException;
|
| | |
|
| | | /**
|
| | | * 未注册之前绑定手机号
|
| | | * @param phone
|
| | | * @param key
|
| | | * @param appId
|
| | | * @param request
|
| | | * @return
|
| | | * @throws UserAccountException
|
| | | */
|
| | | public UserInfo bindPhoneToLogin(String phone, String key, String appId, HttpServletRequest request)
|
| | | throws UserAccountException;
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
|
| | | import com.yeshi.fanli.entity.bus.user.UserRank;
|
| | | import com.yeshi.fanli.entity.bus.user.WeiXinUser;
|
| | | import com.yeshi.fanli.exception.user.UserInfoExtraException;
|
| | | import com.yeshi.fanli.vo.user.UserInfoExtraVO;
|
| | |
|
| | |
| | | * @return
|
| | | * @throws UserInfoExtraException
|
| | | */
|
| | | public UserInfo getInviterInfo(WXAccountInfoDTO wxAccount,Long uid, String code) throws UserInfoExtraException;
|
| | | public UserInfo getInviterInfo(Long uid, String wxUnionId) throws UserInfoExtraException;
|
| | |
|
| | | /**
|
| | | * 更新信息 + 加锁
|
| | |
| | | * @return
|
| | | */
|
| | | public void updateGoldCoin(Long id, Integer goldCoin);
|
| | |
|
| | | /**
|
| | | * 新版邀请激活
|
| | | * @param uid
|
| | | * @param weiXinUser
|
| | | * @throws UserInfoExtraException
|
| | | */
|
| | | public void activeInviteWX(Long uid, WeiXinUser weiXinUser) throws UserInfoExtraException;
|
| | |
|
| | | }
|
| | |
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | | import org.jsoup.select.Elements;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | | import org.yeshi.utils.StringUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.douyin.DouYinGoods;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | public class DouYinUtil {
|
| | |
|
| | |
| | | return null;
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 通过链接获取商品标题,图片信息
|
| | | * @param url
|
| | | * @return
|
| | | */
|
| | | public static DouYinGoods getGoodsInfo(String url) {
|
| | | if (StringUtil.isNullOrEmpty(url)) |
| | | return null;
|
| | | |
| | | try {
|
| | | String id = null;
|
| | | int indexOf = url.indexOf("?");
|
| | | url = url.substring(indexOf + 1, url.length()-1);
|
| | | String[] temp = url.split("&");
|
| | | for (int i =0; i < temp.length; i ++) {
|
| | | String content = temp[i];
|
| | | if (content.startsWith("id")) {
|
| | | id = content.split("=")[content.split("=").length-1];
|
| | | break;
|
| | | } |
| | | }
|
| | | |
| | | if (StringUtil.isNullOrEmpty(id)) |
| | | return null;
|
| | | |
| | | // 请求地址
|
| | | String requestUrl = "https://ec.snssdk.com/product/fxgajaxstaticitem?b_type_new=0&id=%s";
|
| | | // 执行请求
|
| | | String result = HttpUtil.get(String.format(requestUrl,id));
|
| | | |
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONObject data = json.getJSONObject("data");
|
| | | |
| | | DouYinGoods goods = new DouYinGoods();
|
| | | goods.setId(id);
|
| | | goods.setName(data.optString("name"));
|
| | | goods.setImg(data.optString("img"));
|
| | | return goods;
|
| | | |
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
| | | goodsInfo.setTitle(goods.getTitle());
|
| | | goodsInfo.setSalesType(1); // 默认月销量
|
| | | goodsInfo.setZkPrice(goods.getZkPrice());
|
| | |
|
| | | |
| | | String provcity = goods.getProvcity();
|
| | | if (!StringUtil.isNullOrEmpty(provcity)) {
|
| | | String [] arr = provcity.split("\\s+");
|
| | | goodsInfo.setProvcity(arr[arr.length-1]);
|
| | | }
|
| | | |
| | | List<String> imgList = goods.getImgList();
|
| | | if (imgList != null) {
|
| | | goodsInfo.setImgList(imgList);
|
| | |
| | | import org.yeshi.utils.BigDecimalUtil;
|
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dto.GoodsClassDTO;
|
| | | import com.yeshi.fanli.dto.jd.JDCommissionInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDCouponInfo;
|
| | | import com.yeshi.fanli.dto.jd.JDPingouInfo;
|
| | |
| | | import com.yeshi.fanli.dto.jd.JDSearchResult;
|
| | | import com.yeshi.fanli.dto.jd.JDShopInfo;
|
| | | import com.yeshi.fanli.entity.jd.JDGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.MoneyBigDecimalUtil;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
| | | return BigDecimalUtil.getWithNoZera(MoneyBigDecimalUtil.mul(money, new BigDecimal("0.9")));
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 商品佣金计算
|
| | | * |
| | | * @param goods
|
| | | * @param rate
|
| | | * @return
|
| | | */
|
| | | public static BigDecimal getGoodsFanLiMoneyPlus(JDGoods goods, BigDecimal rate) {
|
| | | BigDecimal money = new BigDecimal(0);
|
| | | BigDecimal commissionPlus = goods.getCommissionPlus();
|
| | | if (commissionPlus == null) {
|
| | | return money;
|
| | | }
|
| | | |
| | | |
| | |
|
| | | BigDecimal price = null;
|
| | | JDPingouInfo pinGouInfo = goods.getPinGouInfo();
|
| | | if (pinGouInfo == null) {
|
| | | price = goods.getPrice();
|
| | | } else {
|
| | | price = pinGouInfo.getPingouPrice();
|
| | | }
|
| | |
|
| | | JDCouponInfo couponInfo = goods.getCouponInfo();
|
| | | if (couponInfo == null) {
|
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil
|
| | | .mul(MoneyBigDecimalUtil.mul(price, commissionPlus), new BigDecimal("0.01")),
|
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | } else {
|
| | | BigDecimal quota = couponInfo.getQuota();
|
| | | BigDecimal discount = couponInfo.getDiscount();
|
| | | if (quota.compareTo(price) <= 0 && price.compareTo(discount) > 0) {
|
| | |
|
| | | BigDecimal finalPrice = price.subtract(discount);
|
| | | money = MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(
|
| | | MoneyBigDecimalUtil.mul(finalPrice, commissionPlus),
|
| | | new BigDecimal("0.01")), MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | |
|
| | | } else {// 不能用券
|
| | | money = MoneyBigDecimalUtil.mul(
|
| | | MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(price,commissionPlus),
|
| | | new BigDecimal("0.01")),
|
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | }
|
| | | }
|
| | | // 返利比例为原来的90%
|
| | | return BigDecimalUtil.getWithNoZera(MoneyBigDecimalUtil.mul(money, new BigDecimal("0.9")));
|
| | | }
|
| | | |
| | | /**
|
| | | * 计算商品券后价,没有券则返回原价
|
| | | *
|
| | |
| | | }
|
| | | return jdGoods;
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 获取类目
|
| | | * @param level 等级
|
| | | * @param parentId 上级id
|
| | | * @return
|
| | | */
|
| | | public static List<GoodsClassDTO> getCategoryList(int level, int parentId) {
|
| | | try {
|
| | | // 请求地址
|
| | | String requestUrl = "https://union.jd.com/api/help/getCategoryList?level=%s&parentId=%s";
|
| | | // 执行请求
|
| | | String result = HttpUtil.get(String.format(requestUrl, level, parentId));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONArray jsonArray = json.getJSONArray("data");
|
| | | if (jsonArray != null && jsonArray.size() > 0) {
|
| | | List<GoodsClassDTO> list = new ArrayList<GoodsClassDTO>();
|
| | | for (int i=0;i <jsonArray.size() ;i ++ ) {
|
| | | Object object = jsonArray.get(i);
|
| | | if (object == null)
|
| | | continue;
|
| | | JSONObject jsonClass = JSONObject.fromObject(object);
|
| | | |
| | | GoodsClassDTO goodsClass = new GoodsClassDTO();
|
| | | goodsClass.setId(jsonClass.optString("id"));
|
| | | goodsClass.setName(jsonClass.optString("categoryName"));
|
| | | list.add(goodsClass);
|
| | | }
|
| | | return list;
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取类目
|
| | | * @param level 等级
|
| | | * @param parentId 上级id
|
| | | * @return
|
| | | */
|
| | | public static List<GoodsClassDTO> getCategoryCommiPlus(int level, int parentId) {
|
| | | try {
|
| | | // 请求地址
|
| | | String requestUrl = "https://union.jd.com/api/help/getCategoryCommiPlus?level=%s&parentId=%s";
|
| | | // 执行请求
|
| | | String result = HttpUtil.get(String.format(requestUrl, level, parentId));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(result)) {
|
| | | JSONObject json = JSONObject.fromObject(result);
|
| | | JSONArray jsonArray = json.getJSONArray("data");
|
| | | if (jsonArray != null && jsonArray.size() > 0) {
|
| | | List<GoodsClassDTO> list = new ArrayList<GoodsClassDTO>();
|
| | | for (int i=0;i <jsonArray.size() ;i ++ ) {
|
| | | Object object = jsonArray.get(i);
|
| | | if (object == null)
|
| | | continue;
|
| | | JSONObject jsonClass = JSONObject.fromObject(object);
|
| | | |
| | | GoodsClassDTO goodsClass = new GoodsClassDTO();
|
| | | goodsClass.setId(jsonClass.optString("id"));
|
| | | goodsClass.setName(jsonClass.optString("name"));
|
| | | |
| | | String selfMobileComm = jsonClass.optString("selfMobileComm");
|
| | | if (!StringUtil.isNullOrEmpty(selfMobileComm)) |
| | | goodsClass.setSelfComm(new BigDecimal(selfMobileComm));
|
| | | |
| | | String popMobileComm = jsonClass.optString("popMobileComm");
|
| | | if (!StringUtil.isNullOrEmpty(popMobileComm)) |
| | | goodsClass.setPopComm(new BigDecimal(popMobileComm));
|
| | | |
| | | list.add(goodsClass);
|
| | | }
|
| | | return list;
|
| | | }
|
| | | }
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | |
| | | }
|
| | |
| | | import java.io.UnsupportedEncodingException;
|
| | | import java.lang.reflect.Type;
|
| | | import java.math.BigDecimal;
|
| | | import java.net.URLDecoder;
|
| | | import java.net.URLEncoder;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | |
| | | import javax.xml.parsers.DocumentBuilderFactory;
|
| | |
|
| | | import org.apache.commons.httpclient.HttpClient;
|
| | | import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
|
| | | import org.apache.commons.httpclient.methods.GetMethod;
|
| | | import org.apache.commons.httpclient.params.HttpMethodParams;
|
| | | import org.jsoup.Connection;
|
| | | import org.jsoup.Jsoup;
|
| | | import org.jsoup.nodes.Document;
|
| | |
| | | return taoBaoGoodsBrief;
|
| | | }
|
| | |
|
| | | public static String getGoodsIdByPhoneShareUrl(String burl) {
|
| | | try {
|
| | | Connection connect = Jsoup.connect(burl);
|
| | | Document document = connect.get();
|
| | | org.jsoup.nodes.Element element = document.getElementsByTag("head").get(0).getElementsByTag("Script")
|
| | | .get(1);
|
| | | String html = element.toString();
|
| | | int index = html.indexOf("var url = ");
|
| | | int endIndex = html.lastIndexOf("'");
|
| | | html = html.substring(index, endIndex);
|
| | | int index2 = html.indexOf("'");
|
| | | html = html.substring(index2 + 1);
|
| | | int indexId = html.indexOf("id=");
|
| | | String id = "";
|
| | | if (html.contains("a.m.taobao.com")) {
|
| | | indexId = html.indexOf("com/i");
|
| | | html = html.substring(indexId);
|
| | | html = html.substring(5, html.indexOf("."));
|
| | | id = html;
|
| | | } else {
|
| | | String reg = "[?|&]{1}[i]{1}[d]{1}[=]{1}\\d+[&]?";
|
| | | Pattern p = Pattern.compile(reg);
|
| | | Matcher matcher = p.matcher(html);
|
| | | if (matcher.find()) {
|
| | | id = matcher.group();
|
| | | }
|
| | | id = id.substring(id.indexOf("=") + 1, id.lastIndexOf("&"));
|
| | | }
|
| | | return id;
|
| | | } catch (Exception e) {
|
| | | LogHelper.error("无法解析到淘宝商品ID:" + burl);
|
| | | return null;
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 获取商品的用户分成比例
|
| | | *
|
| | |
| | | }
|
| | | return taoBaoGoodsBrief;
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 抖音返利local 获取真实淘宝链接
|
| | | * @param url https://s.click.taobao.com/t?e=m%3D2%26s%3DT9DFpHQCT7Rw4vFB6t2Z2ueEDrYVVa64XoO8tOebS+dRAdhuF14FMR8
|
| | | * @return
|
| | | */
|
| | | public static String getRealUrl(String url) {
|
| | | if (StringUtil.isNullOrEmpty(url))
|
| | | return null;
|
| | | |
| | | try {
|
| | | HttpClient client = new HttpClient(new MultiThreadedHttpConnectionManager());
|
| | | client.getHttpConnectionManager().getParams().setConnectionTimeout(10000);
|
| | | client.getParams().setParameter(HttpMethodParams.USER_AGENT,"Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)"); // 让服务器认为是IE
|
| | | GetMethod get = new GetMethod(url);
|
| | | get.setFollowRedirects(false); // 禁止自动重定向
|
| | | int iGetResultCode = client.executeMethod(get);
|
| | | String location = get.getResponseHeader("location").getValue(); // 打印地址
|
| | | GetMethod get2 = new GetMethod(URLDecoder.decode(location.split("tu=")[1]));
|
| | | get2.addRequestHeader("Referer", location);
|
| | | get2.setFollowRedirects(false); // 禁止自动重定向
|
| | | int iGetResultCode2 = client.executeMethod(get2);
|
| | | return get2.getResponseHeader("location").getValue(); // 真实地址
|
| | | } catch (Exception ex) {
|
| | | ex.printStackTrace();
|
| | | } |
| | | return null;
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 淘口令过滤
|
| | |
| | | g.setId(goods.getAuctionId());
|
| | | g.setCreatetime(new Date());
|
| | | g.setMaterialLibType(goods.getMaterialLibType());
|
| | | g.setProvcity(goods.getProvcity());
|
| | | return g;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | g.setCreatetime(new Date());
|
| | | g.setMaterialLibType(goods.getMaterialLibType());
|
| | | g.setProvcity(goods.getProvcity());
|
| | | return g;
|
| | | }
|
| | | }
|
| | |
| | | goods.setSellerId(item.optLong("seller_id"));
|
| | | goods.setShopTitle(item.optString("shop_title"));
|
| | | goods.setTitle(item.optString("title"));
|
| | | goods.setProvcity(item.optString("provcity"));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("level_one_category_id"))) {
|
| | | goods.setRootCatId(item.optInt("level_one_category_id"));
|
| | |
| | | goods.setSellerId(item.optLong("seller_id"));
|
| | | goods.setShopTitle(item.optString("shop_title"));
|
| | | goods.setTitle(item.optString("title"));
|
| | | goods.setProvcity(item.optString("provcity"));
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("level_one_category_id"))) {
|
| | | goods.setRootCatId(item.optInt("level_one_category_id"));
|
| | |
| | | private OtherInfo otherInfo; // 其他信息
|
| | | @Expose
|
| | | private boolean baoyou; // 是否包邮
|
| | | @Expose
|
| | | private String provcity; // 商品所在地
|
| | |
|
| | |
|
| | | public Long getGoodsId() {
|
| | |
| | | public void setBaoyou(boolean baoyou) {
|
| | | this.baoyou = baoyou;
|
| | | }
|
| | |
|
| | | public String getProvcity() {
|
| | | return provcity;
|
| | | }
|
| | |
|
| | | public void setProvcity(String provcity) {
|
| | | this.provcity = provcity;
|
| | | }
|
| | | |
| | | }
|
| | |
| | |
|
| | | @Expose
|
| | | private RewardCouponVO rewardCoupon;
|
| | | |
| | | @Expose
|
| | | private String fanliMoneyPlus;
|
| | | |
| | | |
| | |
|
| | | public RewardCouponVO getRewardCoupon() {
|
| | | return rewardCoupon;
|
| | |
| | | this.reduceHongBao = reduceHongBao;
|
| | | }
|
| | |
|
| | | public String getFanliMoneyPlus() {
|
| | | return fanliMoneyPlus;
|
| | | }
|
| | |
|
| | | public void setFanliMoneyPlus(String fanliMoneyPlus) {
|
| | | this.fanliMoneyPlus = fanliMoneyPlus;
|
| | | }
|
| | | }
|
| | |
| | | private JumpDetailV2 jumpDetail;
|
| | | @Expose
|
| | | private String params;
|
| | | @Expose
|
| | | private String maxMoneyPlus;
|
| | |
|
| | | public String getMaxMoney() {
|
| | | return maxMoney;
|
| | |
| | | this.params = params;
|
| | | }
|
| | |
|
| | | public String getMaxMoneyPlus() {
|
| | | return maxMoneyPlus;
|
| | | }
|
| | |
|
| | | public void setMaxMoneyPlus(String maxMoneyPlus) {
|
| | | this.maxMoneyPlus = maxMoneyPlus;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | |
|
| | | import org.junit.Test;
|
| | | import org.yeshi.utils.mybatis.ColumnParseUtil;
|
| | | import org.yeshi.utils.mybatis.MyBatisMapperUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.elme.ElmeHongBaoOrderMap;
|
| | | import com.yeshi.fanli.entity.elme.ElmeOrder;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | |
|
| | | //@Ignore
|
| | |
| | |
|
| | | @Test
|
| | | public void test3() {
|
| | | MyBatisMapperUtil.createMapper(ElmeOrder.class);
|
| | | MyBatisMapperUtil.createMapper(ElmeHongBaoOrderMap.class);
|
| | | }
|
| | |
|
| | | @Test
|
| | |
| | | import org.yeshi.utils.HttpUtil;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TBPidMapper;
|
| | | import com.yeshi.fanli.dto.taobao.TaoLiJinDTO;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.taobao.PidUser;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoLink;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | |
|
| | | @Test
|
| | | public void test1() {
|
| | | TaoBaoSearchResult result = TaoKeApiUtil.getMaterialByMaterialId(16432, 1, 100);
|
| | | System.out.println(result);
|
| | | System.out.println(TaoBaoUtil.filterTaoToken("¥RuPdYM9Knxe¥"));
|
| | | }
|
| | |
|
| | | @Test
|
| | |
| | | @Test
|
| | | public void test3() {
|
| | | Long auctionId = 598165623087L;
|
| | | String appKey = "27821872";
|
| | | String appSecret = "9277b7c40b753e142303eeabc1936c80";
|
| | | String pid = "mm_491980152_690500060_109327900051";
|
| | | String appKey = "27965236";
|
| | | String appSecret = "2be7a216bee767dc3a6388aa24f11140";
|
| | | String pid = "mm_502940004_754900291_109486750166";
|
| | | TaoKeAppInfo app = new TaoKeAppInfo(appKey, appSecret, pid);
|
| | |
|
| | | try {
|
| | | TaoKeApiUtil.createTaoLiJin(auctionId, "淘礼金", new BigDecimal(1), 1, new Date(),
|
| | | TaoLiJinDTO dto = TaoKeApiUtil.createTaoLiJin(auctionId, "淘礼金", new BigDecimal(1), 1, new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 12L), new Date(),
|
| | | new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 12L), app);
|
| | | System.out.println(dto);
|
| | | } catch (Exception e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
| | |
|
| | | @Test
|
| | | public void test4() {
|
| | |
|
| | | TaoBaoOrderService taoBaoOrderService = BeanUtil.getBean(TaoBaoOrderService.class);
|
| | | try {
|
| | | List<TaoBaoOrder> list = TaoBaoOrderUtil.parseOrder(
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 判断是否同一个月
|
| | | * @param date1
|
| | | * @param date2
|
| | | * @return
|
| | | */
|
| | | public static boolean isSameMonth(Date date1, Date date2) {
|
| | | Calendar calendar1 = Calendar.getInstance();
|
| | | calendar1.setTime(date1);
|
| | | Calendar calendar2 = Calendar.getInstance();
|
| | | calendar2.setTime(date2);
|
| | | int year1 = calendar1.get(Calendar.YEAR);
|
| | | int year2 = calendar2.get(Calendar.YEAR);
|
| | | int month1 = calendar1.get(Calendar.MONTH);
|
| | | int month2 = calendar2.get(Calendar.MONTH);
|
| | | System.out.println(year1 + " " + month1);
|
| | | System.out.println(year2 + " " + month2);
|
| | | return calendar1.get(Calendar.YEAR) == calendar2.get(Calendar.YEAR) && calendar1.get(Calendar.MONTH) == calendar2.get(Calendar.MONTH);
|
| | | } |
| | | |
| | | |
| | | |
| | | /**
|
| | | * 指定日期加上天数后的日期
|
| | | *
|
| | |
| | |
|
| | | return result;
|
| | | }
|
| | | |
| | | |
| | | |
| | | /**
|
| | | * 获取post返回location
|
| | | * @param url
|
| | | * @return
|
| | | */
|
| | | public static String getLocation(String url) {
|
| | | HttpClient client = new HttpClient();
|
| | | PostMethod method = new PostMethod(url);
|
| | | try {
|
| | | client.executeMethod(method);
|
| | | return method.getResponseHeader("location").getValue();
|
| | | } catch (HttpException e) {
|
| | | e.printStackTrace();
|
| | | } catch (IOException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | | }
|
| | |
| | | return "DECIMAL";
|
| | | } else if (type.endsWith("java.util.Date")) {
|
| | | return "TIMESTAMP";
|
| | | }else
|
| | | } else if (type.endsWith("java.lang.Double")) {
|
| | | return "DOUBLE";
|
| | | } else {
|
| | | return "VARCHAR";
|
| | | }
|
| | | }
|
| | |
|
| | | }
|