Compare commits
301 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
b9ec839b3b | |
|
|
c8faeb231e | |
|
|
8f2303d1bf | |
|
|
8680a1a5be | |
|
|
ec70083bd6 | |
|
|
f9b5dbad58 | |
|
|
116852ce30 | |
|
|
78ed984ef8 | |
|
|
67af4f1463 | |
|
|
a73530df84 | |
|
|
5e8601745b | |
|
|
69053261e0 | |
|
|
62c28fe2f6 | |
|
|
b1e5ae969b | |
|
|
ff27101e13 | |
|
|
7c00d0d9a0 | |
|
|
7f0056304d | |
|
|
a40431fbe7 | |
|
|
0f9c370118 | |
|
|
5c2b995d1f | |
|
|
90d5e3888b | |
|
|
d7bf0f2811 | |
|
|
be097e8b2d | |
|
|
e08f83ac6e | |
|
|
d2d5c10b0e | |
|
|
baa9c6c260 | |
|
|
0a3b50ef6f | |
|
|
8b099a2ae6 | |
|
|
7e29627bf6 | |
|
|
242427f1ee | |
|
|
c5d92f9ea6 | |
|
|
48078ad2d6 | |
|
|
7af4a48dfa | |
|
|
3b9617a03e | |
|
|
7921c21295 | |
|
|
822141899c | |
|
|
2f4fec7631 | |
|
|
c0bad61875 | |
|
|
5d15b3c309 | |
|
|
770c8e01f2 | |
|
|
1dd8dc4508 | |
|
|
f039135371 | |
|
|
2ef311f887 | |
|
|
2c99b8cd18 | |
|
|
26b3e0bc2c | |
|
|
3ebec6f0c5 | |
|
|
f2bfc718c3 | |
|
|
dc0f6eae1e | |
|
|
373fb2bdf0 | |
|
|
10290bd37b | |
|
|
901fb9af81 | |
|
|
535079c14d | |
|
|
18614278a7 | |
|
|
df4886d62c | |
|
|
ced7d4bc7d | |
|
|
efd9d78227 | |
|
|
6c480acd20 | |
|
|
c063c19532 | |
|
|
6096f91b6c | |
|
|
05adbeb584 | |
|
|
50e0f09be8 | |
|
|
09252dda7c | |
|
|
db545ee118 | |
|
|
fec443ce6c | |
|
|
c618c712f3 | |
|
|
98bb93516f | |
|
|
4e81e0fca1 | |
|
|
28eb1496b9 | |
|
|
81b6454557 | |
|
|
72a3057126 | |
|
|
b7fc525623 | |
|
|
f458e6f77e | |
|
|
7b91549664 | |
|
|
10373ab45f | |
|
|
a08d181e77 | |
|
|
50faef4a20 | |
|
|
782a152243 | |
|
|
5e59b19cec | |
|
|
8f002b689d | |
|
|
dfe0bb6154 | |
|
|
4bd99e7f6e | |
|
|
1cb099702a | |
|
|
37d16054c4 | |
|
|
3174c9abf3 | |
|
|
fed5b28ce2 | |
|
|
53512a0b37 | |
|
|
be701b46ec | |
|
|
8247b3b4bd | |
|
|
963920fd2a | |
|
|
0b645bd695 | |
|
|
44329cc64e | |
|
|
37be5a521e | |
|
|
d63861ac13 | |
|
|
1b9b088e43 | |
|
|
6e31bb6251 | |
|
|
4b5c272cd9 | |
|
|
5480d0eb5f | |
|
|
be4f8cbbdd | |
|
|
923c204c3c | |
|
|
b1219a114b | |
|
|
94e875008b | |
|
|
e823832cdb | |
|
|
cce10b9475 | |
|
|
68b9b1ab98 | |
|
|
e131095e45 | |
|
|
c2843ecc3d | |
|
|
a941cf56f2 | |
|
|
7b62f75cca | |
|
|
68a96b405d | |
|
|
e9297f49a1 | |
|
|
1c5fb88b38 | |
|
|
d6756ee2e3 | |
|
|
26f6af0256 | |
|
|
77f01cabdc | |
|
|
33a0722c8c | |
|
|
b0392f70e1 | |
|
|
9ea2ecf552 | |
|
|
52410b73f1 | |
|
|
a68b7ee991 | |
|
|
71bc936074 | |
|
|
297ccc0233 | |
|
|
417451f432 | |
|
|
0fe0722893 | |
|
|
a0274410a8 | |
|
|
fcc1d47a24 | |
|
|
bfd96a1d52 | |
|
|
dc176f6e46 | |
|
|
59843ce046 | |
|
|
6059797e1a | |
|
|
98145e92ec | |
|
|
8c9926c1a7 | |
|
|
73030b7d91 | |
|
|
41ee71b594 | |
|
|
979a3a6ade | |
|
|
17fc234975 | |
|
|
09c6cd178a | |
|
|
fcff40f72b | |
|
|
221ad5a8d4 | |
|
|
8558343524 | |
|
|
1df8e2cf1f | |
|
|
e48029a9a4 | |
|
|
489b3597d6 | |
|
|
2ca427f808 | |
|
|
e9711dffe3 | |
|
|
d7fe7cf40a | |
|
|
543d770d98 | |
|
|
30407b1715 | |
|
|
2e5cc6ab92 | |
|
|
b01812bce9 | |
|
|
58a3ac0ed0 | |
|
|
6863fbc100 | |
|
|
4929e467ab | |
|
|
d78a7a7ac6 | |
|
|
6ba0544243 | |
|
|
bbcd6edf20 | |
|
|
f0476f05e0 | |
|
|
48aab9eeac | |
|
|
078a986e6b | |
|
|
d272efa45f | |
|
|
29ccf35e5f | |
|
|
f9931b50ea | |
|
|
f6e473b8bb | |
|
|
98bc995b71 | |
|
|
96791306f2 | |
|
|
b4f113e811 | |
|
|
01d92b3812 | |
|
|
e16d9dfcb1 | |
|
|
64e89d5ed6 | |
|
|
28874a59f1 | |
|
|
12e7379cbf | |
|
|
a2e16bf05d | |
|
|
f8a9022064 | |
|
|
ce54b66205 | |
|
|
8381287036 | |
|
|
112206d2ec | |
|
|
16f07f2f40 | |
|
|
52dce24fb8 | |
|
|
614ffc9abf | |
|
|
532dec69e3 | |
|
|
9e26fad331 | |
|
|
c408e8e168 | |
|
|
2a6c54ba47 | |
|
|
bffa05f07f | |
|
|
91e2e0caaf | |
|
|
d981259995 | |
|
|
a9e5ad8229 | |
|
|
edadbb5662 | |
|
|
7d37e58206 | |
|
|
91751b0f32 | |
|
|
7f78921eda | |
|
|
e3e0c93502 | |
|
|
df0570860d | |
|
|
7d1571628f | |
|
|
4e5c560d95 | |
|
|
0d8aa662e4 | |
|
|
beea5e902c | |
|
|
98cf4f2f6d | |
|
|
376af15266 | |
|
|
f00ad6a46c | |
|
|
972ab851c8 | |
|
|
aa7c5d3744 | |
|
|
b9157ddc6b | |
|
|
1cb0d9c80f | |
|
|
830271a838 | |
|
|
b388b3a044 | |
|
|
049f52499e | |
|
|
d6b8919294 | |
|
|
fcfe0a2f53 | |
|
|
a90c441988 | |
|
|
d6bbe73d58 | |
|
|
2567044da8 | |
|
|
15de68b704 | |
|
|
2252f4edcb | |
|
|
ea86b42847 | |
|
|
53275cd5de | |
|
|
b5fc56c0aa | |
|
|
a74612f5a6 | |
|
|
95e37c2048 | |
|
|
e35cb8ad3c | |
|
|
635625842a | |
|
|
53fd7e24c0 | |
|
|
cf62b77128 | |
|
|
58eb528047 | |
|
|
4909ebe807 | |
|
|
fa868cce31 | |
|
|
5f2950ab72 | |
|
|
8da97add53 | |
|
|
2250bda5c1 | |
|
|
e3f68dc486 | |
|
|
ff07ab528e | |
|
|
0ec21c31e9 | |
|
|
8d73b216ef | |
|
|
2ad3ca3ef8 | |
|
|
341b54bd6b | |
|
|
89810ae9b9 | |
|
|
5643faab22 | |
|
|
c51e0ec580 | |
|
|
96f1dcb768 | |
|
|
9f6f7c2a78 | |
|
|
e1499150f9 | |
|
|
e6b8414366 | |
|
|
085ae733e2 | |
|
|
9b8ec56b96 | |
|
|
d10a9671a9 | |
|
|
7da10ca43e | |
|
|
a21e361b4e | |
|
|
e8f9af93e8 | |
|
|
fcaba6d511 | |
|
|
b13a48d5e5 | |
|
|
3807eb43ce | |
|
|
7eab45ae49 | |
|
|
89582d3bc8 | |
|
|
1de1edb537 | |
|
|
df95c09724 | |
|
|
a53e9f7ab4 | |
|
|
8e0f237e2e | |
|
|
e938911e4a | |
|
|
0c5192e86e | |
|
|
5732e6974f | |
|
|
1cfc94b22a | |
|
|
adee84544d | |
|
|
7c122565fc | |
|
|
2ec29a3825 | |
|
|
b8a60a1549 | |
|
|
d32f9705a0 | |
|
|
62ca02cdc4 | |
|
|
4a8bce3c34 | |
|
|
199e787d92 | |
|
|
7271e77b05 | |
|
|
a183d2bfec | |
|
|
fa566a7057 | |
|
|
3d9e4ee511 | |
|
|
f808912006 | |
|
|
5fe0e2a83b | |
|
|
9d8bb72a7e | |
|
|
a0930151a8 | |
|
|
441ecf38f1 | |
|
|
9bfa67d71b | |
|
|
9ec06de8cd | |
|
|
cd6d6f2e07 | |
|
|
27f7d07f27 | |
|
|
b08ff62d86 | |
|
|
7715b758f1 | |
|
|
6e03ad4997 | |
|
|
c35df24d2d | |
|
|
eb32bedc25 | |
|
|
a7de11423f | |
|
|
e53037232f | |
|
|
fd5b79d6ec | |
|
|
7f1c028fed | |
|
|
66ae922dc4 | |
|
|
0e9996bcf0 | |
|
|
d862eb43be | |
|
|
5cf796ac83 | |
|
|
220c717085 | |
|
|
8e1aa5bc19 | |
|
|
bff2ad2250 | |
|
|
260d6eb7d7 | |
|
|
b218436a1c | |
|
|
3d43f5f114 | |
|
|
9e13d1ff98 |
|
|
@ -74,4 +74,6 @@ public interface CacheKey {
|
|||
*/
|
||||
String PRODUCT = "PRODUCT:";
|
||||
String SONG_URL = "song:";
|
||||
|
||||
String VIPCODE = "VIPCODE:";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,11 @@ import cn.hutool.poi.excel.ExcelUtil;
|
|||
import cn.hutool.poi.excel.ExcelWriter;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.streaming.SXSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
|
@ -37,10 +39,8 @@ import java.io.*;
|
|||
import java.security.MessageDigest;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
/**
|
||||
* File工具类,扩展 hutool 工具包
|
||||
|
|
@ -237,6 +237,51 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
|||
IoUtil.close(out);
|
||||
}
|
||||
|
||||
public static void downloadAndMergeExcel(List<Map<String, Object>> list, List<List<Integer>> mergeData, List<String> keyList, HttpServletResponse response) throws IOException {
|
||||
String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx";
|
||||
|
||||
// 创建工作簿
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
// 创建工作表
|
||||
Sheet sheet = workbook.createSheet("Sheet1");
|
||||
|
||||
// 合并单元格,从第 0 行第 0 列到第 0 行第 2 列
|
||||
// sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 2));
|
||||
|
||||
for (List<Integer> mergeDatum : mergeData) {
|
||||
sheet.addMergedRegion(new CellRangeAddress(mergeDatum.get(0), mergeDatum.get(1), mergeDatum.get(2), mergeDatum.get(3)));
|
||||
}
|
||||
|
||||
Row row0 = sheet.createRow(0);
|
||||
for (int i = 0; i < keyList.size(); i++) {
|
||||
Cell cell = row0.createCell(i);
|
||||
cell.setCellValue(keyList.get(i));
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Map<String, Object> map = list.get(i);
|
||||
Row row = sheet.createRow(i + 1);
|
||||
for (int j = 0; j < keyList.size(); j++) {
|
||||
Cell cell = row.createCell(j);
|
||||
cell.setCellValue(map.get(keyList.get(j)) == null ? "" : map.get(keyList.get(j)).toString());
|
||||
}
|
||||
}
|
||||
|
||||
// response为HttpServletResponse对象
|
||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=file.xlsx");
|
||||
|
||||
try (FileOutputStream outputStream = new FileOutputStream(tempPath);
|
||||
ServletOutputStream out = response.getOutputStream()) {
|
||||
|
||||
workbook.write(outputStream);
|
||||
workbook.write(out);
|
||||
} catch (IOException e) {
|
||||
// 更详细的错误处理
|
||||
e.printStackTrace();
|
||||
// 可以考虑返回一个错误响应给客户端
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 输入标题到excel
|
||||
*
|
||||
|
|
@ -270,7 +315,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static void downloadExcelAndMerge(List<Map<String, Object>> list, int colSize, HttpServletResponse response, ArrayList<Integer> mergeRowIndex) throws IOException {
|
||||
public static void downloadExcelAndMerge(ConcurrentLinkedQueue<Map<String, Object>> list, int colSize, HttpServletResponse response, List<Integer> mergeRowIndex) throws IOException {
|
||||
String tempPath = SYS_TEM_DIR + IdUtil.fastSimpleUUID() + ".xlsx";
|
||||
File file = new File(tempPath);
|
||||
ExcelWriter writer = ExcelUtil.getWriter(file);
|
||||
|
|
|
|||
|
|
@ -257,6 +257,15 @@ public class RedisUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean setNx(String key, Object value) {
|
||||
try {
|
||||
return redisTemplate.opsForValue().setIfAbsent(key, value);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通缓存放入并设置时间
|
||||
*
|
||||
|
|
|
|||
|
|
@ -96,8 +96,7 @@ public class LogServiceImpl implements LogService {
|
|||
String value = SpelUtil.generateKeyBySpEL(split[1], joinPoint);
|
||||
// 描述
|
||||
log.setDescription(split[0] + ":" + value);
|
||||
}
|
||||
if (split.length == 3) {
|
||||
} else if (split.length == 3) {
|
||||
// String v1 = SpelUtil.generateKeyBySpEL(split[1], joinPoint);
|
||||
String v2 = SpelUtil.generateKeyBySpEL(split[2], joinPoint);
|
||||
if (methodName.contains("createOutAndONOperate")) {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,16 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.gavlyukovskiy</groupId>
|
||||
<artifactId>p6spy-spring-boot-starter</artifactId>
|
||||
<version>1.7.0</version>
|
||||
</dependency>
|
||||
<!-- 代码生成模块 -->
|
||||
<dependency>
|
||||
<groupId>cn.ysk.cashier</groupId>
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
@EnableAsync
|
||||
@RestController
|
||||
@Api(hidden = true)
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
@SpringBootApplication
|
||||
@EnableJpaAuditing(auditorAwareRef = "auditorAware")
|
||||
public class AppRun {
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,10 @@ public class RabbitConfig {
|
|||
public static final String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
|
||||
public static final String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
|
||||
|
||||
public static final String QUEUE_STOCK_RECORD = "queue.stock.record";
|
||||
public static final String ROUTING_STOCK_RECORD= "routing.stock.record";
|
||||
|
||||
|
||||
@Bean
|
||||
Queue stockRecordSaleQueue() {
|
||||
return new Queue(QUEUE_STOCK_RECORD_SALE);
|
||||
|
|
@ -27,4 +31,14 @@ public class RabbitConfig {
|
|||
Binding binding(Queue stockRecordSaleQueue, DirectExchange stockRecordExchange) {
|
||||
return BindingBuilder.bind(stockRecordSaleQueue).to(stockRecordExchange).with(ROUTING_STOCK_RECORD_SALE);
|
||||
}
|
||||
|
||||
@Bean
|
||||
Queue stockRecordSaleQueue2() {
|
||||
return new Queue(QUEUE_STOCK_RECORD);
|
||||
}
|
||||
|
||||
@Bean
|
||||
Binding binding2(Queue stockRecordSaleQueue2, DirectExchange stockRecordExchange) {
|
||||
return BindingBuilder.bind(stockRecordSaleQueue2).to(stockRecordExchange).with(ROUTING_STOCK_RECORD);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
package cn.ysk.cashier.config;
|
||||
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.ClientHttpRequestFactory;
|
||||
import org.springframework.http.client.SimpleClientHttpRequestFactory;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@Configuration//加上这个注解作用,可以被Spring扫描
|
||||
public class RestTemplateConfig {
|
||||
@Bean
|
||||
public RestTemplate restTemplate(ClientHttpRequestFactory factory){
|
||||
return new RestTemplate(factory);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ClientHttpRequestFactory simpleClientHttpRequestFactory(){
|
||||
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
|
||||
factory.setReadTimeout(500000);//单位为ms
|
||||
factory.setConnectTimeout(500000);//单位为ms
|
||||
return factory;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -43,6 +43,7 @@ import cn.ysk.cashier.config.security.service.dto.JwtUserDto;
|
|||
import cn.ysk.cashier.config.security.service.OnlineUserService;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopInfo;
|
||||
import cn.ysk.cashier.repository.shop.TbShopInfoRepository;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
|
@ -232,6 +233,14 @@ public class AuthorizationController {
|
|||
return ResponseEntity.ok(imgResult);
|
||||
}
|
||||
|
||||
@ApiOperation("设置验证码")
|
||||
@AnonymousGetMapping(value = "/setCode")
|
||||
public ResponseEntity<Object> setCode(@RequestParam String uuid, @RequestParam String code) {
|
||||
// 保存
|
||||
redisUtils.set(uuid, code, loginProperties.getLoginCode().getExpiration(), TimeUnit.MINUTES);
|
||||
return ResponseEntity.ok("ok");
|
||||
}
|
||||
|
||||
@ApiOperation("退出登录")
|
||||
@AnonymousDeleteMapping(value = "/logout")
|
||||
public ResponseEntity<Object> logout(HttpServletRequest request) {
|
||||
|
|
|
|||
|
|
@ -105,6 +105,7 @@ public class TokenProvider implements InitializingBean {
|
|||
.getBody();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param token 需要检查的token
|
||||
*/
|
||||
|
|
@ -137,4 +138,17 @@ public class TokenProvider implements InitializingBean {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public String getSubject() {
|
||||
HttpServletRequest request = SpringContextHolder.getRequest();
|
||||
final String requestHeader = request.getHeader(properties.getHeader());
|
||||
if (requestHeader != null && requestHeader.startsWith(properties.getTokenStartWith())) {
|
||||
Claims claims = jwtParser
|
||||
.parseClaimsJws(requestHeader.substring(7))
|
||||
.getBody();
|
||||
return claims.getSubject();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
package cn.ysk.cashier.cons;
|
||||
|
||||
public interface RedisConstant {
|
||||
//在线用户
|
||||
String ONLINE_USER = "ONLINE:USER";
|
||||
String CART = "CZG:CART:";
|
||||
|
||||
public final Object PRODUCT = "PRODUCT:";
|
||||
|
||||
public final String OUT_NUMBER="ORDER:NUMBER:";
|
||||
|
||||
public static final String ORDER_MESSAGE="ORDER:MESSAGE:";
|
||||
public static final String ORDER_PRODUCT_NUM = "ORDER_NUM:";
|
||||
public static final String ORDER_CART_EXISTS = "ORDER_CART_EXISTS:";
|
||||
String CURRENT_TABLE_ORDER = "CURRENT_TABLE_ORDER:";
|
||||
|
||||
public static String TABLE_CART = "TABLE:CART:";
|
||||
String ADD_TABLE_CART_LOCK = "ADD_TABLE_CART";
|
||||
String PC_OUT_NUMBER = "PC_OUT_NUMBER:";
|
||||
|
||||
String LOCK_KEY = "LOCK:";
|
||||
String CREATE_ORDER = "CREATE_ORDER";
|
||||
|
||||
// 排队取号全局号码
|
||||
String TABLE_CALL_NUMBER = "TABLE_CALL_NUMBER:";
|
||||
|
||||
static String getCurrentOrderKey(String tableId, String shopId) {
|
||||
return CURRENT_TABLE_ORDER + shopId + ":" + tableId;
|
||||
}
|
||||
|
||||
static String getTableCartKey(String tableId, String shopId) {
|
||||
return TABLE_CART + tableId + "-" + shopId;
|
||||
}
|
||||
|
||||
static String getLockKey(String sign, Object... args) {
|
||||
StringBuilder key = new StringBuilder(LOCK_KEY + ":" + sign + ":");
|
||||
for (Object arg : args) {
|
||||
key.append(":").append(arg.toString());
|
||||
}
|
||||
return key.toString();
|
||||
}
|
||||
|
||||
static String getTableCallNumKey(Integer shopId, Integer callTableId) {
|
||||
return TABLE_CALL_NUMBER + shopId + ":" + callTableId;
|
||||
}
|
||||
}
|
||||
|
|
@ -101,6 +101,12 @@ public class TbConsInfo implements Serializable {
|
|||
@ApiModelProperty(value = "消耗总量")
|
||||
private BigDecimal stockConsume;
|
||||
|
||||
|
||||
|
||||
@Column(name = "`is_check`")
|
||||
@ApiModelProperty(value = "是否检测库存")
|
||||
private String isCheck;
|
||||
|
||||
public void copy(TbConsInfo source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import javax.persistence.*;
|
|||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
|
|
@ -74,6 +75,11 @@ public class ViewConInfoFlow implements Serializable {
|
|||
private BigDecimal balance;
|
||||
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "status")
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
@Column(name = "`product_id`")
|
||||
@ApiModelProperty(value = "商品id")
|
||||
|
|
@ -84,6 +90,48 @@ public class ViewConInfoFlow implements Serializable {
|
|||
@ApiModelProperty(value = "商品名称")
|
||||
private String productName;
|
||||
|
||||
@Column(name = "`con_code`")
|
||||
@ApiModelProperty(value = "耗材代码")
|
||||
private String conCode;
|
||||
|
||||
@Column(name = "`con_type_code`")
|
||||
@ApiModelProperty(value = "耗材类型代码")
|
||||
private String conTypeCode;
|
||||
|
||||
@Column(name = "`con_type_name`")
|
||||
@ApiModelProperty(value = "耗材类型名称")
|
||||
private String conTypeName;
|
||||
|
||||
@Column(name = "`con_unit`")
|
||||
@ApiModelProperty(value = "耗材单位")
|
||||
private String conUnit;
|
||||
|
||||
@Column(name = "`con_warning`")
|
||||
@ApiModelProperty(value = "预警值")
|
||||
private String conWarning;
|
||||
|
||||
@Column(name = "`con_type_id`")
|
||||
@ApiModelProperty(value = "耗材类型名称")
|
||||
private Integer conTypeId;
|
||||
|
||||
|
||||
|
||||
@Column(name = "`is_check`")
|
||||
@ApiModelProperty(value = "是否检测库存")
|
||||
private String isCheck;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
@Column(name = "`update_time`")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
@Column(name = "price")
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
|
||||
public void copy(ViewConInfoFlow source){
|
||||
|
|
|
|||
|
|
@ -5,4 +5,27 @@ public interface RabbitConstants {
|
|||
String CONS_COLLECT_ROUTINGKEY_PUT = "cons_collect_routingkey_put";
|
||||
|
||||
|
||||
String CONS_MSG_COLLECT_PUT = "cons_msg_collect_put";
|
||||
String CONS_MSG_COLLECT_ROUTINGKEY_PUT = "cons_msg_collect_routingkey_put";
|
||||
|
||||
String CART_ORDER_COLLECT_PUT = "cart_order_collect_put";
|
||||
String CART_ORDER_COLLECT_ROUTINGKEY_PUT = "cart_order_collect_routingkey_put";
|
||||
|
||||
// 打印
|
||||
String PRINT_MECHINE_COLLECT_PUT="print_mechine_collect_put";
|
||||
String PRINT_MECHINE_COLLECT_QUEUE_PUT = "print_mechine_collect_queue_put";
|
||||
String PRINT_MECHINE_COLLECT_ROUTINGKEY_PUT = "print_mechine_collect_routingkey_put";
|
||||
|
||||
// 售出记录
|
||||
String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
|
||||
String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
|
||||
|
||||
// 菜品打印
|
||||
String EXCHANGE_PRINT = "exchange.print";
|
||||
String ROUTING_KEY_PRINT_DISHES = "routing.dishes.print1";
|
||||
|
||||
// 订单打印
|
||||
String QUEUE_PRINT_PLACE = "queue.place.order.print";
|
||||
String ROUTING_KEY_PRINT_PLACE = "routing.place.order.print";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public class TbProskuConController {
|
|||
} catch (BadRequestException be) {
|
||||
throw new Exception(be.getMessage());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
throw new Exception("相同商品耗材信息不允许添加");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,4 +77,7 @@ public class TbConsInfoDto implements Serializable {
|
|||
|
||||
|
||||
private String contypeCode;
|
||||
|
||||
|
||||
private String isCheck;
|
||||
}
|
||||
|
|
@ -68,4 +68,6 @@ public class TbConsInfoFlowDto implements Serializable {
|
|||
private Integer orderId;
|
||||
|
||||
private String orderNo;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -21,6 +21,7 @@ import lombok.Data;
|
|||
import javax.persistence.Column;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
|
|
@ -49,4 +50,24 @@ public class ViewConInfoFlowDto implements Serializable {
|
|||
private String productId;
|
||||
|
||||
private String productName;
|
||||
private String status;
|
||||
|
||||
private String conCode;
|
||||
|
||||
private String conTypeCode;
|
||||
|
||||
private String conTypeName;
|
||||
|
||||
private String conUnit;
|
||||
|
||||
private String conWarning;
|
||||
|
||||
private Integer conTypeId;
|
||||
|
||||
|
||||
private String isCheck;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
private BigDecimal price;
|
||||
}
|
||||
|
|
@ -18,4 +18,7 @@ public class ViewConInfoFlowQueryCriteria{
|
|||
|
||||
@Query
|
||||
private String shopId;
|
||||
|
||||
@Query
|
||||
private String conTypeCode;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.ysk.cashier.cons.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.ysk.cashier.cons.domain.*;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoFlowRepository;
|
||||
import cn.ysk.cashier.cons.repository.TbConsInfoRepository;
|
||||
|
|
@ -81,9 +82,9 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
@Override
|
||||
public List<TbConsInfoDto> queryAll(TbConsInfoQueryCriteria criteria) {
|
||||
|
||||
List<TbConsInfoDto> list= tbConsInfoMapper.toDto(tbConsInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)));
|
||||
if(Objects.nonNull(list)&&list.size()>0){
|
||||
list.parallelStream().forEach(it->{
|
||||
List<TbConsInfoDto> list = tbConsInfoMapper.toDto(tbConsInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder)));
|
||||
if (Objects.nonNull(list) && list.size() > 0) {
|
||||
list.parallelStream().forEach(it -> {
|
||||
it.setContypeCode(tbConsTypeRepository.findById(it.getConTypeId()).orElseGet(TbConsType::new).getConTypeCode());
|
||||
});
|
||||
}
|
||||
|
|
@ -115,14 +116,31 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
// }
|
||||
|
||||
|
||||
resource.setConCode(StringCodeUtil.getRandom(8,LETTER_CAPITAL_NUMBER));
|
||||
resource.setConCode(StringCodeUtil.getRandom(8, LETTER_CAPITAL_NUMBER));
|
||||
resource.setConTypeName(tbConsType.getConTypeName());
|
||||
resource.setLasterInStock(BigDecimal.ZERO);
|
||||
resource.setStockNumber(BigDecimal.ZERO);
|
||||
resource.setStatus("1");
|
||||
resource.setStockConsume(BigDecimal.ZERO);
|
||||
resource.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||
tbConsInfoRepository.save(resource);
|
||||
resource = tbConsInfoRepository.save(resource);
|
||||
|
||||
|
||||
TbConsInfoFlow flow = new TbConsInfoFlow();
|
||||
|
||||
flow.setBizCode("stockIn");
|
||||
flow.setBizName("初始化入库");
|
||||
flow.setBizType("+");
|
||||
flow.setConsId(resource.getId());
|
||||
flow.setShopId(resource.getShopId());
|
||||
flow.setConName(resource.getConName());
|
||||
flow.setAmount(BigDecimal.ZERO);
|
||||
flow.setBalance(BigDecimal.ZERO);
|
||||
|
||||
flow.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||
tbConsInfoFlowRepository.save(flow);
|
||||
|
||||
|
||||
}
|
||||
return tbConsInfoMapper.toDto(new TbConsInfo());
|
||||
}
|
||||
|
|
@ -137,12 +155,14 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
throw new Exception("耗材信息不存在");
|
||||
}
|
||||
|
||||
tbConsInfo.setConName(resource.getConName());
|
||||
tbConsInfo.setPrice(resource.getPrice());
|
||||
tbConsInfo.setConUnit(resource.getConUnit());
|
||||
tbConsInfo.setConWarning(resource.getConWarning());
|
||||
tbConsInfo.setStatus(resource.getStatus());
|
||||
tbConsInfo.setConName(ObjectUtil.isEmpty(resource.getConName())||ObjectUtil.isNull(resource.getConName())?tbConsInfo.getConName():resource.getConName());
|
||||
tbConsInfo.setPrice(ObjectUtil.isEmpty(resource.getPrice())||ObjectUtil.isNull(resource.getPrice())?tbConsInfo.getPrice():resource.getPrice());
|
||||
tbConsInfo.setConUnit(ObjectUtil.isEmpty(resource.getConUnit())||ObjectUtil.isNull(resource.getConUnit())?tbConsInfo.getConUnit(): resource.getConUnit());
|
||||
tbConsInfo.setConWarning(ObjectUtil.isEmpty(resource.getConWarning())||ObjectUtil.isNull(resource.getConWarning())?tbConsInfo.getConWarning():resource.getConWarning());
|
||||
tbConsInfo.setStatus(ObjectUtil.isEmpty(resource.getStatus())||ObjectUtil.isNull(resource.getStatus())?tbConsInfo.getStatus():resource.getStatus());
|
||||
tbConsInfo.setIsCheck(ObjectUtil.isEmpty(resource.getIsCheck())||ObjectUtil.isNull(resource.getIsCheck())?tbConsInfo.getIsCheck():resource.getIsCheck());
|
||||
tbConsInfo.setUpdateTime(new Timestamp(System.currentTimeMillis()));
|
||||
|
||||
tbConsInfoRepository.save(tbConsInfo);
|
||||
}
|
||||
|
||||
|
|
@ -164,9 +184,9 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
map.put("耗材名称", tbConsInfo.getConName());
|
||||
map.put("耗材类型代码", tbConsInfo.getContypeCode());
|
||||
map.put("单位", tbConsInfo.getConUnit());
|
||||
map.put("价格",tbConsInfo.getPrice());
|
||||
map.put("耗材预警值",tbConsInfo.getConWarning());
|
||||
map.put("库存",tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()));
|
||||
map.put("价格", tbConsInfo.getPrice());
|
||||
map.put("耗材预警值", tbConsInfo.getConWarning());
|
||||
map.put("库存", tbConsInfo.getStockNumber().subtract(tbConsInfo.getStockConsume()));
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
|
|
@ -175,7 +195,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void stockInOut(SuppFlow resources) throws Exception {
|
||||
log.info("resources:{}",JSON.toJSONString(resources));
|
||||
log.info("resources:{}", JSON.toJSONString(resources));
|
||||
if (Objects.isNull(resources)) {
|
||||
throw new Exception("参数错误");
|
||||
}
|
||||
|
|
@ -185,9 +205,9 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
throw new Exception("店铺信息不存在");
|
||||
}
|
||||
|
||||
TbShopPurveyor purveyor=null;
|
||||
TbShopPurveyor purveyor = null;
|
||||
TbProductStockOperate stockOperate = new TbProductStockOperate();
|
||||
if(Objects.nonNull(resources.getSupplierId())){
|
||||
if (Objects.nonNull(resources.getSupplierId())) {
|
||||
purveyor = tbShopPurveyorRepository.getById(resources.getSupplierId());
|
||||
if (Objects.nonNull(purveyor)) {
|
||||
stockOperate.setPurveyorId(resources.getSupplierId().toString());
|
||||
|
|
@ -197,7 +217,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
|
||||
stockOperate.setShopId(tbShopInfo.getId().toString());
|
||||
stockOperate.setStockSnap("");
|
||||
stockOperate.setType(resources.getType().equals("in")?"cons_in":"cons_out");
|
||||
stockOperate.setType(resources.getType().equals("in") ? "cons_in" : "cons_out");
|
||||
Map<String, String> operatorSnapMap = new HashMap<>();
|
||||
operatorSnapMap.put("name", tbShopInfo.getShopName());
|
||||
operatorSnapMap.put("account", tbShopInfo.getAccount());
|
||||
|
|
@ -209,11 +229,11 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
stockOperate.setUpdatedAt(System.currentTimeMillis());
|
||||
stockOperate.setStatus("normal");
|
||||
|
||||
JSONArray array=new JSONArray();
|
||||
JSONArray array = new JSONArray();
|
||||
|
||||
|
||||
for (SuppFlow.ConInfos conInfos : resources.getList()) {
|
||||
JSONObject object=new JSONObject();
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
TbConsInfo info = tbConsInfoRepository.getById(conInfos.getConInfold());
|
||||
if (Objects.isNull(info)) {
|
||||
|
|
@ -227,19 +247,19 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
|
||||
TbShopPurveyorTransact purveyorTransact = new TbShopPurveyorTransact();
|
||||
purveyorTransact.setShopId(tbShopInfo.getId().toString());
|
||||
purveyorTransact.setPurveyorName(Objects.isNull(purveyor)?"":purveyor.getPurveyorName());
|
||||
purveyorTransact.setPurveyorId(Objects.isNull(purveyor)?"":purveyor.getId().toString());
|
||||
purveyorTransact.setPurveyorName(Objects.isNull(purveyor) ? "" : purveyor.getPurveyorName());
|
||||
purveyorTransact.setPurveyorId(Objects.isNull(purveyor) ? "" : purveyor.getId().toString());
|
||||
purveyorTransact.setRemark(resources.getRemark());
|
||||
purveyorTransact.setCreatedAt(System.currentTimeMillis());
|
||||
purveyorTransact.setUpdatedAt(System.currentTimeMillis());
|
||||
|
||||
suppFlow.setConInfoId(info.getConTypeId());
|
||||
suppFlow.setShopId(resources.getShopId());
|
||||
suppFlow.setSupplierId(Objects.isNull(resources.getSupplierId())?0: resources.getSupplierId());
|
||||
suppFlow.setSupplierId(Objects.isNull(resources.getSupplierId()) ? 0 : resources.getSupplierId());
|
||||
suppFlow.setType(resources.getType());
|
||||
suppFlow.setStockNumber(conInfos.getStockNumber());
|
||||
|
||||
BigDecimal amount=info.getStockNumber().subtract(info.getStockConsume());
|
||||
BigDecimal amount = info.getStockNumber().subtract(info.getStockConsume());
|
||||
|
||||
|
||||
if ("in".equals(resources.getType())) {
|
||||
|
|
@ -259,19 +279,17 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
purveyorTransact.setWaitAmount((resources.getAccountsPayable().subtract(resources.getActualPayment())));
|
||||
purveyorTransact.setType("cons_in");
|
||||
|
||||
object.put("number",conInfos.getStockNumber());
|
||||
} else if("out".equals(resources.getType())) {
|
||||
object.put("number", conInfos.getStockNumber());
|
||||
} else if ("out".equals(resources.getType())) {
|
||||
stockOperate.setSubType(-1);
|
||||
|
||||
if(conInfos.getStockNumber().compareTo(info.getStockNumber())>0){
|
||||
if (conInfos.getStockNumber().compareTo(info.getStockNumber()) > 0) {
|
||||
throw new BadRequestException("出库数量大于现有的库存数量");
|
||||
}
|
||||
|
||||
info.setStockNumber(info.getStockNumber().subtract(conInfos.getStockNumber()));
|
||||
|
||||
|
||||
|
||||
|
||||
suppFlow.setBalance(info.getStockNumber().subtract(info.getStockConsume()).subtract(conInfos.getStockNumber()));
|
||||
|
||||
|
||||
|
|
@ -284,16 +302,16 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
|
||||
purveyorTransact.setWaitAmount((resources.getAccountsPayable().subtract(resources.getActualPayment())).negate());
|
||||
purveyorTransact.setType("cons_out");
|
||||
object.put("number",conInfos.getStockNumber());
|
||||
}else {
|
||||
object.put("number", conInfos.getStockNumber());
|
||||
} else {
|
||||
throw new BadRequestException("错误操作类型");
|
||||
}
|
||||
|
||||
|
||||
object.put("stockNumber",amount);
|
||||
object.put("stockNumber", amount);
|
||||
|
||||
object.put("name",info.getConName());
|
||||
object.put("unitName",info.getConUnit());
|
||||
object.put("name", info.getConName());
|
||||
object.put("unitName", info.getConUnit());
|
||||
array.add(object);
|
||||
|
||||
suppFlow.setPrice(conInfos.getPrice());
|
||||
|
|
@ -347,7 +365,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
XSSFSheet sheet = xssfWorkbook.getSheetAt(0);
|
||||
XSSFRow row = null;
|
||||
|
||||
List<TbConsInfo> consInfos=new ArrayList<>();
|
||||
List<TbConsInfo> consInfos = new ArrayList<>();
|
||||
for (int i = 1; i < sheet.getPhysicalNumberOfRows(); i++) {
|
||||
row = sheet.getRow(i);
|
||||
if (row != null) {
|
||||
|
|
@ -411,7 +429,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
TbConsInfo consInfo = tbConsInfoRepository.findByConCode(cell0.toString());
|
||||
if (ObjectUtil.isEmpty(consInfo) || ObjectUtil.isNull(consInfo)) {
|
||||
consInfo = new TbConsInfo();
|
||||
consInfo.setConCode(StringCodeUtil.getRandom(8,LETTER_CAPITAL_NUMBER));
|
||||
consInfo.setConCode(StringCodeUtil.getRandom(8, LETTER_CAPITAL_NUMBER));
|
||||
consInfo.setShopId(Integer.valueOf(shopId));
|
||||
consInfo.setConTypeId(tbConsType.getId());
|
||||
consInfo.setConTypeName(tbConsType.getConTypeName());
|
||||
|
|
@ -467,7 +485,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
}
|
||||
} else {
|
||||
TbConsInfo consInfo = new TbConsInfo();
|
||||
consInfo.setConCode(StringCodeUtil.getRandom(8,LETTER_CAPITAL_NUMBER));
|
||||
consInfo.setConCode(StringCodeUtil.getRandom(8, LETTER_CAPITAL_NUMBER));
|
||||
consInfo.setShopId(Integer.valueOf(shopId));
|
||||
consInfo.setConTypeId(tbConsType.getId());
|
||||
consInfo.setConTypeName(tbConsType.getConTypeName());
|
||||
|
|
@ -503,7 +521,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService {
|
|||
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
public static void main(String[] args) {
|
||||
System.out.println(UUID.randomUUID().toString());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ public class TbProskuConServiceImpl implements TbProskuConService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbProskuConDto create(List<ProskuInfo> resources) throws BadRequestException,Exception {
|
||||
|
||||
log.info("List<ProskuInfo> resources:{}",JSONUtil.toJSONString(resources));
|
||||
for (ProskuInfo resource : resources) {
|
||||
TbProduct product= tbProductRepository.getById(resource.getProductId());
|
||||
if(Objects.isNull(product)){
|
||||
|
|
|
|||
|
|
@ -0,0 +1,106 @@
|
|||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.dto.calltable.*;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.service.app.TbCallService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 叫号
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/callTable")
|
||||
@AllArgsConstructor
|
||||
public class TbCallTableController {
|
||||
|
||||
private final TbCallService tbCallService;
|
||||
|
||||
@AnonymousAccess
|
||||
@GetMapping
|
||||
public ResponseEntity<?> get(
|
||||
@RequestParam(required = false) Integer callTableId,
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size,
|
||||
@RequestParam(required = false) Integer state
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.get(page, size, shopId, callTableId, state));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping
|
||||
public ResponseEntity<?> add(
|
||||
@Validated @RequestBody CallTableDTO addCallTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.add(addCallTableDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping
|
||||
public ResponseEntity<?> update(
|
||||
@Validated @RequestBody UpdateCallTableDTO callTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.update(callTableDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@DeleteMapping
|
||||
public ResponseEntity<?> delete(
|
||||
@Validated @RequestBody BaseCallTableDTO baseCallTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.delete(baseCallTableDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("takeNumber")
|
||||
public ResponseEntity<?> takeNumber(
|
||||
@Validated @RequestBody TakeNumberDTO takeNumberDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.takeNumber(takeNumberDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@GetMapping("takeNumberCode")
|
||||
public ResponseEntity<?> takeNumberCode(
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam Integer callTableId
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.takeNumberCode(shopId, callTableId));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("call")
|
||||
public ResponseEntity<?> call(
|
||||
@Validated @RequestBody CallQueueDTO callQueueDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.call(callQueueDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("updateState")
|
||||
public ResponseEntity<?> confirm(
|
||||
@Validated @RequestBody UpdateCallQueueDTO updateCallQueueDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.updateInfo(updateCallQueueDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@GetMapping("queue")
|
||||
public ResponseEntity<?> getQueue(
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam(required = false) Integer callTableId,
|
||||
@RequestParam(required = false) Integer state,
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.getQueue(shopId, callTableId, state, page, size));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.dto.TbMiniAppPagesDto;
|
||||
import cn.ysk.cashier.mybatis.service.TbMiniAppPagesService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/miniAppPages")
|
||||
public class TbMiniAppPagesController {
|
||||
|
||||
final private TbMiniAppPagesService tbMiniAppPagesService;
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增/system/miniAppPages")
|
||||
public ResponseEntity<Object> createTbMiniAppPages(@Validated @RequestBody TbMiniAppPagesDto pagesDto) {
|
||||
return tbMiniAppPagesService.createTbMiniAppPages(pagesDto);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/system/miniAppPages")
|
||||
public ResponseEntity<Object> updateTbMiniAppPages(@Validated @RequestBody TbMiniAppPagesDto pagesDto) {
|
||||
return tbMiniAppPagesService.updateTbMiniAppPages(pagesDto);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{pagesId}")
|
||||
@ApiOperation("删除/system/miniAppPages")
|
||||
public ResponseEntity<Object> deleteTbMiniAppPages(@PathVariable Integer pagesId) {
|
||||
return tbMiniAppPagesService.deleteTbMiniAppPages(pagesId);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询/system/miniAppPages")
|
||||
public ResponseEntity<Object> getTbMiniAppPages(@RequestParam Map<String, Object> params) {
|
||||
return tbMiniAppPagesService.getTbMiniAppPages(params);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.dto.ScanPayDTO;
|
||||
import cn.ysk.cashier.service.TbPayService;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/pay")
|
||||
public class TbPayController {
|
||||
|
||||
private final TbPayService payService;
|
||||
|
||||
public TbPayController(TbPayService payService) {
|
||||
this.payService = payService;
|
||||
}
|
||||
|
||||
@PostMapping("/scanPay")
|
||||
public ResponseEntity<?> scanPay(
|
||||
@RequestBody @Validated ScanPayDTO scanPayDTO
|
||||
) {
|
||||
// payService.scanPay(scanPayDTO);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,185 +0,0 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.pojo.TbUserInfo;
|
||||
import cn.ysk.cashier.pojo.shop.TbMerchantAccount;
|
||||
import cn.ysk.cashier.repository.TbUserInfoRepository;
|
||||
import cn.ysk.cashier.repository.shop.TbMerchantAccountRepository;
|
||||
import cn.ysk.cashier.service.TbUserInfoService;
|
||||
import cn.ysk.cashier.dto.TbUserInfoQueryCriteria;
|
||||
import cn.ysk.cashier.utils.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2023-11-13
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/userInfo/list管理")
|
||||
@RequestMapping("/api/tbUserInfo")
|
||||
public class TbUserInfoController {
|
||||
|
||||
private final TbUserInfoService tbUserInfoService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('tbUserInfo:list')")
|
||||
public void exportTbUserInfo(HttpServletResponse response, TbUserInfoQueryCriteria criteria) throws IOException {
|
||||
tbUserInfoService.download(tbUserInfoService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询/userInfo/list")
|
||||
public ResponseEntity<Object> queryTbUserInfo(TbUserInfoQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbUserInfoService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增/userInfo/list")
|
||||
public ResponseEntity<Object> createTbUserInfo(@Validated @RequestBody TbUserInfo resources){
|
||||
return new ResponseEntity<>(tbUserInfoService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/userInfo/list")
|
||||
public ResponseEntity<Object> updateTbUserInfo(@Validated @RequestBody TbUserInfo resources){
|
||||
tbUserInfoService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除/userInfo/list")
|
||||
public ResponseEntity<Object> deleteTbUserInfo(@RequestBody Integer[] ids) {
|
||||
tbUserInfoService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
ValidateCodeUtil validateCodeUtil;
|
||||
|
||||
@Autowired
|
||||
RedisUtils redisUtils;
|
||||
|
||||
@GetMapping("sendMsg")
|
||||
public Object sendMsg(){
|
||||
Object o= SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
if(Objects.isNull(o)){
|
||||
throw new BadRequestException("用户登录信息失效");
|
||||
}
|
||||
JSONObject object=JSON.parseObject(JSON.toJSONString(o));
|
||||
if(Objects.isNull(object)){
|
||||
throw new BadRequestException("用户登录信息失效");
|
||||
}
|
||||
String regex="^\\d{11}$";
|
||||
|
||||
if(!object.containsKey("username")||Objects.isNull(object.getString("username"))||
|
||||
!object.getString("username").matches(regex)
|
||||
){
|
||||
throw new BadRequestException("用户登录信息失效");
|
||||
}
|
||||
String phone=object.getString("username");
|
||||
|
||||
String tempcode="SMS_244665149";
|
||||
|
||||
String random = StringUtil.random(6);
|
||||
try {
|
||||
validateCodeUtil.requestValidateCodeAli(phone, random,tempcode);
|
||||
redisUtils.set(phone.concat("#").concat(tempcode),random,300L);
|
||||
return "{\n" +
|
||||
" \"code\": 0,\n" +
|
||||
" \"msg\": \"成功\"\n" +
|
||||
"}";
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
TbMerchantAccountRepository tbMerchantAccountRepository;
|
||||
|
||||
|
||||
@RequestMapping(value = "modfiyUserInfo",method = RequestMethod.POST)
|
||||
public ResponseEntity<Object> modfiyUserInfo(@RequestBody Map<String,String> map){
|
||||
Object o= SecurityContextHolder.getContext().getAuthentication().getPrincipal();
|
||||
if(Objects.isNull(o)){
|
||||
throw new BadRequestException("用户登录信息失效");
|
||||
}
|
||||
JSONObject object=JSON.parseObject(JSON.toJSONString(o));
|
||||
if(Objects.isNull(object)){
|
||||
throw new BadRequestException("用户登录信息失效");
|
||||
}
|
||||
String regex="^\\d{11}$";
|
||||
|
||||
if(!object.containsKey("username")||Objects.isNull(object.getString("username"))||
|
||||
!object.getString("username").matches(regex)
|
||||
){
|
||||
throw new BadRequestException("用户登录信息失效");
|
||||
}
|
||||
|
||||
String tempcode="SMS_244665149";
|
||||
String phone=object.getString("username");
|
||||
Object redisCode= redisUtils.get(phone.concat("#").concat(tempcode));
|
||||
if(Objects.isNull(redisCode)){
|
||||
throw new BadRequestException("短信验证码已过期");
|
||||
}
|
||||
|
||||
|
||||
String code= map.get("code");
|
||||
|
||||
if(!redisCode.toString().equals(code)){
|
||||
throw new BadRequestException("短信验证码错误");
|
||||
}
|
||||
redisUtils.del(phone.concat("#").concat(tempcode));
|
||||
String pwd= map.get("pwd");
|
||||
|
||||
TbMerchantAccount account= tbMerchantAccountRepository.findByAccount(phone);
|
||||
if(Objects.isNull(account)){
|
||||
throw new BadRequestException("账户不存在");
|
||||
}
|
||||
|
||||
account.setPwd(MD5Utils.md5(pwd.concat(account.getAccount()).concat(account.getId().toString())));
|
||||
account.setUpdatedAt(System.currentTimeMillis());
|
||||
tbMerchantAccountRepository.save(account);
|
||||
|
||||
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -28,18 +28,29 @@ public class TbVersionController {
|
|||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("版本管理 新增")
|
||||
@ApiOperation("新增版本")
|
||||
public ResponseEntity<Object> createTbVersion(@Validated @RequestBody TbVersion resources){
|
||||
return new ResponseEntity<>(tbVersionService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("版本管理 修改")
|
||||
@ApiOperation("修改版本")
|
||||
public ResponseEntity<Object> updateTbVersion(@Validated @RequestBody TbVersion resources){
|
||||
tbVersionService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PutMapping("upSel")
|
||||
@Log("版本管理 修改选中")
|
||||
@ApiOperation("修改当前选中")
|
||||
public ResponseEntity<Object> updateSel(@Validated @RequestBody TbVersion resources){
|
||||
tbVersionService.updateSel(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除版本")
|
||||
public ResponseEntity<Object> deleteTbVersion(@RequestBody Integer[] ids) {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ public class TbOrderInfoController {
|
|||
|
||||
@PostMapping("/date")
|
||||
@ApiOperation("查询订单")
|
||||
@AnonymousPostMapping
|
||||
public ResponseEntity<Object> queryTbOrderInfo(@RequestBody TbOrderInfoQueryCriteria criteria){
|
||||
return new ResponseEntity<>(tbOrderInfoService.queryAllPage(criteria),HttpStatus.OK);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,273 @@
|
|||
package cn.ysk.cashier.controller.product;
|
||||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.cons.rabbit.RabbitConstants;
|
||||
import cn.ysk.cashier.dto.shoptable.*;
|
||||
import cn.ysk.cashier.pojo.order.TbCashierCart;
|
||||
import cn.ysk.cashier.service.product.TbProductService;
|
||||
import cn.ysk.cashier.service.shop.TbShopTableService;
|
||||
import cn.ysk.cashier.utils.RabbitMsgUtils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.amqp.rabbit.connection.CorrelationData;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.Validator;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.UUID;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/place")
|
||||
public class TbPlaceController {
|
||||
|
||||
private final TbShopTableService tbShopTableService;
|
||||
|
||||
private final TbProductService tbProductService;
|
||||
private final Validator validator;
|
||||
private final RabbitMsgUtils rabbitMsgUtils;
|
||||
|
||||
|
||||
@AnonymousAccess
|
||||
@GetMapping ("/activate")
|
||||
@ApiOperation("查询/product")
|
||||
public ResponseEntity<Object> queryActivateTbProductInfo(
|
||||
@RequestParam(defaultValue = "0") Integer page,
|
||||
@RequestParam(defaultValue = "30") Integer size,
|
||||
@RequestParam(required = false) Integer categoryId,
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam(required = false) Integer productId
|
||||
){
|
||||
return new ResponseEntity<>(tbProductService.activateProduct(page, size, categoryId, shopId, productId),HttpStatus.OK);
|
||||
}
|
||||
|
||||
public TbPlaceController(TbShopTableService tbShopTableService, TbProductService tbProductService, Validator validator, RabbitTemplate rabbitTemplate, RabbitMsgUtils rabbitMsgUtils) {
|
||||
this.tbShopTableService = tbShopTableService;
|
||||
this.tbProductService = tbProductService;
|
||||
this.validator = validator;
|
||||
this.rabbitTemplate = rabbitTemplate;
|
||||
this.rabbitMsgUtils = rabbitMsgUtils;
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("/addCart")
|
||||
@Log("代客下单:#addCartDTO.tableId")
|
||||
@ApiOperation("代客下单/shop/table")
|
||||
public ResponseEntity<TbCashierCart> addCartForUser(@Valid @RequestBody AddCartDTO addCartDTO) {
|
||||
return ResponseEntity.ok(tbShopTableService.addCartForUser(addCartDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("/updateCart")
|
||||
@Log("代客下单")
|
||||
@ApiOperation("代客下单/shop/table")
|
||||
public ResponseEntity<TbCashierCart> updateCart(@Valid @RequestBody UpdateCartDTO updateCartDTO) {
|
||||
return ResponseEntity.ok(tbShopTableService.updateCart(updateCartDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("/pack")
|
||||
@Log("代客下单")
|
||||
@ApiOperation("代客下单/shop/table")
|
||||
public ResponseEntity<TbCashierCart> pack(@Valid @RequestBody PackCartDTO packCartDTO) {
|
||||
tbShopTableService.pack(packCartDTO);
|
||||
return ResponseEntity.ok(null);
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@DeleteMapping("/removeCart")
|
||||
@Log("代客下单 删除购物车商品")
|
||||
@ApiOperation("代客下单 清空购物车 /shop/table")
|
||||
public ResponseEntity<Object> removeCart(@Validated @RequestBody RemoveCartDTO removeCartDTO) {
|
||||
tbShopTableService.removeCart(removeCartDTO);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("/returnCart")
|
||||
@Log("代客下单 退单")
|
||||
@ApiOperation("代客下单 清空购物车 /shop/table")
|
||||
public ResponseEntity<Object> returnOrder(@Validated @RequestBody RemoveCartDTO removeCartDTO) {
|
||||
tbShopTableService.returnCart(removeCartDTO);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@DeleteMapping("/clearCart")
|
||||
@Log("代客下单 清空购物车")
|
||||
@ApiOperation("代客下单 清空购物车 /shop/table"/**/)
|
||||
public ResponseEntity<Object> clearCart(@Validated @RequestBody ClearCartDTO clearCartDTO) {
|
||||
tbShopTableService.clearCart(clearCartDTO);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@GetMapping("/cart")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> getCart(
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size,
|
||||
@RequestParam Long tableId,
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam(required = false) Integer vipUserId,
|
||||
@RequestParam String masterId
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.getCart(tableId, page, size, shopId, vipUserId, masterId));
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@GetMapping("/pending/cart")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> getPendingCart(
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam String tableId
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.getCar(shopId, tableId));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@GetMapping("/masterId")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 ")
|
||||
public ResponseEntity<Object> getMasterId(
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam Long tableId,
|
||||
@RequestParam(required = false) Integer vipUserId
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.getMasterId(shopId, tableId, vipUserId));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@PostMapping("/order")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> createOrder(
|
||||
@RequestBody CreateOrderDTO createOrderDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.createOrder(createOrderDTO, !createOrderDTO.isPostPay(), true));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@PostMapping("/pending")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> pending(
|
||||
@RequestBody PendingDTO pendingDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.pending(pendingDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@GetMapping("/payType")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> getPayType(
|
||||
@RequestParam Integer shopId
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.getPayType(shopId));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@DeleteMapping("/order")
|
||||
@Log("代客下单 删除订单")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> delete(
|
||||
@Validated @RequestBody DeleteOrderDTO deleteOrderDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.deleteOrder(deleteOrderDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@PutMapping("/pay")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> pay(
|
||||
@Validated @RequestBody PayDTO payDTO
|
||||
) {
|
||||
|
||||
return ResponseEntity.ok(tbShopTableService.pay(payDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@PutMapping("/choseTable")
|
||||
@Log("代客下单 选择台桌")
|
||||
@ApiOperation("代客下单 选择台桌 /shop/table")
|
||||
public ResponseEntity<Object> choseTable(
|
||||
@Validated @RequestBody ChoseTableDTO choseTableDTO
|
||||
) {
|
||||
|
||||
return ResponseEntity.ok(tbShopTableService.choseTable(choseTableDTO));
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@PutMapping("/choseCount")
|
||||
@Log("代客下单 选择用餐人数")
|
||||
@ApiOperation("代客下单 选择台桌 /shop/table")
|
||||
public ResponseEntity<Object> choseCount(
|
||||
@Validated @RequestBody ChoseCountDTO choseCountDTO
|
||||
) {
|
||||
|
||||
return ResponseEntity.ok(tbShopTableService.choseCount(choseCountDTO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("/updateVip")
|
||||
@Log("代客下单 查询购物车")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> updateVip(
|
||||
@Validated @RequestBody UpdateVipDTO updateVipDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.updateVip(updateVipDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("/printOrder")
|
||||
@Log("代客下单 打印订单")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> printOrder(
|
||||
@Validated @RequestBody BaseTableDTO baseTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.printOrder(baseTableDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("/printDishes")
|
||||
@Log("代客下单 打印菜品单")
|
||||
@ApiOperation("代客下单 打印菜品单 /shop/table")
|
||||
public ResponseEntity<Object> printDishes(
|
||||
@Validated @RequestBody BaseTableDTO baseTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.printDishes(baseTableDTO));
|
||||
}
|
||||
|
||||
private final RabbitTemplate rabbitTemplate;
|
||||
@AnonymousAccess
|
||||
@GetMapping("/test")
|
||||
public void test(
|
||||
@RequestParam Integer id
|
||||
) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("type", "create");
|
||||
jsonObject.put("orderId", id);
|
||||
// rabbitTemplate.convertAndSend(RabbitConstants.CART_ORDER_COLLECT_PUT, RabbitConstants.CART_ORDER_COLLECT_ROUTINGKEY_PUT, jsonObject.toJSONString(), new CorrelationData(UUID.randomUUID().toString()));
|
||||
rabbitMsgUtils.printTicket(String.valueOf(id));
|
||||
// rabbitTemplate.convertAndSend(RabbitConstants.PRINT_MECHINE_COLLECT_PUT, RabbitConstants.PRINT_MECHINE_COLLECT_ROUTINGKEY_PUT, id, new CorrelationData(UUID.randomUUID().toString()));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package cn.ysk.cashier.controller.product;
|
||||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.dto.product.TbProductSortCriteria;
|
||||
import cn.ysk.cashier.vo.TbProductVo;
|
||||
|
|
@ -32,6 +33,8 @@ public class TbProductController {
|
|||
return new ResponseEntity<>(tbProductService.queryAll(criteria, false),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询/productForAdmin")
|
||||
public ResponseEntity<Object> queryTbProductForAdmin(TbProductQueryCriteria criteria){
|
||||
|
|
@ -49,12 +52,15 @@ public class TbProductController {
|
|||
public Object queryTbProductInfo(@PathVariable("product") Integer product)throws Exception{
|
||||
return tbProductService.findByProductId(product);
|
||||
}
|
||||
|
||||
@GetMapping ("/productList")
|
||||
@ApiOperation("查询/product")
|
||||
public Object queryTbProductInfo(@RequestParam List<String> productList){
|
||||
return tbProductService.findByProductList(productList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/upProSort")
|
||||
@ApiOperation("修改商品排序")
|
||||
public ResponseEntity<Object> upProSort(@RequestBody TbProductSortCriteria param){
|
||||
|
|
|
|||
|
|
@ -36,12 +36,12 @@ public class TbProductGroupController {
|
|||
@Resource
|
||||
private TbProductService tbProductService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('tbProductGroup:list')")
|
||||
public void exportTbProductGroup(HttpServletResponse response, TbProductGroupQueryCriteria criteria) throws IOException {
|
||||
tbProductGroupService.download(tbProductGroupService.queryAll(criteria), response);
|
||||
}
|
||||
// @ApiOperation("导出数据")
|
||||
// @GetMapping(value = "/download")
|
||||
// @PreAuthorize("@el.check('tbProductGroup:list')")
|
||||
// public void exportTbProductGroup(HttpServletResponse response, TbProductGroupQueryCriteria criteria) throws IOException {
|
||||
// tbProductGroupService.download(tbProductGroupService.queryAll(criteria), response);
|
||||
// }
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询product/group")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.dto.shop.*;
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopOpenId;
|
||||
import cn.ysk.cashier.pojo.shop.TbFullShopId;
|
||||
import cn.ysk.cashier.service.shop.MsgService;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/msg")
|
||||
public class MsgController {
|
||||
|
||||
|
||||
private final MsgService msgService;
|
||||
|
||||
public MsgController(MsgService msgService) {
|
||||
this.msgService = msgService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有订阅消息用户
|
||||
* @return
|
||||
*/
|
||||
@AnonymousAccess
|
||||
|
||||
@GetMapping("/all")
|
||||
public ResponseEntity<Page<TbFullShopId>> all(
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size,
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam(required = false) String nickName,
|
||||
@RequestParam(required = false) String openId,
|
||||
@RequestParam(required = false) Integer state,
|
||||
@RequestParam(required = false) Integer type
|
||||
) {
|
||||
Page<TbFullShopId> all = msgService.all(page, size, shopId, nickName, openId, state, type);
|
||||
return ResponseEntity.ok(all);
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@PutMapping("/shopState")
|
||||
public ResponseEntity<Boolean> shopMsgState(
|
||||
@Valid @RequestBody ShopMsgStateDTO shopMsgStateDTO
|
||||
) {
|
||||
return ResponseEntity.of(msgService.updateShopState(shopMsgStateDTO));
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Boolean> removeSubUser(
|
||||
@Valid @RequestBody ShopMsgRemoveDTO shopMsgRemoveDTO
|
||||
) {
|
||||
return ResponseEntity.of(msgService.removeSubUser(shopMsgRemoveDTO));
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@PutMapping("/info")
|
||||
public ResponseEntity<Boolean> updateInfo(
|
||||
@Valid @RequestBody ShopInfoUpdateDTO shopInfoUpdateDTO
|
||||
) {
|
||||
return ResponseEntity.of(msgService.updateInfo(shopInfoUpdateDTO));
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@GetMapping("/state")
|
||||
public ResponseEntity<HashMap<String, Object>> updateInfo(
|
||||
@RequestParam Integer shopId
|
||||
) {
|
||||
return ResponseEntity.ok(msgService.getInfo(shopId, null));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
|
||||
import cn.ysk.cashier.dto.ShopSummaryDto;
|
||||
import cn.ysk.cashier.service.SummaryService;
|
||||
import cn.ysk.cashier.vo.TbOrderPayCountVo;
|
||||
|
|
@ -41,10 +42,8 @@ public class SummaryByDayController {
|
|||
}
|
||||
|
||||
@GetMapping(value = "count")
|
||||
public List<TbOrderPayCountVo> summaryCount(@RequestParam String shopId,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
|
||||
return summaryService.summaryCount(shopId, startTime, endTime);
|
||||
public List<TbOrderPayCountVo> summaryCount(ShopSummaryDto summaryDto) {
|
||||
return summaryService.summaryCount(summaryDto);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,13 +2,11 @@ package cn.ysk.cashier.controller.shop;
|
|||
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousGetMapping;
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
|
||||
import cn.ysk.cashier.dto.ShopSummaryDto;
|
||||
import cn.ysk.cashier.dto.shop.ShopTableSeleInfoDto;
|
||||
import cn.ysk.cashier.dto.BaseQueryDto;
|
||||
import cn.ysk.cashier.dto.shop.ShopTableSaleInfoDto;
|
||||
import cn.ysk.cashier.service.SummaryService;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
|
@ -26,11 +24,20 @@ public class SummaryController {
|
|||
@Resource
|
||||
private SummaryService summaryService;
|
||||
|
||||
@GetMapping
|
||||
private Object shopSummary(@RequestParam Integer shopId) {
|
||||
return summaryService.selectSummary(shopId);
|
||||
|
||||
@PostMapping("/trade")
|
||||
@AnonymousPostMapping
|
||||
private Object shopSummaryDate(@RequestBody BaseQueryDto param) {
|
||||
return summaryService.trade(param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @GetMapping
|
||||
// private Object shopSummary(@RequestParam Integer shopId) {
|
||||
// return summaryService.selectSummary(shopId);
|
||||
// }
|
||||
|
||||
@GetMapping("/date")
|
||||
private Object shopSummaryDate(@RequestParam Integer shopId, @RequestParam Integer day) {
|
||||
return summaryService.selectSummaryDate(shopId, day);
|
||||
|
|
@ -59,6 +66,7 @@ public class SummaryController {
|
|||
}
|
||||
|
||||
@GetMapping("/table")
|
||||
@AnonymousGetMapping
|
||||
private Object shopSummaryTable(@RequestParam Integer shopId,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date startTime,
|
||||
@RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date endTime) {
|
||||
|
|
@ -66,8 +74,9 @@ public class SummaryController {
|
|||
}
|
||||
|
||||
@PostMapping("/table/download")
|
||||
private void downloadShopSummaryTable(HttpServletResponse response, @RequestBody ShopTableSeleInfoDto exportRequest) throws IOException {
|
||||
summaryService.downloadTableSeleInfo(exportRequest, response);
|
||||
@AnonymousPostMapping
|
||||
private void downloadShopSummaryTable(HttpServletResponse response, @RequestBody ShopTableSaleInfoDto exportRequest) throws IOException {
|
||||
summaryService.downloadTableSaleInfo(exportRequest, response);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ public class TbDeviceStockController {
|
|||
throw new RuntimeException("请先添加台桌");
|
||||
}
|
||||
|
||||
if (downloadDto.getCount() > (shopTables.size() * 2)) {
|
||||
throw new RuntimeException("最多可获取台桌数量的2倍");
|
||||
if (downloadDto.getCount() > 500) {
|
||||
throw new RuntimeException("最多可获取500个");
|
||||
}
|
||||
|
||||
TbDeviceStock lastRecord = tbDeviceStockService.findLastRecord();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.dto.shop.TbShopAdDto;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopAdService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/ad")
|
||||
public class TbShopAdController {
|
||||
final private TbShopAdService tbShopAdService;
|
||||
|
||||
@PostMapping
|
||||
public ResponseEntity<Object> createTbShopAd(@RequestBody TbShopAdDto adDto) {
|
||||
return tbShopAdService.createTbShopAd(adDto);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public ResponseEntity<Object> updateTbShopAd(@RequestBody TbShopAdDto adDto) {
|
||||
return tbShopAdService.updateTbShopAd(adDto);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{adId}")
|
||||
public ResponseEntity<Object> deleteTbShopAd(@PathVariable Integer adId) {
|
||||
return tbShopAdService.deleteTbShopAd(adId);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ResponseEntity<Object> getTbShopAd(@RequestParam Map<String, Object> params) {
|
||||
return tbShopAdService.getTbShopAd(params);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,9 @@
|
|||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousDeleteMapping;
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousGetMapping;
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousPutMapping;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopExtend;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopExtendService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
|
@ -35,38 +32,37 @@ public class TbShopExtendController {
|
|||
|
||||
@GetMapping
|
||||
@ApiOperation("分页查询")
|
||||
@AnonymousGetMapping
|
||||
public ResponseEntity<Object> selectAll(TbShopExtendQueryCriteria criteria) {
|
||||
return new ResponseEntity<>(tbShopExtendService.queryAll(criteria), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("通过Id查询详情")
|
||||
@AnonymousGetMapping
|
||||
public TbShopExtend selectOne(@PathVariable Serializable id) {
|
||||
return tbShopExtendService.getById(id);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增")
|
||||
@AnonymousPostMapping
|
||||
public ResponseEntity<Object> insert(@RequestBody TbShopExtend tbShopExtend) {
|
||||
tbShopExtend.setCreateTime(new Date());
|
||||
return new ResponseEntity<>(tbShopExtendService.save(tbShopExtend), HttpStatus.CREATED);
|
||||
tbShopExtendService.saveInfo(tbShopExtend);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("通过id修改")
|
||||
@AnonymousPutMapping
|
||||
public ResponseEntity<Object> update(@RequestBody TbShopExtend tbShopExtend) {
|
||||
tbShopExtend.setUpdateTime(new Date());
|
||||
tbShopExtendService.updateById(tbShopExtend);
|
||||
if (tbShopExtend.getId() != null) {
|
||||
tbShopExtendService.updateById(tbShopExtend);
|
||||
} else {
|
||||
tbShopExtendService.saveInfo(tbShopExtend);
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
@AnonymousDeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestParam("idList") List<Long> idList) {
|
||||
tbShopExtendService.removeByIds(idList);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
|
|
|||
|
|
@ -15,11 +15,15 @@
|
|||
*/
|
||||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.dto.shoptable.AddCartDTO;
|
||||
import cn.ysk.cashier.dto.shoptable.ClearCartDTO;
|
||||
import cn.ysk.cashier.dto.shoptable.RemoveCartDTO;
|
||||
import cn.ysk.cashier.dto.shoptable.TableGenerateDTO;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopTable;
|
||||
import cn.ysk.cashier.service.shop.TbShopTableService;
|
||||
import cn.ysk.cashier.dto.shop.TbShopTableQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
|
@ -84,4 +88,16 @@ public class TbShopTableController {
|
|||
tbShopTableService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/generate")
|
||||
@ApiOperation("查询/shop/table")
|
||||
public ResponseEntity<Object> generate(@Validated @RequestBody TableGenerateDTO generateDTO){
|
||||
if (generateDTO.getStart() >= generateDTO.getEnd()){
|
||||
return ResponseEntity.badRequest().body("起始数不能大于结束数");
|
||||
}
|
||||
return new ResponseEntity<>(tbShopTableService.generate(generateDTO),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import cn.ysk.cashier.dto.shop.TbShopRechargeListDto;
|
|||
import cn.ysk.cashier.dto.shop.TbShopUserQueryCriteria;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.mybatis.service.TbMShopUserService;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopUserFlowService;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopUser;
|
||||
import cn.ysk.cashier.service.shop.TbShopUserService;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
|
|
@ -36,6 +38,9 @@ public class TbShopUserController {
|
|||
private final TbShopUserService tbShopUserService;
|
||||
private final TbMShopUserService tbMShopUserService;
|
||||
|
||||
private final TbShopUserFlowService tbShopUserFlowService;
|
||||
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportTbShopUser(HttpServletResponse response, TbShopUserQueryCriteria criteria) throws IOException {
|
||||
|
|
@ -50,7 +55,6 @@ public class TbShopUserController {
|
|||
|
||||
@GetMapping("queryAllShopUser")
|
||||
@ApiOperation("查询商家用户")
|
||||
@AnonymousGetMapping
|
||||
public ResponseEntity<Object> queryAllShopUser(TbShopUserQueryCriteria criteria) {
|
||||
return new ResponseEntity<>(tbShopUserService.queryShopUser(criteria), HttpStatus.OK);
|
||||
}
|
||||
|
|
@ -96,4 +100,18 @@ public class TbShopUserController {
|
|||
public void rechargeListDownload(HttpServletResponse response, @RequestBody TbShopRechargeListDto criteria) throws IOException {
|
||||
tbShopUserService.rechargeListDownload(response, criteria);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("midfiyAccount")
|
||||
@ApiOperation("增加扣减会员余额")
|
||||
public ResponseEntity<Object> midfiyAccount(@RequestBody Map<String,Object> map){
|
||||
tbShopUserService.modfiyAccount(map);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("queryShopUserFlow")
|
||||
public ResponseEntity<Object> queryShopUserFlow(@RequestParam("userId") Integer userId,@RequestParam("page") Integer page,@RequestParam("pageSize") Integer pageSize){
|
||||
return new ResponseEntity<>( tbShopUserFlowService.selectByUserId(userId, page, pageSize),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package cn.ysk.cashier.dto;
|
||||
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.util.Date;
|
||||
|
||||
public class BaseQueryDto {
|
||||
private Integer shopId;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date endTime;
|
||||
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public Date getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package cn.ysk.cashier.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ScanPayDTO {
|
||||
private Integer shopId;
|
||||
private Integer orderId;
|
||||
private String authCode;
|
||||
}
|
||||
|
|
@ -19,7 +19,9 @@ public class ShopSummaryDto {
|
|||
}
|
||||
|
||||
public void setCateId(String cateId) {
|
||||
this.cateId = cateId;
|
||||
if(StringUtils.isNotBlank(cateId)){
|
||||
this.cateId = cateId;
|
||||
}
|
||||
}
|
||||
|
||||
public String getShopId() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package cn.ysk.cashier.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表(TbActivateProduct)表查询类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
*/
|
||||
@Data
|
||||
public class TbActivateProductQueryCriteria {
|
||||
|
||||
private Integer id;
|
||||
//活动Id
|
||||
private Integer activateId;
|
||||
//商品id
|
||||
private Integer productId;
|
||||
//数量
|
||||
private Integer num;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
private long page;
|
||||
private long size;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package cn.ysk.cashier.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@Data
|
||||
public class TbMiniAppPagesDto {
|
||||
private Integer id;
|
||||
private Integer shopId;
|
||||
private String name;
|
||||
private String path;
|
||||
private String icon;
|
||||
private String description;
|
||||
private Integer sort;
|
||||
private Integer status;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@ public class TbVersionDto implements Serializable {
|
|||
|
||||
private Integer id;
|
||||
|
||||
/** LDBL_APP;WX; */
|
||||
/** PC;APP; */
|
||||
private String source;
|
||||
|
||||
/** ios;android; */
|
||||
|
|
@ -22,9 +22,12 @@ public class TbVersionDto implements Serializable {
|
|||
|
||||
/** 版本号 */
|
||||
private String version;
|
||||
/** 下载地址 */
|
||||
private String url;
|
||||
|
||||
/** 0:不更新;1:更新 */
|
||||
/** 是否强制更新 0:否 1:是 */
|
||||
private Integer isUp;
|
||||
private Integer sel;
|
||||
|
||||
/** 更新提示内容 */
|
||||
private String message;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import lombok.Data;
|
|||
public class TbVersionQueryCriteria{
|
||||
|
||||
@Query
|
||||
/** LDBL-APP;WX; */
|
||||
/** PC;APP; */
|
||||
private String source;
|
||||
@Query
|
||||
/** ios;android; */
|
||||
|
|
@ -21,7 +21,7 @@ public class TbVersionQueryCriteria{
|
|||
/** 版本号 */
|
||||
private String version;
|
||||
@Query
|
||||
/** 0:不更新;1:更新 */
|
||||
/** 是否强制更新 0:否 1:是*/
|
||||
private Integer isUp;
|
||||
|
||||
private Integer pageSize;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package cn.ysk.cashier.dto.calltable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class BaseCallTableDTO {
|
||||
@NotNull
|
||||
private Integer callTableId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package cn.ysk.cashier.dto.calltable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class CallQueueDTO{
|
||||
@NotNull
|
||||
private Integer callQueueId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
package cn.ysk.cashier.dto.calltable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class CallTableDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotEmpty
|
||||
private String name;
|
||||
private String note;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer waitTime;
|
||||
@NotBlank
|
||||
private String prefix;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer start;
|
||||
@Min(1)
|
||||
private Integer nearNum;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.dto.calltable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class TakeNumberDTO extends BaseCallTableDTO{
|
||||
private Integer userId;
|
||||
private String phone;
|
||||
private String note;
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.dto.calltable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Getter
|
||||
public class UpdateCallQueueDTO extends CallQueueDTO{
|
||||
@NotNull
|
||||
private Byte state;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package cn.ysk.cashier.dto.calltable;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class UpdateCallTableDTO{
|
||||
@NotNull
|
||||
private Integer callTableId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
private String name;
|
||||
private String note;
|
||||
@Min(1)
|
||||
private Integer waitTime;
|
||||
private String prefix;
|
||||
@Min(1)
|
||||
private Integer start;
|
||||
@Min(1)
|
||||
private Integer nearNum;
|
||||
}
|
||||
|
|
@ -59,4 +59,7 @@ public class TbOrderDetailDto implements Serializable {
|
|||
|
||||
/** 打包费 */
|
||||
private BigDecimal packAmount;
|
||||
|
||||
private Integer isVip;
|
||||
|
||||
}
|
||||
|
|
@ -70,6 +70,8 @@ public class TbOrderInfoQueryCriteria{
|
|||
@Query(type = Query.Type.BETWEEN)
|
||||
private List<Long> createdAt;
|
||||
|
||||
private Integer userId;
|
||||
|
||||
|
||||
@Query
|
||||
private String tableName;
|
||||
|
|
@ -79,4 +81,18 @@ public class TbOrderInfoQueryCriteria{
|
|||
public void setProductName(String productName) {
|
||||
if(StringUtils.isNotBlank(productName)) this.productName = productName;
|
||||
}
|
||||
|
||||
public Integer getPage() {
|
||||
if (page == null) {
|
||||
return 0;
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
public Integer getPageSize() {
|
||||
if (pageSize == null) {
|
||||
return 10;
|
||||
}
|
||||
return pageSize;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,12 +9,15 @@ import javax.persistence.Id;
|
|||
public class StockCountDTO {
|
||||
private String shopId;
|
||||
@Id
|
||||
private Long skuId;
|
||||
private Long proId;
|
||||
private String proName;
|
||||
private Integer isStock;
|
||||
private String skuName;
|
||||
private String unitName;
|
||||
// 消耗数
|
||||
private Integer stockCount;
|
||||
// 当前库存
|
||||
private Integer stockNumber;
|
||||
private String specSnap;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package cn.ysk.cashier.dto.product;
|
||||
|
||||
import cn.ysk.cashier.annotation.Query;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
|
@ -11,6 +12,7 @@ public class StockQueryDto {
|
|||
private Double num;
|
||||
private Integer isStock;
|
||||
private String categoryId;
|
||||
private String sort;
|
||||
|
||||
public void setName(String name) {
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
|
|
|
|||
|
|
@ -1,22 +1,10 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
package cn.ysk.cashier.dto.product;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -60,4 +48,10 @@ public class TbProductGroupDto implements Serializable {
|
|||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
private Integer useTime;
|
||||
|
||||
private String saleStartTime;
|
||||
|
||||
private String saleEndTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package cn.ysk.cashier.dto.rabbit;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StockRecordMsg {
|
||||
private Integer shopId;
|
||||
private Integer skuId;
|
||||
private Integer productId;
|
||||
private String type;
|
||||
private Integer subType;
|
||||
private Integer number;
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package cn.ysk.cashier.dto.shop;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ShopInfoUpdateDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotNull
|
||||
private String openId;
|
||||
private String note;
|
||||
@Range(min = 0, max = 1)
|
||||
private Integer state;
|
||||
private Integer type;
|
||||
private String nickName;
|
||||
private String avatar;
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package cn.ysk.cashier.dto.shop;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ShopMsgRemoveDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotBlank
|
||||
private String openId;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.dto.shop;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ShopMsgStateDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@Range(min = 0, max = 1)
|
||||
private Integer state;
|
||||
private Integer type;
|
||||
}
|
||||
|
|
@ -9,7 +9,7 @@ import java.util.Date;
|
|||
* @author GYJ
|
||||
*/
|
||||
@Data
|
||||
public class ShopTableSeleInfoDto {
|
||||
public class ShopTableSaleInfoDto {
|
||||
private Integer shopId;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package cn.ysk.cashier.dto.shop;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ShopTypeDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotNull
|
||||
private Integer type;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.dto.shop;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ShopUserMsgState {
|
||||
@NotNull
|
||||
private Integer state;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotNull
|
||||
private Integer id;
|
||||
}
|
||||
|
|
@ -49,6 +49,8 @@ public class TbPlussShopStaffDto implements Serializable {
|
|||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
private String discountType;
|
||||
|
||||
/** 最大优惠金额 */
|
||||
private BigDecimal maxDiscountAmount;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,40 @@
|
|||
package cn.ysk.cashier.dto.shop;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopAd;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@Data
|
||||
public class TbShopAdDto {
|
||||
private Integer id;
|
||||
private Integer shopId;
|
||||
private String imgUrl;
|
||||
private String linkPath;
|
||||
private Integer borderRadius;
|
||||
private String showPosition;
|
||||
private String frequency;
|
||||
private Integer status;
|
||||
private Integer sort;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
public TbShopAd convertToTbShopAd() {
|
||||
TbShopAd tbShopAd = new TbShopAd();
|
||||
tbShopAd.setId(this.id);
|
||||
tbShopAd.setShopId(this.shopId);
|
||||
tbShopAd.setImgUrl(this.imgUrl);
|
||||
tbShopAd.setLinkPath(this.linkPath);
|
||||
tbShopAd.setBorderRadius(this.borderRadius);
|
||||
tbShopAd.setShowPosition(this.showPosition);
|
||||
tbShopAd.setFrequency(this.frequency);
|
||||
tbShopAd.setStatus(this.status);
|
||||
tbShopAd.setSort(this.sort);
|
||||
tbShopAd.setCreateTime(this.createTime);
|
||||
tbShopAd.setUpdateTime(this.updateTime);
|
||||
return tbShopAd;
|
||||
}
|
||||
}
|
||||
|
|
@ -23,6 +23,7 @@ import javax.persistence.Column;
|
|||
import javax.validation.constraints.NotBlank;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
|
|
@ -186,4 +187,16 @@ public class TbShopInfoDto implements Serializable {
|
|||
private String districts;
|
||||
|
||||
private String cities;
|
||||
|
||||
private String isCustom;
|
||||
|
||||
private String isReturn;
|
||||
private String isMemberIn;
|
||||
private String isMemberReturn;
|
||||
private Integer isTableFee;
|
||||
private BigDecimal tableFee;
|
||||
private List<String> eatModel;
|
||||
//程序码(零点八零首页)
|
||||
private String smallQrcode;
|
||||
private String paymentQrcode;
|
||||
}
|
||||
|
|
@ -36,4 +36,7 @@ public class TbShopTableQueryCriteria{
|
|||
|
||||
@Query
|
||||
private Integer areaId;
|
||||
}
|
||||
|
||||
@Query
|
||||
private Long qrcode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class AddCartDTO {
|
||||
@NotEmpty
|
||||
private String masterId;
|
||||
private Integer vipUserId;
|
||||
@NotNull
|
||||
private Integer productId;
|
||||
@NotNull
|
||||
private Integer skuId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotEmpty
|
||||
private String tableId;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer num;
|
||||
private boolean isPack;
|
||||
private boolean isGift;
|
||||
private Integer cartId;
|
||||
private String note;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class BaseTableDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotEmpty
|
||||
private String tableId;
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class CarDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ChoseCountDTO {
|
||||
@NotEmpty
|
||||
private String masterId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotEmpty
|
||||
private String tableId;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer num;
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ChoseTableDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
private Integer orderId;
|
||||
@NotNull
|
||||
private String newTableId;
|
||||
@NotEmpty
|
||||
private String oldTableId;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ClearCartDTO {
|
||||
@NotEmpty
|
||||
private String masterId;
|
||||
private Integer vipUserId;
|
||||
@NotNull
|
||||
private Long tableId;
|
||||
@NotNull
|
||||
private String shopId;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class CreateOrderDTO {
|
||||
@NotEmpty
|
||||
private String masterId;
|
||||
private Integer vipUserId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotEmpty
|
||||
private String tableId;
|
||||
private String note;
|
||||
private boolean postPay;
|
||||
private Integer orderId;
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DeleteOrderDTO {
|
||||
private Integer shopId;
|
||||
private Integer orderId;
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class PackCartDTO {
|
||||
@NotEmpty
|
||||
private String masterId;
|
||||
private Integer vipUserId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotEmpty
|
||||
private String tableId;
|
||||
@NotNull
|
||||
@Range(min = 0, max = 1)
|
||||
private Integer state;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class PayDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotNull
|
||||
private Integer orderId;
|
||||
@NotEmpty
|
||||
private String payType;
|
||||
@Min(0)
|
||||
@Max(1)
|
||||
private Double discount;
|
||||
private Integer vipUserId;
|
||||
private String code;
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
import org.bouncycastle.asn1.cmc.PendInfo;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class PendingDTO {
|
||||
private String masterId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
private String tableId;
|
||||
private Integer vipUserId;
|
||||
@NotNull
|
||||
private Boolean isPending;
|
||||
private Integer orderId;
|
||||
private String note;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class RemoveCartDTO {
|
||||
@NotNull
|
||||
private Integer cartId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotNull
|
||||
private Long tableId;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class ReturnOrderDTO {
|
||||
@NotNull
|
||||
private Integer cartId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotNull
|
||||
private Long tableId;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class TableGenerateDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotEmpty
|
||||
private String sign;
|
||||
private Integer areaId;
|
||||
@Min(1)
|
||||
@NotNull
|
||||
private Integer start;
|
||||
@Min(2)
|
||||
@Max(1000)
|
||||
@NotNull
|
||||
private Integer end;
|
||||
@NotNull
|
||||
@Min(1)
|
||||
private Integer capacity;
|
||||
private Integer autoClear = 1;
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class UpdateCartDTO {
|
||||
@NotNull
|
||||
private Integer cartId;
|
||||
@NotNull
|
||||
private Integer skuId;
|
||||
@NotNull
|
||||
private Integer productId;
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotNull
|
||||
@Min(0)
|
||||
private Integer num;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package cn.ysk.cashier.dto.shoptable;
|
||||
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Range;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class UpdateVipDTO {
|
||||
@NotNull
|
||||
private Integer shopId;
|
||||
@NotEmpty
|
||||
private String tableId;
|
||||
@NotNull
|
||||
private String masterId;
|
||||
|
||||
private Integer vipUserId;
|
||||
@NotNull
|
||||
@Range(min = 0, max = 1)
|
||||
private Integer type;
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package cn.ysk.cashier.enums;
|
||||
|
||||
public enum ShopWxMsgTypeEnum {
|
||||
ALL_MSG(-1),
|
||||
STOCK_MSG(0),
|
||||
CONSUMABLES_MSG(1),
|
||||
OPERATION_MSG(2);
|
||||
private final Integer type;
|
||||
|
||||
ShopWxMsgTypeEnum(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.enums;
|
||||
|
||||
public enum TableStateEnum {
|
||||
IDLE("idle"),
|
||||
CLOSED("closed"), PAYING("paying"), PENDING("pending"), USING("using"), CLEANING("cleaning");
|
||||
private String state = "closed";
|
||||
|
||||
TableStateEnum(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,8 +18,13 @@ package cn.ysk.cashier.mapper.shop;
|
|||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopInfo;
|
||||
import cn.ysk.cashier.dto.shop.TbShopInfoDto;
|
||||
import cn.ysk.cashier.utils.ListUtil;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
|
|
@ -29,4 +34,19 @@ import org.mapstruct.ReportingPolicy;
|
|||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbShopInfoMapper extends BaseMapper<TbShopInfoDto, TbShopInfo> {
|
||||
|
||||
// 自定义的字符串到整数列表的转换方法
|
||||
default List<String> map(String value) {
|
||||
return ListUtil.stringChangeStringList(value);
|
||||
}
|
||||
|
||||
// 如果需要从DTO转回实体,也可能需要实现反向的映射方法
|
||||
default String map(List<String> values) {
|
||||
if (!CollectionUtils.isEmpty(values)) {
|
||||
return "";
|
||||
}
|
||||
// 将整数列表转换为由逗号分隔的字符串
|
||||
return values.stream()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package cn.ysk.cashier.mybatis.Handler;
|
||||
|
||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||
import org.apache.ibatis.reflection.MetaObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Component
|
||||
public class MyMetaObjectHandler implements MetaObjectHandler {
|
||||
|
||||
@Override
|
||||
public void insertFill(MetaObject metaObject) {
|
||||
this.strictInsertFill(metaObject, "createTime", Date.class, new Date());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateFill(MetaObject metaObject) {
|
||||
this.strictUpdateFill(metaObject, "updateTime", Date.class, new Date());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
|
@ -8,6 +9,7 @@ import lombok.Data;
|
|||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
@ -22,4 +24,8 @@ public class Activate extends Model<Activate> {
|
|||
private BigDecimal handselNum;
|
||||
private String handselType;
|
||||
private String isDel;
|
||||
//是否赠送商品 0否 1是
|
||||
private Integer isGiftPro;
|
||||
@TableField(exist = false)
|
||||
private List<TbActivateProduct> products;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package cn.ysk.cashier.mybatis.entity;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
|
@ -12,6 +14,7 @@ import java.io.Serializable;
|
|||
@SuppressWarnings("serial")
|
||||
public class TagProductDepts extends Model<TagProductDepts> {
|
||||
//标签id
|
||||
@TableId(value = "tagId", type = IdType.NONE)
|
||||
private Integer tagId;
|
||||
//商品id
|
||||
private Integer productId;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_activate")
|
||||
public class TbActivate {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "shop_id")
|
||||
private Integer shopId;
|
||||
|
||||
@Column(name = "min_num")
|
||||
private Integer minNum;
|
||||
|
||||
@Column(name = "max_num")
|
||||
private Integer maxNum;
|
||||
|
||||
@Column(name = "handsel_num", precision = 10, scale = 2)
|
||||
private BigDecimal handselNum;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "handsel_type", length = 20)
|
||||
private String handselType;
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "is_del", length = 20)
|
||||
private String isDel;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "is_user")
|
||||
private String isUser;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,119 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 活动商品赠送表(TbActivateInRecord)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-22 14:50:16
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
||||
|
||||
private Integer id;
|
||||
//会员id
|
||||
private Integer vipUserId;
|
||||
//商品id
|
||||
private Integer proId;
|
||||
//赠送数量
|
||||
private Integer num;
|
||||
//未使用数量
|
||||
private Integer overNum;
|
||||
//店铺id
|
||||
private Integer shopId;
|
||||
//来源活动id
|
||||
private Integer sourceActId;
|
||||
|
||||
private Integer sourceFlowId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getVipUserId() {
|
||||
return vipUserId;
|
||||
}
|
||||
|
||||
public void setVipUserId(Integer vipUserId) {
|
||||
this.vipUserId = vipUserId;
|
||||
}
|
||||
|
||||
public Integer getProId() {
|
||||
return proId;
|
||||
}
|
||||
|
||||
public void setProId(Integer proId) {
|
||||
this.proId = proId;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public Integer getOverNum() {
|
||||
return overNum;
|
||||
}
|
||||
|
||||
public void setOverNum(Integer overNum) {
|
||||
this.overNum = overNum;
|
||||
}
|
||||
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public Integer getSourceActId() {
|
||||
return sourceActId;
|
||||
}
|
||||
|
||||
public void setSourceActId(Integer sourceActId) {
|
||||
this.sourceActId = sourceActId;
|
||||
}
|
||||
|
||||
public Integer getSourceFlowId() {
|
||||
return sourceFlowId;
|
||||
}
|
||||
|
||||
public void setSourceFlowId(Integer sourceFlowId) {
|
||||
this.sourceFlowId = sourceFlowId;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 活动赠送商品使用记录表(TbActivateOutRecord)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-22 14:53:52
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivateOutRecord extends Model<TbActivateOutRecord> {
|
||||
|
||||
private Integer id;
|
||||
//商品赠送Id
|
||||
private Integer giveId;
|
||||
//商品id
|
||||
private Integer proId;
|
||||
//未使用数量
|
||||
private Integer useNum;
|
||||
//退单量
|
||||
private Integer refNum;
|
||||
//订单id
|
||||
private String orderId;
|
||||
//新建: create, 完成: closed, 取消:cancel,
|
||||
private String status;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getGiveId() {
|
||||
return giveId;
|
||||
}
|
||||
|
||||
public void setGiveId(Integer giveId) {
|
||||
this.giveId = giveId;
|
||||
}
|
||||
|
||||
public Integer getProId() {
|
||||
return proId;
|
||||
}
|
||||
|
||||
public void setProId(Integer proId) {
|
||||
this.proId = proId;
|
||||
}
|
||||
|
||||
public Integer getUseNum() {
|
||||
return useNum;
|
||||
}
|
||||
|
||||
public void setUseNum(Integer useNum) {
|
||||
this.useNum = useNum;
|
||||
}
|
||||
|
||||
public Integer getRefNum() {
|
||||
return refNum;
|
||||
}
|
||||
|
||||
public void setRefNum(Integer refNum) {
|
||||
this.refNum = refNum;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表(TbActivateProduct)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivateProduct extends Model<TbActivateProduct> {
|
||||
|
||||
private Integer id;
|
||||
//活动Id
|
||||
private Integer activateId;
|
||||
//商品id
|
||||
private Integer productId;
|
||||
//数量
|
||||
private Integer num;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getActivateId() {
|
||||
return activateId;
|
||||
}
|
||||
|
||||
public void setActivateId(Integer activateId) {
|
||||
this.activateId = activateId;
|
||||
}
|
||||
|
||||
public Integer getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setProductId(Integer productId) {
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_call_queue")
|
||||
public class TbCallQueue {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "call_table_id")
|
||||
private Integer callTableId;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "phone")
|
||||
private String phone;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "name")
|
||||
private String name;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "shop_name")
|
||||
private String shopName;
|
||||
|
||||
@Column(name = "shop_id")
|
||||
private Integer shopId;
|
||||
|
||||
@Column(name = "state")
|
||||
private Byte state;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Instant createTime;
|
||||
|
||||
@Column(name = "call_time")
|
||||
private Instant callTime;
|
||||
|
||||
@Column(name = "call_count")
|
||||
private Integer callCount;
|
||||
|
||||
@Column(name = "pass_time")
|
||||
private Instant passTime;
|
||||
|
||||
@Column(name = "cancel_time")
|
||||
private Instant cancelTime;
|
||||
|
||||
@Column(name = "confirm_time")
|
||||
private Instant confirmTime;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "note")
|
||||
private String note;
|
||||
|
||||
@Column(name = "user_id")
|
||||
private Integer userId;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "open_id")
|
||||
private String openId;
|
||||
|
||||
@Column(name = "sub_state")
|
||||
private Integer subState;
|
||||
|
||||
@Column(name = "call_num")
|
||||
private String callNum;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_call_table")
|
||||
public class TbCallTable {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "name")
|
||||
private String name;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "note")
|
||||
private String note;
|
||||
|
||||
@Column(name = "wait_time")
|
||||
private Integer waitTime;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "prefix")
|
||||
private String prefix;
|
||||
|
||||
@Column(name = "start")
|
||||
private Integer start;
|
||||
|
||||
@Column(name = "near_num")
|
||||
private Integer nearNum;
|
||||
|
||||
@Column(name = "state")
|
||||
private Byte state;
|
||||
|
||||
@Column(name = "shop_id")
|
||||
private Integer shopId;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "qrcode")
|
||||
private String qrcode;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Instant createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
private Instant updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("tb_mini_app_pages")
|
||||
public class TbMiniAppPages extends Model<TbMiniAppPages> {
|
||||
private Integer id;
|
||||
private String icon;
|
||||
private String name;
|
||||
private String path;
|
||||
private String description;
|
||||
private Integer status;
|
||||
private Integer sort;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author GYJ
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("tb_shop_ad")
|
||||
public class TbShopAd extends Model<TbShopAd> {
|
||||
private Integer id;
|
||||
private Integer shopId;
|
||||
private String imgUrl;
|
||||
private String linkPath;
|
||||
private Integer borderRadius;
|
||||
private String showPosition;
|
||||
private String frequency;
|
||||
private Integer status;
|
||||
private Integer sort;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package cn.ysk.cashier.mybatis.entity;
|
|||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -18,11 +19,13 @@ public class TbShopExtend extends Model<TbShopExtend> {
|
|||
//商户Id
|
||||
private Integer shopId;
|
||||
//img:图片;text:文本;
|
||||
private String name;
|
||||
private String type;
|
||||
//自定义key
|
||||
private String autokey;
|
||||
//值
|
||||
private String value;
|
||||
private String detail;
|
||||
//更新时间
|
||||
private Date updateTime;
|
||||
//创建时间
|
||||
|
|
@ -53,6 +56,14 @@ public class TbShopExtend extends Model<TbShopExtend> {
|
|||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getAutokey() {
|
||||
return autokey;
|
||||
}
|
||||
|
|
@ -84,5 +95,51 @@ public class TbShopExtend extends Model<TbShopExtend> {
|
|||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
|
||||
public String getDetail() {
|
||||
return detail;
|
||||
}
|
||||
|
||||
public void setDetail(String detail) {
|
||||
this.detail = detail;
|
||||
}
|
||||
|
||||
/**
|
||||
* index_bg:店铺首页背景图
|
||||
* my_bg: 我的页面背景图
|
||||
* member_bg:会员卡页面背景图
|
||||
* shopinfo_bg:商品列表顶部背景图
|
||||
* @param autokey
|
||||
*/
|
||||
public void initAutoKey(String autokey,Integer shopId) {
|
||||
if (StringUtils.isBlank(name)) {
|
||||
switch (autokey) {
|
||||
case "index_bg":
|
||||
this.name = "店铺首页背景图";
|
||||
this.detail="建议尺寸: 375*600 ";
|
||||
this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/indexs/shuangbackground.png";
|
||||
break;
|
||||
case "my_bg":
|
||||
this.name = "我的页面背景图";
|
||||
this.detail="建议尺寸: 375*200";
|
||||
this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/my/myTopBack.png";
|
||||
break;
|
||||
case "member_bg":
|
||||
this.name = "会员卡页面背景图";
|
||||
this.detail="建议尺寸: 315*152";
|
||||
this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/menber/member_bg.png";
|
||||
break;
|
||||
case "shopinfo_bg":
|
||||
this.name = "商品列表顶部背景图";
|
||||
this.detail="建议尺寸: 375*120";
|
||||
this.value = "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/shopDetails/topBanner.png";
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.type="img";
|
||||
this.shopId=shopId;
|
||||
this.autokey = autokey;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_shop_msg_state")
|
||||
public class TbShopMsgState {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "shop_id")
|
||||
private Integer shopId;
|
||||
|
||||
@Column(name = "type")
|
||||
private Integer type;
|
||||
|
||||
@Column(name = "state")
|
||||
private Integer state;
|
||||
|
||||
@Column(name = "create_time")
|
||||
private Instant createTime;
|
||||
|
||||
@Column(name = "update_time")
|
||||
private Instant updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -1,59 +1,51 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* 商家openid信息表
|
||||
* @TableName tb_shop_open_id
|
||||
*/
|
||||
@Table(name="tb_shop_open_id")
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class TbShopOpenId implements Serializable {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.Instant;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_shop_open_id")
|
||||
public class TbShopOpenId {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
@Column(name = "shop_id")
|
||||
private Integer shopId;
|
||||
|
||||
/**
|
||||
* 已经订阅消息的商家微信号
|
||||
*/
|
||||
@Size(max = 5000)
|
||||
@Column(name = "open_id", length = 5000)
|
||||
private String openId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Column(name = "status")
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
@Column(name = "create_time")
|
||||
private Instant createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
@Column(name = "update_time")
|
||||
private Instant updateTime;
|
||||
|
||||
/**
|
||||
* 类型 -1 任意消息 0库存预警
|
||||
*/
|
||||
@Column(name = "type")
|
||||
private Integer type;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
@Size(max = 255)
|
||||
@Column(name = "nickname")
|
||||
private String nickname;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "avatar")
|
||||
private String avatar;
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "note")
|
||||
private String note;
|
||||
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue