diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..14c2a87 --- /dev/null +++ b/pom.xml @@ -0,0 +1,242 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.7.3 + + + com.chaozhangui.system.cashservice + cashier-service + 1.0-SNAPSHOT + + + 8 + 8 + UTF-8 + + + + + + org.apache.commons + commons-lang3 + + + + commons-io + commons-io + 2.4 + + + + + org.apache.httpcomponents + httpclient + + + + org.springframework.boot + spring-boot-starter-web + 2.4.0 + + + + cn.hutool + hutool-all + 5.7.21 + + + com.alibaba + fastjson + 1.2.9 + + + org.projectlombok + lombok + + + + org.apache.commons + commons-lang3 + + + + + + + + commons-beanutils + commons-beanutils + 1.9.4 + + + org.mybatis.spring.boot + mybatis-spring-boot-starter + 2.1.1 + + + org.mybatis.generator + mybatis-generator-core + 1.3.5 + + + + org.springframework.boot + spring-boot-starter-validation + + + mysql + mysql-connector-java + runtime + + + + + org.apache.commons + commons-lang3 + 3.5 + + + + org.aspectj + aspectjweaver + 1.9.5 + + + + org.springframework.boot + spring-boot-starter-webflux + + + + + com.google.guava + guava + 20.0 + + + + org.apache.commons + commons-lang3 + 3.6 + + + org.apache.httpcomponents + httpclient + 4.5.2 + + + + org.apache.httpcomponents + httpmime + 4.5.2 + + + + com.alibaba + fastjson + 1.2.48 + + + + org.apache.httpcomponents + httpclient + 4.5.2 + + + + + io.jsonwebtoken + jjwt + 0.9.1 + + + + + redis.clients + jedis + + + org.springframework.data + spring-data-redis + + + org.springframework.boot + spring-boot-starter-websocket + + + + org.springframework.boot + spring-boot-starter-amqp + 1.5.2.RELEASE + + + + com.github.binarywang + weixin-java-miniapp + 3.8.0 + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.7.0 + + UTF-8 + 1.8 + 1.8 + + + + org.springframework.boot + spring-boot-maven-plugin + 1.4.2.RELEASE + + com.chaozhanggui.system.cashierservice.Shell + ./ + true + true + + + + + repackage + + + + + + + + org.mybatis.generator + mybatis-generator-maven-plugin + 1.3.7 + + + false + + false + + src/main/resources/generator-mapper/generatorConfig.xml + + + + mysql + mysql-connector-java + 8.0.17 + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/Shell.java b/src/main/java/com/chaozhanggui/system/cashierservice/Shell.java new file mode 100644 index 0000000..08e4839 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/Shell.java @@ -0,0 +1,62 @@ +package com.chaozhanggui.system.cashierservice; + + +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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.support.PropertySourcesPlaceholderConfigurer; +import org.springframework.scheduling.annotation.EnableScheduling; +import org.springframework.transaction.annotation.EnableTransactionManagement; +import org.springframework.web.client.RestTemplate; +import org.springframework.web.socket.config.annotation.EnableWebSocket; + +import java.net.ServerSocket; +import java.net.Socket; + +@SpringBootApplication +@EnableScheduling +@EntityScan(basePackageClasses = {Shell.class}) +@MapperScan(basePackageClasses ={Shell.class} ) +@ComponentScan(basePackageClasses ={Shell.class}) +@EnableTransactionManagement +@EnableAspectJAutoProxy(proxyTargetClass = true) +@Slf4j +@EnableWebSocket +public class Shell { + + private static Logger logger = LoggerFactory.getLogger(Shell.class); + + public static void main(String[] args) { + SpringApplication springApplication = new SpringApplication(Shell.class); + springApplication.run(args); + } + @Bean + RestTemplate restTemplate(){ + return new RestTemplate(); + } + + @Bean + public CommandLineRunner commandLineRunner(ApplicationContext ctx) { + return (args) -> { + logger.info("=========================启动完成=========================="); + }; + } + + + @Bean + public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() { + PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer = new PropertySourcesPlaceholderConfigurer(); + propertySourcesPlaceholderConfigurer.setIgnoreUnresolvablePlaceholders(true); + return propertySourcesPlaceholderConfigurer; + } + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/annotation/OpLog.java b/src/main/java/com/chaozhanggui/system/cashierservice/annotation/OpLog.java new file mode 100644 index 0000000..1d443bb --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/annotation/OpLog.java @@ -0,0 +1,32 @@ +package com.chaozhanggui.system.cashierservice.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * @author DJH + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface OpLog { + + /** + * 操作日志code + * @return 操作code + */ + String opCode() default ""; + + /** + * 操作日志-详情 + * @return 操作详情 + */ + String opDetail() default ""; + + /** + * 操作日志名称 + * @return 操作名称 + */ + String opName() default ""; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/annotation/ResultCode.java b/src/main/java/com/chaozhanggui/system/cashierservice/annotation/ResultCode.java new file mode 100644 index 0000000..b54f9b3 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/annotation/ResultCode.java @@ -0,0 +1,41 @@ +package com.chaozhanggui.system.cashierservice.annotation; + +/** + * 响应码枚举,参考HTTP状态码的语义 + */ +public enum ResultCode { + //成功 + SUCCESS(200), + //失败 + FAIL(400), + //未认证(签名错误) + UNAUTHORIZED(401), + //未认证(签名错误) + PARAM_ERROR(422), + // 403 + FORBIDDEN(403), + //接口不存在 + NOT_FOUND(404), + //服务器内部错误 + INTERNAL_SERVER_ERROR(500), + // 服务不可达 + SERVICE_UNAVAILABLE(503), + //未认证(签名错误) + NOT_TOKEN(401), + //无数据 + UNDEFINDE(201), + /** + * 交易未知 查询交易结果 + */ + TRANSUNKNOW(202); + + private final int code; + + ResultCode(int code) { + this.code = code; + } + + public int code() { + return code; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/config/ChangeHandler.java b/src/main/java/com/chaozhanggui/system/cashierservice/config/ChangeHandler.java new file mode 100644 index 0000000..969a880 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/config/ChangeHandler.java @@ -0,0 +1,35 @@ +package com.chaozhanggui.system.cashierservice.config; + +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +//处理前端改变购物车的行为,并记录 +public class ChangeHandler extends Handler { + + @Override + public void handleRequest(ConcurrentHashMap> webSocketMap, + JSONObject jsonObject, ConcurrentHashMap> recordMap, + AppWebSocketServer webSocke) throws IOException { + + if (jsonObject.containsKey("change")) { + ArrayList jsonObjects = new ArrayList<>(); + jsonObjects.add(jsonObject); +// producerMq.syncShopCar(jsonObjects); + //记录每一次购物车变化的记录 + List objects = recordMap.get(webSocke.getTableId()); + objects.add(jsonObject); + } else { + // 无法处理,传递给下一个处理器 + if (nextHandler != null) { + nextHandler.handleRequest(webSocketMap,jsonObject,recordMap,webSocke); + } + } + } +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/config/ClearHandler.java b/src/main/java/com/chaozhanggui/system/cashierservice/config/ClearHandler.java new file mode 100644 index 0000000..c5b8981 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/config/ClearHandler.java @@ -0,0 +1,33 @@ +package com.chaozhanggui.system.cashierservice.config; + +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +//处理前端订单已完成,把订单标志位置为false +public class ClearHandler extends Handler{ + + @Override + public void handleRequest(ConcurrentHashMap> webSocketMap, + JSONObject jsonObject, ConcurrentHashMap> recordMap, + AppWebSocketServer webSocke) throws IOException { + if (jsonObject.containsKey("clear")) { + if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId())) { + List serverList = webSocketMap.get(webSocke.getTableId()); + //遍历所有对象,把订单都改为未提交,为了下一次点餐 + serverList.forEach(m -> m.getCreateOrder().set(false)); + + } + } else { + // 无法处理,传递给下一个处理器 + if (nextHandler != null) { + nextHandler.handleRequest(webSocketMap,jsonObject,recordMap,webSocke); + } + } + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/config/CreateOrderHandler.java b/src/main/java/com/chaozhanggui/system/cashierservice/config/CreateOrderHandler.java new file mode 100644 index 0000000..ef2c04c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/config/CreateOrderHandler.java @@ -0,0 +1,79 @@ +package com.chaozhanggui.system.cashierservice.config; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; +import java.math.BigDecimal; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +//处理前端创建订单 +public class CreateOrderHandler extends Handler{ + + @Override + public void handleRequest(ConcurrentHashMap> webSocketMap, + JSONObject jsonObject, ConcurrentHashMap> recordMap, + AppWebSocketServer webSocke) throws IOException { + + + if (jsonObject.containsKey("createOrdwebSockeer")) { + if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId())) { + List serverList = webSocketMap.get(webSocke.getTableId()); + //有一个为true就说明已经有订单了 + if (serverList.stream().anyMatch(m -> m.getCreateOrder().get())) { + webSocke.sendMessage("已有人提交订单,请稍后"); + return; + } + } + synchronized (webSocke) { + if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId())) { + List serverList = webSocketMap.get(webSocke.getTableId()); + //有一个为true就说明已经有订单了 + if (serverList.stream().anyMatch(m -> m.getCreateOrder().get())) { + webSocke.sendMessage("已有人提交订单,请稍后"); + return; + } + + BigDecimal amount = new BigDecimal((Integer) jsonObject.get("amount")); + JSONArray shopCarList = jsonObject.getJSONArray("shopCarList"); + String remark = jsonObject.get("remark").toString(); + + +// List list=shopCarList.toJavaList(ShopListDto.class); +// //TODO 加个拦截加个shopid,抛出异常,前端展示 +// setShopId(list.get(0).getShopId()); +// try { +// Result order = orderFeign.createOrder(new CreateOrderDto(Long.parseLong(webSocke.getTableId()), amount, list, remark)); +// if (order.getCode() == 200){ +// //通知清空购物车 +// AppSendInfo("订单提交成功", webSocke.getTableId()); +// //清空本地的购物记录 +// recordMap.get(webSocke.getTableId()).clear(); +// webSocke.getCreateOrder().set(true); +// }else { +// AppSendInfo("订单提交失败",webSocke.getTableId()); +// } +// +// +// }catch (Exception e){ +// e.printStackTrace(); +// AppSendInfo("订单提交失败",webSocke.getTableId()); +// } + + + + } + } + + } else { + // 无法处理,传递给下一个处理器 + if (nextHandler != null) { + nextHandler.handleRequest(webSocketMap,jsonObject,recordMap,webSocke); + } + } + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/config/Handler.java b/src/main/java/com/chaozhanggui/system/cashierservice/config/Handler.java new file mode 100644 index 0000000..9529bc3 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/config/Handler.java @@ -0,0 +1,26 @@ +package com.chaozhanggui.system.cashierservice.config; + +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +public abstract class Handler { + protected Handler nextHandler; + + + public Handler addNextHandler(Handler handler) { + this.nextHandler = handler; + return handler; + } + + + + + public abstract void handleRequest(ConcurrentHashMap> webSocketMap, + JSONObject jsonObject, ConcurrentHashMap> recordMap, + AppWebSocketServer webSocke) throws IOException; +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/config/OtherHandler.java b/src/main/java/com/chaozhanggui/system/cashierservice/config/OtherHandler.java new file mode 100644 index 0000000..8fd78ee --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/config/OtherHandler.java @@ -0,0 +1,30 @@ +package com.chaozhanggui.system.cashierservice.config; + +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +import static com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer.AppSendInfo; + + +//兜底处理器 +public class OtherHandler extends Handler{ + @Override + public void handleRequest(ConcurrentHashMap> webSocketMap, + JSONObject jsonObject, + ConcurrentHashMap> recordMap, + AppWebSocketServer webSocke) throws IOException { + + //传送给对应tableId用户的websocket + if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId())) { + AppSendInfo("1", webSocke.getTableId(),false); + + } else { + System.out.println("请求的tableId:" + webSocke.getTableId() + "不在该服务器上"); + } + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/config/SyncHandler.java b/src/main/java/com/chaozhanggui/system/cashierservice/config/SyncHandler.java new file mode 100644 index 0000000..44a0298 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/config/SyncHandler.java @@ -0,0 +1,46 @@ +package com.chaozhanggui.system.cashierservice.config; + +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import org.apache.commons.lang3.StringUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +//处理前端初次扫码同步购物车 +public class SyncHandler extends Handler { + + @Override + public void handleRequest(ConcurrentHashMap> webSocketMap, + JSONObject jsonObject, ConcurrentHashMap> recordMap, + AppWebSocketServer webSocke) throws IOException { + if (jsonObject.containsKey("sync")) { + //这个是判断是否有这个桌号,也就是 是否有人点过餐 + + List recordList = recordMap.get(webSocke.getTableId()); + //指定发送对象 + if (StringUtils.isNotBlank(webSocke.getTableId()) && webSocketMap.containsKey(webSocke.getTableId()) && recordList != null) { + List serverList = webSocketMap.get(webSocke.getTableId()); + for (AppWebSocketServer server : serverList) { + if (server.getSync().get()) { + server.sendMessage(recordList); + } + + } + } else { + ArrayList objects = new ArrayList<>(); + recordMap.put(webSocke.getTableId(), objects); + } + webSocke.getSync().set(!webSocke.getSync().get()); + + } else { + // 无法处理,传递给下一个处理器 + if (nextHandler != null) { + nextHandler.handleRequest(webSocketMap, jsonObject, recordMap, webSocke); + } + } + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/config/WebSocketCustomEncoding.java b/src/main/java/com/chaozhanggui/system/cashierservice/config/WebSocketCustomEncoding.java new file mode 100644 index 0000000..33a7658 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/config/WebSocketCustomEncoding.java @@ -0,0 +1,31 @@ +package com.chaozhanggui.system.cashierservice.config; + + +import com.alibaba.fastjson.JSON; + +import javax.websocket.Encoder; +import javax.websocket.EndpointConfig; + +/** + * 为了websocket发送对象 + */ + +public class WebSocketCustomEncoding implements Encoder.Text { +// public String encode(Object vo) 这个就是指定发送的类型 + @Override + public String encode(Object vo) { + assert vo!=null; + return JSON.toJSONString(vo); + } + + + @Override + public void init(EndpointConfig endpointConfig) { + + } + @Override + public void destroy() { + + } + +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/CashierCartController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CashierCartController.java new file mode 100644 index 0000000..b59eb50 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CashierCartController.java @@ -0,0 +1,64 @@ +//package com.chaozhanggui.system.cashierservice.controller; +// +//import com.chaozhanggui.system.cashierservice.entity.TbCashierCart; +//import com.chaozhanggui.system.cashierservice.entity.dto.ProductCartDto; +//import com.chaozhanggui.system.cashierservice.service.CashierCartService; +//import com.chaozhanggui.system.cashierservice.sign.Result; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.web.bind.annotation.*; +// +//import javax.annotation.Resource; +//import java.util.List; +// +///** +// * @author lyf +// */ +//@CrossOrigin(origins = "*") +//@RestController +//@Slf4j +//@RequestMapping("/cart") +//public class CashierCartController { +// +// @Resource +// private CashierCartService cashierCartService; +// /** +// * 添加购物车 +// * @param productCartDto +// * @return +// */ +// @PostMapping("/add") +// public Result batchAdd(@RequestBody ProductCartDto productCartDto) { +// return cashierCartService.batchAdd(productCartDto); +// } +// +// /** +// * 购物车 +// * @param tableId +// * @return +// */ +// @GetMapping("/cartList") +// public Result cartList(@RequestParam Integer tableId){ +// return cashierCartService.cartList(tableId); +// } +// +// /** +// *更改数量 +// * @param +// * @return +// */ +// @GetMapping("/updateNumber") +// public Result updateNumber(@RequestParam Integer id ,@RequestParam String type){ +// return cashierCartService.updateNumber(id,type); +// } +// +// +// /** +// *清空购物车 +// * @param +// * @return +// */ +// @GetMapping("/clear") +// public Result clearCart(@RequestParam Integer tableId){ +// return cashierCartService.clearCart(tableId); +// } +//} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/CloudPrinterController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CloudPrinterController.java new file mode 100644 index 0000000..529ff58 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/CloudPrinterController.java @@ -0,0 +1,35 @@ +package com.chaozhanggui.system.cashierservice.controller; + + +import com.chaozhanggui.system.cashierservice.service.CloudPrinterService; +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.*; + +@CrossOrigin(origins = "*") +@RestController +@Slf4j +@RequestMapping("cloudPrinter") +public class CloudPrinterController { + + + @Autowired + CloudPrinterService cloudPrinterService; + + + /** + * 一单一旦 + * @param type + * @param orderId + * @return + */ + @GetMapping("print") + public Result print( + @RequestParam("type") String type, + @RequestParam("orderId") String orderId, + @RequestParam("ispre") Boolean ispre + ){ + return cloudPrinterService.printReceipt(type,orderId,ispre); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java new file mode 100644 index 0000000..4ab596e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/LoginContoller.java @@ -0,0 +1,229 @@ +package com.chaozhanggui.system.cashierservice.controller; + + +import cn.binarywang.wx.miniapp.api.WxMaService; +import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; +import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; +import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.dao.TbMerchantAccountMapper; +import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount; +import com.chaozhanggui.system.cashierservice.entity.dto.AuthUserDto; +import com.chaozhanggui.system.cashierservice.entity.dto.OnlineUserDto; +import com.chaozhanggui.system.cashierservice.service.LoginService; +import com.chaozhanggui.system.cashierservice.service.OnlineUserService; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.util.IpUtil; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.MD5Utils; +import com.chaozhanggui.system.cashierservice.util.StringUtil; +import com.chaozhanggui.system.cashierservice.wxUtil.WechatUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.codec.digest.DigestUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@CrossOrigin(origins = "*") +@RestController +@Slf4j +@RequestMapping("login") +public class LoginContoller { + + + @Value("${wx.login.business.appId}") + private String businessAppId; + + @Value("${wx.login.business.secrete}") + private String businessSecrete; + + + @Value("${wx.login.custom.appId}") + private String customAppId; + + @Value("${wx.login.custom.secrete}") + private String customSecrete; + + + @Autowired + LoginService loginService; + + @Resource + TbMerchantAccountMapper merchantAccountMapper; + + + @RequestMapping("/wx/business/login") + public Result wxBusinessLogin(@RequestParam(value = "code", required = false) String code, + @RequestParam(value = "rawData", required = false) String rawData, + @RequestParam(value = "signature", required = false) String signature + ) { + + + // 用户非敏感信息:rawData + // 签名:signature + JSONObject rawDataJson = JSON.parseObject(rawData); + // 1.接收小程序发送的code + // 2.开发者服务器 登录凭证校验接口 appi + appsecret + code + JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(code, businessAppId, businessSecrete); + // 3.接收微信接口服务 获取返回的参数 + String openid = SessionKeyOpenId.getString("openid"); + String sessionKey = SessionKeyOpenId.getString("session_key"); + + // 4.校验签名 小程序发送的签名signature与服务器端生成的签名signature2 = sha1(rawData + sessionKey) + String signature2 = DigestUtils.sha1Hex(rawData + sessionKey); + if (!signature.equals(signature2)) { + return Result.fail("签名校验失败"); + } + + + return Result.success(CodeEnum.ENCRYPT); + + } + + + + + + + + @RequestMapping("/wx/custom/login") + public Result wxCustomLogin(HttpServletRequest request, @RequestBody Map map +// , +// @RequestParam(value = "rawData", required = false) String rawData, +// @RequestParam(value = "signature", required = false) String signature + ) { + + + if (ObjectUtil.isNull(map) || ObjectUtil.isEmpty(map)||!map.containsKey("code")||ObjectUtil.isEmpty(map.get("code"))) { + Result.fail("code不能为空"); + } + + String code=map.get("code").toString(); + + String qrCode=map.get("qrCode"); + + String rawData=map.get("rawData"); + + String signature=map.get("signature"); + + String encryptedData=map.get("encryptedData"); + + String ivStr=map.get("iv"); + + String phone=map.get("phone"); + + // 用户非敏感信息:rawData + // 签名:signature + JSONObject rawDataJson = JSON.parseObject(rawData); + // 1.接收小程序发送的code + // 2.开发者服务器 登录凭证校验接口 appi + appsecret + code + JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(code, customAppId, customSecrete); + // 3.接收微信接口服务 获取返回的参数 + String openid = SessionKeyOpenId.getString("openid"); + String sessionKey = SessionKeyOpenId.getString("session_key"); + + // 4.校验签名 小程序发送的签名signature与服务器端生成的签名signature2 = sha1(rawData + sessionKey) + String signature2 = DigestUtils.sha1Hex(rawData + sessionKey); + if (!signature.equals(signature2)) { + return Result.fail("签名校验失败"); + } + + String nickName = rawDataJson.getString( "nickName"); + String avatarUrl = rawDataJson.getString( "avatarUrl"); + + try { + return loginService.wxCustomLogin(openid, avatarUrl, nickName, phone,qrCode, IpUtil.getIpAddr(request)); + } catch (Exception e) { + e.printStackTrace(); + } + + return Result.fail("登录失败"); + + } + + + @RequestMapping("getPhoneNumber") + public Result getPhoneNumber(@RequestBody Map map){ + + if (ObjectUtil.isNull(map) || ObjectUtil.isEmpty(map)||!map.containsKey("code")||ObjectUtil.isEmpty(map.get("code"))) { + Result.fail("code不能为空"); + } + String code=map.get("code").toString(); + + String encryptedData=map.get("encryptedData"); + + String ivStr=map.get("iv"); + + + JSONObject SessionKeyOpenId = WechatUtil.getSessionKeyOrOpenId(code, customAppId, customSecrete); + // 3.接收微信接口服务 获取返回的参数 + String openid = SessionKeyOpenId.getString("openid"); + String sessionKey = SessionKeyOpenId.getString("session_key"); + + String data= WxMaCryptUtils.decrypt(sessionKey, encryptedData, ivStr); + if(ObjectUtil.isNotEmpty(data)&&JSONObject.parseObject(data).containsKey("phoneNumber")){ + return Result.success(CodeEnum.SUCCESS, JSONObject.parseObject(data).get("phoneNumber")); + } + return Result.fail("获取手机号失败"); + + } + + @Resource + private OnlineUserService onlineUserService; + + @PostMapping("/wx/merchant/login") + public Result wxCustomLogin(@RequestBody AuthUserDto authUserDto) { + //验证密码 + String mdPasswordString = MD5Utils.MD5Encode(authUserDto.getPassword(), "utf-8"); + // + TbMerchantAccount merchantAccount = merchantAccountMapper.selectByAccount(authUserDto.getUsername()); + if (merchantAccount == null) { + return Result.fail("无此用户"); + } + + if (!mdPasswordString.equalsIgnoreCase(merchantAccount.getPassword())) { + return Result.fail("密码错误"); + } + + //生成token + String token = StringUtil.genRandomNum(6) + StringUtil.getBillno() + StringUtil.genRandomNum(6); + //存入redis + OnlineUserDto jwtUserDto = onlineUserService.save(merchantAccount.getName(), merchantAccount.getAccount(), Integer.valueOf(merchantAccount.getShopId()), token,merchantAccount.getStatus()); + + //组装登录数据 + Map authInfo = new HashMap(2) {{ + put("token", token); + put("user", jwtUserDto); + }}; + return Result.success(CodeEnum.ENCRYPT,authInfo); + } + + + /** + * 获取会员码 + * @param openId + * @param token + * @param id + * @return + */ + @RequestMapping("createCardNo") + public Result createCardNo(@RequestHeader("openId") String openId,@RequestHeader("token") String token,@RequestHeader("id") String id){ + return loginService.createCardNo(id,openId); + } + + @GetMapping("/wx/userInfo") + public Result userInfo(@RequestParam("userId") Integer userId,@RequestParam("shopId") String shopId ){ + return loginService.userInfo(userId,shopId); + } + + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java new file mode 100644 index 0000000..01ba8dc --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/NotifyController.java @@ -0,0 +1,74 @@ +package com.chaozhanggui.system.cashierservice.controller; + + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; +import com.chaozhanggui.system.cashierservice.interceptor.RequestWrapper; +import com.chaozhanggui.system.cashierservice.service.PayService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +@CrossOrigin(origins = "*") +@RestController +@Slf4j +@RequestMapping("notify") +public class NotifyController { + + + + + @Autowired + PayService payService; + + + @RequestMapping("memberInCallBack") + public String memberInCallBack(HttpServletRequest request){ + + Map map= getParameterMap(request); + log.info("回调返回信息:{}",JSONUtil.toJsonStr(map)); + if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"200".equals(map.get("code")+"")){ + JSONObject object=JSONUtil.parseObj(map.get("data")); + if(ObjectUtil.isNotEmpty(object)&&object.containsKey("status")&&"1".equals(object.getStr("status"))){ + String orderNo=object.getStr("orderNumber"); + String channelTradeNo=object.getStr("channelTradeNo"); + return payService.minsuccess(orderNo,channelTradeNo); + } + } + return null; + } + + @RequestMapping("notifyCallBack") + public String notifyCallBack(HttpServletRequest request){ + + Map map= getParameterMap(request); + log.info("回调返回信息:{}",JSONUtil.toJsonStr(map)); + if(ObjectUtil.isNotEmpty(map)&&map.containsKey("code")&&"200".equals(map.get("code")+"")){ + JSONObject object=JSONUtil.parseObj(map.get("data")); + if(ObjectUtil.isNotEmpty(object)&&object.containsKey("status")&&"1".equals(object.getStr("status"))){ + String orderNo=object.getStr("orderNumber"); + return payService.callBackPay(orderNo); + } + } + + return null; + } + + + + private Map getParameterMap(HttpServletRequest request) { + RequestWrapper requestWrapper = new RequestWrapper(request); + String body = requestWrapper.getBody(); + if (ObjectUtil.isNotEmpty(body)) { + return JSONUtil.toBean(body, Map.class); + } + return null; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/OrderController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/OrderController.java new file mode 100644 index 0000000..f2974b1 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/OrderController.java @@ -0,0 +1,53 @@ +package com.chaozhanggui.system.cashierservice.controller; + +import com.chaozhanggui.system.cashierservice.entity.TbShopTable; +import com.chaozhanggui.system.cashierservice.entity.dto.OrderDto; +import com.chaozhanggui.system.cashierservice.service.OrderService; +import com.chaozhanggui.system.cashierservice.sign.Result; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.io.IOException; + +@CrossOrigin(origins = "*") +@RestController +@Slf4j +@RequestMapping("/order") +public class OrderController { + + @Resource + private OrderService orderService; + + /** + * 添加订单 + * @return + */ + @PostMapping("/creatOrder") + public Result createOrder(@RequestBody OrderDto shopTable){ + if (shopTable.getTableId() == null){ + return Result.fail("台桌号有误"); + } + return orderService.createOrder(shopTable.getTableId(),shopTable.getShopId(),shopTable.getUserId()); + } + + /** + * 订单回显 + * @param orderId + * @return + */ + @GetMapping ("/orderInfo") + private Result orderInfo(@RequestParam Integer orderId){ + return orderService.orderInfo(orderId); + } + + @GetMapping("/orderList") + private Result orderList(@RequestParam Integer userId,@RequestParam Integer page, + @RequestParam Integer size, @RequestParam String status){ + return orderService.orderList(userId,page,size,status); + } + @GetMapping("/testMessage") + private void testMessage(@RequestParam("tableId") String tableId, @RequestParam("message") String message) throws IOException { + orderService.testMessage(tableId,message); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/PayController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/PayController.java new file mode 100644 index 0000000..fee5b56 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/PayController.java @@ -0,0 +1,90 @@ +package com.chaozhanggui.system.cashierservice.controller; + +import cn.hutool.core.util.ObjectUtil; +import com.chaozhanggui.system.cashierservice.service.PayService; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.util.IpUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.Map; + +@CrossOrigin(origins = "*") +@RestController +@Slf4j +@RequestMapping("pay") +public class PayController { + + + @Autowired + PayService payService; + + + /** + * 支付 + * @param request + * @param openId + * @param map + * @return + */ + @RequestMapping("orderPay") + public Result pay(HttpServletRequest request, @RequestHeader("openId") String openId, @RequestBody Map map) { + if(ObjectUtil.isEmpty(map)||map.size()<=0||!map.containsKey("orderId")||ObjectUtil.isEmpty(map.get("orderId"))){ + return Result.fail("订单号不允许为空"); + } + + try { + return payService.payOrder(openId,map.get("orderId").toString(), IpUtil.getIpAddr(request)); + } catch (Exception e) { + e.printStackTrace(); + } + return Result.fail("支付失败"); + } + + + /** + * 修改订单状态 + * @param map + * @return + */ + @RequestMapping("modfiyOrderInfo") + public Result modfiyOrderInfo( @RequestBody Map map){ + if(ObjectUtil.isEmpty(map)||map.size()<=0||!map.containsKey("orderId")||ObjectUtil.isEmpty(map.get("orderId"))){ + return Result.fail("订单号不允许为空"); + } + + try { + return payService.modifyOrderStatus(Integer.valueOf(map.get("orderId"))); + } catch (IOException e) { + e.printStackTrace(); + } + return Result.fail("操作失败"); + } + + + /** + * 充值 + * @param request + * @param openId + * @param map + * @return + */ + @RequestMapping("memeberIn") + public Result memeberIn(HttpServletRequest request,@RequestHeader("openId") String openId,@RequestHeader("id") String id, + @RequestBody Map map + ){ + return payService.memberIn(openId,id,map.get("amount").toString(),map.get("shopId").toString(),IpUtil.getIpAddr(request)); + } + + + + + + + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java new file mode 100644 index 0000000..07ed28d --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/ProductController.java @@ -0,0 +1,44 @@ +package com.chaozhanggui.system.cashierservice.controller; + + +import cn.hutool.core.util.ObjectUtil; +import com.chaozhanggui.system.cashierservice.service.ProductService; +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.*; + +import java.util.Map; + +@CrossOrigin(origins = "*") +@RestController +@Slf4j +@RequestMapping("product") +public class ProductController { + + + @Autowired + private ProductService productService; + + @RequestMapping("queryProduct") + public Result queryProduct(@RequestBody Map map){ + + if(ObjectUtil.isEmpty(map)||map.size()<=0||!map.containsKey("code")){ + return Result.fail("参数错误"); + } + return productService.queryProduct(map.get("code").toString(),(map.containsKey("productGroupId")&&ObjectUtil.isNotEmpty(map.get("productGroupId")))?map.get("productGroupId").toString():""); + } + + + + @GetMapping("queryProductSku") + public Result queryProductSku( + @RequestParam("shopId") String shopId, + @RequestParam("productId") String productId, + @RequestParam("spec_tag") String spec_tag + ){ + return productService.queryProductSku(shopId,productId,spec_tag); + } + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/controller/TableController.java b/src/main/java/com/chaozhanggui/system/cashierservice/controller/TableController.java new file mode 100644 index 0000000..7ae6291 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/controller/TableController.java @@ -0,0 +1,49 @@ +package com.chaozhanggui.system.cashierservice.controller; + +import com.chaozhanggui.system.cashierservice.entity.TbShopTable; +import com.chaozhanggui.system.cashierservice.exception.MsgException; +import com.chaozhanggui.system.cashierservice.service.ShopTableService; +import com.chaozhanggui.system.cashierservice.sign.Result; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * @author lyf + */ +@CrossOrigin(origins = "*") +@RestController +@Slf4j +@RequestMapping("/table") +public class TableController { + @Resource + private ShopTableService shopTableService; + + /** + * 桌台列表 + * @return + */ + @PostMapping ("/list") + public Result tableList(@RequestBody TbShopTable shopTable){ + return shopTableService.tableList(shopTable.getShopId(),shopTable.getAreaId()); + } + + /** + * 绑定桌码 + * @param shopTable + * @return + */ + @PostMapping ("/binding") + public Result bindingQrcode(@RequestBody TbShopTable shopTable){ + if (shopTable.getQrcode() == null || shopTable.getId() == null){ + return Result.fail("参数有误"); + } + return shopTableService.bindingQrcode(shopTable); + } + + @GetMapping ("/area") + public Result areaList(@RequestParam Integer shopId){ + return shopTableService.areaList(shopId); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDeptMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDeptMapper.java new file mode 100644 index 0000000..b71b326 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDeptMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysDept; + +public interface SysDeptMapper { + int deleteByPrimaryKey(Long deptId); + + int insert(SysDept record); + + int insertSelective(SysDept record); + + SysDept selectByPrimaryKey(Long deptId); + + int updateByPrimaryKeySelective(SysDept record); + + int updateByPrimaryKey(SysDept record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictDetailMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictDetailMapper.java new file mode 100644 index 0000000..db7547e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictDetailMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysDictDetail; + +public interface SysDictDetailMapper { + int deleteByPrimaryKey(Long detailId); + + int insert(SysDictDetail record); + + int insertSelective(SysDictDetail record); + + SysDictDetail selectByPrimaryKey(Long detailId); + + int updateByPrimaryKeySelective(SysDictDetail record); + + int updateByPrimaryKey(SysDictDetail record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictMapper.java new file mode 100644 index 0000000..7204534 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysDictMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysDict; + +public interface SysDictMapper { + int deleteByPrimaryKey(Long dictId); + + int insert(SysDict record); + + int insertSelective(SysDict record); + + SysDict selectByPrimaryKey(Long dictId); + + int updateByPrimaryKeySelective(SysDict record); + + int updateByPrimaryKey(SysDict record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysJobMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysJobMapper.java new file mode 100644 index 0000000..2be374c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysJobMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysJob; + +public interface SysJobMapper { + int deleteByPrimaryKey(Long jobId); + + int insert(SysJob record); + + int insertSelective(SysJob record); + + SysJob selectByPrimaryKey(Long jobId); + + int updateByPrimaryKeySelective(SysJob record); + + int updateByPrimaryKey(SysJob record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysLogMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysLogMapper.java new file mode 100644 index 0000000..575629b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysLogMapper.java @@ -0,0 +1,20 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysLog; +import com.chaozhanggui.system.cashierservice.entity.SysLogWithBLOBs; + +public interface SysLogMapper { + int deleteByPrimaryKey(Long logId); + + int insert(SysLogWithBLOBs record); + + int insertSelective(SysLogWithBLOBs record); + + SysLogWithBLOBs selectByPrimaryKey(Long logId); + + int updateByPrimaryKeySelective(SysLogWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(SysLogWithBLOBs record); + + int updateByPrimaryKey(SysLog record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysMenuMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysMenuMapper.java new file mode 100644 index 0000000..8220af9 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysMenuMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysMenu; + +public interface SysMenuMapper { + int deleteByPrimaryKey(Long menuId); + + int insert(SysMenu record); + + int insertSelective(SysMenu record); + + SysMenu selectByPrimaryKey(Long menuId); + + int updateByPrimaryKeySelective(SysMenu record); + + int updateByPrimaryKey(SysMenu record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysQuartzJobMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysQuartzJobMapper.java new file mode 100644 index 0000000..db12f33 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysQuartzJobMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysQuartzJob; + +public interface SysQuartzJobMapper { + int deleteByPrimaryKey(Long jobId); + + int insert(SysQuartzJob record); + + int insertSelective(SysQuartzJob record); + + SysQuartzJob selectByPrimaryKey(Long jobId); + + int updateByPrimaryKeySelective(SysQuartzJob record); + + int updateByPrimaryKey(SysQuartzJob record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysQuartzLogMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysQuartzLogMapper.java new file mode 100644 index 0000000..01fe704 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysQuartzLogMapper.java @@ -0,0 +1,19 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysQuartzLog; + +public interface SysQuartzLogMapper { + int deleteByPrimaryKey(Long logId); + + int insert(SysQuartzLog record); + + int insertSelective(SysQuartzLog record); + + SysQuartzLog selectByPrimaryKey(Long logId); + + int updateByPrimaryKeySelective(SysQuartzLog record); + + int updateByPrimaryKeyWithBLOBs(SysQuartzLog record); + + int updateByPrimaryKey(SysQuartzLog record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRoleMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRoleMapper.java new file mode 100644 index 0000000..05e5c34 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRoleMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysRole; + +public interface SysRoleMapper { + int deleteByPrimaryKey(Long roleId); + + int insert(SysRole record); + + int insertSelective(SysRole record); + + SysRole selectByPrimaryKey(Long roleId); + + int updateByPrimaryKeySelective(SysRole record); + + int updateByPrimaryKey(SysRole record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRolesDeptsMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRolesDeptsMapper.java new file mode 100644 index 0000000..d76f3c2 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRolesDeptsMapper.java @@ -0,0 +1,11 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysRolesDeptsKey; + +public interface SysRolesDeptsMapper { + int deleteByPrimaryKey(SysRolesDeptsKey key); + + int insert(SysRolesDeptsKey record); + + int insertSelective(SysRolesDeptsKey record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRolesMenusMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRolesMenusMapper.java new file mode 100644 index 0000000..d4afdf6 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysRolesMenusMapper.java @@ -0,0 +1,11 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysRolesMenusKey; + +public interface SysRolesMenusMapper { + int deleteByPrimaryKey(SysRolesMenusKey key); + + int insert(SysRolesMenusKey record); + + int insertSelective(SysRolesMenusKey record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUserMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUserMapper.java new file mode 100644 index 0000000..0def8a3 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUserMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysUser; + +public interface SysUserMapper { + int deleteByPrimaryKey(Long userId); + + int insert(SysUser record); + + int insertSelective(SysUser record); + + SysUser selectByPrimaryKey(Long userId); + + int updateByPrimaryKeySelective(SysUser record); + + int updateByPrimaryKey(SysUser record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUsersJobsMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUsersJobsMapper.java new file mode 100644 index 0000000..7ff4a5a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUsersJobsMapper.java @@ -0,0 +1,11 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysUsersJobsKey; + +public interface SysUsersJobsMapper { + int deleteByPrimaryKey(SysUsersJobsKey key); + + int insert(SysUsersJobsKey record); + + int insertSelective(SysUsersJobsKey record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUsersRolesMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUsersRolesMapper.java new file mode 100644 index 0000000..d9f4ab5 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/SysUsersRolesMapper.java @@ -0,0 +1,11 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.SysUsersRolesKey; + +public interface SysUsersRolesMapper { + int deleteByPrimaryKey(SysUsersRolesKey key); + + int insert(SysUsersRolesKey record); + + int insertSelective(SysUsersRolesKey record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCashierCartMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCashierCartMapper.java new file mode 100644 index 0000000..5df9578 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbCashierCartMapper.java @@ -0,0 +1,60 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbCashierCart; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@Mapper +public interface TbCashierCartMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbCashierCart record); + + int insertSelective(TbCashierCart record); + + TbCashierCart selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbCashierCart record); + + int updateByPrimaryKey(TbCashierCart record); + + + List selectALlByMasterId(@Param("masterId") String masterId, @Param("status") String status); + + TbCashierCart selectByDetail(@Param("masterId") String masterId, @Param("productId") String productId, + @Param("shopId") String shopId, @Param("skuId") String skuId, @Param("day") String day, @Param("uuid") String uuid); + + List selectByMaskerId(@Param("masterId") String masterId, @Param("shopId") Integer shopId); + + void deleteByCartId(@Param("masterId") String masterId, @Param("cartId") Integer cartId); + + void updateStatus(@Param("masterId") Integer id, @Param("status") String status); + + + void updateStatusByMaster(@Param("shopId") Integer shopId, @Param("masterId") String masterId, + @Param("status") String status, @Param("day") String day); + + List selectAllCreateOrder(@Param("masterId") String masterId, @Param("shopId") Integer shopId, + @Param("day") String day, @Param("status") String status, @Param("uuid") String uuid); + + int updateByOrderId(String orderId); + + + void updateIsGift(@Param("maskerId") String maskerId, @Param("status") String status, @Param("shopId") Integer shopId, @Param("day") String day); + + int selectqgList(String shopId); + + void deleteBymasterId(@Param("masterId") String masterId, @Param("shopId") Integer shopId, + @Param("day") String day, @Param("status") String status); + + int updateStatusByOrderId(@Param("orderId") String orderId, @Param("status") String status); + + + List selectByOrderId(@Param("orderId") String orderId,@Param("status") String status); + + void updateStatusByTableId(@Param("tableId")String tableId,@Param("status") String status); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbDeviceOperateInfoMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbDeviceOperateInfoMapper.java new file mode 100644 index 0000000..38b0c4d --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbDeviceOperateInfoMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbDeviceOperateInfo; + +public interface TbDeviceOperateInfoMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbDeviceOperateInfo record); + + int insertSelective(TbDeviceOperateInfo record); + + TbDeviceOperateInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbDeviceOperateInfo record); + + int updateByPrimaryKey(TbDeviceOperateInfo record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbDeviceStockMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbDeviceStockMapper.java new file mode 100644 index 0000000..88b0e55 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbDeviceStockMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbDeviceStock; + +public interface TbDeviceStockMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbDeviceStock record); + + int insertSelective(TbDeviceStock record); + + TbDeviceStock selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbDeviceStock record); + + int updateByPrimaryKey(TbDeviceStock record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMemberInMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMemberInMapper.java new file mode 100644 index 0000000..479217c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMemberInMapper.java @@ -0,0 +1,23 @@ +package com.chaozhanggui.system.cashierservice.dao; + +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); + + int insert(TbMemberIn record); + + int insertSelective(TbMemberIn record); + + TbMemberIn selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbMemberIn record); + + int updateByPrimaryKey(TbMemberIn record); + + TbMemberIn selectByOrderNo(String ordrNo); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantAccountMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantAccountMapper.java new file mode 100644 index 0000000..e067028 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantAccountMapper.java @@ -0,0 +1,11 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbMerchantAccount; + +public interface TbMerchantAccountMapper { + + TbMerchantAccount selectByAccount(String account); + + TbMerchantAccount selectByShopId(String shopId); + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantRegisterMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantRegisterMapper.java new file mode 100644 index 0000000..6b3a888 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantRegisterMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbMerchantRegister; + +public interface TbMerchantRegisterMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbMerchantRegister record); + + int insertSelective(TbMerchantRegister record); + + TbMerchantRegister selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbMerchantRegister record); + + int updateByPrimaryKey(TbMerchantRegister record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantThirdApplyMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantThirdApplyMapper.java new file mode 100644 index 0000000..53707ad --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbMerchantThirdApplyMapper.java @@ -0,0 +1,23 @@ +package com.chaozhanggui.system.cashierservice.dao; + +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); + + int insert(TbMerchantThirdApply record); + + int insertSelective(TbMerchantThirdApply record); + + TbMerchantThirdApply selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbMerchantThirdApply record); + + int updateByPrimaryKeyWithBLOBs(TbMerchantThirdApply record); + + int updateByPrimaryKey(TbMerchantThirdApply record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderDetailMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderDetailMapper.java new file mode 100644 index 0000000..984ccde --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderDetailMapper.java @@ -0,0 +1,41 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.math.BigDecimal; +import java.util.List; + +@Mapper +@Component +public interface TbOrderDetailMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbOrderDetail record); + + int insertSelective(TbOrderDetail record); + + TbOrderDetail selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbOrderDetail record); + + int updateByPrimaryKey(TbOrderDetail record); + + void updateStatusByOrderId(@Param("orderId") int orderId, @Param("status") String status); + + void deleteByOUrderId(@Param("orderId") int orderId); + + List selectAllByOrderId(@Param("id") Integer id); + + + + + List selectAllByOrderIdAndStatus(@Param("list") List list, @Param("orderId") String orderId); + + BigDecimal selectByOrderId(String orderId); + + + void updateStatusByOrderIdAndStatus(@Param("orderId") int orderId,@Param("status") String status); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderExtendMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderExtendMapper.java new file mode 100644 index 0000000..018c1da --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderExtendMapper.java @@ -0,0 +1,20 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbOrderExtend; +import com.chaozhanggui.system.cashierservice.entity.TbOrderExtendWithBLOBs; + +public interface TbOrderExtendMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbOrderExtendWithBLOBs record); + + int insertSelective(TbOrderExtendWithBLOBs record); + + TbOrderExtendWithBLOBs selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbOrderExtendWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(TbOrderExtendWithBLOBs record); + + int updateByPrimaryKey(TbOrderExtend record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderInfoMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderInfoMapper.java new file mode 100644 index 0000000..bea67e1 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderInfoMapper.java @@ -0,0 +1,36 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@Mapper +public interface TbOrderInfoMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbOrderInfo record); + + int insertSelective(TbOrderInfo record); + + TbOrderInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbOrderInfo record); + + int updateByPrimaryKey(TbOrderInfo record); + + void updateStatusById(@Param("orderId") int orderId, @Param("status") String status); + + + List selectAllByStatus(String status); + TbOrderInfo selectByPayOrderNo(String payOrderNo); + + List selectByUserId(@Param("userId")Integer userId, @Param("page")Integer page, + @Param("size")Integer size, @Param("status") String status); + + + +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderPaymentMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderPaymentMapper.java new file mode 100644 index 0000000..5d13fdc --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbOrderPaymentMapper.java @@ -0,0 +1,23 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbOrderPayment; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +@Component +@Mapper +public interface TbOrderPaymentMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbOrderPayment record); + + int insertSelective(TbOrderPayment record); + + TbOrderPayment selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbOrderPayment record); + + int updateByPrimaryKey(TbOrderPayment record); + + TbOrderPayment selectByOrderId(String orderId); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPlussDeviceGoodsMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPlussDeviceGoodsMapper.java new file mode 100644 index 0000000..c97cc2d --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPlussDeviceGoodsMapper.java @@ -0,0 +1,19 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods; + +public interface TbPlussDeviceGoodsMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbPlussDeviceGoods record); + + int insertSelective(TbPlussDeviceGoods record); + + TbPlussDeviceGoods selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbPlussDeviceGoods record); + + int updateByPrimaryKeyWithBLOBs(TbPlussDeviceGoods record); + + int updateByPrimaryKey(TbPlussDeviceGoods record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPrintMachineMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPrintMachineMapper.java new file mode 100644 index 0000000..98984f8 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbPrintMachineMapper.java @@ -0,0 +1,28 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbPrintMachine; +import com.chaozhanggui.system.cashierservice.entity.TbPrintMachineWithBLOBs; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@Mapper +public interface TbPrintMachineMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbPrintMachineWithBLOBs record); + + int insertSelective(TbPrintMachineWithBLOBs record); + + TbPrintMachineWithBLOBs selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbPrintMachineWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(TbPrintMachineWithBLOBs record); + + int updateByPrimaryKey(TbPrintMachine record); + + List selectByShopId(String shopId); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductGroupMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductGroupMapper.java new file mode 100644 index 0000000..e5274ee --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductGroupMapper.java @@ -0,0 +1,31 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbProductGroup; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@Mapper +public interface TbProductGroupMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbProductGroup record); + + int insertSelective(TbProductGroup record); + + TbProductGroup selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbProductGroup record); + + int updateByPrimaryKeyWithBLOBs(TbProductGroup record); + + int updateByPrimaryKey(TbProductGroup record); + + List selectByIdAndShopId(@Param("code") String code); + + List selectByQrcode(@Param("qrCode") String qrCode,@Param("groupId") Integer groupId); + +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java new file mode 100644 index 0000000..a11ccb6 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductMapper.java @@ -0,0 +1,35 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbProduct; +import com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@Mapper +public interface TbProductMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbProductWithBLOBs record); + + int insertSelective(TbProductWithBLOBs record); + + TbProductWithBLOBs selectByPrimaryKey(Integer id); + + TbProduct selectById(Integer id); + + int updateByPrimaryKeySelective(TbProductWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(TbProductWithBLOBs record); + + int updateByPrimaryKey(TbProduct record); + + List selectByIdIn(@Param("ids") String ids); + + + Integer selectByQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId); + Integer selectByNewQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId,@Param("list") List list); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuMapper.java new file mode 100644 index 0000000..8409119 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuMapper.java @@ -0,0 +1,34 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbProductSku; +import com.chaozhanggui.system.cashierservice.entity.TbProductSkuWithBLOBs; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@Mapper +public interface TbProductSkuMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbProductSkuWithBLOBs record); + + int insertSelective(TbProductSkuWithBLOBs record); + + TbProductSkuWithBLOBs selectByPrimaryKey(Integer id); + Integer selectBySpecSnap(@Param("shopId")String shopId,@Param("tableId") Integer tableId,@Param("specSnap") String specSnap); + int updateByPrimaryKeySelective(TbProductSkuWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(TbProductSkuWithBLOBs record); + + int updateByPrimaryKey(TbProductSku record); + + TbProductSkuWithBLOBs selectByShopIdAndProductIdAndSpec(@Param("shopId") String shopId, @Param("productId") String productId, @Param("spec") String spec); + + void updateStockById(@Param("skuId") String skuId, @Param("num") Integer num); + void updateAddStockById(@Param("skuId") String skuId, @Param("num") Integer num); + + List selectAll(); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuResultMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuResultMapper.java new file mode 100644 index 0000000..2f91148 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSkuResultMapper.java @@ -0,0 +1,23 @@ +package com.chaozhanggui.system.cashierservice.dao; + +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); + + int insert(TbProductSkuResult record); + + int insertSelective(TbProductSkuResult record); + + TbProductSkuResult selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbProductSkuResult record); + + int updateByPrimaryKeyWithBLOBs(TbProductSkuResult record); + + int updateByPrimaryKey(TbProductSkuResult record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSpecMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSpecMapper.java new file mode 100644 index 0000000..fa5e22a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductSpecMapper.java @@ -0,0 +1,19 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbProductSpec; + +public interface TbProductSpecMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbProductSpec record); + + int insertSelective(TbProductSpec record); + + TbProductSpec selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbProductSpec record); + + int updateByPrimaryKeyWithBLOBs(TbProductSpec record); + + int updateByPrimaryKey(TbProductSpec record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductStockDetailMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductStockDetailMapper.java new file mode 100644 index 0000000..e7f0bb9 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductStockDetailMapper.java @@ -0,0 +1,19 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbProductStockDetail; + +public interface TbProductStockDetailMapper { + int deleteByPrimaryKey(Long id); + + int insert(TbProductStockDetail record); + + int insertSelective(TbProductStockDetail record); + + TbProductStockDetail selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(TbProductStockDetail record); + + int updateByPrimaryKeyWithBLOBs(TbProductStockDetail record); + + int updateByPrimaryKey(TbProductStockDetail record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductStockOperateMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductStockOperateMapper.java new file mode 100644 index 0000000..0f057e1 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbProductStockOperateMapper.java @@ -0,0 +1,19 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbProductStockOperate; + +public interface TbProductStockOperateMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbProductStockOperate record); + + int insertSelective(TbProductStockOperate record); + + TbProductStockOperate selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbProductStockOperate record); + + int updateByPrimaryKeyWithBLOBs(TbProductStockOperate record); + + int updateByPrimaryKey(TbProductStockOperate record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbReceiptSalesMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbReceiptSalesMapper.java new file mode 100644 index 0000000..51af334 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbReceiptSalesMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbReceiptSales; + +public interface TbReceiptSalesMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbReceiptSales record); + + int insertSelective(TbReceiptSales record); + + TbReceiptSales selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbReceiptSales record); + + int updateByPrimaryKey(TbReceiptSales record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbRenewalsPayLogMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbRenewalsPayLogMapper.java new file mode 100644 index 0000000..0f317e8 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbRenewalsPayLogMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbRenewalsPayLog; + +public interface TbRenewalsPayLogMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbRenewalsPayLog record); + + int insertSelective(TbRenewalsPayLog record); + + TbRenewalsPayLog selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbRenewalsPayLog record); + + int updateByPrimaryKey(TbRenewalsPayLog record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopAreaMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopAreaMapper.java new file mode 100644 index 0000000..5e5768b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopAreaMapper.java @@ -0,0 +1,23 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopArea; + +import java.util.List; + +public interface TbShopAreaMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopArea record); + + int insertSelective(TbShopArea record); + + TbShopArea selectByPrimaryKey(Integer id); + + List selectByShopId(Integer shopId); + + int updateByPrimaryKeySelective(TbShopArea record); + + int updateByPrimaryKeyWithBLOBs(TbShopArea record); + + int updateByPrimaryKey(TbShopArea record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCashSpreadMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCashSpreadMapper.java new file mode 100644 index 0000000..ddcc1bd --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCashSpreadMapper.java @@ -0,0 +1,20 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopCashSpread; +import com.chaozhanggui.system.cashierservice.entity.TbShopCashSpreadWithBLOBs; + +public interface TbShopCashSpreadMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopCashSpreadWithBLOBs record); + + int insertSelective(TbShopCashSpreadWithBLOBs record); + + TbShopCashSpreadWithBLOBs selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopCashSpreadWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(TbShopCashSpreadWithBLOBs record); + + int updateByPrimaryKey(TbShopCashSpread record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCategoryMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCategoryMapper.java new file mode 100644 index 0000000..e09d37c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCategoryMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopCategory; + +public interface TbShopCategoryMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopCategory record); + + int insertSelective(TbShopCategory record); + + TbShopCategory selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopCategory record); + + int updateByPrimaryKey(TbShopCategory record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCurrencyMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCurrencyMapper.java new file mode 100644 index 0000000..8dbcb5b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopCurrencyMapper.java @@ -0,0 +1,20 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopCurrency; +import com.chaozhanggui.system.cashierservice.entity.TbShopCurrencyWithBLOBs; + +public interface TbShopCurrencyMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopCurrencyWithBLOBs record); + + int insertSelective(TbShopCurrencyWithBLOBs record); + + TbShopCurrencyWithBLOBs selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopCurrencyWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(TbShopCurrencyWithBLOBs record); + + int updateByPrimaryKey(TbShopCurrency record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java new file mode 100644 index 0000000..42f5b48 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopInfoMapper.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopInfo; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +@Component +@Mapper +public interface TbShopInfoMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopInfo record); + + int insertSelective(TbShopInfo record); + + TbShopInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopInfo record); + + int updateByPrimaryKeyWithBLOBs(TbShopInfo record); + + int updateByPrimaryKey(TbShopInfo record); + + TbShopInfo selectByQrCode(String qrcode); + + TbShopInfo selectByPhone(String phone); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPayTypeMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPayTypeMapper.java new file mode 100644 index 0000000..e656808 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPayTypeMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopPayType; + +public interface TbShopPayTypeMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopPayType record); + + int insertSelective(TbShopPayType record); + + TbShopPayType selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopPayType record); + + int updateByPrimaryKey(TbShopPayType record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPurveyorMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPurveyorMapper.java new file mode 100644 index 0000000..edaa45b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPurveyorMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopPurveyor; + +public interface TbShopPurveyorMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopPurveyor record); + + int insertSelective(TbShopPurveyor record); + + TbShopPurveyor selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopPurveyor record); + + int updateByPrimaryKey(TbShopPurveyor record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPurveyorTransactMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPurveyorTransactMapper.java new file mode 100644 index 0000000..f5d20a0 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopPurveyorTransactMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopPurveyorTransact; + +public interface TbShopPurveyorTransactMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopPurveyorTransact record); + + int insertSelective(TbShopPurveyorTransact record); + + TbShopPurveyorTransact selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopPurveyorTransact record); + + int updateByPrimaryKey(TbShopPurveyorTransact record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopTableMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopTableMapper.java new file mode 100644 index 0000000..1cf5017 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopTableMapper.java @@ -0,0 +1,28 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopTable; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Component +@Mapper +public interface TbShopTableMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopTable record); + + int insertSelective(TbShopTable record); + + TbShopTable selectByPrimaryKey(Integer id); + + List selectShopTableById(@Param("shopId") Integer shopId, @Param("areaId")Integer areaId); + + TbShopTable selectQRcode(String code); + + int updateByPrimaryKeySelective(TbShopTable record); + + int updateByPrimaryKey(TbShopTable record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUnitMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUnitMapper.java new file mode 100644 index 0000000..920048c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUnitMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopUnit; + +public interface TbShopUnitMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopUnit record); + + int insertSelective(TbShopUnit record); + + TbShopUnit selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopUnit record); + + int updateByPrimaryKey(TbShopUnit record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUserFlowMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUserFlowMapper.java new file mode 100644 index 0000000..7cf0c32 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUserFlowMapper.java @@ -0,0 +1,26 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow; +import org.apache.ibatis.annotations.Mapper; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Map; + +@Component +@Mapper +public interface TbShopUserFlowMapper { + int deleteByPrimaryKey(Integer id); + + int insert(TbShopUserFlow record); + + int insertSelective(TbShopUserFlow record); + + TbShopUserFlow selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbShopUserFlow record); + + int updateByPrimaryKey(TbShopUserFlow record); + + List> selectByMemberAccountFlow(String memberId); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUserMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUserMapper.java new file mode 100644 index 0000000..1f0e8f8 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbShopUserMapper.java @@ -0,0 +1,28 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.TbShopUser; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Component; + +@Component +@Mapper +public interface TbShopUserMapper { + int deleteByPrimaryKey(String id); + + int insert(TbShopUser record); + + int insertSelective(TbShopUser record); + + TbShopUser selectByPrimaryKey(String id); + + int updateByPrimaryKeySelective(TbShopUser record); + + int updateByPrimaryKey(TbShopUser record); + + + TbShopUser selectByUserIdAndShopId(@Param("userId") String userId,@Param("shopId") String shopId); + + + TbShopUser selectByUserId(@Param("userId") String userId); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbTokenMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbTokenMapper.java new file mode 100644 index 0000000..65ac83b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbTokenMapper.java @@ -0,0 +1,21 @@ +package com.chaozhanggui.system.cashierservice.dao; + +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); + + int insert(TbToken record); + + int insertSelective(TbToken record); + + TbToken selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbToken record); + + int updateByPrimaryKey(TbToken record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbUserInfoMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbUserInfoMapper.java new file mode 100644 index 0000000..ba138d6 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/TbUserInfoMapper.java @@ -0,0 +1,26 @@ +package com.chaozhanggui.system.cashierservice.dao; + +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); + + int insert(TbUserInfo record); + + int insertSelective(TbUserInfo record); + + TbUserInfo selectByPrimaryKey(Integer id); + + int updateByPrimaryKeySelective(TbUserInfo record); + + int updateByPrimaryKey(TbUserInfo record); + + + TbUserInfo selectByOpenId(String openId); + + +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolAlipayConfigMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolAlipayConfigMapper.java new file mode 100644 index 0000000..dd5f556 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolAlipayConfigMapper.java @@ -0,0 +1,20 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.ToolAlipayConfig; +import com.chaozhanggui.system.cashierservice.entity.ToolAlipayConfigWithBLOBs; + +public interface ToolAlipayConfigMapper { + int deleteByPrimaryKey(Long configId); + + int insert(ToolAlipayConfigWithBLOBs record); + + int insertSelective(ToolAlipayConfigWithBLOBs record); + + ToolAlipayConfigWithBLOBs selectByPrimaryKey(Long configId); + + int updateByPrimaryKeySelective(ToolAlipayConfigWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(ToolAlipayConfigWithBLOBs record); + + int updateByPrimaryKey(ToolAlipayConfig record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolEmailConfigMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolEmailConfigMapper.java new file mode 100644 index 0000000..8b2d2f0 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolEmailConfigMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.ToolEmailConfig; + +public interface ToolEmailConfigMapper { + int deleteByPrimaryKey(Long configId); + + int insert(ToolEmailConfig record); + + int insertSelective(ToolEmailConfig record); + + ToolEmailConfig selectByPrimaryKey(Long configId); + + int updateByPrimaryKeySelective(ToolEmailConfig record); + + int updateByPrimaryKey(ToolEmailConfig record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolLocalStorageMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolLocalStorageMapper.java new file mode 100644 index 0000000..fcad4d7 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolLocalStorageMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.ToolLocalStorage; + +public interface ToolLocalStorageMapper { + int deleteByPrimaryKey(Long storageId); + + int insert(ToolLocalStorage record); + + int insertSelective(ToolLocalStorage record); + + ToolLocalStorage selectByPrimaryKey(Long storageId); + + int updateByPrimaryKeySelective(ToolLocalStorage record); + + int updateByPrimaryKey(ToolLocalStorage record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolQiniuConfigMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolQiniuConfigMapper.java new file mode 100644 index 0000000..b077cae --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolQiniuConfigMapper.java @@ -0,0 +1,20 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.ToolQiniuConfig; +import com.chaozhanggui.system.cashierservice.entity.ToolQiniuConfigWithBLOBs; + +public interface ToolQiniuConfigMapper { + int deleteByPrimaryKey(Long configId); + + int insert(ToolQiniuConfigWithBLOBs record); + + int insertSelective(ToolQiniuConfigWithBLOBs record); + + ToolQiniuConfigWithBLOBs selectByPrimaryKey(Long configId); + + int updateByPrimaryKeySelective(ToolQiniuConfigWithBLOBs record); + + int updateByPrimaryKeyWithBLOBs(ToolQiniuConfigWithBLOBs record); + + int updateByPrimaryKey(ToolQiniuConfig record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolQiniuContentMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolQiniuContentMapper.java new file mode 100644 index 0000000..bd580a5 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ToolQiniuContentMapper.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.ToolQiniuContent; + +public interface ToolQiniuContentMapper { + int deleteByPrimaryKey(Long contentId); + + int insert(ToolQiniuContent record); + + int insertSelective(ToolQiniuContent record); + + ToolQiniuContent selectByPrimaryKey(Long contentId); + + int updateByPrimaryKeySelective(ToolQiniuContent record); + + int updateByPrimaryKey(ToolQiniuContent record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/dao/ViewOrderMapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ViewOrderMapper.java new file mode 100644 index 0000000..44a16c9 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/dao/ViewOrderMapper.java @@ -0,0 +1,9 @@ +package com.chaozhanggui.system.cashierservice.dao; + +import com.chaozhanggui.system.cashierservice.entity.ViewOrder; + +public interface ViewOrderMapper { + int insert(ViewOrder record); + + int insertSelective(ViewOrder record); +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDept.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDept.java new file mode 100644 index 0000000..cc6f806 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDept.java @@ -0,0 +1,108 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysDept implements Serializable { + private Long deptId; + + private Long pid; + + private Integer subCount; + + private String name; + + private Integer deptSort; + + private Boolean enabled; + + private String createBy; + + private String updateBy; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public Long getPid() { + return pid; + } + + public void setPid(Long pid) { + this.pid = pid; + } + + public Integer getSubCount() { + return subCount; + } + + public void setSubCount(Integer subCount) { + this.subCount = subCount; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Integer getDeptSort() { + return deptSort; + } + + public void setDeptSort(Integer deptSort) { + this.deptSort = deptSort; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDict.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDict.java new file mode 100644 index 0000000..2317260 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDict.java @@ -0,0 +1,78 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysDict implements Serializable { + private Long dictId; + + private String name; + + private String description; + + private String createBy; + + private String updateBy; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getDictId() { + return dictId; + } + + public void setDictId(Long dictId) { + this.dictId = dictId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDictDetail.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDictDetail.java new file mode 100644 index 0000000..6e74012 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysDictDetail.java @@ -0,0 +1,98 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysDictDetail implements Serializable { + private Long detailId; + + private Long dictId; + + private String label; + + private String value; + + private Integer dictSort; + + private String createBy; + + private String updateBy; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getDetailId() { + return detailId; + } + + public void setDetailId(Long detailId) { + this.detailId = detailId; + } + + public Long getDictId() { + return dictId; + } + + public void setDictId(Long dictId) { + this.dictId = dictId; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label == null ? null : label.trim(); + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value == null ? null : value.trim(); + } + + public Integer getDictSort() { + return dictSort; + } + + public void setDictSort(Integer dictSort) { + this.dictSort = dictSort; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysJob.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysJob.java new file mode 100644 index 0000000..3d231f9 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysJob.java @@ -0,0 +1,88 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysJob implements Serializable { + private Long jobId; + + private String name; + + private Boolean enabled; + + private Integer jobSort; + + private String createBy; + + private String updateBy; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getJobId() { + return jobId; + } + + public void setJobId(Long jobId) { + this.jobId = jobId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public Integer getJobSort() { + return jobSort; + } + + public void setJobSort(Integer jobSort) { + this.jobSort = jobSort; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysLog.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysLog.java new file mode 100644 index 0000000..c86b582 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysLog.java @@ -0,0 +1,108 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysLog implements Serializable { + private Long logId; + + private String description; + + private String logType; + + private String method; + + private String requestIp; + + private Long time; + + private String username; + + private String address; + + private String browser; + + private Date createTime; + + private static final long serialVersionUID = 1L; + + public Long getLogId() { + return logId; + } + + public void setLogId(Long logId) { + this.logId = logId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public String getLogType() { + return logType; + } + + public void setLogType(String logType) { + this.logType = logType == null ? null : logType.trim(); + } + + public String getMethod() { + return method; + } + + public void setMethod(String method) { + this.method = method == null ? null : method.trim(); + } + + public String getRequestIp() { + return requestIp; + } + + public void setRequestIp(String requestIp) { + this.requestIp = requestIp == null ? null : requestIp.trim(); + } + + public Long getTime() { + return time; + } + + public void setTime(Long time) { + this.time = time; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username == null ? null : username.trim(); + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + public String getBrowser() { + return browser; + } + + public void setBrowser(String browser) { + this.browser = browser == null ? null : browser.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysLogWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysLogWithBLOBs.java new file mode 100644 index 0000000..49d2899 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysLogWithBLOBs.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class SysLogWithBLOBs extends SysLog implements Serializable { + private String params; + + private String exceptionDetail; + + private static final long serialVersionUID = 1L; + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params == null ? null : params.trim(); + } + + public String getExceptionDetail() { + return exceptionDetail; + } + + public void setExceptionDetail(String exceptionDetail) { + this.exceptionDetail = exceptionDetail == null ? null : exceptionDetail.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysMenu.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysMenu.java new file mode 100644 index 0000000..9fcc70a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysMenu.java @@ -0,0 +1,198 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysMenu implements Serializable { + private Long menuId; + + private Long pid; + + private Integer subCount; + + private Integer type; + + private String title; + + private String name; + + private String component; + + private Integer menuSort; + + private String icon; + + private String path; + + private Boolean iFrame; + + private Boolean cache; + + private Boolean hidden; + + private String permission; + + private String createBy; + + private String updateBy; + + private Date createTime; + + private Date updateTime; + + private String activeMenu; + + private static final long serialVersionUID = 1L; + + public Long getMenuId() { + return menuId; + } + + public void setMenuId(Long menuId) { + this.menuId = menuId; + } + + public Long getPid() { + return pid; + } + + public void setPid(Long pid) { + this.pid = pid; + } + + public Integer getSubCount() { + return subCount; + } + + public void setSubCount(Integer subCount) { + this.subCount = subCount; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title == null ? null : title.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getComponent() { + return component; + } + + public void setComponent(String component) { + this.component = component == null ? null : component.trim(); + } + + public Integer getMenuSort() { + return menuSort; + } + + public void setMenuSort(Integer menuSort) { + this.menuSort = menuSort; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon == null ? null : icon.trim(); + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path == null ? null : path.trim(); + } + + public Boolean getiFrame() { + return iFrame; + } + + public void setiFrame(Boolean iFrame) { + this.iFrame = iFrame; + } + + public Boolean getCache() { + return cache; + } + + public void setCache(Boolean cache) { + this.cache = cache; + } + + public Boolean getHidden() { + return hidden; + } + + public void setHidden(Boolean hidden) { + this.hidden = hidden; + } + + public String getPermission() { + return permission; + } + + public void setPermission(String permission) { + this.permission = permission == null ? null : permission.trim(); + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + public String getActiveMenu() { + return activeMenu; + } + + public void setActiveMenu(String activeMenu) { + this.activeMenu = activeMenu == null ? null : activeMenu.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysQuartzJob.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysQuartzJob.java new file mode 100644 index 0000000..81c4d6f --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysQuartzJob.java @@ -0,0 +1,168 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysQuartzJob implements Serializable { + private Long jobId; + + private String beanName; + + private String cronExpression; + + private Boolean isPause; + + private String jobName; + + private String methodName; + + private String params; + + private String description; + + private String personInCharge; + + private String email; + + private String subTask; + + private Boolean pauseAfterFailure; + + private String createBy; + + private String updateBy; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getJobId() { + return jobId; + } + + public void setJobId(Long jobId) { + this.jobId = jobId; + } + + public String getBeanName() { + return beanName; + } + + public void setBeanName(String beanName) { + this.beanName = beanName == null ? null : beanName.trim(); + } + + public String getCronExpression() { + return cronExpression; + } + + public void setCronExpression(String cronExpression) { + this.cronExpression = cronExpression == null ? null : cronExpression.trim(); + } + + public Boolean getIsPause() { + return isPause; + } + + public void setIsPause(Boolean isPause) { + this.isPause = isPause; + } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName == null ? null : jobName.trim(); + } + + public String getMethodName() { + return methodName; + } + + public void setMethodName(String methodName) { + this.methodName = methodName == null ? null : methodName.trim(); + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params == null ? null : params.trim(); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public String getPersonInCharge() { + return personInCharge; + } + + public void setPersonInCharge(String personInCharge) { + this.personInCharge = personInCharge == null ? null : personInCharge.trim(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + public String getSubTask() { + return subTask; + } + + public void setSubTask(String subTask) { + this.subTask = subTask == null ? null : subTask.trim(); + } + + public Boolean getPauseAfterFailure() { + return pauseAfterFailure; + } + + public void setPauseAfterFailure(Boolean pauseAfterFailure) { + this.pauseAfterFailure = pauseAfterFailure; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysQuartzLog.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysQuartzLog.java new file mode 100644 index 0000000..6738591 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysQuartzLog.java @@ -0,0 +1,108 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysQuartzLog implements Serializable { + private Long logId; + + private String beanName; + + private Date createTime; + + private String cronExpression; + + private Boolean isSuccess; + + private String jobName; + + private String methodName; + + private String params; + + private Long time; + + private String exceptionDetail; + + private static final long serialVersionUID = 1L; + + public Long getLogId() { + return logId; + } + + public void setLogId(Long logId) { + this.logId = logId; + } + + public String getBeanName() { + return beanName; + } + + public void setBeanName(String beanName) { + this.beanName = beanName == null ? null : beanName.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public String getCronExpression() { + return cronExpression; + } + + public void setCronExpression(String cronExpression) { + this.cronExpression = cronExpression == null ? null : cronExpression.trim(); + } + + public Boolean getIsSuccess() { + return isSuccess; + } + + public void setIsSuccess(Boolean isSuccess) { + this.isSuccess = isSuccess; + } + + public String getJobName() { + return jobName; + } + + public void setJobName(String jobName) { + this.jobName = jobName == null ? null : jobName.trim(); + } + + public String getMethodName() { + return methodName; + } + + public void setMethodName(String methodName) { + this.methodName = methodName == null ? null : methodName.trim(); + } + + public String getParams() { + return params; + } + + public void setParams(String params) { + this.params = params == null ? null : params.trim(); + } + + public Long getTime() { + return time; + } + + public void setTime(Long time) { + this.time = time; + } + + public String getExceptionDetail() { + return exceptionDetail; + } + + public void setExceptionDetail(String exceptionDetail) { + this.exceptionDetail = exceptionDetail == null ? null : exceptionDetail.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRole.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRole.java new file mode 100644 index 0000000..d2934d1 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRole.java @@ -0,0 +1,98 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysRole implements Serializable { + private Long roleId; + + private String name; + + private Integer level; + + private String description; + + private String dataScope; + + private String createBy; + + private String updateBy; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Integer getLevel() { + return level; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description == null ? null : description.trim(); + } + + public String getDataScope() { + return dataScope; + } + + public void setDataScope(String dataScope) { + this.dataScope = dataScope == null ? null : dataScope.trim(); + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRolesDeptsKey.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRolesDeptsKey.java new file mode 100644 index 0000000..ab28093 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRolesDeptsKey.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class SysRolesDeptsKey implements Serializable { + private Long roleId; + + private Long deptId; + + private static final long serialVersionUID = 1L; + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRolesMenusKey.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRolesMenusKey.java new file mode 100644 index 0000000..ff29281 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysRolesMenusKey.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class SysRolesMenusKey implements Serializable { + private Long menuId; + + private Long roleId; + + private static final long serialVersionUID = 1L; + + public Long getMenuId() { + return menuId; + } + + public void setMenuId(Long menuId) { + this.menuId = menuId; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUser.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUser.java new file mode 100644 index 0000000..a4ae328 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUser.java @@ -0,0 +1,178 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class SysUser implements Serializable { + private Long userId; + + private Long deptId; + + private String username; + + private String nickName; + + private String gender; + + private String phone; + + private String email; + + private String avatarName; + + private String avatarPath; + + private String password; + + private Boolean isAdmin; + + private Long enabled; + + private String createBy; + + private String updateBy; + + private Date pwdResetTime; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getDeptId() { + return deptId; + } + + public void setDeptId(Long deptId) { + this.deptId = deptId; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username == null ? null : username.trim(); + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName == null ? null : nickName.trim(); + } + + public String getGender() { + return gender; + } + + public void setGender(String gender) { + this.gender = gender == null ? null : gender.trim(); + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone == null ? null : phone.trim(); + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email == null ? null : email.trim(); + } + + public String getAvatarName() { + return avatarName; + } + + public void setAvatarName(String avatarName) { + this.avatarName = avatarName == null ? null : avatarName.trim(); + } + + public String getAvatarPath() { + return avatarPath; + } + + public void setAvatarPath(String avatarPath) { + this.avatarPath = avatarPath == null ? null : avatarPath.trim(); + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password == null ? null : password.trim(); + } + + public Boolean getIsAdmin() { + return isAdmin; + } + + public void setIsAdmin(Boolean isAdmin) { + this.isAdmin = isAdmin; + } + + public Long getEnabled() { + return enabled; + } + + public void setEnabled(Long enabled) { + this.enabled = enabled; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getPwdResetTime() { + return pwdResetTime; + } + + public void setPwdResetTime(Date pwdResetTime) { + this.pwdResetTime = pwdResetTime; + } + + 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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUsersJobsKey.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUsersJobsKey.java new file mode 100644 index 0000000..1da1fd3 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUsersJobsKey.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class SysUsersJobsKey implements Serializable { + private Long userId; + + private Long jobId; + + private static final long serialVersionUID = 1L; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getJobId() { + return jobId; + } + + public void setJobId(Long jobId) { + this.jobId = jobId; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUsersRolesKey.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUsersRolesKey.java new file mode 100644 index 0000000..65f4c13 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/SysUsersRolesKey.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class SysUsersRolesKey implements Serializable { + private Long userId; + + private Long roleId; + + private static final long serialVersionUID = 1L; + + public Long getUserId() { + return userId; + } + + public void setUserId(Long userId) { + this.userId = userId; + } + + public Long getRoleId() { + return roleId; + } + + public void setRoleId(Long roleId) { + this.roleId = roleId; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCashierCart.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCashierCart.java new file mode 100644 index 0000000..4e8ab74 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbCashierCart.java @@ -0,0 +1,63 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +@Data +public class TbCashierCart implements Serializable { + private Integer id; + + private String masterId; + + private String orderId; + + private String refOrderId; + + private BigDecimal totalAmount; + + private String productId; + + private String coverImg; + + private String isSku; + + private String skuId; + + private String name; + private String skuName; + + private BigDecimal salePrice; + private BigDecimal packFee; + + private Integer number; + + private Integer totalNumber; + + private Integer refundNumber; + + private String categoryId; + private String tradeDay; + + private String status; + + private Byte type; + + private String merchantId; + + private String shopId; + private String isPack; + private String isGift; + private String uuid; + + private Long createdAt; + private Long pendingAt; + + private Long updatedAt; + private Integer userId; + private String tableId; + private TbProductSpec tbProductSpec; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbDeviceOperateInfo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbDeviceOperateInfo.java new file mode 100644 index 0000000..e6c8e56 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbDeviceOperateInfo.java @@ -0,0 +1,68 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class TbDeviceOperateInfo implements Serializable { + private Integer id; + + private String deviceno; + + private String type; + + private String shopId; + + private Date createtime; + + private String remark; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getDeviceno() { + return deviceno; + } + + public void setDeviceno(String deviceno) { + this.deviceno = deviceno == null ? null : deviceno.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public Date getCreatetime() { + return createtime; + } + + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbDeviceStock.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbDeviceStock.java new file mode 100644 index 0000000..0c6fc38 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbDeviceStock.java @@ -0,0 +1,249 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +public class TbDeviceStock implements Serializable { + private Integer id; + + private String code; + + private String snno; + + private String orderno; + + private BigDecimal price; + + private String type; + + private String groupno; + + private String buymercname; + + private String buymercid; + + private String actmercname; + + private String actmercid; + + private String status; + + private Date createtime; + + private String createby; + + private String delflag; + + private String remarks; + + private Date updatetime; + + private String deviceno; + + private Integer belonguserid; + + private Integer extractuserid; + + private String rolecode; + + private Date instocktime; + + private String transferstatus; + + private Date bindtime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + public String getSnno() { + return snno; + } + + public void setSnno(String snno) { + this.snno = snno == null ? null : snno.trim(); + } + + public String getOrderno() { + return orderno; + } + + public void setOrderno(String orderno) { + this.orderno = orderno == null ? null : orderno.trim(); + } + + public BigDecimal getPrice() { + return price; + } + + public void setPrice(BigDecimal price) { + this.price = price; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getGroupno() { + return groupno; + } + + public void setGroupno(String groupno) { + this.groupno = groupno == null ? null : groupno.trim(); + } + + public String getBuymercname() { + return buymercname; + } + + public void setBuymercname(String buymercname) { + this.buymercname = buymercname == null ? null : buymercname.trim(); + } + + public String getBuymercid() { + return buymercid; + } + + public void setBuymercid(String buymercid) { + this.buymercid = buymercid == null ? null : buymercid.trim(); + } + + public String getActmercname() { + return actmercname; + } + + public void setActmercname(String actmercname) { + this.actmercname = actmercname == null ? null : actmercname.trim(); + } + + public String getActmercid() { + return actmercid; + } + + public void setActmercid(String actmercid) { + this.actmercid = actmercid == null ? null : actmercid.trim(); + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public Date getCreatetime() { + return createtime; + } + + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + public String getCreateby() { + return createby; + } + + public void setCreateby(String createby) { + this.createby = createby == null ? null : createby.trim(); + } + + public String getDelflag() { + return delflag; + } + + public void setDelflag(String delflag) { + this.delflag = delflag == null ? null : delflag.trim(); + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks == null ? null : remarks.trim(); + } + + public Date getUpdatetime() { + return updatetime; + } + + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + + public String getDeviceno() { + return deviceno; + } + + public void setDeviceno(String deviceno) { + this.deviceno = deviceno == null ? null : deviceno.trim(); + } + + public Integer getBelonguserid() { + return belonguserid; + } + + public void setBelonguserid(Integer belonguserid) { + this.belonguserid = belonguserid; + } + + public Integer getExtractuserid() { + return extractuserid; + } + + public void setExtractuserid(Integer extractuserid) { + this.extractuserid = extractuserid; + } + + public String getRolecode() { + return rolecode; + } + + public void setRolecode(String rolecode) { + this.rolecode = rolecode == null ? null : rolecode.trim(); + } + + public Date getInstocktime() { + return instocktime; + } + + public void setInstocktime(Date instocktime) { + this.instocktime = instocktime; + } + + public String getTransferstatus() { + return transferstatus; + } + + public void setTransferstatus(String transferstatus) { + this.transferstatus = transferstatus == null ? null : transferstatus.trim(); + } + + public Date getBindtime() { + return bindtime; + } + + public void setBindtime(Date bindtime) { + this.bindtime = bindtime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMemberIn.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMemberIn.java new file mode 100644 index 0000000..476ca5a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMemberIn.java @@ -0,0 +1,109 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +public class TbMemberIn implements Serializable { + private Integer id; + + private Integer userId; + + private Integer merchantId; + + private String code; + + private BigDecimal amount; + + private String status; + + private String orderNo; + + private String tradeNo; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getMerchantId() { + return merchantId; + } + + public void setMerchantId(Integer merchantId) { + this.merchantId = merchantId; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo == null ? null : orderNo.trim(); + } + + public String getTradeNo() { + return tradeNo; + } + + public void setTradeNo(String tradeNo) { + this.tradeNo = tradeNo == null ? null : tradeNo.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantAccount.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantAccount.java new file mode 100644 index 0000000..328982e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantAccount.java @@ -0,0 +1,260 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +/** + * 商家登陆帐号(TbMerchantAccount)实体类 + * + * @author lyf + * @since 2024-02-05 09:23:23 + */ +public class TbMerchantAccount implements Serializable { + private static final long serialVersionUID = -10920550123596123L; + /** + * 自增id + */ + private Integer id; + /** + * 登陆帐号 + */ + private String account; + /** + * 登陆密码 + */ + private String password; + /** + * 商家Id + */ + private String merchantId; + /** + * 门店Id + */ + private String shopId; + + private String shopSnap; + /** + * 是否管理员 + */ + private Integer isAdmin; + /** + * 是否商户:1商户帐号0-店铺帐号 + */ + private Integer isMercantile; + /** + * 姓名 + */ + private String name; + /** + * 性别:0女 1 男 + */ + private Integer sex; + /** + * 邮箱 + */ + private String email; + /** + * 头像 + */ + private String headImg; + /** + * 联系电话 + */ + private String telephone; + /** + * 状态 + */ + private Integer status; + /** + * 排序 + */ + private Integer sort; + + private Integer roleId; + /** + * 最后登陆时间 + */ + private Integer lastLoginAt; + /** + * 公众号openId + */ + private String mpOpenId; + /** + * 是否接收消息通知 + */ + private Integer msgAble; + + private Long createdAt; + + private Long updatedAt; + + + 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; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getMerchantId() { + return merchantId; + } + + public void setMerchantId(String merchantId) { + this.merchantId = merchantId; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId; + } + + public String getShopSnap() { + return shopSnap; + } + + public void setShopSnap(String shopSnap) { + this.shopSnap = shopSnap; + } + + public Integer getIsAdmin() { + return isAdmin; + } + + public void setIsAdmin(Integer isAdmin) { + this.isAdmin = isAdmin; + } + + public Integer getIsMercantile() { + return isMercantile; + } + + public void setIsMercantile(Integer isMercantile) { + this.isMercantile = isMercantile; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getSex() { + return sex; + } + + public void setSex(Integer sex) { + this.sex = sex; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getHeadImg() { + return headImg; + } + + public void setHeadImg(String headImg) { + this.headImg = headImg; + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Integer getRoleId() { + return roleId; + } + + public void setRoleId(Integer roleId) { + this.roleId = roleId; + } + + public Integer getLastLoginAt() { + return lastLoginAt; + } + + public void setLastLoginAt(Integer lastLoginAt) { + this.lastLoginAt = lastLoginAt; + } + + public String getMpOpenId() { + return mpOpenId; + } + + public void setMpOpenId(String mpOpenId) { + this.mpOpenId = mpOpenId; + } + + public Integer getMsgAble() { + return msgAble; + } + + public void setMsgAble(Integer msgAble) { + this.msgAble = msgAble; + } + + 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; + } + +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantRegister.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantRegister.java new file mode 100644 index 0000000..3a7f2db --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantRegister.java @@ -0,0 +1,198 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbMerchantRegister implements Serializable { + private Integer id; + + private String registerCode; + + private String appCode; + + private String telephone; + + private String merchantId; + + private String shopId; + + private String type; + + private BigDecimal amount; + + private Integer periodYear; + + private String name; + + private String address; + + private String logo; + + private String industry; + + private String industryName; + + private Integer status; + + private Integer limitShopNumber; + + private String sourcePath; + + private Long createdAt; + + private Long updatedAt; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getRegisterCode() { + return registerCode; + } + + public void setRegisterCode(String registerCode) { + this.registerCode = registerCode == null ? null : registerCode.trim(); + } + + public String getAppCode() { + return appCode; + } + + public void setAppCode(String appCode) { + this.appCode = appCode == null ? null : appCode.trim(); + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone == null ? null : telephone.trim(); + } + + 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 getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public Integer getPeriodYear() { + return periodYear; + } + + public void setPeriodYear(Integer periodYear) { + this.periodYear = periodYear; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + public String getLogo() { + return logo; + } + + public void setLogo(String logo) { + this.logo = logo == null ? null : logo.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 Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getLimitShopNumber() { + return limitShopNumber; + } + + public void setLimitShopNumber(Integer limitShopNumber) { + this.limitShopNumber = limitShopNumber; + } + + public String getSourcePath() { + return sourcePath; + } + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath == null ? null : sourcePath.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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantThirdApply.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantThirdApply.java new file mode 100644 index 0000000..b3c7922 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbMerchantThirdApply.java @@ -0,0 +1,97 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbMerchantThirdApply implements Serializable { + private Integer id; + + private String type; + + private String appId; + + private Byte status; + + private String payPassword; + + private String applymentState; + + private Long createdAt; + + private Long updatedAt; + + private String appToken; + + private static final long serialVersionUID = 1L; + + 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 == null ? null : type.trim(); + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId == null ? null : appId.trim(); + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getPayPassword() { + return payPassword; + } + + public void setPayPassword(String payPassword) { + this.payPassword = payPassword == null ? null : payPassword.trim(); + } + + public String getApplymentState() { + return applymentState; + } + + public void setApplymentState(String applymentState) { + this.applymentState = applymentState == null ? null : applymentState.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; + } + + public String getAppToken() { + return appToken; + } + + public void setAppToken(String appToken) { + this.appToken = appToken == null ? null : appToken.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderDetail.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderDetail.java new file mode 100644 index 0000000..3d97089 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderDetail.java @@ -0,0 +1,40 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class TbOrderDetail implements Serializable { + private Integer id; + + private Integer orderId; + + private Integer shopId; + + private Integer productId; + + private Integer productSkuId; + + private Integer num; + + private String productName; + private String status; + + private String productSkuName; + + private String productImg; + + private Date createTime; + + private Date updateTime; + + private BigDecimal price; + + private BigDecimal priceAmount; + private BigDecimal packAmount; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderExtend.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderExtend.java new file mode 100644 index 0000000..b1fddd7 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderExtend.java @@ -0,0 +1,98 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbOrderExtend implements Serializable { + private Integer id; + + private String creatorSnap; + + private String cashierSnap; + + private String terminalSnap; + + private String tableParty; + + private String shopId; + + private Long createdAt; + + private Long updatedAt; + + private String shopSnap; + + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getCreatorSnap() { + return creatorSnap; + } + + public void setCreatorSnap(String creatorSnap) { + this.creatorSnap = creatorSnap == null ? null : creatorSnap.trim(); + } + + public String getCashierSnap() { + return cashierSnap; + } + + public void setCashierSnap(String cashierSnap) { + this.cashierSnap = cashierSnap == null ? null : cashierSnap.trim(); + } + + public String getTerminalSnap() { + return terminalSnap; + } + + public void setTerminalSnap(String terminalSnap) { + this.terminalSnap = terminalSnap == null ? null : terminalSnap.trim(); + } + + public String getTableParty() { + return tableParty; + } + + public void setTableParty(String tableParty) { + this.tableParty = tableParty == null ? null : tableParty.trim(); + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.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; + } + + public String getShopSnap() { + return shopSnap; + } + + public void setShopSnap(String shopSnap) { + this.shopSnap = shopSnap == null ? null : shopSnap.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderExtendWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderExtendWithBLOBs.java new file mode 100644 index 0000000..d4269fe --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderExtendWithBLOBs.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbOrderExtendWithBLOBs extends TbOrderExtend implements Serializable { + private String cartList; + + private String paymentList; + + private static final long serialVersionUID = 1L; + + public String getCartList() { + return cartList; + } + + public void setCartList(String cartList) { + this.cartList = cartList == null ? null : cartList.trim(); + } + + public String getPaymentList() { + return paymentList; + } + + public void setPaymentList(String paymentList) { + this.paymentList = paymentList == null ? null : paymentList.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderInfo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderInfo.java new file mode 100644 index 0000000..c2e8b82 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderInfo.java @@ -0,0 +1,162 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +public class TbOrderInfo implements Serializable { + private Integer id; + + //订单号 + private String orderNo; + + private BigDecimal settlementAmount; + + private BigDecimal packFee; + + private BigDecimal originAmount; + + private BigDecimal productAmount; + + private BigDecimal amount; + + private BigDecimal refundAmount; + + private String payType; + + private BigDecimal payAmount; + + private BigDecimal orderAmount; + + private BigDecimal freightAmount; + + private BigDecimal discountRatio; + + private BigDecimal discountAmount; + + private String tableId; + + private BigDecimal smallChange; + + private String sendType; + + private String orderType; + + private String productType; + + private String status; + + private String billingId; + + private String merchantId; + + private String shopId; + + private Byte isVip; + + private String memberId; + private String userName; + private String memberName; + private String zdNo; + + private String userId; + private String imgUrl; + + private Integer productScore; + + private Integer deductScore; + + private String userCouponId; + + private BigDecimal userCouponAmount; + + private Byte refundAble; + + private Long paidTime; + + private Byte isEffect; + + private Byte isGroup; + + private Long updatedAt; + + private Long systemTime; + + private Long createdAt; + + private Byte isAccepted; + + private String payOrderNo; + private String tradeDay; + private Integer source; + private String remark; + private String tableName; + private String masterId; + private Integer totalNumber; + private List detailList; + + private static final long serialVersionUID = 1L; + public TbOrderInfo(){ + super(); + } + public TbOrderInfo( String orderNo, BigDecimal settlementAmount, BigDecimal packFee,BigDecimal originAmount, + BigDecimal productAmount,BigDecimal orderAmount, BigDecimal freightAmount,String tableId, String sendType, + String orderType,String merchantId,String shopId,String userId,Byte refundAble,String tradeDay,String masterId ) { + this.orderNo = orderNo; + this.masterId = masterId; + this.tradeDay = tradeDay; + this.settlementAmount = settlementAmount; + this.packFee = packFee; + this.originAmount = originAmount; + this.productAmount = productAmount; + this.orderAmount = orderAmount; + this.freightAmount = freightAmount; + this.tableId = tableId; + this.sendType = sendType; + this.orderType = orderType; + this.status = "unpaid"; + this.merchantId = merchantId; + this.shopId = shopId; + this.isVip = 0; + this.userId = userId; + this.refundAble = refundAble; + this.isEffect = 1; + this.systemTime = System.currentTimeMillis(); + this.createdAt = System.currentTimeMillis(); + this.isAccepted = 1; + } + + + + + public TbOrderInfo( String orderNo, BigDecimal settlementAmount, BigDecimal packFee,BigDecimal originAmount, + BigDecimal productAmount,BigDecimal orderAmount, BigDecimal freightAmount,String tableId, String sendType, + String orderType,String merchantId,String shopId,String userId,Byte refundAble,String tradeDay,String masterId,String status,BigDecimal payAmount) { + this.orderNo = orderNo; + this.masterId = masterId; + this.tradeDay = tradeDay; + this.settlementAmount = settlementAmount; + this.packFee = packFee; + this.originAmount = originAmount; + this.productAmount = productAmount; + this.orderAmount = orderAmount; + this.freightAmount = freightAmount; + this.payAmount=payAmount; + this.tableId = tableId; + this.sendType = sendType; + this.orderType = orderType; + this.status = status; + this.merchantId = merchantId; + this.shopId = shopId; + this.isVip = 0; + this.userId = userId; + this.refundAble = refundAble; + this.isEffect = 1; + this.systemTime = System.currentTimeMillis(); + this.createdAt = System.currentTimeMillis(); + this.isAccepted = 1; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderPayment.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderPayment.java new file mode 100644 index 0000000..a01999a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbOrderPayment.java @@ -0,0 +1,198 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbOrderPayment implements Serializable { + private Integer id; + + private String payTypeId; + + private BigDecimal amount; + + private BigDecimal paidAmount; + + private BigDecimal hasRefundAmount; + + private String payName; + + private String payType; + + private BigDecimal received; + + private BigDecimal changeFee; + + private String merchantId; + + private String shopId; + + private String billingId; + + private String orderId; + + private String authCode; + + private String refundable; + + private Long createdAt; + + private Long updatedAt; + + private String tradeNumber; + + private String memberId; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getPayTypeId() { + return payTypeId; + } + + public void setPayTypeId(String payTypeId) { + this.payTypeId = payTypeId == null ? null : payTypeId.trim(); + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public BigDecimal getPaidAmount() { + return paidAmount; + } + + public void setPaidAmount(BigDecimal paidAmount) { + this.paidAmount = paidAmount; + } + + public BigDecimal getHasRefundAmount() { + return hasRefundAmount; + } + + public void setHasRefundAmount(BigDecimal hasRefundAmount) { + this.hasRefundAmount = hasRefundAmount; + } + + public String getPayName() { + return payName; + } + + public void setPayName(String payName) { + this.payName = payName == null ? null : payName.trim(); + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType == null ? null : payType.trim(); + } + + public BigDecimal getReceived() { + return received; + } + + public void setReceived(BigDecimal received) { + this.received = received; + } + + public BigDecimal getChangeFee() { + return changeFee; + } + + public void setChangeFee(BigDecimal changeFee) { + this.changeFee = changeFee; + } + + 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 getBillingId() { + return billingId; + } + + public void setBillingId(String billingId) { + this.billingId = billingId == null ? null : billingId.trim(); + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId == null ? null : orderId.trim(); + } + + public String getAuthCode() { + return authCode; + } + + public void setAuthCode(String authCode) { + this.authCode = authCode == null ? null : authCode.trim(); + } + + public String getRefundable() { + return refundable; + } + + public void setRefundable(String refundable) { + this.refundable = refundable == null ? null : refundable.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; + } + + public String getTradeNumber() { + return tradeNumber; + } + + public void setTradeNumber(String tradeNumber) { + this.tradeNumber = tradeNumber == null ? null : tradeNumber.trim(); + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId == null ? null : memberId.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPlussDeviceGoods.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPlussDeviceGoods.java new file mode 100644 index 0000000..d3132cc --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPlussDeviceGoods.java @@ -0,0 +1,128 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class TbPlussDeviceGoods implements Serializable { + private Integer id; + + private String code; + + private String name; + + private String devicelogo; + + private String introdesc; + + private Integer sort; + + private Integer status; + + private Integer tagid; + + private String depositflag; + + private Date createtime; + + private Date updatetime; + + private String detail; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getDevicelogo() { + return devicelogo; + } + + public void setDevicelogo(String devicelogo) { + this.devicelogo = devicelogo == null ? null : devicelogo.trim(); + } + + public String getIntrodesc() { + return introdesc; + } + + public void setIntrodesc(String introdesc) { + this.introdesc = introdesc == null ? null : introdesc.trim(); + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public Integer getTagid() { + return tagid; + } + + public void setTagid(Integer tagid) { + this.tagid = tagid; + } + + public String getDepositflag() { + return depositflag; + } + + public void setDepositflag(String depositflag) { + this.depositflag = depositflag == null ? null : depositflag.trim(); + } + + public Date getCreatetime() { + return createtime; + } + + public void setCreatetime(Date createtime) { + this.createtime = createtime; + } + + public Date getUpdatetime() { + return updatetime; + } + + public void setUpdatetime(Date updatetime) { + this.updatetime = updatetime; + } + + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail == null ? null : detail.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPrintMachine.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPrintMachine.java new file mode 100644 index 0000000..3bdee44 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPrintMachine.java @@ -0,0 +1,167 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbPrintMachine implements Serializable { + private Integer id; + + private String name; + + private String type; + + private String connectionType; + + private String address; + + private String port; + + private String subType; + + private Byte status; + + private String shopId; + + private String categoryIds; + + private String contentType; + + private Long createdAt; + + private Long updatedAt; + + private Integer sort; + + private String vendorId; + + private String productId; + + 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 String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getConnectionType() { + return connectionType; + } + + public void setConnectionType(String connectionType) { + this.connectionType = connectionType == null ? null : connectionType.trim(); + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port == null ? null : port.trim(); + } + + public String getSubType() { + return subType; + } + + public void setSubType(String subType) { + this.subType = subType == null ? null : subType.trim(); + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public String getCategoryIds() { + return categoryIds; + } + + public void setCategoryIds(String categoryIds) { + this.categoryIds = categoryIds == null ? null : categoryIds.trim(); + } + + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType == null ? null : contentType.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; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public String getVendorId() { + return vendorId; + } + + public void setVendorId(String vendorId) { + this.vendorId = vendorId == null ? null : vendorId.trim(); + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId == null ? null : productId.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPrintMachineWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPrintMachineWithBLOBs.java new file mode 100644 index 0000000..6105769 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbPrintMachineWithBLOBs.java @@ -0,0 +1,33 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import org.springframework.data.annotation.Transient; + +import java.io.Serializable; +import java.util.List; + +public class TbPrintMachineWithBLOBs extends TbPrintMachine implements Serializable { + private String config; + + private String categoryList; + + + private static final long serialVersionUID = 1L; + + public String getConfig() { + return config; + } + + public void setConfig(String config) { + this.config = config == null ? null : config.trim(); + } + + public String getCategoryList() { + return categoryList; + } + + public void setCategoryList(String categoryList) { + this.categoryList = categoryList == null ? null : categoryList.trim(); + } + + +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java new file mode 100644 index 0000000..c828f9c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProduct.java @@ -0,0 +1,632 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import org.springframework.data.annotation.Transient; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbProduct implements Serializable { + private Integer id; + + private String categoryId; + + private Integer specId; + + private String sourcePath; + + private Integer brandId; + + private String merchantId; + + private String shopId; + + private String name; + + private String shortTitle; + + private String type; + + private BigDecimal packFee; + + private BigDecimal lowPrice; + + private BigDecimal lowMemberPrice; + + private String unitId; + + private String unitSnap; + + private String coverImg; + + private String shareImg; + + private String videoCoverImg; + + private Integer sort; + + private Integer limitNumber; + + private Integer productScore; + + private Byte status; + + private String failMsg; + + private Byte isRecommend; + + private Byte isHot; + + private Byte isNew; + + private Byte isOnSale; + + private Byte isShow; + + private String typeEnum; + + private Byte isDistribute; + + private Byte isDel; + + private Byte isStock; + + private Byte isPauseSale; + + private Byte isFreeFreight; + + private Long freightId; + + private String strategyType; + + private Integer strategyId; + + private Byte isVip; + + private Byte isDelete; + + private Long createdAt; + + private Long updatedAt; + + private Double baseSalesNumber; + + private Integer realSalesNumber; + + private Integer salesNumber; + + private Integer thumbCount; + + private Integer storeCount; + + private Integer furnishMeal; + + private Integer furnishExpress; + + private Integer furnishDraw; + + private Integer furnishVir; + + private Byte isCombo; + + private Byte isShowCash; + + private Byte isShowMall; + + private Byte isNeedExamine; + + private Byte showOnMallStatus; + + private Long showOnMallTime; + + private String showOnMallErrorMsg; + + private Byte enableLabel; + + private String taxConfigId; + + private String specTableHeaders; + + private String cartNumber="0"; + + public String getCartNumber() { + return cartNumber; + } + + public void setCartNumber(String cartNumber) { + this.cartNumber = cartNumber; + } + + @Transient + private TbProductSkuResult productSkuResult; + + + public TbProductSkuResult getProductSkuResult() { + return productSkuResult; + } + + public void setProductSkuResult(TbProductSkuResult productSkuResult) { + this.productSkuResult = 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(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductGroup.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductGroup.java new file mode 100644 index 0000000..9460370 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductGroup.java @@ -0,0 +1,147 @@ +package com.chaozhanggui.system.cashierservice.entity; + + +import org.springframework.data.annotation.Transient; + +import java.io.Serializable; +import java.util.List; + +public class TbProductGroup implements Serializable { + private Integer id; + + private String name; + + private String merchantId; + + private Integer shopId; + + private String pic; + + private Byte isShow; + + private String detail; + + private String style; + + private Integer sort; + + private Long createdAt; + + private Long updatedAt; + + private String productIds; + + + + @Transient + private List products; + + + + + public List getProducts() { + return products; + } + + public void setProducts(List products) { + this.products = products; + } + + 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 String getMerchantId() { + return merchantId; + } + + public void setMerchantId(String merchantId) { + this.merchantId = merchantId == null ? null : merchantId.trim(); + } + + public Integer getShopId() { + return shopId; + } + + public void setShopId(Integer shopId) { + this.shopId = shopId; + } + + public String getPic() { + return pic; + } + + public void setPic(String pic) { + this.pic = pic == null ? null : pic.trim(); + } + + public Byte getIsShow() { + return isShow; + } + + public void setIsShow(Byte isShow) { + this.isShow = isShow; + } + + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail == null ? null : detail.trim(); + } + + public String getStyle() { + return style; + } + + public void setStyle(String style) { + this.style = style == null ? null : style.trim(); + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + 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 getProductIds() { + return productIds; + } + + public void setProductIds(String productIds) { + this.productIds = productIds == null ? null : productIds.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSku.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSku.java new file mode 100644 index 0000000..924f457 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSku.java @@ -0,0 +1,218 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbProductSku implements Serializable { + private Integer id; + + private String shopId; + + private String barCode; + + private String productId; + + private BigDecimal originPrice; + + private BigDecimal costPrice; + + private BigDecimal memberPrice; + + private BigDecimal mealPrice; + + private BigDecimal salePrice; + + private BigDecimal guidePrice; + + private BigDecimal strategyPrice; + + private Double stockNumber; + + private String coverImg; + + private Integer warnLine; + + private Double weight; + + private Float volume; + + private Double realSalesNumber; + + private BigDecimal firstShared; + + private BigDecimal secondShared; + + private Long createdAt; + + private Long updatedAt; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode == null ? null : barCode.trim(); + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId == null ? null : productId.trim(); + } + + public BigDecimal getOriginPrice() { + return originPrice; + } + + public void setOriginPrice(BigDecimal originPrice) { + this.originPrice = originPrice; + } + + public BigDecimal getCostPrice() { + return costPrice; + } + + public void setCostPrice(BigDecimal costPrice) { + this.costPrice = costPrice; + } + + public BigDecimal getMemberPrice() { + return memberPrice; + } + + public void setMemberPrice(BigDecimal memberPrice) { + this.memberPrice = memberPrice; + } + + public BigDecimal getMealPrice() { + return mealPrice; + } + + public void setMealPrice(BigDecimal mealPrice) { + this.mealPrice = mealPrice; + } + + public BigDecimal getSalePrice() { + return salePrice; + } + + public void setSalePrice(BigDecimal salePrice) { + this.salePrice = salePrice; + } + + public BigDecimal getGuidePrice() { + return guidePrice; + } + + public void setGuidePrice(BigDecimal guidePrice) { + this.guidePrice = guidePrice; + } + + public BigDecimal getStrategyPrice() { + return strategyPrice; + } + + public void setStrategyPrice(BigDecimal strategyPrice) { + this.strategyPrice = strategyPrice; + } + + public Double getStockNumber() { + return stockNumber; + } + + public void setStockNumber(Double stockNumber) { + this.stockNumber = stockNumber; + } + + public String getCoverImg() { + return coverImg; + } + + public void setCoverImg(String coverImg) { + this.coverImg = coverImg == null ? null : coverImg.trim(); + } + + public Integer getWarnLine() { + return warnLine; + } + + public void setWarnLine(Integer warnLine) { + this.warnLine = warnLine; + } + + public Double getWeight() { + return weight; + } + + public void setWeight(Double weight) { + this.weight = weight; + } + + public Float getVolume() { + return volume; + } + + public void setVolume(Float volume) { + this.volume = volume; + } + + public Double getRealSalesNumber() { + return realSalesNumber; + } + + public void setRealSalesNumber(Double realSalesNumber) { + this.realSalesNumber = realSalesNumber; + } + + public BigDecimal getFirstShared() { + return firstShared; + } + + public void setFirstShared(BigDecimal firstShared) { + this.firstShared = firstShared; + } + + public BigDecimal getSecondShared() { + return secondShared; + } + + public void setSecondShared(BigDecimal secondShared) { + this.secondShared = secondShared; + } + + 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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSkuResult.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSkuResult.java new file mode 100644 index 0000000..7ced50b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSkuResult.java @@ -0,0 +1,67 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbProductSkuResult implements Serializable { + private Integer id; + + private String merchantId; + + private Long specId; + + private Long createdAt; + + private Long updatedAt; + + private String tagSnap; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getMerchantId() { + return merchantId; + } + + public void setMerchantId(String merchantId) { + this.merchantId = merchantId == null ? null : merchantId.trim(); + } + + public Long getSpecId() { + return specId; + } + + public void setSpecId(Long specId) { + this.specId = specId; + } + + 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 getTagSnap() { + return tagSnap; + } + + public void setTagSnap(String tagSnap) { + this.tagSnap = tagSnap == null ? null : tagSnap.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSkuWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSkuWithBLOBs.java new file mode 100644 index 0000000..f2af49c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSkuWithBLOBs.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbProductSkuWithBLOBs extends TbProductSku implements Serializable { + private String specInfo; + + private String specSnap; + + private static final long serialVersionUID = 1L; + + public String getSpecInfo() { + return specInfo; + } + + public void setSpecInfo(String specInfo) { + this.specInfo = specInfo == null ? null : specInfo.trim(); + } + + public String getSpecSnap() { + return specSnap; + } + + public void setSpecSnap(String specSnap) { + this.specSnap = specSnap == null ? null : specSnap.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSpec.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSpec.java new file mode 100644 index 0000000..44cc4e7 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductSpec.java @@ -0,0 +1,97 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbProductSpec implements Serializable { + private Integer id; + + private String shopId; + + private String name; + + private String specTag; + + private String specTagDetail; + + private Integer sort; + + private Long createdAt; + + private Long updatedAt; + + private String specList; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + 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 getSpecTag() { + return specTag; + } + + public void setSpecTag(String specTag) { + this.specTag = specTag == null ? null : specTag.trim(); + } + + public String getSpecTagDetail() { + return specTagDetail; + } + + public void setSpecTagDetail(String specTagDetail) { + this.specTagDetail = specTagDetail == null ? null : specTagDetail.trim(); + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + 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 getSpecList() { + return specList; + } + + public void setSpecList(String specList) { + this.specList = specList == null ? null : specList.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java new file mode 100644 index 0000000..1328ac2 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockDetail.java @@ -0,0 +1,268 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbProductStockDetail implements Serializable { + private Long id; + + private String skuId; + + private String productId; + + private String productName; + + private Byte isStock; + + private String specSnap; + + private String unitName; + + private String shopId; + + private String recordId; + + private String batchNumber; + + private String sourcePath; + + private String orderId; + + private Byte subType; + + private String type; + + private Integer leftNumber; + + private Long stockTime; + + private Double stockNumber; + + private BigDecimal costAmount; + + private BigDecimal salesAmount; + + private String operator; + + private String remark; + + private String barCode; + + private String coverImg; + + private Long createdAt; + + private Long updatedAt; + + private String stockSnap; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSkuId() { + return skuId; + } + + public void setSkuId(String skuId) { + this.skuId = skuId == null ? null : skuId.trim(); + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId == null ? null : productId.trim(); + } + + public String getProductName() { + return productName; + } + + public void setProductName(String productName) { + this.productName = productName == null ? null : productName.trim(); + } + + public Byte getIsStock() { + return isStock; + } + + public void setIsStock(Byte isStock) { + this.isStock = isStock; + } + + public String getSpecSnap() { + return specSnap; + } + + public void setSpecSnap(String specSnap) { + this.specSnap = specSnap == null ? null : specSnap.trim(); + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName == null ? null : unitName.trim(); + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public String getRecordId() { + return recordId; + } + + public void setRecordId(String recordId) { + this.recordId = recordId == null ? null : recordId.trim(); + } + + public String getBatchNumber() { + return batchNumber; + } + + public void setBatchNumber(String batchNumber) { + this.batchNumber = batchNumber == null ? null : batchNumber.trim(); + } + + public String getSourcePath() { + return sourcePath; + } + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath == null ? null : sourcePath.trim(); + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId == null ? null : orderId.trim(); + } + + public Byte getSubType() { + return subType; + } + + public void setSubType(Byte subType) { + this.subType = subType; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Integer getLeftNumber() { + return leftNumber; + } + + public void setLeftNumber(Integer leftNumber) { + this.leftNumber = leftNumber; + } + + public Long getStockTime() { + return stockTime; + } + + public void setStockTime(Long stockTime) { + this.stockTime = stockTime; + } + + public Double getStockNumber() { + return stockNumber; + } + + public void setStockNumber(Double stockNumber) { + this.stockNumber = stockNumber; + } + + public BigDecimal getCostAmount() { + return costAmount; + } + + public void setCostAmount(BigDecimal costAmount) { + this.costAmount = costAmount; + } + + public BigDecimal getSalesAmount() { + return salesAmount; + } + + public void setSalesAmount(BigDecimal salesAmount) { + this.salesAmount = salesAmount; + } + + public String getOperator() { + return operator; + } + + public void setOperator(String operator) { + this.operator = operator == null ? null : operator.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getBarCode() { + return barCode; + } + + public void setBarCode(String barCode) { + this.barCode = barCode == null ? null : barCode.trim(); + } + + public String getCoverImg() { + return coverImg; + } + + public void setCoverImg(String coverImg) { + this.coverImg = coverImg == null ? null : coverImg.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; + } + + public String getStockSnap() { + return stockSnap; + } + + public void setStockSnap(String stockSnap) { + this.stockSnap = stockSnap == null ? null : stockSnap.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockOperate.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockOperate.java new file mode 100644 index 0000000..51b902b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductStockOperate.java @@ -0,0 +1,147 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbProductStockOperate implements Serializable { + private Integer id; + + private String shopId; + + private String type; + + private Byte subType; + + private String batchNumber; + + private String remark; + + private Long stockTime; + + private String operatorSnap; + + private Long createdAt; + + private Long updatedAt; + + private String purveyorId; + + private String purveyorName; + + private String status; + + private String stockSnap; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Byte getSubType() { + return subType; + } + + public void setSubType(Byte subType) { + this.subType = subType; + } + + public String getBatchNumber() { + return batchNumber; + } + + public void setBatchNumber(String batchNumber) { + this.batchNumber = batchNumber == null ? null : batchNumber.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public Long getStockTime() { + return stockTime; + } + + public void setStockTime(Long stockTime) { + this.stockTime = stockTime; + } + + public String getOperatorSnap() { + return operatorSnap; + } + + public void setOperatorSnap(String operatorSnap) { + this.operatorSnap = operatorSnap == null ? null : operatorSnap.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; + } + + public String getPurveyorId() { + return purveyorId; + } + + public void setPurveyorId(String purveyorId) { + this.purveyorId = purveyorId == null ? null : purveyorId.trim(); + } + + public String getPurveyorName() { + return purveyorName; + } + + public void setPurveyorName(String purveyorName) { + this.purveyorName = purveyorName == null ? null : purveyorName.trim(); + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public String getStockSnap() { + return stockSnap; + } + + public void setStockSnap(String stockSnap) { + this.stockSnap = stockSnap == null ? null : stockSnap.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java new file mode 100644 index 0000000..7e7b701 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbProductWithBLOBs.java @@ -0,0 +1,67 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbProductWithBLOBs extends TbProduct implements Serializable { + private String images; + + private String video; + + private String notice; + + private String groupSnap; + + private String specInfo; + + private String selectSpec; + + private static final long serialVersionUID = 1L; + + public String getImages() { + return images; + } + + public void setImages(String images) { + this.images = images == null ? null : images.trim(); + } + + public String getVideo() { + return video; + } + + public void setVideo(String video) { + this.video = video == null ? null : video.trim(); + } + + public String getNotice() { + return notice; + } + + public void setNotice(String notice) { + this.notice = notice == null ? null : notice.trim(); + } + + public String getGroupSnap() { + return groupSnap; + } + + public void setGroupSnap(String groupSnap) { + this.groupSnap = groupSnap == null ? null : groupSnap.trim(); + } + + public String getSpecInfo() { + return specInfo; + } + + public void setSpecInfo(String specInfo) { + this.specInfo = specInfo == null ? null : specInfo.trim(); + } + + public String getSelectSpec() { + return selectSpec; + } + + public void setSelectSpec(String selectSpec) { + this.selectSpec = selectSpec == null ? null : selectSpec.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbReceiptSales.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbReceiptSales.java new file mode 100644 index 0000000..1a38a26 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbReceiptSales.java @@ -0,0 +1,207 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbReceiptSales implements Serializable { + private Integer id; + + private String title; + + private String logo; + + private Boolean showContactInfo; + + private Boolean showMember; + + private Boolean showMemberCode; + + private Boolean showMemberScore; + + private Boolean showMemberWallet; + + private String footerRemark; + + private Boolean showCashCharge; + + private Boolean showSerialNo; + + private Boolean bigSerialNo; + + private String headerText; + + private String headerTextAlign; + + private String footerText; + + private String footerTextAlign; + + private String footerImage; + + private String prePrint; + + private Long createdAt; + + private Long updatedAt; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title == null ? null : title.trim(); + } + + public String getLogo() { + return logo; + } + + public void setLogo(String logo) { + this.logo = logo == null ? null : logo.trim(); + } + + public Boolean getShowContactInfo() { + return showContactInfo; + } + + public void setShowContactInfo(Boolean showContactInfo) { + this.showContactInfo = showContactInfo; + } + + public Boolean getShowMember() { + return showMember; + } + + public void setShowMember(Boolean showMember) { + this.showMember = showMember; + } + + public Boolean getShowMemberCode() { + return showMemberCode; + } + + public void setShowMemberCode(Boolean showMemberCode) { + this.showMemberCode = showMemberCode; + } + + public Boolean getShowMemberScore() { + return showMemberScore; + } + + public void setShowMemberScore(Boolean showMemberScore) { + this.showMemberScore = showMemberScore; + } + + public Boolean getShowMemberWallet() { + return showMemberWallet; + } + + public void setShowMemberWallet(Boolean showMemberWallet) { + this.showMemberWallet = showMemberWallet; + } + + public String getFooterRemark() { + return footerRemark; + } + + public void setFooterRemark(String footerRemark) { + this.footerRemark = footerRemark == null ? null : footerRemark.trim(); + } + + public Boolean getShowCashCharge() { + return showCashCharge; + } + + public void setShowCashCharge(Boolean showCashCharge) { + this.showCashCharge = showCashCharge; + } + + public Boolean getShowSerialNo() { + return showSerialNo; + } + + public void setShowSerialNo(Boolean showSerialNo) { + this.showSerialNo = showSerialNo; + } + + public Boolean getBigSerialNo() { + return bigSerialNo; + } + + public void setBigSerialNo(Boolean bigSerialNo) { + this.bigSerialNo = bigSerialNo; + } + + public String getHeaderText() { + return headerText; + } + + public void setHeaderText(String headerText) { + this.headerText = headerText == null ? null : headerText.trim(); + } + + public String getHeaderTextAlign() { + return headerTextAlign; + } + + public void setHeaderTextAlign(String headerTextAlign) { + this.headerTextAlign = headerTextAlign == null ? null : headerTextAlign.trim(); + } + + public String getFooterText() { + return footerText; + } + + public void setFooterText(String footerText) { + this.footerText = footerText == null ? null : footerText.trim(); + } + + public String getFooterTextAlign() { + return footerTextAlign; + } + + public void setFooterTextAlign(String footerTextAlign) { + this.footerTextAlign = footerTextAlign == null ? null : footerTextAlign.trim(); + } + + public String getFooterImage() { + return footerImage; + } + + public void setFooterImage(String footerImage) { + this.footerImage = footerImage == null ? null : footerImage.trim(); + } + + public String getPrePrint() { + return prePrint; + } + + public void setPrePrint(String prePrint) { + this.prePrint = prePrint == null ? null : prePrint.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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbRenewalsPayLog.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbRenewalsPayLog.java new file mode 100644 index 0000000..9a4bcbd --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbRenewalsPayLog.java @@ -0,0 +1,148 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbRenewalsPayLog implements Serializable { + private Integer id; + + private String payType; + + private String shopId; + + private String orderId; + + private String openId; + + private String userId; + + private String transactionId; + + private BigDecimal amount; + + private Byte status; + + private String remark; + + private String attach; + + private Long expiredAt; + + private Long createdAt; + + private Long updatedAt; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType == null ? null : payType.trim(); + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public String getOrderId() { + return orderId; + } + + public void setOrderId(String orderId) { + this.orderId = orderId == null ? null : orderId.trim(); + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId == null ? null : openId.trim(); + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId == null ? null : userId.trim(); + } + + public String getTransactionId() { + return transactionId; + } + + public void setTransactionId(String transactionId) { + this.transactionId = transactionId == null ? null : transactionId.trim(); + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.trim(); + } + + public String getAttach() { + return attach; + } + + public void setAttach(String attach) { + this.attach = attach == null ? null : attach.trim(); + } + + public Long getExpiredAt() { + return expiredAt; + } + + public void setExpiredAt(Long expiredAt) { + this.expiredAt = expiredAt; + } + + 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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopArea.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopArea.java new file mode 100644 index 0000000..2d21e14 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopArea.java @@ -0,0 +1,97 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbShopArea implements Serializable { + private Integer id; + + private Integer shopId; + + private Integer sort; + + private String name; + + private Integer price; + + private String capacityRange; + + private Long createdAt; + + private Long updatedAt; + + private String view; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getShopId() { + return shopId; + } + + public void setShopId(Integer shopId) { + this.shopId = shopId; + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public Integer getPrice() { + return price; + } + + public void setPrice(Integer price) { + this.price = price; + } + + public String getCapacityRange() { + return capacityRange; + } + + public void setCapacityRange(String capacityRange) { + this.capacityRange = capacityRange == null ? null : capacityRange.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; + } + + public String getView() { + return view; + } + + public void setView(String view) { + this.view = view == null ? null : view.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCashSpread.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCashSpread.java new file mode 100644 index 0000000..1a6d486 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCashSpread.java @@ -0,0 +1,37 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbShopCashSpread implements Serializable { + private Integer id; + + private Long createdAt; + + private Long updatedAt; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + 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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCashSpreadWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCashSpreadWithBLOBs.java new file mode 100644 index 0000000..ac6cc8a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCashSpreadWithBLOBs.java @@ -0,0 +1,57 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbShopCashSpreadWithBLOBs extends TbShopCashSpread implements Serializable { + private String saleReceipt; + + private String triplicateReceipt; + + private String screenConfig; + + private String tagConfig; + + private String scaleConfig; + + private static final long serialVersionUID = 1L; + + public String getSaleReceipt() { + return saleReceipt; + } + + public void setSaleReceipt(String saleReceipt) { + this.saleReceipt = saleReceipt == null ? null : saleReceipt.trim(); + } + + public String getTriplicateReceipt() { + return triplicateReceipt; + } + + public void setTriplicateReceipt(String triplicateReceipt) { + this.triplicateReceipt = triplicateReceipt == null ? null : triplicateReceipt.trim(); + } + + public String getScreenConfig() { + return screenConfig; + } + + public void setScreenConfig(String screenConfig) { + this.screenConfig = screenConfig == null ? null : screenConfig.trim(); + } + + public String getTagConfig() { + return tagConfig; + } + + public void setTagConfig(String tagConfig) { + this.tagConfig = tagConfig == null ? null : tagConfig.trim(); + } + + public String getScaleConfig() { + return scaleConfig; + } + + public void setScaleConfig(String scaleConfig) { + this.scaleConfig = scaleConfig == null ? null : scaleConfig.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCategory.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCategory.java new file mode 100644 index 0000000..03b54f6 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCategory.java @@ -0,0 +1,157 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbShopCategory implements Serializable { + private Integer id; + + private String name; + + private String shortName; + + private Integer tree; + + private String pid; + + private String pic; + + private String merchantId; + + private String shopId; + + private String style; + + private Byte isShow; + + private String detail; + + private Integer sort; + + private String keyWord; + + private Long createdAt; + + private Long updatedAt; + + 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 String getShortName() { + return shortName; + } + + public void setShortName(String shortName) { + this.shortName = shortName == null ? null : shortName.trim(); + } + + public Integer getTree() { + return tree; + } + + public void setTree(Integer tree) { + this.tree = tree; + } + + public String getPid() { + return pid; + } + + public void setPid(String pid) { + this.pid = pid == null ? null : pid.trim(); + } + + public String getPic() { + return pic; + } + + public void setPic(String pic) { + this.pic = pic == null ? null : pic.trim(); + } + + 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 getStyle() { + return style; + } + + public void setStyle(String style) { + this.style = style == null ? null : style.trim(); + } + + public Byte getIsShow() { + return isShow; + } + + public void setIsShow(Byte isShow) { + this.isShow = isShow; + } + + public String getDetail() { + return detail; + } + + public void setDetail(String detail) { + this.detail = detail == null ? null : detail.trim(); + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public String getKeyWord() { + return keyWord; + } + + public void setKeyWord(String keyWord) { + this.keyWord = keyWord == null ? null : keyWord.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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCurrency.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCurrency.java new file mode 100644 index 0000000..4b71c95 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCurrency.java @@ -0,0 +1,208 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbShopCurrency implements Serializable { + private Integer id; + + private String shopId; + + private BigDecimal prepareAmount; + + private String currency; + + private Byte decimalsDigits; + + private String discountRound; + + private String merchantId; + + private Byte smallChange; + + private Byte enableCustomDiscount; + + private BigDecimal maxDiscount; + + private Double maxPercent; + + private String bizDuration; + + private Byte allowWebPay; + + private Byte isAutoToZero; + + private Byte isIncludeTaxPrice; + + private String taxNumber; + + private Long createdAt; + + private Long updatedAt; + + private Byte autoLockScreen; + + private Byte voiceNotification; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public BigDecimal getPrepareAmount() { + return prepareAmount; + } + + public void setPrepareAmount(BigDecimal prepareAmount) { + this.prepareAmount = prepareAmount; + } + + public String getCurrency() { + return currency; + } + + public void setCurrency(String currency) { + this.currency = currency == null ? null : currency.trim(); + } + + public Byte getDecimalsDigits() { + return decimalsDigits; + } + + public void setDecimalsDigits(Byte decimalsDigits) { + this.decimalsDigits = decimalsDigits; + } + + public String getDiscountRound() { + return discountRound; + } + + public void setDiscountRound(String discountRound) { + this.discountRound = discountRound == null ? null : discountRound.trim(); + } + + public String getMerchantId() { + return merchantId; + } + + public void setMerchantId(String merchantId) { + this.merchantId = merchantId == null ? null : merchantId.trim(); + } + + public Byte getSmallChange() { + return smallChange; + } + + public void setSmallChange(Byte smallChange) { + this.smallChange = smallChange; + } + + public Byte getEnableCustomDiscount() { + return enableCustomDiscount; + } + + public void setEnableCustomDiscount(Byte enableCustomDiscount) { + this.enableCustomDiscount = enableCustomDiscount; + } + + public BigDecimal getMaxDiscount() { + return maxDiscount; + } + + public void setMaxDiscount(BigDecimal maxDiscount) { + this.maxDiscount = maxDiscount; + } + + public Double getMaxPercent() { + return maxPercent; + } + + public void setMaxPercent(Double maxPercent) { + this.maxPercent = maxPercent; + } + + public String getBizDuration() { + return bizDuration; + } + + public void setBizDuration(String bizDuration) { + this.bizDuration = bizDuration == null ? null : bizDuration.trim(); + } + + public Byte getAllowWebPay() { + return allowWebPay; + } + + public void setAllowWebPay(Byte allowWebPay) { + this.allowWebPay = allowWebPay; + } + + public Byte getIsAutoToZero() { + return isAutoToZero; + } + + public void setIsAutoToZero(Byte isAutoToZero) { + this.isAutoToZero = isAutoToZero; + } + + public Byte getIsIncludeTaxPrice() { + return isIncludeTaxPrice; + } + + public void setIsIncludeTaxPrice(Byte isIncludeTaxPrice) { + this.isIncludeTaxPrice = isIncludeTaxPrice; + } + + public String getTaxNumber() { + return taxNumber; + } + + public void setTaxNumber(String taxNumber) { + this.taxNumber = taxNumber == null ? null : taxNumber.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; + } + + public Byte getAutoLockScreen() { + return autoLockScreen; + } + + public void setAutoLockScreen(Byte autoLockScreen) { + this.autoLockScreen = autoLockScreen; + } + + public Byte getVoiceNotification() { + return voiceNotification; + } + + public void setVoiceNotification(Byte voiceNotification) { + this.voiceNotification = voiceNotification; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCurrencyWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCurrencyWithBLOBs.java new file mode 100644 index 0000000..5fc056b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopCurrencyWithBLOBs.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbShopCurrencyWithBLOBs extends TbShopCurrency implements Serializable { + private String discountConfigs; + + private String serviceCharge; + + private static final long serialVersionUID = 1L; + + public String getDiscountConfigs() { + return discountConfigs; + } + + public void setDiscountConfigs(String discountConfigs) { + this.discountConfigs = discountConfigs == null ? null : discountConfigs.trim(); + } + + public String getServiceCharge() { + return serviceCharge; + } + + public void setServiceCharge(String serviceCharge) { + this.serviceCharge = serviceCharge == null ? null : serviceCharge.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopInfo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopInfo.java new file mode 100644 index 0000000..c311e8a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopInfo.java @@ -0,0 +1,448 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbShopInfo implements Serializable { + private Integer id; + + private String account; + + private String shopCode; + + private String subTitle; + + private String merchantId; + + private String shopName; + + private String chainName; + + private String backImg; + + private String frontImg; + + private String contactName; + + private String phone; + + private String logo; + + private Byte isDeposit; + + private Byte isSupply; + + private String coverImg; + + private String shareImg; + + private String detail; + + private String lat; + + private String lng; + + private String mchId; + + private String registerType; + + private Byte isWxMaIndependent; + + private String address; + + private String city; + + private String type; + + private String industry; + + private String industryName; + + private String businessTime; + + private String postTime; + + private BigDecimal postAmountLine; + + private Byte onSale; + + private Byte settleType; + + private String settleTime; + + private Integer enterAt; + + private Long expireAt; + + private Byte status; + + private Float average; + + private Integer orderWaitPayMinute; + + private Integer supportDeviceNumber; + + private Byte distributeLevel; + + private Long createdAt; + + private Long updatedAt; + + private String proxyId; + + private String view; + + 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(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPayType.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPayType.java new file mode 100644 index 0000000..7e85829 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPayType.java @@ -0,0 +1,137 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbShopPayType implements Serializable { + private Integer id; + + private String payType; + + private String payName; + + private Byte isShowShortcut; + + private String shopId; + + private Byte isRefundable; + + private Byte isOpenCashDrawer; + + private Byte isSystem; + + private Byte isIdeal; + + private Byte isDisplay; + + private Integer sorts; + + private Long createdAt; + + private Long updatedAt; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getPayType() { + return payType; + } + + public void setPayType(String payType) { + this.payType = payType == null ? null : payType.trim(); + } + + public String getPayName() { + return payName; + } + + public void setPayName(String payName) { + this.payName = payName == null ? null : payName.trim(); + } + + public Byte getIsShowShortcut() { + return isShowShortcut; + } + + public void setIsShowShortcut(Byte isShowShortcut) { + this.isShowShortcut = isShowShortcut; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public Byte getIsRefundable() { + return isRefundable; + } + + public void setIsRefundable(Byte isRefundable) { + this.isRefundable = isRefundable; + } + + public Byte getIsOpenCashDrawer() { + return isOpenCashDrawer; + } + + public void setIsOpenCashDrawer(Byte isOpenCashDrawer) { + this.isOpenCashDrawer = isOpenCashDrawer; + } + + public Byte getIsSystem() { + return isSystem; + } + + public void setIsSystem(Byte isSystem) { + this.isSystem = isSystem; + } + + public Byte getIsIdeal() { + return isIdeal; + } + + public void setIsIdeal(Byte isIdeal) { + this.isIdeal = isIdeal; + } + + public Byte getIsDisplay() { + return isDisplay; + } + + public void setIsDisplay(Byte isDisplay) { + this.isDisplay = isDisplay; + } + + public Integer getSorts() { + return sorts; + } + + public void setSorts(Integer sorts) { + this.sorts = sorts; + } + + 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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPurveyor.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPurveyor.java new file mode 100644 index 0000000..8e8c213 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPurveyor.java @@ -0,0 +1,137 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbShopPurveyor implements Serializable { + private Integer id; + + private String shopId; + + private Integer sort; + + private String name; + + private String purveyorName; + + private String purveyorTelephone; + + private Integer period; + + private String address; + + private String tip; + + private String remark; + + private Long createdAt; + + private Long updatedAt; + + private Long lastTransactAt; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getPurveyorName() { + return purveyorName; + } + + public void setPurveyorName(String purveyorName) { + this.purveyorName = purveyorName == null ? null : purveyorName.trim(); + } + + public String getPurveyorTelephone() { + return purveyorTelephone; + } + + public void setPurveyorTelephone(String purveyorTelephone) { + this.purveyorTelephone = purveyorTelephone == null ? null : purveyorTelephone.trim(); + } + + public Integer getPeriod() { + return period; + } + + public void setPeriod(Integer period) { + this.period = period; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address == null ? null : address.trim(); + } + + public String getTip() { + return tip; + } + + public void setTip(String tip) { + this.tip = tip == null ? null : tip.trim(); + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.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; + } + + public Long getLastTransactAt() { + return lastTransactAt; + } + + public void setLastTransactAt(Long lastTransactAt) { + this.lastTransactAt = lastTransactAt; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPurveyorTransact.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPurveyorTransact.java new file mode 100644 index 0000000..d90c6cc --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopPurveyorTransact.java @@ -0,0 +1,138 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbShopPurveyorTransact implements Serializable { + private Integer id; + + private String shopId; + + private String purveyorName; + + private String purveyorId; + + private Byte status; + + private String remark; + + private Long createdAt; + + private Long updatedAt; + + private BigDecimal totalAmount; + + private BigDecimal waitAmount; + + private BigDecimal paidAmount; + + private Long paidAt; + + private String type; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public String getPurveyorName() { + return purveyorName; + } + + public void setPurveyorName(String purveyorName) { + this.purveyorName = purveyorName == null ? null : purveyorName.trim(); + } + + public String getPurveyorId() { + return purveyorId; + } + + public void setPurveyorId(String purveyorId) { + this.purveyorId = purveyorId == null ? null : purveyorId.trim(); + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark == null ? null : remark.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; + } + + public BigDecimal getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(BigDecimal totalAmount) { + this.totalAmount = totalAmount; + } + + public BigDecimal getWaitAmount() { + return waitAmount; + } + + public void setWaitAmount(BigDecimal waitAmount) { + this.waitAmount = waitAmount; + } + + public BigDecimal getPaidAmount() { + return paidAmount; + } + + public void setPaidAmount(BigDecimal paidAmount) { + this.paidAmount = paidAmount; + } + + public Long getPaidAt() { + return paidAt; + } + + public void setPaidAt(Long paidAt) { + this.paidAt = paidAt; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopTable.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopTable.java new file mode 100644 index 0000000..9fd5e39 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopTable.java @@ -0,0 +1,179 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbShopTable implements Serializable { + private Integer id; + + private String name; + + private Integer shopId; + + private Integer maxCapacity; + + private Integer sort; + + private Integer areaId; + + private Byte isPredate; + + private BigDecimal predateAmount; + + private String status; + + private Byte type; + + private BigDecimal amount; + + private BigDecimal perhour; + + private String view; + + private Long createdAt; + + private Long updatedAt; + + private String qrcode; + + private String areaname; + + + public String getAreaname() { + return areaname; + } + + public void setAreaname(String areaname) { + this.areaname = areaname; + } + + public String getQrcode() { + return qrcode; + } + + 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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUnit.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUnit.java new file mode 100644 index 0000000..2b3b263 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUnit.java @@ -0,0 +1,107 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class TbShopUnit implements Serializable { + private Integer id; + + private String name; + + private Integer decimalsDigits; + + private String unitType; + + private Byte isSystem; + + private Byte status; + + private String merchantId; + + private String shopId; + + private Long createdAt; + + private Long updatedAt; + + 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 getDecimalsDigits() { + return decimalsDigits; + } + + public void setDecimalsDigits(Integer decimalsDigits) { + this.decimalsDigits = decimalsDigits; + } + + public String getUnitType() { + return unitType; + } + + public void setUnitType(String unitType) { + this.unitType = unitType == null ? null : unitType.trim(); + } + + public Byte getIsSystem() { + return isSystem; + } + + public void setIsSystem(Byte isSystem) { + this.isSystem = isSystem; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + 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 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; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUser.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUser.java new file mode 100644 index 0000000..c1a688d --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUser.java @@ -0,0 +1,288 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbShopUser implements Serializable { + private String id; + + private BigDecimal amount; + + private BigDecimal creditAmount; + + private BigDecimal consumeAmount; + + private Integer consumeNumber; + + private BigDecimal levelConsume; + + private Byte status; + + private String merchantId; + + private String shopId; + + private String userId; + + private String parentId; + + private String parentLevel; + + private String name; + + private String headImg; + + private Byte sex; + + private String birthDay; + + private String telephone; + + private Byte isVip; + + private String code; + + private Byte isAttention; + + private Integer attentionAt; + + private Byte isShareholder; + + private Byte level; + + private String distributeType; + + private Integer sort; + + private Long createdAt; + + private Long updatedAt; + + private String miniOpenId; + + private static final long serialVersionUID = 1L; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id == null ? null : id.trim(); + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public BigDecimal getCreditAmount() { + return creditAmount; + } + + public void setCreditAmount(BigDecimal creditAmount) { + this.creditAmount = creditAmount; + } + + public BigDecimal getConsumeAmount() { + return consumeAmount; + } + + public void setConsumeAmount(BigDecimal consumeAmount) { + this.consumeAmount = consumeAmount; + } + + public Integer getConsumeNumber() { + return consumeNumber; + } + + public void setConsumeNumber(Integer consumeNumber) { + this.consumeNumber = consumeNumber; + } + + public BigDecimal getLevelConsume() { + return levelConsume; + } + + public void setLevelConsume(BigDecimal levelConsume) { + this.levelConsume = levelConsume; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + 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 getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId == null ? null : userId.trim(); + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId == null ? null : parentId.trim(); + } + + public String getParentLevel() { + return parentLevel; + } + + public void setParentLevel(String parentLevel) { + this.parentLevel = parentLevel == null ? null : parentLevel.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getHeadImg() { + return headImg; + } + + public void setHeadImg(String headImg) { + this.headImg = headImg == null ? null : headImg.trim(); + } + + public Byte getSex() { + return sex; + } + + public void setSex(Byte sex) { + this.sex = sex; + } + + public String getBirthDay() { + return birthDay; + } + + public void setBirthDay(String birthDay) { + this.birthDay = birthDay == null ? null : birthDay.trim(); + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone == null ? null : telephone.trim(); + } + + public Byte getIsVip() { + return isVip; + } + + public void setIsVip(Byte isVip) { + this.isVip = isVip; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + public Byte getIsAttention() { + return isAttention; + } + + public void setIsAttention(Byte isAttention) { + this.isAttention = isAttention; + } + + public Integer getAttentionAt() { + return attentionAt; + } + + public void setAttentionAt(Integer attentionAt) { + this.attentionAt = attentionAt; + } + + public Byte getIsShareholder() { + return isShareholder; + } + + public void setIsShareholder(Byte isShareholder) { + this.isShareholder = isShareholder; + } + + public Byte getLevel() { + return level; + } + + public void setLevel(Byte level) { + this.level = level; + } + + public String getDistributeType() { + return distributeType; + } + + public void setDistributeType(String distributeType) { + this.distributeType = distributeType == null ? null : distributeType.trim(); + } + + public Integer getSort() { + return sort; + } + + public void setSort(Integer sort) { + this.sort = sort; + } + + 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 getMiniOpenId() { + return miniOpenId; + } + + public void setMiniOpenId(String miniOpenId) { + this.miniOpenId = miniOpenId == null ? null : miniOpenId.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUserFlow.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUserFlow.java new file mode 100644 index 0000000..d70e58c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbShopUserFlow.java @@ -0,0 +1,79 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +public class TbShopUserFlow implements Serializable { + private Integer id; + + private Integer shopUserId; + + private BigDecimal amount; + + private BigDecimal balance; + + private String bizCode; + + private String bizName; + + private Date createTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getShopUserId() { + return shopUserId; + } + + public void setShopUserId(Integer shopUserId) { + this.shopUserId = shopUserId; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + public String getBizCode() { + return bizCode; + } + + public void setBizCode(String bizCode) { + this.bizCode = bizCode == null ? null : bizCode.trim(); + } + + public String getBizName() { + return bizName; + } + + public void setBizName(String bizName) { + this.bizName = bizName == null ? null : bizName.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbToken.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbToken.java new file mode 100644 index 0000000..b53a6e9 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbToken.java @@ -0,0 +1,109 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class TbToken implements Serializable { + private Integer id; + + private Integer accountId; + + private Integer staffId; + + private String clientType; + + private String token; + + private String ip; + + private String status; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public Integer getAccountId() { + return accountId; + } + + public void setAccountId(Integer accountId) { + this.accountId = accountId; + } + + public Integer getStaffId() { + return staffId; + } + + public void setStaffId(Integer staffId) { + this.staffId = staffId; + } + + public String getClientType() { + return clientType; + } + + public void setClientType(String clientType) { + this.clientType = clientType == null ? null : clientType.trim(); + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token == null ? null : token.trim(); + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip == null ? null : ip.trim(); + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + + public TbToken(Integer accountId, Integer staffId, String clientType, String token, String ip, String status, Date createTime) { + this.accountId = accountId; + this.staffId = staffId; + this.clientType = clientType; + this.token = token; + this.ip = ip; + this.status = status; + this.createTime = createTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbUserInfo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbUserInfo.java new file mode 100644 index 0000000..63acc56 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/TbUserInfo.java @@ -0,0 +1,478 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class TbUserInfo implements Serializable { + private Integer id; + + private BigDecimal amount; + + private BigDecimal chargeAmount; + + private BigDecimal lineOfCredit; + + private BigDecimal consumeAmount; + + private Integer consumeNumber; + + private Integer totalScore; + + private Integer lockScore; + + private String cardNo; + + private String cardPassword; + + private String levelId; + + private String headImg; + + private String nickName; + + private String telephone; + + private String wxMaAppId; + + private String birthDay; + + private Byte sex; + + private String miniAppOpenId; + + private String openId; + + private String unionId; + + private String code; + + private String type; + + private Byte identify; + + private Byte status; + + private String parentId; + + private String parentLevel; + + private String parentType; + + private String projectId; + + private String merchantId; + + private Byte isResource; + + private Byte isOnline; + + private Byte isVip; + + private Integer vipEffectAt; + + private String tips; + + private String sourcePath; + + private Byte isSalesPerson; + + private Byte isAttentionMp; + + private String city; + + private String searchWord; + + private Long lastLogInAt; + + private Long lastLeaveAt; + + private Long createdAt; + + private Long updatedAt; + + private Long bindParentAt; + + private String grandParentId; + + private String avatar = ""; + + private String phone=""; + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getAvatar() { + return avatar; + } + + public void setAvatar(String avatar) { + this.avatar = avatar; + } + + private static final long serialVersionUID = 1L; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public BigDecimal getChargeAmount() { + return chargeAmount; + } + + public void setChargeAmount(BigDecimal chargeAmount) { + this.chargeAmount = chargeAmount; + } + + public BigDecimal getLineOfCredit() { + return lineOfCredit; + } + + public void setLineOfCredit(BigDecimal lineOfCredit) { + this.lineOfCredit = lineOfCredit; + } + + public BigDecimal getConsumeAmount() { + return consumeAmount; + } + + public void setConsumeAmount(BigDecimal consumeAmount) { + this.consumeAmount = consumeAmount; + } + + public Integer getConsumeNumber() { + return consumeNumber; + } + + public void setConsumeNumber(Integer consumeNumber) { + this.consumeNumber = consumeNumber; + } + + public Integer getTotalScore() { + return totalScore; + } + + public void setTotalScore(Integer totalScore) { + this.totalScore = totalScore; + } + + public Integer getLockScore() { + return lockScore; + } + + public void setLockScore(Integer lockScore) { + this.lockScore = lockScore; + } + + public String getCardNo() { + return cardNo; + } + + public void setCardNo(String cardNo) { + this.cardNo = cardNo == null ? null : cardNo.trim(); + } + + public String getCardPassword() { + return cardPassword; + } + + public void setCardPassword(String cardPassword) { + this.cardPassword = cardPassword == null ? null : cardPassword.trim(); + } + + public String getLevelId() { + return levelId; + } + + public void setLevelId(String levelId) { + this.levelId = levelId == null ? null : levelId.trim(); + } + + public String getHeadImg() { + return headImg; + } + + public void setHeadImg(String headImg) { + this.headImg = headImg == null ? null : headImg.trim(); + } + + public String getNickName() { + return nickName; + } + + public void setNickName(String nickName) { + this.nickName = nickName == null ? null : nickName.trim(); + } + + public String getTelephone() { + return telephone; + } + + public void setTelephone(String telephone) { + this.telephone = telephone == null ? null : telephone.trim(); + } + + public String getWxMaAppId() { + return wxMaAppId; + } + + public void setWxMaAppId(String wxMaAppId) { + this.wxMaAppId = wxMaAppId == null ? null : wxMaAppId.trim(); + } + + public String getBirthDay() { + return birthDay; + } + + public void setBirthDay(String birthDay) { + this.birthDay = birthDay == null ? null : birthDay.trim(); + } + + public Byte getSex() { + return sex; + } + + public void setSex(Byte sex) { + this.sex = sex; + } + + public String getMiniAppOpenId() { + return miniAppOpenId; + } + + public void setMiniAppOpenId(String miniAppOpenId) { + this.miniAppOpenId = miniAppOpenId == null ? null : miniAppOpenId.trim(); + } + + public String getOpenId() { + return openId; + } + + public void setOpenId(String openId) { + this.openId = openId == null ? null : openId.trim(); + } + + public String getUnionId() { + return unionId; + } + + public void setUnionId(String unionId) { + this.unionId = unionId == null ? null : unionId.trim(); + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code == null ? null : code.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public Byte getIdentify() { + return identify; + } + + public void setIdentify(Byte identify) { + this.identify = identify; + } + + public Byte getStatus() { + return status; + } + + public void setStatus(Byte status) { + this.status = status; + } + + public String getParentId() { + return parentId; + } + + public void setParentId(String parentId) { + this.parentId = parentId == null ? null : parentId.trim(); + } + + public String getParentLevel() { + return parentLevel; + } + + public void setParentLevel(String parentLevel) { + this.parentLevel = parentLevel == null ? null : parentLevel.trim(); + } + + public String getParentType() { + return parentType; + } + + public void setParentType(String parentType) { + this.parentType = parentType == null ? null : parentType.trim(); + } + + public String getProjectId() { + return projectId; + } + + public void setProjectId(String projectId) { + this.projectId = projectId == null ? null : projectId.trim(); + } + + public String getMerchantId() { + return merchantId; + } + + public void setMerchantId(String merchantId) { + this.merchantId = merchantId == null ? null : merchantId.trim(); + } + + public Byte getIsResource() { + return isResource; + } + + public void setIsResource(Byte isResource) { + this.isResource = isResource; + } + + public Byte getIsOnline() { + return isOnline; + } + + public void setIsOnline(Byte isOnline) { + this.isOnline = isOnline; + } + + public Byte getIsVip() { + return isVip; + } + + public void setIsVip(Byte isVip) { + this.isVip = isVip; + } + + public Integer getVipEffectAt() { + return vipEffectAt; + } + + public void setVipEffectAt(Integer vipEffectAt) { + this.vipEffectAt = vipEffectAt; + } + + public String getTips() { + return tips; + } + + public void setTips(String tips) { + this.tips = tips == null ? null : tips.trim(); + } + + public String getSourcePath() { + return sourcePath; + } + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath == null ? null : sourcePath.trim(); + } + + public Byte getIsSalesPerson() { + return isSalesPerson; + } + + public void setIsSalesPerson(Byte isSalesPerson) { + this.isSalesPerson = isSalesPerson; + } + + public Byte getIsAttentionMp() { + return isAttentionMp; + } + + public void setIsAttentionMp(Byte isAttentionMp) { + this.isAttentionMp = isAttentionMp; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city == null ? null : city.trim(); + } + + public String getSearchWord() { + return searchWord; + } + + public void setSearchWord(String searchWord) { + this.searchWord = searchWord == null ? null : searchWord.trim(); + } + + public Long getLastLogInAt() { + return lastLogInAt; + } + + public void setLastLogInAt(Long lastLogInAt) { + this.lastLogInAt = lastLogInAt; + } + + public Long getLastLeaveAt() { + return lastLeaveAt; + } + + public void setLastLeaveAt(Long lastLeaveAt) { + this.lastLeaveAt = lastLeaveAt; + } + + 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 Long getBindParentAt() { + return bindParentAt; + } + + public void setBindParentAt(Long bindParentAt) { + this.bindParentAt = bindParentAt; + } + + public String getGrandParentId() { + return grandParentId; + } + + public void setGrandParentId(String grandParentId) { + this.grandParentId = grandParentId == null ? null : grandParentId.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolAlipayConfig.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolAlipayConfig.java new file mode 100644 index 0000000..79615f3 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolAlipayConfig.java @@ -0,0 +1,97 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class ToolAlipayConfig implements Serializable { + private Long configId; + + private String appId; + + private String charset; + + private String format; + + private String gatewayUrl; + + private String notifyUrl; + + private String returnUrl; + + private String signType; + + private String sysServiceProviderId; + + private static final long serialVersionUID = 1L; + + public Long getConfigId() { + return configId; + } + + public void setConfigId(Long configId) { + this.configId = configId; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId == null ? null : appId.trim(); + } + + public String getCharset() { + return charset; + } + + public void setCharset(String charset) { + this.charset = charset == null ? null : charset.trim(); + } + + public String getFormat() { + return format; + } + + public void setFormat(String format) { + this.format = format == null ? null : format.trim(); + } + + public String getGatewayUrl() { + return gatewayUrl; + } + + public void setGatewayUrl(String gatewayUrl) { + this.gatewayUrl = gatewayUrl == null ? null : gatewayUrl.trim(); + } + + public String getNotifyUrl() { + return notifyUrl; + } + + public void setNotifyUrl(String notifyUrl) { + this.notifyUrl = notifyUrl == null ? null : notifyUrl.trim(); + } + + public String getReturnUrl() { + return returnUrl; + } + + public void setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl == null ? null : returnUrl.trim(); + } + + public String getSignType() { + return signType; + } + + public void setSignType(String signType) { + this.signType = signType == null ? null : signType.trim(); + } + + public String getSysServiceProviderId() { + return sysServiceProviderId; + } + + public void setSysServiceProviderId(String sysServiceProviderId) { + this.sysServiceProviderId = sysServiceProviderId == null ? null : sysServiceProviderId.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolAlipayConfigWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolAlipayConfigWithBLOBs.java new file mode 100644 index 0000000..acd2baa --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolAlipayConfigWithBLOBs.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class ToolAlipayConfigWithBLOBs extends ToolAlipayConfig implements Serializable { + private String privateKey; + + private String publicKey; + + private static final long serialVersionUID = 1L; + + public String getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(String privateKey) { + this.privateKey = privateKey == null ? null : privateKey.trim(); + } + + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(String publicKey) { + this.publicKey = publicKey == null ? null : publicKey.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolEmailConfig.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolEmailConfig.java new file mode 100644 index 0000000..b97b766 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolEmailConfig.java @@ -0,0 +1,67 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class ToolEmailConfig implements Serializable { + private Long configId; + + private String fromUser; + + private String host; + + private String pass; + + private String port; + + private String user; + + private static final long serialVersionUID = 1L; + + public Long getConfigId() { + return configId; + } + + public void setConfigId(Long configId) { + this.configId = configId; + } + + public String getFromUser() { + return fromUser; + } + + public void setFromUser(String fromUser) { + this.fromUser = fromUser == null ? null : fromUser.trim(); + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host == null ? null : host.trim(); + } + + public String getPass() { + return pass; + } + + public void setPass(String pass) { + this.pass = pass == null ? null : pass.trim(); + } + + public String getPort() { + return port; + } + + public void setPort(String port) { + this.port = port == null ? null : port.trim(); + } + + public String getUser() { + return user; + } + + public void setUser(String user) { + this.user = user == null ? null : user.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolLocalStorage.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolLocalStorage.java new file mode 100644 index 0000000..7b47ea4 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolLocalStorage.java @@ -0,0 +1,118 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class ToolLocalStorage implements Serializable { + private Long storageId; + + private String realName; + + private String name; + + private String suffix; + + private String path; + + private String type; + + private String size; + + private String createBy; + + private String updateBy; + + private Date createTime; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getStorageId() { + return storageId; + } + + public void setStorageId(Long storageId) { + this.storageId = storageId; + } + + public String getRealName() { + return realName; + } + + public void setRealName(String realName) { + this.realName = realName == null ? null : realName.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getSuffix() { + return suffix; + } + + public void setSuffix(String suffix) { + this.suffix = suffix == null ? null : suffix.trim(); + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path == null ? null : path.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getSize() { + return size; + } + + public void setSize(String size) { + this.size = size == null ? null : size.trim(); + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy == null ? null : updateBy.trim(); + } + + public Date getCreateTime() { + return createTime; + } + + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuConfig.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuConfig.java new file mode 100644 index 0000000..17f1bbd --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuConfig.java @@ -0,0 +1,57 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class ToolQiniuConfig implements Serializable { + private Long configId; + + private String bucket; + + private String host; + + private String type; + + private String zone; + + private static final long serialVersionUID = 1L; + + public Long getConfigId() { + return configId; + } + + public void setConfigId(Long configId) { + this.configId = configId; + } + + public String getBucket() { + return bucket; + } + + public void setBucket(String bucket) { + this.bucket = bucket == null ? null : bucket.trim(); + } + + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host == null ? null : host.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getZone() { + return zone; + } + + public void setZone(String zone) { + this.zone = zone == null ? null : zone.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuConfigWithBLOBs.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuConfigWithBLOBs.java new file mode 100644 index 0000000..82dc353 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuConfigWithBLOBs.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; + +public class ToolQiniuConfigWithBLOBs extends ToolQiniuConfig implements Serializable { + private String accessKey; + + private String secretKey; + + private static final long serialVersionUID = 1L; + + public String getAccessKey() { + return accessKey; + } + + public void setAccessKey(String accessKey) { + this.accessKey = accessKey == null ? null : accessKey.trim(); + } + + public String getSecretKey() { + return secretKey; + } + + public void setSecretKey(String secretKey) { + this.secretKey = secretKey == null ? null : secretKey.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuContent.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuContent.java new file mode 100644 index 0000000..4872bcd --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ToolQiniuContent.java @@ -0,0 +1,88 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.util.Date; + +public class ToolQiniuContent implements Serializable { + private Long contentId; + + private String bucket; + + private String name; + + private String size; + + private String type; + + private String url; + + private String suffix; + + private Date updateTime; + + private static final long serialVersionUID = 1L; + + public Long getContentId() { + return contentId; + } + + public void setContentId(Long contentId) { + this.contentId = contentId; + } + + public String getBucket() { + return bucket; + } + + public void setBucket(String bucket) { + this.bucket = bucket == null ? null : bucket.trim(); + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name == null ? null : name.trim(); + } + + public String getSize() { + return size; + } + + public void setSize(String size) { + this.size = size == null ? null : size.trim(); + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type == null ? null : type.trim(); + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url == null ? null : url.trim(); + } + + public String getSuffix() { + return suffix; + } + + public void setSuffix(String suffix) { + this.suffix = suffix == null ? null : suffix.trim(); + } + + public Date getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/ViewOrder.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ViewOrder.java new file mode 100644 index 0000000..1c33659 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/ViewOrder.java @@ -0,0 +1,378 @@ +package com.chaozhanggui.system.cashierservice.entity; + +import java.io.Serializable; +import java.math.BigDecimal; + +public class ViewOrder implements Serializable { + private BigDecimal aliPaidAmount; + + private Integer id; + + private BigDecimal amount; + + private BigDecimal bankPaidAmount; + + private String billingId; + + private BigDecimal cashPaidAmount; + + private Long createdAt; + + private Integer deductScore; + + private BigDecimal depositPaidAmount; + + private BigDecimal discountAmount; + + private BigDecimal freightAmount; + + private Byte isMaster; + + private Byte isVip; + + private String masterId; + + private String memberId; + + private String orderNo; + + private String orderType; + + private BigDecimal otherPaidAmount; + + private Long paidTime; + + private BigDecimal payAmount; + + private Integer productScore; + + private String productType; + + private String refOrderId; + + private Byte refundAble; + + private BigDecimal refundAmount; + + private String sendType; + + private BigDecimal settlementAmount; + + private String shopId; + + private BigDecimal smallChange; + + private String status; + + private String tableId; + + private String tableParty; + + private String terminalSnap; + + private String userId; + + private BigDecimal virtualPaidAmount; + + private BigDecimal wxPaidAmount; + + private String cartList; + + private static final long serialVersionUID = 1L; + + public BigDecimal getAliPaidAmount() { + return aliPaidAmount; + } + + public void setAliPaidAmount(BigDecimal aliPaidAmount) { + this.aliPaidAmount = aliPaidAmount; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public BigDecimal getAmount() { + return amount; + } + + public void setAmount(BigDecimal amount) { + this.amount = amount; + } + + public BigDecimal getBankPaidAmount() { + return bankPaidAmount; + } + + public void setBankPaidAmount(BigDecimal bankPaidAmount) { + this.bankPaidAmount = bankPaidAmount; + } + + public String getBillingId() { + return billingId; + } + + public void setBillingId(String billingId) { + this.billingId = billingId == null ? null : billingId.trim(); + } + + public BigDecimal getCashPaidAmount() { + return cashPaidAmount; + } + + public void setCashPaidAmount(BigDecimal cashPaidAmount) { + this.cashPaidAmount = cashPaidAmount; + } + + public Long getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(Long createdAt) { + this.createdAt = createdAt; + } + + public Integer getDeductScore() { + return deductScore; + } + + public void setDeductScore(Integer deductScore) { + this.deductScore = deductScore; + } + + public BigDecimal getDepositPaidAmount() { + return depositPaidAmount; + } + + public void setDepositPaidAmount(BigDecimal depositPaidAmount) { + this.depositPaidAmount = depositPaidAmount; + } + + public BigDecimal getDiscountAmount() { + return discountAmount; + } + + public void setDiscountAmount(BigDecimal discountAmount) { + this.discountAmount = discountAmount; + } + + public BigDecimal getFreightAmount() { + return freightAmount; + } + + public void setFreightAmount(BigDecimal freightAmount) { + this.freightAmount = freightAmount; + } + + public Byte getIsMaster() { + return isMaster; + } + + public void setIsMaster(Byte isMaster) { + this.isMaster = isMaster; + } + + public Byte getIsVip() { + return isVip; + } + + public void setIsVip(Byte isVip) { + this.isVip = isVip; + } + + public String getMasterId() { + return masterId; + } + + public void setMasterId(String masterId) { + this.masterId = masterId == null ? null : masterId.trim(); + } + + public String getMemberId() { + return memberId; + } + + public void setMemberId(String memberId) { + this.memberId = memberId == null ? null : memberId.trim(); + } + + public String getOrderNo() { + return orderNo; + } + + public void setOrderNo(String orderNo) { + this.orderNo = orderNo == null ? null : orderNo.trim(); + } + + public String getOrderType() { + return orderType; + } + + public void setOrderType(String orderType) { + this.orderType = orderType == null ? null : orderType.trim(); + } + + public BigDecimal getOtherPaidAmount() { + return otherPaidAmount; + } + + public void setOtherPaidAmount(BigDecimal otherPaidAmount) { + this.otherPaidAmount = otherPaidAmount; + } + + public Long getPaidTime() { + return paidTime; + } + + public void setPaidTime(Long paidTime) { + this.paidTime = paidTime; + } + + public BigDecimal getPayAmount() { + return payAmount; + } + + public void setPayAmount(BigDecimal payAmount) { + this.payAmount = payAmount; + } + + public Integer getProductScore() { + return productScore; + } + + public void setProductScore(Integer productScore) { + this.productScore = productScore; + } + + public String getProductType() { + return productType; + } + + public void setProductType(String productType) { + this.productType = productType == null ? null : productType.trim(); + } + + public String getRefOrderId() { + return refOrderId; + } + + public void setRefOrderId(String refOrderId) { + this.refOrderId = refOrderId == null ? null : refOrderId.trim(); + } + + public Byte getRefundAble() { + return refundAble; + } + + public void setRefundAble(Byte refundAble) { + this.refundAble = refundAble; + } + + public BigDecimal getRefundAmount() { + return refundAmount; + } + + public void setRefundAmount(BigDecimal refundAmount) { + this.refundAmount = refundAmount; + } + + public String getSendType() { + return sendType; + } + + public void setSendType(String sendType) { + this.sendType = sendType == null ? null : sendType.trim(); + } + + public BigDecimal getSettlementAmount() { + return settlementAmount; + } + + public void setSettlementAmount(BigDecimal settlementAmount) { + this.settlementAmount = settlementAmount; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId == null ? null : shopId.trim(); + } + + public BigDecimal getSmallChange() { + return smallChange; + } + + public void setSmallChange(BigDecimal smallChange) { + this.smallChange = smallChange; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status == null ? null : status.trim(); + } + + public String getTableId() { + return tableId; + } + + public void setTableId(String tableId) { + this.tableId = tableId == null ? null : tableId.trim(); + } + + public String getTableParty() { + return tableParty; + } + + public void setTableParty(String tableParty) { + this.tableParty = tableParty == null ? null : tableParty.trim(); + } + + public String getTerminalSnap() { + return terminalSnap; + } + + public void setTerminalSnap(String terminalSnap) { + this.terminalSnap = terminalSnap == null ? null : terminalSnap.trim(); + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId == null ? null : userId.trim(); + } + + public BigDecimal getVirtualPaidAmount() { + return virtualPaidAmount; + } + + public void setVirtualPaidAmount(BigDecimal virtualPaidAmount) { + this.virtualPaidAmount = virtualPaidAmount; + } + + public BigDecimal getWxPaidAmount() { + return wxPaidAmount; + } + + public void setWxPaidAmount(BigDecimal wxPaidAmount) { + this.wxPaidAmount = wxPaidAmount; + } + + public String getCartList() { + return cartList; + } + + public void setCartList(String cartList) { + this.cartList = cartList == null ? null : cartList.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/AuthUserDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/AuthUserDto.java new file mode 100644 index 0000000..c27ef49 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/AuthUserDto.java @@ -0,0 +1,50 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +import javax.validation.constraints.NotBlank; + +/** + * @author lyf + */ +public class AuthUserDto { + @NotBlank + private String username; + + @NotBlank + private String password; + + private String code; + + private String uuid = ""; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getUuid() { + return uuid; + } + + public void setUuid(String uuid) { + this.uuid = uuid; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/AuthorityDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/AuthorityDto.java new file mode 100644 index 0000000..6a7135f --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/AuthorityDto.java @@ -0,0 +1,18 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; + +@NoArgsConstructor +@AllArgsConstructor +public class AuthorityDto { + private String authority; + + public String getAuthority() { + return authority; + } + + public void setAuthority(String authority) { + this.authority = authority; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/OnlineUserDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/OnlineUserDto.java new file mode 100644 index 0000000..e0d6b2a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/OnlineUserDto.java @@ -0,0 +1,88 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +import lombok.AllArgsConstructor; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author lyf + */ +@AllArgsConstructor +@NoArgsConstructor +public class OnlineUserDto implements Serializable { + private static final long serialVersionUID = 1L;; + + private String token; + /** + * 登录时间 + */ + private Date loginTime; + + /** + * 登录名 + */ + private String account; + + /** + * 昵称 + */ + private String name; + /** + * shopId + */ + private Integer shopId; + /** + * 状态 + */ + private Integer status; + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public Date getLoginTime() { + return loginTime; + } + + public void setLoginTime(Date loginTime) { + this.loginTime = loginTime; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Integer getShopId() { + return shopId; + } + + public void setShopId(Integer shopId) { + this.shopId = shopId; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/OrderDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/OrderDto.java new file mode 100644 index 0000000..66fbcdd --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/OrderDto.java @@ -0,0 +1,34 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +/** + * @author lyf + */ +public class OrderDto { + private Integer tableId; + private Integer shopId; + private Integer userId; + + public Integer getTableId() { + return tableId; + } + + public void setTableId(Integer tableId) { + this.tableId = tableId; + } + + 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; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/ProductCartDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/ProductCartDto.java new file mode 100644 index 0000000..4f1c7ef --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/ProductCartDto.java @@ -0,0 +1,123 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +import javax.validation.constraints.NotEmpty; +import java.math.BigDecimal; + +/** + * @author 购物车中 + */ +public class ProductCartDto { + @NotEmpty + private String productId; + + private String skuInfo; + //数目 + @NotEmpty + private Float number; + //图片 + private String coverImg; + //商品名 + @NotEmpty + private String name; + //分类Id + private String categoryId; + //店铺id + @NotEmpty + private String shopId; + //打包费 + private BigDecimal packFee; + + + private Integer userId; + + private Integer tableId; + private String type; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + + public Integer getTableId() { + return tableId; + } + + public void setTableId(Integer tableId) { + this.tableId = tableId; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public String getSkuInfo() { + return skuInfo; + } + + public void setSkuInfo(String skuInfo) { + this.skuInfo = skuInfo; + } + + public Float getNumber() { + return number; + } + + public void setNumber(Float number) { + this.number = number; + } + + public String getCoverImg() { + return coverImg; + } + + public void setCoverImg(String coverImg) { + this.coverImg = coverImg; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getCategoryId() { + return categoryId; + } + + public void setCategoryId(String categoryId) { + this.categoryId = categoryId; + } + + public String getShopId() { + return shopId; + } + + public void setShopId(String shopId) { + this.shopId = shopId; + } + + public BigDecimal getPackFee() { + return packFee; + } + + public void setPackFee(BigDecimal packFee) { + this.packFee = packFee; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/SecurityProperties.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/SecurityProperties.java new file mode 100644 index 0000000..b54165e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/SecurityProperties.java @@ -0,0 +1,111 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +/** + * @author lyf + */ +public class SecurityProperties { + + /** + * Request Headers : Authorization + */ + private String header; + + /** + * 令牌前缀,最后留个空格 Bearer + */ + private String tokenStartWith; + + /** + * 必须使用最少88位的Base64对该令牌进行编码 + */ + private String base64Secret; + + /** + * 令牌过期时间 此处单位/毫秒 + */ + private Long tokenValidityInSeconds; + + /** + * 在线用户 key,根据 key 查询 redis 中在线用户的数据 + */ + private String onlineKey; + + /** + * 验证码 key + */ + private String codeKey; + + /** + * token 续期检查 + */ + private Long detect; + + /** + * 续期时间 + */ + private Long renew; + + public String getTokenStartWith() { + return tokenStartWith + " "; + } + + public String getHeader() { + return header; + } + + public void setHeader(String header) { + this.header = header; + } + + public void setTokenStartWith(String tokenStartWith) { + this.tokenStartWith = tokenStartWith; + } + + public String getBase64Secret() { + return base64Secret; + } + + public void setBase64Secret(String base64Secret) { + this.base64Secret = base64Secret; + } + + public Long getTokenValidityInSeconds() { + return tokenValidityInSeconds; + } + + public void setTokenValidityInSeconds(Long tokenValidityInSeconds) { + this.tokenValidityInSeconds = tokenValidityInSeconds; + } + + public String getOnlineKey() { + return onlineKey; + } + + public void setOnlineKey(String onlineKey) { + this.onlineKey = onlineKey; + } + + public String getCodeKey() { + return codeKey; + } + + public void setCodeKey(String codeKey) { + this.codeKey = codeKey; + } + + public Long getDetect() { + return detect; + } + + public void setDetect(Long detect) { + this.detect = detect; + } + + public Long getRenew() { + return renew; + } + + public void setRenew(Long renew) { + this.renew = renew; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/UserLoginDto.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/UserLoginDto.java new file mode 100644 index 0000000..453493f --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/dto/UserLoginDto.java @@ -0,0 +1,26 @@ +package com.chaozhanggui.system.cashierservice.entity.dto; + +/** + * @author lyf + */ +public class UserLoginDto { + private String password; + + private Boolean isAdmin; + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Boolean getAdmin() { + return isAdmin; + } + + public void setAdmin(Boolean admin) { + isAdmin = admin; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CashierCarVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CashierCarVo.java new file mode 100644 index 0000000..1517a6d --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/CashierCarVo.java @@ -0,0 +1,78 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import java.math.BigDecimal; + +/** + * @author lyf + */ +public class CashierCarVo { + private BigDecimal salePrice; + + private BigDecimal number; + + private String productId; + + private Integer id; + + private String name; + + private String skuId; + + private String coverImg; + + public String getCoverImg() { + return coverImg; + } + + public void setCoverImg(String coverImg) { + this.coverImg = coverImg; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getSkuId() { + return skuId; + } + + public void setSkuId(String skuId) { + this.skuId = skuId; + } + + public BigDecimal getSalePrice() { + return salePrice; + } + + public void setSalePrice(BigDecimal salePrice) { + this.salePrice = salePrice; + } + + public BigDecimal getNumber() { + return number; + } + + public void setNumber(BigDecimal number) { + this.number = number; + } + + public String getProductId() { + return productId; + } + + public void setProductId(String productId) { + this.productId = productId; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/OrderVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/OrderVo.java new file mode 100644 index 0000000..b40a451 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/OrderVo.java @@ -0,0 +1,36 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +import com.chaozhanggui.system.cashierservice.entity.TbCashierCart; +import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author lyf + */ +@Data +public class OrderVo { + private String name; + + private String status; + + private String tableName; + + private List details; + + private String cartListString; + private String orderNo; + + private Long time; + + private BigDecimal payAmount; + private String orderType; + + private Integer orderId; + private String sendType; + + private BigDecimal totalNumber; + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/cartListVo.java b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/cartListVo.java new file mode 100644 index 0000000..1454b74 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/entity/vo/cartListVo.java @@ -0,0 +1,13 @@ +package com.chaozhanggui.system.cashierservice.entity.vo; + +/** + * @author 12847 + */ +public class cartListVo { + + private String name; + + private Float number; + + private String coverImg; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/exception/MsgException.java b/src/main/java/com/chaozhanggui/system/cashierservice/exception/MsgException.java new file mode 100644 index 0000000..b2c23a2 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/exception/MsgException.java @@ -0,0 +1,102 @@ +package com.chaozhanggui.system.cashierservice.exception; + +import com.chaozhanggui.system.cashierservice.annotation.ResultCode; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import lombok.experimental.Accessors; +import org.apache.commons.lang3.StringUtils; + +import java.io.Serializable; +import java.util.List; + +/** + * 一般异常信息的异常,全局捕获会抛出异常信息给前端 + * @author Djh + */ +@Data +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class MsgException extends RuntimeException { + + private final Serializable obj; + private final ResultCode code; + + public MsgException(String msg) { + this(msg, null); + } + + public MsgException(String msg, Serializable obj) { + this(ResultCode.FAIL, msg, obj); + } + + public MsgException(ResultCode code, String msg, Serializable obj) { + super(msg); + this.code = code; + this.obj = obj; + } + + public static void throwException(String msg) throws MsgException { + throw new MsgException(msg); + } + + /** + * @param result + * @param errMsg + * + * @throws MsgException 为空的时候抛出异常 + */ + public static void check(boolean result, String errMsg) throws MsgException { + if (result) { + throw new MsgException(errMsg); + } + } + + /** + * @param obj1 + * @param errMsg + */ + public static void checkNull(Object obj1, String errMsg) throws MsgException { + if (obj1 == null) { + throw new MsgException(errMsg); + } + } + + public static void checkEquals(Object obj1, Object obj2, String errMsg) { + if (obj1.equals(obj2)) { + throw new MsgException(errMsg); + } + } + + public static void checkUnequals(Object obj1, Object obj2, String errMsg) { + if (!obj1.equals(obj2)) { + throw new MsgException(errMsg); + } + } + + public static void checkNonNull(Object obj1, String errMsg) throws MsgException { + if (obj1 != null) { + throw new MsgException(errMsg); + } + } + + public static void checkBlank(String field, String errMsg) throws MsgException { + if (StringUtils.isBlank(field)) { + throw new MsgException(errMsg); + } + } + + public static void checkBlank(List dataList, String errMsg) throws MsgException { + if (dataList == null || dataList.isEmpty()) { + throw new MsgException(errMsg); + } + } + + public static void checkNonBlank(List dataList, String errMsg) throws MsgException { + if (dataList != null && !dataList.isEmpty()) { + throw new MsgException(errMsg); + } + } +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java new file mode 100644 index 0000000..b89fc6f --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomFilter.java @@ -0,0 +1,65 @@ +package com.chaozhanggui.system.cashierservice.interceptor; + +import ch.qos.logback.classic.turbo.TurboFilter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import javax.servlet.*; +import javax.servlet.annotation.WebFilter; +import javax.servlet.http.HttpServletRequest; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; + +@Slf4j +@Component +@WebFilter(urlPatterns = {"/cashierService/*"},filterName = "customFilter") +public class CustomFilter implements Filter { + + private static final List unFilterUrlList= Arrays.asList("/cashierService/notify/notifyCallBack","/cashierService/notify/memberInCallBack"); + + + private boolean isfilter(String url){ + for (String s : unFilterUrlList) { + if(s.equals(url)){ + return true; + } + } + return false; + } + @Override + public void init(FilterConfig filterConfig) throws ServletException { + log.info(">>>> customFilter init <<<<"); + } + + @Override + public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { + log.info(">>>> customFilter doFilter start <<<<"); + HttpServletRequest request=(HttpServletRequest) servletRequest; + + if(isfilter(request.getRequestURI().toString())){ + RequestWrapper requestWapper = null; + if (servletRequest instanceof HttpServletRequest) { + requestWapper = new RequestWrapper((HttpServletRequest) servletRequest); + } + + if (requestWapper != null) { + servletResponse.setContentType("text/plain;charset=UTF-8"); + filterChain.doFilter(requestWapper,servletResponse); + } else { + servletResponse.setContentType("text/plain;charset=UTF-8"); + filterChain.doFilter(servletRequest,servletResponse); + } + }else { + filterChain.doFilter(servletRequest,servletResponse); + } + + + + } + + @Override + public void destroy() { + log.info(">>>> customFilter destroy <<<<"); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomGenerator.java b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomGenerator.java new file mode 100644 index 0000000..26eb1af --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/CustomGenerator.java @@ -0,0 +1,12 @@ +package com.chaozhanggui.system.cashierservice.interceptor; + +import org.springframework.beans.factory.config.BeanDefinition; +import org.springframework.beans.factory.support.BeanDefinitionRegistry; +import org.springframework.beans.factory.support.BeanNameGenerator; + +public class CustomGenerator implements BeanNameGenerator { + @Override + public String generateBeanName(BeanDefinition beanDefinition, BeanDefinitionRegistry beanDefinitionRegistry) { + return beanDefinition.getBeanClassName(); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/RequestWrapper.java b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/RequestWrapper.java new file mode 100644 index 0000000..4f21c5d --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/RequestWrapper.java @@ -0,0 +1,84 @@ +package com.chaozhanggui.system.cashierservice.interceptor; + +import javax.servlet.ReadListener; +import javax.servlet.ServletInputStream; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import java.io.*; + +public class RequestWrapper extends HttpServletRequestWrapper { + private final String body; + + public RequestWrapper(HttpServletRequest request) { + super(request); + StringBuilder stringBuilder = new StringBuilder(); + BufferedReader bufferedReader = null; + InputStream inputStream = null; + try { + inputStream = request.getInputStream(); + if (inputStream != null) { + bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); + char[] charBuffer = new char[128]; + int bytesRead = -1; + while ((bytesRead = bufferedReader.read(charBuffer)) > 0) { + stringBuilder.append(charBuffer, 0, bytesRead); + } + } else { + stringBuilder.append(""); + } + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + if (inputStream != null) { + try { + inputStream.close(); + } + catch (IOException e) { + e.printStackTrace(); + } + } + if (bufferedReader != null) { + try { + bufferedReader.close(); + } + catch (IOException e) { + e.printStackTrace(); + } + } + } + body = stringBuilder.toString(); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes()); + ServletInputStream servletInputStream = new ServletInputStream() { + @Override + public boolean isFinished() { + return false; + } + @Override + public boolean isReady() { + return false; + } + @Override + public void setReadListener(ReadListener readListener) { + } + @Override + public int read() throws IOException { + return byteArrayInputStream.read(); + } + }; + return servletInputStream; + + } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(this.getInputStream())); + } + + public String getBody() { + return this.body; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/SignInterceptor.java b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/SignInterceptor.java new file mode 100644 index 0000000..b00edbf --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/SignInterceptor.java @@ -0,0 +1,123 @@ +package com.chaozhanggui.system.cashierservice.interceptor; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; +import com.chaozhanggui.system.cashierservice.redis.RedisUtil; +import com.chaozhanggui.system.cashierservice.sign.SginAnot; +import com.chaozhanggui.system.cashierservice.sign.SignEnum; +import com.chaozhanggui.system.cashierservice.util.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpMethod; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@Component +public class SignInterceptor implements HandlerInterceptor { + private final static Logger log = LoggerFactory.getLogger(SignInterceptor.class); + + private static final String CONTENT_TYPE = "text/json;charset=UTF-8"; + + @Value("${interceptor.ignore.url}") + private List ignoreUrl; + + + @Autowired + RedisUtil redisUtil; + + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) + throws Exception { + + String requestURI = request.getRequestURI(); + + String token=request.getHeader("token"); + + String type=request.getHeader("type"); + + + + if(ignoreUrl.contains(requestURI)){ + return true; + } + + + + String ip = IpUtil.getIpAddr(request); + + if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) { + response.setStatus(HttpServletResponse.SC_OK); + // 放行OPTIONS请求 + return true; + } + + + if("C".equals(type)){ + String openId=request.getHeader("openId"); + } + + + return true; + + + } + + private boolean signCheck(Object map, SignEnum enumm, String privateKey, String publicKey) throws Exception { + if (enumm == SignEnum.MD5) { + return MD5Util.check(map, privateKey); + } else if (enumm == SignEnum.SHA1) { + return SHA1Util.check(map); + } else if (enumm == SignEnum.RSA) { + Map data=(HashMap)map; + String sign=data.get("sign").toString(); + return RSAUtils.verify(JSONUtil.toJsonStr(data.get("data")),RSAUtils.getPublicKey(publicKey),sign); + } + return false; + } + + + public Map getMap(Object obj){ + Map map=new HashMap(); + if(obj==null){ + return null; + } + + if(obj instanceof Map){ + map=(Map) obj; + }else{ + map = BeanUtil.transBean2Map(obj); + } + + if(map.containsKey("sign")){ + map.remove("sign"); + } + return map; + + } + + /** + * 把request转为map + * @param request + * @return + */ + private Map getParameterMap(HttpServletRequest request) { + RequestWrapper requestWrapper = new RequestWrapper(request); + String body = requestWrapper.getBody(); + if (ObjectUtil.isNotEmpty(body)) { + return JSONUtil.toBean(body, Map.class); + } + return null; + } + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/WebAppConfigurer.java b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/WebAppConfigurer.java new file mode 100644 index 0000000..70165e6 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/interceptor/WebAppConfigurer.java @@ -0,0 +1,25 @@ +package com.chaozhanggui.system.cashierservice.interceptor; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + + +@Configuration +public class WebAppConfigurer implements WebMvcConfigurer { + + @Autowired + SignInterceptor signInterceptor; + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry.addInterceptor(signInterceptor) + .addPathPatterns("/**") + .excludePathPatterns("/notify/callBack") + .excludePathPatterns("/notify/notifyCallBack") + .excludePathPatterns("/cloudPrinter/print") + ; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/model/BaseRequest.java b/src/main/java/com/chaozhanggui/system/cashierservice/model/BaseRequest.java new file mode 100644 index 0000000..0088f33 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/model/BaseRequest.java @@ -0,0 +1,16 @@ +package com.chaozhanggui.system.cashierservice.model; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class BaseRequest implements Serializable { + + private String appId; + + private String sign; + + private Long timestamp; + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/model/CategoryInfo.java b/src/main/java/com/chaozhanggui/system/cashierservice/model/CategoryInfo.java new file mode 100644 index 0000000..ce7639d --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/model/CategoryInfo.java @@ -0,0 +1,23 @@ +package com.chaozhanggui.system.cashierservice.model; + +import lombok.Data; + +@Data +public class CategoryInfo { + + private Integer id; + private String name; + private String shortName; + private String tree; + private String pid; + private String pic; + private String merchantId; + private String shopId; + private String style; + private String isShow; + private String detail; + private String sort; + private String keyWord; + private String createdAt; + private String updatedAt; +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/model/OrderDetailPO.java b/src/main/java/com/chaozhanggui/system/cashierservice/model/OrderDetailPO.java new file mode 100644 index 0000000..4366113 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/model/OrderDetailPO.java @@ -0,0 +1,67 @@ +package com.chaozhanggui.system.cashierservice.model; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class OrderDetailPO implements Serializable { + + private String merchantName; + + private String printType; + + private String masterId; + + private String orderNo; + + private String tradeDate; + + private String operator; + + private String receiptsAmount; + + private String balance; + + private String payType; + + private String integral; + + List detailList; + + + @Data + public static class Detail implements Serializable{ + private String productName; + + private String number; + + private String amount; + + private String remark; + + public Detail(String productName, String number, String amount, String remark) { + this.productName = productName; + this.number = number; + this.amount = amount; + this.remark = remark; + } + + } + + + public OrderDetailPO(String merchantName, String printType, String masterId, String orderNo, String tradeDate, String operator, String receiptsAmount, String balance, String payType, String integral, List detailList) { + this.merchantName = merchantName; + this.printType = printType; + this.masterId = masterId; + this.orderNo = orderNo; + this.tradeDate = tradeDate; + this.operator = operator; + this.receiptsAmount = receiptsAmount; + this.balance = balance; + this.payType = payType; + this.integral = integral; + this.detailList = detailList; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/model/PayReq.java b/src/main/java/com/chaozhanggui/system/cashierservice/model/PayReq.java new file mode 100644 index 0000000..99973d2 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/model/PayReq.java @@ -0,0 +1,51 @@ +package com.chaozhanggui.system.cashierservice.model; + +import cn.hutool.json.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.BeanUtil; +import com.chaozhanggui.system.cashierservice.util.MD5Util; +import lombok.Data; + +import java.util.Map; + +@Data +public class PayReq extends BaseRequest{ + + private String ip; + private String mercOrderNo; + + private String notifyUrl; + + private String payAmt; + + private String payType; + + private String payWay; + + private String subject; + + private String userId; + + + public static void main(String[] args){ + PayReq req=new PayReq(); + String privateKey="MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAIqNqTqhN8zE7eFZnwKcyBTENce2wdAtl/gaDHNuNVgg33dS27Jx0fKl9QSHXyzyxbAdG8F94niYbRBstrMymFRjuO72jH+rIH62Ym1k7l8JSLVK2dKHXt8lHDaQGUP10q0EEocnDQ9cL93oBNG1ttsV6vOAu1TPvRK9TGihRAe1AgMBAAECgYBmI8KCl0DkcrSOsRvYuC2DqZWf8el1B3eFjeZp3e/zVOCIPYv6Q5ArWg6DVSxjnWEA0KSagqvGjU+xkQMqnXzPcPMhsIS+1wyR/pP+pwiatO2ioHaQpEqHg9eXhxrgA477/xuKVw9zl5GNqaIgd++2NDXnqLh0Y6OR73f0OB5eDQJBAPihEm+UWLOam/Q/k2+k4Lm2dvxJTBur1fslBiJpgMhgcz/PlwRwpL7aPD0AuPv0NqLouuoTiKpq9icnUv12tgsCQQCOqTANw0IErCHUNdinjXewmG3ui1j9XgM41rSn5ZeTrPL4GhZc2zbS/pZT4PBKUL6NLGkfPHmw4rOmNL/Xc5E/AkBqAwQBX5eSvVHSC2mqKPtJNGv3lqlFAzfyJg8/jQzEY5vAkZsq4Xzdg+A7gptdkvvY6rMIK9wSDhl3CGVyfbORAkA1N+g1OiHmnFACWhP4bU25EyPvWQxZeDi7e1zpRTzGWj5JT3IIMb7B9zcdE0yQbI6pG2gbvvOmiOt7lTH7raEBAkBas2gugvR3f0aGqQcqMpyM627pyRppQ2h58/7KBylP3oR2BReqMUcXeiJ8TuBXzbRXpeVQ0DWOva5CWZJmBMdz"; + + req.setAppId("M800202305094c170c"); + req.setTimestamp(1693966210242l); + req.setIp("47.97.26.47"); + req.setMercOrderNo("bb243a4731234f19af7734350fad19a4"); + req.setNotifyUrl("https://cashier.machine.sxczgkj.cn/web-custom/custom/third/ysk/wx-pay-notify/bb243a4731234f19af7734350fad19a4"); + req.setPayAmt("20.00"); + req.setPayType("03"); + req.setPayWay("WXZF"); + req.setSubject("描述"); + req.setUserId("o5Fun5XQAaAhf00hB9qBNnel9vYQ"); + + Map map= BeanUtil.transBean2Map(req); + + req.setSign(MD5Util.encrypt(map,privateKey)); + System.out.println(JSONUtil.toJsonStr(req)); + } + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/model/TradeQueryReq.java b/src/main/java/com/chaozhanggui/system/cashierservice/model/TradeQueryReq.java new file mode 100644 index 0000000..5224669 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/model/TradeQueryReq.java @@ -0,0 +1,11 @@ +package com.chaozhanggui.system.cashierservice.model; + +import lombok.Data; + + +@Data +public class TradeQueryReq extends BaseRequest { + + private String orderNumber; + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/CartConsumer.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/CartConsumer.java new file mode 100644 index 0000000..a1edf56 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/CartConsumer.java @@ -0,0 +1,70 @@ +package com.chaozhanggui.system.cashierservice.rabbit; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.dao.*; +import com.chaozhanggui.system.cashierservice.entity.*; +import com.chaozhanggui.system.cashierservice.entity.vo.CashierCarVo; +import com.chaozhanggui.system.cashierservice.exception.MsgException; +import com.chaozhanggui.system.cashierservice.redis.RedisCst; +import com.chaozhanggui.system.cashierservice.redis.RedisUtil; +import com.chaozhanggui.system.cashierservice.service.CartService; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.RedisUtils; +import com.chaozhanggui.system.cashierservice.util.SnowFlakeUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.time.Instant; +import java.util.*; + +@Slf4j +@Component +@RabbitListener(queues = {RabbitConstants.CART_QUEUE_PUT}) +@Service +public class CartConsumer { + + + @Autowired + private RedisUtil redisUtil; + @Autowired + private CartService cartService; + @RabbitHandler + public void listener(String message) { + try { + JSONObject jsonObject = JSON.parseObject(message); + String tableId = jsonObject.getString("tableId"); + String shopId = jsonObject.getString("shopId"); + if (jsonObject.getString("type").equals("addcart") ) { + if (!jsonObject.containsKey("num")) { + throw new MsgException("商品数量错误"); + } + cartService.createCart(jsonObject); + }else if(jsonObject.getString("type").equals("createOrder")){ + String cartDetail = redisUtil.getMessage(RedisCst.TABLE_CART.concat(tableId).concat("-").concat(shopId)); + if (StringUtils.isEmpty(cartDetail)){ + throw new MsgException("购物车为空无法下单"); + } + JSONArray array = JSON.parseArray(cartDetail); + if (array.size() > 0){ + cartService.createOrder(jsonObject); + } + }else if(jsonObject.getString("type").equals("clearCart")){ + cartService.clearCart(jsonObject); + } + } catch (Exception e) { + e.getMessage(); + } + } + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintMechineConsumer.java b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintMechineConsumer.java new file mode 100644 index 0000000..d285d1e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/rabbit/PrintMechineConsumer.java @@ -0,0 +1,266 @@ +package com.chaozhanggui.system.cashierservice.rabbit; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.dao.*; +import com.chaozhanggui.system.cashierservice.entity.*; +import com.chaozhanggui.system.cashierservice.model.CategoryInfo; +import com.chaozhanggui.system.cashierservice.model.OrderDetailPO; +import com.chaozhanggui.system.cashierservice.util.DateUtils; +import com.chaozhanggui.system.cashierservice.util.FeieyunPrintUtil; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.PrinterUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Slf4j +@Component +@RabbitListener(queues = {RabbitConstants.PRINT_MECHINE_COLLECT_QUEUE_PUT}) +@Service +public class PrintMechineConsumer { + + + @Autowired + TbShopUserMapper tbShopUserMapper; + @Autowired + private TbOrderInfoMapper tbOrderInfoMapper; + @Autowired + private TbPrintMachineMapper tbPrintMachineMapper; + @Autowired + private TbCashierCartMapper tbCashierCartMapper; + @Autowired + private TbProductSkuMapper tbProductSkuMapper; + @Autowired + private TbShopInfoMapper tbShopInfoMapper; + + @Autowired + private TbProductMapper tbProductMapper; + + @RabbitHandler + public void listener(String message) { + String orderId = message; + + try { + + Thread.sleep(1000L); + TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId)); + if (ObjectUtil.isEmpty(orderInfo)) { + log.error("没有对应的订单信息"); + return; + } + TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId())); + if (ObjectUtil.isEmpty(shopInfo)) { + log.error("店铺信息不存在"); + return; + } + + + List list = tbPrintMachineMapper.selectByShopId(orderInfo.getShopId()); + + if (ObjectUtil.isEmpty(list) || list.size() <= 0) { + log.error("此店铺没有对应的打印机设备"); + return; + } + + list.parallelStream().forEach(tbPrintMachineWithBLOBs->{ + if (!"network".equals(tbPrintMachineWithBLOBs.getConnectionType())) { + log.error("非网络打印机:{},{}",tbPrintMachineWithBLOBs.getAddress(),tbPrintMachineWithBLOBs.getConnectionType()); + return; + + } + + if (!"1".equals(tbPrintMachineWithBLOBs.getStatus().toString())) { + log.error("打印机状态异常:{},{}",tbPrintMachineWithBLOBs.getAddress(),tbPrintMachineWithBLOBs.getStatus()); + return; + } + + JSONObject config = JSONObject.parseObject(tbPrintMachineWithBLOBs.getConfig()); + String model = config.getString("model"); + + String printerNum = config.getString("printerNum"); + + String feet = config.getString("feet"); + + String autoCut = config.getString("autoCut"); + + List categoryInfos=JSONUtil.parseJSONStr2TList(config.getJSONArray("categoryList").toString(),CategoryInfo.class); + + switch (tbPrintMachineWithBLOBs.getContentType()){ + case "yxyPrinter": + yxyPrinter(tbPrintMachineWithBLOBs,model,orderInfo,shopInfo,printerNum,categoryInfos); + break; + case "fePrinter": + fePrinter(tbPrintMachineWithBLOBs,model,orderInfo,shopInfo,printerNum,categoryInfos); + break; + } + + }); + + + }catch (Exception e){ + e.printStackTrace(); + } + + } + + /** + * 博时结云打印机 + * @param tbPrintMachineWithBLOBs + * @param model + * @param orderInfo + * @param shopInfo + * @param printerNum + */ + private void yxyPrinter(TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs,String model,TbOrderInfo orderInfo,TbShopInfo shopInfo,String printerNum, List categoryInfos){ + String orderId=orderInfo.getId().toString(); + + + switch (tbPrintMachineWithBLOBs.getSubType()) { + case "label": //标签打印机 + break; + case "cash": //小票打印机 + switch (model) { + case "normal": //普通出单 + List cashierCarts = tbCashierCartMapper.selectByOrderId(orderInfo.getId().toString(),"final"); + if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) { + List detailList = new ArrayList<>(); + cashierCarts.parallelStream().forEach(it -> { + String categoryId; + if(ObjectUtil.isEmpty(it.getCategoryId())){ + categoryId= tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId(); + } else { + categoryId = it.getCategoryId(); + } + + + Long count= categoryInfos.stream().filter(c-> + c.getId().toString().equals(categoryId) + ).count(); + + if(count>0){ + TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId())); + String remark = ""; + if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) { + remark = tbProductSkuWithBLOBs.getSpecSnap(); + } + + OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getName(), it.getNumber().toString(), it.getTotalAmount().toPlainString(), remark); + detailList.add(detail); + } + }); + + String balance = "0"; + + if ("deposit".equals(orderInfo.getPayType())) { + TbShopUser user = tbShopUserMapper.selectByPrimaryKey(orderInfo.getMemberId()); + if (ObjectUtil.isNotEmpty(user) && ObjectUtil.isNotEmpty(user.getAmount())) { + balance = user.getAmount().toPlainString(); + } + } + if(ObjectUtil.isNotEmpty(detailList)&&detailList.size()>0){ + + OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getTableName(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", orderInfo.getOrderAmount().toPlainString(), balance, orderInfo.getPayType(), "0", detailList); + String data= PrinterUtils.getCashPrintData(detailPO,"结算单"); + PrinterUtils.printTickets(1, Integer.valueOf(printerNum), tbPrintMachineWithBLOBs.getAddress(), data); + } + + } + + break; + case "one": //一菜一品 + cashierCarts = tbCashierCartMapper.selectByOrderId(orderId,"final"); + if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) { + + cashierCarts.parallelStream().forEach(it -> { + + String categoryId; + if(ObjectUtil.isEmpty(it.getCategoryId())){ + categoryId= tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId(); + } else { + categoryId = it.getCategoryId(); + } + + + Long count= categoryInfos.stream().filter(c-> + c.getId().toString().equals(categoryId) + ).count(); + + if(count>0){ + TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId())); + String remark = ""; + if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) { + remark = tbProductSkuWithBLOBs.getSpecSnap(); + } + String data = PrinterUtils.getPrintData(orderInfo.getTableName(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), it.getName(), it.getNumber(), remark); + PrinterUtils.printTickets(1, Integer.valueOf(printerNum), tbPrintMachineWithBLOBs.getAddress(), data); + } + }); + } + break; + case "category": //分类出单 + break; + } + + break; + case "kitchen": //出品打印机 + break; + } + } + + + + + private void fePrinter(TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs,String model,TbOrderInfo orderInfo,TbShopInfo shopInfo,String printerNum, List categoryInfos){ + String orderId=orderInfo.getId().toString(); + switch (tbPrintMachineWithBLOBs.getSubType()) { + case "label": //标签打印机 + List cashierCarts = tbCashierCartMapper.selectByOrderId(orderInfo.getId().toString(),"final"); + if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) { + cashierCarts.parallelStream().forEach(it->{ + + String categoryId; + if(ObjectUtil.isEmpty(it.getCategoryId())){ + categoryId= tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId(); + } else { + categoryId = it.getCategoryId(); + } + + + Long count= categoryInfos.stream().filter(c-> + c.getId().toString().equals(categoryId) + ).count(); + + + if(count>0) { + TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId())); + String remark = ""; + if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) { + remark = tbProductSkuWithBLOBs.getSpecSnap(); + } + + for(int i=0;i getAllMessage(String key) { + Jedis jedis = null; + try { + if (StringUtils.isEmpty(key)) { + return null; + } + // 从jedis池中获取一个jedis实例 + jedis = pool.getResource(); + // 获取jedis实例后可以对redis服务进行一系列的操作 + if (database!=0) { + jedis.select(database); + } + Set value = jedis.keys(key); + + return value; + + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 释放对象池,即获取jedis实例使用后要将对象还回去 + // 释放对象池,即获取jedis实例使用后要将对象还回去 + if (jedis != null) { + jedis.close(); + } + } + return null; + } + + /** + * @param key + * @return + * @Description: 通过key删除数据 + * @author SLy + * @date 2018-12-19 19:49 + */ + public Integer deleteByKey(String key) { + Jedis jedis = null; + try { + if (StringUtils.isEmpty(key)) { + return REDIS_FAILED; + } + // 从jedis池中获取一个jedis实例 + jedis = pool.getResource(); + if (database!=0) { + jedis.select(database); + } + jedis.del(key); + return REDIS_SUCCESS; + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 释放对象池,即获取jedis实例使用后要将对象还回去 + if (jedis != null) { + jedis.close(); + } + } + return REDIS_FAILED; + } + /** + * @param key + * @return + * @Description: 通过key删除数据 + * @author SLy + * @date 2018-12-19 19:49 + */ + public TreeSet keys(String key) { + Jedis jedis = null; + TreeSet keys = new TreeSet<>(); + try { + if (StringUtils.isEmpty(key)) { + return null; + } + // 从jedis池中获取一个jedis实例 + jedis = pool.getResource(); + if (database!=0) { + jedis.select(database); + } + keys.addAll(jedis.keys(key)); + return keys; + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 释放对象池,即获取jedis实例使用后要将对象还回去 + if (jedis != null) { + jedis.close(); + } + } + return null; + } + + + public int getIncrementNum(String key, String message) { + Jedis jedis = null; + try { + // 从jedis池中获取一个jedis实例 + jedis = pool.getResource(); + if (database!=0) { + jedis.select(database); + } + String sss = jedis.get(key); + if (StringUtils.isBlank(jedis.get(key))) { + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.DAY_OF_YEAR, 1); + cal.set(Calendar.HOUR_OF_DAY, 0); + cal.set(Calendar.SECOND, 0); + cal.set(Calendar.MINUTE, 0); + cal.set(Calendar.MILLISECOND, 0); + long aa = (cal.getTimeInMillis() - System.currentTimeMillis()) / 1000; + int time = new Long(aa).intValue(); + jedis.set(key, message); + jedis.expire(key, time); + } + jedis.incr(key); + return REDIS_SUCCESS; + + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 释放对象池,即获取jedis实例使用后要将对象还回去 + if (jedis != null) { + jedis.close(); + } + } + + return REDIS_FAILED; + } + public int getIncrNum(String key, String message) { + Jedis jedis = null; + try { + // 从jedis池中获取一个jedis实例 + jedis = pool.getResource(); + if (database!=0) { + jedis.select(database); + } + if (message.equals("1")) { + jedis.decr(key); + }else { + jedis.incr(key); + } + return REDIS_SUCCESS; + + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 释放对象池,即获取jedis实例使用后要将对象还回去 + if (jedis != null) { + jedis.close(); + } + } + + return REDIS_FAILED; + } + + public int getTicketNum(String key) { + Jedis jedis = null; + try { + // 从jedis池中获取一个jedis实例 + jedis = pool.getResource(); + if (database!=0) { + jedis.select(database); + } + jedis.incr(key); + return REDIS_SUCCESS; + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 释放对象池,即获取jedis实例使用后要将对象还回去 + if (jedis != null) { + jedis.close(); + } + } + return REDIS_FAILED; + } + String secAddScript = "local prodid=KEYS[1];\r\n" + + "local usernum=KEYS[2];\r\n" + + "local num= redis.call(\"get\" ,prodid);\r\n" + + " redis.call(\"SET\",prodid,tonumber(usernum)+tonumber(num));\r\n" + + "return 1"; + public String secAdd(String key, String num) { + Jedis jedis = null; + try { + if (StringUtils.isEmpty(key)) { + return REDIS_FAILED+""; + } + // 从jedis池中获取一个jedis实例 + jedis = pool.getResource(); + if (database!=0) { + jedis.select(database); + } + Object result = jedis.eval(secAddScript, Arrays.asList(key,num), new ArrayList<>()); + String reString = String.valueOf(result); + return reString; + + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 释放对象池,即获取jedis实例使用后要将对象还回去 + // 释放对象池,即获取jedis实例使用后要将对象还回去 + if (jedis != null) { + jedis.close(); + } + } + return REDIS_FAILED+""; + } + + + + String secKillScript = "local prodid=KEYS[1];\r\n" + + "local usernum=KEYS[2];\r\n" + + "local num= redis.call(\"get\" ,prodid);\r\n" + + "if tonumber(num)()); + String reString = String.valueOf(result); + return reString; + + } catch (Exception e) { + e.printStackTrace(); + } finally { + // 释放对象池,即获取jedis实例使用后要将对象还回去 + // 释放对象池,即获取jedis实例使用后要将对象还回去 + if (jedis != null) { + jedis.close(); + } + } + return REDIS_FAILED+""; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java new file mode 100644 index 0000000..38ff434 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java @@ -0,0 +1,383 @@ +package com.chaozhanggui.system.cashierservice.service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.dao.*; +import com.chaozhanggui.system.cashierservice.entity.*; +import com.chaozhanggui.system.cashierservice.entity.dto.ProductCartDto; +import com.chaozhanggui.system.cashierservice.entity.vo.CashierCarVo; +import com.chaozhanggui.system.cashierservice.exception.MsgException; +import com.chaozhanggui.system.cashierservice.redis.RedisCst; +import com.chaozhanggui.system.cashierservice.redis.RedisUtil; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import com.chaozhanggui.system.cashierservice.socket.WebSocketServer; +import com.chaozhanggui.system.cashierservice.util.DateUtils; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.SnowFlakeUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.Instant; +import java.util.*; + +/** + * @author lyf + */ +@Service +@Slf4j +public class CartService { + @Autowired + private RedisUtil redisUtil; + @Autowired + private TbOrderInfoMapper orderInfoMapper; + @Autowired + private TbCashierCartMapper cashierCartMapper; + @Autowired + private TbProductMapper productMapper; + @Autowired + private TbProductSkuMapper productSkuMapper; + @Autowired + private TbMerchantAccountMapper merchantAccountMapper; + @Autowired + private TbUserInfoMapper userInfoMapper; + @Autowired + private TbOrderDetailMapper orderDetailMapper; + @Autowired + private TbShopTableMapper shopTableMapper; + + + // @Transactional(rollbackFor = Exception.class) + public void createCart(JSONObject jsonObject) throws Exception { + try { + + + String tableId = jsonObject.getString("tableId"); + String shopId = jsonObject.getString("shopId"); + JSONArray jsonArray = new JSONArray(); + BigDecimal amount = BigDecimal.ZERO; + boolean exist = redisUtil.exists(RedisCst.PRODUCT + shopId + ":" + jsonObject.getString("skuId")); + if (!exist) { + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "fail"); + jsonObject1.put("msg", "该商品库存已售罄"); + jsonObject1.put("data", new ArrayList<>()); + AppWebSocketServer.AppSendInfo(jsonObject1, jsonObject.getString("userId"), true); + throw new MsgException("该商品库存已售罄"); + } + if (jsonObject.getInteger("num") > 0) { + String result = redisUtil.seckill(RedisCst.PRODUCT + shopId + ":" + jsonObject.getString("skuId"), jsonObject.getInteger("num").toString()); + if (result.equals("0")) { + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "fail"); + jsonObject1.put("msg", "该商品库存已售罄"); + jsonObject1.put("data", new ArrayList<>()); + AppWebSocketServer.AppSendInfo(jsonObject1, jsonObject.getString("userId"), true); + throw new MsgException("该商品库存已售罄"); + } + } else { + String result = redisUtil.seckill(RedisCst.PRODUCT + shopId + ":" + jsonObject.getString("skuId"), jsonObject.getInteger("num").toString()); + } + + if (redisUtil.exists(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId").concat("-").concat(shopId)))) { + JSONArray array = JSON.parseArray(redisUtil.getMessage(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId").concat("-").concat(shopId)))); + if (Objects.isNull(array) || array.isEmpty() || array.size() < 1) { + if (jsonObject.getInteger("num") > 0) { + TbCashierCart cashierCart = addCart(jsonObject.getString("productId"), jsonObject.getString("skuId"), + jsonObject.getInteger("userId"), jsonObject.getInteger("num"), tableId, jsonObject.getString("shopId")); + jsonArray.add(cashierCart); + amount = amount.add(new BigDecimal(cashierCart.getNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); + } + } else { + boolean flag = true; + for (int i = 0; i < array.size(); i++) { + JSONObject object = array.getJSONObject(i); + if (object.getString("skuId").equals(jsonObject.getString("skuId"))) { + object.put("totalNumber", object.getIntValue("totalNumber") + jsonObject.getInteger("num")); + object.put("number", object.getIntValue("number") + jsonObject.getInteger("num")); + flag = false; + } + TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class); + if (cashierCart.getNumber() > 0) { + cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); + if (StringUtils.isNotEmpty(cashierCart.getStatus())) { + cashierCart.setStatus("create"); + } + cashierCartMapper.updateByPrimaryKeySelective(cashierCart); + if (cashierCart.getNumber() > 0) { + jsonArray.add(cashierCart); + amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); + } else { + cashierCartMapper.deleteByPrimaryKey(cashierCart.getId()); + } + } else { + cashierCartMapper.deleteByPrimaryKey(cashierCart.getId()); + } + } + if (flag && jsonObject.getInteger("num") > 0) { + TbCashierCart cashierCart = addCart(jsonObject.getString("productId"), jsonObject.getString("skuId"), + jsonObject.getInteger("userId"), jsonObject.getInteger("num"), tableId, jsonObject.getString("shopId")); + jsonArray.add(cashierCart); + amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); + } + } + } else { + if (jsonObject.getInteger("num") > 0) { + TbCashierCart cashierCart = addCart(jsonObject.getString("productId"), jsonObject.getString("skuId"), + jsonObject.getInteger("userId"), jsonObject.getInteger("num"), tableId, jsonObject.getString("shopId")); + jsonArray.add(cashierCart); + amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee()))); + } + } + productSkuMapper.updateStockById(jsonObject.getString("skuId"), jsonObject.getInteger("num")); +// AppWebSocketServer.getRecordMap().put(jsonObject.getString("tableId"), returnList); + redisUtil.saveMessage(RedisCst.TABLE_CART.concat(tableId).concat("-").concat(shopId), jsonArray.toJSONString()); + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "success"); + jsonObject1.put("msg", "成功"); + jsonObject1.put("type", jsonObject.getString("type")); + jsonObject1.put("data", jsonArray); + jsonObject1.put("amount", amount); + AppWebSocketServer.AppSendInfo(jsonObject1, jsonObject.getString("tableId").concat("-").concat(shopId), false); + } catch (Exception e) { + e.getMessage(); + } + } + + private TbCashierCart addCart(String productId, String skuId, Integer userId, Integer num, String tableId, String shopId) throws Exception { + TbProduct product = productMapper.selectById(Integer.valueOf(productId)); + if (Objects.isNull(product)) { + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "fail"); + jsonObject1.put("msg", "该商品不存在"); + jsonObject1.put("data", new ArrayList<>()); + AppWebSocketServer.AppSendInfo(jsonObject1, userId.toString(), true); + throw new MsgException("该商品不存在"); + } + TbProductSkuWithBLOBs productSku = productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId)); + if (Objects.isNull(productSku)) { + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "fail"); + jsonObject1.put("msg", "该商品规格不存在"); + jsonObject1.put("data", new ArrayList<>()); + AppWebSocketServer.AppSendInfo(jsonObject1, userId.toString(), true); + throw new MsgException("该商品规格不存在"); + } + TbCashierCart cashierCart = new TbCashierCart(); + cashierCart.setProductId(productId); + cashierCart.setSkuId(skuId); + cashierCart.setNumber(num); + cashierCart.setCoverImg(product.getCoverImg()); + cashierCart.setName(product.getName()); + cashierCart.setCategoryId(product.getCategoryId()); + cashierCart.setShopId(shopId); + cashierCart.setUserId(userId); + cashierCart.setTableId(tableId); + cashierCart.setSkuName(productSku.getSpecSnap()); + cashierCart.setIsPack("false"); + cashierCart.setIsGift("false"); + cashierCart.setUserId(userId); + cashierCart.setStatus("create"); + cashierCart.setType((byte) 0); + cashierCart.setSalePrice(productSku.getSalePrice()); + cashierCart.setCreatedAt(Instant.now().toEpochMilli()); + cashierCart.setUpdatedAt(Instant.now().toEpochMilli()); + cashierCart.setTotalNumber(num); + cashierCart.setPackFee(BigDecimal.ZERO); + cashierCart.setRefundNumber(0); + cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(productSku.getSalePrice().add(cashierCart.getPackFee()))); + cashierCartMapper.insert(cashierCart); + return cashierCart; + } + + @Transactional(rollbackFor = Exception.class) + public void createOrder(JSONObject jsonObject) throws IOException { + try { + + String shopId = jsonObject.getString("shopId"); + JSONArray array = JSON.parseArray(redisUtil.getMessage(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId").concat("-").concat(shopId)))); + //总金额 + List ids = new ArrayList<>(); + BigDecimal totalAmount = BigDecimal.ZERO; + BigDecimal packAMount = BigDecimal.ZERO; + BigDecimal saleAmount = BigDecimal.ZERO; + Map skuMap = new HashMap<>(); + List orderDetails = new ArrayList<>(); + Integer orderId = 0; + for (int i = 0; i < array.size(); i++) { + JSONObject object = array.getJSONObject(i); + TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class); + TbProductSkuWithBLOBs tbProduct = productSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId())); + totalAmount = totalAmount.add(cashierCart.getTotalAmount()); + packAMount = packAMount.add(cashierCart.getPackFee()); + if (Objects.nonNull(tbProduct)) { + saleAmount = saleAmount.add(tbProduct.getSalePrice()); + } + skuMap.put(tbProduct.getId(), tbProduct); + TbOrderDetail orderDetail = new TbOrderDetail(); + orderDetail.setCreateTime(new Date()); + orderDetail.setNum(cashierCart.getNumber()); + orderDetail.setPrice(cashierCart.getSalePrice()); + if (cashierCart.getIsPack().equals("true")) { + orderDetail.setPriceAmount(cashierCart.getTotalAmount().add(cashierCart.getPackFee())); + } else { + orderDetail.setPriceAmount(cashierCart.getTotalAmount()); + } + orderDetail.setProductId(Integer.valueOf(cashierCart.getProductId())); + orderDetail.setProductSkuId(Integer.valueOf(cashierCart.getSkuId())); + orderDetail.setProductSkuName(tbProduct.getSpecSnap()); + orderDetail.setProductName(cashierCart.getName()); + orderDetail.setShopId(jsonObject.getInteger("shopId")); + orderDetail.setPackAmount(cashierCart.getPackFee()); + orderDetail.setProductImg(cashierCart.getCoverImg()); + orderDetail.setStatus("unpaid"); + if (StringUtils.isNotEmpty(cashierCart.getOrderId())) { + orderId = Integer.valueOf(cashierCart.getOrderId()); + + } + orderDetails.add(orderDetail); + if (StringUtils.isNotEmpty(cashierCart.getOrderId())) { + orderId = Integer.valueOf(cashierCart.getOrderId()); + } + } + + TbMerchantAccount tbMerchantAccount = merchantAccountMapper.selectByShopId(jsonObject.getString("shopId")); + if (tbMerchantAccount == null) { + throw new MsgException("生成订单错误"); + } + + TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(jsonObject.getInteger("userId")); + if (tbUserInfo == null) { + throw new MsgException("生成订单失败"); + } + TbShopTable shopTable = shopTableMapper.selectQRcode(jsonObject.getString("tableId")); + //生成订单 + TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId); + if (Objects.nonNull(orderInfo)) { + log.info("订单状态:" + orderInfo.getStatus()); + if (!"unpaid".equals(orderInfo.getStatus())) { + log.info("开始处理订单"); + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "fail"); + jsonObject1.put("msg", "订单正在支付中,请稍后再试"); + jsonObject1.put("type", jsonObject.getString("type")); + jsonObject1.put("data", ""); + AppWebSocketServer.AppSendInfo(jsonObject1, jsonObject.getString("userId"), true); + log.info("消息推送"); + return; + } + + orderDetailMapper.deleteByOUrderId(orderId); + orderInfo.setUpdatedAt(System.currentTimeMillis()); + orderInfo.setSettlementAmount(totalAmount); + orderInfo.setAmount(totalAmount); + orderInfo.setOriginAmount(totalAmount); + orderInfo.setOrderAmount(totalAmount.add(packAMount)); + orderInfo.setFreightAmount(BigDecimal.ZERO); + orderInfo.setProductAmount(saleAmount); + orderInfoMapper.updateByPrimaryKeySelective(orderInfo); + } else { + + orderInfo = new TbOrderInfo(); + String orderNo = generateOrderNumber(); + orderInfo.setOrderNo(orderNo); + orderInfo.setSettlementAmount(totalAmount); + orderInfo.setPackFee(packAMount); + orderInfo.setOriginAmount(totalAmount); + orderInfo.setProductAmount(totalAmount); + orderInfo.setAmount(totalAmount); + orderInfo.setOrderAmount(totalAmount.add(packAMount)); + orderInfo.setPayAmount(BigDecimal.ZERO); + orderInfo.setRefundAmount(new BigDecimal("0.00")); + orderInfo.setTableId(jsonObject.getString("tableId")); + orderInfo.setSendType("table"); + orderInfo.setOrderType("miniapp"); + orderInfo.setTradeDay(DateUtils.getDay()); + orderInfo.setStatus("unpaid"); + orderInfo.setShopId(jsonObject.getString("shopId")); + orderInfo.setUserId(jsonObject.getString("userId")); + orderInfo.setCreatedAt(Instant.now().toEpochMilli()); + orderInfo.setSystemTime(Instant.now().toEpochMilli()); + orderInfo.setUpdatedAt(Instant.now().toEpochMilli()); + orderInfo.setIsAccepted((byte) 1); + if (Objects.nonNull(shopTable)) { + orderInfo.setTableName(shopTable.getName()); + } + orderInfo.setMerchantId(String.valueOf(tbMerchantAccount.getId())); + orderInfoMapper.insert(orderInfo); + orderId = orderInfo.getId(); + } + for (TbOrderDetail orderDetail : orderDetails) { + orderDetail.setOrderId(orderId); + orderDetailMapper.insert(orderDetail); + } + for (int i = 0; i < array.size(); i++) { + JSONObject object = array.getJSONObject(i); + TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class); + cashierCart.setUpdatedAt(System.currentTimeMillis()); + cashierCart.setOrderId(orderId + ""); + cashierCart.setStatus("closed"); + cashierCartMapper.updateByPrimaryKeySelective(cashierCart); + object.put("updatedAt", System.currentTimeMillis()); + object.put("orderId", orderId + ""); + } + redisUtil.saveMessage(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId")).concat("-").concat(shopId), array.toJSONString()); + orderInfo.setDetailList(orderDetails); + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "success"); + jsonObject1.put("msg", "成功"); + jsonObject1.put("type", jsonObject.getString("type")); + jsonObject1.put("data", orderInfo); + redisUtil.deleteByKey(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId")).concat("-").concat(shopId)); + AppWebSocketServer.AppSendInfo(jsonObject1, jsonObject.getString("userId"), true); + JSONObject jsonObject12 = new JSONObject(); + jsonObject12.put("status", "success"); + jsonObject12.put("msg", "成功"); + jsonObject12.put("type", "order"); + jsonObject12.put("amount", BigDecimal.ZERO); + + jsonObject12.put("data", new JSONArray()); + AppWebSocketServer.AppSendInfo(jsonObject12, jsonObject.getString("tableId").concat("-").concat(shopId), false); + } catch (Exception e) { + e.getMessage(); + } + } + public String generateOrderNumber() { + String date = DateUtils.getSdfTimes(); + Random random = new Random(); + int randomNum = random.nextInt(900) + 100; + return "WX" + date + randomNum; + } + public void clearCart(JSONObject jsonObject) throws IOException { + String shopId = jsonObject.getString("shopId"); + if (redisUtil.exists(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId").concat("-").concat(shopId)))) { + JSONArray array = JSON.parseArray(redisUtil.getMessage(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId").concat("-").concat(shopId)))); + if (Objects.isNull(array) || array.isEmpty() || array.size() < 1) { + for (int i = 0; i < array.size(); i++) { + TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(array.get(i).toString(), TbCashierCart.class); +// String result = redisUtil.secAdd(RedisCst.PRODUCT+shopId+":"+jsonObject.getString("skuId"),cashierCart.getNumber().toString()); + productSkuMapper.updateAddStockById(jsonObject.getString("skuId"), cashierCart.getNumber()); + + } + } + } + cashierCartMapper.updateStatusByTableId(jsonObject.getString("tableId"), "closed"); + redisUtil.saveMessage(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId").concat("-").concat(shopId)), new JSONArray().toJSONString()); + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "success"); + jsonObject1.put("msg", "成功"); + jsonObject1.put("type", "clearCart"); + jsonObject1.put("amount", BigDecimal.ZERO); + jsonObject1.put("data", new ArrayList<>()); + AppWebSocketServer.AppSendInfo(jsonObject1, jsonObject.getString("tableId").concat("-").concat(shopId), false); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CashierCartService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CashierCartService.java new file mode 100644 index 0000000..760fdfa --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CashierCartService.java @@ -0,0 +1,156 @@ +//package com.chaozhanggui.system.cashierservice.service; +// +//import com.chaozhanggui.system.cashierservice.dao.TbCashierCartMapper; +//import com.chaozhanggui.system.cashierservice.dao.TbProductMapper; +//import com.chaozhanggui.system.cashierservice.dao.TbProductSkuMapper; +//import com.chaozhanggui.system.cashierservice.entity.TbCashierCart; +//import com.chaozhanggui.system.cashierservice.entity.TbProduct; +//import com.chaozhanggui.system.cashierservice.entity.TbProductSku; +//import com.chaozhanggui.system.cashierservice.entity.dto.ProductCartDto; +//import com.chaozhanggui.system.cashierservice.entity.vo.CashierCarVo; +//import com.chaozhanggui.system.cashierservice.exception.MsgException; +//import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +//import com.chaozhanggui.system.cashierservice.sign.Result; +//import lombok.extern.slf4j.Slf4j; +//import org.springframework.beans.BeanUtils; +//import org.springframework.stereotype.Service; +//import org.springframework.transaction.annotation.Transactional; +// +//import javax.annotation.Resource; +//import java.math.BigDecimal; +//import java.time.Instant; +//import java.util.ArrayList; +//import java.util.HashMap; +//import java.util.List; +// +///** +// * @author lyf +// */ +//@Service +//@Slf4j +//public class CashierCartService { +// @Resource +// private TbCashierCartMapper cashierCartMapper; +// @Resource +// private TbProductMapper productMapper; +// @Resource +// private TbProductSkuMapper productSkuMapper; +// +// /** +// * 增加购物车 +// * @param productCartDto +// * @return +// */ +// @Transactional(rollbackFor = Exception.class) +// public Result batchAdd(ProductCartDto productCartDto){ +// //首先确认金额 +// TbProduct tbProduct = productMapper.selectById(Integer.valueOf(productCartDto.getProductId())); +// if (tbProduct == null){ +// return Result.fail("商品信息不存在"); +// } +// +// TbCashierCart cashierCart = cashierCartMapper.selectByProduct(productCartDto.getProductId(), productCartDto.getTableId()); +// if (cashierCart != null){ +// if ("add".equals(productCartDto.getType())){ +// TbCashierCart cashierCartNow = new TbCashierCart(); +// cashierCartNow.setNumber(cashierCart.getNumber()+1F); +// cashierCartNow.setId(cashierCart.getId()); +// cashierCartMapper.updateByPrimaryKeySelective(cashierCartNow); +// return Result.success(CodeEnum.ENCRYPT); +// }else if ("minus".equals(productCartDto.getType())){ +// TbCashierCart cashierCartNow = new TbCashierCart(); +// cashierCartNow.setNumber(cashierCart.getNumber()-1F); +// cashierCartNow.setId(cashierCart.getId()); +// if (cashierCartNow.getNumber() == 0F){ +// cashierCartNow.setStatus("clear"); +// cashierCartMapper.updateByPrimaryKeySelective(cashierCartNow); +// return Result.success(CodeEnum.ENCRYPT); +// } +// cashierCartMapper.updateByPrimaryKeySelective(cashierCartNow); +// return Result.success(CodeEnum.ENCRYPT); +// }else { +// throw new MsgException("添加购物车失败"); +// } +// } +// //增加新的购物车 +// TbCashierCart tbCashierCart = new TbCashierCart(); +// BeanUtils.copyProperties(productCartDto,tbCashierCart); +// tbCashierCart.setSalePrice(tbProduct.getLowPrice()); +// tbCashierCart.setCreatedAt(Instant.now().toEpochMilli()); +// tbCashierCart.setUpdatedAt(Instant.now().toEpochMilli()); +// tbCashierCart.setTotalNumber(0.00F); +// tbCashierCart.setRefundNumber(0.00F); +// tbCashierCart.setType((byte) 0); +// tbCashierCart.setSkuId(productCartDto.getSkuInfo()); +// //购物车状态打开 +// tbCashierCart.setStatus("open"); +// +// int insert = cashierCartMapper.insertSelective(tbCashierCart); +// if (insert>0){ +// return Result.success(CodeEnum.SUCCESS); +// } +// throw new MsgException("添加购物车失败"); +// } +// +// +// public Result cartList(Integer tableId){ +// HashMap map = new HashMap<>(); +// List tbCashierCarts = cashierCartMapper.selectByTableId(tableId); +// BigDecimal total = new BigDecimal("0.00"); +// for (TbCashierCart date :tbCashierCarts) { +// Float number = date.getNumber(); +// BigDecimal bigDecimalValue = new BigDecimal(number.toString()); +// total=total.add(bigDecimalValue.multiply(date.getSalePrice())); +// } +// +// map.put("cartList",tbCashierCarts); +// map.put("total",total); +// +// return Result.success(CodeEnum.ENCRYPT,map); +// +// } +// @Transactional(rollbackFor = Exception.class) +// public Result updateNumber(Integer tableId,String type){ +// TbCashierCart cashierCart = cashierCartMapper.selectByPrimaryKey(tableId); +// if (cashierCart == null){ +// return Result.fail("商品不存在"); +// } +// if ("add".equals(type)){ +// TbCashierCart cashierCartNow = new TbCashierCart(); +// cashierCartNow.setNumber(cashierCart.getNumber()+1F); +// cashierCartNow.setId(cashierCart.getId()); +// cashierCartMapper.updateByPrimaryKeySelective(cashierCartNow); +// return Result.success(CodeEnum.ENCRYPT); +// }else if ("minus".equals(type)){ +// TbCashierCart cashierCartNow = new TbCashierCart(); +// cashierCartNow.setNumber(cashierCart.getNumber()-1F); +// cashierCartNow.setId(cashierCart.getId()); +// if (cashierCartNow.getNumber() == 0F){ +// cashierCartNow.setStatus("clear"); +// cashierCartMapper.updateByPrimaryKeySelective(cashierCartNow); +// return Result.success(CodeEnum.ENCRYPT); +// } +// cashierCartMapper.updateByPrimaryKeySelective(cashierCartNow); +// return Result.success(CodeEnum.ENCRYPT); +// }else { +// throw new MsgException("更改商品失败"); +// } +// +// } +// @Transactional(rollbackFor = Exception.class) +// public Result clearCart(Integer tableId){ +// List cashierCarVos = cashierCartMapper.selectByTableIdOpen(tableId); +// if (cashierCarVos.isEmpty()){ +// return Result.fail("购物车内无商品"); +// } +// List ids = new ArrayList<>(); +// for (CashierCarVo date :cashierCarVos) { +// ids.add(date.getId()); +// } +// int i = cashierCartMapper.updateByIdsStatus(ids, Instant.now().toEpochMilli()); +// if (i != ids.size()){ +// throw new MsgException("清空购物车失败"); +// } +// return Result.success(CodeEnum.ENCRYPT); +// } +//} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java new file mode 100644 index 0000000..0833316 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/CloudPrinterService.java @@ -0,0 +1,268 @@ +package com.chaozhanggui.system.cashierservice.service; + + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.dao.*; +import com.chaozhanggui.system.cashierservice.entity.*; +import com.chaozhanggui.system.cashierservice.model.CategoryInfo; +import com.chaozhanggui.system.cashierservice.model.OrderDetailPO; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.util.DateUtils; +import com.chaozhanggui.system.cashierservice.util.FeieyunPrintUtil; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.PrinterUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@Service +@Slf4j +public class CloudPrinterService { + + + TbShopUserMapper tbShopUserMapper; + @Autowired + private TbOrderInfoMapper tbOrderInfoMapper; + @Autowired + private TbPrintMachineMapper tbPrintMachineMapper; + @Autowired + private TbCashierCartMapper tbCashierCartMapper; + @Autowired + private TbProductSkuMapper tbProductSkuMapper; + @Autowired + private TbShopInfoMapper tbShopInfoMapper; + + @Autowired + private TbProductMapper tbProductMapper; + + + + + public Result printReceipt(String type,String orderId,Boolean ispre){ + + try { + + TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId)); + if (ObjectUtil.isEmpty(orderInfo)) { + log.error("没有对应的订单信息"); + return Result.fail("没有对应的订单信息"); + } + TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId())); + if (ObjectUtil.isEmpty(shopInfo)) { + log.error("店铺信息不存在"); + return Result.fail("店铺信息不存在"); + } + + + List list = tbPrintMachineMapper.selectByShopId(orderInfo.getShopId()); + + if (ObjectUtil.isEmpty(list) || list.size() <= 0) { + log.error("此店铺没有对应的打印机设备"); + return Result.fail("此店铺没有对应的打印机设备"); + } + + list.parallelStream().forEach(tbPrintMachineWithBLOBs->{ + if (!"network".equals(tbPrintMachineWithBLOBs.getConnectionType())) { + log.error("非网络打印机"); + return; + } + + if (!"1".equals(tbPrintMachineWithBLOBs.getStatus().toString())) { + log.error("打印机状态异常"); + return; + } + + JSONObject config = JSONObject.parseObject(tbPrintMachineWithBLOBs.getConfig()); + String model = config.getString("model"); + + String printerNum = config.getString("printerNum"); + + String feet = config.getString("feet"); + + String autoCut = config.getString("autoCut"); + + List categoryInfos=JSONUtil.parseJSONStr2TList(config.getJSONArray("categoryList").toString(),CategoryInfo.class); + + switch (tbPrintMachineWithBLOBs.getContentType()){ + case "yxyPrinter": + yxyPrinter(tbPrintMachineWithBLOBs,model,orderInfo,shopInfo,printerNum,categoryInfos); + break; + case "fePrinter": + fePrinter(tbPrintMachineWithBLOBs,model,orderInfo,shopInfo,printerNum,categoryInfos); + break; + } + }); + return Result.success(CodeEnum.SUCCESS); + + }catch (Exception e){ + e.printStackTrace(); + } + + return Result.fail("系统异常"); + + } + + + + + /** + * 博时结云打印机 + * @param tbPrintMachineWithBLOBs + * @param model + * @param orderInfo + * @param shopInfo + * @param printerNum + */ + private void yxyPrinter(TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs,String model,TbOrderInfo orderInfo,TbShopInfo shopInfo,String printerNum, List categoryInfos){ + String orderId=orderInfo.getId().toString(); + + + switch (tbPrintMachineWithBLOBs.getSubType()) { + case "label": //标签打印机 + break; + case "cash": //小票打印机 + switch (model) { + case "normal": //普通出单 + List cashierCarts = tbCashierCartMapper.selectByOrderId(orderInfo.getId().toString(),"final"); + if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) { + List detailList = new ArrayList<>(); + cashierCarts.parallelStream().forEach(it -> { + String categoryId; + if(ObjectUtil.isEmpty(it.getCategoryId())){ + categoryId= tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId(); + } else { + categoryId = it.getCategoryId(); + } + + + Long count= categoryInfos.stream().filter(c-> + c.getId().toString().equals(categoryId) + ).count(); + + if(count>0){ + TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId())); + String remark = ""; + if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) { + remark = tbProductSkuWithBLOBs.getSpecSnap(); + } + + OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getName(), it.getNumber().toString(), it.getTotalAmount().toPlainString(), remark); + detailList.add(detail); + } + }); + + String balance = "0"; + + if ("deposit".equals(orderInfo.getPayType())) { + TbShopUser user = tbShopUserMapper.selectByPrimaryKey(orderInfo.getMemberId()); + if (ObjectUtil.isNotEmpty(user) && ObjectUtil.isNotEmpty(user.getAmount())) { + balance = user.getAmount().toPlainString(); + } + } + if(ObjectUtil.isNotEmpty(detailList)&&detailList.size()>0){ + + OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印", orderInfo.getTableName(), orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), "【POS-1】001", orderInfo.getOrderAmount().toPlainString(), balance, orderInfo.getPayType(), "0", detailList); + String data= PrinterUtils.getCashPrintData(detailPO,"结算单"); + PrinterUtils.printTickets(1, Integer.valueOf(printerNum), tbPrintMachineWithBLOBs.getAddress(), data); + } + + } + + break; + case "one": //一菜一品 + cashierCarts = tbCashierCartMapper.selectByOrderId(orderId,"final"); + if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) { + + cashierCarts.parallelStream().forEach(it -> { + + String categoryId; + if(ObjectUtil.isEmpty(it.getCategoryId())){ + categoryId= tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId(); + } else { + categoryId = it.getCategoryId(); + } + + + Long count= categoryInfos.stream().filter(c-> + c.getId().toString().equals(categoryId) + ).count(); + + if(count>0){ + TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId())); + String remark = ""; + if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) { + remark = tbProductSkuWithBLOBs.getSpecSnap(); + } + String data = PrinterUtils.getPrintData(orderInfo.getTableName(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), it.getName(), it.getNumber(), remark); + PrinterUtils.printTickets(1, Integer.valueOf(printerNum), tbPrintMachineWithBLOBs.getAddress(), data); + } + }); + } + break; + case "category": //分类出单 + break; + } + + break; + case "kitchen": //出品打印机 + break; + } + } + + + + + private void fePrinter(TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs,String model,TbOrderInfo orderInfo,TbShopInfo shopInfo,String printerNum, List categoryInfos){ + String orderId=orderInfo.getId().toString(); + switch (tbPrintMachineWithBLOBs.getSubType()) { + case "label": //标签打印机 + List cashierCarts = tbCashierCartMapper.selectByOrderId(orderInfo.getId().toString(),"final"); + if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) { + cashierCarts.parallelStream().forEach(it->{ + + String categoryId; + if(ObjectUtil.isEmpty(it.getCategoryId())){ + categoryId= tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId(); + } else { + categoryId = it.getCategoryId(); + } + + + Long count= categoryInfos.stream().filter(c-> + c.getId().toString().equals(categoryId) + ).count(); + + + if(count>0) { + TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(it.getSkuId())); + String remark = ""; + if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) { + remark = tbProductSkuWithBLOBs.getSpecSnap(); + } + + for(int i=0;i shopMap=new HashMap<>(); + if(ObjectUtil.isNotEmpty(tbShopInfo)){ + tbShopUser= tbShopUserMapper.selectByUserIdAndShopId(userInfo.getId().toString(),tbShopInfo.getId().toString()); + if(ObjectUtil.isEmpty(tbShopUser)){ + tbShopUser=new TbShopUser(); + tbShopUser.setAmount(BigDecimal.ZERO); + tbShopUser.setCreditAmount(BigDecimal.ZERO); + tbShopUser.setConsumeAmount(BigDecimal.ZERO); + tbShopUser.setConsumeNumber(0); + tbShopUser.setLevelConsume(BigDecimal.ZERO); + tbShopUser.setStatus(Byte.parseByte("1")); + tbShopUser.setShopId(tbShopInfo.getId().toString()); + tbShopUser.setUserId(userInfo.getId().toString()); + tbShopUser.setMiniOpenId(openId); + tbShopUser.setCreatedAt(System.currentTimeMillis()); + tbShopUserMapper.insert(tbShopUser); + } + shopMap.put("shopId",tbShopUser.getShopId()); + shopMap.put("name",tbShopInfo.getShopName()); + shopMap.put("amount",BigDecimal.ZERO.toPlainString()); + shopMap.put("levelConsume",BigDecimal.ZERO.toPlainString()); + + } + + + //生成token 信息 + String token = TokenUtil.generateToken(userInfo.getId(), userInfo.getMiniAppOpenId(), userInfo.getTelephone(),userInfo.getNickName()); + + + //存储登录记录 + TbToken tbToken = new TbToken(tbShopInfo.getId(), userInfo.getId(),"wx_lite", token, ip, "1", new Date()); + tbTokenMapper.insert(tbToken); + + + + Map map=new HashMap<>(); + try { + map.put("token",token); + map.put("userInfo",userInfo); + map.put("shopUser",shopMap); + map.put("shopInfo",tbShopInfo); + redisUtil.saveMessage(RedisCst.ONLINE_USER.concat(openId), JSON.toJSONString(map)); + return Result.success(CodeEnum.SUCCESS,map); + } catch (Exception e) { + e.printStackTrace(); + + } + return Result.fail("登录失败"); + } + + + + public Result createCardNo(String id,String openId){ + if(ObjectUtil.isEmpty(id)||ObjectUtil.isEmpty(openId)){ + return Result.fail("head 信息不允许为空"); + } + + + TbUserInfo userInfo= tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(id)); + if(userInfo==null||ObjectUtil.isEmpty(userInfo)){ + userInfo=tbUserInfoMapper.selectByOpenId(openId); + } + + if(userInfo==null||ObjectUtil.isEmpty(userInfo)){ + return Result.fail("用户信息不存在"); + } + + String cardNo= RandomUtil.randomNumbers(10); + userInfo.setCardNo(cardNo); + userInfo.setUpdatedAt(System.currentTimeMillis()); + tbUserInfoMapper.updateByPrimaryKeySelective(userInfo); + + return Result.success(CodeEnum.SUCCESS,cardNo) ; + } + + + public Result userInfo(Integer userId,String shopId){ + TbUserInfo tbUserInfo = tbUserInfoMapper.selectByPrimaryKey(userId); + + if (tbUserInfo == null){ + return Result.success(CodeEnum.ENCRYPT,new ArrayList()); + } + + + TbShopInfo tbShopInfo=null; + if(ObjectUtil.isEmpty(shopId)){ + tbShopInfo=tbShopInfoMapper.selectByPhone(defaultPhone); + }else { + tbShopInfo=tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId)); + } + + TbShopUser tbShopUser=null; + Map shopMap=new HashMap<>(); + if(ObjectUtil.isNotEmpty(tbShopInfo)){ + tbShopUser= tbShopUserMapper.selectByUserIdAndShopId(tbUserInfo.getId().toString(),tbShopInfo.getId().toString()); + shopMap.put("shopId",tbShopUser.getShopId()); + shopMap.put("name",tbShopInfo.getShopName()); + shopMap.put("amount",BigDecimal.ZERO.toPlainString()); + shopMap.put("levelConsume",BigDecimal.ZERO.toPlainString()); + } + + Map map=new HashMap<>(); + map.put("userInfo",tbUserInfo); + map.put("shopUser",shopMap); + map.put("shopInfo",tbShopInfo); + + + return Result.success(CodeEnum.ENCRYPT,map); + } + public static void main(String[] args){ + for(int i =0;i<10;i++){ + System.out.println(RandomUtil.randomNumbers(10)); + } + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/OnlineUserService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/OnlineUserService.java new file mode 100644 index 0000000..704010f --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/OnlineUserService.java @@ -0,0 +1,50 @@ +package com.chaozhanggui.system.cashierservice.service; + + +import com.chaozhanggui.system.cashierservice.entity.dto.OnlineUserDto; +import com.chaozhanggui.system.cashierservice.entity.dto.SecurityProperties; +import com.chaozhanggui.system.cashierservice.exception.MsgException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import com.chaozhanggui.system.cashierservice.util.RedisUtils; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; + +@Service +@Slf4j +public class OnlineUserService { + @Resource + private RedisUtils redisUtils; + + // 令牌有效期(默认30分钟) + protected static final long MILLIS_MINUTE = 30 * 60 *1000; + /** + * 保存在线用户信息 + * @param name + * @param account + * @param shopId + * @param token + */ + public OnlineUserDto save(String name,String account, Integer shopId, String token,Integer status){ + OnlineUserDto onlineUserDto = null; + + onlineUserDto = new OnlineUserDto(); + onlineUserDto.setAccount(account); + onlineUserDto.setName(name); + onlineUserDto.setStatus(status); + onlineUserDto.setToken(token); + onlineUserDto.setLoginTime(new Date()); + onlineUserDto.setShopId(shopId); + try { + redisUtils.set("online-token-"+token, onlineUserDto, MILLIS_MINUTE); + }catch (Exception e){ + throw new MsgException("登录错误"); + } + + return onlineUserDto; + } + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java new file mode 100644 index 0000000..08cb26d --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/OrderService.java @@ -0,0 +1,233 @@ +package com.chaozhanggui.system.cashierservice.service; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.chaozhanggui.system.cashierservice.dao.*; +import com.chaozhanggui.system.cashierservice.entity.*; +import com.chaozhanggui.system.cashierservice.entity.vo.CashierCarVo; +import com.chaozhanggui.system.cashierservice.entity.vo.OrderVo; +import com.chaozhanggui.system.cashierservice.exception.MsgException; +import com.chaozhanggui.system.cashierservice.redis.RedisCst; +import com.chaozhanggui.system.cashierservice.redis.RedisUtil; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import com.chaozhanggui.system.cashierservice.util.SnowFlakeUtil; +import org.springframework.data.domain.Page; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.awt.print.Pageable; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; + +/** + * @author 12847 + */ +@Service +public class OrderService { + + @Resource + private TbCashierCartMapper cashierCartMapper; + + @Resource + private TbOrderInfoMapper orderInfoMapper; + + @Resource + private TbShopInfoMapper tbShopInfoMapper; + + @Resource + private TbShopTableMapper shopTableMapper; + @Resource + private TbProductSkuMapper productSkuMapper; + + @Resource + private TbUserInfoMapper userInfoMapper; + + @Resource + private TbOrderDetailMapper tbOrderDetailMapper; + @Resource + private RedisUtil redisUtil; + /** + * 创建订单 + * @param tableId + * @return + */ + @Transactional(rollbackFor = Exception.class) + public Result createOrder(Integer tableId,Integer shopId,Integer userId){ +// //查询该台桌是否还有开启的购物车 +// List cashierCarVoList = cashierCartMapper.selectByTableIdOpen(tableId); +// if (cashierCarVoList.isEmpty()){ +// return Result.fail("该桌已清台"); +// } +// //总金额 +// BigDecimal total = new BigDecimal("0.00"); +// List ids = new ArrayList<>(); +// for (CashierCarVo date :cashierCarVoList) { +// total=total.add(date.getNumber().multiply(date.getSalePrice())); +// ids.add(date.getId()); +// } +// +// TbMerchantAccount tbMerchantAccount = merchantAccountMapper.selectByShopId(shopId.toString()); +// if (tbMerchantAccount == null){ +// return Result.fail("生成订单错误"); +// } +// +// TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(userId); +// if (tbUserInfo == null){ +// return Result.fail("生成订单失败"); +// } +// //生成订单 +// TbOrderInfo orderInfo = new TbOrderInfo(); +// String orderNo = SnowFlakeUtil.generateOrderNo(); +// orderInfo.setOrderNo(orderNo); +// orderInfo.setSettlementAmount(new BigDecimal("0.00")); +// orderInfo.setPackFee(new BigDecimal("0.00")); +// orderInfo.setOriginAmount(total); +// orderInfo.setProductAmount(new BigDecimal("0.00")); +// orderInfo.setAmount(total); +// orderInfo.setPayAmount(total); +// orderInfo.setRefundAmount(new BigDecimal("0.00")); +// orderInfo.setCashPaidAmount(new BigDecimal("0.00")); +// orderInfo.setTableId(tableId.toString()); +// orderInfo.setSendType("table"); +// orderInfo.setOrderType("miniapp"); +// orderInfo.setStatus("unpaid"); +// orderInfo.setShopId(shopId.toString()); +// orderInfo.setUserId(userId.toString()); +// orderInfo.setCreatedAt(Instant.now().toEpochMilli()); +// orderInfo.setSystemTime(Instant.now().toEpochMilli()); +// orderInfo.setUpdatedAt(Instant.now().toEpochMilli()); +// orderInfo.setIsAccepted((byte) 1); +// orderInfo.setMerchantId(String.valueOf(tbMerchantAccount.getId())); +// int i = orderInfoMapper.insertSelective(orderInfo); +// //添加订单扩展 +// TbOrderExtendWithBLOBs orderExtendWithBLOBs = new TbOrderExtendWithBLOBs(); +// orderExtendWithBLOBs.setCartList(JSON.toJSONString(cashierCarVoList)); +// orderExtendWithBLOBs.setId(orderInfo.getId()); +// int i1 = orderExtendMapper.insertSelective(orderExtendWithBLOBs); +// if (i1<1){ +// throw new MsgException("创建订单失败"); +// } +// if (i<1){ +// throw new MsgException("创建订单失败"); +// } +// int update = cashierCartMapper.updateByIds(ids,orderInfo.getId().toString(),Instant.now().toEpochMilli()); +// if (update<1){ +// throw new MsgException("创建订单失败"); +// } +// //返回显示数据 +// TbShopInfo tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(shopId); +// if (tbShopInfo == null){ +// throw new MsgException("创建订单失败"); +// } +// TbShopTable shopTable = shopTableMapper.selectByPrimaryKey(tableId); +// + OrderVo orderVo = new OrderVo(); +// orderVo.setName(tbShopInfo.getShopName()); +// orderVo.setStatus(orderInfo.getStatus()); +// orderVo.setCartList(cashierCarVoList); +// orderVo.setOrderNo(orderNo); +// orderVo.setTime(Instant.now().toEpochMilli()); +// orderVo.setPayAmount(total); +// orderVo.setTableName(shopTable.getName()); +// orderVo.setOrderType(orderInfo.getOrderType()); +// orderVo.setOrderId(orderInfo.getId()); +// orderVo.setSendType(orderInfo.getSendType()); + return Result.success(CodeEnum.ENCRYPT,orderVo); + } + + public Result orderInfo(Integer orderId){ + TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId); + if (orderInfo == null){ + return Result.fail("未找到订单"); + } + + + + TbShopInfo tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId())); + if (tbShopInfo == null){ + return Result.fail("未找到订单"); + } + TbShopTable tbShopTable = shopTableMapper.selectQRcode(orderInfo.getTableId()); + + + List details= tbOrderDetailMapper.selectAllByOrderId(orderId); + if(ObjectUtil.isEmpty(details)||details.size()<=0){ + return Result.fail("未找到订单"); + } + + OrderVo orderVo = new OrderVo(); + orderVo.setName(tbShopInfo.getShopName()); + orderVo.setStatus(orderInfo.getStatus()); + + orderVo.setDetails(details); + orderVo.setOrderNo(orderInfo.getOrderNo()); + orderVo.setTime(orderInfo.getCreatedAt()); + orderVo.setPayAmount(orderInfo.getOrderAmount()); + orderVo.setTableName(tbShopTable == null?"":tbShopTable.getName()); + orderVo.setOrderType(orderInfo.getOrderType()); + orderVo.setOrderId(orderInfo.getId()); + orderVo.setSendType(orderInfo.getSendType()); + + return Result.success(CodeEnum.ENCRYPT,orderVo); + } + + + public Result orderList(Integer userId,Integer page,Integer size,String status){ + TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(userId); + if (tbUserInfo == null){ + return Result.fail("生成订单失败"); + } + //获取页码号 + int beginNo; + if(page <=0){ + beginNo = 0; + }else{ + beginNo = (page - 1) * size; + } + List tbOrderInfos = orderInfoMapper.selectByUserId(userId, beginNo, size,status); + + for (TbOrderInfo orderInfo:tbOrderInfos){ + List list = tbOrderDetailMapper.selectAllByOrderId(orderInfo.getId()); + int num = 0; + for (TbOrderDetail orderDetail:list){ + num = num+orderDetail.getNum(); + } + orderInfo.setDetailList(list); + orderInfo.setTotalNumber(num); + } +// +// for (OrderVo date :tbOrderInfos) { +// if (date.getCartListString() !=null) { +// date.setCartList(JSON.parseArray(date.getCartListString(), CashierCarVo.class)); +// date.setCartListString(""); +// BigDecimal number = new BigDecimal("0.00"); +// for (CashierCarVo o : date.getCartList()) { +// number = number.add(o.getNumber()); +// } +// //总个数 +// date.setTotalNumber(number); +// } +// } + return Result.success(CodeEnum.ENCRYPT,tbOrderInfos); + + } + + public void testMessage(String tableId, String message) throws IOException { +// AppWebSocketServer.AppSendInfo(message,tableId); +// redisUtil.seckill(tableId,message); +// AppWebSocketServer.onClosed(tableId); + List list = productSkuMapper.selectAll(); + for (TbProductSku productSku:list){ +// productSku.setStockNumber(200.00); + redisUtil.saveMessage("PRODUCT:"+productSku.getShopId()+":"+productSku.getId(),productSku.getStockNumber().intValue()+""); + } + + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java new file mode 100644 index 0000000..7c711dc --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java @@ -0,0 +1,480 @@ +package com.chaozhanggui.system.cashierservice.service; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.dao.*; +import com.chaozhanggui.system.cashierservice.entity.*; +import com.chaozhanggui.system.cashierservice.model.PayReq; +import com.chaozhanggui.system.cashierservice.model.TradeQueryReq; +import com.chaozhanggui.system.cashierservice.rabbit.RabbitProducer; +import com.chaozhanggui.system.cashierservice.redis.RedisCst; +import com.chaozhanggui.system.cashierservice.redis.RedisUtil; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import com.chaozhanggui.system.cashierservice.util.BeanUtil; +import com.chaozhanggui.system.cashierservice.util.MD5Util; +import com.chaozhanggui.system.cashierservice.util.SnowFlakeUtil; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.client.RestTemplate; + +import javax.annotation.Resource; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.Map; + +@Service +@Slf4j +public class PayService { + + + + @Autowired + TbOrderInfoMapper tbOrderInfoMapper; + + @Autowired + TbShopInfoMapper tbShopInfoMapper; + + @Autowired + TbMerchantThirdApplyMapper tbMerchantThirdApplyMapper; + + @Autowired + TbOrderPaymentMapper tbOrderPaymentMapper; + + + @Autowired + TbOrderDetailMapper tbOrderDetailMapper; + + + @Value("${ysk.url}") + private String url; + + @Value("${ysk.callBackurl}") + private String callBackurl; + + @Value("${ysk.callBackIn}") + private String callBackIn; + + + + + @Autowired + private TbCashierCartMapper tbCashierCartMapper; + + @Autowired + TbMemberInMapper tbMemberInMapper; + + @Autowired + TbShopUserMapper tbShopUserMapper; + + @Resource + RestTemplate restTemplate; + + + @Autowired + private RedisUtil redisUtil; + + + @Autowired + RabbitProducer producer; + + @Autowired + TbShopUserFlowMapper tbShopUserFlowMapper; + + + + @Transactional(rollbackFor = Exception.class) + public Result payOrder(String openId,String orderId,String ip) throws Exception { + TbOrderInfo orderInfo= tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId)); + + if(!"unpaid".equals(orderInfo.getStatus())&&!"paying".equals(orderInfo.getStatus())){ + return Result.fail("订单状态异常,不允许支付"); + } + + if(ObjectUtil.isNull(orderInfo.getMerchantId())||ObjectUtil.isEmpty(orderInfo.getMerchantId())){ + return Result.fail("没有对应的商户"); + } + + + TbMerchantThirdApply thirdApply= tbMerchantThirdApplyMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getMerchantId())); + + if(ObjectUtil.isEmpty(thirdApply)||ObjectUtil.isNull(thirdApply)){ + return Result.fail("支付通道不存在"); + } + + TbOrderPayment payment=tbOrderPaymentMapper.selectByOrderId(orderId); + if(ObjectUtil.isEmpty(payment)||payment==null){ + payment=new TbOrderPayment(); + payment.setPayTypeId("ysk"); + payment.setAmount(orderInfo.getOrderAmount()); + payment.setPaidAmount(orderInfo.getPayAmount()); + payment.setHasRefundAmount(BigDecimal.ZERO); + payment.setPayName("微信支付"); + payment.setPayType("wechatPay"); + payment.setReceived(payment.getAmount()); + payment.setChangeFee(BigDecimal.ZERO); + payment.setMemberId(orderInfo.getMemberId()); + payment.setShopId(orderInfo.getShopId()); + payment.setOrderId(orderInfo.getId().toString()); + payment.setCreatedAt(System.currentTimeMillis()); + tbOrderPaymentMapper.insert(payment); + }else { + payment.setUpdatedAt(System.currentTimeMillis()); + tbOrderPaymentMapper.updateByPrimaryKey(payment); + } + + PayReq req=new PayReq(); + + req.setAppId(thirdApply.getAppId()); + req.setTimestamp(System.currentTimeMillis()); + req.setIp(ip); + req.setMercOrderNo(orderInfo.getOrderNo()); + req.setNotifyUrl(callBackurl); + req.setPayAmt(payment.getAmount().setScale(2,BigDecimal.ROUND_DOWN).toPlainString()); + req.setPayType("03"); + req.setPayWay("WXZF"); + req.setSubject("扫码点餐"); + req.setUserId(openId); + + + Map map= BeanUtil.transBeanMap(req); + req.setSign(MD5Util.encrypt(map,thirdApply.getAppToken(),true)); + + ResponseEntity response= restTemplate.postForEntity(url.concat("trans/pay"),req,String.class); + if(response.getStatusCodeValue()==200&&ObjectUtil.isNotEmpty(response.getBody())){ + JSONObject object=JSONObject.parseObject(response.getBody()); + if(object.get("code").equals("0")){ + + payment.setTradeNumber(object.getJSONObject("data").get("orderNumber").toString()); + payment.setUpdatedAt(System.currentTimeMillis()); + tbOrderPaymentMapper.updateByPrimaryKeySelective(payment); + orderInfo.setStatus("paying"); + orderInfo.setPayOrderNo(payment.getTradeNumber()); + + tbOrderInfoMapper.updateByPrimaryKey(orderInfo); + String key= RedisCst.TABLE_CART.concat(orderInfo.getTableId()).concat("-").concat(orderInfo.getShopId()); + //清除缓存购物车数据 + redisUtil.deleteByKey(key); + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "success"); + jsonObject1.put("msg", "成功"); + jsonObject1.put("type", ""); + jsonObject1.put("data", new JSONArray()); + jsonObject1.put("amount", 0); + AppWebSocketServer.AppSendInfo(jsonObject1,key, false); + tbCashierCartMapper.updateStatusByOrderId(orderId.toString(),"final"); + return Result.success(CodeEnum.SUCCESS,object.getJSONObject("data")); + }else { + return Result.fail(object.getString("msg")); + } + } + + return Result.fail("失败"); + } + + + + @Transactional(rollbackFor = Exception.class) + public Result modifyOrderStatus(Integer orderId) throws IOException { + TbOrderInfo orderInfo= tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId)); + if(ObjectUtil.isEmpty(orderInfo)){ + return Result.fail("订单信息不存在"); + } + + if("paying".equals(orderInfo.getStatus())){ + + TbOrderPayment payment= tbOrderPaymentMapper.selectByOrderId(orderInfo.getId().toString()); + if(ObjectUtil.isNotEmpty(payment)&&ObjectUtil.isNotEmpty(payment.getTradeNumber())){ + + TbMerchantThirdApply thirdApply= tbMerchantThirdApplyMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getMerchantId())); + + if(ObjectUtil.isEmpty(thirdApply)||ObjectUtil.isNull(thirdApply)){ + return Result.fail("支付通道不存在"); + } + + + TradeQueryReq req=new TradeQueryReq(); + req.setAppId(thirdApply.getAppId()); + req.setTimestamp(System.currentTimeMillis()); + req.setOrderNumber(payment.getTradeNumber()); + Map map= BeanUtil.transBeanMap(req); + + req.setSign(MD5Util.encrypt(map,thirdApply.getAppToken(),true)); + + ResponseEntity response= restTemplate.postForEntity(url.concat("merchantOrder/tradeQuery"),req,String.class); + if(response.getStatusCodeValue()==200&&ObjectUtil.isNotEmpty(response.getBody())){ + JSONObject object=JSONObject.parseObject(response.getBody()); + + if(object.get("code").equals("0")){ + JSONObject data=object.getJSONObject("data"); + String status=data.getString("status"); + String cartStatus=""; + switch (status){ + case "0": //交易失败 + break; + case "1": //交易成功 + + //修改数据库中购物车数据 + int cartCount= tbCashierCartMapper.updateStatusByOrderId(orderId.toString(),"final"); + + log.info("更新购物车:{}",cartCount); + + //更新子单状态 + tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId),"closed"); + + //修改主单状态 + orderInfo.setStatus("closed"); + orderInfo.setPayType("wx_lite"); + orderInfo.setPayOrderNo(payment.getTradeNumber()); + orderInfo.setPayAmount(orderInfo.getOrderAmount()); + tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); + + + JSONObject jsonObject=new JSONObject(); + jsonObject.put("token",0); + jsonObject.put("type","wxcreate"); + jsonObject.put("orderId",orderInfo.getId().toString()); + + producer.putOrderCollect(jsonObject.toJSONString()); + + + + log.info("发送打印数据"); + producer.printMechine(orderInfo.getId() + ""); + + return Result.success(CodeEnum.SUCCESS,orderId); + case "2": //退款成功 + cartStatus="refund"; + orderInfo.setStatus("refund"); + break; + case "3": //退款失败 + break; + case "4": //退款中 + cartStatus="refunding"; + orderInfo.setStatus("refunding"); + break; + } + + tbCashierCartMapper.updateStatusByOrderId(orderId.toString(),cartStatus); + orderInfo.setUpdatedAt(System.currentTimeMillis()); + tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); + } + } + } + } + return Result.success(CodeEnum.SUCCESS,orderId); + } + + + + + public Result memberIn(String openId,String userId,String amount,String shopId,String ip){ + if(ObjectUtil.isEmpty(openId)||ObjectUtil.isEmpty(userId)){ + return Result.fail("用户信息允许为空"); + } + + + TbShopUser tbShopUser= tbShopUserMapper.selectByUserIdAndShopId(userId,shopId); + if(ObjectUtil.isEmpty(tbShopUser)){ + return Result.fail("对应的用户信息不存在"); + } + + + TbShopInfo shopInfo= tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId)); + if(ObjectUtil.isEmpty(shopInfo)){ + return Result.fail("对应的店铺信息不存在"); + } + + + + TbMerchantThirdApply thirdApply= tbMerchantThirdApplyMapper.selectByPrimaryKey(Integer.valueOf(shopInfo.getMerchantId())); + + if(ObjectUtil.isEmpty(thirdApply)||ObjectUtil.isNull(thirdApply)){ + return Result.fail("支付通道不存在"); + } + + BigDecimal payAmount= new BigDecimal(amount).setScale(2,BigDecimal.ROUND_DOWN); + + TbMemberIn memberIn=new TbMemberIn(); + memberIn.setAmount(payAmount); + memberIn.setUserId(Integer.valueOf(tbShopUser.getId())); + memberIn.setCode(tbShopUser.getCode()); + memberIn.setStatus("7"); + memberIn.setMerchantId(Integer.valueOf(shopInfo.getMerchantId())); + memberIn.setCreateTime(new Date()); + tbMemberInMapper.insert(memberIn); + + + + PayReq req=new PayReq(); + + req.setAppId(thirdApply.getAppId()); + req.setTimestamp(System.currentTimeMillis()); + req.setIp(ip); + req.setMercOrderNo(SnowFlakeUtil.generateOrderNo()); + req.setNotifyUrl(callBackIn); + req.setPayAmt(amount); + req.setPayType("03"); + req.setPayWay("WXZF"); + req.setSubject("充值"); + req.setUserId(openId); + + + Map map= BeanUtil.transBeanMap(req); + req.setSign(MD5Util.encrypt(map,thirdApply.getAppToken(),true)); + + ResponseEntity response= restTemplate.postForEntity(url.concat("trans/pay"),req,String.class); + if(response.getStatusCodeValue()==200&&ObjectUtil.isNotEmpty(response.getBody())){ + JSONObject object=JSONObject.parseObject(response.getBody()); + if(object.get("code").equals("0")){ + + memberIn.setOrderNo(object.getJSONObject("data").get("orderNumber").toString()); + memberIn.setUpdateTime(new Date()); + tbMemberInMapper.updateByPrimaryKeySelective(memberIn); + + return Result.success(CodeEnum.SUCCESS,object.getJSONObject("data")); + }else { + return Result.fail(object.getString("msg")); + } + } + return Result.fail("失败"); + } + + + + @Transactional(rollbackFor = Exception.class) + public String callBackPay(String payOrderNO) { + TbOrderInfo orderInfo = tbOrderInfoMapper.selectByPayOrderNo(payOrderNO); + if (ObjectUtil.isEmpty(orderInfo)) { + return "订单信息不存在"; + } + + if ("paying".equals(orderInfo.getStatus())) { + int cartCount = tbCashierCartMapper.updateStatusByOrderId(orderInfo.getId().toString(), "final"); + + log.info("更新购物车:{}", cartCount); + + //更新子单状态 + tbOrderDetailMapper.updateStatusByOrderIdAndStatus(orderInfo.getId(), "closed"); + + //修改主单状态 + orderInfo.setStatus("closed"); + orderInfo.setPayType("wx_lite"); + orderInfo.setPayOrderNo(payOrderNO); + orderInfo.setPayAmount(orderInfo.getOrderAmount()); + tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); + + + JSONObject jsonObject=new JSONObject(); + jsonObject.put("token",0); + jsonObject.put("type","wxcreate"); + jsonObject.put("orderId",orderInfo.getId().toString()); + + producer.putOrderCollect(jsonObject.toJSONString()); + + log.info("发送打印数据"); + producer.printMechine(orderInfo.getId() + ""); + + return "SUCCESS"; + + } + return null; + } + + + @Transactional(rollbackFor = Exception.class) + public String minsuccess(String payOrderNO,String tradeNo){ + + TbMemberIn memberIn= tbMemberInMapper.selectByOrderNo(payOrderNO); + if(ObjectUtil.isEmpty(memberIn)){ + return "充值记录不存在"; + } + + memberIn.setTradeNo(tradeNo); + memberIn.setStatus("0"); + memberIn.setUpdateTime(new Date()); + tbMemberInMapper.updateByPrimaryKeySelective(memberIn); + + TbShopUser tbShopUser= tbShopUserMapper.selectByUserId(memberIn.getUserId().toString()); + if(ObjectUtil.isEmpty(tbShopUser)){ + return "用户信息不存在"; + } + + //修改客户资金 + tbShopUser.setAmount(tbShopUser.getAmount().add(memberIn.getAmount())); + tbShopUser.setUpdatedAt(System.currentTimeMillis()); + tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser); + + TbShopUserFlow flow=new TbShopUserFlow(); + flow.setShopUserId(Integer.valueOf(tbShopUser.getId())); + flow.setBizCode("scanMemberIn"); + flow.setBizName("会员扫码充值"); + flow.setAmount(memberIn.getAmount()); + flow.setBalance(tbShopUser.getAmount()); + flow.setCreateTime(new Date()); + tbShopUserFlowMapper.insert(flow); + return "success"; + } + + +// public Result returnOrder(){ +// +// } + + + public static void main(String[] args){ + + RestTemplate restTemplate1= new RestTemplate(); + JSONObject param=new JSONObject(); + + String priv="MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAIqNqTqhN8zE7eFZnwKcyBTENce2wdAtl/gaDHNuNVgg33dS27Jx0fKl9QSHXyzyxbAdG8F94niYbRBstrMymFRjuO72jH+rIH62Ym1k7l8JSLVK2dKHXt8lHDaQGUP10q0EEocnDQ9cL93oBNG1ttsV6vOAu1TPvRK9TGihRAe1AgMBAAECgYBmI8KCl0DkcrSOsRvYuC2DqZWf8el1B3eFjeZp3e/zVOCIPYv6Q5ArWg6DVSxjnWEA0KSagqvGjU+xkQMqnXzPcPMhsIS+1wyR/pP+pwiatO2ioHaQpEqHg9eXhxrgA477/xuKVw9zl5GNqaIgd++2NDXnqLh0Y6OR73f0OB5eDQJBAPihEm+UWLOam/Q/k2+k4Lm2dvxJTBur1fslBiJpgMhgcz/PlwRwpL7aPD0AuPv0NqLouuoTiKpq9icnUv12tgsCQQCOqTANw0IErCHUNdinjXewmG3ui1j9XgM41rSn5ZeTrPL4GhZc2zbS/pZT4PBKUL6NLGkfPHmw4rOmNL/Xc5E/AkBqAwQBX5eSvVHSC2mqKPtJNGv3lqlFAzfyJg8/jQzEY5vAkZsq4Xzdg+A7gptdkvvY6rMIK9wSDhl3CGVyfbORAkA1N+g1OiHmnFACWhP4bU25EyPvWQxZeDi7e1zpRTzGWj5JT3IIMb7B9zcdE0yQbI6pG2gbvvOmiOt7lTH7raEBAkBas2gugvR3f0aGqQcqMpyM627pyRppQ2h58/7KBylP3oR2BReqMUcXeiJ8TuBXzbRXpeVQ0DWOva5CWZJmBMdz"; + + PayReq req=new PayReq(); + + req.setAppId("M8002023120892f1e4"); + req.setTimestamp(System.currentTimeMillis()); + req.setIp("127.0.0.1"); + req.setMercOrderNo(System.currentTimeMillis()+""); + req.setNotifyUrl("https"); + req.setPayAmt("0.01"); + req.setPayType("03"); + req.setPayWay("WXZF"); + req.setSubject("ddd"); + req.setUserId("or1l864NBOoJZhC5x_yeziZ26j6c"); + + Map map= BeanUtil.transBeanMap(req); + + req.setSign(MD5Util.encrypt(map,priv,true)); + + + ResponseEntity response= restTemplate1.postForEntity("https://gatewaytestapi.sxczgkj.cn/gate-service/trans/pay",req,String.class); + + + +// TradeQueryReq req=new TradeQueryReq(); +// req.setAppId("M800202305094c170c"); +// req.setTimestamp(System.currentTimeMillis()); +// req.setOrderNumber("SXF_W_MERC_20240205182102491"); +// Map map= BeanUtil.transBeanMap(req); +// +// req.setSign(MD5Util.encrypt(map,priv,true)); +// +// ResponseEntity response= restTemplate1.postForEntity("https://gateway.api.sxczgkj.cn/gate-service/merchantOrder/tradeQuery",req,String.class); +// +// + System.out.println(">>>>>>>>>>>>>>>"+response.getBody()); + } + + + + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java new file mode 100644 index 0000000..4942b0e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ProductService.java @@ -0,0 +1,121 @@ +package com.chaozhanggui.system.cashierservice.service; + + +import cn.hutool.core.util.ObjectUtil; +import com.chaozhanggui.system.cashierservice.dao.*; +import com.chaozhanggui.system.cashierservice.entity.*; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import com.chaozhanggui.system.cashierservice.socket.AppWebSocketServer; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +@Service +@Slf4j +public class ProductService { + + + @Autowired + private TbProductGroupMapper tbProductGroupMapper; + + @Autowired + private TbProductMapper tbProductMapper; + + @Autowired + private TbShopInfoMapper tbShopInfoMapper; + + @Autowired + private TbProductSkuResultMapper tbProductSkuResultMapper; + + @Autowired + private TbShopTableMapper tbShopTableMapper; + + + + @Autowired + TbProductSkuMapper tbProductSkuMapper; + + + + + + + + public Result queryProduct(String code,String productGroupId){ + + ConcurrentMap concurrentMap=new ConcurrentHashMap<>(); + + TbShopTable tbShopTable= tbShopTableMapper.selectQRcode(code); + if(ObjectUtil.isEmpty(tbShopTable)||ObjectUtil.isNull(tbShopTable)){ + return Result.fail("台桌信息不存在"); + } + + + Integer id= ObjectUtil.isNotEmpty(productGroupId)?Integer.valueOf(productGroupId):null; + List groupList=tbProductGroupMapper.selectByQrcode(code,id); + if(ObjectUtil.isNotEmpty(groupList)&&groupList.size()>0){ + + TbProductGroup group= groupList.get(0); + TbShopInfo shopInfo= tbShopInfoMapper.selectByPrimaryKey(group.getShopId()) ; + concurrentMap.put("shopTableInfo",tbShopTable); + concurrentMap.put("storeInfo",shopInfo); + groupList.parallelStream().forEach(g->{ + String in=g.getProductIds().substring(1,g.getProductIds().length()-1); + + + if(ObjectUtil.isNotEmpty(in)&&ObjectUtil.isNotNull(in)){ + log.info("请求参数:{}",in); + List products= tbProductMapper.selectByIdIn(in); + if(ObjectUtil.isNotEmpty(products)&&products.size()>0){ + products.parallelStream().forEach(it->{ + Integer sum = 0; + if (AppWebSocketServer.userMap.containsKey(code)){ + Set userSet = AppWebSocketServer.userMap.get(code); + if (userSet.isEmpty()){ + sum= tbProductMapper.selectByQcode(code,it.getId(),it.getShopId()); + }else { + List userList = new ArrayList<>(userSet); + sum= tbProductMapper.selectByNewQcode(code,it.getId(),it.getShopId(),userList); + } + }else { + sum= tbProductMapper.selectByQcode(code,it.getId(),it.getShopId()); + } + it.setCartNumber(sum==null?"0":String.valueOf(sum)); + TbProductSkuResult skuResult= tbProductSkuResultMapper.selectByPrimaryKey(it.getId()); + it.setProductSkuResult(skuResult); + }); + g.setProducts(products); + }else { + g.setProducts(new ArrayList<>()); + } + + }else { + g.setProducts(new ArrayList<>()); + } + }); + + concurrentMap.put("productInfo",groupList); + } + + return Result.success(CodeEnum.SUCCESS,concurrentMap); + } + + + public Result queryProductSku(String shopId, String productId, String spec_tag){ + if(ObjectUtil.isEmpty(shopId)||ObjectUtil.isEmpty(productId)){ + return Result.fail("参数错误"); + } + + TbProductSkuWithBLOBs tbProductSkuWithBLOBs= tbProductSkuMapper.selectByShopIdAndProductIdAndSpec(shopId,productId,spec_tag); + return Result.success(CodeEnum.SUCCESS,tbProductSkuWithBLOBs); + + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopTableService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopTableService.java new file mode 100644 index 0000000..b172a9b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/ShopTableService.java @@ -0,0 +1,63 @@ +package com.chaozhanggui.system.cashierservice.service; +import com.chaozhanggui.system.cashierservice.annotation.ResultCode; +import com.chaozhanggui.system.cashierservice.dao.TbShopAreaMapper; +import com.chaozhanggui.system.cashierservice.dao.TbShopTableMapper; +import com.chaozhanggui.system.cashierservice.entity.TbShopArea; +import com.chaozhanggui.system.cashierservice.entity.TbShopTable; +import com.chaozhanggui.system.cashierservice.exception.MsgException; +import com.chaozhanggui.system.cashierservice.sign.CodeEnum; +import com.chaozhanggui.system.cashierservice.sign.Result; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author lyf + */ +@Service +public class ShopTableService { + + private final String QRCODEFRONT = "https://kysh.sxczgkj.cn/codeplate?code="; + @Resource + private TbShopTableMapper shopTableMapper; + @Resource + private TbShopAreaMapper shopAreaMapper; + + public Result bindingQrcode(TbShopTable shopTable){ + TbShopTable shopTableId = shopTableMapper.selectByPrimaryKey(shopTable.getId()); + if (shopTableId == null){ + return Result.fail("找不到台桌"); + } + int i = shopTableMapper.updateByPrimaryKeySelective(shopTable); + if (i>0){ + return Result.success(CodeEnum.ENCRYPT); + }else { + return Result.fail("添加失败"); + } + + + } + + public Result tableList(Integer shopId,Integer areaId){ + if (shopId == null){ + return Result.fail("参数有误"); + } + if (areaId == 0){ + areaId =null; + } + List tbShopTablesList = shopTableMapper.selectShopTableById(shopId,areaId); + for (TbShopTable date :tbShopTablesList) { + if (!"".equals(date.getQrcode())){ + date.setQrcode(QRCODEFRONT+date.getQrcode()); + } + } + return Result.success(CodeEnum.ENCRYPT,tbShopTablesList); + } + + + public Result areaList(Integer shopId){ + List tbShopArea = shopAreaMapper.selectByShopId(shopId); + return Result.success(CodeEnum.ENCRYPT,tbShopArea); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/sign/CodeEnum.java b/src/main/java/com/chaozhanggui/system/cashierservice/sign/CodeEnum.java new file mode 100644 index 0000000..b8f92de --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/sign/CodeEnum.java @@ -0,0 +1,78 @@ +package com.chaozhanggui.system.cashierservice.sign; + +public enum CodeEnum { + + //系统编码 + SYS_EXCEPTION("999",false,"系统异常","fail"), + SUCCESS("0",false,"成功","success"), + ENCRYPT("0",true,"成功","success"), + FAIL("1",false,"失败","fail"), + SIGN_FAIL("100013",false,"签名不正确","fail"), + + ORGAN_NO_EXEIST("100010",false,"机构代码不存在或状态异常,请联系服务商","fail"), + ORGAN_NOT_NULL("100014",false,"机构代码不允许为空","fail"), + + MERCHANTNO_NOT_NULL("100015",false,"商户号不允许为空","fail"), + MERCHANT_NOT_NULL("100016",false,"商户进件信息不存在","fail"), + IP_FORBITT("100011",false,"非法的ip访问","fail"), + SIGN_TIMESTAMP_INVALID("100012",false,"签名时间异常","fail"), + + PARAM_ERROR("200001",false,"参数不允许为空","fail"), + ORDER_NO_NULL("200002",false,"订单号不允许为空","fail"), + AMOUNT_ERROR("200003",false,"金额格式错误","fail"), + + ORDER_NO_EXIST("200004",false,"订单号已存在","fail"), + + + ORGAN_NO_EXIST("200005",false,"机构信息错误或状态异常,请联系服务商","fail"), + + CHANNEL_NO_EXIST("200006",false,"支付通道不存在","fail"), + + ORDERINFO_NO_EXIST("200007",false,"订单信息不存在","fail"), + + PAY_TYPE_ERROR("200008",false,"错误的支付类型","fail"), + + WAIT_PAY("300002",false,"用户支付中","wait"), + + + + + WAIT_TRY_AGINA("900000",false,"系统繁忙请稍后重试","wait"), + + + DATA_EMPTY("0",false,"暂无数据","success"), + + + ; + + private String code; + + private String msg; + + private Boolean encrypt; + + private String icon; + + CodeEnum(String code,Boolean encrypt, String msg,String icon) { + this.code = code; + this.encrypt = encrypt; + this.msg = msg; + this.icon = icon; + } + + public String getIcon() { + return icon; + } + + public String getCode() { + return code; + } + + public String getMsg() { + return msg; + } + + public Boolean getEncrypt() { + return encrypt; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/sign/Result.java b/src/main/java/com/chaozhanggui/system/cashierservice/sign/Result.java new file mode 100644 index 0000000..114d58a --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/sign/Result.java @@ -0,0 +1,146 @@ +package com.chaozhanggui.system.cashierservice.sign; + +import cn.hutool.json.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.DESUtil; + +import java.util.List; + +public class Result { + + /** + * 结果详细 + */ + private String msg; + + /** + * 需要传回页面的数据 + */ + private Object data; + + /** + * 状态码 + */ + private String code; + + /** + * 加密 + */ + private boolean encrypt; + + /** + * 图标 + */ + private String icon; + + public boolean isEncrypt() { + return encrypt; + } + + public void setEncrypt(boolean encrypt) { + this.encrypt = encrypt; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public Result() { + + } + + public Result(CodeEnum enums) { + this.msg = enums.getMsg(); + this.encrypt = enums.getEncrypt(); + this.code = enums.getCode(); + this.icon = enums.getIcon(); + } + + public Result(CodeEnum enums,Object data) { + this.msg = enums.getMsg(); + this.encrypt = enums.getEncrypt(); + this.code = enums.getCode(); + this.icon=enums.getIcon(); + if(enums.getEncrypt()){ + this.data= DESUtil.encode(JSONUtil.toJsonStr(data)); + }else{ + this.data=data; + } + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getIcon() { + return icon; + } + + public void setIcon(String icon) { + this.icon = icon; + } + + public static Result success(CodeEnum enums) { + Result dto = new Result(); + dto.setMsg(enums.getMsg()); + dto.setEncrypt(enums.getEncrypt()); + dto.setCode(enums.getCode()); + dto.setIcon(enums.getIcon()); + return dto; + } + + public static Result success(CodeEnum enums,Object data) { + Result dto = new Result(); + dto.setData(data); + dto.setMsg(enums.getMsg()); + dto.setEncrypt(enums.getEncrypt()); + dto.setCode(enums.getCode()); + dto.setIcon(enums.getIcon()); + if(enums.getEncrypt()){ + dto.setData(data); + }else{ + dto.setData(data); + } + return dto; + } + + + public static Result success(CodeEnum enums,List data) { + Result dto = new Result(); + dto.setData(data); + dto.setEncrypt(enums.getEncrypt()); + dto.setCode(enums.getCode()); + dto.setIcon(enums.getIcon()); + if(enums.getEncrypt()){ + dto.setData(data); + }else{ + dto.setData(data); + } + return dto; + } + + + public static Result fail(String msg) { + Result dto = new Result(); + dto.setMsg(msg); + dto.setEncrypt(false); + dto.setCode("1"); + dto.setIcon(CodeEnum.FAIL.getIcon()); + return dto; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/sign/SginAnot.java b/src/main/java/com/chaozhanggui/system/cashierservice/sign/SginAnot.java new file mode 100644 index 0000000..eef987e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/sign/SginAnot.java @@ -0,0 +1,14 @@ +package com.chaozhanggui.system.cashierservice.sign; + + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD}) +@Retention(RetentionPolicy.RUNTIME) +public @interface SginAnot { + + SignEnum type() default SignEnum.ANY;//默认不需要签名 +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/sign/SignEnum.java b/src/main/java/com/chaozhanggui/system/cashierservice/sign/SignEnum.java new file mode 100644 index 0000000..c0bd0e9 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/sign/SignEnum.java @@ -0,0 +1,16 @@ +package com.chaozhanggui.system.cashierservice.sign; + +public enum SignEnum { + + //0不需要签名,1使用MD5数据加密 2 使用SHA数据加密 3 RSA 加密 + ANY(0), MD5(1), SHA1(2),RSA(3); + private final int value; + + private SignEnum(int value) { + this.value = value; + } + + public int getValue() { + return value; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/socket/AppWebSocketServer.java b/src/main/java/com/chaozhanggui/system/cashierservice/socket/AppWebSocketServer.java new file mode 100644 index 0000000..b689660 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/socket/AppWebSocketServer.java @@ -0,0 +1,314 @@ +package com.chaozhanggui.system.cashierservice.socket; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.config.WebSocketCustomEncoding; +import com.chaozhanggui.system.cashierservice.dao.TbShopTableMapper; +import com.chaozhanggui.system.cashierservice.entity.TbCashierCart; +import com.chaozhanggui.system.cashierservice.entity.TbShopTable; +import com.chaozhanggui.system.cashierservice.exception.MsgException; +import com.chaozhanggui.system.cashierservice.rabbit.RabbitProducer; +import com.chaozhanggui.system.cashierservice.redis.RedisCst; +import com.chaozhanggui.system.cashierservice.redis.RedisUtil; +import com.chaozhanggui.system.cashierservice.util.JSONUtil; +import com.chaozhanggui.system.cashierservice.util.SpringUtils; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import javax.websocket.*; +import javax.websocket.server.PathParam; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; +import java.math.BigDecimal; +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; + +@ServerEndpoint(value = "/websocket/table/{tableId}/{shopId}/{userId}", encoders = WebSocketCustomEncoding.class) +@Component +@Slf4j +@Data +public class AppWebSocketServer { + + + @Resource + private RabbitProducer a; + + //注入为空 + public static RabbitProducer rabbitProducer; + + @PostConstruct + public void b() { + rabbitProducer = this.a; + } + + + private RedisUtil redisUtils = SpringUtils.getBean(RedisUtil.class); + private TbShopTableMapper shopTableMapper = SpringUtils.getBean(TbShopTableMapper.class); + /** + * concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。 + */ + //一个 AppWebSocketServer 就是一个用户,一个tableId下有一个 List 也就是多个用户 + private static ConcurrentHashMap> webSocketMap = new ConcurrentHashMap<>(); + public static ConcurrentHashMap> userMap = new ConcurrentHashMap<>(); + private static ConcurrentHashMap userSocketMap = new ConcurrentHashMap<>(); + //购物车的记录,用于第一次扫码的人同步购物车 + private static ConcurrentHashMap> recordMap = new ConcurrentHashMap<>(); + private static ConcurrentHashMap sessionMap = new ConcurrentHashMap<>(); + + /** + * 与某个客户端的连接会话,需要通过它来给客户端发送数据 + */ + private Session session; + + /** + * 接收tableId + */ + private String tableId = ""; + private String shopId = ""; + private String userId = ""; + + /** + * 用来标识这个用户需要接收同步的购物车信息 + */ + private volatile AtomicBoolean sync = new AtomicBoolean(true); + + private volatile AtomicBoolean createOrder = new AtomicBoolean(false); + + + /** + * 连接建立成功调用的方法 + */ + @OnOpen + public void onOpen(Session session, @PathParam("tableId") String tableId, @PathParam("shopId") String shopId, @PathParam("userId") String userId) { + this.session = session; + this.tableId = tableId; + this.shopId = shopId; + this.userId = userId; + try { + TbShopTable shopTable = shopTableMapper.selectQRcode(tableId); + if (Objects.isNull(shopTable)) { + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "fail"); + jsonObject1.put("msg", "桌码不存在"); + jsonObject1.put("type", "addCart"); + jsonObject1.put("data", new ArrayList<>()); + jsonObject1.put("amount", BigDecimal.ZERO); + sendMessage(jsonObject1); + onClose(); + } + if (webSocketMap.containsKey(tableId + "-" + shopId)) { + List serverList = webSocketMap.get(tableId + "-" + shopId); + serverList.add(this); + } else { + List serverList = new ArrayList<>(); + serverList.add(this); + webSocketMap.put(tableId + "-" + shopId, serverList); + } + if (userMap.containsKey(tableId + "-" + shopId)) { + Set userSet = userMap.get(tableId + "-" + shopId); + userSet.add(userId); + } else { + Set userSet = new HashSet<>(); + userSet.add(userId); + userMap.put(tableId + "-" + shopId,userSet); + } + + userSocketMap.put(userId, this); +// sessionMap.put(userId,session); + String mes = redisUtils.getMessage(RedisCst.TABLE_CART.concat(tableId + "-" + shopId)); + if (StringUtils.isEmpty(mes)) { + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "success"); + jsonObject1.put("msg", "成功"); + jsonObject1.put("type", "addCart"); + jsonObject1.put("data", new ArrayList<>()); + jsonObject1.put("amount", BigDecimal.ZERO); + sendMessage(jsonObject1); + } else { + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "success"); + jsonObject1.put("msg", "成功"); + jsonObject1.put("type", "addCart"); + BigDecimal amount = BigDecimal.ZERO; + JSONArray jsonArray = JSON.parseArray(redisUtils.getMessage(RedisCst.TABLE_CART.concat(tableId + "-" + shopId))); + for (int i = 0; i < jsonArray.size(); i++) { + JSONObject object = jsonArray.getJSONObject(i); + amount = amount.add(object.getBigDecimal("totalAmount")); + } + jsonObject1.put("amount", amount); + jsonObject1.put("data", jsonArray); + sendMessage(jsonObject1); + } +// sendMessage(recordMap.get(tableId)); + } catch (IOException e) { + log.error("用户:" + tableId + ",网络异常!!!!!!"); + } + } + + /** + * 连接关闭调用的方法 + */ + @OnClose + public void onClose() { + if (webSocketMap.containsKey(tableId + "-" + shopId)) { + List serverList = webSocketMap.get(tableId + "-" + shopId); + if (serverList.isEmpty()) { + webSocketMap.remove(tableId + "-" + shopId); + } + serverList.remove(this); + + } + if (userMap.containsKey(tableId + "-" + shopId)){ + Set userSet = userMap.get(tableId + "-" + shopId); + if (userSet.isEmpty()){ + userMap.remove(tableId + "-" + shopId); + } + userSet.remove(userId); + } + } + public static void onClosed(String user) throws IOException { + Session session1 = sessionMap.get(user); + session1.close(); + } + /** + * 收到客户端消息后调用的方法 + * + * @param message 客户端发送过来的消息 + */ + @OnMessage + public void onMessage(String message, Session session) { + + System.out.println(message); + //可以群发消息 + //消息保存到数据库、redis + if (StringUtils.isNotBlank(message) && !message.equals("undefined")) { + try { + //解析发送的报文 + JSONObject jsonObject = new JSONObject(); + if (StringUtils.isNotEmpty(message)) { + jsonObject = JSONObject.parseObject(message); + } + //追加发送人(防止串改) + jsonObject.put("tableId", this.tableId); + jsonObject.put("shopId", this.shopId); + + //这里采用责任链模式,每一个处理器对应一个前段发过来的请,这里还可以用工厂模式来生成对象 +// ChangeHandler changeHandler = new ChangeHandler(); +// CreateOrderHandler createOrderHandler = new CreateOrderHandler(); +// SyncHandler syncHandler = new SyncHandler(); +// ClearHandler clearHandler = new ClearHandler(); +// OtherHandler otherHandler = new OtherHandler(); +// +// changeHandler.addNextHandler(syncHandler).addNextHandler(createOrderHandler).addNextHandler(clearHandler).addNextHandler(otherHandler); +// changeHandler.handleRequest(webSocketMap,jsonObject,recordMap,this); + if ("sku".equals(jsonObject.getString("type"))){ + boolean exist = redisUtils.exists(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId").concat("-").concat(shopId))); + Integer num = 0; + if (exist){ + JSONArray array = JSON.parseArray(redisUtils.getMessage(RedisCst.TABLE_CART.concat(jsonObject.getString("tableId").concat("-").concat(shopId)))); + for (int i = 0; i < array.size(); i++) { + JSONObject object = array.getJSONObject(i); + if (object.getString("skuId").equals(jsonObject.getString("skuId"))) { + num = object.getIntValue("totalNumber"); + break; + } + } + } + JSONObject jsonObject1 = new JSONObject(); + jsonObject1.put("status", "success"); + jsonObject1.put("msg", "成功"); + jsonObject1.put("type", "sku"); + jsonObject1.put("data", new ArrayList<>()); + jsonObject1.put("amount", num); + sendMessage(jsonObject1); + }else { + rabbitProducer.putCart(jsonObject.toJSONString()); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + /** + * 发生错误时候 + * + * @param session + * @param error + */ + @OnError + public void onError(Session session, Throwable error) { + log.error("用户错误:" + this.tableId + ",原因:" + error.getMessage()); + error.printStackTrace(); + } + + /** + * 实现服务器主动推送 + */ + public void sendMessage(Object message) throws IOException { + //加入线程锁 + synchronized (session) { + try { + //同步发送信息 + this.session.getBasicRemote().sendObject(message); + } catch (Exception e) { + log.error("服务器推送失败:" + e.getMessage()); + } + } + } + + + /** + * 发送自定义消息 + * */ + /** + * 发送自定义消息 + * + * @param message 发送的信息 + * @param tableId 如果为null默认发送所有 + * @throws IOException + */ + public static void AppSendInfo(Object message, String tableId, boolean userFlag) throws IOException { + if (userFlag) { + if (userSocketMap.containsKey(tableId)) { + AppWebSocketServer server = userSocketMap.get(tableId); + server.sendMessage(message); + } else { + log.error("请求的userId:" + tableId + "不在该服务器上"); + } + } else { + if (StringUtils.isEmpty(tableId)) { + // 向所有用户发送信息 + for (List serverList : webSocketMap.values()) { + for (AppWebSocketServer server : serverList) { + server.sendMessage(message); + } + } + } else if (webSocketMap.containsKey(tableId)) { + // 发送给指定用户信息 + List serverList = webSocketMap.get(tableId); + for (AppWebSocketServer server : serverList) { + server.sendMessage(message); + } + } else { + log.error("请求的tableId:" + tableId + "不在该服务器上"); + } + } + + } + + + public static synchronized ConcurrentHashMap> getWebSocketMap() { + return AppWebSocketServer.webSocketMap; + } + + public static synchronized ConcurrentHashMap> getRecordMap() { + return AppWebSocketServer.recordMap; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/socket/WebSocketConfig.java b/src/main/java/com/chaozhanggui/system/cashierservice/socket/WebSocketConfig.java new file mode 100644 index 0000000..a66a79b --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/socket/WebSocketConfig.java @@ -0,0 +1,27 @@ +package com.chaozhanggui.system.cashierservice.socket; + +import org.springframework.boot.web.servlet.ServletContextInitializer; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.stereotype.Component; +import org.springframework.web.socket.config.annotation.EnableWebSocket; +import org.springframework.web.socket.server.standard.ServerEndpointExporter; + +import javax.servlet.ServletContext; +import javax.servlet.ServletException; + +/** + * WebSocket配置 + */ +@Configuration +public class WebSocketConfig implements ServletContextInitializer { + + @Bean + public ServerEndpointExporter serverEndpointExporter () { + return new ServerEndpointExporter(); + } + @Override + public void onStartup(ServletContext servletContext) throws ServletException { + + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/socket/WebSocketServer.java b/src/main/java/com/chaozhanggui/system/cashierservice/socket/WebSocketServer.java new file mode 100644 index 0000000..66b4d29 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/socket/WebSocketServer.java @@ -0,0 +1,113 @@ +package com.chaozhanggui.system.cashierservice.socket; + +import org.springframework.stereotype.Component; + +import javax.websocket.*; +import javax.websocket.server.ServerEndpoint; +import java.io.IOException; +import java.util.concurrent.CopyOnWriteArraySet; +import java.util.concurrent.atomic.AtomicInteger; + + +@Component +@ServerEndpoint(value = "/ws") +public class WebSocketServer { + + //与某个客户端的连接会话,需要通过它来给客户端发送数据 + private Session session; + + private static final AtomicInteger OnlineCount = new AtomicInteger(0); + + private static CopyOnWriteArraySet SessionSet = new CopyOnWriteArraySet<>(); + + /** + * 连接建立成功调用的方法 + */ + @OnOpen + public void onOpen(Session session) { + SessionSet.add(session); + this.session = session; + int cnt = OnlineCount.incrementAndGet(); // 在线数加1 + System.out.println("有连接加入,当前连接数为:" + cnt); + } + + /** + * 连接关闭调用的方法 + */ + @OnClose + public void onClose() { + SessionSet.remove(this.session); + int cnt = OnlineCount.decrementAndGet(); + System.out.println("有连接关闭,当前连接数为:" + cnt); + } + + /** + * 收到客户端消息后调用的方法 + * @param message 客户端发送过来的消息 + */ + @OnMessage + public void onMessage(String message, Session session) { + System.out.println(message); + BroadCastInfo(message); + } + + /** + * 出现错误 + * @param error + */ + @OnError + public void onError(Throwable error) { + error.printStackTrace(); + } + + + /** + * 发送消息 + * + * @param session + * @param message + */ + public static void SendMessage(Session session, String message) { + try { + if (session.isOpen()) { + session.getBasicRemote().sendText(message); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + + /** + * 群发消息 + * + * @param message + * @throws IOException + */ + public static void BroadCastInfo(String message) { + for (Session session : SessionSet) { + SendMessage(session, message); + } + } + + /** + * 指定Session发送消息 + * + * @param sessionId + * @param message + * @throws IOException + */ + public static void SendMessage(String message, String sessionId) { + Session session = null; + for (Session s : SessionSet) { + if (s.getId().equals(sessionId)) { + session = s; + break; + } + } + if (session != null) { + SendMessage(session, message); + } + } + +} + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/AESUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/AESUtil.java new file mode 100644 index 0000000..ab032ba --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/AESUtil.java @@ -0,0 +1,94 @@ +package com.chaozhanggui.system.cashierservice.util; + + +import org.apache.tomcat.util.codec.binary.Base64; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.security.SecureRandom; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class AESUtil { + //AES:加密方式 CBC:工作模式 PKCS5Padding:填充模式 + private static final String CBC_PKCS5_PADDING = "AES/CBC/PKCS5Padding"; + private static final String AES = "AES"; + public static final String CODE_TYPE = "UTF-8"; // 编码方式 + /* AES 加密操作 + * @param content 待加密内容 + * @param key 加密密钥 + * @return 返回Base64转码后的加密数据 + */ + public static String encrypt(String content, String key,String VIPARA) { + if (content == null || "".equals(content)) { + return content; + } + try { + /* + * 新建一个密码编译器的实例,由三部分构成,用"/"分隔,分别代表如下 + * 1. 加密的类型(如AES,DES,RC2等) + * 2. 模式(AES中包含ECB,CBC,CFB,CTR,CTS等) + * 3. 补码方式(包含nopadding/PKCS5Padding等等) + * 依据这三个参数可以创建很多种加密方式 + */ + Cipher cipher = Cipher.getInstance(CBC_PKCS5_PADDING); + //偏移量 + IvParameterSpec zeroIv = new IvParameterSpec(VIPARA.getBytes(CODE_TYPE)); + byte[] byteContent = content.getBytes(CODE_TYPE); + //使用加密秘钥 + SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(CODE_TYPE), AES); + //SecretKeySpec skeySpec = getSecretKey(key); + cipher.init(Cipher.ENCRYPT_MODE, skeySpec, zeroIv);// 初始化为加密模式的密码器 + byte[] result = cipher.doFinal(byteContent);// 加密 + return Base64.encodeBase64String(result);//通过Base64转码返回 + } catch (Exception ex) { + Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + /* AES 解密操作 + * @param content + * @param key + */ + public static String decrypt(String content, String key,String VIPARA) { + if (content == null || "".equals(content)) { + return content; + } + try { + //实例化 + Cipher cipher = Cipher.getInstance(CBC_PKCS5_PADDING); + IvParameterSpec zeroIv = new IvParameterSpec(VIPARA.getBytes(CODE_TYPE)); + SecretKeySpec skeySpec = new SecretKeySpec(key.getBytes(CODE_TYPE), AES); + //SecretKeySpec skeySpec = getSecretKey(key); + cipher.init(Cipher.DECRYPT_MODE, skeySpec, zeroIv); + byte[] result = cipher.doFinal(Base64.decodeBase64(content)); + return new String(result, CODE_TYPE); + } catch (Exception ex) { + Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + // 生成加密秘钥 + private static SecretKeySpec getSecretKey(final String key) { + //返回生成指定算法密钥生成器的 KeyGenerator 对象 + KeyGenerator kg = null; + try { + kg = KeyGenerator.getInstance(AES); + //AES 要求密钥长度为 128 + kg.init(128, new SecureRandom(key.getBytes())); + //生成一个密钥 + SecretKey secretKey = kg.generateKey(); + return new SecretKeySpec(secretKey.getEncoded(), AES);// 转换为AES专用密钥 + } catch (Exception ex) { + Logger.getLogger(AESUtil.class.getName()).log(Level.SEVERE, null, ex); + } + return null; + } + + public static void main(String[] args){ + System.out.println(decrypt("f9IOB20vHdfjCggHG18OXbRYhPDQAM6EkO0Pppwh6ngXU8mLH6872iivD/sYhzALZ263ab8OSeudRrL/gegm4RUGwXdedE2gL76VMMCbYcsOPlzmj8qjMQQhjlLFVJNSYNoG5A7vFNVKuTXyTnnOaER50yJ2MNeA17SPC3nlHIWoVxrC5TqLMgWoULrdtPX1/nSgw87bXdmICPfIJfwR0w==","0a3pBp100pmmLR1VUZ0001QP500pBp1u","HVkKsTJBeIbQl8pNt17RXw==")); + } +} \ No newline at end of file diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/BeanUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/BeanUtil.java new file mode 100644 index 0000000..c50a17e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/BeanUtil.java @@ -0,0 +1,205 @@ +package com.chaozhanggui.system.cashierservice.util; + +import org.apache.commons.beanutils.BeanUtils; +import org.apache.commons.beanutils.PropertyUtilsBean; +import org.apache.commons.lang3.StringUtils; + +import java.beans.BeanInfo; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.lang.reflect.Field; +import java.lang.reflect.Method; +import java.util.*; +import java.util.Map.Entry; + +public class BeanUtil { + + // Map --> Bean 2: 利用org.apache.commons.beanutils 工具类实现 Map --> Bean + public static void transMap2Bean2(Map map, Object obj) { + if (map == null || obj == null) { + return; + } + try { + BeanUtils.populate(obj, map); + } catch (Exception e) { + System.out.println("transMap2Bean2 Error " + e); + } + } + + // Map --> Bean 1: 利用Introspector,PropertyDescriptor实现 Map --> Bean + public static void transMap2Bean(Map map, Object obj) { + try { + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); + PropertyDescriptor[] propertyDescriptors = beanInfo + .getPropertyDescriptors(); + + for (PropertyDescriptor property : propertyDescriptors) { + String key = property.getName(); + + if (map.containsKey(key)) { + Object value = map.get(key); + // 得到property对应的setter方法 + Method setter = property.getWriteMethod(); + setter.invoke(obj, value); + } + + } + + } catch (Exception e) { + System.out.println("transMap2Bean Error " + e); + } + + return; + + } + + // Bean --> Map 1: 利用Introspector和PropertyDescriptor 将Bean --> Map + public static Map transBean2Map(Object obj) { + if (obj == null) { + return null; + } + Map map = new HashMap(); + try { + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); + for (PropertyDescriptor property : propertyDescriptors) { + String key = property.getName(); + + // 过滤class属性 + if (!key.equals("class")) { + // 得到property对应的getter方法 + Method getter = property.getReadMethod(); + Object value = getter.invoke(obj); + if(null !=value && !"".equals(value)) + map.put(key, value); + } + + } + } catch (Exception e) { + System.out.println("transBean2Map Error " + e); + } + return map; + + } + + + + + + public static LinkedHashMap transBeanMap(Object obj) { + if (obj == null) { + return null; + } + LinkedHashMap map = new LinkedHashMap(); + try { + BeanInfo beanInfo = Introspector.getBeanInfo(obj.getClass()); + PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); + for (PropertyDescriptor property : propertyDescriptors) { + String key = property.getName(); + + // 过滤class属性 + if (!key.equals("class")) { + // 得到property对应的getter方法 + Method getter = property.getReadMethod(); + Object value = getter.invoke(obj); + if(null !=value && !"".equals(value)) + map.put(key, value); + } + + } + } catch (Exception e) { + System.out.println("transBean2Map Error " + e); + } + return map; + + } + + public static String mapOrderStr(Map map) { + List> list = new ArrayList>(map.entrySet()); + Collections.sort(list, new Comparator>() { + public int compare(Entry o1, Entry o2) { + return o1.getKey().compareTo(o2.getKey()); + } + }); + + StringBuilder sb = new StringBuilder(); + for (Entry mapping : list) { + sb.append(mapping.getKey() + "=" + mapping.getValue() + "&"); + } + return sb.substring(0, sb.length() - 1); + } + + /** + * + * 将源的属性复制到目标属性上去 + * @param src + * @param dest + * @lastModified + * @history + */ + public static void copyProperties(Object dest,Object src) { + if (src == null || dest == null) { + return; + } + // 获取所有的get/set 方法对应的属性 + PropertyUtilsBean propertyUtilsBean = new PropertyUtilsBean(); + PropertyDescriptor[] descriptors = propertyUtilsBean.getPropertyDescriptors(src); + + for (int i = 0; i < descriptors.length; i++) { + PropertyDescriptor propItem = descriptors[i]; + // 过滤setclass/getclass属性 + if ("class".equals(propItem.getName())) { + continue; + } + + try { + Method method = propItem.getReadMethod(); + // 通过get方法获取对应的值 + Object val = method.invoke(src); + // 如果是空,不做处理 + if (null == val) { + continue; + } + if(val instanceof String) { + if(StringUtils.isBlank(val.toString())) { + continue; + } + } + // 值复制 + PropertyDescriptor prop = propertyUtilsBean.getPropertyDescriptor(dest, propItem.getName()); + // 调用写方法,设置值 + if (null != prop && prop.getWriteMethod() != null) { + prop.getWriteMethod().invoke(dest, val); + } + } catch (Exception e) { + } + + } + + } + + public static T mapToEntity(Map map, Class entity) { + T t = null; + try { + t = entity.newInstance(); + for(Field field : entity.getDeclaredFields()) { + if (map.containsKey(field.getName())) { + boolean flag = field.isAccessible(); + field.setAccessible(true); + Object object = map.get(field.getName()); + if (object!= null && field.getType().isAssignableFrom(object.getClass())) { + field.set(t, object); + } + field.setAccessible(flag); + } + } + return t; + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return t; + + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/DESUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/DESUtil.java new file mode 100644 index 0000000..1eb651e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/DESUtil.java @@ -0,0 +1,73 @@ +package com.chaozhanggui.system.cashierservice.util; + +import cn.hutool.core.codec.Base64; + +import java.security.Key; + +import javax.crypto.Cipher; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.DESedeKeySpec; +import javax.crypto.spec.IvParameterSpec; + + +public class DESUtil { + + private final static String secretKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwN6xgd6Ad8v2hIIsQVnbt8a3JituR8o4Tc3B5WlcFR55bz4OMqrG/356Ur3cPbc2Fe8ArNd/0gZbC9q56Eb16JTkVNA/fye4SXznWxdyBPR7+guuJZHc/VW2fKH2lfZ2P3Tt0QkKZZoawYOGSMdIvO+WqK44updyax0ikK6JlNQIDAQAB"; + // 向量 + private final static String iv = "ggboy123"; + // 加解密统一使用的编码方式 + private final static String encoding = "utf-8"; + + /** + * @Title: encode + * @Description: TODO(加密) + * @param plainText + * @author gangyu2 + * @date 2018年11月20日下午1:19:19 + */ + public static String encode(String plainText){ + Key deskey = null; + DESedeKeySpec spec; + try { + spec = new DESedeKeySpec(secretKey.getBytes()); + SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("desede"); + deskey = keyfactory.generateSecret(spec); + + Cipher cipher = Cipher.getInstance("desede/CBC/PKCS5Padding"); + IvParameterSpec ips = new IvParameterSpec(iv.getBytes()); + cipher.init(Cipher.ENCRYPT_MODE, deskey, ips); + byte[] encryptData = cipher.doFinal(plainText.getBytes(encoding)); + return Base64.encode(encryptData); + } catch (Exception e) { + e.printStackTrace(); + return ""; + } + } + + /** + * @Title: decode + * @Description: TODO(解密) + * @param encryptText + * @author gangyu2 + * @date 2018年11月20日下午1:19:37 + */ + public static String decode(String encryptText){ + try{ + + Key deskey = null; + DESedeKeySpec spec = new DESedeKeySpec(secretKey.getBytes()); + SecretKeyFactory keyfactory = SecretKeyFactory.getInstance("desede"); + deskey = keyfactory.generateSecret(spec); + Cipher cipher = Cipher.getInstance("desede/CBC/PKCS5Padding"); + IvParameterSpec ips = new IvParameterSpec(iv.getBytes()); + cipher.init(Cipher.DECRYPT_MODE, deskey, ips); + + byte[] decryptData = cipher.doFinal(Base64.decode(encryptText)); + + return new String(decryptData, encoding); + }catch(Exception e){ + e.printStackTrace(); + return ""; + } + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/DateUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/DateUtils.java new file mode 100644 index 0000000..040b90e --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/DateUtils.java @@ -0,0 +1,355 @@ +package com.chaozhanggui.system.cashierservice.util; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * Created by SEELE on 2018/4/19. + */ +public class DateUtils { + + private final static SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy"); + private final static SimpleDateFormat sdfDay = new SimpleDateFormat("yyyy-MM-dd"); + private final static SimpleDateFormat sdfDays = new SimpleDateFormat("yyyyMMdd"); + private final static SimpleDateFormat sdfTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + private final static SimpleDateFormat sdfTimeSS = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); + private final static SimpleDateFormat sdfTimes = new SimpleDateFormat("yyyyMMddHHmmss"); + + private final static SimpleDateFormat sdfday = new SimpleDateFormat("MM-dd HH:mm"); + + + public static Date getNewDate(Date date, Integer type, Integer interval) throws ParseException { + Calendar c = Calendar.getInstance(); + c.setTime(date); + switch (type) { + case 1: + c.set(Calendar.YEAR, (c.get(Calendar.YEAR) + interval)); + break; + case 2: + c.set(Calendar.MONTH, (c.get(Calendar.MONTH) + interval)); + break; + case 3: + c.set(Calendar.DATE, (c.get(Calendar.DATE) + interval)); + break; + case 4: + c.set(Calendar.HOUR, (c.get(Calendar.HOUR) + interval)); + break; + case 5: + c.set(Calendar.MINUTE, (c.get(Calendar.MINUTE) + interval)); + break; + default: + c.set(Calendar.SECOND, (c.get(Calendar.SECOND) + interval)); + break; + } + Date newDate = c.getTime(); + return sdfTime.parse(sdfTime.format(newDate)); + } + + + + public static String getTimes(Date date){ + return sdfday.format(date); + } + + + /** + * 获取YYYY格式 + * @return + */ + public static String getSdfTimes() { + return sdfTimes.format(new Date()); + } + + + public static String getNextSdfTimes(Date date){ + return sdfTimes.format(date); + } + + /** + * 获取YYYY格式 + * @return + */ + public static String getYear() { + return sdfYear.format(new Date()); + } + + /** + * 获取YYYY-MM-DD格式 + * @return + */ + public static String getDay() { + return sdfDay.format(new Date()); + } + + /** + * 获取YYYYMMDD格式 + * @return + */ + public static String getDays(){ + return sdfDays.format(new Date()); + } + + /** + * 获取YYYY-MM-DD HH:mm:ss格式 + * @return + */ + public static String getTime() { + return sdfTime.format(new Date()); + } + + /** + * @Title: compareDate + * @Description: TODO(日期比较,如果s>=e 返回true 否则返回false) + * @param s + * @param e + * @return boolean + * @throws + * @author fh + */ + public static boolean compareDate(String s, String e) { + if(fomatDate(s)==null||fomatDate(e)==null){ + return false; + } + return fomatDate(s).getTime() >=fomatDate(e).getTime(); + } + + /** + * 格式化日期 + * @return + */ + public static Date fomatDate(String date) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + try { + return fmt.parse(date); + } catch (ParseException e) { + e.printStackTrace(); + return null; + } + } + + /** + * 校验日期是否合法 + * @return + */ + public static boolean isValidDate(String s) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + try { + fmt.parse(s); + return true; + } catch (Exception e) { + // 如果throw java.text.ParseException或者NullPointerException,就说明格式不对 + return false; + } + } + + /** + * @param startTime + * @param endTime + * @return + */ + public static int getDiffYear(String startTime,String endTime) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd"); + try { + //long aa=0; + int years=(int) (((fmt.parse(endTime).getTime()-fmt.parse(startTime).getTime())/ (1000 * 60 * 60 * 24))/365); + return years; + } catch (Exception e) { + // 如果throw java.text.ParseException或者NullPointerException,就说明格式不对 + return 0; + } + } + + /** + *
  • 功能描述:时间相减得到天数 + * @param beginDateStr + * @param endDateStr + * @return + * long + * @author Administrator + */ + public static long getDaySub(String beginDateStr,String endDateStr){ + long day=0; + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); + Date beginDate = null; + Date endDate = null; + + try { + beginDate = format.parse(beginDateStr); + endDate= format.parse(endDateStr); + } catch (ParseException e) { + e.printStackTrace(); + } + day=(endDate.getTime()-beginDate.getTime())/(24*60*60*1000); + //System.out.println("相隔的天数="+day); + + return day; + } + + /** + * 得到n天之后的日期 + * @param days + * @return + */ + public static String getAfterDayDate(String days) { + int daysInt = Integer.parseInt(days); + + Calendar canlendar = Calendar.getInstance(); // java.util包 + canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动 + Date date = canlendar.getTime(); + + SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateStr = sdfd.format(date); + + return dateStr; + } + /** + * 得到n天之后的日期 + * @param days + * @return + */ + public static String getAfterDate(Date openDate,String days) { + int daysInt = Integer.parseInt(days); + + Calendar canlendar = Calendar.getInstance(); // java.util包 + canlendar.setTime(openDate); + canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动 + Date date = canlendar.getTime(); + SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateStr = sdfd.format(date); + return dateStr; + } + public static String getAfterDate1(Date openDate,String year) { + int daysInt = Integer.parseInt(year); + + Calendar canlendar = Calendar.getInstance(); // java.util包 + canlendar.setTime(openDate); + canlendar.add(Calendar.YEAR, daysInt); // 日期减 如果不够减会将月变动 + Date date = canlendar.getTime(); + SimpleDateFormat sdfd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String dateStr = sdfd.format(date); + return dateStr; + } + public static Date getAfterDateStr(Date openDate,String days) { + int daysInt = Integer.parseInt(days); + + Calendar canlendar = Calendar.getInstance(); // java.util包 + canlendar.setTime(openDate); + canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动 + Date date = canlendar.getTime(); + return date; + } + + /** + * 得到n天之后是周几 + * @param days + * @return + */ + public static String getAfterDayWeek(String days) { + int daysInt = Integer.parseInt(days); + Calendar canlendar = Calendar.getInstance(); // java.util包 + canlendar.add(Calendar.DATE, daysInt); // 日期减 如果不够减会将月变动 + Date date = canlendar.getTime(); + SimpleDateFormat sdf = new SimpleDateFormat("E"); + String dateStr = sdf.format(date); + return dateStr; + } + + public static void main(String[] args) { + System.out.println(getTime()); + } + + /** + * 格式化日期为时分秒 + * @param date + * @return + */ + public static Date fomatDateTime(String date) { + DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + try { + return fmt.parse(date); + } catch (ParseException e) { + e.printStackTrace(); + return null; + } + } + + + + public static Date fomatDateTime1(String date) { + DateFormat fmt = new SimpleDateFormat("yyyyMMddHHmmss"); + try { + return fmt.parse(date); + } catch (ParseException e) { + e.printStackTrace(); + return null; + } + } + + + public static java.util.Date parse(String dateString, String dateFormat) { + if ("".equals(dateString.trim()) || dateString == null) { + return null; + } + DateFormat sdf = new SimpleDateFormat(dateFormat); + Date date = null; + try { + date = sdf.parse(dateString); + + } catch (Exception e) { + e.printStackTrace(); + } + + return date; + } + + + private final static SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); + public static Date convertDate(String date) { + try { + return sdf.parse(date); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + private final static SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + public static Date convertDateByString(String str){ + StringBuilder sb=new StringBuilder(); + sb.append(str.substring(0,4)); + sb.append("-"); + sb.append(str.substring(4,6)); + sb.append("-"); + sb.append(str.substring(6,8)); + sb.append(" "); + sb.append(str.substring(8,10)); + sb.append(":"); + sb.append(str.substring(10,12)); + sb.append(":"); + sb.append(str.substring(12,14)); + + return convertDate1(sb.toString()); + } + + public static Date convertDate1(String date) { + try { + return sdf1.parse(date); + } catch (ParseException e) { + throw new RuntimeException(e); + } + } + + + public static String getTime(Date date) { + return sdfTime.format(date); + } + + + public static String formatDateToStr(Date date) { + return sdfTime.format(date); + } + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/FeieyunPrintUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/FeieyunPrintUtil.java new file mode 100644 index 0000000..17ba159 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/FeieyunPrintUtil.java @@ -0,0 +1,145 @@ +package com.chaozhanggui.system.cashierservice.util; + + +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.config.RequestConfig; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +public class FeieyunPrintUtil { + + public static final String URL = "http://api.feieyun.cn/Api/Open/";//不需要修改 + + public static final String USER = "chaozhanggui2022@163.com";//*必填*:账号名 + public static final String UKEY = "UfWkhXxSkeSSscsU";//*必填*: 飞鹅云后台注册账号后生成的UKEY 【备注:这不是填打印机的KEY】 + public static final String SN = "960238952";//*必填*:打印机编号,必须要在管理后台里添加打印机或调用API接口添加之后,才能调用API + + + + public static String printLabelMsg(String sn,String masterId,String productName,Integer number,String date,String money,String remark){ + + StringBuffer sb=new StringBuffer(); + sb.append("1"); + sb.append(""); + sb.append(masterId); + char paddingCharacter = ' '; + sb.append(""); + sb.append(productName); + sb.append(" "); + sb.append(number); + sb.append(""); + sb.append(remark); + + sb.append(""); + sb.append(date); + sb.append(" "); + sb.append("¥"); + sb.append(money); + + String content=sb.toString(); + + System.out.println("yxprint 打印请求参数:"+content); + + //通过POST请求,发送打印信息到服务器 + RequestConfig requestConfig = RequestConfig.custom() + .setSocketTimeout(30000)//读取超时 + .setConnectTimeout(30000)//连接超时 + .build(); + + CloseableHttpClient httpClient = HttpClients.custom() + .setDefaultRequestConfig(requestConfig) + .build(); + + HttpPost post = new HttpPost(URL); + List nvps = new ArrayList(); + nvps.add(new BasicNameValuePair("user",USER)); + String STIME = String.valueOf(System.currentTimeMillis()/1000); + nvps.add(new BasicNameValuePair("stime",STIME)); + nvps.add(new BasicNameValuePair("sig",signature(USER,UKEY,STIME))); + nvps.add(new BasicNameValuePair("apiname","Open_printLabelMsg"));//固定值,不需要修改 + nvps.add(new BasicNameValuePair("sn",sn)); + nvps.add(new BasicNameValuePair("content",content)); + nvps.add(new BasicNameValuePair("times","1"));//打印联数 + + CloseableHttpResponse response = null; + String result = null; + try + { + post.setEntity(new UrlEncodedFormEntity(nvps,"utf-8")); + response = httpClient.execute(post); + int statecode = response.getStatusLine().getStatusCode(); + if(statecode == 200){ + HttpEntity httpentity = response.getEntity(); + if (httpentity != null){ + //服务器返回的JSON字符串,建议要当做日志记录起来 + result = EntityUtils.toString(httpentity); + } + } + } + catch (Exception e) + { + e.printStackTrace(); + } + finally{ + try { + if(response!=null){ + response.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + try { + post.abort(); + } catch (Exception e) { + e.printStackTrace(); + } + try { + httpClient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return result; + + } + + + + public static int getProducrName(String str){ + int count = 0; + int digitCount=0; + for (int i=0;i='a' && str.charAt(i)<='z') || (str.charAt(i)>='A' && str.charAt(i)<='Z')){ + count++; + } + + if (Character.isDigit(str.charAt(i))) { + digitCount++; + } + } + return count+digitCount; + } + + private static String signature(String USER,String UKEY,String STIME){ + String s = DigestUtils.sha1Hex(USER+UKEY+STIME); + return s; + } + + + public static void main(String[] args){ + printLabelMsg("960238952","#A9","甜橙马黛茶",5,"03-11 15:21","90","加糖"); + } + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/HttpClientUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/HttpClientUtil.java new file mode 100644 index 0000000..f3123d2 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/HttpClientUtil.java @@ -0,0 +1,134 @@ +package com.chaozhanggui.system.cashierservice.util; + +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; + +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +public class HttpClientUtil { + + + public static String doGet(String url, Map param) { + + // 创建Httpclient对象 + CloseableHttpClient httpclient = HttpClients.createDefault(); + + String resultString = ""; + CloseableHttpResponse response = null; + try { + // 创建uri + URIBuilder builder = new URIBuilder(url); + if (param != null) { + for (String key : param.keySet()) { + builder.addParameter(key, param.get(key)); + } + } + URI uri = builder.build(); + + // 创建http GET请求 + HttpGet httpGet = new HttpGet(uri); + + // 执行请求 + response = httpclient.execute(httpGet); + // 判断返回状态是否为200 + if (response.getStatusLine().getStatusCode() == 200) { + resultString = EntityUtils.toString(response.getEntity(), "UTF-8"); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + if (response != null) { + response.close(); + } + httpclient.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return resultString; + } + + public static String doGet(String url) { + return doGet(url, null); + } + + public static String doPost(String url, Map param) { + // 创建Httpclient对象 + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse response = null; + String resultString = ""; + try { + // 创建Http Post请求 + HttpPost httpPost = new HttpPost(url); + // 创建参数列表 + if (param != null) { + List paramList = new ArrayList<>(); + for (String key : param.keySet()) { + paramList.add(new BasicNameValuePair(key, param.get(key))); + } + // 模拟表单 + UrlEncodedFormEntity entity = new UrlEncodedFormEntity(paramList); + httpPost.setEntity(entity); + } + // 执行http请求 + response = httpClient.execute(httpPost); + resultString = EntityUtils.toString(response.getEntity(), "utf-8"); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + response.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + return resultString; + } + + public static String doPost(String url) { + return doPost(url, null); + } + + public static String doPostJson(String url, String json) { + // 创建Httpclient对象 + CloseableHttpClient httpClient = HttpClients.createDefault(); + CloseableHttpResponse response = null; + String resultString = ""; + try { + // 创建Http Post请求 + HttpPost httpPost = new HttpPost(url); + // 创建请求内容 + StringEntity entity = new StringEntity(json, ContentType.APPLICATION_JSON); + httpPost.setEntity(entity); + // 执行http请求 + response = httpClient.execute(httpPost); + resultString = EntityUtils.toString(response.getEntity(), "utf-8"); + } catch (Exception e) { + e.printStackTrace(); + } finally { + try { + response.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + return resultString; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/IpUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/IpUtil.java new file mode 100644 index 0000000..4d0a44c --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/IpUtil.java @@ -0,0 +1,80 @@ +package com.chaozhanggui.system.cashierservice.util; + +import javax.servlet.http.HttpServletRequest; +import java.net.InetAddress; +import java.net.UnknownHostException; + +/** + * @title: IpUtil + * @Description TODO + * @Author sixic + * @Date 2022/11/9 16:00 + */ +public class IpUtil { + + private static final String UNKNOWN = "unknown"; + private static final String LOCALHOST = "127.0.0.1"; + private static final String SEPARATOR = ","; + + public static String getIpAddr(HttpServletRequest request) { + System.out.println(request); + String ipAddress; + try { + ipAddress = request.getHeader("x-forwarded-for"); + if (ipAddress == null || ipAddress.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddress)) { + ipAddress = request.getHeader("Proxy-Client-IP"); + } + if (ipAddress == null || ipAddress.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddress)) { + ipAddress = request.getHeader("WL-Proxy-Client-IP"); + } + if (ipAddress == null || ipAddress.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddress)) { + ipAddress = request.getRemoteAddr(); + if (LOCALHOST.equals(ipAddress)) { + InetAddress inet = null; + try { + inet = InetAddress.getLocalHost(); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + ipAddress = inet.getHostAddress(); + } + } + // 对于通过多个代理的情况,第一个IP为客户端真实IP,多个IP按照','分割 + // "***.***.***.***".length() + if (ipAddress != null && ipAddress.length() > 15) { + if (ipAddress.indexOf(SEPARATOR) > 0) { + ipAddress = ipAddress.substring(0, ipAddress.indexOf(",")); + } + } + } catch (Exception e) { + ipAddress = ""; + } + return ipAddress; + } + + /** + * 获取ip地址 + * + * @param request + * @return + */ + public static String getIpAddr2(HttpServletRequest request) { + String ip = request.getHeader("X-Real-IP"); + if (ip != null && !"".equals(ip) && !"unknown".equalsIgnoreCase(ip)) { + return ip; + } + ip = request.getHeader("X-Forwarded-For"); + if (ip != null && !"".equals(ip) && !"unknown".equalsIgnoreCase(ip)) { + int index = ip.indexOf(','); + if (index != -1) { + return ip.substring(0, index); + } else { + return ip; + } + } else { + return request.getRemoteAddr(); + } + } + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/JSONUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/JSONUtil.java new file mode 100644 index 0000000..ad6e684 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/JSONUtil.java @@ -0,0 +1,210 @@ +package com.chaozhanggui.system.cashierservice.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.serializer.SerializeConfig; +import com.alibaba.fastjson.serializer.SerializerFeature; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author Stone + * @version V1.0.0 + * @date 2020/2/12 + */ +public class JSONUtil { + + + /** + * 将对象转为JSON字符串 + * + * @param obj 被转的对象 + * @param dateFormat 日期格式,当传null或空串时,则被格式化为时间戳,否则返回指定的格式。例子:yyyy-MM-dd HH:mm:ss(不合法的日期格式会格式化出错) + * @param ignoreNull 是否忽略null字段。true时,且当字段的值是null,则不输出该字段 + * @param noRef 是否不转换成ref。例如false,当字段间是相同的引用之时,则将出现$ref之类的符号替代冗余的值 + * @param pretty 是否格式化JSON字符串以便有更好的可读性 + * @return JSON字符串,出异常时抛出 + */ + public static String toJSONString0(Object obj, + String dateFormat, + boolean ignoreNull, + boolean noRef, + boolean pretty) { + try { + List featureList = new ArrayList<>(); + + // 当传null时,则返回默认的时间戳,否则则返回指定的格式 + if (dateFormat != null && dateFormat.length() > 0) { + featureList.add(SerializerFeature.WriteDateUseDateFormat); + } + if (!ignoreNull) { + // 当字段的值是null时,依然出现这个字段,即不忽略 + featureList.add(SerializerFeature.WriteMapNullValue); + } + if (noRef) { + featureList.add(SerializerFeature.DisableCircularReferenceDetect); + } + if (pretty) { + featureList.add(SerializerFeature.PrettyFormat); + } + + SerializerFeature[] featureArr = featureList.toArray(new SerializerFeature[featureList.size()]); + return JSONObject.toJSONString(obj, SerializeConfig.globalInstance, null, dateFormat, + JSON.DEFAULT_GENERATE_FEATURE, featureArr); + } catch (Exception e) { + throw new RuntimeException("Convert object to JSON string, error[" + obj + "]", e); + } + } + + /** + * 将对象转为JSON字符串。 + * 日期转为特别的格式,不忽略null值的字段,不格式化JSON字符串 + * + * @param obj 被转换的对象 + * @return JSON字符串,发送异常时抛出 + */ + public static String toJSONString(Object obj) { + return toJSONString0(obj, "yyyy-MM-dd HH:mm:ss", false, true, false); + } + + /** + * 将对象转为JSON字符串。不抛出异常,专用于日志打印 + * + * @param obj 被转换的对象 + * @return JSON字符串,出异常时返回null + */ + public static String toJSONStringNoThrows(Object obj) { + try { + return toJSONString0(obj, "yyyy-MM-dd HH:mm:ss", false, true, false); + } catch (Exception e) { + logError(e); + return null; + } + } + + /** + * 解析JSON字符串成为一个Object,结果可能是JSONArray(多个)或JSONObject(单个) + * (该方法可用于对json字符串不知道是对象还是列表的时候之用) + * (假设json字符串多了某个字段,可能是新加上去的,显然转换成JSONEntity会有这个字段) + * + * @param jsonStr 要解析的JSON字符串 + * @return 返回JSONEntity,当jsonArrayFlag 为true,表示它是 JSONArray,否则是JSONObject + */ + public static JSONEntity parseJSONStr2JSONEntity(String jsonStr) { + try { + Object value = JSON.parse(jsonStr); + boolean jsonArrayFlag = false; + if (value instanceof JSONArray) { + jsonArrayFlag = true; + } + return new JSONEntity(jsonArrayFlag, value); + } catch (Exception e) { + throw new RuntimeException("Invalid jsonStr,parse error:" + jsonStr, e); + } + } + + /** + * 字符串转为JSON对象,注意数组类型会抛异常[{name:\"Stone\"}] + * (假设json字符串多了某个字段,可能是新加上去的,显然转换成JSONObject时会有这个字段,因为JSONObject就相当于map) + * + * @param jsonStr 传入的JSON字串 + * @return 返回转换结果。传入的JSON字串必须是对象而非数组,否则会抛出异常 + * @author Stone + */ + public static JSONObject parseJSONStr2JSONObject(String jsonStr) { + try { + return (JSONObject) JSONObject.parse(jsonStr); + } catch (Exception e) { + throw new RuntimeException("Invalid jsonStr,parse error:" + jsonStr, e); + } + } + + /** + * 字符串转为JSON数组,注意对象类型,非数组的会抛异常{name:\"Stone\"} + * (假设json字符串多了某个字段,可能是新加上去的,显然转换成JSONArray时,其元素会有这个字段,因为JSONArray的元素JSONObject就相当于map) + * + * @param jsonStr 传入的JSON字串 + * @return 返回转换结果。当传入的JSON字串是非数组形式时,会抛出异常 + * @author Stone + */ + public static JSONArray parseJSONStr2JSONArray(String jsonStr) { + try { + return (JSONArray) JSONArray.parse(jsonStr); + } catch (Exception e) { + throw new RuntimeException("Invalid jsonStr,parse error:" + jsonStr, e); + } + } + + /** + * 字符串转为某个类 + * (日期字段不管是时间戳形式还是yyyy-MM-dd HH:mm:ss的形式都能成功转换) + * (假设json字符串多了某个字段,可能是新加上去的,T类没有,转换成T对象的时候,不会抛出异常) + * + * @param jsonStr 传入的JSON字串 + * @param clazz 转为什么类型 + * @return 返回转换结果。当传入的JSON字串是数组形式时,会抛出异常 + * @author Stone + */ + public static T parseJSONStr2T(String jsonStr, Class clazz) { + try { + return JSONObject.parseObject(jsonStr, clazz); + } catch (Exception e) { + throw new RuntimeException("Invalid jsonStr,parse error:" + jsonStr, e); + } + } + + /** + * 字符串转为某个类的列表 + * (日期字段不管是时间戳形式还是yyyy-MM-dd HH:mm:ss的形式都能成功转换) + * (假设json字符串多了某个字段,可能是新加上去的,T类没有,转换成T对象的时候,不会抛出异常) + * + * @param jsonStr 传入的JSON字串 + * @param clazz List里装的元素的类型 + * @return 返回转换结果。当传入的JSON字串是非数组的形式时会抛出异常 + * @author Stone + */ + public static List parseJSONStr2TList(String jsonStr, Class clazz) { + try { + return JSONObject.parseArray(jsonStr, clazz); + } catch (Exception e) { + throw new RuntimeException("Invalid jsonStr,parse error:" + jsonStr, e); + } + } + + public static class JSONEntity { + public JSONEntity() { + } + + public JSONEntity(boolean jsonArrayFlag, Object value) { + this.jsonArrayFlag = jsonArrayFlag; + this.value = value; + } + + private boolean jsonArrayFlag; + private Object value; + + public boolean getJsonArrayFlag() { + return jsonArrayFlag; + } + + public Object getValue() { + return value; + } + + @Override + public String toString() { + return "JSONEntity{" + + "jsonArrayFlag=" + jsonArrayFlag + + ", value=" + value + + '}'; + } + } + + private static void logError(Exception e) { + e.printStackTrace(); + } +} + + diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/MD5Util.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/MD5Util.java new file mode 100644 index 0000000..a7b3b65 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/MD5Util.java @@ -0,0 +1,158 @@ +package com.chaozhanggui.system.cashierservice.util; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.json.JSONUtil; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.Map; + +public class MD5Util { + + + private static final Logger log = LoggerFactory.getLogger(MD5Util.class); + + private static final String hexDigIts[] = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"}; + + public static String encrypt(String plainText) { + try { + return encrypt(plainText,true); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + log.error("MD5加密异常:",e); + return null; + } + } + + /** + * @Title: encrypt + * @Description: TODO(16位或32位密码) + * @param @param + * plainText + * @param @param + * flag true为32位,false为16位 + * @throws UnsupportedEncodingException + */ + public static String encrypt(String plainText, boolean flag) throws UnsupportedEncodingException { + try { + if (ObjectUtil.isEmpty(plainText)) { + return null; + } + MessageDigest md = MessageDigest.getInstance("MD5"); + String encrStr = byteArrayToHexString(md.digest(plainText.getBytes("UTF-8"))); + if (flag) + return encrStr; + else + return encrStr.substring(8, 24); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + return null; + } + + } + + @SuppressWarnings("unchecked") + public static String encrypt(Object obj,String privateKey){ + if(obj==null){ + return null; + } + Map map = new HashMap(); + if(obj instanceof Map){ + map=(Map) obj; + }else{ + map = BeanUtil.transBean2Map(obj); + } + return encrypt(map,privateKey,true); + } + + /** + * @Title: encrypt + * @Description: TODO(16位或32位密码) + * @param @param + * plainText + * @param @param + * flag true为32位,false为16位 + * @throws UnsupportedEncodingException + */ + public static String encrypt(Map map, String privateKey,boolean flag) { + String param = null; + map.remove("sign"); + map.remove("encrypt"); + String result = BeanUtil.mapOrderStr(map); + if (StringUtils.isEmpty(result)) { + return null; + } + param = encrypt(encrypt(result)+privateKey); + if (flag) { + return param; + } else { + param = param.substring(8, 24); + } + return param; + } + + public static Map resultMap = new HashMap(); + @SuppressWarnings("unchecked") + public static Map mapFn(Map map) { + for (String key : map.keySet()) { + if (map.get(key) != null && map.get(key) != "" && (!key.equals("BTYPE") && !key.equals("SIGN"))) { + if (key.equals("INPUT")) { + if (map.get(key) != null) { + mapFn((Map) map.get(key)); + } + } else { + resultMap.put(key, map.get(key)); + } + } + } + return resultMap; + } + + @SuppressWarnings("unchecked") + public static boolean check(Object obj,String privateKey){ + Map map=new HashMap(); + if(obj==null){ + return false; + } + if(obj instanceof Map){ + map=(Map) obj; + }else{ + map = BeanUtil.transBean2Map(obj); + } + System.out.println("check:"+ JSONUtil.toJsonStr(map)); + String sign=(String)map.get("sign"); + if(sign==null){ + return false; + } + String str=encrypt(obj,privateKey); + System.out.println("check: "+str); + + return sign.equals(str)?true:false; + } + + public static String byteArrayToHexString(byte b[]){ + StringBuffer resultSb = new StringBuffer(); + for(int i = 0; i < b.length; i++){ + resultSb.append(byteToHexString(b[i])); + } + return resultSb.toString(); + } + + public static String byteToHexString(byte b){ + int n = b; + if(n < 0){ + n += 256; + } + int d1 = n / 16; + int d2 = n % 16; + return hexDigIts[d1] + hexDigIts[d2]; + } + + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/MD5Utils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/MD5Utils.java new file mode 100644 index 0000000..28feaed --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/MD5Utils.java @@ -0,0 +1,83 @@ +package com.chaozhanggui.system.cashierservice.util; + +import java.security.MessageDigest; + +public class MD5Utils { + private static String byteArrayToHexString(byte b[]) { + StringBuffer resultSb = new StringBuffer(); + for (int i = 0; i < b.length; i++) + resultSb.append(byteToHexString(b[i])); + + return resultSb.toString(); + } + + private static String byteToHexString(byte b) { + int n = b; + if (n < 0) + n += 256; + int d1 = n / 16; + int d2 = n % 16; + return hexDigits[d1] + hexDigits[d2]; + } + + public static String MD5Encode(String origin, String charsetname) { + String resultString = null; + try { + resultString = origin; + MessageDigest md = MessageDigest.getInstance("MD5"); + if (charsetname == null || "".equals(charsetname)) + resultString = byteArrayToHexString(md.digest(resultString + .getBytes())); + else + resultString = byteArrayToHexString(md.digest(resultString + .getBytes(charsetname))); + } catch (Exception exception) { + } + return resultString; + } + + private static final String hexDigits[] = { "0", "1", "2", "3", "4", "5", + "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" }; + + /** + * MD5指纹算法 + * + * @param str + * @return + */ + public static String md5(String str) { + if (str == null) { + return null; + } + + try { + MessageDigest messageDigest = MessageDigest.getInstance("MD5"); + messageDigest.update(str.getBytes()); + return bytesToHexString(messageDigest.digest()); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + /** + * 将二进制转换成16进制 + * + * @param src + * @return + */ + public static String bytesToHexString(byte[] src) { + StringBuilder stringBuilder = new StringBuilder(""); + if (src == null || src.length <= 0) { + return null; + } + for (int i = 0; i < src.length; i++) { + int v = src[i] & 0xFF; + String hv = Integer.toHexString(v); + if (hv.length() < 2) { + stringBuilder.append(0); + } + stringBuilder.append(hv); + } + return stringBuilder.toString(); + } + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/N.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/N.java new file mode 100644 index 0000000..6076fc4 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/N.java @@ -0,0 +1,57 @@ +package com.chaozhanggui.system.cashierservice.util; + +import java.math.BigDecimal; + + +// 如果第一个参数与第二个参数相等返回0。 +// 如果第一个参数小于第二个参数返回 -1。 +// 如果第一个参数大于第二个参数返回 1。 +public class N { + + public static final int SCALE = 2; + + public static final boolean isZero(BigDecimal num) { + return num == null || BigDecimal.ZERO.compareTo(num) == 0; + } + + public static final boolean isNull(BigDecimal num) { + return num == null; + } + + + public static final boolean eq(BigDecimal n1, BigDecimal n2) { + return (!isNull(n1) && !isNull(n2) && n1.compareTo(n2) == 0);//n1==n2 + } + + public static final boolean gt(BigDecimal n1, BigDecimal n2) { + return (!isNull(n1) && !isNull(n2) && n1.compareTo(n2) > 0);//n1>n2 + } + + public static final boolean egt(BigDecimal n1, BigDecimal n2) { + return (!isNull(n1) && !isNull(n2) && n1.compareTo(n2) >= 0); + } + + + public static final BigDecimal mul(BigDecimal b1, BigDecimal b2) { + if (isNull(b1) || isNull(b2)) { + throw new IllegalArgumentException(); + } + + return b1.multiply(b2).setScale(SCALE, BigDecimal.ROUND_HALF_UP); + } + + + public static final BigDecimal div(BigDecimal b1, BigDecimal b2) { + if (isNull(b1) || isZero(b2)) { + throw new IllegalArgumentException(); + } + + return b1.divide(b2, SCALE, BigDecimal.ROUND_HALF_UP); + } + +// public static void main(String[] args){ +// System.out.println(N.mul(new BigDecimal(0.6),BigDecimal.ONE)); +// } + + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java new file mode 100644 index 0000000..ffab9ab --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/PrinterUtils.java @@ -0,0 +1,225 @@ +package com.chaozhanggui.system.cashierservice.util; + +import cn.hutool.core.util.ObjectUtil; +import com.chaozhanggui.system.cashierservice.model.OrderDetailPO; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.util.LinkedMultiValueMap; +import org.springframework.util.MultiValueMap; +import org.springframework.web.client.RestTemplate; + +import java.util.*; + +/** + * 打印机 + */ +public class PrinterUtils { + //请求地址 + private static final String URL_STR = "https://ioe.car900.com/v1/openApi/dev/customPrint.json"; + //APPID + private static final String APP_ID = "ZF544"; + //USERCODE + private static final String USER_CODE = "ZF544"; + //APPSECRET + private static final String APP_SECRET = "2022bsjZF544GAH"; + + /** + * 获取TOKEN值 + * @param timestamp 时间戳,13位 + * @param requestId 请求ID,自定义 + * @return + */ + private static Map getToken(String timestamp, String requestId) { + String token = ""; + String encode = ""; + SortedMap map = new TreeMap(); + map.put("appId", APP_ID); + map.put("timestamp", timestamp); + map.put("requestId", requestId); + map.put("userCode", USER_CODE); + Iterator> iterator = map.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry next = iterator.next(); + String key = next.getKey(); + Object value = next.getValue(); + token += key + value; + encode += key + "=" + value + "&"; + } + System.out.println("token"+token); + Map finalMap = new HashMap<>(); + finalMap.put("ENCODE",encode); + System.out.println("+++++++++++++++"+token + APP_SECRET); + finalMap.put("TOKEN", MD5Util.encrypt(token + APP_SECRET).toUpperCase()); + return finalMap; + } + + + /** + * 厨房打印机 + * @param pickupNumber + * @param date + * @param productName + * @param number + * @param remark + * @return + */ + + public static String getPrintData(String pickupNumber,String date,String productName,Integer number,String remark) { + StringBuilder builder = new StringBuilder(); + builder.append(""+pickupNumber+"

    "); + builder.append("时间: "+date+"


    "); + + if(productName.length()>4||remark.length()>4){ + builder.append(""+productName+" "+number+"
    "); + builder.append(""+remark+"
    "); + }else { + builder.append(""+productName+" "+number+"
    "); + builder.append(""+remark+"
    "); + } + builder.append(""); + builder.append(""); + + return builder.toString(); + } + + + public static String getCashPrintData(OrderDetailPO detailPO,String type){ + StringBuilder sb = new StringBuilder(); + + sb.append(""+detailPO.getMerchantName()+"

    "); + sb.append(""+type+"【"+detailPO.getMasterId()+"】

    "); + sb.append("订单号: "+detailPO.getOrderNo()+"
    "); + sb.append("交易时间: "+detailPO.getTradeDate()+"
    "); + sb.append("收银员: "+detailPO.getOperator()+"


    "); + sb.append("------------------------
    "); + char paddingCharacter = ' '; + sb.append(""+String.format("%-15s","品名").replace(' ', paddingCharacter)+String.format("%-4s","数量").replace(' ', paddingCharacter)+String.format("%4s","小计").replace(' ', paddingCharacter)+"
    "); + for (OrderDetailPO.Detail detail : detailPO.getDetailList()) { + if(detail.getProductName().length()>4){ + + int count=getProducrName(detail.getProductName()); + if(count<=0){ + int length=15-(detail.getProductName().length()-4); + sb.append(""+String.format("%-"+length+"s",detail.getProductName()).replace(' ', paddingCharacter)+String.format("%-4s",detail.getNumber()).replace(' ', paddingCharacter)+String.format("%8s",detail.getAmount()).replace(' ', paddingCharacter)+"
    "); + }else { + int length=15+count-(detail.getProductName().length()-4); + sb.append(""+String.format("%-"+length+"s",detail.getProductName()).replace(' ', paddingCharacter)+String.format("%-4s",detail.getNumber()).replace(' ', paddingCharacter)+String.format("%8s",detail.getAmount()).replace(' ', paddingCharacter)+"
    "); + } + + }else { + sb.append(""+String.format("%-15s",detail.getProductName()).replace(' ', paddingCharacter)+String.format("%-4s",detail.getNumber()).replace(' ', paddingCharacter)+String.format("%8s",detail.getAmount()).replace(' ', paddingCharacter)+"
    "); + } + + if(detail.getRemark()!=null&& ObjectUtil.isNotEmpty(detail.getRemark())){ + sb.append("规格:"+detail.getRemark()+"
    "); + } + + sb.append("
    "); + + } + sb.append("------------------------
    "); + String t="¥"+detailPO.getReceiptsAmount(); + t=String.format("%11s",t).replace(' ', paddingCharacter); + sb.append("应收"+t+"
    "); + if(detailPO.getPayType().equals("deposit")){ + sb.append("储值¥"+detailPO.getReceiptsAmount()+"
    "); + sb.append("------------------------
    "); + sb.append("积分:"+detailPO.getIntegral()+"
    "); + } + + sb.append("余额:"+detailPO.getBalance()+"
    "); + sb.append("------------------------
    "); + + sb.append("打印时间:"+DateUtils.getTime(new Date())+"
    "); + + sb.append(""); + sb.append(""); + return sb.toString(); + + } + + + + + + + + + + + + + /** + * 打印票据 + * @throws Exception + */ + public static void printTickets(Integer actWay ,Integer cn,String devName,String data) { + //设备名称 + //行为方式 1:只打印数据 2:只播放信息 3:打印数据并播放信息 + actWay = 3; +// //打印联数 +// int cn = 1; + //打印内容 + //播报语音数据体,字段参考文档IOT_XY_API11001 + String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}"; + String time = String.valueOf(System.currentTimeMillis()); + String uuid = UUID.randomUUID().toString(); + Map param = getToken(time, uuid); + //参数 + MultiValueMap multiValueMap = new LinkedMultiValueMap<>(); + multiValueMap.add("token",param.get("TOKEN")); + multiValueMap.add("devName",devName); + multiValueMap.add("actWay",actWay); + multiValueMap.add("cn",cn); + multiValueMap.add("data",data); + multiValueMap.add("voiceJson",voiceJson); + multiValueMap.add("appId",APP_ID); + multiValueMap.add("timestamp",time); + multiValueMap.add("requestId",uuid); + multiValueMap.add("userCode",USER_CODE); + RestTemplate restTemplate = new RestTemplate(); + HttpHeaders header = new HttpHeaders(); + header.setContentType(MediaType.APPLICATION_FORM_URLENCODED); + System.out.println("yxprint 打印请求参数:"+JSONUtil.toJSONString(multiValueMap)); + HttpEntity> httpEntity = new HttpEntity<>(multiValueMap,header); + String httpResponse = restTemplate.postForObject(URL_STR, + httpEntity, String.class); + + System.out.println("map"+httpResponse); + } + + + + + public static int getProducrName(String str){ + int count = 0; + int digitCount=0; + for (int i=0;i='a' && str.charAt(i)<='z') || (str.charAt(i)>='A' && str.charAt(i)<='Z')){ + count++; + } + + if (Character.isDigit(str.charAt(i))) { + digitCount++; + } + } + return count+digitCount; + } + + public static void main(String[] args)throws Exception { + + List detailList= new ArrayList<>(); + OrderDetailPO.Detail detail=new OrderDetailPO.Detail("花香水牛拿铁","1","19000.90","不甜,麻辣"); + + OrderDetailPO.Detail detail3=new OrderDetailPO.Detail("单位iiii","4","40000.00",null); + OrderDetailPO.Detail detail4=new OrderDetailPO.Detail("喔喔奶茶","1","19000.90","微甜,微辣"); + detailList.add(detail); + detailList.add(detail3); + detailList.add(detail4); + OrderDetailPO detailPO=new OrderDetailPO("牛叉闪闪","普通打印","#365","DD20240306134718468","2024-03-06 15:00:00","【POS-1】001","79000.80","5049758.96","deposit","0",detailList); + + + printTickets(1,1,"ZF544PG03W00001",getCashPrintData(detailPO,"结算单")); + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/RSAUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/RSAUtils.java new file mode 100644 index 0000000..cda9733 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/RSAUtils.java @@ -0,0 +1,202 @@ +package com.chaozhanggui.system.cashierservice.util; + +import java.io.ByteArrayOutputStream; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.Signature; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import javax.crypto.Cipher; +import org.apache.tomcat.util.codec.binary.Base64; + +public class RSAUtils { + + + /** + * RSA最大加密明文大小 + */ + private static final int MAX_ENCRYPT_BLOCK = 117; + + /** + * RSA最大解密密文大小 + */ + private static final int MAX_DECRYPT_BLOCK = 128; + + /** + * 获取密钥对 + * + * @return 密钥对 + */ + public static KeyPair getKeyPair() throws Exception { + KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA"); + generator.initialize(1024); + return generator.generateKeyPair(); + } + + /** + * 获取私钥 + * + * @param privateKey 私钥字符串 + * @return + */ + public static PrivateKey getPrivateKey(String privateKey) throws Exception { + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + byte[] decodedKey = Base64.decodeBase64(privateKey.getBytes()); + PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(decodedKey); + return keyFactory.generatePrivate(keySpec); + } + + /** + * 获取公钥 + * + * @param publicKey 公钥字符串 + * @return + */ + public static PublicKey getPublicKey(String publicKey) throws Exception { + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + byte[] decodedKey = Base64.decodeBase64(publicKey.getBytes()); + X509EncodedKeySpec keySpec = new X509EncodedKeySpec(decodedKey); + return keyFactory.generatePublic(keySpec); + } + + /** + * RSA加密 + * + * @param data 待加密数据 + * @param publicKey 公钥 + * @return + */ + public static String encrypt(String data, PublicKey publicKey) throws Exception { + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, publicKey); + int inputLen = data.getBytes().length; + ByteArrayOutputStream out = new ByteArrayOutputStream(); + int offset = 0; + byte[] cache; + int i = 0; + // 对数据分段加密 + while (inputLen - offset > 0) { + if (inputLen - offset > MAX_ENCRYPT_BLOCK) { + cache = cipher.doFinal(data.getBytes(), offset, MAX_ENCRYPT_BLOCK); + } else { + cache = cipher.doFinal(data.getBytes(), offset, inputLen - offset); + } + out.write(cache, 0, cache.length); + i++; + offset = i * MAX_ENCRYPT_BLOCK; + } + byte[] encryptedData = out.toByteArray(); + out.close(); + // 获取加密内容使用base64进行编码,并以UTF-8为标准转化成字符串 + // 加密后的字符串 + return new String(Base64.encodeBase64String(encryptedData)); + } + + /** + * RSA解密 + * + * @param data 待解密数据 + * @param privateKey 私钥 + * @return + */ + public static String decrypt(String data, PrivateKey privateKey) throws Exception { + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.DECRYPT_MODE, privateKey); + byte[] dataBytes = Base64.decodeBase64(data); + int inputLen = dataBytes.length; + ByteArrayOutputStream out = new ByteArrayOutputStream(); + int offset = 0; + byte[] cache; + int i = 0; + // 对数据分段解密 + while (inputLen - offset > 0) { + if (inputLen - offset > MAX_DECRYPT_BLOCK) { + cache = cipher.doFinal(dataBytes, offset, MAX_DECRYPT_BLOCK); + } else { + cache = cipher.doFinal(dataBytes, offset, inputLen - offset); + } + out.write(cache, 0, cache.length); + i++; + offset = i * MAX_DECRYPT_BLOCK; + } + byte[] decryptedData = out.toByteArray(); + out.close(); + // 解密后的内容 + return new String(decryptedData, "UTF-8"); + } + + /** + * 签名 + * + * @param data 待签名数据 + * @param privateKey 私钥 + * @return 签名 + */ + public static String sign(String data, PrivateKey privateKey) throws Exception { + byte[] keyBytes = privateKey.getEncoded(); + PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PrivateKey key = keyFactory.generatePrivate(keySpec); + Signature signature = Signature.getInstance("MD5withRSA"); + signature.initSign(key); + signature.update(data.getBytes()); + return new String(Base64.encodeBase64(signature.sign())); + } + + /** + * 验签 + * + * @param srcData 原始字符串 + * @param publicKey 公钥 + * @param sign 签名 + * @return 是否验签通过 + */ + public static boolean verify(String srcData, PublicKey publicKey, String sign) throws Exception { + byte[] keyBytes = publicKey.getEncoded(); + X509EncodedKeySpec keySpec = new X509EncodedKeySpec(keyBytes); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PublicKey key = keyFactory.generatePublic(keySpec); + Signature signature = Signature.getInstance("MD5withRSA"); + signature.initVerify(key); + signature.update(srcData.getBytes()); + Boolean flag=signature.verify(Base64.decodeBase64(sign.getBytes())); + return flag; + } + + public static void main(String[] args) { + try { + // 生成密钥对 +// KeyPair keyPair = getKeyPair(); +// String privateKey = new String(Base64.encodeBase64(keyPair.getPrivate().getEncoded())); +// String publicKey = new String(Base64.encodeBase64(keyPair.getPublic().getEncoded())); +// System.out.println("私钥:" + privateKey); +// System.out.println("公钥:" + publicKey); + + + String publicKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMx5HH2xWlwPMPzsO4NTQoWoqZGkrHRvg/15EvBAuMyIfOlP7onES97TXiw8qIw4arDCknke3fld7mpA012TvJSINBYteBOFyBOkVPTlgVRlHYbibgkZh0LJMvQ47uHdk/HSTLjm056MfTgzmMR4IGzmXhhNBWOgeHvxriW4HPLwIDAQAB"; + String privateKey="MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAIzHkcfbFaXA8w/Ow7g1NChaipkaSsdG+D/XkS8EC4zIh86U/uicRL3tNeLDyojDhqsMKSeR7d+V3uakDTXZO8lIg0Fi14E4XIE6RU9OWBVGUdhuJuCRmHQsky9Dju4d2T8dJMuObTnox9ODOYxHggbOZeGE0FY6B4e/GuJbgc8vAgMBAAECgYBEDcFyLH1leEXHkXtZlBaXn1U6t9QIS018hze+06TFtLa57ZrgVZKBgac37M/+lw6Fp0ZJw6iLGgb71bgxHMdiSVPYlSVHLxp42isgafHwty82nt5I47P3+1OQHUD1LUV2HQpMYp7ptQV4jIymZik9ubM79fjT6z3posnrNWAVSQJBAMmkuWaHj8sS13Uz9B9t0jNHtRormxXe2nGiMbV/aQiFx6TvAGR8zEismR2fy0hkMfmH6GXProIimq8ZE5ksiCUCQQCyuquhBPHeRddnUUCjWEwyQV7ChjXdGto+NJ8Bf7LdqXsmdsQR21G1J557gWASZDz3UJcmm6pPxxXlXpziMT/DAkB1OcJfDOhXkriXdoCx1NKi5Ukv0bHzYP91mGl1roCNZ9jM1fVQdgz9IvpQ8pjnmPhErPI6XiaBmUR8DwQJxI3RAkA0mTkfRwxDRLySvFfQepDaDWDs0ICTlG579hKBZ2plT5ZdiIBFXQ0byhAa+sUiRHuosP/6rb8egVGRUhnLe4DvAkBKKr32EI+GSNSrfXktBTaWEkBRW21C6orlCvU7cpoJWb+KBHQzcRCsbDUH2/LM4uM0kuBSz0zK6H6VSWkY8VeR"; + + // RSA加密 + String data = "{\"name\":\"张三\"}"; + String encryptData = encrypt(data, getPublicKey(publicKey)); + System.out.println("加密后内容:" + encryptData); + // RSA解密 + String decryptData = decrypt(encryptData, getPrivateKey(privateKey)); + System.out.println("解密后内容:" + decryptData); + + // RSA签名 + String sign = sign(data, getPrivateKey(privateKey)); + + System.out.println("签名:"+sign); + // RSA验签 + boolean result = verify(data, getPublicKey(publicKey), sign); + System.out.print("验签结果:" + result); + } catch (Exception e) { + e.printStackTrace(); + System.out.print("加解密异常"); + } + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/RedisUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/RedisUtils.java new file mode 100644 index 0000000..d2edcde --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/RedisUtils.java @@ -0,0 +1,776 @@ +package com.chaozhanggui.system.cashierservice.util; + +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Configurable; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.data.redis.connection.RedisConnection; +import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.springframework.data.redis.core.*; +import org.springframework.data.redis.core.script.DefaultRedisScript; +import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; +import org.springframework.data.redis.serializer.RedisSerializer; +import org.springframework.data.redis.serializer.StringRedisSerializer; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; +import javax.annotation.Resource; +import java.util.*; +import java.util.concurrent.TimeUnit; + +/** + * @author / + */ +@Component +@SuppressWarnings({"unchecked", "all"}) +public class RedisUtils { + private static final Logger log = LoggerFactory.getLogger(RedisUtils.class); + private RedisTemplate redisTemplate; + @Value("${jwt.online-key}") + private String onlineKey; + /** + * 指定缓存失效时间 + * + * @param key 键 + * @param time 时间(秒) + */ + public boolean expire(String key, long time) { + try { + if (time > 0) { + redisTemplate.expire(key, time, TimeUnit.SECONDS); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + return true; + } + + /** + * 指定缓存失效时间 + * + * @param key 键 + * @param time 时间(秒) + * @param timeUnit 单位 + */ + public boolean expire(String key, long time, TimeUnit timeUnit) { + try { + if (time > 0) { + redisTemplate.expire(key, time, timeUnit); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + return true; + } + + /** + * 根据 key 获取过期时间 + * + * @param key 键 不能为null + * @return 时间(秒) 返回0代表为永久有效 + */ + public long getExpire(Object key) { + return redisTemplate.getExpire(key, TimeUnit.SECONDS); + } + + /** + * 查找匹配key + * + * @param pattern key + * @return / + */ + public List scan(String pattern) { + ScanOptions options = ScanOptions.scanOptions().match(pattern).build(); + RedisConnectionFactory factory = redisTemplate.getConnectionFactory(); + RedisConnection rc = Objects.requireNonNull(factory).getConnection(); + Cursor cursor = rc.scan(options); + List result = new ArrayList<>(); + while (cursor.hasNext()) { + result.add(new String(cursor.next())); + } + try { + RedisConnectionUtils.releaseConnection(rc, factory); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + return result; + } + + /** + * 分页查询 key + * + * @param patternKey key + * @param page 页码 + * @param size 每页数目 + * @return / + */ + public List findKeysForPage(String patternKey, int page, int size) { + ScanOptions options = ScanOptions.scanOptions().match(patternKey).build(); + RedisConnectionFactory factory = redisTemplate.getConnectionFactory(); + RedisConnection rc = Objects.requireNonNull(factory).getConnection(); + Cursor cursor = rc.scan(options); + List result = new ArrayList<>(size); + int tmpIndex = 0; + int fromIndex = page * size; + int toIndex = page * size + size; + while (cursor.hasNext()) { + if (tmpIndex >= fromIndex && tmpIndex < toIndex) { + result.add(new String(cursor.next())); + tmpIndex++; + continue; + } + // 获取到满足条件的数据后,就可以退出了 + if (tmpIndex >= toIndex) { + break; + } + tmpIndex++; + cursor.next(); + } + try { + RedisConnectionUtils.releaseConnection(rc, factory); + } catch (Exception e) { + log.error(e.getMessage(), e); + } + return result; + } + + /** + * 判断key是否存在 + * + * @param key 键 + * @return true 存在 false不存在 + */ + public boolean hasKey(String key) { + try { + return redisTemplate.hasKey(key); + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 删除缓存 + * + * @param key 可以传一个值 或多个 + */ + public void del(String... keys) { + if (keys != null && keys.length > 0) { + if (keys.length == 1) { + boolean result = redisTemplate.delete(keys[0]); + log.debug("--------------------------------------------"); + log.debug(new StringBuilder("删除缓存:").append(keys[0]).append(",结果:").append(result).toString()); + log.debug("--------------------------------------------"); + } else { + Set keySet = new HashSet<>(); + for (String key : keys) { + keySet.addAll(redisTemplate.keys(key)); + } + long count = redisTemplate.delete(keySet); + log.debug("--------------------------------------------"); + log.debug("成功删除缓存:" + keySet.toString()); + log.debug("缓存删除数量:" + count + "个"); + log.debug("--------------------------------------------"); + } + } + } + + // ============================String============================= + + /** + * 普通缓存获取 + * + * @param key 键 + * @return 值 + */ + public Object get(String key) { + return key == null ? null : redisTemplate.opsForValue().get(key); + } + + /** + * 批量获取 + * + * @param keys + * @return + */ + public List multiGet(List keys) { + List list = redisTemplate.opsForValue().multiGet(Sets.newHashSet(keys)); + List resultList = Lists.newArrayList(); + Optional.ofNullable(list).ifPresent(e-> list.forEach(ele-> Optional.ofNullable(ele).ifPresent(resultList::add))); + return resultList; + } + + /** + * 普通缓存放入 + * + * @param key 键 + * @param value 值 + * @return true成功 false失败 + */ + public boolean set(String key, Object value) { + try { + redisTemplate.opsForValue().set(key, value); + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 普通缓存放入并设置时间 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) time要大于0 如果time小于等于0 将设置无限期 + * @return true成功 false 失败 + */ + public boolean set(String key, Object value, long time) { + try { + if (time > 0) { + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); + } else { + set(key, value); + } + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + @Resource + private StringRedisTemplate stringRedisTemplate; + /** + * 普通缓存放入并设置时间(重写) + * + * @param key 键 + * @param value 值 + * @param time 时间 + * @param timeUnit 类型 + * @return true成功 false 失败 + */ + public boolean setextend(String key, Object value, long time) { + try { + if (time > 0) { + stringRedisTemplate.opsForValue().set(key, value.toString(), time); + } else { + set(key, value); + } + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + /** + * 普通缓存放入并设置时间 + * + * @param key 键 + * @param value 值 + * @param time 时间 + * @param timeUnit 类型 + * @return true成功 false 失败 + */ + public boolean set(String key, Object value, long time, TimeUnit timeUnit) { + try { + if (time > 0) { + redisTemplate.opsForValue().set(key, value, time, timeUnit); + } else { + set(key, value); + } + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + // ================================Map================================= + + /** + * HashGet + * + * @param key 键 不能为null + * @param item 项 不能为null + * @return 值 + */ + public Object hget(String key, String item) { + return redisTemplate.opsForHash().get(key, item); + } + + /** + * 获取hashKey对应的所有键值 + * + * @param key 键 + * @return 对应的多个键值 + */ + public Map hmget(String key) { + return redisTemplate.opsForHash().entries(key); + + } + + /** + * HashSet + * + * @param key 键 + * @param map 对应多个键值 + * @return true 成功 false 失败 + */ + public boolean hmset(String key, Map map) { + try { + redisTemplate.opsForHash().putAll(key, map); + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * HashSet 并设置时间 + * + * @param key 键 + * @param map 对应多个键值 + * @param time 时间(秒) + * @return true成功 false失败 + */ + public boolean hmset(String key, Map map, long time) { + try { + redisTemplate.opsForHash().putAll(key, map); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 向一张hash表中放入数据,如果不存在将创建 + * + * @param key 键 + * @param item 项 + * @param value 值 + * @return true 成功 false失败 + */ + public boolean hset(String key, String item, Object value) { + try { + redisTemplate.opsForHash().put(key, item, value); + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 向一张hash表中放入数据,如果不存在将创建 + * + * @param key 键 + * @param item 项 + * @param value 值 + * @param time 时间(秒) 注意:如果已存在的hash表有时间,这里将会替换原有的时间 + * @return true 成功 false失败 + */ + public boolean hset(String key, String item, Object value, long time) { + try { + redisTemplate.opsForHash().put(key, item, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 删除hash表中的值 + * + * @param key 键 不能为null + * @param item 项 可以使多个 不能为null + */ + public void hdel(String key, Object... item) { + redisTemplate.opsForHash().delete(key, item); + } + + /** + * 判断hash表中是否有该项的值 + * + * @param key 键 不能为null + * @param item 项 不能为null + * @return true 存在 false不存在 + */ + public boolean hHasKey(String key, String item) { + return redisTemplate.opsForHash().hasKey(key, item); + } + + /** + * hash递增 如果不存在,就会创建一个 并把新增后的值返回 + * + * @param key 键 + * @param item 项 + * @param by 要增加几(大于0) + * @return + */ + public double hincr(String key, String item, double by) { + return redisTemplate.opsForHash().increment(key, item, by); + } + + /** + * hash递减 + * + * @param key 键 + * @param item 项 + * @param by 要减少记(小于0) + * @return + */ + public double hdecr(String key, String item, double by) { + return redisTemplate.opsForHash().increment(key, item, -by); + } + + // ============================set============================= + + /** + * 根据key获取Set中的所有值 + * + * @param key 键 + * @return + */ + public Set sGet(String key) { + try { + return redisTemplate.opsForSet().members(key); + } catch (Exception e) { + log.error(e.getMessage(), e); + return null; + } + } + + /** + * 根据value从一个set中查询,是否存在 + * + * @param key 键 + * @param value 值 + * @return true 存在 false不存在 + */ + public boolean sHasKey(String key, Object value) { + try { + return redisTemplate.opsForSet().isMember(key, value); + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 将数据放入set缓存 + * + * @param key 键 + * @param values 值 可以是多个 + * @return 成功个数 + */ + public long sSet(String key, Object... values) { + try { + return redisTemplate.opsForSet().add(key, values); + } catch (Exception e) { + log.error(e.getMessage(), e); + return 0; + } + } + + /** + * 将set数据放入缓存 + * + * @param key 键 + * @param time 时间(秒) + * @param values 值 可以是多个 + * @return 成功个数 + */ + public long sSetAndTime(String key, long time, Object... values) { + try { + Long count = redisTemplate.opsForSet().add(key, values); + if (time > 0) { + expire(key, time); + } + return count; + } catch (Exception e) { + log.error(e.getMessage(), e); + return 0; + } + } + + /** + * 获取set缓存的长度 + * + * @param key 键 + * @return + */ + public long sGetSetSize(String key) { + try { + return redisTemplate.opsForSet().size(key); + } catch (Exception e) { + log.error(e.getMessage(), e); + return 0; + } + } + + /** + * 移除值为value的 + * + * @param key 键 + * @param values 值 可以是多个 + * @return 移除的个数 + */ + public long setRemove(String key, Object... values) { + try { + Long count = redisTemplate.opsForSet().remove(key, values); + return count; + } catch (Exception e) { + log.error(e.getMessage(), e); + return 0; + } + } + + // ===============================list================================= + + /** + * 获取list缓存的内容 + * + * @param key 键 + * @param start 开始 + * @param end 结束 0 到 -1代表所有值 + * @return + */ + public List lGet(String key, long start, long end) { + try { + return redisTemplate.opsForList().range(key, start, end); + } catch (Exception e) { + log.error(e.getMessage(), e); + return null; + } + } + + /** + * 获取list缓存的长度 + * + * @param key 键 + * @return + */ + public long lGetListSize(String key) { + try { + return redisTemplate.opsForList().size(key); + } catch (Exception e) { + log.error(e.getMessage(), e); + return 0; + } + } + + /** + * 通过索引 获取list中的值 + * + * @param key 键 + * @param index 索引 index>=0时, 0 表头,1 第二个元素,依次类推;index<0时,-1,表尾,-2倒数第二个元素,依次类推 + * @return + */ + public Object lGetIndex(String key, long index) { + try { + return redisTemplate.opsForList().index(key, index); + } catch (Exception e) { + log.error(e.getMessage(), e); + return null; + } + } + + /** + * 将list放入缓存 + * + * @param key 键 + * @param value 值 + * @return + */ + public boolean lSet(String key, Object value) { + try { + redisTemplate.opsForList().rightPush(key, value); + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 将list放入缓存 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, Object value, long time) { + try { + redisTemplate.opsForList().rightPush(key, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 将list放入缓存 + * + * @param key 键 + * @param value 值 + * @return + */ + public boolean lSet(String key, List value) { + try { + redisTemplate.opsForList().rightPushAll(key, value); + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 将list放入缓存 + * + * @param key 键 + * @param value 值 + * @param time 时间(秒) + * @return + */ + public boolean lSet(String key, List value, long time) { + try { + redisTemplate.opsForList().rightPushAll(key, value); + if (time > 0) { + expire(key, time); + } + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 根据索引修改list中的某条数据 + * + * @param key 键 + * @param index 索引 + * @param value 值 + * @return / + */ + public boolean lUpdateIndex(String key, long index, Object value) { + try { + redisTemplate.opsForList().set(key, index, value); + return true; + } catch (Exception e) { + log.error(e.getMessage(), e); + return false; + } + } + + /** + * 移除N个值为value + * + * @param key 键 + * @param count 移除多少个 + * @param value 值 + * @return 移除的个数 + */ + public long lRemove(String key, long count, Object value) { + try { + return redisTemplate.opsForList().remove(key, count, value); + } catch (Exception e) { + log.error(e.getMessage(), e); + return 0; + } + } + + /** + * @param prefix 前缀 + * @param ids id + */ + public void delByKeys(String prefix, Set ids) { + Set keys = new HashSet<>(); + for (Long id : ids) { + keys.addAll(redisTemplate.keys(new StringBuffer(prefix).append(id).toString())); + } + long count = redisTemplate.delete(keys); + // 此处提示可自行删除 + log.debug("--------------------------------------------"); + log.debug("成功删除缓存:" + keys.toString()); + log.debug("缓存删除数量:" + count + "个"); + log.debug("--------------------------------------------"); + } + String secKillScript = "local userid=KEYS[1];\r\n" + + "local prodid=KEYS[2];\r\n" + + "local qtkey=prodid;\r\n" + + "local usernum=KEYS[3];\r\n" + + "local usersKey='sk:'..prodid..\":usr\";\r\n" + + "local num= redis.call(\"get\" ,qtkey);\r\n" + + "if tonumber(num) redisScript = new DefaultRedisScript<>(); + redisScript.setResultType(Long.class);//返回类型是Long + redisScript.setScriptText(secKillScript); + Object execute = redisTemplate.execute(redisScript, Arrays.asList(uid, key,num), prodid); + String reString = String.valueOf(execute); + return reString; + } + String secAddScript = "local prodid=KEYS[1];\r\n" + + "local usernum=KEYS[2];\r\n" + + "local num= redis.call(\"get\" ,prodid);\r\n" + + " redis.call(\"SET\",prodid,tonumber(usernum)+tonumber(num));\r\n" + + "return 1"; + public String secAdd(String key,String num) { + + DefaultRedisScript redisScript = new DefaultRedisScript<>(); + redisScript.setResultType(Long.class);//返回类型是Long + redisScript.setScriptText(secKillScript); + Object execute = redisTemplate.execute(redisScript, Arrays.asList(key,num)); + String reString = String.valueOf(execute); + return reString; + + } + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/RsaUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/RsaUtil.java new file mode 100644 index 0000000..333fccf --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/RsaUtil.java @@ -0,0 +1,198 @@ +package me.zhengjie.utils; + +import org.apache.commons.codec.binary.Base64; +import javax.crypto.Cipher; +import java.io.ByteArrayOutputStream; +import java.security.*; +import java.security.interfaces.RSAPrivateKey; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; + +/** + * @author https://www.cnblogs.com/nihaorz/p/10690643.html + * @description Rsa 工具类,公钥私钥生成,加解密 + * @date 2020-05-18 + **/ +public class RsaUtil { + + private static final String SRC = "123456"; + + public static void main(String[] args) throws Exception { + System.out.println("\n"); + RsaKeyPair keyPair = generateKeyPair(); + System.out.println("公钥:" + keyPair.getPublicKey()); + System.out.println("私钥:" + keyPair.getPrivateKey()); + System.out.println("\n"); + test1(keyPair); + System.out.println("\n"); + test2(keyPair); + System.out.println("\n"); + } + + /** + * 公钥加密私钥解密 + */ + private static void test1(RsaKeyPair keyPair) throws Exception { + System.out.println("***************** 公钥加密私钥解密开始 *****************"); + String text1 = encryptByPublicKey(keyPair.getPublicKey(), RsaUtil.SRC); + String text2 = decryptByPrivateKey(keyPair.getPrivateKey(), text1); + System.out.println("加密前:" + RsaUtil.SRC); + System.out.println("加密后:" + text1); + System.out.println("解密后:" + text2); + if (RsaUtil.SRC.equals(text2)) { + System.out.println("解密字符串和原始字符串一致,解密成功"); + } else { + System.out.println("解密字符串和原始字符串不一致,解密失败"); + } + System.out.println("***************** 公钥加密私钥解密结束 *****************"); + } + + /** + * 私钥加密公钥解密 + * @throws Exception / + */ + private static void test2(RsaKeyPair keyPair) throws Exception { + System.out.println("***************** 私钥加密公钥解密开始 *****************"); + String text1 = encryptByPrivateKey(keyPair.getPrivateKey(), RsaUtil.SRC); + String text2 = decryptByPublicKey(keyPair.getPublicKey(), text1); + System.out.println("加密前:" + RsaUtil.SRC); + System.out.println("加密后:" + text1); + System.out.println("解密后:" + text2); + if (RsaUtil.SRC.equals(text2)) { + System.out.println("解密字符串和原始字符串一致,解密成功"); + } else { + System.out.println("解密字符串和原始字符串不一致,解密失败"); + } + System.out.println("***************** 私钥加密公钥解密结束 *****************"); + } + + /** + * 公钥解密 + * + * @param publicKeyText 公钥 + * @param text 待解密的信息 + * @return / + * @throws Exception / + */ + public static String decryptByPublicKey(String publicKeyText, String text) throws Exception { + X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(Base64.decodeBase64(publicKeyText)); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec); + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.DECRYPT_MODE, publicKey); + byte[] result = doLongerCipherFinal(Cipher.DECRYPT_MODE, cipher, Base64.decodeBase64(text)); + return new String(result); + } + + /** + * 私钥加密 + * + * @param privateKeyText 私钥 + * @param text 待加密的信息 + * @return / + * @throws Exception / + */ + public static String encryptByPrivateKey(String privateKeyText, String text) throws Exception { + PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyText)); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec); + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, privateKey); + byte[] result = doLongerCipherFinal(Cipher.ENCRYPT_MODE, cipher, text.getBytes()); + return Base64.encodeBase64String(result); + } + + /** + * 私钥解密 + * + * @param privateKeyText 私钥 + * @param text 待解密的文本 + * @return / + * @throws Exception / + */ + public static String decryptByPrivateKey(String privateKeyText, String text) throws Exception { + PKCS8EncodedKeySpec pkcs8EncodedKeySpec5 = new PKCS8EncodedKeySpec(Base64.decodeBase64(privateKeyText)); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PrivateKey privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec5); + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.DECRYPT_MODE, privateKey); + byte[] result = doLongerCipherFinal(Cipher.DECRYPT_MODE, cipher, Base64.decodeBase64(text)); + return new String(result); + } + + /** + * 公钥加密 + * + * @param publicKeyText 公钥 + * @param text 待加密的文本 + * @return / + */ + public static String encryptByPublicKey(String publicKeyText, String text) throws Exception { + X509EncodedKeySpec x509EncodedKeySpec2 = new X509EncodedKeySpec(Base64.decodeBase64(publicKeyText)); + KeyFactory keyFactory = KeyFactory.getInstance("RSA"); + PublicKey publicKey = keyFactory.generatePublic(x509EncodedKeySpec2); + Cipher cipher = Cipher.getInstance("RSA"); + cipher.init(Cipher.ENCRYPT_MODE, publicKey); + byte[] result = doLongerCipherFinal(Cipher.ENCRYPT_MODE, cipher, text.getBytes()); + return Base64.encodeBase64String(result); + } + + private static byte[] doLongerCipherFinal(int opMode,Cipher cipher, byte[] source) throws Exception { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + if (opMode == Cipher.DECRYPT_MODE) { + out.write(cipher.doFinal(source)); + } else { + int offset = 0; + int totalSize = source.length; + while (totalSize - offset > 0) { + int size = Math.min(cipher.getOutputSize(0) - 11, totalSize - offset); + out.write(cipher.doFinal(source, offset, size)); + offset += size; + } + } + out.close(); + return out.toByteArray(); + } + + /** + * 构建RSA密钥对 + * + * @return / + * @throws NoSuchAlgorithmException / + */ + public static RsaKeyPair generateKeyPair() throws NoSuchAlgorithmException { + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); + keyPairGenerator.initialize(1024); + KeyPair keyPair = keyPairGenerator.generateKeyPair(); + RSAPublicKey rsaPublicKey = (RSAPublicKey) keyPair.getPublic(); + RSAPrivateKey rsaPrivateKey = (RSAPrivateKey) keyPair.getPrivate(); + String publicKeyString = Base64.encodeBase64String(rsaPublicKey.getEncoded()); + String privateKeyString = Base64.encodeBase64String(rsaPrivateKey.getEncoded()); + return new RsaKeyPair(publicKeyString, privateKeyString); + } + + + /** + * RSA密钥对对象 + */ + public static class RsaKeyPair { + + private final String publicKey; + private final String privateKey; + + public RsaKeyPair(String publicKey, String privateKey) { + this.publicKey = publicKey; + this.privateKey = privateKey; + } + + public String getPublicKey() { + return publicKey; + } + + public String getPrivateKey() { + return privateKey; + } + + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/SHA1Util.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/SHA1Util.java new file mode 100644 index 0000000..e82667f --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/SHA1Util.java @@ -0,0 +1,85 @@ +package com.chaozhanggui.system.cashierservice.util; + +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.HashMap; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + + +public class SHA1Util { + + private static final Logger log = LoggerFactory.getLogger(SHA1Util.class); + public static String encrypt(String str){ + if (null == str || 0 == str.length()){ + return null; + } + char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'a', 'b', 'c', 'd', 'e', 'f'}; + try { + MessageDigest mdTemp = MessageDigest.getInstance("SHA1"); + mdTemp.update(new String(str.getBytes("iso8859-1"), "utf-8").getBytes()); + byte[] md = mdTemp.digest(); + int j = md.length; + char[] buf = new char[j * 2]; + int k = 0; + for (int i = 0; i < j; i++) { + byte byte0 = md[i]; + buf[k++] = hexDigits[byte0 >>> 4 & 0xf]; + buf[k++] = hexDigits[byte0 & 0xf]; + } + return new String(buf); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + log.error("SHA1加密异常:",e); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + log.error("SHA1加密异常:",e); + } + return str; + } + + @SuppressWarnings("unchecked") + public static String encrypt(Object obj) { + if(obj==null){ + return null; + } + Map map = new HashMap(); + if(obj instanceof Map){ + map=(Map) obj; + }else{ + map = BeanUtil.transBean2Map(obj); + } + map.remove("sign"); + map.remove("encrypt"); + String result = BeanUtil.mapOrderStr(map); + if (StringUtils.isEmpty(result)) { + return null; + } + return encrypt(result); + } + + @SuppressWarnings("unchecked") + public static boolean check(Object obj){ + Map map=new HashMap(); + if(obj==null){ + return false; + } + if(obj instanceof Map){ + map=(Map) obj; + }else{ + map = BeanUtil.transBean2Map(obj); + } + String sign=(String)map.get("sign"); + if(sign==null){ + return false; + } + String str=encrypt(obj); + return sign.equals(str)?true:false; + + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/SignUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/SignUtils.java new file mode 100644 index 0000000..6a650b1 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/SignUtils.java @@ -0,0 +1,137 @@ +package com.chaozhanggui.system.cashierservice.util; + +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.apache.tomcat.util.codec.binary.Base64; + +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.util.Map; +import java.util.TreeMap; + +/** + * 签名工具类 + */ +@Slf4j +public class SignUtils { + + /** + * 获取签名之前的源串 按照ASCII 排序 + * + * @param object + * @return + */ + public static String getSignContent(JSONObject object) { + TreeMap map = JSONObject.parseObject(JSONObject.toJSONString(object), TreeMap.class); + StringBuilder sb = new StringBuilder(); + for (Map.Entry o : map.entrySet()) { + String key = o.getKey(); + Object value = o.getValue(); + if ("sign".contains(key)) { + continue; + } + if (value != null) { + sb.append(key).append("=").append(value).append("&"); +// if(value instanceof ArrayList || value instanceof Map){ +// sb.append(key).append("=").append(JSON.toJSONString(value)).append("&"); +// }else{ +// sb.append(key).append("=").append(value).append("&"); +// } + } + } + sb.deleteCharAt(sb.length() - 1); + return sb.toString(); + } + + public static String wapGetSign(JSONObject object,String key) { + String checkSign = MD5Utils.MD5Encode(getSignContent(object) + "&key=" + key, "UTF-8"); + return checkSign; + } + + /** + * 获取签名之前的源串 按照ASCII 排序 + * + * @param object + * @return + */ + public static String getYSSignContent(JSONObject object) { + String s = JSONObject.toJSONString(object); + TreeMap map = JSONObject.parseObject(s, TreeMap.class); + StringBuilder sb = new StringBuilder(); + for (Map.Entry o : map.entrySet()) { + String key = o.getKey(); + Object value = o.getValue(); + if ("sign".contains(key)) { + continue; + } + if (ObjectUtil.isNotEmpty(value)) { + sb.append(key).append("=").append(value).append("&"); + } + } + sb.deleteCharAt(sb.length() - 1); + return sb.toString(); + } + + public static String getSignContent1(JSONObject object,String appSerct) { + TreeMap map = JSONObject.parseObject(JSONObject.toJSONString(object), TreeMap.class); + StringBuilder sb = new StringBuilder(); + for (Map.Entry o : map.entrySet()) { + String key = o.getKey(); + Object value = o.getValue(); + if ("sign".contains(key)) { + continue; + } + if (ObjectUtil.isNotEmpty(value)) { + sb.append(key).append(value); + } + } + sb.append(appSerct); + return sb.toString(); + } + + public static String sha1Encrypt(String str) { + if (str == null || str.length() == 0) { + return null; + } + char[] hexDigits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'a', 'b', 'c', 'd', 'e', 'f' }; + try { + MessageDigest mdTemp = MessageDigest.getInstance("SHA1"); + mdTemp.update(str.getBytes(StandardCharsets.UTF_8)); + + byte[] md = mdTemp.digest(); + int j = md.length; + char[] buf = new char[j * 2]; + int k = 0; + + for (byte byte0 : md) { + buf[k++] = hexDigits[byte0 >>> 4 & 0xf]; + buf[k++] = hexDigits[byte0 & 0xf]; + } + return new String(buf); + } catch (Exception e) { + return null; + } + } + public static String HMACSHA256BYTE(String data, String key) { + String hash = ""; + try { + Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); + SecretKeySpec secret_key = new SecretKeySpec(key.getBytes(), "HmacSHA256"); + sha256_HMAC.init(secret_key); + byte[] array = sha256_HMAC.doFinal(data.getBytes()); + hash = Base64.encodeBase64String(array); + } catch (Exception e) { + e.printStackTrace(); + } + return hash; + } + + public static String getSignSha256(JSONObject params, String accessKeySecret) { + return HMACSHA256BYTE(getSignContent(params),accessKeySecret); + } + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/SnowFlakeUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/SnowFlakeUtil.java new file mode 100644 index 0000000..aa284b8 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/SnowFlakeUtil.java @@ -0,0 +1,48 @@ +package com.chaozhanggui.system.cashierservice.util; + +import cn.hutool.core.lang.Snowflake; +import cn.hutool.core.util.IdUtil; +import lombok.extern.slf4j.Slf4j; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Random; + +/** + * @author Exrickx + */ +@Slf4j +public class SnowFlakeUtil { + + /** + * 派号器workid:0~31 + * 机房datacenterid:0~31 + */ + private static Snowflake snowflake = IdUtil.createSnowflake(1, 1); + + public static Long nextId() { + return snowflake.nextId(); + } + + + + + + public static String generateOrderNo(){ + String dateFormat="yyyyMMddHHmmssSSS"; + SimpleDateFormat sm=new SimpleDateFormat(dateFormat); + + String currentDate=sm.format(new Date()); + + Random rm=new Random(); + int suffix=rm.nextInt(9999999); + + return currentDate.concat(String.format("%07d",suffix)); + } + + public static void main(String[] args){ + for(int i=0;i<10;i++){ + System.out.println(SnowFlakeUtil.generateOrderNo()); + } + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/SpringUtils.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/SpringUtils.java new file mode 100644 index 0000000..b029858 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/SpringUtils.java @@ -0,0 +1,33 @@ +package com.chaozhanggui.system.cashierservice.util; + +import org.springframework.beans.BeansException; +import org.springframework.beans.factory.config.BeanFactoryPostProcessor; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; +import org.springframework.stereotype.Repository; + +@Repository +public class SpringUtils implements BeanFactoryPostProcessor { + + //Spring应用上下文环境 + private static ConfigurableListableBeanFactory beanFactory; + + @Override + public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { + SpringUtils.beanFactory = beanFactory; + } + + public static ConfigurableListableBeanFactory getBeanFactory() { + return beanFactory; + } + + @SuppressWarnings("unchecked") + public static T getBean(String name) throws BeansException { + return (T) getBeanFactory().getBean(name); + } + + public static T + getBean(Class clz) throws BeansException { + T result = (T) getBeanFactory().getBean(clz); + return result; + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/StringUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/StringUtil.java new file mode 100644 index 0000000..f049832 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/StringUtil.java @@ -0,0 +1,54 @@ +package com.chaozhanggui.system.cashierservice.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; + +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Random; + +/** + * @author lyf + */ +public class StringUtil { + /** + * 生成指定长度的随机数 + * @param length + * @return + */ + public static String genRandomNum(int length) { + int maxNum = 36; + int i; + int count = 0; + char[] str = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', + 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; + StringBuffer pwd = new StringBuffer(""); + Random r = new Random(); + while (count < length) { + i = Math.abs(r.nextInt(maxNum)); + pwd.append(str[i]); + count++; + } + return pwd.toString(); + } + + /** + * 生成订单号 + * + * @return + */ + public static synchronized String getBillno() { + StringBuilder billno = new StringBuilder(); + + // 日期(格式:20080524) + SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS"); + billno.append(format.format(new Date())); + return billno.toString(); + } + public static JSONArray stringChangeList(String listString){ + // 使用Fastjson将JSON字符串转换为JSONArray对象 + return JSON.parseArray(listString); + + } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/TokenUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/TokenUtil.java new file mode 100644 index 0000000..fab5ba9 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/TokenUtil.java @@ -0,0 +1,124 @@ +package com.chaozhanggui.system.cashierservice.util; + +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import io.jsonwebtoken.Claims; +import io.jsonwebtoken.JwtBuilder; +import io.jsonwebtoken.Jwts; +import io.jsonwebtoken.SignatureAlgorithm; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @author admin + * @date 2020/8/6 13:04 + */ +public class TokenUtil { + + /** + * 设置过期时间 + */ + public static final long EXPIRE_DATE=24*60*60*1000*365; + /** + * token秘钥 + */ + private static final String TOKEN_SECRET = "BBDFSDFHFGHSGSRTRESDFSDFS"; + + private JwtBuilder jwtBuilder; + + public static final String AUTHORITIES_KEY = "user"; + + /** + * 初始化生成token的参数 + * @param userId + * @param phone + * @return + */ + public static String generateToken(Integer userId,String openId,String phone,String userName) throws Exception { + Map claims = new HashMap<>(1); + claims.put("userId", userId); + if(ObjectUtil.isNotEmpty(openId)){ + claims.put("openId",openId); + } + + if(ObjectUtil.isNotEmpty(phone)){ + claims.put("phone",phone); + } + + if(ObjectUtil.isNotEmpty(userName)){ + claims.put("userName",userName); + } + + + + return generateToken(claims); + } + + /** + * 生成token + * @param claims + * @return String + */ + private static String generateToken(Map claims) throws Exception { + return Jwts.builder() + .setClaims(claims) + .setExpiration(new Date(System.currentTimeMillis()+EXPIRE_DATE)) + .setIssuedAt(new Date()) + .signWith(SignatureAlgorithm.HS256,TOKEN_SECRET) + .compact(); + } + + public static String refreshToken(String token) { + String refreshedToken; + try { + final Claims claims = Jwts.parser() + .setSigningKey(TOKEN_SECRET) + .parseClaimsJws(token) + .getBody(); + refreshedToken = generateToken(claims); + } catch (Exception e) { + refreshedToken = null; + } + return refreshedToken; + } + + public static String verifyToken(String token) { + String result = ""; + try { + Claims claims = Jwts.parser() + .setSigningKey(TOKEN_SECRET) + .parseClaimsJws(token) + .getBody(); + result = "1"; + } catch (Exception e) { + result = "0"; + } + return result; + } + + /** + * 从token获取用户信息 + * @param token token + * @return 用户Id + */ + public static Object parseParamFromToken(final String token, final String paramName ) { + Claims claims = Jwts.parser() + .setSigningKey(TOKEN_SECRET) + .parseClaimsJws(token) + .getBody(); + return claims.get(paramName); + } + public static void main(String[] args){ + System.out.println(refreshToken("eyJhbGciOiJIUzUxMiJ9.eyJleHAiOjE1OTY4Nzc5MjEsInN1YiI6ImRkZGRkIiwiaWF0IjoxNTk2Njk3OTIxfQ.lrg3KF9h9izbmyD2q5onqnZIKBqanWy9xCcroFpjxPKmJz6kz27G9lVlFpVanrL1I4SFf3Dz3q3Xu01DX2T_dw")); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar cld = Calendar.getInstance(); + cld.setTime(new Date()); + cld.set(Calendar.DATE, cld.get(Calendar.DATE)-1); + System.out.println(sdf.format(cld.getTime())); + } + +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/util/tokenProvider.java b/src/main/java/com/chaozhanggui/system/cashierservice/util/tokenProvider.java new file mode 100644 index 0000000..90a5b18 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/util/tokenProvider.java @@ -0,0 +1,17 @@ +package com.chaozhanggui.system.cashierservice.util; + +import cn.hutool.core.util.IdUtil; +import io.jsonwebtoken.JwtBuilder; +import org.apache.tomcat.util.net.openssl.ciphers.Authentication; + +public class tokenProvider { + private JwtBuilder jwtBuilder; +// public String createToken(Authentication authentication) { +// return jwtBuilder +// // 加入ID确保生成的 Token 都不一致 +// .setId(IdUtil.simpleUUID()) +// .claim(AUTHORITIES_KEY, authentication.getName()) +// .setSubject(authentication.getName()) +// .compact(); +// } +} diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/wxUtil/WechatUtil.java b/src/main/java/com/chaozhanggui/system/cashierservice/wxUtil/WechatUtil.java new file mode 100644 index 0000000..7cfca73 --- /dev/null +++ b/src/main/java/com/chaozhanggui/system/cashierservice/wxUtil/WechatUtil.java @@ -0,0 +1,73 @@ +package com.chaozhanggui.system.cashierservice.wxUtil; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.chaozhanggui.system.cashierservice.util.HttpClientUtil; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; +import org.springframework.web.client.RestTemplate; + +import java.util.HashMap; +import java.util.Map; + +public class WechatUtil { + + public static JSONObject getSessionKeyOrOpenId(String code, String appId, String secrete) { + String requestUrl = "https://api.weixin.qq.com/sns/jscode2session"; + Map requestUrlParam = new HashMap<>(); + // https://mp.weixin.qq.com/wxopen/devprofile?action=get_profile&token=164113089&lang=zh_CN + //小程序appId + requestUrlParam.put("appid", appId); + //小程序secret + requestUrlParam.put("secret", secrete); + //小程序端返回的code + requestUrlParam.put("js_code", code); + //默认参数 + requestUrlParam.put("grant_type", "authorization_code"); + //发送post请求读取调用微信接口获取openid用户唯一标识 + JSONObject jsonObject = JSON.parseObject(HttpClientUtil.doPost(requestUrl,requestUrlParam)); + return jsonObject; + } + + + + public static JSONObject getAccessToken(String appId, String secrete){ + String requestUrl = "https://api.weixin.qq.com/cgi-bin/token"; + Map requestUrlParam = new HashMap<>(); + //小程序appId + requestUrlParam.put("appid", appId); + //小程序secret + requestUrlParam.put("secret", secrete); + //默认参数 + requestUrlParam.put("grant_type", "client_credential"); + JSONObject jsonObject = JSON.parseObject(HttpClientUtil.doGet(requestUrl,requestUrlParam)); + return jsonObject; + } + + + public static String getPhone(String code,String accessToken){ + String requestUrl = "https://api.weixin.qq.com/wxa/business/getuserphonenumber?access_token="+accessToken; + Map requestUrlParam = new HashMap<>(); + //小程序appId + requestUrlParam.put("code", code); + + HttpHeaders headers = new HttpHeaders(); + headers.setContentType(MediaType.APPLICATION_JSON); + + HttpEntity> httpEntity = new HttpEntity<>(requestUrlParam,headers); + //通过RestTemplate发送请求,获取到用户手机号码 + RestTemplate restTemplate = new RestTemplate(); + ResponseEntity response = restTemplate.postForEntity(requestUrl, httpEntity, JSONObject.class); + String errmsg = response.getBody().getString("errmsg"); + if (errmsg.equals("ok")) { + JSONObject phoneInfoJson = response.getBody().getJSONObject("phone_info"); + String phoneNumber = phoneInfoJson.getString("phoneNumber"); + return phoneNumber; + } + + return null; + } + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml new file mode 100644 index 0000000..5cf8b4d --- /dev/null +++ b/src/main/resources/application-dev.yml @@ -0,0 +1,59 @@ +spring: + datasource: + url: jdbc:mysql://121.40.128.145:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false + username: root + password: mysqlroot@123 + driver-class-name: com.mysql.cj.jdbc.Driver + initialSize: 5 + minIdle: 5 + maxActive: 20 + maxWait: 60000 + logging: + level: + com.chaozhanggui.system.openness: info + redis: + # redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突 + database: 5 + # redis服务器地址(默认为localhost) + host: 101.37.12.135 + # redis端口(默认为6379) + port: 6379 + # redis访问密码(默认为空) + password: 111111 + # redis连接超时时间(单位为毫秒) + timeout: 1000 + block-when-exhausted: true + # redis连接池配置 + jedis: + pool: + max-active: 8 + max-idle: 1024 + min-idle: 0 + max-wait: -1 + main: + allow-circular-references: true + rabbitmq: + host: 101.37.12.135 + port: 5672 + username: admin + password: Czg666888 +#分页配置 +pagehelper: + supportMethodsArguments: true + reasonable: true + helperDialect: mysql + params: count=countSql + +mybatis: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + mapper-locations: classpath:mapper/*.xml +ysk: + url: https://gatewaytestapi.sxczgkj.cn/gate-service/ + callBackurl: https://p40312246f.goho.co/cashierService/notify/notifyCallBack + callBackIn: https://p40312246f.goho.co/cashierService/notify/memberInCallBack + default: 18710449883 + + + diff --git a/src/main/resources/application-hph.yml b/src/main/resources/application-hph.yml new file mode 100644 index 0000000..6861969 --- /dev/null +++ b/src/main/resources/application-hph.yml @@ -0,0 +1,59 @@ +spring: + datasource: + url: jdbc:mysql://rm-bp1b572nblln4jho2po.mysql.rds.aliyuncs.com/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false + username: root + password: Czg666888 + driver-class-name: com.mysql.cj.jdbc.Driver + initialSize: 5 + minIdle: 5 + maxActive: 20 + maxWait: 60000 + logging: + level: + com.chaozhanggui.system.openness: info + redis: + # redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突 + database: 5 + # redis服务器地址(默认为localhost) + host: 101.37.12.135 + # redis端口(默认为6379) + port: 6379 + # redis访问密码(默认为空) + password: 111111 + # redis连接超时时间(单位为毫秒) + timeout: 1000 + block-when-exhausted: true + # redis连接池配置 + jedis: + pool: + max-active: 8 + max-idle: 1024 + min-idle: 0 + max-wait: -1 + main: + allow-circular-references: true + rabbitmq: + host: 101.37.12.135 + port: 5672 + username: admin + password: Czg666888 +#分页配置 +pagehelper: + supportMethodsArguments: true + reasonable: true + helperDialect: mysql + params: count=countSql + +mybatis: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + mapper-locations: classpath:mapper/*.xml +ysk: + url: https://gatewaytestapi.sxczgkj.cn/gate-service/ + callBackurl: https://p40312246f.goho.co/cashierService/notify/notifyCallBack + callBackIn: https://p40312246f.goho.co/cashierService/notify/memberInCallBack + default: 18710449883 + + + diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml new file mode 100644 index 0000000..701eaf7 --- /dev/null +++ b/src/main/resources/application-prod.yml @@ -0,0 +1,59 @@ +spring: + datasource: + url: jdbc:mysql://rm-bp1b572nblln4jho2.mysql.rds.aliyuncs.com/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false + username: root + password: Czg666888 + driver-class-name: com.mysql.cj.jdbc.Driver + initialSize: 5 + minIdle: 5 + maxActive: 20 + maxWait: 60000 + logging: + level: + com.chaozhanggui.system.openness: info + redis: + # redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突 + database: 0 + # redis服务器地址(默认为localhost) + host: 127.0.0.1 + # redis端口(默认为6379) + port: 6379 + # redis访问密码(默认为空) + password: 111111 + # redis连接超时时间(单位为毫秒) + timeout: 1000 + block-when-exhausted: true + # redis连接池配置 + jedis: + pool: + max-active: 8 + max-idle: 1024 + min-idle: 0 + max-wait: -1 + main: + allow-circular-references: true + rabbitmq: + host: 127.0.0.1 + port: 5672 + username: admin + password: Czg666888 +#分页配置 +pagehelper: + supportMethodsArguments: true + reasonable: true + helperDialect: mysql + params: count=countSql + +mybatis: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + mapper-locations: classpath:mapper/*.xml +ysk: + url: https://gatewaytestapi.sxczgkj.cn/gate-service/ + callBackurl: https://cashier.sxczgkj.cn/cashierService/notify/notifyCallBack + callBackIn: https://cashier.sxczgkj.cn/cashierService/notify/memberInCallBack + default: 19191703856 + + + diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml new file mode 100644 index 0000000..7704195 --- /dev/null +++ b/src/main/resources/application-test.yml @@ -0,0 +1,58 @@ +spring: + datasource: + url: jdbc:mysql://121.40.128.145:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false + username: root + password: mysqlroot@123 + driver-class-name: com.mysql.cj.jdbc.Driver + initialSize: 5 + minIdle: 5 + maxActive: 20 + maxWait: 60000 + logging: + level: + com.chaozhanggui.system.openness: info + redis: + # redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突 + database: 5 + # redis服务器地址(默认为localhost) + host: 101.37.12.135 + # redis端口(默认为6379) + port: 6379 + # redis访问密码(默认为空) + password: 111111 + # redis连接超时时间(单位为毫秒) + timeout: 1000 + block-when-exhausted: true + # redis连接池配置 + jedis: + pool: + max-active: 8 + max-idle: 1024 + min-idle: 0 + max-wait: -1 + main: + allow-circular-references: true + rabbitmq: + host: 101.37.12.135 + port: 5672 + username: admin + password: Czg666888 +#分页配置 +pagehelper: + supportMethodsArguments: true + reasonable: true + helperDialect: mysql + params: count=countSql + +mybatis: + configuration: + map-underscore-to-camel-case: true + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + mapper-locations: classpath:mapper/*.xml +ysk: + url: https://gatewaytestapi.sxczgkj.cn/gate-service/ + callBackurl: https://cashierapplet.sxczgkj.cn/cashierService/notify/notifyCallBack + callBackIn: https://cashierapplet.sxczgkj.cn/cashierService/notify/memberInCallBack + default: 18710449883 + + diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000..d5c4870 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,49 @@ +server: + port: 9889 + servlet: + context-path: /cashierService/ +wx: + login: + business: + appId: + secrete: + custom: + appId: wxd88fffa983758a30 + secrete: a34a61adc0602118b49400baa8812454 +# +spring: + profiles: + active: prod +websocket: + port: 6001 + action: ws://127.0.0.1 + thread: + boss: 12 + work: 12 +logging: + level: + # web日志 + org.springframework.web: debug + # mybatis日志 + org.mybatis: debug + charset: + # 输出控制台编码 + console: UTF-8 + # 输出文件编码 + file: UTF-8 + # 输出文件名及路径,不配置则不输出文件 + file: + # 切记,该文件表示正在产出日志的日志文件。并不会打包,当文件大于max-file-size,会根据file-name-pattern格式打包 + # 名称为log/cashier-client.log文件夹会在项目根目录下,打包后会在启动包同目录下;名称为/log/cashier-client.log的文件夹会在项目所在磁盘的跟目录下 + name: log/cashierService.log + logback: + rollingpolicy: + # 单文件的大小,默认10M, 超过之后打包成一个日志文件 + max-file-size: 10MB + # 日志保存的天数 + max-history: 30 + # 打包文件格式,默认: ${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz,书写格式为:文件路径/文件名.%i.文件后缀,其中%i不可省去,否则无日志显示 + # 例如: 日期为:2021/11/5 ,则打包文件之后为: log/ota.2021-11-05.0.gz,0表示日志的第一部分,后续就是,1,2,3... + # 如果是压缩包,里面会多一个名log/ota.2021-11-05.0的日志文件 + # 如下面的例子,打包之后为: log/2021-11/cashier-client.2020-11-5.0.log,这是一个日志文件 + file-name-pattern: log/%d{yyyy-MM}/cashierService.%d{yyyy-MM-dd}.%i.log diff --git a/src/main/resources/generator-mapper/generatorConfig.xml b/src/main/resources/generator-mapper/generatorConfig.xml new file mode 100644 index 0000000..6f0944f --- /dev/null +++ b/src/main/resources/generator-mapper/generatorConfig.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    \ No newline at end of file diff --git a/src/main/resources/mapper/SysDeptMapper.xml b/src/main/resources/mapper/SysDeptMapper.xml new file mode 100644 index 0000000..a6609be --- /dev/null +++ b/src/main/resources/mapper/SysDeptMapper.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + dept_id, pid, sub_count, name, dept_sort, enabled, create_by, update_by, create_time, + update_time + + + + delete from sys_dept + where dept_id = #{deptId,jdbcType=BIGINT} + + + insert into sys_dept (dept_id, pid, sub_count, + name, dept_sort, enabled, + create_by, update_by, create_time, + update_time) + values (#{deptId,jdbcType=BIGINT}, #{pid,jdbcType=BIGINT}, #{subCount,jdbcType=INTEGER}, + #{name,jdbcType=VARCHAR}, #{deptSort,jdbcType=INTEGER}, #{enabled,jdbcType=BIT}, + #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}) + + + insert into sys_dept + + + dept_id, + + + pid, + + + sub_count, + + + name, + + + dept_sort, + + + enabled, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{deptId,jdbcType=BIGINT}, + + + #{pid,jdbcType=BIGINT}, + + + #{subCount,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{deptSort,jdbcType=INTEGER}, + + + #{enabled,jdbcType=BIT}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update sys_dept + + + pid = #{pid,jdbcType=BIGINT}, + + + sub_count = #{subCount,jdbcType=INTEGER}, + + + name = #{name,jdbcType=VARCHAR}, + + + dept_sort = #{deptSort,jdbcType=INTEGER}, + + + enabled = #{enabled,jdbcType=BIT}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where dept_id = #{deptId,jdbcType=BIGINT} + + + update sys_dept + set pid = #{pid,jdbcType=BIGINT}, + sub_count = #{subCount,jdbcType=INTEGER}, + name = #{name,jdbcType=VARCHAR}, + dept_sort = #{deptSort,jdbcType=INTEGER}, + enabled = #{enabled,jdbcType=BIT}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where dept_id = #{deptId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysDictDetailMapper.xml b/src/main/resources/mapper/SysDictDetailMapper.xml new file mode 100644 index 0000000..273765a --- /dev/null +++ b/src/main/resources/mapper/SysDictDetailMapper.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + detail_id, dict_id, label, value, dict_sort, create_by, update_by, create_time, update_time + + + + delete from sys_dict_detail + where detail_id = #{detailId,jdbcType=BIGINT} + + + insert into sys_dict_detail (detail_id, dict_id, label, + value, dict_sort, create_by, + update_by, create_time, update_time + ) + values (#{detailId,jdbcType=BIGINT}, #{dictId,jdbcType=BIGINT}, #{label,jdbcType=VARCHAR}, + #{value,jdbcType=VARCHAR}, #{dictSort,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, + #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} + ) + + + insert into sys_dict_detail + + + detail_id, + + + dict_id, + + + label, + + + value, + + + dict_sort, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{detailId,jdbcType=BIGINT}, + + + #{dictId,jdbcType=BIGINT}, + + + #{label,jdbcType=VARCHAR}, + + + #{value,jdbcType=VARCHAR}, + + + #{dictSort,jdbcType=INTEGER}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update sys_dict_detail + + + dict_id = #{dictId,jdbcType=BIGINT}, + + + label = #{label,jdbcType=VARCHAR}, + + + value = #{value,jdbcType=VARCHAR}, + + + dict_sort = #{dictSort,jdbcType=INTEGER}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where detail_id = #{detailId,jdbcType=BIGINT} + + + update sys_dict_detail + set dict_id = #{dictId,jdbcType=BIGINT}, + label = #{label,jdbcType=VARCHAR}, + value = #{value,jdbcType=VARCHAR}, + dict_sort = #{dictSort,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where detail_id = #{detailId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysDictMapper.xml b/src/main/resources/mapper/SysDictMapper.xml new file mode 100644 index 0000000..f1d271e --- /dev/null +++ b/src/main/resources/mapper/SysDictMapper.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + dict_id, name, description, create_by, update_by, create_time, update_time + + + + delete from sys_dict + where dict_id = #{dictId,jdbcType=BIGINT} + + + insert into sys_dict (dict_id, name, description, + create_by, update_by, create_time, + update_time) + values (#{dictId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, + #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}) + + + insert into sys_dict + + + dict_id, + + + name, + + + description, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{dictId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update sys_dict + + + name = #{name,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where dict_id = #{dictId,jdbcType=BIGINT} + + + update sys_dict + set name = #{name,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where dict_id = #{dictId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysJobMapper.xml b/src/main/resources/mapper/SysJobMapper.xml new file mode 100644 index 0000000..085d412 --- /dev/null +++ b/src/main/resources/mapper/SysJobMapper.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + job_id, name, enabled, job_sort, create_by, update_by, create_time, update_time + + + + delete from sys_job + where job_id = #{jobId,jdbcType=BIGINT} + + + insert into sys_job (job_id, name, enabled, + job_sort, create_by, update_by, + create_time, update_time) + values (#{jobId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{enabled,jdbcType=BIT}, + #{jobSort,jdbcType=INTEGER}, #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) + + + insert into sys_job + + + job_id, + + + name, + + + enabled, + + + job_sort, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{jobId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{enabled,jdbcType=BIT}, + + + #{jobSort,jdbcType=INTEGER}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update sys_job + + + name = #{name,jdbcType=VARCHAR}, + + + enabled = #{enabled,jdbcType=BIT}, + + + job_sort = #{jobSort,jdbcType=INTEGER}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where job_id = #{jobId,jdbcType=BIGINT} + + + update sys_job + set name = #{name,jdbcType=VARCHAR}, + enabled = #{enabled,jdbcType=BIT}, + job_sort = #{jobSort,jdbcType=INTEGER}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where job_id = #{jobId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysLogMapper.xml b/src/main/resources/mapper/SysLogMapper.xml new file mode 100644 index 0000000..8a954be --- /dev/null +++ b/src/main/resources/mapper/SysLogMapper.xml @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + log_id, description, log_type, method, request_ip, time, username, address, browser, + create_time + + + params, exception_detail + + + + delete from sys_log + where log_id = #{logId,jdbcType=BIGINT} + + + insert into sys_log (log_id, description, log_type, + method, request_ip, time, + username, address, browser, + create_time, params, exception_detail + ) + values (#{logId,jdbcType=BIGINT}, #{description,jdbcType=VARCHAR}, #{logType,jdbcType=VARCHAR}, + #{method,jdbcType=VARCHAR}, #{requestIp,jdbcType=VARCHAR}, #{time,jdbcType=BIGINT}, + #{username,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{browser,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{params,jdbcType=LONGVARCHAR}, #{exceptionDetail,jdbcType=LONGVARCHAR} + ) + + + insert into sys_log + + + log_id, + + + description, + + + log_type, + + + method, + + + request_ip, + + + time, + + + username, + + + address, + + + browser, + + + create_time, + + + params, + + + exception_detail, + + + + + #{logId,jdbcType=BIGINT}, + + + #{description,jdbcType=VARCHAR}, + + + #{logType,jdbcType=VARCHAR}, + + + #{method,jdbcType=VARCHAR}, + + + #{requestIp,jdbcType=VARCHAR}, + + + #{time,jdbcType=BIGINT}, + + + #{username,jdbcType=VARCHAR}, + + + #{address,jdbcType=VARCHAR}, + + + #{browser,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{params,jdbcType=LONGVARCHAR}, + + + #{exceptionDetail,jdbcType=LONGVARCHAR}, + + + + + update sys_log + + + description = #{description,jdbcType=VARCHAR}, + + + log_type = #{logType,jdbcType=VARCHAR}, + + + method = #{method,jdbcType=VARCHAR}, + + + request_ip = #{requestIp,jdbcType=VARCHAR}, + + + time = #{time,jdbcType=BIGINT}, + + + username = #{username,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + browser = #{browser,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + params = #{params,jdbcType=LONGVARCHAR}, + + + exception_detail = #{exceptionDetail,jdbcType=LONGVARCHAR}, + + + where log_id = #{logId,jdbcType=BIGINT} + + + update sys_log + set description = #{description,jdbcType=VARCHAR}, + log_type = #{logType,jdbcType=VARCHAR}, + method = #{method,jdbcType=VARCHAR}, + request_ip = #{requestIp,jdbcType=VARCHAR}, + time = #{time,jdbcType=BIGINT}, + username = #{username,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + browser = #{browser,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + params = #{params,jdbcType=LONGVARCHAR}, + exception_detail = #{exceptionDetail,jdbcType=LONGVARCHAR} + where log_id = #{logId,jdbcType=BIGINT} + + + update sys_log + set description = #{description,jdbcType=VARCHAR}, + log_type = #{logType,jdbcType=VARCHAR}, + method = #{method,jdbcType=VARCHAR}, + request_ip = #{requestIp,jdbcType=VARCHAR}, + time = #{time,jdbcType=BIGINT}, + username = #{username,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + browser = #{browser,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP} + where log_id = #{logId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysMenuMapper.xml b/src/main/resources/mapper/SysMenuMapper.xml new file mode 100644 index 0000000..868e016 --- /dev/null +++ b/src/main/resources/mapper/SysMenuMapper.xml @@ -0,0 +1,258 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + menu_id, pid, sub_count, type, title, name, component, menu_sort, icon, path, i_frame, + cache, hidden, permission, create_by, update_by, create_time, update_time, active_menu + + + + delete from sys_menu + where menu_id = #{menuId,jdbcType=BIGINT} + + + insert into sys_menu (menu_id, pid, sub_count, + type, title, name, + component, menu_sort, icon, + path, i_frame, cache, hidden, + permission, create_by, update_by, + create_time, update_time, active_menu + ) + values (#{menuId,jdbcType=BIGINT}, #{pid,jdbcType=BIGINT}, #{subCount,jdbcType=INTEGER}, + #{type,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{component,jdbcType=VARCHAR}, #{menuSort,jdbcType=INTEGER}, #{icon,jdbcType=VARCHAR}, + #{path,jdbcType=VARCHAR}, #{iFrame,jdbcType=BIT}, #{cache,jdbcType=BIT}, #{hidden,jdbcType=BIT}, + #{permission,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{activeMenu,jdbcType=VARCHAR} + ) + + + insert into sys_menu + + + menu_id, + + + pid, + + + sub_count, + + + type, + + + title, + + + name, + + + component, + + + menu_sort, + + + icon, + + + path, + + + i_frame, + + + cache, + + + hidden, + + + permission, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + active_menu, + + + + + #{menuId,jdbcType=BIGINT}, + + + #{pid,jdbcType=BIGINT}, + + + #{subCount,jdbcType=INTEGER}, + + + #{type,jdbcType=INTEGER}, + + + #{title,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{component,jdbcType=VARCHAR}, + + + #{menuSort,jdbcType=INTEGER}, + + + #{icon,jdbcType=VARCHAR}, + + + #{path,jdbcType=VARCHAR}, + + + #{iFrame,jdbcType=BIT}, + + + #{cache,jdbcType=BIT}, + + + #{hidden,jdbcType=BIT}, + + + #{permission,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{activeMenu,jdbcType=VARCHAR}, + + + + + update sys_menu + + + pid = #{pid,jdbcType=BIGINT}, + + + sub_count = #{subCount,jdbcType=INTEGER}, + + + type = #{type,jdbcType=INTEGER}, + + + title = #{title,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + component = #{component,jdbcType=VARCHAR}, + + + menu_sort = #{menuSort,jdbcType=INTEGER}, + + + icon = #{icon,jdbcType=VARCHAR}, + + + path = #{path,jdbcType=VARCHAR}, + + + i_frame = #{iFrame,jdbcType=BIT}, + + + cache = #{cache,jdbcType=BIT}, + + + hidden = #{hidden,jdbcType=BIT}, + + + permission = #{permission,jdbcType=VARCHAR}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + active_menu = #{activeMenu,jdbcType=VARCHAR}, + + + where menu_id = #{menuId,jdbcType=BIGINT} + + + update sys_menu + set pid = #{pid,jdbcType=BIGINT}, + sub_count = #{subCount,jdbcType=INTEGER}, + type = #{type,jdbcType=INTEGER}, + title = #{title,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + component = #{component,jdbcType=VARCHAR}, + menu_sort = #{menuSort,jdbcType=INTEGER}, + icon = #{icon,jdbcType=VARCHAR}, + path = #{path,jdbcType=VARCHAR}, + i_frame = #{iFrame,jdbcType=BIT}, + cache = #{cache,jdbcType=BIT}, + hidden = #{hidden,jdbcType=BIT}, + permission = #{permission,jdbcType=VARCHAR}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + active_menu = #{activeMenu,jdbcType=VARCHAR} + where menu_id = #{menuId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysQuartzJobMapper.xml b/src/main/resources/mapper/SysQuartzJobMapper.xml new file mode 100644 index 0000000..2406d33 --- /dev/null +++ b/src/main/resources/mapper/SysQuartzJobMapper.xml @@ -0,0 +1,224 @@ + + + + + + + + + + + + + + + + + + + + + + + job_id, bean_name, cron_expression, is_pause, job_name, method_name, params, description, + person_in_charge, email, sub_task, pause_after_failure, create_by, update_by, create_time, + update_time + + + + delete from sys_quartz_job + where job_id = #{jobId,jdbcType=BIGINT} + + + insert into sys_quartz_job (job_id, bean_name, cron_expression, + is_pause, job_name, method_name, + params, description, person_in_charge, + email, sub_task, pause_after_failure, + create_by, update_by, create_time, + update_time) + values (#{jobId,jdbcType=BIGINT}, #{beanName,jdbcType=VARCHAR}, #{cronExpression,jdbcType=VARCHAR}, + #{isPause,jdbcType=BIT}, #{jobName,jdbcType=VARCHAR}, #{methodName,jdbcType=VARCHAR}, + #{params,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{personInCharge,jdbcType=VARCHAR}, + #{email,jdbcType=VARCHAR}, #{subTask,jdbcType=VARCHAR}, #{pauseAfterFailure,jdbcType=BIT}, + #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}) + + + insert into sys_quartz_job + + + job_id, + + + bean_name, + + + cron_expression, + + + is_pause, + + + job_name, + + + method_name, + + + params, + + + description, + + + person_in_charge, + + + email, + + + sub_task, + + + pause_after_failure, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{jobId,jdbcType=BIGINT}, + + + #{beanName,jdbcType=VARCHAR}, + + + #{cronExpression,jdbcType=VARCHAR}, + + + #{isPause,jdbcType=BIT}, + + + #{jobName,jdbcType=VARCHAR}, + + + #{methodName,jdbcType=VARCHAR}, + + + #{params,jdbcType=VARCHAR}, + + + #{description,jdbcType=VARCHAR}, + + + #{personInCharge,jdbcType=VARCHAR}, + + + #{email,jdbcType=VARCHAR}, + + + #{subTask,jdbcType=VARCHAR}, + + + #{pauseAfterFailure,jdbcType=BIT}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update sys_quartz_job + + + bean_name = #{beanName,jdbcType=VARCHAR}, + + + cron_expression = #{cronExpression,jdbcType=VARCHAR}, + + + is_pause = #{isPause,jdbcType=BIT}, + + + job_name = #{jobName,jdbcType=VARCHAR}, + + + method_name = #{methodName,jdbcType=VARCHAR}, + + + params = #{params,jdbcType=VARCHAR}, + + + description = #{description,jdbcType=VARCHAR}, + + + person_in_charge = #{personInCharge,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + sub_task = #{subTask,jdbcType=VARCHAR}, + + + pause_after_failure = #{pauseAfterFailure,jdbcType=BIT}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where job_id = #{jobId,jdbcType=BIGINT} + + + update sys_quartz_job + set bean_name = #{beanName,jdbcType=VARCHAR}, + cron_expression = #{cronExpression,jdbcType=VARCHAR}, + is_pause = #{isPause,jdbcType=BIT}, + job_name = #{jobName,jdbcType=VARCHAR}, + method_name = #{methodName,jdbcType=VARCHAR}, + params = #{params,jdbcType=VARCHAR}, + description = #{description,jdbcType=VARCHAR}, + person_in_charge = #{personInCharge,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + sub_task = #{subTask,jdbcType=VARCHAR}, + pause_after_failure = #{pauseAfterFailure,jdbcType=BIT}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where job_id = #{jobId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysQuartzLogMapper.xml b/src/main/resources/mapper/SysQuartzLogMapper.xml new file mode 100644 index 0000000..ebb3fea --- /dev/null +++ b/src/main/resources/mapper/SysQuartzLogMapper.xml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + log_id, bean_name, create_time, cron_expression, is_success, job_name, method_name, + params, time + + + exception_detail + + + + delete from sys_quartz_log + where log_id = #{logId,jdbcType=BIGINT} + + + insert into sys_quartz_log (log_id, bean_name, create_time, + cron_expression, is_success, job_name, + method_name, params, time, + exception_detail) + values (#{logId,jdbcType=BIGINT}, #{beanName,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{cronExpression,jdbcType=VARCHAR}, #{isSuccess,jdbcType=BIT}, #{jobName,jdbcType=VARCHAR}, + #{methodName,jdbcType=VARCHAR}, #{params,jdbcType=VARCHAR}, #{time,jdbcType=BIGINT}, + #{exceptionDetail,jdbcType=LONGVARCHAR}) + + + insert into sys_quartz_log + + + log_id, + + + bean_name, + + + create_time, + + + cron_expression, + + + is_success, + + + job_name, + + + method_name, + + + params, + + + time, + + + exception_detail, + + + + + #{logId,jdbcType=BIGINT}, + + + #{beanName,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{cronExpression,jdbcType=VARCHAR}, + + + #{isSuccess,jdbcType=BIT}, + + + #{jobName,jdbcType=VARCHAR}, + + + #{methodName,jdbcType=VARCHAR}, + + + #{params,jdbcType=VARCHAR}, + + + #{time,jdbcType=BIGINT}, + + + #{exceptionDetail,jdbcType=LONGVARCHAR}, + + + + + update sys_quartz_log + + + bean_name = #{beanName,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + cron_expression = #{cronExpression,jdbcType=VARCHAR}, + + + is_success = #{isSuccess,jdbcType=BIT}, + + + job_name = #{jobName,jdbcType=VARCHAR}, + + + method_name = #{methodName,jdbcType=VARCHAR}, + + + params = #{params,jdbcType=VARCHAR}, + + + time = #{time,jdbcType=BIGINT}, + + + exception_detail = #{exceptionDetail,jdbcType=LONGVARCHAR}, + + + where log_id = #{logId,jdbcType=BIGINT} + + + update sys_quartz_log + set bean_name = #{beanName,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + cron_expression = #{cronExpression,jdbcType=VARCHAR}, + is_success = #{isSuccess,jdbcType=BIT}, + job_name = #{jobName,jdbcType=VARCHAR}, + method_name = #{methodName,jdbcType=VARCHAR}, + params = #{params,jdbcType=VARCHAR}, + time = #{time,jdbcType=BIGINT}, + exception_detail = #{exceptionDetail,jdbcType=LONGVARCHAR} + where log_id = #{logId,jdbcType=BIGINT} + + + update sys_quartz_log + set bean_name = #{beanName,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + cron_expression = #{cronExpression,jdbcType=VARCHAR}, + is_success = #{isSuccess,jdbcType=BIT}, + job_name = #{jobName,jdbcType=VARCHAR}, + method_name = #{methodName,jdbcType=VARCHAR}, + params = #{params,jdbcType=VARCHAR}, + time = #{time,jdbcType=BIGINT} + where log_id = #{logId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysRoleMapper.xml b/src/main/resources/mapper/SysRoleMapper.xml new file mode 100644 index 0000000..a647d0b --- /dev/null +++ b/src/main/resources/mapper/SysRoleMapper.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + role_id, name, level, description, data_scope, create_by, update_by, create_time, + update_time + + + + delete from sys_role + where role_id = #{roleId,jdbcType=BIGINT} + + + insert into sys_role (role_id, name, level, + description, data_scope, create_by, + update_by, create_time, update_time + ) + values (#{roleId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, + #{description,jdbcType=VARCHAR}, #{dataScope,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, + #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} + ) + + + insert into sys_role + + + role_id, + + + name, + + + level, + + + description, + + + data_scope, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{roleId,jdbcType=BIGINT}, + + + #{name,jdbcType=VARCHAR}, + + + #{level,jdbcType=INTEGER}, + + + #{description,jdbcType=VARCHAR}, + + + #{dataScope,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update sys_role + + + name = #{name,jdbcType=VARCHAR}, + + + level = #{level,jdbcType=INTEGER}, + + + description = #{description,jdbcType=VARCHAR}, + + + data_scope = #{dataScope,jdbcType=VARCHAR}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where role_id = #{roleId,jdbcType=BIGINT} + + + update sys_role + set name = #{name,jdbcType=VARCHAR}, + level = #{level,jdbcType=INTEGER}, + description = #{description,jdbcType=VARCHAR}, + data_scope = #{dataScope,jdbcType=VARCHAR}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where role_id = #{roleId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysRolesDeptsMapper.xml b/src/main/resources/mapper/SysRolesDeptsMapper.xml new file mode 100644 index 0000000..68c9180 --- /dev/null +++ b/src/main/resources/mapper/SysRolesDeptsMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + delete from sys_roles_depts + where role_id = #{roleId,jdbcType=BIGINT} + and dept_id = #{deptId,jdbcType=BIGINT} + + + insert into sys_roles_depts (role_id, dept_id) + values (#{roleId,jdbcType=BIGINT}, #{deptId,jdbcType=BIGINT}) + + + insert into sys_roles_depts + + + role_id, + + + dept_id, + + + + + #{roleId,jdbcType=BIGINT}, + + + #{deptId,jdbcType=BIGINT}, + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysRolesMenusMapper.xml b/src/main/resources/mapper/SysRolesMenusMapper.xml new file mode 100644 index 0000000..bde4a93 --- /dev/null +++ b/src/main/resources/mapper/SysRolesMenusMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + delete from sys_roles_menus + where menu_id = #{menuId,jdbcType=BIGINT} + and role_id = #{roleId,jdbcType=BIGINT} + + + insert into sys_roles_menus (menu_id, role_id) + values (#{menuId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}) + + + insert into sys_roles_menus + + + menu_id, + + + role_id, + + + + + #{menuId,jdbcType=BIGINT}, + + + #{roleId,jdbcType=BIGINT}, + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysUserMapper.xml b/src/main/resources/mapper/SysUserMapper.xml new file mode 100644 index 0000000..16c759a --- /dev/null +++ b/src/main/resources/mapper/SysUserMapper.xml @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + + + + + + + + + + + user_id, dept_id, username, nick_name, gender, phone, email, avatar_name, avatar_path, + password, is_admin, enabled, create_by, update_by, pwd_reset_time, create_time, update_time + + + + delete from sys_user + where user_id = #{userId,jdbcType=BIGINT} + + + insert into sys_user (user_id, dept_id, username, + nick_name, gender, phone, + email, avatar_name, avatar_path, + password, is_admin, enabled, + create_by, update_by, pwd_reset_time, + create_time, update_time) + values (#{userId,jdbcType=BIGINT}, #{deptId,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, + #{nickName,jdbcType=VARCHAR}, #{gender,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, + #{email,jdbcType=VARCHAR}, #{avatarName,jdbcType=VARCHAR}, #{avatarPath,jdbcType=VARCHAR}, + #{password,jdbcType=VARCHAR}, #{isAdmin,jdbcType=BIT}, #{enabled,jdbcType=BIGINT}, + #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{pwdResetTime,jdbcType=TIMESTAMP}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) + + + insert into sys_user + + + user_id, + + + dept_id, + + + username, + + + nick_name, + + + gender, + + + phone, + + + email, + + + avatar_name, + + + avatar_path, + + + password, + + + is_admin, + + + enabled, + + + create_by, + + + update_by, + + + pwd_reset_time, + + + create_time, + + + update_time, + + + + + #{userId,jdbcType=BIGINT}, + + + #{deptId,jdbcType=BIGINT}, + + + #{username,jdbcType=VARCHAR}, + + + #{nickName,jdbcType=VARCHAR}, + + + #{gender,jdbcType=VARCHAR}, + + + #{phone,jdbcType=VARCHAR}, + + + #{email,jdbcType=VARCHAR}, + + + #{avatarName,jdbcType=VARCHAR}, + + + #{avatarPath,jdbcType=VARCHAR}, + + + #{password,jdbcType=VARCHAR}, + + + #{isAdmin,jdbcType=BIT}, + + + #{enabled,jdbcType=BIGINT}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{pwdResetTime,jdbcType=TIMESTAMP}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update sys_user + + + dept_id = #{deptId,jdbcType=BIGINT}, + + + username = #{username,jdbcType=VARCHAR}, + + + nick_name = #{nickName,jdbcType=VARCHAR}, + + + gender = #{gender,jdbcType=VARCHAR}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + email = #{email,jdbcType=VARCHAR}, + + + avatar_name = #{avatarName,jdbcType=VARCHAR}, + + + avatar_path = #{avatarPath,jdbcType=VARCHAR}, + + + password = #{password,jdbcType=VARCHAR}, + + + is_admin = #{isAdmin,jdbcType=BIT}, + + + enabled = #{enabled,jdbcType=BIGINT}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + pwd_reset_time = #{pwdResetTime,jdbcType=TIMESTAMP}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where user_id = #{userId,jdbcType=BIGINT} + + + update sys_user + set dept_id = #{deptId,jdbcType=BIGINT}, + username = #{username,jdbcType=VARCHAR}, + nick_name = #{nickName,jdbcType=VARCHAR}, + gender = #{gender,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + email = #{email,jdbcType=VARCHAR}, + avatar_name = #{avatarName,jdbcType=VARCHAR}, + avatar_path = #{avatarPath,jdbcType=VARCHAR}, + password = #{password,jdbcType=VARCHAR}, + is_admin = #{isAdmin,jdbcType=BIT}, + enabled = #{enabled,jdbcType=BIGINT}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + pwd_reset_time = #{pwdResetTime,jdbcType=TIMESTAMP}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where user_id = #{userId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysUsersJobsMapper.xml b/src/main/resources/mapper/SysUsersJobsMapper.xml new file mode 100644 index 0000000..7fe509f --- /dev/null +++ b/src/main/resources/mapper/SysUsersJobsMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + delete from sys_users_jobs + where user_id = #{userId,jdbcType=BIGINT} + and job_id = #{jobId,jdbcType=BIGINT} + + + insert into sys_users_jobs (user_id, job_id) + values (#{userId,jdbcType=BIGINT}, #{jobId,jdbcType=BIGINT}) + + + insert into sys_users_jobs + + + user_id, + + + job_id, + + + + + #{userId,jdbcType=BIGINT}, + + + #{jobId,jdbcType=BIGINT}, + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/SysUsersRolesMapper.xml b/src/main/resources/mapper/SysUsersRolesMapper.xml new file mode 100644 index 0000000..34ef125 --- /dev/null +++ b/src/main/resources/mapper/SysUsersRolesMapper.xml @@ -0,0 +1,36 @@ + + + + + + + + + delete from sys_users_roles + where user_id = #{userId,jdbcType=BIGINT} + and role_id = #{roleId,jdbcType=BIGINT} + + + insert into sys_users_roles (user_id, role_id) + values (#{userId,jdbcType=BIGINT}, #{roleId,jdbcType=BIGINT}) + + + insert into sys_users_roles + + + user_id, + + + role_id, + + + + + #{userId,jdbcType=BIGINT}, + + + #{roleId,jdbcType=BIGINT}, + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbCashierCartMapper.xml b/src/main/resources/mapper/TbCashierCartMapper.xml new file mode 100644 index 0000000..0f141c1 --- /dev/null +++ b/src/main/resources/mapper/TbCashierCartMapper.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, master_id, order_id, ref_order_id, total_amount, product_id, cover_img, is_sku,pack_fee,is_pack,is_gift,pending_at, + sku_id, name, sale_price, number, total_number, refund_number, category_id, status, + type, merchant_id, shop_id, created_at, updated_at, user_id, table_id,pack_fee,trade_day,uuid,,sku_name + + + + + + + + + + + + + delete from tb_cashier_cart + where id = #{id,jdbcType=INTEGER} + + + delete from tb_cashier_cart where id = #{cartId} and master_id = #{masterId} + + + delete from tb_cashier_cart where master_id = #{masterId} and shop_id = #{shopId} and status = #{status} and trade_day = #{day} + + + insert into tb_cashier_cart (id, master_id, order_id, + ref_order_id, total_amount, product_id, + cover_img, is_sku, sku_id, + name, sale_price, number, + total_number, refund_number, category_id, + status, type, merchant_id, + shop_id, created_at, updated_at, pack_fee,trade_day,is_pack,is_gift,table_id,user_id + ) + values (#{id,jdbcType=INTEGER}, #{masterId,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR}, + #{refOrderId,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, #{productId,jdbcType=VARCHAR}, + #{coverImg,jdbcType=VARCHAR}, #{isSku,jdbcType=TINYINT}, #{skuId,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{salePrice,jdbcType=DECIMAL}, #{number,jdbcType=REAL}, + #{totalNumber,jdbcType=REAL}, #{refundNumber,jdbcType=REAL}, #{categoryId,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR}, + #{shopId,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{packFee,jdbcType=DECIMAL} + , #{tradeDay,jdbcType=VARCHAR}, #{isPack,jdbcType=VARCHAR}, #{isGift,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER} + ) + + + insert into tb_cashier_cart + + + id, + + + master_id, + + + order_id, + + + ref_order_id, + + + total_amount, + + + product_id, + + + cover_img, + + + is_sku, + + + sku_id, + + + name, + + + sale_price, + + + number, + + + total_number, + + + refund_number, + + + category_id, + + + status, + + + type, + + + merchant_id, + + + shop_id, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{masterId,jdbcType=VARCHAR}, + + + #{orderId,jdbcType=VARCHAR}, + + + #{refOrderId,jdbcType=VARCHAR}, + + + #{totalAmount,jdbcType=DECIMAL}, + + + #{productId,jdbcType=VARCHAR}, + + + #{coverImg,jdbcType=VARCHAR}, + + + #{isSku,jdbcType=TINYINT}, + + + #{skuId,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{salePrice,jdbcType=DECIMAL}, + + + #{number,jdbcType=REAL}, + + + #{totalNumber,jdbcType=REAL}, + + + #{refundNumber,jdbcType=REAL}, + + + #{categoryId,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{type,jdbcType=TINYINT}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + update tb_cashier_cart + + + master_id = #{masterId,jdbcType=VARCHAR}, + + + order_id = #{orderId,jdbcType=VARCHAR}, + + + ref_order_id = #{refOrderId,jdbcType=VARCHAR}, + + + total_amount = #{totalAmount,jdbcType=DECIMAL}, + + + product_id = #{productId,jdbcType=VARCHAR}, + + + cover_img = #{coverImg,jdbcType=VARCHAR}, + + + is_sku = #{isSku,jdbcType=TINYINT}, + + + sku_id = #{skuId,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + sale_price = #{salePrice,jdbcType=DECIMAL}, + + + pack_fee = #{packFee,jdbcType=DECIMAL}, + + + number = #{number,jdbcType=REAL}, + + + total_number = #{totalNumber,jdbcType=REAL}, + + + refund_number = #{refundNumber,jdbcType=REAL}, + + + category_id = #{categoryId,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=TINYINT}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + pending_at = #{pendingAt,jdbcType=BIGINT}, + + + is_gift = #{isGift,jdbcType=BIGINT}, + + + is_pack = #{isPack,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_cashier_cart + set master_id = #{masterId,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=VARCHAR}, + ref_order_id = #{refOrderId,jdbcType=VARCHAR}, + total_amount = #{totalAmount,jdbcType=DECIMAL}, + product_id = #{productId,jdbcType=VARCHAR}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + is_sku = #{isSku,jdbcType=TINYINT}, + sku_id = #{skuId,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + sale_price = #{salePrice,jdbcType=DECIMAL}, + number = #{number,jdbcType=REAL}, + total_number = #{totalNumber,jdbcType=REAL}, + refund_number = #{refundNumber,jdbcType=REAL}, + category_id = #{categoryId,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + type = #{type,jdbcType=TINYINT}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + + update tb_cashier_cart set status = #{status} where id = #{id} + + + update tb_cashier_cart set status = #{status} where shop_id = #{shopId} and master_id = #{masterId} and trade_day = #{day} + + + + update tb_cashier_cart set `status`='final' where order_id=#{orderId} and `status`='create' + + + update tb_cashier_cart set is_pack = #{status} where master_id = #{maskerId} and trade_day = #{day} and shop_id = #{shopId} + + + update tb_cashier_cart + + status = #{status} + + where order_id =#{orderId} + + + + update tb_cashier_cart set status = #{status} where table_id = #{tableId} and status = 'create' + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbDeviceOperateInfoMapper.xml b/src/main/resources/mapper/TbDeviceOperateInfoMapper.xml new file mode 100644 index 0000000..bd36c49 --- /dev/null +++ b/src/main/resources/mapper/TbDeviceOperateInfoMapper.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + id, deviceNo, type, shop_id, createTime, remark + + + + delete from tb_device_operate_info + where id = #{id,jdbcType=INTEGER} + + + insert into tb_device_operate_info (id, deviceNo, type, + shop_id, createTime, remark + ) + values (#{id,jdbcType=INTEGER}, #{deviceno,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{shopId,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR} + ) + + + insert into tb_device_operate_info + + + id, + + + deviceNo, + + + type, + + + shop_id, + + + createTime, + + + remark, + + + + + #{id,jdbcType=INTEGER}, + + + #{deviceno,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{createtime,jdbcType=TIMESTAMP}, + + + #{remark,jdbcType=VARCHAR}, + + + + + update tb_device_operate_info + + + deviceNo = #{deviceno,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + createTime = #{createtime,jdbcType=TIMESTAMP}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_device_operate_info + set deviceNo = #{deviceno,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + createTime = #{createtime,jdbcType=TIMESTAMP}, + remark = #{remark,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbDeviceStockMapper.xml b/src/main/resources/mapper/TbDeviceStockMapper.xml new file mode 100644 index 0000000..a4e401e --- /dev/null +++ b/src/main/resources/mapper/TbDeviceStockMapper.xml @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, code, snNo, orderNo, price, type, groupNo, buyMercName, buyMercId, actMercName, + actMercId, status, createTime, createBy, delFlag, remarks, updateTime, deviceNo, + belongUserId, extractUserId, roleCode, inStockTime, transferStatus, bindTime + + + + delete from tb_device_stock + where id = #{id,jdbcType=INTEGER} + + + insert into tb_device_stock (id, code, snNo, + orderNo, price, type, + groupNo, buyMercName, buyMercId, + actMercName, actMercId, status, + createTime, createBy, delFlag, + remarks, updateTime, deviceNo, + belongUserId, extractUserId, roleCode, + inStockTime, transferStatus, bindTime + ) + values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{snno,jdbcType=VARCHAR}, + #{orderno,jdbcType=VARCHAR}, #{price,jdbcType=DECIMAL}, #{type,jdbcType=VARCHAR}, + #{groupno,jdbcType=VARCHAR}, #{buymercname,jdbcType=VARCHAR}, #{buymercid,jdbcType=VARCHAR}, + #{actmercname,jdbcType=VARCHAR}, #{actmercid,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, + #{createtime,jdbcType=TIMESTAMP}, #{createby,jdbcType=VARCHAR}, #{delflag,jdbcType=VARCHAR}, + #{remarks,jdbcType=VARCHAR}, #{updatetime,jdbcType=TIMESTAMP}, #{deviceno,jdbcType=VARCHAR}, + #{belonguserid,jdbcType=INTEGER}, #{extractuserid,jdbcType=INTEGER}, #{rolecode,jdbcType=VARCHAR}, + #{instocktime,jdbcType=TIMESTAMP}, #{transferstatus,jdbcType=VARCHAR}, #{bindtime,jdbcType=TIMESTAMP} + ) + + + insert into tb_device_stock + + + id, + + + code, + + + snNo, + + + orderNo, + + + price, + + + type, + + + groupNo, + + + buyMercName, + + + buyMercId, + + + actMercName, + + + actMercId, + + + status, + + + createTime, + + + createBy, + + + delFlag, + + + remarks, + + + updateTime, + + + deviceNo, + + + belongUserId, + + + extractUserId, + + + roleCode, + + + inStockTime, + + + transferStatus, + + + bindTime, + + + + + #{id,jdbcType=INTEGER}, + + + #{code,jdbcType=VARCHAR}, + + + #{snno,jdbcType=VARCHAR}, + + + #{orderno,jdbcType=VARCHAR}, + + + #{price,jdbcType=DECIMAL}, + + + #{type,jdbcType=VARCHAR}, + + + #{groupno,jdbcType=VARCHAR}, + + + #{buymercname,jdbcType=VARCHAR}, + + + #{buymercid,jdbcType=VARCHAR}, + + + #{actmercname,jdbcType=VARCHAR}, + + + #{actmercid,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{createtime,jdbcType=TIMESTAMP}, + + + #{createby,jdbcType=VARCHAR}, + + + #{delflag,jdbcType=VARCHAR}, + + + #{remarks,jdbcType=VARCHAR}, + + + #{updatetime,jdbcType=TIMESTAMP}, + + + #{deviceno,jdbcType=VARCHAR}, + + + #{belonguserid,jdbcType=INTEGER}, + + + #{extractuserid,jdbcType=INTEGER}, + + + #{rolecode,jdbcType=VARCHAR}, + + + #{instocktime,jdbcType=TIMESTAMP}, + + + #{transferstatus,jdbcType=VARCHAR}, + + + #{bindtime,jdbcType=TIMESTAMP}, + + + + + update tb_device_stock + + + code = #{code,jdbcType=VARCHAR}, + + + snNo = #{snno,jdbcType=VARCHAR}, + + + orderNo = #{orderno,jdbcType=VARCHAR}, + + + price = #{price,jdbcType=DECIMAL}, + + + type = #{type,jdbcType=VARCHAR}, + + + groupNo = #{groupno,jdbcType=VARCHAR}, + + + buyMercName = #{buymercname,jdbcType=VARCHAR}, + + + buyMercId = #{buymercid,jdbcType=VARCHAR}, + + + actMercName = #{actmercname,jdbcType=VARCHAR}, + + + actMercId = #{actmercid,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + createTime = #{createtime,jdbcType=TIMESTAMP}, + + + createBy = #{createby,jdbcType=VARCHAR}, + + + delFlag = #{delflag,jdbcType=VARCHAR}, + + + remarks = #{remarks,jdbcType=VARCHAR}, + + + updateTime = #{updatetime,jdbcType=TIMESTAMP}, + + + deviceNo = #{deviceno,jdbcType=VARCHAR}, + + + belongUserId = #{belonguserid,jdbcType=INTEGER}, + + + extractUserId = #{extractuserid,jdbcType=INTEGER}, + + + roleCode = #{rolecode,jdbcType=VARCHAR}, + + + inStockTime = #{instocktime,jdbcType=TIMESTAMP}, + + + transferStatus = #{transferstatus,jdbcType=VARCHAR}, + + + bindTime = #{bindtime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_device_stock + set code = #{code,jdbcType=VARCHAR}, + snNo = #{snno,jdbcType=VARCHAR}, + orderNo = #{orderno,jdbcType=VARCHAR}, + price = #{price,jdbcType=DECIMAL}, + type = #{type,jdbcType=VARCHAR}, + groupNo = #{groupno,jdbcType=VARCHAR}, + buyMercName = #{buymercname,jdbcType=VARCHAR}, + buyMercId = #{buymercid,jdbcType=VARCHAR}, + actMercName = #{actmercname,jdbcType=VARCHAR}, + actMercId = #{actmercid,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + createTime = #{createtime,jdbcType=TIMESTAMP}, + createBy = #{createby,jdbcType=VARCHAR}, + delFlag = #{delflag,jdbcType=VARCHAR}, + remarks = #{remarks,jdbcType=VARCHAR}, + updateTime = #{updatetime,jdbcType=TIMESTAMP}, + deviceNo = #{deviceno,jdbcType=VARCHAR}, + belongUserId = #{belonguserid,jdbcType=INTEGER}, + extractUserId = #{extractuserid,jdbcType=INTEGER}, + roleCode = #{rolecode,jdbcType=VARCHAR}, + inStockTime = #{instocktime,jdbcType=TIMESTAMP}, + transferStatus = #{transferstatus,jdbcType=VARCHAR}, + bindTime = #{bindtime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbMemberInMapper.xml b/src/main/resources/mapper/TbMemberInMapper.xml new file mode 100644 index 0000000..86a82fc --- /dev/null +++ b/src/main/resources/mapper/TbMemberInMapper.xml @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + id, user_id, merchant_id, code, amount, status, order_no, trade_no, create_time, + update_time + + + + delete from tb_member_in + where id = #{id,jdbcType=INTEGER} + + + insert into tb_member_in (id, user_id, merchant_id, + code, amount, status, + order_no, trade_no, create_time, + update_time) + values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=INTEGER}, #{merchantId,jdbcType=INTEGER}, + #{code,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, + #{orderNo,jdbcType=VARCHAR}, #{tradeNo,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, + #{updateTime,jdbcType=TIMESTAMP}) + + + insert into tb_member_in + + + id, + + + user_id, + + + merchant_id, + + + code, + + + amount, + + + status, + + + order_no, + + + trade_no, + + + create_time, + + + update_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{userId,jdbcType=INTEGER}, + + + #{merchantId,jdbcType=INTEGER}, + + + #{code,jdbcType=VARCHAR}, + + + #{amount,jdbcType=DECIMAL}, + + + #{status,jdbcType=VARCHAR}, + + + #{orderNo,jdbcType=VARCHAR}, + + + #{tradeNo,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update tb_member_in + + + user_id = #{userId,jdbcType=INTEGER}, + + + merchant_id = #{merchantId,jdbcType=INTEGER}, + + + code = #{code,jdbcType=VARCHAR}, + + + amount = #{amount,jdbcType=DECIMAL}, + + + status = #{status,jdbcType=VARCHAR}, + + + order_no = #{orderNo,jdbcType=VARCHAR}, + + + trade_no = #{tradeNo,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_member_in + set user_id = #{userId,jdbcType=INTEGER}, + merchant_id = #{merchantId,jdbcType=INTEGER}, + code = #{code,jdbcType=VARCHAR}, + amount = #{amount,jdbcType=DECIMAL}, + status = #{status,jdbcType=VARCHAR}, + order_no = #{orderNo,jdbcType=VARCHAR}, + trade_no = #{tradeNo,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbMerchantAccountDao.xml b/src/main/resources/mapper/TbMerchantAccountDao.xml new file mode 100644 index 0000000..2da118a --- /dev/null +++ b/src/main/resources/mapper/TbMerchantAccountDao.xml @@ -0,0 +1,310 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into tb_merchant_account(account, password, merchant_id, shop_id, shop_snap, is_admin, is_mercantile, name, sex, email, head_img, telephone, status, sort, role_id, last_login_at, mp_open_id, msg_able, created_at, updated_at) + values (#{account}, #{password}, #{merchantId}, #{shopId}, #{shopSnap}, #{isAdmin}, #{isMercantile}, #{name}, #{sex}, #{email}, #{headImg}, #{telephone}, #{status}, #{sort}, #{roleId}, #{lastLoginAt}, #{mpOpenId}, #{msgAble}, #{createdAt}, #{updatedAt}) + + + + insert into tb_merchant_account(account, password, merchant_id, shop_id, shop_snap, is_admin, is_mercantile, name, sex, email, head_img, telephone, status, sort, role_id, last_login_at, mp_open_id, msg_able, created_at, updated_at) + values + + (#{entity.account}, #{entity.password}, #{entity.merchantId}, #{entity.shopId}, #{entity.shopSnap}, #{entity.isAdmin}, #{entity.isMercantile}, #{entity.name}, #{entity.sex}, #{entity.email}, #{entity.headImg}, #{entity.telephone}, #{entity.status}, #{entity.sort}, #{entity.roleId}, #{entity.lastLoginAt}, #{entity.mpOpenId}, #{entity.msgAble}, #{entity.createdAt}, #{entity.updatedAt}) + + + + + insert into tb_merchant_account(account, password, merchant_id, shop_id, shop_snap, is_admin, is_mercantile, name, sex, email, head_img, telephone, status, sort, role_id, last_login_at, mp_open_id, msg_able, created_at, updated_at) + values + + (#{entity.account}, #{entity.password}, #{entity.merchantId}, #{entity.shopId}, #{entity.shopSnap}, #{entity.isAdmin}, #{entity.isMercantile}, #{entity.name}, #{entity.sex}, #{entity.email}, #{entity.headImg}, #{entity.telephone}, #{entity.status}, #{entity.sort}, #{entity.roleId}, #{entity.lastLoginAt}, #{entity.mpOpenId}, #{entity.msgAble}, #{entity.createdAt}, #{entity.updatedAt}) + + on duplicate key update + account = values(account), + password = values(password), + merchant_id = values(merchant_id), + shop_id = values(shop_id), + shop_snap = values(shop_snap), + is_admin = values(is_admin), + is_mercantile = values(is_mercantile), + name = values(name), + sex = values(sex), + email = values(email), + head_img = values(head_img), + telephone = values(telephone), + status = values(status), + sort = values(sort), + role_id = values(role_id), + last_login_at = values(last_login_at), + mp_open_id = values(mp_open_id), + msg_able = values(msg_able), + created_at = values(created_at), + updated_at = values(updated_at) + + + + + update tb_merchant_account + + + account = #{account}, + + + password = #{password}, + + + merchant_id = #{merchantId}, + + + shop_id = #{shopId}, + + + shop_snap = #{shopSnap}, + + + is_admin = #{isAdmin}, + + + is_mercantile = #{isMercantile}, + + + name = #{name}, + + + sex = #{sex}, + + + email = #{email}, + + + head_img = #{headImg}, + + + telephone = #{telephone}, + + + status = #{status}, + + + sort = #{sort}, + + + role_id = #{roleId}, + + + last_login_at = #{lastLoginAt}, + + + mp_open_id = #{mpOpenId}, + + + msg_able = #{msgAble}, + + + created_at = #{createdAt}, + + + updated_at = #{updatedAt}, + + + where id = #{id} + + + + + delete from tb_merchant_account where id = #{id} + + + + diff --git a/src/main/resources/mapper/TbMerchantRegisterMapper.xml b/src/main/resources/mapper/TbMerchantRegisterMapper.xml new file mode 100644 index 0000000..1cdbcc9 --- /dev/null +++ b/src/main/resources/mapper/TbMerchantRegisterMapper.xml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id, register_code, app_code, telephone, merchant_id, shop_id, type, amount, period_year, + name, address, logo, industry, industry_name, status, limit_shop_number, source_path, + created_at, updated_at + + + + delete from tb_merchant_register + where id = #{id,jdbcType=INTEGER} + + + insert into tb_merchant_register (id, register_code, app_code, + telephone, merchant_id, shop_id, + type, amount, period_year, + name, address, logo, + industry, industry_name, status, + limit_shop_number, source_path, created_at, + updated_at) + values (#{id,jdbcType=INTEGER}, #{registerCode,jdbcType=VARCHAR}, #{appCode,jdbcType=VARCHAR}, + #{telephone,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{periodYear,jdbcType=INTEGER}, + #{name,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR}, + #{industry,jdbcType=VARCHAR}, #{industryName,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, + #{limitShopNumber,jdbcType=INTEGER}, #{sourcePath,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}) + + + insert into tb_merchant_register + + + id, + + + register_code, + + + app_code, + + + telephone, + + + merchant_id, + + + shop_id, + + + type, + + + amount, + + + period_year, + + + name, + + + address, + + + logo, + + + industry, + + + industry_name, + + + status, + + + limit_shop_number, + + + source_path, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{registerCode,jdbcType=VARCHAR}, + + + #{appCode,jdbcType=VARCHAR}, + + + #{telephone,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{amount,jdbcType=DECIMAL}, + + + #{periodYear,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{address,jdbcType=VARCHAR}, + + + #{logo,jdbcType=VARCHAR}, + + + #{industry,jdbcType=VARCHAR}, + + + #{industryName,jdbcType=VARCHAR}, + + + #{status,jdbcType=INTEGER}, + + + #{limitShopNumber,jdbcType=INTEGER}, + + + #{sourcePath,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + update tb_merchant_register + + + register_code = #{registerCode,jdbcType=VARCHAR}, + + + app_code = #{appCode,jdbcType=VARCHAR}, + + + telephone = #{telephone,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + amount = #{amount,jdbcType=DECIMAL}, + + + period_year = #{periodYear,jdbcType=INTEGER}, + + + name = #{name,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + logo = #{logo,jdbcType=VARCHAR}, + + + industry = #{industry,jdbcType=VARCHAR}, + + + industry_name = #{industryName,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=INTEGER}, + + + limit_shop_number = #{limitShopNumber,jdbcType=INTEGER}, + + + source_path = #{sourcePath,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_merchant_register + set register_code = #{registerCode,jdbcType=VARCHAR}, + app_code = #{appCode,jdbcType=VARCHAR}, + telephone = #{telephone,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + amount = #{amount,jdbcType=DECIMAL}, + period_year = #{periodYear,jdbcType=INTEGER}, + name = #{name,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + logo = #{logo,jdbcType=VARCHAR}, + industry = #{industry,jdbcType=VARCHAR}, + industry_name = #{industryName,jdbcType=VARCHAR}, + status = #{status,jdbcType=INTEGER}, + limit_shop_number = #{limitShopNumber,jdbcType=INTEGER}, + source_path = #{sourcePath,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbMerchantThirdApplyMapper.xml b/src/main/resources/mapper/TbMerchantThirdApplyMapper.xml new file mode 100644 index 0000000..d9782c3 --- /dev/null +++ b/src/main/resources/mapper/TbMerchantThirdApplyMapper.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + id, type, app_id, status, pay_password, applyment_state, created_at, updated_at + + + app_token + + + + delete from tb_merchant_third_apply + where id = #{id,jdbcType=INTEGER} + + + insert into tb_merchant_third_apply (id, type, app_id, + status, pay_password, applyment_state, + created_at, updated_at, app_token + ) + values (#{id,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR}, + #{status,jdbcType=TINYINT}, #{payPassword,jdbcType=VARCHAR}, #{applymentState,jdbcType=VARCHAR}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{appToken,jdbcType=LONGVARCHAR} + ) + + + insert into tb_merchant_third_apply + + + id, + + + type, + + + app_id, + + + status, + + + pay_password, + + + applyment_state, + + + created_at, + + + updated_at, + + + app_token, + + + + + #{id,jdbcType=INTEGER}, + + + #{type,jdbcType=VARCHAR}, + + + #{appId,jdbcType=VARCHAR}, + + + #{status,jdbcType=TINYINT}, + + + #{payPassword,jdbcType=VARCHAR}, + + + #{applymentState,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{appToken,jdbcType=LONGVARCHAR}, + + + + + update tb_merchant_third_apply + + + type = #{type,jdbcType=VARCHAR}, + + + app_id = #{appId,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=TINYINT}, + + + pay_password = #{payPassword,jdbcType=VARCHAR}, + + + applyment_state = #{applymentState,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + app_token = #{appToken,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_merchant_third_apply + set type = #{type,jdbcType=VARCHAR}, + app_id = #{appId,jdbcType=VARCHAR}, + status = #{status,jdbcType=TINYINT}, + pay_password = #{payPassword,jdbcType=VARCHAR}, + applyment_state = #{applymentState,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + app_token = #{appToken,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_merchant_third_apply + set type = #{type,jdbcType=VARCHAR}, + app_id = #{appId,jdbcType=VARCHAR}, + status = #{status,jdbcType=TINYINT}, + pay_password = #{payPassword,jdbcType=VARCHAR}, + applyment_state = #{applymentState,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbOrderDetailMapper.xml b/src/main/resources/mapper/TbOrderDetailMapper.xml new file mode 100644 index 0000000..b7645cb --- /dev/null +++ b/src/main/resources/mapper/TbOrderDetailMapper.xml @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + id, order_id, shop_id, product_id, product_sku_id, num, product_name, product_sku_name, + product_img, create_time, update_time, price, price_amount,status,pack_amount + + + + + delete from tb_order_detail + where id = #{id,jdbcType=INTEGER} + + + delete from tb_order_detail where order_id = #{orderId} + + + insert into tb_order_detail (id, order_id, shop_id, + product_id, product_sku_id, num, + product_name, product_sku_name, product_img, + create_time, update_time, price, + price_amount,pack_amount,status) + values (#{id,jdbcType=INTEGER}, #{orderId,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, + #{productId,jdbcType=INTEGER}, #{productSkuId,jdbcType=INTEGER}, #{num,jdbcType=INTEGER}, + #{productName,jdbcType=VARCHAR}, #{productSkuName,jdbcType=VARCHAR}, #{productImg,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{price,jdbcType=DECIMAL}, + #{priceAmount,jdbcType=DECIMAL},#{packAmount,jdbcType=DECIMAL},#{status,jdbcType=VARCHAR}) + + + insert into tb_order_detail + + + id, + + + order_id, + + + shop_id, + + + product_id, + + + product_sku_id, + + + num, + + + product_name, + + + product_sku_name, + + + product_img, + + + create_time, + + + update_time, + + + price, + + + price_amount, + + + + + #{id,jdbcType=INTEGER}, + + + #{orderId,jdbcType=INTEGER}, + + + #{shopId,jdbcType=INTEGER}, + + + #{productId,jdbcType=INTEGER}, + + + #{productSkuId,jdbcType=INTEGER}, + + + #{num,jdbcType=INTEGER}, + + + #{productName,jdbcType=VARCHAR}, + + + #{productSkuName,jdbcType=VARCHAR}, + + + #{productImg,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + #{price,jdbcType=DECIMAL}, + + + #{priceAmount,jdbcType=DECIMAL}, + + + + + update tb_order_detail + + + order_id = #{orderId,jdbcType=INTEGER}, + + + shop_id = #{shopId,jdbcType=INTEGER}, + + + product_id = #{productId,jdbcType=INTEGER}, + + + product_sku_id = #{productSkuId,jdbcType=INTEGER}, + + + num = #{num,jdbcType=INTEGER}, + + + product_name = #{productName,jdbcType=VARCHAR}, + + + sstatus = #{sstatus,jdbcType=VARCHAR}, + + + product_sku_name = #{productSkuName,jdbcType=VARCHAR}, + + + product_img = #{productImg,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + price = #{price,jdbcType=DECIMAL}, + + + price_amount = #{priceAmount,jdbcType=DECIMAL}, + + + pack_amount = #{packAmount,jdbcType=DECIMAL}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_order_detail + set order_id = #{orderId,jdbcType=INTEGER}, + shop_id = #{shopId,jdbcType=INTEGER}, + product_id = #{productId,jdbcType=INTEGER}, + product_sku_id = #{productSkuId,jdbcType=INTEGER}, + num = #{num,jdbcType=INTEGER}, + product_name = #{productName,jdbcType=VARCHAR}, + product_sku_name = #{productSkuName,jdbcType=VARCHAR}, + product_img = #{productImg,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + price = #{price,jdbcType=DECIMAL}, + price_amount = #{priceAmount,jdbcType=DECIMAL} + where id = #{id,jdbcType=INTEGER} + + + update tb_order_detail set status = #{status} where order_id = #{orderId} + + + + + + + + + update tb_order_detail set status = #{status} where order_id = #{orderId} and status='unpaid' + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbOrderExtendMapper.xml b/src/main/resources/mapper/TbOrderExtendMapper.xml new file mode 100644 index 0000000..eaeed44 --- /dev/null +++ b/src/main/resources/mapper/TbOrderExtendMapper.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + id, creator_snap, cashier_snap, terminal_snap, table_party, shop_id, created_at, + updated_at, shop_snap + + + cart_list, payment_list + + + + delete from tb_order_extend + where id = #{id,jdbcType=INTEGER} + + + insert into tb_order_extend (id, creator_snap, cashier_snap, + terminal_snap, table_party, shop_id, + created_at, updated_at, shop_snap, + cart_list, payment_list) + values (#{id,jdbcType=INTEGER}, #{creatorSnap,jdbcType=VARCHAR}, #{cashierSnap,jdbcType=VARCHAR}, + #{terminalSnap,jdbcType=VARCHAR}, #{tableParty,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{shopSnap,jdbcType=VARCHAR}, + #{cartList,jdbcType=LONGVARCHAR}, #{paymentList,jdbcType=LONGVARCHAR}) + + + insert into tb_order_extend + + + id, + + + creator_snap, + + + cashier_snap, + + + terminal_snap, + + + table_party, + + + shop_id, + + + created_at, + + + updated_at, + + + shop_snap, + + + cart_list, + + + payment_list, + + + + + #{id,jdbcType=INTEGER}, + + + #{creatorSnap,jdbcType=VARCHAR}, + + + #{cashierSnap,jdbcType=VARCHAR}, + + + #{terminalSnap,jdbcType=VARCHAR}, + + + #{tableParty,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{shopSnap,jdbcType=VARCHAR}, + + + #{cartList,jdbcType=LONGVARCHAR}, + + + #{paymentList,jdbcType=LONGVARCHAR}, + + + + + update tb_order_extend + + + creator_snap = #{creatorSnap,jdbcType=VARCHAR}, + + + cashier_snap = #{cashierSnap,jdbcType=VARCHAR}, + + + terminal_snap = #{terminalSnap,jdbcType=VARCHAR}, + + + table_party = #{tableParty,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + shop_snap = #{shopSnap,jdbcType=VARCHAR}, + + + cart_list = #{cartList,jdbcType=LONGVARCHAR}, + + + payment_list = #{paymentList,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_order_extend + set creator_snap = #{creatorSnap,jdbcType=VARCHAR}, + cashier_snap = #{cashierSnap,jdbcType=VARCHAR}, + terminal_snap = #{terminalSnap,jdbcType=VARCHAR}, + table_party = #{tableParty,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + shop_snap = #{shopSnap,jdbcType=VARCHAR}, + cart_list = #{cartList,jdbcType=LONGVARCHAR}, + payment_list = #{paymentList,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_order_extend + set creator_snap = #{creatorSnap,jdbcType=VARCHAR}, + cashier_snap = #{cashierSnap,jdbcType=VARCHAR}, + terminal_snap = #{terminalSnap,jdbcType=VARCHAR}, + table_party = #{tableParty,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + shop_snap = #{shopSnap,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbOrderInfoMapper.xml b/src/main/resources/mapper/TbOrderInfoMapper.xml new file mode 100644 index 0000000..eaa9bc4 --- /dev/null +++ b/src/main/resources/mapper/TbOrderInfoMapper.xml @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, order_no, settlement_amount, pack_fee, origin_amount, product_amount, amount, + refund_amount, pay_type, pay_amount, order_amount, freight_amount, discount_ratio, + discount_amount, table_id, small_change, send_type, order_type, product_type, status, + billing_id, merchant_id, shop_id, is_vip, member_id, user_id, product_score, deduct_score, + user_coupon_id, user_coupon_amount, refund_able, paid_time, is_effect, is_group, + updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,remark,master_id,`table_name` + + + + delete from tb_order_info + where id = #{id,jdbcType=INTEGER} + + + + insert into tb_order_info (id, order_no, settlement_amount, + pack_fee, origin_amount, product_amount, + amount, refund_amount, pay_type, + pay_amount, order_amount, freight_amount, + discount_ratio, discount_amount, table_id, + small_change, send_type, order_type, + product_type, status, billing_id, + merchant_id, shop_id, is_vip, + member_id, user_id, product_score, + deduct_score, user_coupon_id, user_coupon_amount, + refund_able, paid_time, is_effect, + is_group, updated_at, system_time, + created_at, is_accepted, pay_order_no,trade_day,source,remark,master_id,table_name + ) + values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL}, + #{packFee,jdbcType=DECIMAL}, #{originAmount,jdbcType=DECIMAL}, #{productAmount,jdbcType=DECIMAL}, + #{amount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR}, + #{payAmount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL}, + #{discountRatio,jdbcType=DECIMAL}, #{discountAmount,jdbcType=DECIMAL}, #{tableId,jdbcType=VARCHAR}, + #{smallChange,jdbcType=DECIMAL}, #{sendType,jdbcType=VARCHAR}, #{orderType,jdbcType=VARCHAR}, + #{productType,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{billingId,jdbcType=VARCHAR}, + #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{isVip,jdbcType=TINYINT}, + #{memberId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{productScore,jdbcType=INTEGER}, + #{deductScore,jdbcType=INTEGER}, #{userCouponId,jdbcType=VARCHAR}, #{userCouponAmount,jdbcType=DECIMAL}, + #{refundAble,jdbcType=TINYINT}, #{paidTime,jdbcType=BIGINT}, #{isEffect,jdbcType=TINYINT}, + #{isGroup,jdbcType=TINYINT}, #{updatedAt,jdbcType=BIGINT}, #{systemTime,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}, #{isAccepted,jdbcType=TINYINT}, #{payOrderNo,jdbcType=VARCHAR}, + #{tradeDay,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR}, #{masterId,jdbcType=VARCHAR}, #{tableName,jdbcType=VARCHAR} + ) + + + insert into tb_order_info + + + id, + + + order_no, + + + settlement_amount, + + + pack_fee, + + + origin_amount, + + + product_amount, + + + amount, + + + refund_amount, + + + pay_type, + + + pay_amount, + + + order_amount, + + + freight_amount, + + + discount_ratio, + + + discount_amount, + + + table_id, + + + small_change, + + + send_type, + + + order_type, + + + product_type, + + + status, + + + billing_id, + + + merchant_id, + + + shop_id, + + + is_vip, + + + member_id, + + + user_id, + + + product_score, + + + deduct_score, + + + user_coupon_id, + + + user_coupon_amount, + + + refund_able, + + + paid_time, + + + is_effect, + + + is_group, + + + updated_at, + + + system_time, + + + created_at, + + + is_accepted, + + + pay_order_no, + + + + + #{id,jdbcType=INTEGER}, + + + #{orderNo,jdbcType=VARCHAR}, + + + #{settlementAmount,jdbcType=DECIMAL}, + + + #{packFee,jdbcType=DECIMAL}, + + + #{originAmount,jdbcType=DECIMAL}, + + + #{productAmount,jdbcType=DECIMAL}, + + + #{amount,jdbcType=DECIMAL}, + + + #{refundAmount,jdbcType=DECIMAL}, + + + #{payType,jdbcType=VARCHAR}, + + + #{payAmount,jdbcType=DECIMAL}, + + + #{orderAmount,jdbcType=DECIMAL}, + + + #{freightAmount,jdbcType=DECIMAL}, + + + #{discountRatio,jdbcType=DECIMAL}, + + + #{discountAmount,jdbcType=DECIMAL}, + + + #{tableId,jdbcType=VARCHAR}, + + + #{smallChange,jdbcType=DECIMAL}, + + + #{sendType,jdbcType=VARCHAR}, + + + #{orderType,jdbcType=VARCHAR}, + + + #{productType,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{billingId,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{isVip,jdbcType=TINYINT}, + + + #{memberId,jdbcType=VARCHAR}, + + + #{userId,jdbcType=VARCHAR}, + + + #{productScore,jdbcType=INTEGER}, + + + #{deductScore,jdbcType=INTEGER}, + + + #{userCouponId,jdbcType=VARCHAR}, + + + #{userCouponAmount,jdbcType=DECIMAL}, + + + #{refundAble,jdbcType=TINYINT}, + + + #{paidTime,jdbcType=BIGINT}, + + + #{isEffect,jdbcType=TINYINT}, + + + #{isGroup,jdbcType=TINYINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{systemTime,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{isAccepted,jdbcType=TINYINT}, + + + #{payOrderNo,jdbcType=VARCHAR}, + + + + + update tb_order_info + + + order_no = #{orderNo,jdbcType=VARCHAR}, + + + settlement_amount = #{settlementAmount,jdbcType=DECIMAL}, + + + pack_fee = #{packFee,jdbcType=DECIMAL}, + + + origin_amount = #{originAmount,jdbcType=DECIMAL}, + + + product_amount = #{productAmount,jdbcType=DECIMAL}, + + + amount = #{amount,jdbcType=DECIMAL}, + + + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + + + pay_type = #{payType,jdbcType=VARCHAR}, + + + pay_amount = #{payAmount,jdbcType=DECIMAL}, + + + order_amount = #{orderAmount,jdbcType=DECIMAL}, + + + freight_amount = #{freightAmount,jdbcType=DECIMAL}, + + + discount_ratio = #{discountRatio,jdbcType=DECIMAL}, + + + discount_amount = #{discountAmount,jdbcType=DECIMAL}, + + + table_id = #{tableId,jdbcType=VARCHAR}, + + + small_change = #{smallChange,jdbcType=DECIMAL}, + + + send_type = #{sendType,jdbcType=VARCHAR}, + + + order_type = #{orderType,jdbcType=VARCHAR}, + + + product_type = #{productType,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + billing_id = #{billingId,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + is_vip = #{isVip,jdbcType=TINYINT}, + + + member_id = #{memberId,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=VARCHAR}, + + + product_score = #{productScore,jdbcType=INTEGER}, + + + deduct_score = #{deductScore,jdbcType=INTEGER}, + + + user_coupon_id = #{userCouponId,jdbcType=VARCHAR}, + + + user_coupon_amount = #{userCouponAmount,jdbcType=DECIMAL}, + + + refund_able = #{refundAble,jdbcType=TINYINT}, + + + paid_time = #{paidTime,jdbcType=BIGINT}, + + + is_effect = #{isEffect,jdbcType=TINYINT}, + + + is_group = #{isGroup,jdbcType=TINYINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + system_time = #{systemTime,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + is_accepted = #{isAccepted,jdbcType=TINYINT}, + + + pay_order_no = #{payOrderNo,jdbcType=VARCHAR}, + + + master_id = #{masterId,jdbcType=VARCHAR}, + + + trade_day = #{tradeDay,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_order_info + set order_no = #{orderNo,jdbcType=VARCHAR}, + settlement_amount = #{settlementAmount,jdbcType=DECIMAL}, + pack_fee = #{packFee,jdbcType=DECIMAL}, + origin_amount = #{originAmount,jdbcType=DECIMAL}, + product_amount = #{productAmount,jdbcType=DECIMAL}, + amount = #{amount,jdbcType=DECIMAL}, + refund_amount = #{refundAmount,jdbcType=DECIMAL}, + pay_type = #{payType,jdbcType=VARCHAR}, + pay_amount = #{payAmount,jdbcType=DECIMAL}, + order_amount = #{orderAmount,jdbcType=DECIMAL}, + freight_amount = #{freightAmount,jdbcType=DECIMAL}, + discount_ratio = #{discountRatio,jdbcType=DECIMAL}, + discount_amount = #{discountAmount,jdbcType=DECIMAL}, + table_id = #{tableId,jdbcType=VARCHAR}, + small_change = #{smallChange,jdbcType=DECIMAL}, + send_type = #{sendType,jdbcType=VARCHAR}, + order_type = #{orderType,jdbcType=VARCHAR}, + product_type = #{productType,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + billing_id = #{billingId,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + is_vip = #{isVip,jdbcType=TINYINT}, + member_id = #{memberId,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=VARCHAR}, + product_score = #{productScore,jdbcType=INTEGER}, + deduct_score = #{deductScore,jdbcType=INTEGER}, + user_coupon_id = #{userCouponId,jdbcType=VARCHAR}, + user_coupon_amount = #{userCouponAmount,jdbcType=DECIMAL}, + refund_able = #{refundAble,jdbcType=TINYINT}, + paid_time = #{paidTime,jdbcType=BIGINT}, + is_effect = #{isEffect,jdbcType=TINYINT}, + is_group = #{isGroup,jdbcType=TINYINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + system_time = #{systemTime,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + is_accepted = #{isAccepted,jdbcType=TINYINT}, + pay_order_no = #{payOrderNo,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_order_info set status = #{status} where id = #{orderId} + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbOrderPaymentMapper.xml b/src/main/resources/mapper/TbOrderPaymentMapper.xml new file mode 100644 index 0000000..b6d8972 --- /dev/null +++ b/src/main/resources/mapper/TbOrderPaymentMapper.xml @@ -0,0 +1,263 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + id, pay_type_id, amount, paid_amount, has_refund_amount, pay_name, pay_type, received, + change_fee, merchant_id, shop_id, billing_id, order_id, auth_code, refundable, created_at, + updated_at, trade_number, member_id + + + + delete from tb_order_payment + where id = #{id,jdbcType=INTEGER} + + + insert into tb_order_payment (id, pay_type_id, amount, + paid_amount, has_refund_amount, pay_name, + pay_type, received, change_fee, + merchant_id, shop_id, billing_id, + order_id, auth_code, refundable, + created_at, updated_at, trade_number, + member_id) + values (#{id,jdbcType=INTEGER}, #{payTypeId,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, + #{paidAmount,jdbcType=DECIMAL}, #{hasRefundAmount,jdbcType=DECIMAL}, #{payName,jdbcType=VARCHAR}, + #{payType,jdbcType=VARCHAR}, #{received,jdbcType=DECIMAL}, #{changeFee,jdbcType=DECIMAL}, + #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{billingId,jdbcType=VARCHAR}, + #{orderId,jdbcType=VARCHAR}, #{authCode,jdbcType=VARCHAR}, #{refundable,jdbcType=VARCHAR}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{tradeNumber,jdbcType=VARCHAR}, + #{memberId,jdbcType=VARCHAR}) + + + insert into tb_order_payment + + + id, + + + pay_type_id, + + + amount, + + + paid_amount, + + + has_refund_amount, + + + pay_name, + + + pay_type, + + + received, + + + change_fee, + + + merchant_id, + + + shop_id, + + + billing_id, + + + order_id, + + + auth_code, + + + refundable, + + + created_at, + + + updated_at, + + + trade_number, + + + member_id, + + + + + #{id,jdbcType=INTEGER}, + + + #{payTypeId,jdbcType=VARCHAR}, + + + #{amount,jdbcType=DECIMAL}, + + + #{paidAmount,jdbcType=DECIMAL}, + + + #{hasRefundAmount,jdbcType=DECIMAL}, + + + #{payName,jdbcType=VARCHAR}, + + + #{payType,jdbcType=VARCHAR}, + + + #{received,jdbcType=DECIMAL}, + + + #{changeFee,jdbcType=DECIMAL}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{billingId,jdbcType=VARCHAR}, + + + #{orderId,jdbcType=VARCHAR}, + + + #{authCode,jdbcType=VARCHAR}, + + + #{refundable,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{tradeNumber,jdbcType=VARCHAR}, + + + #{memberId,jdbcType=VARCHAR}, + + + + + update tb_order_payment + + + pay_type_id = #{payTypeId,jdbcType=VARCHAR}, + + + amount = #{amount,jdbcType=DECIMAL}, + + + paid_amount = #{paidAmount,jdbcType=DECIMAL}, + + + has_refund_amount = #{hasRefundAmount,jdbcType=DECIMAL}, + + + pay_name = #{payName,jdbcType=VARCHAR}, + + + pay_type = #{payType,jdbcType=VARCHAR}, + + + received = #{received,jdbcType=DECIMAL}, + + + change_fee = #{changeFee,jdbcType=DECIMAL}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + billing_id = #{billingId,jdbcType=VARCHAR}, + + + order_id = #{orderId,jdbcType=VARCHAR}, + + + auth_code = #{authCode,jdbcType=VARCHAR}, + + + refundable = #{refundable,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + trade_number = #{tradeNumber,jdbcType=VARCHAR}, + + + member_id = #{memberId,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_order_payment + set pay_type_id = #{payTypeId,jdbcType=VARCHAR}, + amount = #{amount,jdbcType=DECIMAL}, + paid_amount = #{paidAmount,jdbcType=DECIMAL}, + has_refund_amount = #{hasRefundAmount,jdbcType=DECIMAL}, + pay_name = #{payName,jdbcType=VARCHAR}, + pay_type = #{payType,jdbcType=VARCHAR}, + received = #{received,jdbcType=DECIMAL}, + change_fee = #{changeFee,jdbcType=DECIMAL}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + billing_id = #{billingId,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=VARCHAR}, + auth_code = #{authCode,jdbcType=VARCHAR}, + refundable = #{refundable,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + trade_number = #{tradeNumber,jdbcType=VARCHAR}, + member_id = #{memberId,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbPlussDeviceGoodsMapper.xml b/src/main/resources/mapper/TbPlussDeviceGoodsMapper.xml new file mode 100644 index 0000000..b67bfe7 --- /dev/null +++ b/src/main/resources/mapper/TbPlussDeviceGoodsMapper.xml @@ -0,0 +1,198 @@ + + + + + + + + + + + + + + + + + + + + + id, code, name, deviceLogo, introDesc, sort, status, tagId, depositFlag, createTime, + updateTime + + + detail + + + + delete from tb_pluss_device_goods + where id = #{id,jdbcType=INTEGER} + + + insert into tb_pluss_device_goods (id, code, name, + deviceLogo, introDesc, sort, + status, tagId, depositFlag, + createTime, updateTime, detail + ) + values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{devicelogo,jdbcType=VARCHAR}, #{introdesc,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, + #{status,jdbcType=INTEGER}, #{tagid,jdbcType=INTEGER}, #{depositflag,jdbcType=VARCHAR}, + #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}, #{detail,jdbcType=LONGVARCHAR} + ) + + + insert into tb_pluss_device_goods + + + id, + + + code, + + + name, + + + deviceLogo, + + + introDesc, + + + sort, + + + status, + + + tagId, + + + depositFlag, + + + createTime, + + + updateTime, + + + detail, + + + + + #{id,jdbcType=INTEGER}, + + + #{code,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{devicelogo,jdbcType=VARCHAR}, + + + #{introdesc,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{status,jdbcType=INTEGER}, + + + #{tagid,jdbcType=INTEGER}, + + + #{depositflag,jdbcType=VARCHAR}, + + + #{createtime,jdbcType=TIMESTAMP}, + + + #{updatetime,jdbcType=TIMESTAMP}, + + + #{detail,jdbcType=LONGVARCHAR}, + + + + + update tb_pluss_device_goods + + + code = #{code,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + deviceLogo = #{devicelogo,jdbcType=VARCHAR}, + + + introDesc = #{introdesc,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + status = #{status,jdbcType=INTEGER}, + + + tagId = #{tagid,jdbcType=INTEGER}, + + + depositFlag = #{depositflag,jdbcType=VARCHAR}, + + + createTime = #{createtime,jdbcType=TIMESTAMP}, + + + updateTime = #{updatetime,jdbcType=TIMESTAMP}, + + + detail = #{detail,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_pluss_device_goods + set code = #{code,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + deviceLogo = #{devicelogo,jdbcType=VARCHAR}, + introDesc = #{introdesc,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + status = #{status,jdbcType=INTEGER}, + tagId = #{tagid,jdbcType=INTEGER}, + depositFlag = #{depositflag,jdbcType=VARCHAR}, + createTime = #{createtime,jdbcType=TIMESTAMP}, + updateTime = #{updatetime,jdbcType=TIMESTAMP}, + detail = #{detail,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_pluss_device_goods + set code = #{code,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + deviceLogo = #{devicelogo,jdbcType=VARCHAR}, + introDesc = #{introdesc,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + status = #{status,jdbcType=INTEGER}, + tagId = #{tagid,jdbcType=INTEGER}, + depositFlag = #{depositflag,jdbcType=VARCHAR}, + createTime = #{createtime,jdbcType=TIMESTAMP}, + updateTime = #{updatetime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbPrintMachineMapper.xml b/src/main/resources/mapper/TbPrintMachineMapper.xml new file mode 100644 index 0000000..d376c38 --- /dev/null +++ b/src/main/resources/mapper/TbPrintMachineMapper.xml @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + id, name, type, connection_type, address, port, sub_type, status, shop_id, category_ids, + content_type, created_at, updated_at, sort, vendor_id, product_id + + + config, category_list + + + + delete from tb_print_machine + where id = #{id,jdbcType=INTEGER} + + + insert into tb_print_machine (id, name, type, + connection_type, address, port, + sub_type, status, shop_id, + category_ids, content_type, created_at, + updated_at, sort, vendor_id, + product_id, config, category_list + ) + values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{connectionType,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{port,jdbcType=VARCHAR}, + #{subType,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{shopId,jdbcType=VARCHAR}, + #{categoryIds,jdbcType=VARCHAR}, #{contentType,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}, #{sort,jdbcType=INTEGER}, #{vendorId,jdbcType=VARCHAR}, + #{productId,jdbcType=VARCHAR}, #{config,jdbcType=LONGVARCHAR}, #{categoryList,jdbcType=LONGVARCHAR} + ) + + + insert into tb_print_machine + + + id, + + + name, + + + type, + + + connection_type, + + + address, + + + port, + + + sub_type, + + + status, + + + shop_id, + + + category_ids, + + + content_type, + + + created_at, + + + updated_at, + + + sort, + + + vendor_id, + + + product_id, + + + config, + + + category_list, + + + + + #{id,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{connectionType,jdbcType=VARCHAR}, + + + #{address,jdbcType=VARCHAR}, + + + #{port,jdbcType=VARCHAR}, + + + #{subType,jdbcType=VARCHAR}, + + + #{status,jdbcType=TINYINT}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{categoryIds,jdbcType=VARCHAR}, + + + #{contentType,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{sort,jdbcType=INTEGER}, + + + #{vendorId,jdbcType=VARCHAR}, + + + #{productId,jdbcType=VARCHAR}, + + + #{config,jdbcType=LONGVARCHAR}, + + + #{categoryList,jdbcType=LONGVARCHAR}, + + + + + update tb_print_machine + + + name = #{name,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + connection_type = #{connectionType,jdbcType=VARCHAR}, + + + address = #{address,jdbcType=VARCHAR}, + + + port = #{port,jdbcType=VARCHAR}, + + + sub_type = #{subType,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=TINYINT}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + category_ids = #{categoryIds,jdbcType=VARCHAR}, + + + content_type = #{contentType,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + sort = #{sort,jdbcType=INTEGER}, + + + vendor_id = #{vendorId,jdbcType=VARCHAR}, + + + product_id = #{productId,jdbcType=VARCHAR}, + + + config = #{config,jdbcType=LONGVARCHAR}, + + + category_list = #{categoryList,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_print_machine + set name = #{name,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + connection_type = #{connectionType,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + port = #{port,jdbcType=VARCHAR}, + sub_type = #{subType,jdbcType=VARCHAR}, + status = #{status,jdbcType=TINYINT}, + shop_id = #{shopId,jdbcType=VARCHAR}, + category_ids = #{categoryIds,jdbcType=VARCHAR}, + content_type = #{contentType,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + sort = #{sort,jdbcType=INTEGER}, + vendor_id = #{vendorId,jdbcType=VARCHAR}, + product_id = #{productId,jdbcType=VARCHAR}, + config = #{config,jdbcType=LONGVARCHAR}, + category_list = #{categoryList,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_print_machine + set name = #{name,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + connection_type = #{connectionType,jdbcType=VARCHAR}, + address = #{address,jdbcType=VARCHAR}, + port = #{port,jdbcType=VARCHAR}, + sub_type = #{subType,jdbcType=VARCHAR}, + status = #{status,jdbcType=TINYINT}, + shop_id = #{shopId,jdbcType=VARCHAR}, + category_ids = #{categoryIds,jdbcType=VARCHAR}, + content_type = #{contentType,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + sort = #{sort,jdbcType=INTEGER}, + vendor_id = #{vendorId,jdbcType=VARCHAR}, + product_id = #{productId,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbProductGroupMapper.xml b/src/main/resources/mapper/TbProductGroupMapper.xml new file mode 100644 index 0000000..bc1758d --- /dev/null +++ b/src/main/resources/mapper/TbProductGroupMapper.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + id, name, merchant_id, shop_id, pic, is_show, detail, style, sort, created_at, updated_at + + + product_ids + + + + delete from tb_product_group + where id = #{id,jdbcType=INTEGER} + + + insert into tb_product_group (id, name, merchant_id, + shop_id, pic, is_show, + detail, style, sort, + created_at, updated_at, product_ids + ) + values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, + #{shopId,jdbcType=INTEGER}, #{pic,jdbcType=VARCHAR}, #{isShow,jdbcType=TINYINT}, + #{detail,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{productIds,jdbcType=LONGVARCHAR} + ) + + + insert into tb_product_group + + + id, + + + name, + + + merchant_id, + + + shop_id, + + + pic, + + + is_show, + + + detail, + + + style, + + + sort, + + + created_at, + + + updated_at, + + + product_ids, + + + + + #{id,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=INTEGER}, + + + #{pic,jdbcType=VARCHAR}, + + + #{isShow,jdbcType=TINYINT}, + + + #{detail,jdbcType=VARCHAR}, + + + #{style,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{productIds,jdbcType=LONGVARCHAR}, + + + + + update tb_product_group + + + name = #{name,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=INTEGER}, + + + pic = #{pic,jdbcType=VARCHAR}, + + + is_show = #{isShow,jdbcType=TINYINT}, + + + detail = #{detail,jdbcType=VARCHAR}, + + + style = #{style,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + product_ids = #{productIds,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_product_group + set name = #{name,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=INTEGER}, + pic = #{pic,jdbcType=VARCHAR}, + is_show = #{isShow,jdbcType=TINYINT}, + detail = #{detail,jdbcType=VARCHAR}, + style = #{style,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + product_ids = #{productIds,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_product_group + set name = #{name,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=INTEGER}, + pic = #{pic,jdbcType=VARCHAR}, + is_show = #{isShow,jdbcType=TINYINT}, + detail = #{detail,jdbcType=VARCHAR}, + style = #{style,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbProductMapper.xml b/src/main/resources/mapper/TbProductMapper.xml new file mode 100644 index 0000000..41f3706 --- /dev/null +++ b/src/main/resources/mapper/TbProductMapper.xml @@ -0,0 +1,929 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, category_id, spec_id, source_path, brand_id, merchant_id, shop_id, name, short_title, + type, pack_fee, low_price, low_member_price, unit_id, unit_snap, cover_img, share_img, + video_cover_img, sort, limit_number, product_score, status, fail_msg, is_recommend, + is_hot, is_new, is_on_sale, is_show, type_enum, is_distribute, is_del, is_stock, + is_pause_sale, is_free_freight, freight_id, strategy_type, strategy_id, is_vip, is_delete, + created_at, updated_at, base_sales_number, real_sales_number, sales_number, thumb_count, + store_count, furnish_meal, furnish_express, furnish_draw, furnish_vir, is_combo, + is_show_cash, is_show_mall, is_need_examine, show_on_mall_status, show_on_mall_time, + show_on_mall_error_msg, enable_label, tax_config_id, spec_table_headers + + + images, video, notice, group_snap, spec_info, select_spec + + + + delete from tb_product + where id = #{id,jdbcType=INTEGER} + + + insert into tb_product (id, category_id, spec_id, + source_path, brand_id, merchant_id, + shop_id, name, short_title, + type, pack_fee, low_price, + low_member_price, unit_id, unit_snap, + cover_img, share_img, video_cover_img, + sort, limit_number, product_score, + status, fail_msg, is_recommend, + is_hot, is_new, is_on_sale, + is_show, type_enum, is_distribute, + is_del, is_stock, is_pause_sale, + is_free_freight, freight_id, strategy_type, + strategy_id, is_vip, is_delete, + created_at, updated_at, base_sales_number, + real_sales_number, sales_number, thumb_count, + store_count, furnish_meal, furnish_express, + furnish_draw, furnish_vir, is_combo, + is_show_cash, is_show_mall, is_need_examine, + show_on_mall_status, show_on_mall_time, show_on_mall_error_msg, + enable_label, tax_config_id, spec_table_headers, + images, video, notice, + group_snap, spec_info, select_spec + ) + values (#{id,jdbcType=INTEGER}, #{categoryId,jdbcType=VARCHAR}, #{specId,jdbcType=INTEGER}, + #{sourcePath,jdbcType=VARCHAR}, #{brandId,jdbcType=INTEGER}, #{merchantId,jdbcType=VARCHAR}, + #{shopId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{shortTitle,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{packFee,jdbcType=DECIMAL}, #{lowPrice,jdbcType=DECIMAL}, + #{lowMemberPrice,jdbcType=DECIMAL}, #{unitId,jdbcType=VARCHAR}, #{unitSnap,jdbcType=VARCHAR}, + #{coverImg,jdbcType=VARCHAR}, #{shareImg,jdbcType=VARCHAR}, #{videoCoverImg,jdbcType=VARCHAR}, + #{sort,jdbcType=INTEGER}, #{limitNumber,jdbcType=INTEGER}, #{productScore,jdbcType=INTEGER}, + #{status,jdbcType=TINYINT}, #{failMsg,jdbcType=VARCHAR}, #{isRecommend,jdbcType=TINYINT}, + #{isHot,jdbcType=TINYINT}, #{isNew,jdbcType=TINYINT}, #{isOnSale,jdbcType=TINYINT}, + #{isShow,jdbcType=TINYINT}, #{typeEnum,jdbcType=VARCHAR}, #{isDistribute,jdbcType=TINYINT}, + #{isDel,jdbcType=TINYINT}, #{isStock,jdbcType=TINYINT}, #{isPauseSale,jdbcType=TINYINT}, + #{isFreeFreight,jdbcType=TINYINT}, #{freightId,jdbcType=BIGINT}, #{strategyType,jdbcType=VARCHAR}, + #{strategyId,jdbcType=INTEGER}, #{isVip,jdbcType=TINYINT}, #{isDelete,jdbcType=TINYINT}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{baseSalesNumber,jdbcType=DOUBLE}, + #{realSalesNumber,jdbcType=INTEGER}, #{salesNumber,jdbcType=INTEGER}, #{thumbCount,jdbcType=INTEGER}, + #{storeCount,jdbcType=INTEGER}, #{furnishMeal,jdbcType=INTEGER}, #{furnishExpress,jdbcType=INTEGER}, + #{furnishDraw,jdbcType=INTEGER}, #{furnishVir,jdbcType=INTEGER}, #{isCombo,jdbcType=TINYINT}, + #{isShowCash,jdbcType=TINYINT}, #{isShowMall,jdbcType=TINYINT}, #{isNeedExamine,jdbcType=TINYINT}, + #{showOnMallStatus,jdbcType=TINYINT}, #{showOnMallTime,jdbcType=BIGINT}, #{showOnMallErrorMsg,jdbcType=VARCHAR}, + #{enableLabel,jdbcType=TINYINT}, #{taxConfigId,jdbcType=VARCHAR}, #{specTableHeaders,jdbcType=VARCHAR}, + #{images,jdbcType=LONGVARCHAR}, #{video,jdbcType=LONGVARCHAR}, #{notice,jdbcType=LONGVARCHAR}, + #{groupSnap,jdbcType=LONGVARCHAR}, #{specInfo,jdbcType=LONGVARCHAR}, #{selectSpec,jdbcType=LONGVARCHAR} + ) + + + insert into tb_product + + + id, + + + category_id, + + + spec_id, + + + source_path, + + + brand_id, + + + merchant_id, + + + shop_id, + + + name, + + + short_title, + + + type, + + + pack_fee, + + + low_price, + + + low_member_price, + + + unit_id, + + + unit_snap, + + + cover_img, + + + share_img, + + + video_cover_img, + + + sort, + + + limit_number, + + + product_score, + + + status, + + + fail_msg, + + + is_recommend, + + + is_hot, + + + is_new, + + + is_on_sale, + + + is_show, + + + type_enum, + + + is_distribute, + + + is_del, + + + is_stock, + + + is_pause_sale, + + + is_free_freight, + + + freight_id, + + + strategy_type, + + + strategy_id, + + + is_vip, + + + is_delete, + + + created_at, + + + updated_at, + + + base_sales_number, + + + real_sales_number, + + + sales_number, + + + thumb_count, + + + store_count, + + + furnish_meal, + + + furnish_express, + + + furnish_draw, + + + furnish_vir, + + + is_combo, + + + is_show_cash, + + + is_show_mall, + + + is_need_examine, + + + show_on_mall_status, + + + show_on_mall_time, + + + show_on_mall_error_msg, + + + enable_label, + + + tax_config_id, + + + spec_table_headers, + + + images, + + + video, + + + notice, + + + group_snap, + + + spec_info, + + + select_spec, + + + + + #{id,jdbcType=INTEGER}, + + + #{categoryId,jdbcType=VARCHAR}, + + + #{specId,jdbcType=INTEGER}, + + + #{sourcePath,jdbcType=VARCHAR}, + + + #{brandId,jdbcType=INTEGER}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{shortTitle,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{packFee,jdbcType=DECIMAL}, + + + #{lowPrice,jdbcType=DECIMAL}, + + + #{lowMemberPrice,jdbcType=DECIMAL}, + + + #{unitId,jdbcType=VARCHAR}, + + + #{unitSnap,jdbcType=VARCHAR}, + + + #{coverImg,jdbcType=VARCHAR}, + + + #{shareImg,jdbcType=VARCHAR}, + + + #{videoCoverImg,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{limitNumber,jdbcType=INTEGER}, + + + #{productScore,jdbcType=INTEGER}, + + + #{status,jdbcType=TINYINT}, + + + #{failMsg,jdbcType=VARCHAR}, + + + #{isRecommend,jdbcType=TINYINT}, + + + #{isHot,jdbcType=TINYINT}, + + + #{isNew,jdbcType=TINYINT}, + + + #{isOnSale,jdbcType=TINYINT}, + + + #{isShow,jdbcType=TINYINT}, + + + #{typeEnum,jdbcType=VARCHAR}, + + + #{isDistribute,jdbcType=TINYINT}, + + + #{isDel,jdbcType=TINYINT}, + + + #{isStock,jdbcType=TINYINT}, + + + #{isPauseSale,jdbcType=TINYINT}, + + + #{isFreeFreight,jdbcType=TINYINT}, + + + #{freightId,jdbcType=BIGINT}, + + + #{strategyType,jdbcType=VARCHAR}, + + + #{strategyId,jdbcType=INTEGER}, + + + #{isVip,jdbcType=TINYINT}, + + + #{isDelete,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{baseSalesNumber,jdbcType=DOUBLE}, + + + #{realSalesNumber,jdbcType=INTEGER}, + + + #{salesNumber,jdbcType=INTEGER}, + + + #{thumbCount,jdbcType=INTEGER}, + + + #{storeCount,jdbcType=INTEGER}, + + + #{furnishMeal,jdbcType=INTEGER}, + + + #{furnishExpress,jdbcType=INTEGER}, + + + #{furnishDraw,jdbcType=INTEGER}, + + + #{furnishVir,jdbcType=INTEGER}, + + + #{isCombo,jdbcType=TINYINT}, + + + #{isShowCash,jdbcType=TINYINT}, + + + #{isShowMall,jdbcType=TINYINT}, + + + #{isNeedExamine,jdbcType=TINYINT}, + + + #{showOnMallStatus,jdbcType=TINYINT}, + + + #{showOnMallTime,jdbcType=BIGINT}, + + + #{showOnMallErrorMsg,jdbcType=VARCHAR}, + + + #{enableLabel,jdbcType=TINYINT}, + + + #{taxConfigId,jdbcType=VARCHAR}, + + + #{specTableHeaders,jdbcType=VARCHAR}, + + + #{images,jdbcType=LONGVARCHAR}, + + + #{video,jdbcType=LONGVARCHAR}, + + + #{notice,jdbcType=LONGVARCHAR}, + + + #{groupSnap,jdbcType=LONGVARCHAR}, + + + #{specInfo,jdbcType=LONGVARCHAR}, + + + #{selectSpec,jdbcType=LONGVARCHAR}, + + + + + update tb_product + + + category_id = #{categoryId,jdbcType=VARCHAR}, + + + spec_id = #{specId,jdbcType=INTEGER}, + + + source_path = #{sourcePath,jdbcType=VARCHAR}, + + + brand_id = #{brandId,jdbcType=INTEGER}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + short_title = #{shortTitle,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + pack_fee = #{packFee,jdbcType=DECIMAL}, + + + low_price = #{lowPrice,jdbcType=DECIMAL}, + + + low_member_price = #{lowMemberPrice,jdbcType=DECIMAL}, + + + unit_id = #{unitId,jdbcType=VARCHAR}, + + + unit_snap = #{unitSnap,jdbcType=VARCHAR}, + + + cover_img = #{coverImg,jdbcType=VARCHAR}, + + + share_img = #{shareImg,jdbcType=VARCHAR}, + + + video_cover_img = #{videoCoverImg,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + limit_number = #{limitNumber,jdbcType=INTEGER}, + + + product_score = #{productScore,jdbcType=INTEGER}, + + + status = #{status,jdbcType=TINYINT}, + + + fail_msg = #{failMsg,jdbcType=VARCHAR}, + + + is_recommend = #{isRecommend,jdbcType=TINYINT}, + + + is_hot = #{isHot,jdbcType=TINYINT}, + + + is_new = #{isNew,jdbcType=TINYINT}, + + + is_on_sale = #{isOnSale,jdbcType=TINYINT}, + + + is_show = #{isShow,jdbcType=TINYINT}, + + + type_enum = #{typeEnum,jdbcType=VARCHAR}, + + + is_distribute = #{isDistribute,jdbcType=TINYINT}, + + + is_del = #{isDel,jdbcType=TINYINT}, + + + is_stock = #{isStock,jdbcType=TINYINT}, + + + is_pause_sale = #{isPauseSale,jdbcType=TINYINT}, + + + is_free_freight = #{isFreeFreight,jdbcType=TINYINT}, + + + freight_id = #{freightId,jdbcType=BIGINT}, + + + strategy_type = #{strategyType,jdbcType=VARCHAR}, + + + strategy_id = #{strategyId,jdbcType=INTEGER}, + + + is_vip = #{isVip,jdbcType=TINYINT}, + + + is_delete = #{isDelete,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + base_sales_number = #{baseSalesNumber,jdbcType=DOUBLE}, + + + real_sales_number = #{realSalesNumber,jdbcType=INTEGER}, + + + sales_number = #{salesNumber,jdbcType=INTEGER}, + + + thumb_count = #{thumbCount,jdbcType=INTEGER}, + + + store_count = #{storeCount,jdbcType=INTEGER}, + + + furnish_meal = #{furnishMeal,jdbcType=INTEGER}, + + + furnish_express = #{furnishExpress,jdbcType=INTEGER}, + + + furnish_draw = #{furnishDraw,jdbcType=INTEGER}, + + + furnish_vir = #{furnishVir,jdbcType=INTEGER}, + + + is_combo = #{isCombo,jdbcType=TINYINT}, + + + is_show_cash = #{isShowCash,jdbcType=TINYINT}, + + + is_show_mall = #{isShowMall,jdbcType=TINYINT}, + + + is_need_examine = #{isNeedExamine,jdbcType=TINYINT}, + + + show_on_mall_status = #{showOnMallStatus,jdbcType=TINYINT}, + + + show_on_mall_time = #{showOnMallTime,jdbcType=BIGINT}, + + + show_on_mall_error_msg = #{showOnMallErrorMsg,jdbcType=VARCHAR}, + + + enable_label = #{enableLabel,jdbcType=TINYINT}, + + + tax_config_id = #{taxConfigId,jdbcType=VARCHAR}, + + + spec_table_headers = #{specTableHeaders,jdbcType=VARCHAR}, + + + images = #{images,jdbcType=LONGVARCHAR}, + + + video = #{video,jdbcType=LONGVARCHAR}, + + + notice = #{notice,jdbcType=LONGVARCHAR}, + + + group_snap = #{groupSnap,jdbcType=LONGVARCHAR}, + + + spec_info = #{specInfo,jdbcType=LONGVARCHAR}, + + + select_spec = #{selectSpec,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_product + set category_id = #{categoryId,jdbcType=VARCHAR}, + spec_id = #{specId,jdbcType=INTEGER}, + source_path = #{sourcePath,jdbcType=VARCHAR}, + brand_id = #{brandId,jdbcType=INTEGER}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + short_title = #{shortTitle,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + pack_fee = #{packFee,jdbcType=DECIMAL}, + low_price = #{lowPrice,jdbcType=DECIMAL}, + low_member_price = #{lowMemberPrice,jdbcType=DECIMAL}, + unit_id = #{unitId,jdbcType=VARCHAR}, + unit_snap = #{unitSnap,jdbcType=VARCHAR}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + share_img = #{shareImg,jdbcType=VARCHAR}, + video_cover_img = #{videoCoverImg,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + limit_number = #{limitNumber,jdbcType=INTEGER}, + product_score = #{productScore,jdbcType=INTEGER}, + status = #{status,jdbcType=TINYINT}, + fail_msg = #{failMsg,jdbcType=VARCHAR}, + is_recommend = #{isRecommend,jdbcType=TINYINT}, + is_hot = #{isHot,jdbcType=TINYINT}, + is_new = #{isNew,jdbcType=TINYINT}, + is_on_sale = #{isOnSale,jdbcType=TINYINT}, + is_show = #{isShow,jdbcType=TINYINT}, + type_enum = #{typeEnum,jdbcType=VARCHAR}, + is_distribute = #{isDistribute,jdbcType=TINYINT}, + is_del = #{isDel,jdbcType=TINYINT}, + is_stock = #{isStock,jdbcType=TINYINT}, + is_pause_sale = #{isPauseSale,jdbcType=TINYINT}, + is_free_freight = #{isFreeFreight,jdbcType=TINYINT}, + freight_id = #{freightId,jdbcType=BIGINT}, + strategy_type = #{strategyType,jdbcType=VARCHAR}, + strategy_id = #{strategyId,jdbcType=INTEGER}, + is_vip = #{isVip,jdbcType=TINYINT}, + is_delete = #{isDelete,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + base_sales_number = #{baseSalesNumber,jdbcType=DOUBLE}, + real_sales_number = #{realSalesNumber,jdbcType=INTEGER}, + sales_number = #{salesNumber,jdbcType=INTEGER}, + thumb_count = #{thumbCount,jdbcType=INTEGER}, + store_count = #{storeCount,jdbcType=INTEGER}, + furnish_meal = #{furnishMeal,jdbcType=INTEGER}, + furnish_express = #{furnishExpress,jdbcType=INTEGER}, + furnish_draw = #{furnishDraw,jdbcType=INTEGER}, + furnish_vir = #{furnishVir,jdbcType=INTEGER}, + is_combo = #{isCombo,jdbcType=TINYINT}, + is_show_cash = #{isShowCash,jdbcType=TINYINT}, + is_show_mall = #{isShowMall,jdbcType=TINYINT}, + is_need_examine = #{isNeedExamine,jdbcType=TINYINT}, + show_on_mall_status = #{showOnMallStatus,jdbcType=TINYINT}, + show_on_mall_time = #{showOnMallTime,jdbcType=BIGINT}, + show_on_mall_error_msg = #{showOnMallErrorMsg,jdbcType=VARCHAR}, + enable_label = #{enableLabel,jdbcType=TINYINT}, + tax_config_id = #{taxConfigId,jdbcType=VARCHAR}, + spec_table_headers = #{specTableHeaders,jdbcType=VARCHAR}, + images = #{images,jdbcType=LONGVARCHAR}, + video = #{video,jdbcType=LONGVARCHAR}, + notice = #{notice,jdbcType=LONGVARCHAR}, + group_snap = #{groupSnap,jdbcType=LONGVARCHAR}, + spec_info = #{specInfo,jdbcType=LONGVARCHAR}, + select_spec = #{selectSpec,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_product + set category_id = #{categoryId,jdbcType=VARCHAR}, + spec_id = #{specId,jdbcType=INTEGER}, + source_path = #{sourcePath,jdbcType=VARCHAR}, + brand_id = #{brandId,jdbcType=INTEGER}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + short_title = #{shortTitle,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + pack_fee = #{packFee,jdbcType=DECIMAL}, + low_price = #{lowPrice,jdbcType=DECIMAL}, + low_member_price = #{lowMemberPrice,jdbcType=DECIMAL}, + unit_id = #{unitId,jdbcType=VARCHAR}, + unit_snap = #{unitSnap,jdbcType=VARCHAR}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + share_img = #{shareImg,jdbcType=VARCHAR}, + video_cover_img = #{videoCoverImg,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + limit_number = #{limitNumber,jdbcType=INTEGER}, + product_score = #{productScore,jdbcType=INTEGER}, + status = #{status,jdbcType=TINYINT}, + fail_msg = #{failMsg,jdbcType=VARCHAR}, + is_recommend = #{isRecommend,jdbcType=TINYINT}, + is_hot = #{isHot,jdbcType=TINYINT}, + is_new = #{isNew,jdbcType=TINYINT}, + is_on_sale = #{isOnSale,jdbcType=TINYINT}, + is_show = #{isShow,jdbcType=TINYINT}, + type_enum = #{typeEnum,jdbcType=VARCHAR}, + is_distribute = #{isDistribute,jdbcType=TINYINT}, + is_del = #{isDel,jdbcType=TINYINT}, + is_stock = #{isStock,jdbcType=TINYINT}, + is_pause_sale = #{isPauseSale,jdbcType=TINYINT}, + is_free_freight = #{isFreeFreight,jdbcType=TINYINT}, + freight_id = #{freightId,jdbcType=BIGINT}, + strategy_type = #{strategyType,jdbcType=VARCHAR}, + strategy_id = #{strategyId,jdbcType=INTEGER}, + is_vip = #{isVip,jdbcType=TINYINT}, + is_delete = #{isDelete,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + base_sales_number = #{baseSalesNumber,jdbcType=DOUBLE}, + real_sales_number = #{realSalesNumber,jdbcType=INTEGER}, + sales_number = #{salesNumber,jdbcType=INTEGER}, + thumb_count = #{thumbCount,jdbcType=INTEGER}, + store_count = #{storeCount,jdbcType=INTEGER}, + furnish_meal = #{furnishMeal,jdbcType=INTEGER}, + furnish_express = #{furnishExpress,jdbcType=INTEGER}, + furnish_draw = #{furnishDraw,jdbcType=INTEGER}, + furnish_vir = #{furnishVir,jdbcType=INTEGER}, + is_combo = #{isCombo,jdbcType=TINYINT}, + is_show_cash = #{isShowCash,jdbcType=TINYINT}, + is_show_mall = #{isShowMall,jdbcType=TINYINT}, + is_need_examine = #{isNeedExamine,jdbcType=TINYINT}, + show_on_mall_status = #{showOnMallStatus,jdbcType=TINYINT}, + show_on_mall_time = #{showOnMallTime,jdbcType=BIGINT}, + show_on_mall_error_msg = #{showOnMallErrorMsg,jdbcType=VARCHAR}, + enable_label = #{enableLabel,jdbcType=TINYINT}, + tax_config_id = #{taxConfigId,jdbcType=VARCHAR}, + spec_table_headers = #{specTableHeaders,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbProductSkuMapper.xml b/src/main/resources/mapper/TbProductSkuMapper.xml new file mode 100644 index 0000000..6ba93af --- /dev/null +++ b/src/main/resources/mapper/TbProductSkuMapper.xml @@ -0,0 +1,358 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, shop_id, bar_code, product_id, origin_price, cost_price, member_price, meal_price, + sale_price, guide_price, strategy_price, stock_number, cover_img, warn_line, weight, + volume, real_sales_number, first_shared, second_shared, created_at, updated_at + + + spec_info, spec_snap + + + + + delete from tb_product_sku + where id = #{id,jdbcType=INTEGER} + + + insert into tb_product_sku (id, shop_id, bar_code, + product_id, origin_price, cost_price, + member_price, meal_price, sale_price, + guide_price, strategy_price, stock_number, + cover_img, warn_line, weight, + volume, real_sales_number, first_shared, + second_shared, created_at, updated_at, + spec_info, spec_snap) + values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=VARCHAR}, #{barCode,jdbcType=VARCHAR}, + #{productId,jdbcType=VARCHAR}, #{originPrice,jdbcType=DECIMAL}, #{costPrice,jdbcType=DECIMAL}, + #{memberPrice,jdbcType=DECIMAL}, #{mealPrice,jdbcType=DECIMAL}, #{salePrice,jdbcType=DECIMAL}, + #{guidePrice,jdbcType=DECIMAL}, #{strategyPrice,jdbcType=DECIMAL}, #{stockNumber,jdbcType=DOUBLE}, + #{coverImg,jdbcType=VARCHAR}, #{warnLine,jdbcType=INTEGER}, #{weight,jdbcType=DOUBLE}, + #{volume,jdbcType=REAL}, #{realSalesNumber,jdbcType=DOUBLE}, #{firstShared,jdbcType=DECIMAL}, + #{secondShared,jdbcType=DECIMAL}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, + #{specInfo,jdbcType=LONGVARCHAR}, #{specSnap,jdbcType=LONGVARCHAR}) + + + insert into tb_product_sku + + + id, + + + shop_id, + + + bar_code, + + + product_id, + + + origin_price, + + + cost_price, + + + member_price, + + + meal_price, + + + sale_price, + + + guide_price, + + + strategy_price, + + + stock_number, + + + cover_img, + + + warn_line, + + + weight, + + + volume, + + + real_sales_number, + + + first_shared, + + + second_shared, + + + created_at, + + + updated_at, + + + spec_info, + + + spec_snap, + + + + + #{id,jdbcType=INTEGER}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{barCode,jdbcType=VARCHAR}, + + + #{productId,jdbcType=VARCHAR}, + + + #{originPrice,jdbcType=DECIMAL}, + + + #{costPrice,jdbcType=DECIMAL}, + + + #{memberPrice,jdbcType=DECIMAL}, + + + #{mealPrice,jdbcType=DECIMAL}, + + + #{salePrice,jdbcType=DECIMAL}, + + + #{guidePrice,jdbcType=DECIMAL}, + + + #{strategyPrice,jdbcType=DECIMAL}, + + + #{stockNumber,jdbcType=DOUBLE}, + + + #{coverImg,jdbcType=VARCHAR}, + + + #{warnLine,jdbcType=INTEGER}, + + + #{weight,jdbcType=DOUBLE}, + + + #{volume,jdbcType=REAL}, + + + #{realSalesNumber,jdbcType=DOUBLE}, + + + #{firstShared,jdbcType=DECIMAL}, + + + #{secondShared,jdbcType=DECIMAL}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{specInfo,jdbcType=LONGVARCHAR}, + + + #{specSnap,jdbcType=LONGVARCHAR}, + + + + + update tb_product_sku + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + bar_code = #{barCode,jdbcType=VARCHAR}, + + + product_id = #{productId,jdbcType=VARCHAR}, + + + origin_price = #{originPrice,jdbcType=DECIMAL}, + + + cost_price = #{costPrice,jdbcType=DECIMAL}, + + + member_price = #{memberPrice,jdbcType=DECIMAL}, + + + meal_price = #{mealPrice,jdbcType=DECIMAL}, + + + sale_price = #{salePrice,jdbcType=DECIMAL}, + + + guide_price = #{guidePrice,jdbcType=DECIMAL}, + + + strategy_price = #{strategyPrice,jdbcType=DECIMAL}, + + + stock_number = #{stockNumber,jdbcType=DOUBLE}, + + + cover_img = #{coverImg,jdbcType=VARCHAR}, + + + warn_line = #{warnLine,jdbcType=INTEGER}, + + + weight = #{weight,jdbcType=DOUBLE}, + + + volume = #{volume,jdbcType=REAL}, + + + real_sales_number = #{realSalesNumber,jdbcType=DOUBLE}, + + + first_shared = #{firstShared,jdbcType=DECIMAL}, + + + second_shared = #{secondShared,jdbcType=DECIMAL}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + spec_info = #{specInfo,jdbcType=LONGVARCHAR}, + + + spec_snap = #{specSnap,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_product_sku + set shop_id = #{shopId,jdbcType=VARCHAR}, + bar_code = #{barCode,jdbcType=VARCHAR}, + product_id = #{productId,jdbcType=VARCHAR}, + origin_price = #{originPrice,jdbcType=DECIMAL}, + cost_price = #{costPrice,jdbcType=DECIMAL}, + member_price = #{memberPrice,jdbcType=DECIMAL}, + meal_price = #{mealPrice,jdbcType=DECIMAL}, + sale_price = #{salePrice,jdbcType=DECIMAL}, + guide_price = #{guidePrice,jdbcType=DECIMAL}, + strategy_price = #{strategyPrice,jdbcType=DECIMAL}, + stock_number = #{stockNumber,jdbcType=DOUBLE}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + warn_line = #{warnLine,jdbcType=INTEGER}, + weight = #{weight,jdbcType=DOUBLE}, + volume = #{volume,jdbcType=REAL}, + real_sales_number = #{realSalesNumber,jdbcType=DOUBLE}, + first_shared = #{firstShared,jdbcType=DECIMAL}, + second_shared = #{secondShared,jdbcType=DECIMAL}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + spec_info = #{specInfo,jdbcType=LONGVARCHAR}, + spec_snap = #{specSnap,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_product_sku + set shop_id = #{shopId,jdbcType=VARCHAR}, + bar_code = #{barCode,jdbcType=VARCHAR}, + product_id = #{productId,jdbcType=VARCHAR}, + origin_price = #{originPrice,jdbcType=DECIMAL}, + cost_price = #{costPrice,jdbcType=DECIMAL}, + member_price = #{memberPrice,jdbcType=DECIMAL}, + meal_price = #{mealPrice,jdbcType=DECIMAL}, + sale_price = #{salePrice,jdbcType=DECIMAL}, + guide_price = #{guidePrice,jdbcType=DECIMAL}, + strategy_price = #{strategyPrice,jdbcType=DECIMAL}, + stock_number = #{stockNumber,jdbcType=DOUBLE}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + warn_line = #{warnLine,jdbcType=INTEGER}, + weight = #{weight,jdbcType=DOUBLE}, + volume = #{volume,jdbcType=REAL}, + real_sales_number = #{realSalesNumber,jdbcType=DOUBLE}, + first_shared = #{firstShared,jdbcType=DECIMAL}, + second_shared = #{secondShared,jdbcType=DECIMAL}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + + update tb_product_sku set stock_number = stock_number - #{num} where id = #{skuId} + + + update tb_product_sku set stock_number = stock_number + #{num} where id = #{skuId} + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbProductSkuResultMapper.xml b/src/main/resources/mapper/TbProductSkuResultMapper.xml new file mode 100644 index 0000000..a2d2eb9 --- /dev/null +++ b/src/main/resources/mapper/TbProductSkuResultMapper.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + id, merchant_id, spec_id, created_at, updated_at + + + tag_snap + + + + delete from tb_product_sku_result + where id = #{id,jdbcType=INTEGER} + + + insert into tb_product_sku_result (id, merchant_id, spec_id, + created_at, updated_at, tag_snap + ) + values (#{id,jdbcType=INTEGER}, #{merchantId,jdbcType=VARCHAR}, #{specId,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{tagSnap,jdbcType=LONGVARCHAR} + ) + + + insert into tb_product_sku_result + + + id, + + + merchant_id, + + + spec_id, + + + created_at, + + + updated_at, + + + tag_snap, + + + + + #{id,jdbcType=INTEGER}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{specId,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{tagSnap,jdbcType=LONGVARCHAR}, + + + + + update tb_product_sku_result + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + spec_id = #{specId,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + tag_snap = #{tagSnap,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_product_sku_result + set merchant_id = #{merchantId,jdbcType=VARCHAR}, + spec_id = #{specId,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + tag_snap = #{tagSnap,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_product_sku_result + set merchant_id = #{merchantId,jdbcType=VARCHAR}, + spec_id = #{specId,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbProductSpecMapper.xml b/src/main/resources/mapper/TbProductSpecMapper.xml new file mode 100644 index 0000000..fd0f937 --- /dev/null +++ b/src/main/resources/mapper/TbProductSpecMapper.xml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + + id, shop_id, name, spec_tag, spec_tag_detail, sort, created_at, updated_at + + + spec_list + + + + delete from tb_product_spec + where id = #{id,jdbcType=INTEGER} + + + insert into tb_product_spec (id, shop_id, name, + spec_tag, spec_tag_detail, sort, + created_at, updated_at, spec_list + ) + values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{specTag,jdbcType=VARCHAR}, #{specTagDetail,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{specList,jdbcType=LONGVARCHAR} + ) + + + insert into tb_product_spec + + + id, + + + shop_id, + + + name, + + + spec_tag, + + + spec_tag_detail, + + + sort, + + + created_at, + + + updated_at, + + + spec_list, + + + + + #{id,jdbcType=INTEGER}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{specTag,jdbcType=VARCHAR}, + + + #{specTagDetail,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{specList,jdbcType=LONGVARCHAR}, + + + + + update tb_product_spec + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + spec_tag = #{specTag,jdbcType=VARCHAR}, + + + spec_tag_detail = #{specTagDetail,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + spec_list = #{specList,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_product_spec + set shop_id = #{shopId,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + spec_tag = #{specTag,jdbcType=VARCHAR}, + spec_tag_detail = #{specTagDetail,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + spec_list = #{specList,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_product_spec + set shop_id = #{shopId,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + spec_tag = #{specTag,jdbcType=VARCHAR}, + spec_tag_detail = #{specTagDetail,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbProductStockDetailMapper.xml b/src/main/resources/mapper/TbProductStockDetailMapper.xml new file mode 100644 index 0000000..55056d6 --- /dev/null +++ b/src/main/resources/mapper/TbProductStockDetailMapper.xml @@ -0,0 +1,375 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, sku_id, product_id, product_name, is_stock, spec_snap, unit_name, shop_id, record_id, + batch_number, source_path, order_id, sub_type, type, left_number, stock_time, stock_number, + cost_amount, sales_amount, operator, remark, bar_code, cover_img, created_at, updated_at + + + stock_snap + + + + delete from tb_product_stock_detail + where id = #{id,jdbcType=BIGINT} + + + insert into tb_product_stock_detail (id, sku_id, product_id, + product_name, is_stock, spec_snap, + unit_name, shop_id, record_id, + batch_number, source_path, order_id, + sub_type, type, left_number, + stock_time, stock_number, cost_amount, + sales_amount, operator, remark, + bar_code, cover_img, created_at, + updated_at, stock_snap) + values (#{id,jdbcType=BIGINT}, #{skuId,jdbcType=VARCHAR}, #{productId,jdbcType=VARCHAR}, + #{productName,jdbcType=VARCHAR}, #{isStock,jdbcType=TINYINT}, #{specSnap,jdbcType=VARCHAR}, + #{unitName,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{recordId,jdbcType=VARCHAR}, + #{batchNumber,jdbcType=VARCHAR}, #{sourcePath,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR}, + #{subType,jdbcType=TINYINT}, #{type,jdbcType=VARCHAR}, #{leftNumber,jdbcType=INTEGER}, + #{stockTime,jdbcType=BIGINT}, #{stockNumber,jdbcType=DOUBLE}, #{costAmount,jdbcType=DECIMAL}, + #{salesAmount,jdbcType=DECIMAL}, #{operator,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{barCode,jdbcType=VARCHAR}, #{coverImg,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}, #{stockSnap,jdbcType=LONGVARCHAR}) + + + insert into tb_product_stock_detail + + + id, + + + sku_id, + + + product_id, + + + product_name, + + + is_stock, + + + spec_snap, + + + unit_name, + + + shop_id, + + + record_id, + + + batch_number, + + + source_path, + + + order_id, + + + sub_type, + + + type, + + + left_number, + + + stock_time, + + + stock_number, + + + cost_amount, + + + sales_amount, + + + operator, + + + remark, + + + bar_code, + + + cover_img, + + + created_at, + + + updated_at, + + + stock_snap, + + + + + #{id,jdbcType=BIGINT}, + + + #{skuId,jdbcType=VARCHAR}, + + + #{productId,jdbcType=VARCHAR}, + + + #{productName,jdbcType=VARCHAR}, + + + #{isStock,jdbcType=TINYINT}, + + + #{specSnap,jdbcType=VARCHAR}, + + + #{unitName,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{recordId,jdbcType=VARCHAR}, + + + #{batchNumber,jdbcType=VARCHAR}, + + + #{sourcePath,jdbcType=VARCHAR}, + + + #{orderId,jdbcType=VARCHAR}, + + + #{subType,jdbcType=TINYINT}, + + + #{type,jdbcType=VARCHAR}, + + + #{leftNumber,jdbcType=INTEGER}, + + + #{stockTime,jdbcType=BIGINT}, + + + #{stockNumber,jdbcType=DOUBLE}, + + + #{costAmount,jdbcType=DECIMAL}, + + + #{salesAmount,jdbcType=DECIMAL}, + + + #{operator,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{barCode,jdbcType=VARCHAR}, + + + #{coverImg,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{stockSnap,jdbcType=LONGVARCHAR}, + + + + + update tb_product_stock_detail + + + sku_id = #{skuId,jdbcType=VARCHAR}, + + + product_id = #{productId,jdbcType=VARCHAR}, + + + product_name = #{productName,jdbcType=VARCHAR}, + + + is_stock = #{isStock,jdbcType=TINYINT}, + + + spec_snap = #{specSnap,jdbcType=VARCHAR}, + + + unit_name = #{unitName,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + record_id = #{recordId,jdbcType=VARCHAR}, + + + batch_number = #{batchNumber,jdbcType=VARCHAR}, + + + source_path = #{sourcePath,jdbcType=VARCHAR}, + + + order_id = #{orderId,jdbcType=VARCHAR}, + + + sub_type = #{subType,jdbcType=TINYINT}, + + + type = #{type,jdbcType=VARCHAR}, + + + left_number = #{leftNumber,jdbcType=INTEGER}, + + + stock_time = #{stockTime,jdbcType=BIGINT}, + + + stock_number = #{stockNumber,jdbcType=DOUBLE}, + + + cost_amount = #{costAmount,jdbcType=DECIMAL}, + + + sales_amount = #{salesAmount,jdbcType=DECIMAL}, + + + operator = #{operator,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + bar_code = #{barCode,jdbcType=VARCHAR}, + + + cover_img = #{coverImg,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + stock_snap = #{stockSnap,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=BIGINT} + + + update tb_product_stock_detail + set sku_id = #{skuId,jdbcType=VARCHAR}, + product_id = #{productId,jdbcType=VARCHAR}, + product_name = #{productName,jdbcType=VARCHAR}, + is_stock = #{isStock,jdbcType=TINYINT}, + spec_snap = #{specSnap,jdbcType=VARCHAR}, + unit_name = #{unitName,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + record_id = #{recordId,jdbcType=VARCHAR}, + batch_number = #{batchNumber,jdbcType=VARCHAR}, + source_path = #{sourcePath,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=VARCHAR}, + sub_type = #{subType,jdbcType=TINYINT}, + type = #{type,jdbcType=VARCHAR}, + left_number = #{leftNumber,jdbcType=INTEGER}, + stock_time = #{stockTime,jdbcType=BIGINT}, + stock_number = #{stockNumber,jdbcType=DOUBLE}, + cost_amount = #{costAmount,jdbcType=DECIMAL}, + sales_amount = #{salesAmount,jdbcType=DECIMAL}, + operator = #{operator,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + bar_code = #{barCode,jdbcType=VARCHAR}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + stock_snap = #{stockSnap,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=BIGINT} + + + update tb_product_stock_detail + set sku_id = #{skuId,jdbcType=VARCHAR}, + product_id = #{productId,jdbcType=VARCHAR}, + product_name = #{productName,jdbcType=VARCHAR}, + is_stock = #{isStock,jdbcType=TINYINT}, + spec_snap = #{specSnap,jdbcType=VARCHAR}, + unit_name = #{unitName,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + record_id = #{recordId,jdbcType=VARCHAR}, + batch_number = #{batchNumber,jdbcType=VARCHAR}, + source_path = #{sourcePath,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=VARCHAR}, + sub_type = #{subType,jdbcType=TINYINT}, + type = #{type,jdbcType=VARCHAR}, + left_number = #{leftNumber,jdbcType=INTEGER}, + stock_time = #{stockTime,jdbcType=BIGINT}, + stock_number = #{stockNumber,jdbcType=DOUBLE}, + cost_amount = #{costAmount,jdbcType=DECIMAL}, + sales_amount = #{salesAmount,jdbcType=DECIMAL}, + operator = #{operator,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + bar_code = #{barCode,jdbcType=VARCHAR}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbProductStockOperateMapper.xml b/src/main/resources/mapper/TbProductStockOperateMapper.xml new file mode 100644 index 0000000..46e38a3 --- /dev/null +++ b/src/main/resources/mapper/TbProductStockOperateMapper.xml @@ -0,0 +1,222 @@ + + + + + + + + + + + + + + + + + + + + + + + id, shop_id, type, sub_type, batch_number, remark, stock_time, operator_snap, created_at, + updated_at, purveyor_id, purveyor_name, status + + + stock_snap + + + + delete from tb_product_stock_operate + where id = #{id,jdbcType=INTEGER} + + + insert into tb_product_stock_operate (id, shop_id, type, + sub_type, batch_number, remark, + stock_time, operator_snap, created_at, + updated_at, purveyor_id, purveyor_name, + status, stock_snap) + values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{subType,jdbcType=TINYINT}, #{batchNumber,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, + #{stockTime,jdbcType=BIGINT}, #{operatorSnap,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}, #{purveyorId,jdbcType=VARCHAR}, #{purveyorName,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, #{stockSnap,jdbcType=LONGVARCHAR}) + + + insert into tb_product_stock_operate + + + id, + + + shop_id, + + + type, + + + sub_type, + + + batch_number, + + + remark, + + + stock_time, + + + operator_snap, + + + created_at, + + + updated_at, + + + purveyor_id, + + + purveyor_name, + + + status, + + + stock_snap, + + + + + #{id,jdbcType=INTEGER}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{subType,jdbcType=TINYINT}, + + + #{batchNumber,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{stockTime,jdbcType=BIGINT}, + + + #{operatorSnap,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{purveyorId,jdbcType=VARCHAR}, + + + #{purveyorName,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{stockSnap,jdbcType=LONGVARCHAR}, + + + + + update tb_product_stock_operate + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + sub_type = #{subType,jdbcType=TINYINT}, + + + batch_number = #{batchNumber,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + stock_time = #{stockTime,jdbcType=BIGINT}, + + + operator_snap = #{operatorSnap,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + purveyor_id = #{purveyorId,jdbcType=VARCHAR}, + + + purveyor_name = #{purveyorName,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + stock_snap = #{stockSnap,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_product_stock_operate + set shop_id = #{shopId,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + sub_type = #{subType,jdbcType=TINYINT}, + batch_number = #{batchNumber,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + stock_time = #{stockTime,jdbcType=BIGINT}, + operator_snap = #{operatorSnap,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + purveyor_id = #{purveyorId,jdbcType=VARCHAR}, + purveyor_name = #{purveyorName,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + stock_snap = #{stockSnap,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_product_stock_operate + set shop_id = #{shopId,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + sub_type = #{subType,jdbcType=TINYINT}, + batch_number = #{batchNumber,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + stock_time = #{stockTime,jdbcType=BIGINT}, + operator_snap = #{operatorSnap,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + purveyor_id = #{purveyorId,jdbcType=VARCHAR}, + purveyor_name = #{purveyorName,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbReceiptSalesMapper.xml b/src/main/resources/mapper/TbReceiptSalesMapper.xml new file mode 100644 index 0000000..0f0e0c5 --- /dev/null +++ b/src/main/resources/mapper/TbReceiptSalesMapper.xml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + id, title, logo, show_contact_info, show_member, show_member_code, show_member_score, + show_member_wallet, footer_remark, show_cash_charge, show_serial_no, big_serial_no, + header_text, header_text_align, footer_text, footer_text_align, footer_image, pre_print, + created_at, updated_at + + + + delete from tb_receipt_sales + where id = #{id,jdbcType=INTEGER} + + + insert into tb_receipt_sales (id, title, logo, + show_contact_info, show_member, show_member_code, + show_member_score, show_member_wallet, footer_remark, + show_cash_charge, show_serial_no, big_serial_no, + header_text, header_text_align, footer_text, + footer_text_align, footer_image, pre_print, + created_at, updated_at) + values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR}, + #{showContactInfo,jdbcType=BIT}, #{showMember,jdbcType=BIT}, #{showMemberCode,jdbcType=BIT}, + #{showMemberScore,jdbcType=BIT}, #{showMemberWallet,jdbcType=BIT}, #{footerRemark,jdbcType=VARCHAR}, + #{showCashCharge,jdbcType=BIT}, #{showSerialNo,jdbcType=BIT}, #{bigSerialNo,jdbcType=BIT}, + #{headerText,jdbcType=VARCHAR}, #{headerTextAlign,jdbcType=VARCHAR}, #{footerText,jdbcType=VARCHAR}, + #{footerTextAlign,jdbcType=VARCHAR}, #{footerImage,jdbcType=VARCHAR}, #{prePrint,jdbcType=VARCHAR}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}) + + + insert into tb_receipt_sales + + + id, + + + title, + + + logo, + + + show_contact_info, + + + show_member, + + + show_member_code, + + + show_member_score, + + + show_member_wallet, + + + footer_remark, + + + show_cash_charge, + + + show_serial_no, + + + big_serial_no, + + + header_text, + + + header_text_align, + + + footer_text, + + + footer_text_align, + + + footer_image, + + + pre_print, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{title,jdbcType=VARCHAR}, + + + #{logo,jdbcType=VARCHAR}, + + + #{showContactInfo,jdbcType=BIT}, + + + #{showMember,jdbcType=BIT}, + + + #{showMemberCode,jdbcType=BIT}, + + + #{showMemberScore,jdbcType=BIT}, + + + #{showMemberWallet,jdbcType=BIT}, + + + #{footerRemark,jdbcType=VARCHAR}, + + + #{showCashCharge,jdbcType=BIT}, + + + #{showSerialNo,jdbcType=BIT}, + + + #{bigSerialNo,jdbcType=BIT}, + + + #{headerText,jdbcType=VARCHAR}, + + + #{headerTextAlign,jdbcType=VARCHAR}, + + + #{footerText,jdbcType=VARCHAR}, + + + #{footerTextAlign,jdbcType=VARCHAR}, + + + #{footerImage,jdbcType=VARCHAR}, + + + #{prePrint,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + update tb_receipt_sales + + + title = #{title,jdbcType=VARCHAR}, + + + logo = #{logo,jdbcType=VARCHAR}, + + + show_contact_info = #{showContactInfo,jdbcType=BIT}, + + + show_member = #{showMember,jdbcType=BIT}, + + + show_member_code = #{showMemberCode,jdbcType=BIT}, + + + show_member_score = #{showMemberScore,jdbcType=BIT}, + + + show_member_wallet = #{showMemberWallet,jdbcType=BIT}, + + + footer_remark = #{footerRemark,jdbcType=VARCHAR}, + + + show_cash_charge = #{showCashCharge,jdbcType=BIT}, + + + show_serial_no = #{showSerialNo,jdbcType=BIT}, + + + big_serial_no = #{bigSerialNo,jdbcType=BIT}, + + + header_text = #{headerText,jdbcType=VARCHAR}, + + + header_text_align = #{headerTextAlign,jdbcType=VARCHAR}, + + + footer_text = #{footerText,jdbcType=VARCHAR}, + + + footer_text_align = #{footerTextAlign,jdbcType=VARCHAR}, + + + footer_image = #{footerImage,jdbcType=VARCHAR}, + + + pre_print = #{prePrint,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_receipt_sales + set title = #{title,jdbcType=VARCHAR}, + logo = #{logo,jdbcType=VARCHAR}, + show_contact_info = #{showContactInfo,jdbcType=BIT}, + show_member = #{showMember,jdbcType=BIT}, + show_member_code = #{showMemberCode,jdbcType=BIT}, + show_member_score = #{showMemberScore,jdbcType=BIT}, + show_member_wallet = #{showMemberWallet,jdbcType=BIT}, + footer_remark = #{footerRemark,jdbcType=VARCHAR}, + show_cash_charge = #{showCashCharge,jdbcType=BIT}, + show_serial_no = #{showSerialNo,jdbcType=BIT}, + big_serial_no = #{bigSerialNo,jdbcType=BIT}, + header_text = #{headerText,jdbcType=VARCHAR}, + header_text_align = #{headerTextAlign,jdbcType=VARCHAR}, + footer_text = #{footerText,jdbcType=VARCHAR}, + footer_text_align = #{footerTextAlign,jdbcType=VARCHAR}, + footer_image = #{footerImage,jdbcType=VARCHAR}, + pre_print = #{prePrint,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbRenewalsPayLogMapper.xml b/src/main/resources/mapper/TbRenewalsPayLogMapper.xml new file mode 100644 index 0000000..ea09b30 --- /dev/null +++ b/src/main/resources/mapper/TbRenewalsPayLogMapper.xml @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + id, pay_type, shop_id, order_id, open_id, user_id, transaction_id, amount, status, + remark, attach, expired_at, created_at, updated_at + + + + delete from tb_renewals_pay_log + where id = #{id,jdbcType=INTEGER} + + + insert into tb_renewals_pay_log (id, pay_type, shop_id, + order_id, open_id, user_id, + transaction_id, amount, status, + remark, attach, expired_at, + created_at, updated_at) + values (#{id,jdbcType=INTEGER}, #{payType,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, + #{orderId,jdbcType=VARCHAR}, #{openId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, + #{transactionId,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=TINYINT}, + #{remark,jdbcType=VARCHAR}, #{attach,jdbcType=VARCHAR}, #{expiredAt,jdbcType=BIGINT}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}) + + + insert into tb_renewals_pay_log + + + id, + + + pay_type, + + + shop_id, + + + order_id, + + + open_id, + + + user_id, + + + transaction_id, + + + amount, + + + status, + + + remark, + + + attach, + + + expired_at, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{payType,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{orderId,jdbcType=VARCHAR}, + + + #{openId,jdbcType=VARCHAR}, + + + #{userId,jdbcType=VARCHAR}, + + + #{transactionId,jdbcType=VARCHAR}, + + + #{amount,jdbcType=DECIMAL}, + + + #{status,jdbcType=TINYINT}, + + + #{remark,jdbcType=VARCHAR}, + + + #{attach,jdbcType=VARCHAR}, + + + #{expiredAt,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + update tb_renewals_pay_log + + + pay_type = #{payType,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + order_id = #{orderId,jdbcType=VARCHAR}, + + + open_id = #{openId,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=VARCHAR}, + + + transaction_id = #{transactionId,jdbcType=VARCHAR}, + + + amount = #{amount,jdbcType=DECIMAL}, + + + status = #{status,jdbcType=TINYINT}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + attach = #{attach,jdbcType=VARCHAR}, + + + expired_at = #{expiredAt,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_renewals_pay_log + set pay_type = #{payType,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + order_id = #{orderId,jdbcType=VARCHAR}, + open_id = #{openId,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=VARCHAR}, + transaction_id = #{transactionId,jdbcType=VARCHAR}, + amount = #{amount,jdbcType=DECIMAL}, + status = #{status,jdbcType=TINYINT}, + remark = #{remark,jdbcType=VARCHAR}, + attach = #{attach,jdbcType=VARCHAR}, + expired_at = #{expiredAt,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopAreaMapper.xml b/src/main/resources/mapper/TbShopAreaMapper.xml new file mode 100644 index 0000000..798f400 --- /dev/null +++ b/src/main/resources/mapper/TbShopAreaMapper.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + id, shop_id, sort, name, price, capacity_range, created_at, updated_at + + + view + + + + + delete from tb_shop_area + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_area (id, shop_id, sort, + name, price, capacity_range, + created_at, updated_at, view + ) + values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, + #{name,jdbcType=VARCHAR}, #{price,jdbcType=INTEGER}, #{capacityRange,jdbcType=VARCHAR}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{view,jdbcType=LONGVARCHAR} + ) + + + insert into tb_shop_area + + + id, + + + shop_id, + + + sort, + + + name, + + + price, + + + capacity_range, + + + created_at, + + + updated_at, + + + view, + + + + + #{id,jdbcType=INTEGER}, + + + #{shopId,jdbcType=INTEGER}, + + + #{sort,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{price,jdbcType=INTEGER}, + + + #{capacityRange,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{view,jdbcType=LONGVARCHAR}, + + + + + update tb_shop_area + + + shop_id = #{shopId,jdbcType=INTEGER}, + + + sort = #{sort,jdbcType=INTEGER}, + + + name = #{name,jdbcType=VARCHAR}, + + + price = #{price,jdbcType=INTEGER}, + + + capacity_range = #{capacityRange,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + view = #{view,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_area + set shop_id = #{shopId,jdbcType=INTEGER}, + sort = #{sort,jdbcType=INTEGER}, + name = #{name,jdbcType=VARCHAR}, + price = #{price,jdbcType=INTEGER}, + capacity_range = #{capacityRange,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + view = #{view,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_area + set shop_id = #{shopId,jdbcType=INTEGER}, + sort = #{sort,jdbcType=INTEGER}, + name = #{name,jdbcType=VARCHAR}, + price = #{price,jdbcType=INTEGER}, + capacity_range = #{capacityRange,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopCashSpreadMapper.xml b/src/main/resources/mapper/TbShopCashSpreadMapper.xml new file mode 100644 index 0000000..87c41c7 --- /dev/null +++ b/src/main/resources/mapper/TbShopCashSpreadMapper.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + id, created_at, updated_at + + + sale_receipt, triplicate_receipt, screen_config, tag_config, scale_config + + + + delete from tb_shop_cash_spread + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_cash_spread (id, created_at, updated_at, + sale_receipt, triplicate_receipt, + screen_config, tag_config, scale_config + ) + values (#{id,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, + #{saleReceipt,jdbcType=LONGVARCHAR}, #{triplicateReceipt,jdbcType=LONGVARCHAR}, + #{screenConfig,jdbcType=LONGVARCHAR}, #{tagConfig,jdbcType=LONGVARCHAR}, #{scaleConfig,jdbcType=LONGVARCHAR} + ) + + + insert into tb_shop_cash_spread + + + id, + + + created_at, + + + updated_at, + + + sale_receipt, + + + triplicate_receipt, + + + screen_config, + + + tag_config, + + + scale_config, + + + + + #{id,jdbcType=INTEGER}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{saleReceipt,jdbcType=LONGVARCHAR}, + + + #{triplicateReceipt,jdbcType=LONGVARCHAR}, + + + #{screenConfig,jdbcType=LONGVARCHAR}, + + + #{tagConfig,jdbcType=LONGVARCHAR}, + + + #{scaleConfig,jdbcType=LONGVARCHAR}, + + + + + update tb_shop_cash_spread + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + sale_receipt = #{saleReceipt,jdbcType=LONGVARCHAR}, + + + triplicate_receipt = #{triplicateReceipt,jdbcType=LONGVARCHAR}, + + + screen_config = #{screenConfig,jdbcType=LONGVARCHAR}, + + + tag_config = #{tagConfig,jdbcType=LONGVARCHAR}, + + + scale_config = #{scaleConfig,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_cash_spread + set created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + sale_receipt = #{saleReceipt,jdbcType=LONGVARCHAR}, + triplicate_receipt = #{triplicateReceipt,jdbcType=LONGVARCHAR}, + screen_config = #{screenConfig,jdbcType=LONGVARCHAR}, + tag_config = #{tagConfig,jdbcType=LONGVARCHAR}, + scale_config = #{scaleConfig,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_cash_spread + set created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopCategoryMapper.xml b/src/main/resources/mapper/TbShopCategoryMapper.xml new file mode 100644 index 0000000..95a0976 --- /dev/null +++ b/src/main/resources/mapper/TbShopCategoryMapper.xml @@ -0,0 +1,210 @@ + + + + + + + + + + + + + + + + + + + + + + id, name, short_name, tree, pid, pic, merchant_id, shop_id, style, is_show, detail, + sort, key_word, created_at, updated_at + + + + delete from tb_shop_category + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_category (id, name, short_name, + tree, pid, pic, merchant_id, + shop_id, style, is_show, + detail, sort, key_word, + created_at, updated_at) + values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{shortName,jdbcType=VARCHAR}, + #{tree,jdbcType=INTEGER}, #{pid,jdbcType=VARCHAR}, #{pic,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, + #{shopId,jdbcType=VARCHAR}, #{style,jdbcType=VARCHAR}, #{isShow,jdbcType=TINYINT}, + #{detail,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{keyWord,jdbcType=VARCHAR}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}) + + + insert into tb_shop_category + + + id, + + + name, + + + short_name, + + + tree, + + + pid, + + + pic, + + + merchant_id, + + + shop_id, + + + style, + + + is_show, + + + detail, + + + sort, + + + key_word, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{shortName,jdbcType=VARCHAR}, + + + #{tree,jdbcType=INTEGER}, + + + #{pid,jdbcType=VARCHAR}, + + + #{pic,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{style,jdbcType=VARCHAR}, + + + #{isShow,jdbcType=TINYINT}, + + + #{detail,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{keyWord,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + update tb_shop_category + + + name = #{name,jdbcType=VARCHAR}, + + + short_name = #{shortName,jdbcType=VARCHAR}, + + + tree = #{tree,jdbcType=INTEGER}, + + + pid = #{pid,jdbcType=VARCHAR}, + + + pic = #{pic,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + style = #{style,jdbcType=VARCHAR}, + + + is_show = #{isShow,jdbcType=TINYINT}, + + + detail = #{detail,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + key_word = #{keyWord,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_category + set name = #{name,jdbcType=VARCHAR}, + short_name = #{shortName,jdbcType=VARCHAR}, + tree = #{tree,jdbcType=INTEGER}, + pid = #{pid,jdbcType=VARCHAR}, + pic = #{pic,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + style = #{style,jdbcType=VARCHAR}, + is_show = #{isShow,jdbcType=TINYINT}, + detail = #{detail,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + key_word = #{keyWord,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopCurrencyMapper.xml b/src/main/resources/mapper/TbShopCurrencyMapper.xml new file mode 100644 index 0000000..503f4e0 --- /dev/null +++ b/src/main/resources/mapper/TbShopCurrencyMapper.xml @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, shop_id, prepare_amount, currency, decimals_digits, discount_round, merchant_id, + small_change, enable_custom_discount, max_discount, max_percent, biz_duration, allow_web_pay, + is_auto_to_zero, is_include_tax_price, tax_number, created_at, updated_at, auto_lock_screen, + voice_notification + + + discount_configs, service_charge + + + + delete from tb_shop_currency + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_currency (id, shop_id, prepare_amount, + currency, decimals_digits, discount_round, + merchant_id, small_change, enable_custom_discount, + max_discount, max_percent, biz_duration, + allow_web_pay, is_auto_to_zero, is_include_tax_price, + tax_number, created_at, updated_at, + auto_lock_screen, voice_notification, discount_configs, + service_charge) + values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=VARCHAR}, #{prepareAmount,jdbcType=DECIMAL}, + #{currency,jdbcType=VARCHAR}, #{decimalsDigits,jdbcType=TINYINT}, #{discountRound,jdbcType=VARCHAR}, + #{merchantId,jdbcType=VARCHAR}, #{smallChange,jdbcType=TINYINT}, #{enableCustomDiscount,jdbcType=TINYINT}, + #{maxDiscount,jdbcType=DECIMAL}, #{maxPercent,jdbcType=DOUBLE}, #{bizDuration,jdbcType=VARCHAR}, + #{allowWebPay,jdbcType=TINYINT}, #{isAutoToZero,jdbcType=TINYINT}, #{isIncludeTaxPrice,jdbcType=TINYINT}, + #{taxNumber,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, + #{autoLockScreen,jdbcType=TINYINT}, #{voiceNotification,jdbcType=TINYINT}, #{discountConfigs,jdbcType=LONGVARCHAR}, + #{serviceCharge,jdbcType=LONGVARCHAR}) + + + insert into tb_shop_currency + + + id, + + + shop_id, + + + prepare_amount, + + + currency, + + + decimals_digits, + + + discount_round, + + + merchant_id, + + + small_change, + + + enable_custom_discount, + + + max_discount, + + + max_percent, + + + biz_duration, + + + allow_web_pay, + + + is_auto_to_zero, + + + is_include_tax_price, + + + tax_number, + + + created_at, + + + updated_at, + + + auto_lock_screen, + + + voice_notification, + + + discount_configs, + + + service_charge, + + + + + #{id,jdbcType=INTEGER}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{prepareAmount,jdbcType=DECIMAL}, + + + #{currency,jdbcType=VARCHAR}, + + + #{decimalsDigits,jdbcType=TINYINT}, + + + #{discountRound,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{smallChange,jdbcType=TINYINT}, + + + #{enableCustomDiscount,jdbcType=TINYINT}, + + + #{maxDiscount,jdbcType=DECIMAL}, + + + #{maxPercent,jdbcType=DOUBLE}, + + + #{bizDuration,jdbcType=VARCHAR}, + + + #{allowWebPay,jdbcType=TINYINT}, + + + #{isAutoToZero,jdbcType=TINYINT}, + + + #{isIncludeTaxPrice,jdbcType=TINYINT}, + + + #{taxNumber,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{autoLockScreen,jdbcType=TINYINT}, + + + #{voiceNotification,jdbcType=TINYINT}, + + + #{discountConfigs,jdbcType=LONGVARCHAR}, + + + #{serviceCharge,jdbcType=LONGVARCHAR}, + + + + + update tb_shop_currency + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + prepare_amount = #{prepareAmount,jdbcType=DECIMAL}, + + + currency = #{currency,jdbcType=VARCHAR}, + + + decimals_digits = #{decimalsDigits,jdbcType=TINYINT}, + + + discount_round = #{discountRound,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + small_change = #{smallChange,jdbcType=TINYINT}, + + + enable_custom_discount = #{enableCustomDiscount,jdbcType=TINYINT}, + + + max_discount = #{maxDiscount,jdbcType=DECIMAL}, + + + max_percent = #{maxPercent,jdbcType=DOUBLE}, + + + biz_duration = #{bizDuration,jdbcType=VARCHAR}, + + + allow_web_pay = #{allowWebPay,jdbcType=TINYINT}, + + + is_auto_to_zero = #{isAutoToZero,jdbcType=TINYINT}, + + + is_include_tax_price = #{isIncludeTaxPrice,jdbcType=TINYINT}, + + + tax_number = #{taxNumber,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + auto_lock_screen = #{autoLockScreen,jdbcType=TINYINT}, + + + voice_notification = #{voiceNotification,jdbcType=TINYINT}, + + + discount_configs = #{discountConfigs,jdbcType=LONGVARCHAR}, + + + service_charge = #{serviceCharge,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_currency + set shop_id = #{shopId,jdbcType=VARCHAR}, + prepare_amount = #{prepareAmount,jdbcType=DECIMAL}, + currency = #{currency,jdbcType=VARCHAR}, + decimals_digits = #{decimalsDigits,jdbcType=TINYINT}, + discount_round = #{discountRound,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + small_change = #{smallChange,jdbcType=TINYINT}, + enable_custom_discount = #{enableCustomDiscount,jdbcType=TINYINT}, + max_discount = #{maxDiscount,jdbcType=DECIMAL}, + max_percent = #{maxPercent,jdbcType=DOUBLE}, + biz_duration = #{bizDuration,jdbcType=VARCHAR}, + allow_web_pay = #{allowWebPay,jdbcType=TINYINT}, + is_auto_to_zero = #{isAutoToZero,jdbcType=TINYINT}, + is_include_tax_price = #{isIncludeTaxPrice,jdbcType=TINYINT}, + tax_number = #{taxNumber,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + auto_lock_screen = #{autoLockScreen,jdbcType=TINYINT}, + voice_notification = #{voiceNotification,jdbcType=TINYINT}, + discount_configs = #{discountConfigs,jdbcType=LONGVARCHAR}, + service_charge = #{serviceCharge,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_currency + set shop_id = #{shopId,jdbcType=VARCHAR}, + prepare_amount = #{prepareAmount,jdbcType=DECIMAL}, + currency = #{currency,jdbcType=VARCHAR}, + decimals_digits = #{decimalsDigits,jdbcType=TINYINT}, + discount_round = #{discountRound,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + small_change = #{smallChange,jdbcType=TINYINT}, + enable_custom_discount = #{enableCustomDiscount,jdbcType=TINYINT}, + max_discount = #{maxDiscount,jdbcType=DECIMAL}, + max_percent = #{maxPercent,jdbcType=DOUBLE}, + biz_duration = #{bizDuration,jdbcType=VARCHAR}, + allow_web_pay = #{allowWebPay,jdbcType=TINYINT}, + is_auto_to_zero = #{isAutoToZero,jdbcType=TINYINT}, + is_include_tax_price = #{isIncludeTaxPrice,jdbcType=TINYINT}, + tax_number = #{taxNumber,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + auto_lock_screen = #{autoLockScreen,jdbcType=TINYINT}, + voice_notification = #{voiceNotification,jdbcType=TINYINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopInfoMapper.xml b/src/main/resources/mapper/TbShopInfoMapper.xml new file mode 100644 index 0000000..bad0fbf --- /dev/null +++ b/src/main/resources/mapper/TbShopInfoMapper.xml @@ -0,0 +1,620 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, account, shop_code, sub_title, merchant_id, shop_name, chain_name, back_img, + front_img, contact_name, phone, logo, is_deposit, is_supply, cover_img, share_img, + detail, lat, lng, mch_id, register_type, is_wx_ma_independent, address, city, type, + industry, industry_name, business_time, post_time, post_amount_line, on_sale, settle_type, + settle_time, enter_at, expire_at, status, average, order_wait_pay_minute, support_device_number, + distribute_level, created_at, updated_at, proxy_id + + + view + + + + delete from tb_shop_info + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_info (id, account, shop_code, + sub_title, merchant_id, shop_name, + chain_name, back_img, front_img, + contact_name, phone, logo, + is_deposit, is_supply, cover_img, + share_img, detail, lat, + lng, mch_id, register_type, + is_wx_ma_independent, address, city, + type, industry, industry_name, + business_time, post_time, post_amount_line, + on_sale, settle_type, settle_time, + enter_at, expire_at, status, + average, order_wait_pay_minute, support_device_number, + distribute_level, created_at, updated_at, + proxy_id, view) + values (#{id,jdbcType=INTEGER}, #{account,jdbcType=VARCHAR}, #{shopCode,jdbcType=VARCHAR}, + #{subTitle,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{shopName,jdbcType=VARCHAR}, + #{chainName,jdbcType=VARCHAR}, #{backImg,jdbcType=VARCHAR}, #{frontImg,jdbcType=VARCHAR}, + #{contactName,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR}, + #{isDeposit,jdbcType=TINYINT}, #{isSupply,jdbcType=TINYINT}, #{coverImg,jdbcType=VARCHAR}, + #{shareImg,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR}, #{lat,jdbcType=VARCHAR}, + #{lng,jdbcType=VARCHAR}, #{mchId,jdbcType=VARCHAR}, #{registerType,jdbcType=VARCHAR}, + #{isWxMaIndependent,jdbcType=TINYINT}, #{address,jdbcType=VARCHAR}, #{city,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{industry,jdbcType=VARCHAR}, #{industryName,jdbcType=VARCHAR}, + #{businessTime,jdbcType=VARCHAR}, #{postTime,jdbcType=VARCHAR}, #{postAmountLine,jdbcType=DECIMAL}, + #{onSale,jdbcType=TINYINT}, #{settleType,jdbcType=TINYINT}, #{settleTime,jdbcType=VARCHAR}, + #{enterAt,jdbcType=INTEGER}, #{expireAt,jdbcType=BIGINT}, #{status,jdbcType=TINYINT}, + #{average,jdbcType=REAL}, #{orderWaitPayMinute,jdbcType=INTEGER}, #{supportDeviceNumber,jdbcType=INTEGER}, + #{distributeLevel,jdbcType=TINYINT}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, + #{proxyId,jdbcType=VARCHAR}, #{view,jdbcType=LONGVARCHAR}) + + + insert into tb_shop_info + + + id, + + + account, + + + shop_code, + + + sub_title, + + + merchant_id, + + + shop_name, + + + chain_name, + + + back_img, + + + front_img, + + + contact_name, + + + phone, + + + logo, + + + is_deposit, + + + is_supply, + + + cover_img, + + + share_img, + + + detail, + + + lat, + + + lng, + + + mch_id, + + + register_type, + + + is_wx_ma_independent, + + + address, + + + city, + + + type, + + + industry, + + + industry_name, + + + business_time, + + + post_time, + + + post_amount_line, + + + on_sale, + + + settle_type, + + + settle_time, + + + enter_at, + + + expire_at, + + + status, + + + average, + + + order_wait_pay_minute, + + + support_device_number, + + + distribute_level, + + + created_at, + + + updated_at, + + + proxy_id, + + + view, + + + + + #{id,jdbcType=INTEGER}, + + + #{account,jdbcType=VARCHAR}, + + + #{shopCode,jdbcType=VARCHAR}, + + + #{subTitle,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopName,jdbcType=VARCHAR}, + + + #{chainName,jdbcType=VARCHAR}, + + + #{backImg,jdbcType=VARCHAR}, + + + #{frontImg,jdbcType=VARCHAR}, + + + #{contactName,jdbcType=VARCHAR}, + + + #{phone,jdbcType=VARCHAR}, + + + #{logo,jdbcType=VARCHAR}, + + + #{isDeposit,jdbcType=TINYINT}, + + + #{isSupply,jdbcType=TINYINT}, + + + #{coverImg,jdbcType=VARCHAR}, + + + #{shareImg,jdbcType=VARCHAR}, + + + #{detail,jdbcType=VARCHAR}, + + + #{lat,jdbcType=VARCHAR}, + + + #{lng,jdbcType=VARCHAR}, + + + #{mchId,jdbcType=VARCHAR}, + + + #{registerType,jdbcType=VARCHAR}, + + + #{isWxMaIndependent,jdbcType=TINYINT}, + + + #{address,jdbcType=VARCHAR}, + + + #{city,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{industry,jdbcType=VARCHAR}, + + + #{industryName,jdbcType=VARCHAR}, + + + #{businessTime,jdbcType=VARCHAR}, + + + #{postTime,jdbcType=VARCHAR}, + + + #{postAmountLine,jdbcType=DECIMAL}, + + + #{onSale,jdbcType=TINYINT}, + + + #{settleType,jdbcType=TINYINT}, + + + #{settleTime,jdbcType=VARCHAR}, + + + #{enterAt,jdbcType=INTEGER}, + + + #{expireAt,jdbcType=BIGINT}, + + + #{status,jdbcType=TINYINT}, + + + #{average,jdbcType=REAL}, + + + #{orderWaitPayMinute,jdbcType=INTEGER}, + + + #{supportDeviceNumber,jdbcType=INTEGER}, + + + #{distributeLevel,jdbcType=TINYINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{proxyId,jdbcType=VARCHAR}, + + + #{view,jdbcType=LONGVARCHAR}, + + + + + update tb_shop_info + + + account = #{account,jdbcType=VARCHAR}, + + + shop_code = #{shopCode,jdbcType=VARCHAR}, + + + sub_title = #{subTitle,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_name = #{shopName,jdbcType=VARCHAR}, + + + chain_name = #{chainName,jdbcType=VARCHAR}, + + + back_img = #{backImg,jdbcType=VARCHAR}, + + + front_img = #{frontImg,jdbcType=VARCHAR}, + + + contact_name = #{contactName,jdbcType=VARCHAR}, + + + phone = #{phone,jdbcType=VARCHAR}, + + + logo = #{logo,jdbcType=VARCHAR}, + + + is_deposit = #{isDeposit,jdbcType=TINYINT}, + + + is_supply = #{isSupply,jdbcType=TINYINT}, + + + cover_img = #{coverImg,jdbcType=VARCHAR}, + + + share_img = #{shareImg,jdbcType=VARCHAR}, + + + detail = #{detail,jdbcType=VARCHAR}, + + + lat = #{lat,jdbcType=VARCHAR}, + + + lng = #{lng,jdbcType=VARCHAR}, + + + mch_id = #{mchId,jdbcType=VARCHAR}, + + + register_type = #{registerType,jdbcType=VARCHAR}, + + + is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, + + + address = #{address,jdbcType=VARCHAR}, + + + city = #{city,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + industry = #{industry,jdbcType=VARCHAR}, + + + industry_name = #{industryName,jdbcType=VARCHAR}, + + + business_time = #{businessTime,jdbcType=VARCHAR}, + + + post_time = #{postTime,jdbcType=VARCHAR}, + + + post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, + + + on_sale = #{onSale,jdbcType=TINYINT}, + + + settle_type = #{settleType,jdbcType=TINYINT}, + + + settle_time = #{settleTime,jdbcType=VARCHAR}, + + + enter_at = #{enterAt,jdbcType=INTEGER}, + + + expire_at = #{expireAt,jdbcType=BIGINT}, + + + status = #{status,jdbcType=TINYINT}, + + + average = #{average,jdbcType=REAL}, + + + order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, + + + support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, + + + distribute_level = #{distributeLevel,jdbcType=TINYINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + proxy_id = #{proxyId,jdbcType=VARCHAR}, + + + view = #{view,jdbcType=LONGVARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_info + set account = #{account,jdbcType=VARCHAR}, + shop_code = #{shopCode,jdbcType=VARCHAR}, + sub_title = #{subTitle,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_name = #{shopName,jdbcType=VARCHAR}, + chain_name = #{chainName,jdbcType=VARCHAR}, + back_img = #{backImg,jdbcType=VARCHAR}, + front_img = #{frontImg,jdbcType=VARCHAR}, + contact_name = #{contactName,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + logo = #{logo,jdbcType=VARCHAR}, + is_deposit = #{isDeposit,jdbcType=TINYINT}, + is_supply = #{isSupply,jdbcType=TINYINT}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + share_img = #{shareImg,jdbcType=VARCHAR}, + detail = #{detail,jdbcType=VARCHAR}, + lat = #{lat,jdbcType=VARCHAR}, + lng = #{lng,jdbcType=VARCHAR}, + mch_id = #{mchId,jdbcType=VARCHAR}, + register_type = #{registerType,jdbcType=VARCHAR}, + is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, + address = #{address,jdbcType=VARCHAR}, + city = #{city,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + industry = #{industry,jdbcType=VARCHAR}, + industry_name = #{industryName,jdbcType=VARCHAR}, + business_time = #{businessTime,jdbcType=VARCHAR}, + post_time = #{postTime,jdbcType=VARCHAR}, + post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, + on_sale = #{onSale,jdbcType=TINYINT}, + settle_type = #{settleType,jdbcType=TINYINT}, + settle_time = #{settleTime,jdbcType=VARCHAR}, + enter_at = #{enterAt,jdbcType=INTEGER}, + expire_at = #{expireAt,jdbcType=BIGINT}, + status = #{status,jdbcType=TINYINT}, + average = #{average,jdbcType=REAL}, + order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, + support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, + distribute_level = #{distributeLevel,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + proxy_id = #{proxyId,jdbcType=VARCHAR}, + view = #{view,jdbcType=LONGVARCHAR} + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_info + set account = #{account,jdbcType=VARCHAR}, + shop_code = #{shopCode,jdbcType=VARCHAR}, + sub_title = #{subTitle,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_name = #{shopName,jdbcType=VARCHAR}, + chain_name = #{chainName,jdbcType=VARCHAR}, + back_img = #{backImg,jdbcType=VARCHAR}, + front_img = #{frontImg,jdbcType=VARCHAR}, + contact_name = #{contactName,jdbcType=VARCHAR}, + phone = #{phone,jdbcType=VARCHAR}, + logo = #{logo,jdbcType=VARCHAR}, + is_deposit = #{isDeposit,jdbcType=TINYINT}, + is_supply = #{isSupply,jdbcType=TINYINT}, + cover_img = #{coverImg,jdbcType=VARCHAR}, + share_img = #{shareImg,jdbcType=VARCHAR}, + detail = #{detail,jdbcType=VARCHAR}, + lat = #{lat,jdbcType=VARCHAR}, + lng = #{lng,jdbcType=VARCHAR}, + mch_id = #{mchId,jdbcType=VARCHAR}, + register_type = #{registerType,jdbcType=VARCHAR}, + is_wx_ma_independent = #{isWxMaIndependent,jdbcType=TINYINT}, + address = #{address,jdbcType=VARCHAR}, + city = #{city,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + industry = #{industry,jdbcType=VARCHAR}, + industry_name = #{industryName,jdbcType=VARCHAR}, + business_time = #{businessTime,jdbcType=VARCHAR}, + post_time = #{postTime,jdbcType=VARCHAR}, + post_amount_line = #{postAmountLine,jdbcType=DECIMAL}, + on_sale = #{onSale,jdbcType=TINYINT}, + settle_type = #{settleType,jdbcType=TINYINT}, + settle_time = #{settleTime,jdbcType=VARCHAR}, + enter_at = #{enterAt,jdbcType=INTEGER}, + expire_at = #{expireAt,jdbcType=BIGINT}, + status = #{status,jdbcType=TINYINT}, + average = #{average,jdbcType=REAL}, + order_wait_pay_minute = #{orderWaitPayMinute,jdbcType=INTEGER}, + support_device_number = #{supportDeviceNumber,jdbcType=INTEGER}, + distribute_level = #{distributeLevel,jdbcType=TINYINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + proxy_id = #{proxyId,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopPayTypeMapper.xml b/src/main/resources/mapper/TbShopPayTypeMapper.xml new file mode 100644 index 0000000..9b2c36c --- /dev/null +++ b/src/main/resources/mapper/TbShopPayTypeMapper.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + id, pay_type, pay_name, is_show_shortcut, shop_id, is_refundable, is_open_cash_drawer, + is_system, is_ideal, is_display, sorts, created_at, updated_at + + + + delete from tb_shop_pay_type + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_pay_type (id, pay_type, pay_name, + is_show_shortcut, shop_id, is_refundable, + is_open_cash_drawer, is_system, is_ideal, + is_display, sorts, created_at, + updated_at) + values (#{id,jdbcType=INTEGER}, #{payType,jdbcType=VARCHAR}, #{payName,jdbcType=VARCHAR}, + #{isShowShortcut,jdbcType=TINYINT}, #{shopId,jdbcType=VARCHAR}, #{isRefundable,jdbcType=TINYINT}, + #{isOpenCashDrawer,jdbcType=TINYINT}, #{isSystem,jdbcType=TINYINT}, #{isIdeal,jdbcType=TINYINT}, + #{isDisplay,jdbcType=TINYINT}, #{sorts,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}) + + + insert into tb_shop_pay_type + + + id, + + + pay_type, + + + pay_name, + + + is_show_shortcut, + + + shop_id, + + + is_refundable, + + + is_open_cash_drawer, + + + is_system, + + + is_ideal, + + + is_display, + + + sorts, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{payType,jdbcType=VARCHAR}, + + + #{payName,jdbcType=VARCHAR}, + + + #{isShowShortcut,jdbcType=TINYINT}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{isRefundable,jdbcType=TINYINT}, + + + #{isOpenCashDrawer,jdbcType=TINYINT}, + + + #{isSystem,jdbcType=TINYINT}, + + + #{isIdeal,jdbcType=TINYINT}, + + + #{isDisplay,jdbcType=TINYINT}, + + + #{sorts,jdbcType=INTEGER}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + update tb_shop_pay_type + + + pay_type = #{payType,jdbcType=VARCHAR}, + + + pay_name = #{payName,jdbcType=VARCHAR}, + + + is_show_shortcut = #{isShowShortcut,jdbcType=TINYINT}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + is_refundable = #{isRefundable,jdbcType=TINYINT}, + + + is_open_cash_drawer = #{isOpenCashDrawer,jdbcType=TINYINT}, + + + is_system = #{isSystem,jdbcType=TINYINT}, + + + is_ideal = #{isIdeal,jdbcType=TINYINT}, + + + is_display = #{isDisplay,jdbcType=TINYINT}, + + + sorts = #{sorts,jdbcType=INTEGER}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_pay_type + set pay_type = #{payType,jdbcType=VARCHAR}, + pay_name = #{payName,jdbcType=VARCHAR}, + is_show_shortcut = #{isShowShortcut,jdbcType=TINYINT}, + shop_id = #{shopId,jdbcType=VARCHAR}, + is_refundable = #{isRefundable,jdbcType=TINYINT}, + is_open_cash_drawer = #{isOpenCashDrawer,jdbcType=TINYINT}, + is_system = #{isSystem,jdbcType=TINYINT}, + is_ideal = #{isIdeal,jdbcType=TINYINT}, + is_display = #{isDisplay,jdbcType=TINYINT}, + sorts = #{sorts,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopPurveyorMapper.xml b/src/main/resources/mapper/TbShopPurveyorMapper.xml new file mode 100644 index 0000000..79962a9 --- /dev/null +++ b/src/main/resources/mapper/TbShopPurveyorMapper.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + id, shop_id, sort, name, purveyor_name, purveyor_telephone, period, address, tip, + remark, created_at, updated_at, last_transact_at + + + + delete from tb_shop_purveyor + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_purveyor (id, shop_id, sort, + name, purveyor_name, purveyor_telephone, + period, address, tip, + remark, created_at, updated_at, + last_transact_at) + values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, + #{name,jdbcType=VARCHAR}, #{purveyorName,jdbcType=VARCHAR}, #{purveyorTelephone,jdbcType=VARCHAR}, + #{period,jdbcType=INTEGER}, #{address,jdbcType=VARCHAR}, #{tip,jdbcType=VARCHAR}, + #{remark,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, + #{lastTransactAt,jdbcType=BIGINT}) + + + insert into tb_shop_purveyor + + + id, + + + shop_id, + + + sort, + + + name, + + + purveyor_name, + + + purveyor_telephone, + + + period, + + + address, + + + tip, + + + remark, + + + created_at, + + + updated_at, + + + last_transact_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{purveyorName,jdbcType=VARCHAR}, + + + #{purveyorTelephone,jdbcType=VARCHAR}, + + + #{period,jdbcType=INTEGER}, + + + #{address,jdbcType=VARCHAR}, + + + #{tip,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{lastTransactAt,jdbcType=BIGINT}, + + + + + update tb_shop_purveyor + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + name = #{name,jdbcType=VARCHAR}, + + + purveyor_name = #{purveyorName,jdbcType=VARCHAR}, + + + purveyor_telephone = #{purveyorTelephone,jdbcType=VARCHAR}, + + + period = #{period,jdbcType=INTEGER}, + + + address = #{address,jdbcType=VARCHAR}, + + + tip = #{tip,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + last_transact_at = #{lastTransactAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_purveyor + set shop_id = #{shopId,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + name = #{name,jdbcType=VARCHAR}, + purveyor_name = #{purveyorName,jdbcType=VARCHAR}, + purveyor_telephone = #{purveyorTelephone,jdbcType=VARCHAR}, + period = #{period,jdbcType=INTEGER}, + address = #{address,jdbcType=VARCHAR}, + tip = #{tip,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + last_transact_at = #{lastTransactAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopPurveyorTransactMapper.xml b/src/main/resources/mapper/TbShopPurveyorTransactMapper.xml new file mode 100644 index 0000000..d29303a --- /dev/null +++ b/src/main/resources/mapper/TbShopPurveyorTransactMapper.xml @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + id, shop_id, purveyor_name, purveyor_id, status, remark, created_at, updated_at, + total_amount, wait_amount, paid_amount, paid_at, type + + + + delete from tb_shop_purveyor_transact + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_purveyor_transact (id, shop_id, purveyor_name, + purveyor_id, status, remark, + created_at, updated_at, total_amount, + wait_amount, paid_amount, paid_at, + type) + values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=VARCHAR}, #{purveyorName,jdbcType=VARCHAR}, + #{purveyorId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}, + #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{totalAmount,jdbcType=DECIMAL}, + #{waitAmount,jdbcType=DECIMAL}, #{paidAmount,jdbcType=DECIMAL}, #{paidAt,jdbcType=BIGINT}, + #{type,jdbcType=VARCHAR}) + + + insert into tb_shop_purveyor_transact + + + id, + + + shop_id, + + + purveyor_name, + + + purveyor_id, + + + status, + + + remark, + + + created_at, + + + updated_at, + + + total_amount, + + + wait_amount, + + + paid_amount, + + + paid_at, + + + type, + + + + + #{id,jdbcType=INTEGER}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{purveyorName,jdbcType=VARCHAR}, + + + #{purveyorId,jdbcType=VARCHAR}, + + + #{status,jdbcType=TINYINT}, + + + #{remark,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{totalAmount,jdbcType=DECIMAL}, + + + #{waitAmount,jdbcType=DECIMAL}, + + + #{paidAmount,jdbcType=DECIMAL}, + + + #{paidAt,jdbcType=BIGINT}, + + + #{type,jdbcType=VARCHAR}, + + + + + update tb_shop_purveyor_transact + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + purveyor_name = #{purveyorName,jdbcType=VARCHAR}, + + + purveyor_id = #{purveyorId,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=TINYINT}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + total_amount = #{totalAmount,jdbcType=DECIMAL}, + + + wait_amount = #{waitAmount,jdbcType=DECIMAL}, + + + paid_amount = #{paidAmount,jdbcType=DECIMAL}, + + + paid_at = #{paidAt,jdbcType=BIGINT}, + + + type = #{type,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_purveyor_transact + set shop_id = #{shopId,jdbcType=VARCHAR}, + purveyor_name = #{purveyorName,jdbcType=VARCHAR}, + purveyor_id = #{purveyorId,jdbcType=VARCHAR}, + status = #{status,jdbcType=TINYINT}, + remark = #{remark,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + total_amount = #{totalAmount,jdbcType=DECIMAL}, + wait_amount = #{waitAmount,jdbcType=DECIMAL}, + paid_amount = #{paidAmount,jdbcType=DECIMAL}, + paid_at = #{paidAt,jdbcType=BIGINT}, + type = #{type,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopTableMapper.xml b/src/main/resources/mapper/TbShopTableMapper.xml new file mode 100644 index 0000000..c7b6d68 --- /dev/null +++ b/src/main/resources/mapper/TbShopTableMapper.xml @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + id, name, shop_id, max_capacity, sort, area_id, is_predate, predate_amount, status, + type, amount, perhour, view, created_at, updated_at,qrcode + + + + + + delete from tb_shop_table + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_table (id, name, shop_id, + max_capacity, sort, area_id, + is_predate, predate_amount, status, + type, amount, perhour, + view, created_at, updated_at + ) + values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{shopId,jdbcType=INTEGER}, + #{maxCapacity,jdbcType=INTEGER}, #{sort,jdbcType=INTEGER}, #{areaId,jdbcType=INTEGER}, + #{isPredate,jdbcType=TINYINT}, #{predateAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, + #{type,jdbcType=TINYINT}, #{amount,jdbcType=DECIMAL}, #{perhour,jdbcType=DECIMAL}, + #{view,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT} + ) + + + insert into tb_shop_table + + + id, + + + name, + + + shop_id, + + + max_capacity, + + + sort, + + + area_id, + + + is_predate, + + + predate_amount, + + + status, + + + type, + + + amount, + + + perhour, + + + view, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=INTEGER}, + + + #{maxCapacity,jdbcType=INTEGER}, + + + #{sort,jdbcType=INTEGER}, + + + #{areaId,jdbcType=INTEGER}, + + + #{isPredate,jdbcType=TINYINT}, + + + #{predateAmount,jdbcType=DECIMAL}, + + + #{status,jdbcType=VARCHAR}, + + + #{type,jdbcType=TINYINT}, + + + #{amount,jdbcType=DECIMAL}, + + + #{perhour,jdbcType=DECIMAL}, + + + #{view,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + update tb_shop_table + + + name = #{name,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=INTEGER}, + + + max_capacity = #{maxCapacity,jdbcType=INTEGER}, + + + sort = #{sort,jdbcType=INTEGER}, + + + area_id = #{areaId,jdbcType=INTEGER}, + + + is_predate = #{isPredate,jdbcType=TINYINT}, + + + predate_amount = #{predateAmount,jdbcType=DECIMAL}, + + + status = #{status,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=TINYINT}, + + + amount = #{amount,jdbcType=DECIMAL}, + + + perhour = #{perhour,jdbcType=DECIMAL}, + + + view = #{view,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + qrcode = #{qrcode}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_table + set name = #{name,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=INTEGER}, + max_capacity = #{maxCapacity,jdbcType=INTEGER}, + sort = #{sort,jdbcType=INTEGER}, + area_id = #{areaId,jdbcType=INTEGER}, + is_predate = #{isPredate,jdbcType=TINYINT}, + predate_amount = #{predateAmount,jdbcType=DECIMAL}, + status = #{status,jdbcType=VARCHAR}, + type = #{type,jdbcType=TINYINT}, + amount = #{amount,jdbcType=DECIMAL}, + perhour = #{perhour,jdbcType=DECIMAL}, + view = #{view,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopUnitMapper.xml b/src/main/resources/mapper/TbShopUnitMapper.xml new file mode 100644 index 0000000..8630f61 --- /dev/null +++ b/src/main/resources/mapper/TbShopUnitMapper.xml @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + id, name, decimals_digits, unit_type, is_system, status, merchant_id, shop_id, created_at, + updated_at + + + + delete from tb_shop_unit + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_unit (id, name, decimals_digits, + unit_type, is_system, status, + merchant_id, shop_id, created_at, + updated_at) + values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{decimalsDigits,jdbcType=INTEGER}, + #{unitType,jdbcType=VARCHAR}, #{isSystem,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, + #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}) + + + insert into tb_shop_unit + + + id, + + + name, + + + decimals_digits, + + + unit_type, + + + is_system, + + + status, + + + merchant_id, + + + shop_id, + + + created_at, + + + updated_at, + + + + + #{id,jdbcType=INTEGER}, + + + #{name,jdbcType=VARCHAR}, + + + #{decimalsDigits,jdbcType=INTEGER}, + + + #{unitType,jdbcType=VARCHAR}, + + + #{isSystem,jdbcType=TINYINT}, + + + #{status,jdbcType=TINYINT}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + + + update tb_shop_unit + + + name = #{name,jdbcType=VARCHAR}, + + + decimals_digits = #{decimalsDigits,jdbcType=INTEGER}, + + + unit_type = #{unitType,jdbcType=VARCHAR}, + + + is_system = #{isSystem,jdbcType=TINYINT}, + + + status = #{status,jdbcType=TINYINT}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_unit + set name = #{name,jdbcType=VARCHAR}, + decimals_digits = #{decimalsDigits,jdbcType=INTEGER}, + unit_type = #{unitType,jdbcType=VARCHAR}, + is_system = #{isSystem,jdbcType=TINYINT}, + status = #{status,jdbcType=TINYINT}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopUserFlowMapper.xml b/src/main/resources/mapper/TbShopUserFlowMapper.xml new file mode 100644 index 0000000..c395a1f --- /dev/null +++ b/src/main/resources/mapper/TbShopUserFlowMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + id, shop_user_id, amount, balance, biz_code, biz_name, create_time + + + + delete from tb_shop_user_flow + where id = #{id,jdbcType=INTEGER} + + + insert into tb_shop_user_flow (id, shop_user_id, amount, + balance, biz_code, biz_name, + create_time) + values (#{id,jdbcType=INTEGER}, #{shopUserId,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, + #{balance,jdbcType=DECIMAL}, #{bizCode,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}) + + + insert into tb_shop_user_flow + + + id, + + + shop_user_id, + + + amount, + + + balance, + + + biz_code, + + + biz_name, + + + create_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{shopUserId,jdbcType=INTEGER}, + + + #{amount,jdbcType=DECIMAL}, + + + #{balance,jdbcType=DECIMAL}, + + + #{bizCode,jdbcType=VARCHAR}, + + + #{bizName,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + + + update tb_shop_user_flow + + + shop_user_id = #{shopUserId,jdbcType=INTEGER}, + + + amount = #{amount,jdbcType=DECIMAL}, + + + balance = #{balance,jdbcType=DECIMAL}, + + + biz_code = #{bizCode,jdbcType=VARCHAR}, + + + biz_name = #{bizName,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_shop_user_flow + set shop_user_id = #{shopUserId,jdbcType=INTEGER}, + amount = #{amount,jdbcType=DECIMAL}, + balance = #{balance,jdbcType=DECIMAL}, + biz_code = #{bizCode,jdbcType=VARCHAR}, + biz_name = #{bizName,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbShopUserMapper.xml b/src/main/resources/mapper/TbShopUserMapper.xml new file mode 100644 index 0000000..690c5ac --- /dev/null +++ b/src/main/resources/mapper/TbShopUserMapper.xml @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, amount, credit_amount, consume_amount, consume_number, level_consume, status, + merchant_id, shop_id, user_id, parent_id, parent_level, name, head_img, sex, birth_day, + telephone, is_vip, code, is_attention, attention_at, is_shareholder, level, distribute_type, + sort, created_at, updated_at, mini_open_id + + + + delete from tb_shop_user + where id = #{id,jdbcType=VARCHAR} + + + insert into tb_shop_user (id, amount, credit_amount, + consume_amount, consume_number, level_consume, + status, merchant_id, shop_id, + user_id, parent_id, parent_level, + name, head_img, sex, + birth_day, telephone, is_vip, + code, is_attention, attention_at, + is_shareholder, level, distribute_type, + sort, created_at, updated_at, + mini_open_id) + values (#{id,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{creditAmount,jdbcType=DECIMAL}, + #{consumeAmount,jdbcType=DECIMAL}, #{consumeNumber,jdbcType=INTEGER}, #{levelConsume,jdbcType=DECIMAL}, + #{status,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, + #{userId,jdbcType=VARCHAR}, #{parentId,jdbcType=VARCHAR}, #{parentLevel,jdbcType=VARCHAR}, + #{name,jdbcType=VARCHAR}, #{headImg,jdbcType=VARCHAR}, #{sex,jdbcType=TINYINT}, + #{birthDay,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, #{isVip,jdbcType=TINYINT}, + #{code,jdbcType=VARCHAR}, #{isAttention,jdbcType=TINYINT}, #{attentionAt,jdbcType=INTEGER}, + #{isShareholder,jdbcType=TINYINT}, #{level,jdbcType=TINYINT}, #{distributeType,jdbcType=VARCHAR}, + #{sort,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, + #{miniOpenId,jdbcType=VARCHAR}) + + + insert into tb_shop_user + + + id, + + + amount, + + + credit_amount, + + + consume_amount, + + + consume_number, + + + level_consume, + + + status, + + + merchant_id, + + + shop_id, + + + user_id, + + + parent_id, + + + parent_level, + + + name, + + + head_img, + + + sex, + + + birth_day, + + + telephone, + + + is_vip, + + + code, + + + is_attention, + + + attention_at, + + + is_shareholder, + + + level, + + + distribute_type, + + + sort, + + + created_at, + + + updated_at, + + + mini_open_id, + + + + + #{id,jdbcType=VARCHAR}, + + + #{amount,jdbcType=DECIMAL}, + + + #{creditAmount,jdbcType=DECIMAL}, + + + #{consumeAmount,jdbcType=DECIMAL}, + + + #{consumeNumber,jdbcType=INTEGER}, + + + #{levelConsume,jdbcType=DECIMAL}, + + + #{status,jdbcType=TINYINT}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{userId,jdbcType=VARCHAR}, + + + #{parentId,jdbcType=VARCHAR}, + + + #{parentLevel,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{headImg,jdbcType=VARCHAR}, + + + #{sex,jdbcType=TINYINT}, + + + #{birthDay,jdbcType=VARCHAR}, + + + #{telephone,jdbcType=VARCHAR}, + + + #{isVip,jdbcType=TINYINT}, + + + #{code,jdbcType=VARCHAR}, + + + #{isAttention,jdbcType=TINYINT}, + + + #{attentionAt,jdbcType=INTEGER}, + + + #{isShareholder,jdbcType=TINYINT}, + + + #{level,jdbcType=TINYINT}, + + + #{distributeType,jdbcType=VARCHAR}, + + + #{sort,jdbcType=INTEGER}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{miniOpenId,jdbcType=VARCHAR}, + + + + + update tb_shop_user + + + amount = #{amount,jdbcType=DECIMAL}, + + + credit_amount = #{creditAmount,jdbcType=DECIMAL}, + + + consume_amount = #{consumeAmount,jdbcType=DECIMAL}, + + + consume_number = #{consumeNumber,jdbcType=INTEGER}, + + + level_consume = #{levelConsume,jdbcType=DECIMAL}, + + + status = #{status,jdbcType=TINYINT}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + shop_id = #{shopId,jdbcType=VARCHAR}, + + + user_id = #{userId,jdbcType=VARCHAR}, + + + parent_id = #{parentId,jdbcType=VARCHAR}, + + + parent_level = #{parentLevel,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + head_img = #{headImg,jdbcType=VARCHAR}, + + + sex = #{sex,jdbcType=TINYINT}, + + + birth_day = #{birthDay,jdbcType=VARCHAR}, + + + telephone = #{telephone,jdbcType=VARCHAR}, + + + is_vip = #{isVip,jdbcType=TINYINT}, + + + code = #{code,jdbcType=VARCHAR}, + + + is_attention = #{isAttention,jdbcType=TINYINT}, + + + attention_at = #{attentionAt,jdbcType=INTEGER}, + + + is_shareholder = #{isShareholder,jdbcType=TINYINT}, + + + level = #{level,jdbcType=TINYINT}, + + + distribute_type = #{distributeType,jdbcType=VARCHAR}, + + + sort = #{sort,jdbcType=INTEGER}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + mini_open_id = #{miniOpenId,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=VARCHAR} + + + update tb_shop_user + set amount = #{amount,jdbcType=DECIMAL}, + credit_amount = #{creditAmount,jdbcType=DECIMAL}, + consume_amount = #{consumeAmount,jdbcType=DECIMAL}, + consume_number = #{consumeNumber,jdbcType=INTEGER}, + level_consume = #{levelConsume,jdbcType=DECIMAL}, + status = #{status,jdbcType=TINYINT}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + shop_id = #{shopId,jdbcType=VARCHAR}, + user_id = #{userId,jdbcType=VARCHAR}, + parent_id = #{parentId,jdbcType=VARCHAR}, + parent_level = #{parentLevel,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + head_img = #{headImg,jdbcType=VARCHAR}, + sex = #{sex,jdbcType=TINYINT}, + birth_day = #{birthDay,jdbcType=VARCHAR}, + telephone = #{telephone,jdbcType=VARCHAR}, + is_vip = #{isVip,jdbcType=TINYINT}, + code = #{code,jdbcType=VARCHAR}, + is_attention = #{isAttention,jdbcType=TINYINT}, + attention_at = #{attentionAt,jdbcType=INTEGER}, + is_shareholder = #{isShareholder,jdbcType=TINYINT}, + level = #{level,jdbcType=TINYINT}, + distribute_type = #{distributeType,jdbcType=VARCHAR}, + sort = #{sort,jdbcType=INTEGER}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + mini_open_id = #{miniOpenId,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbTokenMapper.xml b/src/main/resources/mapper/TbTokenMapper.xml new file mode 100644 index 0000000..9531ae9 --- /dev/null +++ b/src/main/resources/mapper/TbTokenMapper.xml @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + id, account_id, staff_id, client_type, token, ip, status, create_time, update_time + + + + delete from tb_token + where id = #{id,jdbcType=INTEGER} + + + insert into tb_token (id, account_id, staff_id, + client_type, token, ip, + status, create_time, update_time + ) + values (#{id,jdbcType=INTEGER}, #{accountId,jdbcType=INTEGER}, #{staffId,jdbcType=INTEGER}, + #{clientType,jdbcType=VARCHAR}, #{token,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, + #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP} + ) + + + insert into tb_token + + + id, + + + account_id, + + + staff_id, + + + client_type, + + + token, + + + ip, + + + status, + + + create_time, + + + update_time, + + + + + #{id,jdbcType=INTEGER}, + + + #{accountId,jdbcType=INTEGER}, + + + #{staffId,jdbcType=INTEGER}, + + + #{clientType,jdbcType=VARCHAR}, + + + #{token,jdbcType=VARCHAR}, + + + #{ip,jdbcType=VARCHAR}, + + + #{status,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update tb_token + + + account_id = #{accountId,jdbcType=INTEGER}, + + + staff_id = #{staffId,jdbcType=INTEGER}, + + + client_type = #{clientType,jdbcType=VARCHAR}, + + + token = #{token,jdbcType=VARCHAR}, + + + ip = #{ip,jdbcType=VARCHAR}, + + + status = #{status,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_token + set account_id = #{accountId,jdbcType=INTEGER}, + staff_id = #{staffId,jdbcType=INTEGER}, + client_type = #{clientType,jdbcType=VARCHAR}, + token = #{token,jdbcType=VARCHAR}, + ip = #{ip,jdbcType=VARCHAR}, + status = #{status,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/TbUserInfoMapper.xml b/src/main/resources/mapper/TbUserInfoMapper.xml new file mode 100644 index 0000000..a52332a --- /dev/null +++ b/src/main/resources/mapper/TbUserInfoMapper.xml @@ -0,0 +1,574 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, amount, charge_amount, line_of_credit, consume_amount, consume_number, total_score, + lock_score, card_no, card_password, level_id, head_img, nick_name, telephone, wx_ma_app_id, + birth_day, sex, mini_app_open_id, open_id, union_id, code, type, identify, status, + parent_id, parent_level, parent_type, project_id, merchant_id, is_resource, is_online, + is_vip, vip_effect_at, tips, source_path, is_sales_person, is_attention_mp, city, + search_word, last_log_in_at, last_leave_at, created_at, updated_at, bind_parent_at, + grand_parent_id + + + + delete from tb_user_info + where id = #{id,jdbcType=INTEGER} + + + + insert into tb_user_info (id, amount, charge_amount, + line_of_credit, consume_amount, consume_number, + total_score, lock_score, card_no, + card_password, level_id, head_img, + nick_name, telephone, wx_ma_app_id, + birth_day, sex, mini_app_open_id, + open_id, union_id, code, + type, identify, status, + parent_id, parent_level, parent_type, + project_id, merchant_id, is_resource, + is_online, is_vip, vip_effect_at, + tips, source_path, is_sales_person, + is_attention_mp, city, search_word, + last_log_in_at, last_leave_at, created_at, + updated_at, bind_parent_at, grand_parent_id + ) + values (#{id,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, #{chargeAmount,jdbcType=DECIMAL}, + #{lineOfCredit,jdbcType=DECIMAL}, #{consumeAmount,jdbcType=DECIMAL}, #{consumeNumber,jdbcType=INTEGER}, + #{totalScore,jdbcType=INTEGER}, #{lockScore,jdbcType=INTEGER}, #{cardNo,jdbcType=VARCHAR}, + #{cardPassword,jdbcType=VARCHAR}, #{levelId,jdbcType=VARCHAR}, #{headImg,jdbcType=VARCHAR}, + #{nickName,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR}, #{wxMaAppId,jdbcType=VARCHAR}, + #{birthDay,jdbcType=VARCHAR}, #{sex,jdbcType=TINYINT}, #{miniAppOpenId,jdbcType=VARCHAR}, + #{openId,jdbcType=VARCHAR}, #{unionId,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{identify,jdbcType=TINYINT}, #{status,jdbcType=TINYINT}, + #{parentId,jdbcType=VARCHAR}, #{parentLevel,jdbcType=VARCHAR}, #{parentType,jdbcType=VARCHAR}, + #{projectId,jdbcType=VARCHAR}, #{merchantId,jdbcType=VARCHAR}, #{isResource,jdbcType=TINYINT}, + #{isOnline,jdbcType=TINYINT}, #{isVip,jdbcType=TINYINT}, #{vipEffectAt,jdbcType=INTEGER}, + #{tips,jdbcType=VARCHAR}, #{sourcePath,jdbcType=VARCHAR}, #{isSalesPerson,jdbcType=TINYINT}, + #{isAttentionMp,jdbcType=TINYINT}, #{city,jdbcType=VARCHAR}, #{searchWord,jdbcType=VARCHAR}, + #{lastLogInAt,jdbcType=BIGINT}, #{lastLeaveAt,jdbcType=BIGINT}, #{createdAt,jdbcType=BIGINT}, + #{updatedAt,jdbcType=BIGINT}, #{bindParentAt,jdbcType=BIGINT}, #{grandParentId,jdbcType=VARCHAR} + ) + + + insert into tb_user_info + + + id, + + + amount, + + + charge_amount, + + + line_of_credit, + + + consume_amount, + + + consume_number, + + + total_score, + + + lock_score, + + + card_no, + + + card_password, + + + level_id, + + + head_img, + + + nick_name, + + + telephone, + + + wx_ma_app_id, + + + birth_day, + + + sex, + + + mini_app_open_id, + + + open_id, + + + union_id, + + + code, + + + type, + + + identify, + + + status, + + + parent_id, + + + parent_level, + + + parent_type, + + + project_id, + + + merchant_id, + + + is_resource, + + + is_online, + + + is_vip, + + + vip_effect_at, + + + tips, + + + source_path, + + + is_sales_person, + + + is_attention_mp, + + + city, + + + search_word, + + + last_log_in_at, + + + last_leave_at, + + + created_at, + + + updated_at, + + + bind_parent_at, + + + grand_parent_id, + + + + + #{id,jdbcType=INTEGER}, + + + #{amount,jdbcType=DECIMAL}, + + + #{chargeAmount,jdbcType=DECIMAL}, + + + #{lineOfCredit,jdbcType=DECIMAL}, + + + #{consumeAmount,jdbcType=DECIMAL}, + + + #{consumeNumber,jdbcType=INTEGER}, + + + #{totalScore,jdbcType=INTEGER}, + + + #{lockScore,jdbcType=INTEGER}, + + + #{cardNo,jdbcType=VARCHAR}, + + + #{cardPassword,jdbcType=VARCHAR}, + + + #{levelId,jdbcType=VARCHAR}, + + + #{headImg,jdbcType=VARCHAR}, + + + #{nickName,jdbcType=VARCHAR}, + + + #{telephone,jdbcType=VARCHAR}, + + + #{wxMaAppId,jdbcType=VARCHAR}, + + + #{birthDay,jdbcType=VARCHAR}, + + + #{sex,jdbcType=TINYINT}, + + + #{miniAppOpenId,jdbcType=VARCHAR}, + + + #{openId,jdbcType=VARCHAR}, + + + #{unionId,jdbcType=VARCHAR}, + + + #{code,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{identify,jdbcType=TINYINT}, + + + #{status,jdbcType=TINYINT}, + + + #{parentId,jdbcType=VARCHAR}, + + + #{parentLevel,jdbcType=VARCHAR}, + + + #{parentType,jdbcType=VARCHAR}, + + + #{projectId,jdbcType=VARCHAR}, + + + #{merchantId,jdbcType=VARCHAR}, + + + #{isResource,jdbcType=TINYINT}, + + + #{isOnline,jdbcType=TINYINT}, + + + #{isVip,jdbcType=TINYINT}, + + + #{vipEffectAt,jdbcType=INTEGER}, + + + #{tips,jdbcType=VARCHAR}, + + + #{sourcePath,jdbcType=VARCHAR}, + + + #{isSalesPerson,jdbcType=TINYINT}, + + + #{isAttentionMp,jdbcType=TINYINT}, + + + #{city,jdbcType=VARCHAR}, + + + #{searchWord,jdbcType=VARCHAR}, + + + #{lastLogInAt,jdbcType=BIGINT}, + + + #{lastLeaveAt,jdbcType=BIGINT}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{updatedAt,jdbcType=BIGINT}, + + + #{bindParentAt,jdbcType=BIGINT}, + + + #{grandParentId,jdbcType=VARCHAR}, + + + + + update tb_user_info + + + amount = #{amount,jdbcType=DECIMAL}, + + + charge_amount = #{chargeAmount,jdbcType=DECIMAL}, + + + line_of_credit = #{lineOfCredit,jdbcType=DECIMAL}, + + + consume_amount = #{consumeAmount,jdbcType=DECIMAL}, + + + consume_number = #{consumeNumber,jdbcType=INTEGER}, + + + total_score = #{totalScore,jdbcType=INTEGER}, + + + lock_score = #{lockScore,jdbcType=INTEGER}, + + + card_no = #{cardNo,jdbcType=VARCHAR}, + + + card_password = #{cardPassword,jdbcType=VARCHAR}, + + + level_id = #{levelId,jdbcType=VARCHAR}, + + + head_img = #{headImg,jdbcType=VARCHAR}, + + + nick_name = #{nickName,jdbcType=VARCHAR}, + + + telephone = #{telephone,jdbcType=VARCHAR}, + + + wx_ma_app_id = #{wxMaAppId,jdbcType=VARCHAR}, + + + birth_day = #{birthDay,jdbcType=VARCHAR}, + + + sex = #{sex,jdbcType=TINYINT}, + + + mini_app_open_id = #{miniAppOpenId,jdbcType=VARCHAR}, + + + open_id = #{openId,jdbcType=VARCHAR}, + + + union_id = #{unionId,jdbcType=VARCHAR}, + + + code = #{code,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + identify = #{identify,jdbcType=TINYINT}, + + + status = #{status,jdbcType=TINYINT}, + + + parent_id = #{parentId,jdbcType=VARCHAR}, + + + parent_level = #{parentLevel,jdbcType=VARCHAR}, + + + parent_type = #{parentType,jdbcType=VARCHAR}, + + + project_id = #{projectId,jdbcType=VARCHAR}, + + + merchant_id = #{merchantId,jdbcType=VARCHAR}, + + + is_resource = #{isResource,jdbcType=TINYINT}, + + + is_online = #{isOnline,jdbcType=TINYINT}, + + + is_vip = #{isVip,jdbcType=TINYINT}, + + + vip_effect_at = #{vipEffectAt,jdbcType=INTEGER}, + + + tips = #{tips,jdbcType=VARCHAR}, + + + source_path = #{sourcePath,jdbcType=VARCHAR}, + + + is_sales_person = #{isSalesPerson,jdbcType=TINYINT}, + + + is_attention_mp = #{isAttentionMp,jdbcType=TINYINT}, + + + city = #{city,jdbcType=VARCHAR}, + + + search_word = #{searchWord,jdbcType=VARCHAR}, + + + last_log_in_at = #{lastLogInAt,jdbcType=BIGINT}, + + + last_leave_at = #{lastLeaveAt,jdbcType=BIGINT}, + + + created_at = #{createdAt,jdbcType=BIGINT}, + + + updated_at = #{updatedAt,jdbcType=BIGINT}, + + + bind_parent_at = #{bindParentAt,jdbcType=BIGINT}, + + + grand_parent_id = #{grandParentId,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tb_user_info + set amount = #{amount,jdbcType=DECIMAL}, + charge_amount = #{chargeAmount,jdbcType=DECIMAL}, + line_of_credit = #{lineOfCredit,jdbcType=DECIMAL}, + consume_amount = #{consumeAmount,jdbcType=DECIMAL}, + consume_number = #{consumeNumber,jdbcType=INTEGER}, + total_score = #{totalScore,jdbcType=INTEGER}, + lock_score = #{lockScore,jdbcType=INTEGER}, + card_no = #{cardNo,jdbcType=VARCHAR}, + card_password = #{cardPassword,jdbcType=VARCHAR}, + level_id = #{levelId,jdbcType=VARCHAR}, + head_img = #{headImg,jdbcType=VARCHAR}, + nick_name = #{nickName,jdbcType=VARCHAR}, + telephone = #{telephone,jdbcType=VARCHAR}, + wx_ma_app_id = #{wxMaAppId,jdbcType=VARCHAR}, + birth_day = #{birthDay,jdbcType=VARCHAR}, + sex = #{sex,jdbcType=TINYINT}, + mini_app_open_id = #{miniAppOpenId,jdbcType=VARCHAR}, + open_id = #{openId,jdbcType=VARCHAR}, + union_id = #{unionId,jdbcType=VARCHAR}, + code = #{code,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + identify = #{identify,jdbcType=TINYINT}, + status = #{status,jdbcType=TINYINT}, + parent_id = #{parentId,jdbcType=VARCHAR}, + parent_level = #{parentLevel,jdbcType=VARCHAR}, + parent_type = #{parentType,jdbcType=VARCHAR}, + project_id = #{projectId,jdbcType=VARCHAR}, + merchant_id = #{merchantId,jdbcType=VARCHAR}, + is_resource = #{isResource,jdbcType=TINYINT}, + is_online = #{isOnline,jdbcType=TINYINT}, + is_vip = #{isVip,jdbcType=TINYINT}, + vip_effect_at = #{vipEffectAt,jdbcType=INTEGER}, + tips = #{tips,jdbcType=VARCHAR}, + source_path = #{sourcePath,jdbcType=VARCHAR}, + is_sales_person = #{isSalesPerson,jdbcType=TINYINT}, + is_attention_mp = #{isAttentionMp,jdbcType=TINYINT}, + city = #{city,jdbcType=VARCHAR}, + search_word = #{searchWord,jdbcType=VARCHAR}, + last_log_in_at = #{lastLogInAt,jdbcType=BIGINT}, + last_leave_at = #{lastLeaveAt,jdbcType=BIGINT}, + created_at = #{createdAt,jdbcType=BIGINT}, + updated_at = #{updatedAt,jdbcType=BIGINT}, + bind_parent_at = #{bindParentAt,jdbcType=BIGINT}, + grand_parent_id = #{grandParentId,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + + + + \ No newline at end of file diff --git a/src/main/resources/mapper/ToolAlipayConfigMapper.xml b/src/main/resources/mapper/ToolAlipayConfigMapper.xml new file mode 100644 index 0000000..195605e --- /dev/null +++ b/src/main/resources/mapper/ToolAlipayConfigMapper.xml @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + config_id, app_id, charset, format, gateway_url, notify_url, return_url, sign_type, + sys_service_provider_id + + + private_key, public_key + + + + delete from tool_alipay_config + where config_id = #{configId,jdbcType=BIGINT} + + + insert into tool_alipay_config (config_id, app_id, charset, + format, gateway_url, notify_url, + return_url, sign_type, sys_service_provider_id, + private_key, public_key) + values (#{configId,jdbcType=BIGINT}, #{appId,jdbcType=VARCHAR}, #{charset,jdbcType=VARCHAR}, + #{format,jdbcType=VARCHAR}, #{gatewayUrl,jdbcType=VARCHAR}, #{notifyUrl,jdbcType=VARCHAR}, + #{returnUrl,jdbcType=VARCHAR}, #{signType,jdbcType=VARCHAR}, #{sysServiceProviderId,jdbcType=VARCHAR}, + #{privateKey,jdbcType=LONGVARCHAR}, #{publicKey,jdbcType=LONGVARCHAR}) + + + insert into tool_alipay_config + + + config_id, + + + app_id, + + + charset, + + + format, + + + gateway_url, + + + notify_url, + + + return_url, + + + sign_type, + + + sys_service_provider_id, + + + private_key, + + + public_key, + + + + + #{configId,jdbcType=BIGINT}, + + + #{appId,jdbcType=VARCHAR}, + + + #{charset,jdbcType=VARCHAR}, + + + #{format,jdbcType=VARCHAR}, + + + #{gatewayUrl,jdbcType=VARCHAR}, + + + #{notifyUrl,jdbcType=VARCHAR}, + + + #{returnUrl,jdbcType=VARCHAR}, + + + #{signType,jdbcType=VARCHAR}, + + + #{sysServiceProviderId,jdbcType=VARCHAR}, + + + #{privateKey,jdbcType=LONGVARCHAR}, + + + #{publicKey,jdbcType=LONGVARCHAR}, + + + + + update tool_alipay_config + + + app_id = #{appId,jdbcType=VARCHAR}, + + + charset = #{charset,jdbcType=VARCHAR}, + + + format = #{format,jdbcType=VARCHAR}, + + + gateway_url = #{gatewayUrl,jdbcType=VARCHAR}, + + + notify_url = #{notifyUrl,jdbcType=VARCHAR}, + + + return_url = #{returnUrl,jdbcType=VARCHAR}, + + + sign_type = #{signType,jdbcType=VARCHAR}, + + + sys_service_provider_id = #{sysServiceProviderId,jdbcType=VARCHAR}, + + + private_key = #{privateKey,jdbcType=LONGVARCHAR}, + + + public_key = #{publicKey,jdbcType=LONGVARCHAR}, + + + where config_id = #{configId,jdbcType=BIGINT} + + + update tool_alipay_config + set app_id = #{appId,jdbcType=VARCHAR}, + charset = #{charset,jdbcType=VARCHAR}, + format = #{format,jdbcType=VARCHAR}, + gateway_url = #{gatewayUrl,jdbcType=VARCHAR}, + notify_url = #{notifyUrl,jdbcType=VARCHAR}, + return_url = #{returnUrl,jdbcType=VARCHAR}, + sign_type = #{signType,jdbcType=VARCHAR}, + sys_service_provider_id = #{sysServiceProviderId,jdbcType=VARCHAR}, + private_key = #{privateKey,jdbcType=LONGVARCHAR}, + public_key = #{publicKey,jdbcType=LONGVARCHAR} + where config_id = #{configId,jdbcType=BIGINT} + + + update tool_alipay_config + set app_id = #{appId,jdbcType=VARCHAR}, + charset = #{charset,jdbcType=VARCHAR}, + format = #{format,jdbcType=VARCHAR}, + gateway_url = #{gatewayUrl,jdbcType=VARCHAR}, + notify_url = #{notifyUrl,jdbcType=VARCHAR}, + return_url = #{returnUrl,jdbcType=VARCHAR}, + sign_type = #{signType,jdbcType=VARCHAR}, + sys_service_provider_id = #{sysServiceProviderId,jdbcType=VARCHAR} + where config_id = #{configId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/ToolEmailConfigMapper.xml b/src/main/resources/mapper/ToolEmailConfigMapper.xml new file mode 100644 index 0000000..7d7c9ea --- /dev/null +++ b/src/main/resources/mapper/ToolEmailConfigMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + config_id, from_user, host, pass, port, user + + + + delete from tool_email_config + where config_id = #{configId,jdbcType=BIGINT} + + + insert into tool_email_config (config_id, from_user, host, + pass, port, user) + values (#{configId,jdbcType=BIGINT}, #{fromUser,jdbcType=VARCHAR}, #{host,jdbcType=VARCHAR}, + #{pass,jdbcType=VARCHAR}, #{port,jdbcType=VARCHAR}, #{user,jdbcType=VARCHAR}) + + + insert into tool_email_config + + + config_id, + + + from_user, + + + host, + + + pass, + + + port, + + + user, + + + + + #{configId,jdbcType=BIGINT}, + + + #{fromUser,jdbcType=VARCHAR}, + + + #{host,jdbcType=VARCHAR}, + + + #{pass,jdbcType=VARCHAR}, + + + #{port,jdbcType=VARCHAR}, + + + #{user,jdbcType=VARCHAR}, + + + + + update tool_email_config + + + from_user = #{fromUser,jdbcType=VARCHAR}, + + + host = #{host,jdbcType=VARCHAR}, + + + pass = #{pass,jdbcType=VARCHAR}, + + + port = #{port,jdbcType=VARCHAR}, + + + user = #{user,jdbcType=VARCHAR}, + + + where config_id = #{configId,jdbcType=BIGINT} + + + update tool_email_config + set from_user = #{fromUser,jdbcType=VARCHAR}, + host = #{host,jdbcType=VARCHAR}, + pass = #{pass,jdbcType=VARCHAR}, + port = #{port,jdbcType=VARCHAR}, + user = #{user,jdbcType=VARCHAR} + where config_id = #{configId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/ToolLocalStorageMapper.xml b/src/main/resources/mapper/ToolLocalStorageMapper.xml new file mode 100644 index 0000000..137c007 --- /dev/null +++ b/src/main/resources/mapper/ToolLocalStorageMapper.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + storage_id, real_name, name, suffix, path, type, size, create_by, update_by, create_time, + update_time + + + + delete from tool_local_storage + where storage_id = #{storageId,jdbcType=BIGINT} + + + insert into tool_local_storage (storage_id, real_name, name, + suffix, path, type, + size, create_by, update_by, + create_time, update_time) + values (#{storageId,jdbcType=BIGINT}, #{realName,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{suffix,jdbcType=VARCHAR}, #{path,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, + #{size,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, + #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) + + + insert into tool_local_storage + + + storage_id, + + + real_name, + + + name, + + + suffix, + + + path, + + + type, + + + size, + + + create_by, + + + update_by, + + + create_time, + + + update_time, + + + + + #{storageId,jdbcType=BIGINT}, + + + #{realName,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{suffix,jdbcType=VARCHAR}, + + + #{path,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{size,jdbcType=VARCHAR}, + + + #{createBy,jdbcType=VARCHAR}, + + + #{updateBy,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=TIMESTAMP}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update tool_local_storage + + + real_name = #{realName,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + suffix = #{suffix,jdbcType=VARCHAR}, + + + path = #{path,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + size = #{size,jdbcType=VARCHAR}, + + + create_by = #{createBy,jdbcType=VARCHAR}, + + + update_by = #{updateBy,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where storage_id = #{storageId,jdbcType=BIGINT} + + + update tool_local_storage + set real_name = #{realName,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + suffix = #{suffix,jdbcType=VARCHAR}, + path = #{path,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + size = #{size,jdbcType=VARCHAR}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_by = #{updateBy,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where storage_id = #{storageId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/ToolQiniuConfigMapper.xml b/src/main/resources/mapper/ToolQiniuConfigMapper.xml new file mode 100644 index 0000000..2360082 --- /dev/null +++ b/src/main/resources/mapper/ToolQiniuConfigMapper.xml @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + config_id, bucket, host, type, zone + + + access_key, secret_key + + + + delete from tool_qiniu_config + where config_id = #{configId,jdbcType=BIGINT} + + + insert into tool_qiniu_config (config_id, bucket, host, + type, zone, access_key, + secret_key) + values (#{configId,jdbcType=BIGINT}, #{bucket,jdbcType=VARCHAR}, #{host,jdbcType=VARCHAR}, + #{type,jdbcType=VARCHAR}, #{zone,jdbcType=VARCHAR}, #{accessKey,jdbcType=LONGVARCHAR}, + #{secretKey,jdbcType=LONGVARCHAR}) + + + insert into tool_qiniu_config + + + config_id, + + + bucket, + + + host, + + + type, + + + zone, + + + access_key, + + + secret_key, + + + + + #{configId,jdbcType=BIGINT}, + + + #{bucket,jdbcType=VARCHAR}, + + + #{host,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{zone,jdbcType=VARCHAR}, + + + #{accessKey,jdbcType=LONGVARCHAR}, + + + #{secretKey,jdbcType=LONGVARCHAR}, + + + + + update tool_qiniu_config + + + bucket = #{bucket,jdbcType=VARCHAR}, + + + host = #{host,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + zone = #{zone,jdbcType=VARCHAR}, + + + access_key = #{accessKey,jdbcType=LONGVARCHAR}, + + + secret_key = #{secretKey,jdbcType=LONGVARCHAR}, + + + where config_id = #{configId,jdbcType=BIGINT} + + + update tool_qiniu_config + set bucket = #{bucket,jdbcType=VARCHAR}, + host = #{host,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + zone = #{zone,jdbcType=VARCHAR}, + access_key = #{accessKey,jdbcType=LONGVARCHAR}, + secret_key = #{secretKey,jdbcType=LONGVARCHAR} + where config_id = #{configId,jdbcType=BIGINT} + + + update tool_qiniu_config + set bucket = #{bucket,jdbcType=VARCHAR}, + host = #{host,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + zone = #{zone,jdbcType=VARCHAR} + where config_id = #{configId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/ToolQiniuContentMapper.xml b/src/main/resources/mapper/ToolQiniuContentMapper.xml new file mode 100644 index 0000000..491bc16 --- /dev/null +++ b/src/main/resources/mapper/ToolQiniuContentMapper.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + content_id, bucket, name, size, type, url, suffix, update_time + + + + delete from tool_qiniu_content + where content_id = #{contentId,jdbcType=BIGINT} + + + insert into tool_qiniu_content (content_id, bucket, name, + size, type, url, suffix, + update_time) + values (#{contentId,jdbcType=BIGINT}, #{bucket,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{size,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{suffix,jdbcType=VARCHAR}, + #{updateTime,jdbcType=TIMESTAMP}) + + + insert into tool_qiniu_content + + + content_id, + + + bucket, + + + name, + + + size, + + + type, + + + url, + + + suffix, + + + update_time, + + + + + #{contentId,jdbcType=BIGINT}, + + + #{bucket,jdbcType=VARCHAR}, + + + #{name,jdbcType=VARCHAR}, + + + #{size,jdbcType=VARCHAR}, + + + #{type,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{suffix,jdbcType=VARCHAR}, + + + #{updateTime,jdbcType=TIMESTAMP}, + + + + + update tool_qiniu_content + + + bucket = #{bucket,jdbcType=VARCHAR}, + + + name = #{name,jdbcType=VARCHAR}, + + + size = #{size,jdbcType=VARCHAR}, + + + type = #{type,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + suffix = #{suffix,jdbcType=VARCHAR}, + + + update_time = #{updateTime,jdbcType=TIMESTAMP}, + + + where content_id = #{contentId,jdbcType=BIGINT} + + + update tool_qiniu_content + set bucket = #{bucket,jdbcType=VARCHAR}, + name = #{name,jdbcType=VARCHAR}, + size = #{size,jdbcType=VARCHAR}, + type = #{type,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + suffix = #{suffix,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP} + where content_id = #{contentId,jdbcType=BIGINT} + + \ No newline at end of file diff --git a/src/main/resources/mapper/ViewOrderMapper.xml b/src/main/resources/mapper/ViewOrderMapper.xml new file mode 100644 index 0000000..ad79f52 --- /dev/null +++ b/src/main/resources/mapper/ViewOrderMapper.xml @@ -0,0 +1,305 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + cart_list + + + insert into view_order (ali_paid_amount, id, amount, + bank_paid_amount, billing_id, cash_paid_amount, + created_at, deduct_score, deposit_paid_amount, + discount_amount, freight_amount, is_master, + is_vip, master_id, member_id, + order_no, order_type, other_paid_amount, + paid_time, pay_amount, product_score, + product_type, ref_order_id, refund_able, + refund_amount, send_type, settlement_amount, + shop_id, small_change, status, + table_id, table_party, terminal_snap, + user_id, virtual_paid_amount, wx_paid_amount, + cart_list) + values (#{aliPaidAmount,jdbcType=DECIMAL}, #{id,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL}, + #{bankPaidAmount,jdbcType=DECIMAL}, #{billingId,jdbcType=VARCHAR}, #{cashPaidAmount,jdbcType=DECIMAL}, + #{createdAt,jdbcType=BIGINT}, #{deductScore,jdbcType=INTEGER}, #{depositPaidAmount,jdbcType=DECIMAL}, + #{discountAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL}, #{isMaster,jdbcType=TINYINT}, + #{isVip,jdbcType=TINYINT}, #{masterId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, + #{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=VARCHAR}, #{otherPaidAmount,jdbcType=DECIMAL}, + #{paidTime,jdbcType=BIGINT}, #{payAmount,jdbcType=DECIMAL}, #{productScore,jdbcType=INTEGER}, + #{productType,jdbcType=VARCHAR}, #{refOrderId,jdbcType=VARCHAR}, #{refundAble,jdbcType=TINYINT}, + #{refundAmount,jdbcType=DECIMAL}, #{sendType,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL}, + #{shopId,jdbcType=VARCHAR}, #{smallChange,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, + #{tableId,jdbcType=VARCHAR}, #{tableParty,jdbcType=VARCHAR}, #{terminalSnap,jdbcType=VARCHAR}, + #{userId,jdbcType=VARCHAR}, #{virtualPaidAmount,jdbcType=DECIMAL}, #{wxPaidAmount,jdbcType=DECIMAL}, + #{cartList,jdbcType=LONGVARCHAR}) + + + insert into view_order + + + ali_paid_amount, + + + id, + + + amount, + + + bank_paid_amount, + + + billing_id, + + + cash_paid_amount, + + + created_at, + + + deduct_score, + + + deposit_paid_amount, + + + discount_amount, + + + freight_amount, + + + is_master, + + + is_vip, + + + master_id, + + + member_id, + + + order_no, + + + order_type, + + + other_paid_amount, + + + paid_time, + + + pay_amount, + + + product_score, + + + product_type, + + + ref_order_id, + + + refund_able, + + + refund_amount, + + + send_type, + + + settlement_amount, + + + shop_id, + + + small_change, + + + status, + + + table_id, + + + table_party, + + + terminal_snap, + + + user_id, + + + virtual_paid_amount, + + + wx_paid_amount, + + + cart_list, + + + + + #{aliPaidAmount,jdbcType=DECIMAL}, + + + #{id,jdbcType=INTEGER}, + + + #{amount,jdbcType=DECIMAL}, + + + #{bankPaidAmount,jdbcType=DECIMAL}, + + + #{billingId,jdbcType=VARCHAR}, + + + #{cashPaidAmount,jdbcType=DECIMAL}, + + + #{createdAt,jdbcType=BIGINT}, + + + #{deductScore,jdbcType=INTEGER}, + + + #{depositPaidAmount,jdbcType=DECIMAL}, + + + #{discountAmount,jdbcType=DECIMAL}, + + + #{freightAmount,jdbcType=DECIMAL}, + + + #{isMaster,jdbcType=TINYINT}, + + + #{isVip,jdbcType=TINYINT}, + + + #{masterId,jdbcType=VARCHAR}, + + + #{memberId,jdbcType=VARCHAR}, + + + #{orderNo,jdbcType=VARCHAR}, + + + #{orderType,jdbcType=VARCHAR}, + + + #{otherPaidAmount,jdbcType=DECIMAL}, + + + #{paidTime,jdbcType=BIGINT}, + + + #{payAmount,jdbcType=DECIMAL}, + + + #{productScore,jdbcType=INTEGER}, + + + #{productType,jdbcType=VARCHAR}, + + + #{refOrderId,jdbcType=VARCHAR}, + + + #{refundAble,jdbcType=TINYINT}, + + + #{refundAmount,jdbcType=DECIMAL}, + + + #{sendType,jdbcType=VARCHAR}, + + + #{settlementAmount,jdbcType=DECIMAL}, + + + #{shopId,jdbcType=VARCHAR}, + + + #{smallChange,jdbcType=DECIMAL}, + + + #{status,jdbcType=VARCHAR}, + + + #{tableId,jdbcType=VARCHAR}, + + + #{tableParty,jdbcType=VARCHAR}, + + + #{terminalSnap,jdbcType=VARCHAR}, + + + #{userId,jdbcType=VARCHAR}, + + + #{virtualPaidAmount,jdbcType=DECIMAL}, + + + #{wxPaidAmount,jdbcType=DECIMAL}, + + + #{cartList,jdbcType=LONGVARCHAR}, + + + + \ No newline at end of file