Merge branch 'lyf'

This commit is contained in:
2024-06-26 09:35:50 +08:00
235 changed files with 13604 additions and 4510 deletions

29
pom.xml
View File

@@ -20,7 +20,11 @@
</properties>
<dependencies>
<dependency>
<groupId>com.belerweb</groupId>
<artifactId >pinyin4j</artifactId>
<version >2.5.1</version >
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
@@ -56,7 +60,12 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.9</version>
<version>1.2.83</version>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
<version>3.15.1</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
@@ -103,6 +112,18 @@
<scope>runtime</scope>
</dependency>
<!-- zxing生成二维码 -->
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.5.3</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.5.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
@@ -178,6 +199,10 @@
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>

View File

@@ -14,6 +14,7 @@ import org.springframework.context.ApplicationContext;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
@@ -26,11 +27,12 @@ import java.net.Socket;
@EnableScheduling
@EntityScan(basePackageClasses = {Shell.class})
@MapperScan(basePackageClasses ={Shell.class} )
@ComponentScan(basePackageClasses ={Shell.class})
//@ComponentScan(basePackageClasses ={Shell.class})
@EnableTransactionManagement
@EnableAspectJAutoProxy(proxyTargetClass = true)
@Slf4j
@EnableWebSocket
@EnableAsync
public class Shell {
private static Logger logger = LoggerFactory.getLogger(Shell.class);

View File

@@ -0,0 +1,22 @@
package com.chaozhanggui.system.cashierservice.annotation;
import java.lang.annotation.*;
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface LimitSubmit {
String key() ;
/**
* 默认 10s
*/
int limit() default 5;
/**
* 请求完成后 是否一直等待
* true则等待
* @return
*/
boolean needAllWait() default true;
}

View File

@@ -10,6 +10,7 @@ import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.servlet.*;
@@ -36,11 +37,26 @@ public class LoginFilter implements Filter {
// 忽略静态资源
"css/**",
"js/**",
"cashierService/websocket/table",//websocket
"cashierService/phoneValidateCode",//验证码
"cashierService/tbPlatformDict",//获取菜单
"cashierService/location/**",//高德 获取行政区域
"cashierService/home/homePageUp",//首页上半
"cashierService/home",//首页
"cashierService/login/**"//登录部分接口不校验
"cashierService/order/testMessage",//首页
"cashierService/common/**",//通用接口
"cashierService/distirict/**",//首页其它接口
// "cashierService/login/**",//登录部分接口不校验
"cashierService/login/wx/**",//登录部分接口不校验
"cashierService/login/app/login",//登录部分接口不校验
"cashierService/product/queryProduct",
"cashierService/product/queryProductSku",
"cashierService/product/productInfo",
"cashierService/notify/**",//登录部分接口不校验
"notify/**",
"cashierService/table/**",//回调部分接口不校验
"cashierService/pay/**"
);
@Autowired
@@ -62,33 +78,58 @@ public class LoginFilter implements Filter {
}
// 获取请求地址
String url = request.getRequestURI();
// 不需要授权的接口直接访问的地址
if (containsUrl(NOT_LOGIN_URL, url)) {
chain.doFilter(req, resp);
return;
}
//environment 环境标识 wx app 后续environment不可为空
String environment = request.getHeader("environment");
//token校验目前只对app生效
if (StringUtils.isBlank(environment) || !environment.equals("app")) {
chain.doFilter(req, resp);
return;
}
// 判断用户TOKEN是否存在
String token = request.getHeader("token");
if (StringUtils.isBlank(token)) {
Result result = new Result(CodeEnum.TOKEN_EXEIST);
Result result = new Result(CodeEnum.TOKEN_EXPIRED);
String jsonString = JSONObject.toJSONString(result);
JSONObject jsonObject = JSONObject.parseObject(jsonString, JSONObject.class);
response.getWriter().print(jsonObject);
response.getWriter().flush();//流里边的缓存刷出
return;
}
//获取当前登录人的用户id
String loginName = TokenUtil.parseParamFromToken(token).getString("userId");
//获取redis中的token
String message = redisUtil.getMessage(RedisCst.ONLINE_APP_USER.concat(loginName));
String message = "";
String tokenKey="";
JSONObject jsonObject1 = TokenUtil.parseParamFromToken(token);
if (jsonObject1.containsKey("status")){
String openId = request.getHeader("openId");
String userId = request.getHeader("id");
redisUtil.deleteByKey(RedisCst.ONLINE_USER.concat(openId));
redisUtil.deleteByKey(RedisCst.ONLINE_USER.concat(userId));
redisUtil.deleteByKey(RedisCst.ONLINE_APP_USER.concat(userId));
Result result = new Result(CodeEnum.TOKEN_EXPIRED);
String jsonString = JSONObject.toJSONString(result);
JSONObject jsonObject = JSONObject.parseObject(jsonString, JSONObject.class);
response.getWriter().print(jsonObject);
response.getWriter().flush();//流里边的缓存刷出
return;
}
if(environment.equals("app")){
//获取当前登录人的用户id
String userId = jsonObject1.getString("userId");
tokenKey=RedisCst.ONLINE_APP_USER.concat(userId);
//获取redis中的token
}else if(environment.equals("wx")){
//获取当前登录人的用户id
String openId = jsonObject1.getString("openId");
if(StringUtils.isBlank(openId)){
openId = jsonObject1.getString("userId");
}
tokenKey=RedisCst.ONLINE_USER.concat(openId);
}
message = redisUtil.getMessage(tokenKey);
if (StringUtils.isBlank(message)) {
Result result = new Result(CodeEnum.TOKEN_EXPIRED);
String jsonString = JSONObject.toJSONString(result);
@@ -106,9 +147,19 @@ public class LoginFilter implements Filter {
response.getWriter().flush();//流里边的缓存刷出
return;
}
checkRenewal(tokenKey);
chain.doFilter(req, resp);
}
@Async
public void checkRenewal(String tokenKey) {
// 判断是否续期token,计算token的过期时间
long time = redisUtil.getRemainingTime(tokenKey);
if(time<60*60*24*10L){
redisUtil.setKeyExpirationTime(tokenKey,60*60*24*30L);
}
}
/**
* 判断url请求是否配置在urls列表中
*/
@@ -122,6 +173,9 @@ public class LoginFilter implements Filter {
return true;
}
} else {
if (url.equals(s)) {
return true;
}
if (url.equals("/" + s)) {
return true;
}

View File

@@ -1,35 +0,0 @@
package com.chaozhanggui.system.cashierservice.config;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
//处理前端改变购物车的行为,并记录
public class ChangeHandler extends Handler {
@Override
public void handleRequest(ConcurrentHashMap<String, List<AppWebSocketServer>> webSocketMap,
JSONObject jsonObject, ConcurrentHashMap<String,
List<JSONObject>> recordMap,
AppWebSocketServer webSocke) throws IOException {
if (jsonObject.containsKey("change")) {
ArrayList<JSONObject> jsonObjects = new ArrayList<>();
jsonObjects.add(jsonObject);
// producerMq.syncShopCar(jsonObjects);
//记录每一次购物车变化的记录
List<JSONObject> objects = recordMap.get(webSocke.getTableId());
objects.add(jsonObject);
} else {
// 无法处理,传递给下一个处理器
if (nextHandler != null) {
nextHandler.handleRequest(webSocketMap,jsonObject,recordMap,webSocke);
}
}
}
}

View File

@@ -1,33 +0,0 @@
package com.chaozhanggui.system.cashierservice.config;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
//处理前端订单已完成把订单标志位置为false
public class ClearHandler extends Handler{
@Override
public void handleRequest(ConcurrentHashMap<String, List<AppWebSocketServer>> webSocketMap,
JSONObject jsonObject, ConcurrentHashMap<String,
List<JSONObject>> recordMap,
AppWebSocketServer webSocke) throws IOException {
if (jsonObject.containsKey("clear")) {
if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId())) {
List<AppWebSocketServer> serverList = webSocketMap.get(webSocke.getTableId());
//遍历所有对象,把订单都改为未提交,为了下一次点餐
serverList.forEach(m -> m.getCreateOrder().set(false));
}
} else {
// 无法处理,传递给下一个处理器
if (nextHandler != null) {
nextHandler.handleRequest(webSocketMap,jsonObject,recordMap,webSocke);
}
}
}
}

View File

@@ -28,7 +28,7 @@ public class CorsFilter implements Filter {
response.setHeader("Access-Control-Allow-Origin", curOrigin == null ? "true" : curOrigin);
response.setHeader("Access-Control-Allow-Methods", "*");
response.setHeader("Access-Control-Max-Age", "3600");
response.setHeader("Access-Control-Allow-Headers", "x-requested-with,signature");
response.setHeader("Access-Control-Allow-Headers", "environment,openId,type,version,token");
response.setHeader("Access-Control-Allow-Credentials", "true");
chain.doFilter(req, resp);
}

View File

@@ -1,79 +0,0 @@
package com.chaozhanggui.system.cashierservice.config;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
//处理前端创建订单
public class CreateOrderHandler extends Handler{
@Override
public void handleRequest(ConcurrentHashMap<String, List<AppWebSocketServer>> webSocketMap,
JSONObject jsonObject, ConcurrentHashMap<String,
List<JSONObject>> recordMap,
AppWebSocketServer webSocke) throws IOException {
if (jsonObject.containsKey("createOrdwebSockeer")) {
if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId())) {
List<AppWebSocketServer> serverList = webSocketMap.get(webSocke.getTableId());
//有一个为true就说明已经有订单了
if (serverList.stream().anyMatch(m -> m.getCreateOrder().get())) {
webSocke.sendMessage("已有人提交订单,请稍后");
return;
}
}
synchronized (webSocke) {
if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId())) {
List<AppWebSocketServer> serverList = webSocketMap.get(webSocke.getTableId());
//有一个为true就说明已经有订单了
if (serverList.stream().anyMatch(m -> m.getCreateOrder().get())) {
webSocke.sendMessage("已有人提交订单,请稍后");
return;
}
BigDecimal amount = new BigDecimal((Integer) jsonObject.get("amount"));
JSONArray shopCarList = jsonObject.getJSONArray("shopCarList");
String remark = jsonObject.get("remark").toString();
// List<ShopListDto> list=shopCarList.toJavaList(ShopListDto.class);
// //TODO 加个拦截加个shopid,抛出异常,前端展示
// setShopId(list.get(0).getShopId());
// try {
// Result order = orderFeign.createOrder(new CreateOrderDto(Long.parseLong(webSocke.getTableId()), amount, list, remark));
// if (order.getCode() == 200){
// //通知清空购物车
// AppSendInfo("订单提交成功", webSocke.getTableId());
// //清空本地的购物记录
// recordMap.get(webSocke.getTableId()).clear();
// webSocke.getCreateOrder().set(true);
// }else {
// AppSendInfo("订单提交失败",webSocke.getTableId());
// }
//
//
// }catch (Exception e){
// e.printStackTrace();
// AppSendInfo("订单提交失败",webSocke.getTableId());
// }
}
}
} else {
// 无法处理,传递给下一个处理器
if (nextHandler != null) {
nextHandler.handleRequest(webSocketMap,jsonObject,recordMap,webSocke);
}
}
}
}

View File

@@ -1,26 +0,0 @@
package com.chaozhanggui.system.cashierservice.config;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
public abstract class Handler {
protected Handler nextHandler;
public Handler addNextHandler(Handler handler) {
this.nextHandler = handler;
return handler;
}
public abstract void handleRequest(ConcurrentHashMap<String, List<AppWebSocketServer>> webSocketMap,
JSONObject jsonObject, ConcurrentHashMap<String,
List<JSONObject>> recordMap,
AppWebSocketServer webSocke) throws IOException;
}

View File

@@ -1,30 +0,0 @@
package com.chaozhanggui.system.cashierservice.config;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import static com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer.AppSendInfo;
//兜底处理器
public class OtherHandler extends Handler{
@Override
public void handleRequest(ConcurrentHashMap<String, List<AppWebSocketServer>> webSocketMap,
JSONObject jsonObject,
ConcurrentHashMap<String, List<JSONObject>> recordMap,
AppWebSocketServer webSocke) throws IOException {
//传送给对应tableId用户的websocket
if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId())) {
AppSendInfo("1", webSocke.getTableId(),false);
} else {
System.out.println("请求的tableId:" + webSocke.getTableId() + "不在该服务器上");
}
}
}

View File

@@ -1,46 +0,0 @@
package com.chaozhanggui.system.cashierservice.config;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer;
import org.apache.commons.lang3.StringUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
//处理前端初次扫码同步购物车
public class SyncHandler extends Handler {
@Override
public void handleRequest(ConcurrentHashMap<String, List<AppWebSocketServer>> webSocketMap,
JSONObject jsonObject, ConcurrentHashMap<String,
List<JSONObject>> recordMap,
AppWebSocketServer webSocke) throws IOException {
if (jsonObject.containsKey("sync")) {
//这个是判断是否有这个桌号,也就是 是否有人点过餐
List<JSONObject> recordList = recordMap.get(webSocke.getTableId());
//指定发送对象
if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId()) && recordList != null) {
List<AppWebSocketServer> serverList = webSocketMap.get(webSocke.getTableId());
for (AppWebSocketServer server : serverList) {
if (server.getSync().get()) {
server.sendMessage(recordList);
}
}
} else {
ArrayList<JSONObject> objects = new ArrayList<>();
recordMap.put(webSocke.getTableId(), objects);
}
webSocke.getSync().set(!webSocke.getSync().get());
} else {
// 无法处理,传递给下一个处理器
if (nextHandler != null) {
nextHandler.handleRequest(webSocketMap, jsonObject, recordMap, webSocke);
}
}
}
}

View File

@@ -1,31 +0,0 @@
package com.chaozhanggui.system.cashierservice.config;
import com.alibaba.fastjson.JSON;
import javax.websocket.Encoder;
import javax.websocket.EndpointConfig;
/**
* 为了websocket发送对象
*/
public class WebSocketCustomEncoding implements Encoder.Text<Object> {
// public String encode(Object vo) 这个就是指定发送的类型
@Override
public String encode(Object vo) {
assert vo!=null;
return JSON.toJSONString(vo);
}
@Override
public void init(EndpointConfig endpointConfig) {
}
@Override
public void destroy() {
}
}

View File

@@ -7,6 +7,9 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author admin
*/
@CrossOrigin(origins = "*")
@RestController
@Slf4j

View File

@@ -0,0 +1,201 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.dao.TbPlatformDictMapper;
import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict;
import com.chaozhanggui.system.cashierservice.entity.vo.DistrictVo;
import com.chaozhanggui.system.cashierservice.exception.MsgException;
import com.chaozhanggui.system.cashierservice.redis.RedisCst;
import com.chaozhanggui.system.cashierservice.redis.RedisUtil;
import com.chaozhanggui.system.cashierservice.service.FileService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.LocationUtils;
import com.chaozhanggui.system.cashierservice.util.StringUtil;
import com.chaozhanggui.system.cashierservice.util.ValidateCodeUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;
/**
* 通用接口
*
* @author lyf
*/
@RestController
@RequestMapping
@RequiredArgsConstructor
public class CommonController {
private final ValidateCodeUtil validateCodeUtil;
@Autowired
private RedisUtil redisUtil;
@Resource
private TbPlatformDictMapper platformDictMapper;
@Resource
private FileService fileService;
/**
* 一分钟
*/
protected static final long ONE_MINUTE = 1800;
/**
* 发送短信验证码
*
* @param phone
* @return
*/
@GetMapping("/phoneValidateCode")
public Result phoneValidateCode(@RequestParam String phone) {
if (StringUtils.isBlank(phone)) {
return Result.fail("手机号不可为空!");
}
// 检查手机号格式是否正确
if (!isValidPhoneNumber(phone)) {
return Result.fail("手机号格式不正确!");
}
// 检查手机号请求次数是否超出限制
Result isOk = isRequestLimit(phone);
if (!isOk.getCode().equals("0")) {
return isOk;
}
String random = StringUtil.random(6);
validateCodeUtil.requestValidateCodeAli(phone, random);
//存入缓存
try {
redisUtil.saveMessage(phone, random, 60L);
} catch (Exception e) {
throw new MsgException("验证码发送失败");
}
return Result.success(CodeEnum.SUCCESS);
}
/**
* 获取菜单
*/
@GetMapping("/tbPlatformDict")
public Result getPlatformDict(@RequestParam String type, @RequestHeader String environment) {
List<TbPlatformDict> carouselList = platformDictMapper.queryAllByType(type, environment);
return Result.success(CodeEnum.SUCCESS, carouselList);
}
/**
* 查询省市
*/
@GetMapping("location/districtAll")
public Result districtAll() throws JsonProcessingException {
ObjectMapper mapper = new ObjectMapper();
if(redisUtil.exists("DISTRICTALL")){
String str=redisUtil.getMessage("DISTRICTALL");
JsonNode jsonNode = mapper.readTree(str);
return Result.success(CodeEnum.SUCCESS, jsonNode);
}else {
String districtJson = LocationUtils.district("100000","2");//中国
JsonNode jsonNode = mapper.readTree(districtJson);
JsonNode districts = jsonNode.get("districts");
List<DistrictVo> cityInfoList = mapper.readValue(districts.get(0).get("districts").toString(), mapper.getTypeFactory().constructCollectionType(List.class, DistrictVo.class));
Collections.sort(cityInfoList, (o1, o2) -> o1.getNameAsPY().compareTo(o2.getNameAsPY()));
redisUtil.saveMessage("DISTRICTALL",mapper.writeValueAsString(cityInfoList),7*24*3600L);
return Result.success(CodeEnum.SUCCESS, cityInfoList);
}
}
/**
* 行政区域查询
*
* @param keywords citycode市、adcode区
* @return
*/
@GetMapping("location/district")
public Result district(String keywords) throws JsonProcessingException {
String districtJson = LocationUtils.district(keywords,null);
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonNode = mapper.readTree(districtJson);
JsonNode districts = jsonNode.get("districts");
String text = districts.toString();
List<DistrictVo> cityInfoList = mapper.readValue(text, mapper.getTypeFactory().constructCollectionType(List.class, DistrictVo.class));
DistrictVo allCity = new DistrictVo();
allCity.setName("全城");
cityInfoList.add(0, allCity);
return Result.success(CodeEnum.SUCCESS, cityInfoList);
}
@GetMapping("location/geocode")
public Result geocode(@RequestParam String lat, @RequestParam String lng) {
String address="108.939645,34.343207";
if (!StringUtils.isBlank(lat) && !StringUtils.isBlank(lng)) {
address=lng + "," + lat;
}
return Result.success(CodeEnum.SUCCESS, LocationUtils.geocode(address));
}
@GetMapping("location/getGPSByIp")
public Result getGPSByIp(String ip) throws JsonProcessingException {
String gpsInfo = LocationUtils.getGPSByIp(ip);
ObjectMapper mapper = new ObjectMapper();
JsonNode jsonNode = mapper.readTree(gpsInfo);
return Result.success(CodeEnum.SUCCESS, jsonNode);
}
@RequestMapping("common/upload")
public Result upload(MultipartFile file) throws Exception {
return new Result(CodeEnum.SUCCESS, fileService.uploadFile(file));
}
// 检查手机号格式是否正确的方法
private boolean isValidPhoneNumber(String phone) {
return phone.matches("^1[3-9]\\d{9}$");
}
// 检查手机号请求次数是否超出限制的方法
public Result isRequestLimit(String phone) {
Object count = redisUtil.getMessage(RedisCst.PHONE_LIMIT + phone);
if (count != null && Integer.valueOf(count.toString()) >= 5) {
return Result.fail("请求次数超出限制!,请半小时后重试");
}
long time = redisUtil.getRemainingTime(phone);
if (time > 0) {
return Result.fail("" + time + "秒后重试");
}
refreshPhoneLimit(phone,count != null);
return Result.success(CodeEnum.SUCCESS);
}
// 从 Redis 中获取手机号码的请求次数的方法
@Async
public void refreshPhoneLimit(String phone,boolean isExist) {
if (isExist) {
phoneRequestrinc(RedisCst.PHONE_LIMIT + phone);
} else {
phoneRequestset(RedisCst.PHONE_LIMIT + phone);
}
}
/**
* 存储手机号和请求次数的对应关系 时间 半小时
*/
public void phoneRequestset(String key) {
// 使用 Hash 结构存储手机号和请求次数的对应关系 时间 半小时
redisUtil.saveMessage(key, "1", 60*30L);
}
/**
* 将手机号码的请求次数加1
*/
public void phoneRequestrinc(String key) {
// 将手机号码的请求次数加1
redisUtil.getIncrNum(key, "2");
}
}

View File

@@ -0,0 +1,91 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.entity.TbGroupOrderInfo;
import com.chaozhanggui.system.cashierservice.entity.dto.CreateGroupOrderDto;
import com.chaozhanggui.system.cashierservice.entity.dto.GroupOrderDto;
import com.chaozhanggui.system.cashierservice.service.GroupOrderCouponService;
import com.chaozhanggui.system.cashierservice.service.GroupOrderInfoService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 团购卷订单
*
* @author ww
* @since 2024-04-27 16:15:08
*/
@RestController
@RequestMapping("groupOrderInfo")
public class GroupOrderInfoController {
@Resource
private GroupOrderInfoService tbGroupOrderInfoService;
@Resource
private GroupOrderCouponService orderCouponService;
/**
* 分页查询
*
* @param param 筛选条件
* @return 查询结果
*/
@RequestMapping("list")
public Result queryByPage(@RequestHeader String token, GroupOrderDto param) {
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
param.setUserId(userId);
return tbGroupOrderInfoService.queryByPage(param);
}
/**
* 通过id查询卷码
*/
@RequestMapping("getCoupon")
public Result queryCouponById(Integer id) {
return Result.success(CodeEnum.SUCCESS,orderCouponService.queryNoRefundByOrderId(id));
}
/**
* 团购卷 下单
* @param token
* @param param
* @return
*/
@PostMapping("/creatGroupOrder")
public Result createOrder(@RequestHeader String token,@RequestBody CreateGroupOrderDto param){
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
String phone = TokenUtil.parseParamFromToken(token).getString("phone");
param.setUserId(Integer.valueOf(userId));
param.setPhone(phone);
return tbGroupOrderInfoService.insert(param);
}
/**
* 通过主键查询单条数据
*
* @param id 主键
* @return 单条数据
*/
@RequestMapping("get")
public Result queryById(Integer id,String lng,String lat) {
return tbGroupOrderInfoService.queryById(id,lng,lat);
}
/**
* 编辑数据
*
* @param tbGroupOrderInfo 实体
* @return 编辑结果
*/
@RequestMapping("edit")
public Result edit(TbGroupOrderInfo tbGroupOrderInfo) {
return tbGroupOrderInfoService.update(tbGroupOrderInfo);
}
}

View File

@@ -20,12 +20,13 @@ public class HomeController {
@Resource
private HomePageService homePageService;
@PostMapping
public Result homePage(@RequestBody HomeDto homeDto,@RequestHeader("environment") String environmen)throws Exception{
return homePageService.homePage(homeDto, environmen);
}
@PostMapping("/homePageUp")
public Result homePageUp(@RequestHeader("environment") String environment){
return homePageService.homePageUp(environment);
}
@PostMapping
public Result homePage(@RequestBody HomeDto homeDto)throws Exception{
return homePageService.proList(homeDto);
}
}

View File

@@ -0,0 +1,61 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.entity.dto.ComShopDto;
import com.chaozhanggui.system.cashierservice.entity.dto.HomeBaseDto;
import com.chaozhanggui.system.cashierservice.entity.dto.HomeDto;
import com.chaozhanggui.system.cashierservice.service.HomeDistrictService;
import com.chaozhanggui.system.cashierservice.sign.Result;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 首页其它接口
*/
@RestController
@RequestMapping("/distirict")
@RequiredArgsConstructor
public class HomeDistrictController {
@Resource
private HomeDistrictService districtService;
/**
* 顶部图/菜单
*/
@RequestMapping("/topCommon")
public Result topCommon(HomeDto param,@RequestHeader("environment") String environment){
return districtService.topCommon(param,environment);
}
/**
* 预约到店(店铺列表)
*/
@RequestMapping("/subShopList")
public Result subShopList(HomeBaseDto param){
return districtService.queryShopListByPage(param);
}
/**
* 品类
*
* 今日上新
* 热榜推荐
* 咖啡饮品
*/
@RequestMapping("/productCate")
public Result productCate(HomeDto param){
return districtService.proList(param);
}
/**
* 通用门店
*/
@RequestMapping("/comShopList")
public Result comShopList(ComShopDto param){
return districtService.queryComShopList(param);
}
}

View File

@@ -1,37 +0,0 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.LocationUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
@CrossOrigin(origins = "*")
@RestController
@Slf4j
@RequestMapping("/location")
public class LocationController {
/**
* 行政区域查询
*
* @param keywords citycode市、adcode区
* @return
*/
@GetMapping("/district")
public Result createOrder(String keywords) throws JsonProcessingException {
String district = LocationUtils.district(keywords);
ObjectMapper mapper = new ObjectMapper();
// 将 JSON 字符串解析为 JsonNode 对象
JsonNode jsonNode = mapper.readTree(district);
JsonNode districts = jsonNode.get("districts");
return Result.success(CodeEnum.SUCCESS, districts);
}
}

View File

@@ -6,18 +6,17 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.dao.TbMerchantAccountMapper;
import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount;
import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
import com.chaozhanggui.system.cashierservice.entity.dto.AuthUserDto;
import com.chaozhanggui.system.cashierservice.entity.dto.OnlineUserDto;
import com.chaozhanggui.system.cashierservice.entity.dto.UserPassDto;
import com.chaozhanggui.system.cashierservice.redis.RedisCst;
import com.chaozhanggui.system.cashierservice.redis.RedisUtil;
import com.chaozhanggui.system.cashierservice.service.LoginService;
import com.chaozhanggui.system.cashierservice.service.OnlineUserService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.IpUtil;
import com.chaozhanggui.system.cashierservice.util.MD5Utils;
import com.chaozhanggui.system.cashierservice.util.StringUtil;
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import com.chaozhanggui.system.cashierservice.util.*;
import com.chaozhanggui.system.cashierservice.wxUtil.WechatUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
@@ -61,7 +60,7 @@ public class LoginContoller {
RedisUtil redisUtil;
@RequestMapping("/wx/business/login")
// @RequestMapping("/wx/business/login")
public Result wxBusinessLogin(@RequestParam(value = "code", required = false) String code,
@RequestParam(value = "rawData", required = false) String rawData,
@RequestParam(value = "signature", required = false) String signature
@@ -89,33 +88,28 @@ public class LoginContoller {
}
/**
* 小程序登录
*
* @param request
* @param map
* @return
*/
@RequestMapping("/wx/custom/login")
public Result wxCustomLogin(HttpServletRequest request, @RequestBody Map<String, String> map
// ,
// @RequestParam(value = "rawData", required = false) String rawData,
// @RequestParam(value = "signature", required = false) String signature
) {
if (ObjectUtil.isNull(map) || ObjectUtil.isEmpty(map) || !map.containsKey("code") || ObjectUtil.isEmpty(map.get("code"))) {
Result.fail("code不能为空");
}
String code = map.get("code").toString();
String qrCode = map.get("qrCode");
String rawData = map.get("rawData");
String signature = map.get("signature");
String encryptedData = map.get("encryptedData");
String ivStr = map.get("iv");
String phone = map.get("phone");
// String phone = map.get("phone");
// 用户非敏感信息rawData
// 签名signature
JSONObject rawDataJson = JSON.parseObject(rawData);
@@ -131,12 +125,19 @@ public class LoginContoller {
if (!signature.equals(signature2)) {
return Result.fail("签名校验失败");
}
String phone = "";
try{
String data = WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr);
if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
phone =JSONObject.parseObject(data).get("phoneNumber").toString();
}
}catch (Exception e){
log.info("登录传参:获取手机号失败{}",e.getMessage());
}
String nickName = rawDataJson.getString("nickName");
String avatarUrl = rawDataJson.getString("avatarUrl");
try {
return loginService.wxCustomLogin(openid, avatarUrl, nickName, phone, qrCode, IpUtil.getIpAddr(request));
return loginService.wxCustomLogin(openid, avatarUrl, nickName, phone, IpUtil.getIpAddr(request));
} catch (Exception e) {
e.printStackTrace();
}
@@ -146,7 +147,13 @@ public class LoginContoller {
}
@RequestMapping("getPhoneNumber")
/**
* 小程序获取手机号
*
* @param map
* @return
*/
// @RequestMapping("getPhoneNumber")
public Result getPhoneNumber(@RequestBody Map<String, String> map) {
if (ObjectUtil.isNull(map) || ObjectUtil.isEmpty(map) || !map.containsKey("code") || ObjectUtil.isEmpty(map.get("code"))) {
@@ -157,19 +164,24 @@ public class LoginContoller {
String encryptedData = map.get("encryptedData");
String ivStr = map.get("iv");
if (StringUtils.isBlank(encryptedData) || StringUtils.isBlank(ivStr)) {
return Result.fail("请授权后使用");
}
JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(code, customAppId, customSecrete);
// 3.接收微信接口服务 获取返回的参数
String openid = SessionKeyOpenId.getString("openid");
String sessionKey = SessionKeyOpenId.getString("session_key");
String data = WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr);
if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
return Result.success(CodeEnum.SUCCESS, JSONObject.parseObject(data).get("phoneNumber"));
try {
if (ObjectUtil.isNotEmpty(data) && JSONObject.parseObject(data).containsKey("phoneNumber")) {
log.info("登录传参 获取手机号成功 sessionKey:{}\n encryptedData:{} \nivStr:{} \n data:{},",sessionKey,encryptedData,ivStr,JSONObject.parseObject(data).get("phoneNumber"));
return Result.success(CodeEnum.SUCCESS, JSONObject.parseObject(data).get("phoneNumber"));
}
} catch (Exception e){
log.info("登录传参 获取手机号失败 sessionKey:{}\n encryptedData:{} \nivStr:{} \n data:{},",sessionKey,encryptedData,ivStr,data);
}
return Result.fail("获取手机号失败");
return Result.fail("获取手机号失败,请重试!");
}
@Resource
@@ -191,6 +203,7 @@ public class LoginContoller {
//生成token
String token = StringUtil.genRandomNum(6) + StringUtil.getBillno() + StringUtil.genRandomNum(6);
//存入redis
OnlineUserDto jwtUserDto = onlineUserService.save(merchantAccount.getName(), merchantAccount.getAccount(), Integer.valueOf(merchantAccount.getShopId()), token, merchantAccount.getStatus());
@@ -211,17 +224,71 @@ public class LoginContoller {
* @param id
* @return
*/
@RequestMapping("createCardNo")
public Result createCardNo(@RequestHeader("openId") String openId, @RequestHeader("token") String token, @RequestHeader("id") String id) {
return loginService.createCardNo(id, openId);
@GetMapping("createCardNo")
public Result createCardNo(@RequestHeader("openId") String openId, @RequestHeader("token") String token, @RequestHeader("id") String id,
@RequestParam("shopId") String shopId
) {
return loginService.createCardNo(id, openId,shopId);
}
@GetMapping("/wx/userInfo")
public Result userInfo(@RequestParam("userId") Integer userId, @RequestParam("shopId") String shopId) {
return loginService.userInfo(userId, shopId);
@GetMapping("/userInfo")
public Result userInfo(@RequestParam("userId") Integer userId) {
return loginService.userInfo(userId);
}
/**
* 更新用户信息
* @param token
* @param userInfo
* @return
*/
@PostMapping("/upUserInfo")
public Result userInfo(@RequestHeader String token, @RequestBody TbUserInfo userInfo) {
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
userInfo.setId(Integer.valueOf(userId));
userInfo.setUpdatedAt(System.currentTimeMillis());
return loginService.upUserInfo(userInfo);
}
@PostMapping(value = "/upPass")
public Result upPass(@RequestHeader String token,@RequestBody UserPassDto passVo){
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
String newPass = MD5Utils.MD5Encode(passVo.getNewPass(), "utf-8");
if (ObjectUtil.isNull(passVo.getCode())) {
String oldPass = MD5Utils.MD5Encode(passVo.getOldPass(), "utf-8");
return loginService.upPass(userId,oldPass, newPass);
} else {
boolean tf = loginService.validate(passVo.getCode(), passVo.getPhone());
if (tf) {
TbUserInfo userInfo=new TbUserInfo();
userInfo.setId(Integer.valueOf(userId));
userInfo.setPassword(newPass);
return loginService.upUserInfo(userInfo);
} else {
return Result.fail("验证码输入有误");
}
}
}
@PostMapping(value = "modityPass")
public Result modityPass(@RequestHeader String token,@RequestBody UserPassDto passVo){
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
String newPass = MD5Utils.MD5Encode(passVo.getNewPass(), "utf-8");
if (ObjectUtil.isNull(passVo.getCode())) {
String oldPass = MD5Utils.MD5Encode(passVo.getOldPass(), "utf-8");
return loginService.upPass(userId,oldPass, newPass);
} else {
boolean tf = loginService.validate(passVo.getCode(), passVo.getPhone());
if (tf) {
TbUserInfo userInfo=new TbUserInfo();
userInfo.setId(Integer.valueOf(userId));
userInfo.setPassword(newPass);
return loginService.upUserInfo(userInfo);
} else {
return Result.fail("验证码输入有误");
}
}
}
/**
* 用户注册
* phone 手机号
@@ -244,40 +311,82 @@ public class LoginContoller {
/**
* App登录用户端的请求接口 登录即注册
* 查看 {@link com.chaozhanggui.system.cashierservice.entity.dto.AuthUserDto}
* username 手机号
* password 密码登录时使用
* code 验证码登录时使用
* username 手机号
* password 密码登录时使用
* code 验证码登录时使用
*
* @return
*/
@PostMapping("/app/login")
public Result applogin(@RequestBody AuthUserDto authUserDto) {
boolean tf = false;
JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(authUserDto.getOpencode(), customAppId, customSecrete);
// 3.接收微信接口服务 获取返回的参数
String openid = SessionKeyOpenId.getString("openid");
if (ObjectUtil.isNull(authUserDto.getCode())) {
if(StringUtils.isBlank(authUserDto.getPassword())){
if (StringUtils.isBlank(authUserDto.getPassword())) {
return Result.fail("请输入密码,或使用验证码登录");
}
//验证密码
String mdPasswordString = MD5Utils.MD5Encode(authUserDto.getPassword(), "utf-8");
return loginService.appLogin(authUserDto.getUsername(), mdPasswordString);
return loginService.appLogin(authUserDto.getUsername(),openid, mdPasswordString);
} else {
boolean tf = loginService.validate(authUserDto.getCode(), authUserDto.getUsername());
// tf = true;
tf = loginService.validate(authUserDto.getCode(), authUserDto.getUsername());
if (tf) {
return loginService.appLogin(authUserDto.getUsername(), null);
return loginService.appLogin(authUserDto.getUsername(),openid, null);
} else {
return Result.fail("验证码输入有误");
}
}
}
//退出登录的接口
/**
* APP退出登录
*
* @return
* @header token
*/
@PostMapping("/loginOut")
public Result loginOut(HttpServletRequest request) {
String token = request.getHeader("token");
public Result loginOut(@RequestHeader String token, @RequestHeader String environment, HttpServletRequest request) {
//获取当前登录人的账号
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
redisUtil.deleteByKey(RedisCst.ONLINE_APP_USER.concat(userId));
if (environment.equals("wx")) {
String openId = request.getHeader("openId");
redisUtil.deleteByKey(RedisCst.ONLINE_USER.concat(openId));
} else if (environment.equals("app")) {
redisUtil.deleteByKey(RedisCst.ONLINE_APP_USER.concat(userId));
}
return Result.success(CodeEnum.SUCCESS);
}
/**
* 重置资金密码
* @param token
* @param map
* @return
*/
@RequestMapping("resetPwd")
public Result resetPwd(@RequestHeader String token,@RequestBody Map<String, Object> map){
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
return loginService.resetPwd(userId,map);
}
/**
* 修改密码
* @param token
* @param map
* @return
*/
@RequestMapping("mpdifyPwd")
public Result mpdifyPwd(@RequestHeader String token,@RequestBody Map<String, Object> map){
String userId = TokenUtil.parseParamFromToken(token).getString("userId");
return loginService.modifyPwd(userId,map);
}
}

View File

@@ -6,15 +6,15 @@ import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.chaozhanggui.system.cashierservice.interceptor.RequestWrapper;
import com.chaozhanggui.system.cashierservice.service.PayService;
import com.chaozhanggui.system.cashierservice.util.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.Map;
import java.util.Random;
@CrossOrigin(origins = "*")
@RestController
@@ -30,21 +30,47 @@ public class NotifyController {
@RequestMapping("memberInCallBack")
public String memberInCallBack(HttpServletRequest request){
public String memberInCallBack(HttpServletRequest request) {
Map<String, Object> map= getParameterMap(request);
log.info("回调返回信息:{}",JSONUtil.toJsonStr(map));
if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"200".equals(map.get("code")+"")){
JSONObject object=JSONUtil.parseObj(map.get("data"));
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("status")&&"1".equals(object.getStr("status"))){
String orderNo=object.getStr("orderNumber");
String channelTradeNo=object.getStr("channelTradeNo");
return payService.minsuccess(orderNo,channelTradeNo);
Map<String, Object> map = getParameterMap(request);
log.info("回调返回信息:{}", JSONUtil.toJsonStr(map));
if (ObjectUtil.isNotEmpty(map) && map.containsKey("code") && "200".equals(map.get("code") + "")) {
JSONObject object = JSONUtil.parseObj(map.get("data"));
if (ObjectUtil.isNotEmpty(object) && object.containsKey("status") && "1".equals(object.getStr("status"))) {
String orderNo = object.getStr("orderNumber");
String channelTradeNo = object.getStr("channelTradeNo");
return payService.minsuccess(orderNo, channelTradeNo);
}
}
return null;
}
@RequestMapping("fstmemberInCallBack")
public String fstmemberInCallBack(HttpServletRequest request){
Map<String, Object> map= getParameterMap(request);
log.info("fstmemberInCallBack回调返回信息:{}",JSONUtil.toJsonStr(map));
if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"000000".equals(map.get("code")+"")){
// Map<String,Object> object=(Map)map.get("bizData");
JSONObject object=JSONUtil.parseObj(map.get("bizData").toString());
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("state")){
if("TRADE_SUCCESS".equals(object.get("state").toString())){
String orderNo=object.get("mchOrderNo").toString();
String tradeNo=object.get("payOrderId").toString();
return payService.fstMemberInSuccess(orderNo,tradeNo);
}
}
}
return null;
}
@RequestMapping("test")
public void test(@RequestParam String payOrderNO){
payService.test(payOrderNO);
}
@RequestMapping("notifyCallBack")
public String notifyCallBack(HttpServletRequest request){
@@ -62,13 +88,64 @@ public class NotifyController {
}
@RequestMapping("notifyfstCallBack")
public String notifyfstCallBack(HttpServletRequest request){
private Map<String, Object> getParameterMap(HttpServletRequest request) {
Map<String, Object> map= getParameterMap(request);
log.info("notifyfstCallBack回调返回信息:{}",JSONUtil.toJsonStr(map));
if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"000000".equals(map.get("code")+"")){
JSONObject object=JSONUtil.parseObj(map.get("bizData").toString());
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("state")){
if("TRADE_SUCCESS".equals(object.get("state").toString())){
String orderNo=object.get("mchOrderNo").toString();
String tradeNo=object.get("payOrderId").toString();
return payService.callBackPayFST(tradeNo);
}
}
}
return null;
}
@RequestMapping("notifyCallBackGroupYsk")
public String notifyCallBackGroupYsk(HttpServletRequest request){
Map<String, Object> map= getParameterMap(request);
log.info("团购卷回调返回信息:{}",JSONUtil.toJsonStr(map));
if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"200".equals(map.get("code")+"")){
JSONObject object=JSONUtil.parseObj(map.get("data"));
if(ObjectUtil.isNotEmpty(object)&&object.containsKey("status")&&"1".equals(object.getStr("status"))){
String orderNo=object.getStr("orderNumber");
String payTime = object.getStr("payTime");
return payService.callBackGroupPay(orderNo,payTime);
}
}
return null;
}
@RequestMapping("notifyCallBackGroup")
public String notifyCallBackGroup(HttpServletRequest request) {
Map<String, Object> map = getParameterMap(request);
log.info("团购卷回调返回信息:{}", JSONUtil.toJsonStr(map));
if (ObjectUtil.isNotEmpty(map) && map.containsKey("code") && "000000".equals(map.get("code") + "")) {
JSONObject object = JSONUtil.parseObj(map.get("bizData"));
if (ObjectUtil.isNotEmpty(object) && object.containsKey("state") && "TRADE_SUCCESS".equals(object.getStr("state"))) {
String orderNo = object.getStr("payOrderId");
return payService.callBackGroupPay(orderNo, DateUtils.getTime(new Date()));
}
}
return null;
}
private Map getParameterMap(HttpServletRequest request) {
RequestWrapper requestWrapper = new RequestWrapper(request);
String body = requestWrapper.getBody();
if (ObjectUtil.isNotEmpty(body)) {
return JSONUtil.toBean(body, Map.class);
}else {
Map<String, String[]> parameterMap = request.getParameterMap();
return parameterMap;
}
return null;
}
}

View File

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.IOException;
import java.text.ParseException;
@CrossOrigin(origins = "*")
@RestController
@@ -37,7 +38,10 @@ public class OrderController {
* @return
*/
@GetMapping ("/orderInfo")
private Result orderInfo(@RequestParam Integer orderId){
private Result orderInfo(@RequestParam(required = false) Integer orderId){
if (orderId==null) {
return Result.fail("请返回首页订单列表查看");
}
return orderService.orderInfo(orderId);
}
@@ -50,4 +54,55 @@ public class OrderController {
private void testMessage(@RequestParam("tableId") String tableId, @RequestParam("message") String message) throws IOException {
orderService.testMessage(tableId,message);
}
@GetMapping("/tradeIntegral")
private Result tradeIntegral(@RequestParam("userId") String userId, @RequestParam("id") String id) throws IOException, ParseException {
return orderService.tradeIntegral(userId,id);
}
// @GetMapping("/我的积分")
// private Result mineYhq(@RequestParam("userId") String userId) throws IOException {
// return orderService.mineYhq(userId);
// }
@GetMapping("/mineCoupons")
private Result mineCoupons(@RequestHeader String token,
@RequestParam("userId") String userId,
@RequestParam("status") String status,
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size,
@RequestParam("orderId") String orderId
) throws IOException {
return orderService.mineCoupons(userId,orderId,status,page,size);
}
@GetMapping("/findCoupons")
private Result findCoupons(@RequestHeader String token,String type,
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size) throws IOException {
return orderService.findCoupons(type,page,size);
}
@GetMapping("/findWiningUser")
private Result findWiningUser(){
return orderService.findWiningUser();
}
@GetMapping("/mineWinner")
private Result mineWinner(@RequestHeader String token,@RequestParam Integer userId,
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size){
return orderService.mineWinner(userId,page,size);
}
@GetMapping("/getYhqPara")
private Result getYhqPara(){
return orderService.getYhqPara();
}
@GetMapping("/getYhqDouble")
private Result getYhqDouble(@RequestParam Integer orderId){
return orderService.getYhqDouble(orderId);
}
@PostMapping("/yhqDouble")
private Result yhqDouble(@RequestParam Integer conponsId){
return orderService.yhqDouble(conponsId);
}
@GetMapping("/kc")
private Result kc(){
return orderService.kc();
}
}

View File

@@ -1,12 +1,14 @@
package com.chaozhanggui.system.cashierservice.controller;
import cn.hutool.core.util.ObjectUtil;
import com.chaozhanggui.system.cashierservice.annotation.LimitSubmit;
import com.chaozhanggui.system.cashierservice.service.PayService;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.IpUtil;
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
@@ -26,19 +28,20 @@ public class PayController {
/**
* 支付
* @param request
* @param openId
*
* @param request payType wechatPay:微信支付aliPay:支付宝支付;
* @param map
* @return
*/
@RequestMapping("orderPay")
public Result pay(HttpServletRequest request, @RequestHeader("openId") String openId, @RequestBody Map<String,String> map) {
if(ObjectUtil.isEmpty(map)||map.size()<=0||!map.containsKey("orderId")||ObjectUtil.isEmpty(map.get("orderId"))){
@LimitSubmit(key = "orderPay:%s")
public Result pay(HttpServletRequest request, @RequestHeader("openId") String openId, @RequestBody Map<String, String> map) {
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("orderId") || ObjectUtil.isEmpty(map.get("orderId"))) {
return Result.fail("订单号不允许为空");
}
try {
return payService.payOrder(openId,map.get("orderId").toString(), IpUtil.getIpAddr(request));
return payService.payOrder(openId, map.get("orderId"), IpUtil.getIpAddr(request));
} catch (Exception e) {
e.printStackTrace();
}
@@ -46,14 +49,67 @@ public class PayController {
}
/**
* 储值卡支付
*
* @param token
* @param orderId
* @param memberId
* @return
*/
@GetMapping("accountPay")
public Result accountPay(@RequestHeader("token") String token,
@RequestParam("orderId") String orderId,
@RequestParam("memberId") String memberId,
@RequestParam("pwd") String pwd
) {
return payService.accountPay(orderId, memberId, token,pwd);
}
@RequestMapping("groupOrderPay")
public Result groupOrderPay(HttpServletRequest request, @RequestHeader String environment, @RequestHeader String token, @RequestBody Map<String, String> map) {
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("orderId") || ObjectUtil.isEmpty(map.get("orderId"))) {
return Result.fail("订单号不允许为空");
}
String orderId = map.get("orderId");
// String orderType = map.get("orderType").toString();
String payType = map.get("payType");
String userId = "";
if (environment.equals("wx") && payType.equals("wechatPay")) {
userId = TokenUtil.parseParamFromToken(token).getString("openId");
} else {
userId = TokenUtil.parseParamFromToken(token).getString("userId");
}
//订单支付 orderId:62,payType=wechatPay,userId:or1l860rwM-rU_j9KrgMOwued
log.info("订单支付 orderId:{},payType={},userId:{}", orderId, payType, userId);
try {
return payService.groupOrderPay(orderId, payType, userId, IpUtil.getIpAddr(request), map.get("pwd"));
} catch (Exception e) {
e.printStackTrace();
}
return Result.fail("支付失败");
}
//
// public Result memberAccountPay(@RequestHeader("openId") String openId,
// @RequestParam("orderId") String orderId,
// @RequestParam("userId") Integer userId,
// @RequestParam("shopId") String shopId,
// @RequestParam("pwd") String pwd
// ){
//
// }
/**
* 修改订单状态
*
* @param map
* @return
*/
@RequestMapping("modfiyOrderInfo")
public Result modfiyOrderInfo( @RequestBody Map<String,String> map){
if(ObjectUtil.isEmpty(map)||map.size()<=0||!map.containsKey("orderId")||ObjectUtil.isEmpty(map.get("orderId"))){
public Result modfiyOrderInfo(@RequestBody Map<String, String> map) {
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("orderId") || ObjectUtil.isEmpty(map.get("orderId"))) {
return Result.fail("订单号不允许为空");
}
@@ -66,25 +122,53 @@ public class PayController {
}
@RequestMapping("getActive")
public Result getActive(
@RequestHeader("token") String token,
@RequestParam("shopId") String shopId,
@RequestParam("page") int page,
@RequestParam("pageSize") int pageSize) {
return payService.getActivate(shopId, page, pageSize);
}
/**
* 充值
*
* @param request
* @param openId
* @param map
* @return
*/
@RequestMapping("memeberIn")
public Result memeberIn(HttpServletRequest request,@RequestHeader("openId") String openId,@RequestHeader("id") String id,
@RequestBody Map<String,Object> map
){
return payService.memberIn(openId,id,map.get("amount").toString(),map.get("shopId").toString(),IpUtil.getIpAddr(request));
@LimitSubmit(key = "memeberIn:%s")
public Result memeberIn(HttpServletRequest request, @RequestHeader("openId") String openId, @RequestHeader("id") String id,
@RequestBody Map<String, Object> map
) {
try {
return payService.memberIn(openId, id, map.get("amount").toString(), map.get("shopId").toString(), IpUtil.getIpAddr(request));
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
@RequestMapping("getShopByMember")
public Result getShopByMember(@RequestHeader("token") String token,
@RequestParam("page") int page,
@RequestParam("pageSize") int pageSize,
@RequestParam("userId") String userId,
@RequestParam("shopId") String shopId
) {
return payService.getShopByMember(userId,shopId,page,pageSize);
}
@RequestMapping("queryMemberAccount")
public Result queryMemberAccount(@RequestParam("memberId") String memberId,
@RequestParam(value = "page", defaultValue = "1") int page,
@RequestParam(value = "pageSize", defaultValue = "10") int pageSize
) {
return payService.queryMemberAccount(memberId, page, pageSize);
}
}

View File

@@ -1,55 +0,0 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.exception.MsgException;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.RedisUtils;
import com.chaozhanggui.system.cashierservice.util.StringUtil;
import com.chaozhanggui.system.cashierservice.util.ValidateCodeUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;
/**
* @author lyf
*/
@RestController
@RequestMapping("/phoneValidateCode")
@RequiredArgsConstructor
public class PhoneValidateCodeController {
private final ValidateCodeUtil validateCodeUtil;
@Resource
private RedisUtils redisUtils;
/**
* 一分钟
*/
protected static final long ONE_MINUTE = 60;
/**
* 发送短信验证码
* @param phone
* @return
*/
@GetMapping
public Result verifyPhoneIsExist(@RequestParam String phone) {
if (StringUtils.isBlank(phone)) {
return Result.fail("手机号不可为空!");
}
String random = StringUtil.random(6);
validateCodeUtil.requestValidateCodeAli(phone, random);
//存入缓存
try {
redisUtils.set(phone,random,ONE_MINUTE,TimeUnit.SECONDS);
}catch (Exception e){
throw new MsgException("验证码发送失败");
}
return Result.success(CodeEnum.SUCCESS);
}
}

View File

@@ -2,9 +2,12 @@ package com.chaozhanggui.system.cashierservice.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.service.ProductService;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -20,25 +23,66 @@ public class ProductController {
@Autowired
private ProductService productService;
@RequestMapping("queryProduct")
public Result queryProduct(@RequestBody Map<String,String> map){
if(ObjectUtil.isEmpty(map)||map.size()<=0||!map.containsKey("code")){
return Result.fail("参数错误");
}
return productService.queryProduct(map.get("code").toString(),(map.containsKey("productGroupId")&&ObjectUtil.isNotEmpty(map.get("productGroupId")))?map.get("productGroupId").toString():"");
/**
* 通过桌码获取shopId
*
* @param code
* @return shopid
*/
@RequestMapping("queryShopIdByTableCode")
public Result queryShopIdByTableCode(
@RequestHeader("openId") String openId,
@RequestHeader("id") String userId,
@RequestParam("code") String code) {
return productService.queryShopIdByTableCode(userId, openId, code);
}
/**
* 通过code和分组Id
*
* @param map
* @return
*/
@RequestMapping("queryProduct")
public Result queryProduct(@RequestBody Map<String, String> map) {
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("code")) {
return Result.fail("参数错误");
}
return productService.queryProduct(
map.get("code").toString(),
(map.containsKey("productGroupId") && ObjectUtil.isNotEmpty(map.get("productGroupId"))) ? map.get("productGroupId").toString() : "");
}
@GetMapping("queryProductSku")
public Result queryProductSku(
@RequestParam("shopId") String shopId,
@RequestParam("productId") String productId,
@RequestParam("spec_tag") String spec_tag
){
return productService.queryProductSku(shopId,productId,spec_tag);
@RequestParam("shopId") String shopId,
@RequestParam("productId") String productId,
@RequestParam("spec_tag") String spec_tag
) {
return productService.queryProductSku(shopId, productId, spec_tag);
}
/**
* 团购商品详情/商品类型为 套餐商品
*/
@GetMapping("/productInfo")
public Result productInfo(
@RequestParam Integer productId,
@RequestParam String lat,
@RequestParam String lng,
@RequestHeader String environment) throws Exception {
return productService.productInfo(productId, lat, lng, environment);
}
/**
* 订单确认页
*/
@GetMapping("/orderConfirm")
public Result orderConfirm(
@RequestParam Integer productId,
@RequestHeader String environment) throws Exception {
return productService.orderConfirm(productId, environment);
}
}

View File

@@ -0,0 +1,151 @@
package com.chaozhanggui.system.cashierservice.controller;
import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.dao.TbMerchantAccountMapper;
import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
import com.chaozhanggui.system.cashierservice.dao.TbUserInfoMapper;
import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount;
import com.chaozhanggui.system.cashierservice.entity.TbShopUser;
import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
import com.chaozhanggui.system.cashierservice.entity.dto.AuthUserDto;
import com.chaozhanggui.system.cashierservice.entity.dto.OnlineUserDto;
import com.chaozhanggui.system.cashierservice.entity.vo.IntegralFlowVo;
import com.chaozhanggui.system.cashierservice.entity.vo.IntegralVo;
import com.chaozhanggui.system.cashierservice.entity.vo.OrderVo;
import com.chaozhanggui.system.cashierservice.service.LoginService;
import com.chaozhanggui.system.cashierservice.service.OnlineUserService;
import com.chaozhanggui.system.cashierservice.service.UserService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.IpUtil;
import com.chaozhanggui.system.cashierservice.util.MD5Utils;
import com.chaozhanggui.system.cashierservice.util.StringUtil;
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import com.chaozhanggui.system.cashierservice.wxUtil.WechatUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
@CrossOrigin(origins = "*")
@RestController
@Slf4j
@RequestMapping("user")
public class UserContoller {
@Autowired
UserService userService;
@Autowired
private TbShopUserMapper shopUserMapper;
@Autowired
private TbUserInfoMapper userInfoMapper;
// @GetMapping("/userInfo")
// public JSONObject userInfo(@RequestParam("openId") String openId ) throws Exception {
// TbUserInfo shopUser = userInfoMapper.selectByOpenId(openId);
// JSONObject jsonObject = new JSONObject();
// if (Objects.isNull(shopUser)){
// jsonObject.put("status","fail");
// jsonObject.put("msg","用户不存在");
// return jsonObject;
// }
// String userSign = UUID.randomUUID().toString().replaceAll("-","");
// String token = TokenUtil.generateJfToken(openId,userSign);
// JSONObject object = new JSONObject();
// object.put("token",token);
// object.put("userSign",userSign);
// object.put("num",shopUser.getTotalScore());
// jsonObject.put("status","success");
// jsonObject.put("msg","成功");
// jsonObject.put("data",object);
// return jsonObject;
// }
@GetMapping("/shopUserInfo")
public Result shopUserInfo(@RequestParam("userId") String userId ,@RequestHeader("openId") String openId,@RequestParam("shopId") String shopId ) throws Exception {
TbShopUser shopUser=new TbShopUser();
if (StringUtils.isNotBlank(shopId) && !shopId.equals("null")) {
shopUser = shopUserMapper.selectByUserIdAndShopId(userId, shopId);
if (ObjectUtil.isEmpty(shopUser)) {
TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
shopUser = shopUserMapper.selectByPhoneAndShopId(tbUserInfo.getTelephone(), shopId);
if(ObjectUtil.isEmpty(shopUser)){
shopUser=new TbShopUser();
shopUser.setName(tbUserInfo.getNickName());
shopUser.setSex(tbUserInfo.getSex());
shopUser.setBirthDay(tbUserInfo.getBirthDay());
shopUser.setLevel(Byte.parseByte("1"));
String dynamicCode = RandomUtil.randomNumbers(8);
shopUser.setCode(dynamicCode);
shopUser.setTelephone(tbUserInfo.getTelephone());
shopUser.setAmount(BigDecimal.ZERO);
shopUser.setIsVip(Byte.parseByte("0"));
shopUser.setCreditAmount(BigDecimal.ZERO);
shopUser.setConsumeAmount(BigDecimal.ZERO);
shopUser.setConsumeNumber(0);
shopUser.setLevelConsume(BigDecimal.ZERO);
shopUser.setStatus(Byte.parseByte("1"));
shopUser.setShopId(shopId);
shopUser.setUserId(userId);
shopUser.setMiniOpenId(openId);
shopUser.setCreatedAt(System.currentTimeMillis());
shopUser.setUpdatedAt(System.currentTimeMillis());
shopUserMapper.insert(shopUser);
}else {
shopUser.setUserId(userId);
shopUser.setUpdatedAt(System.currentTimeMillis());
shopUserMapper.updateByPrimaryKey(shopUser);
}
}
}else {
shopUser.setAmount(BigDecimal.ZERO);
}
return Result.success(CodeEnum.SUCCESS,shopUser);
}
@GetMapping("/userCoupon")
public Result userCoupon(@RequestParam("userId") String userId ,@RequestParam("orderNum") BigDecimal orderNum ) throws Exception {
int num = userService.userCoupon(userId,orderNum);
return Result.success(CodeEnum.SUCCESS,num);
}
@PostMapping("/modityIntegral")
public JSONObject modityIntegral(@RequestHeader String token,@RequestBody IntegralVo integralVo ) throws Exception {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userSign = jsonObject.getString("userSign");
return userService.modityIntegral(integralVo,userSign);
}
@PostMapping("/userIntegral")
public JSONObject userIntegral(@RequestHeader String token,@RequestBody IntegralFlowVo integralFlowVo ) throws Exception {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userSign = jsonObject.getString("userSign");
return userService.userIntegral(integralFlowVo,userSign);
}
@PostMapping("/userAllIntegral")
public JSONObject userAllIntegral(@RequestBody IntegralFlowVo integralFlowVo ) throws Exception {
// JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
// String userSign = jsonObject.getString("userSign");
return userService.userAllIntegral(integralFlowVo,"userSign");
}
@PostMapping("/userAll")
public JSONObject userAll(@RequestBody IntegralFlowVo integralFlowVo ) throws Exception {
// JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
// String userSign = jsonObject.getString("userSign");
return userService.userAll(integralFlowVo,"userSign");
}
}

View File

@@ -1,27 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.SysDict;
import com.chaozhanggui.system.cashierservice.entity.SysDictDetail;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysDictDetailMapper {
int deleteByPrimaryKey(Long detailId);
int insert(SysDictDetail record);
int insertSelective(SysDictDetail record);
SysDictDetail selectByPrimaryKey(Long detailId);
List<SysDict> selectByAll();
List<SysDictDetail> selectByAllDetail(@Param("list") List<Long> dictId);
List<SysDictDetail> selectByDictId(@Param("dictId") Long dictId);
int updateByPrimaryKeySelective(SysDictDetail record);
int updateByPrimaryKey(SysDictDetail record);
}

View File

@@ -1,17 +1,14 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.SysDict;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface SysDictMapper {
int deleteByPrimaryKey(Long dictId);
List<SysDict> selectHot();
int insert(SysDict record);
List<SysDict> selectByType(@Param("type") String type);
int insertSelective(SysDict record);
SysDict selectByPrimaryKey(Long dictId);
int updateByPrimaryKeySelective(SysDict record);
int updateByPrimaryKey(SysDict record);
List<SysDict> selectByDictId(@Param("dictId") Long dictId);
}

View File

@@ -0,0 +1,22 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.vo.TagProductVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* (TagProductDepts) 商品标签 表数据库访问层
*
* @author lyf
* @since 2024-04-08 15:03:49
*/
@Component
@Mapper
public interface TagProductDeptsMapper {
List<TagProductVO> queryTagAndProduct(@Param("list") List<Integer> list);
List<TagProductVO> queryTagByProductId(@Param("productId") String productId);
}

View File

@@ -0,0 +1,29 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbActivate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
@Component
@Mapper
public interface TbActivateMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbActivate record);
int insertSelective(TbActivate record);
TbActivate selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbActivate record);
int updateByPrimaryKey(TbActivate record);
TbActivate selectByAmount(@Param("shopId") String shopId,@Param("amount") BigDecimal amount);
List<TbActivate> selectByShpopId(String shopId);
}

View File

@@ -20,8 +20,7 @@ public interface TbCashierCartMapper {
int updateByPrimaryKeySelective(TbCashierCart record);
int updateByPrimaryKey(TbCashierCart record);
List<TbCashierCart> selectByShopIdAndTableId(@Param("shopId") String shopId,@Param("tableId") String tableId);
List<TbCashierCart> selectALlByMasterId(@Param("masterId") String masterId, @Param("status") String status);
@@ -57,4 +56,5 @@ public interface TbCashierCartMapper {
List<TbCashierCart> selectByOrderId(@Param("orderId") String orderId,@Param("status") String status);
void updateStatusByTableId(@Param("tableId")String tableId,@Param("status") String status);
void updateStatusById(@Param("id")Integer id,@Param("status") String status);
}

View File

@@ -0,0 +1,20 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbCouponCategory;
/**
* 团购卷分类(TbCouponCategory)表数据库访问层
*
* @author ww
* @since 2024-04-24 14:09:16
*/
public interface TbCouponCategoryMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbCouponCategory queryById(Integer id);
}

View File

@@ -0,0 +1,72 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbGroupOrderCoupon;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* 团购卷 卷码表(TbGroupOrderCoupon)表数据库访问层
*
* @author ww
* @since 2024-05-06 14:39:59
*/
public interface TbGroupOrderCouponMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbGroupOrderCoupon queryById(Integer id);
List<TbGroupOrderCoupon> queryByOrderId(Integer orderId);
List<TbGroupOrderCoupon> queryNoRefundByOrderId(Integer orderId);
/**
* 查询数据
*
* @param tbGroupOrderCoupon 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbGroupOrderCoupon> queryAll(TbGroupOrderCoupon tbGroupOrderCoupon, @Param("pageable") Pageable pageable);
/**
* 新增数据
*
* @param tbGroupOrderCoupon 实例对象
* @return 影响行数
*/
int insert(TbGroupOrderCoupon tbGroupOrderCoupon);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbGroupOrderCoupon> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbGroupOrderCoupon> entities);
/**
* 修改数据
*
* @param tbGroupOrderCoupon 实例对象
* @return 影响行数
*/
int update(TbGroupOrderCoupon tbGroupOrderCoupon);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

@@ -0,0 +1,64 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbGroupOrderInfo;
import com.chaozhanggui.system.cashierservice.entity.dto.GroupOrderDto;
import com.chaozhanggui.system.cashierservice.entity.vo.GroupOrderListVo;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 团购卷订单(TbGroupOrderInfo)表数据库访问层
*
* @author ww
* @since 2024-04-27 16:15:08
*/
public interface TbGroupOrderInfoMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbGroupOrderInfo queryById(Integer id);
TbGroupOrderInfo selectByPayOrderNo(@Param("payOrderNO")String payOrderNO);
/**
* 查询数据
*
* @param param 查询条件
* @return 对象列表
*/
List<GroupOrderListVo> queryAll(GroupOrderDto param);
/**
* 新增数据
*
* @param tbGroupOrderInfo 实例对象
* @return 影响行数
*/
int insert(TbGroupOrderInfo tbGroupOrderInfo);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbGroupOrderInfo> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbGroupOrderInfo> entities);
/**
* 修改数据
*
* @param tbGroupOrderInfo 实例对象
* @return 影响行数
*/
int update(TbGroupOrderInfo tbGroupOrderInfo);
}

View File

@@ -0,0 +1,17 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbIntegralFlow;
public interface TbIntegralFlowMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbIntegralFlow record);
int insertSelective(TbIntegralFlow record);
TbIntegralFlow selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbIntegralFlow record);
int updateByPrimaryKey(TbIntegralFlow record);
}

View File

@@ -0,0 +1,23 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbIntegral;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
public interface TbIntegralMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbIntegral record);
int insertSelective(TbIntegral record);
TbIntegral selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbIntegral record);
int updateByPrimaryKey(TbIntegral record);
List<TbIntegral> selectAllByUserId(String userId);
}

View File

@@ -1,7 +1,11 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbMerchantAccountMapper {
TbMerchantAccount selectByAccount(String account);

View File

@@ -1,9 +1,8 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbMerchantCoupon;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
/**
* 优惠券(TbMerchantCoupon)表数据库访问层
@@ -11,6 +10,8 @@ import java.util.List;
* @author lyf
* @since 2024-04-02 09:24:16
*/
@Component
@Mapper
public interface TbMerchantCouponMapper {
/**
@@ -21,65 +22,7 @@ public interface TbMerchantCouponMapper {
*/
TbMerchantCoupon queryById(Integer id);
/**
* 查询指定行数据
*
* @param tbMerchantCoupon 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbMerchantCoupon> queryAllByLimit(TbMerchantCoupon tbMerchantCoupon, @Param("pageable") Pageable pageable);
List<TbMerchantCoupon> queryAllByPage(@Param("page")Integer page, @Param("size")Integer size);
/**
* 统计总行数
*
* @param tbMerchantCoupon 查询条件
* @return 总行数
*/
long count(TbMerchantCoupon tbMerchantCoupon);
/**
* 新增数据
*
* @param tbMerchantCoupon 实例对象
* @return 影响行数
*/
int insert(TbMerchantCoupon tbMerchantCoupon);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbMerchantCoupon> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbMerchantCoupon> entities);
/**
* 批量新增或按主键更新数据MyBatis原生foreach方法
*
* @param entities List<TbMerchantCoupon> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<TbMerchantCoupon> entities);
/**
* 修改数据
*
* @param tbMerchantCoupon 实例对象
* @return 影响行数
*/
int update(TbMerchantCoupon tbMerchantCoupon);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
@Component
@@ -28,9 +29,9 @@ public interface TbOrderInfoMapper {
List<TbOrderInfo> selectAllByStatus(String status);
TbOrderInfo selectByPayOrderNo(String payOrderNo);
List<TbOrderInfo> selectByUserId(@Param("userId")Integer userId, @Param("page")Integer page,
@Param("size")Integer size, @Param("status") String status);
List<TbOrderInfo> selectByUserId(@Param("userId")Integer userId, @Param("status") String status);
List<TbOrderInfo> selectByTradeDay(@Param("day") String day,@Param("minPrice") BigDecimal minPrice,@Param("maxPrice") BigDecimal maxPrice);
List<TbOrderInfo> selectWinnerByUserId(@Param("userId")Integer userId);
}

View File

@@ -0,0 +1,17 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbParams;
public interface TbParamsMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbParams record);
int insertSelective(TbParams record);
TbParams selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbParams record);
int updateByPrimaryKey(TbParams record);
}

View File

@@ -3,7 +3,6 @@ package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
@@ -22,64 +21,10 @@ public interface TbPlatformDictMapper {
*/
TbPlatformDict queryById(Integer id);
/**
* 查询指定行数据
*
* @param tbPlatformDict 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbPlatformDict> queryAllByLimit(TbPlatformDict tbPlatformDict, @Param("pageable") Pageable pageable);
List<TbPlatformDict> queryByIdList(@Param("idList")List<Integer> idList);
List<TbPlatformDict> queryAllByType(@Param("type") String type,@Param("environment") String environment);
/**
* 统计总行数
*
* @param tbPlatformDict 查询条件
* @return 总行数
*/
long count(TbPlatformDict tbPlatformDict);
/**
* 新增数据
*
* @param tbPlatformDict 实例对象
* @return 影响行数
*/
int insert(TbPlatformDict tbPlatformDict);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbPlatformDict> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbPlatformDict> entities);
/**
* 批量新增或按主键更新数据MyBatis原生foreach方法
*
* @param entities List<TbPlatformDict> 实例对象列表
* @return 影响行数
* @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常请自行校验入参
*/
int insertOrUpdateBatch(@Param("entities") List<TbPlatformDict> entities);
/**
* 修改数据
*
* @param tbPlatformDict 实例对象
* @return 影响行数
*/
int update(TbPlatformDict tbPlatformDict);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
List<TbPlatformDict> queryGroupByValue(@Param("value")String value,@Param("environment") String environment);
}

View File

@@ -27,5 +27,6 @@ public interface TbProductGroupMapper {
List<TbProductGroup> selectByIdAndShopId(@Param("code") String code);
List<TbProductGroup> selectByQrcode(@Param("qrCode") String qrCode,@Param("groupId") Integer groupId);
List<TbProductGroup> selectByShopId(@Param("shopId") String shopId,@Param("groupId") Integer groupId);
}

View File

@@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
import com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs;
import com.chaozhanggui.system.cashierservice.entity.vo.ShopGroupInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@@ -11,25 +12,26 @@ import java.util.List;
@Component
@Mapper
public interface TbProductMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbProductWithBLOBs record);
int insertSelective(TbProductWithBLOBs record);
TbProductWithBLOBs selectByPrimaryKey(Integer id);
TbProduct selectById(Integer id);
int updateByPrimaryKeySelective(TbProductWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(TbProductWithBLOBs record);
int updateByPrimaryKey(TbProduct record);
List<TbProduct> selectByIdIn(@Param("ids") String ids);
List<TbProduct> selectByIds(@Param("list") List<String> ids);
Integer selectByQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId);
Integer selectByNewQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId,@Param("list") List<String> list);
List<ShopGroupInfoVo> selGroups(@Param("proName") String proName,@Param("type") String type,
@Param("rightTopLng") Double rightTopLng, @Param("rightTopLat") Double rightTopLat,
@Param("leftBottomLng") Double leftBottomLng, @Param("leftBottomLat") Double leftBottomLat,
@Param("cities") String cities, @Param("orderBy") String orderBy, @Param("lng") String lng, @Param("lat") String lat);
List<ShopGroupInfoVo> selHotGroups(@Param("proName") String proName,@Param("type") String type,
@Param("startTime") String startTime, @Param("endTime") String endTime,
@Param("cities") String cities, @Param("orderBy") String orderBy, @Param("lng") String lng, @Param("lat") String lat);
void upGroupRealSalesNumber(@Param("id") String id,@Param("number") Integer number);
}

View File

@@ -38,4 +38,5 @@ public interface TbProductSkuMapper {
List<TbProductSku> selectDownSku(@Param("list") List<Integer> productId);
List<TbProductSku> selectSkus(@Param("list") List<String> productId);
List<TbProductSku> selectSku(@Param("productId") String productId);
}

View File

@@ -0,0 +1,30 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbPurchaseNotice;
/**
* 购买须知(关联tb_merchant_coupon)(TbPurchaseNotice)表数据库访问层
*
* @author ww
* @since 2024-04-11 10:00:23
*/
public interface TbPurchaseNoticeMapper {
/**
* 通过ID查询单条数据
*
* CouponId 主键
* @return 实例对象
*/
TbPurchaseNotice queryByCouponId(Integer id);
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbPurchaseNotice queryById(Integer id);
}

View File

@@ -0,0 +1,24 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbReleaseFlow;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface TbReleaseFlowMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbReleaseFlow record);
int insertSelective(TbReleaseFlow record);
TbReleaseFlow selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbReleaseFlow record);
int updateByPrimaryKey(TbReleaseFlow record);
List<TbReleaseFlow> selectByUserId(@Param("userId") String userId);
List<TbReleaseFlow> selectAll();
}

View File

@@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
import com.chaozhanggui.system.cashierservice.entity.vo.HomeVO;
import com.chaozhanggui.system.cashierservice.entity.vo.SubShopVo;
import com.chaozhanggui.system.cashierservice.entity.vo.UserDutyVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -18,7 +19,15 @@ public interface TbShopInfoMapper {
int insertSelective(TbShopInfo record);
List<SubShopVo> selShopInfoByGps(@Param("rightTopLng") Double rightTopLng, @Param("rightTopLat") Double rightTopLat,
@Param("leftBottomLng") Double leftBottomLng, @Param("leftBottomLat") Double leftBottomLat,
@Param("cities") String cities, @Param("lng") String lng, @Param("lat") String lat,
@Param("shopName")String shopName);
TbShopInfo selectByPrimaryKey(Integer id);
Integer selNumByChain(@Param("chainName") String chainName);
List<TbShopInfo> selectByIds(@Param("list") List<String> ids);
int updateByPrimaryKeySelective(TbShopInfo record);
@@ -31,7 +40,7 @@ public interface TbShopInfoMapper {
TbShopInfo selectByPhone(String phone);
List<HomeVO> selectShopInfo(@Param("page")Integer page, @Param("size")Integer size);
List<HomeVO> selectShopInfo(@Param("page") Integer page, @Param("size") Integer size);
List<UserDutyVo> searchUserDutyDetail(@Param("list") List<Integer> productId);
}

View File

@@ -1,7 +1,12 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbShopPayType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbShopPayTypeMapper {
int deleteByPrimaryKey(Integer id);
@@ -14,4 +19,6 @@ public interface TbShopPayTypeMapper {
int updateByPrimaryKeySelective(TbShopPayType record);
int updateByPrimaryKey(TbShopPayType record);
int countSelectByShopIdAndPayType(@Param("shopId") String shopId, @Param("payType") String payType );
}

View File

@@ -22,6 +22,9 @@ public interface TbShopTableMapper {
TbShopTable selectQRcode(String code);
String queryShopIdByTableCode(String code);
int upDateQrcodeNull(String code);
int updateByPrimaryKeySelective(TbShopTable record);
int updateByPrimaryKey(TbShopTable record);

View File

@@ -1,14 +1,10 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@Component
@Mapper
public interface TbShopUserFlowMapper {
int deleteByPrimaryKey(Integer id);
@@ -22,5 +18,6 @@ public interface TbShopUserFlowMapper {
int updateByPrimaryKey(TbShopUserFlow record);
List<Map<String,Object>> selectByMemberAccountFlow(String memberId);
}

View File

@@ -1,10 +1,15 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbParams;
import com.chaozhanggui.system.cashierservice.entity.TbShopUser;
import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@Component
@Mapper
public interface TbShopUserMapper {
@@ -15,14 +20,22 @@ public interface TbShopUserMapper {
int insertSelective(TbShopUser record);
TbShopUser selectByPrimaryKey(String id);
List<TbShopUser> selectByPhone(String phone);
int updateByPrimaryKeySelective(TbShopUser record);
int updateByPrimaryKey(TbShopUser record);
int upUserBYId(TbShopUser record);
TbShopUser selectByUserIdAndShopId(@Param("userId") String userId,@Param("shopId") String shopId);
TbShopUser selectByPhoneAndShopId(@Param("phone") String phone,@Param("shopId") String shopId);
List<TbShopUser> selectAllByUserId(@Param("userId") String userId);
TbShopUser selectByUserId(@Param("userId") String userId);
List<ShopUserListVo> selectByUserId(@Param("userId") String userId, @Param("shopId") String shopId);
TbShopUser selectByOpenId(@Param("openId") String openId);
TbParams selectParams();
}

View File

@@ -0,0 +1,32 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbShopVideo;
import java.util.List;
/**
* (TbShopVideo)表数据库访问层
*
* @author ww
* @since 2024-04-12 14:50:09
*/
public interface TbShopVideoMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbShopVideo queryById(Integer id);
/**
* 查询数据
*
* @param tbShopVideo 查询条件
* @return 对象列表
*/
List<TbShopVideo> queryAll(TbShopVideo tbShopVideo);
}

View File

@@ -0,0 +1,17 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbSplitAccounts;
public interface TbSplitAccountsMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbSplitAccounts record);
int insertSelective(TbSplitAccounts record);
TbSplitAccounts selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbSplitAccounts record);
int updateByPrimaryKey(TbSplitAccounts record);
}

View File

@@ -0,0 +1,25 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbSystemCoupons;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
public interface TbSystemCouponsMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbSystemCoupons record);
int insertSelective(TbSystemCoupons record);
TbSystemCoupons selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbSystemCoupons record);
int updateByPrimaryKey(TbSystemCoupons record);
List<TbSystemCoupons> selectAll(@Param("type") String type);
int selectByAmount(@Param("orderNum") BigDecimal orderNum);
}

View File

@@ -0,0 +1,31 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbUserCoupons;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
@Component
@Mapper
public interface TbUserCouponsMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbUserCoupons record);
int insertSelective(TbUserCoupons record);
TbUserCoupons selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbUserCoupons record);
int updateByPrimaryKey(TbUserCoupons record);
List<TbUserCoupons> selectByUserId(@Param("userId") String userId,@Param("status") String status,@Param("amount") BigDecimal amount);
TbUserCoupons selectByOrderId(@Param("orderId") Integer orderId);
int selectByUserIdAndAmount(@Param("userId") String userId, @Param("orderNum") BigDecimal orderNum);
}

View File

@@ -4,6 +4,8 @@ import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbUserInfoMapper {
@@ -22,14 +24,6 @@ public interface TbUserInfoMapper {
TbUserInfo selectByOpenId(String openId);
/**
* 通过手机号查询
* @param phone
* @param source 公众号 WECHAT 小程序 WECHAT-APP 手机注册 TELEPHONE 移动端 APP
* @return
*/
TbUserInfo selectUserByPhone(String phone,String source);
/**
* 查询来源为APP 未绑定微信用户的 用户数据
* @param phone
@@ -38,4 +32,5 @@ public interface TbUserInfoMapper {
TbUserInfo selectByPhone(String phone);
List<TbUserInfo> selectAll();
}

View File

@@ -0,0 +1,21 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbWiningParams;
import java.util.List;
public interface TbWiningParamsMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbWiningParams record);
int insertSelective(TbWiningParams record);
TbWiningParams selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbWiningParams record);
int updateByPrimaryKey(TbWiningParams record);
List<TbWiningParams> selectAll();
}

View File

@@ -0,0 +1,26 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbWiningUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbWiningUserMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbWiningUser record);
int insertSelective(TbWiningUser record);
TbWiningUser selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbWiningUser record);
int updateByPrimaryKey(TbWiningUser record);
List<TbWiningUser> selectAllByTrade(@Param("day") String day);
}

View File

@@ -0,0 +1,21 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbYhqParams;
import java.util.List;
public interface TbYhqParamsMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbYhqParams record);
int insertSelective(TbYhqParams record);
TbYhqParams selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbYhqParams record);
int updateByPrimaryKey(TbYhqParams record);
List<TbYhqParams> selectAll();
}

View File

@@ -0,0 +1,87 @@
package com.chaozhanggui.system.cashierservice.entity.Enum;
import com.github.pagehelper.util.StringUtil;
/**
* @author 12847
*/
public enum LogoEnum {
url1(1,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/IMG_0299.PNG"),
url2(2,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/ffaab08f6a62103593646bf36dbaa24c.jpeg"),
url3(3,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/fe6c4572004f9aa7716bff89c4c56783.jpeg"),
url4(4,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/fb56ef7c59d46835e6ff4b5c494aed5a.jpeg"),
url5(5,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/f8469a7760c7f584ab55e47b60cd3829.jpeg"),
url6(6,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/f73810e20530a70dd068e0e0a82677d4.jpeg"),
url7(7,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/f66361c48515ba9b2a03d9d72829d675.jpeg"),
url8(8,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/f2be456f85849922ba838e7eb4694272.jpeg"),
url9(9,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e9fca54f0320644291848338184b6c08.jpeg"),
url10(10,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e9e574fdedb43831801697a610603044.jpeg"),
url11(11,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e913ec3afe3520b9a638e16d298b401f.jpeg"),
url12(12,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e87d19da0cb5af9b53f485117b665cc9.jpeg"),
url13(13,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e847667f37d86dc4a48ffcf69bb1a964.jpeg"),
url14(14,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e731f8a883ab1ef2a71487f2eb5b0e38.jpeg"),
url15(15,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e681a9a281760f275f4b9d11c01a5869.jpeg"),
url16(16,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e41fa3916c86d43904a66d1174b81080.jpeg"),
url17(17,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e138425037e7ba3eded9ab828e3f39d2.jpeg"),
url18(18,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e0d4e933083418e6c4795fb6bf5db628.jpeg"),
url19(19,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/e07b1933b0ad75f428339ffc79ee4fef.jpeg"),
url20(20,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/d4ac63680f417b49210aa54cf6e03e77.jpeg"),
url21(21,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/d44a8bccd46f4fa6c340e825bba5c338.jpeg"),
url22(22,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/cd794c0c5dd3b212e7c46eaa7c3a85cc.jpeg"),
url23(23,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/ccf1f255cd30c2aed0b421213df01863.jpeg"),
url24(24,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/cbe7897bee2d057eaaeaa1604d5bd167.jpeg"),
url25(25,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/cae19ed2c2c1c749e388730ef1cbb596.jpeg"),
url26(26,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/c90a7e5d7a9a95a48dac8aecfab5c8e1.jpeg"),
url27(27,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/c72ec32dbb7c0a42ca6a0a483a0d99ab.jpeg"),
url28(28,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/c72ec32dbb7c0a42ca6a0a483a0d99ab.jpeg"),
url29(29,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/c451f57dde1fcbbe4afe5766184084da.jpeg"),
url30(30,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/a9a9e9eb047009f79bc22290470c2932.jpeg"),
url31(31,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/aef489a444793e37e2f33aeb3fe1fe13.jpeg"),
url32(32,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/b0f4a2d7ab851fb2ea01446b722c5631.jpeg"),
url33(33,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/b2d643c11850042ff2932451c84940c3.jpeg"),
url34(34,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/bdf1ebd620f759f703631b805216ca11.jpeg"),
url35(35,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/be1e70097583d1a08a9951925d66ef33.jpeg"),
url36(36,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/c3f38f6604713f13474a5e2f1145e481.jpeg"),
url37(37,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/c27da8b2c154998ebf7300c49cef649a.jpeg"),
url38(38,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/c26400a670209b60abcd28bfc6d22171.jpeg"),
url39(39,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/a906414986b1bee60cec709dabf2103b.jpeg"),
url40(40,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/a6d8629c155b59814e4d772fb5e6ec6a.jpeg"),
url41(41,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/a6a78d2a64c49cf62e37475eb66e351c.jpeg"),
url42(42,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/a571ccde02b075656f354b593533b00c.jpeg"),
url43(43,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/a0be3632c238d1a8e24e51ff8942efc6.jpeg"),
url44(44,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/9fca88b43ed09ddbeb4803ceab4f356f.jpeg"),
url45(45,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/86ad712e29369b9f56ca93a94f7a5d67.jpeg"),
url46(46,"https://cashier-oss.oss-cn-beijing.aliyuncs.com/status/%E6%BE%B6%E6%9D%91%E5%84%9A/88d4ca4146196992b48a52f62a690bf0.jpeg"),
;
private Integer key;
private String url;
public Integer getKey() {
return key;
}
public String getUrl() {
return url;
}
LogoEnum(Integer key, String url) {
this.key = key;
this.url = url;
}
public static String getValueByKey(Integer key) {
if(key == null){
return "";
}
LogoEnum[] urlEnums = values();
for (LogoEnum logo : urlEnums) {
if (logo.key.equals(key)) {
return logo.getUrl();
}
}
return "";
}
}

View File

@@ -1,88 +1,30 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@Data
public class SysDict implements Serializable {
private Long dictId;
private String dictName;
private String name;
private String description;
/**
* 是否有子类0否1是
*/
private Object isChild;
private String createBy;
/**
* 值
*/
private String value;
private String updateBy;
private Date createTime;
private Date updateTime;
private Integer isChild;
private static final long serialVersionUID = 1L;
public Integer getIsChild() {
return isChild;
}
public void setIsChild(Integer isChild) {
this.isChild = isChild;
}
public Long getDictId() {
return dictId;
}
public void setDictId(Long dictId) {
this.dictId = dictId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
private List<SysDict> detail=new ArrayList<>();
}

View File

@@ -1,98 +1,15 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class SysDictDetail implements Serializable {
private Long detailId;
private Long dictId;
private String dictName;
private String label;
private String value;
private Integer dictSort;
private String createBy;
private String updateBy;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Long getDetailId() {
return detailId;
}
public void setDetailId(Long detailId) {
this.detailId = detailId;
}
public Long getDictId() {
return dictId;
}
public void setDictId(Long dictId) {
this.dictId = dictId;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label == null ? null : label.trim();
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value == null ? null : value.trim();
}
public Integer getDictSort() {
return dictSort;
}
public void setDictSort(Integer dictSort) {
this.dictSort = dictSort;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -0,0 +1,78 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
public class TbActivate implements Serializable {
private Integer id;
private Integer shopId;
private Integer minNum;
private Integer maxNum;
private BigDecimal handselNum;
private String handselType;
private String isDel;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getMinNum() {
return minNum;
}
public void setMinNum(Integer minNum) {
this.minNum = minNum;
}
public Integer getMaxNum() {
return maxNum;
}
public void setMaxNum(Integer maxNum) {
this.maxNum = maxNum;
}
public BigDecimal getHandselNum() {
return handselNum;
}
public void setHandselNum(BigDecimal handselNum) {
this.handselNum = handselNum;
}
public String getHandselType() {
return handselType;
}
public void setHandselType(String handselType) {
this.handselType = handselType == null ? null : handselType.trim();
}
public String getIsDel() {
return isDel;
}
public void setIsDel(String isDel) {
this.isDel = isDel == null ? null : isDel.trim();
}
}

View File

@@ -1,6 +1,7 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import java.io.Serializable;
import java.math.BigDecimal;
@@ -60,4 +61,12 @@ public class TbCashierCart implements Serializable {
private TbProductSpec tbProductSpec;
private static final long serialVersionUID = 1L;
public String getSkuName() {
if(StringUtils.isNotBlank(skuName)){
return skuName;
}else {
return "";
}
}
}

View File

@@ -0,0 +1,71 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.util.Date;
import java.io.Serializable;
/**
* 团购卷分类(TbCouponCategory)实体类
*
* @author ww
* @since 2024-04-24 14:09:16
*/
public class TbCouponCategory implements Serializable {
private static final long serialVersionUID = -45350278241700844L;
private Integer id;
/**
* 分类名称
*/
private String name;
private Date createTime;
private Date updateTime;
/**
* 0不展示1展示
*/
private Integer status;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}

View File

@@ -0,0 +1,101 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 团购卷 卷码表(TbGroupOrderCoupon)实体类
*
* @author ww
* @since 2024-05-06 14:39:59
*/
public class TbGroupOrderCoupon implements Serializable {
private static final long serialVersionUID = -35424376349743542L;
private Integer id;
/**
* 团购订单id
*/
private Integer orderId;
/**
* 团购卷码
*/
private String couponNo;
/**
* 是否已退款
* 0
* 1
*/
private Integer isRefund;
/**
* 退款金额
*/
private BigDecimal refundAmount;
/**
* 退款原因
*/
private String refundReason;
/**
* 退款说明
*/
private String refundDesc;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getOrderId() {
return orderId;
}
public void setOrderId(Integer orderId) {
this.orderId = orderId;
}
public String getCouponNo() {
return couponNo;
}
public void setCouponNo(String couponNo) {
this.couponNo = couponNo;
}
public Integer getIsRefund() {
return isRefund;
}
public void setIsRefund(Integer isRefund) {
this.isRefund = isRefund;
}
public BigDecimal getRefundAmount() {
return refundAmount;
}
public void setRefundAmount(BigDecimal refundAmount) {
this.refundAmount = refundAmount;
}
public String getRefundReason() {
return refundReason;
}
public void setRefundReason(String refundReason) {
this.refundReason = refundReason;
}
public String getRefundDesc() {
return refundDesc;
}
public void setRefundDesc(String refundDesc) {
this.refundDesc = refundDesc;
}
}

View File

@@ -0,0 +1,123 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;
@Data
public class TbGroupOrderInfo implements Serializable {
private static final long serialVersionUID = -11810357048433715L;
/**
* id
*/
private Integer id;
/**
* 订单编号
*/
private String orderNo;
private Integer merchantId;
/**
* 商户Id
*/
private Integer shopId;
/**
* 用户id
*/
private Integer userId;
/**
* 商品id
*/
private Integer proId;
/**
* 商品图
*/
private String proImg;
/**
* 商品名称
*/
private String proName;
/**
* 团购卷到期日期
*/
private Date expDate;
/**
* 订单类型 预留字段
*/
private String orderType;
/**
* 支付方式 wechatPay微信支付aliPay支付宝支付
*/
private String payType;
/**
* 订单金额
*/
private BigDecimal orderAmount;
/**
* 优惠金额
*/
private BigDecimal saveAmount;
/**
* 实付金额
*/
private BigDecimal payAmount;
/**
* 退单金额
*/
private BigDecimal refundAmount;
/**
* 数量
*/
private Integer number;
private Integer refundNumber;
/**
* 订单状态
* 状态: unpaid-待付款;unused-待使用;closed-已完成;refunding-退款中;refund-已退款;cancelled-已取消;
*/
private String status;
/**
* 备注
*/
private String remark;
/**
* 手机号
*/
private String phone;
/**
* 付款时间
*/
private Date payTime;
/**
* 是否支持退款 0不支持 1支持
*/
private Integer refundAble;
/**
* 创建时间
*/
private Date createTime;
/**
* 卷码核销员
*/
private String verifier;
/**
* 更新时间
*/
private Date updateTime;
/**
* 支付订单号
*/
private String payOrderNo;
/**
* 交易日期
*/
private Date tradeDay;
/**
* 原订单id 退单
*/
private Integer source;
}

View File

@@ -0,0 +1,69 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class TbIntegral implements Serializable {
private Integer id;
private String userId;
private BigDecimal num;
private String status;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public BigDecimal getNum() {
return num;
}
public void setNum(BigDecimal num) {
this.num = num;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -0,0 +1,59 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class TbIntegralFlow implements Serializable {
private Integer id;
private String userId;
private BigDecimal num;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public BigDecimal getNum() {
return num;
}
public void setNum(BigDecimal num) {
this.num = num;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -41,6 +41,7 @@ public class TbMerchantCoupon implements Serializable {
* 限领数量
*/
private String limitNumber;
private String useNumber;
/**
* 发放数量
*/
@@ -135,6 +136,14 @@ public class TbMerchantCoupon implements Serializable {
private String merchantId;
public String getUseNumber() {
return useNumber;
}
public void setUseNumber(String useNumber) {
this.useNumber = useNumber;
}
public Integer getId() {
return id;
}

View File

@@ -21,6 +21,13 @@ public class TbMerchantThirdApply implements Serializable {
private String appToken;
private String smallAppid;
private String storeId;
private static final long serialVersionUID = 1L;
public Integer getId() {
@@ -94,4 +101,20 @@ public class TbMerchantThirdApply implements Serializable {
public void setAppToken(String appToken) {
this.appToken = appToken == null ? null : appToken.trim();
}
public String getSmallAppid() {
return smallAppid;
}
public void setSmallAppid(String smallAppid) {
this.smallAppid = smallAppid;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
}

View File

@@ -95,9 +95,36 @@ public class TbOrderInfo implements Serializable {
private String remark;
private String tableName;
private String masterId;
private String isBuyCoupon;
private String isUseCoupon;
private Integer totalNumber;
private List<TbOrderDetail> detailList;
private String winnnerNo;
private String isWinner;
//根据状态返回 需付款 已付款 未付款 已退
private String description;
public void setDescription() {
switch (status) {
case "closed":
this.description = "已付款";
break;
case "refund":
this.description = "已退款";
break;
case "paying":
case "unpaid":
this.description = "需付款";
break;
default:
this.description = "";
break;
}
}
private String outNumber;
private static final long serialVersionUID = 1L;
public TbOrderInfo(){
super();

View File

@@ -0,0 +1,19 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class TbParams implements Serializable {
private Integer id;
private BigDecimal integralRatio;
private BigDecimal twoRatio;
private BigDecimal tradeRatio;
private static final long serialVersionUID = 1L;
}

View File

@@ -12,10 +12,17 @@ public class TbPlatformDict implements Serializable {
private static final long serialVersionUID = -34581903392247717L;
private Integer id;
/**
* 标签前图标
*/
private String shareImg;
/**
* 描述 同类型下 name唯一
*/
private String name;
private String value;
private String fontColor;
private String backColor;
/**
* homeDistrict--金刚区(首页) carousel--轮播图 tag--标签
*/
@@ -24,10 +31,6 @@ public class TbPlatformDict implements Serializable {
* 封面图
*/
private String coverImg;
/**
* 分享图
*/
private String shareImg;
/**
* 视频URL地址
*/
@@ -36,10 +39,8 @@ public class TbPlatformDict implements Serializable {
* 视频封面图
*/
private String videoCoverImg;
/**
* 相对跳转地址
*/
private String relUrl;
private String jumpType;
/**
* 绝对跳转地址
*/
@@ -78,6 +79,22 @@ public class TbPlatformDict implements Serializable {
this.id = id;
}
public String getFontColor() {
return fontColor;
}
public void setFontColor(String fontColor) {
this.fontColor = fontColor;
}
public String getBackColor() {
return backColor;
}
public void setBackColor(String backColor) {
this.backColor = backColor;
}
public String getName() {
return name;
}
@@ -86,6 +103,14 @@ public class TbPlatformDict implements Serializable {
this.name = name;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public String getType() {
return type;
}
@@ -126,12 +151,12 @@ public class TbPlatformDict implements Serializable {
this.videoCoverImg = videoCoverImg;
}
public String getRelUrl() {
return relUrl;
public String getJumpType() {
return jumpType;
}
public void setRelUrl(String relUrl) {
this.relUrl = relUrl;
public void setJumpType(String jumpType) {
this.jumpType = jumpType;
}
public String getAbsUrl() {

View File

@@ -40,6 +40,8 @@ public class TbProduct implements Serializable {
private String shareImg;
private String images;
private String videoCoverImg;
private Integer sort;
@@ -127,6 +129,16 @@ public class TbProduct implements Serializable {
private String specTableHeaders;
private String cartNumber="0";
private String groupCategoryId;
public String getImages() {
return images;
}
public void setImages(String images) {
this.images = images;
}
public String getCartNumber() {
return cartNumber;
@@ -626,6 +638,15 @@ public class TbProduct implements Serializable {
return specTableHeaders;
}
public String getGroupCategoryId() {
return groupCategoryId;
}
public void setGroupCategoryId(String groupCategoryId) {
this.groupCategoryId = groupCategoryId;
}
public void setSpecTableHeaders(String specTableHeaders) {
this.specTableHeaders = specTableHeaders == null ? null : specTableHeaders.trim();
}

View File

@@ -0,0 +1,160 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
/**
* 购买须知(关联tb_merchant_coupon)(TbPurchaseNotice)实体类
*
* @author ww
* @since 2024-04-11 10:00:23
*/
public class TbPurchaseNotice implements Serializable {
private static final long serialVersionUID = 811103518413221387L;
/**
* 自增
*/
private Integer id;
/**
* 商户卷Id
*/
private Integer couponId;
/**
* 使用日期说明
*/
private String dateUsed;
/**
* 可用时间说明
*/
private String availableTime;
/**
* 预约方式
*/
private String bookingType;
/**
* 退款说明
*/
private String refundPolicy;
/**
* 使用规则
*/
private String usageRules;
/**
* 发票说明
*/
private String invoiceInfo;
/**
* 团购价说明
*/
private String groupPurInfo;
/**
* 门市价/划线价说明
*/
private String marketPriceInfo;
/**
* 折扣说明
*/
private String discountInfo;
/**
* 平台温馨提示
*/
private String platformTips;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCouponId() {
return couponId;
}
public void setCouponId(Integer couponId) {
this.couponId = couponId;
}
public String getDateUsed() {
return dateUsed;
}
public void setDateUsed(String dateUsed) {
this.dateUsed = dateUsed;
}
public String getAvailableTime() {
return availableTime;
}
public void setAvailableTime(String availableTime) {
this.availableTime = availableTime;
}
public String getBookingType() {
return bookingType;
}
public void setBookingType(String bookingType) {
this.bookingType = bookingType;
}
public String getRefundPolicy() {
return refundPolicy;
}
public void setRefundPolicy(String refundPolicy) {
this.refundPolicy = refundPolicy;
}
public String getUsageRules() {
return usageRules;
}
public void setUsageRules(String usageRules) {
this.usageRules = usageRules;
}
public String getInvoiceInfo() {
return invoiceInfo;
}
public void setInvoiceInfo(String invoiceInfo) {
this.invoiceInfo = invoiceInfo;
}
public String getGroupPurInfo() {
return groupPurInfo;
}
public void setGroupPurInfo(String groupPurInfo) {
this.groupPurInfo = groupPurInfo;
}
public String getMarketPriceInfo() {
return marketPriceInfo;
}
public void setMarketPriceInfo(String marketPriceInfo) {
this.marketPriceInfo = marketPriceInfo;
}
public String getDiscountInfo() {
return discountInfo;
}
public void setDiscountInfo(String discountInfo) {
this.discountInfo = discountInfo;
}
public String getPlatformTips() {
return platformTips;
}
public void setPlatformTips(String platformTips) {
this.platformTips = platformTips;
}
}

View File

@@ -0,0 +1,30 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class TbReleaseFlow implements Serializable {
private Integer id;
private String userId;
private BigDecimal num;
private String type;
private String operationType;
private String remark;
private String nickName;
private String fromSource;
private Date createTime;
private String createTr;
private String openId;
private static final long serialVersionUID = 1L;
}

View File

@@ -1,8 +1,12 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class TbShopInfo implements Serializable {
private Integer id;
@@ -58,6 +62,8 @@ public class TbShopInfo implements Serializable {
private String industryName;
private String businessStartDay;
private String businessEndDay;
private String businessTime;
private String postTime;
@@ -95,366 +101,16 @@ public class TbShopInfo implements Serializable {
* 商家二维码
*/
private String shopQrcode;
public String getShopQrcode() {
return shopQrcode;
}
public void setShopQrcode(String shopQrcode) {
this.shopQrcode = shopQrcode;
}
private String isOpenYhq;
private Byte isUseVip;
/**
* 商户标签
*/
private String tag;
private String provinces;
private String cities;
private String districts;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account == null ? null : account.trim();
}
public String getShopCode() {
return shopCode;
}
public void setShopCode(String shopCode) {
this.shopCode = shopCode == null ? null : shopCode.trim();
}
public String getSubTitle() {
return subTitle;
}
public void setSubTitle(String subTitle) {
this.subTitle = subTitle == null ? null : subTitle.trim();
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId == null ? null : merchantId.trim();
}
public String getShopName() {
return shopName;
}
public void setShopName(String shopName) {
this.shopName = shopName == null ? null : shopName.trim();
}
public String getChainName() {
return chainName;
}
public void setChainName(String chainName) {
this.chainName = chainName == null ? null : chainName.trim();
}
public String getBackImg() {
return backImg;
}
public void setBackImg(String backImg) {
this.backImg = backImg == null ? null : backImg.trim();
}
public String getFrontImg() {
return frontImg;
}
public void setFrontImg(String frontImg) {
this.frontImg = frontImg == null ? null : frontImg.trim();
}
public String getContactName() {
return contactName;
}
public void setContactName(String contactName) {
this.contactName = contactName == null ? null : contactName.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo == null ? null : logo.trim();
}
public Byte getIsDeposit() {
return isDeposit;
}
public void setIsDeposit(Byte isDeposit) {
this.isDeposit = isDeposit;
}
public Byte getIsSupply() {
return isSupply;
}
public void setIsSupply(Byte isSupply) {
this.isSupply = isSupply;
}
public String getCoverImg() {
return coverImg;
}
public void setCoverImg(String coverImg) {
this.coverImg = coverImg == null ? null : coverImg.trim();
}
public String getShareImg() {
return shareImg;
}
public void setShareImg(String shareImg) {
this.shareImg = shareImg == null ? null : shareImg.trim();
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail == null ? null : detail.trim();
}
public String getLat() {
return lat;
}
public void setLat(String lat) {
this.lat = lat == null ? null : lat.trim();
}
public String getLng() {
return lng;
}
public void setLng(String lng) {
this.lng = lng == null ? null : lng.trim();
}
public String getMchId() {
return mchId;
}
public void setMchId(String mchId) {
this.mchId = mchId == null ? null : mchId.trim();
}
public String getRegisterType() {
return registerType;
}
public void setRegisterType(String registerType) {
this.registerType = registerType == null ? null : registerType.trim();
}
public Byte getIsWxMaIndependent() {
return isWxMaIndependent;
}
public void setIsWxMaIndependent(Byte isWxMaIndependent) {
this.isWxMaIndependent = isWxMaIndependent;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city == null ? null : city.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getIndustry() {
return industry;
}
public void setIndustry(String industry) {
this.industry = industry == null ? null : industry.trim();
}
public String getIndustryName() {
return industryName;
}
public void setIndustryName(String industryName) {
this.industryName = industryName == null ? null : industryName.trim();
}
public String getBusinessTime() {
return businessTime;
}
public void setBusinessTime(String businessTime) {
this.businessTime = businessTime == null ? null : businessTime.trim();
}
public String getPostTime() {
return postTime;
}
public void setPostTime(String postTime) {
this.postTime = postTime == null ? null : postTime.trim();
}
public BigDecimal getPostAmountLine() {
return postAmountLine;
}
public void setPostAmountLine(BigDecimal postAmountLine) {
this.postAmountLine = postAmountLine;
}
public Byte getOnSale() {
return onSale;
}
public void setOnSale(Byte onSale) {
this.onSale = onSale;
}
public Byte getSettleType() {
return settleType;
}
public void setSettleType(Byte settleType) {
this.settleType = settleType;
}
public String getSettleTime() {
return settleTime;
}
public void setSettleTime(String settleTime) {
this.settleTime = settleTime == null ? null : settleTime.trim();
}
public Integer getEnterAt() {
return enterAt;
}
public void setEnterAt(Integer enterAt) {
this.enterAt = enterAt;
}
public Long getExpireAt() {
return expireAt;
}
public void setExpireAt(Long expireAt) {
this.expireAt = expireAt;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public Float getAverage() {
return average;
}
public void setAverage(Float average) {
this.average = average;
}
public Integer getOrderWaitPayMinute() {
return orderWaitPayMinute;
}
public void setOrderWaitPayMinute(Integer orderWaitPayMinute) {
this.orderWaitPayMinute = orderWaitPayMinute;
}
public Integer getSupportDeviceNumber() {
return supportDeviceNumber;
}
public void setSupportDeviceNumber(Integer supportDeviceNumber) {
this.supportDeviceNumber = supportDeviceNumber;
}
public Byte getDistributeLevel() {
return distributeLevel;
}
public void setDistributeLevel(Byte distributeLevel) {
this.distributeLevel = distributeLevel;
}
public Long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
public Long getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Long updatedAt) {
this.updatedAt = updatedAt;
}
public String getProxyId() {
return proxyId;
}
public void setProxyId(String proxyId) {
this.proxyId = proxyId == null ? null : proxyId.trim();
}
public String getView() {
return view;
}
public void setView(String view) {
this.view = view == null ? null : view.trim();
}
}

View File

@@ -42,6 +42,10 @@ public class TbShopUser implements Serializable {
private String code;
private String dynamicCode;
private Byte isAttention;
private Integer attentionAt;
@@ -214,6 +218,15 @@ public class TbShopUser implements Serializable {
this.code = code == null ? null : code.trim();
}
public String getDynamicCode() {
return dynamicCode;
}
public void setDynamicCode(String dynamicCode) {
this.dynamicCode = dynamicCode;
}
public Byte getIsAttention() {
return isAttention;
}

View File

@@ -19,6 +19,8 @@ public class TbShopUserFlow implements Serializable {
private Date createTime;
private String type;
private static final long serialVersionUID = 1L;
public Integer getId() {
@@ -76,4 +78,12 @@ public class TbShopUserFlow implements Serializable {
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
}

View File

@@ -0,0 +1,159 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.util.Date;
import java.io.Serializable;
/**
* 商户视频号(TbShopVideo)实体类
*
* @author ww
* @since 2024-04-12 14:50:09
*/
public class TbShopVideo implements Serializable {
private static final long serialVersionUID = 521986900418854409L;
private Integer id;
/**
* 店铺id
*/
private Integer shopId;
/**
* 1-公众号2-小程序3-视频号
*/
private Integer type;
/**
* 描述信息
*/
private String name;
/**
* 渠道id(视频号id)
*/
private Integer channelId;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 资源Id(视频号id)(公众号id)
*/
private Integer sourceId;
/**
* 资源地址
*/
private String sourceUrl;
/**
* 0:关闭1开启
*/
private Integer status;
/**
* 视频id
*/
private Integer videoId;
/**
* 视频地址
*/
private String videoUrl;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getChannelId() {
return channelId;
}
public void setChannelId(Integer channelId) {
this.channelId = channelId;
}
public Date getCreatedTime() {
return createdTime;
}
public void setCreatedTime(Date createdTime) {
this.createdTime = createdTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getSourceId() {
return sourceId;
}
public void setSourceId(Integer sourceId) {
this.sourceId = sourceId;
}
public String getSourceUrl() {
return sourceUrl;
}
public void setSourceUrl(String sourceUrl) {
this.sourceUrl = sourceUrl;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getVideoId() {
return videoId;
}
public void setVideoId(Integer videoId) {
this.videoId = videoId;
}
public String getVideoUrl() {
return videoUrl;
}
public void setVideoUrl(String videoUrl) {
this.videoUrl = videoUrl;
}
}

View File

@@ -0,0 +1,34 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
//分配金额
public class TbSplitAccounts implements Serializable {
private Integer id;
private Integer merchantId;//商户ID
private Integer shopId;//店铺ID
private BigDecimal couponsPrice;//优惠券价值
private BigDecimal conponsAmount;//优惠券面额
private BigDecimal originAmount;//
private String isSplit;
private BigDecimal orderAmount;
private Date createTime;
private Date splitTime;
private String tradeDay;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,30 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class TbSystemCoupons implements Serializable {
private Integer id;
private String name;
private BigDecimal couponsPrice;
private BigDecimal couponsAmount;
private String status;
private String typeName;
private Date createTime;
private Date updateTime;
private Integer dayNum;
private Date endTime;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,31 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class TbUserCoupons implements Serializable {
private Integer id;
private String userId;
private Integer orderId;
private BigDecimal couponsPrice;
private BigDecimal couponsAmount;
private TbOrderInfo orderInfo;
private String status;
private String isDouble;
private Date createTime;
private Date updateTime;
private Date endTime;
private static final long serialVersionUID = 1L;
}

View File

@@ -5,7 +5,6 @@ import java.math.BigDecimal;
public class TbUserInfo implements Serializable {
private Integer id;
private Integer userId;
private BigDecimal amount;
@@ -98,15 +97,12 @@ public class TbUserInfo implements Serializable {
private String avatar = "";
private String phone="";
private String isPwd;
public String getPhone() {
return phone;
}
private String pwd;
private String custPhone="400-6666-389";
public void setPhone(String phone) {
this.phone = phone;
}
public String getAvatar() {
return avatar;
@@ -116,6 +112,14 @@ public class TbUserInfo implements Serializable {
this.avatar = avatar;
}
public String getCustPhone() {
return custPhone;
}
public void setCustPhone(String custPhone) {
this.custPhone = custPhone;
}
private static final long serialVersionUID = 1L;
public Integer getId() {
@@ -478,14 +482,6 @@ public class TbUserInfo implements Serializable {
this.grandParentId = grandParentId == null ? null : grandParentId.trim();
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public String getPassword() {
return password;
}
@@ -493,4 +489,20 @@ public class TbUserInfo implements Serializable {
public void setPassword(String password) {
this.password = password;
}
public String getIsPwd() {
return isPwd;
}
public void setIsPwd(String isPwd) {
this.isPwd = isPwd;
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd;
}
}

View File

@@ -0,0 +1,22 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class TbWiningParams implements Serializable {
private Integer id;
private BigDecimal minPrice;
private BigDecimal maxPrice;
private Integer winingNum;
private Integer winingUserNum;
private String status;
private static final long serialVersionUID = 1L;
}

View File

@@ -0,0 +1,54 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class TbWiningUser implements Serializable {
private Integer id;
private String userName;
private String orderNo;
private BigDecimal orderAmount;
private String isUser;
private Date createTime;
private String isRefund;
private BigDecimal refundAmount;
private String refundNo;
private String refundPayType;
private String tradeDay;
private Date refundTime;
private static final long serialVersionUID = 1L;
public TbWiningUser(){
super();
}
public TbWiningUser(String userName,String orderNo,BigDecimal orderAmount,
String isUser,String tradeDay){
this.createTime = new Date();
this.userName = userName;
this.orderNo = orderNo;
this.orderAmount = orderAmount;
this.isUser = isUser;
this.tradeDay = tradeDay;
this.isRefund = "true";
this.refundAmount = BigDecimal.ZERO;
this.refundPayType = "WX";
}
}

View File

@@ -0,0 +1,20 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class TbYhqParams implements Serializable {
private Integer id;
private String name;
private BigDecimal minPrice;
private BigDecimal maxPrice;
private String status;
private static final long serialVersionUID = 1L;
}

View File

@@ -13,6 +13,7 @@ public class AuthUserDto {
private String password;
private String code;
private String opencode;
private String uuid = "";
@@ -47,4 +48,12 @@ public class AuthUserDto {
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getOpencode() {
return opencode;
}
public void setOpencode(String opencode) {
this.opencode = opencode;
}
}

View File

@@ -0,0 +1,13 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
/**
* 分页数据
*/
@Data
public class BasePageDto {
private Integer page = 1;
private Integer size = 10;
}

View File

@@ -0,0 +1,15 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
/**
* 通用门店查询类
*/
@Data
public class ComShopDto extends HomeBaseDto{
/**
* 连锁店名
*/
private String shopName;
}

View File

@@ -0,0 +1,18 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class CreateGroupOrderDto {
private Integer proId;
private Integer shopId;
private Integer num;
private Integer userId;
private String phone;
private BigDecimal orderAmount;
private BigDecimal payAmount;
private String remark;
}

View File

@@ -0,0 +1,13 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
@Data
public class GroupOrderDto extends BasePageDto {
//用户Id 必填
private String userId;
//状态: unpaid-待付款;unused-待使用;closed-已完成;refunding-退款中;refund-已退款;cancelled-已取消;
private String status;
//商品名称 模糊查询
private String proName;
}

View File

@@ -0,0 +1,54 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
/**
* 查询通用核心类
* 经纬度
* 城市信息
*/
@Data
public class HomeBaseDto extends BasePageDto{
/**
* 经度
*/
private String lat;
/**
* 纬度
*/
private String lng;
/**
* 地址
*/
private String address;
private String distanceInKm;
private Integer isPage = 1;
public void setLat(String lat) {
if (StringUtils.isBlank(lat) || lat.equals("undefined")) {
this.lat = "34.343207";
}else {
this.lat = lat;
}
}
public void setLng(String lng) {
if (StringUtils.isBlank(lng) || lng.equals("undefined")) {
this.lng = "108.939645";
}else {
this.lng = lng;
}
}
public void setAddress(String address) {
if (StringUtils.isBlank(address) || address.equals("undefined")) {
this.address = "西安市";
}else {
this.address = address;
}
}
}

View File

@@ -1,76 +1,37 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
/**
* @author 12847
*/
public class HomeDto {
/**
* 地址
*/
private String address;
@Data
public class HomeDto extends HomeBaseDto {
private String proName;
/**
* 品类
*/
private String type;
/**
* 1.理我最近 2.销量优先 3.价格优先
* 0.今日上新
* 1.离我最近
* 2.销量优先
* 3.价格优先
* 4.热榜推荐
* 5.精选推荐
*/
private Integer orderBy;
private Integer orderBy = 0;
/**
* 附近1KM 1选中 0未选中
* 0:今天
* 1:两小时内
*/
private Integer distance;
private Integer page;
private Integer size;
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Integer getOrderBy() {
return orderBy;
}
private Integer dateType = 1;
public void setOrderBy(Integer orderBy) {
this.orderBy = orderBy;
}
public Integer getDistance() {
return distance;
}
public void setDistance(Integer distance) {
this.distance = distance;
}
public Integer getPage() {
return page;
}
public void setPage(Integer page) {
this.page = page;
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
if(orderBy!=null){
this.orderBy = orderBy;
}
}
}

View File

@@ -0,0 +1,29 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ReturnGroupOrderDto {
/**
* 退单数
*/
private Integer num;
/**
* 团购订单id
*/
private Integer orderId;
/**
* 退款金额
*/
private BigDecimal refundAmount;
/**
* 退款原因
*/
private String refundReason;
/**
* 退款说明
*/
private String refundDesc;
}

View File

@@ -0,0 +1,17 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
/**
* 修改密码的 Vo 类
*/
@Data
public class UserPassDto {
private String phone;
private String code;
private String oldPass;
private String newPass;
}

View File

@@ -0,0 +1,43 @@
package com.chaozhanggui.system.cashierservice.entity.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author lyf
*/
@Data
public class BannerInfoVo {
/**
* 昵称
*/
private String name;
/**
* 昵称
*/
private String logo;
/**
* 免单了多少钱
*/
private BigDecimal money;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
}

View File

@@ -0,0 +1,31 @@
package com.chaozhanggui.system.cashierservice.entity.vo;
import java.util.List;
/**
* @author 12847
*/
public class BannerVO {
/**
* 有多少人参与了免单
*/
private String coupons;
private List<BannerInfoVo> counponsInfo;
public String getCoupons() {
return coupons;
}
public void setCoupons(String coupons) {
this.coupons = coupons;
}
public List<BannerInfoVo> getCounponsInfo() {
return counponsInfo;
}
public void setCounponsInfo(List<BannerInfoVo> counponsInfo) {
this.counponsInfo = counponsInfo;
}
}

View File

@@ -0,0 +1,25 @@
package com.chaozhanggui.system.cashierservice.entity.vo;
import com.chaozhanggui.system.cashierservice.entity.SysDict;
import lombok.Data;
import java.util.List;
/**
* 顶部图
* 预约到店
* 每日上新
* 热榜推荐
* 咖啡饮品
*/
@Data
public class CommonVo {
private String title;
private List<HomeCarouselVo> carousel;
/**
* 菜单列表 不一定有
*/
private List<SysDict> menu;
}

View File

@@ -1,50 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity.vo;
import com.chaozhanggui.system.cashierservice.entity.SysDictDetail;
import java.util.List;
/**
* @author lyf
*/
public class DicDetailVO {
private String name;
private String description;
private List<SysDictDetail> detail;
private Integer isChild;
public Integer getIsChild() {
return isChild;
}
public void setIsChild(Integer isChild) {
this.isChild = isChild;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public List<SysDictDetail> getDetail() {
return detail;
}
public void setDetail(List<SysDictDetail> detail) {
this.detail = detail;
}
}

Some files were not shown because too many files have changed in this diff Show More