1.增加mybatisplus依赖

This commit is contained in:
SongZhang 2024-08-20 17:03:51 +08:00
parent 796f43299f
commit d8027c92b2
3 changed files with 78 additions and 38 deletions

90
pom.xml
View File

@ -48,11 +48,11 @@
<artifactId>hutool-all</artifactId>
<version>4.5.18</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- <version>1.2.9</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.alibaba</groupId>-->
<!-- <artifactId>fastjson</artifactId>-->
<!-- <version>1.2.9</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
@ -69,11 +69,10 @@
<version>1.9.4</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.7</version>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
@ -186,30 +185,57 @@
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
<version>3.3.1</version>
<exclusions>
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.3.1</version>
<exclusions>
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<!-- <profiles>-->
<!-- <profile>-->
<!-- <id>dev</id>-->
<!-- <properties>-->
<!-- <env>dev</env>-->
<!-- </properties>-->
<!-- <activation>-->
<!-- <activeByDefault>true</activeByDefault>-->
<!-- </activation>-->
<!-- </profile>-->
<!-- <profile>-->
<!-- <id>test</id>-->
<!-- <properties>-->
<!-- <env>test</env>-->
<!-- </properties>-->
<!-- </profile>-->
<!-- <profile>-->
<!-- <id>pro</id>-->
<!-- <properties>-->
<!-- <env>pro</env>-->
<!-- </properties>-->
<!-- </profile>-->
<!-- </profiles>-->
<!-- <profiles>-->
<!-- <profile>-->
<!-- <id>dev</id>-->
<!-- <properties>-->
<!-- <env>dev</env>-->
<!-- </properties>-->
<!-- <activation>-->
<!-- <activeByDefault>true</activeByDefault>-->
<!-- </activation>-->
<!-- </profile>-->
<!-- <profile>-->
<!-- <id>test</id>-->
<!-- <properties>-->
<!-- <env>test</env>-->
<!-- </properties>-->
<!-- </profile>-->
<!-- <profile>-->
<!-- <id>pro</id>-->
<!-- <properties>-->
<!-- <env>pro</env>-->
<!-- </properties>-->
<!-- </profile>-->
<!-- </profiles>-->
<build>
<plugins>

View File

@ -141,10 +141,10 @@ public class OrderService {
if ((StrUtil.isNotBlank(tableId))) {
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaUpdateWrapper<TbShopTable>()
.eq(TbShopTable::getQrcode, tableId)
.eq(TbShopTable::getStatus, "opening"));
.in(TbShopTable::getStatus, "idle", "opening"));
if (shopTable == null) {
return Result.fail("台桌不存在或未开台");
return Result.fail("台桌不处于开台或空闲状态");
}
}
@ -389,14 +389,19 @@ public class OrderService {
}
int orderId = 0;
String uuid = "";
ArrayList<Integer> ids = new ArrayList<>();
for (TbCashierCart cashierCart : list) {
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
orderId = Integer.parseInt(cashierCart.getOrderId());
}
cashierCart.setStatus("create");
ids.add(cashierCart.getId());
}
mpCashierCartMapper.insertOrUpdate(list);
// mpCashierCartMapper.insertOrUpdate(list);
// cashierCartMapper.updateStatusByMaster(Integer.valueOf(shopId), masterId, "create", day, uuid);
mpCashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
.set(TbCashierCart::getStatus, "create")
.in(TbCashierCart::getId, ids));
if (orderId > 0) {
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
orderDetailMapper.updateStatusByOrderId(orderId, "cancelled");
@ -908,13 +913,19 @@ public class OrderService {
return Result.fail(CodeEnum.CARTJH);
}
int orderId = 0;
ArrayList<Integer> ids = new ArrayList<>();
for (TbCashierCart cashierCart : list) {
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
orderId = Integer.parseInt(cashierCart.getOrderId());
}
cashierCart.setStatus("create");
ids.add(cashierCart.getId());
// cashierCart.setStatus("create");
// }
}
mpCashierCartMapper.insertOrUpdate(list);
mpCashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
.set(TbCashierCart::getStatus, "create")
.in(TbCashierCart::getId, ids));
// cashierCartMapper.updateStatusByMaster(shopId, masterId, "create", day, uuid);
if (orderId > 0) {
tbOrderInfoMapper.updateStatusById(orderId, "cancelled");

View File

@ -57,5 +57,8 @@ wx:
warnMsgTmpId: C08OUr80x6wGmUN1zpFhSQ3Sv7VF5vksdZigiEx2pD0
mybatis-plus:
global-config:
db-config:
id-type: auto