代理佣金审批+日志添加操作人及代理分享图功能
This commit is contained in:
parent
7cb938482d
commit
64ff8a492b
|
|
@ -31,6 +31,7 @@ public class ShiroConfig {
|
|||
shiroFilterFactoryBean.setSecurityManager(securityManager);
|
||||
Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>();
|
||||
filterChainDefinitionMap.put("/admin/auth/login", "anon");
|
||||
filterChainDefinitionMap.put("/admin/auth/captchaImage", "anon");
|
||||
filterChainDefinitionMap.put("/admin/auth/401", "anon");
|
||||
filterChainDefinitionMap.put("/admin/auth/index", "anon");
|
||||
filterChainDefinitionMap.put("/admin/auth/403", "anon");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,33 @@
|
|||
package com.qiguliuxing.dts.admin.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
import com.qiguliuxing.dts.db.bean.CategorySellAmts;
|
||||
|
||||
public class CategorySellVo implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 96458407347975166L;
|
||||
|
||||
private String[] categoryNames;//一级大类目录名称
|
||||
|
||||
private List<CategorySellAmts> categorySellData;//大类销售金额集合
|
||||
|
||||
public String[] getCategoryNames() {
|
||||
return categoryNames;
|
||||
}
|
||||
|
||||
public void setCategoryNames(String[] categoryNames) {
|
||||
this.categoryNames = categoryNames;
|
||||
}
|
||||
|
||||
public List<CategorySellAmts> getCategorySellData() {
|
||||
return categorySellData;
|
||||
}
|
||||
|
||||
public void setCategorySellData(List<CategorySellAmts> categorySellData) {
|
||||
this.categorySellData = categorySellData;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.qiguliuxing.dts.admin.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class OrderAmtsVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 3840196229938738818L;
|
||||
|
||||
private String[] dayData;//日期数据
|
||||
|
||||
private BigDecimal[] orderAmtData;//日订单金额
|
||||
|
||||
private int[] orderCntData;//日订单量
|
||||
|
||||
public String[] getDayData() {
|
||||
return dayData;
|
||||
}
|
||||
|
||||
public void setDayData(String[] dayData) {
|
||||
this.dayData = dayData;
|
||||
}
|
||||
|
||||
public BigDecimal[] getOrderAmtData() {
|
||||
return orderAmtData;
|
||||
}
|
||||
|
||||
public void setOrderAmtData(BigDecimal[] orderAmtData) {
|
||||
this.orderAmtData = orderAmtData;
|
||||
}
|
||||
|
||||
public int[] getOrderCntData() {
|
||||
return orderCntData;
|
||||
}
|
||||
|
||||
public void setOrderCntData(int[] orderCntData) {
|
||||
this.orderCntData = orderCntData;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package com.qiguliuxing.dts.admin.dao;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class UserOrderCntVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5460904409450124808L;
|
||||
|
||||
private String[] dayData;//日期数据
|
||||
|
||||
private int[] userCnt;//每日用户新增量
|
||||
|
||||
private int[] orderCnt;//每日订单量
|
||||
|
||||
public String[] getDayData() {
|
||||
return dayData;
|
||||
}
|
||||
|
||||
public void setDayData(String[] dayData) {
|
||||
this.dayData = dayData;
|
||||
}
|
||||
|
||||
public int[] getUserCnt() {
|
||||
return userCnt;
|
||||
}
|
||||
|
||||
public void setUserCnt(int[] userCnt) {
|
||||
this.userCnt = userCnt;
|
||||
}
|
||||
|
||||
public int[] getOrderCnt() {
|
||||
return orderCnt;
|
||||
}
|
||||
|
||||
public void setOrderCnt(int[] orderCnt) {
|
||||
this.orderCnt = orderCnt;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.qiguliuxing.dts.core.type.BrokerageTypeEnum;
|
||||
import com.qiguliuxing.dts.core.util.DateTimeUtil;
|
||||
import com.qiguliuxing.dts.db.service.DtsAccountService;
|
||||
|
||||
|
|
@ -25,18 +26,18 @@ public class SettlementJob {
|
|||
/**
|
||||
* 自动结算代理佣金
|
||||
* <p>
|
||||
* 每月10号 凌晨1点半执行,自动计算代理用户的佣金到对应账户,作为系统结算。
|
||||
* 每月8-20号 凌晨1点半执行,自动计算代理用户的佣金到对应账户,作为系统结算。
|
||||
* <p>
|
||||
* 注意,仅统计上个月订单状态为已经完成,即订单状态为 401 402 的订单。
|
||||
*/
|
||||
@Scheduled(cron = "0 30 1 10 * ?")
|
||||
@Scheduled(cron = "0 30 1 8-20 * ?")
|
||||
public void checkOrderUnconfirm() {
|
||||
List<Integer> sharedUserIds = accountService.findAllSharedUserId();
|
||||
logger.info("自动结算代理佣金定时任务,共找到 " + sharedUserIds.size() + " 位代理用户,开始统计佣金...");
|
||||
|
||||
for (Integer sharedUserId : sharedUserIds) {
|
||||
try {
|
||||
accountService.setSettleMentAccount(sharedUserId, DateTimeUtil.getPrevMonthEndDay());
|
||||
accountService.setSettleMentAccount(sharedUserId, DateTimeUtil.getPrevMonthEndDay(),BrokerageTypeEnum.SYS_APPLY.getType().intValue());
|
||||
} catch (Exception e) {
|
||||
logger.error("自动结算出错:" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
package com.qiguliuxing.dts.admin.service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.db.domain.DtsAdmin;
|
||||
import com.qiguliuxing.dts.db.domain.DtsBrand;
|
||||
import com.qiguliuxing.dts.db.service.DtsBrandService;
|
||||
import com.qiguliuxing.dts.db.service.DtsRoleService;
|
||||
|
||||
@Service
|
||||
public class AdminDataAuthService {
|
||||
|
||||
@Autowired
|
||||
private DtsRoleService roleService;
|
||||
|
||||
@Autowired
|
||||
private DtsBrandService brandService;
|
||||
|
||||
/**
|
||||
* 是否属于运营商管理员,超级管理员除外
|
||||
* @return
|
||||
*/
|
||||
public boolean isBrandManager() {
|
||||
Integer[] roleIds = null;
|
||||
DtsAdmin currentUser = AuthSupport.currentUser();
|
||||
if (currentUser != null) {
|
||||
roleIds = currentUser.getRoleIds();
|
||||
Set<String> roles = roleService.queryByIds(roleIds);
|
||||
//仅仅只是品牌管理员且不属于超级管理员
|
||||
if (roles.contains(AuthSupport.BRAND_ROLE_NAME) && !roles.contains(AuthSupport.SUPER_ROLE_NAME)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户的管理的品牌商铺
|
||||
* @return
|
||||
*/
|
||||
public List<Integer> getBrandIds() {
|
||||
List<Integer> brandIds = null;
|
||||
DtsAdmin currentUser = AuthSupport.currentUser();
|
||||
List<DtsBrand> brands = brandService.getAdminBrands(currentUser.getId());
|
||||
if (brands != null && brands.size() > 0) {
|
||||
brandIds = new ArrayList<Integer>();
|
||||
for (DtsBrand brand:brands) {
|
||||
brandIds.add(brand.getId());
|
||||
}
|
||||
}
|
||||
return brandIds;
|
||||
}
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.dao.GoodsAllinone;
|
||||
import com.qiguliuxing.dts.admin.util.AdminResponseUtil;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.admin.util.CatVo;
|
||||
import com.qiguliuxing.dts.core.qcode.QCodeService;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
|
|
@ -61,9 +62,12 @@ public class AdminGoodsService {
|
|||
|
||||
@Autowired
|
||||
private QCodeService qCodeService;
|
||||
|
||||
@Autowired
|
||||
private AdminDataAuthService adminDataAuthService;
|
||||
|
||||
public Object list(String goodsSn, String name, Integer page, Integer limit, String sort, String order) {
|
||||
List<DtsGoods> goodsList = goodsService.querySelective(goodsSn, name, page, limit, sort, order);
|
||||
public Object list(String goodsSn, String name, Integer page, Integer limit, String sort, String order, List<Integer> brandIds) {
|
||||
List<DtsGoods> goodsList = goodsService.querySelective(goodsSn, name, page, limit, sort, order, brandIds);
|
||||
long total = PageInfo.of(goodsList).getTotal();
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", total);
|
||||
|
|
@ -174,7 +178,7 @@ public class AdminGoodsService {
|
|||
}
|
||||
|
||||
// 将生成的分享图片地址写入数据库
|
||||
String url = qCodeService.createGoodShareImage(goods.getId().toString(), goods.getPicUrl(), goods.getName(),goods.getCounterPrice(),goods.getRetailPrice());
|
||||
String url = qCodeService.createGoodShareImage(null,goods.getId().toString(), goods.getPicUrl(), goods.getName(),goods.getCounterPrice(),goods.getRetailPrice());
|
||||
goods.setShareUrl(url);
|
||||
|
||||
// 商品基本信息表Dts_goods
|
||||
|
|
@ -250,7 +254,7 @@ public class AdminGoodsService {
|
|||
goodsService.add(goods);
|
||||
|
||||
// 将生成的分享图片地址写入数据库
|
||||
String url = qCodeService.createGoodShareImage(goods.getId().toString(), goods.getPicUrl(), goods.getName(),goods.getCounterPrice(),goods.getRetailPrice());
|
||||
String url = qCodeService.createGoodShareImage(null,goods.getId().toString(), goods.getPicUrl(), goods.getName(),goods.getCounterPrice(),goods.getRetailPrice());
|
||||
if (!StringUtils.isEmpty(url)) {
|
||||
goods.setShareUrl(url);
|
||||
if (goodsService.updateById(goods) == 0) {
|
||||
|
|
@ -304,8 +308,19 @@ public class AdminGoodsService {
|
|||
|
||||
categoryList.add(l1CatVo);
|
||||
}
|
||||
List<DtsBrand> list = brandService.all();
|
||||
List<Map<String, Object>> brandList = new ArrayList<>(list.size());
|
||||
|
||||
//品牌商获取需要控制数据权限,如果是店铺管理员下拉的品牌商只能选择当前用户可管理的品牌商
|
||||
List<DtsBrand> list = new ArrayList<>();
|
||||
List<Map<String, Object>> brandList = new ArrayList<>();
|
||||
List<Integer> brandIds = null;
|
||||
if (adminDataAuthService.isBrandManager()) {
|
||||
list = brandService.getAdminBrands(AuthSupport.adminId());
|
||||
logger.info("运营商管理角色操作,需控制数据权限,brandIds:{}", JSONObject.toJSONString(brandIds));
|
||||
} else {
|
||||
list = brandService.all();
|
||||
brandList = new ArrayList<>(list.size());
|
||||
}
|
||||
|
||||
for (DtsBrand brand : list) {
|
||||
Map<String, Object> b = new HashMap<>(2);
|
||||
b.put("value", brand.getId());
|
||||
|
|
|
|||
|
|
@ -59,13 +59,38 @@ public class AdminOrderService {
|
|||
*/
|
||||
@Autowired
|
||||
private NotifyService notifyService;
|
||||
|
||||
@Autowired
|
||||
private AdminDataAuthService adminDataAuthService;
|
||||
|
||||
public Object list(Integer userId, String orderSn, List<Short> orderStatusArray, Integer page, Integer limit,
|
||||
String sort, String order) {
|
||||
List<DtsOrder> orderList = orderService.querySelective(userId, orderSn, orderStatusArray, page, limit, sort,
|
||||
order);
|
||||
long total = PageInfo.of(orderList).getTotal();
|
||||
|
||||
// 需要区分数据权限,如果属于品牌商管理员,则需要获取当前用户管理品牌店铺
|
||||
List<Integer> brandIds = null;
|
||||
if (adminDataAuthService.isBrandManager()) {
|
||||
brandIds = adminDataAuthService.getBrandIds();
|
||||
logger.info("运营商管理角色操作,需控制数据权限,brandIds:{}", JSONObject.toJSONString(brandIds));
|
||||
|
||||
if (brandIds == null || brandIds.size() == 0) {//如果尚未管理任何入驻店铺,则返回空数据
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", 0L);
|
||||
data.put("items", null);
|
||||
|
||||
logger.info("【请求结束】商场管理->订单管理->查询,响应结果:{}", JSONObject.toJSONString(data));
|
||||
return ResponseUtil.ok(data);
|
||||
}
|
||||
}
|
||||
List<DtsOrder> orderList = null;
|
||||
long total = 0L;
|
||||
if (brandIds == null || brandIds.size() == 0) {
|
||||
orderList = orderService.querySelective(userId, orderSn, orderStatusArray, page, limit, sort,order);
|
||||
total = PageInfo.of(orderList).getTotal();
|
||||
} else {
|
||||
orderList = orderService.queryBrandSelective(brandIds,userId, orderSn, orderStatusArray, page, limit, sort,order);
|
||||
total = PageInfo.of(orderList).getTotal();
|
||||
}
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", total);
|
||||
data.put("items", orderList);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,9 @@ public enum AdminResponseCode {
|
|||
// USER_NAME_EXIST(633,""),
|
||||
// USER_MOBILE_EXIST(634,""),
|
||||
ROLE_NAME_EXIST(640, "角色已经存在"), ROLE_SUPER_SUPERMISSION(641, "当前角色的超级权限不能变更"),
|
||||
ARTICLE_NAME_EXIST(642,"公告或通知文章已经存在");
|
||||
ARTICLE_NAME_EXIST(642,"公告或通知文章已经存在"),
|
||||
AUTH_CAPTCHA_FREQUENCY(643,"验证码请求过于频繁"),
|
||||
AUTH_CAPTCHA_ERROR(644,"验证码错误"), AUTH_CAPTCHA_EXPIRED(645,"验证码过期");
|
||||
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
package com.qiguliuxing.dts.admin.util;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.subject.Subject;
|
||||
|
||||
import com.qiguliuxing.dts.db.domain.DtsAdmin;
|
||||
|
||||
/**
|
||||
* 用于权限支持服务
|
||||
* @author QIGULIXING
|
||||
* @since 1.0.0
|
||||
* @QQ 623659388
|
||||
*
|
||||
*/
|
||||
public class AuthSupport {
|
||||
|
||||
public static final Object BRAND_ROLE_NAME = "品牌制造商";
|
||||
|
||||
public static final Object SUPER_ROLE_NAME = "超级管理员";
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户
|
||||
* @return
|
||||
*/
|
||||
public static DtsAdmin currentUser() {
|
||||
DtsAdmin admin = null;
|
||||
Subject currentUser = SecurityUtils.getSubject();
|
||||
if (currentUser != null) {
|
||||
admin = (DtsAdmin) currentUser.getPrincipal();
|
||||
}
|
||||
return admin;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户名
|
||||
* @return
|
||||
*/
|
||||
public static String userName() {
|
||||
String userName = null;
|
||||
DtsAdmin currentUser = currentUser();
|
||||
if (currentUser != null) {
|
||||
userName = currentUser.getUsername();
|
||||
}
|
||||
return userName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户id
|
||||
* @return
|
||||
*/
|
||||
public static Integer adminId() {
|
||||
Integer adminId = null;
|
||||
DtsAdmin currentUser = currentUser();
|
||||
if (currentUser != null) {
|
||||
adminId = currentUser.getId();
|
||||
}
|
||||
return adminId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,204 @@
|
|||
package com.qiguliuxing.dts.admin.util;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Arrays;
|
||||
import java.util.Random;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
/**
|
||||
* 验证码图片生成工具类
|
||||
*/
|
||||
public class VerifyCodeUtils {
|
||||
// 使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符
|
||||
public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ";
|
||||
|
||||
private static Random random = new SecureRandom();
|
||||
|
||||
/**
|
||||
* 使用系统默认字符源生成验证码
|
||||
*
|
||||
* @param verifySize
|
||||
* 验证码长度
|
||||
* @return
|
||||
*/
|
||||
public static String generateVerifyCode(int verifySize) {
|
||||
return generateVerifyCode(verifySize, VERIFY_CODES);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用指定源生成验证码
|
||||
*
|
||||
* @param verifySize
|
||||
* 验证码长度
|
||||
* @param sources
|
||||
* 验证码字符源
|
||||
* @return
|
||||
*/
|
||||
public static String generateVerifyCode(int verifySize, String sources) {
|
||||
if (sources == null || sources.length() == 0) {
|
||||
sources = VERIFY_CODES;
|
||||
}
|
||||
int codesLen = sources.length();
|
||||
Random rand = new Random(System.currentTimeMillis());
|
||||
StringBuilder verifyCode = new StringBuilder(verifySize);
|
||||
for (int i = 0; i < verifySize; i++) {
|
||||
verifyCode.append(sources.charAt(rand.nextInt(codesLen - 1)));
|
||||
}
|
||||
return verifyCode.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 输出指定验证码图片流
|
||||
*
|
||||
* @param w
|
||||
* @param h
|
||||
* @param os
|
||||
* @param code
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void outputImage(int w, int h, OutputStream os, String code) throws IOException {
|
||||
int verifySize = code.length();
|
||||
BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
|
||||
Random rand = new Random();
|
||||
Graphics2D g2 = image.createGraphics();
|
||||
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
Color[] colors = new Color[5];
|
||||
Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN, Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA,
|
||||
Color.ORANGE, Color.PINK, Color.YELLOW };
|
||||
float[] fractions = new float[colors.length];
|
||||
for (int i = 0; i < colors.length; i++) {
|
||||
colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)];
|
||||
fractions[i] = rand.nextFloat();
|
||||
}
|
||||
Arrays.sort(fractions);
|
||||
|
||||
g2.setColor(Color.GRAY);// 设置边框色
|
||||
g2.fillRect(0, 0, w, h);
|
||||
|
||||
Color c = getRandColor(200, 250);
|
||||
g2.setColor(c);// 设置背景色
|
||||
g2.fillRect(0, 2, w, h - 4);
|
||||
|
||||
// 绘制干扰线
|
||||
Random random = new Random();
|
||||
g2.setColor(getRandColor(160, 200));// 设置线条的颜色
|
||||
for (int i = 0; i < 20; i++) {
|
||||
int x = random.nextInt(w - 1);
|
||||
int y = random.nextInt(h - 1);
|
||||
int xl = random.nextInt(6) + 1;
|
||||
int yl = random.nextInt(12) + 1;
|
||||
g2.drawLine(x, y, x + xl + 40, y + yl + 20);
|
||||
}
|
||||
|
||||
// 添加噪点
|
||||
float yawpRate = 0.05f;// 噪声率
|
||||
int area = (int) (yawpRate * w * h);
|
||||
for (int i = 0; i < area; i++) {
|
||||
int x = random.nextInt(w);
|
||||
int y = random.nextInt(h);
|
||||
int rgb = getRandomIntColor();
|
||||
image.setRGB(x, y, rgb);
|
||||
}
|
||||
|
||||
shear(g2, w, h, c);// 使图片扭曲
|
||||
|
||||
g2.setColor(getRandColor(100, 160));
|
||||
int fontSize = h - 4;
|
||||
Font font = new Font("Algerian", Font.ITALIC, fontSize);
|
||||
g2.setFont(font);
|
||||
char[] chars = code.toCharArray();
|
||||
for (int i = 0; i < verifySize; i++) {
|
||||
AffineTransform affine = new AffineTransform();
|
||||
affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1),
|
||||
(w / verifySize) * i + fontSize / 2, h / 2);
|
||||
g2.setTransform(affine);
|
||||
g2.drawChars(chars, i, 1, ((w - 10) / verifySize) * i + 5, h / 2 + fontSize / 2 - 10);
|
||||
}
|
||||
|
||||
g2.dispose();
|
||||
ImageIO.write(image, "jpg", os);
|
||||
}
|
||||
|
||||
private static Color getRandColor(int fc, int bc) {
|
||||
if (fc > 255)
|
||||
fc = 255;
|
||||
if (bc > 255)
|
||||
bc = 255;
|
||||
int r = fc + random.nextInt(bc - fc);
|
||||
int g = fc + random.nextInt(bc - fc);
|
||||
int b = fc + random.nextInt(bc - fc);
|
||||
return new Color(r, g, b);
|
||||
}
|
||||
|
||||
private static int getRandomIntColor() {
|
||||
int[] rgb = getRandomRgb();
|
||||
int color = 0;
|
||||
for (int c : rgb) {
|
||||
color = color << 8;
|
||||
color = color | c;
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
private static int[] getRandomRgb() {
|
||||
int[] rgb = new int[3];
|
||||
for (int i = 0; i < 3; i++) {
|
||||
rgb[i] = random.nextInt(255);
|
||||
}
|
||||
return rgb;
|
||||
}
|
||||
|
||||
private static void shear(Graphics g, int w1, int h1, Color color) {
|
||||
shearX(g, w1, h1, color);
|
||||
shearY(g, w1, h1, color);
|
||||
}
|
||||
|
||||
private static void shearX(Graphics g, int w1, int h1, Color color) {
|
||||
|
||||
int period = random.nextInt(2);
|
||||
|
||||
boolean borderGap = true;
|
||||
int frames = 1;
|
||||
int phase = random.nextInt(2);
|
||||
|
||||
for (int i = 0; i < h1; i++) {
|
||||
double d = (double) (period >> 1)
|
||||
* Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames);
|
||||
g.copyArea(0, i, w1, 1, (int) d, 0);
|
||||
if (borderGap) {
|
||||
g.setColor(color);
|
||||
g.drawLine((int) d, i, 0, i);
|
||||
g.drawLine((int) d + w1, i, w1, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void shearY(Graphics g, int w1, int h1, Color color) {
|
||||
|
||||
int period = random.nextInt(40) + 10; // 50;
|
||||
|
||||
boolean borderGap = true;
|
||||
int frames = 20;
|
||||
int phase = 7;
|
||||
for (int i = 0; i < w1; i++) {
|
||||
double d = (double) (period >> 1)
|
||||
* Math.sin((double) i / (double) period + (6.2831853071795862D * (double) phase) / (double) frames);
|
||||
g.copyArea(i, 0, 1, h1, 0, (int) d);
|
||||
if (borderGap) {
|
||||
g.setColor(color);
|
||||
g.drawLine(i, (int) d, i, 0);
|
||||
g.drawLine(i, (int) d + h1, i, h1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -44,7 +45,7 @@ public class AdminAdController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】推广管理->广告管理->查询,请求参数:name:{},content:{},page:{}", name, content, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 操作人:[" + AuthSupport.userName()+ "] 推广管理->广告管理->查询,请求参数:name:{},content:{},page:{}", name, content, page);
|
||||
|
||||
List<DtsAd> adList = adService.querySelective(name, content, page, limit, sort, order);
|
||||
long total = PageInfo.of(adList).getTotal();
|
||||
|
|
@ -72,7 +73,7 @@ public class AdminAdController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "广告管理" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsAd ad) {
|
||||
logger.info("【请求开始】推广管理->广告管理->添加,请求参数:ad:{}", JSONObject.toJSONString(ad));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->广告管理->添加,请求参数:ad:{}", JSONObject.toJSONString(ad));
|
||||
|
||||
Object error = validate(ad);
|
||||
if (error != null) {
|
||||
|
|
@ -89,7 +90,7 @@ public class AdminAdController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "广告管理" }, button = "详情")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】推广管理->广告管理->详情,请求参数:id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->广告管理->详情,请求参数:id:{}", id);
|
||||
|
||||
DtsAd brand = adService.findById(id);
|
||||
|
||||
|
|
@ -101,7 +102,7 @@ public class AdminAdController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "广告管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsAd ad) {
|
||||
logger.info("【请求开始】推广管理->广告管理->编辑,请求参数:ad:{}", JSONObject.toJSONString(ad));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->广告管理->编辑,请求参数:ad:{}", JSONObject.toJSONString(ad));
|
||||
|
||||
Object error = validate(ad);
|
||||
if (error != null) {
|
||||
|
|
@ -120,7 +121,7 @@ public class AdminAdController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "广告管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsAd ad) {
|
||||
logger.info("【请求开始】推广管理->广告管理->删除,请求参数:ad:{}", JSONObject.toJSONString(ad));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->广告管理->删除,请求参数:ad:{}", JSONObject.toJSONString(ad));
|
||||
|
||||
Integer id = ad.getId();
|
||||
if (id == null) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -64,7 +65,7 @@ public class AdminAddressController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】用户管理->收货地址->查询,请求参数:name:{},userId:{},page:{}", name, userId, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->收货地址->查询,请求参数:name:{},userId:{},page:{}", name, userId, page);
|
||||
|
||||
List<DtsAddress> addressList = addressService.querySelective(userId, name, page, limit, sort, order);
|
||||
long total = PageInfo.of(addressList).getTotal();
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AdminResponseUtil;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.RegexUtil;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.util.bcrypt.BCryptPasswordEncoder;
|
||||
|
|
@ -51,7 +52,7 @@ public class AdminAdminController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】系统管理->管理员管理->查询,请求参数:username:{},page:{}", username, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->管理员管理->查询,请求参数:username:{},page:{}", username, page);
|
||||
|
||||
List<DtsAdmin> adminList = adminService.querySelective(username, page, limit, sort, order);
|
||||
long total = PageInfo.of(adminList).getTotal();
|
||||
|
|
@ -84,7 +85,7 @@ public class AdminAdminController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "管理员管理" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsAdmin admin) {
|
||||
logger.info("【请求开始】系统管理->管理员管理->添加,请求参数:{}", JSONObject.toJSONString(admin));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->管理员管理->添加,请求参数:{}", JSONObject.toJSONString(admin));
|
||||
|
||||
Object error = validate(admin);
|
||||
if (error != null) {
|
||||
|
|
@ -112,7 +113,7 @@ public class AdminAdminController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "管理员管理" }, button = "详情")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】系统管理->管理员管理->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->管理员管理->详情,请求参数,id:{}", id);
|
||||
|
||||
DtsAdmin admin = adminService.findById(id);
|
||||
|
||||
|
|
@ -124,7 +125,7 @@ public class AdminAdminController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "管理员管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsAdmin admin) {
|
||||
logger.info("【请求开始】系统管理->管理员管理->编辑,请求参数:{}", JSONObject.toJSONString(admin));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->管理员管理->编辑,请求参数:{}", JSONObject.toJSONString(admin));
|
||||
|
||||
Object error = validate(admin);
|
||||
if (error != null) {
|
||||
|
|
@ -154,7 +155,7 @@ public class AdminAdminController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "管理员管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsAdmin admin) {
|
||||
logger.info("【请求开始】系统管理->管理员管理->删除,请求参数:{}", JSONObject.toJSONString(admin));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->管理员管理->删除,请求参数:{}", JSONObject.toJSONString(admin));
|
||||
|
||||
Integer anotherAdminId = admin.getId();
|
||||
if (anotherAdminId == null) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.github.pagehelper.PageInfo;
|
|||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AdminResponseUtil;
|
||||
import com.qiguliuxing.dts.admin.util.ArticleType;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -62,7 +63,7 @@ public class AdminArticleController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】推广管理->公告管理->查询,请求参数:title:{},page:{}", title, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->公告管理->查询,请求参数:title:{},page:{}", title, page);
|
||||
|
||||
List<DtsArticle> articleList = articleService.querySelective(title, page, limit, sort, order);
|
||||
long total = PageInfo.of(articleList).getTotal();
|
||||
|
|
@ -85,7 +86,7 @@ public class AdminArticleController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "公告管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsArticle article) {
|
||||
logger.info("【请求开始】推广管理->公告管理->编辑,请求参数:{}", JSONObject.toJSONString(article));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->公告管理->编辑,请求参数:{}", JSONObject.toJSONString(article));
|
||||
Object error = validate(article);
|
||||
if (error != null) {
|
||||
return error;
|
||||
|
|
@ -111,7 +112,7 @@ public class AdminArticleController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "公告管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsArticle article) {
|
||||
logger.info("【请求开始】推广管理->公告管理->删除,请求参数:{}", JSONObject.toJSONString(article));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->公告管理->删除,请求参数:{}", JSONObject.toJSONString(article));
|
||||
Integer id = article.getId();
|
||||
if (id == null) {
|
||||
return ResponseUtil.badArgument();
|
||||
|
|
@ -135,7 +136,7 @@ public class AdminArticleController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "公告管理" }, button = "详情")
|
||||
@GetMapping("/detail")
|
||||
public Object detail(@NotNull Integer id) {
|
||||
logger.info("【请求开始】推广管理->公告管理->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->公告管理->详情,请求参数,id:{}", id);
|
||||
DtsArticle article = null;
|
||||
try {
|
||||
article = articleService.findById(id);
|
||||
|
|
@ -158,7 +159,7 @@ public class AdminArticleController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "公告管理" }, button = "发布")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsArticle article) {
|
||||
logger.info("【请求开始】推广管理->公告管理->发布公告,请求参数:{}", JSONObject.toJSONString(article));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->公告管理->发布公告,请求参数:{}", JSONObject.toJSONString(article));
|
||||
|
||||
Object error = validate(article);
|
||||
if (error != null) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.qiguliuxing.dts.admin.web;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
|
@ -7,6 +9,8 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.authc.AuthenticationException;
|
||||
import org.apache.shiro.authc.LockedAccountException;
|
||||
|
|
@ -31,8 +35,12 @@ import com.qiguliuxing.dts.admin.util.AdminResponseCode;
|
|||
import com.qiguliuxing.dts.admin.util.AdminResponseUtil;
|
||||
import com.qiguliuxing.dts.admin.util.Permission;
|
||||
import com.qiguliuxing.dts.admin.util.PermissionUtil;
|
||||
import com.qiguliuxing.dts.admin.util.VerifyCodeUtils;
|
||||
import com.qiguliuxing.dts.core.captcha.CaptchaCodeManager;
|
||||
import com.qiguliuxing.dts.core.util.Base64;
|
||||
import com.qiguliuxing.dts.core.util.JacksonUtil;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.util.UUID;
|
||||
import com.qiguliuxing.dts.db.domain.DtsAdmin;
|
||||
import com.qiguliuxing.dts.db.service.DtsPermissionService;
|
||||
import com.qiguliuxing.dts.db.service.DtsRoleService;
|
||||
|
|
@ -57,11 +65,23 @@ public class AdminAuthController {
|
|||
|
||||
String username = JacksonUtil.parseString(body, "username");
|
||||
String password = JacksonUtil.parseString(body, "password");
|
||||
String code = JacksonUtil.parseString(body, "code");
|
||||
String uuid = JacksonUtil.parseString(body, "uuid");
|
||||
|
||||
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) {
|
||||
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password) || StringUtils.isEmpty(code) || StringUtils.isEmpty(uuid)) {
|
||||
return ResponseUtil.badArgument();
|
||||
}
|
||||
|
||||
//验证码校验
|
||||
String cachedCaptcha = CaptchaCodeManager.getCachedCaptcha(uuid);
|
||||
if (cachedCaptcha == null) {
|
||||
logger.error("系统管理->用户登录 错误:{},", AdminResponseCode.AUTH_CAPTCHA_EXPIRED.desc());
|
||||
return AdminResponseUtil.fail(AdminResponseCode.AUTH_CAPTCHA_EXPIRED);
|
||||
}
|
||||
if (!code.equalsIgnoreCase(cachedCaptcha)) {
|
||||
logger.error("系统管理->用户登录 错误:{},输入验证码:{},后台验证码:{}", AdminResponseCode.AUTH_CAPTCHA_ERROR.desc(),code,cachedCaptcha);
|
||||
return AdminResponseUtil.fail(AdminResponseCode.AUTH_CAPTCHA_ERROR);
|
||||
}
|
||||
Subject currentUser = SecurityUtils.getSubject();
|
||||
try {
|
||||
currentUser.login(new UsernamePasswordToken(username, password));
|
||||
|
|
@ -82,7 +102,7 @@ public class AdminAuthController {
|
|||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* 用户注销
|
||||
*/
|
||||
@RequiresAuthentication
|
||||
@PostMapping("/logout")
|
||||
|
|
@ -142,11 +162,41 @@ public class AdminAuthController {
|
|||
apis.add("*");
|
||||
return apis;
|
||||
// return systemPermissionsMap.values();
|
||||
|
||||
}
|
||||
}
|
||||
return apis;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成验证码
|
||||
*/
|
||||
@GetMapping("/captchaImage")
|
||||
public Object getCode(HttpServletResponse response) throws IOException {
|
||||
// 生成随机字串
|
||||
String verifyCode = VerifyCodeUtils.generateVerifyCode(4);
|
||||
// 唯一标识
|
||||
String uuid = UUID.randomUUID().toString(true);
|
||||
boolean successful = CaptchaCodeManager.addToCache(uuid, verifyCode,10);//存储内存
|
||||
if (!successful) {
|
||||
logger.error("请求验证码出错:{}", AdminResponseCode.AUTH_CAPTCHA_FREQUENCY.desc());
|
||||
return AdminResponseUtil.fail(AdminResponseCode.AUTH_CAPTCHA_FREQUENCY);
|
||||
}
|
||||
// 生成图片
|
||||
int w = 111, h = 36;
|
||||
ByteArrayOutputStream stream = new ByteArrayOutputStream();
|
||||
VerifyCodeUtils.outputImage(w, h, stream, verifyCode);
|
||||
try {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("uuid", uuid);
|
||||
data.put("img", Base64.encode(stream.toByteArray()));
|
||||
return ResponseUtil.ok(data);
|
||||
} catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return ResponseUtil.serious();
|
||||
} finally {
|
||||
stream.close();
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping("/401")
|
||||
public Object page401() {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.service.AdminBrandService;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.admin.util.DtsBrandVo;
|
||||
import com.qiguliuxing.dts.core.qcode.QCodeService;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
|
|
@ -61,7 +62,7 @@ public class AdminBrandController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】商场管理->品牌管理->查询,请求参数:name:{},page:{}", name, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->品牌管理->查询,请求参数:name:{},page:{}", name, page);
|
||||
|
||||
List<DtsBrand> brandList = brandService.querySelective(id, name, page, limit, sort, order);
|
||||
long total = PageInfo.of(brandList).getTotal();
|
||||
|
|
@ -112,7 +113,7 @@ public class AdminBrandController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "品牌管理" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsBrand brand) {
|
||||
logger.info("【请求开始】商场管理->品牌管理->添加,请求参数:{}", JSONObject.toJSONString(brand));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->品牌管理->添加,请求参数:{}", JSONObject.toJSONString(brand));
|
||||
Object error = validate(brand);
|
||||
if (error != null) {
|
||||
return error;
|
||||
|
|
@ -121,7 +122,7 @@ public class AdminBrandController {
|
|||
try {
|
||||
//生成店铺的分享URL
|
||||
String defaultCategory = brandService.getBrandCategory(brand.getDefaultCategoryId());
|
||||
String shareUrl = qCodeService.createBrandImage(brand.getId(), brand.getPicUrl(), brand.getName(),defaultCategory);
|
||||
String shareUrl = qCodeService.createBrandImage(null,brand.getId(), brand.getPicUrl(), brand.getName(),defaultCategory);
|
||||
brand.setShareUrl(shareUrl);
|
||||
} catch (Exception e) {
|
||||
logger.error("生成品牌商铺分享图URL出错:{}",e.getMessage());
|
||||
|
|
@ -137,7 +138,7 @@ public class AdminBrandController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "品牌管理" }, button = "详情")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】商场管理->品牌管理->详情,请求参数, id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->品牌管理->详情,请求参数, id:{}", id);
|
||||
|
||||
DtsBrand brand = brandService.findById(id);
|
||||
|
||||
|
|
@ -149,7 +150,7 @@ public class AdminBrandController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "品牌管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsBrand brand) {
|
||||
logger.info("【请求开始】商场管理->品牌管理->编辑,请求参数, id:{}", JSONObject.toJSONString(brand));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->品牌管理->编辑,请求参数, id:{}", JSONObject.toJSONString(brand));
|
||||
|
||||
Object error = validate(brand);
|
||||
if (error != null) {
|
||||
|
|
@ -158,7 +159,7 @@ public class AdminBrandController {
|
|||
try {
|
||||
//生成店铺的分享URL
|
||||
String defaultCategory = brandService.getBrandCategory(brand.getDefaultCategoryId());
|
||||
String shareUrl = qCodeService.createBrandImage(brand.getId(), brand.getPicUrl(), brand.getName(),defaultCategory);
|
||||
String shareUrl = qCodeService.createBrandImage(null,brand.getId(), brand.getPicUrl(), brand.getName(),defaultCategory);
|
||||
brand.setShareUrl(shareUrl);
|
||||
} catch (Exception e) {
|
||||
logger.error("生成品牌商铺分享图URL出错:{}",e.getMessage());
|
||||
|
|
@ -177,7 +178,7 @@ public class AdminBrandController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "品牌管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsBrand brand) {
|
||||
logger.info("【请求开始】商场管理->品牌管理->删除,请求参数:{}", JSONObject.toJSONString(brand));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->品牌管理->删除,请求参数:{}", JSONObject.toJSONString(brand));
|
||||
|
||||
Integer id = brand.getId();
|
||||
if (id == null) {
|
||||
|
|
@ -192,7 +193,7 @@ public class AdminBrandController {
|
|||
|
||||
@GetMapping("/catAndAdmin")
|
||||
public Object catAndAdmin() {
|
||||
logger.info("【请求开始】商场管理->品牌管理->获取目录与管理用户");
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->品牌管理->获取目录与管理用户");
|
||||
return adminBrandService.catAndAdmin();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,17 +10,24 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.JacksonUtil;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
import com.qiguliuxing.dts.db.domain.DtsAccountTrace;
|
||||
import com.qiguliuxing.dts.db.domain.DtsUser;
|
||||
import com.qiguliuxing.dts.db.service.DtsAccountService;
|
||||
import com.qiguliuxing.dts.db.service.DtsUserService;
|
||||
|
||||
/**
|
||||
* 佣金业务接口
|
||||
|
|
@ -37,17 +44,21 @@ public class AdminBrokerageController {
|
|||
|
||||
@Autowired
|
||||
private DtsAccountService accountService;
|
||||
|
||||
@Autowired
|
||||
private DtsUserService userService;
|
||||
|
||||
@RequiresPermissions("admin:brokerage:list")
|
||||
@RequiresPermissionsDesc(menu = { "用户管理", "佣金管理" }, button = "查询")
|
||||
@GetMapping("/list")
|
||||
public Object list(String username, String mobile,String type,@RequestParam(defaultValue = "1") Integer page,
|
||||
public Object list(String username, String mobile,@RequestParam(required = false) List<Byte> statusArray,@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "trace_time") String sort,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】用户管理->佣金管理->查询,请求参数,username:{},mobile:{},type:{},page:{}", username, mobile, type,page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->佣金管理->查询,请求参数,username:{},mobile:{},status:{},page:{}", username, mobile, JSONObject.toJSONString(statusArray),page);
|
||||
|
||||
List<DtsAccountTrace> traceList = accountService.querySelective(username, mobile, type, page, limit, sort, order);
|
||||
List<DtsUser> userList = userService.queryDtsUserListByNickname(username, mobile);
|
||||
List<DtsAccountTrace> traceList = accountService.querySelectiveTrace(userList,statusArray, page, limit, sort, order);
|
||||
long total = PageInfo.of(traceList).getTotal();
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", total);
|
||||
|
|
@ -57,4 +68,23 @@ public class AdminBrokerageController {
|
|||
return ResponseUtil.ok(data);
|
||||
}
|
||||
|
||||
@RequiresPermissions("admin:brokerage:approve")
|
||||
@RequiresPermissionsDesc(menu = { "用户管理", "佣金管理" }, button = "审批销账")
|
||||
@PostMapping("/approve")
|
||||
public Object approve(@RequestBody String body) {
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->佣金管理->审批销账,请求参数:{}",body);
|
||||
Integer traceId = JacksonUtil.parseInteger(body, "id");
|
||||
String traceMsg = JacksonUtil.parseString(body, "traceMsg");
|
||||
Byte status = JacksonUtil.parseByte(body, "status");
|
||||
boolean approveResult = accountService.approveAccountTrace(traceId,status, traceMsg);
|
||||
|
||||
if (!approveResult) {
|
||||
logger.info("用户管理->佣金管理->审批销账失败:{}", "审批处理错误!");
|
||||
return ResponseUtil.updatedDataFailed();
|
||||
}
|
||||
|
||||
logger.info("【请求结束】用户管理->佣金管理->审批销账,响应结果:{}", "成功!");
|
||||
return ResponseUtil.ok();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -45,7 +46,7 @@ public class AdminCategoryController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】商场管理->类目管理->查询,请求参数:name:{},page:{}", name, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->类目管理->查询,请求参数:name:{},page:{}", name, page);
|
||||
|
||||
List<DtsCategory> collectList = categoryService.querySelective(id, name, page, limit, sort, order);
|
||||
long total = PageInfo.of(collectList).getTotal();
|
||||
|
|
@ -83,7 +84,7 @@ public class AdminCategoryController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "类目管理" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsCategory category) {
|
||||
logger.info("【请求开始】商场管理->类目管理->添加,请求参数:{}", JSONObject.toJSONString(category));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->类目管理->添加,请求参数:{}", JSONObject.toJSONString(category));
|
||||
|
||||
Object error = validate(category);
|
||||
if (error != null) {
|
||||
|
|
@ -99,7 +100,7 @@ public class AdminCategoryController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "类目管理" }, button = "详情")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】商场管理->类目管理->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->类目管理->详情,请求参数,id:{}", id);
|
||||
|
||||
DtsCategory category = categoryService.findById(id);
|
||||
|
||||
|
|
@ -111,7 +112,7 @@ public class AdminCategoryController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "类目管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsCategory category) {
|
||||
logger.info("【请求开始】商场管理->类目管理->编辑,请求参数:{}", JSONObject.toJSONString(category));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->类目管理->编辑,请求参数:{}", JSONObject.toJSONString(category));
|
||||
|
||||
Object error = validate(category);
|
||||
if (error != null) {
|
||||
|
|
@ -131,7 +132,7 @@ public class AdminCategoryController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "类目管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsCategory category) {
|
||||
logger.info("【请求开始】商场管理->类目管理->删除,请求参数:{}", JSONObject.toJSONString(category));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->类目管理->删除,请求参数:{}", JSONObject.toJSONString(category));
|
||||
|
||||
Integer id = category.getId();
|
||||
if (id == null) {
|
||||
|
|
@ -146,7 +147,7 @@ public class AdminCategoryController {
|
|||
@RequiresPermissions("admin:category:list")
|
||||
@GetMapping("/l1")
|
||||
public Object catL1() {
|
||||
logger.info("【请求开始】商场管理->类目管理->一级分类目录查询");
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->类目管理->一级分类目录查询");
|
||||
|
||||
// 所有一级分类目录
|
||||
List<DtsCategory> l1CatList = categoryService.queryL1();
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -39,7 +40,7 @@ public class AdminCollectController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】用户管理->用户收藏->查询,请求参数:userId:{},page:{}", userId, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->用户收藏->查询,请求参数:userId:{},page:{}", userId, page);
|
||||
|
||||
List<DtsCollect> collectList = collectService.querySelective(userId, valueId, page, limit, sort, order);
|
||||
long total = PageInfo.of(collectList).getTotal();
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.service.AdminDataAuthService;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -33,6 +35,9 @@ public class AdminCommentController {
|
|||
|
||||
@Autowired
|
||||
private DtsCommentService commentService;
|
||||
|
||||
@Autowired
|
||||
private AdminDataAuthService adminDataAuthService;
|
||||
|
||||
@RequiresPermissions("admin:comment:list")
|
||||
@RequiresPermissionsDesc(menu = { "商品管理", "评论管理" }, button = "查询")
|
||||
|
|
@ -41,15 +46,37 @@ public class AdminCommentController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】商品管理->评论管理->查询,请求参数:userId:{},page:{}", userId, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商品管理->评论管理->查询,请求参数:userId:{},page:{}", userId, page);
|
||||
|
||||
List<DtsComment> brandList = commentService.querySelective(userId, valueId, page, limit, sort, order);
|
||||
long total = PageInfo.of(brandList).getTotal();
|
||||
// 需要区分数据权限,如果属于品牌商管理员,则需要获取当前用户管理品牌店铺
|
||||
List<Integer> brandIds = null;
|
||||
if (adminDataAuthService.isBrandManager()) {
|
||||
brandIds = adminDataAuthService.getBrandIds();
|
||||
logger.info("运营商管理角色操作,需控制数据权限,brandIds:{}", JSONObject.toJSONString(brandIds));
|
||||
|
||||
if (brandIds == null || brandIds.size() == 0) {// 如果尚未管理任何入驻店铺,则返回空数据
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", 0L);
|
||||
data.put("items", null);
|
||||
|
||||
logger.info("【请求结束】商品管理->评论管理->查询:{}", JSONObject.toJSONString(data));
|
||||
return ResponseUtil.ok(data);
|
||||
}
|
||||
}
|
||||
List<DtsComment> commentList = null;
|
||||
long total = 0L;
|
||||
if (brandIds == null || brandIds.size() == 0) {
|
||||
commentList = commentService.querySelective(userId, valueId, page, limit, sort, order);
|
||||
total = PageInfo.of(commentList).getTotal();
|
||||
} else {
|
||||
commentList = commentService.queryBrandCommentSelective(brandIds,userId, valueId, page, limit, sort, order);
|
||||
total = PageInfo.of(commentList).getTotal();
|
||||
}
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", total);
|
||||
data.put("items", brandList);
|
||||
data.put("items", commentList);
|
||||
|
||||
logger.info("【请求结束】商品管理->评论管理->查询:total:{}", JSONObject.toJSONString(data));
|
||||
logger.info("【请求结束】商品管理->评论管理->查询:total:{}", total);
|
||||
return ResponseUtil.ok(data);
|
||||
}
|
||||
|
||||
|
|
@ -57,7 +84,7 @@ public class AdminCommentController {
|
|||
@RequiresPermissionsDesc(menu = { "商品管理", "评论管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsComment comment) {
|
||||
logger.info("【请求开始】商品管理->评论管理->删除,请求参数:{}", JSONObject.toJSONString(comment));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商品管理->评论管理->删除,请求参数:{}", JSONObject.toJSONString(comment));
|
||||
|
||||
Integer id = comment.getId();
|
||||
if (id == null) {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -49,7 +50,7 @@ public class AdminCouponController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】推广管理->优惠券管理->查询,请求参数:name:{},page:{}", name, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->优惠券管理->查询,请求参数:name:{},page:{}", name, page);
|
||||
|
||||
List<DtsCoupon> couponList = couponService.querySelective(name, type, status, page, limit, sort, order);
|
||||
long total = PageInfo.of(couponList).getTotal();
|
||||
|
|
@ -68,7 +69,7 @@ public class AdminCouponController {
|
|||
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】推广管理->优惠券管理->查询用户,请求参数:userId:{},couponId:{}", userId, couponId);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->优惠券管理->查询用户,请求参数:userId:{},couponId:{}", userId, couponId);
|
||||
|
||||
List<DtsCouponUser> couponList = couponUserService.queryList(userId, couponId, status, page, limit, sort,
|
||||
order);
|
||||
|
|
@ -93,7 +94,7 @@ public class AdminCouponController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "优惠券管理" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsCoupon coupon) {
|
||||
logger.info("【请求开始】推广管理->优惠券管理->添加,请求参数:{}", JSONObject.toJSONString(coupon));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->优惠券管理->添加,请求参数:{}", JSONObject.toJSONString(coupon));
|
||||
|
||||
Object error = validate(coupon);
|
||||
if (error != null) {
|
||||
|
|
@ -116,7 +117,7 @@ public class AdminCouponController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "优惠券管理" }, button = "详情")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】推广管理->优惠券管理->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->优惠券管理->详情,请求参数,id:{}", id);
|
||||
|
||||
DtsCoupon coupon = couponService.findById(id);
|
||||
|
||||
|
|
@ -128,7 +129,7 @@ public class AdminCouponController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "优惠券管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsCoupon coupon) {
|
||||
logger.info("【请求开始】推广管理->优惠券管理->编辑,请求参数:{}", JSONObject.toJSONString(coupon));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->优惠券管理->编辑,请求参数:{}", JSONObject.toJSONString(coupon));
|
||||
|
||||
Object error = validate(coupon);
|
||||
if (error != null) {
|
||||
|
|
@ -146,7 +147,7 @@ public class AdminCouponController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "优惠券管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsCoupon coupon) {
|
||||
logger.info("【请求开始】推广管理->优惠券管理->删除,请求参数:{}", JSONObject.toJSONString(coupon));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->优惠券管理->删除,请求参数:{}", JSONObject.toJSONString(coupon));
|
||||
|
||||
couponService.deleteById(coupon.getId());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,13 @@
|
|||
package com.qiguliuxing.dts.admin.web;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
|
@ -12,7 +18,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.qiguliuxing.dts.admin.dao.CategorySellVo;
|
||||
import com.qiguliuxing.dts.admin.dao.OrderAmtsVo;
|
||||
import com.qiguliuxing.dts.admin.dao.UserOrderCntVo;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.db.bean.CategorySellAmts;
|
||||
import com.qiguliuxing.dts.db.bean.DayStatis;
|
||||
import com.qiguliuxing.dts.db.service.DtsGoodsProductService;
|
||||
import com.qiguliuxing.dts.db.service.DtsGoodsService;
|
||||
import com.qiguliuxing.dts.db.service.DtsOrderService;
|
||||
|
|
@ -24,6 +36,8 @@ import com.qiguliuxing.dts.db.service.DtsUserService;
|
|||
public class AdminDashbordController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(AdminDashbordController.class);
|
||||
|
||||
private static final int STATIS_DAYS_RANG = 30;// 统计的天数范围,一个月数据
|
||||
|
||||
@Autowired
|
||||
private DtsUserService userService;
|
||||
@Autowired
|
||||
|
|
@ -35,7 +49,7 @@ public class AdminDashbordController {
|
|||
|
||||
@GetMapping("")
|
||||
public Object info() {
|
||||
logger.info("【请求开始】系统管理->首页仪表盘查询");
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName() + "] 系统管理->首页仪表盘查询");
|
||||
|
||||
int userTotal = userService.count();
|
||||
int goodsTotal = goodsService.count();
|
||||
|
|
@ -51,4 +65,128 @@ public class AdminDashbordController {
|
|||
return ResponseUtil.ok(data);
|
||||
}
|
||||
|
||||
@GetMapping("/chart")
|
||||
public Object chart() {
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName() + "] 系统管理->首页图表查询");
|
||||
|
||||
// 近期用户,订单增长量查询
|
||||
UserOrderCntVo userOrderCnt = new UserOrderCntVo();
|
||||
List<DayStatis> userCnts = userService.recentCount(STATIS_DAYS_RANG);
|
||||
List<DayStatis> orderCnts = orderService.recentCount(STATIS_DAYS_RANG);
|
||||
|
||||
String[] dayData = unionDayData(userCnts, orderCnts);
|
||||
userOrderCnt.setDayData(dayData);
|
||||
userOrderCnt.setUserCnt(fetchArrCnt(dayData, userCnts));
|
||||
userOrderCnt.setOrderCnt(fetchArrCnt(dayData, orderCnts));
|
||||
|
||||
// 订单请款统计,订单笔数与订单金额
|
||||
OrderAmtsVo orderAmts = fetchOrderAmtsVo(orderCnts);
|
||||
|
||||
// 大类销售统计情况
|
||||
List<CategorySellAmts> categorySellStatis = orderService.categorySell();// 统计总量
|
||||
CategorySellVo categorySell = fetchCategorySell(categorySellStatis);
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("userOrderCnt", userOrderCnt);
|
||||
data.put("orderAmts", orderAmts);
|
||||
data.put("categorySell", categorySell);
|
||||
|
||||
logger.info("【请求结束】系统管理->首页图表查询:响应结果:{}", JSONObject.toJSONString(data));
|
||||
return ResponseUtil.ok(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取日期数据并排序
|
||||
*
|
||||
* @param userCnts
|
||||
* @param orderCnts
|
||||
* @return
|
||||
*/
|
||||
private String[] unionDayData(List<DayStatis> userCnts, List<DayStatis> orderCnts) {
|
||||
Set<String> days = new HashSet<>();
|
||||
for (DayStatis userCnt : userCnts) {
|
||||
days.add(userCnt.getDayStr());
|
||||
}
|
||||
for (DayStatis orderCnt : orderCnts) {
|
||||
days.add(orderCnt.getDayStr());
|
||||
}
|
||||
|
||||
/*days.stream().sorted(Comparator.reverseOrder());// 排序
|
||||
return days.toArray(new String[days.size()]);*/
|
||||
|
||||
List<String> list = new ArrayList<String>(days);
|
||||
Collections.sort(list);
|
||||
return list.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从统计集合中获取数量 不存在则设置 0
|
||||
*
|
||||
* @param dayData
|
||||
* @param dayStatisCnts
|
||||
* @return
|
||||
*/
|
||||
private int[] fetchArrCnt(String[] dayData, List<DayStatis> dayStatisCnts) {
|
||||
int[] arrCnts = new int[dayData.length];
|
||||
for (int i = 0; i < dayData.length; i++) {
|
||||
int dayCnt = 0;
|
||||
String dayStr = dayData[i];
|
||||
for (DayStatis ds : dayStatisCnts) {
|
||||
if (dayStr.equals(ds.getDayStr())) {
|
||||
dayCnt = ds.getCnts();
|
||||
break;
|
||||
}
|
||||
}
|
||||
arrCnts[i] = dayCnt;
|
||||
}
|
||||
return arrCnts;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单统计数据
|
||||
*
|
||||
* @param orderCnts
|
||||
* @return
|
||||
*/
|
||||
private OrderAmtsVo fetchOrderAmtsVo(List<DayStatis> orderCnts) {
|
||||
OrderAmtsVo orderAmts = new OrderAmtsVo();
|
||||
int size = 0;
|
||||
if (orderCnts != null && orderCnts.size() > 0) {
|
||||
size = orderCnts.size();
|
||||
}
|
||||
String[] dayData = new String[size];
|
||||
int[] orderCntData = new int[size];
|
||||
BigDecimal[] orderAmtData = new BigDecimal[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
dayData[i] = orderCnts.get(i).getDayStr();
|
||||
orderCntData[i] = orderCnts.get(i).getCnts();
|
||||
orderAmtData[i] = orderCnts.get(i).getAmts();
|
||||
}
|
||||
orderAmts.setDayData(dayData);
|
||||
orderAmts.setOrderAmtData(orderAmtData);
|
||||
orderAmts.setOrderCntData(orderCntData);
|
||||
return orderAmts;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取大类的销售统计数据
|
||||
*
|
||||
* @param categorySellStatis
|
||||
* @return
|
||||
*/
|
||||
private CategorySellVo fetchCategorySell(List<CategorySellAmts> categorySellData) {
|
||||
CategorySellVo categorySell = new CategorySellVo();
|
||||
int size = 0;
|
||||
if (categorySellData != null && categorySellData.size() > 0) {
|
||||
size = categorySellData.size();
|
||||
}
|
||||
String[] categoryNames = new String[size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
categoryNames[i] = categorySellData.get(i).getName();
|
||||
}
|
||||
categorySell.setCategoryNames(categoryNames);
|
||||
categorySell.setCategorySellData(categorySellData);
|
||||
return categorySell;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -44,7 +45,7 @@ public class AdminFeedbackController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】用户管理->意见反馈->查询,请求参数:userId:{},username:{},page:{}", userId, username, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->意见反馈->查询,请求参数:userId:{},username:{},page:{}", userId, username, page);
|
||||
|
||||
List<DtsFeedback> feedbackList = feedbackService.querySelective(userId, username, page, limit, sort, order);
|
||||
long total = PageInfo.of(feedbackList).getTotal();
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -39,7 +40,7 @@ public class AdminFootprintController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】用户管理->用户足迹->查询,请求参数:userId:{},goodsId:{},page:{}", userId, goodsId, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->用户足迹->查询,请求参数:userId:{},goodsId:{},page:{}", userId, goodsId, page);
|
||||
|
||||
List<DtsFootprint> footprintList = footprintService.querySelective(userId, goodsId, page, limit, sort, order);
|
||||
long total = PageInfo.of(footprintList).getTotal();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.qiguliuxing.dts.admin.web;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -17,7 +21,10 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.dao.GoodsAllinone;
|
||||
import com.qiguliuxing.dts.admin.service.AdminDataAuthService;
|
||||
import com.qiguliuxing.dts.admin.service.AdminGoodsService;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
import com.qiguliuxing.dts.db.domain.DtsGoods;
|
||||
|
|
@ -30,6 +37,9 @@ public class AdminGoodsController {
|
|||
|
||||
@Autowired
|
||||
private AdminGoodsService adminGoodsService;
|
||||
|
||||
@Autowired
|
||||
private AdminDataAuthService adminDataAuthService;
|
||||
|
||||
/**
|
||||
* 查询商品
|
||||
|
|
@ -49,9 +59,25 @@ public class AdminGoodsController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】商品管理->商品管理->查询,请求参数:goodsSn:{},name:{},page:{}", goodsSn, name, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商品管理->商品管理->查询,请求参数:goodsSn:{},name:{},page:{}", goodsSn, name, page);
|
||||
|
||||
return adminGoodsService.list(goodsSn, name, page, limit, sort, order);
|
||||
//需要区分数据权限,如果属于品牌商管理员,则需要获取当前用户管理品牌店铺
|
||||
List<Integer> brandIds = null;
|
||||
if (adminDataAuthService.isBrandManager()) {
|
||||
brandIds = adminDataAuthService.getBrandIds();
|
||||
logger.info("运营商管理角色操作,需控制数据权限,brandIds:{}",JSONObject.toJSONString(brandIds));
|
||||
|
||||
if (brandIds == null || brandIds.size() == 0) {
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", 0L);
|
||||
data.put("items", null);
|
||||
|
||||
logger.info("【请求结束】商品管理->商品管理->查询,响应结果:{}", JSONObject.toJSONString(data));
|
||||
return ResponseUtil.ok(data);
|
||||
}
|
||||
}
|
||||
|
||||
return adminGoodsService.list(goodsSn, name, page, limit, sort, order, brandIds);
|
||||
}
|
||||
|
||||
@GetMapping("/catAndBrand")
|
||||
|
|
@ -69,7 +95,7 @@ public class AdminGoodsController {
|
|||
@RequiresPermissionsDesc(menu = { "商品管理", "商品管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody GoodsAllinone goodsAllinone) {
|
||||
logger.info("【请求开始】商品管理->商品管理->编辑,请求参数:{}", JSONObject.toJSONString(goodsAllinone));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商品管理->商品管理->编辑,请求参数:{}", JSONObject.toJSONString(goodsAllinone));
|
||||
|
||||
return adminGoodsService.update(goodsAllinone);
|
||||
}
|
||||
|
|
@ -84,7 +110,7 @@ public class AdminGoodsController {
|
|||
@RequiresPermissionsDesc(menu = { "商品管理", "商品管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsGoods goods) {
|
||||
logger.info("【请求开始】商品管理->商品管理->删除,请求参数:{}", JSONObject.toJSONString(goods));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商品管理->商品管理->删除,请求参数:{}", JSONObject.toJSONString(goods));
|
||||
|
||||
return adminGoodsService.delete(goods);
|
||||
}
|
||||
|
|
@ -99,7 +125,7 @@ public class AdminGoodsController {
|
|||
@RequiresPermissionsDesc(menu = { "商品管理", "商品管理" }, button = "上架")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody GoodsAllinone goodsAllinone) {
|
||||
logger.info("【请求开始】商品管理->商品管理->上架,请求参数:{}", JSONObject.toJSONString(goodsAllinone));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商品管理->商品管理->上架,请求参数:{}", JSONObject.toJSONString(goodsAllinone));
|
||||
|
||||
return adminGoodsService.create(goodsAllinone);
|
||||
}
|
||||
|
|
@ -114,7 +140,7 @@ public class AdminGoodsController {
|
|||
@RequiresPermissionsDesc(menu = { "商品管理", "商品管理" }, button = "详情")
|
||||
@GetMapping("/detail")
|
||||
public Object detail(@NotNull Integer id) {
|
||||
logger.info("【请求开始】商品管理->商品管理->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商品管理->商品管理->详情,请求参数,id:{}", id);
|
||||
|
||||
return adminGoodsService.detail(id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.service.AdminDataAuthService;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -44,18 +46,43 @@ public class AdminGrouponController {
|
|||
private DtsGoodsService goodsService;
|
||||
@Autowired
|
||||
private DtsGrouponService grouponService;
|
||||
@Autowired
|
||||
private AdminDataAuthService adminDataAuthService;
|
||||
|
||||
@RequiresPermissions("admin:groupon:read")
|
||||
@RequiresPermissionsDesc(menu = { "推广管理", "团购管理" }, button = "详情")
|
||||
@GetMapping("/listRecord")
|
||||
public Object listRecord(String grouponId, @RequestParam(defaultValue = "1") Integer page,
|
||||
public Object listRecord(String rulesId, @RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】推广管理->团购管理->详情,请求参数:grouponId:{},page:{}", grouponId, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->团购管理->详情,请求参数:rulesId:{},page:{}", rulesId, page);
|
||||
|
||||
List<DtsGroupon> grouponList = grouponService.querySelective(grouponId, page, limit, sort, order);
|
||||
long total = PageInfo.of(grouponList).getTotal();
|
||||
// 需要区分数据权限,如果属于品牌商管理员,则需要获取当前用户管理品牌店铺
|
||||
List<Integer> brandIds = null;
|
||||
if (adminDataAuthService.isBrandManager()) {
|
||||
brandIds = adminDataAuthService.getBrandIds();
|
||||
logger.info("运营商管理角色操作,需控制数据权限,brandIds:{}", JSONObject.toJSONString(brandIds));
|
||||
|
||||
if (brandIds == null || brandIds.size() == 0) {// 如果尚未管理任何入驻店铺,则返回空数据
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", 0L);
|
||||
data.put("items", null);
|
||||
|
||||
logger.info("【请求结束】推广管理->团购管理->详情,响应结果:{}", JSONObject.toJSONString(data));
|
||||
return ResponseUtil.ok(data);
|
||||
}
|
||||
}
|
||||
|
||||
List<DtsGroupon> grouponList = null;
|
||||
long total = 0L;
|
||||
if (brandIds == null || brandIds.size() == 0) {
|
||||
grouponList = grouponService.querySelective(rulesId, page, limit, sort, order);
|
||||
total = PageInfo.of(grouponList).getTotal();
|
||||
} else {
|
||||
grouponList = grouponService.queryBrandGroupons(brandIds,rulesId, page, limit, sort, order);
|
||||
total = PageInfo.of(grouponList).getTotal();
|
||||
}
|
||||
|
||||
List<Map<String, Object>> records = new ArrayList<>();
|
||||
for (DtsGroupon groupon : grouponList) {
|
||||
|
|
@ -91,10 +118,33 @@ public class AdminGrouponController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】推广管理->团购管理->查询,请求参数:goodsId:{},page:{}", goodsId, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->团购管理->查询,请求参数:goodsId:{},page:{}", goodsId, page);
|
||||
|
||||
List<DtsGrouponRules> rulesList = rulesService.querySelective(goodsId, page, limit, sort, order);
|
||||
long total = PageInfo.of(rulesList).getTotal();
|
||||
// 需要区分数据权限,如果属于品牌商管理员,则需要获取当前用户管理品牌店铺
|
||||
List<Integer> brandIds = null;
|
||||
if (adminDataAuthService.isBrandManager()) {
|
||||
brandIds = adminDataAuthService.getBrandIds();
|
||||
logger.info("运营商管理角色操作,需控制数据权限,brandIds:{}", JSONObject.toJSONString(brandIds));
|
||||
|
||||
if (brandIds == null || brandIds.size() == 0) {// 如果尚未管理任何入驻店铺,则返回空数据
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", 0L);
|
||||
data.put("items", null);
|
||||
|
||||
logger.info("【请求结束】推广管理->团购管理->查询,响应结果:{}", JSONObject.toJSONString(data));
|
||||
return ResponseUtil.ok(data);
|
||||
}
|
||||
}
|
||||
|
||||
List<DtsGrouponRules> rulesList = null;
|
||||
long total = 0L;
|
||||
if (brandIds == null || brandIds.size() == 0) {
|
||||
rulesList = rulesService.querySelective(goodsId, page, limit, sort, order);
|
||||
total = PageInfo.of(rulesList).getTotal();
|
||||
} else {
|
||||
rulesList = rulesService.queryBrandGrouponRules(brandIds,goodsId, page, limit, sort, order);
|
||||
total = PageInfo.of(rulesList).getTotal();
|
||||
}
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("total", total);
|
||||
data.put("items", rulesList);
|
||||
|
|
@ -128,7 +178,7 @@ public class AdminGrouponController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "团购管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsGrouponRules grouponRules) {
|
||||
logger.info("【请求开始】推广管理->团购管理->编辑,请求参数:{}", JSONObject.toJSONString(grouponRules));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->团购管理->编辑,请求参数:{}", JSONObject.toJSONString(grouponRules));
|
||||
|
||||
Object error = validate(grouponRules);
|
||||
if (error != null) {
|
||||
|
|
@ -157,7 +207,7 @@ public class AdminGrouponController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "团购管理" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsGrouponRules grouponRules) {
|
||||
logger.info("【请求开始】推广管理->团购管理->添加,请求参数:{}", JSONObject.toJSONString(grouponRules));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->团购管理->添加,请求参数:{}", JSONObject.toJSONString(grouponRules));
|
||||
|
||||
Object error = validate(grouponRules);
|
||||
if (error != null) {
|
||||
|
|
@ -194,7 +244,7 @@ public class AdminGrouponController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "团购管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsGrouponRules grouponRules) {
|
||||
logger.info("【请求开始】推广管理->团购管理->删除,请求参数:{}", JSONObject.toJSONString(grouponRules));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->团购管理->删除,请求参数:{}", JSONObject.toJSONString(grouponRules));
|
||||
|
||||
Integer id = grouponRules.getId();
|
||||
if (id == null) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -37,7 +38,7 @@ public class AdminHistoryController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】用户管理->搜索历史->查询,请求参数:userId:{},keyword:{},page:{}", userId, keyword, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->搜索历史->查询,请求参数:userId:{},keyword:{},page:{}", userId, keyword, page);
|
||||
|
||||
List<DtsSearchHistory> footprintList = searchHistoryService.querySelective(userId, keyword, page, limit, sort,
|
||||
order);
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -44,7 +45,7 @@ public class AdminIssueController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】商场管理->通用问题->查询,请求参数:question:{},page:{}", question, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->通用问题->查询,请求参数:question:{},page:{}", question, page);
|
||||
|
||||
List<DtsIssue> issueList = issueService.querySelective(question, page, limit, sort, order);
|
||||
long total = PageInfo.of(issueList).getTotal();
|
||||
|
|
@ -72,7 +73,7 @@ public class AdminIssueController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "通用问题" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsIssue issue) {
|
||||
logger.info("【请求开始】商场管理->通用问题->添加,请求参数:question:{},page:{}", JSONObject.toJSONString(issue));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->通用问题->添加,请求参数:question:{},page:{}", JSONObject.toJSONString(issue));
|
||||
|
||||
Object error = validate(issue);
|
||||
if (error != null) {
|
||||
|
|
@ -87,7 +88,7 @@ public class AdminIssueController {
|
|||
@RequiresPermissions("admin:issue:read")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】商场管理->通用问题->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->通用问题->详情,请求参数,id:{}", id);
|
||||
|
||||
DtsIssue issue = issueService.findById(id);
|
||||
|
||||
|
|
@ -99,7 +100,7 @@ public class AdminIssueController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "通用问题" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsIssue issue) {
|
||||
logger.info("【请求开始】商场管理->通用问题->编辑,请求参数:{}", JSONObject.toJSONString(issue));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->通用问题->编辑,请求参数:{}", JSONObject.toJSONString(issue));
|
||||
|
||||
Object error = validate(issue);
|
||||
if (error != null) {
|
||||
|
|
@ -118,7 +119,7 @@ public class AdminIssueController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "通用问题" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsIssue issue) {
|
||||
logger.info("【请求开始】商场管理->通用问题->删除,请求参数:{}", JSONObject.toJSONString(issue));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->通用问题->删除,请求参数:{}", JSONObject.toJSONString(issue));
|
||||
|
||||
Integer id = issue.getId();
|
||||
if (id == null) {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -44,7 +45,7 @@ public class AdminKeywordController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】商场管理->关键词->查询,请求参数:keyword:{},url:{},page:{}", keyword, url, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->关键词->查询,请求参数:keyword:{},url:{},page:{}", keyword, url, page);
|
||||
|
||||
List<DtsKeyword> brandList = keywordService.querySelective(keyword, url, page, limit, sort, order);
|
||||
long total = PageInfo.of(brandList).getTotal();
|
||||
|
|
@ -72,7 +73,7 @@ public class AdminKeywordController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "关键词" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsKeyword keywords) {
|
||||
logger.info("【请求开始】商场管理->关键词->添加,请求参数:{}", JSONObject.toJSONString(keywords));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->关键词->添加,请求参数:{}", JSONObject.toJSONString(keywords));
|
||||
|
||||
Object error = validate(keywords);
|
||||
if (error != null) {
|
||||
|
|
@ -88,7 +89,7 @@ public class AdminKeywordController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "关键词" }, button = "详情")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】商场管理->关键词->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->关键词->详情,请求参数,id:{}", id);
|
||||
|
||||
DtsKeyword keywords = keywordService.findById(id);
|
||||
|
||||
|
|
@ -100,7 +101,7 @@ public class AdminKeywordController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "关键词" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsKeyword keywords) {
|
||||
logger.info("【请求开始】商场管理->关键词->编辑,请求参数:{}", JSONObject.toJSONString(keywords));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->关键词->编辑,请求参数:{}", JSONObject.toJSONString(keywords));
|
||||
|
||||
Object error = validate(keywords);
|
||||
if (error != null) {
|
||||
|
|
@ -119,7 +120,7 @@ public class AdminKeywordController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "关键词" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsKeyword keyword) {
|
||||
logger.info("【请求开始】商场管理->关键词->删除,请求参数:{}", JSONObject.toJSONString(keyword));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->关键词->删除,请求参数:{}", JSONObject.toJSONString(keyword));
|
||||
|
||||
Integer id = keyword.getId();
|
||||
if (id == null) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.service.AdminOrderService;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
||||
|
|
@ -49,7 +50,7 @@ public class AdminOrderController {
|
|||
@RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】商场管理->订单管理->查询,请求参数:userId:{},orderSn:{},page:{}", userId, orderSn, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->订单管理->查询,请求参数:userId:{},orderSn:{},page:{}", userId, orderSn, page);
|
||||
|
||||
return adminOrderService.list(userId, orderSn, orderStatusArray, page, limit, sort, order);
|
||||
}
|
||||
|
|
@ -64,7 +65,7 @@ public class AdminOrderController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "订单管理" }, button = "详情")
|
||||
@GetMapping("/detail")
|
||||
public Object detail(@NotNull Integer id) {
|
||||
logger.info("【请求开始】商场管理->订单管理->详情,请求参数:id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->订单管理->详情,请求参数:id:{}", id);
|
||||
|
||||
return adminOrderService.detail(id);
|
||||
}
|
||||
|
|
@ -79,7 +80,7 @@ public class AdminOrderController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "订单管理" }, button = "订单退款")
|
||||
@PostMapping("/refund")
|
||||
public Object refund(@RequestBody String body) {
|
||||
logger.info("【请求开始】商场管理->订单管理->订单退款,请求参数,body:{}", body);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->订单管理->订单退款,请求参数,body:{}", body);
|
||||
|
||||
return adminOrderService.refund(body);
|
||||
}
|
||||
|
|
@ -94,7 +95,7 @@ public class AdminOrderController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "订单管理" }, button = "订单发货")
|
||||
@PostMapping("/ship")
|
||||
public Object ship(@RequestBody String body) {
|
||||
logger.info("【请求开始】商场管理->订单管理->订单发货,请求参数,body:{}", body);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->订单管理->订单发货,请求参数,body:{}", body);
|
||||
|
||||
return adminOrderService.ship(body);
|
||||
}
|
||||
|
|
@ -109,7 +110,7 @@ public class AdminOrderController {
|
|||
@RequiresPermissionsDesc(menu = { "商场管理", "订单管理" }, button = "订单商品回复")
|
||||
@PostMapping("/reply")
|
||||
public Object reply(@RequestBody String body) {
|
||||
logger.info("【请求开始】商场管理->订单管理->订单商品回复,请求参数,body:{}", body);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->订单管理->订单商品回复,请求参数,body:{}", body);
|
||||
|
||||
return adminOrderService.reply(body);
|
||||
}
|
||||
|
|
@ -120,11 +121,11 @@ public class AdminOrderController {
|
|||
* @param body 订单信息,{ orderId:xxx }
|
||||
* @return 订单操作结果
|
||||
*/
|
||||
@RequiresPermissions("admin:order:listShipChannel")
|
||||
@RequiresPermissionsDesc(menu = { "商场管理", "订单管理" }, button = "快递信息加载")
|
||||
@RequiresPermissions("admin:order:listShip")
|
||||
@RequiresPermissionsDesc(menu = { "商场管理", "订单管理" }, button = "快递加载")
|
||||
@GetMapping("/listShipChannel")
|
||||
public Object listShipChannel() {
|
||||
logger.info("【请求开始】商场管理->订单管理->快递信息加载");
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 商场管理->订单管理->快递信息加载");
|
||||
|
||||
return adminOrderService.listShipChannel();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.qiguliuxing.dts.admin.util.AdminResponseUtil;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.JacksonUtil;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.util.bcrypt.BCryptPasswordEncoder;
|
||||
|
|
@ -34,7 +35,7 @@ public class AdminProfileController {
|
|||
@RequiresAuthentication
|
||||
@PostMapping("/password")
|
||||
public Object create(@RequestBody String body) {
|
||||
logger.info("【请求开始】系统管理->修改密码,请求参数,body:{}", body);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->修改密码,请求参数,body:{}", body);
|
||||
|
||||
String oldPassword = JacksonUtil.parseString(body, "oldPassword");
|
||||
String newPassword = JacksonUtil.parseString(body, "newPassword");
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
|
|
@ -43,7 +44,7 @@ public class AdminRegionController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort(accepts = { "id" }) @RequestParam(defaultValue = "id") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】行政区域管理->查询,请求参数,name:{},code:{},page:{}", name, code, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 行政区域管理->查询,请求参数,name:{},code:{},page:{}", name, code, page);
|
||||
|
||||
List<DtsRegion> regionList = regionService.querySelective(name, code, page, limit, sort, order);
|
||||
long total = PageInfo.of(regionList).getTotal();
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.github.pagehelper.PageInfo;
|
|||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AdminResponseCode;
|
||||
import com.qiguliuxing.dts.admin.util.AdminResponseUtil;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.admin.util.PermVo;
|
||||
import com.qiguliuxing.dts.admin.util.Permission;
|
||||
import com.qiguliuxing.dts.admin.util.PermissionUtil;
|
||||
|
|
@ -59,7 +60,7 @@ public class AdminRoleController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】系统管理->角色管理->角色查询,请求参数,name:{},page:{}", name, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->角色查询,请求参数,name:{},page:{}", name, page);
|
||||
|
||||
List<DtsRole> roleList = roleService.querySelective(name, page, limit, sort, order);
|
||||
long total = PageInfo.of(roleList).getTotal();
|
||||
|
|
@ -74,7 +75,7 @@ public class AdminRoleController {
|
|||
@GetMapping("/options")
|
||||
public Object options() {
|
||||
List<DtsRole> roleList = roleService.queryAll();
|
||||
logger.info("【请求开始】系统管理->角色管理->查询所有角色");
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->查询所有角色");
|
||||
|
||||
List<Map<String, Object>> options = new ArrayList<>(roleList.size());
|
||||
for (DtsRole role : roleList) {
|
||||
|
|
@ -92,7 +93,7 @@ public class AdminRoleController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "角色管理" }, button = "角色详情")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】系统管理->角色管理->角色详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->角色详情,请求参数,id:{}", id);
|
||||
|
||||
DtsRole role = roleService.findById(id);
|
||||
|
||||
|
|
@ -113,7 +114,7 @@ public class AdminRoleController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "角色管理" }, button = "角色添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsRole role) {
|
||||
logger.info("【请求开始】系统管理->角色管理->角色添加,请求参数:{}", JSONObject.toJSONString(role));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->角色添加,请求参数:{}", JSONObject.toJSONString(role));
|
||||
|
||||
Object error = validate(role);
|
||||
if (error != null) {
|
||||
|
|
@ -135,7 +136,7 @@ public class AdminRoleController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "角色管理" }, button = "角色编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsRole role) {
|
||||
logger.info("【请求开始】系统管理->角色管理->角色编辑,请求参数:{}", JSONObject.toJSONString(role));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->角色编辑,请求参数:{}", JSONObject.toJSONString(role));
|
||||
|
||||
Object error = validate(role);
|
||||
if (error != null) {
|
||||
|
|
@ -151,7 +152,7 @@ public class AdminRoleController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "角色管理" }, button = "角色删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsRole role) {
|
||||
logger.info("【请求开始】系统管理->角色管理->角色删除,请求参数,id:{}", JSONObject.toJSONString(role));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->角色删除,请求参数,id:{}", JSONObject.toJSONString(role));
|
||||
|
||||
Integer id = role.getId();
|
||||
if (id == null) {
|
||||
|
|
@ -201,7 +202,7 @@ public class AdminRoleController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "角色管理" }, button = "权限详情")
|
||||
@GetMapping("/permissions")
|
||||
public Object getPermissions(Integer roleId) {
|
||||
logger.info("【请求开始】系统管理->角色管理->权限详情,请求参数,roleId:{}", roleId);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->权限详情,请求参数,roleId:{}", roleId);
|
||||
|
||||
List<PermVo> systemPermissions = getSystemPermissions();
|
||||
Set<String> assignedPermissions = getAssignedPermissions(roleId);
|
||||
|
|
@ -224,7 +225,7 @@ public class AdminRoleController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "角色管理" }, button = "权限变更")
|
||||
@PostMapping("/permissions")
|
||||
public Object updatePermissions(@RequestBody String body) {
|
||||
logger.info("【请求开始】系统管理->角色管理->权限变更,请求参数,body:{}", body);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->角色管理->权限变更,请求参数,body:{}", body);
|
||||
|
||||
Integer roleId = JacksonUtil.parseInteger(body, "roleId");
|
||||
List<String> permissions = JacksonUtil.parseStringList(body, "permissions");
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.admin.util.StatVo;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.db.service.StatService;
|
||||
|
|
@ -32,7 +33,7 @@ public class AdminStatController {
|
|||
@RequiresPermissionsDesc(menu = { "统计管理", "用户统计" }, button = "查询")
|
||||
@GetMapping("/user")
|
||||
public Object statUser() {
|
||||
logger.info("【请求开始】统计管理->用户统计->查询");
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 统计管理->用户统计->查询");
|
||||
|
||||
List<Map> rows = statService.statUser();
|
||||
String[] columns = new String[] { "day", "users" };
|
||||
|
|
@ -48,7 +49,7 @@ public class AdminStatController {
|
|||
@RequiresPermissionsDesc(menu = { "统计管理", "订单统计" }, button = "查询")
|
||||
@GetMapping("/order")
|
||||
public Object statOrder() {
|
||||
logger.info("【请求开始】统计管理->订单统计->查询");
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 统计管理->订单统计->查询");
|
||||
|
||||
List<Map> rows = statService.statOrder();
|
||||
String[] columns = new String[] { "day", "orders", "customers", "amount", "pcr" };
|
||||
|
|
@ -64,7 +65,7 @@ public class AdminStatController {
|
|||
@RequiresPermissionsDesc(menu = { "统计管理", "商品统计" }, button = "查询")
|
||||
@GetMapping("/goods")
|
||||
public Object statGoods() {
|
||||
logger.info("【请求开始】统计管理->商品统计->查询");
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 统计管理->商品统计->查询");
|
||||
|
||||
List<Map> rows = statService.statGoods();
|
||||
String[] columns = new String[] { "day", "orders", "products", "amount" };
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.storage.StorageService;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
|
|
@ -49,7 +50,7 @@ public class AdminStorageController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】系统管理->对象存储->查询,请求参数,name:{},key:{},page:{}", name, key, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->对象存储->查询,请求参数,name:{},key:{},page:{}", name, key, page);
|
||||
|
||||
List<DtsStorage> storageList = DtsStorageService.querySelective(key, name, page, limit, sort, order);
|
||||
long total = PageInfo.of(storageList).getTotal();
|
||||
|
|
@ -65,7 +66,7 @@ public class AdminStorageController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "对象存储" }, button = "上传")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestParam("file") MultipartFile file) throws IOException {
|
||||
logger.info("【请求开始】系统管理->对象存储->上传,请求参数,file:{}", file.getOriginalFilename());
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->对象存储->上传,请求参数,file:{}", file.getOriginalFilename());
|
||||
|
||||
String originalFilename = file.getOriginalFilename();
|
||||
String url = storageService.store(file.getInputStream(), file.getSize(), file.getContentType(),
|
||||
|
|
@ -81,7 +82,7 @@ public class AdminStorageController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "对象存储" }, button = "详情")
|
||||
@PostMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】系统管理->对象存储->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->对象存储->详情,请求参数,id:{}", id);
|
||||
|
||||
DtsStorage storageInfo = DtsStorageService.findById(id);
|
||||
if (storageInfo == null) {
|
||||
|
|
@ -96,7 +97,7 @@ public class AdminStorageController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "对象存储" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsStorage dtsStorage) {
|
||||
logger.info("【请求开始】系统管理->对象存储->编辑,请求参数:{}", JSONObject.toJSONString(dtsStorage));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->对象存储->编辑,请求参数:{}", JSONObject.toJSONString(dtsStorage));
|
||||
|
||||
if (DtsStorageService.update(dtsStorage) == 0) {
|
||||
logger.error("系统管理->对象存储->编辑 错误:{}", "更新数据失败!");
|
||||
|
|
@ -111,7 +112,7 @@ public class AdminStorageController {
|
|||
@RequiresPermissionsDesc(menu = { "系统管理", "对象存储" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsStorage DtsStorage) {
|
||||
logger.info("【请求开始】系统管理->对象存储->删除,请求参数:{}", JSONObject.toJSONString(DtsStorage));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 系统管理->对象存储->删除,请求参数:{}", JSONObject.toJSONString(DtsStorage));
|
||||
|
||||
String key = DtsStorage.getKey();
|
||||
if (StringUtils.isEmpty(key)) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.qcode.QCodeService;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.core.validator.Order;
|
||||
|
|
@ -49,7 +50,7 @@ public class AdminTopicController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】推广管理->专题管理->查询,请求参数,title:{},subtitle:{},page:{}", title, subtitle, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->专题管理->查询,请求参数,title:{},subtitle:{},page:{}", title, subtitle, page);
|
||||
|
||||
List<DtsTopic> topicList = topicService.querySelective(title, subtitle, page, limit, sort, order);
|
||||
long total = PageInfo.of(topicList).getTotal();
|
||||
|
|
@ -81,7 +82,7 @@ public class AdminTopicController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "专题管理" }, button = "添加")
|
||||
@PostMapping("/create")
|
||||
public Object create(@RequestBody DtsTopic topic) {
|
||||
logger.info("【请求开始】推广管理->专题管理->添加,请求参数:{}", JSONObject.toJSONString(topic));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->专题管理->添加,请求参数:{}", JSONObject.toJSONString(topic));
|
||||
|
||||
Object error = validate(topic);
|
||||
if (error != null) {
|
||||
|
|
@ -106,7 +107,7 @@ public class AdminTopicController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "专题管理" }, button = "详情")
|
||||
@GetMapping("/read")
|
||||
public Object read(@NotNull Integer id) {
|
||||
logger.info("【请求开始】推广管理->专题管理->详情,请求参数,id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->专题管理->详情,请求参数,id:{}", id);
|
||||
|
||||
DtsTopic topic = topicService.findById(id);
|
||||
|
||||
|
|
@ -118,7 +119,7 @@ public class AdminTopicController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "专题管理" }, button = "编辑")
|
||||
@PostMapping("/update")
|
||||
public Object update(@RequestBody DtsTopic topic) {
|
||||
logger.info("【请求开始】推广管理->专题管理->编辑,请求参数:{}", JSONObject.toJSONString(topic));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->专题管理->编辑,请求参数:{}", JSONObject.toJSONString(topic));
|
||||
|
||||
Object error = validate(topic);
|
||||
if (error != null) {
|
||||
|
|
@ -146,7 +147,7 @@ public class AdminTopicController {
|
|||
@RequiresPermissionsDesc(menu = { "推广管理", "专题管理" }, button = "删除")
|
||||
@PostMapping("/delete")
|
||||
public Object delete(@RequestBody DtsTopic topic) {
|
||||
logger.info("【请求开始】推广管理->专题管理->删除,请求参数:{}", JSONObject.toJSONString(topic));
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 推广管理->专题管理->删除,请求参数:{}", JSONObject.toJSONString(topic));
|
||||
|
||||
topicService.deleteById(topic.getId());
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.qiguliuxing.dts.admin.annotation.RequiresPermissionsDesc;
|
||||
import com.qiguliuxing.dts.admin.util.AuthSupport;
|
||||
import com.qiguliuxing.dts.core.qcode.QCodeService;
|
||||
import com.qiguliuxing.dts.core.util.JacksonUtil;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
|
|
@ -28,6 +29,7 @@ import com.qiguliuxing.dts.core.validator.Order;
|
|||
import com.qiguliuxing.dts.core.validator.Sort;
|
||||
import com.qiguliuxing.dts.db.domain.DtsUser;
|
||||
import com.qiguliuxing.dts.db.domain.DtsUserAccount;
|
||||
import com.qiguliuxing.dts.db.service.DtsAccountService;
|
||||
import com.qiguliuxing.dts.db.service.DtsUserService;
|
||||
|
||||
@RestController
|
||||
|
|
@ -41,6 +43,9 @@ public class AdminUserController {
|
|||
|
||||
@Autowired
|
||||
private QCodeService qCodeService;
|
||||
|
||||
@Autowired
|
||||
private DtsAccountService accountService;
|
||||
|
||||
@RequiresPermissions("admin:user:list")
|
||||
@RequiresPermissionsDesc(menu = { "用户管理", "会员管理" }, button = "查询")
|
||||
|
|
@ -49,7 +54,7 @@ public class AdminUserController {
|
|||
@RequestParam(defaultValue = "10") Integer limit,
|
||||
@Sort @RequestParam(defaultValue = "add_time") String sort,
|
||||
@Order @RequestParam(defaultValue = "desc") String order) {
|
||||
logger.info("【请求开始】用户管理->会员管理->查询,请求参数,username:{},code:{},page:{}", username, mobile, page);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->会员管理->查询,请求参数,username:{},code:{},page:{}", username, mobile, page);
|
||||
|
||||
List<DtsUser> userList = userService.querySelective(username, mobile, page, limit, sort, order);
|
||||
long total = PageInfo.of(userList).getTotal();
|
||||
|
|
@ -71,7 +76,7 @@ public class AdminUserController {
|
|||
@RequiresPermissionsDesc(menu = { "用户管理", "会员管理" }, button = "代理详情")
|
||||
@GetMapping("/detailApprove")
|
||||
public Object detailApprove(@NotNull Integer id) {
|
||||
logger.info("【请求开始】用户管理->会员管理->代理详情,请求参数:id:{}", id);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->会员管理->代理详情,请求参数:id:{}", id);
|
||||
|
||||
DtsUserAccount dbAccount = userService.detailApproveByUserId(id);
|
||||
if (dbAccount == null) {
|
||||
|
|
@ -86,7 +91,7 @@ public class AdminUserController {
|
|||
@RequiresPermissionsDesc(menu = { "用户管理", "会员管理" }, button = "代理审批")
|
||||
@PostMapping("/approveAgency")
|
||||
public Object approveAgency(@RequestBody String body) {
|
||||
logger.info("【请求开始】用户管理->会员管理->代理审批,请求参数:{}",body);
|
||||
logger.info("【请求开始】操作人:[" + AuthSupport.userName()+ "] 用户管理->会员管理->代理审批,请求参数:{}",body);
|
||||
|
||||
Integer userId = JacksonUtil.parseInteger(body, "userId");
|
||||
Integer settlementRate = JacksonUtil.parseInteger(body, "settlementRate");
|
||||
|
|
@ -101,7 +106,18 @@ public class AdminUserController {
|
|||
*/
|
||||
String shareUrl = qCodeService.createShareUserImage(userId);
|
||||
|
||||
/**
|
||||
* 结算当前用户的订单佣金给其代理
|
||||
* 在用户审批通过成为代理用户之前下的订单,结算佣金应归属于前一个代理用户
|
||||
* 后续的订单由用户申请或系统自动结算给,代理用户直接会将佣金结算给自己
|
||||
*/
|
||||
boolean result = accountService.settlementPreviousAgency(userId);
|
||||
if (!result) {
|
||||
logger.warn("用户管理->会员管理->代理审批 存在异常:{}","当前用户订单佣金交割给代理用户时出错!");
|
||||
}
|
||||
|
||||
userService.approveAgency(userId,settlementRate,shareUrl);
|
||||
|
||||
}catch (Exception e) {
|
||||
logger.error("用户管理->会员管理->代理审批 出错:{}",e.getMessage());
|
||||
e.printStackTrace();
|
||||
|
|
|
|||
|
|
@ -9,12 +9,12 @@ spring:
|
|||
max-request-size: 80Mb
|
||||
location: /tmp/tomcat_upload
|
||||
|
||||
|
||||
|
||||
server:
|
||||
port: 8083
|
||||
servlet:
|
||||
context-path: /demo
|
||||
|
||||
|
||||
logging:
|
||||
level:
|
||||
root: ERROR
|
||||
|
|
|
|||
|
|
@ -0,0 +1,100 @@
|
|||
package com.qiguliuxing.dts.core.captcha;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* 缓存系统中的验证码
|
||||
*/
|
||||
public class CaptchaCodeManager {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CaptchaCodeManager.class);
|
||||
|
||||
private static final Integer DEFAULT_EXPIRE_MINUTES = 3;//验证码默认存储的有效期,单位:分钟
|
||||
private static Map<String, CaptchaItem> captchaCodeCache = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 添加到缓存
|
||||
*
|
||||
* @param flagUid
|
||||
* 验证标志码
|
||||
* @param code
|
||||
* 验证码
|
||||
*/
|
||||
public static boolean addToCache(String flagUid, String code,Integer expireTime) {
|
||||
cleanExpireCacheData();//清理过期内存数据
|
||||
|
||||
// 已经发过验证码且验证码还未过期
|
||||
if (captchaCodeCache.get(flagUid) != null) {
|
||||
if (captchaCodeCache.get(flagUid).getExpireTime().isAfter(LocalDateTime.now())) {
|
||||
return false;
|
||||
} else {
|
||||
// 存在但是已过期,删掉
|
||||
captchaCodeCache.remove(flagUid);
|
||||
}
|
||||
}
|
||||
|
||||
CaptchaItem captchaItem = new CaptchaItem();
|
||||
captchaItem.setFlagUid(flagUid);
|
||||
captchaItem.setCode(code);
|
||||
// 有效期为expireTime分钟
|
||||
if (expireTime == null) {
|
||||
expireTime = DEFAULT_EXPIRE_MINUTES;
|
||||
}
|
||||
captchaItem.setExpireTime(LocalDateTime.now().plusMinutes(expireTime));
|
||||
|
||||
captchaCodeCache.put(flagUid, captchaItem);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取缓存的验证码
|
||||
*
|
||||
* @param flagUid
|
||||
* 关联的标志码
|
||||
* @return 验证码
|
||||
*/
|
||||
public static String getCachedCaptcha(String flagUid) {
|
||||
// 没有标志码记录
|
||||
if (captchaCodeCache.get(flagUid) == null)
|
||||
return null;
|
||||
|
||||
// 记录但是已经过期
|
||||
if (captchaCodeCache.get(flagUid).getExpireTime().isBefore(LocalDateTime.now())) {
|
||||
return null;
|
||||
}
|
||||
cleanExpireCacheData();//清理过期内存数据
|
||||
|
||||
return captchaCodeCache.get(flagUid).getCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理过期验证码
|
||||
*/
|
||||
private static void cleanExpireCacheData() {
|
||||
Iterator<Entry<String, CaptchaItem>> iterator = captchaCodeCache.entrySet().iterator(); //map.entrySet()得到的是set集合,可以使用迭代器遍历
|
||||
List<String> keys = new ArrayList<String>();
|
||||
while(iterator.hasNext()){
|
||||
Entry<String, CaptchaItem> entry = iterator.next();
|
||||
if (entry.getValue() != null && entry.getValue().getExpireTime().isBefore(LocalDateTime.now())) {
|
||||
keys.add(entry.getKey());
|
||||
logger.info("清理商品分享图 验证标志码flagUid:{},验证码 captcha:{}",entry.getKey(),entry.getValue().getCode());
|
||||
}
|
||||
}
|
||||
if (keys.size() > 0) {
|
||||
for(String key : keys) {
|
||||
captchaCodeCache.remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.qiguliuxing.dts.core.captcha;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 验证码实体类,用于缓存验证码发送
|
||||
*/
|
||||
public class CaptchaItem {
|
||||
|
||||
private String flagUid;
|
||||
private String code;
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
|
||||
public String getFlagUid() {
|
||||
return flagUid;
|
||||
}
|
||||
|
||||
public void setFlagUid(String flagUid) {
|
||||
this.flagUid = flagUid;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public LocalDateTime getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(LocalDateTime expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,18 @@
|
|||
package com.qiguliuxing.dts.core.config;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
|
||||
|
|
@ -8,22 +21,12 @@ import com.fasterxml.jackson.datatype.jsr310.deser.LocalTimeDeserializer;
|
|||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalTimeSerializer;
|
||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.core.Ordered;
|
||||
import org.springframework.core.annotation.Order;
|
||||
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
@Configuration
|
||||
public class JacksonConfig {
|
||||
|
||||
@Bean
|
||||
@Primary
|
||||
@Order(Ordered.HIGHEST_PRECEDENCE)
|
||||
public Jackson2ObjectMapperBuilderCustomizer customJackson() {
|
||||
return new Jackson2ObjectMapperBuilderCustomizer() {
|
||||
|
|
@ -31,6 +34,8 @@ public class JacksonConfig {
|
|||
public void customize(Jackson2ObjectMapperBuilder builder) {
|
||||
builder.serializerByType(LocalDateTime.class,
|
||||
new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
/*builder.serializerByType(LocalDateTime.class,
|
||||
new LocalDateTimeSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")));*/
|
||||
builder.serializerByType(LocalDate.class,
|
||||
new LocalDateSerializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
builder.serializerByType(LocalTime.class,
|
||||
|
|
@ -38,6 +43,8 @@ public class JacksonConfig {
|
|||
|
||||
builder.deserializerByType(LocalDateTime.class,
|
||||
new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
||||
/*builder.deserializerByType(LocalDateTime.class,
|
||||
new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")));*/
|
||||
builder.deserializerByType(LocalDate.class,
|
||||
new LocalDateDeserializer(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
|
||||
builder.deserializerByType(LocalTime.class,
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public interface CommConsts {
|
|||
|
||||
public static final String DEFAULT_AVATAR = "https://avatar.csdnimg.cn/8/A/0/2_qiguliuxing.jpg";
|
||||
|
||||
public static final String DEFAULT_ORDER_FIX = "聚惠星小程序订单:";
|
||||
public static final String DEFAULT_ORDER_FIX = "小程序订单:";
|
||||
|
||||
public static final String MISS_PARAMS = "缺少必要参数";
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.qiguliuxing.dts.core.exception;
|
||||
|
||||
/**
|
||||
* 工具类异常
|
||||
*/
|
||||
public class UtilException extends RuntimeException {
|
||||
private static final long serialVersionUID = 8247610319171014183L;
|
||||
|
||||
public UtilException(Throwable e) {
|
||||
super(e.getMessage(), e);
|
||||
}
|
||||
|
||||
public UtilException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public UtilException(String message, Throwable throwable) {
|
||||
super(message, throwable);
|
||||
}
|
||||
}
|
||||
|
|
@ -63,18 +63,18 @@ public class NotifyService {
|
|||
* 通知模版内容里的参数,类似"您的验证码为{1}"中{1}的值
|
||||
*/
|
||||
@Async
|
||||
public void notifySmsTemplate(String phoneNumber, NotifyType notifyType, String[] params) {
|
||||
public SmsResult notifySmsTemplate(String phoneNumber, NotifyType notifyType, String[] params) {
|
||||
if (smsSender == null) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
String templateIdStr = getTemplateId(notifyType, smsTemplate);
|
||||
if (templateIdStr == null) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
int templateId = Integer.parseInt(templateIdStr);
|
||||
smsSender.sendWithTemplate(phoneNumber, templateId, params);
|
||||
return smsSender.sendWithTemplate(phoneNumber, templateId, params);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -70,17 +70,22 @@ public class QCodeService {
|
|||
|
||||
/**
|
||||
* 创建商品分享图
|
||||
*
|
||||
*
|
||||
* @param shareUserId
|
||||
* @param goodId
|
||||
* @param goodPicUrl
|
||||
* @param goodName
|
||||
*/
|
||||
public String createGoodShareImage(String goodId, String goodPicUrl, String goodName,BigDecimal counterPrice,BigDecimal retailPrice) {
|
||||
public String createGoodShareImage(Integer shareUserId,String goodId, String goodPicUrl, String goodName,BigDecimal counterPrice,BigDecimal retailPrice) {
|
||||
if (!SystemConfig.isAutoCreateShareImage())
|
||||
return "";
|
||||
try {
|
||||
// 创建该商品的二维码
|
||||
File file = wxMaService.getQrcodeService().createWxaCodeUnlimit("goods," + goodId, "pages/index/index");
|
||||
String scene = "goods," + goodId;
|
||||
if (shareUserId != null ) {
|
||||
scene = scene + ",user," + shareUserId;
|
||||
}
|
||||
File file = wxMaService.getQrcodeService().createWxaCodeUnlimit(scene, "pages/index/index");
|
||||
FileInputStream inputStream = new FileInputStream(file);
|
||||
// 将商品图片,商品名字,商城名字画到模版图中
|
||||
byte[] imageData = drawPicture(inputStream, goodPicUrl,goodName,counterPrice,retailPrice);
|
||||
|
|
@ -361,12 +366,25 @@ public class QCodeService {
|
|||
return bs.toByteArray();
|
||||
}
|
||||
|
||||
public String createBrandImage(Integer brandId, String picUrl, String name, String defaultCategory) {
|
||||
/**
|
||||
* 创建商品的分享海报
|
||||
* @param shareUserId
|
||||
* @param brandId
|
||||
* @param picUrl
|
||||
* @param name
|
||||
* @param defaultCategory
|
||||
* @return
|
||||
*/
|
||||
public String createBrandImage(Integer shareUserId,Integer brandId, String picUrl, String name, String defaultCategory) {
|
||||
if (!SystemConfig.isAutoCreateShareImage())
|
||||
return "";
|
||||
try {
|
||||
// 创建该商品的二维码
|
||||
File file = wxMaService.getQrcodeService().createWxaCodeUnlimit("brand," + brandId, "pages/index/index");
|
||||
String scene = "brand," + brandId;
|
||||
if (shareUserId != null ) {
|
||||
scene = scene + ",user," + shareUserId;
|
||||
}
|
||||
File file = wxMaService.getQrcodeService().createWxaCodeUnlimit(scene, "pages/index/index");
|
||||
FileInputStream inputStream = new FileInputStream(file);
|
||||
// 将商品图片,商品名字,商城名字画到模版图中
|
||||
byte[] imageData = drawBrandPicture(inputStream, picUrl,name,defaultCategory);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,48 @@
|
|||
package com.qiguliuxing.dts.core.type;
|
||||
|
||||
/**
|
||||
* 代理分享海报 枚举类型
|
||||
*
|
||||
* @author QIGULIUXING
|
||||
* @QQ 623659388
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public enum AgencyShareTypeEnum {
|
||||
|
||||
GOODS_SHARE(1, "商品分享海报"), BRAND_SHARE(2, "入驻品牌店铺分享海报"),GROUPON_SHARE(3, "团购分享海报");
|
||||
|
||||
private Integer type;
|
||||
private String desc;
|
||||
|
||||
private AgencyShareTypeEnum(Integer type, String desc) {
|
||||
this.type = type;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public static AgencyShareTypeEnum getInstance(Integer type2) {
|
||||
if (type2 != null) {
|
||||
for (AgencyShareTypeEnum tmp : AgencyShareTypeEnum.values()) {
|
||||
if (tmp.type.intValue() == type2.intValue()) {
|
||||
return tmp;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ package com.qiguliuxing.dts.core.type;
|
|||
*/
|
||||
public enum BrokerageTypeEnum {
|
||||
|
||||
SYS_APPLY((byte) 0, "系统结算自动申请"), USER_APPLY((byte) 1, "用户手工申请"), APPLY_FINISH((byte) 2, "审批通过或完成"), APPLY_FAIL((byte) 2, "审批不通过");
|
||||
SYS_APPLY((byte) 0, "系统结算自动申请"), USER_APPLY((byte) 1, "用户手工申请");
|
||||
|
||||
private Byte type;
|
||||
private String desc;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,289 @@
|
|||
package com.qiguliuxing.dts.core.util;
|
||||
|
||||
/**
|
||||
* Base64工具类
|
||||
*/
|
||||
public final class Base64
|
||||
{
|
||||
static private final int BASELENGTH = 128;
|
||||
static private final int LOOKUPLENGTH = 64;
|
||||
static private final int TWENTYFOURBITGROUP = 24;
|
||||
static private final int EIGHTBIT = 8;
|
||||
static private final int SIXTEENBIT = 16;
|
||||
static private final int FOURBYTE = 4;
|
||||
static private final int SIGN = -128;
|
||||
static private final char PAD = '=';
|
||||
static final private byte[] base64Alphabet = new byte[BASELENGTH];
|
||||
static final private char[] lookUpBase64Alphabet = new char[LOOKUPLENGTH];
|
||||
|
||||
static
|
||||
{
|
||||
for (int i = 0; i < BASELENGTH; ++i)
|
||||
{
|
||||
base64Alphabet[i] = -1;
|
||||
}
|
||||
for (int i = 'Z'; i >= 'A'; i--)
|
||||
{
|
||||
base64Alphabet[i] = (byte) (i - 'A');
|
||||
}
|
||||
for (int i = 'z'; i >= 'a'; i--)
|
||||
{
|
||||
base64Alphabet[i] = (byte) (i - 'a' + 26);
|
||||
}
|
||||
|
||||
for (int i = '9'; i >= '0'; i--)
|
||||
{
|
||||
base64Alphabet[i] = (byte) (i - '0' + 52);
|
||||
}
|
||||
|
||||
base64Alphabet['+'] = 62;
|
||||
base64Alphabet['/'] = 63;
|
||||
|
||||
for (int i = 0; i <= 25; i++)
|
||||
{
|
||||
lookUpBase64Alphabet[i] = (char) ('A' + i);
|
||||
}
|
||||
|
||||
for (int i = 26, j = 0; i <= 51; i++, j++)
|
||||
{
|
||||
lookUpBase64Alphabet[i] = (char) ('a' + j);
|
||||
}
|
||||
|
||||
for (int i = 52, j = 0; i <= 61; i++, j++)
|
||||
{
|
||||
lookUpBase64Alphabet[i] = (char) ('0' + j);
|
||||
}
|
||||
lookUpBase64Alphabet[62] = (char) '+';
|
||||
lookUpBase64Alphabet[63] = (char) '/';
|
||||
}
|
||||
|
||||
private static boolean isWhiteSpace(char octect)
|
||||
{
|
||||
return (octect == 0x20 || octect == 0xd || octect == 0xa || octect == 0x9);
|
||||
}
|
||||
|
||||
private static boolean isPad(char octect)
|
||||
{
|
||||
return (octect == PAD);
|
||||
}
|
||||
|
||||
private static boolean isData(char octect)
|
||||
{
|
||||
return (octect < BASELENGTH && base64Alphabet[octect] != -1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Encodes hex octects into Base64
|
||||
*
|
||||
* @param binaryData Array containing binaryData
|
||||
* @return Encoded Base64 array
|
||||
*/
|
||||
public static String encode(byte[] binaryData)
|
||||
{
|
||||
if (binaryData == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int lengthDataBits = binaryData.length * EIGHTBIT;
|
||||
if (lengthDataBits == 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
int fewerThan24bits = lengthDataBits % TWENTYFOURBITGROUP;
|
||||
int numberTriplets = lengthDataBits / TWENTYFOURBITGROUP;
|
||||
int numberQuartet = fewerThan24bits != 0 ? numberTriplets + 1 : numberTriplets;
|
||||
char encodedData[] = null;
|
||||
|
||||
encodedData = new char[numberQuartet * 4];
|
||||
|
||||
byte k = 0, l = 0, b1 = 0, b2 = 0, b3 = 0;
|
||||
|
||||
int encodedIndex = 0;
|
||||
int dataIndex = 0;
|
||||
|
||||
for (int i = 0; i < numberTriplets; i++)
|
||||
{
|
||||
b1 = binaryData[dataIndex++];
|
||||
b2 = binaryData[dataIndex++];
|
||||
b3 = binaryData[dataIndex++];
|
||||
|
||||
l = (byte) (b2 & 0x0f);
|
||||
k = (byte) (b1 & 0x03);
|
||||
|
||||
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
||||
byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
|
||||
byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);
|
||||
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[(l << 2) | val3];
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[b3 & 0x3f];
|
||||
}
|
||||
|
||||
// form integral number of 6-bit groups
|
||||
if (fewerThan24bits == EIGHTBIT)
|
||||
{
|
||||
b1 = binaryData[dataIndex];
|
||||
k = (byte) (b1 & 0x03);
|
||||
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[k << 4];
|
||||
encodedData[encodedIndex++] = PAD;
|
||||
encodedData[encodedIndex++] = PAD;
|
||||
}
|
||||
else if (fewerThan24bits == SIXTEENBIT)
|
||||
{
|
||||
b1 = binaryData[dataIndex];
|
||||
b2 = binaryData[dataIndex + 1];
|
||||
l = (byte) (b2 & 0x0f);
|
||||
k = (byte) (b1 & 0x03);
|
||||
|
||||
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
|
||||
byte val2 = ((b2 & SIGN) == 0) ? (byte) (b2 >> 4) : (byte) ((b2) >> 4 ^ 0xf0);
|
||||
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val1];
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[val2 | (k << 4)];
|
||||
encodedData[encodedIndex++] = lookUpBase64Alphabet[l << 2];
|
||||
encodedData[encodedIndex++] = PAD;
|
||||
}
|
||||
return new String(encodedData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes Base64 data into octects
|
||||
*
|
||||
* @param encoded string containing Base64 data
|
||||
* @return Array containind decoded data.
|
||||
*/
|
||||
public static byte[] decode(String encoded)
|
||||
{
|
||||
if (encoded == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
char[] base64Data = encoded.toCharArray();
|
||||
// remove white spaces
|
||||
int len = removeWhiteSpace(base64Data);
|
||||
|
||||
if (len % FOURBYTE != 0)
|
||||
{
|
||||
return null;// should be divisible by four
|
||||
}
|
||||
|
||||
int numberQuadruple = (len / FOURBYTE);
|
||||
|
||||
if (numberQuadruple == 0)
|
||||
{
|
||||
return new byte[0];
|
||||
}
|
||||
|
||||
byte decodedData[] = null;
|
||||
byte b1 = 0, b2 = 0, b3 = 0, b4 = 0;
|
||||
char d1 = 0, d2 = 0, d3 = 0, d4 = 0;
|
||||
|
||||
int i = 0;
|
||||
int encodedIndex = 0;
|
||||
int dataIndex = 0;
|
||||
decodedData = new byte[(numberQuadruple) * 3];
|
||||
|
||||
for (; i < numberQuadruple - 1; i++)
|
||||
{
|
||||
|
||||
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
|
||||
|| !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++])))
|
||||
{
|
||||
return null;
|
||||
} // if found "no data" just return null
|
||||
|
||||
b1 = base64Alphabet[d1];
|
||||
b2 = base64Alphabet[d2];
|
||||
b3 = base64Alphabet[d3];
|
||||
b4 = base64Alphabet[d4];
|
||||
|
||||
decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
||||
decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
||||
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
|
||||
}
|
||||
|
||||
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++])))
|
||||
{
|
||||
return null;// if found "no data" just return null
|
||||
}
|
||||
|
||||
b1 = base64Alphabet[d1];
|
||||
b2 = base64Alphabet[d2];
|
||||
|
||||
d3 = base64Data[dataIndex++];
|
||||
d4 = base64Data[dataIndex++];
|
||||
if (!isData((d3)) || !isData((d4)))
|
||||
{// Check if they are PAD characters
|
||||
if (isPad(d3) && isPad(d4))
|
||||
{
|
||||
if ((b2 & 0xf) != 0)// last 4 bits should be zero
|
||||
{
|
||||
return null;
|
||||
}
|
||||
byte[] tmp = new byte[i * 3 + 1];
|
||||
System.arraycopy(decodedData, 0, tmp, 0, i * 3);
|
||||
tmp[encodedIndex] = (byte) (b1 << 2 | b2 >> 4);
|
||||
return tmp;
|
||||
}
|
||||
else if (!isPad(d3) && isPad(d4))
|
||||
{
|
||||
b3 = base64Alphabet[d3];
|
||||
if ((b3 & 0x3) != 0)// last 2 bits should be zero
|
||||
{
|
||||
return null;
|
||||
}
|
||||
byte[] tmp = new byte[i * 3 + 2];
|
||||
System.arraycopy(decodedData, 0, tmp, 0, i * 3);
|
||||
tmp[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
||||
tmp[encodedIndex] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
||||
return tmp;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // No PAD e.g 3cQl
|
||||
b3 = base64Alphabet[d3];
|
||||
b4 = base64Alphabet[d4];
|
||||
decodedData[encodedIndex++] = (byte) (b1 << 2 | b2 >> 4);
|
||||
decodedData[encodedIndex++] = (byte) (((b2 & 0xf) << 4) | ((b3 >> 2) & 0xf));
|
||||
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
|
||||
|
||||
}
|
||||
return decodedData;
|
||||
}
|
||||
|
||||
/**
|
||||
* remove WhiteSpace from MIME containing encoded Base64 data.
|
||||
*
|
||||
* @param data the byte array of base64 data (with WS)
|
||||
* @return the new length
|
||||
*/
|
||||
private static int removeWhiteSpace(char[] data)
|
||||
{
|
||||
if (data == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// count characters that's not whitespace
|
||||
int newSize = 0;
|
||||
int len = data.length;
|
||||
for (int i = 0; i < len; i++)
|
||||
{
|
||||
if (!isWhiteSpace(data[i]))
|
||||
{
|
||||
data[newSize++] = data[i];
|
||||
}
|
||||
}
|
||||
return newSize;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,445 @@
|
|||
package com.qiguliuxing.dts.core.util;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import com.qiguliuxing.dts.core.exception.UtilException;
|
||||
|
||||
/**
|
||||
* 提供通用唯一识别码(universally unique identifier)(UUID)实现
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public final class UUID implements java.io.Serializable, Comparable<UUID> {
|
||||
private static final long serialVersionUID = -1185015143654744140L;
|
||||
|
||||
/**
|
||||
* SecureRandom 的单例
|
||||
*
|
||||
*/
|
||||
private static class Holder {
|
||||
static final SecureRandom numberGenerator = getSecureRandom();
|
||||
}
|
||||
|
||||
/** 此UUID的最高64有效位 */
|
||||
private final long mostSigBits;
|
||||
|
||||
/** 此UUID的最低64有效位 */
|
||||
private final long leastSigBits;
|
||||
|
||||
/**
|
||||
* 私有构造
|
||||
*
|
||||
* @param data 数据
|
||||
*/
|
||||
private UUID(byte[] data) {
|
||||
long msb = 0;
|
||||
long lsb = 0;
|
||||
assert data.length == 16 : "data must be 16 bytes in length";
|
||||
for (int i = 0; i < 8; i++) {
|
||||
msb = (msb << 8) | (data[i] & 0xff);
|
||||
}
|
||||
for (int i = 8; i < 16; i++) {
|
||||
lsb = (lsb << 8) | (data[i] & 0xff);
|
||||
}
|
||||
this.mostSigBits = msb;
|
||||
this.leastSigBits = lsb;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用指定的数据构造新的 UUID。
|
||||
*
|
||||
* @param mostSigBits 用于 {@code UUID} 的最高有效 64 位
|
||||
* @param leastSigBits 用于 {@code UUID} 的最低有效 64 位
|
||||
*/
|
||||
public UUID(long mostSigBits, long leastSigBits) {
|
||||
this.mostSigBits = mostSigBits;
|
||||
this.leastSigBits = leastSigBits;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的本地线程伪随机数生成器生成该 UUID。
|
||||
*
|
||||
* @return 随机生成的 {@code UUID}
|
||||
*/
|
||||
public static UUID fastUUID() {
|
||||
return randomUUID(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
|
||||
*
|
||||
* @return 随机生成的 {@code UUID}
|
||||
*/
|
||||
public static UUID randomUUID() {
|
||||
return randomUUID(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取类型 4(伪随机生成的)UUID 的静态工厂。 使用加密的强伪随机数生成器生成该 UUID。
|
||||
*
|
||||
* @param isSecure 是否使用{@link SecureRandom}如果是可以获得更安全的随机码,否则可以得到更好的性能
|
||||
* @return 随机生成的 {@code UUID}
|
||||
*/
|
||||
public static UUID randomUUID(boolean isSecure) {
|
||||
final Random ng = isSecure ? Holder.numberGenerator : getRandom();
|
||||
|
||||
byte[] randomBytes = new byte[16];
|
||||
ng.nextBytes(randomBytes);
|
||||
randomBytes[6] &= 0x0f; /* clear version */
|
||||
randomBytes[6] |= 0x40; /* set to version 4 */
|
||||
randomBytes[8] &= 0x3f; /* clear variant */
|
||||
randomBytes[8] |= 0x80; /* set to IETF variant */
|
||||
return new UUID(randomBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据指定的字节数组获取类型 3(基于名称的)UUID 的静态工厂。
|
||||
*
|
||||
* @param name 用于构造 UUID 的字节数组。
|
||||
*
|
||||
* @return 根据指定数组生成的 {@code UUID}
|
||||
*/
|
||||
public static UUID nameUUIDFromBytes(byte[] name) {
|
||||
MessageDigest md;
|
||||
try {
|
||||
md = MessageDigest.getInstance("MD5");
|
||||
} catch (NoSuchAlgorithmException nsae) {
|
||||
throw new InternalError("MD5 not supported");
|
||||
}
|
||||
byte[] md5Bytes = md.digest(name);
|
||||
md5Bytes[6] &= 0x0f; /* clear version */
|
||||
md5Bytes[6] |= 0x30; /* set to version 3 */
|
||||
md5Bytes[8] &= 0x3f; /* clear variant */
|
||||
md5Bytes[8] |= 0x80; /* set to IETF variant */
|
||||
return new UUID(md5Bytes);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 {@link #toString()} 方法中描述的字符串标准表示形式创建{@code UUID}。
|
||||
*
|
||||
* @param name 指定 {@code UUID} 字符串
|
||||
* @return 具有指定值的 {@code UUID}
|
||||
* @throws IllegalArgumentException 如果 name 与 {@link #toString}
|
||||
* 中描述的字符串表示形式不符抛出此异常
|
||||
*
|
||||
*/
|
||||
public static UUID fromString(String name) {
|
||||
String[] components = name.split("-");
|
||||
if (components.length != 5) {
|
||||
throw new IllegalArgumentException("Invalid UUID string: " + name);
|
||||
}
|
||||
for (int i = 0; i < 5; i++) {
|
||||
components[i] = "0x" + components[i];
|
||||
}
|
||||
|
||||
long mostSigBits = Long.decode(components[0]).longValue();
|
||||
mostSigBits <<= 16;
|
||||
mostSigBits |= Long.decode(components[1]).longValue();
|
||||
mostSigBits <<= 16;
|
||||
mostSigBits |= Long.decode(components[2]).longValue();
|
||||
|
||||
long leastSigBits = Long.decode(components[3]).longValue();
|
||||
leastSigBits <<= 48;
|
||||
leastSigBits |= Long.decode(components[4]).longValue();
|
||||
|
||||
return new UUID(mostSigBits, leastSigBits);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回此 UUID 的 128 位值中的最低有效 64 位。
|
||||
*
|
||||
* @return 此 UUID 的 128 位值中的最低有效 64 位。
|
||||
*/
|
||||
public long getLeastSignificantBits() {
|
||||
return leastSigBits;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回此 UUID 的 128 位值中的最高有效 64 位。
|
||||
*
|
||||
* @return 此 UUID 的 128 位值中最高有效 64 位。
|
||||
*/
|
||||
public long getMostSignificantBits() {
|
||||
return mostSigBits;
|
||||
}
|
||||
|
||||
/**
|
||||
* 与此 {@code UUID} 相关联的版本号. 版本号描述此 {@code UUID} 是如何生成的。
|
||||
* <p>
|
||||
* 版本号具有以下含意:
|
||||
* <ul>
|
||||
* <li>1 基于时间的 UUID
|
||||
* <li>2 DCE 安全 UUID
|
||||
* <li>3 基于名称的 UUID
|
||||
* <li>4 随机生成的 UUID
|
||||
* </ul>
|
||||
*
|
||||
* @return 此 {@code UUID} 的版本号
|
||||
*/
|
||||
public int version() {
|
||||
// Version is bits masked by 0x000000000000F000 in MS long
|
||||
return (int) ((mostSigBits >> 12) & 0x0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* 与此 {@code UUID} 相关联的变体号。变体号描述 {@code UUID} 的布局。
|
||||
* <p>
|
||||
* 变体号具有以下含意:
|
||||
* <ul>
|
||||
* <li>0 为 NCS 向后兼容保留
|
||||
* <li>2 <a href=
|
||||
* "http://www.ietf.org/rfc/rfc4122.txt">IETF RFC 4122</a>(Leach-Salz),
|
||||
* 用于此类
|
||||
* <li>6 保留,微软向后兼容
|
||||
* <li>7 保留供以后定义使用
|
||||
* </ul>
|
||||
*
|
||||
* @return 此 {@code UUID} 相关联的变体号
|
||||
*/
|
||||
public int variant() {
|
||||
// This field is composed of a varying number of bits.
|
||||
// 0 - - Reserved for NCS backward compatibility
|
||||
// 1 0 - The IETF aka Leach-Salz variant (used by this class)
|
||||
// 1 1 0 Reserved, Microsoft backward compatibility
|
||||
// 1 1 1 Reserved for future definition.
|
||||
return (int) ((leastSigBits >>> (64 - (leastSigBits >>> 62))) & (leastSigBits >> 63));
|
||||
}
|
||||
|
||||
/**
|
||||
* 与此 UUID 相关联的时间戳值。
|
||||
*
|
||||
* <p>
|
||||
* 60 位的时间戳值根据此 {@code UUID} 的 time_low、time_mid 和 time_hi 字段构造。<br>
|
||||
* 所得到的时间戳以 100 毫微秒为单位,从 UTC(通用协调时间) 1582 年 10 月 15 日零时开始。
|
||||
*
|
||||
* <p>
|
||||
* 时间戳值仅在在基于时间的 UUID(其 version 类型为 1)中才有意义。<br>
|
||||
* 如果此 {@code UUID} 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。
|
||||
*
|
||||
* @throws UnsupportedOperationException 如果此 {@code UUID} 不是 version 为 1 的 UUID。
|
||||
*/
|
||||
public long timestamp() throws UnsupportedOperationException {
|
||||
checkTimeBase();
|
||||
return (mostSigBits & 0x0FFFL) << 48//
|
||||
| ((mostSigBits >> 16) & 0x0FFFFL) << 32//
|
||||
| mostSigBits >>> 32;
|
||||
}
|
||||
|
||||
/**
|
||||
* 与此 UUID 相关联的时钟序列值。
|
||||
*
|
||||
* <p>
|
||||
* 14 位的时钟序列值根据此 UUID 的 clock_seq 字段构造。clock_seq 字段用于保证在基于时间的 UUID 中的时间唯一性。
|
||||
* <p>
|
||||
* {@code clockSequence} 值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。 如果此 UUID 不是基于时间的
|
||||
* UUID,则此方法抛出 UnsupportedOperationException。
|
||||
*
|
||||
* @return 此 {@code UUID} 的时钟序列
|
||||
*
|
||||
* @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1
|
||||
*/
|
||||
public int clockSequence() throws UnsupportedOperationException {
|
||||
checkTimeBase();
|
||||
return (int) ((leastSigBits & 0x3FFF000000000000L) >>> 48);
|
||||
}
|
||||
|
||||
/**
|
||||
* 与此 UUID 相关的节点值。
|
||||
*
|
||||
* <p>
|
||||
* 48 位的节点值根据此 UUID 的 node 字段构造。此字段旨在用于保存机器的 IEEE 802 地址,该地址用于生成此 UUID 以保证空间唯一性。
|
||||
* <p>
|
||||
* 节点值仅在基于时间的 UUID(其 version 类型为 1)中才有意义。<br>
|
||||
* 如果此 UUID 不是基于时间的 UUID,则此方法抛出 UnsupportedOperationException。
|
||||
*
|
||||
* @return 此 {@code UUID} 的节点值
|
||||
*
|
||||
* @throws UnsupportedOperationException 如果此 UUID 的 version 不为 1
|
||||
*/
|
||||
public long node() throws UnsupportedOperationException {
|
||||
checkTimeBase();
|
||||
return leastSigBits & 0x0000FFFFFFFFFFFFL;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回此{@code UUID} 的字符串表现形式。
|
||||
*
|
||||
* <p>
|
||||
* UUID 的字符串表示形式由此 BNF 描述:
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* UUID = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
|
||||
* time_low = 4*<hexOctet>
|
||||
* time_mid = 2*<hexOctet>
|
||||
* time_high_and_version = 2*<hexOctet>
|
||||
* variant_and_sequence = 2*<hexOctet>
|
||||
* node = 6*<hexOctet>
|
||||
* hexOctet = <hexDigit><hexDigit>
|
||||
* hexDigit = [0-9a-fA-F]
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* </blockquote>
|
||||
*
|
||||
* @return 此{@code UUID} 的字符串表现形式
|
||||
* @see #toString(boolean)
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return toString(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回此{@code UUID} 的字符串表现形式。
|
||||
*
|
||||
* <p>
|
||||
* UUID 的字符串表示形式由此 BNF 描述:
|
||||
*
|
||||
* <pre>
|
||||
* {@code
|
||||
* UUID = <time_low>-<time_mid>-<time_high_and_version>-<variant_and_sequence>-<node>
|
||||
* time_low = 4*<hexOctet>
|
||||
* time_mid = 2*<hexOctet>
|
||||
* time_high_and_version = 2*<hexOctet>
|
||||
* variant_and_sequence = 2*<hexOctet>
|
||||
* node = 6*<hexOctet>
|
||||
* hexOctet = <hexDigit><hexDigit>
|
||||
* hexDigit = [0-9a-fA-F]
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* </blockquote>
|
||||
*
|
||||
* @param isSimple 是否简单模式,简单模式为不带'-'的UUID字符串
|
||||
* @return 此{@code UUID} 的字符串表现形式
|
||||
*/
|
||||
public String toString(boolean isSimple) {
|
||||
final StringBuilder builder = new StringBuilder(isSimple ? 32 : 36);
|
||||
// time_low
|
||||
builder.append(digits(mostSigBits >> 32, 8));
|
||||
if (false == isSimple) {
|
||||
builder.append('-');
|
||||
}
|
||||
// time_mid
|
||||
builder.append(digits(mostSigBits >> 16, 4));
|
||||
if (false == isSimple) {
|
||||
builder.append('-');
|
||||
}
|
||||
// time_high_and_version
|
||||
builder.append(digits(mostSigBits, 4));
|
||||
if (false == isSimple) {
|
||||
builder.append('-');
|
||||
}
|
||||
// variant_and_sequence
|
||||
builder.append(digits(leastSigBits >> 48, 4));
|
||||
if (false == isSimple) {
|
||||
builder.append('-');
|
||||
}
|
||||
// node
|
||||
builder.append(digits(leastSigBits, 12));
|
||||
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回此 UUID 的哈希码。
|
||||
*
|
||||
* @return UUID 的哈希码值。
|
||||
*/
|
||||
public int hashCode() {
|
||||
long hilo = mostSigBits ^ leastSigBits;
|
||||
return ((int) (hilo >> 32)) ^ (int) hilo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将此对象与指定对象比较。
|
||||
* <p>
|
||||
* 当且仅当参数不为 {@code null}、而是一个 UUID 对象、具有与此 UUID 相同的
|
||||
* varriant、包含相同的值(每一位均相同)时,结果才为 {@code true}。
|
||||
*
|
||||
* @param obj 要与之比较的对象
|
||||
*
|
||||
* @return 如果对象相同,则返回 {@code true};否则返回 {@code false}
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if ((null == obj) || (obj.getClass() != UUID.class)) {
|
||||
return false;
|
||||
}
|
||||
UUID id = (UUID) obj;
|
||||
return (mostSigBits == id.mostSigBits && leastSigBits == id.leastSigBits);
|
||||
}
|
||||
|
||||
// Comparison Operations
|
||||
|
||||
/**
|
||||
* 将此 UUID 与指定的 UUID 比较。
|
||||
*
|
||||
* <p>
|
||||
* 如果两个 UUID 不同,且第一个 UUID 的最高有效字段大于第二个 UUID 的对应字段,则第一个 UUID 大于第二个 UUID。
|
||||
*
|
||||
* @param val 与此 UUID 比较的 UUID
|
||||
*
|
||||
* @return 在此 UUID 小于、等于或大于 val 时,分别返回 -1、0 或 1。
|
||||
*
|
||||
*/
|
||||
public int compareTo(UUID val) {
|
||||
// The ordering is intentionally set up so that the UUIDs
|
||||
// can simply be numerically compared as two numbers
|
||||
return (this.mostSigBits < val.mostSigBits ? -1 : //
|
||||
(this.mostSigBits > val.mostSigBits ? 1 : //
|
||||
(this.leastSigBits < val.leastSigBits ? -1 : //
|
||||
(this.leastSigBits > val.leastSigBits ? 1 : //
|
||||
0))));
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------
|
||||
// Private method start
|
||||
/**
|
||||
* 返回指定数字对应的hex值
|
||||
*
|
||||
* @param val 值
|
||||
* @param digits 位
|
||||
* @return 值
|
||||
*/
|
||||
private static String digits(long val, int digits) {
|
||||
long hi = 1L << (digits * 4);
|
||||
return Long.toHexString(hi | (val & (hi - 1))).substring(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否为time-based版本UUID
|
||||
*/
|
||||
private void checkTimeBase() {
|
||||
if (version() != 1) {
|
||||
throw new UnsupportedOperationException("Not a time-based UUID");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取{@link SecureRandom},类提供加密的强随机数生成器 (RNG)
|
||||
*
|
||||
* @return {@link SecureRandom}
|
||||
*/
|
||||
public static SecureRandom getSecureRandom() {
|
||||
try {
|
||||
return SecureRandom.getInstance("SHA1PRNG");
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new UtilException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取随机数生成器对象<br>
|
||||
* ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。
|
||||
*
|
||||
* @return {@link ThreadLocalRandom}
|
||||
*/
|
||||
public static ThreadLocalRandom getRandom() {
|
||||
return ThreadLocalRandom.current();
|
||||
}
|
||||
}
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
|
||||
connectionURL="jdbc:mysql://localhost:3306/dts-demo?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&verifyServerCertificate=false&useSSL=false"
|
||||
userId="root"
|
||||
password="Ab888888"/>
|
||||
password="root"/>
|
||||
|
||||
<javaTypeResolver>
|
||||
<property name="useJSR310Types" value="true"/>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package com.qiguliuxing.dts.db.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class CategorySellAmts implements Serializable{
|
||||
|
||||
private static final long serialVersionUID = 677901688504280013L;
|
||||
|
||||
private String name;
|
||||
|
||||
private BigDecimal value;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public BigDecimal getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(BigDecimal value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.qiguliuxing.dts.db.bean;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class DayStatis {
|
||||
|
||||
private String dayStr;
|
||||
|
||||
private int cnts;
|
||||
|
||||
private BigDecimal amts;
|
||||
|
||||
public String getDayStr() {
|
||||
return dayStr;
|
||||
}
|
||||
public void setDayStr(String dayStr) {
|
||||
this.dayStr = dayStr;
|
||||
}
|
||||
public int getCnts() {
|
||||
return cnts;
|
||||
}
|
||||
public void setCnts(int cnts) {
|
||||
this.cnts = cnts;
|
||||
}
|
||||
public BigDecimal getAmts() {
|
||||
return amts;
|
||||
}
|
||||
public void setAmts(BigDecimal amts) {
|
||||
this.amts = amts;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,132 @@
|
|||
package com.qiguliuxing.dts.db.dao;
|
||||
|
||||
import com.qiguliuxing.dts.db.domain.DtsAgencyShare;
|
||||
import com.qiguliuxing.dts.db.domain.DtsAgencyShareExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface DtsAgencyShareMapper {
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(DtsAgencyShareExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByExample(DtsAgencyShareExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(DtsAgencyShare record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(DtsAgencyShare record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
DtsAgencyShare selectOneByExample(DtsAgencyShareExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
DtsAgencyShare selectOneByExampleSelective(@Param("example") DtsAgencyShareExample example, @Param("selective") DtsAgencyShare.Column ... selective);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
List<DtsAgencyShare> selectByExampleSelective(@Param("example") DtsAgencyShareExample example, @Param("selective") DtsAgencyShare.Column ... selective);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DtsAgencyShare> selectByExample(DtsAgencyShareExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
DtsAgencyShare selectByPrimaryKeySelective(@Param("id") Integer id, @Param("selective") DtsAgencyShare.Column ... selective);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
DtsAgencyShare selectByPrimaryKey(Integer id);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") DtsAgencyShare record, @Param("example") DtsAgencyShareExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByExample(@Param("record") DtsAgencyShare record, @Param("example") DtsAgencyShareExample example);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(DtsAgencyShare record);
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(DtsAgencyShare record);
|
||||
}
|
||||
|
|
@ -18,7 +18,14 @@ public interface AccountMapperEx {
|
|||
|
||||
List<Integer> getShareUserId();
|
||||
|
||||
BigDecimal getLastMonthSettleMoney(@Param("sharedUserId") Integer sharedUserId,
|
||||
/**
|
||||
* 获取用户时间范围内待结算的金额
|
||||
* @param sharedUserId
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getToSettleMoney(@Param("sharedUserId") Integer sharedUserId,
|
||||
@Param("startTime") String startTime, @Param("endTime") String endTime);
|
||||
|
||||
/**
|
||||
|
|
@ -70,4 +77,17 @@ public interface AccountMapperEx {
|
|||
*/
|
||||
List<DtsOrder> querySettlementOrder(@Param("sharedUserId") Integer sharedUserId,
|
||||
@Param("conditionSql") String conditionSql);
|
||||
|
||||
/**
|
||||
* 获取用户的未结算佣金
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getUserUnOrderSettleMoney(@Param("userId") Integer userId);
|
||||
|
||||
/**
|
||||
* 将用户订单的的状态调整为已结算
|
||||
* @param userId
|
||||
*/
|
||||
void setUserOrderSettleStaus(@Param("userId") Integer userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package com.qiguliuxing.dts.db.dao.ex;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.qiguliuxing.dts.db.domain.DtsComment;
|
||||
|
||||
/**
|
||||
* 评论管理DAO层接口
|
||||
* @author QIGULIUXING
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface CommentMapperEx {
|
||||
|
||||
/**
|
||||
* 按入驻店铺查询归属的评论信息
|
||||
* @param userId
|
||||
* @param valueId
|
||||
* @param orderBySql
|
||||
* @param brandIdsSql
|
||||
* @return
|
||||
*/
|
||||
List<DtsComment> queryBrandComment(@Param("type") Byte type,@Param("userId") String userId, @Param("valueId") String valueId, @Param("orderBySql") String orderBySql, @Param("brandIdsSql") String brandIdsSql);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.qiguliuxing.dts.db.dao.ex;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.qiguliuxing.dts.db.domain.DtsGroupon;
|
||||
import com.qiguliuxing.dts.db.domain.DtsGrouponRules;
|
||||
|
||||
/**
|
||||
* 团购管理
|
||||
* @author QIGULIUXING
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface GrouponMapperEx {
|
||||
|
||||
/**
|
||||
* 按入驻店铺查询归属的团购规则信息
|
||||
* @param goodsId
|
||||
* @param orderBySql
|
||||
* @param brandIdsSql
|
||||
* @return
|
||||
*/
|
||||
List<DtsGrouponRules> queryBrandGrouponRules(@Param("goodsId") String goodsId, @Param("orderBySql") String orderBySql, @Param("brandIdsSql") String brandIdsSql);
|
||||
|
||||
/**
|
||||
* 按入驻店铺查询归属的团购记录信息
|
||||
* @param goodsId
|
||||
* @param orderBySql
|
||||
* @param brandIdsSql
|
||||
* @return
|
||||
*/
|
||||
List<DtsGroupon> queryBrandGroupons(@Param("rulesId") String rulesId, @Param("orderBySql") String orderBySql, @Param("brandIdsSql") String brandIdsSql);
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +1,26 @@
|
|||
package com.qiguliuxing.dts.db.dao.ex;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.qiguliuxing.dts.db.domain.DtsOrder;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public interface OrderMapper {
|
||||
|
||||
int updateWithOptimisticLocker(@Param("lastUpdateTime") LocalDateTime lastUpdateTime,
|
||||
@Param("order") DtsOrder order);
|
||||
|
||||
/**
|
||||
* 根据条件获取入驻店铺的订单
|
||||
* @param userId
|
||||
* @param orderSn
|
||||
* @param orderStatusSql
|
||||
* @param orderBySql
|
||||
* @param brandIdsSql
|
||||
* @return
|
||||
*/
|
||||
List<DtsOrder> selectBrandOrdersByExample(@Param("userId") Integer userId, @Param("orderSn") String orderSn, @Param("orderStatusSql") String orderStatusSql, @Param("orderBySql") String orderBySql,
|
||||
@Param("brandIdsSql") String brandIdsSql);
|
||||
}
|
||||
|
|
@ -3,11 +3,51 @@ package com.qiguliuxing.dts.db.dao.ex;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.qiguliuxing.dts.db.bean.CategorySellAmts;
|
||||
import com.qiguliuxing.dts.db.bean.DayStatis;
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
public interface StatMapper {
|
||||
|
||||
/**
|
||||
* 统计近多少天之内的用户增长量
|
||||
* @param daysAgo
|
||||
* @return
|
||||
*/
|
||||
List<DayStatis> statisIncreaseUserCnt(@Param("daysAgo") int daysAgo);
|
||||
|
||||
/**
|
||||
* 统计近多少天之内的订单增长量
|
||||
* @param daysAgo
|
||||
* @return
|
||||
*/
|
||||
List<DayStatis> statisIncreaseOrderCnt(@Param("daysAgo") int daysAgo);
|
||||
|
||||
/**
|
||||
* 类目销售额统计
|
||||
* @return
|
||||
*/
|
||||
List<CategorySellAmts> categorySellStatis();
|
||||
|
||||
/**
|
||||
* 用户数统计
|
||||
* @return
|
||||
*/
|
||||
List<Map> statUser();
|
||||
|
||||
/**
|
||||
* 订单数统计
|
||||
* @return
|
||||
*/
|
||||
List<Map> statOrder();
|
||||
|
||||
/**
|
||||
* 商品数统计
|
||||
* @return
|
||||
*/
|
||||
List<Map> statGoods();
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -54,20 +54,20 @@ public class DtsAccountTrace {
|
|||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_account_trace.remain_amount
|
||||
* This field corresponds to the database column dts_account_trace.total_amount
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private BigDecimal remainAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_account_trace.trace_time
|
||||
* This field corresponds to the database column dts_account_trace.add_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private LocalDateTime traceTime;
|
||||
private LocalDateTime addTime;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -87,6 +87,33 @@ public class DtsAccountTrace {
|
|||
*/
|
||||
private String smsCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_account_trace.status
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private Byte status;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_account_trace.trace_msg
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private String traceMsg;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_account_trace.update_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_account_trace.id
|
||||
|
|
@ -209,50 +236,50 @@ public class DtsAccountTrace {
|
|||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_account_trace.remain_amount
|
||||
* This method returns the value of the database column dts_account_trace.total_amount
|
||||
*
|
||||
* @return the value of dts_account_trace.remain_amount
|
||||
* @return the value of dts_account_trace.total_amount
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public BigDecimal getRemainAmount() {
|
||||
return remainAmount;
|
||||
public BigDecimal getTotalAmount() {
|
||||
return totalAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_account_trace.remain_amount
|
||||
* This method sets the value of the database column dts_account_trace.total_amount
|
||||
*
|
||||
* @param remainAmount the value for dts_account_trace.remain_amount
|
||||
* @param totalAmount the value for dts_account_trace.total_amount
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setRemainAmount(BigDecimal remainAmount) {
|
||||
this.remainAmount = remainAmount;
|
||||
public void setTotalAmount(BigDecimal totalAmount) {
|
||||
this.totalAmount = totalAmount;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_account_trace.trace_time
|
||||
* This method returns the value of the database column dts_account_trace.add_time
|
||||
*
|
||||
* @return the value of dts_account_trace.trace_time
|
||||
* @return the value of dts_account_trace.add_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public LocalDateTime getTraceTime() {
|
||||
return traceTime;
|
||||
public LocalDateTime getAddTime() {
|
||||
return addTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_account_trace.trace_time
|
||||
* This method sets the value of the database column dts_account_trace.add_time
|
||||
*
|
||||
* @param traceTime the value for dts_account_trace.trace_time
|
||||
* @param addTime the value for dts_account_trace.add_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setTraceTime(LocalDateTime traceTime) {
|
||||
this.traceTime = traceTime;
|
||||
public void setAddTime(LocalDateTime addTime) {
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -303,6 +330,78 @@ public class DtsAccountTrace {
|
|||
this.smsCode = smsCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_account_trace.status
|
||||
*
|
||||
* @return the value of dts_account_trace.status
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Byte getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_account_trace.status
|
||||
*
|
||||
* @param status the value for dts_account_trace.status
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setStatus(Byte status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_account_trace.trace_msg
|
||||
*
|
||||
* @return the value of dts_account_trace.trace_msg
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getTraceMsg() {
|
||||
return traceMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_account_trace.trace_msg
|
||||
*
|
||||
* @param traceMsg the value for dts_account_trace.trace_msg
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setTraceMsg(String traceMsg) {
|
||||
this.traceMsg = traceMsg;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_account_trace.update_time
|
||||
*
|
||||
* @return the value of dts_account_trace.update_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public LocalDateTime getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_account_trace.update_time
|
||||
*
|
||||
* @param updateTime the value for dts_account_trace.update_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setUpdateTime(LocalDateTime updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
|
|
@ -320,10 +419,13 @@ public class DtsAccountTrace {
|
|||
sb.append(", userId=").append(userId);
|
||||
sb.append(", type=").append(type);
|
||||
sb.append(", amount=").append(amount);
|
||||
sb.append(", remainAmount=").append(remainAmount);
|
||||
sb.append(", traceTime=").append(traceTime);
|
||||
sb.append(", totalAmount=").append(totalAmount);
|
||||
sb.append(", addTime=").append(addTime);
|
||||
sb.append(", mobile=").append(mobile);
|
||||
sb.append(", smsCode=").append(smsCode);
|
||||
sb.append(", status=").append(status);
|
||||
sb.append(", traceMsg=").append(traceMsg);
|
||||
sb.append(", updateTime=").append(updateTime);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
@ -351,10 +453,13 @@ public class DtsAccountTrace {
|
|||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
|
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
|
||||
&& (this.getAmount() == null ? other.getAmount() == null : this.getAmount().equals(other.getAmount()))
|
||||
&& (this.getRemainAmount() == null ? other.getRemainAmount() == null : this.getRemainAmount().equals(other.getRemainAmount()))
|
||||
&& (this.getTraceTime() == null ? other.getTraceTime() == null : this.getTraceTime().equals(other.getTraceTime()))
|
||||
&& (this.getTotalAmount() == null ? other.getTotalAmount() == null : this.getTotalAmount().equals(other.getTotalAmount()))
|
||||
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
|
||||
&& (this.getMobile() == null ? other.getMobile() == null : this.getMobile().equals(other.getMobile()))
|
||||
&& (this.getSmsCode() == null ? other.getSmsCode() == null : this.getSmsCode().equals(other.getSmsCode()));
|
||||
&& (this.getSmsCode() == null ? other.getSmsCode() == null : this.getSmsCode().equals(other.getSmsCode()))
|
||||
&& (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
|
||||
&& (this.getTraceMsg() == null ? other.getTraceMsg() == null : this.getTraceMsg().equals(other.getTraceMsg()))
|
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -372,10 +477,13 @@ public class DtsAccountTrace {
|
|||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
|
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
|
||||
result = prime * result + ((getAmount() == null) ? 0 : getAmount().hashCode());
|
||||
result = prime * result + ((getRemainAmount() == null) ? 0 : getRemainAmount().hashCode());
|
||||
result = prime * result + ((getTraceTime() == null) ? 0 : getTraceTime().hashCode());
|
||||
result = prime * result + ((getTotalAmount() == null) ? 0 : getTotalAmount().hashCode());
|
||||
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
|
||||
result = prime * result + ((getMobile() == null) ? 0 : getMobile().hashCode());
|
||||
result = prime * result + ((getSmsCode() == null) ? 0 : getSmsCode().hashCode());
|
||||
result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
|
||||
result = prime * result + ((getTraceMsg() == null) ? 0 : getTraceMsg().hashCode());
|
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -392,10 +500,13 @@ public class DtsAccountTrace {
|
|||
userId("user_id", "userId", "INTEGER", false),
|
||||
type("type", "type", "INTEGER", true),
|
||||
amount("amount", "amount", "DECIMAL", false),
|
||||
remainAmount("remain_amount", "remainAmount", "DECIMAL", false),
|
||||
traceTime("trace_time", "traceTime", "TIMESTAMP", false),
|
||||
totalAmount("total_amount", "totalAmount", "DECIMAL", false),
|
||||
addTime("add_time", "addTime", "TIMESTAMP", false),
|
||||
mobile("mobile", "mobile", "VARCHAR", false),
|
||||
smsCode("sms_code", "smsCode", "VARCHAR", false);
|
||||
smsCode("sms_code", "smsCode", "VARCHAR", false),
|
||||
status("status", "status", "TINYINT", true),
|
||||
traceMsg("trace_msg", "traceMsg", "VARCHAR", false),
|
||||
updateTime("update_time", "updateTime", "TIMESTAMP", false);
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
|
|
|
|||
|
|
@ -909,18 +909,18 @@ public class DtsAccountTraceExample {
|
|||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountIsNull() {
|
||||
addCriterion("remain_amount is null");
|
||||
public Criteria andTotalAmountIsNull() {
|
||||
addCriterion("total_amount is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountIsNotNull() {
|
||||
addCriterion("remain_amount is not null");
|
||||
public Criteria andTotalAmountIsNotNull() {
|
||||
addCriterion("total_amount is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountEqualTo(BigDecimal value) {
|
||||
addCriterion("remain_amount =", value, "remainAmount");
|
||||
public Criteria andTotalAmountEqualTo(BigDecimal value) {
|
||||
addCriterion("total_amount =", value, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -931,13 +931,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andRemainAmountEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("remain_amount = ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andTotalAmountEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("total_amount = ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountNotEqualTo(BigDecimal value) {
|
||||
addCriterion("remain_amount <>", value, "remainAmount");
|
||||
public Criteria andTotalAmountNotEqualTo(BigDecimal value) {
|
||||
addCriterion("total_amount <>", value, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -948,13 +948,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andRemainAmountNotEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("remain_amount <> ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andTotalAmountNotEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("total_amount <> ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountGreaterThan(BigDecimal value) {
|
||||
addCriterion("remain_amount >", value, "remainAmount");
|
||||
public Criteria andTotalAmountGreaterThan(BigDecimal value) {
|
||||
addCriterion("total_amount >", value, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -965,13 +965,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andRemainAmountGreaterThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("remain_amount > ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andTotalAmountGreaterThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("total_amount > ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("remain_amount >=", value, "remainAmount");
|
||||
public Criteria andTotalAmountGreaterThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("total_amount >=", value, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -982,13 +982,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andRemainAmountGreaterThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("remain_amount >= ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andTotalAmountGreaterThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("total_amount >= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountLessThan(BigDecimal value) {
|
||||
addCriterion("remain_amount <", value, "remainAmount");
|
||||
public Criteria andTotalAmountLessThan(BigDecimal value) {
|
||||
addCriterion("total_amount <", value, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -999,13 +999,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andRemainAmountLessThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("remain_amount < ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andTotalAmountLessThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("total_amount < ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("remain_amount <=", value, "remainAmount");
|
||||
public Criteria andTotalAmountLessThanOrEqualTo(BigDecimal value) {
|
||||
addCriterion("total_amount <=", value, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -1016,43 +1016,43 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andRemainAmountLessThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("remain_amount <= ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andTotalAmountLessThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("total_amount <= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountIn(List<BigDecimal> values) {
|
||||
addCriterion("remain_amount in", values, "remainAmount");
|
||||
public Criteria andTotalAmountIn(List<BigDecimal> values) {
|
||||
addCriterion("total_amount in", values, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountNotIn(List<BigDecimal> values) {
|
||||
addCriterion("remain_amount not in", values, "remainAmount");
|
||||
public Criteria andTotalAmountNotIn(List<BigDecimal> values) {
|
||||
addCriterion("total_amount not in", values, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("remain_amount between", value1, value2, "remainAmount");
|
||||
public Criteria andTotalAmountBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("total_amount between", value1, value2, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andRemainAmountNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("remain_amount not between", value1, value2, "remainAmount");
|
||||
public Criteria andTotalAmountNotBetween(BigDecimal value1, BigDecimal value2) {
|
||||
addCriterion("total_amount not between", value1, value2, "totalAmount");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeIsNull() {
|
||||
addCriterion("trace_time is null");
|
||||
public Criteria andAddTimeIsNull() {
|
||||
addCriterion("add_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeIsNotNull() {
|
||||
addCriterion("trace_time is not null");
|
||||
public Criteria andAddTimeIsNotNull() {
|
||||
addCriterion("add_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeEqualTo(LocalDateTime value) {
|
||||
addCriterion("trace_time =", value, "traceTime");
|
||||
public Criteria andAddTimeEqualTo(LocalDateTime value) {
|
||||
addCriterion("add_time =", value, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -1063,13 +1063,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceTimeEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_time = ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andAddTimeEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("add_time = ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeNotEqualTo(LocalDateTime value) {
|
||||
addCriterion("trace_time <>", value, "traceTime");
|
||||
public Criteria andAddTimeNotEqualTo(LocalDateTime value) {
|
||||
addCriterion("add_time <>", value, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -1080,13 +1080,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceTimeNotEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_time <> ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andAddTimeNotEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("add_time <> ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeGreaterThan(LocalDateTime value) {
|
||||
addCriterion("trace_time >", value, "traceTime");
|
||||
public Criteria andAddTimeGreaterThan(LocalDateTime value) {
|
||||
addCriterion("add_time >", value, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -1097,13 +1097,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceTimeGreaterThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_time > ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andAddTimeGreaterThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("add_time > ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeGreaterThanOrEqualTo(LocalDateTime value) {
|
||||
addCriterion("trace_time >=", value, "traceTime");
|
||||
public Criteria andAddTimeGreaterThanOrEqualTo(LocalDateTime value) {
|
||||
addCriterion("add_time >=", value, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -1114,13 +1114,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceTimeGreaterThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_time >= ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andAddTimeGreaterThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("add_time >= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeLessThan(LocalDateTime value) {
|
||||
addCriterion("trace_time <", value, "traceTime");
|
||||
public Criteria andAddTimeLessThan(LocalDateTime value) {
|
||||
addCriterion("add_time <", value, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -1131,13 +1131,13 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceTimeLessThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_time < ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andAddTimeLessThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("add_time < ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeLessThanOrEqualTo(LocalDateTime value) {
|
||||
addCriterion("trace_time <=", value, "traceTime");
|
||||
public Criteria andAddTimeLessThanOrEqualTo(LocalDateTime value) {
|
||||
addCriterion("add_time <=", value, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -1148,28 +1148,28 @@ public class DtsAccountTraceExample {
|
|||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceTimeLessThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_time <= ").append(column.getEscapedColumnName()).toString());
|
||||
public Criteria andAddTimeLessThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("add_time <= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeIn(List<LocalDateTime> values) {
|
||||
addCriterion("trace_time in", values, "traceTime");
|
||||
public Criteria andAddTimeIn(List<LocalDateTime> values) {
|
||||
addCriterion("add_time in", values, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeNotIn(List<LocalDateTime> values) {
|
||||
addCriterion("trace_time not in", values, "traceTime");
|
||||
public Criteria andAddTimeNotIn(List<LocalDateTime> values) {
|
||||
addCriterion("add_time not in", values, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeBetween(LocalDateTime value1, LocalDateTime value2) {
|
||||
addCriterion("trace_time between", value1, value2, "traceTime");
|
||||
public Criteria andAddTimeBetween(LocalDateTime value1, LocalDateTime value2) {
|
||||
addCriterion("add_time between", value1, value2, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
|
||||
addCriterion("trace_time not between", value1, value2, "traceTime");
|
||||
public Criteria andAddTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
|
||||
addCriterion("add_time not between", value1, value2, "addTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
|
|
@ -1456,6 +1456,412 @@ public class DtsAccountTraceExample {
|
|||
addCriterion("sms_code not between", value1, value2, "smsCode");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("`status` is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("`status` is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(Byte value) {
|
||||
addCriterion("`status` =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andStatusEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("`status` = ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(Byte value) {
|
||||
addCriterion("`status` <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andStatusNotEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("`status` <> ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(Byte value) {
|
||||
addCriterion("`status` >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andStatusGreaterThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("`status` > ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Byte value) {
|
||||
addCriterion("`status` >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andStatusGreaterThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("`status` >= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(Byte value) {
|
||||
addCriterion("`status` <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andStatusLessThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("`status` < ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Byte value) {
|
||||
addCriterion("`status` <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andStatusLessThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("`status` <= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<Byte> values) {
|
||||
addCriterion("`status` in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<Byte> values) {
|
||||
addCriterion("`status` not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(Byte value1, Byte value2) {
|
||||
addCriterion("`status` between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(Byte value1, Byte value2) {
|
||||
addCriterion("`status` not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgIsNull() {
|
||||
addCriterion("trace_msg is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgIsNotNull() {
|
||||
addCriterion("trace_msg is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgEqualTo(String value) {
|
||||
addCriterion("trace_msg =", value, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceMsgEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_msg = ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgNotEqualTo(String value) {
|
||||
addCriterion("trace_msg <>", value, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceMsgNotEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_msg <> ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgGreaterThan(String value) {
|
||||
addCriterion("trace_msg >", value, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceMsgGreaterThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_msg > ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("trace_msg >=", value, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceMsgGreaterThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_msg >= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgLessThan(String value) {
|
||||
addCriterion("trace_msg <", value, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceMsgLessThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_msg < ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgLessThanOrEqualTo(String value) {
|
||||
addCriterion("trace_msg <=", value, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andTraceMsgLessThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("trace_msg <= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgLike(String value) {
|
||||
addCriterion("trace_msg like", value, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgNotLike(String value) {
|
||||
addCriterion("trace_msg not like", value, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgIn(List<String> values) {
|
||||
addCriterion("trace_msg in", values, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgNotIn(List<String> values) {
|
||||
addCriterion("trace_msg not in", values, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgBetween(String value1, String value2) {
|
||||
addCriterion("trace_msg between", value1, value2, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTraceMsgNotBetween(String value1, String value2) {
|
||||
addCriterion("trace_msg not between", value1, value2, "traceMsg");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNull() {
|
||||
addCriterion("update_time is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIsNotNull() {
|
||||
addCriterion("update_time is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeEqualTo(LocalDateTime value) {
|
||||
addCriterion("update_time =", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andUpdateTimeEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotEqualTo(LocalDateTime value) {
|
||||
addCriterion("update_time <>", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andUpdateTimeNotEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThan(LocalDateTime value) {
|
||||
addCriterion("update_time >", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andUpdateTimeGreaterThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualTo(LocalDateTime value) {
|
||||
addCriterion("update_time >=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThan(LocalDateTime value) {
|
||||
addCriterion("update_time <", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andUpdateTimeLessThanColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeLessThanOrEqualTo(LocalDateTime value) {
|
||||
addCriterion("update_time <=", value, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_account_trace
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public Criteria andUpdateTimeLessThanOrEqualToColumn(DtsAccountTrace.Column column) {
|
||||
addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString());
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeIn(List<LocalDateTime> values) {
|
||||
addCriterion("update_time in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotIn(List<LocalDateTime> values) {
|
||||
addCriterion("update_time not in", values, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeBetween(LocalDateTime value1, LocalDateTime value2) {
|
||||
addCriterion("update_time between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdateTimeNotBetween(LocalDateTime value1, LocalDateTime value2) {
|
||||
addCriterion("update_time not between", value1, value2, "updateTime");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,489 @@
|
|||
package com.qiguliuxing.dts.db.domain;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class DtsAgencyShare {
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_agency_share.id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_agency_share.user_id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_agency_share.share_url
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private String shareUrl;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_agency_share.type
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_agency_share.share_obj_id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private Integer shareObjId;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_agency_share.add_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private LocalDateTime addTime;
|
||||
|
||||
/**
|
||||
*
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database column dts_agency_share.update_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_agency_share.id
|
||||
*
|
||||
* @return the value of dts_agency_share.id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_agency_share.id
|
||||
*
|
||||
* @param id the value for dts_agency_share.id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_agency_share.user_id
|
||||
*
|
||||
* @return the value of dts_agency_share.user_id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_agency_share.user_id
|
||||
*
|
||||
* @param userId the value for dts_agency_share.user_id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_agency_share.share_url
|
||||
*
|
||||
* @return the value of dts_agency_share.share_url
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getShareUrl() {
|
||||
return shareUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_agency_share.share_url
|
||||
*
|
||||
* @param shareUrl the value for dts_agency_share.share_url
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setShareUrl(String shareUrl) {
|
||||
this.shareUrl = shareUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_agency_share.type
|
||||
*
|
||||
* @return the value of dts_agency_share.type
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_agency_share.type
|
||||
*
|
||||
* @param type the value for dts_agency_share.type
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_agency_share.share_obj_id
|
||||
*
|
||||
* @return the value of dts_agency_share.share_obj_id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getShareObjId() {
|
||||
return shareObjId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_agency_share.share_obj_id
|
||||
*
|
||||
* @param shareObjId the value for dts_agency_share.share_obj_id
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setShareObjId(Integer shareObjId) {
|
||||
this.shareObjId = shareObjId;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_agency_share.add_time
|
||||
*
|
||||
* @return the value of dts_agency_share.add_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public LocalDateTime getAddTime() {
|
||||
return addTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_agency_share.add_time
|
||||
*
|
||||
* @param addTime the value for dts_agency_share.add_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setAddTime(LocalDateTime addTime) {
|
||||
this.addTime = addTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method returns the value of the database column dts_agency_share.update_time
|
||||
*
|
||||
* @return the value of dts_agency_share.update_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public LocalDateTime getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method sets the value of the database column dts_agency_share.update_time
|
||||
*
|
||||
* @param updateTime the value for dts_agency_share.update_time
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setUpdateTime(LocalDateTime updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(getClass().getSimpleName());
|
||||
sb.append(" [");
|
||||
sb.append("Hash = ").append(hashCode());
|
||||
sb.append(", id=").append(id);
|
||||
sb.append(", userId=").append(userId);
|
||||
sb.append(", shareUrl=").append(shareUrl);
|
||||
sb.append(", type=").append(type);
|
||||
sb.append(", shareObjId=").append(shareObjId);
|
||||
sb.append(", addTime=").append(addTime);
|
||||
sb.append(", updateTime=").append(updateTime);
|
||||
sb.append("]");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object that) {
|
||||
if (this == that) {
|
||||
return true;
|
||||
}
|
||||
if (that == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != that.getClass()) {
|
||||
return false;
|
||||
}
|
||||
DtsAgencyShare other = (DtsAgencyShare) that;
|
||||
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
|
||||
&& (this.getShareUrl() == null ? other.getShareUrl() == null : this.getShareUrl().equals(other.getShareUrl()))
|
||||
&& (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()))
|
||||
&& (this.getShareObjId() == null ? other.getShareObjId() == null : this.getShareObjId().equals(other.getShareObjId()))
|
||||
&& (this.getAddTime() == null ? other.getAddTime() == null : this.getAddTime().equals(other.getAddTime()))
|
||||
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
|
||||
result = prime * result + ((getShareUrl() == null) ? 0 : getShareUrl().hashCode());
|
||||
result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
|
||||
result = prime * result + ((getShareObjId() == null) ? 0 : getShareObjId().hashCode());
|
||||
result = prime * result + ((getAddTime() == null) ? 0 : getAddTime().hashCode());
|
||||
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This enum was generated by MyBatis Generator.
|
||||
* This enum corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public enum Column {
|
||||
id("id", "id", "INTEGER", false),
|
||||
userId("user_id", "userId", "INTEGER", false),
|
||||
shareUrl("share_url", "shareUrl", "VARCHAR", false),
|
||||
type("type", "type", "INTEGER", true),
|
||||
shareObjId("share_obj_id", "shareObjId", "INTEGER", false),
|
||||
addTime("add_time", "addTime", "TIMESTAMP", false),
|
||||
updateTime("update_time", "updateTime", "TIMESTAMP", false);
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
private static final String BEGINNING_DELIMITER = "`";
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
private static final String ENDING_DELIMITER = "`";
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
private final String column;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
private final boolean isColumnNameDelimited;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
private final String javaProperty;
|
||||
|
||||
/**
|
||||
* This field was generated by MyBatis Generator.
|
||||
* This field corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
private final String jdbcType;
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public String value() {
|
||||
return this.column;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public String getValue() {
|
||||
return this.column;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public String getJavaProperty() {
|
||||
return this.javaProperty;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public String getJdbcType() {
|
||||
return this.jdbcType;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) {
|
||||
this.column = column;
|
||||
this.javaProperty = javaProperty;
|
||||
this.jdbcType = jdbcType;
|
||||
this.isColumnNameDelimited = isColumnNameDelimited;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public String desc() {
|
||||
return this.getEscapedColumnName() + " DESC";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public String asc() {
|
||||
return this.getEscapedColumnName() + " ASC";
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public static Column[] excludes(Column ... excludes) {
|
||||
ArrayList<Column> columns = new ArrayList<>(Arrays.asList(Column.values()));
|
||||
if (excludes != null && excludes.length > 0) {
|
||||
columns.removeAll(new ArrayList<>(Arrays.asList(excludes)));
|
||||
}
|
||||
return columns.toArray(new Column[]{});
|
||||
}
|
||||
|
||||
/**
|
||||
* This method was generated by MyBatis Generator.
|
||||
* This method corresponds to the database table dts_agency_share
|
||||
*
|
||||
* @mbg.generated
|
||||
* @project https://github.com/itfsw/mybatis-generator-plugin
|
||||
*/
|
||||
public String getEscapedColumnName() {
|
||||
if (this.isColumnNameDelimited) {
|
||||
return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString();
|
||||
} else {
|
||||
return this.column;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -12,11 +12,12 @@ import java.util.Random;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.qiguliuxing.dts.db.dao.DtsAccountTraceMapper;
|
||||
|
|
@ -33,8 +34,11 @@ import com.qiguliuxing.dts.db.domain.DtsUserExample;
|
|||
|
||||
@Service
|
||||
public class DtsAccountService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(DtsAccountService.class);
|
||||
|
||||
private final static Log logger = LogFactory.getLog(DtsAccountService.class);
|
||||
public static final long TWO_MONTH_DAYS = 60;//近两个月,60天
|
||||
|
||||
public static final long ONE_WEEK_DAYS = 7;//近一周
|
||||
|
||||
@Resource
|
||||
private DtsUserAccountMapper userAccountMapper;
|
||||
|
|
@ -54,10 +58,12 @@ public class DtsAccountService {
|
|||
example.or().andUserIdEqualTo(shareUserId);
|
||||
List<DtsUserAccount> accounts = userAccountMapper.selectByExample(example);
|
||||
// Assert.state(accounts.size() < 2, "同一个用户存在两个账户");
|
||||
if (accounts.size() == 0) {
|
||||
if (accounts.size() == 1) {
|
||||
return accounts.get(0);
|
||||
} else {
|
||||
logger.error("根据代理用户id:{},获取账号信息出错!!!",shareUserId);
|
||||
return null;
|
||||
}
|
||||
return accounts.get(0);
|
||||
}
|
||||
|
||||
public List<Integer> findAllSharedUserId() {
|
||||
|
|
@ -75,62 +81,56 @@ public class DtsAccountService {
|
|||
return sb.toString();
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
|
||||
public void setSettleMentAccount(Integer sharedUserId, String prevMonthEndDay) throws Exception {
|
||||
public void setSettleMentAccount(Integer sharedUserId, String prevMonthEndDay,Integer type) throws Exception {
|
||||
// 1.获取用户的代理订单代理金额
|
||||
String endTime = prevMonthEndDay + " 23:59:59";
|
||||
String startTime = prevMonthEndDay.substring(0, 7) + "-01 00:00:00";
|
||||
BigDecimal totalSettleMoney = accountMapperEx.getLastMonthSettleMoney(sharedUserId, startTime, endTime);
|
||||
logger.info("代理用户编号: {" + sharedUserId + "},日期:" + startTime + " - " + endTime + ",获取佣金: " + totalSettleMoney
|
||||
BigDecimal toSettleMoney = accountMapperEx.getToSettleMoney(sharedUserId, startTime, endTime);
|
||||
if (toSettleMoney == null || toSettleMoney.compareTo(new BigDecimal(0)) <= 0) {//如果无佣金
|
||||
toSettleMoney = new BigDecimal(0);
|
||||
}
|
||||
logger.info("代理用户编号: {" + sharedUserId + "},日期:" + startTime + " - " + endTime + ",获取佣金: " + toSettleMoney
|
||||
+ "元");
|
||||
|
||||
// 更新订单结算状态
|
||||
accountMapperEx.setLastMonthOrderSettleStaus(sharedUserId, startTime, endTime);
|
||||
|
||||
Integer settlementRate = 4;
|
||||
if (totalSettleMoney.compareTo(new BigDecimal("0")) == 0) {// 如果该用户未产生推荐单,则降低结算比例
|
||||
settlementRate = 2;
|
||||
if (toSettleMoney.compareTo(new BigDecimal(0)) > 0) {
|
||||
settleApplyTrace(sharedUserId, startTime,endTime,type, toSettleMoney,null);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
|
||||
public void settleApplyTrace(Integer sharedUserId, String startTime,String endTime,Integer type, BigDecimal toSettleMoney,String mobile) {
|
||||
|
||||
Integer settlementRate = 5;
|
||||
// 获取用户账户信息并更新记录
|
||||
DtsUserAccount account = this.findShareUserAccountByUserId(sharedUserId);
|
||||
|
||||
if (account != null && toSettleMoney.compareTo(new BigDecimal("0")) == 0) {// 如果该用户未产生推荐单,则降低结算比例
|
||||
settlementRate = account.getSettlementRate() > 8 ? 8 : account.getSettlementRate();
|
||||
}
|
||||
|
||||
// 更新订单结算状态
|
||||
accountMapperEx.setLastMonthOrderSettleStaus(sharedUserId, startTime, endTime);
|
||||
|
||||
//更新代理用户账号信息
|
||||
account.setRemainAmount(account.getRemainAmount().add(toSettleMoney));//剩余结算,尚未结算给用户
|
||||
account.setTotalAmount(account.getTotalAmount().add(toSettleMoney));
|
||||
account.setModifyTime(LocalDateTime.now());
|
||||
account.setSettlementRate(settlementRate);
|
||||
userAccountMapper.updateByPrimaryKeySelective(account);
|
||||
|
||||
// 新增账户跟踪表,添加结算跟踪记录
|
||||
DtsAccountTrace trace = new DtsAccountTrace();
|
||||
trace.setAmount(totalSettleMoney);
|
||||
trace.setRemainAmount(account == null ? totalSettleMoney : account.getTotalAmount().add(totalSettleMoney));
|
||||
trace.setAmount(account.getRemainAmount());//当前申请金额,直接将未结算的进行申请
|
||||
trace.setTotalAmount(account.getTotalAmount());//已提现总金额
|
||||
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
String now = df.format(LocalDate.now());
|
||||
String traceSn = now + getRandomNum(6);
|
||||
trace.setTraceSn(traceSn);
|
||||
trace.setTraceTime(LocalDateTime.now());
|
||||
trace.setType(0);
|
||||
trace.setAddTime(LocalDateTime.now());
|
||||
trace.setType(type);
|
||||
trace.setUserId(sharedUserId);
|
||||
trace.setStatus((byte) 0);//申请状态
|
||||
trace.setMobile(mobile);
|
||||
accountTraceMapper.insert(trace);
|
||||
|
||||
if (account == null) { // 则创建
|
||||
account = new DtsUserAccount();
|
||||
account.setCreateTime(LocalDateTime.now());
|
||||
account.setModifyTime(LocalDateTime.now());
|
||||
account.setRemainAmount(totalSettleMoney);
|
||||
account.setSettlementRate(settlementRate);
|
||||
account.setTotalAmount(totalSettleMoney);
|
||||
userAccountMapper.insert(account);
|
||||
} else {
|
||||
account.setRemainAmount(account.getRemainAmount().add(totalSettleMoney));
|
||||
account.setTotalAmount(account.getTotalAmount().add(totalSettleMoney));
|
||||
account.setModifyTime(LocalDateTime.now());
|
||||
account.setSettlementRate(settlementRate);
|
||||
userAccountMapper.updateByPrimaryKeySelective(account);
|
||||
}
|
||||
|
||||
// 再次验证是否都已经结算
|
||||
BigDecimal vaildSettleMoney = accountMapperEx.getLastMonthSettleMoney(sharedUserId, startTime, endTime);
|
||||
if (vaildSettleMoney.compareTo(new BigDecimal("0")) > 0) {
|
||||
logger.error("错误:结算过程有误,请联系管理员排查 ,代理用户编号: {" + sharedUserId + "},日期:" + startTime + " - " + endTime
|
||||
+ ",获取佣金: " + totalSettleMoney + "元");
|
||||
throw new Exception("结算过程有误,请联系管理员排查");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -163,7 +163,7 @@ public class DtsAccountService {
|
|||
if (orderSettleAmt == null) {
|
||||
orderSettleAmt = new BigDecimal(0.00);
|
||||
}
|
||||
BigDecimal finalSettleAmt = orderSettleAmt; // 默认就是设置的结算价格
|
||||
BigDecimal finalSettleAmt = orderSettleAmt; //默认就是设置的结算价格
|
||||
result.put("userCnt", userCnt);
|
||||
result.put("orderCnt", orderCnt);
|
||||
result.put("orderSettleAmt", orderSettleAmt);
|
||||
|
|
@ -192,7 +192,7 @@ public class DtsAccountService {
|
|||
|
||||
public List<DtsAccountTrace> queryAccountTraceList(Integer userId, Integer page, Integer size) {
|
||||
DtsAccountTraceExample example = new DtsAccountTraceExample();
|
||||
example.setOrderByClause(DtsAccountTrace.Column.traceTime.desc());
|
||||
example.setOrderByClause(DtsAccountTrace.Column.addTime.desc());
|
||||
DtsAccountTraceExample.Criteria criteria = example.or();
|
||||
criteria.andUserIdEqualTo(userId);
|
||||
PageHelper.startPage(page, size);
|
||||
|
|
@ -206,12 +206,11 @@ public class DtsAccountService {
|
|||
* @param applyAmt
|
||||
*/
|
||||
public void addExtractRecord(Integer userId, BigDecimal applyAmt, String mobile, String smsCode,
|
||||
BigDecimal remainAmount) {
|
||||
|
||||
BigDecimal hasAmount) {
|
||||
DtsAccountTrace record = new DtsAccountTrace();
|
||||
record.setAmount(applyAmt);
|
||||
record.setMobile(mobile);
|
||||
record.setRemainAmount(remainAmount);
|
||||
record.setTotalAmount(applyAmt.add(hasAmount));
|
||||
record.setSmsCode(smsCode);
|
||||
|
||||
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
|
|
@ -219,7 +218,7 @@ public class DtsAccountService {
|
|||
String traceSn = now + getRandomNum(6);
|
||||
record.setTraceSn(traceSn);
|
||||
|
||||
record.setTraceTime(LocalDateTime.now());
|
||||
record.setAddTime(LocalDateTime.now());
|
||||
record.setType(1);// 申请中..
|
||||
record.setUserId(userId);
|
||||
accountTraceMapper.insert(record);
|
||||
|
|
@ -242,18 +241,135 @@ public class DtsAccountService {
|
|||
return null;
|
||||
}
|
||||
DtsAccountTraceExample example = new DtsAccountTraceExample();
|
||||
List<Integer> typeInts = new ArrayList<Integer>();
|
||||
List<Byte> statusList = new ArrayList<Byte>();
|
||||
for (Byte type : types) {
|
||||
typeInts.add(type.intValue());
|
||||
statusList.add(type);
|
||||
}
|
||||
example.or().andUserIdEqualTo(userId).andTypeIn(typeInts);
|
||||
example.or().andUserIdEqualTo(userId).andStatusIn(statusList);
|
||||
return accountTraceMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<DtsAccountTrace> querySelective(String username, String mobile, String type, Integer page,
|
||||
Integer limit, String sort, String order) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
public List<DtsAccountTrace> querySelectiveTrace(List<DtsUser> userList, List<Byte> status, Integer page,
|
||||
Integer size, String sort, String order) {
|
||||
//是否有匹配到的用户,转用户id集合
|
||||
List<Integer> userIdArray = null;
|
||||
if (userList != null && userList.size() > 0) {
|
||||
userIdArray = new ArrayList<Integer>();
|
||||
for (DtsUser dtsUser : userList) {
|
||||
userIdArray.add(dtsUser.getId().intValue()) ;
|
||||
}
|
||||
}
|
||||
|
||||
DtsAccountTraceExample example = new DtsAccountTraceExample();
|
||||
DtsAccountTraceExample.Criteria criteria = example.or();
|
||||
|
||||
if (userIdArray != null && userIdArray.size() != 0) {
|
||||
criteria.andUserIdIn(userIdArray);
|
||||
}
|
||||
if (status != null && status.size() != 0) {
|
||||
criteria.andStatusIn(status);
|
||||
}
|
||||
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
|
||||
example.setOrderByClause(sort + " " + order);
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, size);
|
||||
return accountTraceMapper.selectByExample(example);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 只计算近两个月内未结算的订单佣金
|
||||
* 时间范围两月内,且订单超过一周,原因,一周内可能发生退款,
|
||||
* 减少退款订单对佣金结算的影响
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getUnSettleAmount(Integer userId) {
|
||||
LocalDateTime startTime = LocalDateTime.now().minusDays(TWO_MONTH_DAYS);
|
||||
LocalDateTime endTime = LocalDateTime.now().minusDays(ONE_WEEK_DAYS);
|
||||
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
return getUnSettleAmount(userId,startTime.format(df),endTime.format(df));
|
||||
}
|
||||
|
||||
public BigDecimal getUnSettleAmount(Integer userId,String startDay,String endDay) {
|
||||
BigDecimal staticSettleMoney = accountMapperEx.getToSettleMoney(userId,startDay,endDay);
|
||||
if (staticSettleMoney == null || staticSettleMoney.compareTo(new BigDecimal("0")) == 0) {// 如果该用户未产生推荐单,则降低结算比例
|
||||
staticSettleMoney = new BigDecimal(0.00);
|
||||
}
|
||||
logger.info("获取开始时间:{} - 结束时间 :{} 内 用户id:{} 的未结算佣金 :{}",startDay,endDay,userId,staticSettleMoney);
|
||||
return staticSettleMoney;
|
||||
}
|
||||
|
||||
/**
|
||||
* 为资金账户的安全,建议做线下销账处理,处理后执行该逻辑
|
||||
* 这里只根据记录做状态调整和审批意见记录
|
||||
* @param traceId
|
||||
* @param status
|
||||
* @param traceMsg
|
||||
* @return
|
||||
*/
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
|
||||
public boolean approveAccountTrace(Integer traceId, Byte status, String traceMsg) {
|
||||
|
||||
DtsAccountTrace trace = accountTraceMapper.selectByPrimaryKey(traceId);
|
||||
trace.setStatus(status);
|
||||
trace.setTraceMsg(traceMsg);
|
||||
if (status.intValue() == 1) {//如果是审批通过,需要消除账户中的可提现余额
|
||||
DtsUserAccount userAccount = findShareUserAccountByUserId(trace.getUserId());
|
||||
if (userAccount != null) {
|
||||
userAccount.setRemainAmount(userAccount.getRemainAmount().subtract(trace.getAmount()));
|
||||
logger.info("提现审批通过,调整账户可提现余额为{} - {} = {}",userAccount.getRemainAmount(),trace.getAmount(),userAccount.getRemainAmount().subtract(trace.getAmount()));
|
||||
if(userAccountMapper.updateByPrimaryKeySelective(userAccount) == 0) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
logger.error("审批提现,获取账号出错!请检查对应用户 userId:{} 的账户",trace.getUserId());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (accountTraceMapper.updateByPrimaryKeySelective(trace) == 0) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户userId,结算用户代理商的结算金额</br>
|
||||
* <p>该方法主要提供给 某个用户从普通用户转代理时调用
|
||||
* 在代理审批通过时,将申请代理人的订单结算金额结算给当前申请人归属的前一个代理<br>
|
||||
* 原因:在没成为代理之前,用户归属为前一个代理用户之下,该用户产生的订单佣金归属于前一个代理用户</p>
|
||||
* <p>产生误差:因结算时间没有考虑退款情况(正常逻辑考虑了延迟时间,此处是实时结算),
|
||||
* 可能造成这几天内如果发生退款,佣金确已结算给上一个代理用户的情况,因为这种情况产生的概率低,且本身
|
||||
* 佣金数额低,此误差暂时忽略,后续通过定时任务去处理这种异常结算的佣金,联系代理协商</p>
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = { Exception.class })
|
||||
public boolean settlementPreviousAgency(Integer userId){
|
||||
|
||||
// 获取当前用户是否有未结算的订单(约束:已支付,且无退款,在正常流转的订单),如果存在则结算给用户的代理人,如果不存在,则结束
|
||||
BigDecimal toSettleMoney = accountMapperEx.getUserUnOrderSettleMoney(userId);
|
||||
if (toSettleMoney == null || toSettleMoney.compareTo(new BigDecimal("0")) == 0) {// 如果该用户未产生订单
|
||||
logger.info("用户 userId:{} 不存在未结算的订单,给其代理人结算佣金结束!");
|
||||
return true;
|
||||
}
|
||||
// 获取当前用户的代理
|
||||
DtsUser user = userMapper.selectByPrimaryKey(userId);
|
||||
Integer sharedUserId = user.getShareUserId();
|
||||
// 获取用户账户信息并更新记录
|
||||
DtsUserAccount account = this.findShareUserAccountByUserId(sharedUserId);
|
||||
|
||||
// 更新用户订单结算状态
|
||||
accountMapperEx.setUserOrderSettleStaus(userId);
|
||||
|
||||
// 更新代理用户账号信息
|
||||
account.setRemainAmount(account.getRemainAmount().add(toSettleMoney));// 剩余结算,尚未结算给用户
|
||||
account.setTotalAmount(account.getTotalAmount().add(toSettleMoney));
|
||||
account.setModifyTime(LocalDateTime.now());
|
||||
userAccountMapper.updateByPrimaryKeySelective(account);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
package com.qiguliuxing.dts.db.service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.qiguliuxing.dts.db.dao.DtsAgencyShareMapper;
|
||||
import com.qiguliuxing.dts.db.domain.DtsAgencyShare;
|
||||
import com.qiguliuxing.dts.db.domain.DtsAgencyShareExample;
|
||||
|
||||
@Service
|
||||
public class DtsAgencyService {
|
||||
|
||||
@Resource
|
||||
private DtsAgencyShareMapper agencyShareMapper;
|
||||
|
||||
/**
|
||||
* 获取代理用户的分享对象海报图
|
||||
* @param userId
|
||||
* @param type
|
||||
* @param shareObjId
|
||||
* @return
|
||||
*/
|
||||
public String getDtsAgencyShare(Integer userId, Integer type, Integer shareObjId) {
|
||||
String shareUrl = null;
|
||||
DtsAgencyShareExample example = new DtsAgencyShareExample();
|
||||
example.or().andUserIdEqualTo(userId).andTypeEqualTo(type).andShareObjIdEqualTo(shareObjId);
|
||||
DtsAgencyShare das = agencyShareMapper.selectOneByExample(example);
|
||||
if (das != null) {
|
||||
shareUrl = das.getShareUrl();
|
||||
}
|
||||
return shareUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储代理用户的分享对象海报图
|
||||
* @param userId
|
||||
* @param type
|
||||
* @param shareObjId
|
||||
* @param shareUrl
|
||||
*/
|
||||
public void saveDtsAgencyShare(Integer userId, Integer type, Integer shareObjId, String shareUrl) {
|
||||
DtsAgencyShare record = new DtsAgencyShare();
|
||||
record.setUserId(userId);
|
||||
record.setType(type);
|
||||
record.setShareObjId(shareObjId);
|
||||
record.setShareUrl(shareUrl);
|
||||
record.setAddTime(LocalDateTime.now());
|
||||
record.setUpdateTime(LocalDateTime.now());
|
||||
agencyShareMapper.insert(record );
|
||||
}
|
||||
}
|
||||
|
|
@ -84,6 +84,15 @@ public class DtsBrandService {
|
|||
example.or().andDeletedEqualTo(false);
|
||||
return brandMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<DtsBrand> getAdminBrands(Integer adminId) {
|
||||
if (adminId == null) {
|
||||
return null;
|
||||
}
|
||||
DtsBrandExample example = new DtsBrandExample();
|
||||
example.or().andDeletedEqualTo(false).andAdminIdEqualTo(adminId);
|
||||
return brandMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分类id获取分类名
|
||||
|
|
@ -94,4 +103,5 @@ public class DtsBrandService {
|
|||
DtsCategory dtsCategory = categoryMapper.selectByPrimaryKey(categoryId);
|
||||
return dtsCategory == null ? "综合" : dtsCategory.getName();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.qiguliuxing.dts.db.service;
|
|||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.qiguliuxing.dts.db.dao.DtsCommentMapper;
|
||||
import com.qiguliuxing.dts.db.dao.ex.CommentMapperEx;
|
||||
import com.qiguliuxing.dts.db.domain.DtsComment;
|
||||
import com.qiguliuxing.dts.db.domain.DtsCommentExample;
|
||||
|
||||
|
|
@ -16,6 +17,9 @@ import java.util.List;
|
|||
public class DtsCommentService {
|
||||
@Resource
|
||||
private DtsCommentMapper commentMapper;
|
||||
|
||||
@Resource
|
||||
private CommentMapperEx commentMapperEx;
|
||||
|
||||
public List<DtsComment> queryGoodsByGid(Integer id, int offset, int limit) {
|
||||
DtsCommentExample example = new DtsCommentExample();
|
||||
|
|
@ -101,4 +105,38 @@ public class DtsCommentService {
|
|||
public DtsComment findById(Integer id) {
|
||||
return commentMapper.selectByPrimaryKey(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 入驻店铺对应商品的评价
|
||||
* @param brandIds
|
||||
* @param userId
|
||||
* @param valueId
|
||||
* @param page
|
||||
* @param limit
|
||||
* @param sort
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public List<DtsComment> queryBrandCommentSelective(List<Integer> brandIds, String userId, String valueId,
|
||||
Integer page, Integer size, String sort, String order) {
|
||||
|
||||
String orderBySql = null;
|
||||
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
|
||||
orderBySql = "o."+sort + " " + order;
|
||||
}
|
||||
|
||||
String brandIdsSql = null;
|
||||
if (brandIds != null) {
|
||||
brandIdsSql = "";
|
||||
for (Integer brandId : brandIds) {
|
||||
brandIdsSql += "," + brandId;
|
||||
}
|
||||
brandIdsSql = " and g.brand_id in (" + brandIdsSql.substring(1) + ") ";
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, size);
|
||||
|
||||
Byte type = (byte) 0;//品牌入驻管理员限定只查商品评论
|
||||
return commentMapperEx.queryBrandComment(type,userId,valueId,orderBySql,brandIdsSql);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,17 +193,4 @@ public class DtsCouponService {
|
|||
.andEndTimeLessThan(LocalDate.now()).andDeletedEqualTo(false);
|
||||
return couponMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询用户的优惠券
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public int queryUserCouponCnt(Integer userId) {
|
||||
DtsCouponUserExample example = new DtsCouponUserExample();
|
||||
DtsCouponUserExample.Criteria criteria = example.createCriteria();
|
||||
criteria.andUserIdEqualTo(userId);
|
||||
criteria.andDeletedEqualTo(false);
|
||||
return (int) couponUserMapper.countByExample(example);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ public class DtsGoodsService {
|
|||
}
|
||||
|
||||
public List<DtsGoods> querySelective(String goodsSn, String name, Integer page, Integer size, String sort,
|
||||
String order) {
|
||||
String order,List<Integer> brandIds) {
|
||||
DtsGoodsExample example = new DtsGoodsExample();
|
||||
DtsGoodsExample.Criteria criteria = example.createCriteria();
|
||||
|
||||
|
|
@ -139,6 +139,10 @@ public class DtsGoodsService {
|
|||
criteria.andNameLike("%" + name + "%");
|
||||
}
|
||||
criteria.andDeletedEqualTo(false);
|
||||
|
||||
if (brandIds != null && brandIds.size() > 0) {
|
||||
criteria.andBrandIdIn(brandIds);
|
||||
}
|
||||
|
||||
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
|
||||
example.setOrderByClause(sort + " " + order);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.alibaba.druid.util.StringUtils;
|
|||
import com.github.pagehelper.PageHelper;
|
||||
import com.qiguliuxing.dts.db.dao.DtsGoodsMapper;
|
||||
import com.qiguliuxing.dts.db.dao.DtsGrouponRulesMapper;
|
||||
import com.qiguliuxing.dts.db.dao.ex.GrouponMapperEx;
|
||||
import com.qiguliuxing.dts.db.domain.DtsGoods;
|
||||
import com.qiguliuxing.dts.db.domain.DtsGrouponRules;
|
||||
import com.qiguliuxing.dts.db.domain.DtsGrouponRulesExample;
|
||||
|
|
@ -23,6 +24,9 @@ public class DtsGrouponRulesService {
|
|||
private DtsGrouponRulesMapper mapper;
|
||||
@Resource
|
||||
private DtsGoodsMapper goodsMapper;
|
||||
@Resource
|
||||
private GrouponMapperEx grouponMapperEx;
|
||||
|
||||
private DtsGoods.Column[] goodsColumns = new DtsGoods.Column[] { DtsGoods.Column.id, DtsGoods.Column.name,
|
||||
DtsGoods.Column.brief, DtsGoods.Column.picUrl, DtsGoods.Column.counterPrice, DtsGoods.Column.retailPrice };
|
||||
|
||||
|
|
@ -133,4 +137,35 @@ public class DtsGrouponRulesService {
|
|||
grouponRules.setUpdateTime(LocalDateTime.now());
|
||||
return mapper.updateByPrimaryKeySelective(grouponRules);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询品牌入驻管理员团购规则
|
||||
* @param brandIds
|
||||
* @param goodsId
|
||||
* @param page
|
||||
* @param limit
|
||||
* @param sort
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public List<DtsGrouponRules> queryBrandGrouponRules(List<Integer> brandIds, String goodsId, Integer page,
|
||||
Integer size, String sort, String order) {
|
||||
String orderBySql = null;
|
||||
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
|
||||
orderBySql = "o."+sort + " " + order;
|
||||
}
|
||||
|
||||
String brandIdsSql = null;
|
||||
if (brandIds != null) {
|
||||
brandIdsSql = "";
|
||||
for (Integer brandId : brandIds) {
|
||||
brandIdsSql += "," + brandId;
|
||||
}
|
||||
brandIdsSql = " and g.brand_id in (" + brandIdsSql.substring(1) + ") ";
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, size);
|
||||
|
||||
return grouponMapperEx.queryBrandGrouponRules(goodsId,orderBySql,brandIdsSql);
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.qiguliuxing.dts.db.service;
|
|||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.qiguliuxing.dts.db.dao.DtsGrouponMapper;
|
||||
import com.qiguliuxing.dts.db.dao.ex.GrouponMapperEx;
|
||||
import com.qiguliuxing.dts.db.domain.DtsGroupon;
|
||||
import com.qiguliuxing.dts.db.domain.DtsGrouponExample;
|
||||
|
||||
|
|
@ -16,6 +17,8 @@ import java.util.List;
|
|||
public class DtsGrouponService {
|
||||
@Resource
|
||||
private DtsGrouponMapper mapper;
|
||||
@Resource
|
||||
private GrouponMapperEx grouponMapperEx;
|
||||
|
||||
/**
|
||||
* 获取用户发起的团购记录
|
||||
|
|
@ -134,4 +137,35 @@ public class DtsGrouponService {
|
|||
PageHelper.startPage(page, size);
|
||||
return mapper.selectByExample(example);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据品牌入驻店铺获取对应的团购数据
|
||||
* @param brandIds
|
||||
* @param rulesId
|
||||
* @param page
|
||||
* @param limit
|
||||
* @param sort
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public List<DtsGroupon> queryBrandGroupons(List<Integer> brandIds, String rulesId, Integer page, Integer size,
|
||||
String sort, String order) {
|
||||
String orderBySql = null;
|
||||
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
|
||||
orderBySql = "o."+sort + " " + order;
|
||||
}
|
||||
|
||||
String brandIdsSql = null;
|
||||
if (brandIds != null) {
|
||||
brandIdsSql = "";
|
||||
for (Integer brandId : brandIds) {
|
||||
brandIdsSql += "," + brandId;
|
||||
}
|
||||
brandIdsSql = " and g.brand_id in (" + brandIdsSql.substring(1) + ") ";
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, size);
|
||||
|
||||
return grouponMapperEx.queryBrandGroupons(rulesId,orderBySql,brandIdsSql);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,5 @@
|
|||
package com.qiguliuxing.dts.db.service;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.qiguliuxing.dts.db.dao.DtsOrderMapper;
|
||||
import com.qiguliuxing.dts.db.dao.ex.OrderMapper;
|
||||
import com.qiguliuxing.dts.db.domain.DtsOrder;
|
||||
import com.qiguliuxing.dts.db.domain.DtsOrderExample;
|
||||
import com.qiguliuxing.dts.db.util.OrderUtil;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
|
@ -19,12 +8,30 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.qiguliuxing.dts.db.bean.CategorySellAmts;
|
||||
import com.qiguliuxing.dts.db.bean.DayStatis;
|
||||
import com.qiguliuxing.dts.db.dao.DtsOrderMapper;
|
||||
import com.qiguliuxing.dts.db.dao.ex.OrderMapper;
|
||||
import com.qiguliuxing.dts.db.dao.ex.StatMapper;
|
||||
import com.qiguliuxing.dts.db.domain.DtsOrder;
|
||||
import com.qiguliuxing.dts.db.domain.DtsOrderExample;
|
||||
import com.qiguliuxing.dts.db.util.OrderUtil;
|
||||
|
||||
@Service
|
||||
public class DtsOrderService {
|
||||
@Resource
|
||||
private DtsOrderMapper dtsOrderMapper;
|
||||
@Resource
|
||||
private OrderMapper orderMapper;
|
||||
@Resource
|
||||
private StatMapper statMapper;
|
||||
|
||||
|
||||
public int add(DtsOrder order) {
|
||||
order.setAddTime(LocalDateTime.now());
|
||||
|
|
@ -171,7 +178,6 @@ public class DtsOrderService {
|
|||
orderInfo.put("unrecv", unrecv);
|
||||
orderInfo.put("uncomment", uncomment);
|
||||
return orderInfo;
|
||||
|
||||
}
|
||||
|
||||
public List<DtsOrder> queryComment() {
|
||||
|
|
@ -180,4 +186,54 @@ public class DtsOrderService {
|
|||
return dtsOrderMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<DayStatis> recentCount(int statisDaysRang) {
|
||||
return statMapper.statisIncreaseOrderCnt(statisDaysRang);
|
||||
}
|
||||
|
||||
public List<CategorySellAmts> categorySell() {
|
||||
return statMapper.categorySellStatis();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取指定店铺的订单
|
||||
* @param brandIds
|
||||
* @param userId
|
||||
* @param orderSn
|
||||
* @param orderStatusArray
|
||||
* @param page
|
||||
* @param limit
|
||||
* @param sort
|
||||
* @param order
|
||||
* @return
|
||||
*/
|
||||
public List<DtsOrder> queryBrandSelective(List<Integer> brandIds, Integer userId, String orderSn,
|
||||
List<Short> orderStatusArray, Integer page, Integer size, String sort, String order) {
|
||||
|
||||
String orderStatusSql = null;
|
||||
if (orderStatusArray != null) {
|
||||
orderStatusSql = "";
|
||||
for (Short orderStatus : orderStatusArray) {
|
||||
orderStatusSql += "," + orderStatus;
|
||||
}
|
||||
orderStatusSql = "and o.order_status in (" + orderStatusSql.substring(1) + ") ";
|
||||
}
|
||||
|
||||
String orderBySql = null;
|
||||
if (!StringUtils.isEmpty(sort) && !StringUtils.isEmpty(order)) {
|
||||
orderBySql = "o."+sort + " " + order;
|
||||
}
|
||||
|
||||
String brandIdsSql = null;
|
||||
if (brandIds != null) {
|
||||
brandIdsSql = "";
|
||||
for (Integer brandId : brandIds) {
|
||||
brandIdsSql += "," + brandId;
|
||||
}
|
||||
brandIdsSql = " and g.brand_id in (" + brandIdsSql.substring(1) + ") ";
|
||||
}
|
||||
|
||||
PageHelper.startPage(page, size);
|
||||
return orderMapper.selectBrandOrdersByExample(userId, orderSn,orderStatusSql,orderBySql,brandIdsSql);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.qiguliuxing.dts.db.bean.DayStatis;
|
||||
import com.qiguliuxing.dts.db.dao.DtsUserAccountMapper;
|
||||
import com.qiguliuxing.dts.db.dao.DtsUserMapper;
|
||||
import com.qiguliuxing.dts.db.dao.ex.StatMapper;
|
||||
import com.qiguliuxing.dts.db.domain.DtsUser;
|
||||
import com.qiguliuxing.dts.db.domain.DtsUserAccount;
|
||||
import com.qiguliuxing.dts.db.domain.DtsUserAccountExample;
|
||||
|
|
@ -25,6 +27,9 @@ public class DtsUserService {
|
|||
|
||||
@Resource
|
||||
private DtsUserAccountMapper userAccountMapper;
|
||||
|
||||
@Resource
|
||||
private StatMapper statMapper;
|
||||
|
||||
public DtsUser findById(Integer userId) {
|
||||
return userMapper.selectByPrimaryKey(userId);
|
||||
|
|
@ -61,7 +66,7 @@ public class DtsUserService {
|
|||
DtsUserExample.Criteria criteria = example.createCriteria();
|
||||
|
||||
if (!StringUtils.isEmpty(username)) {
|
||||
criteria.andUsernameLike("%" + username + "%");
|
||||
criteria.andNicknameLike("%" + username + "%");
|
||||
}
|
||||
if (!StringUtils.isEmpty(mobile)) {
|
||||
criteria.andMobileEqualTo(mobile);
|
||||
|
|
@ -136,6 +141,7 @@ public class DtsUserService {
|
|||
user.setUserLevel((byte) 2);//区域代理用户
|
||||
user.setStatus((byte) 0);//正常状态
|
||||
updateById(user);
|
||||
|
||||
}
|
||||
|
||||
public DtsUserAccount detailApproveByUserId(Integer userId) {
|
||||
|
|
@ -146,4 +152,21 @@ public class DtsUserService {
|
|||
DtsUserAccount dbAccount = userAccountMapper.selectOneByExample(example);
|
||||
return dbAccount;
|
||||
}
|
||||
|
||||
public List<DtsUser> queryDtsUserListByNickname(String username,String mobile) {
|
||||
DtsUserExample example = new DtsUserExample();
|
||||
DtsUserExample.Criteria criteria = example.createCriteria();
|
||||
if (!StringUtils.isEmpty(username)) {
|
||||
criteria.andNicknameLike("%" + username + "%");
|
||||
}
|
||||
if (!StringUtils.isEmpty(mobile)) {
|
||||
criteria.andMobileEqualTo(mobile);
|
||||
}
|
||||
criteria.andDeletedEqualTo(false);
|
||||
return userMapper.selectByExample(example);
|
||||
}
|
||||
|
||||
public List<DayStatis> recentCount(int statisDaysRang) {
|
||||
return statMapper.statisIncreaseUserCnt(statisDaysRang);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,10 +11,13 @@
|
|||
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="type" jdbcType="INTEGER" property="type" />
|
||||
<result column="amount" jdbcType="DECIMAL" property="amount" />
|
||||
<result column="remain_amount" jdbcType="DECIMAL" property="remainAmount" />
|
||||
<result column="trace_time" jdbcType="TIMESTAMP" property="traceTime" />
|
||||
<result column="total_amount" jdbcType="DECIMAL" property="totalAmount" />
|
||||
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
|
||||
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
|
||||
<result column="sms_code" jdbcType="VARCHAR" property="smsCode" />
|
||||
<result column="status" jdbcType="TINYINT" property="status" />
|
||||
<result column="trace_msg" jdbcType="VARCHAR" property="traceMsg" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<!--
|
||||
|
|
@ -87,7 +90,8 @@
|
|||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
id, trace_sn, user_id, `type`, amount, remain_amount, trace_time, mobile, sms_code
|
||||
id, trace_sn, user_id, `type`, amount, total_amount, add_time, mobile, sms_code,
|
||||
`status`, trace_msg, update_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAccountTraceExample" resultMap="BaseResultMap">
|
||||
<!--
|
||||
|
|
@ -124,8 +128,8 @@
|
|||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
id, trace_sn, user_id, `type`, amount, remain_amount, trace_time, mobile, sms_code
|
||||
|
||||
id, trace_sn, user_id, `type`, amount, total_amount, add_time, mobile, sms_code,
|
||||
`status`, trace_msg, update_time
|
||||
</otherwise>
|
||||
</choose>
|
||||
from dts_account_trace
|
||||
|
|
@ -160,8 +164,8 @@
|
|||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
id, trace_sn, user_id, `type`, amount, remain_amount, trace_time, mobile, sms_code
|
||||
|
||||
id, trace_sn, user_id, `type`, amount, total_amount, add_time, mobile, sms_code,
|
||||
`status`, trace_msg, update_time
|
||||
</otherwise>
|
||||
</choose>
|
||||
from dts_account_trace
|
||||
|
|
@ -194,11 +198,13 @@
|
|||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into dts_account_trace (trace_sn, user_id, `type`,
|
||||
amount, remain_amount, trace_time,
|
||||
mobile, sms_code)
|
||||
amount, total_amount, add_time,
|
||||
mobile, sms_code, `status`,
|
||||
trace_msg, update_time)
|
||||
values (#{traceSn,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER}, #{type,jdbcType=INTEGER},
|
||||
#{amount,jdbcType=DECIMAL}, #{remainAmount,jdbcType=DECIMAL}, #{traceTime,jdbcType=TIMESTAMP},
|
||||
#{mobile,jdbcType=VARCHAR}, #{smsCode,jdbcType=VARCHAR})
|
||||
#{amount,jdbcType=DECIMAL}, #{totalAmount,jdbcType=DECIMAL}, #{addTime,jdbcType=TIMESTAMP},
|
||||
#{mobile,jdbcType=VARCHAR}, #{smsCode,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT},
|
||||
#{traceMsg,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.qiguliuxing.dts.db.domain.DtsAccountTrace">
|
||||
<!--
|
||||
|
|
@ -222,11 +228,11 @@
|
|||
<if test="amount != null">
|
||||
amount,
|
||||
</if>
|
||||
<if test="remainAmount != null">
|
||||
remain_amount,
|
||||
<if test="totalAmount != null">
|
||||
total_amount,
|
||||
</if>
|
||||
<if test="traceTime != null">
|
||||
trace_time,
|
||||
<if test="addTime != null">
|
||||
add_time,
|
||||
</if>
|
||||
<if test="mobile != null">
|
||||
mobile,
|
||||
|
|
@ -234,6 +240,15 @@
|
|||
<if test="smsCode != null">
|
||||
sms_code,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status`,
|
||||
</if>
|
||||
<if test="traceMsg != null">
|
||||
trace_msg,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="traceSn != null">
|
||||
|
|
@ -248,11 +263,11 @@
|
|||
<if test="amount != null">
|
||||
#{amount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="remainAmount != null">
|
||||
#{remainAmount,jdbcType=DECIMAL},
|
||||
<if test="totalAmount != null">
|
||||
#{totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="traceTime != null">
|
||||
#{traceTime,jdbcType=TIMESTAMP},
|
||||
<if test="addTime != null">
|
||||
#{addTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="mobile != null">
|
||||
#{mobile,jdbcType=VARCHAR},
|
||||
|
|
@ -260,6 +275,15 @@
|
|||
<if test="smsCode != null">
|
||||
#{smsCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="traceMsg != null">
|
||||
#{traceMsg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAccountTraceExample" resultType="java.lang.Long">
|
||||
|
|
@ -294,11 +318,11 @@
|
|||
<if test="record.amount != null">
|
||||
amount = #{record.amount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.remainAmount != null">
|
||||
remain_amount = #{record.remainAmount,jdbcType=DECIMAL},
|
||||
<if test="record.totalAmount != null">
|
||||
total_amount = #{record.totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="record.traceTime != null">
|
||||
trace_time = #{record.traceTime,jdbcType=TIMESTAMP},
|
||||
<if test="record.addTime != null">
|
||||
add_time = #{record.addTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.mobile != null">
|
||||
mobile = #{record.mobile,jdbcType=VARCHAR},
|
||||
|
|
@ -306,6 +330,15 @@
|
|||
<if test="record.smsCode != null">
|
||||
sms_code = #{record.smsCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.status != null">
|
||||
`status` = #{record.status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="record.traceMsg != null">
|
||||
trace_msg = #{record.traceMsg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
|
|
@ -322,10 +355,13 @@
|
|||
user_id = #{record.userId,jdbcType=INTEGER},
|
||||
`type` = #{record.type,jdbcType=INTEGER},
|
||||
amount = #{record.amount,jdbcType=DECIMAL},
|
||||
remain_amount = #{record.remainAmount,jdbcType=DECIMAL},
|
||||
trace_time = #{record.traceTime,jdbcType=TIMESTAMP},
|
||||
total_amount = #{record.totalAmount,jdbcType=DECIMAL},
|
||||
add_time = #{record.addTime,jdbcType=TIMESTAMP},
|
||||
mobile = #{record.mobile,jdbcType=VARCHAR},
|
||||
sms_code = #{record.smsCode,jdbcType=VARCHAR}
|
||||
sms_code = #{record.smsCode,jdbcType=VARCHAR},
|
||||
`status` = #{record.status,jdbcType=TINYINT},
|
||||
trace_msg = #{record.traceMsg,jdbcType=VARCHAR},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
|
|
@ -349,11 +385,11 @@
|
|||
<if test="amount != null">
|
||||
amount = #{amount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="remainAmount != null">
|
||||
remain_amount = #{remainAmount,jdbcType=DECIMAL},
|
||||
<if test="totalAmount != null">
|
||||
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||||
</if>
|
||||
<if test="traceTime != null">
|
||||
trace_time = #{traceTime,jdbcType=TIMESTAMP},
|
||||
<if test="addTime != null">
|
||||
add_time = #{addTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="mobile != null">
|
||||
mobile = #{mobile,jdbcType=VARCHAR},
|
||||
|
|
@ -361,6 +397,15 @@
|
|||
<if test="smsCode != null">
|
||||
sms_code = #{smsCode,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
</if>
|
||||
<if test="traceMsg != null">
|
||||
trace_msg = #{traceMsg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
|
@ -374,10 +419,13 @@
|
|||
user_id = #{userId,jdbcType=INTEGER},
|
||||
`type` = #{type,jdbcType=INTEGER},
|
||||
amount = #{amount,jdbcType=DECIMAL},
|
||||
remain_amount = #{remainAmount,jdbcType=DECIMAL},
|
||||
trace_time = #{traceTime,jdbcType=TIMESTAMP},
|
||||
total_amount = #{totalAmount,jdbcType=DECIMAL},
|
||||
add_time = #{addTime,jdbcType=TIMESTAMP},
|
||||
mobile = #{mobile,jdbcType=VARCHAR},
|
||||
sms_code = #{smsCode,jdbcType=VARCHAR}
|
||||
sms_code = #{smsCode,jdbcType=VARCHAR},
|
||||
`status` = #{status,jdbcType=TINYINT},
|
||||
trace_msg = #{traceMsg,jdbcType=VARCHAR},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectOneByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAccountTraceExample" resultMap="BaseResultMap">
|
||||
|
|
@ -411,8 +459,8 @@
|
|||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
id, trace_sn, user_id, `type`, amount, remain_amount, trace_time, mobile, sms_code
|
||||
|
||||
id, trace_sn, user_id, `type`, amount, total_amount, add_time, mobile, sms_code,
|
||||
`status`, trace_msg, update_time
|
||||
</otherwise>
|
||||
</choose>
|
||||
from dts_account_trace
|
||||
|
|
|
|||
|
|
@ -0,0 +1,394 @@
|
|||
<?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.qiguliuxing.dts.db.dao.DtsAgencyShareMapper">
|
||||
<resultMap id="BaseResultMap" type="com.qiguliuxing.dts.db.domain.DtsAgencyShare">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="share_url" jdbcType="VARCHAR" property="shareUrl" />
|
||||
<result column="type" jdbcType="INTEGER" property="type" />
|
||||
<result column="share_obj_id" jdbcType="INTEGER" property="shareObjId" />
|
||||
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
id, user_id, share_url, `type`, share_obj_id, add_time, update_time
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAgencyShareExample" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from dts_agency_share
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExampleSelective" parameterType="map" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
@project https://github.com/itfsw/mybatis-generator-plugin
|
||||
-->
|
||||
select
|
||||
<if test="example.distinct">
|
||||
distinct
|
||||
</if>
|
||||
<choose>
|
||||
<when test="selective != null and selective.length > 0">
|
||||
<foreach collection="selective" item="column" separator=",">
|
||||
${column.escapedColumnName}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
id, user_id, share_url, `type`, share_obj_id, add_time, update_time
|
||||
</otherwise>
|
||||
</choose>
|
||||
from dts_agency_share
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="example.orderByClause != null">
|
||||
order by ${example.orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from dts_agency_share
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<select id="selectByPrimaryKeySelective" parameterType="map" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
@project https://github.com/itfsw/mybatis-generator-plugin
|
||||
-->
|
||||
select
|
||||
<choose>
|
||||
<when test="selective != null and selective.length > 0">
|
||||
<foreach collection="selective" item="column" separator=",">
|
||||
${column.escapedColumnName}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
id, user_id, share_url, `type`, share_obj_id, add_time, update_time
|
||||
</otherwise>
|
||||
</choose>
|
||||
from dts_agency_share
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from dts_agency_share
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</delete>
|
||||
<delete id="deleteByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAgencyShareExample">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
delete from dts_agency_share
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.qiguliuxing.dts.db.domain.DtsAgencyShare">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into dts_agency_share (user_id, share_url, `type`,
|
||||
share_obj_id, add_time, update_time
|
||||
)
|
||||
values (#{userId,jdbcType=INTEGER}, #{shareUrl,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER},
|
||||
#{shareObjId,jdbcType=INTEGER}, #{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.qiguliuxing.dts.db.domain.DtsAgencyShare">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into dts_agency_share
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
user_id,
|
||||
</if>
|
||||
<if test="shareUrl != null">
|
||||
share_url,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type`,
|
||||
</if>
|
||||
<if test="shareObjId != null">
|
||||
share_obj_id,
|
||||
</if>
|
||||
<if test="addTime != null">
|
||||
add_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">
|
||||
#{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="shareUrl != null">
|
||||
#{shareUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="shareObjId != null">
|
||||
#{shareObjId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="addTime != null">
|
||||
#{addTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAgencyShareExample" resultType="java.lang.Long">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
select count(*) from dts_agency_share
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update dts_agency_share
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.userId != null">
|
||||
user_id = #{record.userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.shareUrl != null">
|
||||
share_url = #{record.shareUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.type != null">
|
||||
`type` = #{record.type,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.shareObjId != null">
|
||||
share_obj_id = #{record.shareObjId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.addTime != null">
|
||||
add_time = #{record.addTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updateTime != null">
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update dts_agency_share
|
||||
set id = #{record.id,jdbcType=INTEGER},
|
||||
user_id = #{record.userId,jdbcType=INTEGER},
|
||||
share_url = #{record.shareUrl,jdbcType=VARCHAR},
|
||||
`type` = #{record.type,jdbcType=INTEGER},
|
||||
share_obj_id = #{record.shareObjId,jdbcType=INTEGER},
|
||||
add_time = #{record.addTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.qiguliuxing.dts.db.domain.DtsAgencyShare">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update dts_agency_share
|
||||
<set>
|
||||
<if test="userId != null">
|
||||
user_id = #{userId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="shareUrl != null">
|
||||
share_url = #{shareUrl,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
`type` = #{type,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="shareObjId != null">
|
||||
share_obj_id = #{shareObjId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="addTime != null">
|
||||
add_time = #{addTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.qiguliuxing.dts.db.domain.DtsAgencyShare">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
update dts_agency_share
|
||||
set user_id = #{userId,jdbcType=INTEGER},
|
||||
share_url = #{shareUrl,jdbcType=VARCHAR},
|
||||
`type` = #{type,jdbcType=INTEGER},
|
||||
share_obj_id = #{shareObjId,jdbcType=INTEGER},
|
||||
add_time = #{addTime,jdbcType=TIMESTAMP},
|
||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=INTEGER}
|
||||
</update>
|
||||
<select id="selectOneByExample" parameterType="com.qiguliuxing.dts.db.domain.DtsAgencyShareExample" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
@project https://github.com/itfsw/mybatis-generator-plugin
|
||||
-->
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from dts_agency_share
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
<select id="selectOneByExampleSelective" parameterType="map" resultMap="BaseResultMap">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
@project https://github.com/itfsw/mybatis-generator-plugin
|
||||
-->
|
||||
select
|
||||
<choose>
|
||||
<when test="selective != null and selective.length > 0">
|
||||
<foreach collection="selective" item="column" separator=",">
|
||||
${column.escapedColumnName}
|
||||
</foreach>
|
||||
</when>
|
||||
<otherwise>
|
||||
id, user_id, share_url, `type`, share_obj_id, add_time, update_time
|
||||
</otherwise>
|
||||
</choose>
|
||||
from dts_agency_share
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="example.orderByClause != null">
|
||||
order by ${example.orderByClause}
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -44,23 +44,32 @@
|
|||
select distinct share_user_id from dts_user t where t.deleted = 0 and t.share_user_id > 0
|
||||
</select>
|
||||
|
||||
<select id="getToSettleMoney" resultType="java.math.BigDecimal" parameterType="map">
|
||||
select sum(t.settlement_money) as total_settlement_money from dts_order t
|
||||
where t.deleted = 0 and t.order_status in (401,402) and t.settlement_status = 0
|
||||
and t.confirm_time >= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
|
||||
and t.confirm_time <= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
and t.user_id in (select id
|
||||
from dts_user u where (u.id=#{sharedUserId,jdbcType=INTEGER} and u.user_level=2) or (u.share_user_id =#{sharedUserId,jdbcType=INTEGER} and u.user_level < 2))
|
||||
</select>
|
||||
|
||||
<select id="getLastMonthSettleMoney" resultType="java.math.BigDecimal" parameterType="map">
|
||||
select sum(t.settlement_money) as total_settlement_money from dts_order t
|
||||
where t.deleted = 0 and t.order_status in (401,402) and t.settlement_status = 0
|
||||
and t.confirm_time >= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
|
||||
and t.confirm_time <= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
and t.user_id in (select id
|
||||
from dts_user u where u.share_user_id = #{sharedUserId,jdbcType=INTEGER})
|
||||
from dts_user u where (u.id=#{sharedUserId,jdbcType=INTEGER} and u.user_level=2) or (u.share_user_id =#{sharedUserId,jdbcType=INTEGER} and u.user_level < 2))
|
||||
</select>
|
||||
|
||||
<select id="setLastMonthOrderSettleStaus" resultType="java.math.BigDecimal" parameterType="map">
|
||||
update dts_order t set settlement_status = 1
|
||||
where t.deleted = 0 and t.order_status in (401,402)
|
||||
and t.confirm_time >= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
|
||||
and t.confirm_time <= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
and t.user_id in (select id
|
||||
from dts_user u where u.share_user_id = #{sharedUserId,jdbcType=INTEGER})
|
||||
</select>
|
||||
<update id="setLastMonthOrderSettleStaus" parameterType="map">
|
||||
update dts_order set settlement_status = 1
|
||||
where deleted = 0 and order_status in (401,402)
|
||||
and confirm_time >= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
|
||||
and confirm_time <= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
and user_id in (select id
|
||||
from dts_user u where (u.id=#{sharedUserId,jdbcType=INTEGER} and u.user_level=2) or (u.share_user_id =#{sharedUserId,jdbcType=INTEGER} and u.user_level < 2))
|
||||
</update>
|
||||
|
||||
<select id="staticMonthSettleMoney" resultType="java.math.BigDecimal" parameterType="map">
|
||||
select sum(t.settlement_money) as total_settlement_money from dts_order t
|
||||
|
|
@ -68,7 +77,7 @@
|
|||
and t.confirm_time >= STR_TO_DATE(#{startTime},'%Y-%m-%d %H:%i:%s')
|
||||
and t.confirm_time <= STR_TO_DATE(#{endTime},'%Y-%m-%d %H:%i:%s')
|
||||
and t.user_id in (select id
|
||||
from dts_user u where u.share_user_id = #{sharedUserId,jdbcType=INTEGER})
|
||||
from dts_user u where (u.id=#{sharedUserId,jdbcType=INTEGER} and u.user_level=2) or (u.share_user_id =#{sharedUserId,jdbcType=INTEGER} and u.user_level < 2))
|
||||
</select>
|
||||
|
||||
<select id="countOrderSharedUser" resultType="java.lang.Long" parameterType="map">
|
||||
|
|
@ -76,7 +85,7 @@
|
|||
where t.deleted = 0
|
||||
and t.pay_time >= #{startTime,jdbcType=TIMESTAMP}
|
||||
and t.user_id in (select id
|
||||
from dts_user u where u.share_user_id = #{sharedUserId,jdbcType=INTEGER})
|
||||
from dts_user u where (u.id=#{sharedUserId,jdbcType=INTEGER} and u.user_level=2) or (u.share_user_id =#{sharedUserId,jdbcType=INTEGER} and u.user_level < 2))
|
||||
</select>
|
||||
|
||||
<select id="sumOrderSettleAmtSharedUser" resultType="java.math.BigDecimal" parameterType="map">
|
||||
|
|
@ -84,7 +93,7 @@
|
|||
where t.deleted = 0
|
||||
and t.pay_time >= #{startTime,jdbcType=TIMESTAMP}
|
||||
and t.user_id in (select id
|
||||
from dts_user u where u.share_user_id = #{sharedUserId,jdbcType=INTEGER})
|
||||
from dts_user u where (u.id=#{sharedUserId,jdbcType=INTEGER} and u.user_level=2) or (u.share_user_id =#{sharedUserId,jdbcType=INTEGER} and u.user_level < 2))
|
||||
</select>
|
||||
|
||||
<select id="querySettlementOrder" resultMap="BaseResultMap" parameterType="map">
|
||||
|
|
@ -95,8 +104,21 @@
|
|||
${conditionSql}
|
||||
</if>
|
||||
and o.user_id in (select id
|
||||
from dts_user u where u.share_user_id = #{sharedUserId,jdbcType=INTEGER})
|
||||
from dts_user u where (u.id=#{sharedUserId,jdbcType=INTEGER} and u.user_level=2) or (u.share_user_id =#{sharedUserId,jdbcType=INTEGER} and u.user_level < 2))
|
||||
order by o.add_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 已支付,且无退款,在正常流转的订单 -->
|
||||
<select id="getUserUnOrderSettleMoney" resultType="java.math.BigDecimal" parameterType="map">
|
||||
select sum(t.settlement_money) as total_settlement_money from dts_order t
|
||||
where t.deleted = 0 and t.order_status in (201,301,401,402) and t.settlement_status = 0
|
||||
and t.user_id=#{userId,jdbcType=INTEGER}
|
||||
</select>
|
||||
|
||||
<update id="setUserOrderSettleStaus" parameterType="map">
|
||||
update dts_order set settlement_status = 1
|
||||
where deleted = 0 and order_status in (201,301,401,402)
|
||||
and t.user_id=#{userId,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
<?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.qiguliuxing.dts.db.dao.ex.CommentMapperEx">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qiguliuxing.dts.db.domain.DtsComment">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="value_id" jdbcType="INTEGER" property="valueId" />
|
||||
<result column="type" jdbcType="TINYINT" property="type" />
|
||||
<result column="content" jdbcType="VARCHAR" property="content" />
|
||||
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="has_picture" jdbcType="BIT" property="hasPicture" />
|
||||
<result column="pic_urls" jdbcType="VARCHAR" property="picUrls" typeHandler="com.qiguliuxing.dts.db.mybatis.JsonStringArrayTypeHandler" />
|
||||
<result column="star" jdbcType="SMALLINT" property="star" />
|
||||
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
o.id, o.value_id, o.`type`, o.content, o.user_id, o.has_picture, o.pic_urls, o.star, o.add_time, o.update_time,
|
||||
o.deleted
|
||||
</sql>
|
||||
|
||||
<select id="queryBrandComment" resultMap="BaseResultMap" parameterType="map">
|
||||
select distinct
|
||||
<include refid="Base_Column_List" />
|
||||
from dts_comment o
|
||||
join dts_goods g on o.value_id=g.id
|
||||
and o.deleted = 0
|
||||
<if test="type != null and type != ''">
|
||||
and o.`type` = #{type,jdbcType=TINYINT}
|
||||
</if>
|
||||
<if test="userId != null and userId != ''">
|
||||
and o.user_id = #{userId}
|
||||
</if>
|
||||
<if test="valueId != null and valueId != ''">
|
||||
and o.value_id = #{valueId}
|
||||
</if>
|
||||
<if test="brandIdsSql != null and brandIdsSql != ''">
|
||||
${brandIdsSql}
|
||||
</if>
|
||||
<if test="orderBySql != null">
|
||||
order by ${orderBySql}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
<?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.qiguliuxing.dts.db.dao.ex.GrouponMapperEx">
|
||||
<resultMap id="RuleResultMap" type="com.qiguliuxing.dts.db.domain.DtsGrouponRules">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="goods_id" jdbcType="BIGINT" property="goodsId" />
|
||||
<result column="goods_name" jdbcType="VARCHAR" property="goodsName" />
|
||||
<result column="pic_url" jdbcType="VARCHAR" property="picUrl" />
|
||||
<result column="discount" jdbcType="DECIMAL" property="discount" />
|
||||
<result column="discount_member" jdbcType="INTEGER" property="discountMember" />
|
||||
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="expire_time" jdbcType="TIMESTAMP" property="expireTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Rule_Column_List">
|
||||
o.id, o.goods_id, o.goods_name, o.pic_url, o.discount, o.discount_member, o.add_time, o.update_time,
|
||||
o.expire_time, o.deleted
|
||||
</sql>
|
||||
|
||||
<select id="queryBrandGrouponRules" resultMap="RuleResultMap" parameterType="map">
|
||||
select distinct
|
||||
<include refid="Rule_Column_List" />
|
||||
from dts_groupon_rules o
|
||||
join dts_goods g on o.goods_id=g.id
|
||||
and o.deleted = 0
|
||||
<if test="goodsId != null and goodsId != ''">
|
||||
and o.goods_id = #{goodsId}
|
||||
</if>
|
||||
<if test="brandIdsSql != null and brandIdsSql != ''">
|
||||
${brandIdsSql}
|
||||
</if>
|
||||
<if test="orderBySql != null">
|
||||
order by ${orderBySql}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<resultMap id="GrouponsResultMap" type="com.qiguliuxing.dts.db.domain.DtsGroupon">
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="order_id" jdbcType="INTEGER" property="orderId" />
|
||||
<result column="groupon_id" jdbcType="INTEGER" property="grouponId" />
|
||||
<result column="rules_id" jdbcType="INTEGER" property="rulesId" />
|
||||
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="creator_user_id" jdbcType="INTEGER" property="creatorUserId" />
|
||||
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="share_url" jdbcType="VARCHAR" property="shareUrl" />
|
||||
<result column="payed" jdbcType="BIT" property="payed" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="Groupons_Column_List">
|
||||
o.id, o.order_id, o.groupon_id, o.rules_id, o.user_id, o.creator_user_id, o.add_time, o.update_time,
|
||||
o.share_url, o.payed, o.deleted
|
||||
</sql>
|
||||
|
||||
<select id="queryBrandGroupons" resultMap="GrouponsResultMap" parameterType="map">
|
||||
select distinct
|
||||
<include refid="Groupons_Column_List" />
|
||||
from dts_groupon o
|
||||
join dts_groupon_rules r on o.rules_id = r.id
|
||||
join dts_goods g on r.goods_id=g.id
|
||||
and o.deleted = 0
|
||||
<if test="rulesId != null and rulesId != ''">
|
||||
and o.rules_id = #{rulesId}
|
||||
</if>
|
||||
<if test="brandIdsSql != null and brandIdsSql != ''">
|
||||
${brandIdsSql}
|
||||
</if>
|
||||
<if test="orderBySql != null">
|
||||
order by ${orderBySql}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -1,6 +1,42 @@
|
|||
<?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.qiguliuxing.dts.db.dao.ex.OrderMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.qiguliuxing.dts.db.domain.DtsOrder">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
<id column="id" jdbcType="INTEGER" property="id" />
|
||||
<result column="user_id" jdbcType="INTEGER" property="userId" />
|
||||
<result column="order_sn" jdbcType="VARCHAR" property="orderSn" />
|
||||
<result column="order_status" jdbcType="SMALLINT" property="orderStatus" />
|
||||
<result column="consignee" jdbcType="VARCHAR" property="consignee" />
|
||||
<result column="mobile" jdbcType="VARCHAR" property="mobile" />
|
||||
<result column="address" jdbcType="VARCHAR" property="address" />
|
||||
<result column="message" jdbcType="VARCHAR" property="message" />
|
||||
<result column="goods_price" jdbcType="DECIMAL" property="goodsPrice" />
|
||||
<result column="freight_price" jdbcType="DECIMAL" property="freightPrice" />
|
||||
<result column="coupon_price" jdbcType="DECIMAL" property="couponPrice" />
|
||||
<result column="integral_price" jdbcType="DECIMAL" property="integralPrice" />
|
||||
<result column="groupon_price" jdbcType="DECIMAL" property="grouponPrice" />
|
||||
<result column="order_price" jdbcType="DECIMAL" property="orderPrice" />
|
||||
<result column="actual_price" jdbcType="DECIMAL" property="actualPrice" />
|
||||
<result column="pay_id" jdbcType="VARCHAR" property="payId" />
|
||||
<result column="pay_time" jdbcType="TIMESTAMP" property="payTime" />
|
||||
<result column="ship_sn" jdbcType="VARCHAR" property="shipSn" />
|
||||
<result column="ship_channel" jdbcType="VARCHAR" property="shipChannel" />
|
||||
<result column="ship_time" jdbcType="TIMESTAMP" property="shipTime" />
|
||||
<result column="confirm_time" jdbcType="TIMESTAMP" property="confirmTime" />
|
||||
<result column="comments" jdbcType="SMALLINT" property="comments" />
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||
<result column="add_time" jdbcType="TIMESTAMP" property="addTime" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
<result column="deleted" jdbcType="BIT" property="deleted" />
|
||||
<result column="settlement_money" jdbcType="DECIMAL" property="settlementMoney" />
|
||||
<result column="settlement_status" jdbcType="BIT" property="settlementStatus" />
|
||||
</resultMap>
|
||||
|
||||
<update id="updateWithOptimisticLocker" parameterType="map">
|
||||
update dts_order
|
||||
<set>
|
||||
|
|
@ -85,4 +121,38 @@
|
|||
</set>
|
||||
where id = #{order.id,jdbcType=INTEGER} and update_time = #{lastUpdateTime,jdbcType=INTEGER}
|
||||
</update>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
<!--
|
||||
WARNING - @mbg.generated
|
||||
This element is automatically generated by MyBatis Generator, do not modify.
|
||||
-->
|
||||
o.id, o.user_id, o.order_sn, o.order_status, o.consignee, o.mobile, o.address, o.message, o.goods_price,
|
||||
o.freight_price, o.coupon_price, o.integral_price, o.groupon_price, o.order_price, o.actual_price,
|
||||
o.pay_id, o.pay_time, o.ship_sn, o.ship_channel, o.ship_time, o.confirm_time, o.comments, o.end_time,
|
||||
o.add_time, o.update_time, o.deleted, o.settlement_money, o.settlement_status
|
||||
</sql>
|
||||
|
||||
<select id="selectBrandOrdersByExample" resultMap="BaseResultMap" parameterType="map">
|
||||
select distinct
|
||||
<include refid="Base_Column_List" />
|
||||
from dts_order o
|
||||
join dts_order_goods g on o.id=g.order_id
|
||||
and o.deleted = 0
|
||||
<if test="userId != null and userId != ''">
|
||||
and o.user_id = #{userId}
|
||||
</if>
|
||||
<if test="orderSn != null and orderSn != ''">
|
||||
and o.order_sn = #{orderSn}
|
||||
</if>
|
||||
<if test="orderStatusSql != null and orderStatusSql != ''">
|
||||
${orderStatusSql}
|
||||
</if>
|
||||
<if test="brandIdsSql != null and brandIdsSql != ''">
|
||||
${brandIdsSql}
|
||||
</if>
|
||||
<if test="orderBySql != null">
|
||||
order by ${orderBySql}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -1,6 +1,42 @@
|
|||
<?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.qiguliuxing.dts.db.dao.ex.StatMapper">
|
||||
|
||||
<resultMap id="DayStatis" type="com.qiguliuxing.dts.db.bean.DayStatis">
|
||||
<result column="statis_day" jdbcType="VARCHAR" property="dayStr" />
|
||||
<result column="statis_cnts" jdbcType="INTEGER" property="cnts" />
|
||||
<result column="statis_amts" jdbcType="INTEGER" property="amts" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="CategorySellAmts" type="com.qiguliuxing.dts.db.bean.CategorySellAmts">
|
||||
<result column="category_name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="statis_amts" jdbcType="INTEGER" property="value" />
|
||||
</resultMap>
|
||||
|
||||
<select id="statisIncreaseUserCnt" resultMap="DayStatis" parameterType="map">
|
||||
select date_format(t.add_time,"%Y-%m-%d") as statis_day,count(1) as statis_cnts
|
||||
from dts_user t where t.add_time > date_add(now(),interval -#{daysAgo} day)
|
||||
and t.deleted=0
|
||||
group by date_format(t.add_time,"%Y-%m-%d")
|
||||
</select>
|
||||
|
||||
<select id="statisIncreaseOrderCnt" resultMap="DayStatis" parameterType="map">
|
||||
select date_format(t.add_time,"%Y-%m-%d") as statis_day,count(1) as statis_cnts,sum(actual_price) as statis_amts
|
||||
from dts_order t where t.add_time > date_add(now(),interval -#{daysAgo} day)
|
||||
and t.deleted=0 and t.order_status not in(101,102,103)
|
||||
group by date_format(t.add_time,"%Y-%m-%d")
|
||||
</select>
|
||||
|
||||
<select id="categorySellStatis" resultMap="CategorySellAmts">
|
||||
select pc.name as category_name,sum(og.price) as statis_amts from dts_order_goods og
|
||||
join dts_order o on o.id = og.order_id
|
||||
join dts_goods g on g.id = og.goods_id
|
||||
join dts_category c on g.category_id = c.id
|
||||
join dts_category pc on pc.id = c.pid
|
||||
where og.deleted=0 and o.order_status not in(101,102,103)
|
||||
group by pc.name
|
||||
</select>
|
||||
|
||||
<select id="statUser" resultType="map">
|
||||
select
|
||||
substr(add_time,1,10) as day,
|
||||
|
|
@ -8,6 +44,7 @@
|
|||
from dts_user
|
||||
group by substr(add_time,1,10)
|
||||
</select>
|
||||
|
||||
<select id="statOrder" resultType="map">
|
||||
select
|
||||
substr(add_time,1,10) as day,
|
||||
|
|
@ -19,6 +56,7 @@
|
|||
where order_status in(103)
|
||||
group by substr(add_time,1,10)
|
||||
</select>
|
||||
|
||||
<select id="statGoods" resultType="map">
|
||||
select
|
||||
substr(add_time,1, 10) as day,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import com.qiguliuxing.dts.core.consts.CommConsts;
|
|||
* 简单缓存的数据
|
||||
*/
|
||||
public class HomeCacheManager {
|
||||
public static final boolean ENABLE = true;// 默认启动缓存
|
||||
public static final boolean ENABLE = true;// 默认启动缓存true,不启动false
|
||||
|
||||
public static final String INDEX = "index";
|
||||
public static final String CATALOG = "catalog";
|
||||
|
|
|
|||
|
|
@ -0,0 +1,135 @@
|
|||
package com.qiguliuxing.dts.wx.service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.qiguliuxing.dts.core.qcode.QCodeService;
|
||||
import com.qiguliuxing.dts.core.type.AgencyShareTypeEnum;
|
||||
import com.qiguliuxing.dts.db.domain.DtsBrand;
|
||||
import com.qiguliuxing.dts.db.domain.DtsGoods;
|
||||
import com.qiguliuxing.dts.db.service.DtsAgencyService;
|
||||
import com.qiguliuxing.dts.db.service.DtsBrandService;
|
||||
import com.qiguliuxing.dts.db.service.DtsGoodsService;
|
||||
|
||||
@Service
|
||||
public class WxAgencyService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(WxAgencyService.class);
|
||||
|
||||
@Autowired
|
||||
private DtsAgencyService agencyService;
|
||||
|
||||
@Autowired
|
||||
private DtsGoodsService goodsService;
|
||||
|
||||
@Autowired
|
||||
private DtsBrandService brandService;
|
||||
|
||||
@Autowired
|
||||
private QCodeService qCodeService;
|
||||
|
||||
/**
|
||||
* 生成代理用户的分享海报
|
||||
* @param userId
|
||||
* @param type
|
||||
* @param shareObjId
|
||||
* @return
|
||||
*/
|
||||
public String createAgencyShareUrl(Integer userId, Integer type, Integer shareObjId) {
|
||||
String shareUrl = null;
|
||||
try {
|
||||
if (type.intValue() == AgencyShareTypeEnum.GOODS_SHARE.getType().intValue()) {// 商品
|
||||
// 商品信息
|
||||
DtsGoods goods = goodsService.findById(shareObjId);
|
||||
// 将生成的分享图片到存储空间
|
||||
shareUrl = qCodeService.createGoodShareImage(userId,goods.getId().toString(), goods.getPicUrl(),
|
||||
goods.getName(), goods.getCounterPrice(), goods.getRetailPrice());
|
||||
|
||||
} else if (type.intValue() == AgencyShareTypeEnum.BRAND_SHARE.getType().intValue()) {// 入驻店铺
|
||||
// 生成店铺的分享URL
|
||||
DtsBrand brand = brandService.findById(shareObjId);
|
||||
String defaultCategory = brandService.getBrandCategory(brand.getDefaultCategoryId());
|
||||
shareUrl = qCodeService.createBrandImage(userId,brand.getId(), brand.getPicUrl(), brand.getName(),
|
||||
defaultCategory);
|
||||
|
||||
} else {// 其他暂时不考虑
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("生成分享海报URL出错:{}", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
agencyService.saveDtsAgencyShare(userId, type, shareObjId, shareUrl);// 代理用户的需要保存记录
|
||||
return shareUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 非代理用户的分享海报获取
|
||||
*
|
||||
* @param type
|
||||
* @param shareObjId
|
||||
* @return
|
||||
*/
|
||||
public String getShareObjUrl(Integer type, Integer shareObjId) {
|
||||
String shareUrl = null;
|
||||
if (type.intValue() == AgencyShareTypeEnum.GOODS_SHARE.getType().intValue()) {// 商品
|
||||
// 商品信息
|
||||
DtsGoods goods = goodsService.findById(shareObjId);
|
||||
if (goods != null) {
|
||||
shareUrl = goods.getShareUrl();
|
||||
}
|
||||
} else if (type.intValue() == AgencyShareTypeEnum.BRAND_SHARE.getType().intValue()) {// 入驻店铺
|
||||
DtsBrand brand = brandService.findById(shareObjId);
|
||||
if (brand != null) {
|
||||
shareUrl = brand.getShareUrl();
|
||||
}
|
||||
} else {// 其他暂时不考虑
|
||||
}
|
||||
logger.info("获取 {} 的分享海报 url {}", AgencyShareTypeEnum.getInstance(type).getDesc(), shareUrl);
|
||||
return shareUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 非代理用户的海报分享创建
|
||||
*
|
||||
* @param type
|
||||
* @param shareObjId
|
||||
* @return
|
||||
*/
|
||||
public String createShareUrl(Integer type, Integer shareObjId) {
|
||||
String shareUrl = null;
|
||||
try {
|
||||
if (type.intValue() == AgencyShareTypeEnum.GOODS_SHARE.getType().intValue()) {// 商品
|
||||
// 商品信息
|
||||
DtsGoods goods = goodsService.findById(shareObjId);
|
||||
// 将生成的分享图片到存储空间
|
||||
shareUrl = qCodeService.createGoodShareImage(null,goods.getId().toString(), goods.getPicUrl(),
|
||||
goods.getName(), goods.getCounterPrice(), goods.getRetailPrice());
|
||||
|
||||
// 更新数据
|
||||
goods.setShareUrl(shareUrl);
|
||||
goodsService.updateById(goods);
|
||||
} else if (type.intValue() == AgencyShareTypeEnum.BRAND_SHARE.getType().intValue()) {// 入驻店铺
|
||||
|
||||
// 生成店铺的分享URL
|
||||
DtsBrand brand = brandService.findById(shareObjId);
|
||||
String defaultCategory = brandService.getBrandCategory(brand.getDefaultCategoryId());
|
||||
shareUrl = qCodeService.createBrandImage(null,brand.getId(), brand.getPicUrl(), brand.getName(),
|
||||
defaultCategory);
|
||||
|
||||
// 更新数据
|
||||
brand.setShareUrl(shareUrl);
|
||||
brandService.updateById(brand);
|
||||
|
||||
} else {// 其他暂时不考虑
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("生成分享海报URL出错:{}", e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
logger.info("生成 {} 的分享海报 url {}", AgencyShareTypeEnum.getInstance(type).getDesc(), shareUrl);
|
||||
return shareUrl;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -478,7 +478,7 @@ public class WxOrderService {
|
|||
if (user != null && user.getShareUserId() != null) {
|
||||
shareUserId = user.getShareUserId();
|
||||
}
|
||||
Integer settlementRate = 3;// 默认百分之3
|
||||
Integer settlementRate = 5;// 默认百分之5
|
||||
DtsUserAccount userAccount = accountService.findShareUserAccountByUserId(shareUserId);
|
||||
if (userAccount != null && userAccount.getSettlementRate() > 0 && userAccount.getSettlementRate() < 15) {
|
||||
settlementRate = userAccount.getSettlementRate();
|
||||
|
|
@ -1343,7 +1343,7 @@ public class WxOrderService {
|
|||
result.put("accountTraceList", accountTraceList);
|
||||
result.put("totalPages", totalPages);
|
||||
|
||||
logger.info("【请求结束】获取推广订单列表成功!,推广订单数:{}", count);
|
||||
logger.info("【请求结束】获取佣金提现列表成功!,提现总数:{}", count);
|
||||
return ResponseUtil.ok(result);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ package com.qiguliuxing.dts.wx.util;
|
|||
public enum WxResponseCode {
|
||||
|
||||
AUTH_INVALID_ACCOUNT(700, "账号密码不对"), AUTH_CAPTCHA_UNSUPPORT(701, "小程序后台验证码服务不支持"), AUTH_CAPTCHA_FREQUENCY(702,
|
||||
"验证码未超时1分钟,不能发送"), AUTH_CAPTCHA_UNMATCH(703, "验证码错误"), AUTH_NAME_REGISTERED(704,
|
||||
"验证码请求过于频繁"), AUTH_CAPTCHA_UNMATCH(703, "验证码错误"), AUTH_NAME_REGISTERED(704,
|
||||
"用户名已注册"), AUTH_MOBILE_REGISTERED(705, "手机号已注册"), AUTH_MOBILE_UNREGISTERED(706,
|
||||
"手机号未注册"), AUTH_INVALID_MOBILE(707, "手机号格式不正确"), AUTH_OPENID_UNACCESS(708,
|
||||
"获取腾讯官方 openid失败"), AUTH_OPENID_BINDED(709, "openid已绑定账号"),
|
||||
|
|
|
|||
|
|
@ -0,0 +1,97 @@
|
|||
package com.qiguliuxing.dts.wx.web;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.qiguliuxing.dts.core.consts.CommConsts;
|
||||
import com.qiguliuxing.dts.core.util.JacksonUtil;
|
||||
import com.qiguliuxing.dts.core.util.ResponseUtil;
|
||||
import com.qiguliuxing.dts.db.domain.DtsUser;
|
||||
import com.qiguliuxing.dts.db.service.DtsAgencyService;
|
||||
import com.qiguliuxing.dts.db.service.DtsUserService;
|
||||
import com.qiguliuxing.dts.wx.annotation.LoginUser;
|
||||
import com.qiguliuxing.dts.wx.service.WxAgencyService;
|
||||
|
||||
/**
|
||||
* 代理业务接口
|
||||
*
|
||||
* @author QIGULIUXING
|
||||
* @QQ 623659388
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wx/agency")
|
||||
@Validated
|
||||
public class WxAgencyController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(WxAgencyController.class);
|
||||
|
||||
@Autowired
|
||||
private DtsAgencyService agencyService;
|
||||
|
||||
@Autowired
|
||||
private DtsUserService userService;
|
||||
|
||||
@Autowired
|
||||
private WxAgencyService wxAgencyService;
|
||||
|
||||
|
||||
/**
|
||||
* 生成分享图
|
||||
*
|
||||
* @param userId
|
||||
* @param page
|
||||
* @param size
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("createShareImg")
|
||||
public Object createShareImg(@LoginUser Integer userId, @RequestBody String body) {
|
||||
logger.info("【请求开始】生成分享图,请求参数,body:{}", body);
|
||||
if (userId == null) {
|
||||
logger.error("生成分享图失败:用户未登录!!!");
|
||||
return ResponseUtil.unlogin();
|
||||
}
|
||||
|
||||
Integer shareObjId = JacksonUtil.parseInteger(body, "shareObjId");
|
||||
Integer type = JacksonUtil.parseInteger(body, "type");
|
||||
|
||||
if (shareObjId == null || type == null) {
|
||||
logger.error("生成分享图失败:{}", CommConsts.MISS_PARAMS);
|
||||
return ResponseUtil.badArgument();
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证是否需要生成图片
|
||||
* 1.验证用户是否是代理用户,如果是代理用户,需要返回代理用户的分享图
|
||||
* 不存在代理分享图,则需要重新生成,并返回代理图,存在直接返回
|
||||
* 2.如果是非代理用户,则需要直接返回对象的分享图,如果不存在,则创建后返回
|
||||
*/
|
||||
DtsUser user = userService.findById(userId);
|
||||
String shareUrl = null;
|
||||
if (user.getUserLevel().equals((byte)2)) {//之所以代理用户与非代理用户分开,是为了减少海报图片的生成
|
||||
shareUrl = agencyService.getDtsAgencyShare(userId,type,shareObjId);
|
||||
if (StringUtils.isEmpty(shareUrl)) {//如果不存在,则需要创建
|
||||
shareUrl = wxAgencyService.createAgencyShareUrl(userId,type,shareObjId);
|
||||
}
|
||||
} else {
|
||||
shareUrl = wxAgencyService.getShareObjUrl(type,shareObjId);
|
||||
if (StringUtils.isEmpty(shareUrl)) {// 如果不存在,则需要创建
|
||||
shareUrl = wxAgencyService.createShareUrl(type,shareObjId);
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("shareUrl", shareUrl);
|
||||
logger.info("【请求结束】生成分享图成功,URL:{} ",shareUrl);
|
||||
return ResponseUtil.ok(result);
|
||||
}
|
||||
}
|
||||
|
|
@ -31,9 +31,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.qiguliuxing.dts.core.captcha.CaptchaCodeManager;
|
||||
import com.qiguliuxing.dts.core.consts.CommConsts;
|
||||
import com.qiguliuxing.dts.core.notify.NotifyService;
|
||||
import com.qiguliuxing.dts.core.notify.NotifyType;
|
||||
import com.qiguliuxing.dts.core.notify.SmsResult;
|
||||
import com.qiguliuxing.dts.core.type.UserTypeEnum;
|
||||
import com.qiguliuxing.dts.core.util.CharUtil;
|
||||
import com.qiguliuxing.dts.core.util.JacksonUtil;
|
||||
|
|
@ -47,7 +49,6 @@ import com.qiguliuxing.dts.wx.annotation.LoginUser;
|
|||
import com.qiguliuxing.dts.wx.dao.UserInfo;
|
||||
import com.qiguliuxing.dts.wx.dao.UserToken;
|
||||
import com.qiguliuxing.dts.wx.dao.WxLoginInfo;
|
||||
import com.qiguliuxing.dts.wx.service.CaptchaCodeManager;
|
||||
import com.qiguliuxing.dts.wx.service.UserTokenManager;
|
||||
import com.qiguliuxing.dts.wx.util.IpUtil;
|
||||
import com.qiguliuxing.dts.wx.util.WxResponseUtil;
|
||||
|
|
@ -272,9 +273,12 @@ public class WxAuthController {
|
|||
return WxResponseUtil.fail(AUTH_CAPTCHA_UNSUPPORT);
|
||||
}
|
||||
String code = CharUtil.getRandomNum(6);
|
||||
notifyService.notifySmsTemplate(phoneNumber, NotifyType.CAPTCHA, new String[] { code, "1" });
|
||||
|
||||
boolean successful = CaptchaCodeManager.addToCache(phoneNumber, code);
|
||||
SmsResult smsResult = notifyService.notifySmsTemplate(phoneNumber, NotifyType.CAPTCHA, new String[] { code, "1" });
|
||||
if (smsResult != null) {
|
||||
logger.info("*****腾讯云短信发送->请求验证码,短信发送结果:{}",JSONObject.toJSONString(smsResult));
|
||||
}
|
||||
|
||||
boolean successful = CaptchaCodeManager.addToCache(phoneNumber, code,1);
|
||||
if (!successful) {
|
||||
logger.error("请求验证码出错:{}", AUTH_CAPTCHA_FREQUENCY.desc());
|
||||
return WxResponseUtil.fail(AUTH_CAPTCHA_FREQUENCY);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
package com.qiguliuxing.dts.wx.web;
|
||||
|
||||
import static com.qiguliuxing.dts.wx.util.WxResponseCode.AUTH_CAPTCHA_UNMATCH;
|
||||
import static com.qiguliuxing.dts.wx.util.WxResponseCode.APPLY_WITHDRAWAL_FAIL;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
|
@ -16,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
|
@ -31,7 +31,6 @@ import com.qiguliuxing.dts.db.domain.DtsAccountTrace;
|
|||
import com.qiguliuxing.dts.db.domain.DtsUserAccount;
|
||||
import com.qiguliuxing.dts.db.service.DtsAccountService;
|
||||
import com.qiguliuxing.dts.wx.annotation.LoginUser;
|
||||
import com.qiguliuxing.dts.wx.service.CaptchaCodeManager;
|
||||
import com.qiguliuxing.dts.wx.service.WxOrderService;
|
||||
import com.qiguliuxing.dts.wx.util.WxResponseCode;
|
||||
import com.qiguliuxing.dts.wx.util.WxResponseUtil;
|
||||
|
|
@ -71,7 +70,6 @@ public class WxBrokerageController {
|
|||
logger.error("获取结算信息数据失败:用户未登录!!!");
|
||||
return ResponseUtil.unlogin();
|
||||
}
|
||||
|
||||
Map<Object, Object> data = new HashMap<Object, Object>();
|
||||
|
||||
// 查询用户账号
|
||||
|
|
@ -82,8 +80,11 @@ public class WxBrokerageController {
|
|||
totalAmount = userAccount.getTotalAmount();
|
||||
remainAmount = userAccount.getRemainAmount();
|
||||
}
|
||||
|
||||
//可提现金额 = 已结算未提现 remainAmount + 未结算 unSettleAmount
|
||||
BigDecimal unSettleAmount = accountService.getUnSettleAmount(userId);
|
||||
data.put("totalAmount", totalAmount);
|
||||
data.put("remainAmount", remainAmount);
|
||||
data.put("remainAmount", remainAmount.add(unSettleAmount));
|
||||
|
||||
// 统计数据信息 本月和上月的结算
|
||||
String lastMonthEndTime = DateTimeUtil.getPrevMonthEndDay() + " 23:59:59";
|
||||
|
|
@ -147,54 +148,45 @@ public class WxBrokerageController {
|
|||
* @param size
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("applyWithdrawal")
|
||||
@PostMapping("applyWithdrawal")
|
||||
public Object applyWithdrawal(@LoginUser Integer userId, @RequestBody String body) {
|
||||
logger.info("【请求开始】提现申请,请求参数,userId:{}", body);
|
||||
|
||||
logger.info("【请求开始】提现申请,请求参数,body:{}", body);
|
||||
if (userId == null) {
|
||||
logger.error("提现申请失败:用户未登录!!!");
|
||||
return ResponseUtil.unlogin();
|
||||
}
|
||||
|
||||
String mobile = JacksonUtil.parseString(body, "mobile");
|
||||
String code = JacksonUtil.parseString(body, "code");
|
||||
//String code = JacksonUtil.parseString(body, "code");
|
||||
String amt = JacksonUtil.parseString(body, "amt");
|
||||
|
||||
if (StringUtils.isEmpty(amt) || StringUtils.isEmpty(mobile) || StringUtils.isEmpty(code)) {
|
||||
if (StringUtils.isEmpty(amt) || StringUtils.isEmpty(mobile)) {
|
||||
logger.error("提现申请失败:{}", CommConsts.MISS_PARAMS);
|
||||
return ResponseUtil.badArgument();
|
||||
}
|
||||
|
||||
// 判断验证码是否正确
|
||||
String cacheCode = CaptchaCodeManager.getCachedCaptcha(mobile);
|
||||
/*String cacheCode = CaptchaCodeManager.getCachedCaptcha(mobile);
|
||||
if (cacheCode == null || cacheCode.isEmpty() || !cacheCode.equals(code)) {
|
||||
logger.error("提现申请失败:{}", AUTH_CAPTCHA_UNMATCH.desc());
|
||||
return WxResponseUtil.fail(AUTH_CAPTCHA_UNMATCH);
|
||||
}
|
||||
|
||||
// 判断用户可提现金额正确性
|
||||
DtsUserAccount userAccount = accountService.findShareUserAccountByUserId(userId);
|
||||
BigDecimal remainAmount = new BigDecimal(0.00);
|
||||
BigDecimal applyAmt = new BigDecimal(amt);
|
||||
if (userAccount != null) {
|
||||
remainAmount = userAccount.getRemainAmount();
|
||||
}
|
||||
if (remainAmount.compareTo(applyAmt) == -1) {
|
||||
logger.error("提现申请失败:{}", APPLY_WITHDRAWAL_FAIL.desc());
|
||||
return WxResponseUtil.fail(APPLY_WITHDRAWAL_FAIL);
|
||||
}
|
||||
}*/
|
||||
|
||||
//验证是否存在未审批通过的申请单,需完成上一个申请才能继续申请下一个提现
|
||||
List<DtsAccountTrace> traceList = accountService.getAccountTraceList(userId,BrokerageTypeEnum.SYS_APPLY.getType(),BrokerageTypeEnum.USER_APPLY.getType());
|
||||
if (traceList.size() > 0 ) {
|
||||
List<DtsAccountTrace> traceList = accountService.getAccountTraceList(userId,(byte)0);
|
||||
if (traceList.size() > 0) {
|
||||
logger.error("提现申请失败:{}", WxResponseCode.APPLY_WITHDRAWAL_EXIST.desc());
|
||||
return WxResponseUtil.fail(WxResponseCode.APPLY_WITHDRAWAL_EXIST);
|
||||
}
|
||||
// 生成提现申请记录到账户跟踪表
|
||||
try {
|
||||
accountService.addExtractRecord(userId, applyAmt, mobile, code, remainAmount);
|
||||
} catch (Exception e) {
|
||||
logger.error("提现申请失败,生成提现申请记录到账户跟踪表失败:userId:{}", userId);
|
||||
e.printStackTrace();
|
||||
return ResponseUtil.fail();
|
||||
|
||||
LocalDateTime startTime = LocalDateTime.now().minusDays(DtsAccountService.TWO_MONTH_DAYS);
|
||||
LocalDateTime endTime = LocalDateTime.now().minusDays(DtsAccountService.ONE_WEEK_DAYS);
|
||||
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
//获取未结算的金额
|
||||
BigDecimal unSettleAmount = accountService.getUnSettleAmount(userId,startTime.format(df),endTime.format(df));
|
||||
if (unSettleAmount != null && unSettleAmount.compareTo(new BigDecimal(0)) > 0) {
|
||||
accountService.settleApplyTrace(userId, startTime.format(df),endTime.format(df),BrokerageTypeEnum.USER_APPLY.getType().intValue(), unSettleAmount,mobile);
|
||||
}
|
||||
|
||||
logger.info("【请求结束】提现申请成功!");
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import java.util.Map;
|
|||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -111,8 +110,7 @@ public class WxCouponController {
|
|||
|
||||
List<DtsCouponUser> couponUserList = couponUserService.queryList(userId, null, status, page, size, sort, order);
|
||||
List<CouponVo> couponVoList = change(couponUserList);
|
||||
long total = PageInfo.of(couponUserList).getTotal();
|
||||
//int total = couponService.queryTotal();
|
||||
int total = couponService.queryTotal();
|
||||
Map<String, Object> data = new HashMap<String, Object>();
|
||||
data.put("data", couponVoList);
|
||||
data.put("count", total);
|
||||
|
|
|
|||
|
|
@ -74,11 +74,14 @@ public class WxUserController {
|
|||
totalAmount = userAccount.getTotalAmount();
|
||||
remainAmount = userAccount.getRemainAmount();
|
||||
}
|
||||
|
||||
// 可提现金额 = 已结算未提现 remainAmount + 未结算 unSettleAmount
|
||||
BigDecimal unSettleAmount = accountService.getUnSettleAmount(userId);
|
||||
data.put("totalAmount", totalAmount);
|
||||
data.put("remainAmount", remainAmount);
|
||||
|
||||
data.put("remainAmount", remainAmount.add(unSettleAmount));
|
||||
|
||||
// 查询用户的优惠券
|
||||
int total = couponService.queryUserCouponCnt(userId);
|
||||
int total = couponService.queryTotal();
|
||||
data.put("couponCount", total);
|
||||
|
||||
logger.info("【请求结束】用户个人页面数据,响应结果:{}", JSONObject.toJSONString(data));
|
||||
|
|
|
|||
Loading…
Reference in New Issue