Merge branch 'refs/heads/test' into dev

# Conflicts:
#	src/main/java/com/chaozhanggui/system/cashierservice/controller/OrderController.java
This commit is contained in:
SongZhang 2024-10-22 15:26:31 +08:00
commit 20416c7774
184 changed files with 9089 additions and 4240 deletions

25
pom.xml
View File

@ -21,6 +21,10 @@
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
@ -185,16 +189,11 @@
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.3.1</version>
<exclusions>
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</exclusion>
</exclusions>
<groupId>p6spy</groupId>
<artifactId>p6spy</artifactId>
<version>3.8.2</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
@ -212,6 +211,14 @@
</exclusions>
</dependency>
<!-- alipay -->
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>4.39.208.ALL</version>
</dependency>
</dependencies>
<!-- <profiles>-->
<!-- <profile>-->

View File

@ -2,29 +2,26 @@ package com.chaozhanggui.system.cashierservice;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.ApplicationContext;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.Bean;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
@EnableScheduling
@EntityScan(basePackageClasses = {Shell.class})
@MapperScan(basePackageClasses ={Shell.class} )
@ComponentScan(basePackageClasses ={Shell.class})
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableAsync
//@EntityScan(basePackageClasses = {Shell.class})
//@EnableAspectJAutoProxy(proxyTargetClass = true)
@Slf4j
@MapperScan({"com.chaozhanggui.system.cashierservice.mybatis", "com.chaozhanggui.system.cashierservice.mapper", "com.chaozhanggui.system.cashierservice.dao"})
public class Shell {
private static Logger logger = LoggerFactory.getLogger(Shell.class);

View File

@ -1,26 +0,0 @@
package com.chaozhanggui.system.cashierservice.annotation;
import com.chaozhanggui.system.cashierservice.bean.*;
import java.lang.annotation.*;
/**
* 日志注解
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface MyLog {
String value() default "未命名日志";
LogTag tag();
OperationLogType operationLogType() default OperationLogType.NULL;
boolean write() default false;
GetKeyWith getKeyWith() default GetKeyWith.WITH_NULL;
String keyName() default "";
OperationLogState operationLogstate() default OperationLogState.UN_HTTP_STATE;
ActionType actionType() default ActionType.SELECT;
LogType type() default LogType.INFO;
boolean showBody() default false;
}

View File

@ -1,201 +0,0 @@
package com.chaozhanggui.system.cashierservice.aop;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.text.StrFormatter;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.annotation.MyLog;
import com.chaozhanggui.system.cashierservice.bean.GetKeyWith;
import lombok.extern.log4j.Log4j2;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Aspect
@Order
@Component
@Log4j2
public class LogAop {
@Pointcut("@annotation(com.chaozhanggui.system.cashierservice.annotation.MyLog)")
private void getLogPointCut() {
}
private String getRequestBodyInfo(HttpServletRequest request) {
try {
//利用InputStreamReader将字节流转换为字符流
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(request.getInputStream()));
String string;
StringBuilder stringBuffer=new StringBuilder();
//读取字符流的字符拼接在stringBufferStringBuffer在进行字符串处理时不生成新的对象在内存使用上要优于String类
while((string=bufferedReader.readLine())!=null){
stringBuffer.append(string);
}
return stringBuffer.toString();
}catch (Exception e) {
log.error(e);
}
return "";
}
@Async
public void writeLog(String remoteAddr, String url, MyLog logAnnotation, Map<String, String[]> parameterMap, String bodyInfo, Object resp, long duration) {
if (!logAnnotation.write()) return;
// 系统操作日志, 异步事件
String keyVal = null;
JSONObject jsonObject = JSON.parseObject(bodyInfo);
if (logAnnotation.keyName() != null && jsonObject != null) {
if (GetKeyWith.WITH_POST.equals(logAnnotation.getKeyWith())) {
keyVal = jsonObject.getString(logAnnotation.keyName());
}else if (GetKeyWith.WITH_GET.equals(logAnnotation.getKeyWith())) {
for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
if (entry.getKey().equals(logAnnotation.keyName())) {
keyVal = entry.getValue()[0];
}
}
}
}
// SystemOperationLog operationLog = new SystemOperationLog();
// operationLog.setMsg(logAnnotation.tag().getValue() + " " + logAnnotation.value())
// .setKeyValue(keyVal)
// .setKeyName(logAnnotation.keyName())
// .setState(logAnnotation.operationLogstate())
// .setType(logAnnotation.operationLogType())
// .setRespData(resp)
// .setDuration(duration)
// .setIp(remoteAddr)
// .setUrl(url)
// .setReqData(jsonObject);
// Utils.publishEvent(operationLog, OperationLogEvent.class);
}
/**
* 配置环绕通知,使用在方法logPointcut()上注册的切入点
*
* @param joinPoint join point for advice
*/
@Around("getLogPointCut()")
public Object logAround(ProceedingJoinPoint joinPoint) throws Throwable {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
String logInfo = "\033[34m请求地址: {}, 请求ip: {}, 请求方式: {}, GET参数: {}, POST参数: {}\033[0m";
String logStr = "";
String bodyInfo = "";
Map<String, String[]> parameterMap = new HashMap<>();
HttpServletRequest request = null;
String remoteAddr = "";
if (attributes != null) {
request = attributes.getRequest();
if (request.getHeader("X-Forwarded-For") != null) {
remoteAddr = request.getHeader("X-Forwarded-For").split(",")[0];
} else {
remoteAddr = request.getRemoteAddr();
}
parameterMap = request.getParameterMap();
bodyInfo = getRequestBodyInfo(request);
logStr = StrFormatter.format(logInfo,
request.getRequestURI(), remoteAddr, request.getMethod(), request.getQueryString(), bodyInfo);
log.info(logStr);
}
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();
Method method = methodSignature.getMethod();
MyLog logAnnotation = method.getAnnotation(MyLog.class);
// 开始时间
long startTime = DateUtil.current(false);
Object result = null;
Exception error = null;
try {
result = joinPoint.proceed();
return result;
}catch (Exception e) {
error = e;
throw e;
}
finally {
long endTime = DateUtil.current(false);
writeLog(remoteAddr, request != null ? request.getRequestURI() : "", logAnnotation, parameterMap, bodyInfo, result == null ? Objects.requireNonNull(error).getCause() + error.getMessage(): result, endTime - startTime);
// 异步记录日志
if (logAnnotation.showBody()) {
logInfo = "\033[32;4m包名: {}, 方法名: {}, 描述: {}, 操作类型: {}, 执行结果: {}, 执行时间: {}ms\033[0m";
}else {
logInfo = "\033[32;4m包名: {}, 方法名: {}, 描述: {}, 操作类型: {}, 执行时间: {}ms\033[0m";
}
switch (logAnnotation.type()) {
case INFO:
if (logAnnotation.showBody()) {
log.info(logInfo,
joinPoint.getTarget().getClass().getPackage().getName(),
method.getName(), logAnnotation.value(), logAnnotation.actionType().getType(), result, endTime - startTime);
}else {
log.info(logInfo,
joinPoint.getTarget().getClass().getPackage().getName(),
method.getName(), logAnnotation.tag() + logAnnotation.value(), logAnnotation.actionType().getType(), endTime - startTime);
}
break;
case ERROR:
if (logAnnotation.showBody()) {
log.error(logInfo,
joinPoint.getTarget().getClass().getPackage().getName(),
method.getName(), logAnnotation.value(), logAnnotation.actionType().getType(), result, endTime - startTime);
}else {
log.error(logInfo,
joinPoint.getTarget().getClass().getPackage().getName(),
method.getName(), logAnnotation.tag() + logAnnotation.value(), logAnnotation.actionType().getType(), endTime - startTime);
}
break;
case WARN:
if (logAnnotation.showBody()) {
log.warn(logInfo,
joinPoint.getTarget().getClass().getPackage().getName(),
method.getName(), logAnnotation.value(), logAnnotation.actionType().getType(), result, endTime - startTime);
}else {
log.warn(logInfo,
joinPoint.getTarget().getClass().getPackage().getName(),
method.getName(), logAnnotation.tag() + logAnnotation.value(), logAnnotation.actionType().getType(), endTime - startTime);
}
break;
default:
if (logAnnotation.showBody()) {
log.debug(logInfo,
joinPoint.getTarget().getClass().getPackage().getName(),
method.getName(), logAnnotation.value(), logAnnotation.actionType().getType(), result, endTime - startTime);
}else {
log.debug(logInfo,
joinPoint.getTarget().getClass().getPackage().getName(),
method.getName(), logAnnotation.tag() + logAnnotation.value(), logAnnotation.actionType().getType(), endTime - startTime);
}
break;
}
}
}
}

View File

@ -1,25 +0,0 @@
package com.chaozhanggui.system.cashierservice.bean;
/**
* 日志操作活动枚举
*/
public enum ActionType {
SELECT("查询操作"),
UPDATE("修改操作"),
DELETE("删除操作"),
ADD("新增操作");
private String type;
ActionType(String type) {
this.type = type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}

View File

@ -1,20 +0,0 @@
package com.chaozhanggui.system.cashierservice.bean;
import lombok.Getter;
/**
* @author: ZhangSong
* @create: 2024-05-15 17:01
*/
@Getter
public enum GetKeyWith {
WITH_GET(0),
WITH_POST(1),
WITH_NULL(-1);
private final Integer value;
GetKeyWith(Integer value) {
this.value = value;
}
}

View File

@ -1,19 +0,0 @@
package com.chaozhanggui.system.cashierservice.bean;
import lombok.Getter;
/**
* 日志标签
* @author: ZhangSong
* @create: 2024-05-15 16:32
*/
@Getter
public enum LogTag {
JPUSH("极光"), CLIENT("安卓"),
LOGIN("登录"), SYSTEM("系统"), CART("订单购物车"), PLACE("下单");
private final String value;
LogTag(String value) {
this.value = value;
}
}

View File

@ -1,21 +0,0 @@
package com.chaozhanggui.system.cashierservice.bean;
public enum LogType {
INFO("INFO"),
ERROR("ERROR"),
WARN("WARN"),
DEBUG("DEBUG");
private String value;
LogType(String value) {
this.value = value;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -1,24 +0,0 @@
package com.chaozhanggui.system.cashierservice.bean;
/**
* 操作日志所有状态
* @author: ZhangSong
* @create: 2024-04-28 11:06
*/
public enum OperationLogState {
UN_HTTP_STATE(-1),
HTTP_FAIL_STATE(0),
HTTP_SUCCESS_STATE(1),
SQL_EXE_FAIL_STATE(2),
SQL_EXE_SUCCESS_STATE(3);
private Integer state;
OperationLogState(Integer state) {
this.state = state;
}
public Integer getState() {
return state;
}
}

View File

@ -1,43 +0,0 @@
package com.chaozhanggui.system.cashierservice.bean;
/**
* 操作日志所有操作类型
* @author: ZhangSong
* @create: 2024-04-28 11:04
*/
public enum OperationLogType {
UM_API_QUERY_CITY_CALL(1000),
UM_API_UPDATE_ORDER_PHONE(1010),
UM_API_QUERY_DRIVER_LOCATION(1020),
UM_API_CANCEL_ORDER(1030),
UM_API_CANCEL_ORDER_SUCCESS(1040),
UM_API_PAY_ORDER_CALL(1050),
UM_API_CREATE_INVOICE_CALL(1060),
UM_API_QUERY_INVOICE_CALL(1070),
UM_API_RED_REVERSE_CALL(1080),
UM_API_RED_REVERSE_CALL_SUCCESS(1081),
UM_API_PUSH_ORDER_STATE_CALL(1090),
UM_API_PUSH_ORDER_STATE_CALL_GET_HL_STATE_FAIL(1091),
UM_API_PUSH_DRIVER_CALL(1100),
UM_API_PUSH_DRIVER_CALL_API_FAIL(1101),
UM_API_QUERY_PRICE_CALL(1110),
UM_API_CREATE_ORDER_CALL(1120),
UM_API_QUERY_ORDER_DETAIL_CALL(1130),
JPUSH_API_CALL(1140),
UM_CONTROLLER_MAKE_INVOICE_CALL(1150), UM_API_PUSH_TEMP_DRIVER_CALL(1160),
ENUOYUN_INVOICE_CALL(1170),
UM_API_CALL_UM_CHANGE_ORDER_STATE(1180),
API_CHARGEBACK_CALL(1190),
API_REDISTRIBUTE_CALL(1200), API_DRIVER_LOGIN_CALL(1210), NULL(-1),
API_CHANGXING_HANGLV_CHONGXIN_SHANGCHUAN(1220),
API_CHANGXING_HANGLV_FAPIAO_ZUOFEI(1230);
private final Integer value;
OperationLogType(Integer value) {
this.value = value;
}
public Integer getValue() {
return value;
}
}

View File

@ -0,0 +1,15 @@
package com.chaozhanggui.system.cashierservice.bean;
import lombok.Getter;
@Getter
public enum OrderPlatformTypeEnum {
PC("pc"),
CASH("cash"),
MINI_APP("miniapp");
private final String value;
OrderPlatformTypeEnum(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,16 @@
package com.chaozhanggui.system.cashierservice.bean;
import lombok.Getter;
@Getter
public enum OrderSendTypeEnums {
TABLE("table"),
TAKEAWAY("takeaway"),
TAKE_SELF("takeself"),
POST("post");
private final String value;
OrderSendTypeEnums(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,15 @@
package com.chaozhanggui.system.cashierservice.bean;
import lombok.Getter;
@Getter
public enum OrderUseTypeEnum {
TAKEOUT("takeout"),
DINE_IN_AFTER("dine-in-after"),
DINE_IN_BEFORE("dine-in-before");
private final String value;
OrderUseTypeEnum(String value) {
this.value = value;
}
}

View File

@ -1,23 +0,0 @@
package com.chaozhanggui.system.cashierservice.bean;
import lombok.Getter;
/**
* @author: ZhangSong
* @create: 2024-05-23 19:01
*/
@Getter
public enum Plat {
TT(1),
CX(2),
RZ(3),
JS(5),
UNDEFINED(-1);
private final Integer value;
Plat(Integer value) {
this.value = value;
}
}

View File

@ -0,0 +1,16 @@
package com.chaozhanggui.system.cashierservice.bean;
import lombok.EqualsAndHashCode;
import lombok.Getter;
@Getter
public enum ShopInfoEatModelEnum {
TAKE_OUT("take-out"),
DINE_IN("dine-in");
private final String value;
ShopInfoEatModelEnum(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,17 @@
package com.chaozhanggui.system.cashierservice.bean;
import lombok.Getter;
@Getter
public enum ShopInfoRegisterlEnum {
// 快餐版
MUNCHIES("munchies"),
// 餐饮版
RESTAURANT("restaurant");
private final String value;
ShopInfoRegisterlEnum(String value) {
this.value = value;
}
}

View File

@ -2,7 +2,7 @@ package com.chaozhanggui.system.cashierservice.bean;
public enum TableStateEnum {
IDLE("idle"),
CLOSED("closed"), PAYING("paying"), PENDING("pending"), USING("using");
CLOSED("closed"), PAYING("paying"), PENDING("pending"), USING("using"), CLEANING("cleaning");
private String state = "closed";
TableStateEnum(String state) {

View File

@ -0,0 +1,6 @@
package com.chaozhanggui.system.cashierservice.bean.constant;
public interface TableConstant {
String CART_SEAT_ID = "-999";
}

View File

@ -0,0 +1,30 @@
package com.chaozhanggui.system.cashierservice.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.web.filter.CommonsRequestLoggingFilter;
@Configuration
public class RequestLoggingConfig {
@Bean
@Order(-9999)
public CommonsRequestLoggingFilter logFilter() {
CommonsRequestLoggingFilter filter = new CommonsRequestLoggingFilter();
// 是否记录请求的查询参数信息
filter.setIncludeQueryString(true);
// 是否记录请求body内容
filter.setIncludePayload(true);
filter.setMaxPayloadLength(10000);
//是否记录请求header信息
filter.setIncludeHeaders(false);
// 是否记录请求客户端信息
filter.setIncludeClientInfo(true);
// 设置日期记录的前缀
filter.setBeforeMessagePrefix("\033[32;4m请求开始:");
filter.setBeforeMessageSuffix("\033[0m");
filter.setAfterMessagePrefix("\033[34m请求结束:");
filter.setAfterMessageSuffix("\033[0m");
return filter;
}
}

View File

@ -1,14 +1,20 @@
package com.chaozhanggui.system.cashierservice.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.extra.servlet.ServletUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
import com.chaozhanggui.system.cashierservice.service.OrderService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import lombok.extern.slf4j.Slf4j;
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 java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
@CrossOrigin(origins = "*")
@RestController
@ -17,11 +23,51 @@ import java.util.Map;
public class NotifyController {
@Resource
private OrderService orderService;
@RequestMapping("notifyPay")
public String notifyPay(@RequestBody Map<String,Object> map){
log.info("notifyPay:{}", JSON.toJSONString(map));
return null;
public Result notifyPay(HttpServletRequest request) {
String body = ServletUtil.getBody(request);
log.info("notifyPay body:{}", body);
JSONObject resp = JSON.parseObject(body);
String code = resp.getString("code");
String msg = resp.getString("msg");
if (!"000000".equals(code)) {
log.error("支付失败:{}", resp.getString("msg"));
return Result.fail(msg);
}
JSONObject bizData = JSON.parseObject(resp.getString("bizData"));
String state = bizData.getString("state");
String note = bizData.getString("note");
String payOrderId = bizData.getString("payOrderId");
String payType = bizData.getString("payType");
String payTime = bizData.getString("payTime");
long amount = bizData.getLongValue("amount");
long paidTime = DateUtil.parseDateTime(payTime).getTime();
if (!"TRADE_SUCCESS".equals(state)) {
log.error("支付失败:{},{}", state, note);
return Result.fail(state + ":" + note);
}
TbOrderInfo entity = orderService.selectByPayOrderNo(payOrderId);
if (entity == null) {
log.error("订单不存在:{}", payOrderId);
return Result.fail("订单不存在");
}
entity.setPaidTime(paidTime);
orderService.payCallbackCloseOrder(entity, payType, amount);
return Result.success(CodeEnum.SUCCESS);
}
/**
* 支付取消
*
* @return 影响数量
*/
@PostMapping("cancel")
public Result notifyCancel(@RequestBody HashMap<String, Integer> data) {
return Result.success(CodeEnum.SUCCESS, orderService.cancelOrder(data.get("orderId")));
}
}

View File

@ -3,12 +3,13 @@ package com.chaozhanggui.system.cashierservice.controller;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.annotation.MyLog;
import com.chaozhanggui.system.cashierservice.bean.LogTag;
import com.chaozhanggui.system.cashierservice.entity.OrderVo;
import com.chaozhanggui.system.cashierservice.entity.dto.ChoseCountDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.ReturnCartDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.UpdateVipDTO;
import com.chaozhanggui.system.cashierservice.entity.vo.CartVo;
import com.chaozhanggui.system.cashierservice.service.OrderService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import lombok.extern.slf4j.Slf4j;
@ -28,10 +29,7 @@ public class OrderController {
private OrderService orderService;
@PutMapping("/updateVip")
@MyLog(value = "代客下单 修改会员", tag = LogTag.PLACE)
public ResponseEntity<Object> updateVip(
@Validated @RequestBody UpdateVipDTO updateVipDTO
) {
public ResponseEntity<Object> updateVip(@Validated @RequestBody UpdateVipDTO updateVipDTO) {
return ResponseEntity.ok(orderService.updateVip(updateVipDTO));
}
@ -39,150 +37,192 @@ public class OrderController {
public Result createCart(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody CartVo cartVo
){
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
@Validated @RequestBody CartVo cartVo) {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userId = jsonObject.getString("accountId");
return orderService.createCart(cartVo.getMasterId(),cartVo.getProductId(),cartVo.getShopId(),
cartVo.getSkuId(),cartVo.getNumber(),userId,clientType,cartVo.getCartId(),cartVo.getIsGift(),
cartVo.getIsPack(),cartVo.getUuid(),cartVo.getType(), cartVo.getTableId(), cartVo.getVipUserId());
return orderService.createCart(cartVo.getMasterId(), cartVo.getProductId(), cartVo.getShopId(), cartVo.getSkuId(),
cartVo.getNumber(), userId, clientType, cartVo.getCartId(), cartVo.getIsGift(),
cartVo.getIsPack(), cartVo.getUuid(), cartVo.getType(), cartVo.getTableId());
}
@MyLog(value = "查询购物车信息", tag = LogTag.CART)
@GetMapping("/queryCart")
public Result queryCart(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam(value = "masterId", required = false) String masterId,
@RequestParam(required = false) Integer tableId,
@RequestParam(required = false) Integer vipUserId,
@RequestParam("shopId") String shopId
){
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam(value = "masterId", required = false) String masterId,
@RequestParam(required = false) String tableId,
@RequestParam("shopId") String shopId) {
if (tableId == null && StrUtil.isBlank(masterId)) {
return Result.fail("masterId和tableId不能同 时为空");
return Result.fail("masterId和tableId不能同时为空");
}
return orderService.queryCart(masterId,shopId, tableId, vipUserId);
return orderService.queryCart(masterId, shopId, tableId);
}
@GetMapping("/delCart")
public Result delCart(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam(value = "masterId", required = false) String masterId,
@RequestParam("cartId") Integer cartId
){
return orderService.delCart(masterId,cartId);
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam(required = false) String tableId,
@RequestParam(value = "masterId", required = false) String masterId,
@RequestParam("cartId") Integer cartId) {
return orderService.delCart(masterId, cartId);
}
@GetMapping("/createCode")
public Result createCode(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("shopId") String shopId,
@RequestParam(required = false) String tableId,
String type
){
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userId = jsonObject.getString("accountId");
return orderService.createCode(shopId,clientType,userId,type, tableId);
}
@GetMapping("/getCartList")
public Result getCart(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestParam("shopId") Integer shopId){
return orderService.getCartList(shopId);
}
@GetMapping("/getCartPrductSpec")
public Result getCartPrductSpec(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestParam("cartId") Integer cartId){
return orderService.getCartPrductSpec(cartId);
}
@PostMapping("/cartStatus")
public Result cartStatus(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestBody CartVo cartVo){
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("shopId") String shopId,
@RequestParam(required = false) String tableId, String type) {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userId = jsonObject.getString("accountId");
String code = jsonObject.getString("code");
return orderService.cartStatus(Integer.valueOf(cartVo.getShopId()),cartVo.getMasterId(),
cartVo.getStatus(),userId,cartVo.getUuid(),clientType, cartVo.getVipUserId(), cartVo.getTableId());
return orderService.createCode(shopId, clientType, userId, type, tableId);
}
@GetMapping("/getCartList")
public Result getCart(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("shopId") Integer shopId) {
return orderService.getCartList(shopId);
}
@GetMapping("/getCartPrductSpec")
public Result getCartPrductSpec(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("cartId") Integer cartId) {
return orderService.getCartPrductSpec(cartId);
}
@PostMapping("/cartStatus")
public Result cartStatus(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody CartVo cartVo) {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userId = jsonObject.getString("accountId");
return orderService.cartStatus(cartVo.getShopId(), cartVo.getMasterId(), cartVo.getStatus(), userId, cartVo.getUuid(), clientType, cartVo.getTableId(), token, cartVo.getOrderId());
}
@PostMapping("/createOrder")
public Result createOrder(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestBody OrderVo orderVo){
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
public Result createOrder(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody OrderVo orderVo) {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userId = jsonObject.getString("accountId");
orderVo.setMerchantId(Integer.valueOf(userId));
orderVo.setUserId(jsonObject.getString("staffId"));
return orderService.createOrder(orderVo,clientType,token, null, orderVo.getType() != null && orderVo.getType().equals(0));
return orderService.createOrder(orderVo, clientType, token, null);
}
@PostMapping("/createBackOrder")
public Result createBackOrder(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestBody OrderVo orderVo){
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
public Result createBackOrder(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody OrderVo orderVo) {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userId = jsonObject.getString("accountId");
orderVo.setMerchantId(Integer.valueOf(userId));
orderVo.setUserId(jsonObject.getString("staffId"));
return orderService.createBackOrder(orderVo,clientType,token);
return orderService.createBackOrder(orderVo, clientType, token);
}
@PostMapping("/packall")
public Result packall(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestBody CartVo cartVo){
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
public Result packall(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody CartVo cartVo) {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userId = jsonObject.getString("accountId");
return orderService.packall(cartVo);
}
@PostMapping("/clearCart")
public Result clearCart(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestBody CartVo cartVo){
public Result clearCart(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody CartVo cartVo) {
return orderService.clearCart(cartVo);
}
@GetMapping("/findOrder")
public Result findOrder(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestParam("shopId") Integer shopId,
public Result findOrder(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("shopId") Integer shopId,
@RequestParam("status") String status,
@RequestParam(value = "orderNo", required = false) String orderNo,
@RequestParam(value = "startTime", required = false) String startTime,
@RequestParam(value = "endTime", required = false) String endTime,
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size){
return orderService.findOrder(shopId,status,page,size,orderNo, DateUtil.parse(startTime), DateUtil.parse(endTime));
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size) {
return orderService.findOrder(shopId, status, page, size, orderNo, DateUtil.parse(startTime), DateUtil.parse(endTime));
}
@GetMapping("/orderDetail")
public Result orderDetail(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType, @RequestParam("shopId") Integer shopId,
@RequestParam("id") Integer id){
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
public Result orderDetail(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("shopId") Integer shopId,
@RequestParam("id") Integer id) {
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String userId = jsonObject.getString("accountId");
return orderService.orderDetail(shopId,id, clientType, token, userId, jsonObject.getString("staffId"));
return orderService.orderDetail(shopId, id, clientType, token, userId, jsonObject.getString("staffId"));
}
@RequestMapping(value = "sendMessage")
public Result sendMessage(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,@RequestParam("orderId") String orderId){
public Result sendMessage(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("orderId") String orderId) {
return orderService.sendMassage(orderId);
}
@GetMapping(value = "scanSendMessage")
public Result scanSendMessage(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,@RequestParam("outNumber") String outNumber,@RequestParam("shopId") String shopId){
return orderService.scanSendMessage(outNumber,shopId);
public Result scanSendMessage(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("outNumber") String outNumber,
@RequestParam("shopId") String shopId) {
return orderService.scanSendMessage(outNumber, shopId);
}
@GetMapping(value = "getsendMessage")
public Result getsendMessage(@RequestHeader("token") String token, @RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,@RequestParam("shopId") String shopId,@RequestParam("page") int page,
@RequestParam("pageSize") int pageSize){
return orderService.getOutNumber(shopId,page,pageSize);
public Result getsendMessage(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("shopId") String shopId,
@RequestParam("page") int page,
@RequestParam("pageSize") int pageSize) {
return orderService.getOutNumber(shopId, page, pageSize);
}
@GetMapping("getOrderById")
public Result getOrderById(@RequestParam("orderId") Integer orderId){
return orderService.getOrder(orderId);
public Result getOrderById(@RequestParam("orderId") Integer orderId) {
return orderService.getOrder(orderId);
}
/**
* 就餐人数选择
*/
@PutMapping("/choseCount")
public Result choseCount(@Validated @RequestBody ChoseCountDTO choseCountDTO) {
return Result.success(CodeEnum.SUCCESS, orderService.choseCount(choseCountDTO));
}
/**
* 退菜
* @param returnCartDTO 退菜信息
* @return 是否成功
*/
@PostMapping("/returnCart")
public Result returnCart(@Validated @RequestBody ReturnCartDTO returnCartDTO) {
return Result.success(CodeEnum.SUCCESS, orderService.returnCart(returnCartDTO));
}
}

View File

@ -1,49 +1,71 @@
package com.chaozhanggui.system.cashierservice.controller;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.AlipayConfig;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.AlipaySystemOauthTokenRequest;
import com.alipay.api.response.AlipaySystemOauthTokenResponse;
import com.chaozhanggui.system.cashierservice.annotation.LimitSubmit;
import com.chaozhanggui.system.cashierservice.dao.TbOrderInfoMapper;
import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
import com.chaozhanggui.system.cashierservice.entity.dto.ReturnGroupOrderDto;
import com.chaozhanggui.system.cashierservice.entity.dto.VipPayDTO;
import com.chaozhanggui.system.cashierservice.model.PaymentReq;
import com.chaozhanggui.system.cashierservice.service.PayService;
import com.chaozhanggui.system.cashierservice.service.ShopInfoService;
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.RedisCst;
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
import com.chaozhanggui.system.cashierservice.util.WechatUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@CrossOrigin(origins = "*")
@RestController
@Slf4j
@RequestMapping("pay")
public class PayController {
@Autowired
PayService payService;
@Autowired
private ShopInfoService shopInfoService;
@Autowired
private TbShopInfoMapper tbShopInfoMapper;
@Autowired
private TbOrderInfoMapper tbOrderInfoMapper;
@RequestMapping("queryPayType")
public Result queryPayType( @RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("shopId") String shopId
){
public Result queryPayType(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("shopId") String shopId) {
return payService.queryPayType(shopId);
}
/**
* 扫码支付
*
* @param request
* @param token
* @param loginName
@ -56,56 +78,55 @@ public class PayController {
@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody PaymentReq paymentReq
) {
return payService.scanPay(paymentReq.getOrderId(),paymentReq.getAuthCode(), IpUtil.getIpAddr(request),token,paymentReq.getPayAmount(),paymentReq.getDiscountAmount());
@RequestBody PaymentReq paymentReq) {
return payService.scanPay(paymentReq.getOrderId(), paymentReq.getAuthCode(), IpUtil.getIpAddr(request), token, paymentReq.getPayAmount(), paymentReq.getDiscountAmount());
}
/**
* 储值卡支付
*
* @param token
* @param loginName
* @param clientType
* @return
*/
@RequestMapping("accountPay")
@LimitSubmit(key = "accountPay:%s")
public Result accountPay(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody PaymentReq paymentReq
){
return payService.accountPay(paymentReq.getOrderId(),paymentReq.getMemberId(),token,paymentReq.getMemberAccount(),paymentReq.getPayAmount(),paymentReq.getDiscountAmount());
@RequestBody PaymentReq paymentReq) {
return payService.accountPay(paymentReq.getOrderId(), paymentReq.getMemberId(), token, paymentReq.getMemberAccount(), paymentReq.getPayAmount(), paymentReq.getDiscountAmount());
}
/**
* 快捷收款
*
* @param token
* @param loginName
* @param clientType
* @param amount
* @param authCode
* @param payType cash 现金 scanpay 扫码
* @param payType cash 现金 scanpay 扫码
* @return
*/
@GetMapping("quickPay")
@LimitSubmit(key = "quickPay:%s")
public Result quickPay(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("amount") String amount,
@RequestParam("authCode") String authCode,
@RequestParam("payType") String payType
){
return payService.quickPay(token,amount,authCode,payType);
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("amount") String amount,
@RequestParam("authCode") String authCode,
@RequestParam("payType") String payType) {
return payService.quickPay(token, amount, authCode, payType);
}
/**
* 查询快捷订单状态
*
* @param token
* @param loginName
* @param clientType
@ -113,16 +134,16 @@ public class PayController {
*/
@GetMapping("queryQuickPayStatus")
public Result queryQuickPayStatus(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("orderId") String orderId
){
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("orderId") String orderId) {
return payService.queryQuickPayStatus(orderId);
}
/**
* 获取快捷收款信息
*
* @param token
* @param loginName
* @param clientType
@ -132,21 +153,16 @@ public class PayController {
*/
@GetMapping("queryQuickPay")
public Result queryQuickPay(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("page") Integer page,
@RequestParam("pageSize") Integer pageSize
){
return payService.queryQuickPay(token,page,pageSize);
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("page") Integer page,
@RequestParam("pageSize") Integer pageSize) {
return payService.queryQuickPay(token, page, pageSize);
}
/**
* 会员扫码支付
*
* @param token
* @param loginName
* @param clientType
@ -155,17 +171,16 @@ public class PayController {
@RequestMapping("memberScanPay")
@LimitSubmit(key = "memberScanPay:%s")
public Result memberScanPay(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody PaymentReq paymentReq
){
return payService.memberScanPay(paymentReq.getOrderId(),paymentReq.getMemberCode(),token,paymentReq.getPayAmount(),paymentReq.getDiscountAmount());
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody PaymentReq paymentReq) {
return payService.memberScanPay(paymentReq.getOrderId(), paymentReq.getMemberCode(), token, paymentReq.getPayAmount(), paymentReq.getDiscountAmount());
}
/**
* 现金支付
*
* @param token
* @param loginName
* @param clientType
@ -176,14 +191,14 @@ public class PayController {
public Result cashPay(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody PaymentReq paymentReq){
@RequestBody PaymentReq paymentReq) {
Result result = payService.cashPay(paymentReq.getOrderId(), token, paymentReq.getPayAmount(), paymentReq.getDiscountAmount());
return result;
}
/**
* 会员支付
*
* @param token
* @param loginName
* @param clientType
@ -192,29 +207,23 @@ public class PayController {
@PostMapping("vipPay")
@LimitSubmit(key = "vipPay:%s")
public Result vipPay(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody VipPayDTO vipPayDTO
){
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody VipPayDTO vipPayDTO) {
if (vipPayDTO.getOrderId() == null || vipPayDTO.getVipUserId() == null) {
return Result.fail("参数缺失");
}
if (
(vipPayDTO.getPayAmount() != null && vipPayDTO.getPayAmount().compareTo(BigDecimal.ZERO) <= 0) ||
(vipPayDTO.getDiscountAmount() != null && vipPayDTO.getDiscountAmount().compareTo(BigDecimal.ZERO) <= 0)
) {
if ((vipPayDTO.getPayAmount() != null && vipPayDTO.getPayAmount().compareTo(BigDecimal.ZERO) <= 0) ||
(vipPayDTO.getDiscountAmount() != null && vipPayDTO.getDiscountAmount().compareTo(BigDecimal.ZERO) <= 0)) {
return Result.fail("折扣金额必须大于0");
}
return payService.vipPay(vipPayDTO.getOrderId(),token, vipPayDTO.getVipUserId(), vipPayDTO.getPayAmount(), vipPayDTO.getDiscountAmount());
return payService.vipPay(vipPayDTO.getOrderId(), token, vipPayDTO.getVipUserId(), vipPayDTO.getPayAmount(), vipPayDTO.getDiscountAmount());
}
/**
* 银行卡支付
*
* @param token
* @param loginName
* @param clientType
@ -225,12 +234,10 @@ public class PayController {
public Result bankPay(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestBody PaymentReq paymentReq){
return payService.bankPay(paymentReq.getOrderId(),token,paymentReq.getPayAmount(),paymentReq.getDiscountAmount());
@RequestBody PaymentReq paymentReq) {
return payService.bankPay(paymentReq.getOrderId(), token, paymentReq.getPayAmount(), paymentReq.getDiscountAmount());
}
@RequestMapping("returnOrder")
@LimitSubmit(key = "returnOrder:%s", limit = 10)
public Result returnOrder(@RequestHeader("token") String token,
@ -238,12 +245,8 @@ public class PayController {
@RequestHeader("clientType") String clientType,
@RequestBody List<TbOrderDetail> list,
@RequestParam("pwd") String pwd,
@RequestParam(defaultValue = "true") boolean isOnline
){
return payService.returnOrder(list,token,pwd, isOnline);
@RequestParam(defaultValue = "true") boolean isOnline) {
return payService.returnOrder(list, token, pwd, isOnline);
}
@ -251,31 +254,174 @@ public class PayController {
public Result queryOrder(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("orderId") String orderId){
return payService.queryOrder(orderId,token);
@RequestParam("orderId") String orderId) {
return payService.queryOrder(orderId, token);
}
@RequestMapping("returnGpOrder")
public Result returnOrder(@RequestBody ReturnGroupOrderDto param){
public Result returnOrder(@RequestBody ReturnGroupOrderDto param) {
return payService.returnGroupOrder(param);
}
@RequestMapping("test")
@LimitSubmit(key = "testOrder:%s")
public Result testOrder( @RequestParam("orderId") String orderId){
public Result testOrder(@RequestParam("orderId") String orderId) {
return Result.success(CodeEnum.SUCCESS);
}
@RequestMapping("getOrderDiscount")
public Result getOrderDiscount(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@RequestHeader("clientType") String clientType,
@RequestParam("orderId") String orderId,
@RequestParam("staffId") String staffId
){
@RequestParam("staffId") String staffId) {
return payService.getOrderDiscount(staffId, orderId, token);
}
@RequestMapping("pcscanpay")
@LimitSubmit(key = "pcscanpay:%s")
public Result pcscanpay(HttpServletRequest request, @RequestBody PaymentReq paymentReq) {
try {
return payService.pcscanpay(paymentReq.getOrderId(), IpUtil.getIpAddr(request), paymentReq.getUserId(), paymentReq.getPayType());
} catch (Exception e) {
e.printStackTrace();
}
return Result.fail(CodeEnum.FAIL);
}
@RequestMapping("createOrder")
public Result createOrder(HttpServletRequest request, @RequestBody PaymentReq paymentReq) {
try {
return payService.createOrder(IpUtil.getIpAddr(request), paymentReq.getUserId(), paymentReq.getPayType(),
paymentReq.getShopId(), paymentReq.getOrderId(), paymentReq.getPayAmount(), paymentReq.getRemark());
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return Result.fail(CodeEnum.FAIL);
}
@GetMapping("queryOrderPay")
public Result queryOrderPay(String orderId) {
return payService.queryOrderPay(orderId);
}
@GetMapping("/noToken/queryOrderInfo")
public Result noTokenQueryOrderInfo(String orderId) {
if(StrUtil.isBlank(orderId)){
return Result.fail("订单id不能为空");
}
TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId));
if(orderInfo == null){
return Result.fail("订单不存在");
}
Map<String, Object> data = new HashMap<>(4);
data.put("id", orderInfo.getId());
data.put("orderNo", orderInfo.getOrderNo());
data.put("payAmount", orderInfo.getPayAmount());
data.put("orderAmount", orderInfo.getOrderAmount());
return Result.success(CodeEnum.SUCCESS, data);
}
@Value("${wx.ysk.appId}")
private String appId;
@Value("${wx.ysk.secrete}")
private String secrete;
@Value("${ali.appId}")
private String aliAppId;
@Value("${ali.privateKey}")
private String privateKey;
@Value("${ali.publicKey}")
private String publicKey;
/**
* 获取支付宝或微信openId
*
* @param code
* @return
*/
@GetMapping("/openId")
public Result getOpenId(@RequestParam String code, @RequestParam String payType,
@RequestParam String shopId) throws AlipayApiException {
if (StrUtil.isBlank(shopId)) {
return Result.fail("店铺ID不能为空");
}
// 查询店铺信息
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
if (Objects.isNull(shopInfo)) {
return Result.fail("店铺不存在");
}
Map<String, Object> data = new HashMap<>(4);
data.put("shopId", shopInfo.getId());
data.put("shopName", shopInfo.getShopName());
data.put("shopImage", shopInfo.getCoverImg());
if ("WECHAT".equals(payType)) {
JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(code, appId, secrete);
log.info("SessionKeyOpenId:{}", SessionKeyOpenId.toString());
String openid = SessionKeyOpenId.getString("openid");
if (Objects.isNull(openid)) {
return Result.fail("获取微信id失败");
}
data.put("openId", openid);
return Result.success(CodeEnum.SUCCESS, data);
} else if ("ALIPAY".equals(payType)) {
// 初始化SDK
AlipayClient alipayClient = new DefaultAlipayClient(getAlipayConfig());
// 构造请求参数以调用接口
AlipaySystemOauthTokenRequest request = new AlipaySystemOauthTokenRequest();
// 设置授权码
request.setCode(code);
// 设置授权方式
request.setGrantType("authorization_code");
AlipaySystemOauthTokenResponse response = alipayClient.execute(request);
log.info("AlipaySystemOauthTokenResponse:{}", JSONUtil.toJSONString(response));
response.setAccessToken(response.getRefreshToken());
if (!response.isSuccess()) {
return Result.fail("获取支付宝userId失败");
}
String openid = ObjectUtil.isNull(response.getUserId()) ? response.getOpenId() : response.getUserId();
data.put("openId", openid);
return Result.success(CodeEnum.SUCCESS, data);
}
return Result.fail(CodeEnum.FAIL);
}
private AlipayConfig getAlipayConfig() {
AlipayConfig alipayConfig = new AlipayConfig();
alipayConfig.setServerUrl("https://openapi.alipay.com/gateway.do");
alipayConfig.setAppId(aliAppId);
alipayConfig.setPrivateKey(privateKey);
alipayConfig.setFormat("json");
alipayConfig.setAlipayPublicKey(publicKey);
alipayConfig.setCharset("UTF-8");
alipayConfig.setSignType("RSA2");
return alipayConfig;
}
public static void main(String[] args) {
LocalDate date = LocalDate.now();
if (date.isLeapYear()) {
System.out.println();
}
}
}

View File

@ -1,12 +1,14 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStatusDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStockDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.QuerySpecDTO;
import com.chaozhanggui.system.cashierservice.service.ProductService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
@ -36,9 +38,12 @@ public class ProductController {
@PutMapping("/productStock")
public Result productStock(
@RequestHeader("token") String token,
@Valid @RequestBody ProductStockDTO productStockDTO
) {
productService.updateStock(productStockDTO);
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
String loginName = jsonObject.getString("loginName");
productService.updateStock(productStockDTO,loginName);
return Result.success(CodeEnum.SUCCESS);
}

View File

@ -1,7 +1,9 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.entity.dto.ClearTableDTO;
import com.chaozhanggui.system.cashierservice.service.ShopInfoService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,6 +19,11 @@ public class ShopInfoController {
@Autowired
ShopInfoService shopInfoService;
@GetMapping("/queryShopInfo")
public Result queryShopInfo(@RequestParam Integer shopId){
return shopInfoService.queryShopInfo(shopId);
}
@GetMapping("queryShopArea")
public Result queryShopArea(@RequestHeader("token") String token,
@RequestHeader("loginName") String loginName,
@ -42,6 +49,13 @@ public class ShopInfoController {
return shopInfoService.queryShopTable(shopId, areaId, status, page, pageSize);
}
@PutMapping("clearTable")
public Result queryShopTable(
@RequestBody ClearTableDTO clearTableDTO
) {
return Result.success(CodeEnum.SUCCESS, shopInfoService.cleatTable(clearTableDTO));
}
@GetMapping("queryDuty")
public Result queryDuty(@RequestHeader("token") String token,
@RequestParam("page") int page,

View File

@ -0,0 +1,33 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.entity.TbPrintMachineLog;
import com.chaozhanggui.system.cashierservice.service.ShopPrintLogService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.Map;
/**
* 店铺小票打印记录
* @author tankaikai
* @since 2024-10-09 17:14
*/
@Slf4j
@RestController
@CrossOrigin(origins = "*")
@RequestMapping("shop/print/log")
public class ShopPrintLogController {
@Resource
private ShopPrintLogService shopPrintLogService;
@GetMapping("page")
public Result page(@RequestParam Map<String, Object> params) {
PageInfo<TbPrintMachineLog> page = shopPrintLogService.page(params);
return Result.success(CodeEnum.SUCCESS, page);
}
}

View File

@ -0,0 +1,71 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.entity.dto.ShopPrinterDTO;
import com.chaozhanggui.system.cashierservice.service.ShopPrinterService;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* 店铺打印机配置
*
* @author tankaikai
* @since 2024-09-24 16:56
*/
@Slf4j
@RestController
@CrossOrigin(origins = "*")
@RequestMapping("shop-config/printer")
public class ShopPrinterController {
@Resource
private ShopPrinterService shopPrinterService;
@GetMapping("page")
public Result page(@RequestHeader String token, @RequestParam Map<String, Object> params) {
PageInfo<ShopPrinterDTO> page = shopPrinterService.page(params);
return Result.success(CodeEnum.SUCCESS, page);
}
@GetMapping("list")
public Result list(@RequestParam Map<String, Object> params) {
List<ShopPrinterDTO> list = shopPrinterService.list(params);
return Result.success(CodeEnum.SUCCESS, list);
}
@GetMapping("{id}")
public Result get(@PathVariable("id") Integer id) {
ShopPrinterDTO dto = shopPrinterService.get(id);
return Result.success(CodeEnum.SUCCESS, dto);
}
@PostMapping
public Result save(@RequestBody ShopPrinterDTO dto) {
shopPrinterService.save(dto);
return Result.success(CodeEnum.SUCCESS);
}
@PutMapping
public Result update(@RequestBody ShopPrinterDTO dto) {
shopPrinterService.update(dto);
return Result.success(CodeEnum.SUCCESS);
}
@DeleteMapping("{id}")
public Result delete(@PathVariable("id") Integer id) {
shopPrinterService.delete(id);
return Result.success(CodeEnum.SUCCESS);
}
@PostMapping("update-status")
public Result updateStatus(@RequestBody ShopPrinterDTO dto) {
shopPrinterService.updateStatus(dto.getId(), dto.getStatus());
return Result.success(CodeEnum.SUCCESS);
}
}

View File

@ -0,0 +1,25 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.service.TbShopPermissionService;
import com.chaozhanggui.system.cashierservice.service.TbShopStaffPermissionService;
import com.chaozhanggui.system.cashierservice.sign.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Slf4j
@RequestMapping("staffPermission")
public class StaffPermissionController {
@Autowired
private TbShopPermissionService permissionService;
@GetMapping
public Result getStaffPermission(String staffId, String code) {
return permissionService.getStaffPermission(staffId, code);
}
}

View File

@ -0,0 +1,40 @@
package com.chaozhanggui.system.cashierservice.controller;
import com.chaozhanggui.system.cashierservice.entity.TbVersion;
import com.chaozhanggui.system.cashierservice.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author yijiegong
*/
@RestController
@RequestMapping("/version")
public class VersionController {
@Autowired
LoginService loginService;
@GetMapping("pcDownload")
public ResponseEntity<Void> pcDownload(HttpServletRequest request, HttpServletResponse response) {
TbVersion pcVersion = loginService.getCurrentPcVersion();
if (pcVersion == null) {
throw new RuntimeException("未找到PC版本信息");
}
// 重定向到下载地址
HttpHeaders headers = new HttpHeaders();
headers.setLocation(java.net.URI.create(pcVersion.getUrl()));
return new ResponseEntity<>(headers, HttpStatus.FOUND);
}
}

View File

@ -0,0 +1,19 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.dto.ShopPrinterDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author tankaikai
* @since 2024-09-24 17:25
*/
@Mapper
public interface ShopPrinterServiceMapper {
List<ShopPrinterDTO> getList(Map<String, Object> params);
int updateStatus(@Param("id") Integer id, @Param("status") Integer status);
}

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Mapper
@Component
public interface ShopUserDutyDetailMapper {
int deleteByPrimaryKey(Integer id);
@ -26,4 +24,4 @@ public interface ShopUserDutyDetailMapper {
List<ShopUserDutyDetail> selectByDuctId(@Param("id") Integer id, @Param("list") List<Integer> list);
List<ShopUserDutyDetail> selectAllByDuctId(@Param("id") Integer id);
}
}

View File

@ -9,8 +9,6 @@ import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
@Component
@Mapper
public interface ShopUserDutyMapper {
int deleteByPrimaryKey(Integer id);
@ -47,4 +45,4 @@ public interface ShopUserDutyMapper {
List<ProductInfo> selectByDutyId(Integer dutyId);
}
}

View File

@ -10,8 +10,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@Component
@Mapper
public interface ShopUserDutyPayMapper {
int deleteByPrimaryKey(Integer id);
@ -34,4 +32,4 @@ public interface ShopUserDutyPayMapper {
List<Map<String,Object>> selectCetoryBydutyId(Integer dutyId);
List<ProductInfoPO> selectProductByDutyId(Integer dutyId);
}
}

View File

@ -11,8 +11,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbCashierCartMapper {
int deleteByPrimaryKey(Integer id);

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbConsInfoFlowMapper {
int deleteByPrimaryKey(Integer id);
@ -23,4 +21,4 @@ public interface TbConsInfoFlowMapper {
int updateByPrimaryKey(TbConsInfoFlow record);
void insertBatch(@Param("list")List<TbConsInfoFlow> list);
}
}

View File

@ -8,8 +8,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbConsInfoMapper {
int deleteByPrimaryKey(Integer id);
@ -27,4 +25,4 @@ public interface TbConsInfoMapper {
int countAll();
List<TbConsInfo> selectAllInfo();
}
}

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.TbMemberIn;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbMemberInMapper {
int deleteByPrimaryKey(Integer id);
@ -18,4 +16,4 @@ public interface TbMemberInMapper {
int updateByPrimaryKeySelective(TbMemberIn record);
int updateByPrimaryKey(TbMemberIn record);
}
}

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.TbMerchantThirdApply;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbMerchantThirdApplyMapper {
int deleteByPrimaryKey(Integer id);
@ -20,4 +18,4 @@ public interface TbMerchantThirdApplyMapper {
int updateByPrimaryKeyWithBLOBs(TbMerchantThirdApply record);
int updateByPrimaryKey(TbMerchantThirdApply record);
}
}

View File

@ -10,8 +10,6 @@ import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.List;
@Mapper
@Component
public interface TbOrderDetailMapper {
int deleteByPrimaryKey(Integer id);
@ -43,4 +41,4 @@ public interface TbOrderDetailMapper {
int batchInsert(@Param("list") List<TbOrderDetail> list,@Param("orderId") String orderId);
TbOrderDetail selectByOrderIdAndSkuId(@Param("orderId") int orderId, @Param("skuId") Integer skuId);
}
}

View File

@ -12,8 +12,6 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
@Component
@Mapper
public interface TbOrderInfoMapper {
int deleteByPrimaryKey(Integer id);

View File

@ -7,12 +7,10 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbOrderOutNumberMapper {
int insert(TbOrderOutNumber record);
int insertSelective(TbOrderOutNumber record);
List<TbOrderOutNumber> selectAll(@Param("shopId") String shopId);
}
}

View File

@ -1,11 +1,10 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbOrderPayment;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Component
@Mapper
public interface TbOrderPaymentMapper {
int deleteByPrimaryKey(Integer id);
@ -20,4 +19,6 @@ public interface TbOrderPaymentMapper {
int updateByPrimaryKey(TbOrderPayment record);
TbOrderPayment selectByOrderId(String orderId);
}
List<TbOrderPayment> selectListByOrderId(@Param("orderId") String orderId);
}

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.TbPlussShopStaff;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbPlussShopStaffMapper {
int deleteByPrimaryKey(Integer id);
@ -21,4 +19,4 @@ public interface TbPlussShopStaffMapper {
TbPlussShopStaff selectByAccount(String account);
TbPlussShopStaff selectByAccountAndShopId(String account,String shopId);
}
}

View File

@ -0,0 +1,15 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chaozhanggui.system.cashierservice.entity.TbPrintMachineLog;
import org.apache.ibatis.annotations.Mapper;
/**
* 店铺小票打印记录
*
* @author tankaikai
* @since 2024-10-8 16:37
*/
@Mapper
public interface TbPrintMachineLogMapper extends BaseMapper<TbPrintMachineLog> {
}

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbPrintMachineMapper {
int deleteByPrimaryKey(Integer id);
@ -25,4 +23,4 @@ public interface TbPrintMachineMapper {
int updateByPrimaryKey(TbPrintMachine record);
List<TbPrintMachineWithBLOBs> selectByShopId(String shopId);
}
}

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbPrintPCMachineMapper {
/**

View File

@ -11,8 +11,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbProductMapper {
int deleteByPrimaryKey(Integer id);

View File

@ -11,8 +11,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbProductSkuMapper {
int deleteByPrimaryKey(Integer id);

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.TbProductSkuResult;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbProductSkuResultMapper {
int deleteByPrimaryKey(Integer id);
@ -20,4 +18,4 @@ public interface TbProductSkuResultMapper {
int updateByPrimaryKeyWithBLOBs(TbProductSkuResult record);
int updateByPrimaryKey(TbProductSkuResult record);
}
}

View File

@ -5,8 +5,6 @@ import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbProductSpecMapper {
int deleteByPrimaryKey(Integer id);
@ -22,4 +20,4 @@ public interface TbProductSpecMapper {
int updateByPrimaryKey(TbProductSpec record);
}
}

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbProskuConMapper {
int deleteByPrimaryKey(Integer id);

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbQuickPayMapper {
int deleteByPrimaryKey(Integer id);
@ -25,4 +23,4 @@ public interface TbQuickPayMapper {
List<TbQuickPay> selectByShopIdAndStaffId(@Param("shopId") Integer shopId,@Param("staffId") Integer staffId);
TbQuickPay selectByOrderNo(String orderNo);
}
}

View File

@ -6,8 +6,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbShopAreaMapper {
int deleteByPrimaryKey(Integer id);
@ -24,4 +22,4 @@ public interface TbShopAreaMapper {
int updateByPrimaryKey(TbShopArea record);
List<TbShopArea> selectByShopId(String shopId);
}
}

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbShopCategoryMapper {
int deleteByPrimaryKey(Integer id);
@ -24,4 +22,4 @@ public interface TbShopCategoryMapper {
List<TbShopCategory> selectByAll(String shopId);
List<ShopCategoryVo> queryAllCategory(String shopId);
}
}

View File

@ -6,8 +6,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbShopInfoMapper {
int deleteByPrimaryKey(Integer id);
@ -29,4 +27,4 @@ public interface TbShopInfoMapper {
}
}

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.TbShopOnline;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbShopOnlineMapper {
int deleteByPrimaryKey(Integer shopId);
@ -18,4 +16,4 @@ public interface TbShopOnlineMapper {
int updateByPrimaryKeySelective(TbShopOnline record);
int updateByPrimaryKey(TbShopOnline record);
}
}

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbShopPayTypeMapper {
int deleteByPrimaryKey(Integer id);
@ -27,4 +25,4 @@ public interface TbShopPayTypeMapper {
int countSelectByShopIdAndPayType(@Param("shopId") String shopId, @Param("payType") String payType );
}
}

View File

@ -0,0 +1,15 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chaozhanggui.system.cashierservice.entity.TbShopPermission;
/**
* (TbShopPermission)表数据库访问层
*
* @author makejava
* @since 2024-09-14 17:08:48
*/
public interface TbShopPermissionDao extends BaseMapper<TbShopPermission> {
}

View File

@ -0,0 +1,15 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.chaozhanggui.system.cashierservice.entity.TbShopStaffPermission;
/**
* 店铺员工权限关联表(TbShopStaffPermission)表数据库访问层
*
* @author makejava
* @since 2024-09-14 17:07:33
*/
public interface TbShopStaffPermissionDao extends BaseMapper<TbShopStaffPermission> {
}

View File

@ -8,8 +8,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbShopTableMapper {
int deleteByPrimaryKey(Integer id);

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
@Component
@Mapper
public interface TbShopUserFlowMapper {
int deleteByPrimaryKey(Integer id);
@ -23,4 +21,4 @@ public interface TbShopUserFlowMapper {
int updateByPrimaryKey(TbShopUserFlow record);
List<Map<String,Object>> selectByMemberAccountFlow(String memberId);
}
}

View File

@ -7,8 +7,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbShopUserMapper {
int deleteByPrimaryKey(Integer id);
@ -30,4 +28,4 @@ public interface TbShopUserMapper {
TbShopUser selectByUserIdAndShopId(@Param("userId") String userId,@Param("shopId") String shopId);
TbShopUser selectByShopIdAndDdynamicCode(@Param("shopId") String shopId,@Param("memberAccount") String memberAccount);
}
}

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.TbToken;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbTokenMapper {
int deleteByPrimaryKey(Integer id);
@ -20,4 +18,4 @@ public interface TbTokenMapper {
int updateByPrimaryKey(TbToken record);
TbToken selectByToken(String token);
}
}

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbUserInfoMapper {
int deleteByPrimaryKey(Integer id);
@ -23,4 +21,4 @@ public interface TbUserInfoMapper {
TbUserInfo selectByPhone(String phone);
int selectCountByPhone(String phone);
}
}

View File

@ -8,8 +8,6 @@ import org.springframework.stereotype.Component;
import java.util.List;
@Component
@Mapper
public interface TbUserShopMsgMapper {
int deleteByPrimaryKey(Integer id);
@ -28,4 +26,4 @@ public interface TbUserShopMsgMapper {
List<TbUserShopMsg> selectAllByShopId(@Param("shopId") Integer shopId);
}
}

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.TbmerchantAccount;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface TbmerchantAccountMapper {
int deleteByPrimaryKey(Integer id);
@ -23,4 +21,4 @@ public interface TbmerchantAccountMapper {
TbmerchantAccount selectByAccount(String account);
}
}

View File

@ -4,8 +4,6 @@ import com.chaozhanggui.system.cashierservice.entity.tbHandover;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
@Component
@Mapper
public interface tbHandoverMapper {
int deleteByPrimaryKey(Integer id);
@ -18,4 +16,4 @@ public interface tbHandoverMapper {
int updateByPrimaryKeySelective(tbHandover record);
int updateByPrimaryKey(tbHandover record);
}
}

View File

@ -2,6 +2,8 @@ package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.util.List;
@Data
@ -15,4 +17,10 @@ public class OrderVo {
private String tableId;
private Integer vipUserId;
private Integer type;
private String sendType;
private String eatModel;
@Min(1)
private Integer seatNum;
}

View File

@ -0,0 +1,315 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
/**
*
* @TableName tb_call_config
*/
@TableName(value ="tb_call_config")
public class TbCallConfig implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 小程序页面地址
*/
private String pageAddress;
/**
* 线上取号 1是 0否
*/
private Integer isOnline;
/**
* 背景图片
*/
private String bgCover;
/**
* 成功提示
*/
private String successMsg;
/**
* 临近提示
*/
private String nearMsg;
/**
* 过号提示
*/
private String callingMsg;
/**
* 店铺id
*/
private Integer shopId;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 是否过号顺延
*/
private Integer isPostpone;
/**
* 顺延号码数量
*/
private Integer postponeNum;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 小程序页面地址
*/
public String getPageAddress() {
return pageAddress;
}
/**
* 小程序页面地址
*/
public void setPageAddress(String pageAddress) {
this.pageAddress = pageAddress;
}
/**
* 线上取号 1是 0否
*/
public Integer getIsOnline() {
return isOnline;
}
/**
* 线上取号 1是 0否
*/
public void setIsOnline(Integer isOnline) {
this.isOnline = isOnline;
}
/**
* 背景图片
*/
public String getBgCover() {
return bgCover;
}
/**
* 背景图片
*/
public void setBgCover(String bgCover) {
this.bgCover = bgCover;
}
/**
* 成功提示
*/
public String getSuccessMsg() {
return successMsg;
}
/**
* 成功提示
*/
public void setSuccessMsg(String successMsg) {
this.successMsg = successMsg;
}
/**
* 临近提示
*/
public String getNearMsg() {
return nearMsg;
}
/**
* 临近提示
*/
public void setNearMsg(String nearMsg) {
this.nearMsg = nearMsg;
}
/**
* 过号提示
*/
public String getCallingMsg() {
return callingMsg;
}
/**
* 过号提示
*/
public void setCallingMsg(String callingMsg) {
this.callingMsg = callingMsg;
}
/**
* 店铺id
*/
public Integer getShopId() {
return shopId;
}
/**
* 店铺id
*/
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
/**
*
*/
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 getIsPostpone() {
return isPostpone;
}
/**
* 是否过号顺延
*/
public void setIsPostpone(Integer isPostpone) {
this.isPostpone = isPostpone;
}
/**
* 顺延号码数量
*/
public Integer getPostponeNum() {
return postponeNum;
}
/**
* 顺延号码数量
*/
public void setPostponeNum(Integer postponeNum) {
this.postponeNum = postponeNum;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
TbCallConfig other = (TbCallConfig) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getPageAddress() == null ? other.getPageAddress() == null : this.getPageAddress().equals(other.getPageAddress()))
&& (this.getIsOnline() == null ? other.getIsOnline() == null : this.getIsOnline().equals(other.getIsOnline()))
&& (this.getBgCover() == null ? other.getBgCover() == null : this.getBgCover().equals(other.getBgCover()))
&& (this.getSuccessMsg() == null ? other.getSuccessMsg() == null : this.getSuccessMsg().equals(other.getSuccessMsg()))
&& (this.getNearMsg() == null ? other.getNearMsg() == null : this.getNearMsg().equals(other.getNearMsg()))
&& (this.getCallingMsg() == null ? other.getCallingMsg() == null : this.getCallingMsg().equals(other.getCallingMsg()))
&& (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getIsPostpone() == null ? other.getIsPostpone() == null : this.getIsPostpone().equals(other.getIsPostpone()))
&& (this.getPostponeNum() == null ? other.getPostponeNum() == null : this.getPostponeNum().equals(other.getPostponeNum()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getPageAddress() == null) ? 0 : getPageAddress().hashCode());
result = prime * result + ((getIsOnline() == null) ? 0 : getIsOnline().hashCode());
result = prime * result + ((getBgCover() == null) ? 0 : getBgCover().hashCode());
result = prime * result + ((getSuccessMsg() == null) ? 0 : getSuccessMsg().hashCode());
result = prime * result + ((getNearMsg() == null) ? 0 : getNearMsg().hashCode());
result = prime * result + ((getCallingMsg() == null) ? 0 : getCallingMsg().hashCode());
result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getIsPostpone() == null) ? 0 : getIsPostpone().hashCode());
result = prime * result + ((getPostponeNum() == null) ? 0 : getPostponeNum().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", pageAddress=").append(pageAddress);
sb.append(", isOnline=").append(isOnline);
sb.append(", bgCover=").append(bgCover);
sb.append(", successMsg=").append(successMsg);
sb.append(", nearMsg=").append(nearMsg);
sb.append(", callingMsg=").append(callingMsg);
sb.append(", shopId=").append(shopId);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isPostpone=").append(isPostpone);
sb.append(", postponeNum=").append(postponeNum);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,469 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
/**
*
* @TableName tb_call_queue
*/
@TableName(value ="tb_call_queue")
public class TbCallQueue implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 叫号台桌类型id
*/
private Integer callTableId;
/**
* 手机号
*/
private String phone;
/**
* 姓名
*/
private String name;
/**
* 店铺名称
*/
private String shopName;
/**
* 店铺id
*/
private Integer shopId;
/**
* -1已取消 0排队中 1叫号中 2已入座 3 已过号
*/
private Integer state;
/**
* 排号时间
*/
private Date createTime;
/**
* 叫号时间
*/
private Date callTime;
/**
* 叫号次数
*/
private Integer callCount;
/**
* 过号时间
*/
private Date passTime;
/**
* 取消时间
*/
private Date cancelTime;
/**
* 备注
*/
private String note;
/**
*
*/
private Integer userId;
/**
*
*/
private String openId;
/**
* 订阅提醒 0未订阅 1已订阅
*/
private Integer subState;
/**
* 确认时间
*/
private Date confirmTime;
/**
* 叫号号码
*/
private String callNum;
/**
* 创建年月日
*/
private String createDay;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/**
*
*/
public Integer getId() {
return id;
}
/**
*
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 叫号台桌类型id
*/
public Integer getCallTableId() {
return callTableId;
}
/**
* 叫号台桌类型id
*/
public void setCallTableId(Integer callTableId) {
this.callTableId = callTableId;
}
/**
* 手机号
*/
public String getPhone() {
return phone;
}
/**
* 手机号
*/
public void setPhone(String phone) {
this.phone = phone;
}
/**
* 姓名
*/
public String getName() {
return name;
}
/**
* 姓名
*/
public void setName(String name) {
this.name = name;
}
/**
* 店铺名称
*/
public String getShopName() {
return shopName;
}
/**
* 店铺名称
*/
public void setShopName(String shopName) {
this.shopName = shopName;
}
/**
* 店铺id
*/
public Integer getShopId() {
return shopId;
}
/**
* 店铺id
*/
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
/**
* -1已取消 0排队中 1叫号中 2已入座 3 已过号
*/
public Integer getState() {
return state;
}
/**
* -1已取消 0排队中 1叫号中 2已入座 3 已过号
*/
public void setState(Integer state) {
this.state = state;
}
/**
* 排号时间
*/
public Date getCreateTime() {
return createTime;
}
/**
* 排号时间
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* 叫号时间
*/
public Date getCallTime() {
return callTime;
}
/**
* 叫号时间
*/
public void setCallTime(Date callTime) {
this.callTime = callTime;
}
/**
* 叫号次数
*/
public Integer getCallCount() {
return callCount;
}
/**
* 叫号次数
*/
public void setCallCount(Integer callCount) {
this.callCount = callCount;
}
/**
* 过号时间
*/
public Date getPassTime() {
return passTime;
}
/**
* 过号时间
*/
public void setPassTime(Date passTime) {
this.passTime = passTime;
}
/**
* 取消时间
*/
public Date getCancelTime() {
return cancelTime;
}
/**
* 取消时间
*/
public void setCancelTime(Date cancelTime) {
this.cancelTime = cancelTime;
}
/**
* 备注
*/
public String getNote() {
return note;
}
/**
* 备注
*/
public void setNote(String note) {
this.note = note;
}
/**
*
*/
public Integer getUserId() {
return userId;
}
/**
*
*/
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
*
*/
public String getOpenId() {
return openId;
}
/**
*
*/
public void setOpenId(String openId) {
this.openId = openId;
}
/**
* 订阅提醒 0未订阅 1已订阅
*/
public Integer getSubState() {
return subState;
}
/**
* 订阅提醒 0未订阅 1已订阅
*/
public void setSubState(Integer subState) {
this.subState = subState;
}
/**
* 确认时间
*/
public Date getConfirmTime() {
return confirmTime;
}
/**
* 确认时间
*/
public void setConfirmTime(Date confirmTime) {
this.confirmTime = confirmTime;
}
/**
* 叫号号码
*/
public String getCallNum() {
return callNum;
}
/**
* 叫号号码
*/
public void setCallNum(String callNum) {
this.callNum = callNum;
}
/**
* 创建年月日
*/
public String getCreateDay() {
return createDay;
}
/**
* 创建年月日
*/
public void setCreateDay(String createDay) {
this.createDay = createDay;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
TbCallQueue other = (TbCallQueue) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getCallTableId() == null ? other.getCallTableId() == null : this.getCallTableId().equals(other.getCallTableId()))
&& (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getShopName() == null ? other.getShopName() == null : this.getShopName().equals(other.getShopName()))
&& (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getCallTime() == null ? other.getCallTime() == null : this.getCallTime().equals(other.getCallTime()))
&& (this.getCallCount() == null ? other.getCallCount() == null : this.getCallCount().equals(other.getCallCount()))
&& (this.getPassTime() == null ? other.getPassTime() == null : this.getPassTime().equals(other.getPassTime()))
&& (this.getCancelTime() == null ? other.getCancelTime() == null : this.getCancelTime().equals(other.getCancelTime()))
&& (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
&& (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
&& (this.getOpenId() == null ? other.getOpenId() == null : this.getOpenId().equals(other.getOpenId()))
&& (this.getSubState() == null ? other.getSubState() == null : this.getSubState().equals(other.getSubState()))
&& (this.getConfirmTime() == null ? other.getConfirmTime() == null : this.getConfirmTime().equals(other.getConfirmTime()))
&& (this.getCallNum() == null ? other.getCallNum() == null : this.getCallNum().equals(other.getCallNum()))
&& (this.getCreateDay() == null ? other.getCreateDay() == null : this.getCreateDay().equals(other.getCreateDay()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getCallTableId() == null) ? 0 : getCallTableId().hashCode());
result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getShopName() == null) ? 0 : getShopName().hashCode());
result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getCallTime() == null) ? 0 : getCallTime().hashCode());
result = prime * result + ((getCallCount() == null) ? 0 : getCallCount().hashCode());
result = prime * result + ((getPassTime() == null) ? 0 : getPassTime().hashCode());
result = prime * result + ((getCancelTime() == null) ? 0 : getCancelTime().hashCode());
result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
result = prime * result + ((getOpenId() == null) ? 0 : getOpenId().hashCode());
result = prime * result + ((getSubState() == null) ? 0 : getSubState().hashCode());
result = prime * result + ((getConfirmTime() == null) ? 0 : getConfirmTime().hashCode());
result = prime * result + ((getCallNum() == null) ? 0 : getCallNum().hashCode());
result = prime * result + ((getCreateDay() == null) ? 0 : getCreateDay().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", callTableId=").append(callTableId);
sb.append(", phone=").append(phone);
sb.append(", name=").append(name);
sb.append(", shopName=").append(shopName);
sb.append(", shopId=").append(shopId);
sb.append(", state=").append(state);
sb.append(", createTime=").append(createTime);
sb.append(", callTime=").append(callTime);
sb.append(", callCount=").append(callCount);
sb.append(", passTime=").append(passTime);
sb.append(", cancelTime=").append(cancelTime);
sb.append(", note=").append(note);
sb.append(", userId=").append(userId);
sb.append(", openId=").append(openId);
sb.append(", subState=").append(subState);
sb.append(", confirmTime=").append(confirmTime);
sb.append(", callNum=").append(callNum);
sb.append(", createDay=").append(createDay);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -0,0 +1,359 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
/**
* 叫号桌型表
* @TableName tb_call_table
*/
@TableName(value ="tb_call_table")
public class TbCallTable implements Serializable {
/**
*
*/
@TableId(type = IdType.AUTO)
private Integer id;
/**
* 名称
*/
private String name;
/**
* 描述
*/
private String note;
/**
* 等待时间分钟
*/
private Integer waitTime;
/**
* 前缀
*/
private String prefix;
/**
* 起始号码
*/
private Integer start;
/**
* 临近几桌提醒
*/
private Integer nearNum;
/**
* 0禁用 1使用
*/
private Integer state;
/**
* 店铺id
*/
private Integer shopId;
/**
* 二维码地址
*/
private String qrcode;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 顺延号码数量
*/
private Integer isPostpone;
/**
* 顺延号码数量
*/
private Integer postponeNum;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/**
*
*/
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 String getNote() {
return note;
}
/**
* 描述
*/
public void setNote(String note) {
this.note = note;
}
/**
* 等待时间分钟
*/
public Integer getWaitTime() {
return waitTime;
}
/**
* 等待时间分钟
*/
public void setWaitTime(Integer waitTime) {
this.waitTime = waitTime;
}
/**
* 前缀
*/
public String getPrefix() {
return prefix;
}
/**
* 前缀
*/
public void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
* 起始号码
*/
public Integer getStart() {
return start;
}
/**
* 起始号码
*/
public void setStart(Integer start) {
this.start = start;
}
/**
* 临近几桌提醒
*/
public Integer getNearNum() {
return nearNum;
}
/**
* 临近几桌提醒
*/
public void setNearNum(Integer nearNum) {
this.nearNum = nearNum;
}
/**
* 0禁用 1使用
*/
public Integer getState() {
return state;
}
/**
* 0禁用 1使用
*/
public void setState(Integer state) {
this.state = state;
}
/**
* 店铺id
*/
public Integer getShopId() {
return shopId;
}
/**
* 店铺id
*/
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
/**
* 二维码地址
*/
public String getQrcode() {
return qrcode;
}
/**
* 二维码地址
*/
public void setQrcode(String qrcode) {
this.qrcode = qrcode;
}
/**
*
*/
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 getIsPostpone() {
return isPostpone;
}
/**
* 顺延号码数量
*/
public void setIsPostpone(Integer isPostpone) {
this.isPostpone = isPostpone;
}
/**
* 顺延号码数量
*/
public Integer getPostponeNum() {
return postponeNum;
}
/**
* 顺延号码数量
*/
public void setPostponeNum(Integer postponeNum) {
this.postponeNum = postponeNum;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
TbCallTable other = (TbCallTable) that;
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getNote() == null ? other.getNote() == null : this.getNote().equals(other.getNote()))
&& (this.getWaitTime() == null ? other.getWaitTime() == null : this.getWaitTime().equals(other.getWaitTime()))
&& (this.getPrefix() == null ? other.getPrefix() == null : this.getPrefix().equals(other.getPrefix()))
&& (this.getStart() == null ? other.getStart() == null : this.getStart().equals(other.getStart()))
&& (this.getNearNum() == null ? other.getNearNum() == null : this.getNearNum().equals(other.getNearNum()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()))
&& (this.getShopId() == null ? other.getShopId() == null : this.getShopId().equals(other.getShopId()))
&& (this.getQrcode() == null ? other.getQrcode() == null : this.getQrcode().equals(other.getQrcode()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getIsPostpone() == null ? other.getIsPostpone() == null : this.getIsPostpone().equals(other.getIsPostpone()))
&& (this.getPostponeNum() == null ? other.getPostponeNum() == null : this.getPostponeNum().equals(other.getPostponeNum()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getNote() == null) ? 0 : getNote().hashCode());
result = prime * result + ((getWaitTime() == null) ? 0 : getWaitTime().hashCode());
result = prime * result + ((getPrefix() == null) ? 0 : getPrefix().hashCode());
result = prime * result + ((getStart() == null) ? 0 : getStart().hashCode());
result = prime * result + ((getNearNum() == null) ? 0 : getNearNum().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
result = prime * result + ((getShopId() == null) ? 0 : getShopId().hashCode());
result = prime * result + ((getQrcode() == null) ? 0 : getQrcode().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getIsPostpone() == null) ? 0 : getIsPostpone().hashCode());
result = prime * result + ((getPostponeNum() == null) ? 0 : getPostponeNum().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", note=").append(note);
sb.append(", waitTime=").append(waitTime);
sb.append(", prefix=").append(prefix);
sb.append(", start=").append(start);
sb.append(", nearNum=").append(nearNum);
sb.append(", state=").append(state);
sb.append(", shopId=").append(shopId);
sb.append(", qrcode=").append(qrcode);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", isPostpone=").append(isPostpone);
sb.append(", postponeNum=").append(postponeNum);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@ -58,6 +58,9 @@ public class TbCashierCart implements Serializable {
private Long updatedAt;
private Integer userId;
private String tableId;
private String useType;
private Integer placeNum;
private String platformType;
@TableField(exist = false)
private TbProductSpec tbProductSpec;

View File

@ -24,6 +24,7 @@ public class TbMerchantThirdApply implements Serializable {
private String appToken;
private String smallAppid;
private String alipaySmallAppid;
private String storeId;
@ -124,4 +125,12 @@ public class TbMerchantThirdApply implements Serializable {
public void setStoreId(String storeId) {
this.storeId = storeId;
}
public String getAlipaySmallAppid() {
return alipaySmallAppid;
}
public void setAlipaySmallAppid(String alipaySmallAppid) {
this.alipaySmallAppid = alipaySmallAppid;
}
}

View File

@ -1,5 +1,6 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
@ -37,7 +38,14 @@ public class TbOrderDetail implements Serializable {
private BigDecimal priceAmount;
private BigDecimal packAmount;
@TableField(exist = false)
private String remark;
private Integer cartId;
private Integer placeNum;
private String useType;
private String note;
private static final long serialVersionUID = 1L;
}
}

View File

@ -1,5 +1,6 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.io.Serializable;
@ -45,6 +46,7 @@ public class TbOrderInfo implements Serializable {
private String sendType;
private String orderType;
@TableField(exist = false)
private Integer tokenId;
private String productType;
@ -60,11 +62,15 @@ public class TbOrderInfo implements Serializable {
private Byte isVip;
private String memberId;
@TableField(exist = false)
private String userName;
@TableField(exist = false)
private String memberName;
@TableField(exist = false)
private String zdNo;
private String userId;
@TableField(exist = false)
private String imgUrl;
private Integer productScore;
@ -96,6 +102,7 @@ public class TbOrderInfo implements Serializable {
private Integer source;
private String remark;
private String masterId;
@TableField(exist = false)
private List<TbOrderDetail> detailList;
private String outNumber;
@ -103,6 +110,10 @@ public class TbOrderInfo implements Serializable {
private Integer staffId;
private String useType;
private Integer placeNum;
private Integer seatCount;
private BigDecimal seatAmount;
private static final long serialVersionUID = 1L;
public TbOrderInfo(){

View File

@ -1,7 +1,12 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.ToString;
import org.springframework.data.annotation.Transient;
import java.io.Serializable;
@ToString
public class TbPrintMachine implements Serializable {
private Integer id;
@ -23,6 +28,8 @@ public class TbPrintMachine implements Serializable {
private String categoryIds;
private String categoryList;
private String contentType;
private Long createdAt;
@ -36,6 +43,23 @@ public class TbPrintMachine implements Serializable {
private String productId;
private String config;
private String receiptSize;
private String classifyPrint;
private String tablePrint;
private String printQty;
private String printMethod;
private String printType;
private String printReceipt;
@Transient
@TableField(exist = false)
private Long currentUserId;
@Transient
@TableField(exist = false)
private String currentUserName;
@Transient
@TableField(exist = false)
private String currentUserNickName;
public String getConfig() {
return config;
}
@ -173,4 +197,92 @@ public class TbPrintMachine implements Serializable {
public void setProductId(String productId) {
this.productId = productId == null ? null : productId.trim();
}
public String getReceiptSize() {
return receiptSize;
}
public String getCategoryList() {
return categoryList;
}
public void setCategoryList(String categoryList) {
this.categoryList = categoryList;
}
public void setReceiptSize(String receiptSize) {
this.receiptSize = receiptSize;
}
public String getClassifyPrint() {
return classifyPrint;
}
public void setClassifyPrint(String classifyPrint) {
this.classifyPrint = classifyPrint;
}
public String getTablePrint() {
return tablePrint;
}
public void setTablePrint(String tablePrint) {
this.tablePrint = tablePrint;
}
public String getPrintQty() {
return printQty;
}
public void setPrintQty(String printQty) {
this.printQty = printQty;
}
public String getPrintMethod() {
return printMethod;
}
public void setPrintMethod(String printMethod) {
this.printMethod = printMethod;
}
public String getPrintType() {
return printType;
}
public void setPrintType(String printType) {
this.printType = printType;
}
public String getPrintReceipt() {
return printReceipt;
}
public void setPrintReceipt(String printReceipt) {
this.printReceipt = printReceipt;
}
public Long getCurrentUserId() {
return currentUserId;
}
public void setCurrentUserId(Long currentUserId) {
this.currentUserId = currentUserId;
}
public String getCurrentUserName() {
return currentUserName;
}
public void setCurrentUserName(String currentUserName) {
this.currentUserName = currentUserName;
}
public String getCurrentUserNickName() {
return currentUserNickName;
}
public void setCurrentUserNickName(String currentUserNickName) {
this.currentUserNickName = currentUserNickName;
}
}

View File

@ -0,0 +1,126 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 店铺小票打印记录
*
* @author tankaikai
* @since 2024-10-8 16:19:50
*/
@Data
@TableName("tb_print_machine_log")
public class TbPrintMachineLog implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 打印机类型 本地打印机-local USB打印机-USB 云打印机-network
*/
private String connectionType;
/**
* 打印机品牌 云想印 = yxyPrinter飞鹅 = fePrinter 本地 = local USB = printer
*/
private String contentType;
/**
* 打印小票 标签-label 出品-kitchen 小票-cash
*/
private String subType;
/**
* 打印机名称
*/
private String name;
/**
* IP地址/打印机编号
*/
private String address;
/**
* 端口/打印机秘钥
*/
private String port;
/**
* 小票尺寸 58mm 80mm
*/
private String receiptSize;
/**
* 分类打印 0-所以 1-部分分类 2-部分商品
*/
private String classifyPrint;
/**
* 桌台打印 0-所有 1-部分
*/
private String tablePrint;
/**
* 打印数量 c1m1^2=顾客+商家[2张] m1^1=商家[1张] c1^1顾客[1张] c2m1^3=顾客2+商家1[3张]
*/
private String printQty;
/**
* 打印方式 all-全部打印 normal-仅打印结账单前台one-仅打印制作单厨房
*/
private String printMethod;
/**
* 打印类型JSON数组 refund-确认退款单 handover-交班单 queue-排队取号['refund','handover','queue']
*/
private String printType;
/**
* 打印票据 0-全部打印 1-仅厨房 2-仅前台
*/
private String printReceipt;
/**
* 打印内容
*/
private String printContent;
/**
* 店铺id
*/
private String shopId;
/**
* 业务类型
*/
private String bizType;
/**
* 打印人id
*/
private Long createUserId;
/**
* 打印人名称
*/
private String createUserName;
/**
* 打印任务创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 打印任务id用于复查打印状态云想印=orderId
*/
private String taskId;
/**
* 实际打印时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date printTime;
/**
* 失败标识 1- 0-
*/
private Integer failFlag;
/**
* 响应代码
*/
private String respCode;
/**
* 响应消息
*/
private String respMsg;
}

View File

@ -1,7 +1,10 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.ToString;
import java.io.Serializable;
@ToString
public class TbPrintMachineWithBLOBs extends TbPrintMachine implements Serializable {
private String config;
@ -24,4 +27,4 @@ public class TbPrintMachineWithBLOBs extends TbPrintMachine implements Serializa
public void setCategoryList(String categoryList) {
this.categoryList = categoryList == null ? null : categoryList.trim();
}
}
}

View File

@ -77,6 +77,14 @@ public class TbPrintPCMachine implements Serializable {
*/
private String productId;
private String receiptSize;
private String classifyPrint;
private String tablePrint;
private String printQty;
private String printMethod;
private String printType;
private String printReceipt;
private Integer pageSize;
private Integer page;
@ -242,5 +250,60 @@ public class TbPrintPCMachine implements Serializable {
this.productId = productId;
}
public String getReceiptSize() {
return receiptSize;
}
public void setReceiptSize(String receiptSize) {
this.receiptSize = receiptSize;
}
public String getClassifyPrint() {
return classifyPrint;
}
public void setClassifyPrint(String classifyPrint) {
this.classifyPrint = classifyPrint;
}
public String getTablePrint() {
return tablePrint;
}
public void setTablePrint(String tablePrint) {
this.tablePrint = tablePrint;
}
public String getPrintQty() {
return printQty;
}
public void setPrintQty(String printQty) {
this.printQty = printQty;
}
public String getPrintMethod() {
return printMethod;
}
public void setPrintMethod(String printMethod) {
this.printMethod = printMethod;
}
public String getPrintType() {
return printType;
}
public void setPrintType(String printType) {
this.printType = printType;
}
public String getPrintReceipt() {
return printReceipt;
}
public void setPrintReceipt(String printReceipt) {
this.printReceipt = printReceipt;
}
}

View File

@ -1,10 +1,13 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class TbProduct implements Serializable {
private Integer id;
@ -131,528 +134,22 @@ public class TbProduct implements Serializable {
private Integer stockNumber;
private Integer warnLine = 0;
@Transient
@TableField(exist = false)
private int orderCount;
@Transient
@TableField(exist = false)
private TbProductSpec tbProductSpec;
@Transient
@TableField(exist = false)
private TbProductSkuResult productSkuResult;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCategoryId() {
return categoryId;
}
public void setCategoryId(String categoryId) {
this.categoryId = categoryId == null ? null : categoryId.trim();
}
public Integer getSpecId() {
return specId;
}
public void setSpecId(Integer specId) {
this.specId = specId;
}
public String getSourcePath() {
return sourcePath;
}
public void setSourcePath(String sourcePath) {
this.sourcePath = sourcePath == null ? null : sourcePath.trim();
}
public Integer getBrandId() {
return brandId;
}
public void setBrandId(Integer brandId) {
this.brandId = brandId;
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId == null ? null : merchantId.trim();
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId == null ? null : shopId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getShortTitle() {
return shortTitle;
}
public void setShortTitle(String shortTitle) {
this.shortTitle = shortTitle == null ? null : shortTitle.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public BigDecimal getPackFee() {
return packFee;
}
public void setPackFee(BigDecimal packFee) {
this.packFee = packFee;
}
public BigDecimal getLowPrice() {
return lowPrice;
}
public void setLowPrice(BigDecimal lowPrice) {
this.lowPrice = lowPrice;
}
public BigDecimal getLowMemberPrice() {
return lowMemberPrice;
}
public void setLowMemberPrice(BigDecimal lowMemberPrice) {
this.lowMemberPrice = lowMemberPrice;
}
public String getUnitId() {
return unitId;
}
public void setUnitId(String unitId) {
this.unitId = unitId == null ? null : unitId.trim();
}
public String getUnitSnap() {
return unitSnap;
}
public void setUnitSnap(String unitSnap) {
this.unitSnap = unitSnap == null ? null : unitSnap.trim();
}
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 getVideoCoverImg() {
return videoCoverImg;
}
public void setVideoCoverImg(String videoCoverImg) {
this.videoCoverImg = videoCoverImg == null ? null : videoCoverImg.trim();
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getLimitNumber() {
return limitNumber;
}
public void setLimitNumber(Integer limitNumber) {
this.limitNumber = limitNumber;
}
public Integer getProductScore() {
return productScore;
}
public void setProductScore(Integer productScore) {
this.productScore = productScore;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public String getFailMsg() {
return failMsg;
}
public void setFailMsg(String failMsg) {
this.failMsg = failMsg == null ? null : failMsg.trim();
}
public Byte getIsRecommend() {
return isRecommend;
}
public void setIsRecommend(Byte isRecommend) {
this.isRecommend = isRecommend;
}
public Byte getIsHot() {
return isHot;
}
public void setIsHot(Byte isHot) {
this.isHot = isHot;
}
public Byte getIsNew() {
return isNew;
}
public void setIsNew(Byte isNew) {
this.isNew = isNew;
}
public Byte getIsOnSale() {
return isOnSale;
}
public void setIsOnSale(Byte isOnSale) {
this.isOnSale = isOnSale;
}
public Byte getIsShow() {
return isShow;
}
public void setIsShow(Byte isShow) {
this.isShow = isShow;
}
public String getTypeEnum() {
return typeEnum;
}
public void setTypeEnum(String typeEnum) {
this.typeEnum = typeEnum == null ? null : typeEnum.trim();
}
public Byte getIsDistribute() {
return isDistribute;
}
public void setIsDistribute(Byte isDistribute) {
this.isDistribute = isDistribute;
}
public Byte getIsDel() {
return isDel;
}
public void setIsDel(Byte isDel) {
this.isDel = isDel;
}
public Byte getIsStock() {
return isStock;
}
public void setIsStock(Byte isStock) {
this.isStock = isStock;
}
public Byte getIsPauseSale() {
return isPauseSale;
}
public void setIsPauseSale(Byte isPauseSale) {
this.isPauseSale = isPauseSale;
}
public Byte getIsFreeFreight() {
return isFreeFreight;
}
public void setIsFreeFreight(Byte isFreeFreight) {
this.isFreeFreight = isFreeFreight;
}
public Long getFreightId() {
return freightId;
}
public void setFreightId(Long freightId) {
this.freightId = freightId;
}
public String getStrategyType() {
return strategyType;
}
public void setStrategyType(String strategyType) {
this.strategyType = strategyType == null ? null : strategyType.trim();
}
public Integer getStrategyId() {
return strategyId;
}
public void setStrategyId(Integer strategyId) {
this.strategyId = strategyId;
}
public Byte getIsVip() {
return isVip;
}
public void setIsVip(Byte isVip) {
this.isVip = isVip;
}
public Byte getIsDelete() {
return isDelete;
}
public void setIsDelete(Byte isDelete) {
this.isDelete = isDelete;
}
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 Double getBaseSalesNumber() {
return baseSalesNumber;
}
public void setBaseSalesNumber(Double baseSalesNumber) {
this.baseSalesNumber = baseSalesNumber;
}
public Integer getRealSalesNumber() {
return realSalesNumber;
}
public void setRealSalesNumber(Integer realSalesNumber) {
this.realSalesNumber = realSalesNumber;
}
public Integer getSalesNumber() {
return salesNumber;
}
public void setSalesNumber(Integer salesNumber) {
this.salesNumber = salesNumber;
}
public Integer getThumbCount() {
return thumbCount;
}
public void setThumbCount(Integer thumbCount) {
this.thumbCount = thumbCount;
}
public Integer getStoreCount() {
return storeCount;
}
public void setStoreCount(Integer storeCount) {
this.storeCount = storeCount;
}
public Integer getFurnishMeal() {
return furnishMeal;
}
public void setFurnishMeal(Integer furnishMeal) {
this.furnishMeal = furnishMeal;
}
public Integer getFurnishExpress() {
return furnishExpress;
}
public void setFurnishExpress(Integer furnishExpress) {
this.furnishExpress = furnishExpress;
}
public Integer getFurnishDraw() {
return furnishDraw;
}
public void setFurnishDraw(Integer furnishDraw) {
this.furnishDraw = furnishDraw;
}
public Integer getFurnishVir() {
return furnishVir;
}
public void setFurnishVir(Integer furnishVir) {
this.furnishVir = furnishVir;
}
public Byte getIsCombo() {
return isCombo;
}
public void setIsCombo(Byte isCombo) {
this.isCombo = isCombo;
}
public Byte getIsShowCash() {
return isShowCash;
}
public void setIsShowCash(Byte isShowCash) {
this.isShowCash = isShowCash;
}
public Byte getIsShowMall() {
return isShowMall;
}
public void setIsShowMall(Byte isShowMall) {
this.isShowMall = isShowMall;
}
public Byte getIsNeedExamine() {
return isNeedExamine;
}
public void setIsNeedExamine(Byte isNeedExamine) {
this.isNeedExamine = isNeedExamine;
}
public Byte getShowOnMallStatus() {
return showOnMallStatus;
}
public void setShowOnMallStatus(Byte showOnMallStatus) {
this.showOnMallStatus = showOnMallStatus;
}
public Long getShowOnMallTime() {
return showOnMallTime;
}
public void setShowOnMallTime(Long showOnMallTime) {
this.showOnMallTime = showOnMallTime;
}
public String getShowOnMallErrorMsg() {
return showOnMallErrorMsg;
}
public void setShowOnMallErrorMsg(String showOnMallErrorMsg) {
this.showOnMallErrorMsg = showOnMallErrorMsg == null ? null : showOnMallErrorMsg.trim();
}
public Byte getEnableLabel() {
return enableLabel;
}
public void setEnableLabel(Byte enableLabel) {
this.enableLabel = enableLabel;
}
public String getTaxConfigId() {
return taxConfigId;
}
public void setTaxConfigId(String taxConfigId) {
this.taxConfigId = taxConfigId == null ? null : taxConfigId.trim();
}
public String getSpecTableHeaders() {
return specTableHeaders;
}
public void setSpecTableHeaders(String specTableHeaders) {
this.specTableHeaders = specTableHeaders == null ? null : specTableHeaders.trim();
}
public TbProductSpec getTbProductSpec() {
return tbProductSpec;
}
public void setTbProductSpec(TbProductSpec tbProductSpec) {
this.tbProductSpec = tbProductSpec;
}
public TbProductSkuResult getProductSkuResult() {
return productSkuResult;
}
public void setProductSkuResult(TbProductSkuResult productSkuResult) {
this.productSkuResult = productSkuResult;
}
public int getOrderCount() {
return orderCount;
}
public void setOrderCount(int orderCount) {
this.orderCount = orderCount;
}
public Integer getStockNumber() {
return stockNumber;
}
public void setStockNumber(Integer stockNumber) {
this.stockNumber = stockNumber;
}
}

View File

@ -35,8 +35,6 @@ public class TbProductSku implements Serializable {
private String coverImg;
private Integer warnLine;
private Double weight;
private Float volume;

View File

@ -1,8 +1,11 @@
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;
@ -105,394 +108,19 @@ public class TbShopInfo implements Serializable {
private String isMemberReturn;
//是否开启桌位费 0否1是
private Integer isTableFee;
//桌位费
private BigDecimal tableFee;
//就餐模式 堂食 dine-in 外带 take-out
private String eatModel;
//程序码(零点八零首页)
private String smallQrcode;
//店铺收款码
private String paymentQrcode;
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();
}
public String getIsCustom() {
return isCustom;
}
public void setIsCustom(String isCustom) {
this.isCustom = isCustom;
}
public String getIsReturn() {
return isReturn;
}
public void setIsReturn(String isReturn) {
this.isReturn = isReturn;
}
public String getIsMemberIn() {
return isMemberIn;
}
public void setIsMemberIn(String isMemberIn) {
this.isMemberIn = isMemberIn;
}
public String getIsMemberReturn() {
return isMemberReturn;
}
public void setIsMemberReturn(String isMemberReturn) {
this.isMemberReturn = isMemberReturn;
}
}
}

View File

@ -0,0 +1,129 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.util.Date;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
/**
* (TbShopPermission)表实体类
*
* @author makejava
* @since 2024-09-14 17:08:48
*/
@SuppressWarnings("serial")
public class TbShopPermission extends Model<TbShopPermission> {
private Integer id;
//权限类型staff 员工
private String type;
//权限名称
private String label;
//权限code为了区分采用汉语拼音
private String code;
//层级
private Integer level;
//上级ID
private Integer parentId;
//是否重要 重要对应页面红色
private Integer isImportant;
//排序
private Integer sort;
private Date createTime;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public Integer getLevel() {
return level;
}
public void setLevel(Integer level) {
this.level = level;
}
public Integer getParentId() {
return parentId;
}
public void setParentId(Integer parentId) {
this.parentId = parentId;
}
public Integer getIsImportant() {
return isImportant;
}
public void setIsImportant(Integer isImportant) {
this.isImportant = isImportant;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
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;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -0,0 +1,77 @@
package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
/**
* 店铺员工权限关联表(TbShopStaffPermission)表实体类
*
* @author makejava
* @since 2024-09-14 17:07:33
*/
@SuppressWarnings("serial")
public class TbShopStaffPermission extends Model<TbShopStaffPermission> {
private Integer id;
//权限ID
private Integer permissionId;
//员工ID
private Integer staffId;
//店铺ID
private Integer shopId;
//用户ID
private Integer userId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getPermissionId() {
return permissionId;
}
public void setPermissionId(Integer permissionId) {
this.permissionId = permissionId;
}
public Integer getStaffId() {
return staffId;
}
public void setStaffId(Integer staffId) {
this.staffId = staffId;
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
/**
* 获取主键值
*
* @return 主键值
*/
@Override
protected Serializable pkVal() {
return this.id;
}
}

View File

@ -1,8 +1,11 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
@Data
public class TbShopTable implements Serializable {
private Integer id;
@ -36,133 +39,10 @@ public class TbShopTable implements Serializable {
private String qrcode;
public String getQrcode() {
return qrcode;
}
private Integer autoClear;
public void setQrcode(String qrcode) {
this.qrcode = qrcode;
}
private static final long serialVersionUID = 1L;
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 == null ? null : name.trim();
}
public Integer getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public Integer getMaxCapacity() {
return maxCapacity;
}
public void setMaxCapacity(Integer maxCapacity) {
this.maxCapacity = maxCapacity;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getAreaId() {
return areaId;
}
public void setAreaId(Integer areaId) {
this.areaId = areaId;
}
public Byte getIsPredate() {
return isPredate;
}
public void setIsPredate(Byte isPredate) {
this.isPredate = isPredate;
}
public BigDecimal getPredateAmount() {
return predateAmount;
}
public void setPredateAmount(BigDecimal predateAmount) {
this.predateAmount = predateAmount;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public BigDecimal getPerhour() {
return perhour;
}
public void setPerhour(BigDecimal perhour) {
this.perhour = perhour;
}
public String getView() {
return view;
}
public void setView(String view) {
this.view = view == null ? null : view.trim();
}
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;
}
private Integer productNum;
private BigDecimal totalAmount;
private BigDecimal realAmount;
private Integer useNum;
}

View File

@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class TbShopUser implements Serializable {
private Integer id;
@ -61,6 +62,7 @@ public class TbShopUser implements Serializable {
private Long updatedAt;
private String miniOpenId;
private Date joinTime;
private static final long serialVersionUID = 1L;
@ -295,4 +297,12 @@ public class TbShopUser implements Serializable {
public void setDynamicCode(String dynamicCode) {
this.dynamicCode = dynamicCode;
}
public Date getJoinTime() {
return joinTime;
}
public void setJoinTime(Date joinTime) {
this.joinTime = joinTime;
}
}

View File

@ -0,0 +1,13 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
@Data
public class CallNumPrintDTO {
private Integer callQueueId;
private Integer shopId;
private Long currentUserId;
private String currentUserName;
private String currentUserNickName;
}

View File

@ -0,0 +1,20 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class ChoseCountDTO {
@NotEmpty
private String masterId;
@NotNull
private Integer shopId;
@NotEmpty
private String tableId;
@NotNull
@Min(1)
private Integer num;
}

View File

@ -0,0 +1,14 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class ClearTableDTO {
@NotNull
private Integer shopId;
@NotBlank
private String tableId;
}

View File

@ -0,0 +1,7 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
@Data
public class PrintDTO {
}

View File

@ -0,0 +1,15 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class ReturnCartDTO {
@NotNull
private Integer cartId;
@NotNull
private Integer shopId;
@NotNull
private Long tableId;
}

View File

@ -0,0 +1,17 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class ShopEatTypeInfoDTO {
private boolean isTakeout;
private boolean isMunchies;
private boolean isDineInAfter;
private boolean isDineInBefore;
private TbShopInfo shopInfo;
private String useType;
private String sendType;
}

View File

@ -0,0 +1,118 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 店铺小票打印记录
*
* @author tankaikai
* @since 2024-10-8 16:44
*/
@Data
public class ShopPrintLogDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long id;
/**
* 打印机类型 本地打印机-local USB打印机-USB 云打印机-network
*/
private String connectionType;
/**
* 打印机品牌 云想印 = yxyPrinter飞鹅 = fePrinter 本地 = local USB = printer
*/
private String contentType;
/**
* 打印小票 标签-label 出品-kitchen 小票-cash
*/
private String subType;
/**
* 打印机名称
*/
private String name;
/**
* IP地址/打印机编号
*/
private String address;
/**
* 端口/打印机秘钥
*/
private String port;
/**
* 小票尺寸 58mm 80mm
*/
private String receiptSize;
/**
* 分类打印 0-所以 1-部分分类 2-部分商品
*/
private String classifyPrint;
/**
* 桌台打印 0-所有 1-部分
*/
private String tablePrint;
/**
* 打印数量 c1m1^2=顾客+商家[2张] m1^1=商家[1张] c1^1顾客[1张] c2m1^3=顾客2+商家1[3张]
*/
private String printQty;
/**
* 打印方式 all-全部打印 normal-仅打印结账单前台one-仅打印制作单厨房
*/
private String printMethod;
/**
* 打印类型JSON数组 refund-确认退款单 handover-交班单 queue-排队取号['refund','handover','queue']
*/
private String printType;
/**
* 打印票据 0-全部打印 1-仅厨房 2-仅前台
*/
private String printReceipt;
/**
* 打印内容
*/
private String printContent;
/**
* 店铺id
*/
private String shopId;
/**
* 业务类型
*/
private String bizType;
/**
* 打印人id
*/
private Long createUserId;
/**
* 打印人名称
*/
private String createUserName;
/**
* 打印任务创建时间
*/
private Date createTime;
/**
* 打印任务id用于复查打印状态云想印=orderId
*/
private String taskId;
/**
* 实际打印时间
*/
private Date printTime;
/**
* 失败标识 1- 0-
*/
private Integer failFlag;
/**
* 响应代码
*/
private String respCode;
/**
* 响应消息
*/
private String respMsg;
}

View File

@ -0,0 +1,64 @@
package com.chaozhanggui.system.cashierservice.entity.dto;
import lombok.Data;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* 店铺打印机配置
*
* @author tankaikai
* @since 2024-09-24 17:13
*/
@Data
public class ShopPrinterDTO implements Serializable {
private static final long serialVersionUID = 1L;
private Integer id;
private String name;
private String type;
private String connectionType;
private String address;
private String port;
private String subType;
private Integer status;
private String shopId;
private String categoryIds;
private String contentType;
private String createdAt;
private String updatedAt;
private Integer sort;
private String vendorId;
private String productId;
private String config;
public String getCreatedAt() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(new Date(Long.valueOf(createdAt)));
}
public String getUpdatedAt() {
if("".equals(updatedAt) || updatedAt == null){
return "";
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(new Date(Long.valueOf(updatedAt)));
}
}

View File

@ -0,0 +1,17 @@
package com.chaozhanggui.system.cashierservice.entity.po;
import lombok.Data;
import java.util.Date;
@Data
public class CallNumPrintPO {
private String shopName;
private String tableName;
private String tableNote;
private String preNum;
private String callNum;
private String codeUrl;
private String shopNote;
private Date takeTime;
}

View File

@ -12,4 +12,5 @@ public class CartPo {
private Integer shopId;
private Long pendingAt;
private BigDecimal totalAmount;
private Integer orderId;
}

View File

@ -13,4 +13,5 @@ public class SkuInfoPo {
private BigDecimal priceAmount;
private BigDecimal packAmount;
private String categoryId;
private BigDecimal price;
}

View File

@ -2,11 +2,17 @@ package com.chaozhanggui.system.cashierservice.entity.vo;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
@Data
public class CartVo {
private String productId;
private String shopId;
private Integer productId;
@NotNull
private Integer shopId;
private Integer skuId;
@Min(1)
private Integer number;
private String isPack;
private String isGift;
@ -16,5 +22,5 @@ public class CartVo {
private Integer cartId;
private String masterId;
private String tableId;
private Integer vipUserId;
private Integer orderId;
}

View File

@ -2,6 +2,7 @@ package com.chaozhanggui.system.cashierservice.exception;
import com.chaozhanggui.system.cashierservice.sign.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
@ -11,6 +12,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
* ControllerAdvice注解的含义是当异常抛到controller层时会拦截下来
*/
@ControllerAdvice
@Slf4j
public class GlobalExceptionHandler {
/**
@ -26,6 +28,14 @@ public class GlobalExceptionHandler {
return Result.fail("系统内部错误");
}
@ResponseBody
@ExceptionHandler(NotPrintException.class)
public Result exceptionNotPrint(Exception e) {
log.warn("获取到不打印堆栈异常, 异常信息: {}", e.getMessage());
// 返回错误格式信息
return Result.fail(e.getMessage());
}
/**
* 使用ExceptionHandler注解声明处理TestException异常
*

View File

@ -0,0 +1,16 @@
package com.chaozhanggui.system.cashierservice.exception;
import cn.hutool.core.util.StrUtil;
import com.chaozhanggui.system.cashierservice.util.Utils;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class NotPrintException extends RuntimeException{
public NotPrintException(String format, Object... args) {
super(StrUtil.format(format, args));
StringBuilder builder = new StringBuilder();
Utils.recursiveReversePrintStackCause(this, 2, new Utils.ForwardCounter(0), 2, builder);
log.warn("异常信息: {}", builder);
}
}

View File

@ -86,13 +86,6 @@ public class LimitSubmitAspect {
Object[] args= joinPoint.getArgs();
String orderId=orderId(method,args);
LimitSubmit limitSubmit = method.getAnnotation(LimitSubmit.class);
String redisKey = limitSubmit.key();
String key = getRedisKey1(joinPoint, redisKey,orderId);
@ -205,6 +198,13 @@ public class LimitSubmitAspect {
if(o instanceof List){
orderId= ((List<TbOrderDetail>)o).get(0).getOrderId().toString();
}
}else if("pcscanpay".equals(method.getName())){
Object o=args[1];
if(o instanceof PaymentReq){
orderId=((PaymentReq)o).getOrderId();
}
}
return orderId;

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