Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c82661351 | ||
|
|
6792450f6b |
@@ -2,7 +2,6 @@ package com.chaozhanggui.system.cashierservice.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbPlatformDictMapper;
|
import com.chaozhanggui.system.cashierservice.dao.TbPlatformDictMapper;
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbShopExtendMapper;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict;
|
import com.chaozhanggui.system.cashierservice.entity.TbPlatformDict;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.dto.WxMsgSubDTO;
|
import com.chaozhanggui.system.cashierservice.entity.dto.WxMsgSubDTO;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.vo.DistrictVo;
|
import com.chaozhanggui.system.cashierservice.entity.vo.DistrictVo;
|
||||||
@@ -25,14 +24,12 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用接口
|
* 通用接口
|
||||||
@@ -53,8 +50,6 @@ public class CommonController {
|
|||||||
private TbPlatformDictMapper platformDictMapper;
|
private TbPlatformDictMapper platformDictMapper;
|
||||||
@Resource
|
@Resource
|
||||||
private FileService fileService;
|
private FileService fileService;
|
||||||
@Resource
|
|
||||||
private TbShopExtendMapper extendMapper;
|
|
||||||
|
|
||||||
private final LoginService loginService;;
|
private final LoginService loginService;;
|
||||||
|
|
||||||
@@ -168,12 +163,6 @@ public class CommonController {
|
|||||||
return new Result(CodeEnum.SUCCESS, fileService.uploadFile(file));
|
return new Result(CodeEnum.SUCCESS, fileService.uploadFile(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("common/shopExtend")
|
|
||||||
public Result getShopExtend(@RequestBody Map<String, String> map) {
|
|
||||||
if (CollectionUtils.isEmpty(map) || !map.containsKey("shopId") || !map.containsKey("autokey")) return new Result(CodeEnum.SUCCESS);
|
|
||||||
return new Result(CodeEnum.SUCCESS, extendMapper.queryByShopIdAndAutoKey(Integer.valueOf(map.get("shopId").toString()),map.get("autokey")));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 检查手机号格式是否正确的方法
|
// 检查手机号格式是否正确的方法
|
||||||
private boolean isValidPhoneNumber(String phone) {
|
private boolean isValidPhoneNumber(String phone) {
|
||||||
return phone.matches("^1[3-9]\\d{9}$");
|
return phone.matches("^1[3-9]\\d{9}$");
|
||||||
|
|||||||
@@ -66,6 +66,11 @@ public class NotifyController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("test")
|
||||||
|
public void test(@RequestParam String payOrderNO){
|
||||||
|
payService.test(payOrderNO);
|
||||||
|
}
|
||||||
|
|
||||||
@RequestMapping("notifyCallBack")
|
@RequestMapping("notifyCallBack")
|
||||||
public String notifyCallBack(HttpServletRequest request){
|
public String notifyCallBack(HttpServletRequest request){
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.controller;
|
package com.chaozhanggui.system.cashierservice.controller;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbShopTable;
|
import com.chaozhanggui.system.cashierservice.entity.TbShopTable;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.dto.OrderDto;
|
import com.chaozhanggui.system.cashierservice.entity.dto.OrderDto;
|
||||||
import com.chaozhanggui.system.cashierservice.service.OrderService;
|
import com.chaozhanggui.system.cashierservice.service.OrderService;
|
||||||
@@ -11,7 +10,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@CrossOrigin(origins = "*")
|
@CrossOrigin(origins = "*")
|
||||||
@RestController
|
@RestController
|
||||||
@@ -53,14 +51,6 @@ public class OrderController {
|
|||||||
return orderService.orderList(userId,page,size,status);
|
return orderService.orderList(userId,page,size,status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/rmOrder")
|
|
||||||
private Result rmOrder(@RequestBody Map<String, Object> map){
|
|
||||||
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("orderId") || ObjectUtil.isEmpty(map.get("orderId"))) {
|
|
||||||
return Result.fail("订单号不允许为空");
|
|
||||||
}
|
|
||||||
return orderService.rmOrder(Integer.valueOf(map.get("orderId").toString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/tradeIntegral")
|
@GetMapping("/tradeIntegral")
|
||||||
private Result tradeIntegral(@RequestParam("userId") String userId, @RequestParam("id") String id) throws IOException, ParseException {
|
private Result tradeIntegral(@RequestParam("userId") String userId, @RequestParam("id") String id) throws IOException, ParseException {
|
||||||
return orderService.tradeIntegral(userId,id);
|
return orderService.tradeIntegral(userId,id);
|
||||||
|
|||||||
@@ -50,13 +50,12 @@ public class ProductController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping("queryProduct")
|
@RequestMapping("queryProduct")
|
||||||
public Result queryProduct(@RequestHeader("id") String userId,@RequestBody Map<String, String> map) {
|
public Result queryProduct(@RequestBody Map<String, String> map) {
|
||||||
|
|
||||||
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("shopId")) {
|
if (ObjectUtil.isEmpty(map) || map.size() <= 0 || !map.containsKey("shopId")) {
|
||||||
return Result.fail("参数错误");
|
return Result.fail("参数错误");
|
||||||
}
|
}
|
||||||
return productService.queryProduct(
|
return productService.queryProduct(
|
||||||
userId,
|
|
||||||
map.get("shopId").toString(),
|
map.get("shopId").toString(),
|
||||||
(map.containsKey("productGroupId") && ObjectUtil.isNotEmpty(map.get("productGroupId"))) ? map.get("productGroupId").toString() : "");
|
(map.containsKey("productGroupId") && ObjectUtil.isNotEmpty(map.get("productGroupId"))) ? map.get("productGroupId").toString() : "");
|
||||||
}
|
}
|
||||||
@@ -82,10 +81,9 @@ public class ProductController {
|
|||||||
@RequestParam(value = "code", required = false) String code,
|
@RequestParam(value = "code", required = false) String code,
|
||||||
@RequestParam("shopId") String shopId,
|
@RequestParam("shopId") String shopId,
|
||||||
@RequestParam("productId") String productId,
|
@RequestParam("productId") String productId,
|
||||||
@RequestParam("spec_tag") String spec_tag,
|
@RequestParam("spec_tag") String spec_tag
|
||||||
@RequestParam("isVip") String isVip
|
|
||||||
) {
|
) {
|
||||||
return productService.queryProductSku(code,shopId, productId, spec_tag,isVip);
|
return productService.queryProductSku(code,shopId, productId, spec_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("addCart")
|
@PostMapping("addCart")
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.controller;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.dto.UserCouponDto;
|
|
||||||
import com.chaozhanggui.system.cashierservice.service.TbUserCouponsService;
|
|
||||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("userConpons")
|
|
||||||
public class TbUserCouponsController {
|
|
||||||
/**
|
|
||||||
* 服务对象
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private TbUserCouponsService tbUserCouponsService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询优惠卷
|
|
||||||
* @param conponDto
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping("find")
|
|
||||||
public Result queryByPage(@RequestBody UserCouponDto conponDto) {
|
|
||||||
return tbUserCouponsService.queryByPage(conponDto);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -65,20 +65,9 @@ public class UserContoller {
|
|||||||
|
|
||||||
@PostMapping("/openMember")
|
@PostMapping("/openMember")
|
||||||
public Result openMember(@RequestBody OpenMemberVo memberVo){
|
public Result openMember(@RequestBody OpenMemberVo memberVo){
|
||||||
if(StringUtils.isBlank(memberVo.getTelephone())){
|
|
||||||
return Result.fail("手机号不可为空");
|
|
||||||
}
|
|
||||||
return userService.openMember(memberVo);
|
return userService.openMember(memberVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/upVipPhont")
|
|
||||||
public Result upVipPhont(@RequestBody OpenMemberVo memberVo){
|
|
||||||
if(StringUtils.isBlank(memberVo.getTelephone())){
|
|
||||||
return Result.fail("手机号不可为空");
|
|
||||||
}
|
|
||||||
return userService.upVipPhont(memberVo);
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/shopUserInfo")
|
@GetMapping("/shopUserInfo")
|
||||||
public Result shopUserInfo(@RequestParam("userId") String userId, @RequestHeader("openId") String openId, @RequestParam("shopId") String shopId) throws Exception {
|
public Result shopUserInfo(@RequestParam("userId") String userId, @RequestHeader("openId") String openId, @RequestParam("shopId") String shopId) throws Exception {
|
||||||
if(shopId.equals("undefined")){
|
if(shopId.equals("undefined")){
|
||||||
@@ -133,7 +122,6 @@ public class UserContoller {
|
|||||||
shopUser.setLng(tbShopInfo.getLng());
|
shopUser.setLng(tbShopInfo.getLng());
|
||||||
shopUser.setLat(tbShopInfo.getLat());
|
shopUser.setLat(tbShopInfo.getLat());
|
||||||
shopUser.setAddress(tbShopInfo.getAddress());
|
shopUser.setAddress(tbShopInfo.getAddress());
|
||||||
shopUser.setIsUser(tbShopInfo.getIsCustom());
|
|
||||||
}
|
}
|
||||||
return Result.success(CodeEnum.SUCCESS, shopUser);
|
return Result.success(CodeEnum.SUCCESS, shopUser);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,75 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateInRecord;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbUserCoupons;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动商品赠送表(TbActivateInRecord)表数据库访问层
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-22 11:13:40
|
|
||||||
*/
|
|
||||||
public interface TbActivateInRecordMapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateInRecord queryById(Integer id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询数据
|
|
||||||
*
|
|
||||||
* @param tbActivateInRecord 查询条件
|
|
||||||
* @return 对象列表
|
|
||||||
*/
|
|
||||||
List<TbActivateInRecord> queryAll(TbActivateInRecord tbActivateInRecord);
|
|
||||||
|
|
||||||
List<TbProduct> queryByVipIdAndShopId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId);
|
|
||||||
List<UserCouponVo> queryVipPro(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("shopName")String shopName);
|
|
||||||
int queryByVipIdAndShopIdAndProId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
|
||||||
List<TbActivateInRecord> queryAllByVipIdAndShopIdAndProId(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @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);
|
|
||||||
|
|
||||||
int updateOverNumById(@Param("id")Integer id,@Param("overNum")Integer overNum);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
int deleteById(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -11,19 +11,19 @@ import java.util.List;
|
|||||||
@Component
|
@Component
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TbActivateMapper {
|
public interface TbActivateMapper {
|
||||||
// int deleteByPrimaryKey(Integer id);
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
// int insert(TbActivate record);
|
int insert(TbActivate record);
|
||||||
|
|
||||||
// int insertSelective(TbActivate record);
|
int insertSelective(TbActivate record);
|
||||||
|
|
||||||
TbActivate selectByPrimaryKey(Integer id);
|
TbActivate selectByPrimaryKey(Integer id);
|
||||||
|
|
||||||
// int updateByPrimaryKeySelective(TbActivate record);
|
int updateByPrimaryKeySelective(TbActivate record);
|
||||||
|
|
||||||
// int updateByPrimaryKey(TbActivate record);
|
int updateByPrimaryKey(TbActivate record);
|
||||||
|
|
||||||
TbActivate selectByAmount(@Param("shopId") String shopId,@Param("amount") BigDecimal amount);
|
TbActivate selectByAmount(@Param("shopId") String shopId,@Param("amount") BigDecimal amount);
|
||||||
|
|
||||||
List<TbActivate> selectByShopId(String shopId);
|
List<TbActivate> selectByShpopId(String shopId);
|
||||||
}
|
}
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateOutRecord;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动赠送商品使用记录表(TbActivateOutRecord)表数据库访问层
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-22 11:21:56
|
|
||||||
*/
|
|
||||||
public interface TbActivateOutRecordMapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateOutRecord queryById(Integer id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询数据
|
|
||||||
*
|
|
||||||
* @param tbActivateOutRecord 查询条件
|
|
||||||
* @return 对象列表
|
|
||||||
*/
|
|
||||||
List<TbActivateOutRecord> queryAll(TbActivateOutRecord tbActivateOutRecord);
|
|
||||||
|
|
||||||
List<UserCouponVo> queryVipPro(@Param("vipUserId") Integer vipUserId, @Param("shopId") Integer shopId, @Param("shopName") String shopName);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @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);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据订单id 将数据状态变为
|
|
||||||
* @param orderId 订单Id
|
|
||||||
* @param status 状态
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
int updateByOrderIdAndStatus(@Param("orderId")Integer orderId,@Param("status")String status);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
int deleteById(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateProduct;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动赠送商品表(TbActivateProduct)表数据库访问层
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-20 15:14:55
|
|
||||||
*/
|
|
||||||
public interface TbActivateProductMapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateProduct queryById(Integer id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询数据
|
|
||||||
*
|
|
||||||
* @param tbActivateProduct 查询条件
|
|
||||||
* @return 对象列表
|
|
||||||
*/
|
|
||||||
List<TbActivateProduct> queryAll(TbActivateProduct tbActivateProduct);
|
|
||||||
|
|
||||||
List<TbActivateProduct> queryAllByActivateId(Integer activateId);
|
|
||||||
List<String> queryProsByActivateId(Integer activateId);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @param tbActivateProduct 实例对象
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
int insert(TbActivateProduct tbActivateProduct);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量新增数据(MyBatis原生foreach方法)
|
|
||||||
*
|
|
||||||
* @param entities List<TbActivateProduct> 实例对象列表
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
int insertBatch(@Param("entities") List<TbActivateProduct> entities);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改数据
|
|
||||||
*
|
|
||||||
* @param tbActivateProduct 实例对象
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
int update(TbActivateProduct tbActivateProduct);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 影响行数
|
|
||||||
*/
|
|
||||||
int deleteById(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbConsInfo;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@Mapper
|
|
||||||
public interface TbConsInfoMapper {
|
|
||||||
int deleteByPrimaryKey(Integer id);
|
|
||||||
|
|
||||||
int insert(TbConsInfo record);
|
|
||||||
|
|
||||||
int insertSelective(TbConsInfo record);
|
|
||||||
|
|
||||||
TbConsInfo selectByPrimaryKey(Integer id);
|
|
||||||
|
|
||||||
int updateByPrimaryKeySelective(TbConsInfo record);
|
|
||||||
|
|
||||||
int updateByPrimaryKey(TbConsInfo record);
|
|
||||||
|
|
||||||
int countAll();
|
|
||||||
|
|
||||||
List<TbConsInfo> selectAllInfo();
|
|
||||||
}
|
|
||||||
@@ -11,10 +11,6 @@ import java.util.List;
|
|||||||
@Component
|
@Component
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TbOrderInfoMapper {
|
public interface TbOrderInfoMapper {
|
||||||
|
|
||||||
/**
|
|
||||||
* 逻辑删除
|
|
||||||
*/
|
|
||||||
int deleteByPrimaryKey(Integer id);
|
int deleteByPrimaryKey(Integer id);
|
||||||
|
|
||||||
int insert(TbOrderInfo record);
|
int insert(TbOrderInfo record);
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public interface TbProductMapper {
|
|||||||
|
|
||||||
List<TbProduct> selectByIds(@Param("list") List<String> ids);
|
List<TbProduct> selectByIds(@Param("list") List<String> ids);
|
||||||
Integer selectByQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId);
|
Integer selectByQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId);
|
||||||
Integer selectByCodeAndSkuId(@Param("code") String code,@Param("skuId") Integer skuId,@Param("shopId") String shopId,@Param("isVip") String isVip);
|
Integer selectByCodeAndSkuId(@Param("code") String code,@Param("skuId") Integer skuId,@Param("shopId") String shopId);
|
||||||
Integer selectByNewQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId,@Param("list") List<String> list);
|
Integer selectByNewQcode(@Param("code") String code,@Param("productId") Integer productId,@Param("shopId") String shopId,@Param("list") List<String> list);
|
||||||
|
|
||||||
List<ShopGroupInfoVo> selGroups(@Param("proName") String proName,@Param("type") String type,
|
List<ShopGroupInfoVo> selGroups(@Param("proName") String proName,@Param("type") String type,
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProskuCon;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
@Mapper
|
|
||||||
public interface TbProskuConMapper {
|
|
||||||
int deleteByPrimaryKey(Integer id);
|
|
||||||
|
|
||||||
int insert(TbProskuCon record);
|
|
||||||
|
|
||||||
int insertSelective(TbProskuCon record);
|
|
||||||
|
|
||||||
TbProskuCon selectByPrimaryKey(Integer id);
|
|
||||||
|
|
||||||
int updateByPrimaryKeySelective(TbProskuCon record);
|
|
||||||
|
|
||||||
int updateByPrimaryKey(TbProskuCon record);
|
|
||||||
|
|
||||||
|
|
||||||
List<TbProskuCon> selectBySkuIdAndShopId(@Param("skuId") Integer skuId, @Param("shopId") Integer shopId);
|
|
||||||
List<TbProskuCon> selectBySkuIdAndShopIdAngCheck(@Param("skuId") Integer skuId, @Param("shopId") Integer shopId);
|
|
||||||
|
|
||||||
|
|
||||||
List<Integer> selectIdBySkuIdAndShopId(@Param("skuId") Integer skuId, @Param("shopId") Integer shopId);
|
|
||||||
|
|
||||||
List<TbProskuCon> selectByShopIdAndSkuIdAndProductId(@Param("skuId") Integer skuId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
|
||||||
List<TbProskuCon> selectByShopIdAndSkuIdAndProductIdAndCheck(@Param("skuId") Integer skuId, @Param("shopId") Integer shopId,@Param("productId") Integer productId);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbShopExtend;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺扩展信息(TbShopExtend)表数据库访问层
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-21 09:40:25
|
|
||||||
*/
|
|
||||||
public interface TbShopExtendMapper {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbShopExtend queryById(Integer id);
|
|
||||||
|
|
||||||
TbShopExtend queryByShopIdAndAutoKey(Integer shopId,String autokey);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询数据
|
|
||||||
*
|
|
||||||
* @param tbShopExtend 查询条件
|
|
||||||
* @return 对象列表
|
|
||||||
*/
|
|
||||||
List<TbShopExtend> queryAll(TbShopExtend tbShopExtend);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.dao;
|
package com.chaozhanggui.system.cashierservice.dao;
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbUserCoupons;
|
import com.chaozhanggui.system.cashierservice.entity.TbUserCoupons;
|
||||||
import com.chaozhanggui.system.cashierservice.entity.dto.UserCouponDto;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
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.stereotype.Component;
|
||||||
@@ -20,7 +18,6 @@ public interface TbUserCouponsMapper {
|
|||||||
int insertSelective(TbUserCoupons record);
|
int insertSelective(TbUserCoupons record);
|
||||||
|
|
||||||
TbUserCoupons selectByPrimaryKey(Integer id);
|
TbUserCoupons selectByPrimaryKey(Integer id);
|
||||||
List<UserCouponVo> queryAllSelective(UserCouponDto record);
|
|
||||||
|
|
||||||
int updateByPrimaryKeySelective(TbUserCoupons record);
|
int updateByPrimaryKeySelective(TbUserCoupons record);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
package com.chaozhanggui.system.cashierservice.entity;
|
||||||
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class TbActivate implements Serializable {
|
public class TbActivate implements Serializable {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
@@ -22,10 +18,6 @@ public class TbActivate implements Serializable {
|
|||||||
|
|
||||||
private String isDel;
|
private String isDel;
|
||||||
|
|
||||||
//是否赠送商品 0否 1是
|
|
||||||
private Integer isGiftPro;
|
|
||||||
private List<String> gives;
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
@@ -83,24 +75,4 @@ public class TbActivate implements Serializable {
|
|||||||
public void setIsDel(String isDel) {
|
public void setIsDel(String isDel) {
|
||||||
this.isDel = isDel == null ? null : isDel.trim();
|
this.isDel = isDel == null ? null : isDel.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getIsGiftPro() {
|
|
||||||
return isGiftPro;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsGiftPro(Integer isGiftPro) {
|
|
||||||
this.isGiftPro = isGiftPro;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<String> getGives() {
|
|
||||||
return gives;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGives(List<String> gives) {
|
|
||||||
if(CollectionUtils.isEmpty(gives)){
|
|
||||||
this.gives = new ArrayList<>();
|
|
||||||
}else {
|
|
||||||
this.gives = gives;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动商品赠送表(TbActivateInRecord)实体类
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-22 11:13:40
|
|
||||||
*/
|
|
||||||
public class TbActivateInRecord implements Serializable {
|
|
||||||
private static final long serialVersionUID = -35515830201618782L;
|
|
||||||
|
|
||||||
private Integer id;
|
|
||||||
/**
|
|
||||||
* 会员id
|
|
||||||
*/
|
|
||||||
private Integer vipUserId;
|
|
||||||
/**
|
|
||||||
* 商品id
|
|
||||||
*/
|
|
||||||
private Integer proId;
|
|
||||||
/**
|
|
||||||
* 赠送数量
|
|
||||||
*/
|
|
||||||
private Integer num;
|
|
||||||
/**
|
|
||||||
* 未使用数量
|
|
||||||
*/
|
|
||||||
private Integer overNum;
|
|
||||||
/**
|
|
||||||
* 店铺id
|
|
||||||
*/
|
|
||||||
private Integer shopId;
|
|
||||||
/**
|
|
||||||
* 来源活动id
|
|
||||||
*/
|
|
||||||
private Integer sourceActId;
|
|
||||||
|
|
||||||
private Integer sourceFlowId;
|
|
||||||
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
public TbActivateInRecord(Integer vipUserId, Integer proId, Integer num, Integer shopId, Integer sourceActId,Integer sourceFlowId) {
|
|
||||||
this.vipUserId = vipUserId;
|
|
||||||
this.proId = proId;
|
|
||||||
this.num = num;
|
|
||||||
this.overNum = num;
|
|
||||||
this.shopId = shopId;
|
|
||||||
this.sourceActId = sourceActId;
|
|
||||||
this.sourceFlowId = sourceFlowId;
|
|
||||||
this.createTime=new Date();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getVipUserId() {
|
|
||||||
return vipUserId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVipUserId(Integer vipUserId) {
|
|
||||||
this.vipUserId = vipUserId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getProId() {
|
|
||||||
return proId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProId(Integer proId) {
|
|
||||||
this.proId = proId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNum() {
|
|
||||||
return num;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNum(Integer num) {
|
|
||||||
this.num = num;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getOverNum() {
|
|
||||||
return overNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOverNum(Integer overNum) {
|
|
||||||
this.overNum = overNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getShopId() {
|
|
||||||
return shopId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShopId(Integer shopId) {
|
|
||||||
this.shopId = shopId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getSourceActId() {
|
|
||||||
return sourceActId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceActId(Integer sourceActId) {
|
|
||||||
this.sourceActId = sourceActId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getSourceFlowId() {
|
|
||||||
return sourceFlowId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSourceFlowId(Integer sourceFlowId) {
|
|
||||||
this.sourceFlowId = sourceFlowId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateTime(Date createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getUpdateTime() {
|
|
||||||
return updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUpdateTime(Date updateTime) {
|
|
||||||
this.updateTime = updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,125 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动赠送商品使用记录表(TbActivateOutRecord)实体类
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-22 11:21:56
|
|
||||||
*/
|
|
||||||
public class TbActivateOutRecord implements Serializable {
|
|
||||||
private static final long serialVersionUID = -54399746948905097L;
|
|
||||||
|
|
||||||
private Integer id;
|
|
||||||
/**
|
|
||||||
* 商品赠送Id
|
|
||||||
*/
|
|
||||||
private Integer giveId;
|
|
||||||
/**
|
|
||||||
* 商品id
|
|
||||||
*/
|
|
||||||
private Integer proId;
|
|
||||||
/**
|
|
||||||
* 使用数量
|
|
||||||
*/
|
|
||||||
private Integer useNum;
|
|
||||||
/**
|
|
||||||
* 退单量
|
|
||||||
*/
|
|
||||||
private Integer refNum;
|
|
||||||
/**
|
|
||||||
* 订单id
|
|
||||||
*/
|
|
||||||
private String orderId;
|
|
||||||
//新建: create, 完成: closed, 取消:cancel,
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
public TbActivateOutRecord(Integer giveId, Integer proId, Integer useNum, String orderId, String status) {
|
|
||||||
this.giveId = giveId;
|
|
||||||
this.proId = proId;
|
|
||||||
this.useNum = useNum;
|
|
||||||
this.orderId = orderId;
|
|
||||||
this.status = status;
|
|
||||||
this.createTime = new Date();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getGiveId() {
|
|
||||||
return giveId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGiveId(Integer giveId) {
|
|
||||||
this.giveId = giveId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getProId() {
|
|
||||||
return proId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProId(Integer proId) {
|
|
||||||
this.proId = proId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getUseNum() {
|
|
||||||
return useNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseNum(Integer useNum) {
|
|
||||||
this.useNum = useNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getRefNum() {
|
|
||||||
return refNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRefNum(Integer refNum) {
|
|
||||||
this.refNum = refNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOrderId() {
|
|
||||||
return orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrderId(String orderId) {
|
|
||||||
this.orderId = orderId;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动赠送商品表(TbActivateProduct)实体类
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-20 15:15:01
|
|
||||||
*/
|
|
||||||
public class TbActivateProduct implements Serializable {
|
|
||||||
private static final long serialVersionUID = 592370528166603965L;
|
|
||||||
|
|
||||||
private Integer id;
|
|
||||||
/**
|
|
||||||
* 活动Id
|
|
||||||
*/
|
|
||||||
private Integer activateId;
|
|
||||||
/**
|
|
||||||
* 商品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 getActivateId() {
|
|
||||||
return activateId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setActivateId(Integer activateId) {
|
|
||||||
this.activateId = activateId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getProductId() {
|
|
||||||
return productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProductId(Integer productId) {
|
|
||||||
this.productId = productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getNum() {
|
|
||||||
return num;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNum(Integer num) {
|
|
||||||
this.num = num;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateTime(Date createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getUpdateTime() {
|
|
||||||
return updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUpdateTime(Date updateTime) {
|
|
||||||
this.updateTime = updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -58,7 +58,6 @@ public class TbCashierCart implements Serializable {
|
|||||||
private Long updatedAt;
|
private Long updatedAt;
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
private String tableId;
|
private String tableId;
|
||||||
private Byte isVip;
|
|
||||||
private TbProductSpec tbProductSpec;
|
private TbProductSpec tbProductSpec;
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@@ -1,169 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class TbConsInfo implements Serializable {
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
private Integer shopId;
|
|
||||||
|
|
||||||
private Integer conTypeId;
|
|
||||||
|
|
||||||
private String conTypeName;
|
|
||||||
|
|
||||||
private String conCode;
|
|
||||||
|
|
||||||
private String conName;
|
|
||||||
|
|
||||||
private BigDecimal stockNumber;
|
|
||||||
|
|
||||||
private String conUnit;
|
|
||||||
|
|
||||||
private BigDecimal lasterInStock;
|
|
||||||
|
|
||||||
private BigDecimal conWarning;
|
|
||||||
|
|
||||||
private BigDecimal stockConsume;
|
|
||||||
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
private BigDecimal price;
|
|
||||||
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
private Date updateTime;
|
|
||||||
|
|
||||||
private String isCheck;
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getShopId() {
|
|
||||||
return shopId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShopId(Integer shopId) {
|
|
||||||
this.shopId = shopId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getConTypeId() {
|
|
||||||
return conTypeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConTypeId(Integer conTypeId) {
|
|
||||||
this.conTypeId = conTypeId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConTypeName() {
|
|
||||||
return conTypeName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConTypeName(String conTypeName) {
|
|
||||||
this.conTypeName = conTypeName == null ? null : conTypeName.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConCode() {
|
|
||||||
return conCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConCode(String conCode) {
|
|
||||||
this.conCode = conCode == null ? null : conCode.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConName() {
|
|
||||||
return conName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConName(String conName) {
|
|
||||||
this.conName = conName == null ? null : conName.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getStockNumber() {
|
|
||||||
return stockNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStockNumber(BigDecimal stockNumber) {
|
|
||||||
this.stockNumber = stockNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConUnit() {
|
|
||||||
return conUnit;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConUnit(String conUnit) {
|
|
||||||
this.conUnit = conUnit == null ? null : conUnit.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getLasterInStock() {
|
|
||||||
return lasterInStock;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLasterInStock(BigDecimal lasterInStock) {
|
|
||||||
this.lasterInStock = lasterInStock;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getConWarning() {
|
|
||||||
return conWarning;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConWarning(BigDecimal conWarning) {
|
|
||||||
this.conWarning = conWarning;
|
|
||||||
}
|
|
||||||
|
|
||||||
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 BigDecimal getStockConsume() {
|
|
||||||
return stockConsume;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStockConsume(BigDecimal stockConsume) {
|
|
||||||
this.stockConsume = stockConsume;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getPrice() {
|
|
||||||
return price;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrice(BigDecimal price) {
|
|
||||||
this.price = price;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsCheck() {
|
|
||||||
return isCheck;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsCheck(String isCheck) {
|
|
||||||
this.isCheck = isCheck;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -20,8 +20,6 @@ public class TbOrderDetail implements Serializable {
|
|||||||
|
|
||||||
private Integer num;
|
private Integer num;
|
||||||
|
|
||||||
private Byte isVip;
|
|
||||||
|
|
||||||
private String productName;
|
private String productName;
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
@@ -37,7 +35,6 @@ public class TbOrderDetail implements Serializable {
|
|||||||
|
|
||||||
private BigDecimal priceAmount;
|
private BigDecimal priceAmount;
|
||||||
private BigDecimal packAmount;
|
private BigDecimal packAmount;
|
||||||
private String remark;
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
@@ -101,16 +101,12 @@ public class TbOrderInfo implements Serializable {
|
|||||||
private List<TbOrderDetail> detailList;
|
private List<TbOrderDetail> detailList;
|
||||||
private String winnnerNo;
|
private String winnnerNo;
|
||||||
private String isWinner;
|
private String isWinner;
|
||||||
private String shopName;
|
|
||||||
|
|
||||||
private String useType;
|
|
||||||
|
|
||||||
|
|
||||||
//根据状态返回 需付款 已付款 未付款 已退
|
//根据状态返回 需付款 已付款 未付款 已退
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
public void setDescription(String shopName) {
|
public void setDescription() {
|
||||||
this.shopName = shopName;
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case "closed":
|
case "closed":
|
||||||
this.description = "已付款";
|
this.description = "已付款";
|
||||||
@@ -190,4 +186,4 @@ public class TbOrderInfo implements Serializable {
|
|||||||
this.createdAt = System.currentTimeMillis();
|
this.createdAt = System.currentTimeMillis();
|
||||||
this.isAccepted = 1;
|
this.isAccepted = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
public class TbProskuCon implements Serializable {
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
private Integer shopId;
|
|
||||||
|
|
||||||
private Integer productId;
|
|
||||||
|
|
||||||
private Integer productSkuId;
|
|
||||||
|
|
||||||
private Integer conInfoId;
|
|
||||||
|
|
||||||
private BigDecimal surplusStock;
|
|
||||||
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
public Integer getId() {
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setId(Integer id) {
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getShopId() {
|
|
||||||
return shopId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShopId(Integer shopId) {
|
|
||||||
this.shopId = shopId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getProductId() {
|
|
||||||
return productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProductId(Integer productId) {
|
|
||||||
this.productId = productId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getProductSkuId() {
|
|
||||||
return productSkuId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProductSkuId(Integer productSkuId) {
|
|
||||||
this.productSkuId = productSkuId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getConInfoId() {
|
|
||||||
return conInfoId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConInfoId(Integer conInfoId) {
|
|
||||||
this.conInfoId = conInfoId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getSurplusStock() {
|
|
||||||
return surplusStock;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSurplusStock(BigDecimal surplusStock) {
|
|
||||||
this.surplusStock = surplusStock;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status) {
|
|
||||||
this.status = status == null ? null : status.trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateTime(Date createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.io.Serializable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 店铺扩展信息(TbShopExtend)实体类
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-21 09:40:26
|
|
||||||
*/
|
|
||||||
public class TbShopExtend implements Serializable {
|
|
||||||
private static final long serialVersionUID = -25782280496188600L;
|
|
||||||
/**
|
|
||||||
* 自增id
|
|
||||||
*/
|
|
||||||
private Integer id;
|
|
||||||
/**
|
|
||||||
* 商户Id
|
|
||||||
*/
|
|
||||||
private Integer shopId;
|
|
||||||
/**
|
|
||||||
* img:图片;text:文本;
|
|
||||||
*/
|
|
||||||
private String type;
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* 自定义key
|
|
||||||
*/
|
|
||||||
private String autokey;
|
|
||||||
/**
|
|
||||||
* 值
|
|
||||||
*/
|
|
||||||
private String value;
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
private Date updateTime;
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
|
|
||||||
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 getType() {
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setType(String type) {
|
|
||||||
this.type = type;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setName(String name) {
|
|
||||||
this.name = name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAutokey() {
|
|
||||||
return autokey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAutokey(String autokey) {
|
|
||||||
this.autokey = autokey;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getUpdateTime() {
|
|
||||||
return updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUpdateTime(Date updateTime) {
|
|
||||||
this.updateTime = updateTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCreateTime() {
|
|
||||||
return createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCreateTime(Date createTime) {
|
|
||||||
this.createTime = createTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -320,36 +320,4 @@ public class TbShopUser implements Serializable {
|
|||||||
public void setMiniOpenId(String miniOpenId) {
|
public void setMiniOpenId(String miniOpenId) {
|
||||||
this.miniOpenId = miniOpenId == null ? null : miniOpenId.trim();
|
this.miniOpenId = miniOpenId == null ? null : miniOpenId.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsUser() {
|
|
||||||
return isUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsUser(String isUser) {
|
|
||||||
this.isUser = isUser;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLat() {
|
|
||||||
return lat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLat(String lat) {
|
|
||||||
this.lat = lat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLng() {
|
|
||||||
return lng;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLng(String lng) {
|
|
||||||
this.lng = lng;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAddress() {
|
|
||||||
return address;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAddress(String address) {
|
|
||||||
this.address = address;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -21,11 +21,6 @@ public class TbShopUserFlow implements Serializable {
|
|||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
private String isReturn;
|
|
||||||
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public Integer getId() {
|
public Integer getId() {
|
||||||
@@ -91,20 +86,4 @@ public class TbShopUserFlow implements Serializable {
|
|||||||
public void setType(String type) {
|
public void setType(String type) {
|
||||||
this.type = type == null ? null : type.trim();
|
this.type = type == null ? null : type.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIsReturn() {
|
|
||||||
return isReturn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsReturn(String isReturn) {
|
|
||||||
this.isReturn = isReturn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getRemark() {
|
|
||||||
return remark;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRemark(String remark) {
|
|
||||||
this.remark = remark;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -7,11 +7,10 @@ import java.math.BigDecimal;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class TbUserCoupons implements Serializable{
|
public class TbUserCoupons implements Serializable {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
private String userId;
|
private String userId;
|
||||||
private String detail;
|
|
||||||
private Integer orderId;
|
private Integer orderId;
|
||||||
|
|
||||||
private BigDecimal couponsPrice;
|
private BigDecimal couponsPrice;
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity.dto;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class UserCouponDto extends BasePageDto{
|
|
||||||
private Integer userId;
|
|
||||||
private Integer status;
|
|
||||||
private Integer shopId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -6,8 +6,10 @@ import lombok.Data;
|
|||||||
public class OpenMemberVo {
|
public class OpenMemberVo {
|
||||||
private Integer id;
|
private Integer id;
|
||||||
private Integer shopId;
|
private Integer shopId;
|
||||||
private String telephone;
|
|
||||||
private String nickName;
|
|
||||||
private String birthDay;
|
|
||||||
private String headImg;
|
private String headImg;
|
||||||
|
|
||||||
|
private String nickName;
|
||||||
|
|
||||||
|
private String telephone;
|
||||||
|
private String birthDay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity.vo;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class UserCouponVo {
|
|
||||||
/**
|
|
||||||
* 2 会员商品卷
|
|
||||||
*/
|
|
||||||
private Integer type;
|
|
||||||
/**
|
|
||||||
* 卷描述
|
|
||||||
*/
|
|
||||||
private String detail;
|
|
||||||
private String shopName;
|
|
||||||
/**
|
|
||||||
* 优惠金额
|
|
||||||
*/
|
|
||||||
private BigDecimal couponsPrice = BigDecimal.ZERO;
|
|
||||||
/**
|
|
||||||
* 多少可用
|
|
||||||
*/
|
|
||||||
private BigDecimal couponsAmount = BigDecimal.ZERO;
|
|
||||||
/**
|
|
||||||
* 数量
|
|
||||||
*/
|
|
||||||
private Integer num;
|
|
||||||
/**
|
|
||||||
* 卷状态 0 未使用
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.entity.vo;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class VipProductsLimits extends TbProduct {
|
|
||||||
|
|
||||||
private Integer vipLimitNumber;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.rabbit;
|
package com.chaozhanggui.system.cashierservice.rabbit;
|
||||||
|
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
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.*;
|
||||||
import com.chaozhanggui.system.cashierservice.model.CategoryInfo;
|
import com.chaozhanggui.system.cashierservice.model.CategoryInfo;
|
||||||
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
|
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
|
||||||
import com.chaozhanggui.system.cashierservice.redis.RedisCst;
|
|
||||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||||
import com.chaozhanggui.system.cashierservice.util.FeieyunPrintUtil;
|
import com.chaozhanggui.system.cashierservice.util.FeieyunPrintUtil;
|
||||||
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
|
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
|
||||||
@@ -17,15 +14,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.Date;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@@ -53,10 +47,6 @@ public class PrintMechineConsumer {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TbOrderDetailMapper tbOrderDetailMapper;
|
private TbOrderDetailMapper tbOrderDetailMapper;
|
||||||
@Autowired
|
|
||||||
private RedisTemplate<Object, Object> redisTemplate2;
|
|
||||||
@Autowired
|
|
||||||
private StringRedisTemplate stringRedisTemplate;
|
|
||||||
|
|
||||||
@RabbitHandler
|
@RabbitHandler
|
||||||
public void listener(String message) {
|
public void listener(String message) {
|
||||||
@@ -84,9 +74,6 @@ public class PrintMechineConsumer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("打印机列表,{}", ArrayUtil.toString(list));
|
|
||||||
log.info("待打印订单信息, {}", orderInfo);
|
|
||||||
|
|
||||||
list.parallelStream().forEach(tbPrintMachineWithBLOBs->{
|
list.parallelStream().forEach(tbPrintMachineWithBLOBs->{
|
||||||
if (!"network".equals(tbPrintMachineWithBLOBs.getConnectionType())) {
|
if (!"network".equals(tbPrintMachineWithBLOBs.getConnectionType())) {
|
||||||
log.error("非网络打印机:{},{}",tbPrintMachineWithBLOBs.getAddress(),tbPrintMachineWithBLOBs.getConnectionType());
|
log.error("非网络打印机:{},{}",tbPrintMachineWithBLOBs.getAddress(),tbPrintMachineWithBLOBs.getConnectionType());
|
||||||
@@ -195,20 +182,10 @@ public class PrintMechineConsumer {
|
|||||||
break;
|
break;
|
||||||
case "one": //一菜一品
|
case "one": //一菜一品
|
||||||
cashierCarts = tbCashierCartMapper.selectByOrderId(orderId,"final");
|
cashierCarts = tbCashierCartMapper.selectByOrderId(orderId,"final");
|
||||||
log.info("一菜一品打印,待打印信息:{}", cashierCarts);
|
|
||||||
if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) {
|
if (ObjectUtil.isNotEmpty(cashierCarts) && cashierCarts.size() > 0) {
|
||||||
|
|
||||||
|
|
||||||
cashierCarts.parallelStream().forEach(it -> {
|
cashierCarts.parallelStream().forEach(it -> {
|
||||||
|
|
||||||
// 取餐号不为空为代客下单
|
|
||||||
if ("postPay".equals(orderInfo.getUseType()) && StrUtil.isNotBlank(it.getMasterId())) {
|
|
||||||
log.info("--------------------代客下单 打印一菜一品");
|
|
||||||
printTicket(Integer.valueOf(orderId), categoryInfos, tbPrintMachineWithBLOBs, orderInfo);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
log.info("--------------------非代客下单 打印一菜一品");
|
|
||||||
|
|
||||||
String categoryId;
|
String categoryId;
|
||||||
if(ObjectUtil.isEmpty(it.getCategoryId())){
|
if(ObjectUtil.isEmpty(it.getCategoryId())){
|
||||||
categoryId= tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
|
categoryId= tbProductMapper.selectByPrimaryKey(Integer.valueOf(it.getProductId())).getCategoryId();
|
||||||
@@ -243,115 +220,6 @@ public class PrintMechineConsumer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void printTicket(Integer orderId, List<CategoryInfo> categoryInfos, TbPrintMachineWithBLOBs tbPrintMachineWithBLOBs, TbOrderInfo orderInfo) {
|
|
||||||
String printKey = RedisCst.ORDER_PRINT_PRO + orderId;
|
|
||||||
AtomicReference<Set<Object>> printProductSet = new AtomicReference<>(redisTemplate2.opsForSet().members(printKey));
|
|
||||||
List<TbOrderDetail> tbOrderDetails = tbOrderDetailMapper.selectAllByOrderId(orderId);
|
|
||||||
log.info("--------------------订单detail列表: {}", tbOrderDetails);
|
|
||||||
log.info("--------------------缓存打印printProductSet: {}", printProductSet);
|
|
||||||
if (!tbOrderDetails.isEmpty()) {
|
|
||||||
|
|
||||||
// 重置打印数据
|
|
||||||
redisTemplate2.delete(printKey);
|
|
||||||
tbOrderDetails.forEach(it -> {
|
|
||||||
log.info("开始打印一菜一品票据,:{}", it.getProductName());
|
|
||||||
String categoryId = tbProductMapper.selectByPrimaryKey(it.getProductId()).getCategoryId();
|
|
||||||
|
|
||||||
long count = categoryInfos.stream().filter(c ->
|
|
||||||
c.getId().toString().equals(categoryId)
|
|
||||||
).count();
|
|
||||||
|
|
||||||
log.info("获取当前类别是否未打印类别:{}", count);
|
|
||||||
if (count > 0) {
|
|
||||||
|
|
||||||
// 统计已打数量
|
|
||||||
int printerNum = 0;
|
|
||||||
boolean isReturn = false;
|
|
||||||
String key = RedisCst.ORDER_PRINT + orderId + ":" + it.getProductId() + ":" + it.getProductSkuId();
|
|
||||||
String info = stringRedisTemplate.opsForValue().get(key);
|
|
||||||
stringRedisTemplate.opsForValue().set(key, String.valueOf(it.getNum()), 60 * 60 * 24, TimeUnit.SECONDS);
|
|
||||||
|
|
||||||
log.info("--------------------已打印数量: {}", info);
|
|
||||||
|
|
||||||
// 删除已打印数据
|
|
||||||
if (printProductSet.get() != null) {
|
|
||||||
printProductSet.set(printProductSet.get().stream().filter(r -> {
|
|
||||||
TbOrderDetail detail = (TbOrderDetail) r;
|
|
||||||
return !detail.getProductSkuId().equals(it.getProductSkuId()) || !detail.getProductId().equals(it.getProductId());
|
|
||||||
}).collect(Collectors.toSet()));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (info != null) {
|
|
||||||
isReturn = it.getNum() - Integer.parseInt(info) < 0;
|
|
||||||
printerNum = it.getNum() - Integer.parseInt(info);
|
|
||||||
}else {
|
|
||||||
printerNum = it.getNum();
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info("--------------------isReturn: {}, 数量: {}", isReturn, printerNum);
|
|
||||||
|
|
||||||
|
|
||||||
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByPrimaryKey(it.getProductSkuId());
|
|
||||||
String remark = "";
|
|
||||||
if (ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs) && ObjectUtil.isNotEmpty(tbProductSkuWithBLOBs.getSpecSnap())) {
|
|
||||||
remark = tbProductSkuWithBLOBs.getSpecSnap();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 将已打印信息加入redis
|
|
||||||
it.setRemark(remark);
|
|
||||||
redisTemplate2.opsForSet().add(printKey, it);
|
|
||||||
redisTemplate2.expire(printKey, 24, TimeUnit.HOURS);
|
|
||||||
|
|
||||||
// 已打印不再打印
|
|
||||||
if (info != null && printerNum == 0) {
|
|
||||||
log.info("--------------------------订单已打印,跳过打印");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
String data;
|
|
||||||
String voiceJson;
|
|
||||||
if (isReturn) {
|
|
||||||
|
|
||||||
data = PrinterUtils.getPrintData("return",
|
|
||||||
StrUtil.isBlank(orderInfo.getTableName()) ? orderInfo.getMasterId() : orderInfo.getTableName(),
|
|
||||||
DateUtils.getTime(new Date(orderInfo.getCreatedAt())), it.getProductName(), Math.abs(printerNum), remark);
|
|
||||||
voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔退款订单,请及时处理\"}";
|
|
||||||
|
|
||||||
PrinterUtils.printTickets(voiceJson, 3, 1, tbPrintMachineWithBLOBs.getAddress(), data);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
data = PrinterUtils.getPrintData("", orderInfo.getMasterId(),
|
|
||||||
DateUtils.getTime(new Date(orderInfo.getCreatedAt())), it.getProductName(),
|
|
||||||
printerNum, remark);
|
|
||||||
voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔新的订单,请及时处理\"}";
|
|
||||||
PrinterUtils.printTickets(voiceJson, 3, 1, tbPrintMachineWithBLOBs.getAddress(), data);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// 已删除的商品打印退款信息
|
|
||||||
if (printProductSet.get() != null) {
|
|
||||||
printProductSet.get().forEach(item -> {
|
|
||||||
log.info("已删除订单,打印退款票据, {}", item);
|
|
||||||
TbOrderDetail orderDetail = (TbOrderDetail) item;
|
|
||||||
String data = PrinterUtils.getPrintData("return",
|
|
||||||
StrUtil.isBlank(orderInfo.getTableName()) ? orderInfo.getMasterId() : orderInfo.getTableName(),
|
|
||||||
DateUtils.getTime(new Date(orderInfo.getCreatedAt())), orderDetail.getProductName(), orderDetail.getNum(), orderDetail.getRemark());
|
|
||||||
String voiceJson = "{\"bizType\":\"2\",\"content\":\"您有一笔退款订单,请及时处理\"}";
|
|
||||||
PrinterUtils.printTickets(voiceJson, 3, 1, tbPrintMachineWithBLOBs.getAddress(), data);
|
|
||||||
|
|
||||||
String key = RedisCst.ORDER_PRINT + orderId + ":" + orderDetail.getProductId() + ":" + orderDetail.getProductSkuId();
|
|
||||||
log.info("删除商品数量记录key, {}", key);
|
|
||||||
stringRedisTemplate.delete(key);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -62,10 +62,4 @@ public interface RabbitConstants {
|
|||||||
// 库存记录交换机
|
// 库存记录交换机
|
||||||
String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
|
String EXCHANGE_STOCK_RECORD = "exchange.stock.record";
|
||||||
String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
|
String ROUTING_STOCK_RECORD_SALE = "routing.stock.record.sale";
|
||||||
|
|
||||||
|
|
||||||
public static final String BALANCE_PUT="balance_put";
|
|
||||||
public static final String BALANCE_QUEUE_PUT="balance_queue_put";
|
|
||||||
|
|
||||||
public static final String BALANCE_ROUTINGKEY_PUT="balance_routingkey_put";
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,15 +58,6 @@ public class RabbitProducer implements RabbitTemplate.ConfirmCallback {
|
|||||||
rabbitTemplate.convertAndSend(RabbitConstants.CONS_MSG_COLLECT_PUT, RabbitConstants.CONS_MSG_COLLECT_ROUTINGKEY_PUT, content, correlationId);
|
rabbitTemplate.convertAndSend(RabbitConstants.CONS_MSG_COLLECT_PUT, RabbitConstants.CONS_MSG_COLLECT_ROUTINGKEY_PUT, content, correlationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void balance(String content){
|
|
||||||
CorrelationData correlationId = new CorrelationData(UUID.randomUUID().toString());
|
|
||||||
rabbitTemplate.convertAndSend(RabbitConstants.BALANCE_PUT, RabbitConstants.BALANCE_ROUTINGKEY_PUT, content, correlationId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
|
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
|
||||||
logger.info(" 回调id:" + correlationData);
|
logger.info(" 回调id:" + correlationData);
|
||||||
|
|||||||
@@ -96,11 +96,4 @@ public class RedisConfig {
|
|||||||
template.setValueSerializer(new StringRedisSerializer(Charset.forName("UTF-8")));
|
template.setValueSerializer(new StringRedisSerializer(Charset.forName("UTF-8")));
|
||||||
return template;
|
return template;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
public RedisTemplate<Object, Object> redisTemplate2(RedisConnectionFactory factory) {
|
|
||||||
RedisTemplate<Object, Object> template = new RedisTemplate<>();
|
|
||||||
template.setConnectionFactory(factory);
|
|
||||||
return template;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,13 +26,4 @@ public class RedisCst {
|
|||||||
public static final String CREATE_ORDER_LOCK = "CREATE_ORDER_LOCK:";
|
public static final String CREATE_ORDER_LOCK = "CREATE_ORDER_LOCK:";
|
||||||
public static final String SEND_STOCK_WARN_MSG = "SEND_STOCK_WARN_MSG:";
|
public static final String SEND_STOCK_WARN_MSG = "SEND_STOCK_WARN_MSG:";
|
||||||
public static final String SONG_PAY_LOCK = "song_pay_lock:";
|
public static final String SONG_PAY_LOCK = "song_pay_lock:";
|
||||||
public static final String ORDER_PRINT_PRO = "ORDER_PRINT_PRODUCT:";
|
|
||||||
public static final String ORDER_PRINT = "ORDER_PRINT:";
|
|
||||||
|
|
||||||
static String CURRENT_TABLE_ORDER = "CURRENT_TABLE_ORDER:";
|
|
||||||
|
|
||||||
|
|
||||||
public static String getCurrentOrderKey(String tableId, String shopId) {
|
|
||||||
return CURRENT_TABLE_ORDER + shopId + ":" + tableId;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,12 +25,10 @@ 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.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
@@ -59,9 +57,6 @@ public class CartService {
|
|||||||
private TbMerchantAccountMapper merchantAccountMapper;
|
private TbMerchantAccountMapper merchantAccountMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private TbUserInfoMapper userInfoMapper;
|
private TbUserInfoMapper userInfoMapper;
|
||||||
@Autowired
|
|
||||||
private TbShopUserMapper shopUserMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TbOrderDetailMapper orderDetailMapper;
|
private TbOrderDetailMapper orderDetailMapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -76,10 +71,6 @@ public class CartService {
|
|||||||
private final WxAccountUtil wxAccountUtil;
|
private final WxAccountUtil wxAccountUtil;
|
||||||
|
|
||||||
private final TbShopOpenIdMapper shopOpenIdMapper;
|
private final TbShopOpenIdMapper shopOpenIdMapper;
|
||||||
@Resource
|
|
||||||
private TbActivateInRecordService activateInRecordService;
|
|
||||||
@Autowired
|
|
||||||
private TbActivateOutRecordMapper outRecordMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RabbitProducer producer;
|
private RabbitProducer producer;
|
||||||
@@ -94,16 +85,7 @@ public class CartService {
|
|||||||
|
|
||||||
private final RedisTemplate<String, Object> redisTemplate;
|
private final RedisTemplate<String, Object> redisTemplate;
|
||||||
|
|
||||||
private final StringRedisTemplate stringRedisTemplate;
|
public CartService(TbUserShopMsgMapper tbUserShopMsgMapper, WechatUtil wechatUtil, WxAccountUtil wxAccountUtil, TbShopOpenIdMapper shopOpenIdMapper, ProductService productService, TbProductMapper tbProductMapper, RedisTemplate<String, Object> redisTemplate) {
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TbProskuConMapper tbProskuConMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
TbConsInfoMapper tbConsInfoMapper;
|
|
||||||
|
|
||||||
public CartService(TbUserShopMsgMapper tbUserShopMsgMapper, WechatUtil wechatUtil, WxAccountUtil wxAccountUtil, TbShopOpenIdMapper shopOpenIdMapper, ProductService productService, TbProductMapper tbProductMapper, RedisTemplate<String, Object> redisTemplate, StringRedisTemplate stringRedisTemplate) {
|
|
||||||
this.tbUserShopMsgMapper = tbUserShopMsgMapper;
|
this.tbUserShopMsgMapper = tbUserShopMsgMapper;
|
||||||
this.wechatUtil = wechatUtil;
|
this.wechatUtil = wechatUtil;
|
||||||
this.wxAccountUtil = wxAccountUtil;
|
this.wxAccountUtil = wxAccountUtil;
|
||||||
@@ -111,7 +93,6 @@ public class CartService {
|
|||||||
this.productService = productService;
|
this.productService = productService;
|
||||||
this.tbProductMapper = tbProductMapper;
|
this.tbProductMapper = tbProductMapper;
|
||||||
this.redisTemplate = redisTemplate;
|
this.redisTemplate = redisTemplate;
|
||||||
this.stringRedisTemplate = stringRedisTemplate;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void initCart(JSONObject jsonObject) {
|
public void initCart(JSONObject jsonObject) {
|
||||||
@@ -134,7 +115,6 @@ public class CartService {
|
|||||||
if (!CollectionUtils.isEmpty(tbCashierCarts)) {
|
if (!CollectionUtils.isEmpty(tbCashierCarts)) {
|
||||||
for (TbCashierCart cashierCart : tbCashierCarts) {
|
for (TbCashierCart cashierCart : tbCashierCarts) {
|
||||||
array.add(cashierCart);
|
array.add(cashierCart);
|
||||||
if(cashierCart.getIsVip().equals((byte) 1)) continue;
|
|
||||||
amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
||||||
}
|
}
|
||||||
redisUtil.saveMessage(RedisCst.TABLE_CART.concat(key), array.toString());
|
redisUtil.saveMessage(RedisCst.TABLE_CART.concat(key), array.toString());
|
||||||
@@ -161,9 +141,8 @@ public class CartService {
|
|||||||
String skuId = jsonObject.getString("skuId");
|
String skuId = jsonObject.getString("skuId");
|
||||||
Integer type = jsonObject.getInteger("type");
|
Integer type = jsonObject.getInteger("type");
|
||||||
Integer buyNum = jsonObject.getInteger("num");
|
Integer buyNum = jsonObject.getInteger("num");
|
||||||
Integer isVip = jsonObject.getInteger("isVip");
|
|
||||||
if (StringUtils.isBlank(tableId) || StringUtils.isBlank(shopId) || StringUtils.isBlank(productId)
|
if (StringUtils.isBlank(tableId) || StringUtils.isBlank(shopId) || StringUtils.isBlank(productId)
|
||||||
|| StringUtils.isBlank(skuId) || type == null || buyNum == null) {
|
|| StringUtils.isBlank(skuId) || type==null || buyNum == null) {
|
||||||
return Result.fail("参数缺失");
|
return Result.fail("参数缺失");
|
||||||
}
|
}
|
||||||
String key = tableId + "-" + shopId;
|
String key = tableId + "-" + shopId;
|
||||||
@@ -174,39 +153,24 @@ public class CartService {
|
|||||||
}
|
}
|
||||||
// 判断商品是否已下架
|
// 判断商品是否已下架
|
||||||
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId));
|
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId));
|
||||||
if (tbProductSkuWithBLOBs == null || tbProductSkuWithBLOBs.getIsGrounding().equals(0)) {
|
if (tbProductSkuWithBLOBs ==null || tbProductSkuWithBLOBs.getIsGrounding().equals(0)) {
|
||||||
rmCart(jsonObject, skuId, key);
|
rmCart(jsonObject,skuId,key);
|
||||||
return Result.fail("商品已下架");
|
return Result.fail("商品已下架");
|
||||||
}
|
}
|
||||||
if (tbProduct.getIsStock() == 1) {
|
if (tbProduct.getIsStock() == 1) {
|
||||||
// 1:共享库存 0:独立库存
|
// 1:共享库存 0:独立库存
|
||||||
if (Integer.valueOf(tbProduct.getIsDistribute()).equals(1)) {
|
if (Integer.valueOf(tbProduct.getIsDistribute()).equals(1)) {
|
||||||
if (tbProduct.getIsPauseSale() == 1) {//是否售罄
|
if (tbProduct.getIsPauseSale() == 1) {//是否售罄
|
||||||
rmCart(jsonObject, skuId, key);
|
rmCart(jsonObject,skuId,key);
|
||||||
return Result.fail("该商品已售罄");
|
return Result.fail("该商品已售罄");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (tbProductSkuWithBLOBs.getIsPauseSale() == 1) {//是否售罄
|
if (tbProductSkuWithBLOBs.getIsPauseSale() == 1) {//是否售罄
|
||||||
rmCart(jsonObject, skuId, key);
|
rmCart(jsonObject,skuId,key);
|
||||||
return Result.fail("该商品已售罄");
|
return Result.fail("该商品已售罄");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TbProskuCon> proskuConList = tbProskuConMapper.selectByShopIdAndSkuIdAndProductId(Integer.valueOf(skuId), Integer.valueOf(shopId), Integer.valueOf(productId));
|
|
||||||
if (Objects.nonNull(proskuConList) && proskuConList.size() > 0) {
|
|
||||||
for (TbProskuCon proskuCon : proskuConList) {
|
|
||||||
if ("1".equals(proskuCon.getStatus())) {
|
|
||||||
TbConsInfo consInfo = tbConsInfoMapper.selectByPrimaryKey(proskuCon.getConInfoId());
|
|
||||||
if ("1".equals(consInfo.getIsCheck())) {
|
|
||||||
if (N.gt(proskuCon.getSurplusStock(), consInfo.getStockNumber().abs().subtract(consInfo.getStockConsume().abs()))) {
|
|
||||||
return Result.fail("商品:".concat(tbProduct.getName()).concat("对应的:").concat(consInfo.getConName()).concat("耗材不足"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JSONArray jsonArray = new JSONArray();
|
JSONArray jsonArray = new JSONArray();
|
||||||
BigDecimal amount = BigDecimal.ZERO;
|
BigDecimal amount = BigDecimal.ZERO;
|
||||||
try{
|
try{
|
||||||
@@ -215,7 +179,7 @@ public class CartService {
|
|||||||
if (Objects.isNull(array) || array.isEmpty()) {
|
if (Objects.isNull(array) || array.isEmpty()) {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
TbCashierCart cashierCart = addCart(productId, skuId,
|
TbCashierCart cashierCart = addCart(productId, skuId,
|
||||||
jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip);
|
jsonObject.getInteger("userId"), buyNum, tableId, shopId);
|
||||||
jsonArray.add(cashierCart);
|
jsonArray.add(cashierCart);
|
||||||
amount = amount.add(new BigDecimal(cashierCart.getNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
amount = amount.add(new BigDecimal(cashierCart.getNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
||||||
}
|
}
|
||||||
@@ -224,21 +188,15 @@ public class CartService {
|
|||||||
for (int i = 0; i < array.size(); i++) {
|
for (int i = 0; i < array.size(); i++) {
|
||||||
JSONObject object = array.getJSONObject(i);
|
JSONObject object = array.getJSONObject(i);
|
||||||
TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class);
|
TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class);
|
||||||
|
if (cashierCart.getSkuId().equals(skuId)) {
|
||||||
if (cashierCart.getSkuId().equals(skuId) && cashierCart.getIsVip().intValue() == isVip) {
|
|
||||||
cashierCart.setTotalNumber(buyNum);
|
cashierCart.setTotalNumber(buyNum);
|
||||||
cashierCart.setNumber(buyNum);
|
cashierCart.setNumber(buyNum);
|
||||||
if (type == 0 && isVip == 0 && tbProductSkuWithBLOBs.getSuit() != null
|
if (type == 0 && tbProductSkuWithBLOBs.getSuit() != null && tbProductSkuWithBLOBs.getSuit() > 1 && cashierCart.getNumber() < tbProductSkuWithBLOBs.getSuit()) {
|
||||||
&& tbProductSkuWithBLOBs.getSuit() > 1 && cashierCart.getNumber() < tbProductSkuWithBLOBs.getSuit()) {
|
|
||||||
cashierCartMapper.deleteByPrimaryKey(cashierCart.getId());
|
cashierCartMapper.deleteByPrimaryKey(cashierCart.getId());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (cashierCart.getNumber() > 0) {
|
if (cashierCart.getNumber() > 0) {
|
||||||
if (isVip == 1) {
|
cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
||||||
cashierCart.setTotalAmount(BigDecimal.ZERO);
|
|
||||||
} else {
|
|
||||||
cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
|
||||||
}
|
|
||||||
cashierCart.setUpdatedAt(Instant.now().toEpochMilli());
|
cashierCart.setUpdatedAt(Instant.now().toEpochMilli());
|
||||||
cashierCartMapper.updateByPrimaryKeySelective(cashierCart);
|
cashierCartMapper.updateByPrimaryKeySelective(cashierCart);
|
||||||
} else {
|
} else {
|
||||||
@@ -252,7 +210,7 @@ public class CartService {
|
|||||||
}
|
}
|
||||||
if (flag && type == 1) {
|
if (flag && type == 1) {
|
||||||
TbCashierCart cashierCart = addCart(productId, skuId,
|
TbCashierCart cashierCart = addCart(productId, skuId,
|
||||||
jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip);
|
jsonObject.getInteger("userId"), buyNum, tableId, shopId);
|
||||||
jsonArray.add(cashierCart);
|
jsonArray.add(cashierCart);
|
||||||
amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
||||||
}
|
}
|
||||||
@@ -260,11 +218,9 @@ public class CartService {
|
|||||||
} else {
|
} else {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
TbCashierCart cashierCart = addCart(productId, skuId,
|
TbCashierCart cashierCart = addCart(productId, skuId,
|
||||||
jsonObject.getInteger("userId"), buyNum, tableId, shopId,isVip);
|
jsonObject.getInteger("userId"), buyNum, tableId, shopId);
|
||||||
jsonArray.add(cashierCart);
|
jsonArray.add(cashierCart);
|
||||||
if (isVip != 1) {
|
amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
||||||
amount = amount.add(new BigDecimal(cashierCart.getTotalNumber()).multiply(cashierCart.getSalePrice().add(cashierCart.getPackFee())));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}catch (MsgException e){
|
}catch (MsgException e){
|
||||||
@@ -282,7 +238,7 @@ public class CartService {
|
|||||||
jsonObject1.put("reqData", jsonObject);
|
jsonObject1.put("reqData", jsonObject);
|
||||||
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), key, "", false);
|
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), key, "", false);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("长链接错误 createCart {}", e.getMessage());
|
log.error("长链接错误 createCart{}", e.getMessage());
|
||||||
}
|
}
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
}
|
}
|
||||||
@@ -397,13 +353,13 @@ public class CartService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private TbCashierCart addCart(String productId, String skuId, Integer userId, Integer num, String tableId, String shopId,Integer isVip) throws Exception{
|
private TbCashierCart addCart(String productId, String skuId, Integer userId, Integer num, String tableId, String shopId) throws Exception{
|
||||||
try {
|
try {
|
||||||
TbProduct product = productMapper.selectById(Integer.valueOf(productId));
|
TbProduct product = productMapper.selectById(Integer.valueOf(productId));
|
||||||
String key = tableId + "-" + shopId;
|
String key = tableId + "-" + shopId;
|
||||||
TbProductSkuWithBLOBs productSku = productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId));
|
TbProductSkuWithBLOBs productSku = productSkuMapper.selectByPrimaryKey(Integer.valueOf(skuId));
|
||||||
TbCashierCart cashierCart = new TbCashierCart();
|
TbCashierCart cashierCart = new TbCashierCart();
|
||||||
if (productSku.getSuit() != null && productSku.getSuit() > 1 && isVip != 1) {
|
if (productSku.getSuit() != null && productSku.getSuit() > 1) {
|
||||||
if (product.getIsStock() == 1) {
|
if (product.getIsStock() == 1) {
|
||||||
boolean isSale = false;
|
boolean isSale = false;
|
||||||
// 1:共享库存 0:独立库存
|
// 1:共享库存 0:独立库存
|
||||||
@@ -453,14 +409,7 @@ public class CartService {
|
|||||||
cashierCart.setUpdatedAt(Instant.now().toEpochMilli());
|
cashierCart.setUpdatedAt(Instant.now().toEpochMilli());
|
||||||
cashierCart.setPackFee(BigDecimal.ZERO);
|
cashierCart.setPackFee(BigDecimal.ZERO);
|
||||||
cashierCart.setRefundNumber(0);
|
cashierCart.setRefundNumber(0);
|
||||||
if(isVip==1){
|
cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(productSku.getSalePrice().add(cashierCart.getPackFee())));
|
||||||
cashierCart.setIsVip(Byte.parseByte("1"));
|
|
||||||
cashierCart.setTotalAmount(BigDecimal.ZERO);
|
|
||||||
cashierCart.setSalePrice(BigDecimal.ZERO);
|
|
||||||
}else {
|
|
||||||
cashierCart.setIsVip(Byte.parseByte("0"));
|
|
||||||
cashierCart.setTotalAmount(new BigDecimal(cashierCart.getTotalNumber()).multiply(productSku.getSalePrice().add(cashierCart.getPackFee())));
|
|
||||||
}
|
|
||||||
cashierCartMapper.insert(cashierCart);
|
cashierCartMapper.insert(cashierCart);
|
||||||
|
|
||||||
|
|
||||||
@@ -473,7 +422,7 @@ public class CartService {
|
|||||||
|
|
||||||
return cashierCart;
|
return cashierCart;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("长链接错误 addCart {}", e.getMessage());
|
log.error("长链接错误 addCart{}", e.getMessage());
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -504,36 +453,9 @@ public class CartService {
|
|||||||
if (tbUserInfo == null) {
|
if (tbUserInfo == null) {
|
||||||
MsgException.throwException("生成订单失败");
|
MsgException.throwException("生成订单失败");
|
||||||
}
|
}
|
||||||
TbShopUser tbShopUser = shopUserMapper.selectByUserIdAndShopId(userId, shopId);
|
|
||||||
boolean isVip= false;
|
|
||||||
if (tbShopUser != null && tbShopUser.getIsVip().equals((byte) 1)) {
|
|
||||||
isVip=true;
|
|
||||||
}
|
|
||||||
//校验 库存 耗材
|
|
||||||
for (int i = 0; i < array.size(); i++) {
|
for (int i = 0; i < array.size(); i++) {
|
||||||
JSONObject object = array.getJSONObject(i);
|
JSONObject object = array.getJSONObject(i);
|
||||||
TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class);
|
TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class);
|
||||||
if (cashierCart.getIsVip().equals((byte) 1)) {
|
|
||||||
if (isVip) {
|
|
||||||
int i1 = activateInRecordService.queryByVipIdAndShopIdAndProId(
|
|
||||||
Integer.valueOf(tbShopUser.getId()), Integer.valueOf(shopId), Integer.valueOf(cashierCart.getProductId()));
|
|
||||||
if (i1 < cashierCart.getTotalNumber()) {
|
|
||||||
JSONObject jsonObject1 = new JSONObject();
|
|
||||||
jsonObject1.put("status", "fail");
|
|
||||||
jsonObject1.put("msg", "会员商品[" + cashierCart.getName() + "],可下单数量为" + i1);
|
|
||||||
jsonObject1.put("data", new ArrayList<>());
|
|
||||||
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), key, jsonObject.getString("userId"), true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
JSONObject jsonObject1 = new JSONObject();
|
|
||||||
jsonObject1.put("status", "fail");
|
|
||||||
jsonObject1.put("msg", "非会员用户不可下单会员商品");
|
|
||||||
jsonObject1.put("data", new ArrayList<>());
|
|
||||||
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), key, jsonObject.getString("userId"), true);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TbProductSkuWithBLOBs tbProduct = productSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId()));
|
TbProductSkuWithBLOBs tbProduct = productSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId()));
|
||||||
TbProduct tbProduct1 = tbProductMapper.selectById(Integer.valueOf(tbProduct.getProductId()));
|
TbProduct tbProduct1 = tbProductMapper.selectById(Integer.valueOf(tbProduct.getProductId()));
|
||||||
|
|
||||||
@@ -592,7 +514,6 @@ public class CartService {
|
|||||||
orderDetail.setPackAmount(cashierCart.getPackFee());
|
orderDetail.setPackAmount(cashierCart.getPackFee());
|
||||||
orderDetail.setProductImg(cashierCart.getCoverImg());
|
orderDetail.setProductImg(cashierCart.getCoverImg());
|
||||||
orderDetail.setStatus("unpaid");
|
orderDetail.setStatus("unpaid");
|
||||||
orderDetail.setIsVip(cashierCart.getIsVip());
|
|
||||||
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
|
if (StringUtils.isNotEmpty(cashierCart.getOrderId())) {
|
||||||
orderId = Integer.valueOf(cashierCart.getOrderId());
|
orderId = Integer.valueOf(cashierCart.getOrderId());
|
||||||
}
|
}
|
||||||
@@ -606,8 +527,6 @@ public class CartService {
|
|||||||
TbShopTable shopTable = shopTableMapper.selectQRcode(jsonObject.getString("tableId"));
|
TbShopTable shopTable = shopTableMapper.selectQRcode(jsonObject.getString("tableId"));
|
||||||
//生成订单
|
//生成订单
|
||||||
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
|
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
|
||||||
|
|
||||||
//优惠卷
|
|
||||||
String isBuyYhq = "false";
|
String isBuyYhq = "false";
|
||||||
String isuseYhq = "false";
|
String isuseYhq = "false";
|
||||||
if (jsonObject.containsKey("isYhq") && jsonObject.getString("isYhq").equals("1")) {
|
if (jsonObject.containsKey("isYhq") && jsonObject.getString("isYhq").equals("1")) {
|
||||||
@@ -655,7 +574,28 @@ public class CartService {
|
|||||||
couponAmount = userCoupons.getCouponsAmount();
|
couponAmount = userCoupons.getCouponsAmount();
|
||||||
} else {
|
} else {
|
||||||
TbUserCoupons userCoupons = userCouponsMapper.selectByPrimaryKey(couponsId);
|
TbUserCoupons userCoupons = userCouponsMapper.selectByPrimaryKey(couponsId);
|
||||||
|
if (Objects.isNull(userCoupons) || !userCoupons.getStatus().equals("0")) {
|
||||||
|
log.info("开始处理订单");
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("status", "fail");
|
||||||
|
jsonObject1.put("msg", "优惠券已使用");
|
||||||
|
jsonObject1.put("type", jsonObject.getString("type"));
|
||||||
|
jsonObject1.put("data", "");
|
||||||
|
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), key, jsonObject.getString("userId"), true);
|
||||||
|
log.info("消息推送");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (N.gt(userCoupons.getCouponsAmount(), totalAmount)) {
|
||||||
|
log.info("开始处理订单");
|
||||||
|
JSONObject jsonObject1 = new JSONObject();
|
||||||
|
jsonObject1.put("status", "fail");
|
||||||
|
jsonObject1.put("msg", "订单金额小于优惠价金额");
|
||||||
|
jsonObject1.put("type", jsonObject.getString("type"));
|
||||||
|
jsonObject1.put("data", "");
|
||||||
|
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(jsonObject1.toString(), key, jsonObject.getString("userId"), true);
|
||||||
|
log.info("消息推送");
|
||||||
|
return;
|
||||||
|
}
|
||||||
totalAmount = totalAmount.subtract(userCoupons.getCouponsAmount());
|
totalAmount = totalAmount.subtract(userCoupons.getCouponsAmount());
|
||||||
userCoupons.setStatus("1");
|
userCoupons.setStatus("1");
|
||||||
userCoupons.setEndTime(DateUtils.getNewDate(new Date(), 5, 30));
|
userCoupons.setEndTime(DateUtils.getNewDate(new Date(), 5, 30));
|
||||||
@@ -692,7 +632,6 @@ public class CartService {
|
|||||||
orderInfo.setIsBuyCoupon(isBuyYhq);
|
orderInfo.setIsBuyCoupon(isBuyYhq);
|
||||||
orderInfo.setIsUseCoupon(isuseYhq);
|
orderInfo.setIsUseCoupon(isuseYhq);
|
||||||
orderInfo.setRemark(remark);
|
orderInfo.setRemark(remark);
|
||||||
orderInfo.setUserId(userId);
|
|
||||||
orderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
orderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -704,7 +643,6 @@ public class CartService {
|
|||||||
orderInfo.setIsUseCoupon(isuseYhq);
|
orderInfo.setIsUseCoupon(isuseYhq);
|
||||||
orderInfo.setUserCouponAmount(couponAmount);
|
orderInfo.setUserCouponAmount(couponAmount);
|
||||||
orderInfo.setRemark(remark);
|
orderInfo.setRemark(remark);
|
||||||
orderInfo.setUserId(userId);
|
|
||||||
|
|
||||||
JSONObject object = new JSONObject();
|
JSONObject object = new JSONObject();
|
||||||
String outNumber = redisUtil.getMessage(RedisCst.OUT_NUMBER.concat(jsonObject.getString("shopId")));
|
String outNumber = redisUtil.getMessage(RedisCst.OUT_NUMBER.concat(jsonObject.getString("shopId")));
|
||||||
@@ -733,30 +671,9 @@ public class CartService {
|
|||||||
orderDetail.setOrderId(orderId);
|
orderDetail.setOrderId(orderId);
|
||||||
orderDetailMapper.insert(orderDetail);
|
orderDetailMapper.insert(orderDetail);
|
||||||
}
|
}
|
||||||
List<TbActivateOutRecord> outRecords = new ArrayList<>();
|
|
||||||
for (int i = 0; i < array.size(); i++) {
|
for (int i = 0; i < array.size(); i++) {
|
||||||
JSONObject object = array.getJSONObject(i);
|
JSONObject object = array.getJSONObject(i);
|
||||||
TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class);
|
TbCashierCart cashierCart = JSONUtil.parseJSONStr2T(object.toJSONString(), TbCashierCart.class);
|
||||||
if (cashierCart.getIsVip().equals((byte) 1)) {
|
|
||||||
List<TbActivateInRecord> actInRecords = activateInRecordService.queryAllByVipIdAndShopIdAndProId(
|
|
||||||
Integer.valueOf(tbShopUser.getId()), Integer.valueOf(orderInfo.getShopId()), Integer.valueOf(cashierCart.getProductId()));
|
|
||||||
Integer totalNumber = cashierCart.getTotalNumber();
|
|
||||||
for (TbActivateInRecord actInRecord : actInRecords) {
|
|
||||||
if (totalNumber > 0) {
|
|
||||||
if (actInRecord.getOverNum() > totalNumber) {
|
|
||||||
TbActivateOutRecord outRecord = new TbActivateOutRecord(actInRecord.getId(), actInRecord.getProId(), totalNumber, orderInfo.getId().toString(), "create");
|
|
||||||
outRecords.add(outRecord);
|
|
||||||
activateInRecordService.updateOverNumById(actInRecord.getId(), actInRecord.getOverNum() - totalNumber);
|
|
||||||
break;
|
|
||||||
} else {
|
|
||||||
TbActivateOutRecord outRecord = new TbActivateOutRecord(actInRecord.getId(), actInRecord.getProId(), actInRecord.getOverNum(), orderInfo.getId().toString(), "create");
|
|
||||||
outRecords.add(outRecord);
|
|
||||||
activateInRecordService.updateOverNumById(actInRecord.getId(), 0);
|
|
||||||
totalNumber = totalNumber - actInRecord.getOverNum();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cashierCart.setUpdatedAt(System.currentTimeMillis());
|
cashierCart.setUpdatedAt(System.currentTimeMillis());
|
||||||
cashierCart.setOrderId(orderId + "");
|
cashierCart.setOrderId(orderId + "");
|
||||||
cashierCart.setStatus("closed");
|
cashierCart.setStatus("closed");
|
||||||
@@ -766,7 +683,7 @@ public class CartService {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!CollectionUtils.isEmpty(outRecords)) outRecordMapper.insertBatch(outRecords);
|
|
||||||
// 发送mq消息
|
// 发送mq消息
|
||||||
JSONObject jsonObject2 = new JSONObject();
|
JSONObject jsonObject2 = new JSONObject();
|
||||||
jsonObject2.put("orderId", orderInfo.getId());
|
jsonObject2.put("orderId", orderInfo.getId());
|
||||||
@@ -808,7 +725,7 @@ public class CartService {
|
|||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.info("长链接错误 createOrder{}", e.getMessage());
|
log.info("长链接错误 addCart{}", e.getMessage());
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -537,23 +537,21 @@ public class LoginService {
|
|||||||
) {
|
) {
|
||||||
return Result.fail("参数错误");
|
return Result.fail("参数错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
TbUserInfo userInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
|
TbUserInfo userInfo = tbUserInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
|
||||||
String phone = userInfo.getTelephone();
|
boolean flag = validate(map.get("code").toString(), userInfo.getTelephone());
|
||||||
if (map.containsKey("vipId")) {
|
if (!flag) {
|
||||||
TbShopUser tbShopUser = tbShopUserMapper.selectByPrimaryKey(map.get("vipId").toString());
|
return Result.fail("验证码错误");
|
||||||
phone = tbShopUser.getTelephone();
|
|
||||||
}
|
}
|
||||||
if (StringUtils.isBlank(phone)) return Result.fail("设置密码失败,手机号获取为空");
|
|
||||||
|
|
||||||
boolean flag = validate(map.get("code").toString(), phone);
|
|
||||||
|
|
||||||
if (!flag) return Result.fail("验证码错误");
|
|
||||||
|
|
||||||
userInfo.setIsPwd("1");
|
userInfo.setIsPwd("1");
|
||||||
userInfo.setPwd(MD5Utils.md5(map.get("pwd").toString()));
|
userInfo.setPwd(MD5Utils.md5(map.get("pwd").toString()));
|
||||||
userInfo.setUpdatedAt(System.currentTimeMillis());
|
userInfo.setUpdatedAt(System.currentTimeMillis());
|
||||||
tbUserInfoMapper.updateByPrimaryKey(userInfo);
|
tbUserInfoMapper.updateByPrimaryKey(userInfo);
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -583,4 +581,11 @@ public class LoginService {
|
|||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
for (int i = 0; i < 10; i++) {
|
||||||
|
System.out.println(RandomUtil.randomNumbers(10));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,14 +212,6 @@ public class OrderService {
|
|||||||
return Result.success(CodeEnum.ENCRYPT, orderVo);
|
return Result.success(CodeEnum.ENCRYPT, orderVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result rmOrder(Integer orderId) {
|
|
||||||
int i = orderInfoMapper.deleteByPrimaryKey(orderId);
|
|
||||||
if (i > 0) {
|
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
|
||||||
}
|
|
||||||
return Result.fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Result orderList(Integer userId, Integer page, Integer size, String status) {
|
public Result orderList(Integer userId, Integer page, Integer size, String status) {
|
||||||
// TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(userId);
|
// TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(userId);
|
||||||
@@ -228,11 +220,9 @@ public class OrderService {
|
|||||||
// }
|
// }
|
||||||
PageHelper.startPage(page, size);
|
PageHelper.startPage(page, size);
|
||||||
List<TbOrderInfo> tbOrderInfos = orderInfoMapper.selectByUserId(userId, status);
|
List<TbOrderInfo> tbOrderInfos = orderInfoMapper.selectByUserId(userId, status);
|
||||||
String shopName = "";
|
|
||||||
for (TbOrderInfo orderInfo : tbOrderInfos) {
|
for (TbOrderInfo orderInfo : tbOrderInfos) {
|
||||||
TbShopInfo tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
orderInfo.setDescription();
|
||||||
shopName = tbShopInfo.getShopName();
|
|
||||||
orderInfo.setDescription(shopName);
|
|
||||||
List<TbOrderDetail> list = tbOrderDetailMapper.selectAllByOrderId(orderInfo.getId());
|
List<TbOrderDetail> list = tbOrderDetailMapper.selectAllByOrderId(orderInfo.getId());
|
||||||
int num = 0;
|
int num = 0;
|
||||||
for (TbOrderDetail orderDetail : list) {
|
for (TbOrderDetail orderDetail : list) {
|
||||||
|
|||||||
@@ -31,11 +31,9 @@ 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.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -73,10 +71,6 @@ public class PayService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
TbShopPayTypeMapper tbShopPayTypeMapper;
|
TbShopPayTypeMapper tbShopPayTypeMapper;
|
||||||
@Autowired
|
|
||||||
private TbActivateProductMapper actProductMapper;
|
|
||||||
@Resource
|
|
||||||
private TbActivateInRecordMapper activateInRecordMapper;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TbShopSongOrderMapper tbShopSongOrderMapper;
|
private TbShopSongOrderMapper tbShopSongOrderMapper;
|
||||||
@@ -117,10 +111,6 @@ public class PayService {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
TbShopUserFlowMapper tbShopUserFlowMapper;
|
TbShopUserFlowMapper tbShopUserFlowMapper;
|
||||||
@Resource
|
|
||||||
private TbActivateInRecordService activateInRecordService;
|
|
||||||
@Autowired
|
|
||||||
private TbActivateOutRecordMapper outRecordMapper;
|
|
||||||
|
|
||||||
@Value("${thirdPay.payType}")
|
@Value("${thirdPay.payType}")
|
||||||
private String thirdPayType;
|
private String thirdPayType;
|
||||||
@@ -159,8 +149,6 @@ public class PayService {
|
|||||||
private final TbShopSongOrderService shopSongOrderService;
|
private final TbShopSongOrderService shopSongOrderService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private MQUtils mQUtils;
|
private MQUtils mQUtils;
|
||||||
@Autowired
|
|
||||||
private StringRedisTemplate stringRedisTemplate;
|
|
||||||
|
|
||||||
public PayService(@Qualifier("tbShopSongOrderServiceImpl") TbShopSongOrderService shopSongOrderService) {
|
public PayService(@Qualifier("tbShopSongOrderServiceImpl") TbShopSongOrderService shopSongOrderService) {
|
||||||
this.shopSongOrderService = shopSongOrderService;
|
this.shopSongOrderService = shopSongOrderService;
|
||||||
@@ -333,7 +321,6 @@ public class PayService {
|
|||||||
if (ObjectUtil.isEmpty(orderInfo)) {
|
if (ObjectUtil.isEmpty(orderInfo)) {
|
||||||
return Result.fail("订单信息不存在");
|
return Result.fail("订单信息不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (System.currentTimeMillis() - orderInfo.getCreatedAt() > 60 * 15 * 1000) {
|
if (System.currentTimeMillis() - orderInfo.getCreatedAt() > 60 * 15 * 1000) {
|
||||||
return Result.fail("订单十五分钟内有效,当前已超时,请重新下单。");
|
return Result.fail("订单十五分钟内有效,当前已超时,请重新下单。");
|
||||||
}
|
}
|
||||||
@@ -385,12 +372,11 @@ public class PayService {
|
|||||||
TbShopUserFlow flow = new TbShopUserFlow();
|
TbShopUserFlow flow = new TbShopUserFlow();
|
||||||
flow.setShopUserId(Integer.valueOf(user.getId()));
|
flow.setShopUserId(Integer.valueOf(user.getId()));
|
||||||
flow.setBizCode("accountPay");
|
flow.setBizCode("accountPay");
|
||||||
flow.setBizName("余额支付");
|
flow.setBizName("会员储值卡支付");
|
||||||
flow.setType("-");
|
flow.setType("-");
|
||||||
flow.setAmount(orderInfo.getOrderAmount());
|
flow.setAmount(orderInfo.getOrderAmount());
|
||||||
flow.setBalance(user.getAmount());
|
flow.setBalance(user.getAmount());
|
||||||
flow.setCreateTime(new Date());
|
flow.setCreateTime(new Date());
|
||||||
flow.setIsReturn("0");
|
|
||||||
tbShopUserFlowMapper.insert(flow);
|
tbShopUserFlowMapper.insert(flow);
|
||||||
|
|
||||||
|
|
||||||
@@ -407,7 +393,7 @@ public class PayService {
|
|||||||
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed");
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed");
|
||||||
|
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
||||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(),"closed");
|
|
||||||
log.info("更新购物车:{}", cartCount);
|
log.info("更新购物车:{}", cartCount);
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
@@ -425,24 +411,6 @@ public class PayService {
|
|||||||
data.put("orderId", orderInfo.getId());
|
data.put("orderId", orderInfo.getId());
|
||||||
data.put("plat", "miniApp");
|
data.put("plat", "miniApp");
|
||||||
mQUtils.sendStockSaleMsg(data);
|
mQUtils.sendStockSaleMsg(data);
|
||||||
|
|
||||||
|
|
||||||
JSONObject baObj=new JSONObject();
|
|
||||||
baObj.put("userId",userInfo.getId());
|
|
||||||
baObj.put("shopId",user.getShopId());
|
|
||||||
baObj.put("amount",orderInfo.getOrderAmount());
|
|
||||||
baObj.put("balance",user.getAmount());
|
|
||||||
baObj.put("type","消费");
|
|
||||||
baObj.put("time",flow.getCreateTime());
|
|
||||||
producer.balance(baObj.toString());
|
|
||||||
|
|
||||||
// 为代客下单清楚当前台桌最新订单
|
|
||||||
String currentOrderKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(), orderInfo.getShopId());
|
|
||||||
String currentOrderId = stringRedisTemplate.opsForValue().get(currentOrderKey);
|
|
||||||
if (currentOrderId != null && currentOrderId.equals(orderId)) {
|
|
||||||
stringRedisTemplate.delete(currentOrderKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Result.success(CodeEnum.SUCCESS, "1");
|
return Result.success(CodeEnum.SUCCESS, "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -489,7 +457,6 @@ public class PayService {
|
|||||||
flow.setAmount(orderInfo.getOrderAmount());
|
flow.setAmount(orderInfo.getOrderAmount());
|
||||||
flow.setBalance(user.getAmount());
|
flow.setBalance(user.getAmount());
|
||||||
flow.setCreateTime(new Date());
|
flow.setCreateTime(new Date());
|
||||||
flow.setIsReturn("0");
|
|
||||||
tbShopUserFlowMapper.insert(flow);
|
tbShopUserFlowMapper.insert(flow);
|
||||||
|
|
||||||
for (int i = 0; i < orderInfo.getNumber(); i++) {
|
for (int i = 0; i < orderInfo.getNumber(); i++) {
|
||||||
@@ -901,7 +868,7 @@ public class PayService {
|
|||||||
|
|
||||||
//更新子单状态
|
//更新子单状态
|
||||||
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(orderInfo.getId(), "closed");
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(orderInfo.getId(), "closed");
|
||||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(),"closed");
|
|
||||||
//修改主单状态
|
//修改主单状态
|
||||||
orderInfo.setStatus("closed");
|
orderInfo.setStatus("closed");
|
||||||
orderInfo.setPayType("wx_lite");
|
orderInfo.setPayType("wx_lite");
|
||||||
@@ -922,13 +889,6 @@ public class PayService {
|
|||||||
sendOrderToClient(orderInfo);
|
sendOrderToClient(orderInfo);
|
||||||
redisUtil.deleteByKey(RedisCst.ORDER_EXPIRED.concat(orderInfo.getId().toString()));
|
redisUtil.deleteByKey(RedisCst.ORDER_EXPIRED.concat(orderInfo.getId().toString()));
|
||||||
|
|
||||||
// 为代客下单清除当前台桌最新订单
|
|
||||||
String currentOrderKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(), orderInfo.getShopId());
|
|
||||||
String currentOrderId = stringRedisTemplate.opsForValue().get(currentOrderKey);
|
|
||||||
if (currentOrderId != null && currentOrderId.equals(orderInfo.getId().toString())) {
|
|
||||||
stringRedisTemplate.delete(currentOrderKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 发送mq消息并保存库存记录
|
// 发送mq消息并保存库存记录
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("orderId", orderInfo.getId());
|
data.put("orderId", orderInfo.getId());
|
||||||
@@ -962,7 +922,7 @@ public class PayService {
|
|||||||
orderInfo.setPayOrderNo(payOrderNO);
|
orderInfo.setPayOrderNo(payOrderNO);
|
||||||
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
||||||
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||||
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(),"closed");
|
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("token", 0);
|
jsonObject.put("token", 0);
|
||||||
@@ -980,13 +940,6 @@ public class PayService {
|
|||||||
sendOrderToClient(orderInfo);
|
sendOrderToClient(orderInfo);
|
||||||
redisUtil.deleteByKey(RedisCst.ORDER_EXPIRED.concat(orderInfo.getId().toString()));
|
redisUtil.deleteByKey(RedisCst.ORDER_EXPIRED.concat(orderInfo.getId().toString()));
|
||||||
|
|
||||||
// 为代客下单清楚当前台桌最新订单
|
|
||||||
String currentOrderKey = RedisCst.getCurrentOrderKey(orderInfo.getTableId(), orderInfo.getShopId());
|
|
||||||
String currentOrderId = stringRedisTemplate.opsForValue().get(currentOrderKey);
|
|
||||||
if (currentOrderId != null && currentOrderId.equals(orderInfo.getId().toString())) {
|
|
||||||
stringRedisTemplate.delete(currentOrderKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 发送mq消息并保存库存记录
|
// 发送mq消息并保存库存记录
|
||||||
JSONObject data = new JSONObject();
|
JSONObject data = new JSONObject();
|
||||||
data.put("orderId", orderInfo.getId());
|
data.put("orderId", orderInfo.getId());
|
||||||
@@ -1029,12 +982,7 @@ public class PayService {
|
|||||||
|
|
||||||
public Result getActivate(String shopId, int page, int pageSize) {
|
public Result getActivate(String shopId, int page, int pageSize) {
|
||||||
PageHelper.startPage(page, pageSize);
|
PageHelper.startPage(page, pageSize);
|
||||||
List<TbActivate> list = tbActivateMapper.selectByShopId(shopId);
|
List<TbActivate> list = tbActivateMapper.selectByShpopId(shopId);
|
||||||
for (TbActivate tbActivate : list) {
|
|
||||||
if (tbActivate.getIsGiftPro() == 1) {
|
|
||||||
tbActivate.setGives(actProductMapper.queryProsByActivateId(tbActivate.getId()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PageInfo pageInfo = new PageInfo(list);
|
PageInfo pageInfo = new PageInfo(list);
|
||||||
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
||||||
}
|
}
|
||||||
@@ -1130,59 +1078,43 @@ public class PayService {
|
|||||||
flow.setAmount(memberIn.getAmount());
|
flow.setAmount(memberIn.getAmount());
|
||||||
flow.setBalance(tbShopUser.getAmount());
|
flow.setBalance(tbShopUser.getAmount());
|
||||||
flow.setCreateTime(new Date());
|
flow.setCreateTime(new Date());
|
||||||
flow.setIsReturn("0");
|
|
||||||
tbShopUserFlowMapper.insert(flow);
|
tbShopUserFlowMapper.insert(flow);
|
||||||
//会员活动
|
TbActivate activate = tbActivateMapper.selectByAmount(tbShopUser.getShopId(), memberIn.getAmount());
|
||||||
giveActivate(tbShopUser,memberIn.getAmount(),flow.getId());
|
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
|
||||||
jsonObject.put("shopId", memberIn.getShopId());
|
|
||||||
jsonObject.put("type", "wxMemberIn");
|
|
||||||
jsonObject.put("amount", memberIn.getAmount());
|
|
||||||
producer.putOrderCollect(jsonObject.toJSONString());
|
|
||||||
return "success";
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal giveActivate(TbShopUser tbShopUser, BigDecimal memAmount,Integer flowId){
|
|
||||||
TbActivate activate = tbActivateMapper.selectByAmount(tbShopUser.getShopId(), memAmount);
|
|
||||||
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) {
|
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) {
|
||||||
if (activate.getIsGiftPro() != null && activate.getIsGiftPro() == 1) {
|
|
||||||
List<TbActivateProduct> tbActivateProducts = actProductMapper.queryAllByActivateId(activate.getId());
|
|
||||||
List<TbActivateInRecord> actGiveRecords = new ArrayList<>();
|
|
||||||
for (TbActivateProduct actPro : tbActivateProducts) {
|
|
||||||
TbActivateInRecord record = new TbActivateInRecord(Integer.valueOf(tbShopUser.getId()), actPro.getProductId(), actPro.getNum(), Integer.valueOf(tbShopUser.getShopId()), activate.getId(),flowId);
|
|
||||||
actGiveRecords.add(record);
|
|
||||||
}
|
|
||||||
activateInRecordMapper.insertBatch(actGiveRecords);
|
|
||||||
}
|
|
||||||
BigDecimal amount = BigDecimal.ZERO;
|
BigDecimal amount = BigDecimal.ZERO;
|
||||||
switch (activate.getHandselType()) {
|
switch (activate.getHandselType()) {
|
||||||
case "GD":
|
case "GD":
|
||||||
amount = activate.getHandselNum();
|
amount = activate.getHandselNum();
|
||||||
break;
|
break;
|
||||||
case "RATIO":
|
case "RATIO":
|
||||||
amount = memAmount.multiply(activate.getHandselNum());
|
amount = memberIn.getAmount().multiply(activate.getHandselNum());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tbShopUser.setAmount(tbShopUser.getAmount().add(amount));
|
tbShopUser.setAmount(tbShopUser.getAmount().add(amount));
|
||||||
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
||||||
tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser);
|
tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser);
|
||||||
|
|
||||||
TbShopUserFlow flow = new TbShopUserFlow();
|
flow = new TbShopUserFlow();
|
||||||
flow.setShopUserId(Integer.valueOf(tbShopUser.getId()));
|
flow.setShopUserId(Integer.valueOf(tbShopUser.getId()));
|
||||||
flow.setBizCode("scanMemberAwardIn");
|
flow.setBizCode("scanMemberAwardIn");
|
||||||
flow.setBizName("充值活动奖励");
|
flow.setBizName("会员充值奖励");
|
||||||
flow.setType("+");
|
flow.setType("+");
|
||||||
flow.setAmount(amount);
|
flow.setAmount(amount);
|
||||||
flow.setBalance(tbShopUser.getAmount());
|
flow.setBalance(tbShopUser.getAmount());
|
||||||
flow.setCreateTime(new Date());
|
flow.setCreateTime(new Date());
|
||||||
flow.setIsReturn("0");
|
|
||||||
tbShopUserFlowMapper.insert(flow);
|
tbShopUserFlowMapper.insert(flow);
|
||||||
return amount;
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("shopId", memberIn.getShopId());
|
||||||
|
jsonObject.put("type", "wxMemberIn");
|
||||||
|
jsonObject.put("amount", memberIn.getAmount());
|
||||||
|
producer.putOrderCollect(jsonObject.toJSONString());
|
||||||
|
|
||||||
|
}
|
||||||
|
return "success";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1228,28 +1160,42 @@ public class PayService {
|
|||||||
flow.setAmount(memberIn.getAmount());
|
flow.setAmount(memberIn.getAmount());
|
||||||
flow.setBalance(tbShopUser.getAmount());
|
flow.setBalance(tbShopUser.getAmount());
|
||||||
flow.setCreateTime(new Date());
|
flow.setCreateTime(new Date());
|
||||||
flow.setRemark(payOrderNO);
|
|
||||||
flow.setIsReturn("0");
|
|
||||||
tbShopUserFlowMapper.insert(flow);
|
tbShopUserFlowMapper.insert(flow);
|
||||||
//会员活动
|
|
||||||
BigDecimal awardAmount= giveActivate(tbShopUser,memberIn.getAmount(),flow.getId());
|
TbActivate activate = tbActivateMapper.selectByAmount(tbShopUser.getShopId(), memberIn.getAmount());
|
||||||
|
if (ObjectUtil.isNotEmpty(activate) && ObjectUtil.isNotNull(activate)) {
|
||||||
|
BigDecimal amount = BigDecimal.ZERO;
|
||||||
|
switch (activate.getHandselType()) {
|
||||||
|
case "GD":
|
||||||
|
amount = activate.getHandselNum();
|
||||||
|
break;
|
||||||
|
case "RATIO":
|
||||||
|
amount = memberIn.getAmount().multiply(activate.getHandselNum());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tbShopUser.setAmount(tbShopUser.getAmount().add(amount));
|
||||||
|
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
||||||
|
tbShopUserMapper.updateByPrimaryKeySelective(tbShopUser);
|
||||||
|
|
||||||
|
flow = new TbShopUserFlow();
|
||||||
|
flow.setShopUserId(Integer.valueOf(tbShopUser.getId()));
|
||||||
|
flow.setBizCode("scanMemberAwardIn");
|
||||||
|
flow.setType("+");
|
||||||
|
flow.setBizName("充值活动奖励");
|
||||||
|
flow.setAmount(amount);
|
||||||
|
flow.setBalance(tbShopUser.getAmount());
|
||||||
|
flow.setCreateTime(new Date());
|
||||||
|
tbShopUserFlowMapper.insert(flow);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("shopId", memberIn.getShopId());
|
jsonObject.put("shopId", memberIn.getShopId());
|
||||||
jsonObject.put("type", "wxMemberIn");
|
jsonObject.put("type", "wxMemberIn");
|
||||||
jsonObject.put("amount", memberIn.getAmount());
|
jsonObject.put("amount", memberIn.getAmount());
|
||||||
producer.putOrderCollect(jsonObject.toJSONString());
|
producer.putOrderCollect(jsonObject.toJSONString());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
JSONObject baObj=new JSONObject();
|
|
||||||
baObj.put("userId", tbShopUser.getUserId());
|
|
||||||
baObj.put("shopId",tbShopUser.getShopId());
|
|
||||||
baObj.put("amount",ObjectUtil.isNull(awardAmount)?memberIn.getAmount():memberIn.getAmount().add(awardAmount));
|
|
||||||
baObj.put("balance",tbShopUser.getAmount());
|
|
||||||
baObj.put("type","充值");
|
|
||||||
baObj.put("time",flow.getCreateTime());
|
|
||||||
producer.balance(baObj.toString());
|
|
||||||
|
|
||||||
return "SUCCESS";
|
return "SUCCESS";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,14 +75,6 @@ public class ProductService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TbUserInfoMapper tbUserInfoMapper;
|
private TbUserInfoMapper tbUserInfoMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TbProskuConMapper tbProskuConMapper;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private TbConsInfoMapper tbConsInfoMapper;
|
|
||||||
@Resource
|
|
||||||
private TbActivateInRecordService activateInRecordService;
|
|
||||||
|
|
||||||
public Result queryShopIdByTableCode(String userId, String openId, String code, String lat, String lng) {
|
public Result queryShopIdByTableCode(String userId, String openId, String code, String lat, String lng) {
|
||||||
if (StringUtils.isBlank(code)) return Result.fail("桌码信息为空");
|
if (StringUtils.isBlank(code)) return Result.fail("桌码信息为空");
|
||||||
if (StringUtils.isBlank(lat) || lat.equals("undefined")) {
|
if (StringUtils.isBlank(lat) || lat.equals("undefined")) {
|
||||||
@@ -144,41 +136,32 @@ public class ProductService {
|
|||||||
return Result.success(CodeEnum.SUCCESS, concurrentMap);
|
return Result.success(CodeEnum.SUCCESS, concurrentMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Result queryProduct(String userId,String shopId, String productGroupId) {
|
public Result queryProduct(String shopId, String productGroupId) {
|
||||||
ConcurrentMap<String, Object> concurrentMap = new ConcurrentHashMap<>();
|
ConcurrentMap<String, Object> concurrentMap = new ConcurrentHashMap<>();
|
||||||
Integer id = ObjectUtil.isNotEmpty(productGroupId) ? Integer.valueOf(productGroupId) : null;
|
Integer id = ObjectUtil.isNotEmpty(productGroupId) ? Integer.valueOf(productGroupId) : null;
|
||||||
//招牌菜
|
//招牌菜
|
||||||
List<TbProduct> tbProducts = tbProductMapper.selectIsSpecialty(Integer.valueOf(shopId));
|
List<TbProduct> tbProducts = tbProductMapper.selectIsSpecialty(Integer.valueOf(shopId));
|
||||||
concurrentMap.put("hots", handleDate(tbProducts,true,1,false));
|
concurrentMap.put("hots", handleDate(tbProducts,true,1));
|
||||||
List<TbProductGroup> groupList = tbProductGroupMapper.selectByShopId(shopId, id);
|
List<TbProductGroup> groupList = tbProductGroupMapper.selectByShopId(shopId, id);
|
||||||
if (ObjectUtil.isNotEmpty(groupList) && groupList.size() > 0) {
|
if (ObjectUtil.isNotEmpty(groupList) && groupList.size() > 0) {
|
||||||
//热销
|
//热销
|
||||||
TbProductGroup hot = new TbProductGroup();
|
TbProductGroup hot = new TbProductGroup();
|
||||||
hot.setName("热销");
|
hot.setName("热销");
|
||||||
List<TbProduct> hots = tbProductMapper.selectHot(shopId);
|
List<TbProduct> hots = tbProductMapper.selectHot(shopId);
|
||||||
hot.setProducts(handleDate(hots,true,1,false));
|
hot.setProducts(handleDate(hots,true,1));
|
||||||
//商品
|
//商品
|
||||||
groupList.parallelStream().forEach(g -> {
|
groupList.parallelStream().forEach(g -> {
|
||||||
if (g.getUseTime()==1) g.setIsSale(getIsSale(g.getSaleStartTime(),g.getSaleEndTime()));
|
if (g.getUseTime()==1) g.setIsSale(getIsSale(g.getSaleStartTime(),g.getSaleEndTime()));
|
||||||
String in = g.getProductIds().substring(1, g.getProductIds().length() - 1);
|
String in = g.getProductIds().substring(1, g.getProductIds().length() - 1);
|
||||||
if (ObjectUtil.isNotEmpty(in) && ObjectUtil.isNotNull(in)) {
|
if (ObjectUtil.isNotEmpty(in) && ObjectUtil.isNotNull(in)) {
|
||||||
|
// List<TbProduct> products = tbProductMapper.selectByIdIn(in);
|
||||||
List<TbProduct> products = tbProductMapper.selectByIdInAndCheck(in);
|
List<TbProduct> products = tbProductMapper.selectByIdInAndCheck(in);
|
||||||
g.setProducts(handleDate(products,false,g.getIsSale(),false));
|
g.setProducts(handleDate(products,false,g.getIsSale()));
|
||||||
} else {
|
} else {
|
||||||
g.setProducts(new ArrayList<>());
|
g.setProducts(new ArrayList<>());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
groupList.sort(Comparator.comparingInt(TbProductGroup::getIsSale).reversed());
|
groupList.sort(Comparator.comparingInt(TbProductGroup::getIsSale).reversed());
|
||||||
TbShopUser tbShopUser = tbShopUserMapper.selectByUserIdAndShopId(userId, shopId);
|
|
||||||
if (tbShopUser != null) {
|
|
||||||
TbProductGroup vipProGroup = new TbProductGroup();
|
|
||||||
vipProGroup.setName("会员商品");
|
|
||||||
List<TbProduct> vipPros = activateInRecordService.queryByVipIdAndShopId(Integer.valueOf(tbShopUser.getId()), Integer.valueOf(shopId));
|
|
||||||
if(!CollectionUtils.isEmpty(vipPros)){
|
|
||||||
vipProGroup.setProducts(handleDate(vipPros, true, 1, true));
|
|
||||||
groupList.add(0, vipProGroup);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
groupList.add(0, hot);
|
groupList.add(0, hot);
|
||||||
concurrentMap.put("productInfo", groupList);
|
concurrentMap.put("productInfo", groupList);
|
||||||
}
|
}
|
||||||
@@ -233,8 +216,7 @@ public class ProductService {
|
|||||||
|
|
||||||
// 重组有效规格数据
|
// 重组有效规格数据
|
||||||
String tagSnap = skuResult != null ? skuResult.getTagSnap() : null;
|
String tagSnap = skuResult != null ? skuResult.getTagSnap() : null;
|
||||||
// List<TbProductSku> tbProductSkus = tbProductSkuMapper.selectGroundingByProId(querySpecDTO.getProductId());
|
List<TbProductSku> tbProductSkus = tbProductSkuMapper.selectGroundingByProId(querySpecDTO.getProductId());
|
||||||
List<TbProductSku> tbProductSkus = tbProductSkuMapper.selectSku(String.valueOf(querySpecDTO.getProductId()));
|
|
||||||
|
|
||||||
JSONArray finalSnap = new JSONArray();
|
JSONArray finalSnap = new JSONArray();
|
||||||
// if (tagSnap != null) {
|
// if (tagSnap != null) {
|
||||||
@@ -316,17 +298,11 @@ public class ProductService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<HashMap<String, Object>> specList = new ArrayList<>();
|
ArrayList<HashMap<String, Object>> specList = new ArrayList<>();
|
||||||
HashMap<String, TbProductSku> unGroundingMap = new HashMap<>();
|
|
||||||
tbProductSkus.forEach(item -> {
|
tbProductSkus.forEach(item -> {
|
||||||
if (item.getIsGrounding() == 1) {
|
HashMap<String, Object> itemMap = new HashMap<>();
|
||||||
HashMap<String, Object> itemMap = new HashMap<>();
|
itemMap.put("specSnap", item.getSpecSnap());
|
||||||
itemMap.put("specSnap", item.getSpecSnap());
|
itemMap.put("skuId", item.getId());
|
||||||
itemMap.put("skuId", item.getId());
|
specList.add(itemMap);
|
||||||
itemMap.put("info", item);
|
|
||||||
specList.add(itemMap);
|
|
||||||
}else {
|
|
||||||
unGroundingMap.put(item.getSpecSnap(), item);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -336,14 +312,6 @@ public class ProductService {
|
|||||||
for (HashMap<String, Object> spec : specList) {
|
for (HashMap<String, Object> spec : specList) {
|
||||||
if (res.equals(spec.get("specSnap").toString())) {
|
if (res.equals(spec.get("specSnap").toString())) {
|
||||||
spec.put("isGrounding", true);
|
spec.put("isGrounding", true);
|
||||||
TbProductSku sku = (TbProductSku) spec.get("info");
|
|
||||||
if (sku != null) {
|
|
||||||
tbProduct.setIsPauseSale(tbProduct.getIsDistribute() == 1 ? tbProduct.getIsPauseSale() : sku.getIsPauseSale().byteValue());
|
|
||||||
checkPauseSale(tbProduct, new ArrayList<>(Collections.singletonList(sku)), true);
|
|
||||||
spec.put("isPauseSale", tbProduct.getIsPauseSale());
|
|
||||||
}else {
|
|
||||||
spec.put("isPauseSale", 1);
|
|
||||||
}
|
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -353,14 +321,6 @@ public class ProductService {
|
|||||||
itemMap.put("specSnap", res);
|
itemMap.put("specSnap", res);
|
||||||
itemMap.put("skuId", null);
|
itemMap.put("skuId", null);
|
||||||
itemMap.put("isGrounding", false);
|
itemMap.put("isGrounding", false);
|
||||||
TbProductSku sku = unGroundingMap.get("specSnap");
|
|
||||||
if (sku != null) {
|
|
||||||
tbProduct.setIsPauseSale(tbProduct.getIsDistribute() == 1 ? tbProduct.getIsPauseSale() : sku.getIsPauseSale().byteValue());
|
|
||||||
checkPauseSale(tbProduct, Collections.singletonList(sku), true);
|
|
||||||
itemMap.put("isPauseSale", tbProduct.getIsPauseSale());
|
|
||||||
}else {
|
|
||||||
itemMap.put("isPauseSale", 1);
|
|
||||||
}
|
|
||||||
otherVal.add(itemMap);
|
otherVal.add(itemMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -387,7 +347,7 @@ public class ProductService {
|
|||||||
* @param check 是否校验可售
|
* @param check 是否校验可售
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<TbProduct> handleDate(List<TbProduct> products,boolean check,Integer isSale,boolean isVip){
|
public List<TbProduct> handleDate(List<TbProduct> products,boolean check,Integer isSale){
|
||||||
if (!CollectionUtils.isEmpty(products)) {
|
if (!CollectionUtils.isEmpty(products)) {
|
||||||
products.parallelStream().forEach(it -> {
|
products.parallelStream().forEach(it -> {
|
||||||
if(check){
|
if(check){
|
||||||
@@ -409,11 +369,12 @@ public class ProductService {
|
|||||||
it.setCartNumber("0");
|
it.setCartNumber("0");
|
||||||
List<TbProductSku> tbProductSkus = tbProductSkuMapper.selectGroundingByProId(it.getId());
|
List<TbProductSku> tbProductSkus = tbProductSkuMapper.selectGroundingByProId(it.getId());
|
||||||
TbProductSkuResult skuResult = tbProductSkuResultMapper.selectByPrimaryKey(it.getId());
|
TbProductSkuResult skuResult = tbProductSkuResultMapper.selectByPrimaryKey(it.getId());
|
||||||
//判断库存及耗材
|
|
||||||
checkPauseSale(it,tbProductSkus, false);
|
|
||||||
|
|
||||||
|
// 上下架对应的sku
|
||||||
|
// HashSet<String> specSet = new HashSet<>();
|
||||||
AtomicDouble sum = new AtomicDouble(0.0);
|
AtomicDouble sum = new AtomicDouble(0.0);
|
||||||
BigDecimal lowerPrice = null;
|
BigDecimal lowerPrice = null;
|
||||||
|
BigDecimal lowMemberPrice = null;
|
||||||
for (TbProductSku item : tbProductSkus) {
|
for (TbProductSku item : tbProductSkus) {
|
||||||
if (item.getRealSalesNumber() != null) {
|
if (item.getRealSalesNumber() != null) {
|
||||||
sum.addAndGet(item.getRealSalesNumber());
|
sum.addAndGet(item.getRealSalesNumber());
|
||||||
@@ -421,19 +382,25 @@ public class ProductService {
|
|||||||
if (lowerPrice == null || lowerPrice.compareTo(item.getSalePrice()) > 0) {
|
if (lowerPrice == null || lowerPrice.compareTo(item.getSalePrice()) > 0) {
|
||||||
lowerPrice = item.getSalePrice();
|
lowerPrice = item.getSalePrice();
|
||||||
}
|
}
|
||||||
|
if (lowMemberPrice == null || lowMemberPrice.compareTo(item.getMemberPrice()) > 0) {
|
||||||
|
lowMemberPrice = item.getMemberPrice();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//销量
|
// 销量
|
||||||
it.setStockNumber(sum.intValue());
|
it.setStockNumber(sum.intValue());
|
||||||
|
|
||||||
|
// 售价
|
||||||
if (lowerPrice == null) {
|
if (lowerPrice == null) {
|
||||||
lowerPrice = BigDecimal.ZERO;
|
lowerPrice = BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
//售价
|
|
||||||
it.setLowPrice(lowerPrice);
|
it.setLowPrice(lowerPrice);
|
||||||
it.setProductSkuResult(skuResult);
|
|
||||||
if (isVip) {
|
// 会员价
|
||||||
it.setLowPrice(BigDecimal.ZERO);
|
if (lowMemberPrice == null) {
|
||||||
it.setIsVip(Byte.parseByte("1"));
|
lowMemberPrice = BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
|
it.setLowMemberPrice(lowMemberPrice);
|
||||||
|
it.setProductSkuResult(skuResult);
|
||||||
});
|
});
|
||||||
return products;
|
return products;
|
||||||
}else {
|
}else {
|
||||||
@@ -441,63 +408,9 @@ public class ProductService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkPauseSale(TbProduct tbProduct, List<TbProductSku> skus, boolean isSingle) {
|
|
||||||
if (tbProduct.getIsStock() == 1) {//库存开关 1开启
|
|
||||||
if (Integer.valueOf(tbProduct.getIsDistribute()).equals(1)) {//共享库存 1开启
|
|
||||||
if (tbProduct.getStockNumber() != null && tbProduct.getStockNumber() <= 0) {
|
|
||||||
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isSingle && tbProduct.getIsPauseSale() == 1) {
|
public Result queryProductSku(String code, String shopId, String productId, String spec_tag) {
|
||||||
return;
|
if (ObjectUtil.isEmpty(shopId) || ObjectUtil.isEmpty(productId)) {
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (isSingle && !skus.stream().filter(res -> res.getIsPauseSale().equals(1)).collect(Collectors.toList()).isEmpty()) {
|
|
||||||
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!tbProduct.getTypeEnum().equals("sku")) {
|
|
||||||
if (skus.stream().anyMatch(sku -> sku.getStockNumber() != null && sku.getStockNumber() <= 0)){
|
|
||||||
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
skus.removeIf(sku -> sku.getStockNumber() != null && sku.getStockNumber() <= 0);
|
|
||||||
if (CollectionUtils.isEmpty(skus)) {
|
|
||||||
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Iterator<TbProductSku> iterator = skus.iterator();
|
|
||||||
while (iterator.hasNext()) {
|
|
||||||
TbProductSku tbProductSku = iterator.next();
|
|
||||||
List<TbProskuCon> proskuConList = tbProskuConMapper.selectByShopIdAndSkuIdAndProductId(Integer.valueOf(tbProductSku.getId()), Integer.valueOf(tbProductSku.getShopId()), Integer.valueOf(tbProductSku.getProductId()));
|
|
||||||
if (Objects.nonNull(proskuConList) && proskuConList.size() > 0) {
|
|
||||||
for (TbProskuCon proskuCon : proskuConList) {
|
|
||||||
if ("1".equals(proskuCon.getStatus())) {
|
|
||||||
TbConsInfo consInfo = tbConsInfoMapper.selectByPrimaryKey(proskuCon.getConInfoId());
|
|
||||||
if ("1".equals(consInfo.getIsCheck())) {
|
|
||||||
if (N.gt(proskuCon.getSurplusStock(), consInfo.getStockNumber().abs().subtract(consInfo.getStockConsume().abs()))) {
|
|
||||||
iterator.remove();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (CollectionUtils.isEmpty(skus)) {
|
|
||||||
tbProduct.setIsPauseSale(Byte.parseByte("1"));//售罄 1暂停
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public Result queryProductSku(String code, String shopId, String productId, String spec_tag,String isVip) {
|
|
||||||
if (ObjectUtil.isEmpty(shopId) || ObjectUtil.isEmpty(productId) || StringUtils.isEmpty(isVip)|| isVip.equals("undefined") ) {
|
|
||||||
return Result.fail("参数错误");
|
return Result.fail("参数错误");
|
||||||
}
|
}
|
||||||
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByShopIdAndProductIdAndSpec(shopId, productId, spec_tag);
|
TbProductSkuWithBLOBs tbProductSkuWithBLOBs = tbProductSkuMapper.selectByShopIdAndProductIdAndSpec(shopId, productId, spec_tag);
|
||||||
@@ -510,7 +423,7 @@ public class ProductService {
|
|||||||
tbProductSkuWithBLOBs.setId(null);
|
tbProductSkuWithBLOBs.setId(null);
|
||||||
}else {
|
}else {
|
||||||
if (StringUtils.isNotBlank(code)) {
|
if (StringUtils.isNotBlank(code)) {
|
||||||
Integer sum = tbProductMapper.selectByCodeAndSkuId(code, tbProductSkuWithBLOBs.getId(), shopId,isVip);
|
Integer sum = tbProductMapper.selectByCodeAndSkuId(code, tbProductSkuWithBLOBs.getId(), shopId);
|
||||||
tbProductSkuWithBLOBs.setNumber(sum);
|
tbProductSkuWithBLOBs.setNumber(sum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateInRecord;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
import org.springframework.data.domain.PageRequest;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动商品赠送表(TbActivateInRecord)表服务接口
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-22 11:13:40
|
|
||||||
*/
|
|
||||||
public interface TbActivateInRecordService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateInRecord queryById(Integer id);
|
|
||||||
|
|
||||||
List<TbProduct> queryByVipIdAndShopId(Integer vipUserId, Integer shopId);
|
|
||||||
int queryByVipIdAndShopIdAndProId(Integer vipUserId, Integer shopId,Integer productId);
|
|
||||||
List<TbActivateInRecord> queryAllByVipIdAndShopIdAndProId(Integer vipUserId, Integer shopId,Integer productId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @param tbActivateInRecord 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateInRecord insert(TbActivateInRecord tbActivateInRecord);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改数据
|
|
||||||
*
|
|
||||||
* @param tbActivateInRecord 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateInRecord update(TbActivateInRecord tbActivateInRecord);
|
|
||||||
|
|
||||||
int updateOverNumById(Integer id,Integer overNum);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
boolean deleteById(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateOutRecord;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动赠送商品使用记录表(TbActivateOutRecord)表服务接口
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-22 11:21:56
|
|
||||||
*/
|
|
||||||
public interface TbActivateOutRecordService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateOutRecord queryById(Integer id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @param tbActivateOutRecord 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateOutRecord insert(TbActivateOutRecord tbActivateOutRecord);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改数据
|
|
||||||
*
|
|
||||||
* @param tbActivateOutRecord 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateOutRecord update(TbActivateOutRecord tbActivateOutRecord);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
boolean deleteById(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service;
|
|
||||||
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateProduct;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动赠送商品表(TbActivateProduct)表服务接口
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-20 15:15:01
|
|
||||||
*/
|
|
||||||
public interface TbActivateProductService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateProduct queryById(Integer id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @param tbActivateProduct 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateProduct insert(TbActivateProduct tbActivateProduct);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改数据
|
|
||||||
*
|
|
||||||
* @param tbActivateProduct 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
TbActivateProduct update(TbActivateProduct tbActivateProduct);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
boolean deleteById(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.dto.UserCouponDto;
|
|
||||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (TbUserCoupons)表服务接口
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-09-02 13:38:20
|
|
||||||
*/
|
|
||||||
public interface TbUserCouponsService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param tbUserCoupons 筛选条件
|
|
||||||
* @return 查询结果
|
|
||||||
*/
|
|
||||||
Result queryByPage(UserCouponDto tbUserCoupons);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service;
|
package com.chaozhanggui.system.cashierservice.service;
|
||||||
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||||
import cn.hutool.extra.qrcode.QrConfig;
|
import cn.hutool.extra.qrcode.QrConfig;
|
||||||
@@ -22,7 +21,6 @@ import com.chaozhanggui.system.cashierservice.wxUtil.WxAccountUtil;
|
|||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
||||||
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.core.io.Resource;
|
import org.springframework.core.io.Resource;
|
||||||
@@ -273,57 +271,25 @@ public class UserService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Result openMember(OpenMemberVo memberVo) {
|
public Result openMember(OpenMemberVo memberVo) {
|
||||||
TbShopUser tbShopUser = shopUserMapper.selectByUserIdAndShopId(memberVo.getId().toString(), memberVo.getShopId().toString());
|
TbUserInfo userInfo = new TbUserInfo();
|
||||||
if (tbShopUser != null) {
|
userInfo.setId(memberVo.getId());
|
||||||
tbShopUser.setName(StringUtils.isNotBlank(memberVo.getNickName()) ? memberVo.getNickName() : null);
|
userInfo.setHeadImg(memberVo.getHeadImg());
|
||||||
tbShopUser.setHeadImg(StringUtils.isNotBlank(memberVo.getHeadImg()) ? memberVo.getHeadImg() : null);
|
userInfo.setNickName(memberVo.getNickName());
|
||||||
|
userInfo.setTelephone(memberVo.getTelephone());
|
||||||
|
userInfo.setBirthDay(memberVo.getBirthDay());
|
||||||
|
userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
||||||
|
List<TbShopUser> tbShopUsers = shopUserMapper.selectAllByUserId(memberVo.getId().toString());
|
||||||
|
for (TbShopUser tbShopUser : tbShopUsers) {
|
||||||
tbShopUser.setTelephone(memberVo.getTelephone());
|
tbShopUser.setTelephone(memberVo.getTelephone());
|
||||||
tbShopUser.setBirthDay(StringUtils.isNotBlank(memberVo.getBirthDay()) ? memberVo.getBirthDay() : null);
|
shopUserMapper.updateByPrimaryKey(tbShopUser);
|
||||||
tbShopUser.setIsVip(Byte.parseByte("1"));
|
|
||||||
shopUserMapper.updateByPrimaryKeySelective(tbShopUser);
|
|
||||||
} else {
|
|
||||||
TbUserInfo tbUserInfo = userInfoMapper.selectByPrimaryKey(memberVo.getId());
|
|
||||||
tbShopUser = shopUserMapper.selectPCByPhoneAndShopId(memberVo.getTelephone(), memberVo.getShopId().toString());
|
|
||||||
if (tbShopUser != null) {
|
|
||||||
tbShopUser.setName(StringUtils.isNotBlank(memberVo.getNickName()) ? memberVo.getNickName() : null);
|
|
||||||
tbShopUser.setHeadImg(StringUtils.isNotBlank(memberVo.getHeadImg()) ? memberVo.getHeadImg() : null);
|
|
||||||
tbShopUser.setTelephone(memberVo.getTelephone());
|
|
||||||
tbShopUser.setBirthDay(StringUtils.isNotBlank(memberVo.getBirthDay()) ? memberVo.getBirthDay() : null);
|
|
||||||
tbShopUser.setUserId(tbUserInfo.getId().toString());
|
|
||||||
tbShopUser.setMiniOpenId(tbUserInfo.getMiniAppOpenId());
|
|
||||||
shopUserMapper.updateByPrimaryKeySelective(tbShopUser);
|
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
|
||||||
}
|
|
||||||
tbShopUser = new TbShopUser();
|
|
||||||
tbShopUser.setName(StringUtils.isNotBlank(memberVo.getNickName()) ? memberVo.getNickName() : null);
|
|
||||||
tbShopUser.setSex(Byte.parseByte("1"));
|
|
||||||
tbShopUser.setBirthDay(StringUtils.isNotBlank(memberVo.getBirthDay()) ? memberVo.getBirthDay() : null);
|
|
||||||
tbShopUser.setLevel(Byte.parseByte("1"));
|
|
||||||
String dynamicCode = RandomUtil.randomNumbers(8);
|
|
||||||
tbShopUser.setCode(dynamicCode);
|
|
||||||
tbShopUser.setTelephone(memberVo.getTelephone());
|
|
||||||
tbShopUser.setAmount(BigDecimal.ZERO);
|
|
||||||
tbShopUser.setIsVip(Byte.parseByte("1"));
|
|
||||||
tbShopUser.setCreditAmount(BigDecimal.ZERO);
|
|
||||||
tbShopUser.setConsumeAmount(BigDecimal.ZERO);
|
|
||||||
tbShopUser.setConsumeNumber(0);
|
|
||||||
tbShopUser.setLevelConsume(BigDecimal.ZERO);
|
|
||||||
tbShopUser.setStatus(Byte.parseByte("1"));
|
|
||||||
tbShopUser.setShopId(memberVo.getShopId().toString());
|
|
||||||
tbShopUser.setUserId(tbUserInfo.getId().toString());
|
|
||||||
tbShopUser.setMiniOpenId(tbUserInfo.getMiniAppOpenId());
|
|
||||||
tbShopUser.setCreatedAt(System.currentTimeMillis());
|
|
||||||
tbShopUser.setUpdatedAt(System.currentTimeMillis());
|
|
||||||
shopUserMapper.insertSelective(tbShopUser);
|
|
||||||
}
|
}
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
TbShopUser tbShopUser = shopUserMapper.selectByUserIdAndShopId(memberVo.getId().toString(), memberVo.getShopId().toString());
|
||||||
}
|
tbShopUser.setName(memberVo.getNickName());
|
||||||
|
tbShopUser.setHeadImg(memberVo.getHeadImg());
|
||||||
public Result upVipPhont(OpenMemberVo memberVo) {
|
tbShopUser.setTelephone(memberVo.getTelephone());
|
||||||
TbShopUser shopUser = new TbShopUser();
|
tbShopUser.setBirthDay(memberVo.getBirthDay());
|
||||||
shopUser.setId(memberVo.getId().toString());
|
tbShopUser.setIsVip(Byte.parseByte("1"));
|
||||||
shopUser.setTelephone(memberVo.getTelephone());
|
shopUserMapper.updateByPrimaryKey(tbShopUser);
|
||||||
shopUserMapper.updateByPrimaryKeySelective(shopUser);
|
|
||||||
return Result.success(CodeEnum.SUCCESS);
|
return Result.success(CodeEnum.SUCCESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,91 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service.impl;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbActivateInRecordMapper;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateInRecord;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbProduct;
|
|
||||||
import com.chaozhanggui.system.cashierservice.service.TbActivateInRecordService;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动商品赠送表(TbActivateInRecord)表服务实现类
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-22 11:13:40
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Primary
|
|
||||||
public class TbActivateInRecordServiceImpl implements TbActivateInRecordService {
|
|
||||||
@Resource
|
|
||||||
private TbActivateInRecordMapper tbActivateInRecordMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateInRecord queryById(Integer id) {
|
|
||||||
return this.tbActivateInRecordMapper.queryById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<TbProduct> queryByVipIdAndShopId(Integer vipUserId, Integer shopId) {
|
|
||||||
return tbActivateInRecordMapper.queryByVipIdAndShopId(vipUserId, shopId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int queryByVipIdAndShopIdAndProId(Integer vipUserId, Integer shopId,Integer productId){
|
|
||||||
return tbActivateInRecordMapper.queryByVipIdAndShopIdAndProId(vipUserId,shopId,productId);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<TbActivateInRecord> queryAllByVipIdAndShopIdAndProId(Integer vipUserId, Integer shopId,Integer productId){
|
|
||||||
return tbActivateInRecordMapper.queryAllByVipIdAndShopIdAndProId(vipUserId,shopId,productId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @param tbActivateInRecord 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateInRecord insert(TbActivateInRecord tbActivateInRecord) {
|
|
||||||
this.tbActivateInRecordMapper.insert(tbActivateInRecord);
|
|
||||||
return tbActivateInRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改数据
|
|
||||||
*
|
|
||||||
* @param tbActivateInRecord 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateInRecord update(TbActivateInRecord tbActivateInRecord) {
|
|
||||||
this.tbActivateInRecordMapper.update(tbActivateInRecord);
|
|
||||||
return this.queryById(tbActivateInRecord.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int updateOverNumById(Integer id,Integer overNum){
|
|
||||||
return tbActivateInRecordMapper.updateOverNumById(id,overNum);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean deleteById(Integer id) {
|
|
||||||
return this.tbActivateInRecordMapper.deleteById(id) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service.impl;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateOutRecord;
|
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbActivateOutRecordMapper;
|
|
||||||
import com.chaozhanggui.system.cashierservice.service.TbActivateOutRecordService;
|
|
||||||
import org.springframework.beans.factory.annotation.Qualifier;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动赠送商品使用记录表(TbActivateOutRecord)表服务实现类
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-22 11:21:56
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Primary
|
|
||||||
public class TbActivateOutRecordServiceImpl implements TbActivateOutRecordService {
|
|
||||||
@Resource
|
|
||||||
private TbActivateOutRecordMapper tbActivateOutRecordMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateOutRecord queryById(Integer id) {
|
|
||||||
return this.tbActivateOutRecordMapper.queryById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @param tbActivateOutRecord 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateOutRecord insert(TbActivateOutRecord tbActivateOutRecord) {
|
|
||||||
this.tbActivateOutRecordMapper.insert(tbActivateOutRecord);
|
|
||||||
return tbActivateOutRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改数据
|
|
||||||
*
|
|
||||||
* @param tbActivateOutRecord 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateOutRecord update(TbActivateOutRecord tbActivateOutRecord) {
|
|
||||||
this.tbActivateOutRecordMapper.update(tbActivateOutRecord);
|
|
||||||
return this.queryById(tbActivateOutRecord.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean deleteById(Integer id) {
|
|
||||||
return this.tbActivateOutRecordMapper.deleteById(id) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service.impl;
|
|
||||||
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.dao.TbActivateProductMapper;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbActivateProduct;
|
|
||||||
import com.chaozhanggui.system.cashierservice.service.TbActivateProductService;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动赠送商品表(TbActivateProduct)表服务实现类
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-08-20 15:15:02
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Primary
|
|
||||||
public class TbActivateProductServiceImpl implements TbActivateProductService {
|
|
||||||
@Resource
|
|
||||||
private TbActivateProductMapper tbActivateProductMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过ID查询单条数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateProduct queryById(Integer id) {
|
|
||||||
return this.tbActivateProductMapper.queryById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增数据
|
|
||||||
*
|
|
||||||
* @param tbActivateProduct 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateProduct insert(TbActivateProduct tbActivateProduct) {
|
|
||||||
this.tbActivateProductMapper.insert(tbActivateProduct);
|
|
||||||
return tbActivateProduct;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改数据
|
|
||||||
*
|
|
||||||
* @param tbActivateProduct 实例对象
|
|
||||||
* @return 实例对象
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TbActivateProduct update(TbActivateProduct tbActivateProduct) {
|
|
||||||
this.tbActivateProductMapper.update(tbActivateProduct);
|
|
||||||
return this.queryById(tbActivateProduct.getId());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过主键删除数据
|
|
||||||
*
|
|
||||||
* @param id 主键
|
|
||||||
* @return 是否成功
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean deleteById(Integer id) {
|
|
||||||
return this.tbActivateProductMapper.deleteById(id) > 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
package com.chaozhanggui.system.cashierservice.service.impl;
|
|
||||||
|
|
||||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.dto.UserCouponDto;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo;
|
|
||||||
import com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo;
|
|
||||||
import com.chaozhanggui.system.cashierservice.service.TbUserCouponsService;
|
|
||||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
|
||||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.context.annotation.Primary;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (TbUserCoupons)表服务实现类
|
|
||||||
*
|
|
||||||
* @author ww
|
|
||||||
* @since 2024-09-02 13:38:20
|
|
||||||
*/
|
|
||||||
@Primary
|
|
||||||
@Service
|
|
||||||
public class TbUserCouponsServiceImpl implements TbUserCouponsService {
|
|
||||||
@Resource
|
|
||||||
private TbUserCouponsMapper tbUserCouponsMapper;
|
|
||||||
@Resource
|
|
||||||
private TbActivateInRecordMapper inRecordMapper;
|
|
||||||
@Resource
|
|
||||||
private TbActivateOutRecordMapper outRecordMapper;
|
|
||||||
@Autowired
|
|
||||||
private TbShopUserMapper tbShopUserMapper;
|
|
||||||
@Autowired
|
|
||||||
private TbShopInfoMapper tbShopInfoMapper;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
* @return 查询结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Result queryByPage(UserCouponDto couponDto) {
|
|
||||||
// PageHelper.startPage(couponDto.getPage(), couponDto.getSize());
|
|
||||||
// List<TbUserCoupons> result = tbUserCouponsMapper.queryAllSelective(couponDto);
|
|
||||||
// return new Result(CodeEnum.SUCCESS, new PageInfo<>(result));
|
|
||||||
// List<UserCouponVo> result = tbUserCouponsMapper.queryAllSelective(couponDto);
|
|
||||||
List<UserCouponVo> result = new ArrayList<>();
|
|
||||||
List<ShopUserListVo> tbShopUsers = tbShopUserMapper.selectByUserId(couponDto.getUserId().toString(), couponDto.getShopId()==null?null:couponDto.getShopId().toString());
|
|
||||||
if (!CollectionUtils.isEmpty(tbShopUsers)) {
|
|
||||||
tbShopUsers.forEach(s -> {
|
|
||||||
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(s.getShopId().intValue());
|
|
||||||
if (couponDto.getStatus()==null || (couponDto.getStatus() != null && couponDto.getStatus() == 0)) {
|
|
||||||
List<UserCouponVo> unuseCoupon = inRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue(),shopInfo.getShopName());
|
|
||||||
result.addAll(unuseCoupon);
|
|
||||||
}
|
|
||||||
if (couponDto.getStatus()==null || (couponDto.getStatus() != null && couponDto.getStatus() == 1)) {
|
|
||||||
List<UserCouponVo> useCoupon = outRecordMapper.queryVipPro(s.getMemberId().intValue(), s.getShopId().intValue(),shopInfo.getShopName());
|
|
||||||
result.addAll(useCoupon);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Result(CodeEnum.SUCCESS, result);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2,7 +2,6 @@ package com.chaozhanggui.system.cashierservice.util;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
|
import com.chaozhanggui.system.cashierservice.model.OrderDetailPO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
@@ -15,7 +14,6 @@ import java.util.*;
|
|||||||
/**
|
/**
|
||||||
* 打印机
|
* 打印机
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
|
||||||
public class PrinterUtils {
|
public class PrinterUtils {
|
||||||
//请求地址
|
//请求地址
|
||||||
private static final String URL_STR = "https://ioe.car900.com/v1/openApi/dev/customPrint.json";
|
private static final String URL_STR = "https://ioe.car900.com/v1/openApi/dev/customPrint.json";
|
||||||
@@ -85,41 +83,6 @@ public class PrinterUtils {
|
|||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 厨房打印机
|
|
||||||
*
|
|
||||||
* @param pickupNumber
|
|
||||||
* @param date
|
|
||||||
* @param productName
|
|
||||||
* @param number
|
|
||||||
* @param remark
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static String getPrintData(String type, String pickupNumber, String date, String productName, Integer number, String remark) {
|
|
||||||
StringBuilder builder = new StringBuilder();
|
|
||||||
if ("return".equals(type)) {
|
|
||||||
builder.append("<C><B>" + pickupNumber + "【退】</B></C><BR><BR>");
|
|
||||||
} else {
|
|
||||||
builder.append("<C><B>" + pickupNumber + "</B></C><BR><BR>");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
builder.append("<S><L>时间: " + date + " </L></S><BR><BR><BR>");
|
|
||||||
|
|
||||||
if (productName.length() > 4 || remark.length() > 4) {
|
|
||||||
builder.append("<CS:32>" + productName + " " + number + "</CS><BR>");
|
|
||||||
builder.append("<CS:32>" + remark + " </CS><BR>");
|
|
||||||
} else {
|
|
||||||
builder.append("<B>" + productName + " " + number + "</B><BR>");
|
|
||||||
builder.append("<B>" + remark + " </B><BR>");
|
|
||||||
}
|
|
||||||
builder.append("<OUT:150>");
|
|
||||||
builder.append("<PCUT>");
|
|
||||||
|
|
||||||
return builder.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String getCashPrintData(OrderDetailPO detailPO,String type){
|
public static String getCashPrintData(OrderDetailPO detailPO,String type){
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@@ -199,46 +162,7 @@ public class PrinterUtils {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打印票据
|
|
||||||
*
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public static void printTickets(String voiceJson, Integer actWay, Integer cn, String devName, String data) {
|
|
||||||
log.info("开始请求云享印,请求数据:{}, {}", voiceJson, data);
|
|
||||||
//设备名称
|
|
||||||
//行为方式 1:只打印数据 2:只播放信息 3:打印数据并播放信息
|
|
||||||
// actWay = 3;
|
|
||||||
// //打印联数
|
|
||||||
// int cn = 1;
|
|
||||||
//打印内容
|
|
||||||
//播报语音数据体,字段参考文档IOT_XY_API11001
|
|
||||||
String time = String.valueOf(System.currentTimeMillis());
|
|
||||||
String uuid = UUID.randomUUID().toString();
|
|
||||||
|
|
||||||
Map<String, String> param = getToken(time, uuid);
|
|
||||||
//参数
|
|
||||||
MultiValueMap<String, Object> multiValueMap = new LinkedMultiValueMap<>();
|
|
||||||
multiValueMap.add("token", param.get("TOKEN"));
|
|
||||||
multiValueMap.add("devName", devName);
|
|
||||||
multiValueMap.add("actWay", actWay);
|
|
||||||
multiValueMap.add("cn", cn);
|
|
||||||
multiValueMap.add("data", data);
|
|
||||||
multiValueMap.add("voiceJson", voiceJson);
|
|
||||||
multiValueMap.add("appId", APP_ID);
|
|
||||||
multiValueMap.add("timestamp", time);
|
|
||||||
multiValueMap.add("requestId", uuid);
|
|
||||||
multiValueMap.add("userCode", USER_CODE);
|
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
|
||||||
HttpHeaders header = new HttpHeaders();
|
|
||||||
header.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
|
||||||
|
|
||||||
HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity<>(multiValueMap, header);
|
|
||||||
String httpResponse = restTemplate.postForObject(URL_STR,
|
|
||||||
httpEntity, String.class);
|
|
||||||
|
|
||||||
System.out.println("map" + httpResponse);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,189 +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.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="proId" column="pro_id" jdbcType="INTEGER"/>
|
|
||||||
<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="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
||||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id
|
|
||||||
, vip_user_id, pro_id, num, over_num, shop_id, source_act_id, source_flow_id, create_time, update_time </sql>
|
|
||||||
|
|
||||||
<!--查询单个-->
|
|
||||||
<select id="queryById" resultMap="TbActivateInRecordMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
|
|
||||||
from tb_activate_in_record
|
|
||||||
where id = #{id}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="queryByVipIdAndShopId" resultType="com.chaozhanggui.system.cashierservice.entity.TbProduct">
|
|
||||||
SELECT
|
|
||||||
tb_product.*, sum(tb_activate_in_record.over_num) as limitNumber
|
|
||||||
FROM
|
|
||||||
tb_activate_in_record
|
|
||||||
LEFT JOIN tb_product ON tb_activate_in_record.pro_id = tb_product.id
|
|
||||||
WHERE
|
|
||||||
vip_user_id = #{vipUserId} and tb_activate_in_record.shop_id = #{shopId}
|
|
||||||
group by tb_activate_in_record.pro_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="queryVipPro" resultType="com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo">
|
|
||||||
SELECT tb_product.name as detail,
|
|
||||||
0 as status,
|
|
||||||
sum(tb_activate_in_record.over_num) as num,
|
|
||||||
<choose>
|
|
||||||
<when test="shopName != null and shopName != ''">#{shopName}</when>
|
|
||||||
<otherwise>''</otherwise>
|
|
||||||
</choose> AS shopName,
|
|
||||||
2 as type
|
|
||||||
FROM tb_activate_in_record
|
|
||||||
LEFT JOIN tb_product ON tb_activate_in_record.pro_id = tb_product.id
|
|
||||||
WHERE vip_user_id = #{vipUserId}
|
|
||||||
and tb_activate_in_record.shop_id = #{shopId}
|
|
||||||
and num!=0
|
|
||||||
group by tb_activate_in_record.pro_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="queryByVipIdAndShopIdAndProId" resultType="INTEGER">
|
|
||||||
SELECT
|
|
||||||
sum(tb_activate_in_record.num)
|
|
||||||
FROM
|
|
||||||
tb_activate_in_record
|
|
||||||
WHERE
|
|
||||||
vip_user_id = #{vipUserId} and shop_id = #{shopId} and pro_id = #{productId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="queryAllByVipIdAndShopIdAndProId" resultMap="TbActivateInRecordMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
from tb_activate_in_record
|
|
||||||
WHERE
|
|
||||||
vip_user_id = #{vipUserId}
|
|
||||||
and shop_id = #{shopId}
|
|
||||||
and pro_id = #{productId}
|
|
||||||
and over_num > 0
|
|
||||||
order by create_time
|
|
||||||
</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="proId != null">
|
|
||||||
and pro_id = #{proId}
|
|
||||||
</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="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_in_record(vip_user_id, pro_id, num, over_num, shop_id, source_act_id, source_flow_id,
|
|
||||||
create_time, update_time)
|
|
||||||
values (#{vipUserId}, #{proId}, #{num}, #{overNum}, #{shopId}, #{sourceActId}, #{sourceFlowId}, #{createTime},
|
|
||||||
#{updateTime})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
||||||
insert into tb_activate_in_record(vip_user_id, pro_id, num, over_num, shop_id, source_act_id, source_flow_id,
|
|
||||||
create_time, update_time)
|
|
||||||
values
|
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
|
||||||
(#{entity.vipUserId}, #{entity.proId}, #{entity.num}, #{entity.overNum}, #{entity.shopId},
|
|
||||||
#{entity.sourceActId}, #{entity.sourceFlowId}, #{entity.createTime}, #{entity.updateTime})
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<!--通过主键修改数据-->
|
|
||||||
<update id="update">
|
|
||||||
update tb_activate_in_record
|
|
||||||
<set>
|
|
||||||
<if test="vipUserId != null">
|
|
||||||
vip_user_id = #{vipUserId},
|
|
||||||
</if>
|
|
||||||
<if test="proId != null">
|
|
||||||
pro_id = #{proId},
|
|
||||||
</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="createTime != null">
|
|
||||||
create_time = #{createTime},
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time = #{updateTime},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id}
|
|
||||||
</update>
|
|
||||||
<update id="updateOverNumById">
|
|
||||||
update tb_activate_in_record
|
|
||||||
set
|
|
||||||
over_num = #{overNum}
|
|
||||||
where id = #{id};
|
|
||||||
</update>
|
|
||||||
|
|
||||||
|
|
||||||
<!--通过主键删除-->
|
|
||||||
<delete id="deleteById">
|
|
||||||
delete
|
|
||||||
from tb_activate_in_record
|
|
||||||
where id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
|
|
||||||
@@ -9,10 +9,9 @@
|
|||||||
<result column="handsel_num" jdbcType="DECIMAL" property="handselNum" />
|
<result column="handsel_num" jdbcType="DECIMAL" property="handselNum" />
|
||||||
<result column="handsel_type" jdbcType="VARCHAR" property="handselType" />
|
<result column="handsel_type" jdbcType="VARCHAR" property="handselType" />
|
||||||
<result column="is_del" jdbcType="VARCHAR" property="isDel" />
|
<result column="is_del" jdbcType="VARCHAR" property="isDel" />
|
||||||
<result column="is_gift_pro" jdbcType="INTEGER" property="isGiftPro" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, shop_id, min_num, max_num, handsel_num, handsel_type, is_del,is_gift_pro
|
id, shop_id, min_num, max_num, handsel_num, handsel_type, is_del
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
@@ -117,16 +116,10 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<select id="selectByAmount" resultMap="BaseResultMap">
|
<select id="selectByAmount" resultMap="BaseResultMap">
|
||||||
select *
|
select * from tb_activate where shop_id=#{shopId} and is_del=0 and min_num <= #{amount} and max_num >= #{amount}
|
||||||
from tb_activate
|
</select>
|
||||||
where shop_id = #{shopId}
|
|
||||||
and is_del = 0
|
|
||||||
and min_num <= #{amount}
|
|
||||||
and max_num >= #{amount}
|
|
||||||
order by max_num desc limit 1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectByShopId" resultMap="BaseResultMap">
|
<select id="selectByShpopId" resultMap="BaseResultMap">
|
||||||
select * from tb_activate where shop_id=#{shopId}
|
select * from tb_activate where shop_id=#{shopId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,149 +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.TbActivateOutRecordMapper">
|
|
||||||
|
|
||||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbActivateOutRecord" id="TbActivateOutRecordMap">
|
|
||||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
||||||
<result property="giveId" column="give_id" jdbcType="INTEGER"/>
|
|
||||||
<result property="proId" column="pro_id" jdbcType="INTEGER"/>
|
|
||||||
<result property="useNum" column="use_num" jdbcType="INTEGER"/>
|
|
||||||
<result property="refNum" column="ref_num" jdbcType="INTEGER"/>
|
|
||||||
<result property="orderId" column="order_id" jdbcType="VARCHAR"/>
|
|
||||||
<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
|
|
||||||
, give_id, pro_id, use_num, ref_num, order_id,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="queryVipPro" resultType="com.chaozhanggui.system.cashierservice.entity.vo.UserCouponVo">
|
|
||||||
SELECT tb_product.NAME AS detail,
|
|
||||||
1 AS status,
|
|
||||||
tb_activate_out_record.use_num AS num,
|
|
||||||
<choose>
|
|
||||||
<when test="shopName != null and shopName != ''">#{shopName}</when>
|
|
||||||
<otherwise>''</otherwise>
|
|
||||||
</choose>
|
|
||||||
AS shopName,
|
|
||||||
2 AS type
|
|
||||||
FROM tb_activate_out_record
|
|
||||||
LEFT JOIN tb_product ON tb_activate_out_record.pro_id = tb_product.id
|
|
||||||
LEFT JOIN tb_activate_in_record ON tb_activate_in_record.id = tb_activate_out_record.give_id
|
|
||||||
WHERE vip_user_id = #{vipUserId}
|
|
||||||
AND tb_activate_in_record.shop_id = #{shopId}
|
|
||||||
AND tb_activate_out_record.STATUS = 'closed'
|
|
||||||
</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="giveId != null">
|
|
||||||
and give_id = #{giveId}
|
|
||||||
</if>
|
|
||||||
<if test="proId != null">
|
|
||||||
and pro_id = #{proId}
|
|
||||||
</if>
|
|
||||||
<if test="useNum != null">
|
|
||||||
and use_num = #{useNum}
|
|
||||||
</if>
|
|
||||||
<if test="refNum != null">
|
|
||||||
and ref_num = #{refNum}
|
|
||||||
</if>
|
|
||||||
<if test="orderId != null and orderId != ''">
|
|
||||||
and order_id = #{orderId}
|
|
||||||
</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(give_id, pro_id, use_num, ref_num, order_id, status, create_time, update_time)
|
|
||||||
values (#{giveId}, #{proId}, #{useNum}, #{refNum}, #{orderId}, #{status} #{createTime}, #{updateTime})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
||||||
insert into tb_activate_out_record(give_id, pro_id, use_num, ref_num, order_id, status, create_time, update_time)
|
|
||||||
values
|
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
|
||||||
(#{entity.giveId}, #{entity.proId}, #{entity.useNum}, #{entity.refNum}, #{entity.orderId},
|
|
||||||
#{entity.status}, #{entity.createTime}, #{entity.updateTime})
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<!--通过主键修改数据-->
|
|
||||||
<update id="update">
|
|
||||||
update tb_activate_out_record
|
|
||||||
<set>
|
|
||||||
<if test="giveId != null">
|
|
||||||
give_id = #{giveId},
|
|
||||||
</if>
|
|
||||||
<if test="proId != null">
|
|
||||||
pro_id = #{proId},
|
|
||||||
</if>
|
|
||||||
<if test="useNum != null">
|
|
||||||
use_num = #{useNum},
|
|
||||||
</if>
|
|
||||||
<if test="refNum != null">
|
|
||||||
ref_num = #{refNum},
|
|
||||||
</if>
|
|
||||||
<if test="orderId != null and orderId != ''">
|
|
||||||
order_id = #{orderId},
|
|
||||||
</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>
|
|
||||||
<update id="updateByOrderIdAndStatus">
|
|
||||||
update tb_activate_out_record
|
|
||||||
set
|
|
||||||
status = 'closed'
|
|
||||||
where order_id = #{orderId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
|
|
||||||
<!--通过主键删除-->
|
|
||||||
<delete id="deleteById">
|
|
||||||
delete
|
|
||||||
from tb_activate_out_record
|
|
||||||
where id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
|
|
||||||
@@ -1,113 +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.TbActivateProductMapper">
|
|
||||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbActivateProduct" id="TbActivateProductMap">
|
|
||||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
||||||
<result property="activateId" column="activate_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, activate_id, product_id, num, create_time, update_time </sql>
|
|
||||||
|
|
||||||
<!--查询单个-->
|
|
||||||
<select id="queryById" resultMap="TbActivateProductMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
|
|
||||||
from tb_activate_product
|
|
||||||
where id = #{id}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!--查询指定行数据-->
|
|
||||||
<select id="queryAll" resultMap="TbActivateProductMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
|
|
||||||
from tb_activate_product
|
|
||||||
<where>
|
|
||||||
<if test="id != null">
|
|
||||||
and id = #{id}
|
|
||||||
</if>
|
|
||||||
<if test="activateId != null">
|
|
||||||
and activate_id = #{activateId}
|
|
||||||
</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>
|
|
||||||
|
|
||||||
<select id="queryAllByActivateId" resultMap="TbActivateProductMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
from tb_activate_product
|
|
||||||
where
|
|
||||||
activate_id = #{activateId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="queryProsByActivateId" resultType="java.lang.String">
|
|
||||||
select CONCAT(tb_product.name, '*', SUM(tb_activate_product.num))
|
|
||||||
from tb_activate_product
|
|
||||||
LEFT JOIN tb_product ON tb_activate_product.product_id = tb_product.id
|
|
||||||
where activate_id = #{activateId}
|
|
||||||
group by tb_activate_product.product_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
<!--新增所有列-->
|
|
||||||
<insert id="insert" keyProperty="id" useGeneratedKeys="true">
|
|
||||||
insert into tb_activate_product(activate_id, product_id, num, create_time, update_time)
|
|
||||||
values (#{activateId}, #{productId}, #{num}, #{createTime}, #{updateTime})
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
|
|
||||||
insert into tb_activate_product(activate_id, product_id, num, create_time, update_time)
|
|
||||||
values
|
|
||||||
<foreach collection="entities" item="entity" separator=",">
|
|
||||||
(#{entity.activateId}, #{entity.productId}, #{entity.num}, #{entity.createTime}, #{entity.updateTime})
|
|
||||||
</foreach>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<!--通过主键修改数据-->
|
|
||||||
<update id="update">
|
|
||||||
update tb_activate_product
|
|
||||||
<set>
|
|
||||||
<if test="activateId != null">
|
|
||||||
activate_id = #{activateId},
|
|
||||||
</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_activate_product where id = #{id}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
|
|
||||||
@@ -33,12 +33,11 @@
|
|||||||
<result column="pending_at" jdbcType="BIGINT" property="pendingAt"/>
|
<result column="pending_at" jdbcType="BIGINT" property="pendingAt"/>
|
||||||
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
|
<result column="uuid" jdbcType="VARCHAR" property="uuid"/>
|
||||||
<result column="sku_name" jdbcType="VARCHAR" property="skuName"/>
|
<result column="sku_name" jdbcType="VARCHAR" property="skuName"/>
|
||||||
<result column="is_vip" jdbcType="TINYINT" property="isVip" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, master_id, order_id, ref_order_id, total_amount, product_id, cover_img, is_sku,pack_fee,is_pack,is_gift,pending_at,
|
id, master_id, order_id, ref_order_id, total_amount, product_id, cover_img, is_sku,pack_fee,is_pack,is_gift,pending_at,
|
||||||
sku_id, name, sale_price, number, total_number, refund_number, category_id, status,
|
sku_id, name, sale_price, number, total_number, refund_number, category_id, status,
|
||||||
type, merchant_id, shop_id, created_at, updated_at, user_id, table_id,pack_fee,trade_day,uuid,sku_name,is_vip
|
type, merchant_id, shop_id, created_at, updated_at, user_id, table_id,pack_fee,trade_day,uuid,sku_name
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
@@ -97,28 +96,25 @@
|
|||||||
<delete id="deleteBymasterId">
|
<delete id="deleteBymasterId">
|
||||||
delete from tb_cashier_cart where master_id = #{masterId} and shop_id = #{shopId} and status = #{status} and trade_day = #{day}
|
delete from tb_cashier_cart where master_id = #{masterId} and shop_id = #{shopId} and status = #{status} and trade_day = #{day}
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart"
|
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart" useGeneratedKeys="true" keyProperty="id">
|
||||||
useGeneratedKeys="true" keyProperty="id">
|
insert into tb_cashier_cart (id, master_id, order_id,
|
||||||
insert into tb_cashier_cart (id, master_id, order_id,
|
ref_order_id, total_amount, product_id,
|
||||||
ref_order_id, total_amount, product_id,
|
cover_img, is_sku, sku_id,
|
||||||
cover_img, is_sku, sku_id,
|
name, sale_price, number,
|
||||||
name, sale_price, number,
|
total_number, refund_number, category_id,
|
||||||
total_number, refund_number, category_id,
|
status, type, merchant_id,
|
||||||
status, type, merchant_id,
|
shop_id, created_at, updated_at, pack_fee,trade_day,is_pack,is_gift,table_id,user_id,sku_name
|
||||||
shop_id, created_at, updated_at, pack_fee, trade_day, is_pack, is_gift, table_id,
|
)
|
||||||
user_id, sku_name, is_vip)
|
values (#{id,jdbcType=INTEGER}, #{masterId,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR},
|
||||||
values (#{id,jdbcType=INTEGER}, #{masterId,jdbcType=VARCHAR}, #{orderId,jdbcType=VARCHAR},
|
#{refOrderId,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, #{productId,jdbcType=VARCHAR},
|
||||||
#{refOrderId,jdbcType=VARCHAR}, #{totalAmount,jdbcType=DECIMAL}, #{productId,jdbcType=VARCHAR},
|
#{coverImg,jdbcType=VARCHAR}, #{isSku,jdbcType=TINYINT}, #{skuId,jdbcType=VARCHAR},
|
||||||
#{coverImg,jdbcType=VARCHAR}, #{isSku,jdbcType=TINYINT}, #{skuId,jdbcType=VARCHAR},
|
#{name,jdbcType=VARCHAR}, #{salePrice,jdbcType=DECIMAL}, #{number,jdbcType=REAL},
|
||||||
#{name,jdbcType=VARCHAR}, #{salePrice,jdbcType=DECIMAL}, #{number,jdbcType=REAL},
|
#{totalNumber,jdbcType=REAL}, #{refundNumber,jdbcType=REAL}, #{categoryId,jdbcType=VARCHAR},
|
||||||
#{totalNumber,jdbcType=REAL}, #{refundNumber,jdbcType=REAL}, #{categoryId,jdbcType=VARCHAR},
|
#{status,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR},
|
||||||
#{status,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{merchantId,jdbcType=VARCHAR},
|
#{shopId,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT}, #{packFee,jdbcType=DECIMAL}
|
||||||
#{shopId,jdbcType=VARCHAR}, #{createdAt,jdbcType=BIGINT}, #{updatedAt,jdbcType=BIGINT},
|
, #{tradeDay,jdbcType=VARCHAR}, #{isPack,jdbcType=VARCHAR}, #{isGift,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{userId,jdbcType=INTEGER},#{skuName,jdbcType=VARCHAR}
|
||||||
#{packFee,jdbcType=DECIMAL}
|
)
|
||||||
, #{tradeDay,jdbcType=VARCHAR}, #{isPack,jdbcType=VARCHAR}, #{isGift,jdbcType=VARCHAR},
|
</insert>
|
||||||
#{tableId,jdbcType=VARCHAR}
|
|
||||||
, #{userId,jdbcType=INTEGER}, #{skuName,jdbcType=VARCHAR}, #{isVip,jdbcType=TINYINT})
|
|
||||||
</insert>
|
|
||||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbCashierCart">
|
||||||
insert into tb_cashier_cart
|
insert into tb_cashier_cart
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
@@ -185,9 +181,6 @@
|
|||||||
<if test="updatedAt != null">
|
<if test="updatedAt != null">
|
||||||
updated_at,
|
updated_at,
|
||||||
</if>
|
</if>
|
||||||
<if test="isVip != null">
|
|
||||||
is_vip,
|
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@@ -253,9 +246,6 @@
|
|||||||
<if test="updatedAt != null">
|
<if test="updatedAt != null">
|
||||||
#{updatedAt,jdbcType=BIGINT},
|
#{updatedAt,jdbcType=BIGINT},
|
||||||
</if>
|
</if>
|
||||||
<if test="isVip != null">
|
|
||||||
#{isVip,jdbcType=TINYINT},
|
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateByPrimaryKeySelective"
|
<update id="updateByPrimaryKeySelective"
|
||||||
@@ -334,9 +324,6 @@
|
|||||||
<if test="isGift != null">
|
<if test="isGift != null">
|
||||||
is_gift = #{isGift,jdbcType=BIGINT},
|
is_gift = #{isGift,jdbcType=BIGINT},
|
||||||
</if>
|
</if>
|
||||||
<if test="isVip != null">
|
|
||||||
is_vip = #{isVip,jdbcType=TINYINT},
|
|
||||||
</if>
|
|
||||||
<if test="isPack != null">
|
<if test="isPack != null">
|
||||||
is_pack = #{isPack,jdbcType=VARCHAR},
|
is_pack = #{isPack,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -1,194 +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.TbConsInfoMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
|
|
||||||
<id column="id" jdbcType="INTEGER" property="id" />
|
|
||||||
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
|
|
||||||
<result column="con_type_id" jdbcType="INTEGER" property="conTypeId" />
|
|
||||||
<result column="con_type_name" jdbcType="VARCHAR" property="conTypeName" />
|
|
||||||
<result column="con_code" jdbcType="VARCHAR" property="conCode" />
|
|
||||||
<result column="con_name" jdbcType="VARCHAR" property="conName" />
|
|
||||||
<result column="stock_number" jdbcType="DECIMAL" property="stockNumber" />
|
|
||||||
<result column="price" jdbcType="DECIMAL" property="price" />
|
|
||||||
<result column="stock_consume" jdbcType="DECIMAL" property="stockConsume" />
|
|
||||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
|
||||||
<result column="con_unit" jdbcType="VARCHAR" property="conUnit" />
|
|
||||||
<result column="laster_in_stock" jdbcType="DECIMAL" property="lasterInStock" />
|
|
||||||
<result column="con_warning" jdbcType="DECIMAL" property="conWarning" />
|
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
|
||||||
<result column="is_check" jdbcType="VARCHAR" property="isCheck" />
|
|
||||||
|
|
||||||
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id, shop_id, con_type_id, con_type_name, con_code, con_name, stock_number,price,stock_consume,status, con_unit,
|
|
||||||
laster_in_stock, con_warning, create_time, update_time,is_check
|
|
||||||
</sql>
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from tb_cons_info
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</select>
|
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
||||||
delete from tb_cons_info
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</delete>
|
|
||||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
|
|
||||||
insert into tb_cons_info (id, shop_id, con_type_id,
|
|
||||||
con_type_name, con_code, con_name,
|
|
||||||
stock_number, con_unit, laster_in_stock,
|
|
||||||
con_warning, create_time, update_time
|
|
||||||
)
|
|
||||||
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{conTypeId,jdbcType=INTEGER},
|
|
||||||
#{conTypeName,jdbcType=VARCHAR}, #{conCode,jdbcType=VARCHAR}, #{conName,jdbcType=VARCHAR},
|
|
||||||
#{stockNumber,jdbcType=DECIMAL}, #{conUnit,jdbcType=VARCHAR}, #{lasterInStock,jdbcType=DECIMAL},
|
|
||||||
#{conWarning,jdbcType=DECIMAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
|
|
||||||
insert into tb_cons_info
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
id,
|
|
||||||
</if>
|
|
||||||
<if test="shopId != null">
|
|
||||||
shop_id,
|
|
||||||
</if>
|
|
||||||
<if test="conTypeId != null">
|
|
||||||
con_type_id,
|
|
||||||
</if>
|
|
||||||
<if test="conTypeName != null">
|
|
||||||
con_type_name,
|
|
||||||
</if>
|
|
||||||
<if test="conCode != null">
|
|
||||||
con_code,
|
|
||||||
</if>
|
|
||||||
<if test="conName != null">
|
|
||||||
con_name,
|
|
||||||
</if>
|
|
||||||
<if test="stockNumber != null">
|
|
||||||
stock_number,
|
|
||||||
</if>
|
|
||||||
<if test="conUnit != null">
|
|
||||||
con_unit,
|
|
||||||
</if>
|
|
||||||
<if test="lasterInStock != null">
|
|
||||||
laster_in_stock,
|
|
||||||
</if>
|
|
||||||
<if test="conWarning != null">
|
|
||||||
con_warning,
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time,
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time,
|
|
||||||
</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="conTypeId != null">
|
|
||||||
#{conTypeId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="conTypeName != null">
|
|
||||||
#{conTypeName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="conCode != null">
|
|
||||||
#{conCode,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="conName != null">
|
|
||||||
#{conName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="stockNumber != null">
|
|
||||||
#{stockNumber,jdbcType=DECIMAL},
|
|
||||||
</if>
|
|
||||||
<if test="conUnit != null">
|
|
||||||
#{conUnit,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lasterInStock != null">
|
|
||||||
#{lasterInStock,jdbcType=DECIMAL},
|
|
||||||
</if>
|
|
||||||
<if test="conWarning != null">
|
|
||||||
#{conWarning,jdbcType=DECIMAL},
|
|
||||||
</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.TbConsInfo">
|
|
||||||
update tb_cons_info
|
|
||||||
<set>
|
|
||||||
<if test="shopId != null">
|
|
||||||
shop_id = #{shopId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="conTypeId != null">
|
|
||||||
con_type_id = #{conTypeId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="conTypeName != null">
|
|
||||||
con_type_name = #{conTypeName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="conCode != null">
|
|
||||||
con_code = #{conCode,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="conName != null">
|
|
||||||
con_name = #{conName,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="stockNumber != null">
|
|
||||||
stock_number = #{stockNumber,jdbcType=DECIMAL},
|
|
||||||
</if>
|
|
||||||
<if test="conUnit != null">
|
|
||||||
con_unit = #{conUnit,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="lasterInStock != null">
|
|
||||||
laster_in_stock = #{lasterInStock,jdbcType=DECIMAL},
|
|
||||||
</if>
|
|
||||||
<if test="conWarning != null">
|
|
||||||
con_warning = #{conWarning,jdbcType=DECIMAL},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</update>
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
|
|
||||||
update tb_cons_info
|
|
||||||
set shop_id = #{shopId,jdbcType=INTEGER},
|
|
||||||
con_type_id = #{conTypeId,jdbcType=INTEGER},
|
|
||||||
con_type_name = #{conTypeName,jdbcType=VARCHAR},
|
|
||||||
con_code = #{conCode,jdbcType=VARCHAR},
|
|
||||||
con_name = #{conName,jdbcType=VARCHAR},
|
|
||||||
stock_number = #{stockNumber,jdbcType=DECIMAL},
|
|
||||||
con_unit = #{conUnit,jdbcType=VARCHAR},
|
|
||||||
laster_in_stock = #{lasterInStock,jdbcType=DECIMAL},
|
|
||||||
con_warning = #{conWarning,jdbcType=DECIMAL},
|
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
||||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
|
||||||
stock_consume=#{stockConsume,jdbcType=DECIMAL}
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<select id="countAll" resultType="int">
|
|
||||||
select count(id) from tb_cons_info
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectAllInfo" resultType="com.chaozhanggui.system.cashierservice.entity.TbConsInfo">
|
|
||||||
select * from tb_cons_info order by id desc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -8,7 +8,6 @@
|
|||||||
<result column="product_id" jdbcType="INTEGER" property="productId"/>
|
<result column="product_id" jdbcType="INTEGER" property="productId"/>
|
||||||
<result column="product_sku_id" jdbcType="INTEGER" property="productSkuId"/>
|
<result column="product_sku_id" jdbcType="INTEGER" property="productSkuId"/>
|
||||||
<result column="num" jdbcType="INTEGER" property="num"/>
|
<result column="num" jdbcType="INTEGER" property="num"/>
|
||||||
<result column="is_vip" jdbcType="TINYINT" property="isVip" />
|
|
||||||
<result column="product_name" jdbcType="VARCHAR" property="productName"/>
|
<result column="product_name" jdbcType="VARCHAR" property="productName"/>
|
||||||
<result column="product_sku_name" jdbcType="VARCHAR" property="productSkuName"/>
|
<result column="product_sku_name" jdbcType="VARCHAR" property="productSkuName"/>
|
||||||
<result column="product_img" jdbcType="VARCHAR" property="productImg"/>
|
<result column="product_img" jdbcType="VARCHAR" property="productImg"/>
|
||||||
@@ -21,7 +20,7 @@
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, order_id, shop_id, product_id, product_sku_id, num, product_name, product_sku_name,
|
id, order_id, shop_id, product_id, product_sku_id, num, product_name, product_sku_name,
|
||||||
product_img, create_time, update_time, price, price_amount,status,pack_amount,is_vip
|
product_img, create_time, update_time, price, price_amount,status,pack_amount
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
@@ -44,12 +43,12 @@
|
|||||||
product_id, product_sku_id, num,
|
product_id, product_sku_id, num,
|
||||||
product_name, product_sku_name, product_img,
|
product_name, product_sku_name, product_img,
|
||||||
create_time, update_time, price,
|
create_time, update_time, price,
|
||||||
price_amount,pack_amount,status,is_vip)
|
price_amount,pack_amount,status)
|
||||||
values (#{id,jdbcType=INTEGER}, #{orderId,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER},
|
values (#{id,jdbcType=INTEGER}, #{orderId,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER},
|
||||||
#{productId,jdbcType=INTEGER}, #{productSkuId,jdbcType=INTEGER}, #{num,jdbcType=INTEGER},
|
#{productId,jdbcType=INTEGER}, #{productSkuId,jdbcType=INTEGER}, #{num,jdbcType=INTEGER},
|
||||||
#{productName,jdbcType=VARCHAR}, #{productSkuName,jdbcType=VARCHAR}, #{productImg,jdbcType=VARCHAR},
|
#{productName,jdbcType=VARCHAR}, #{productSkuName,jdbcType=VARCHAR}, #{productImg,jdbcType=VARCHAR},
|
||||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{price,jdbcType=DECIMAL},
|
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{price,jdbcType=DECIMAL},
|
||||||
#{priceAmount,jdbcType=DECIMAL},#{packAmount,jdbcType=DECIMAL},#{status,jdbcType=VARCHAR},#{isVip,jdbcType=TINYINT})
|
#{priceAmount,jdbcType=DECIMAL},#{packAmount,jdbcType=DECIMAL},#{status,jdbcType=VARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderDetail">
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderDetail">
|
||||||
insert into tb_order_detail
|
insert into tb_order_detail
|
||||||
@@ -93,9 +92,6 @@
|
|||||||
<if test="priceAmount != null">
|
<if test="priceAmount != null">
|
||||||
price_amount,
|
price_amount,
|
||||||
</if>
|
</if>
|
||||||
<if test="isVip != null">
|
|
||||||
is_vip,
|
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">
|
<if test="id != null">
|
||||||
@@ -137,9 +133,6 @@
|
|||||||
<if test="priceAmount != null">
|
<if test="priceAmount != null">
|
||||||
#{priceAmount,jdbcType=DECIMAL},
|
#{priceAmount,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
<if test="isVip != null">
|
|
||||||
#{isVip,jdbcType=TINYINT},
|
|
||||||
</if>
|
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
<update id="updateByPrimaryKeySelective"
|
<update id="updateByPrimaryKeySelective"
|
||||||
@@ -161,9 +154,6 @@
|
|||||||
<if test="num != null">
|
<if test="num != null">
|
||||||
num = #{num,jdbcType=INTEGER},
|
num = #{num,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="isVip != null">
|
|
||||||
is_vip = #{isVip,jdbcType=TINYINT},
|
|
||||||
</if>
|
|
||||||
<if test="productName != null">
|
<if test="productName != null">
|
||||||
product_name = #{productName,jdbcType=VARCHAR},
|
product_name = #{productName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@@ -207,7 +197,6 @@
|
|||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
update_time = #{updateTime,jdbcType=TIMESTAMP},
|
||||||
price = #{price,jdbcType=DECIMAL},
|
price = #{price,jdbcType=DECIMAL},
|
||||||
is_vip= #{isVip,jdbcType=TINYINT},
|
|
||||||
price_amount = #{priceAmount,jdbcType=DECIMAL}
|
price_amount = #{priceAmount,jdbcType=DECIMAL}
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
@@ -51,58 +51,53 @@
|
|||||||
<result column="out_number" jdbcType="VARCHAR" property="outNumber"/>
|
<result column="out_number" jdbcType="VARCHAR" property="outNumber"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, order_no, settlement_amount, pack_fee, origin_amount, product_amount, amount,
|
id, order_no, settlement_amount, pack_fee, origin_amount, product_amount, amount,
|
||||||
refund_amount, pay_type, pay_amount, order_amount, freight_amount, discount_ratio,
|
refund_amount, pay_type, pay_amount, order_amount, freight_amount, discount_ratio,
|
||||||
discount_amount, table_id, small_change, send_type, order_type, product_type, status,
|
discount_amount, table_id, small_change, send_type, order_type, product_type, status,
|
||||||
billing_id, merchant_id, shop_id, is_vip, member_id, user_id, product_score, deduct_score,
|
billing_id, merchant_id, shop_id, is_vip, member_id, user_id, product_score, deduct_score,
|
||||||
user_coupon_id, user_coupon_amount, refund_able, paid_time, is_effect, is_group,
|
user_coupon_id, user_coupon_amount, refund_able, paid_time, is_effect, is_group,
|
||||||
updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,
|
updated_at, `system_time`, created_at, is_accepted, pay_order_no,trade_day,`source`,
|
||||||
remark,master_id,`table_name`,is_buy_coupon,is_use_coupon,out_number
|
remark,master_id,`table_name`,is_buy_coupon,is_use_coupon,out_number
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
*
|
<include refid="Base_Column_List"/>
|
||||||
from tb_order_info
|
from tb_order_info
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</select>
|
</select>
|
||||||
<!-- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">-->
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
<!-- delete from tb_order_info-->
|
delete from tb_order_info
|
||||||
<!-- where id = #{id,jdbcType=INTEGER}-->
|
where id = #{id,jdbcType=INTEGER}
|
||||||
<!-- </delete>-->
|
</delete>
|
||||||
<update id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
||||||
update tb_order_info
|
|
||||||
set is_del = 1
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo"
|
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbOrderInfo"
|
||||||
useGeneratedKeys="true" keyProperty="id">
|
useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into tb_order_info (id, order_no, settlement_amount,
|
insert into tb_order_info (id, order_no, settlement_amount,
|
||||||
pack_fee, origin_amount, product_amount,
|
pack_fee, origin_amount, product_amount,
|
||||||
amount, refund_amount, pay_type,
|
amount, refund_amount, pay_type,
|
||||||
pay_amount, order_amount, freight_amount,
|
pay_amount, order_amount, freight_amount,
|
||||||
discount_ratio, discount_amount, table_id,
|
discount_ratio, discount_amount, table_id,
|
||||||
small_change, send_type, order_type,
|
small_change, send_type, order_type,
|
||||||
product_type, status, billing_id,
|
product_type, status, billing_id,
|
||||||
merchant_id, shop_id, is_vip,
|
merchant_id, shop_id, is_vip,
|
||||||
member_id, user_id, product_score,
|
member_id, user_id, product_score,
|
||||||
deduct_score, user_coupon_id, user_coupon_amount,
|
deduct_score, user_coupon_id, user_coupon_amount,
|
||||||
refund_able, paid_time, is_effect,
|
refund_able, paid_time, is_effect,
|
||||||
is_group, updated_at, system_time,
|
is_group, updated_at, system_time,
|
||||||
created_at, is_accepted, pay_order_no,trade_day,source,remark,master_id,table_name,is_buy_coupon,is_use_coupon,out_number
|
created_at, is_accepted, pay_order_no,trade_day,source,remark,master_id,table_name,is_buy_coupon,is_use_coupon,out_number
|
||||||
)
|
)
|
||||||
values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL},
|
values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{settlementAmount,jdbcType=DECIMAL},
|
||||||
#{packFee,jdbcType=DECIMAL}, #{originAmount,jdbcType=DECIMAL}, #{productAmount,jdbcType=DECIMAL},
|
#{packFee,jdbcType=DECIMAL}, #{originAmount,jdbcType=DECIMAL}, #{productAmount,jdbcType=DECIMAL},
|
||||||
#{amount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR},
|
#{amount,jdbcType=DECIMAL}, #{refundAmount,jdbcType=DECIMAL}, #{payType,jdbcType=VARCHAR},
|
||||||
#{payAmount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL},
|
#{payAmount,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, #{freightAmount,jdbcType=DECIMAL},
|
||||||
#{discountRatio,jdbcType=DECIMAL}, #{discountAmount,jdbcType=DECIMAL}, #{tableId,jdbcType=VARCHAR},
|
#{discountRatio,jdbcType=DECIMAL}, #{discountAmount,jdbcType=DECIMAL}, #{tableId,jdbcType=VARCHAR},
|
||||||
#{smallChange,jdbcType=DECIMAL}, #{sendType,jdbcType=VARCHAR}, #{orderType,jdbcType=VARCHAR},
|
#{smallChange,jdbcType=DECIMAL}, #{sendType,jdbcType=VARCHAR}, #{orderType,jdbcType=VARCHAR},
|
||||||
#{productType,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{billingId,jdbcType=VARCHAR},
|
#{productType,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{billingId,jdbcType=VARCHAR},
|
||||||
#{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{isVip,jdbcType=TINYINT},
|
#{merchantId,jdbcType=VARCHAR}, #{shopId,jdbcType=VARCHAR}, #{isVip,jdbcType=TINYINT},
|
||||||
#{memberId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{productScore,jdbcType=INTEGER},
|
#{memberId,jdbcType=VARCHAR}, #{userId,jdbcType=VARCHAR}, #{productScore,jdbcType=INTEGER},
|
||||||
#{deductScore,jdbcType=INTEGER}, #{userCouponId,jdbcType=VARCHAR}, #{userCouponAmount,jdbcType=DECIMAL},
|
#{deductScore,jdbcType=INTEGER}, #{userCouponId,jdbcType=VARCHAR}, #{userCouponAmount,jdbcType=DECIMAL},
|
||||||
#{refundAble,jdbcType=TINYINT}, #{paidTime,jdbcType=BIGINT}, #{isEffect,jdbcType=TINYINT},
|
#{refundAble,jdbcType=TINYINT}, #{paidTime,jdbcType=BIGINT}, #{isEffect,jdbcType=TINYINT},
|
||||||
#{isGroup,jdbcType=TINYINT}, #{updatedAt,jdbcType=BIGINT}, #{systemTime,jdbcType=BIGINT},
|
#{isGroup,jdbcType=TINYINT}, #{updatedAt,jdbcType=BIGINT}, #{systemTime,jdbcType=BIGINT},
|
||||||
#{createdAt,jdbcType=BIGINT}, #{isAccepted,jdbcType=TINYINT}, #{payOrderNo,jdbcType=VARCHAR},
|
#{createdAt,jdbcType=BIGINT}, #{isAccepted,jdbcType=TINYINT}, #{payOrderNo,jdbcType=VARCHAR},
|
||||||
#{tradeDay,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
|
#{tradeDay,jdbcType=VARCHAR}, #{source,jdbcType=INTEGER}, #{remark,jdbcType=VARCHAR},
|
||||||
#{masterId,jdbcType=VARCHAR}, #{tableName,jdbcType=VARCHAR}, #{isBuyCoupon,jdbcType=VARCHAR}, #{isUseCoupon,jdbcType=VARCHAR},#{outNumber,jdbcType=VARCHAR}
|
#{masterId,jdbcType=VARCHAR}, #{tableName,jdbcType=VARCHAR}, #{isBuyCoupon,jdbcType=VARCHAR}, #{isUseCoupon,jdbcType=VARCHAR},#{outNumber,jdbcType=VARCHAR}
|
||||||
@@ -491,10 +486,9 @@
|
|||||||
<if test="isBuyCoupon != null">
|
<if test="isBuyCoupon != null">
|
||||||
is_buy_coupon = #{isBuyCoupon,jdbcType=VARCHAR},
|
is_buy_coupon = #{isBuyCoupon,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="userId != null">
|
<if test="isUseCoupon != null">
|
||||||
user_id = #{userId,jdbcType=VARCHAR},
|
is_use_coupon = #{isUseCoupon,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
</set>
|
</set>
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</update>
|
||||||
@@ -555,7 +549,6 @@
|
|||||||
|
|
||||||
where user_id = #{userId}
|
where user_id = #{userId}
|
||||||
and order_type='miniapp'
|
and order_type='miniapp'
|
||||||
and is_del != 1
|
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
<choose>
|
<choose>
|
||||||
<when test="status == 'unpaid'">
|
<when test="status == 'unpaid'">
|
||||||
@@ -583,4 +576,4 @@
|
|||||||
left join tb_user_info tui on tui.id = toi.user_id
|
left join tb_user_info tui on tui.id = toi.user_id
|
||||||
where toi.user_id = #{userId}
|
where toi.user_id = #{userId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1009,7 +1009,6 @@
|
|||||||
AND t.sku_id = #{skuId}
|
AND t.sku_id = #{skuId}
|
||||||
AND t.`status` = 'create'
|
AND t.`status` = 'create'
|
||||||
AND t.table_id = #{code}
|
AND t.table_id = #{code}
|
||||||
AND t.is_vip = #{isVip}
|
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByNewQcode" resultType="java.lang.Integer">
|
<select id="selectByNewQcode" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -403,7 +403,7 @@
|
|||||||
FROM
|
FROM
|
||||||
tb_product_sku
|
tb_product_sku
|
||||||
WHERE
|
WHERE
|
||||||
product_id = #{productId} and is_del=0
|
product_id = #{productId}
|
||||||
</select>
|
</select>
|
||||||
<select id="selectSale" resultType="com.chaozhanggui.system.cashierservice.entity.vo.HomeVO">
|
<select id="selectSale" resultType="com.chaozhanggui.system.cashierservice.entity.vo.HomeVO">
|
||||||
SELECT
|
SELECT
|
||||||
|
|||||||
@@ -1,155 +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.TbProskuConMapper">
|
|
||||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
|
||||||
<id column="id" jdbcType="INTEGER" property="id" />
|
|
||||||
<result column="shop_id" jdbcType="INTEGER" property="shopId" />
|
|
||||||
<result column="product_id" jdbcType="INTEGER" property="productId" />
|
|
||||||
<result column="product_sku_id" jdbcType="INTEGER" property="productSkuId" />
|
|
||||||
<result column="con_info_id" jdbcType="INTEGER" property="conInfoId" />
|
|
||||||
<result column="surplus_stock" jdbcType="DECIMAL" property="surplusStock" />
|
|
||||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
||||||
</resultMap>
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id, shop_id,product_id ,product_sku_id, con_info_id, surplus_stock, status, create_time
|
|
||||||
</sql>
|
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List" />
|
|
||||||
from tb_prosku_con
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</select>
|
|
||||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
||||||
delete from tb_prosku_con
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</delete>
|
|
||||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
|
||||||
insert into tb_prosku_con (id, shop_id, product_sku_id,
|
|
||||||
con_info_id, surplus_stock, status,
|
|
||||||
create_time)
|
|
||||||
values (#{id,jdbcType=INTEGER}, #{shopId,jdbcType=INTEGER}, #{productSkuId,jdbcType=INTEGER},
|
|
||||||
#{conInfoId,jdbcType=INTEGER}, #{surplusStock,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR},
|
|
||||||
#{createTime,jdbcType=TIMESTAMP})
|
|
||||||
</insert>
|
|
||||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
|
||||||
insert into tb_prosku_con
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="id != null">
|
|
||||||
id,
|
|
||||||
</if>
|
|
||||||
<if test="shopId != null">
|
|
||||||
shop_id,
|
|
||||||
</if>
|
|
||||||
<if test="productSkuId != null">
|
|
||||||
product_sku_id,
|
|
||||||
</if>
|
|
||||||
<if test="conInfoId != null">
|
|
||||||
con_info_id,
|
|
||||||
</if>
|
|
||||||
<if test="surplusStock != null">
|
|
||||||
surplus_stock,
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
status,
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time,
|
|
||||||
</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="productSkuId != null">
|
|
||||||
#{productSkuId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="conInfoId != null">
|
|
||||||
#{conInfoId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="surplusStock != null">
|
|
||||||
#{surplusStock,jdbcType=DECIMAL},
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
#{status,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
#{createTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
<update id="updateByPrimaryKeySelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
|
||||||
update tb_prosku_con
|
|
||||||
<set>
|
|
||||||
<if test="shopId != null">
|
|
||||||
shop_id = #{shopId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="productSkuId != null">
|
|
||||||
product_sku_id = #{productSkuId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="conInfoId != null">
|
|
||||||
con_info_id = #{conInfoId,jdbcType=INTEGER},
|
|
||||||
</if>
|
|
||||||
<if test="surplusStock != null">
|
|
||||||
surplus_stock = #{surplusStock,jdbcType=DECIMAL},
|
|
||||||
</if>
|
|
||||||
<if test="status != null">
|
|
||||||
status = #{status,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
</set>
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</update>
|
|
||||||
<update id="updateByPrimaryKey" parameterType="com.chaozhanggui.system.cashierservice.entity.TbProskuCon">
|
|
||||||
update tb_prosku_con
|
|
||||||
set shop_id = #{shopId,jdbcType=INTEGER},
|
|
||||||
product_sku_id = #{productSkuId,jdbcType=INTEGER},
|
|
||||||
con_info_id = #{conInfoId,jdbcType=INTEGER},
|
|
||||||
surplus_stock = #{surplusStock,jdbcType=DECIMAL},
|
|
||||||
status = #{status,jdbcType=VARCHAR},
|
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
||||||
where id = #{id,jdbcType=INTEGER}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectBySkuIdAndShopId" resultMap="BaseResultMap">
|
|
||||||
select * from tb_prosku_con where product_sku_id=#{skuId} and shop_id=#{shopId} and status=1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectBySkuIdAndShopIdAngCheck" resultMap="BaseResultMap">
|
|
||||||
select a.* from tb_prosku_con as a
|
|
||||||
left join tb_cons_info as b on a.con_info_id=b.id
|
|
||||||
where a.product_sku_id=#{skuId} and a.shop_id=#{shopId} and a.status=1 and b.is_check=1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectIdBySkuIdAndShopId" resultType="java.lang.Integer">
|
|
||||||
SELECT
|
|
||||||
p.con_info_id
|
|
||||||
FROM
|
|
||||||
tb_prosku_con p
|
|
||||||
WHERE
|
|
||||||
p.shop_id = #{shopId}
|
|
||||||
AND p.product_sku_id = #{skuId}
|
|
||||||
AND p.`status` = 1
|
|
||||||
group by p.con_info_id
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectByShopIdAndSkuIdAndProductId" resultMap="BaseResultMap">
|
|
||||||
|
|
||||||
select * from tb_prosku_con where product_sku_id=#{skuId} and shop_id=#{shopId} and product_id=#{productId} and status=1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectByShopIdAndSkuIdAndProductIdAndCheck" resultMap="BaseResultMap">
|
|
||||||
|
|
||||||
select a.* from tb_prosku_con as a
|
|
||||||
left join tb_cons_info as b on a.con_info_id=b.id
|
|
||||||
where a.product_sku_id=#{skuId} and a.shop_id=#{shopId} and a.product_id=#{productId} and a.status=1 and b.is_check=1
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
@@ -1,72 +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.TbShopExtendMapper">
|
|
||||||
|
|
||||||
<resultMap type="com.chaozhanggui.system.cashierservice.entity.TbShopExtend" id="TbShopExtendMap">
|
|
||||||
<result property="id" column="id" jdbcType="INTEGER"/>
|
|
||||||
<result property="shopId" column="shop_id" jdbcType="INTEGER"/>
|
|
||||||
<result property="type" column="type" jdbcType="VARCHAR"/>
|
|
||||||
<result property="name" column="name" jdbcType="VARCHAR"/>
|
|
||||||
<result property="autokey" column="autoKey" jdbcType="VARCHAR"/>
|
|
||||||
<result property="value" column="value" jdbcType="VARCHAR"/>
|
|
||||||
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
|
|
||||||
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
|
||||||
id
|
|
||||||
, shop_id, type, name, autoKey, value, update_time, create_time </sql>
|
|
||||||
|
|
||||||
<!--查询单个-->
|
|
||||||
<select id="queryById" resultMap="TbShopExtendMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
|
|
||||||
from tb_shop_extend
|
|
||||||
where id = #{id}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="queryByShopIdAndAutoKey" resultMap="TbShopExtendMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
|
|
||||||
from tb_shop_extend
|
|
||||||
where shop_id = #{shopId} and autoKey = #{autokey}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!--查询指定行数据-->
|
|
||||||
<select id="queryAll" resultMap="TbShopExtendMap">
|
|
||||||
select
|
|
||||||
<include refid="Base_Column_List"/>
|
|
||||||
|
|
||||||
from tb_shop_extend
|
|
||||||
<where>
|
|
||||||
<if test="id != null">
|
|
||||||
and id = #{id}
|
|
||||||
</if>
|
|
||||||
<if test="shopId != null">
|
|
||||||
and shop_id = #{shopId}
|
|
||||||
</if>
|
|
||||||
<if test="type != null and type != ''">
|
|
||||||
and type = #{type}
|
|
||||||
</if>
|
|
||||||
<if test="name != null and name != ''">
|
|
||||||
and name = #{name}
|
|
||||||
</if>
|
|
||||||
<if test="autokey != null and autokey != ''">
|
|
||||||
and autoKey = #{autokey}
|
|
||||||
</if>
|
|
||||||
<if test="value != null and value != ''">
|
|
||||||
and value = #{value}
|
|
||||||
</if>
|
|
||||||
<if test="updateTime != null">
|
|
||||||
and update_time = #{updateTime}
|
|
||||||
</if>
|
|
||||||
<if test="createTime != null">
|
|
||||||
and create_time = #{createTime}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
|
|
||||||
@@ -10,11 +10,9 @@
|
|||||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
|
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||||
<result column="is_return" jdbcType="VARCHAR" property="isReturn" />
|
|
||||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, shop_user_id, amount, balance, biz_code, biz_name, create_time, type,is_return,remark
|
id, shop_user_id, amount, balance, biz_code, biz_name, create_time, type
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
@@ -26,13 +24,13 @@
|
|||||||
delete from tb_shop_user_flow
|
delete from tb_shop_user_flow
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
|
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow">
|
||||||
insert into tb_shop_user_flow (id, shop_user_id, amount,
|
insert into tb_shop_user_flow (id, shop_user_id, amount,
|
||||||
balance, biz_code, biz_name,
|
balance, biz_code, biz_name,
|
||||||
create_time, type,is_return,remark)
|
create_time, type)
|
||||||
values (#{id,jdbcType=INTEGER}, #{shopUserId,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL},
|
values (#{id,jdbcType=INTEGER}, #{shopUserId,jdbcType=INTEGER}, #{amount,jdbcType=DECIMAL},
|
||||||
#{balance,jdbcType=DECIMAL}, #{bizCode,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
#{balance,jdbcType=DECIMAL}, #{bizCode,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||||
#{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR},#{isReturn,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR})
|
#{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow">
|
<insert id="insertSelective" parameterType="com.chaozhanggui.system.cashierservice.entity.TbShopUserFlow">
|
||||||
insert into tb_shop_user_flow
|
insert into tb_shop_user_flow
|
||||||
|
|||||||
@@ -414,10 +414,6 @@
|
|||||||
select * from tb_shop_user where user_id=#{userId}
|
select * from tb_shop_user where user_id=#{userId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectVipByUserId" resultMap="BaseResultMap">
|
|
||||||
select * from tb_shop_user where user_id=#{userId} and is_vip = 1
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectByOpenId" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
<select id="selectByOpenId" resultType="com.chaozhanggui.system.cashierservice.entity.TbShopUser">
|
||||||
select * from tb_shop_user where mini_open_id = #{openId}
|
select * from tb_shop_user where mini_open_id = #{openId}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
<resultMap id="BaseResultMap" type="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||||
<id column="id" jdbcType="INTEGER" property="id" />
|
<id column="id" jdbcType="INTEGER" property="id" />
|
||||||
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
<result column="user_id" jdbcType="VARCHAR" property="userId" />
|
||||||
<result column="detail" jdbcType="VARCHAR" property="detail" />
|
|
||||||
<result column="coupons_price" jdbcType="DECIMAL" property="couponsPrice" />
|
<result column="coupons_price" jdbcType="DECIMAL" property="couponsPrice" />
|
||||||
<result column="coupons_amount" jdbcType="DECIMAL" property="couponsAmount" />
|
<result column="coupons_amount" jdbcType="DECIMAL" property="couponsAmount" />
|
||||||
<result column="status" jdbcType="VARCHAR" property="status" />
|
<result column="status" jdbcType="VARCHAR" property="status" />
|
||||||
@@ -14,7 +13,7 @@
|
|||||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, user_id, detail, coupons_price, coupons_amount, status, create_time, update_time, end_time,is_double
|
id, user_id, coupons_price, coupons_amount, status, create_time, update_time, end_time,is_double
|
||||||
</sql>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
@@ -22,21 +21,6 @@
|
|||||||
from tb_user_coupons
|
from tb_user_coupons
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryAllSelective" resultMap="BaseResultMap">
|
|
||||||
select
|
|
||||||
detail,coupons_price as couponsPrice,coupons_amount as couponsAmount,status,1 as num,0 as type
|
|
||||||
from tb_user_coupons
|
|
||||||
<where>
|
|
||||||
<if test="userId != null and userId != ''">
|
|
||||||
and user_id = #{userId}
|
|
||||||
</if>
|
|
||||||
<if test="status != null and status != ''">
|
|
||||||
and status = #{status}
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectByUserId" resultType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
<select id="selectByUserId" resultType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons">
|
||||||
select * from tb_user_coupons where user_id = #{userId}
|
select * from tb_user_coupons where user_id = #{userId}
|
||||||
<if test="status != null and status != ''">
|
<if test="status != null and status != ''">
|
||||||
@@ -60,10 +44,10 @@
|
|||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</delete>
|
</delete>
|
||||||
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insert" parameterType="com.chaozhanggui.system.cashierservice.entity.TbUserCoupons" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into tb_user_coupons (id, user_id, detail, coupons_price,
|
insert into tb_user_coupons (id, user_id, coupons_price,
|
||||||
coupons_amount, status, create_time,
|
coupons_amount, status, create_time,
|
||||||
update_time, end_time,is_double)
|
update_time, end_time,is_double)
|
||||||
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{detail,jdbcType=VARCHAR}, #{couponsPrice,jdbcType=DECIMAL},
|
values (#{id,jdbcType=INTEGER}, #{userId,jdbcType=VARCHAR}, #{couponsPrice,jdbcType=DECIMAL},
|
||||||
#{couponsAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
#{couponsAmount,jdbcType=DECIMAL}, #{status,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||||
#{updateTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{isDouble,jdbcType=VARCHAR})
|
#{updateTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP}, #{isDouble,jdbcType=VARCHAR})
|
||||||
</insert>
|
</insert>
|
||||||
@@ -76,9 +60,6 @@
|
|||||||
<if test="userId != null">
|
<if test="userId != null">
|
||||||
user_id,
|
user_id,
|
||||||
</if>
|
</if>
|
||||||
<if test="detail != null">
|
|
||||||
detail,
|
|
||||||
</if>
|
|
||||||
<if test="couponsPrice != null">
|
<if test="couponsPrice != null">
|
||||||
coupons_price,
|
coupons_price,
|
||||||
</if>
|
</if>
|
||||||
@@ -105,9 +86,6 @@
|
|||||||
<if test="userId != null">
|
<if test="userId != null">
|
||||||
#{userId,jdbcType=VARCHAR},
|
#{userId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="detail != null">
|
|
||||||
#{detail,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="couponsPrice != null">
|
<if test="couponsPrice != null">
|
||||||
#{couponsPrice,jdbcType=DECIMAL},
|
#{couponsPrice,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
@@ -134,9 +112,6 @@
|
|||||||
<if test="userId != null">
|
<if test="userId != null">
|
||||||
user_id = #{userId,jdbcType=VARCHAR},
|
user_id = #{userId,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="detail != null">
|
|
||||||
detail = #{detail,jdbcType=VARCHAR},
|
|
||||||
</if>
|
|
||||||
<if test="couponsPrice != null">
|
<if test="couponsPrice != null">
|
||||||
coupons_price = #{couponsPrice,jdbcType=DECIMAL},
|
coupons_price = #{couponsPrice,jdbcType=DECIMAL},
|
||||||
</if>
|
</if>
|
||||||
@@ -162,7 +137,6 @@
|
|||||||
update tb_user_coupons
|
update tb_user_coupons
|
||||||
set user_id = #{userId,jdbcType=VARCHAR},
|
set user_id = #{userId,jdbcType=VARCHAR},
|
||||||
coupons_price = #{couponsPrice,jdbcType=DECIMAL},
|
coupons_price = #{couponsPrice,jdbcType=DECIMAL},
|
||||||
detail = #{detail,jdbcType=VARCHAR},
|
|
||||||
coupons_amount = #{couponsAmount,jdbcType=DECIMAL},
|
coupons_amount = #{couponsAmount,jdbcType=DECIMAL},
|
||||||
status = #{status,jdbcType=VARCHAR},
|
status = #{status,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
|||||||
Reference in New Issue
Block a user