54 Commits

Author SHA1 Message Date
1157d4eb16 商品校验调整 2024-11-19 16:47:05 +08:00
51c160aa26 商品校验调整 2024-11-19 16:37:03 +08:00
2fce514c38 商品字段调整 2024-11-19 10:25:21 +08:00
d1aa03b2ba 打包时 跳过单元测试 2024-11-18 15:37:07 +08:00
5bf6bc4fed 商品多余字段删除 2024-11-18 15:16:52 +08:00
张松
be8c796254 fix: 订单详情增加是否会员价字段标识 2024-11-18 13:56:44 +08:00
2fffee3c55 活动赠送券 来源字段 2024-11-13 18:08:26 +08:00
张松
7a8ae2b5bc fix: 订单保存先付费后付费 2024-11-13 13:24:03 +08:00
张松
25f86bf5fe feat: 订单保存amount金额 2024-11-13 10:26:02 +08:00
张松
cdfd5a625f Merge remote-tracking branch 'origin/test' into test 2024-11-12 18:18:06 +08:00
张松
8b66dba411 feat: 空订单删除 2024-11-12 18:17:46 +08:00
6834a313cc 优惠券 字段修改为浮点数 2024-11-12 10:44:45 +08:00
谭凯凯
9304543b96 储值送积分活动 2024-11-09 09:55:16 +08:00
8bf63d821d 充值活动 满足金额 2024-11-08 17:25:26 +08:00
张松
0d8052d620 feat: 会员价根据店铺设置返回 2024-11-07 16:10:57 +08:00
张松
af1f990c73 fix: 外带不校验餐位费 2024-11-07 11:21:03 +08:00
张松
d448e25fc8 fix: 只选择餐位费不允许创建订单 2024-11-07 11:11:56 +08:00
张松
873aa9fc89 fix: 只选择餐位费不允许创建订单 2024-11-07 11:08:21 +08:00
张松
68a8f6d3c5 fix: 只选择餐位费不允许创建订单 2024-11-07 11:07:53 +08:00
张松
6fd8a4f7d0 fix: 只选择餐位费不允许创建订单 2024-11-07 11:02:35 +08:00
张松
7b333543a7 feat: 空订单直接删除 2024-11-07 10:48:54 +08:00
张松
9d43ce2fc1 feat: 空订单直接删除 2024-11-07 10:44:41 +08:00
张松
896667018a feat: 1. 添加商品会员价 2.空订单直接删除 2024-11-07 10:25:52 +08:00
谭凯凯
635ebb138f 交班BUG修复 2024-11-06 16:14:26 +08:00
Tankaikai
81941984b6 Merge remote-tracking branch 'origin/dev' into test 2024-11-04 13:59:35 +08:00
谭凯凯
79601b6877 解决飞蛾打印机切刀bug 2024-11-04 13:58:57 +08:00
f0ebdd9b55 fix: 放开打票语音提示 2024-11-01 15:59:14 +08:00
d783ac93d0 fix: 数据库没有tickLogo字段修复 2024-11-01 10:35:03 +08:00
c04d8faabd 店铺信息 增加小票logo返回 2024-11-01 10:02:31 +08:00
efe907d9af fix: 购物车状态统一 2024-10-31 09:42:28 +08:00
0b93b474ec fix: 外带模式下单次数修复 2024-10-30 15:22:27 +08:00
5d3ba8e014 Merge branch 'refs/heads/dev' into test 2024-10-30 11:17:34 +08:00
79c1d9ecc4 fix: 1.购物车返回金额修改 2.支付完成购物车状态未更新修复 2024-10-30 11:17:08 +08:00
b3264ad1b3 Merge branch 'refs/heads/dev' into test 2024-10-30 10:40:17 +08:00
15a4537bfd feat: 1.餐位费允许增减数量 2.选择人数根据店铺配置决定是否操作 2024-10-30 10:39:11 +08:00
d2e1174646 订单状态统一 2024-10-29 17:21:50 +08:00
fe7e8d4ed9 fix: 创建订单修改 2024-10-29 16:28:34 +08:00
a531fa2445 Merge remote-tracking branch 'origin/dev' into dev 2024-10-29 16:22:08 +08:00
a3c364030d fix: 台桌关联订单查询修改 2024-10-29 16:21:59 +08:00
Tankaikai
fd87a1f2e3 Merge remote-tracking branch 'origin/dev' into test 2024-10-29 16:05:54 +08:00
Tankaikai
a2354d7d08 Merge remote-tracking branch 'origin/dev' into dev 2024-10-29 16:05:26 +08:00
谭凯凯
bd3687329e 小票打印bug修复 2024-10-29 16:05:17 +08:00
89be4ba654 Merge remote-tracking branch 'origin/dev' into dev 2024-10-29 16:00:00 +08:00
0863764b5e feat: 购物车全为退款订单清空购物车 2024-10-29 15:59:50 +08:00
Tankaikai
c438c7f250 Merge remote-tracking branch 'origin/dev' into test 2024-10-29 14:29:06 +08:00
谭凯凯
4f2e4e7f2e 修复收银机充值异常缺陷 2024-10-29 14:24:55 +08:00
谭凯凯
7765758c9b 收银机支付异常添加错误日志 2024-10-29 14:08:05 +08:00
谭凯凯
93e43a2cf7 小票打印bug修复 2024-10-29 13:38:58 +08:00
Tankaikai
a5fd421147 Merge remote-tracking branch 'origin/dev' into dev 2024-10-29 13:22:08 +08:00
谭凯凯
345ec77279 小票打印bug修复 2024-10-29 11:48:02 +08:00
7c3c77bc4b fix: 台桌模式创建订单报错修复 2024-10-29 11:35:11 +08:00
Tankaikai
16e57907ba Merge remote-tracking branch 'origin/dev' into test 2024-10-26 10:50:43 +08:00
Tankaikai
8896f1760b Merge remote-tracking branch 'origin/dev' into test 2024-10-25 18:07:37 +08:00
cbdbe16cd0 多余内容删除
充值会员优惠券赠送
店铺信息增加字段
2024-10-24 16:53:37 +08:00
103 changed files with 3511 additions and 6540 deletions

View File

@@ -14,6 +14,7 @@
<version>1.0.0</version> <version>1.0.0</version>
<properties> <properties>
<skipTests>true</skipTests>
<maven.compiler.source>8</maven.compiler.source> <maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target> <maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

View File

@@ -1,6 +1,168 @@
package com.chaozhanggui.system.cashierservice.bean.constant; package com.chaozhanggui.system.cashierservice.bean.constant;
import lombok.Getter;
import java.util.Objects;
public interface TableConstant { public interface TableConstant {
String CART_SEAT_ID = "-999"; String CART_SEAT_ID = "-999";
@Getter
enum Status {
REFUNDING("refunding"), REFUND("refund"), CLOSED("closed"), CREATE("create"),
UNPAID("unpaid"), PAYING("paying"), RETURN("return"), CANCELLED("cancelled");
private final String value;
Status(String value) {
this.value = value;
}
public boolean equalsVals(String value) {
return this.value.equals(value);
}
}
class ShopTable {
@Getter
public enum State {
IDLE("idle"), CLOSED("closed"), PAYING("paying"), PENDING("pending"), USING("using"), CLEANING("cleaning");
private final String value;
State(String value) {
this.value = value;
}
}
}
class OrderInfo {
@Getter
public enum Status {
REFUNDING("refunding"), REFUND("refund"), CLOSED("closed"), CREATE("create"),
UNPAID("unpaid"), PAYING("paying"), RETURN("return");
private final String value;
Status(String value) {
this.value = value;
}
public boolean equalsVals(String value) {
return this.value.equals(value);
}
}
@Getter
public enum UseType {
TAKEOUT("takeout"),
DINE_IN_AFTER("dine-in-after"),
DINE_IN_BEFORE("dine-in-before");
private final String value;
UseType(String value) {
this.value = value;
}
public boolean equalsVals(String value) {
return this.value.equals(value);
}
}
}
class CashierCart {
public static final String ID = "-999";
@Getter
public enum Status {
REFUNDING("refunding"), REFUND("refund"), CLOSED("closed"), CREATE("create"),
UNPAID("unpaid"), PAYING("paying"), RETURN("return"), CANCEL("cancel");
private final String value;
Status(String value) {
this.value = value;
}
public boolean equalsVals(String value) {
return this.value.equals(value);
}
}
@Getter
public enum UseType {
TAKEOUT("takeout"),
DINE_IN_AFTER("dine-in-after"),
DINE_IN_BEFORE("dine-in-before");
private final String value;
UseType(String value) {
this.value = value;
}
public boolean equalsVals(String value) {
return this.value.equals(value);
}
}
}
class ShopInfo {
@Getter
public enum EatModel {
TAKEOUT("takeout"),
DINE_IN("dine-in");
private final String value;
EatModel(String value) {
this.value = value;
}
public boolean equalsVals(String value) {
return this.value.equals(value);
}
}
}
class MemberIn {
@Getter
public enum Type {
NORMAL(0),
FREE_DINE(1);
private final Integer value;
Type(Integer value) {
this.value = value;
}
public boolean equalsVals(Integer value) {
return Objects.equals(this.value, value);
}
}
}
class ActivateOutRecord {
@Getter
public enum Type {
// 满减
FULL_REDUCTION(1),
// 商品
PRODUCT(2);
private final Integer value;
Type(Integer value) {
this.value = value;
}
public boolean equalsVals(Integer value) {
return Objects.equals(this.value, value);
}
}
@Getter
public enum Status {
CREATE("create"),
CANCEL("cancel"),
// 商品
CLOSED("closed");
private final String value;
Status(String value) {
this.value = value;
}
public boolean equalsVals(String value) {
return this.value.equals(value);
}
}
}
} }

View File

@@ -75,6 +75,7 @@ public class MemberController {
try { try {
return memberService.memberAccountPay(map, token); return memberService.memberAccountPay(map, token);
} catch (Exception e) { } catch (Exception e) {
log.error("》》》》》》》》》》账户支付异常:",e);
e.printStackTrace(); e.printStackTrace();
} }
return Result.fail(CodeEnum.SYS_EXCEPTION); return Result.fail(CodeEnum.SYS_EXCEPTION);

View File

@@ -213,6 +213,9 @@ public class OrderController {
*/ */
@PutMapping("/choseCount") @PutMapping("/choseCount")
public Result choseCount(@Validated @RequestBody ChoseCountDTO choseCountDTO) { public Result choseCount(@Validated @RequestBody ChoseCountDTO choseCountDTO) {
if (choseCountDTO.getNum() == null) {
return Result.success(CodeEnum.SUCCESS);
}
return Result.success(CodeEnum.SUCCESS, orderService.choseCount(choseCountDTO)); return Result.success(CodeEnum.SUCCESS, orderService.choseCount(choseCountDTO));
} }

View File

@@ -263,11 +263,6 @@ public class PayController {
return payService.returnGroupOrder(param); return payService.returnGroupOrder(param);
} }
@RequestMapping("test")
@LimitSubmit(key = "testOrder:%s")
public Result testOrder(@RequestParam("orderId") String orderId) {
return Result.success(CodeEnum.SUCCESS);
}
@RequestMapping("getOrderDiscount") @RequestMapping("getOrderDiscount")
public Result getOrderDiscount(@RequestHeader("token") String token, public Result getOrderDiscount(@RequestHeader("token") String token,

View File

@@ -1,17 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.CodeColumnConfig;
public interface CodeColumnConfigMapper {
int deleteByPrimaryKey(Long columnId);
int insert(CodeColumnConfig record);
int insertSelective(CodeColumnConfig record);
CodeColumnConfig selectByPrimaryKey(Long columnId);
int updateByPrimaryKeySelective(CodeColumnConfig record);
int updateByPrimaryKey(CodeColumnConfig record);
}

View File

@@ -1,17 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.CodeGenConfig;
public interface CodeGenConfigMapper {
int deleteByPrimaryKey(Long configId);
int insert(CodeGenConfig record);
int insertSelective(CodeGenConfig record);
CodeGenConfig selectByPrimaryKey(Long configId);
int updateByPrimaryKeySelective(CodeGenConfig record);
int updateByPrimaryKey(CodeGenConfig record);
}

View File

@@ -1,17 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.MntApp;
public interface MntAppMapper {
int deleteByPrimaryKey(Long appId);
int insert(MntApp record);
int insertSelective(MntApp record);
MntApp selectByPrimaryKey(Long appId);
int updateByPrimaryKeySelective(MntApp record);
int updateByPrimaryKey(MntApp record);
}

View File

@@ -1,17 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.MntDatabase;
public interface MntDatabaseMapper {
int deleteByPrimaryKey(String dbId);
int insert(MntDatabase record);
int insertSelective(MntDatabase record);
MntDatabase selectByPrimaryKey(String dbId);
int updateByPrimaryKeySelective(MntDatabase record);
int updateByPrimaryKey(MntDatabase record);
}

View File

@@ -1,17 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.MntDeployHistory;
public interface MntDeployHistoryMapper {
int deleteByPrimaryKey(String historyId);
int insert(MntDeployHistory record);
int insertSelective(MntDeployHistory record);
MntDeployHistory selectByPrimaryKey(String historyId);
int updateByPrimaryKeySelective(MntDeployHistory record);
int updateByPrimaryKey(MntDeployHistory record);
}

View File

@@ -1,17 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.MntDeploy;
public interface MntDeployMapper {
int deleteByPrimaryKey(Long deployId);
int insert(MntDeploy record);
int insertSelective(MntDeploy record);
MntDeploy selectByPrimaryKey(Long deployId);
int updateByPrimaryKeySelective(MntDeploy record);
int updateByPrimaryKey(MntDeploy record);
}

View File

@@ -1,11 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.MntDeployServerKey;
public interface MntDeployServerMapper {
int deleteByPrimaryKey(MntDeployServerKey key);
int insert(MntDeployServerKey record);
int insertSelective(MntDeployServerKey record);
}

View File

@@ -1,17 +0,0 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.MntServer;
public interface MntServerMapper {
int deleteByPrimaryKey(Long serverId);
int insert(MntServer record);
int insertSelective(MntServer record);
MntServer selectByPrimaryKey(Long serverId);
int updateByPrimaryKeySelective(MntServer record);
int updateByPrimaryKey(MntServer record);
}

View File

@@ -0,0 +1,68 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbActivateInRecord;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* 活动商品赠送记录表(TbActivateInRecord)表数据库访问层
*
* @author ww
* @since 2024-10-24 15:55:01
*/
public interface TbActivateInRecordMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbActivateInRecord queryById(Integer id);
/**
* 查询数据
*
* @param tbActivateInRecord 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbActivateInRecord> queryAll(TbActivateInRecord tbActivateInRecord, @Param("pageable") Pageable pageable);
/**
* 新增数据
*
* @param tbActivateInRecord 实例对象
* @return 影响行数
*/
int insert(TbActivateInRecord tbActivateInRecord);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbActivateInRecord> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbActivateInRecord> entities);
/**
* 修改数据
*
* @param tbActivateInRecord 实例对象
* @return 影响行数
*/
int update(TbActivateInRecord tbActivateInRecord);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

@@ -1,27 +1,77 @@
package com.chaozhanggui.system.cashierservice.dao; package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbActivate; import com.chaozhanggui.system.cashierservice.entity.TbActivate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component; import org.springframework.data.domain.Pageable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@Component /**
@Mapper * (TbActivate)表数据库访问层
*
* @author ww
* @since 2024-10-23 09:57:47
*/
public interface TbActivateMapper { public interface TbActivateMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbActivate record); /**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbActivate queryById(Integer id);
int insertSelective(TbActivate record); /**
* 查询数据
*
* @param tbActivate 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbActivate> queryAll(TbActivate tbActivate, @Param("pageable") Pageable pageable);
TbActivate selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbActivate record); /**
* 新增数据
*
* @param tbActivate 实例对象
* @return 影响行数
*/
int insert(TbActivate tbActivate);
int updateByPrimaryKey(TbActivate record); /**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbActivate> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbActivate> entities);
/**
* 修改数据
*
* @param tbActivate 实例对象
* @return 影响行数
*/
int update(TbActivate tbActivate);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
TbActivate selectByAmount(@Param("shopId") String shopId, @Param("amount") BigDecimal amount); TbActivate selectByAmount(@Param("shopId") String shopId, @Param("amount") BigDecimal amount);
}
TbActivate selectByAmountScope(@Param("shopId") String shopId,@Param("amount") BigDecimal amount);
int updateMemberPoints(@Param("memberId") Long memberId,@Param("points") Integer points);
int insertMemberPointsLog(Map<String,Object> params);
}

View File

@@ -0,0 +1,68 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbActivateOutRecord;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* 活动赠送商品使用记录表(TbActivateOutRecord)表数据库访问层
*
* @author ww
* @since 2024-10-24 15:55:23
*/
public interface TbActivateOutRecordMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbActivateOutRecord queryById(Integer id);
/**
* 查询数据
*
* @param tbActivateOutRecord 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbActivateOutRecord> queryAll(TbActivateOutRecord tbActivateOutRecord, @Param("pageable") Pageable pageable);
/**
* 新增数据
*
* @param tbActivateOutRecord 实例对象
* @return 影响行数
*/
int insert(TbActivateOutRecord tbActivateOutRecord);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbActivateOutRecord> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbActivateOutRecord> entities);
/**
* 修改数据
*
* @param tbActivateOutRecord 实例对象
* @return 影响行数
*/
int update(TbActivateOutRecord tbActivateOutRecord);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

@@ -0,0 +1,69 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbCouponProduct;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* 活动赠送商品表(TbCouponProduct)表数据库访问层
*
* @author ww
* @since 2024-10-24 15:56:08
*/
public interface TbCouponProductMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbCouponProduct queryById(Integer id);
/**
* 查询数据
*
* @param tbCouponProduct 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbCouponProduct> queryAll(TbCouponProduct tbCouponProduct, @Param("pageable") Pageable pageable);
List<TbCouponProduct> queryAllByCouponId(Integer couponId);
/**
* 新增数据
*
* @param tbCouponProduct 实例对象
* @return 影响行数
*/
int insert(TbCouponProduct tbCouponProduct);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbCouponProduct> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbCouponProduct> entities);
/**
* 修改数据
*
* @param tbCouponProduct 实例对象
* @return 影响行数
*/
int update(TbCouponProduct tbCouponProduct);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

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

View File

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

View File

@@ -1,45 +1,26 @@
package com.chaozhanggui.system.cashierservice.dao; package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbProduct; import com.chaozhanggui.system.cashierservice.entity.TbProduct;
import com.chaozhanggui.system.cashierservice.entity.TbProductWithBLOBs;
import com.chaozhanggui.system.cashierservice.entity.po.ProConsSkuInfo; import com.chaozhanggui.system.cashierservice.entity.po.ProConsSkuInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
public interface TbProductMapper { public interface TbProductMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbProductWithBLOBs record); TbProduct selectByPrimaryKey(Integer id);
int insertSelective(TbProductWithBLOBs record);
TbProductWithBLOBs selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbProductWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(TbProductWithBLOBs record);
int updateByPrimaryKey(TbProduct record);
List<TbProductWithBLOBs> selectByShopId(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
List<TbProductWithBLOBs> selectByShopIdAndCheckGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
List<TbProductWithBLOBs> selectByShopIdAndShopType(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName);
List<TbProductWithBLOBs> selectByShopIdAndShopTypeCheckGrounding(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName);
List<TbProductWithBLOBs> selectByShopIdAndShopTypeUnGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
List<TbProduct> selectByShopId(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
List<TbProduct> selectByShopIdAndCheckGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
List<TbProduct> selectByShopIdAndShopType(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName);
List<TbProduct> selectByShopIdAndShopTypeCheckGrounding(@Param("shopId") String shopId, @Param("categoryId") String categoryId,@Param("commdityName") String commdityName);
List<TbProduct> selectByShopIdAndShopTypeUnGrounding(@Param("shopId") String shopId,@Param("commdityName") String commdityName);
Integer countOrderByshopIdAndProductId(@Param("shopId") String shopId, @Param("productId") String productId, @Param("masterId") String masterId,@Param("day") String day, @Param("tableId") String tableId); Integer countOrderByshopIdAndProductId(@Param("shopId") String shopId, @Param("productId") String productId, @Param("masterId") String masterId,@Param("day") String day, @Param("tableId") String tableId);
@Update("update tb_product set stock_number = stock_number - #{num,jdbcType=INTEGER} where id = #{productId}")
void updateStockById(@Param("productId")Integer productId, @Param("num")Integer num); void updateStockById(@Param("productId")Integer productId, @Param("num")Integer num);

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,68 @@
package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbShopCoupon;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Pageable;
import java.util.List;
/**
* 优惠券(TbShopCoupon)表数据库访问层
*
* @author ww
* @since 2024-10-24 15:52:58
*/
public interface TbShopCouponMapper {
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
TbShopCoupon queryById(Integer id);
/**
* 查询数据
*
* @param tbShopCoupon 查询条件
* @param pageable 分页对象
* @return 对象列表
*/
List<TbShopCoupon> queryAll(TbShopCoupon tbShopCoupon, @Param("pageable") Pageable pageable);
/**
* 新增数据
*
* @param tbShopCoupon 实例对象
* @return 影响行数
*/
int insert(TbShopCoupon tbShopCoupon);
/**
* 批量新增数据MyBatis原生foreach方法
*
* @param entities List<TbShopCoupon> 实例对象列表
* @return 影响行数
*/
int insertBatch(@Param("entities") List<TbShopCoupon> entities);
/**
* 修改数据
*
* @param tbShopCoupon 实例对象
* @return 影响行数
*/
int update(TbShopCoupon tbShopCoupon);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 影响行数
*/
int deleteById(Integer id);
}

View File

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

View File

@@ -1,30 +1,18 @@
package com.chaozhanggui.system.cashierservice.dao; package com.chaozhanggui.system.cashierservice.dao;
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo; import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
public interface TbShopInfoMapper { public interface TbShopInfoMapper {
int deleteByPrimaryKey(Integer id);
int insert(TbShopInfo record);
int insertSelective(TbShopInfo record);
TbShopInfo selectByPrimaryKey(Integer id); TbShopInfo selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(TbShopInfo record);
int updateByPrimaryKeyWithBLOBs(TbShopInfo record);
int updateByPrimaryKey(TbShopInfo record);
List<TbShopInfo> selectAll(); List<TbShopInfo> selectAll();
List<TbShopInfo> selectAllByCreateTime(); List<TbShopInfo> selectAllByCreateTime();
String getTicketLogo(Integer shopId);
} }

View File

@@ -1,147 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
public class CodeColumnConfig implements Serializable {
private Long columnId;
private String tableName;
private String columnName;
private String columnType;
private String dictName;
private String extra;
private Boolean formShow;
private String formType;
private String keyType;
private Boolean listShow;
private Boolean notNull;
private String queryType;
private String remark;
private String dateAnnotation;
private static final long serialVersionUID = 1L;
public Long getColumnId() {
return columnId;
}
public void setColumnId(Long columnId) {
this.columnId = columnId;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName == null ? null : tableName.trim();
}
public String getColumnName() {
return columnName;
}
public void setColumnName(String columnName) {
this.columnName = columnName == null ? null : columnName.trim();
}
public String getColumnType() {
return columnType;
}
public void setColumnType(String columnType) {
this.columnType = columnType == null ? null : columnType.trim();
}
public String getDictName() {
return dictName;
}
public void setDictName(String dictName) {
this.dictName = dictName == null ? null : dictName.trim();
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra == null ? null : extra.trim();
}
public Boolean getFormShow() {
return formShow;
}
public void setFormShow(Boolean formShow) {
this.formShow = formShow;
}
public String getFormType() {
return formType;
}
public void setFormType(String formType) {
this.formType = formType == null ? null : formType.trim();
}
public String getKeyType() {
return keyType;
}
public void setKeyType(String keyType) {
this.keyType = keyType == null ? null : keyType.trim();
}
public Boolean getListShow() {
return listShow;
}
public void setListShow(Boolean listShow) {
this.listShow = listShow;
}
public Boolean getNotNull() {
return notNull;
}
public void setNotNull(Boolean notNull) {
this.notNull = notNull;
}
public String getQueryType() {
return queryType;
}
public void setQueryType(String queryType) {
this.queryType = queryType == null ? null : queryType.trim();
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getDateAnnotation() {
return dateAnnotation;
}
public void setDateAnnotation(String dateAnnotation) {
this.dateAnnotation = dateAnnotation == null ? null : dateAnnotation.trim();
}
}

View File

@@ -1,107 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
public class CodeGenConfig implements Serializable {
private Long configId;
private String tableName;
private String author;
private Boolean cover;
private String moduleName;
private String pack;
private String path;
private String apiPath;
private String prefix;
private String apiAlias;
private static final long serialVersionUID = 1L;
public Long getConfigId() {
return configId;
}
public void setConfigId(Long configId) {
this.configId = configId;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName == null ? null : tableName.trim();
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author == null ? null : author.trim();
}
public Boolean getCover() {
return cover;
}
public void setCover(Boolean cover) {
this.cover = cover;
}
public String getModuleName() {
return moduleName;
}
public void setModuleName(String moduleName) {
this.moduleName = moduleName == null ? null : moduleName.trim();
}
public String getPack() {
return pack;
}
public void setPack(String pack) {
this.pack = pack == null ? null : pack.trim();
}
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path == null ? null : path.trim();
}
public String getApiPath() {
return apiPath;
}
public void setApiPath(String apiPath) {
this.apiPath = apiPath == null ? null : apiPath.trim();
}
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix == null ? null : prefix.trim();
}
public String getApiAlias() {
return apiAlias;
}
public void setApiAlias(String apiAlias) {
this.apiAlias = apiAlias == null ? null : apiAlias.trim();
}
}

View File

@@ -1,128 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class MntApp implements Serializable {
private Long appId;
private String name;
private String uploadPath;
private String deployPath;
private String backupPath;
private Integer port;
private String startScript;
private String deployScript;
private String createBy;
private String updateBy;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Long getAppId() {
return appId;
}
public void setAppId(Long appId) {
this.appId = appId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getUploadPath() {
return uploadPath;
}
public void setUploadPath(String uploadPath) {
this.uploadPath = uploadPath == null ? null : uploadPath.trim();
}
public String getDeployPath() {
return deployPath;
}
public void setDeployPath(String deployPath) {
this.deployPath = deployPath == null ? null : deployPath.trim();
}
public String getBackupPath() {
return backupPath;
}
public void setBackupPath(String backupPath) {
this.backupPath = backupPath == null ? null : backupPath.trim();
}
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public String getStartScript() {
return startScript;
}
public void setStartScript(String startScript) {
this.startScript = startScript == null ? null : startScript.trim();
}
public String getDeployScript() {
return deployScript;
}
public void setDeployScript(String deployScript) {
this.deployScript = deployScript == null ? null : deployScript.trim();
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -1,98 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class MntDatabase implements Serializable {
private String dbId;
private String name;
private String jdbcUrl;
private String userName;
private String pwd;
private String createBy;
private String updateBy;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public String getDbId() {
return dbId;
}
public void setDbId(String dbId) {
this.dbId = dbId == null ? null : dbId.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getJdbcUrl() {
return jdbcUrl;
}
public void setJdbcUrl(String jdbcUrl) {
this.jdbcUrl = jdbcUrl == null ? null : jdbcUrl.trim();
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName == null ? null : userName.trim();
}
public String getPwd() {
return pwd;
}
public void setPwd(String pwd) {
this.pwd = pwd == null ? null : pwd.trim();
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -1,68 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class MntDeploy implements Serializable {
private Long deployId;
private Long appId;
private String createBy;
private String updateBy;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Long getDeployId() {
return deployId;
}
public void setDeployId(Long deployId) {
this.deployId = deployId;
}
public Long getAppId() {
return appId;
}
public void setAppId(Long appId) {
this.appId = appId;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -1,68 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class MntDeployHistory implements Serializable {
private String historyId;
private String appName;
private Date deployDate;
private String deployUser;
private String ip;
private Long deployId;
private static final long serialVersionUID = 1L;
public String getHistoryId() {
return historyId;
}
public void setHistoryId(String historyId) {
this.historyId = historyId == null ? null : historyId.trim();
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName == null ? null : appName.trim();
}
public Date getDeployDate() {
return deployDate;
}
public void setDeployDate(Date deployDate) {
this.deployDate = deployDate;
}
public String getDeployUser() {
return deployUser;
}
public void setDeployUser(String deployUser) {
this.deployUser = deployUser == null ? null : deployUser.trim();
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip == null ? null : ip.trim();
}
public Long getDeployId() {
return deployId;
}
public void setDeployId(Long deployId) {
this.deployId = deployId;
}
}

View File

@@ -1,27 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
public class MntDeployServerKey implements Serializable {
private Long deployId;
private Long serverId;
private static final long serialVersionUID = 1L;
public Long getDeployId() {
return deployId;
}
public void setDeployId(Long deployId) {
this.deployId = deployId;
}
public Long getServerId() {
return serverId;
}
public void setServerId(Long serverId) {
this.serverId = serverId;
}
}

View File

@@ -1,108 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class MntServer implements Serializable {
private Long serverId;
private String account;
private String ip;
private String name;
private String password;
private Integer port;
private String createBy;
private String updateBy;
private Date createTime;
private Date updateTime;
private static final long serialVersionUID = 1L;
public Long getServerId() {
return serverId;
}
public void setServerId(Long serverId) {
this.serverId = serverId;
}
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account == null ? null : account.trim();
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip == null ? null : ip.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password == null ? null : password.trim();
}
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy == null ? null : createBy.trim();
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy == null ? null : updateBy.trim();
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@@ -1,24 +1,49 @@
package com.chaozhanggui.system.cashierservice.entity; package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.util.Date;
/**
* (TbActivate)实体类
*
* @author ww
* @since 2024-10-23 09:57:13
*/
public class TbActivate implements Serializable { public class TbActivate implements Serializable {
private static final long serialVersionUID = -45208765530510891L;
private Integer id; private Integer id;
private Integer shopId; private Integer shopId;
/**
* 充值金额
*/
private Integer amount;
/**
* 赠送金额
*/
private Integer giftAmount;
/**
* 赠送积分
*/
private Integer giftPoints;
/**
* 是否使用优惠卷 0否 1是
*/
private Integer isUseCoupon;
/**
* 优惠卷id
*/
private Integer couponId;
/**
* 优惠卷数量
*/
private Integer num;
private Integer minNum; private Date createTime;
private Integer maxNum; private Date updateTime;
private BigDecimal handselNum;
private String handselType;
private String isDel;
private static final long serialVersionUID = 1L;
public Integer getId() { public Integer getId() {
return id; return id;
@@ -36,43 +61,68 @@ public class TbActivate implements Serializable {
this.shopId = shopId; this.shopId = shopId;
} }
public Integer getMinNum() { public Integer getAmount() {
return minNum; return amount;
} }
public void setMinNum(Integer minNum) { public void setAmount(Integer amount) {
this.minNum = minNum; this.amount = amount;
} }
public Integer getMaxNum() { public Integer getGiftAmount() {
return maxNum; return giftAmount;
} }
public void setMaxNum(Integer maxNum) { public void setGiftAmount(Integer giftAmount) {
this.maxNum = maxNum; this.giftAmount = giftAmount;
} }
public BigDecimal getHandselNum() { public Integer getIsUseCoupon() {
return handselNum; return isUseCoupon;
} }
public void setHandselNum(BigDecimal handselNum) { public void setIsUseCoupon(Integer isUseCoupon) {
this.handselNum = handselNum; this.isUseCoupon = isUseCoupon;
} }
public String getHandselType() { public Integer getCouponId() {
return handselType; return couponId;
} }
public void setHandselType(String handselType) { public void setCouponId(Integer couponId) {
this.handselType = handselType == null ? null : handselType.trim(); this.couponId = couponId;
} }
public String getIsDel() { public Integer getNum() {
return isDel; return num;
} }
public void setIsDel(String isDel) { public void setNum(Integer num) {
this.isDel = isDel == null ? null : isDel.trim(); 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;
}
public Integer getGiftPoints() {
return giftPoints;
}
public void setGiftPoints(Integer giftPoints) {
this.giftPoints = giftPoints;
}
}

View File

@@ -0,0 +1,233 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;
/**
* 活动商品赠送记录表(TbActivateInRecord)实体类
*
* @author ww
* @since 2024-10-24 15:55:01
*/
public class TbActivateInRecord implements Serializable {
private static final long serialVersionUID = -87516247063601097L;
private Integer id;
/**
* 会员id
*/
private Integer vipUserId;
/**
* 卷Id (校验是否可用)
*/
private Integer couponId;
/**
* 卷描述 满10减2/商品卷
*/
private String name;
/**
* 1-满减 2-商品
*/
private Integer type;
/**
* 商品id
*/
private Integer proId;
/**
* 满多少金额
*/
private BigDecimal fullAmount;
/**
* 减多少金额
*/
private BigDecimal discountAmount;
/**
* 赠送数量
*/
private Integer num;
/**
* 未使用数量
*/
private Integer overNum;
/**
* 店铺id
*/
private Integer shopId;
/**
* 来源活动id
*/
private Integer sourceActId;
private Integer sourceFlowId;
/**
* 可用开始时间
*/
private Date useStartTime;
/**
* 可用结束时间
*/
private Date useEndTime;
private Date createTime;
private Date updateTime;
private String couponJson;
private String source;
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 getCouponId() {
return couponId;
}
public void setCouponId(Integer couponId) {
this.couponId = couponId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public Integer getProId() {
return proId;
}
public void setProId(Integer proId) {
this.proId = proId;
}
public BigDecimal getFullAmount() {
return fullAmount;
}
public void setFullAmount(BigDecimal fullAmount) {
this.fullAmount = fullAmount;
}
public BigDecimal getDiscountAmount() {
return discountAmount;
}
public void setDiscountAmount(BigDecimal discountAmount) {
this.discountAmount = discountAmount;
}
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 getUseStartTime() {
return useStartTime;
}
public void setUseStartTime(Date useStartTime) {
this.useStartTime = useStartTime;
}
public Date getUseEndTime() {
return useEndTime;
}
public void setUseEndTime(Date useEndTime) {
this.useEndTime = useEndTime;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getCouponJson() {
return couponJson;
}
public void setCouponJson(String couponJson) {
this.couponJson = couponJson;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
}

View File

@@ -0,0 +1,141 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.util.Date;
import java.io.Serializable;
/**
* 活动赠送商品使用记录表(TbActivateOutRecord)实体类
*
* @author ww
* @since 2024-10-24 15:55:23
*/
public class TbActivateOutRecord implements Serializable {
private static final long serialVersionUID = -14744224643993479L;
private Integer id;
private Integer shopId;
/**
* 订单id
*/
private String orderId;
/**
* 商品赠送Id tb_activate_in_record的id
*/
private Integer giveId;
/**
* 会员id
*/
private Integer vipUserId;
/**
* 1-满减 2-商品
*/
private Integer type;
/**
* 使用数量
*/
private Integer useNum;
/**
* 退单量
*/
private Integer refNum;
/**
* 新建: 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 getShopId() {
return shopId;
}
public void setShopId(Integer shopId) {
this.shopId = shopId;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public Integer getGiveId() {
return giveId;
}
public void setGiveId(Integer giveId) {
this.giveId = giveId;
}
public Integer getVipUserId() {
return vipUserId;
}
public void setVipUserId(Integer vipUserId) {
this.vipUserId = vipUserId;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
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 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;
}
}

View File

@@ -61,6 +61,8 @@ public class TbCashierCart implements Serializable {
private String useType; private String useType;
private Integer placeNum; private Integer placeNum;
private String platformType; private String platformType;
private BigDecimal memberPrice;
private Integer isMember;
@TableField(exist = false) @TableField(exist = false)
private TbProductSpec tbProductSpec; private TbProductSpec tbProductSpec;
@@ -69,4 +71,22 @@ public class TbCashierCart implements Serializable {
private String selectSpec=""; private String selectSpec="";
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 根据是否会员充值价格
*/
public void resetTotalAmount() {
if ("false".equals(isPack)) {
packFee = BigDecimal.ZERO;
}
if ("true".equals(isGift)) {
totalAmount = packFee;
}else {
if (isMember != null && isMember == 1 && memberPrice != null && memberPrice.compareTo(BigDecimal.ZERO) > 0) {
totalAmount = BigDecimal.valueOf(totalNumber).multiply(memberPrice).add(packFee);
}else {
totalAmount = BigDecimal.valueOf(totalNumber).multiply(salePrice).add(packFee);
}
}
}
} }

View File

@@ -0,0 +1,83 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.util.Date;
import java.io.Serializable;
/**
* 活动赠送商品表(TbCouponProduct)实体类
*
* @author ww
* @since 2024-10-24 15:56:09
*/
public class TbCouponProduct implements Serializable {
private static final long serialVersionUID = 685322089212281310L;
private Integer id;
/**
* 活动Id
*/
private Integer couponId;
/**
* 商品id
*/
private Integer productId;
/**
* 数量
*/
private Integer num;
private Date createTime;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getCouponId() {
return couponId;
}
public void setCouponId(Integer couponId) {
this.couponId = couponId;
}
public 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;
}
}

View File

@@ -1,68 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class TbDeviceOperateInfo implements Serializable {
private Integer id;
private String deviceno;
private String type;
private String shopId;
private Date createtime;
private String remark;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getDeviceno() {
return deviceno;
}
public void setDeviceno(String deviceno) {
this.deviceno = deviceno == null ? null : deviceno.trim();
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId == null ? null : shopId.trim();
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
}

View File

@@ -47,5 +47,9 @@ public class TbOrderDetail implements Serializable {
private String note; private String note;
private BigDecimal memberPrice;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer isMember;
} }

View File

@@ -116,6 +116,8 @@ public class TbOrderInfo implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private int isPostpaid;
public TbOrderInfo(){ public TbOrderInfo(){
super(); super();
} }

View File

@@ -1,128 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.util.Date;
public class TbPlussDeviceGoods implements Serializable {
private Integer id;
private String code;
private String name;
private String devicelogo;
private String introdesc;
private Integer sort;
private Integer status;
private Integer tagid;
private String depositflag;
private Date createtime;
private Date updatetime;
private String detail;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getDevicelogo() {
return devicelogo;
}
public void setDevicelogo(String devicelogo) {
this.devicelogo = devicelogo == null ? null : devicelogo.trim();
}
public String getIntrodesc() {
return introdesc;
}
public void setIntrodesc(String introdesc) {
this.introdesc = introdesc == null ? null : introdesc.trim();
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Integer getTagid() {
return tagid;
}
public void setTagid(Integer tagid) {
this.tagid = tagid;
}
public String getDepositflag() {
return depositflag;
}
public void setDepositflag(String depositflag) {
this.depositflag = depositflag == null ? null : depositflag.trim();
}
public Date getCreatetime() {
return createtime;
}
public void setCreatetime(Date createtime) {
this.createtime = createtime;
}
public Date getUpdatetime() {
return updatetime;
}
public void setUpdatetime(Date updatetime) {
this.updatetime = updatetime;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail == null ? null : detail.trim();
}
}

View File

@@ -1,155 +1,191 @@
package com.chaozhanggui.system.cashierservice.entity; package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.TableField; import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo;
import lombok.Data; import lombok.Data;
import org.springframework.data.annotation.Transient;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalTime;
import java.io.Serializable;
import java.util.List;
/**
* (TbProduct)实体类
*
* @author ww
* @since 2024-11-19 15:23:12
*/
@Data @Data
public class TbProduct implements Serializable { public class TbProduct implements Serializable {
private static final long serialVersionUID = 371589032559725924L;
/**
* id
*/
private Integer id; private Integer id;
/**
* 商品分类
*/
private String categoryId; private String categoryId;
/**
* 商品规格
*/
private Integer specId; private Integer specId;
private String sourcePath;
private Integer brandId;
private String merchantId;
private String shopId; private String shopId;
/**
* 商品名称
*/
private String name; private String name;
/**
* 短标题--促销语
*/
private String shortTitle; private String shortTitle;
/**
* 普通商品 normal 套餐商品 package 称重商品 weigh 团购券 coupon
*/
private String type; private String type;
/**
* 计量商品 normal
* 多规格商品 sku
*/
private String typeEnum;
/**
* 包装费
*/
private BigDecimal packFee; private BigDecimal packFee;
/**
* 商品最低价
*/
private BigDecimal lowPrice; private BigDecimal lowPrice;
private BigDecimal lowMemberPrice;
private String unitId;
private String unitSnap;
private String coverImg;
private String shareImg;
private String videoCoverImg;
private Integer sort;
private Integer limitNumber;
private Integer productScore;
private Byte status;
private String failMsg;
private Byte isRecommend;
private Byte isHot;
private Byte isNew;
private Byte isOnSale;
private Byte isShow;
private String typeEnum;
/** /**
* 是否共享库存 * 单位Id
*/ */
private Byte isDistribute; private Integer unitId;
/**
private Byte isDel; * 商品封面图
*/
private Byte isStock; private String coverImg;
/**
private Byte isPauseSale; * 商品图片(第一张为缩略图,其他为详情)
*/
private Byte isFreeFreight; private String images;
/**
private Long freightId; * 排序
*/
private String strategyType; private Integer sort;
/**
private Integer strategyId; * 0--待审核 1审核通过 -1审核失败 -2违规下架
*/
private Byte isVip; private Integer status;
/**
private Byte isDelete; * 是否热销
*/
private Integer isHot;
/**
* 是否回收站 0-否1回收站
*/
private Integer isDel;
/**
* 是否开启库存
*/
private Integer isStock;
/**
* 是否暂停销售
*/
private Integer isPauseSale;
private Long createdAt; private Long createdAt;
private Long updatedAt; private Long updatedAt;
/**
private Double baseSalesNumber; * 0 固定套餐 1可选套餐
*/
private Integer realSalesNumber; private Integer groupType;
/**
private Integer salesNumber; * 套餐内容
*/
private Integer thumbCount; private String groupSnap;
/**
private Integer storeCount; * 规格详情
*/
private Integer furnishMeal; private String specInfo;
/**
private Integer furnishExpress; * 已选择的规格
*/
private Integer furnishDraw; private String selectSpec;
/**
private Integer furnishVir; * 已选规格表格头部
*/
private Byte isCombo;
private Byte isShowCash;
private Byte isShowMall;
private Byte isNeedExamine;
private Byte showOnMallStatus;
private Long showOnMallTime;
private String showOnMallErrorMsg;
private Byte enableLabel;
private String taxConfigId;
private String specTableHeaders; private String specTableHeaders;
/**
* 团购卷分类,可有多个分类
*/
private String groupCategoryId;
/**
* 销量
*/
private Integer realSalesNumber;
/**
* 商品级库存数量
*/
private Integer stockNumber; private Integer stockNumber;
/**
* 是否上架
*/
private Integer isGrounding;
/**
* 退款是否退回库存
*/
private Integer isRefundStock;
/**
* 库存警戒线
*/
private Integer warnLine;
/**
* 堂食 table 自取 dine 配送 delivery 快递 express
*/
private String showType;
/**
* 称重 价格/千克
*/
private BigDecimal weight;
/**
* 是否允许临时改价
*/
private Integer isTempPrice;
/**
* 日销售上限
*/
private Integer dayLimit;
/**
* 每单销售上限
*/
private Integer singleOrderLimit;
/**
* 每人销售上限
*/
private Integer singlePeopleLimit;
/**
* 周 数组 周一,周二,周日
*/
private String days;
/**
* 可用开始时间
*/
private LocalTime startTime;
/**
* 可用结束时间
*/
private LocalTime endTime;
private Integer warnLine = 0;
@Transient
@TableField(exist = false)
private int orderCount; private int orderCount;
@Transient
@TableField(exist = false)
private TbProductSpec tbProductSpec; private TbProductSpec tbProductSpec;
@Transient
@TableField(exist = false)
private TbProductSkuResult productSkuResult; private TbProductSkuResult productSkuResult;
private Object groundingSpecInfo;
private List<?> skuList;
private static final long serialVersionUID = 1L; private List<ProductGroupVo> proGroupVo;
} }

View File

@@ -12,7 +12,7 @@ public class TbProductStockDetail implements Serializable {
private String productName; private String productName;
private Byte isStock; private Integer isStock;
private String specSnap; private String specSnap;
@@ -90,11 +90,11 @@ public class TbProductStockDetail implements Serializable {
this.productName = productName == null ? null : productName.trim(); this.productName = productName == null ? null : productName.trim();
} }
public Byte getIsStock() { public Integer getIsStock() {
return isStock; return isStock;
} }
public void setIsStock(Byte isStock) { public void setIsStock(Integer isStock) {
this.isStock = isStock; this.isStock = isStock;
} }

View File

@@ -1,58 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import lombok.Getter;
import java.io.Serializable;
import java.util.List;
@Getter
public class TbProductWithBLOBs extends TbProduct implements Serializable {
private Object groundingSpecInfo;
private String images;
private String video;
private String notice;
private String groupSnap;
private String specInfo;
private String selectSpec;
private List<?> skuList;
private static final long serialVersionUID = 1L;
public void setGroundingSpecInfo(Object groundingSpecInfo) {
this.groundingSpecInfo = groundingSpecInfo;
}
public void setSkuList(List<?> skuList) {
this.skuList = skuList;
}
public void setImages(String images) {
this.images = images == null ? null : images.trim();
}
public void setVideo(String video) {
this.video = video == null ? null : video.trim();
}
public void setNotice(String notice) {
this.notice = notice == null ? null : notice.trim();
}
public void setGroupSnap(String groupSnap) {
this.groupSnap = groupSnap == null ? null : groupSnap.trim();
}
public void setSpecInfo(String specInfo) {
this.specInfo = specInfo == null ? null : specInfo.trim();
}
public void setSelectSpec(String selectSpec) {
this.selectSpec = selectSpec == null ? null : selectSpec.trim();
}
}

View File

@@ -1,207 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
public class TbReceiptSales implements Serializable {
private Integer id;
private String title;
private String logo;
private Boolean showContactInfo;
private Boolean showMember;
private Boolean showMemberCode;
private Boolean showMemberScore;
private Boolean showMemberWallet;
private String footerRemark;
private Boolean showCashCharge;
private Boolean showSerialNo;
private Boolean bigSerialNo;
private String headerText;
private String headerTextAlign;
private String footerText;
private String footerTextAlign;
private String footerImage;
private String prePrint;
private Long createdAt;
private Long updatedAt;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title == null ? null : title.trim();
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo == null ? null : logo.trim();
}
public Boolean getShowContactInfo() {
return showContactInfo;
}
public void setShowContactInfo(Boolean showContactInfo) {
this.showContactInfo = showContactInfo;
}
public Boolean getShowMember() {
return showMember;
}
public void setShowMember(Boolean showMember) {
this.showMember = showMember;
}
public Boolean getShowMemberCode() {
return showMemberCode;
}
public void setShowMemberCode(Boolean showMemberCode) {
this.showMemberCode = showMemberCode;
}
public Boolean getShowMemberScore() {
return showMemberScore;
}
public void setShowMemberScore(Boolean showMemberScore) {
this.showMemberScore = showMemberScore;
}
public Boolean getShowMemberWallet() {
return showMemberWallet;
}
public void setShowMemberWallet(Boolean showMemberWallet) {
this.showMemberWallet = showMemberWallet;
}
public String getFooterRemark() {
return footerRemark;
}
public void setFooterRemark(String footerRemark) {
this.footerRemark = footerRemark == null ? null : footerRemark.trim();
}
public Boolean getShowCashCharge() {
return showCashCharge;
}
public void setShowCashCharge(Boolean showCashCharge) {
this.showCashCharge = showCashCharge;
}
public Boolean getShowSerialNo() {
return showSerialNo;
}
public void setShowSerialNo(Boolean showSerialNo) {
this.showSerialNo = showSerialNo;
}
public Boolean getBigSerialNo() {
return bigSerialNo;
}
public void setBigSerialNo(Boolean bigSerialNo) {
this.bigSerialNo = bigSerialNo;
}
public String getHeaderText() {
return headerText;
}
public void setHeaderText(String headerText) {
this.headerText = headerText == null ? null : headerText.trim();
}
public String getHeaderTextAlign() {
return headerTextAlign;
}
public void setHeaderTextAlign(String headerTextAlign) {
this.headerTextAlign = headerTextAlign == null ? null : headerTextAlign.trim();
}
public String getFooterText() {
return footerText;
}
public void setFooterText(String footerText) {
this.footerText = footerText == null ? null : footerText.trim();
}
public String getFooterTextAlign() {
return footerTextAlign;
}
public void setFooterTextAlign(String footerTextAlign) {
this.footerTextAlign = footerTextAlign == null ? null : footerTextAlign.trim();
}
public String getFooterImage() {
return footerImage;
}
public void setFooterImage(String footerImage) {
this.footerImage = footerImage == null ? null : footerImage.trim();
}
public String getPrePrint() {
return prePrint;
}
public void setPrePrint(String prePrint) {
this.prePrint = prePrint == null ? null : prePrint.trim();
}
public Long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
public Long getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Long updatedAt) {
this.updatedAt = updatedAt;
}
}

View File

@@ -1,148 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
public class TbRenewalsPayLog implements Serializable {
private Integer id;
private String payType;
private String shopId;
private String orderId;
private String openId;
private String userId;
private String transactionId;
private BigDecimal amount;
private Byte status;
private String remark;
private String attach;
private Long expiredAt;
private Long createdAt;
private Long updatedAt;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getPayType() {
return payType;
}
public void setPayType(String payType) {
this.payType = payType == null ? null : payType.trim();
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId == null ? null : shopId.trim();
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId == null ? null : orderId.trim();
}
public String getOpenId() {
return openId;
}
public void setOpenId(String openId) {
this.openId = openId == null ? null : openId.trim();
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId == null ? null : userId.trim();
}
public String getTransactionId() {
return transactionId;
}
public void setTransactionId(String transactionId) {
this.transactionId = transactionId == null ? null : transactionId.trim();
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public Byte getStatus() {
return status;
}
public void setStatus(Byte status) {
this.status = status;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
public String getAttach() {
return attach;
}
public void setAttach(String attach) {
this.attach = attach == null ? null : attach.trim();
}
public Long getExpiredAt() {
return expiredAt;
}
public void setExpiredAt(Long expiredAt) {
this.expiredAt = expiredAt;
}
public Long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
public Long getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Long updatedAt) {
this.updatedAt = updatedAt;
}
}

View File

@@ -1,37 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
public class TbShopCashSpread implements Serializable {
private Integer id;
private Long createdAt;
private Long updatedAt;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
public Long getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Long updatedAt) {
this.updatedAt = updatedAt;
}
}

View File

@@ -1,57 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
public class TbShopCashSpreadWithBLOBs extends TbShopCashSpread implements Serializable {
private String saleReceipt;
private String triplicateReceipt;
private String screenConfig;
private String tagConfig;
private String scaleConfig;
private static final long serialVersionUID = 1L;
public String getSaleReceipt() {
return saleReceipt;
}
public void setSaleReceipt(String saleReceipt) {
this.saleReceipt = saleReceipt == null ? null : saleReceipt.trim();
}
public String getTriplicateReceipt() {
return triplicateReceipt;
}
public void setTriplicateReceipt(String triplicateReceipt) {
this.triplicateReceipt = triplicateReceipt == null ? null : triplicateReceipt.trim();
}
public String getScreenConfig() {
return screenConfig;
}
public void setScreenConfig(String screenConfig) {
this.screenConfig = screenConfig == null ? null : screenConfig.trim();
}
public String getTagConfig() {
return tagConfig;
}
public void setTagConfig(String tagConfig) {
this.tagConfig = tagConfig == null ? null : tagConfig.trim();
}
public String getScaleConfig() {
return scaleConfig;
}
public void setScaleConfig(String scaleConfig) {
this.scaleConfig = scaleConfig == null ? null : scaleConfig.trim();
}
}

View File

@@ -0,0 +1,289 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.math.BigDecimal;
import java.time.LocalTime;
import java.util.Date;
import java.io.Serializable;
/**
* 优惠券(TbShopCoupon)实体类
*
* @author ww
* @since 2024-10-24 15:52:58
*/
public class TbShopCoupon implements Serializable {
private static final long serialVersionUID = -97269009590588062L;
/**
* 自增
*/
private Integer id;
private String shopId;
/**
* 名称(无意义)
*/
private String title;
/**
* 1-满减 2-商品
*/
private Integer type;
/**
* 满多少金额
*/
private BigDecimal fullAmount;
/**
* 减多少金额
*/
private BigDecimal discountAmount;
/**
* 描述
*/
private String description;
/**
* 发放数量
*/
private Integer number;
/**
* 剩余数量
*/
private Integer leftNumber;
/**
* 有效期类型,可选值为 fixed固定时间/custom自定义时间
*/
private String validityType;
/**
* 有效天数
*/
private Integer validDays;
/**
* 隔多少天生效
*/
private Integer daysToTakeEffect;
/**
* 有效开始时间
*/
private Date validStartTime;
/**
* 有效结束时间
*/
private Date validEndTime;
/**
* 周 数组["周一","周二"]
*/
private String userDays;
/**
* all-全时段 custom-指定时段
*/
private String useTimeType;
/**
* 可用开始时间
*/
private LocalTime useStartTime;
/**
* 可用结束时间
*/
private LocalTime useEndTime;
/**
* 已使用数量
*/
private Integer useNumber;
/**
* 发放人
*/
private String editor;
/**
* 状态0-关闭 1 正常
*/
private Integer status;
private Date createTime;
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public BigDecimal getFullAmount() {
return fullAmount;
}
public void setFullAmount(BigDecimal fullAmount) {
this.fullAmount = fullAmount;
}
public BigDecimal getDiscountAmount() {
return discountAmount;
}
public void setDiscountAmount(BigDecimal discountAmount) {
this.discountAmount = discountAmount;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getNumber() {
return number;
}
public void setNumber(Integer number) {
this.number = number;
}
public Integer getLeftNumber() {
return leftNumber;
}
public void setLeftNumber(Integer leftNumber) {
this.leftNumber = leftNumber;
}
public String getValidityType() {
return validityType;
}
public void setValidityType(String validityType) {
this.validityType = validityType;
}
public Integer getValidDays() {
return validDays;
}
public void setValidDays(Integer validDays) {
this.validDays = validDays;
}
public Integer getDaysToTakeEffect() {
return daysToTakeEffect;
}
public void setDaysToTakeEffect(Integer daysToTakeEffect) {
this.daysToTakeEffect = daysToTakeEffect;
}
public Date getValidStartTime() {
return validStartTime;
}
public void setValidStartTime(Date validStartTime) {
this.validStartTime = validStartTime;
}
public Date getValidEndTime() {
return validEndTime;
}
public void setValidEndTime(Date validEndTime) {
this.validEndTime = validEndTime;
}
public String getUserDays() {
return userDays;
}
public void setUserDays(String userDays) {
this.userDays = userDays;
}
public String getUseTimeType() {
return useTimeType;
}
public void setUseTimeType(String useTimeType) {
this.useTimeType = useTimeType;
}
public LocalTime getUseStartTime() {
return useStartTime;
}
public void setUseStartTime(LocalTime useStartTime) {
this.useStartTime = useStartTime;
}
public LocalTime getUseEndTime() {
return useEndTime;
}
public void setUseEndTime(LocalTime useEndTime) {
this.useEndTime = useEndTime;
}
public Integer getUseNumber() {
return useNumber;
}
public void setUseNumber(Integer useNumber) {
this.useNumber = useNumber;
}
public String getEditor() {
return editor;
}
public void setEditor(String editor) {
this.editor = editor;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer 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;
}
}

View File

@@ -1,208 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
import java.math.BigDecimal;
public class TbShopCurrency implements Serializable {
private Integer id;
private String shopId;
private BigDecimal prepareAmount;
private String currency;
private Byte decimalsDigits;
private String discountRound;
private String merchantId;
private Byte smallChange;
private Byte enableCustomDiscount;
private BigDecimal maxDiscount;
private Double maxPercent;
private String bizDuration;
private Byte allowWebPay;
private Byte isAutoToZero;
private Byte isIncludeTaxPrice;
private String taxNumber;
private Long createdAt;
private Long updatedAt;
private Byte autoLockScreen;
private Byte voiceNotification;
private static final long serialVersionUID = 1L;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getShopId() {
return shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId == null ? null : shopId.trim();
}
public BigDecimal getPrepareAmount() {
return prepareAmount;
}
public void setPrepareAmount(BigDecimal prepareAmount) {
this.prepareAmount = prepareAmount;
}
public String getCurrency() {
return currency;
}
public void setCurrency(String currency) {
this.currency = currency == null ? null : currency.trim();
}
public Byte getDecimalsDigits() {
return decimalsDigits;
}
public void setDecimalsDigits(Byte decimalsDigits) {
this.decimalsDigits = decimalsDigits;
}
public String getDiscountRound() {
return discountRound;
}
public void setDiscountRound(String discountRound) {
this.discountRound = discountRound == null ? null : discountRound.trim();
}
public String getMerchantId() {
return merchantId;
}
public void setMerchantId(String merchantId) {
this.merchantId = merchantId == null ? null : merchantId.trim();
}
public Byte getSmallChange() {
return smallChange;
}
public void setSmallChange(Byte smallChange) {
this.smallChange = smallChange;
}
public Byte getEnableCustomDiscount() {
return enableCustomDiscount;
}
public void setEnableCustomDiscount(Byte enableCustomDiscount) {
this.enableCustomDiscount = enableCustomDiscount;
}
public BigDecimal getMaxDiscount() {
return maxDiscount;
}
public void setMaxDiscount(BigDecimal maxDiscount) {
this.maxDiscount = maxDiscount;
}
public Double getMaxPercent() {
return maxPercent;
}
public void setMaxPercent(Double maxPercent) {
this.maxPercent = maxPercent;
}
public String getBizDuration() {
return bizDuration;
}
public void setBizDuration(String bizDuration) {
this.bizDuration = bizDuration == null ? null : bizDuration.trim();
}
public Byte getAllowWebPay() {
return allowWebPay;
}
public void setAllowWebPay(Byte allowWebPay) {
this.allowWebPay = allowWebPay;
}
public Byte getIsAutoToZero() {
return isAutoToZero;
}
public void setIsAutoToZero(Byte isAutoToZero) {
this.isAutoToZero = isAutoToZero;
}
public Byte getIsIncludeTaxPrice() {
return isIncludeTaxPrice;
}
public void setIsIncludeTaxPrice(Byte isIncludeTaxPrice) {
this.isIncludeTaxPrice = isIncludeTaxPrice;
}
public String getTaxNumber() {
return taxNumber;
}
public void setTaxNumber(String taxNumber) {
this.taxNumber = taxNumber == null ? null : taxNumber.trim();
}
public Long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Long createdAt) {
this.createdAt = createdAt;
}
public Long getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Long updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getAutoLockScreen() {
return autoLockScreen;
}
public void setAutoLockScreen(Byte autoLockScreen) {
this.autoLockScreen = autoLockScreen;
}
public Byte getVoiceNotification() {
return voiceNotification;
}
public void setVoiceNotification(Byte voiceNotification) {
this.voiceNotification = voiceNotification;
}
}

View File

@@ -1,27 +0,0 @@
package com.chaozhanggui.system.cashierservice.entity;
import java.io.Serializable;
public class TbShopCurrencyWithBLOBs extends TbShopCurrency implements Serializable {
private String discountConfigs;
private String serviceCharge;
private static final long serialVersionUID = 1L;
public String getDiscountConfigs() {
return discountConfigs;
}
public void setDiscountConfigs(String discountConfigs) {
this.discountConfigs = discountConfigs == null ? null : discountConfigs.trim();
}
public String getServiceCharge() {
return serviceCharge;
}
public void setServiceCharge(String serviceCharge) {
this.serviceCharge = serviceCharge == null ? null : serviceCharge.trim();
}
}

View File

@@ -1,126 +1,270 @@
package com.chaozhanggui.system.cashierservice.entity; package com.chaozhanggui.system.cashierservice.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data; import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.io.Serializable;
/**
* (TbShopInfo)实体类
*
* @author ww
* @since 2024-10-24 16:42:26
*/
@Data @Data
public class TbShopInfo implements Serializable { public class TbShopInfo implements Serializable {
private static final long serialVersionUID = 561716476024545414L;
/**
* 自增id
*/
private Integer id; private Integer id;
/**
* 店铺帐号
*/
private String account; private String account;
/**
* 店铺代号策略方式为city +店铺号8位
*/
private String shopCode; private String shopCode;
/**
* 店铺口号
*/
private String subTitle; private String subTitle;
/**
* 商户Id
*/
private String merchantId; private String merchantId;
/**
* 店铺名称
*/
private String shopName; private String shopName;
/**
* 连锁店扩展店名
*/
private String chainName; private String chainName;
/**
* 背景图
*/
private String backImg; private String backImg;
/**
* 门头照
*/
private String frontImg; private String frontImg;
/**
* 联系人姓名
*/
private String contactName; private String contactName;
/**
* 联系电话
*/
private String phone; private String phone;
/**
* 店铺log0
*/
private String logo; private String logo;
/**
private Byte isDeposit; * 是否参与代收 0--不参与 1参与
*/
private Byte isSupply; private Integer isDeposit;
/**
* 是否为供应商
*/
private Integer isSupply;
/**
* 封面图
*/
private String coverImg; private String coverImg;
/**
* 店铺分享图
*/
private String shareImg; private String shareImg;
/**
* 轮播图
*/
private String view;
/**
* 店铺简介
*/
private String detail; private String detail;
/**
* 经纬度
*/
private String lat; private String lat;
/**
* 经纬度
*/
private String lng; private String lng;
/**
* 未用
*/
private String mchId; private String mchId;
private String registerType; private String registerType;
/**
private Byte isWxMaIndependent; * 是否独立的微信小程序
*/
private Integer isWxMaIndependent;
/**
* 详细地址
*/
private String address; private String address;
/**
* 类似于这种规则51.51.570
*/
private String city; private String city;
/**
* 店铺类型 超市--MARKET---其它店SHOP
*/
private String type; private String type;
/**
* 行业
*/
private String industry; private String industry;
/**
* 行业名称
*/
private String industryName; private String industryName;
/**
* 营业时间(周开始)
*/
private String businessStartDay;
/**
* 营业时间(周结束)
*/
private String businessEndDay;
/**
* 营业时间
*/
private String businessTime; private String businessTime;
/**
* 配送时间
*/
private String postTime; private String postTime;
private BigDecimal postAmountLine; private BigDecimal postAmountLine;
/**
private Byte onSale; * 0停业1正常营业,网上售卖
*/
private Byte settleType; private Integer onSale;
/**
* 0今日1次日
*/
private Integer settleType;
/**
* 时间
*/
private String settleTime; private String settleTime;
/**
* 入驻时间
*/
private Integer enterAt; private Integer enterAt;
/**
* 到期时间
*/
private Long expireAt; private Long expireAt;
/**
private Byte status; * -1 平台禁用 0-过期1正式营业
*/
private Float average; private Integer status;
/**
* 人均消费
*/
private BigDecimal average;
/**
* 订单等待时间
*/
private Integer orderWaitPayMinute; private Integer orderWaitPayMinute;
/**
* 支持登陆设备个数
*/
private Integer supportDeviceNumber; private Integer supportDeviceNumber;
/**
private Byte distributeLevel; * 分销层级1-下级分销 2-两下级分销)
*/
private Integer distributeLevel;
private Long createdAt; private Long createdAt;
private Long updatedAt; private Long updatedAt;
private String proxyId; private String proxyId;
/**
* trial试用版release正式
*/
private String profiles;
/**
* 商家二维码
*/
private String shopQrcode;
/**
* 商家标签
*/
private String tag;
private String view; private String isOpenYhq;
/**
* 0否1是
*/
private Integer isUseVip;
/**
* 省
*/
private String provinces;
/**
* 市
*/
private String cities;
/**
* 区/县
*/
private String districts;
/**
* 是否允许会员自定义金额 1 允许 0 不允许
*/
private String isCustom; private String isCustom;
/**
* 是否开启退款密码 1 启用 0 禁用
*/
private String isReturn; private String isReturn;
/**
* 是否开启会员充值密码 1 启用 0 禁用
*/
private String isMemberIn; private String isMemberIn;
/**
* 是否开启会员退款密码 1 启用 0 禁用
*/
private String isMemberReturn; private String isMemberReturn;
/**
//是否开启桌位费 0否1是 * 是否免除桌位费 0否1是
*/
private Integer isTableFee; private Integer isTableFee;
//桌位费 /**
* 是否启用会员价 0否1是
*/
private Integer isMemberPrice;
/**
* 积分群体 all-所有 vip-仅针对会员
*/
private String consumeColony;
/**
* 桌位费
*/
private BigDecimal tableFee; private BigDecimal tableFee;
//就餐模式 堂食 dine-in 外带 take-out /**
* 就餐模式 堂食 dine-in 外带 take-out
*/
private String eatModel; private String eatModel;
//程序码(零点八零首页) /**
* 小程序码(零点八零首页)
*/
private String smallQrcode; private String smallQrcode;
//店铺收款码 /**
* 店铺收款码
*/
private String paymentQrcode; private String paymentQrcode;
@TableField(exist = false)
private static final long serialVersionUID = 1L; private String ticketLogo = "https://cashier-oss.oss-cn-beijing.aliyuncs.com/upload/20241022/eeee8e85c66947e5bcaebf687381b5d6.png";
} }

View File

@@ -14,7 +14,6 @@ public class ChoseCountDTO {
private Integer shopId; private Integer shopId;
@NotEmpty @NotEmpty
private String tableId; private String tableId;
@NotNull
@Min(1) @Min(1)
private Integer num; private Integer num;
} }

View File

@@ -11,6 +11,8 @@ public class ShopEatTypeInfoDTO {
private boolean isMunchies; private boolean isMunchies;
private boolean isDineInAfter; private boolean isDineInAfter;
private boolean isDineInBefore; private boolean isDineInBefore;
private boolean needSeatFee;
private boolean isMemberPrice;
private TbShopInfo shopInfo; private TbShopInfo shopInfo;
private String useType; private String useType;
private String sendType; private String sendType;

View File

@@ -0,0 +1,34 @@
package com.chaozhanggui.system.cashierservice.entity.vo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProductGroupVo {
private Integer count;
//选几个
private Integer number;
//类别
private String title;
//食物
private List<Food> goods=new ArrayList<>();
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public static class Food {
private Integer proId;
private String proName;
private Integer skuId;
private String skuName;
private BigDecimal price;
private String number;
private String unitName;
}
}

View File

@@ -41,6 +41,10 @@ public class SignInterceptor implements HandlerInterceptor {
return true; return true;
} }
if (requestUri.contains("/shopInfo/queryShopInfo")) {
return true;
}
if (requestUri.contains("/version/pcDownload")) { if (requestUri.contains("/version/pcDownload")) {
return true; return true;
} }

View File

@@ -108,7 +108,7 @@ public class ConsMsgConsumer {
return; return;
} }
TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(skuWithBLOBs.getProductId())); TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(skuWithBLOBs.getProductId()));
if (Objects.isNull(product)) { if (Objects.isNull(product)) {
log.info("商品信息不存在"); log.info("商品信息不存在");
return; return;

View File

@@ -673,7 +673,7 @@ public class PrintMechineConsumer {
} }
FeieyunPrintUtil.getPrintData(tbPrintMachineWithBLOBs.getAddress(), orderInfo.getMasterId(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), it.getName(), it.getNumber(), remark); FeieyunPrintUtil.getPrintData(tbPrintMachineWithBLOBs.getAddress(), orderInfo, DateUtils.getTime(new Date(orderInfo.getCreatedAt())), it.getName(), it.getNumber(), remark);
} }
}); });
} }

View File

@@ -69,7 +69,7 @@ public class FeiPrinter extends PrinterHandler {
return; return;
} }
String remark = sku.getSpecSnap(); String remark = sku.getSpecSnap();
String[] resp = FeieyunPrintUtil.getPrintData(machine.getAddress(), orderInfo.getMasterId(), String[] resp = FeieyunPrintUtil.getPrintData(machine.getAddress(), orderInfo,
DateUtils.getTime(new Date(orderInfo.getCreatedAt())), orderDetail.getProductName(), orderDetail.getNum(), remark); DateUtils.getTime(new Date(orderInfo.getCreatedAt())), orderDetail.getProductName(), orderDetail.getNum(), remark);
shopPrintLogService.save(machine, "新订单", resp[0], resp[1]); shopPrintLogService.save(machine, "新订单", resp[0], resp[1]);
} }

View File

@@ -66,8 +66,8 @@ public class YxyPrinter extends PrinterHandler {
String data = PrinterUtils.getPrintData("return", getPickupNum(orderInfo), String data = PrinterUtils.getPrintData("return", getPickupNum(orderInfo),
DateUtils.getTime(new Date(orderInfo.getCreatedAt())), orderDetail.getProductName(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), orderDetail.getProductName(),
Math.abs(orderDetail.getNum()), orderDetail.getRemark(), orderDetail.getNote()); Math.abs(orderDetail.getNum()), orderDetail.getRemark(), orderDetail.getNote());
// String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔退款订单,请及时处理\"}"; String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔退款订单,请及时处理\"}";
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}"; // String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
String resp = PrinterUtils.printTickets(voiceJson, 3, 1, machine.getAddress(), data); String resp = PrinterUtils.printTickets(voiceJson, 3, 1, machine.getAddress(), data);
shopPrintLogService.save(machine, "退款单", data, resp); shopPrintLogService.save(machine, "退款单", data, resp);
} }
@@ -77,8 +77,8 @@ public class YxyPrinter extends PrinterHandler {
String data = PrinterUtils.getPrintData("", getPickupNum(orderInfo), String data = PrinterUtils.getPrintData("", getPickupNum(orderInfo),
DateUtils.getTime(new Date(orderInfo.getCreatedAt())), orderDetail.getProductName(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), orderDetail.getProductName(),
orderDetail.getNum(), orderDetail.getRemark(), orderDetail.getNote()); orderDetail.getNum(), orderDetail.getRemark(), orderDetail.getNote());
// String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}"; String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}";
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}"; // String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
String resp = PrinterUtils.printTickets(voiceJson, 3, 1, machine.getAddress(), data); String resp = PrinterUtils.printTickets(voiceJson, 3, 1, machine.getAddress(), data);
shopPrintLogService.save(machine, "新订单", data, resp); shopPrintLogService.save(machine, "新订单", data, resp);
} }
@@ -94,8 +94,8 @@ public class YxyPrinter extends PrinterHandler {
String printType = "退款单"; String printType = "退款单";
String data = PrinterUtils.getCashPrintData(detailPO, printType, "return"); String data = PrinterUtils.getCashPrintData(detailPO, printType, "return");
// String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}"; String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}";
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}"; // String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
String resp = PrinterUtils.printTickets(voiceJson, 1, 1, machine.getAddress(), data); String resp = PrinterUtils.printTickets(voiceJson, 1, 1, machine.getAddress(), data);
shopPrintLogService.save(machine, printType, data, resp); shopPrintLogService.save(machine, printType, data, resp);
} }
@@ -114,8 +114,8 @@ public class YxyPrinter extends PrinterHandler {
detailPO.setOutNumber(orderInfo.getOutNumber()); detailPO.setOutNumber(orderInfo.getOutNumber());
String printType = "结算单"; String printType = "结算单";
String data = PrinterUtils.getCashPrintData(detailPO, printType, orderInfo.getOrderType()); String data = PrinterUtils.getCashPrintData(detailPO, printType, orderInfo.getOrderType());
// String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}"; String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}";
String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}"; // String voiceJson = "{\"bizType\":\"2\",\"content\":\"\"}";
String printerNum = "1"; String printerNum = "1";
if (StrUtil.isNotBlank(machine.getPrintQty())) { if (StrUtil.isNotBlank(machine.getPrintQty())) {
printerNum = machine.getPrintQty().split("\\^")[1]; printerNum = machine.getPrintQty().split("\\^")[1];

View File

@@ -262,7 +262,7 @@ public class CloudPrinterService {
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) { if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
remark = tbProductSkuWithBLOBs.getSpecSnap(); remark = tbProductSkuWithBLOBs.getSpecSnap();
} }
OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getProductName(), it.getNum().toString(), NumberUtil.mul(it.getNum(),it.getPrice()).toPlainString(), remark); OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getProductName(), it.getNum().toString(), NumberUtil.mul(it.getNum(), it.getPrice()).toPlainString(), remark);
detailList.add(detail); detailList.add(detail);
}); });
@@ -397,7 +397,7 @@ public class CloudPrinterService {
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) { if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
remark = tbProductSkuWithBLOBs.getSpecSnap(); remark = tbProductSkuWithBLOBs.getSpecSnap();
} }
OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getProductName(), it.getNum().toString(), NumberUtil.mul(it.getNum(),it.getPrice()).toPlainString(), remark); OrderDetailPO.Detail detail = new OrderDetailPO.Detail(it.getProductName(), it.getNum().toString(), NumberUtil.mul(it.getNum(), it.getPrice()).toPlainString(), remark);
detailList.add(detail); detailList.add(detail);
}); });
@@ -527,7 +527,7 @@ public class CloudPrinterService {
remark = tbProductSkuWithBLOBs.getSpecSnap(); remark = tbProductSkuWithBLOBs.getSpecSnap();
} }
FeieyunPrintUtil.getPrintData(tbPrintMachineWithBLOBs.getAddress(), orderInfo.getMasterId(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())), it.getName(), it.getNumber(), remark); FeieyunPrintUtil.getPrintData(tbPrintMachineWithBLOBs.getAddress(), orderInfo, DateUtils.getTime(new Date(orderInfo.getCreatedAt())), it.getName(), it.getNumber(), remark);
} }
}); });
} }

View File

@@ -135,12 +135,20 @@ public class DutyService {
} else { } else {
if (type.equals("return") || type.equals("create")) { if (type.equals("return") || type.equals("create")) {
if (Objects.isNull(tbToken)) { if (Objects.isNull(tbToken) && type.equals("return")) {
throw new MsgException("当前用户不存在"); throw new MsgException("当前用户不存在");
} }
JSONObject tokenJson;
if (!Objects.isNull(tbToken)) {
tokenJson = TokenUtil.parseParamFromToken(tbToken.getToken());
} else {
tokenJson = new JSONObject();
tokenJson.put("shopId", jsonObject.getInteger("shopId"));
tokenJson.put("staffId", jsonObject.getInteger("staffId"));
tokenJson.put("loginName", jsonObject.getString("loginName"));
}
Integer tokenId = tbToken.getId(); Integer tokenId = tbToken.getId();
Integer orderId = jsonObject.getInteger("orderId"); Integer orderId = jsonObject.getInteger("orderId");
JSONObject tokenJson = TokenUtil.parseParamFromToken(tbToken.getToken());
Integer shopId = tokenJson.getInteger("shopId"); Integer shopId = tokenJson.getInteger("shopId");
Integer userId = tokenJson.getInteger("staffId"); Integer userId = tokenJson.getInteger("staffId");
String loginName = tokenJson.getString("loginName"); String loginName = tokenJson.getString("loginName");
@@ -378,7 +386,7 @@ public class DutyService {
if (tbProductSku == null) { if (tbProductSku == null) {
return; return;
} }
TbProductWithBLOBs product = productMapper.selectByPrimaryKey(Integer.valueOf(tbProductSku.getProductId())); TbProduct product = productMapper.selectByPrimaryKey(Integer.valueOf(tbProductSku.getProductId()));
if (ObjectUtil.isNotEmpty(product)) { if (ObjectUtil.isNotEmpty(product)) {

View File

@@ -1,7 +1,10 @@
package com.chaozhanggui.system.cashierservice.service; package com.chaozhanggui.system.cashierservice.service;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.RandomUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.dao.*; import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*; import com.chaozhanggui.system.cashierservice.entity.*;
@@ -28,12 +31,10 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
@Service @Service
@@ -68,6 +69,15 @@ public class MemberService {
RestTemplate restTemplate; RestTemplate restTemplate;
@Autowired @Autowired
TbActivateMapper tbActivateMapper; TbActivateMapper tbActivateMapper;
@Autowired
TbShopCouponMapper couponMapper;
@Autowired
TbActivateInRecordMapper activateInRecordMapper;
@Autowired
TbCouponProductMapper couProductMapper;
@Resource
private TbActivateInRecordService activateInRecordService;
@Autowired @Autowired
TbmerchantAccountMapper tbmerchantAccountMapper; TbmerchantAccountMapper tbmerchantAccountMapper;
@Autowired @Autowired
@@ -369,36 +379,25 @@ public class MemberService {
flow.setIsReturn("0"); flow.setIsReturn("0");
tbShopUserFlowMapper.insert(flow); tbShopUserFlowMapper.insert(flow);
BigDecimal fl = null; //充值送积分
TbActivate activate = tbActivateMapper.selectByAmount(shopInfo.getId().toString(), memberIn.getAmount()); TbActivate activate = tbActivateMapper.selectByAmountScope(shopUser.getShopId(), memberIn.getAmount());
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) { if (ObjectUtil.isNotNull(activate)) {
BigDecimal awardAmount = BigDecimal.ZERO; tbActivateMapper.updateMemberPoints(Convert.toLong(shopUser.getId()),activate.getGiftAmount());
switch (activate.getHandselType()) { Map<String, Object> params = new HashMap<>();
case "GD": params.put("shopId", shopInfo.getId());
awardAmount = activate.getHandselNum(); params.put("memberId", shopUser.getId());
break; params.put("memberName", shopUser.getName());
case "RATIO": params.put("avatarUrl", shopUser.getHeadImg());
awardAmount = memberIn.getAmount().multiply(activate.getHandselNum()); params.put("mobile", shopUser.getTelephone());
break; params.put("content", StrUtil.format("充值¥{}送{}积分", amount, activate.getGiftPoints()));
} params.put("orderNo", memberIn.getOrderNo());
params.put("floatType", "add");
shopUser.setAmount(shopUser.getAmount().add(awardAmount)); params.put("floatPoints", activate.getGiftPoints());
shopUser.setUpdatedAt(System.currentTimeMillis()); tbActivateMapper.insertMemberPointsLog(params);
tbShopUserMapper.updateByPrimaryKeySelective(shopUser);
flow = new TbShopUserFlow();
flow.setShopUserId(shopUser.getId());
flow.setBizCode("scanMemberAwardIn");
flow.setType("+");
flow.setBizName("充值活动奖励");
flow.setAmount(awardAmount);
flow.setBalance(shopUser.getAmount());
flow.setCreateTime(new Date());
flow.setIsReturn("0");
tbShopUserFlowMapper.insert(flow);
fl = awardAmount;
} }
BigDecimal fl = giveActivate(shopUser, amount, flow.getId());
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("token", token); jsonObject.put("token", token);
jsonObject.put("type", "memberIn"); jsonObject.put("type", "memberIn");
@@ -436,6 +435,94 @@ public class MemberService {
} }
public BigDecimal giveActivate(TbShopUser tbShopUser, BigDecimal memAmount, Integer flowId) {
TbActivate activate = tbActivateMapper.selectByAmount(tbShopUser.getShopId(), memAmount);
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) {
if (activate.getIsUseCoupon() == 1) {
TbShopCoupon tbShopCoupon = couponMapper.queryById(activate.getCouponId());
Date start = new Date();
Date end = new Date();
if ("fixed".equals(tbShopCoupon.getValidityType())) {
//固定时间
end = DateUtil.offsetDay(new Date(),tbShopCoupon.getValidDays());
} else if ("custom".equals(tbShopCoupon.getValidityType())) {
//自定义时间
start = tbShopCoupon.getValidStartTime();
end = tbShopCoupon.getValidEndTime();
}
if (tbShopCoupon != null) {
List<TbActivateInRecord> actGiveRecords = new ArrayList<>();
if(tbShopCoupon.getType() == 1) {
//满减
TbActivateInRecord record = new TbActivateInRecord();
record.setVipUserId(Integer.valueOf(tbShopUser.getId()));
record.setCouponId(tbShopCoupon.getId());
record.setName("" + tbShopCoupon.getFullAmount() + "" + tbShopCoupon.getDiscountAmount());
record.setFullAmount(tbShopCoupon.getFullAmount());
record.setDiscountAmount(tbShopCoupon.getDiscountAmount());
record.setType(1);
record.setNum(activate.getNum());
record.setOverNum(activate.getNum());
record.setShopId(Integer.valueOf(tbShopUser.getShopId()));
record.setSourceActId(activate.getId());
record.setSourceFlowId(flowId);
record.setUseStartTime(start);
record.setUseEndTime(end);
record.setSource("activate");
record.setCouponJson(activateInRecordService.getCouponJson(activate,tbShopCoupon,null));
actGiveRecords.add(record);
} else if (tbShopCoupon.getType() == 2) {
//商品卷
List<TbCouponProduct> tbCouponProducts = couProductMapper.queryAllByCouponId(tbShopCoupon.getId());
for (TbCouponProduct actPro : tbCouponProducts) {
TbActivateInRecord record = new TbActivateInRecord();
record.setVipUserId(tbShopUser.getId());
record.setCouponId(tbShopCoupon.getId());
record.setName("商品卷");
record.setType(2);
record.setProId(actPro.getProductId());
record.setNum(actPro.getNum()*tbShopCoupon.getNumber());
record.setOverNum(actPro.getNum()*tbShopCoupon.getNumber());
record.setShopId(Integer.valueOf(tbShopUser.getShopId()));
record.setSourceActId(activate.getId());
record.setSourceFlowId(flowId);
record.setUseStartTime(start);
record.setUseEndTime(end);
record.setSource("activate");
record.setCouponJson(activateInRecordService.getCouponJson(activate,tbShopCoupon,actPro));
actGiveRecords.add(record);
}
}
activateInRecordMapper.insertBatch(actGiveRecords);
tbShopCoupon.setLeftNumber(tbShopCoupon.getLeftNumber()-activate.getNum());
couponMapper.update(tbShopCoupon);
}
}
BigDecimal amount = activate.getGiftAmount() == null ?
BigDecimal.ZERO : new BigDecimal(activate.getGiftAmount());
tbShopUser.setAmount(tbShopUser.getAmount().add(amount));
tbShopUser.setUpdatedAt(System.currentTimeMillis());
tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser);
TbShopUserFlow flow = new TbShopUserFlow();
flow.setShopUserId(Integer.valueOf(tbShopUser.getId()));
flow.setBizCode("scanMemberAwardIn");
flow.setBizName("充值活动奖励");
flow.setType("+");
flow.setAmount(amount);
flow.setBalance(tbShopUser.getAmount());
flow.setCreateTime(new Date());
flow.setIsReturn("0");
tbShopUserFlowMapper.insert(flow);
return amount;
}
return null;
}
public Result queryScanPay(String flowId, String token) { public Result queryScanPay(String flowId, String token) {
if (ObjectUtil.isEmpty(flowId)) { if (ObjectUtil.isEmpty(flowId)) {
return Result.fail(CodeEnum.PARAM); return Result.fail(CodeEnum.PARAM);
@@ -521,20 +608,12 @@ public class MemberService {
flow.setBalance(shopUser.getAmount()); flow.setBalance(shopUser.getAmount());
flow.setIsReturn("0"); flow.setIsReturn("0");
flow.setCreateTime(new Date()); flow.setCreateTime(new Date());
flow.setRemark(memberIn.getOrderNo());
tbShopUserFlowMapper.insert(flow); tbShopUserFlowMapper.insert(flow);
TbActivate activate = tbActivateMapper.selectByAmount(shopUser.getId().toString(), memberIn.getAmount()); TbActivate activate = tbActivateMapper.selectByAmount(shopUser.getId().toString(), memberIn.getAmount());
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) { if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) {
BigDecimal awardAmount = BigDecimal.ZERO; BigDecimal awardAmount = activate.getGiftAmount() == null ? BigDecimal.ZERO : new BigDecimal(activate.getGiftAmount());
switch (activate.getHandselType()) {
case "GD":
awardAmount = activate.getHandselNum();
break;
case "RATIO":
awardAmount = memberIn.getAmount().multiply(activate.getHandselNum());
break;
}
shopUser.setAmount(shopUser.getAmount().add(awardAmount)); shopUser.setAmount(shopUser.getAmount().add(awardAmount));
shopUser.setUpdatedAt(System.currentTimeMillis()); shopUser.setUpdatedAt(System.currentTimeMillis());
@@ -549,7 +628,7 @@ public class MemberService {
flow.setBalance(shopUser.getAmount()); flow.setBalance(shopUser.getAmount());
flow.setIsReturn("0"); flow.setIsReturn("0");
flow.setCreateTime(new Date()); flow.setCreateTime(new Date());
tbShopUserFlowMapper.insert(flow);
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("token", token); jsonObject.put("token", token);
@@ -567,8 +646,23 @@ public class MemberService {
baObj.put("type", "充值"); baObj.put("type", "充值");
baObj.put("time", flow.getCreateTime()); baObj.put("time", flow.getCreateTime());
producer.balance(baObj.toString()); producer.balance(baObj.toString());
}
tbShopUserFlowMapper.insert(flow); //充值送积分
activate = tbActivateMapper.selectByAmountScope(shopUser.getShopId(), memberIn.getAmount());
if (ObjectUtil.isNotNull(activate)) {
tbActivateMapper.updateMemberPoints(Convert.toLong(shopUser.getId()),activate.getGiftAmount());
Map<String, Object> params = new HashMap<>();
params.put("shopId", shopUser.getShopId());
params.put("memberId", shopUser.getId());
params.put("memberName", shopUser.getName());
params.put("avatarUrl", shopUser.getHeadImg());
params.put("mobile", shopUser.getTelephone());
params.put("content", StrUtil.format("充值¥{}送{}积分", memberIn.getAmount(), activate.getGiftPoints()));
params.put("orderNo", memberIn.getOrderNo());
params.put("floatType", "add");
params.put("floatPoints", activate.getGiftPoints());
tbActivateMapper.insertMemberPointsLog(params);
} }
return Result.success(CodeEnum.SUCCESS, memberIn); return Result.success(CodeEnum.SUCCESS, memberIn);
@@ -671,38 +765,24 @@ public class MemberService {
flow.get().setCreateTime(new Date()); flow.get().setCreateTime(new Date());
flow.get().setIsReturn("0"); flow.get().setIsReturn("0");
tbShopUserFlowMapper.insert(flow.get()); tbShopUserFlowMapper.insert(flow.get());
fl.set(giveActivate(shopUser, amount, flow.get().getId()));
TbActivate activate = tbActivateMapper.selectByAmount(shopInfo.getId().toString(), memberIn.getAmount()); //充值送积分
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) { TbActivate activate = tbActivateMapper.selectByAmountScope(shopUser.getShopId(), memberIn.getAmount());
BigDecimal awardAmount = BigDecimal.ZERO; if (ObjectUtil.isNotNull(activate)) {
switch (activate.getHandselType()) { tbActivateMapper.updateMemberPoints(Convert.toLong(shopUser.getId()),activate.getGiftAmount());
case "GD": Map<String, Object> params = new HashMap<>();
awardAmount = activate.getHandselNum(); params.put("shopId", shopInfo.getId());
break; params.put("memberId", shopUser.getId());
case "RATIO": params.put("memberName", shopUser.getName());
awardAmount = memberIn.getAmount().multiply(activate.getHandselNum()); params.put("avatarUrl", shopUser.getHeadImg());
break; params.put("mobile", shopUser.getTelephone());
} params.put("content", StrUtil.format("充值¥{}送{}积分", amount, activate.getGiftPoints()));
params.put("orderNo", memberIn.getOrderNo());
shopUser.setAmount(shopUser.getAmount().add(awardAmount)); params.put("floatType", "add");
shopUser.setUpdatedAt(System.currentTimeMillis()); params.put("floatPoints", activate.getGiftPoints());
tbShopUserMapper.updateByPrimaryKeySelective(shopUser); tbActivateMapper.insertMemberPointsLog(params);
flow.set(new TbShopUserFlow());
flow.get().setShopUserId(shopUser.getId());
flow.get().setBizCode("scanMemberAwardIn");
flow.get().setType("+");
flow.get().setBizName("充值活动奖励");
flow.get().setAmount(awardAmount);
flow.get().setBalance(shopUser.getAmount());
flow.get().setCreateTime(new Date());
flow.get().setIsReturn("0");
tbShopUserFlowMapper.insert(flow.get());
fl.set(awardAmount);
} }
return null; return null;
}); });
@@ -717,14 +797,12 @@ public class MemberService {
JSONObject baObj = new JSONObject(); JSONObject baObj = new JSONObject();
baObj.put("userId", shopUser.getUserId()); baObj.put("userId", shopUser.getUserId());
baObj.put("shopId", shopInfo.getId()); baObj.put("shopId", shopInfo.getId());
baObj.put("amount", ObjectUtil.isNull(fl) ? amount : amount.add(fl.get())); baObj.put("amount", ObjectUtil.isNull(fl.get()) ? amount : amount.add(fl.get()));
baObj.put("balance", shopUser.getAmount()); baObj.put("balance", shopUser.getAmount());
baObj.put("type", "充值"); baObj.put("type", "充值");
baObj.put("time", flow.get().getCreateTime()); baObj.put("time", flow.get().getCreateTime());
producer.balance(baObj.toString()); producer.balance(baObj.toString());
return Result.success(CodeEnum.SUCCESS); return Result.success(CodeEnum.SUCCESS);
} }
@@ -852,5 +930,4 @@ public class MemberService {
} }
} }

View File

@@ -1,9 +1,12 @@
package com.chaozhanggui.system.cashierservice.service; package com.chaozhanggui.system.cashierservice.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.entity.TbCashierCart; import com.chaozhanggui.system.cashierservice.entity.TbCashierCart;
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail; import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
import java.util.List;
/** /**
* (TbShopPermission)表服务接口 * (TbShopPermission)表服务接口
* *
@@ -12,5 +15,26 @@ import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
*/ */
public interface MpCashierCartService extends IService<TbCashierCart> { public interface MpCashierCartService extends IService<TbCashierCart> {
/**
* 根据id修改状态
* @param cartIds id
* @param status 状态
* @return 是否成功
*/
boolean updateStateByIds(Integer shopId, List<Integer> cartIds, TableConstant.Status status);
/**
* 根据订单id更改购物车状态
* @param status 状态
* @param orderId 订单id
*/
boolean updateStateByOrderId(TableConstant.OrderInfo.Status status, Integer orderId);
/**
* 获取购物车信息
* @return 购物车列表
*/
List<TbCashierCart> selectCart(String useType, String masterId, Integer orderId, Integer shopId, TableConstant.OrderInfo.Status... statusList);
} }

View File

@@ -1,10 +1,13 @@
package com.chaozhanggui.system.cashierservice.service; package com.chaozhanggui.system.cashierservice.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail; import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
import com.chaozhanggui.system.cashierservice.entity.TbShopPermission; import com.chaozhanggui.system.cashierservice.entity.TbShopPermission;
import com.chaozhanggui.system.cashierservice.sign.Result; import com.chaozhanggui.system.cashierservice.sign.Result;
import java.util.List;
/** /**
* (TbShopPermission)表服务接口 * (TbShopPermission)表服务接口
* *
@@ -13,5 +16,26 @@ import com.chaozhanggui.system.cashierservice.sign.Result;
*/ */
public interface MpOrderDetailService extends IService<TbOrderDetail> { public interface MpOrderDetailService extends IService<TbOrderDetail> {
/**
* 根据购物车id修改详情状态
* @param shopId 店铺id
* @param cartIds 购物车id
* @param status 状态
* @return 是否成功
*/
boolean updateStateByCartIds(Integer shopId, List<Integer> cartIds, TableConstant.Status status);
/**
* 根据购物车id删除订单详情
* @param cartIds 购物车id
* @return 是否成功
*/
boolean removeByCartIds(List<Integer> cartIds);
/**
* 根据订单id删除详情
* @param orderId 订单id
*/
boolean removeByOrderId(String orderId);
} }

View File

@@ -0,0 +1,27 @@
package com.chaozhanggui.system.cashierservice.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
import java.util.List;
/**
* (TbShopPermission)表服务接口
*
* @author makejava
* @since 2024-09-14 17:08:48
*/
public interface MpOrderInfoService extends IService<TbOrderInfo> {
/**
* 根据id修改详情状态
* @param shopId 店铺id
* @param orderId 订单id
* @param status 状态
* @return 是否成功
*/
boolean updateStateById(Integer shopId, Integer orderId, TableConstant.Status status);
}

View File

@@ -0,0 +1,19 @@
package com.chaozhanggui.system.cashierservice.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.entity.TbCashierCart;
import com.chaozhanggui.system.cashierservice.entity.TbShopTable;
import java.util.List;
/**
* (TbShopPermission)表服务接口
*
* @author makejava
* @since 2024-09-14 17:08:48
*/
public interface MpShopTableService extends IService<TbShopTable> {
}

View File

@@ -95,6 +95,8 @@ public class OrderService {
private final TbShopOpenIdMapper shopOpenIdMapper; private final TbShopOpenIdMapper shopOpenIdMapper;
private final MpShopTableMapper mpShopTableMapper; private final MpShopTableMapper mpShopTableMapper;
private final MpOrderInfoService mpOrderInfoService;
private final MpShopTableService mpShopTableService;
@Autowired @Autowired
TbConsInfoMapper tbConsInfoMapper; TbConsInfoMapper tbConsInfoMapper;
@@ -131,12 +133,14 @@ public class OrderService {
public OrderService(WxAccountUtil wxAccountUtil, MPCashierCartMapper mpCashierCartMapper, public OrderService(WxAccountUtil wxAccountUtil, MPCashierCartMapper mpCashierCartMapper,
TbShopOpenIdMapper shopOpenIdMapper, MpShopTableMapper mpShopTableMapper, TbShopOpenIdMapper shopOpenIdMapper, MpShopTableMapper mpShopTableMapper, MpOrderInfoService mpOrderInfoService, MpShopTableService mpShopTableService,
TbCashierCartMapper tbCashierCartMapper, MpCashierCartService mpCashierCartService) { TbCashierCartMapper tbCashierCartMapper, MpCashierCartService mpCashierCartService) {
this.wxAccountUtil = wxAccountUtil; this.wxAccountUtil = wxAccountUtil;
this.mpCashierCartMapper = mpCashierCartMapper; this.mpCashierCartMapper = mpCashierCartMapper;
this.shopOpenIdMapper = shopOpenIdMapper; this.shopOpenIdMapper = shopOpenIdMapper;
this.mpShopTableMapper = mpShopTableMapper; this.mpShopTableMapper = mpShopTableMapper;
this.mpOrderInfoService = mpOrderInfoService;
this.mpShopTableService = mpShopTableService;
this.tbCashierCartMapper = tbCashierCartMapper; this.tbCashierCartMapper = tbCashierCartMapper;
this.mpCashierCartService = mpCashierCartService; this.mpCashierCartService = mpCashierCartService;
} }
@@ -160,8 +164,10 @@ public class OrderService {
boolean isDineInAfter = !isMunchies && !isTakeout; boolean isDineInAfter = !isMunchies && !isTakeout;
boolean isDineInBefore = isMunchies && !isTakeout; boolean isDineInBefore = isMunchies && !isTakeout;
boolean needSeatFee = !isTakeout && (shopInfo.getIsTableFee() == null || shopInfo.getIsTableFee() == 0);
boolean isMemberPrice = shopInfo.getIsMemberPrice() != null && shopInfo.getIsMemberPrice() == 1;
return new ShopEatTypeInfoDTO(isTakeout, isMunchies, isDineInAfter, isDineInBefore, shopInfo, isTakeout ? OrderUseTypeEnum.TAKEOUT.getValue() : return new ShopEatTypeInfoDTO(isTakeout, isMunchies, isDineInAfter, isDineInBefore, needSeatFee, isMemberPrice, shopInfo, isTakeout ? OrderUseTypeEnum.TAKEOUT.getValue() :
isMunchies ? OrderUseTypeEnum.DINE_IN_BEFORE.getValue() : OrderUseTypeEnum.DINE_IN_AFTER.getValue(), isTakeout ? OrderSendTypeEnums.TAKE_SELF.getValue() : OrderSendTypeEnums.TABLE.getValue()); isMunchies ? OrderUseTypeEnum.DINE_IN_BEFORE.getValue() : OrderUseTypeEnum.DINE_IN_AFTER.getValue(), isTakeout ? OrderSendTypeEnums.TAKE_SELF.getValue() : OrderSendTypeEnums.TABLE.getValue());
} }
@@ -176,26 +182,9 @@ public class OrderService {
String eatModel = StrUtil.isBlank(tableId) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue(); String eatModel = StrUtil.isBlank(tableId) ? ShopInfoEatModelEnum.TAKE_OUT.getValue() : ShopInfoEatModelEnum.DINE_IN.getValue();
ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(shopId, eatModel); ShopEatTypeInfoDTO shopEatTypeInfoDTO = checkEatModel(shopId, eatModel);
TbProduct product = mpProductMapper.selectOne(new LambdaQueryWrapper<TbProduct>()
.eq(TbProduct::getId, productId)
.eq(TbProduct::getStatus, 1));
if (ObjectUtil.isEmpty(product)) {
return Result.fail(CodeEnum.PRODUCTINFOERROR);
}
TbProductSkuWithBLOBs skuWithBLOBs;
if ("1".equals(product.getTypeEnum())) {
skuWithBLOBs = tbProductSkuMapper.selectByProduct(productId);
} else {
skuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(skuId);
}
if (ObjectUtil.isEmpty(skuWithBLOBs)) {
return Result.fail(CodeEnum.PRODUCTSKUERROR);
}
// 台桌点单 // 台桌点单
boolean isSeatCart = TableConstant.CashierCart.ID.equals(productId.toString());
if ((StrUtil.isNotBlank(tableId))) { if ((StrUtil.isNotBlank(tableId))) {
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaUpdateWrapper<TbShopTable>() TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaUpdateWrapper<TbShopTable>()
.eq(TbShopTable::getQrcode, tableId) .eq(TbShopTable::getQrcode, tableId)
@@ -204,6 +193,9 @@ public class OrderService {
if (shopTable == null) { if (shopTable == null) {
return Result.fail("台桌不处于开台或空闲状态"); return Result.fail("台桌不处于开台或空闲状态");
} }
if (shopEatTypeInfoDTO.isNeedSeatFee() && number > shopTable.getMaxCapacity() && isSeatCart) {
return Result.fail("当前台桌最大人数未: " + shopTable.getMaxCapacity());
}
} }
LambdaQueryWrapper<TbCashierCart> cartQuery = new LambdaQueryWrapper<TbCashierCart>() LambdaQueryWrapper<TbCashierCart> cartQuery = new LambdaQueryWrapper<TbCashierCart>()
@@ -213,60 +205,78 @@ public class OrderService {
.in(TbCashierCart::getStatus, "create") .in(TbCashierCart::getStatus, "create")
.eq(TbCashierCart::getId, cartId); .eq(TbCashierCart::getId, cartId);
// 后付款订单只查询为空的
if (shopEatTypeInfoDTO.isDineInAfter()) {
cartQuery.isNull(TbCashierCart::getPlaceNum);
}
TbCashierCart cart = mpCashierCartMapper.selectOne(cartQuery); TbCashierCart cart = mpCashierCartMapper.selectOne(cartQuery);
// 校验是否是代客下单往期订单 // 校验是否是代客下单往期订单
if (shopEatTypeInfoDTO.isDineInAfter() && cart != null && cart.getPlaceNum() != null) { if (shopEatTypeInfoDTO.isDineInAfter() && cart != null && cart.getPlaceNum() != null && !isSeatCart) {
return Result.fail("后付费已下单订单仅支持退款"); return Result.fail("后付费已下单订单仅支持退款");
} }
TbProduct product = null;
TbProductSkuWithBLOBs skuWithBLOBs = null;
if (!isSeatCart) {
product = mpProductMapper.selectOne(new LambdaQueryWrapper<TbProduct>()
.eq(TbProduct::getId, productId)
.eq(TbProduct::getStatus, 1));
if (ObjectUtil.isEmpty(product)) {
return Result.fail(CodeEnum.PRODUCTINFOERROR);
}
// 首次加入购物车,并且拥有起售数,设置为起售数
if (cart == null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0) {
number = skuWithBLOBs.getSuit();
// 低于起售,删除商品
} else if (cart != null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0 && number < skuWithBLOBs.getSuit()) {
delCart(masterId, cartId);
if (StrUtil.isNotBlank(cart.getOrderId()) && StrUtil.isNotBlank(cart.getTableId())) {
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
.notIn(TbCashierCart::getStatus, "final", "refund", "closed", "pending")
.eq(TbCashierCart::getShopId, cart.getShopId());
TbCashierCart finalCart = cart; if ("1".equals(product.getTypeEnum())) {
queryWrapper.eq(TbCashierCart::getTableId, cart.getTableId()) skuWithBLOBs = tbProductSkuMapper.selectByProduct(productId);
.and(q -> q.or( } else {
query -> query.eq(TbCashierCart::getMasterId, finalCart.getMasterId()) skuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(skuId);
.or() }
.isNull(TbCashierCart::getMasterId)
.or()
.eq(TbCashierCart::getMasterId, "")
)
.or(query -> query.eq(TbCashierCart::getOrderId, finalCart.getOrderId())
.or()
.isNull(TbCashierCart::getOrderId)));
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper.eq(TbCashierCart::getStatus, "create"));
if (list.isEmpty()) { if (ObjectUtil.isEmpty(skuWithBLOBs)) {
tbOrderInfoMapper.deleteByPrimaryKey(Integer.valueOf(finalCart.getOrderId())); return Result.fail(CodeEnum.PRODUCTSKUERROR);
}
// 首次加入购物车,并且拥有起售数,设置为起售数
if (cart == null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0) {
number = skuWithBLOBs.getSuit();
// 低于起售,删除商品
} else if (cart != null && skuWithBLOBs.getSuit() != null && skuWithBLOBs.getSuit() != 0 && number < skuWithBLOBs.getSuit()) {
delCart(masterId, cartId);
if (StrUtil.isNotBlank(cart.getOrderId()) && StrUtil.isNotBlank(cart.getTableId())) {
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
.notIn(TbCashierCart::getStatus, "final", "refund", "closed", "pending")
.eq(TbCashierCart::getShopId, cart.getShopId());
TbCashierCart finalCart = cart;
queryWrapper.eq(TbCashierCart::getTableId, cart.getTableId())
.and(q -> q.or(
query -> query.eq(TbCashierCart::getMasterId, finalCart.getMasterId())
.or()
.isNull(TbCashierCart::getMasterId)
.or()
.eq(TbCashierCart::getMasterId, "")
)
.or(query -> query.eq(TbCashierCart::getOrderId, finalCart.getOrderId())
.or()
.isNull(TbCashierCart::getOrderId)));
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper.eq(TbCashierCart::getStatus, "create"));
if (list.isEmpty()) {
tbOrderInfoMapper.deleteByPrimaryKey(Integer.valueOf(cart.getOrderId()));
}
}
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cart), false);
return Result.success(CodeEnum.SUCCESS, masterId);
}
// 校验库存
if ("1".equals(product.getIsStock().toString())) {
if (product.getStockNumber() - number < 0) {
return Result.fail(CodeEnum.STOCKERROR);
} }
} }
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cart), false);
return Result.success(CodeEnum.SUCCESS, masterId);
} }
// 校验库存
if ("1".equals(product.getIsStock().toString())) {
if (product.getStockNumber() - number < 0) {
return Result.fail(CodeEnum.STOCKERROR);
}
}
if (StringUtils.isEmpty(masterId)) { if (StringUtils.isEmpty(masterId)) {
boolean flag = redisUtil.exists("SHOP:CODE:" + clientType + ":" + shopId); boolean flag = redisUtil.exists("SHOP:CODE:" + clientType + ":" + shopId);
if (flag) { if (flag) {
@@ -302,10 +312,18 @@ public class OrderService {
if (isPack.equals("false")) { if (isPack.equals("false")) {
cart.setPackFee(BigDecimal.ZERO); cart.setPackFee(BigDecimal.ZERO);
} else { } else {
cart.setPackFee(new BigDecimal(number).multiply(product.getPackFee())); if (!isSeatCart) {
cart.setPackFee(new BigDecimal(number).multiply(product.getPackFee()));
}else{
cart.setPackFee(BigDecimal.ZERO);
}
} }
if (isGift.equals("false")) { if (isGift.equals("false")) {
cart.setTotalAmount(new BigDecimal(number).multiply(skuWithBLOBs.getSalePrice()).add(cart.getPackFee())); if (!isSeatCart) {
cart.setTotalAmount(new BigDecimal(number).multiply(skuWithBLOBs.getSalePrice()).add(cart.getPackFee()));
}else {
cart.setTotalAmount(new BigDecimal(number).multiply(cart.getSalePrice()).add(cart.getPackFee()));
}
} else { } else {
cart.setTotalAmount(BigDecimal.ZERO); cart.setTotalAmount(BigDecimal.ZERO);
} }
@@ -322,31 +340,44 @@ public class OrderService {
if (Objects.isNull(cashierCart)) { if (Objects.isNull(cashierCart)) {
cashierCart = new TbCashierCart(); cashierCart = new TbCashierCart();
cashierCart.setUseType(shopEatTypeInfoDTO.getUseType()); cashierCart.setUseType(shopEatTypeInfoDTO.getUseType());
cashierCart.setCoverImg(product.getCoverImg()); if (product != null) {
cashierCart.setCoverImg(product.getCoverImg());
cashierCart.setIsSku(product.getTypeEnum());
cashierCart.setName(product.getName());
cashierCart.setCategoryId(product.getCategoryId());
}
cashierCart.setCreatedAt(System.currentTimeMillis()); cashierCart.setCreatedAt(System.currentTimeMillis());
cashierCart.setIsSku(product.getTypeEnum());
cashierCart.setMasterId(masterId); cashierCart.setMasterId(masterId);
cashierCart.setUuid(uuid); cashierCart.setUuid(uuid);
cashierCart.setMerchantId(userId); cashierCart.setMerchantId(userId);
cashierCart.setName(product.getName());
cashierCart.setProductId(productId.toString()); cashierCart.setProductId(productId.toString());
cashierCart.setSalePrice(skuWithBLOBs.getSalePrice()); if (skuWithBLOBs != null) {
cashierCart.setSkuId(skuWithBLOBs.getId().toString()); cashierCart.setSalePrice(skuWithBLOBs.getSalePrice());
cashierCart.setSkuId(skuWithBLOBs.getId().toString());
cashierCart.setSkuName(skuWithBLOBs.getSpecSnap());
cashierCart.setMemberPrice(skuWithBLOBs.getMemberPrice());
cashierCart.setIsMember(0);
}
cashierCart.setShopId(shopId.toString()); cashierCart.setShopId(shopId.toString());
cashierCart.setTradeDay(DateUtils.getDay()); cashierCart.setTradeDay(DateUtils.getDay());
cashierCart.setStatus("create"); cashierCart.setStatus("create");
cashierCart.setIsPack(isPack); cashierCart.setIsPack(isPack);
cashierCart.setIsGift(isGift); cashierCart.setIsGift(isGift);
cashierCart.setSkuName(skuWithBLOBs.getSpecSnap());
if (isGift.equals("false")) { if (isGift.equals("false")) {
cashierCart.setTotalAmount(new BigDecimal(number).multiply(skuWithBLOBs.getSalePrice())); if (isSeatCart) {
cashierCart.setTotalAmount(new BigDecimal(number).multiply(cashierCart.getSalePrice()));
}else {
cashierCart.setTotalAmount(new BigDecimal(number).multiply(skuWithBLOBs.getSalePrice()));
}
} else { } else {
cashierCart.setTotalAmount(BigDecimal.ZERO); cashierCart.setTotalAmount(BigDecimal.ZERO);
} }
if (isPack.equals("false")) { if (isPack.equals("false")) {
cashierCart.setPackFee(BigDecimal.ZERO); cashierCart.setPackFee(BigDecimal.ZERO);
} else { } else {
cashierCart.setPackFee(new BigDecimal(number).multiply(product.getPackFee())); if (!isSeatCart) {
cashierCart.setPackFee(new BigDecimal(number).multiply(product.getPackFee()));
}
cashierCart.setTotalAmount(cashierCart.getTotalAmount().add(cashierCart.getPackFee())); cashierCart.setTotalAmount(cashierCart.getTotalAmount().add(cashierCart.getPackFee()));
} }
@@ -354,7 +385,6 @@ public class OrderService {
cashierCart.setUserId(Integer.valueOf(userId)); cashierCart.setUserId(Integer.valueOf(userId));
cashierCart.setNumber(number); cashierCart.setNumber(number);
cashierCart.setUuid(uuid); cashierCart.setUuid(uuid);
cashierCart.setCategoryId(product.getCategoryId());
cashierCart.setTableId(tableId); cashierCart.setTableId(tableId);
cashierCart.setPlatformType(OrderPlatformTypeEnum.CASH.getValue()); cashierCart.setPlatformType(OrderPlatformTypeEnum.CASH.getValue());
list.add(cashierCart); list.add(cashierCart);
@@ -368,7 +398,9 @@ public class OrderService {
if (isPack.equals("false")) { if (isPack.equals("false")) {
cashierCart.setPackFee(BigDecimal.ZERO); cashierCart.setPackFee(BigDecimal.ZERO);
} else { } else {
cashierCart.setPackFee(new BigDecimal(number).multiply(product.getPackFee())); if (!isSeatCart) {
cashierCart.setPackFee(new BigDecimal(number).multiply(product.getPackFee()));
}
} }
cashierCart.setTotalAmount(new BigDecimal(cashierCart.getNumber()).multiply(skuWithBLOBs.getSalePrice()).add(cashierCart.getPackFee())); cashierCart.setTotalAmount(new BigDecimal(cashierCart.getNumber()).multiply(skuWithBLOBs.getSalePrice()).add(cashierCart.getPackFee()));
mpCashierCartMapper.updateById(cashierCart); mpCashierCartMapper.updateById(cashierCart);
@@ -378,15 +410,6 @@ public class OrderService {
} }
// TbCashierCart finalCart1 = cart;
// ThreadUtil.execute(() -> {
// ThreadUtil.sleep(1, TimeUnit.SECONDS);
// if (finalCart1.getOrderId() != null && finalCart1.getTableId() != null) {
// log.info("购物车数量改变,开始校验订单是否为空");
// printMechineConsumer.printReturnTicket(Integer.valueOf(finalCart1.getOrderId()), tbOrderDetailMapper.selectAllByOrderId(Integer.valueOf(finalCart1.getOrderId())));
// }
// });
setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cart), true); setRedisTableCartInfo(tableId, shopId, Collections.singletonList(cart), true);
return Result.success(CodeEnum.SUCCESS, masterId); return Result.success(CodeEnum.SUCCESS, masterId);
@@ -498,12 +521,47 @@ public class OrderService {
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper); List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper);
AtomicReference<TbCashierCart> mealCashierCart = new AtomicReference<>(); AtomicReference<TbCashierCart> mealCashierCart = new AtomicReference<>();
list.forEach(item -> { ArrayList<TbCashierCart> returnCashierCarts = new ArrayList<>();
item.setPlaceNum(item.getPlaceNum() == null ? 0 : item.getPlaceNum()); String orderId = null;
if (item.getProductId().equals("-999")) { for (TbCashierCart cart : list) {
mealCashierCart.set(item); if (cart.getOrderId() != null) {
orderId = cart.getOrderId();
} }
}); if (TableConstant.CashierCart.Status.RETURN.equalsVals(cart.getStatus())) {
returnCashierCarts.add(cart);
}
cart.setPlaceNum(cart.getPlaceNum() == null ? 0 : cart.getPlaceNum());
if (cart.getProductId().equals("-999")) {
mealCashierCart.set(cart);
}
}
// 检查购物车商品是否已经全部退款
if (!returnCashierCarts.isEmpty() && returnCashierCarts.size() == list.size()) {
List<Integer> cartIds = returnCashierCarts.stream().map(TbCashierCart::getId).collect(Collectors.toList());
mpCashierCartService.removeByIds(cartIds);
// mpCashierCartService.updateStateByIds(Integer.valueOf(shopId), cartIds, TableConstant.Status.CLOSED);
// mpOrderDetailService.updateStateByCartIds(Integer.valueOf(shopId), cartIds, TableConstant.Status.CLOSED);
mpOrderDetailService.removeByCartIds(cartIds);
if (StrUtil.isNotBlank(orderId)) {
mpOrderInfoService.removeById(orderId);
// mpOrderInfoService.updateStateById(Integer.valueOf(shopId), Integer.valueOf(orderId), TableConstant.Status.CANCELLED);
}
String finalMasterId = masterId;
return Result.success(CodeEnum.SUCCESS, new HashMap<String, Object>(){{
put("list", new ArrayList<>());
put("masterId", finalMasterId);
put("num", 0);
put("seatFee", null);
put("amount", new HashMap<String, Object>(){{
put("packAmount", 0);
put("productNum", 0);
put("productSum", 0);
put("totalAmount", 0);
}});
}});
}
// 根据placeNum进行分组 // 根据placeNum进行分组
Map<Integer, List<TbCashierCart>> groupedByPlaceNum = list.stream() Map<Integer, List<TbCashierCart>> groupedByPlaceNum = list.stream()
@@ -532,15 +590,18 @@ public class OrderService {
if (StrUtil.isNotBlank(cashierCart.getMasterId())) { if (StrUtil.isNotBlank(cashierCart.getMasterId())) {
masterId = cashierCart.getMasterId(); masterId = cashierCart.getMasterId();
} }
totalAmount = totalAmount.add(cashierCart.getTotalAmount()); boolean isReturn = TableConstant.CashierCart.Status.RETURN.equalsVals(cashierCart.getStatus());
if (cashierCart.getIsPack().equals("true")) { if (!isReturn) {
totalAmount = totalAmount.add(cashierCart.getTotalAmount());
}
if (cashierCart.getIsPack().equals("true") && !isReturn) {
packAmount = packAmount.add(cashierCart.getPackFee()); packAmount = packAmount.add(cashierCart.getPackFee());
} }
TbProductSkuWithBLOBs skuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId())); TbProductSkuWithBLOBs skuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId()));
if (Objects.nonNull(skuWithBLOBs)) { if (Objects.nonNull(skuWithBLOBs)) {
cashierCart.setSkuName(skuWithBLOBs.getSpecSnap()); cashierCart.setSkuName(skuWithBLOBs.getSpecSnap());
} }
TbProductWithBLOBs tbProduct = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); TbProduct tbProduct = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId()));
if (Objects.nonNull(tbProduct)) { if (Objects.nonNull(tbProduct)) {
cashierCart.setSelectSpec(tbProduct.getSelectSpec()); cashierCart.setSelectSpec(tbProduct.getSelectSpec());
if (tbProduct.getSpecId() != null) { if (tbProduct.getSpecId() != null) {
@@ -582,7 +643,7 @@ public class OrderService {
return Result.success(CodeEnum.SUCCESS, returnCart(dto)); return Result.success(CodeEnum.SUCCESS, returnCart(dto));
} }
TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId()));
if (ObjectUtil.isEmpty(product)) { if (ObjectUtil.isEmpty(product)) {
return Result.fail(CodeEnum.PRODUCTINFOERROR); return Result.fail(CodeEnum.PRODUCTINFOERROR);
} }
@@ -597,8 +658,6 @@ public class OrderService {
List<String> skuIds = new ArrayList<>(); List<String> skuIds = new ArrayList<>();
skuIds.add(cashierCart.getSkuId()); skuIds.add(cashierCart.getSkuId());
cashierCartMapper.deleteByPrimaryKey(cartId); cashierCartMapper.deleteByPrimaryKey(cartId);
if (StrUtil.isNotBlank(cashierCart.getOrderId()) && StrUtil.isNotBlank(cashierCart.getTableId())) { if (StrUtil.isNotBlank(cashierCart.getOrderId()) && StrUtil.isNotBlank(cashierCart.getTableId())) {
@@ -629,10 +688,10 @@ public class OrderService {
tbOrderInfoMapper.deleteByPrimaryKey(Integer.valueOf(cashierCart.getOrderId())); tbOrderInfoMapper.deleteByPrimaryKey(Integer.valueOf(cashierCart.getOrderId()));
}); });
} }
} }
checkTakeOutEmptyAndClear(cashierCart);
if (StrUtil.isNotBlank(cashierCart.getTableId())) { if (StrUtil.isNotBlank(cashierCart.getTableId())) {
setRedisTableCartInfo(cashierCart.getTableId(), cashierCart.getShopId(), Collections.singletonList(cashierCart), false); setRedisTableCartInfo(cashierCart.getTableId(), cashierCart.getShopId(), Collections.singletonList(cashierCart), false);
} }
@@ -641,9 +700,23 @@ public class OrderService {
return Result.success(CodeEnum.SUCCESS); return Result.success(CodeEnum.SUCCESS);
} }
/**
* 检查订单购物车是否为空并删除订单
*/
private void checkTakeOutEmptyAndClear(TbCashierCart cashierCart) {
if (!TableConstant.OrderInfo.UseType.TAKEOUT.equalsVals(cashierCart.getUseType())) {
return;
}
List<TbCashierCart> cashierCarts = mpCashierCartService.selectCart(cashierCart.getUseType(), cashierCart.getMasterId(), cashierCart.getOrderId() == null ? null : Integer.valueOf(cashierCart.getOrderId()), Integer.valueOf(cashierCart.getShopId()));
if (cashierCarts.isEmpty() && cashierCart.getOrderId() != null) {
mpOrderDetailService.removeByOrderId(cashierCart.getOrderId());
mpOrderInfoService.removeById(cashierCart.getOrderId());
}
}
private TbOrderInfo getCurrentOrder(ShopEatTypeInfoDTO eatTypeInfoDTO, String tableId, Object shopId) { private TbOrderInfo getCurrentOrder(ShopEatTypeInfoDTO eatTypeInfoDTO, String tableId, Object shopId) {
// 获取当前台桌最新订单,先付款模式不获取 // 获取当前台桌最新订单,先付款模式不获取
if (eatTypeInfoDTO.isDineInBefore()) { if (eatTypeInfoDTO.isDineInBefore() || eatTypeInfoDTO.isTakeout()) {
return null; return null;
} }
List<TbOrderInfo> orderInfoList = mPOrderInfoMapper.selectPage(new Page<>(1, 1), new LambdaQueryWrapper<TbOrderInfo>() List<TbOrderInfo> orderInfoList = mPOrderInfoMapper.selectPage(new Page<>(1, 1), new LambdaQueryWrapper<TbOrderInfo>()
@@ -705,15 +778,13 @@ public class OrderService {
// 获取当前台桌最新订单,先付款模式不获取 // 获取当前台桌最新订单,先付款模式不获取
String currentOrderKey = RedisCst.getCurrentOrderKey(orderVo.getTableId(), orderVo.getShopId().toString()); String currentOrderKey = RedisCst.getCurrentOrderKey(orderVo.getTableId(), orderVo.getShopId().toString());
TbOrderInfo orderInfo = getCurrentOrder(eatTypeInfoDTO, orderVo.getTableId(), orderVo.getShopId());
Integer orderId = orderInfo == null ? null : orderInfo.getId();
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>() LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
.eq(TbCashierCart::getShopId, orderVo.getShopId()) .eq(TbCashierCart::getShopId, orderVo.getShopId())
.eq(TbCashierCart::getUseType, eatTypeInfoDTO.getUseType()) .eq(TbCashierCart::getUseType, eatTypeInfoDTO.getUseType())
.gt(TbCashierCart::getCreatedAt, DateUtil.offsetDay(DateUtil.date(), -1).getTime()) .gt(TbCashierCart::getCreatedAt, DateUtil.offsetDay(DateUtil.date(), -1).getTime())
.and(q -> q.eq(TbCashierCart::getMasterId, orderVo.getMasterId()).or().isNull(TbCashierCart::getMasterId)) .and(q -> q.eq(TbCashierCart::getMasterId, orderVo.getMasterId()).or().isNull(TbCashierCart::getMasterId))
.eq(TbCashierCart::getStatus, "create"); .in(TbCashierCart::getStatus, "create", "return");
// 外带模式 // 外带模式
if (eatTypeInfoDTO.isTakeout()) { if (eatTypeInfoDTO.isTakeout()) {
@@ -753,20 +824,31 @@ public class OrderService {
ArrayList<Integer> cashierIds = new ArrayList<>(); ArrayList<Integer> cashierIds = new ArrayList<>();
// 就餐人数 // 就餐人数
Integer mealNum = null; Integer mealNum = null;
Integer orderId = null;
int cartCount = 0;
for (TbCashierCart cart : list) { for (TbCashierCart cart : list) {
if (StrUtil.isNotBlank(cart.getOrderId())) {
orderId = Integer.valueOf(cart.getOrderId());
}
cashierIds.add(cart.getId()); cashierIds.add(cart.getId());
if ("-999".equals(cart.getProductId())) { if ("-999".equals(cart.getProductId())) {
mealNum = cart.getNumber(); mealNum = cart.getNumber();
} }
if (TableConstant.OrderInfo.Status.CREATE.equalsVals(cart.getStatus()) && !TableConstant.CashierCart.ID.equals(cart.getProductId())) {
cartCount++;
}
} }
if (shopInfo.getIsTableFee() != null && shopInfo.getIsTableFee() == 0 if (eatTypeInfoDTO.isNeedSeatFee() && mealNum == null) {
&& !eatTypeInfoDTO.isTakeout() && mealNum == null
) {
return Result.fail("请选择用餐人数"); return Result.fail("请选择用餐人数");
} }
list = list.stream().filter(item -> TableConstant.OrderInfo.Status.CREATE.equalsVals(item.getStatus())).collect(Collectors.toList());
if (cartCount == 0) {
return Result.fail("购物车为空");
}
// 查询历史orderDetail // 查询历史orderDetail
Integer finalOrderId = orderId; Integer finalOrderId = orderId;
List<TbOrderDetail> oldOrderDetailList = mPOrderDetailMapper.selectList(new LambdaQueryWrapper<TbOrderDetail>() List<TbOrderDetail> oldOrderDetailList = mPOrderDetailMapper.selectList(new LambdaQueryWrapper<TbOrderDetail>()
@@ -779,6 +861,8 @@ public class OrderService {
ArrayList<TbOrderDetail> addOrderDetailList = new ArrayList<>(); ArrayList<TbOrderDetail> addOrderDetailList = new ArrayList<>();
for (TbCashierCart cashierCart : list) { for (TbCashierCart cashierCart : list) {
cashierCart.setIsMember(eatTypeInfoDTO.isMemberPrice() && orderVo.getVipUserId() != null && orderVo.getVipUserId() == 1 ? 1 : 0);
cashierCart.resetTotalAmount();
// 设置下单次数 // 设置下单次数
if (cashierCart.getPlaceNum() == null) { if (cashierCart.getPlaceNum() == null) {
cashierCart.setPlaceNum(currentPlaceNum); cashierCart.setPlaceNum(currentPlaceNum);
@@ -798,7 +882,9 @@ public class OrderService {
orderDetail = new TbOrderDetail(); orderDetail = new TbOrderDetail();
// 已经加入修改了库存数量,返还或减少库存 // 已经加入修改了库存数量,返还或减少库存
addOrderDetailList.add(orderDetail); addOrderDetailList.add(orderDetail);
productService.decrStock(cashierCart.getProductId(), cashierCart.getSkuId(), cashierCart.getNumber()); if (!TableConstant.CART_SEAT_ID.equals(cashierCart.getProductId())) {
productService.decrStock(cashierCart.getProductId(), cashierCart.getSkuId(), cashierCart.getNumber());
}
} else { } else {
if (!TableConstant.CART_SEAT_ID.equals(cashierCart.getProductId())) { if (!TableConstant.CART_SEAT_ID.equals(cashierCart.getProductId())) {
int subVal = cashierCart.getNumber() - orderDetail.getNum(); int subVal = cashierCart.getNumber() - orderDetail.getNum();
@@ -815,7 +901,7 @@ public class OrderService {
orderDetail.setPlaceNum(currentPlaceNum); orderDetail.setPlaceNum(currentPlaceNum);
} }
TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId()));
if ("takeaway".equals(orderVo.getSendType()) || "takeself".equals(orderVo.getSendType())) { if ("takeaway".equals(orderVo.getSendType()) || "takeself".equals(orderVo.getSendType())) {
if (Objects.nonNull(product.getPackFee())) { if (Objects.nonNull(product.getPackFee())) {
packAMount = packAMount.add(product.getPackFee()); packAMount = packAMount.add(product.getPackFee());
@@ -835,6 +921,7 @@ public class OrderService {
saleAmount = saleAmount.add(shopInfo.getTableFee()); saleAmount = saleAmount.add(shopInfo.getTableFee());
} }
orderDetail.setMemberPrice(cashierCart.getMemberPrice());
orderDetail.setCreateTime(new Date()); orderDetail.setCreateTime(new Date());
orderDetail.setNum(cashierCart.getNumber()); orderDetail.setNum(cashierCart.getNumber());
orderDetail.setPrice(cashierCart.getSalePrice()); orderDetail.setPrice(cashierCart.getSalePrice());
@@ -851,6 +938,8 @@ public class OrderService {
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) { if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
orderId = Integer.valueOf(cashierCart.getOrderId()); orderId = Integer.valueOf(cashierCart.getOrderId());
} }
orderDetail.setIsMember(cashierCart.getIsMember());
orderDetails.add(orderDetail); orderDetails.add(orderDetail);
@@ -865,6 +954,10 @@ public class OrderService {
// 创建订单 // 创建订单
String orderNo = generateOrderNumber(); String orderNo = generateOrderNumber();
TbToken tbToken = tokenMapper.selectByToken(token); TbToken tbToken = tokenMapper.selectByToken(token);
TbOrderInfo orderInfo = null;
if (orderId != null) {
orderInfo = mPOrderInfoMapper.selectById(orderId);
}
if (orderInfo == null || !"unpaid".equals(orderInfo.getStatus())) { if (orderInfo == null || !"unpaid".equals(orderInfo.getStatus())) {
redisUtil.deleteByKey(currentOrderKey); redisUtil.deleteByKey(currentOrderKey);
} }
@@ -878,6 +971,7 @@ public class OrderService {
orderInfo.setRemark(orderVo.getRemark()); orderInfo.setRemark(orderVo.getRemark());
orderInfo.setFreightAmount(feeAmount); orderInfo.setFreightAmount(feeAmount);
orderInfo.setProductAmount(saleAmount); orderInfo.setProductAmount(saleAmount);
orderInfo.setAmount(saleAmount);
orderInfo.setTradeDay(DateUtils.getDay()); orderInfo.setTradeDay(DateUtils.getDay());
orderInfo.setUserId(orderVo.getUserId()); orderInfo.setUserId(orderVo.getUserId());
orderInfo.setUseType(eatTypeInfoDTO.getUseType()); orderInfo.setUseType(eatTypeInfoDTO.getUseType());
@@ -899,6 +993,7 @@ public class OrderService {
orderInfo.setPackFee(packAMount); orderInfo.setPackFee(packAMount);
orderInfo.setTableName(shopTable != null ? shopTable.getName() : null); orderInfo.setTableName(shopTable != null ? shopTable.getName() : null);
orderInfo.setPayAmount(BigDecimal.ZERO); orderInfo.setPayAmount(BigDecimal.ZERO);
orderInfo.setAmount(saleAmount);
// 堂食自取增加下单次数 // 堂食自取增加下单次数
if (eatTypeInfoDTO.isDineInAfter()) { if (eatTypeInfoDTO.isDineInAfter()) {
orderInfo.setPlaceNum(currentPlaceNum); orderInfo.setPlaceNum(currentPlaceNum);
@@ -912,6 +1007,8 @@ public class OrderService {
} }
orderInfo.setSendType(eatTypeInfoDTO.getSendType()); orderInfo.setSendType(eatTypeInfoDTO.getSendType());
orderInfo.setOutNumber(masterId); orderInfo.setOutNumber(masterId);
orderInfo.setIsPostpaid(eatTypeInfoDTO.isDineInAfter() ? 1 : 0);
mPOrderInfoMapper.insert(orderInfo); mPOrderInfoMapper.insert(orderInfo);
orderId = orderInfo.getId(); orderId = orderInfo.getId();
} }
@@ -979,9 +1076,10 @@ public class OrderService {
jsonObject.put("type", "create"); jsonObject.put("type", "create");
producer.cons(jsonObject.toString()); producer.cons(jsonObject.toString());
List<TbCashierCart> finalList = list;
ThreadUtil.execAsync(() -> { ThreadUtil.execAsync(() -> {
ThreadUtil.sleep(5, TimeUnit.SECONDS); ThreadUtil.sleep(5, TimeUnit.SECONDS);
for (TbCashierCart cashierCart : list) { for (TbCashierCart cashierCart : finalList) {
JSONObject objectMsg = new JSONObject(); JSONObject objectMsg = new JSONObject();
objectMsg.put("skuId", Integer.valueOf(cashierCart.getSkuId())); objectMsg.put("skuId", Integer.valueOf(cashierCart.getSkuId()));
objectMsg.put("shopId", Integer.valueOf(cashierCart.getShopId())); objectMsg.put("shopId", Integer.valueOf(cashierCart.getShopId()));
@@ -1171,7 +1269,7 @@ public class OrderService {
} }
List<TbCashierCart> list = cashierCartMapper.selectAllByMarketId(day, String.valueOf(cartVo.getShopId()), cartVo.getMasterId()); List<TbCashierCart> list = cashierCartMapper.selectAllByMarketId(day, String.valueOf(cartVo.getShopId()), cartVo.getMasterId());
for (TbCashierCart cashierCart : list) { for (TbCashierCart cashierCart : list) {
TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId())); TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId()));
if ("true".equals(cartVo.getStatus())) { if ("true".equals(cartVo.getStatus())) {
cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(product.getPackFee()))); cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(product.getPackFee())));
cashierCart.setPackFee(new BigDecimal(cashierCart.getTotalNumber()).multiply(product.getPackFee())); cashierCart.setPackFee(new BigDecimal(cashierCart.getTotalNumber()).multiply(product.getPackFee()));
@@ -1221,9 +1319,11 @@ public class OrderService {
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper); List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper);
int orderId = 0; int orderId = 0;
ArrayList<Integer> ids = new ArrayList<>(); ArrayList<Integer> ids = new ArrayList<>();
TbCashierCart cart = null;
for (TbCashierCart cashierCart : list) { for (TbCashierCart cashierCart : list) {
if (StrUtil.isNotBlank(cashierCart.getOrderId())) { if (StrUtil.isNotBlank(cashierCart.getOrderId())) {
orderId = Integer.parseInt(cashierCart.getOrderId()); orderId = Integer.parseInt(cashierCart.getOrderId());
cart = cashierCart;
} }
ids.add(cashierCart.getId()); ids.add(cashierCart.getId());
@@ -1245,12 +1345,12 @@ public class OrderService {
producer.cons(jsonObject1.toString()); producer.cons(jsonObject1.toString());
if (!shopEatTypeInfoDTO.isDineInAfter() && Objects.nonNull(orderInfo) && !orderInfo.getStatus().equals("pending")) { if (!shopEatTypeInfoDTO.isDineInAfter() && Objects.nonNull(orderInfo) && !orderInfo.getStatus().equals("pending")) {
tbOrderInfoMapper.updateStatusById(orderId, "cancelled"); // tbOrderInfoMapper.updateStatusById(orderId, "cancelled");
tbOrderInfoMapper.deleteByPrimaryKey(orderId);
orderDetailMapper.deleteByOUrderId(orderId); orderDetailMapper.deleteByOUrderId(orderId);
} }
} }
if (!ids.isEmpty()) { if (!ids.isEmpty()) {
mpCashierCartMapper.deleteBatchIds(ids); mpCashierCartMapper.deleteBatchIds(ids);
} }
@@ -1740,7 +1840,7 @@ public class OrderService {
if (shopInfo == null) throw new NotPrintException("店铺信息不存在"); if (shopInfo == null) throw new NotPrintException("店铺信息不存在");
if (shopInfo.getIsTableFee() != null && shopInfo.getIsTableFee() == 1) { if (shopInfo.getIsTableFee() != null && shopInfo.getIsTableFee() == 1) {
throw new NotPrintException("当前店铺无需选择餐位费"); return Result.success(CodeEnum.SUCCESS);
} }
TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>() TbShopTable shopTable = mpShopTableMapper.selectOne(new LambdaQueryWrapper<TbShopTable>()

View File

@@ -11,11 +11,13 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.chaozhanggui.system.cashierservice.bean.OrderUseTypeEnum; import com.chaozhanggui.system.cashierservice.bean.OrderUseTypeEnum;
import com.chaozhanggui.system.cashierservice.bean.TableStateEnum; import com.chaozhanggui.system.cashierservice.bean.TableStateEnum;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.dao.*; import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.*; import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.entity.dto.ReturnGroupOrderDto; import com.chaozhanggui.system.cashierservice.entity.dto.ReturnGroupOrderDto;
import com.chaozhanggui.system.cashierservice.entity.po.OrderDetailPo; import com.chaozhanggui.system.cashierservice.entity.po.OrderDetailPo;
import com.chaozhanggui.system.cashierservice.exception.MsgException; import com.chaozhanggui.system.cashierservice.exception.MsgException;
import com.chaozhanggui.system.cashierservice.exception.NotPrintException;
import com.chaozhanggui.system.cashierservice.model.ReturnOrderReq; import com.chaozhanggui.system.cashierservice.model.ReturnOrderReq;
import com.chaozhanggui.system.cashierservice.model.ScanPayReq; import com.chaozhanggui.system.cashierservice.model.ScanPayReq;
import com.chaozhanggui.system.cashierservice.model.TradeQueryReq; import com.chaozhanggui.system.cashierservice.model.TradeQueryReq;
@@ -134,10 +136,13 @@ public class PayService {
@Autowired @Autowired
private PlatformTransactionManager transactionManager; private PlatformTransactionManager transactionManager;
private final MpCashierCartService mpCashierCartService;
private final Utils utils; private final Utils utils;
public PayService(RedisTemplate<String, Object> redisTemplate, Utils utils) { public PayService(RedisTemplate<String, Object> redisTemplate, MpCashierCartService mpCashierCartService, Utils utils) {
this.redisTemplate = redisTemplate; this.redisTemplate = redisTemplate;
this.mpCashierCartService = mpCashierCartService;
this.utils = utils; this.utils = utils;
} }
@@ -398,7 +403,10 @@ public class PayService {
reqbody = body.toString(); reqbody = body.toString();
} }
PublicResp<MainScanResp> publicResp = thirdPayService.mainScan(url, thirdApply.getAppId(), reqbody, reqbody, payment.getAmount().setScale(2, RoundingMode.DOWN).multiply(new BigDecimal(100)).longValue(), payType.equals("wechatPay") ? thirdApply.getSmallAppid() : null, authCode, DateUtils.getSsdfTimes(), thirdApply.getStoreId(), callBack, thirdApply.getAppToken()); PublicResp<MainScanResp> publicResp = thirdPayService.mainScan(url, thirdApply.getAppId(), reqbody, reqbody,
payment.getAmount().setScale(2, RoundingMode.DOWN).multiply(new BigDecimal(100)).longValue(),
payType.equals("wechatPay") ? thirdApply.getSmallAppid() : null, authCode,
DateUtils.getSsdfTimes(), thirdApply.getStoreId(), callBack, thirdApply.getAppToken());
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) { if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
if ("000000".equals(publicResp.getCode())) { if ("000000".equals(publicResp.getCode())) {
MainScanResp mainScanResp = publicResp.getObjData(); MainScanResp mainScanResp = publicResp.getObjData();
@@ -664,14 +672,13 @@ public class PayService {
orderInfo.setPayOrderNo("deposit".concat(SnowFlakeUtil.generateOrderNo())); orderInfo.setPayOrderNo("deposit".concat(SnowFlakeUtil.generateOrderNo()));
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
//更新购物车状态 //更新购物车状态
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final"); mpCashierCartService.updateStateByOrderId(TableConstant.OrderInfo.Status.CLOSED, orderInfo.getId());
if (ObjectUtil.isNotNull(orderInfo.getDiscountRatio()) && ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())) { if (ObjectUtil.isNotNull(orderInfo.getDiscountRatio()) && ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())) {
tbOrderDetailMapper.updateStatusByOrderId(Integer.parseInt(orderId), "closed", orderInfo.getDiscountRatio()); tbOrderDetailMapper.updateStatusByOrderId(Integer.parseInt(orderId), "closed", orderInfo.getDiscountRatio());
} else { } else {
tbOrderDetailMapper.updateStatusByOrderId(Integer.parseInt(orderId), "closed", null); tbOrderDetailMapper.updateStatusByOrderId(Integer.parseInt(orderId), "closed", null);
} }
log.info("更新购物车:{}", cartCount);
return null; return null;
}); });
@@ -917,7 +924,7 @@ public class PayService {
orderInfo.setMemberId(vipUserId.toString()); orderInfo.setMemberId(vipUserId.toString());
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
//更新购物车状态 //更新购物车状态
int cartCount = tbCashierCartMapper.updateByOrderId(String.valueOf(orderId), "final"); mpCashierCartService.updateStateByOrderId(TableConstant.OrderInfo.Status.CLOSED, orderInfo.getId());
if (ObjectUtil.isNotNull(orderInfo.getDiscountRatio()) && ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())) { if (ObjectUtil.isNotNull(orderInfo.getDiscountRatio()) && ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())) {
@@ -925,8 +932,6 @@ public class PayService {
} else { } else {
tbOrderDetailMapper.updateStatusByOrderId(orderId, "closed", null); tbOrderDetailMapper.updateStatusByOrderId(orderId, "closed", null);
} }
log.info("更新购物车:{}", cartCount);
return null; return null;
}); });
@@ -961,6 +966,7 @@ public class PayService {
return Result.success(CodeEnum.SUCCESS); return Result.success(CodeEnum.SUCCESS);
} }
public Result cashPay(String orderId, String token, BigDecimal payAmount, BigDecimal discountAmount) { public Result cashPay(String orderId, String token, BigDecimal payAmount, BigDecimal discountAmount) {
if (ObjectUtil.isEmpty(orderId)) { if (ObjectUtil.isEmpty(orderId)) {
return Result.fail(CodeEnum.PARAM); return Result.fail(CodeEnum.PARAM);
@@ -1013,15 +1019,13 @@ public class PayService {
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo); tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
//更新购物车状态 //更新购物车状态
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final"); mpCashierCartService.updateStateByOrderId(TableConstant.OrderInfo.Status.CLOSED, Integer.valueOf(orderId));
if (ObjectUtil.isNotNull(orderInfo.getDiscountRatio()) && ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())) { if (ObjectUtil.isNotNull(orderInfo.getDiscountRatio()) && ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())) {
tbOrderDetailMapper.updateStatusByOrderId(Integer.parseInt(orderId), "closed", orderInfo.getDiscountRatio()); tbOrderDetailMapper.updateStatusByOrderId(Integer.parseInt(orderId), "closed", orderInfo.getDiscountRatio());
} else { } else {
tbOrderDetailMapper.updateStatusByOrderId(Integer.parseInt(orderId), "closed", null); tbOrderDetailMapper.updateStatusByOrderId(Integer.parseInt(orderId), "closed", null);
} }
log.info("更新购物车:{}", cartCount);
return orderInfo; return orderInfo;
}); });
@@ -1420,7 +1424,7 @@ public class PayService {
detail = tbOrderDetailMapper.selectByPrimaryKey(detail.getId()); detail = tbOrderDetailMapper.selectByPrimaryKey(detail.getId());
TbProductSku productSku = productSkuMapper.selectByPrimaryKey(detail.getProductSkuId()); TbProductSku productSku = productSkuMapper.selectByPrimaryKey(detail.getProductSkuId());
TbProductWithBLOBs product = productMapper.selectByPrimaryKey(detail.getProductId()); TbProduct product = productMapper.selectByPrimaryKey(detail.getProductId());
TbProductStockDetail tbProductStockDetail = new TbProductStockDetail(); TbProductStockDetail tbProductStockDetail = new TbProductStockDetail();
tbProductStockDetail.setCreatedAt(System.currentTimeMillis()); tbProductStockDetail.setCreatedAt(System.currentTimeMillis());

View File

@@ -10,6 +10,8 @@ import com.chaozhanggui.system.cashierservice.entity.*;
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStatusDTO; import com.chaozhanggui.system.cashierservice.entity.dto.ProductStatusDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.ProductStockDTO; import com.chaozhanggui.system.cashierservice.entity.dto.ProductStockDTO;
import com.chaozhanggui.system.cashierservice.entity.dto.QuerySpecDTO; import com.chaozhanggui.system.cashierservice.entity.dto.QuerySpecDTO;
import com.chaozhanggui.system.cashierservice.entity.vo.ProductGroupVo;
import com.chaozhanggui.system.cashierservice.entity.vo.ProductVo;
import com.chaozhanggui.system.cashierservice.entity.vo.ShopCategoryVo; import com.chaozhanggui.system.cashierservice.entity.vo.ShopCategoryVo;
import com.chaozhanggui.system.cashierservice.exception.MsgException; import com.chaozhanggui.system.cashierservice.exception.MsgException;
import com.chaozhanggui.system.cashierservice.interceptor.LimitSubmitAspect; import com.chaozhanggui.system.cashierservice.interceptor.LimitSubmitAspect;
@@ -17,6 +19,7 @@ import com.chaozhanggui.system.cashierservice.rabbit.RabbitProducer;
import com.chaozhanggui.system.cashierservice.sign.CodeEnum; import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
import com.chaozhanggui.system.cashierservice.sign.Result; import com.chaozhanggui.system.cashierservice.sign.Result;
import com.chaozhanggui.system.cashierservice.util.DateUtils; import com.chaozhanggui.system.cashierservice.util.DateUtils;
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
import com.chaozhanggui.system.cashierservice.util.PageHelperUtil; import com.chaozhanggui.system.cashierservice.util.PageHelperUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -70,33 +73,33 @@ public class ProductService {
} }
public Result queryCommodityInfo(String shopId, String categoryId, String commdityName, Integer page, Integer pageSize, String masterId){ public Result queryCommodityInfo(String shopId, String categoryId, String commdityName, Integer page, Integer pageSize, String masterId) {
List<TbProductWithBLOBs> tbProductWithBLOBs=null; List<TbProduct> tbProducts = null;
if(ObjectUtil.isEmpty(categoryId)){ if (ObjectUtil.isEmpty(categoryId)) {
tbProductWithBLOBs=tbProductMapper.selectByShopId(shopId,commdityName); tbProducts = tbProductMapper.selectByShopId(shopId, commdityName);
}else { } else {
tbProductWithBLOBs=tbProductMapper.selectByShopIdAndShopType(shopId,categoryId,commdityName); tbProducts = tbProductMapper.selectByShopIdAndShopType(shopId, categoryId, commdityName);
} }
String day = DateUtils.getDay(); String day = DateUtils.getDay();
if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){ if (ObjectUtil.isNotEmpty(tbProducts)) {
tbProductWithBLOBs.parallelStream().forEach(it->{ tbProducts.parallelStream().forEach(it -> {
Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, ""); Integer orderCount = tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(), it.getId().toString(), masterId, day, "");
it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount); it.setOrderCount((ObjectUtil.isNull(orderCount) || ObjectUtil.isEmpty(orderCount)) ? 0 : orderCount);
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId()); TbProductSpec tbProductSpec = tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
if(ObjectUtil.isEmpty(tbProductSpec)){ if (ObjectUtil.isEmpty(tbProductSpec)) {
tbProductSpec=new TbProductSpec(); tbProductSpec = new TbProductSpec();
} }
it.setTbProductSpec(tbProductSpec); it.setTbProductSpec(tbProductSpec);
TbProductSkuResult skuResult=tbProductSkuResultMapper.selectByPrimaryKey(it.getId()); TbProductSkuResult skuResult = tbProductSkuResultMapper.selectByPrimaryKey(it.getId());
if(ObjectUtil.isEmpty(skuResult)){ if (ObjectUtil.isEmpty(skuResult)) {
skuResult=new TbProductSkuResult(); skuResult = new TbProductSkuResult();
} }
it.setProductSkuResult(skuResult); it.setProductSkuResult(skuResult);
}); });
} }
return Result.success(CodeEnum.SUCCESS,tbProductWithBLOBs); return Result.success(CodeEnum.SUCCESS, tbProducts);
} }
@@ -111,21 +114,24 @@ public class ProductService {
} }
public Result queryNewCommodityInfo(String shopId, String categoryId, String commdityName, String tableId, int page, int pageSize, String masterId) { public Result queryNewCommodityInfo(String shopId, String categoryId, String commdityName, String tableId, int page, int pageSize, String masterId) {
List<TbProductWithBLOBs> tbProductWithBLOBs=null; List<TbProduct> tbProducts=null;
PageHelperUtil.startPage(page,pageSize); PageHelperUtil.startPage(page,pageSize);
if(ObjectUtil.isEmpty(categoryId)){ if(ObjectUtil.isEmpty(categoryId)){
tbProductWithBLOBs=tbProductMapper.selectByShopIdAndCheckGrounding(shopId,commdityName); tbProducts=tbProductMapper.selectByShopIdAndCheckGrounding(shopId,commdityName);
}else { }else {
if (Integer.valueOf(categoryId).equals(-1)) { if (Integer.valueOf(categoryId).equals(-1)) {
tbProductWithBLOBs = tbProductMapper.selectByShopIdAndShopTypeUnGrounding(shopId,commdityName); tbProducts = tbProductMapper.selectByShopIdAndShopTypeUnGrounding(shopId,commdityName);
}else { }else {
tbProductWithBLOBs=tbProductMapper.selectByShopIdAndShopTypeCheckGrounding(shopId,categoryId,commdityName); tbProducts=tbProductMapper.selectByShopIdAndShopTypeCheckGrounding(shopId,categoryId,commdityName);
} }
} }
String day = DateUtils.getDay(); String day = DateUtils.getDay();
if(ObjectUtil.isNotEmpty(tbProductWithBLOBs)){ if(ObjectUtil.isNotEmpty(tbProducts)){
tbProductWithBLOBs.parallelStream().forEach(it->{ tbProducts.parallelStream().forEach(it->{
if("package".equals(it.getType())){
it.setProGroupVo(JSONUtil.parseListTNewList(it.getGroupSnap(), ProductGroupVo.class));
}
Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, tableId); Integer orderCount=tbProductMapper.countOrderByshopIdAndProductId(it.getShopId(),it.getId().toString(),masterId,day, tableId);
it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount); it.setOrderCount((ObjectUtil.isNull(orderCount)||ObjectUtil.isEmpty(orderCount))?0:orderCount);
TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId()); TbProductSpec tbProductSpec= tbProductSpecMapper.selectByPrimaryKey(it.getSpecId());
@@ -143,7 +149,7 @@ public class ProductService {
it.setGroundingSpecInfo(querySpec(Integer.valueOf(shopId), it.getId())); it.setGroundingSpecInfo(querySpec(Integer.valueOf(shopId), it.getId()));
}); });
} }
PageInfo pageInfo=new PageInfo(tbProductWithBLOBs); PageInfo pageInfo=new PageInfo(tbProducts);
return Result.success(CodeEnum.SUCCESS,pageInfo); return Result.success(CodeEnum.SUCCESS,pageInfo);
} }
@@ -152,7 +158,7 @@ public class ProductService {
} }
public void decrStock(String productId, String skuId, int decrNum) { public void decrStock(String productId, String skuId, int decrNum) {
TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(productId)); TbProduct product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(productId));
if (product.getIsStock() == 1) { if (product.getIsStock() == 1) {
if (tbProductMapper.decrStock(productId, decrNum) < 1) { if (tbProductMapper.decrStock(productId, decrNum) < 1) {
throw new MsgException("库存不足,下单失败"); throw new MsgException("库存不足,下单失败");

View File

@@ -18,6 +18,7 @@ import com.chaozhanggui.system.cashierservice.util.PageHelperUtil;
import com.chaozhanggui.system.cashierservice.util.TokenUtil; import com.chaozhanggui.system.cashierservice.util.TokenUtil;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -55,7 +56,12 @@ public class ShopInfoService {
} }
public Result queryShopInfo(Integer shopId) { public Result queryShopInfo(Integer shopId) {
return new Result(CodeEnum.SUCCESS,tbShopInfoMapper.selectByPrimaryKey(shopId)); TbShopInfo tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(shopId);
String ticketLogo = tbShopInfoMapper.getTicketLogo(shopId);
if(StringUtils.isNotBlank(ticketLogo)){
tbShopInfo.setTicketLogo(ticketLogo);
}
return new Result(CodeEnum.SUCCESS,tbShopInfo);
} }
public Result queryShopArea(String shopId){ public Result queryShopArea(String shopId){

View File

@@ -0,0 +1,25 @@
package com.chaozhanggui.system.cashierservice.service;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.system.cashierservice.entity.TbActivate;
import com.chaozhanggui.system.cashierservice.entity.TbCouponProduct;
import com.chaozhanggui.system.cashierservice.entity.TbShopCoupon;
import org.springframework.stereotype.Service;
/**
* 活动商品赠送表(TbActivateInRecord)表服务接口
*
* @author ww
* @since 2024-08-22 11:13:40
*/
@Service
public class TbActivateInRecordService {
public String getCouponJson(TbActivate activate, TbShopCoupon tbShopCoupon, TbCouponProduct couProduct){
JSONObject result = new JSONObject();
result.put("activate",JSONObject.toJSON(activate));
result.put("coupon",JSONObject.toJSON(tbShopCoupon));
result.put("couProduct",JSONObject.toJSON(couProduct));
return result.toJSONString();
}
}

View File

@@ -50,7 +50,7 @@ public class TbGroupOrderInfoService {
*/ */
public Result queryById(Integer id) { public Result queryById(Integer id) {
TbGroupOrderInfo tbGroupOrderInfo = tbGroupOrderInfoMapper.queryById(id); TbGroupOrderInfo tbGroupOrderInfo = tbGroupOrderInfoMapper.queryById(id);
TbProductWithBLOBs tbProduct = productMapper.selectByPrimaryKey(tbGroupOrderInfo.getProId()); TbProduct tbProduct = productMapper.selectByPrimaryKey(tbGroupOrderInfo.getProId());
TbProductSkuWithBLOBs tbProductSku = skuMapper.selectByProduct(tbGroupOrderInfo.getProId()); TbProductSkuWithBLOBs tbProductSku = skuMapper.selectByProduct(tbGroupOrderInfo.getProId());
GroupOrderInfoVo productInfo = new GroupOrderInfoVo(); GroupOrderInfoVo productInfo = new GroupOrderInfoVo();

View File

@@ -1,6 +1,12 @@
package com.chaozhanggui.system.cashierservice.service.impl; package com.chaozhanggui.system.cashierservice.service.impl;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.entity.TbCashierCart; import com.chaozhanggui.system.cashierservice.entity.TbCashierCart;
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail; import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
import com.chaozhanggui.system.cashierservice.mybatis.MPCashierCartMapper; import com.chaozhanggui.system.cashierservice.mybatis.MPCashierCartMapper;
@@ -9,6 +15,9 @@ import com.chaozhanggui.system.cashierservice.service.MpCashierCartService;
import com.chaozhanggui.system.cashierservice.service.MpOrderDetailService; import com.chaozhanggui.system.cashierservice.service.MpOrderDetailService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
/** /**
* (TbShopPermission)表服务实现类 * (TbShopPermission)表服务实现类
* *
@@ -18,5 +27,37 @@ import org.springframework.stereotype.Service;
@Service @Service
public class MpCashierCartServiceImpl extends ServiceImpl<MPCashierCartMapper, TbCashierCart> implements MpCashierCartService { public class MpCashierCartServiceImpl extends ServiceImpl<MPCashierCartMapper, TbCashierCart> implements MpCashierCartService {
@Override
public boolean updateStateByIds(Integer shopId, List<Integer> cartIds, TableConstant.Status status) {
return update(new LambdaUpdateWrapper<TbCashierCart>()
.eq(TbCashierCart::getShopId, shopId)
.in(TbCashierCart::getId, cartIds)
.set(TbCashierCart::getStatus, status.getValue()));
}
@Override
public boolean updateStateByOrderId(TableConstant.OrderInfo.Status status, Integer orderId) {
return update(new LambdaUpdateWrapper<TbCashierCart>()
.eq(TbCashierCart::getOrderId, orderId)
.ne(TbCashierCart::getStatus, TableConstant.Status.RETURN.getValue())
.set(TbCashierCart::getStatus, status.getValue()));
}
@Override
public List<TbCashierCart> selectCart(String useType, String masterId, Integer orderId, Integer shopId, TableConstant.OrderInfo.Status... statusList) {
LambdaQueryWrapper<TbCashierCart> query = new LambdaQueryWrapper<TbCashierCart>()
.eq(TbCashierCart::getShopId, shopId)
.eq(TbCashierCart::getUseType, useType)
.eq(TbCashierCart::getMasterId, masterId)
.gt(TbCashierCart::getCreatedAt, DateUtil.offsetDay(DateUtil.date(), -1).getTime());
if (orderId != null) {
query.and(q -> q.eq(TbCashierCart::getOrderId, orderId).or().isNull(TbCashierCart::getOrderId));
}
if (statusList.length != 0) {
query.in(TbCashierCart::getStatus, Convert.toList(statusList));
}
return list(query);
}
} }

View File

@@ -1,7 +1,10 @@
package com.chaozhanggui.system.cashierservice.service.impl; package com.chaozhanggui.system.cashierservice.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.dao.TbOrderDetailMapper; import com.chaozhanggui.system.cashierservice.dao.TbOrderDetailMapper;
import com.chaozhanggui.system.cashierservice.dao.TbShopPermissionDao; import com.chaozhanggui.system.cashierservice.dao.TbShopPermissionDao;
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail; import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
@@ -17,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* (TbShopPermission)表服务实现类 * (TbShopPermission)表服务实现类
* *
@@ -26,5 +31,24 @@ import org.springframework.stereotype.Service;
@Service @Service
public class MpOrderDetailServiceImpl extends ServiceImpl<MPOrderDetailMapper, TbOrderDetail> implements MpOrderDetailService { public class MpOrderDetailServiceImpl extends ServiceImpl<MPOrderDetailMapper, TbOrderDetail> implements MpOrderDetailService {
@Override
public boolean updateStateByCartIds(Integer shopId, List<Integer> cartIds, TableConstant.Status status) {
return update(new LambdaUpdateWrapper<TbOrderDetail>()
.eq(TbOrderDetail::getShopId, shopId)
.in(TbOrderDetail::getCartId, cartIds)
.set(TbOrderDetail::getStatus, status.getValue()));
}
@Override
public boolean removeByCartIds(List<Integer> cartIds) {
return remove(new LambdaQueryWrapper<TbOrderDetail>()
.in(TbOrderDetail::getCartId, cartIds));
}
@Override
public boolean removeByOrderId(String orderId) {
return remove(new LambdaQueryWrapper<TbOrderDetail>()
.eq(TbOrderDetail::getOrderId, orderId));
}
} }

View File

@@ -0,0 +1,34 @@
package com.chaozhanggui.system.cashierservice.service.impl;
import cn.hutool.Hutool;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
import com.chaozhanggui.system.cashierservice.mybatis.MPOrderDetailMapper;
import com.chaozhanggui.system.cashierservice.mybatis.MPOrderInfoMapper;
import com.chaozhanggui.system.cashierservice.service.MpOrderDetailService;
import com.chaozhanggui.system.cashierservice.service.MpOrderInfoService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* (TbShopPermission)表服务实现类
*
* @author makejava
* @since 2024-09-14 17:08:49
*/
@Service
public class MpOrderInfoServiceImpl extends ServiceImpl<MPOrderInfoMapper, TbOrderInfo> implements MpOrderInfoService {
@Override
public boolean updateStateById(Integer shopId, Integer orderId, TableConstant.Status status) {
return update(new LambdaUpdateWrapper<TbOrderInfo>()
.eq(TbOrderInfo::getShopId, shopId)
.eq(TbOrderInfo::getId, orderId)
.set(TbOrderInfo::getStatus, status.getValue()));
}
}

View File

@@ -0,0 +1,27 @@
package com.chaozhanggui.system.cashierservice.service.impl;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.chaozhanggui.system.cashierservice.bean.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.entity.TbCashierCart;
import com.chaozhanggui.system.cashierservice.entity.TbShopTable;
import com.chaozhanggui.system.cashierservice.mybatis.MPCashierCartMapper;
import com.chaozhanggui.system.cashierservice.mybatis.MpShopTableMapper;
import com.chaozhanggui.system.cashierservice.service.MpCashierCartService;
import com.chaozhanggui.system.cashierservice.service.MpShopTableService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* (TbShopPermission)表服务实现类
*
* @author makejava
* @since 2024-09-14 17:08:49
*/
@Service
public class MpShopTableServiceImpl extends ServiceImpl<MpShopTableMapper, TbShopTable> implements MpShopTableService {
}

View File

@@ -1,101 +0,0 @@
package com.chaozhanggui.system.cashierservice.task;
import cn.hutool.core.util.ObjectUtil;
import com.chaozhanggui.system.cashierservice.cache.DataCache;
import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
import com.chaozhanggui.system.cashierservice.dao.TbShopOnlineMapper;
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
import com.chaozhanggui.system.cashierservice.entity.TbShopOnline;
import com.chaozhanggui.system.cashierservice.util.DateUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.Enumeration;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
@Component
@Slf4j
public class ShopInfoStatusTask {
@Autowired
TbShopInfoMapper tbShopInfoMapper;
@Autowired
TbShopOnlineMapper tbShopOnlineMapper;
// @Scheduled(initialDelay = 2000,fixedDelay = 500)
public void modifyShopStatus(){
ConcurrentHashMap<String, TbShopInfo> concurrentHashMap= DataCache.concurrentHashMap;
Enumeration<String> keys= concurrentHashMap.keys();
while (keys.hasMoreElements()) {
String key = keys.nextElement();
TbShopInfo shopInfo = concurrentHashMap.get(key);
if (shopInfo.getBusinessTime() == null || ObjectUtil.isEmpty(shopInfo.getBusinessTime())) {
shopInfo.setOnSale(Byte.parseByte("0"));
shopInfo.setStatus(Byte.parseByte("0"));
shopInfo.setUpdatedAt(System.currentTimeMillis());
tbShopInfoMapper.updateByPrimaryKeyWithBLOBs(shopInfo);
continue;
}
try {
deal(shopInfo);
} catch (Exception e) {
e.printStackTrace();
}
}
}
@Transactional(rollbackFor = Exception.class)
public void deal(TbShopInfo shopInfo) throws Exception{
TbShopOnline online= tbShopOnlineMapper.selectByPrimaryKey(shopInfo.getId());
if(Objects.isNull(online)||ObjectUtil.isEmpty(online)){
log.error("店铺信息不存在:{}",shopInfo.getId());
return;
}
switch (shopInfo.getOnSale().toString()){
case "0":
if(new Date().compareTo(online.getStartTime())>0&&online.getEndTime().compareTo(new Date())>0){
shopInfo.setOnSale(Byte.parseByte("1"));
shopInfo.setStatus(Byte.parseByte("1"));
shopInfo.setCreatedAt(System.currentTimeMillis());
tbShopInfoMapper.updateByPrimaryKey(shopInfo);
online.setStatus("1");
online.setUpdateTime(new Date());
tbShopOnlineMapper.updateByPrimaryKey(online);
DataCache.concurrentHashMap.put(shopInfo.getId().toString(),shopInfo);
}
break;
case "1":
if(online.getStartTime().compareTo(new Date())>0||new Date().compareTo(online.getEndTime())>0){
shopInfo.setOnSale(Byte.parseByte("1"));
shopInfo.setStatus(Byte.parseByte("1"));
shopInfo.setCreatedAt(System.currentTimeMillis());
tbShopInfoMapper.updateByPrimaryKey(shopInfo);
online.setStartTime(DateUtils.getNewDate(online.getStartTime(),3,1));
online.setEndTime(DateUtils.getNewDate(online.getEndTime(),3,1));
online.setStatus("0");
online.setUpdateTime(new Date());
tbShopOnlineMapper.updateByPrimaryKey(online);
}
break;
}
}
}

View File

@@ -8,6 +8,8 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil; import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject; import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil; import cn.hutool.json.JSONUtil;
import com.chaozhanggui.system.cashierservice.bean.OrderUseTypeEnum;
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
import com.chaozhanggui.system.cashierservice.entity.po.CallNumPrintPO; import com.chaozhanggui.system.cashierservice.entity.po.CallNumPrintPO;
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO; import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@@ -120,23 +122,22 @@ public class FeieyunPrintUtil {
public static String buildPrintContent(String pickupNumber, String date, String productName, Integer number, String remark) { public static String buildPrintContent(String pickupNumber, String date, String productName, Integer number, String remark) {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("<CB>" + pickupNumber + "</CB><BR><BR>"); builder.append("<CB>" + pickupNumber + "</CB><BR><BR>");
builder.append("<L>时间: " + date + " </L><BR><BR><BR>"); builder.append("<L>时间: " + date + " </L><BR><BR><BR>");
remark = StrUtil.emptyToDefault(remark, ""); remark = StrUtil.emptyToDefault(remark, "");
if (productName.length() > 4 || remark.length() > 4) { if (productName.length() > 4 || remark.length() > 4) {
builder.append("<B><BOLD>" + productName + " x " + number + "</BOLD></B><BR><BR>"); builder.append("<B><BOLD>" + productName + " x " + number + "</BOLD></B><BR><BR>");
builder.append("<B><BOLD>" + remark + " </BOLD></B><BR>"); builder.append("<B><BOLD>" + remark + " </BOLD></B><BR>");
} else { } else {
builder.append("<B><BOLD>" + productName + " x " + number + "</BOLD></B><BR><BR>"); builder.append("<B><BOLD>" + productName + " x " + number + "</BOLD></B><BR><BR>");
builder.append("<B><BOLD>" + remark + " </BOLD></B><BR>"); builder.append("<B><BOLD>" + remark + " </BOLD></B><BR>");
} }
builder.append("<CUT>"); //builder.append("<CUT>");
return builder.toString(); return builder.toString();
} }
public static String[] getPrintData(String sn, String pickupNumber, String date, String productName, Integer number, String remark) { public static String[] getPrintData(String sn, TbOrderInfo orderInfo, String date, String productName, Integer number, String remark) {
String content = buildPrintContent(pickupNumber, date, productName, number, remark); String content = buildPrintContent(getPickupNum(orderInfo), date, productName, number, remark);
System.out.println("content:".concat(content)); System.out.println("content:".concat(content));
@@ -200,6 +201,20 @@ public class FeieyunPrintUtil {
} }
private static String getPickupNum(TbOrderInfo orderInfo) {
String pickupNum = "";
if ("miniapp".equals(orderInfo.getOrderType())) {
if (OrderUseTypeEnum.TAKEOUT.getValue().equals(orderInfo.getUseType())) {
pickupNum = orderInfo.getOutNumber();
} else {
pickupNum = orderInfo.getTableName();
}
} else {
pickupNum = orderInfo.getMasterId();
}
return pickupNum;
}
public static String buildPrintContent(OrderDetailPO detailPO, String type, String orderType) { public static String buildPrintContent(OrderDetailPO detailPO, String type, String orderType) {
StringBuffer data = new StringBuffer(); StringBuffer data = new StringBuffer();
data.append(StrUtil.format("<CB>{}</CB><BR>", detailPO.getMerchantName())); data.append(StrUtil.format("<CB>{}</CB><BR>", detailPO.getMerchantName()));
@@ -241,8 +256,8 @@ public class FeieyunPrintUtil {
data.append(StrUtil.format("<B>应收:{}</B><BR>", t)); data.append(StrUtil.format("<B>应收:{}</B><BR>", t));
} }
if (ObjectUtil.isNotEmpty(detailPO.getPayType()) && ObjectUtil.isNotNull(detailPO.getPayType()) && detailPO.getPayType().equals("deposit")) { if (ObjectUtil.isNotEmpty(detailPO.getPayType()) && ObjectUtil.isNotNull(detailPO.getPayType()) && detailPO.getPayType().equals("deposit")) {
data.append("--------------------------------<BR>");
data.append(StrUtil.format("储值:{}<BR>", detailPO.getReceiptsAmount())); data.append(StrUtil.format("储值:{}<BR>", detailPO.getReceiptsAmount()));
data.append("--------------------------------<BR>");
data.append(StrUtil.format("积分:{}<BR>", detailPO.getIntegral())); data.append(StrUtil.format("积分:{}<BR>", detailPO.getIntegral()));
} }
data.append(StrUtil.format("余额:{}<BR>", detailPO.getBalance())); data.append(StrUtil.format("余额:{}<BR>", detailPO.getBalance()));
@@ -537,4 +552,6 @@ public class FeieyunPrintUtil {
} }
} }

View File

@@ -1,199 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.CodeColumnConfigMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.CodeColumnConfig">
<id column="column_id" jdbcType="BIGINT" property="columnId" />
<result column="table_name" jdbcType="VARCHAR" property="tableName" />
<result column="column_name" jdbcType="VARCHAR" property="columnName" />
<result column="column_type" jdbcType="VARCHAR" property="columnType" />
<result column="dict_name" jdbcType="VARCHAR" property="dictName" />
<result column="extra" jdbcType="VARCHAR" property="extra" />
<result column="form_show" jdbcType="BIT" property="formShow" />
<result column="form_type" jdbcType="VARCHAR" property="formType" />
<result column="key_type" jdbcType="VARCHAR" property="keyType" />
<result column="list_show" jdbcType="BIT" property="listShow" />
<result column="not_null" jdbcType="BIT" property="notNull" />
<result column="query_type" jdbcType="VARCHAR" property="queryType" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="date_annotation" jdbcType="VARCHAR" property="dateAnnotation" />
</resultMap>
<sql id="Base_Column_List">
column_id, table_name, column_name, column_type, dict_name, extra, form_show, form_type,
key_type, list_show, not_null, query_type, remark, date_annotation
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_column_config
where column_id = #{columnId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from code_column_config
where column_id = #{columnId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.CodeColumnConfig">
insert into code_column_config (column_id, table_name, column_name,
column_type, dict_name, extra,
form_show, form_type, key_type,
list_show, not_null, query_type,
remark, date_annotation)
values (#{columnId,jdbcType=BIGINT}, #{tableName,jdbcType=VARCHAR}, #{columnName,jdbcType=VARCHAR},
#{columnType,jdbcType=VARCHAR}, #{dictName,jdbcType=VARCHAR}, #{extra,jdbcType=VARCHAR},
#{formShow,jdbcType=BIT}, #{formType,jdbcType=VARCHAR}, #{keyType,jdbcType=VARCHAR},
#{listShow,jdbcType=BIT}, #{notNull,jdbcType=BIT}, #{queryType,jdbcType=VARCHAR},
#{remark,jdbcType=VARCHAR}, #{dateAnnotation,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.CodeColumnConfig">
insert into code_column_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="columnId != null">
column_id,
</if>
<if test="tableName != null">
table_name,
</if>
<if test="columnName != null">
column_name,
</if>
<if test="columnType != null">
column_type,
</if>
<if test="dictName != null">
dict_name,
</if>
<if test="extra != null">
extra,
</if>
<if test="formShow != null">
form_show,
</if>
<if test="formType != null">
form_type,
</if>
<if test="keyType != null">
key_type,
</if>
<if test="listShow != null">
list_show,
</if>
<if test="notNull != null">
not_null,
</if>
<if test="queryType != null">
query_type,
</if>
<if test="remark != null">
remark,
</if>
<if test="dateAnnotation != null">
date_annotation,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="columnId != null">
#{columnId,jdbcType=BIGINT},
</if>
<if test="tableName != null">
#{tableName,jdbcType=VARCHAR},
</if>
<if test="columnName != null">
#{columnName,jdbcType=VARCHAR},
</if>
<if test="columnType != null">
#{columnType,jdbcType=VARCHAR},
</if>
<if test="dictName != null">
#{dictName,jdbcType=VARCHAR},
</if>
<if test="extra != null">
#{extra,jdbcType=VARCHAR},
</if>
<if test="formShow != null">
#{formShow,jdbcType=BIT},
</if>
<if test="formType != null">
#{formType,jdbcType=VARCHAR},
</if>
<if test="keyType != null">
#{keyType,jdbcType=VARCHAR},
</if>
<if test="listShow != null">
#{listShow,jdbcType=BIT},
</if>
<if test="notNull != null">
#{notNull,jdbcType=BIT},
</if>
<if test="queryType != null">
#{queryType,jdbcType=VARCHAR},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="dateAnnotation != null">
#{dateAnnotation,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.CodeColumnConfig">
update code_column_config
<set>
<if test="tableName != null">
table_name = #{tableName,jdbcType=VARCHAR},
</if>
<if test="columnName != null">
column_name = #{columnName,jdbcType=VARCHAR},
</if>
<if test="columnType != null">
column_type = #{columnType,jdbcType=VARCHAR},
</if>
<if test="dictName != null">
dict_name = #{dictName,jdbcType=VARCHAR},
</if>
<if test="extra != null">
extra = #{extra,jdbcType=VARCHAR},
</if>
<if test="formShow != null">
form_show = #{formShow,jdbcType=BIT},
</if>
<if test="formType != null">
form_type = #{formType,jdbcType=VARCHAR},
</if>
<if test="keyType != null">
key_type = #{keyType,jdbcType=VARCHAR},
</if>
<if test="listShow != null">
list_show = #{listShow,jdbcType=BIT},
</if>
<if test="notNull != null">
not_null = #{notNull,jdbcType=BIT},
</if>
<if test="queryType != null">
query_type = #{queryType,jdbcType=VARCHAR},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="dateAnnotation != null">
date_annotation = #{dateAnnotation,jdbcType=VARCHAR},
</if>
</set>
where column_id = #{columnId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.CodeColumnConfig">
update code_column_config
set table_name = #{tableName,jdbcType=VARCHAR},
column_name = #{columnName,jdbcType=VARCHAR},
column_type = #{columnType,jdbcType=VARCHAR},
dict_name = #{dictName,jdbcType=VARCHAR},
extra = #{extra,jdbcType=VARCHAR},
form_show = #{formShow,jdbcType=BIT},
form_type = #{formType,jdbcType=VARCHAR},
key_type = #{keyType,jdbcType=VARCHAR},
list_show = #{listShow,jdbcType=BIT},
not_null = #{notNull,jdbcType=BIT},
query_type = #{queryType,jdbcType=VARCHAR},
remark = #{remark,jdbcType=VARCHAR},
date_annotation = #{dateAnnotation,jdbcType=VARCHAR}
where column_id = #{columnId,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -1,153 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.CodeGenConfigMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.CodeGenConfig">
<id column="config_id" jdbcType="BIGINT" property="configId" />
<result column="table_name" jdbcType="VARCHAR" property="tableName" />
<result column="author" jdbcType="VARCHAR" property="author" />
<result column="cover" jdbcType="BIT" property="cover" />
<result column="module_name" jdbcType="VARCHAR" property="moduleName" />
<result column="pack" jdbcType="VARCHAR" property="pack" />
<result column="path" jdbcType="VARCHAR" property="path" />
<result column="api_path" jdbcType="VARCHAR" property="apiPath" />
<result column="prefix" jdbcType="VARCHAR" property="prefix" />
<result column="api_alias" jdbcType="VARCHAR" property="apiAlias" />
</resultMap>
<sql id="Base_Column_List">
config_id, table_name, author, cover, module_name, pack, path, api_path, prefix,
api_alias
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from code_gen_config
where config_id = #{configId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from code_gen_config
where config_id = #{configId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.CodeGenConfig">
insert into code_gen_config (config_id, table_name, author,
cover, module_name, pack,
path, api_path, prefix,
api_alias)
values (#{configId,jdbcType=BIGINT}, #{tableName,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
#{cover,jdbcType=BIT}, #{moduleName,jdbcType=VARCHAR}, #{pack,jdbcType=VARCHAR},
#{path,jdbcType=VARCHAR}, #{apiPath,jdbcType=VARCHAR}, #{prefix,jdbcType=VARCHAR},
#{apiAlias,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.CodeGenConfig">
insert into code_gen_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="configId != null">
config_id,
</if>
<if test="tableName != null">
table_name,
</if>
<if test="author != null">
author,
</if>
<if test="cover != null">
cover,
</if>
<if test="moduleName != null">
module_name,
</if>
<if test="pack != null">
pack,
</if>
<if test="path != null">
path,
</if>
<if test="apiPath != null">
api_path,
</if>
<if test="prefix != null">
prefix,
</if>
<if test="apiAlias != null">
api_alias,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="configId != null">
#{configId,jdbcType=BIGINT},
</if>
<if test="tableName != null">
#{tableName,jdbcType=VARCHAR},
</if>
<if test="author != null">
#{author,jdbcType=VARCHAR},
</if>
<if test="cover != null">
#{cover,jdbcType=BIT},
</if>
<if test="moduleName != null">
#{moduleName,jdbcType=VARCHAR},
</if>
<if test="pack != null">
#{pack,jdbcType=VARCHAR},
</if>
<if test="path != null">
#{path,jdbcType=VARCHAR},
</if>
<if test="apiPath != null">
#{apiPath,jdbcType=VARCHAR},
</if>
<if test="prefix != null">
#{prefix,jdbcType=VARCHAR},
</if>
<if test="apiAlias != null">
#{apiAlias,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.CodeGenConfig">
update code_gen_config
<set>
<if test="tableName != null">
table_name = #{tableName,jdbcType=VARCHAR},
</if>
<if test="author != null">
author = #{author,jdbcType=VARCHAR},
</if>
<if test="cover != null">
cover = #{cover,jdbcType=BIT},
</if>
<if test="moduleName != null">
module_name = #{moduleName,jdbcType=VARCHAR},
</if>
<if test="pack != null">
pack = #{pack,jdbcType=VARCHAR},
</if>
<if test="path != null">
path = #{path,jdbcType=VARCHAR},
</if>
<if test="apiPath != null">
api_path = #{apiPath,jdbcType=VARCHAR},
</if>
<if test="prefix != null">
prefix = #{prefix,jdbcType=VARCHAR},
</if>
<if test="apiAlias != null">
api_alias = #{apiAlias,jdbcType=VARCHAR},
</if>
</set>
where config_id = #{configId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.CodeGenConfig">
update code_gen_config
set table_name = #{tableName,jdbcType=VARCHAR},
author = #{author,jdbcType=VARCHAR},
cover = #{cover,jdbcType=BIT},
module_name = #{moduleName,jdbcType=VARCHAR},
pack = #{pack,jdbcType=VARCHAR},
path = #{path,jdbcType=VARCHAR},
api_path = #{apiPath,jdbcType=VARCHAR},
prefix = #{prefix,jdbcType=VARCHAR},
api_alias = #{apiAlias,jdbcType=VARCHAR}
where config_id = #{configId,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -1,177 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.MntAppMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.MntApp">
<id column="app_id" jdbcType="BIGINT" property="appId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="upload_path" jdbcType="VARCHAR" property="uploadPath" />
<result column="deploy_path" jdbcType="VARCHAR" property="deployPath" />
<result column="backup_path" jdbcType="VARCHAR" property="backupPath" />
<result column="port" jdbcType="INTEGER" property="port" />
<result column="start_script" jdbcType="VARCHAR" property="startScript" />
<result column="deploy_script" jdbcType="VARCHAR" property="deployScript" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
app_id, name, upload_path, deploy_path, backup_path, port, start_script, deploy_script,
create_by, update_by, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from mnt_app
where app_id = #{appId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from mnt_app
where app_id = #{appId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.MntApp">
insert into mnt_app (app_id, name, upload_path,
deploy_path, backup_path, port,
start_script, deploy_script, create_by,
update_by, create_time, update_time
)
values (#{appId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{uploadPath,jdbcType=VARCHAR},
#{deployPath,jdbcType=VARCHAR}, #{backupPath,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER},
#{startScript,jdbcType=VARCHAR}, #{deployScript,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntApp">
insert into mnt_app
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="appId != null">
app_id,
</if>
<if test="name != null">
name,
</if>
<if test="uploadPath != null">
upload_path,
</if>
<if test="deployPath != null">
deploy_path,
</if>
<if test="backupPath != null">
backup_path,
</if>
<if test="port != null">
port,
</if>
<if test="startScript != null">
start_script,
</if>
<if test="deployScript != null">
deploy_script,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="appId != null">
#{appId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="uploadPath != null">
#{uploadPath,jdbcType=VARCHAR},
</if>
<if test="deployPath != null">
#{deployPath,jdbcType=VARCHAR},
</if>
<if test="backupPath != null">
#{backupPath,jdbcType=VARCHAR},
</if>
<if test="port != null">
#{port,jdbcType=INTEGER},
</if>
<if test="startScript != null">
#{startScript,jdbcType=VARCHAR},
</if>
<if test="deployScript != null">
#{deployScript,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntApp">
update mnt_app
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="uploadPath != null">
upload_path = #{uploadPath,jdbcType=VARCHAR},
</if>
<if test="deployPath != null">
deploy_path = #{deployPath,jdbcType=VARCHAR},
</if>
<if test="backupPath != null">
backup_path = #{backupPath,jdbcType=VARCHAR},
</if>
<if test="port != null">
port = #{port,jdbcType=INTEGER},
</if>
<if test="startScript != null">
start_script = #{startScript,jdbcType=VARCHAR},
</if>
<if test="deployScript != null">
deploy_script = #{deployScript,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where app_id = #{appId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.MntApp">
update mnt_app
set name = #{name,jdbcType=VARCHAR},
upload_path = #{uploadPath,jdbcType=VARCHAR},
deploy_path = #{deployPath,jdbcType=VARCHAR},
backup_path = #{backupPath,jdbcType=VARCHAR},
port = #{port,jdbcType=INTEGER},
start_script = #{startScript,jdbcType=VARCHAR},
deploy_script = #{deployScript,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where app_id = #{appId,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -1,141 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.MntDatabaseMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.MntDatabase">
<id column="db_id" jdbcType="VARCHAR" property="dbId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="jdbc_url" jdbcType="VARCHAR" property="jdbcUrl" />
<result column="user_name" jdbcType="VARCHAR" property="userName" />
<result column="pwd" jdbcType="VARCHAR" property="pwd" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
db_id, name, jdbc_url, user_name, pwd, create_by, update_by, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from mnt_database
where db_id = #{dbId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from mnt_database
where db_id = #{dbId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDatabase">
insert into mnt_database (db_id, name, jdbc_url,
user_name, pwd, create_by,
update_by, create_time, update_time
)
values (#{dbId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{jdbcUrl,jdbcType=VARCHAR},
#{userName,jdbcType=VARCHAR}, #{pwd,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDatabase">
insert into mnt_database
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="dbId != null">
db_id,
</if>
<if test="name != null">
name,
</if>
<if test="jdbcUrl != null">
jdbc_url,
</if>
<if test="userName != null">
user_name,
</if>
<if test="pwd != null">
pwd,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="dbId != null">
#{dbId,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="jdbcUrl != null">
#{jdbcUrl,jdbcType=VARCHAR},
</if>
<if test="userName != null">
#{userName,jdbcType=VARCHAR},
</if>
<if test="pwd != null">
#{pwd,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDatabase">
update mnt_database
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="jdbcUrl != null">
jdbc_url = #{jdbcUrl,jdbcType=VARCHAR},
</if>
<if test="userName != null">
user_name = #{userName,jdbcType=VARCHAR},
</if>
<if test="pwd != null">
pwd = #{pwd,jdbcType=VARCHAR},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where db_id = #{dbId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDatabase">
update mnt_database
set name = #{name,jdbcType=VARCHAR},
jdbc_url = #{jdbcUrl,jdbcType=VARCHAR},
user_name = #{userName,jdbcType=VARCHAR},
pwd = #{pwd,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where db_id = #{dbId,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -1,106 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.MntDeployHistoryMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.MntDeployHistory">
<id column="history_id" jdbcType="VARCHAR" property="historyId" />
<result column="app_name" jdbcType="VARCHAR" property="appName" />
<result column="deploy_date" jdbcType="TIMESTAMP" property="deployDate" />
<result column="deploy_user" jdbcType="VARCHAR" property="deployUser" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="deploy_id" jdbcType="BIGINT" property="deployId" />
</resultMap>
<sql id="Base_Column_List">
history_id, app_name, deploy_date, deploy_user, ip, deploy_id
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from mnt_deploy_history
where history_id = #{historyId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from mnt_deploy_history
where history_id = #{historyId,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeployHistory">
insert into mnt_deploy_history (history_id, app_name, deploy_date,
deploy_user, ip, deploy_id
)
values (#{historyId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR}, #{deployDate,jdbcType=TIMESTAMP},
#{deployUser,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{deployId,jdbcType=BIGINT}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeployHistory">
insert into mnt_deploy_history
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="historyId != null">
history_id,
</if>
<if test="appName != null">
app_name,
</if>
<if test="deployDate != null">
deploy_date,
</if>
<if test="deployUser != null">
deploy_user,
</if>
<if test="ip != null">
ip,
</if>
<if test="deployId != null">
deploy_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="historyId != null">
#{historyId,jdbcType=VARCHAR},
</if>
<if test="appName != null">
#{appName,jdbcType=VARCHAR},
</if>
<if test="deployDate != null">
#{deployDate,jdbcType=TIMESTAMP},
</if>
<if test="deployUser != null">
#{deployUser,jdbcType=VARCHAR},
</if>
<if test="ip != null">
#{ip,jdbcType=VARCHAR},
</if>
<if test="deployId != null">
#{deployId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeployHistory">
update mnt_deploy_history
<set>
<if test="appName != null">
app_name = #{appName,jdbcType=VARCHAR},
</if>
<if test="deployDate != null">
deploy_date = #{deployDate,jdbcType=TIMESTAMP},
</if>
<if test="deployUser != null">
deploy_user = #{deployUser,jdbcType=VARCHAR},
</if>
<if test="ip != null">
ip = #{ip,jdbcType=VARCHAR},
</if>
<if test="deployId != null">
deploy_id = #{deployId,jdbcType=BIGINT},
</if>
</set>
where history_id = #{historyId,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeployHistory">
update mnt_deploy_history
set app_name = #{appName,jdbcType=VARCHAR},
deploy_date = #{deployDate,jdbcType=TIMESTAMP},
deploy_user = #{deployUser,jdbcType=VARCHAR},
ip = #{ip,jdbcType=VARCHAR},
deploy_id = #{deployId,jdbcType=BIGINT}
where history_id = #{historyId,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -1,106 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.MntDeployMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.MntDeploy">
<id column="deploy_id" jdbcType="BIGINT" property="deployId" />
<result column="app_id" jdbcType="BIGINT" property="appId" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
deploy_id, app_id, create_by, update_by, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from mnt_deploy
where deploy_id = #{deployId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from mnt_deploy
where deploy_id = #{deployId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeploy">
insert into mnt_deploy (deploy_id, app_id, create_by,
update_by, create_time, update_time
)
values (#{deployId,jdbcType=BIGINT}, #{appId,jdbcType=BIGINT}, #{createBy,jdbcType=VARCHAR},
#{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeploy">
insert into mnt_deploy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deployId != null">
deploy_id,
</if>
<if test="appId != null">
app_id,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deployId != null">
#{deployId,jdbcType=BIGINT},
</if>
<if test="appId != null">
#{appId,jdbcType=BIGINT},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeploy">
update mnt_deploy
<set>
<if test="appId != null">
app_id = #{appId,jdbcType=BIGINT},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where deploy_id = #{deployId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeploy">
update mnt_deploy
set app_id = #{appId,jdbcType=BIGINT},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where deploy_id = #{deployId,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.MntDeployServerMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.MntDeployServerKey">
<id column="deploy_id" jdbcType="BIGINT" property="deployId" />
<id column="server_id" jdbcType="BIGINT" property="serverId" />
</resultMap>
<delete id="deleteByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeployServerKey">
delete from mnt_deploy_server
where deploy_id = #{deployId,jdbcType=BIGINT}
and server_id = #{serverId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeployServerKey">
insert into mnt_deploy_server (deploy_id, server_id)
values (#{deployId,jdbcType=BIGINT}, #{serverId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntDeployServerKey">
insert into mnt_deploy_server
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deployId != null">
deploy_id,
</if>
<if test="serverId != null">
server_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deployId != null">
#{deployId,jdbcType=BIGINT},
</if>
<if test="serverId != null">
#{serverId,jdbcType=BIGINT},
</if>
</trim>
</insert>
</mapper>

View File

@@ -1,153 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.MntServerMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.MntServer">
<id column="server_id" jdbcType="BIGINT" property="serverId" />
<result column="account" jdbcType="VARCHAR" property="account" />
<result column="ip" jdbcType="VARCHAR" property="ip" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="password" jdbcType="VARCHAR" property="password" />
<result column="port" jdbcType="INTEGER" property="port" />
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
server_id, account, ip, name, password, port, create_by, update_by, create_time,
update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from mnt_server
where server_id = #{serverId,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from mnt_server
where server_id = #{serverId,jdbcType=BIGINT}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.MntServer">
insert into mnt_server (server_id, account, ip,
name, password, port,
create_by, update_by, create_time,
update_time)
values (#{serverId,jdbcType=BIGINT}, #{account,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR},
#{name,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER},
#{createBy,jdbcType=VARCHAR}, #{updateBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntServer">
insert into mnt_server
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="serverId != null">
server_id,
</if>
<if test="account != null">
account,
</if>
<if test="ip != null">
ip,
</if>
<if test="name != null">
name,
</if>
<if test="password != null">
password,
</if>
<if test="port != null">
port,
</if>
<if test="createBy != null">
create_by,
</if>
<if test="updateBy != null">
update_by,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="serverId != null">
#{serverId,jdbcType=BIGINT},
</if>
<if test="account != null">
#{account,jdbcType=VARCHAR},
</if>
<if test="ip != null">
#{ip,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="password != null">
#{password,jdbcType=VARCHAR},
</if>
<if test="port != null">
#{port,jdbcType=INTEGER},
</if>
<if test="createBy != null">
#{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
#{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.MntServer">
update mnt_server
<set>
<if test="account != null">
account = #{account,jdbcType=VARCHAR},
</if>
<if test="ip != null">
ip = #{ip,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="password != null">
password = #{password,jdbcType=VARCHAR},
</if>
<if test="port != null">
port = #{port,jdbcType=INTEGER},
</if>
<if test="createBy != null">
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if test="updateBy != null">
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where server_id = #{serverId,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.MntServer">
update mnt_server
set account = #{account,jdbcType=VARCHAR},
ip = #{ip,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
password = #{password,jdbcType=VARCHAR},
port = #{port,jdbcType=INTEGER},
create_by = #{createBy,jdbcType=VARCHAR},
update_by = #{updateBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where server_id = #{serverId,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -0,0 +1,198 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbActivateInRecordMapper">
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbActivateInRecord" id="TbActivateInRecordMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="vipUserId" column="vip_user_id" jdbcType="INTEGER"/>
<result property="couponId" column="coupon_id" jdbcType="INTEGER"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="INTEGER"/>
<result property="proId" column="pro_id" jdbcType="INTEGER"/>
<result property="fullAmount" column="full_amount" jdbcType="DECIMAL"/>
<result property="discountAmount" column="discount_amount" jdbcType="DECIMAL"/>
<result property="num" column="num" jdbcType="INTEGER"/>
<result property="overNum" column="over_num" jdbcType="INTEGER"/>
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
<result property="sourceActId" column="source_act_id" jdbcType="INTEGER"/>
<result property="sourceFlowId" column="source_flow_id" jdbcType="INTEGER"/>
<result property="useStartTime" column="use_start_time" jdbcType="TIMESTAMP"/>
<result property="useEndTime" column="use_end_time" jdbcType="TIMESTAMP"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
<result property="couponJson" column="coupon_json" jdbcType="VARCHAR"/>
<result property="source" column="source" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
id
, vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num, over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time, coupon_json, `source` </sql>
<!--查询单个-->
<select id="queryById" resultMap="TbActivateInRecordMap">
select
<include refid="Base_Column_List"/>
from tb_activate_in_record
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbActivateInRecordMap">
select
<include refid="Base_Column_List"/>
from tb_activate_in_record
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="vipUserId != null">
and vip_user_id = #{vipUserId}
</if>
<if test="couponId != null">
and coupon_id = #{couponId}
</if>
<if test="name != null and name != ''">
and name = #{name}
</if>
<if test="type != null">
and type = #{type}
</if>
<if test="proId != null">
and pro_id = #{proId}
</if>
<if test="fullAmount != null">
and full_amount = #{fullAmount}
</if>
<if test="discountAmount != null">
and discount_amount = #{discountAmount}
</if>
<if test="num != null">
and num = #{num}
</if>
<if test="overNum != null">
and over_num = #{overNum}
</if>
<if test="shopId != null">
and shop_id = #{shopId}
</if>
<if test="sourceActId != null">
and source_act_id = #{sourceActId}
</if>
<if test="sourceFlowId != null">
and source_flow_id = #{sourceFlowId}
</if>
<if test="useStartTime != null">
and use_start_time = #{useStartTime}
</if>
<if test="useEndTime != null">
and use_end_time = #{useEndTime}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
<if test="couponJson != null and couponJson != ''">
and coupon_json = #{couponJson}
</if>
<if test="source != null and source != ''">
and source = #{source}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_in_record(vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num,
over_num, shop_id, source_act_id, source_flow_id, use_start_time,
use_end_time, create_time, update_time, coupon_json, source)
values (#{vipUserId}, #{couponId}, #{name}, #{type}, #{proId}, #{fullAmount}, #{discountAmount}, #{num},
#{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{useStartTime}, #{useEndTime}, #{createTime},
#{updateTime}, #{couponJson}, #{source})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_in_record(vip_user_id, coupon_id, name, type, pro_id, full_amount, discount_amount, num,
over_num, shop_id, source_act_id, source_flow_id, use_start_time, use_end_time, create_time, update_time,
coupon_json,source)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.vipUserId}, #{entity.couponId}, #{entity.name}, #{entity.type}, #{entity.proId},
#{entity.fullAmount}, #{entity.discountAmount}, #{entity.num}, #{entity.overNum}, #{entity.shopId},
#{entity.sourceActId}, #{entity.sourceFlowId}, #{entity.useStartTime}, #{entity.useEndTime},
#{entity.createTime}, #{entity.updateTime}, #{entity.couponJson},#{entity.source})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_activate_in_record
<set>
<if test="vipUserId != null">
vip_user_id = #{vipUserId},
</if>
<if test="couponId != null">
coupon_id = #{couponId},
</if>
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="proId != null">
pro_id = #{proId},
</if>
<if test="fullAmount != null">
full_amount = #{fullAmount},
</if>
<if test="discountAmount != null">
discount_amount = #{discountAmount},
</if>
<if test="num != null">
num = #{num},
</if>
<if test="overNum != null">
over_num = #{overNum},
</if>
<if test="shopId != null">
shop_id = #{shopId},
</if>
<if test="sourceActId != null">
source_act_id = #{sourceActId},
</if>
<if test="sourceFlowId != null">
source_flow_id = #{sourceFlowId},
</if>
<if test="useStartTime != null">
use_start_time = #{useStartTime},
</if>
<if test="useEndTime != null">
use_end_time = #{useEndTime},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
<if test="couponJson != null and couponJson != ''">
coupon_json = #{couponJson},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tb_activate_in_record
where id = #{id}
</delete>
</mapper>

View File

@@ -1,127 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbActivateMapper"> <mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbActivateMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbActivate">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
<result column="min_num" jdbcType="INTEGER" property="minNum" />
<result column="max_num" jdbcType="INTEGER" property="maxNum" />
<result column="handsel_num" jdbcType="DECIMAL" property="handselNum" />
<result column="handsel_type" jdbcType="VARCHAR" property="handselType" />
<result column="is_del" jdbcType="VARCHAR" property="isDel" />
</resultMap>
<sql id="Base_Column_List">
id, shop_id, min_num, max_num, handsel_num, handsel_type, is_del
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_activate
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_activate
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbActivate">
insert into tb_activate (id, shop_id, min_num,
max_num, handsel_num, handsel_type,
is_del)
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{minNum,jdbcType=INTEGER},
#{maxNum,jdbcType=INTEGER}, #{handselNum,jdbcType=DECIMAL}, #{handselType,jdbcType=VARCHAR},
#{isDel,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbActivate">
insert into tb_activate
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="minNum != null">
min_num,
</if>
<if test="maxNum != null">
max_num,
</if>
<if test="handselNum != null">
handsel_num,
</if>
<if test="handselType != null">
handsel_type,
</if>
<if test="isDel != null">
is_del,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="shopId != null">
#{shopId,jdbcType=INTEGER},
</if>
<if test="minNum != null">
#{minNum,jdbcType=INTEGER},
</if>
<if test="maxNum != null">
#{maxNum,jdbcType=INTEGER},
</if>
<if test="handselNum != null">
#{handselNum,jdbcType=DECIMAL},
</if>
<if test="handselType != null">
#{handselType,jdbcType=VARCHAR},
</if>
<if test="isDel != null">
#{isDel,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbActivate">
update tb_activate
<set>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=INTEGER},
</if>
<if test="minNum != null">
min_num = #{minNum,jdbcType=INTEGER},
</if>
<if test="maxNum != null">
max_num = #{maxNum,jdbcType=INTEGER},
</if>
<if test="handselNum != null">
handsel_num = #{handselNum,jdbcType=DECIMAL},
</if>
<if test="handselType != null">
handsel_type = #{handselType,jdbcType=VARCHAR},
</if>
<if test="isDel != null">
is_del = #{isDel,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbActivate">
update tb_activate
set shop_id = #{shopId,jdbcType=INTEGER},
min_num = #{minNum,jdbcType=INTEGER},
max_num = #{maxNum,jdbcType=INTEGER},
handsel_num = #{handselNum,jdbcType=DECIMAL},
handsel_type = #{handselType,jdbcType=VARCHAR},
is_del = #{isDel,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByAmount" resultMap="BaseResultMap"> <resultMap type="com.chaozhanggui.system.cashierservice.entity.TbActivate" id="TbActivateMap">
select * <result property="id" column="id" jdbcType="INTEGER"/>
from tb_activate <result property="shopId" column="shop_id" jdbcType="INTEGER"/>
where shop_id = #{shopId} <result property="amount" column="amount" jdbcType="INTEGER"/>
and is_del = 0 <result property="giftAmount" column="gift_amount" jdbcType="INTEGER"/>
and min_num &lt;= #{amount} <result property="giftPoints" column="gift_points" jdbcType="INTEGER"/>
and max_num &gt;= #{amount} <result property="isUseCoupon" column="is_use_coupon" jdbcType="INTEGER"/>
ORDER BY max_num desc limit 1 <result property="couponId" column="coupon_id" jdbcType="INTEGER"/>
<result property="num" column="num" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id
, shop_id, amount, gift_amount, gift_points, is_use_coupon, coupon_id, num, create_time, update_time </sql>
<select id="selectByAmount" resultMap="TbActivateMap">
select *
from tb_activate
where shop_id = #{shopId}
and amount &lt;= #{amount}
order by amount desc
limit 1
</select> </select>
</mapper>
<select id="selectByAmountScope" resultMap="TbActivateMap">
select
<include refid="Base_Column_List"/>
from tb_activate
where shop_id = #{shopId}
<![CDATA[
and amount > 0
and amount <= #{amount}
]]>
order by amount desc,gift_points desc,id desc
limit 1
</select>
<select id="updateMemberPoints" resultType="int">
update tb_shop_user set last_points_change_time = now(),last_float_points = #{points},account_points = account_points + ${points} where id = #{memberId}
</select>
<insert id="insertMemberPointsLog" keyProperty="id" useGeneratedKeys="true">
insert into tb_member_points_log(shop_id, member_id, member_name, avatar_url, content, order_no, mobile, float_type, float_points, create_time)
values (#{shopId}, #{memberId}, #{memberName}, #{avatarUrl}, #{content}, #{orderNo}, #{mobile}, #{floatType}, #{floatPoints}, now())
</insert>
<!--查询单个-->
<select id="queryById" resultMap="TbActivateMap">
select
<include refid="Base_Column_List"/>
from tb_activate
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbActivateMap">
select
<include refid="Base_Column_List"/>
from tb_activate
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="shopId != null">
and shop_id = #{shopId}
</if>
<if test="amount != null">
and amount = #{amount}
</if>
<if test="giftAmount != null">
and gift_amount = #{giftAmount}
</if>
<if test="giftPoints != null">
and gift_points = #{giftPoints}
</if>
<if test="isUseCoupon != null">
and is_use_coupon = #{isUseCoupon}
</if>
<if test="couponId != null">
and coupon_id = #{couponId}
</if>
<if test="num != null">
and num = #{num}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate(shop_id, amount, gift_amount, gift_points, is_use_coupon, coupon_id, num, create_time, update_time)
values (#{shopId}, #{amount}, #{giftAmount}, #{giftPoints}, #{isUseCoupon}, #{couponId}, #{num}, #{createTime}, #{updateTime})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate(shop_id, amount, gift_amount, gift_points, is_use_coupon, coupon_id, num, create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.shopId}, #{entity.amount}, #{entity.giftAmount}, #{entity.giftPoints}, #{entity.isUseCoupon}, #{entity.couponId},
#{entity.num}, #{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_activate
<set>
<if test="shopId != null">
shop_id = #{shopId},
</if>
<if test="amount != null">
amount = #{amount},
</if>
<if test="giftAmount != null">
gift_amount = #{giftAmount},
</if>
<if test="giftPoints != null">
gift_points = #{giftPoints},
</if>
<if test="isUseCoupon != null">
is_use_coupon = #{isUseCoupon},
</if>
<if test="couponId != null">
coupon_id = #{couponId},
</if>
<if test="num != null">
num = #{num},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tb_activate
where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbActivateOutRecordMapper">
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbActivateOutRecord" id="TbActivateOutRecordMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
<result property="giveId" column="give_id" jdbcType="INTEGER"/>
<result property="vipUserId" column="vip_user_id" jdbcType="INTEGER"/>
<result property="type" column="type" jdbcType="INTEGER"/>
<result property="useNum" column="use_num" jdbcType="INTEGER"/>
<result property="refNum" column="ref_num" jdbcType="INTEGER"/>
<result property="status" column="status" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id
, shop_id, order_id, give_id, vip_user_id, type, use_num, ref_num, status, create_time, update_time </sql>
<!--查询单个-->
<select id="queryById" resultMap="TbActivateOutRecordMap">
select
<include refid="Base_Column_List"/>
from tb_activate_out_record
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbActivateOutRecordMap">
select
<include refid="Base_Column_List"/>
from tb_activate_out_record
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="shopId != null">
and shop_id = #{shopId}
</if>
<if test="orderId != null and orderId != ''">
and order_id = #{orderId}
</if>
<if test="giveId != null">
and give_id = #{giveId}
</if>
<if test="vipUserId != null">
and vip_user_id = #{vipUserId}
</if>
<if test="type != null">
and type = #{type}
</if>
<if test="useNum != null">
and use_num = #{useNum}
</if>
<if test="refNum != null">
and ref_num = #{refNum}
</if>
<if test="status != null and status != ''">
and status = #{status}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_out_record(shop_id, order_id, give_id, vip_user_id, type, use_num, ref_num, status,
create_time, update_time)
values (#{shopId}, #{orderId}, #{giveId}, #{vipUserId}, #{type}, #{useNum}, #{refNum}, #{status}, #{createTime},
#{updateTime})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_activate_out_record(shop_id, order_id, give_id, vip_user_id, type, use_num, ref_num, status,
create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.shopId}, #{entity.orderId}, #{entity.giveId}, #{entity.vipUserId}, #{entity.type},
#{entity.useNum}, #{entity.refNum}, #{entity.status}, #{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_activate_out_record
<set>
<if test="shopId != null">
shop_id = #{shopId},
</if>
<if test="orderId != null and orderId != ''">
order_id = #{orderId},
</if>
<if test="giveId != null">
give_id = #{giveId},
</if>
<if test="vipUserId != null">
vip_user_id = #{vipUserId},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="useNum != null">
use_num = #{useNum},
</if>
<if test="refNum != null">
ref_num = #{refNum},
</if>
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tb_activate_out_record
where id = #{id}
</delete>
</mapper>

View File

@@ -0,0 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbCouponProductMapper">
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbCouponProduct" id="TbCouponProductMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="couponId" column="coupon_id" jdbcType="INTEGER"/>
<result property="productId" column="product_id" jdbcType="INTEGER"/>
<result property="num" column="num" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id
, coupon_id, product_id, num, create_time, update_time </sql>
<!--查询单个-->
<select id="queryById" resultMap="TbCouponProductMap">
select
<include refid="Base_Column_List"/>
from tb_coupon_product
where id = #{id}
</select>
<select id="queryAllByCouponId" resultMap="TbCouponProductMap">
select
<include refid="Base_Column_List"/>
from tb_coupon_product
where
coupon_id = #{couponId}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbCouponProductMap">
select
<include refid="Base_Column_List"/>
from tb_coupon_product
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="couponId != null">
and coupon_id = #{couponId}
</if>
<if test="productId != null">
and product_id = #{productId}
</if>
<if test="num != null">
and num = #{num}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into tb_coupon_product(coupon_id, product_id, num, create_time, update_time)
values (#{couponId}, #{productId}, #{num}, #{createTime}, #{updateTime})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_coupon_product(coupon_id, product_id, num, create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.couponId}, #{entity.productId}, #{entity.num}, #{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_coupon_product
<set>
<if test="couponId != null">
coupon_id = #{couponId},
</if>
<if test="productId != null">
product_id = #{productId},
</if>
<if test="num != null">
num = #{num},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tb_coupon_product
where id = #{id}
</delete>
</mapper>

View File

@@ -1,106 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbDeviceOperateInfoMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbDeviceOperateInfo">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="deviceNo" jdbcType="VARCHAR" property="deviceno" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
<result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
</resultMap>
<sql id="Base_Column_List">
id, deviceNo, type, shop_id, createTime, remark
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_device_operate_info
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_device_operate_info
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbDeviceOperateInfo">
insert into tb_device_operate_info (id, deviceNo, type,
shop_id, createTime, remark
)
values (#{id,jdbcType=INTEGER}, #{deviceno,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{shopId,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, #{remark,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbDeviceOperateInfo">
insert into tb_device_operate_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="deviceno != null">
deviceNo,
</if>
<if test="type != null">
type,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="createtime != null">
createTime,
</if>
<if test="remark != null">
remark,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="deviceno != null">
#{deviceno,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
#{shopId,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbDeviceOperateInfo">
update tb_device_operate_info
<set>
<if test="deviceno != null">
deviceNo = #{deviceno,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbDeviceOperateInfo">
update tb_device_operate_info
set deviceNo = #{deviceno,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
shop_id = #{shopId,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=TIMESTAMP},
remark = #{remark,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -1,198 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbPlussDeviceGoodsMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="deviceLogo" jdbcType="VARCHAR" property="devicelogo" />
<result column="introDesc" jdbcType="VARCHAR" property="introdesc" />
<result column="sort" jdbcType="INTEGER" property="sort" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="tagId" jdbcType="INTEGER" property="tagid" />
<result column="depositFlag" jdbcType="VARCHAR" property="depositflag" />
<result column="createTime" jdbcType="TIMESTAMP" property="createtime" />
<result column="updateTime" jdbcType="TIMESTAMP" property="updatetime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods">
<result column="detail" jdbcType="LONGVARCHAR" property="detail" />
</resultMap>
<sql id="Base_Column_List">
id, code, name, deviceLogo, introDesc, sort, status, tagId, depositFlag, createTime,
updateTime
</sql>
<sql id="Blob_Column_List">
detail
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tb_pluss_device_goods
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_pluss_device_goods
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods">
insert into tb_pluss_device_goods (id, code, name,
deviceLogo, introDesc, sort,
status, tagId, depositFlag,
createTime, updateTime, detail
)
values (#{id,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{devicelogo,jdbcType=VARCHAR}, #{introdesc,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER},
#{status,jdbcType=INTEGER}, #{tagid,jdbcType=INTEGER}, #{depositflag,jdbcType=VARCHAR},
#{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}, #{detail,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods">
insert into tb_pluss_device_goods
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="code != null">
code,
</if>
<if test="name != null">
name,
</if>
<if test="devicelogo != null">
deviceLogo,
</if>
<if test="introdesc != null">
introDesc,
</if>
<if test="sort != null">
sort,
</if>
<if test="status != null">
status,
</if>
<if test="tagid != null">
tagId,
</if>
<if test="depositflag != null">
depositFlag,
</if>
<if test="createtime != null">
createTime,
</if>
<if test="updatetime != null">
updateTime,
</if>
<if test="detail != null">
detail,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="devicelogo != null">
#{devicelogo,jdbcType=VARCHAR},
</if>
<if test="introdesc != null">
#{introdesc,jdbcType=VARCHAR},
</if>
<if test="sort != null">
#{sort,jdbcType=INTEGER},
</if>
<if test="status != null">
#{status,jdbcType=INTEGER},
</if>
<if test="tagid != null">
#{tagid,jdbcType=INTEGER},
</if>
<if test="depositflag != null">
#{depositflag,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
#{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
#{updatetime,jdbcType=TIMESTAMP},
</if>
<if test="detail != null">
#{detail,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods">
update tb_pluss_device_goods
<set>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="devicelogo != null">
deviceLogo = #{devicelogo,jdbcType=VARCHAR},
</if>
<if test="introdesc != null">
introDesc = #{introdesc,jdbcType=VARCHAR},
</if>
<if test="sort != null">
sort = #{sort,jdbcType=INTEGER},
</if>
<if test="status != null">
status = #{status,jdbcType=INTEGER},
</if>
<if test="tagid != null">
tagId = #{tagid,jdbcType=INTEGER},
</if>
<if test="depositflag != null">
depositFlag = #{depositflag,jdbcType=VARCHAR},
</if>
<if test="createtime != null">
createTime = #{createtime,jdbcType=TIMESTAMP},
</if>
<if test="updatetime != null">
updateTime = #{updatetime,jdbcType=TIMESTAMP},
</if>
<if test="detail != null">
detail = #{detail,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods">
update tb_pluss_device_goods
set code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
deviceLogo = #{devicelogo,jdbcType=VARCHAR},
introDesc = #{introdesc,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
tagId = #{tagid,jdbcType=INTEGER},
depositFlag = #{depositflag,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=TIMESTAMP},
updateTime = #{updatetime,jdbcType=TIMESTAMP},
detail = #{detail,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods">
update tb_pluss_device_goods
set code = #{code,jdbcType=VARCHAR},
name = #{name,jdbcType=VARCHAR},
deviceLogo = #{devicelogo,jdbcType=VARCHAR},
introDesc = #{introdesc,jdbcType=VARCHAR},
sort = #{sort,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
tagId = #{tagid,jdbcType=INTEGER},
depositFlag = #{depositflag,jdbcType=VARCHAR},
createTime = #{createtime,jdbcType=TIMESTAMP},
updateTime = #{updatetime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

File diff suppressed because it is too large Load Diff

View File

@@ -1,271 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbReceiptSalesMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbReceiptSales">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="logo" jdbcType="VARCHAR" property="logo" />
<result column="show_contact_info" jdbcType="BIT" property="showContactInfo" />
<result column="show_member" jdbcType="BIT" property="showMember" />
<result column="show_member_code" jdbcType="BIT" property="showMemberCode" />
<result column="show_member_score" jdbcType="BIT" property="showMemberScore" />
<result column="show_member_wallet" jdbcType="BIT" property="showMemberWallet" />
<result column="footer_remark" jdbcType="VARCHAR" property="footerRemark" />
<result column="show_cash_charge" jdbcType="BIT" property="showCashCharge" />
<result column="show_serial_no" jdbcType="BIT" property="showSerialNo" />
<result column="big_serial_no" jdbcType="BIT" property="bigSerialNo" />
<result column="header_text" jdbcType="VARCHAR" property="headerText" />
<result column="header_text_align" jdbcType="VARCHAR" property="headerTextAlign" />
<result column="footer_text" jdbcType="VARCHAR" property="footerText" />
<result column="footer_text_align" jdbcType="VARCHAR" property="footerTextAlign" />
<result column="footer_image" jdbcType="VARCHAR" property="footerImage" />
<result column="pre_print" jdbcType="VARCHAR" property="prePrint" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
</resultMap>
<sql id="Base_Column_List">
id, title, logo, show_contact_info, show_member, show_member_code, show_member_score,
show_member_wallet, footer_remark, show_cash_charge, show_serial_no, big_serial_no,
header_text, header_text_align, footer_text, footer_text_align, footer_image, pre_print,
created_at, updated_at
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_receipt_sales
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_receipt_sales
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbReceiptSales">
insert into tb_receipt_sales (id, title, logo,
show_contact_info, show_member, show_member_code,
show_member_score, show_member_wallet, footer_remark,
show_cash_charge, show_serial_no, big_serial_no,
header_text, header_text_align, footer_text,
footer_text_align, footer_image, pre_print,
created_at, updated_at)
values (#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR},
#{showContactInfo,jdbcType=BIT}, #{showMember,jdbcType=BIT}, #{showMemberCode,jdbcType=BIT},
#{showMemberScore,jdbcType=BIT}, #{showMemberWallet,jdbcType=BIT}, #{footerRemark,jdbcType=VARCHAR},
#{showCashCharge,jdbcType=BIT}, #{showSerialNo,jdbcType=BIT}, #{bigSerialNo,jdbcType=BIT},
#{headerText,jdbcType=VARCHAR}, #{headerTextAlign,jdbcType=VARCHAR}, #{footerText,jdbcType=VARCHAR},
#{footerTextAlign,jdbcType=VARCHAR}, #{footerImage,jdbcType=VARCHAR}, #{prePrint,jdbcType=VARCHAR},
#{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbReceiptSales">
insert into tb_receipt_sales
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="title != null">
title,
</if>
<if test="logo != null">
logo,
</if>
<if test="showContactInfo != null">
show_contact_info,
</if>
<if test="showMember != null">
show_member,
</if>
<if test="showMemberCode != null">
show_member_code,
</if>
<if test="showMemberScore != null">
show_member_score,
</if>
<if test="showMemberWallet != null">
show_member_wallet,
</if>
<if test="footerRemark != null">
footer_remark,
</if>
<if test="showCashCharge != null">
show_cash_charge,
</if>
<if test="showSerialNo != null">
show_serial_no,
</if>
<if test="bigSerialNo != null">
big_serial_no,
</if>
<if test="headerText != null">
header_text,
</if>
<if test="headerTextAlign != null">
header_text_align,
</if>
<if test="footerText != null">
footer_text,
</if>
<if test="footerTextAlign != null">
footer_text_align,
</if>
<if test="footerImage != null">
footer_image,
</if>
<if test="prePrint != null">
pre_print,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="logo != null">
#{logo,jdbcType=VARCHAR},
</if>
<if test="showContactInfo != null">
#{showContactInfo,jdbcType=BIT},
</if>
<if test="showMember != null">
#{showMember,jdbcType=BIT},
</if>
<if test="showMemberCode != null">
#{showMemberCode,jdbcType=BIT},
</if>
<if test="showMemberScore != null">
#{showMemberScore,jdbcType=BIT},
</if>
<if test="showMemberWallet != null">
#{showMemberWallet,jdbcType=BIT},
</if>
<if test="footerRemark != null">
#{footerRemark,jdbcType=VARCHAR},
</if>
<if test="showCashCharge != null">
#{showCashCharge,jdbcType=BIT},
</if>
<if test="showSerialNo != null">
#{showSerialNo,jdbcType=BIT},
</if>
<if test="bigSerialNo != null">
#{bigSerialNo,jdbcType=BIT},
</if>
<if test="headerText != null">
#{headerText,jdbcType=VARCHAR},
</if>
<if test="headerTextAlign != null">
#{headerTextAlign,jdbcType=VARCHAR},
</if>
<if test="footerText != null">
#{footerText,jdbcType=VARCHAR},
</if>
<if test="footerTextAlign != null">
#{footerTextAlign,jdbcType=VARCHAR},
</if>
<if test="footerImage != null">
#{footerImage,jdbcType=VARCHAR},
</if>
<if test="prePrint != null">
#{prePrint,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbReceiptSales">
update tb_receipt_sales
<set>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="logo != null">
logo = #{logo,jdbcType=VARCHAR},
</if>
<if test="showContactInfo != null">
show_contact_info = #{showContactInfo,jdbcType=BIT},
</if>
<if test="showMember != null">
show_member = #{showMember,jdbcType=BIT},
</if>
<if test="showMemberCode != null">
show_member_code = #{showMemberCode,jdbcType=BIT},
</if>
<if test="showMemberScore != null">
show_member_score = #{showMemberScore,jdbcType=BIT},
</if>
<if test="showMemberWallet != null">
show_member_wallet = #{showMemberWallet,jdbcType=BIT},
</if>
<if test="footerRemark != null">
footer_remark = #{footerRemark,jdbcType=VARCHAR},
</if>
<if test="showCashCharge != null">
show_cash_charge = #{showCashCharge,jdbcType=BIT},
</if>
<if test="showSerialNo != null">
show_serial_no = #{showSerialNo,jdbcType=BIT},
</if>
<if test="bigSerialNo != null">
big_serial_no = #{bigSerialNo,jdbcType=BIT},
</if>
<if test="headerText != null">
header_text = #{headerText,jdbcType=VARCHAR},
</if>
<if test="headerTextAlign != null">
header_text_align = #{headerTextAlign,jdbcType=VARCHAR},
</if>
<if test="footerText != null">
footer_text = #{footerText,jdbcType=VARCHAR},
</if>
<if test="footerTextAlign != null">
footer_text_align = #{footerTextAlign,jdbcType=VARCHAR},
</if>
<if test="footerImage != null">
footer_image = #{footerImage,jdbcType=VARCHAR},
</if>
<if test="prePrint != null">
pre_print = #{prePrint,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbReceiptSales">
update tb_receipt_sales
set title = #{title,jdbcType=VARCHAR},
logo = #{logo,jdbcType=VARCHAR},
show_contact_info = #{showContactInfo,jdbcType=BIT},
show_member = #{showMember,jdbcType=BIT},
show_member_code = #{showMemberCode,jdbcType=BIT},
show_member_score = #{showMemberScore,jdbcType=BIT},
show_member_wallet = #{showMemberWallet,jdbcType=BIT},
footer_remark = #{footerRemark,jdbcType=VARCHAR},
show_cash_charge = #{showCashCharge,jdbcType=BIT},
show_serial_no = #{showSerialNo,jdbcType=BIT},
big_serial_no = #{bigSerialNo,jdbcType=BIT},
header_text = #{headerText,jdbcType=VARCHAR},
header_text_align = #{headerTextAlign,jdbcType=VARCHAR},
footer_text = #{footerText,jdbcType=VARCHAR},
footer_text_align = #{footerTextAlign,jdbcType=VARCHAR},
footer_image = #{footerImage,jdbcType=VARCHAR},
pre_print = #{prePrint,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -1,199 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbRenewalsPayLogMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbRenewalsPayLog">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="pay_type" jdbcType="VARCHAR" property="payType" />
<result column="shop_id" jdbcType="VARCHAR" property="shopId" />
<result column="order_id" jdbcType="VARCHAR" property="orderId" />
<result column="open_id" jdbcType="VARCHAR" property="openId" />
<result column="user_id" jdbcType="VARCHAR" property="userId" />
<result column="transaction_id" jdbcType="VARCHAR" property="transactionId" />
<result column="amount" jdbcType="DECIMAL" property="amount" />
<result column="status" jdbcType="TINYINT" property="status" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="attach" jdbcType="VARCHAR" property="attach" />
<result column="expired_at" jdbcType="BIGINT" property="expiredAt" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
</resultMap>
<sql id="Base_Column_List">
id, pay_type, shop_id, order_id, open_id, user_id, transaction_id, amount, status,
remark, attach, expired_at, created_at, updated_at
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tb_renewals_pay_log
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_renewals_pay_log
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbRenewalsPayLog">
insert into tb_renewals_pay_log (id, pay_type, shop_id,
order_id, open_id, user_id,
transaction_id, amount, status,
remark, attach, expired_at,
created_at, updated_at)
values (#{id,jdbcType=INTEGER}, #{payType,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR},
#{orderId,jdbcType=VARCHAR}, #{openId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR},
#{transactionId,jdbcType=VARCHAR}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}, #{attach,jdbcType=VARCHAR}, #{expiredAt,jdbcType=BIGINT},
#{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbRenewalsPayLog">
insert into tb_renewals_pay_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="payType != null">
pay_type,
</if>
<if test="shopId != null">
shop_id,
</if>
<if test="orderId != null">
order_id,
</if>
<if test="openId != null">
open_id,
</if>
<if test="userId != null">
user_id,
</if>
<if test="transactionId != null">
transaction_id,
</if>
<if test="amount != null">
amount,
</if>
<if test="status != null">
status,
</if>
<if test="remark != null">
remark,
</if>
<if test="attach != null">
attach,
</if>
<if test="expiredAt != null">
expired_at,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="payType != null">
#{payType,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
#{shopId,jdbcType=VARCHAR},
</if>
<if test="orderId != null">
#{orderId,jdbcType=VARCHAR},
</if>
<if test="openId != null">
#{openId,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=VARCHAR},
</if>
<if test="transactionId != null">
#{transactionId,jdbcType=VARCHAR},
</if>
<if test="amount != null">
#{amount,jdbcType=DECIMAL},
</if>
<if test="status != null">
#{status,jdbcType=TINYINT},
</if>
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="attach != null">
#{attach,jdbcType=VARCHAR},
</if>
<if test="expiredAt != null">
#{expiredAt,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbRenewalsPayLog">
update tb_renewals_pay_log
<set>
<if test="payType != null">
pay_type = #{payType,jdbcType=VARCHAR},
</if>
<if test="shopId != null">
shop_id = #{shopId,jdbcType=VARCHAR},
</if>
<if test="orderId != null">
order_id = #{orderId,jdbcType=VARCHAR},
</if>
<if test="openId != null">
open_id = #{openId,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=VARCHAR},
</if>
<if test="transactionId != null">
transaction_id = #{transactionId,jdbcType=VARCHAR},
</if>
<if test="amount != null">
amount = #{amount,jdbcType=DECIMAL},
</if>
<if test="status != null">
status = #{status,jdbcType=TINYINT},
</if>
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="attach != null">
attach = #{attach,jdbcType=VARCHAR},
</if>
<if test="expiredAt != null">
expired_at = #{expiredAt,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbRenewalsPayLog">
update tb_renewals_pay_log
set pay_type = #{payType,jdbcType=VARCHAR},
shop_id = #{shopId,jdbcType=VARCHAR},
order_id = #{orderId,jdbcType=VARCHAR},
open_id = #{openId,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=VARCHAR},
transaction_id = #{transactionId,jdbcType=VARCHAR},
amount = #{amount,jdbcType=DECIMAL},
status = #{status,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR},
attach = #{attach,jdbcType=VARCHAR},
expired_at = #{expiredAt,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -1,143 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbShopCashSpreadMapper">
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbShopCashSpread">
<id column="id" jdbcType="INTEGER" property="id" />
<result column="created_at" jdbcType="BIGINT" property="createdAt" />
<result column="updated_at" jdbcType="BIGINT" property="updatedAt" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.chaozhanggui.system.cashierservice.entity.TbShopCashSpreadWithBLOBs">
<result column="sale_receipt" jdbcType="LONGVARCHAR" property="saleReceipt" />
<result column="triplicate_receipt" jdbcType="LONGVARCHAR" property="triplicateReceipt" />
<result column="screen_config" jdbcType="LONGVARCHAR" property="screenConfig" />
<result column="tag_config" jdbcType="LONGVARCHAR" property="tagConfig" />
<result column="scale_config" jdbcType="LONGVARCHAR" property="scaleConfig" />
</resultMap>
<sql id="Base_Column_List">
id, created_at, updated_at
</sql>
<sql id="Blob_Column_List">
sale_receipt, triplicate_receipt, screen_config, tag_config, scale_config
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from tb_shop_cash_spread
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_shop_cash_spread
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopCashSpreadWithBLOBs">
insert into tb_shop_cash_spread (id, created_at, updated_at,
sale_receipt, triplicate_receipt,
screen_config, tag_config, scale_config
)
values (#{id,jdbcType=INTEGER}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
#{saleReceipt,jdbcType=LONGVARCHAR}, #{triplicateReceipt,jdbcType=LONGVARCHAR},
#{screenConfig,jdbcType=LONGVARCHAR}, #{tagConfig,jdbcType=LONGVARCHAR}, #{scaleConfig,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopCashSpreadWithBLOBs">
insert into tb_shop_cash_spread
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="saleReceipt != null">
sale_receipt,
</if>
<if test="triplicateReceipt != null">
triplicate_receipt,
</if>
<if test="screenConfig != null">
screen_config,
</if>
<if test="tagConfig != null">
tag_config,
</if>
<if test="scaleConfig != null">
scale_config,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=INTEGER},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=BIGINT},
</if>
<if test="saleReceipt != null">
#{saleReceipt,jdbcType=LONGVARCHAR},
</if>
<if test="triplicateReceipt != null">
#{triplicateReceipt,jdbcType=LONGVARCHAR},
</if>
<if test="screenConfig != null">
#{screenConfig,jdbcType=LONGVARCHAR},
</if>
<if test="tagConfig != null">
#{tagConfig,jdbcType=LONGVARCHAR},
</if>
<if test="scaleConfig != null">
#{scaleConfig,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopCashSpreadWithBLOBs">
update tb_shop_cash_spread
<set>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=BIGINT},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=BIGINT},
</if>
<if test="saleReceipt != null">
sale_receipt = #{saleReceipt,jdbcType=LONGVARCHAR},
</if>
<if test="triplicateReceipt != null">
triplicate_receipt = #{triplicateReceipt,jdbcType=LONGVARCHAR},
</if>
<if test="screenConfig != null">
screen_config = #{screenConfig,jdbcType=LONGVARCHAR},
</if>
<if test="tagConfig != null">
tag_config = #{tagConfig,jdbcType=LONGVARCHAR},
</if>
<if test="scaleConfig != null">
scale_config = #{scaleConfig,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopCashSpreadWithBLOBs">
update tb_shop_cash_spread
set created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT},
sale_receipt = #{saleReceipt,jdbcType=LONGVARCHAR},
triplicate_receipt = #{triplicateReceipt,jdbcType=LONGVARCHAR},
screen_config = #{screenConfig,jdbcType=LONGVARCHAR},
tag_config = #{tagConfig,jdbcType=LONGVARCHAR},
scale_config = #{scaleConfig,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopCashSpread">
update tb_shop_cash_spread
set created_at = #{createdAt,jdbcType=BIGINT},
updated_at = #{updatedAt,jdbcType=BIGINT}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,232 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.chaozhanggui.system.cashierservice.dao.TbShopCouponMapper">
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbShopCoupon" id="TbShopCouponMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="shopId" column="shop_id" jdbcType="VARCHAR"/>
<result property="title" column="title" jdbcType="VARCHAR"/>
<result property="type" column="type" jdbcType="INTEGER"/>
<result property="fullAmount" column="full_amount" jdbcType="DECIMAL"/>
<result property="discountAmount" column="discount_amount" jdbcType="DECIMAL"/>
<result property="description" column="description" jdbcType="VARCHAR"/>
<result property="number" column="number" jdbcType="INTEGER"/>
<result property="leftNumber" column="left_number" jdbcType="INTEGER"/>
<result property="validityType" column="validity_type" jdbcType="VARCHAR"/>
<result property="validDays" column="valid_days" jdbcType="INTEGER"/>
<result property="daysToTakeEffect" column="days_to_take_effect" jdbcType="INTEGER"/>
<result property="validStartTime" column="valid_start_time" jdbcType="TIMESTAMP"/>
<result property="validEndTime" column="valid_end_time" jdbcType="TIMESTAMP"/>
<result property="userDays" column="user_days" jdbcType="VARCHAR"/>
<result property="useTimeType" column="use_time_type" jdbcType="VARCHAR"/>
<result property="useStartTime" column="use_start_time" jdbcType="VARCHAR"/>
<result property="useEndTime" column="use_end_time" jdbcType="VARCHAR"/>
<result property="useNumber" column="use_number" jdbcType="INTEGER"/>
<result property="editor" column="editor" jdbcType="VARCHAR"/>
<result property="status" column="status" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
<sql id="Base_Column_List">
id
, shop_id, title, type, full_amount, discount_amount, description, number, left_number, validity_type, valid_days, days_to_take_effect, valid_start_time, valid_end_time, user_days, use_time_type, use_start_time, use_end_time, use_number, editor, status, create_time, update_time </sql>
<!--查询单个-->
<select id="queryById" resultMap="TbShopCouponMap">
select
<include refid="Base_Column_List"/>
from tb_shop_coupon
where id = #{id}
</select>
<!--查询指定行数据-->
<select id="queryAll" resultMap="TbShopCouponMap">
select
<include refid="Base_Column_List"/>
from tb_shop_coupon
<where>
<if test="id != null">
and id = #{id}
</if>
<if test="shopId != null and shopId != ''">
and shop_id = #{shopId}
</if>
<if test="title != null and title != ''">
and title = #{title}
</if>
<if test="type != null">
and type = #{type}
</if>
<if test="fullAmount != null">
and full_amount = #{fullAmount}
</if>
<if test="discountAmount != null">
and discount_amount = #{discountAmount}
</if>
<if test="description != null and description != ''">
and description = #{description}
</if>
<if test="number != null">
and number = #{number}
</if>
<if test="leftNumber != null">
and left_number = #{leftNumber}
</if>
<if test="validityType != null and validityType != ''">
and validity_type = #{validityType}
</if>
<if test="validDays != null">
and valid_days = #{validDays}
</if>
<if test="daysToTakeEffect != null">
and days_to_take_effect = #{daysToTakeEffect}
</if>
<if test="validStartTime != null">
and valid_start_time = #{validStartTime}
</if>
<if test="validEndTime != null">
and valid_end_time = #{validEndTime}
</if>
<if test="userDays != null and userDays != ''">
and user_days = #{userDays}
</if>
<if test="useTimeType != null and useTimeType != ''">
and use_time_type = #{useTimeType}
</if>
<if test="useStartTime != null">
and use_start_time = #{useStartTime}
</if>
<if test="useEndTime != null">
and use_end_time = #{useEndTime}
</if>
<if test="useNumber != null">
and use_number = #{useNumber}
</if>
<if test="editor != null and editor != ''">
and editor = #{editor}
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="createTime != null">
and create_time = #{createTime}
</if>
<if test="updateTime != null">
and update_time = #{updateTime}
</if>
</where>
</select>
<!--新增所有列-->
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
insert into tb_shop_coupon(shop_id, title, type, full_amount, discount_amount, description, number, left_number,
validity_type, valid_days, days_to_take_effect, valid_start_time, valid_end_time,
user_days, use_time_type, use_start_time, use_end_time, use_number, editor, status,
create_time, update_time)
values (#{shopId}, #{title}, #{type}, #{fullAmount}, #{discountAmount}, #{description}, #{number},
#{leftNumber}, #{validityType}, #{validDays}, #{daysToTakeEffect}, #{validStartTime}, #{validEndTime},
#{userDays}, #{useTimeType}, #{useStartTime}, #{useEndTime}, #{useNumber}, #{editor}, #{status},
#{createTime}, #{updateTime})
</insert>
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
insert into tb_shop_coupon(shop_id, title, type, full_amount, discount_amount, description, number, left_number,
validity_type, valid_days, days_to_take_effect, valid_start_time, valid_end_time, user_days, use_time_type,
use_start_time, use_end_time, use_number, editor, status, create_time, update_time)
values
<foreach collection="entities" item="entity" separator=",">
(#{entity.shopId}, #{entity.title}, #{entity.type}, #{entity.fullAmount}, #{entity.discountAmount},
#{entity.description}, #{entity.number}, #{entity.leftNumber}, #{entity.validityType}, #{entity.validDays},
#{entity.daysToTakeEffect}, #{entity.validStartTime}, #{entity.validEndTime}, #{entity.userDays},
#{entity.useTimeType}, #{entity.useStartTime}, #{entity.useEndTime}, #{entity.useNumber}, #{entity.editor},
#{entity.status}, #{entity.createTime}, #{entity.updateTime})
</foreach>
</insert>
<!--通过主键修改数据-->
<update id="update">
update tb_shop_coupon
<set>
<if test="shopId != null and shopId != ''">
shop_id = #{shopId},
</if>
<if test="title != null and title != ''">
title = #{title},
</if>
<if test="type != null">
type = #{type},
</if>
<if test="fullAmount != null">
full_amount = #{fullAmount},
</if>
<if test="discountAmount != null">
discount_amount = #{discountAmount},
</if>
<if test="description != null and description != ''">
description = #{description},
</if>
<if test="number != null">
number = #{number},
</if>
<if test="leftNumber != null">
left_number = #{leftNumber},
</if>
<if test="validityType != null and validityType != ''">
validity_type = #{validityType},
</if>
<if test="validDays != null">
valid_days = #{validDays},
</if>
<if test="daysToTakeEffect != null">
days_to_take_effect = #{daysToTakeEffect},
</if>
<if test="validStartTime != null">
valid_start_time = #{validStartTime},
</if>
<if test="validEndTime != null">
valid_end_time = #{validEndTime},
</if>
<if test="userDays != null and userDays != ''">
user_days = #{userDays},
</if>
<if test="useTimeType != null and useTimeType != ''">
use_time_type = #{useTimeType},
</if>
<if test="useStartTime != null">
use_start_time = #{useStartTime},
</if>
<if test="useEndTime != null">
use_end_time = #{useEndTime},
</if>
<if test="useNumber != null">
use_number = #{useNumber},
</if>
<if test="editor != null and editor != ''">
editor = #{editor},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="createTime != null">
create_time = #{createTime},
</if>
<if test="updateTime != null">
update_time = #{updateTime},
</if>
</set>
where id = #{id}
</update>
<!--通过主键删除-->
<delete id="deleteById">
delete
from tb_shop_coupon
where id = #{id}
</delete>
</mapper>

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