多余内容删除
This commit is contained in:
@@ -11,8 +11,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.ParseException;
|
||||
import java.util.Map;
|
||||
|
||||
@CrossOrigin(origins = "*")
|
||||
@@ -42,19 +40,6 @@ public class OrderController {
|
||||
// return orderService.createOrder(shopTable.getTableId(),shopTable.getShopId(),shopTable.getUserId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单回显
|
||||
* @param orderId
|
||||
* @return
|
||||
*/
|
||||
// @GetMapping ("/orderInfo")
|
||||
private Result orderInfo(@RequestParam(required = false) Integer orderId){
|
||||
if (orderId==null) {
|
||||
return Result.fail("请返回首页订单列表查看");
|
||||
}
|
||||
return orderService.orderInfo(orderId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 订单详情
|
||||
@@ -81,56 +66,4 @@ public class OrderController {
|
||||
}
|
||||
return orderService.rmOrder(Integer.valueOf(map.get("orderId").toString()));
|
||||
}
|
||||
|
||||
@GetMapping("/tradeIntegral")
|
||||
private Result tradeIntegral(@RequestParam("userId") String userId, @RequestParam("id") String id) throws IOException, ParseException {
|
||||
return orderService.tradeIntegral(userId,id);
|
||||
}
|
||||
// @GetMapping("/我的积分")
|
||||
// private Result mineYhq(@RequestParam("userId") String userId) throws IOException {
|
||||
// return orderService.mineYhq(userId);
|
||||
// }
|
||||
@GetMapping("/mineCoupons")
|
||||
private Result mineCoupons(@RequestHeader String token,
|
||||
@RequestParam("userId") String userId,
|
||||
@RequestParam("status") String status,
|
||||
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size,
|
||||
@RequestParam("orderId") String orderId
|
||||
) throws IOException {
|
||||
return orderService.mineCoupons(userId,orderId,status,page,size);
|
||||
}
|
||||
@GetMapping("/findCoupons")
|
||||
private Result findCoupons(@RequestHeader String token,String type,
|
||||
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size) throws IOException {
|
||||
return orderService.findCoupons(type,page,size);
|
||||
}
|
||||
|
||||
@GetMapping("/findWiningUser")
|
||||
private Result findWiningUser(){
|
||||
return orderService.findWiningUser();
|
||||
}
|
||||
@GetMapping("/mineWinner")
|
||||
private Result mineWinner(@RequestHeader String token,@RequestParam Integer userId,
|
||||
@RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
|
||||
@RequestParam(value = "size", required = false, defaultValue = "1") Integer size){
|
||||
return orderService.mineWinner(userId,page,size);
|
||||
}
|
||||
@GetMapping("/getYhqPara")
|
||||
private Result getYhqPara(){
|
||||
return orderService.getYhqPara();
|
||||
}
|
||||
@GetMapping("/getYhqDouble")
|
||||
private Result getYhqDouble(@RequestParam Integer orderId){
|
||||
return orderService.getYhqDouble(orderId);
|
||||
}
|
||||
@PostMapping("/yhqDouble")
|
||||
private Result yhqDouble(@RequestParam Integer conponsId){
|
||||
return orderService.yhqDouble(conponsId);
|
||||
}
|
||||
@GetMapping("/kc")
|
||||
private Result kc(){
|
||||
return orderService.kc();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -3,26 +3,21 @@ package com.chaozhanggui.system.cashierservice.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbUserInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopUser;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.IntegralFlowVo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.IntegralVo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.OpenMemberVo;
|
||||
import com.chaozhanggui.system.cashierservice.service.UserService;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.TokenUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@CrossOrigin(origins = "*")
|
||||
@@ -42,27 +37,6 @@ public class UserContoller {
|
||||
@Autowired
|
||||
private TbUserInfoMapper userInfoMapper;
|
||||
|
||||
// @GetMapping("/userInfo")
|
||||
// public JSONObject userInfo(@RequestParam("openId") String openId ) throws Exception {
|
||||
// TbUserInfo shopUser = userInfoMapper.selectByOpenId(openId);
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// if (Objects.isNull(shopUser)){
|
||||
// jsonObject.put("status","fail");
|
||||
// jsonObject.put("msg","用户不存在");
|
||||
// return jsonObject;
|
||||
// }
|
||||
// String userSign = UUID.randomUUID().toString().replaceAll("-","");
|
||||
// String token = TokenUtil.generateJfToken(openId,userSign);
|
||||
// JSONObject object = new JSONObject();
|
||||
// object.put("token",token);
|
||||
// object.put("userSign",userSign);
|
||||
// object.put("num",shopUser.getTotalScore());
|
||||
// jsonObject.put("status","success");
|
||||
// jsonObject.put("msg","成功");
|
||||
// jsonObject.put("data",object);
|
||||
// return jsonObject;
|
||||
// }
|
||||
|
||||
@PostMapping("/openMember")
|
||||
public Result openMember(@RequestBody OpenMemberVo memberVo){
|
||||
if(StringUtils.isBlank(memberVo.getTelephone())){
|
||||
@@ -138,41 +112,6 @@ public class UserContoller {
|
||||
return Result.success(CodeEnum.SUCCESS, shopUser);
|
||||
}
|
||||
|
||||
@GetMapping("/userCoupon")
|
||||
public Result userCoupon(@RequestParam("userId") String userId, @RequestParam("orderNum") BigDecimal orderNum) throws Exception {
|
||||
int num = userService.userCoupon(userId, orderNum);
|
||||
return Result.success(CodeEnum.SUCCESS, num);
|
||||
}
|
||||
|
||||
@PostMapping("/modityIntegral")
|
||||
public JSONObject modityIntegral(@RequestHeader String token, @RequestBody IntegralVo integralVo) throws Exception {
|
||||
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
|
||||
String userSign = jsonObject.getString("userSign");
|
||||
return userService.modityIntegral(integralVo, userSign);
|
||||
}
|
||||
|
||||
@PostMapping("/userIntegral")
|
||||
public JSONObject userIntegral(@RequestHeader String token, @RequestBody IntegralFlowVo integralFlowVo) throws Exception {
|
||||
JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
|
||||
String userSign = jsonObject.getString("userSign");
|
||||
return userService.userIntegral(integralFlowVo, userSign);
|
||||
}
|
||||
|
||||
@PostMapping("/userAllIntegral")
|
||||
public JSONObject userAllIntegral(@RequestBody IntegralFlowVo integralFlowVo) throws Exception {
|
||||
// JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
|
||||
// String userSign = jsonObject.getString("userSign");
|
||||
return userService.userAllIntegral(integralFlowVo, "userSign");
|
||||
}
|
||||
|
||||
@PostMapping("/userAll")
|
||||
public JSONObject userAll(@RequestBody IntegralFlowVo integralFlowVo) throws Exception {
|
||||
// JSONObject jsonObject = TokenUtil.parseParamFromToken(token);
|
||||
// String userSign = jsonObject.getString("userSign");
|
||||
return userService.userAll(integralFlowVo, "userSign");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取订阅当前用户店库存预警消息的二维码
|
||||
*
|
||||
|
||||
@@ -2,7 +2,6 @@ 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;
|
||||
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbDeviceOperateInfo;
|
||||
|
||||
public interface TbDeviceOperateInfoMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbDeviceOperateInfo record);
|
||||
|
||||
int insertSelective(TbDeviceOperateInfo record);
|
||||
|
||||
TbDeviceOperateInfo selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbDeviceOperateInfo record);
|
||||
|
||||
int updateByPrimaryKey(TbDeviceOperateInfo record);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbDeviceStock;
|
||||
|
||||
public interface TbDeviceStockMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbDeviceStock record);
|
||||
|
||||
int insertSelective(TbDeviceStock record);
|
||||
|
||||
TbDeviceStock selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbDeviceStock record);
|
||||
|
||||
int updateByPrimaryKey(TbDeviceStock record);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbIntegralFlow;
|
||||
|
||||
public interface TbIntegralFlowMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbIntegralFlow record);
|
||||
|
||||
int insertSelective(TbIntegralFlow record);
|
||||
|
||||
TbIntegralFlow selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbIntegralFlow record);
|
||||
|
||||
int updateByPrimaryKey(TbIntegralFlow record);
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbIntegral;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public interface TbIntegralMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbIntegral record);
|
||||
|
||||
int insertSelective(TbIntegral record);
|
||||
|
||||
TbIntegral selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbIntegral record);
|
||||
|
||||
int updateByPrimaryKey(TbIntegral record);
|
||||
|
||||
List<TbIntegral> selectAllByUserId(String userId);
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbMerchantCoupon;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 优惠券(TbMerchantCoupon)表数据库访问层
|
||||
*
|
||||
* @author lyf
|
||||
* @since 2024-04-02 09:24:16
|
||||
*/
|
||||
@Component
|
||||
@Mapper
|
||||
public interface TbMerchantCouponMapper {
|
||||
|
||||
/**
|
||||
* 通过ID查询单条数据
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 实例对象
|
||||
*/
|
||||
TbMerchantCoupon queryById(Integer id);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbParams;
|
||||
|
||||
public interface TbParamsMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbParams record);
|
||||
|
||||
int insertSelective(TbParams record);
|
||||
|
||||
TbParams selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbParams record);
|
||||
|
||||
int updateByPrimaryKey(TbParams record);
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbPlussDeviceGoods;
|
||||
|
||||
public interface TbPlussDeviceGoodsMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbPlussDeviceGoods record);
|
||||
|
||||
int insertSelective(TbPlussDeviceGoods record);
|
||||
|
||||
TbPlussDeviceGoods selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbPlussDeviceGoods record);
|
||||
|
||||
int updateByPrimaryKeyWithBLOBs(TbPlussDeviceGoods record);
|
||||
|
||||
int updateByPrimaryKey(TbPlussDeviceGoods record);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbReceiptSales;
|
||||
|
||||
public interface TbReceiptSalesMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbReceiptSales record);
|
||||
|
||||
int insertSelective(TbReceiptSales record);
|
||||
|
||||
TbReceiptSales selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbReceiptSales record);
|
||||
|
||||
int updateByPrimaryKey(TbReceiptSales record);
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbReleaseFlow;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbReleaseFlowMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbReleaseFlow record);
|
||||
|
||||
int insertSelective(TbReleaseFlow record);
|
||||
|
||||
TbReleaseFlow selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbReleaseFlow record);
|
||||
|
||||
int updateByPrimaryKey(TbReleaseFlow record);
|
||||
|
||||
List<TbReleaseFlow> selectByUserId(@Param("userId") String userId);
|
||||
|
||||
List<TbReleaseFlow> selectAll();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbRenewalsPayLog;
|
||||
|
||||
public interface TbRenewalsPayLogMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbRenewalsPayLog record);
|
||||
|
||||
int insertSelective(TbRenewalsPayLog record);
|
||||
|
||||
TbRenewalsPayLog selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbRenewalsPayLog record);
|
||||
|
||||
int updateByPrimaryKey(TbRenewalsPayLog record);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopCashSpread;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopCashSpreadWithBLOBs;
|
||||
|
||||
public interface TbShopCashSpreadMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbShopCashSpreadWithBLOBs record);
|
||||
|
||||
int insertSelective(TbShopCashSpreadWithBLOBs record);
|
||||
|
||||
TbShopCashSpreadWithBLOBs selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbShopCashSpreadWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKeyWithBLOBs(TbShopCashSpreadWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKey(TbShopCashSpread record);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopCurrency;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopCurrencyWithBLOBs;
|
||||
|
||||
public interface TbShopCurrencyMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbShopCurrencyWithBLOBs record);
|
||||
|
||||
int insertSelective(TbShopCurrencyWithBLOBs record);
|
||||
|
||||
TbShopCurrencyWithBLOBs selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbShopCurrencyWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKeyWithBLOBs(TbShopCurrencyWithBLOBs record);
|
||||
|
||||
int updateByPrimaryKey(TbShopCurrency record);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbParams;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopUser;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.ShopUserListVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -9,7 +8,6 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
@Mapper
|
||||
@@ -40,6 +38,4 @@ public interface TbShopUserMapper {
|
||||
List<ShopUserListVo> selectByUserId(@Param("userId") String userId, @Param("shopId") String shopId);
|
||||
|
||||
TbShopUser selectByOpenId(@Param("openId") String openId);
|
||||
|
||||
TbParams selectParams();
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbSplitAccounts;
|
||||
|
||||
public interface TbSplitAccountsMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbSplitAccounts record);
|
||||
|
||||
int insertSelective(TbSplitAccounts record);
|
||||
|
||||
TbSplitAccounts selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbSplitAccounts record);
|
||||
|
||||
int updateByPrimaryKey(TbSplitAccounts record);
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbSystemCoupons;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public interface TbSystemCouponsMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbSystemCoupons record);
|
||||
|
||||
int insertSelective(TbSystemCoupons record);
|
||||
|
||||
TbSystemCoupons selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbSystemCoupons record);
|
||||
|
||||
int updateByPrimaryKey(TbSystemCoupons record);
|
||||
|
||||
List<TbSystemCoupons> selectAll(@Param("type") String type);
|
||||
|
||||
int selectByAmount(@Param("orderNum") BigDecimal orderNum);
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
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.Param;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Mapper
|
||||
public interface TbUserCouponsMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbUserCoupons record);
|
||||
|
||||
int insertSelective(TbUserCoupons record);
|
||||
|
||||
TbUserCoupons selectByPrimaryKey(Integer id);
|
||||
List<UserCouponVo> queryAllSelective(UserCouponDto record);
|
||||
|
||||
int updateByPrimaryKeySelective(TbUserCoupons record);
|
||||
|
||||
int updateByPrimaryKey(TbUserCoupons record);
|
||||
|
||||
List<TbUserCoupons> selectByUserId(@Param("userId") String userId,@Param("status") String status,@Param("amount") BigDecimal amount);
|
||||
|
||||
TbUserCoupons selectByOrderId(@Param("orderId") Integer orderId);
|
||||
|
||||
int selectByUserIdAndAmount(@Param("userId") String userId, @Param("orderNum") BigDecimal orderNum);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbWiningParams;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbWiningParamsMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbWiningParams record);
|
||||
|
||||
int insertSelective(TbWiningParams record);
|
||||
|
||||
TbWiningParams selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbWiningParams record);
|
||||
|
||||
int updateByPrimaryKey(TbWiningParams record);
|
||||
|
||||
List<TbWiningParams> selectAll();
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbWiningUser;
|
||||
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 TbWiningUserMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbWiningUser record);
|
||||
|
||||
int insertSelective(TbWiningUser record);
|
||||
|
||||
TbWiningUser selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbWiningUser record);
|
||||
|
||||
int updateByPrimaryKey(TbWiningUser record);
|
||||
|
||||
List<TbWiningUser> selectAllByTrade(@Param("day") String day);
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbYhqParams;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbYhqParamsMapper {
|
||||
int deleteByPrimaryKey(Integer id);
|
||||
|
||||
int insert(TbYhqParams record);
|
||||
|
||||
int insertSelective(TbYhqParams record);
|
||||
|
||||
TbYhqParams selectByPrimaryKey(Integer id);
|
||||
|
||||
int updateByPrimaryKeySelective(TbYhqParams record);
|
||||
|
||||
int updateByPrimaryKey(TbYhqParams record);
|
||||
|
||||
List<TbYhqParams> selectAll();
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.dao;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.entity.ViewOrder;
|
||||
|
||||
public interface ViewOrderMapper {
|
||||
int insert(ViewOrder record);
|
||||
|
||||
int insertSelective(ViewOrder record);
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class TbDeviceOperateInfo implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String deviceno;
|
||||
|
||||
private String type;
|
||||
|
||||
private String shopId;
|
||||
|
||||
private Date createtime;
|
||||
|
||||
private String remark;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getDeviceno() {
|
||||
return deviceno;
|
||||
}
|
||||
|
||||
public void setDeviceno(String deviceno) {
|
||||
this.deviceno = deviceno == null ? null : deviceno.trim();
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type == null ? null : type.trim();
|
||||
}
|
||||
|
||||
public String getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(String shopId) {
|
||||
this.shopId = shopId == null ? null : shopId.trim();
|
||||
}
|
||||
|
||||
public Date getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(Date createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark == null ? null : remark.trim();
|
||||
}
|
||||
}
|
||||
@@ -1,249 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class TbDeviceStock implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String snno;
|
||||
|
||||
private String orderno;
|
||||
|
||||
private BigDecimal price;
|
||||
|
||||
private String type;
|
||||
|
||||
private String groupno;
|
||||
|
||||
private String buymercname;
|
||||
|
||||
private String buymercid;
|
||||
|
||||
private String actmercname;
|
||||
|
||||
private String actmercid;
|
||||
|
||||
private String status;
|
||||
|
||||
private Date createtime;
|
||||
|
||||
private String createby;
|
||||
|
||||
private String delflag;
|
||||
|
||||
private String remarks;
|
||||
|
||||
private Date updatetime;
|
||||
|
||||
private String deviceno;
|
||||
|
||||
private Integer belonguserid;
|
||||
|
||||
private Integer extractuserid;
|
||||
|
||||
private String rolecode;
|
||||
|
||||
private Date instocktime;
|
||||
|
||||
private String transferstatus;
|
||||
|
||||
private Date bindtime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code == null ? null : code.trim();
|
||||
}
|
||||
|
||||
public String getSnno() {
|
||||
return snno;
|
||||
}
|
||||
|
||||
public void setSnno(String snno) {
|
||||
this.snno = snno == null ? null : snno.trim();
|
||||
}
|
||||
|
||||
public String getOrderno() {
|
||||
return orderno;
|
||||
}
|
||||
|
||||
public void setOrderno(String orderno) {
|
||||
this.orderno = orderno == null ? null : orderno.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type == null ? null : type.trim();
|
||||
}
|
||||
|
||||
public String getGroupno() {
|
||||
return groupno;
|
||||
}
|
||||
|
||||
public void setGroupno(String groupno) {
|
||||
this.groupno = groupno == null ? null : groupno.trim();
|
||||
}
|
||||
|
||||
public String getBuymercname() {
|
||||
return buymercname;
|
||||
}
|
||||
|
||||
public void setBuymercname(String buymercname) {
|
||||
this.buymercname = buymercname == null ? null : buymercname.trim();
|
||||
}
|
||||
|
||||
public String getBuymercid() {
|
||||
return buymercid;
|
||||
}
|
||||
|
||||
public void setBuymercid(String buymercid) {
|
||||
this.buymercid = buymercid == null ? null : buymercid.trim();
|
||||
}
|
||||
|
||||
public String getActmercname() {
|
||||
return actmercname;
|
||||
}
|
||||
|
||||
public void setActmercname(String actmercname) {
|
||||
this.actmercname = actmercname == null ? null : actmercname.trim();
|
||||
}
|
||||
|
||||
public String getActmercid() {
|
||||
return actmercid;
|
||||
}
|
||||
|
||||
public void setActmercid(String actmercid) {
|
||||
this.actmercid = actmercid == null ? null : actmercid.trim();
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status == null ? null : status.trim();
|
||||
}
|
||||
|
||||
public Date getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(Date createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public String getCreateby() {
|
||||
return createby;
|
||||
}
|
||||
|
||||
public void setCreateby(String createby) {
|
||||
this.createby = createby == null ? null : createby.trim();
|
||||
}
|
||||
|
||||
public String getDelflag() {
|
||||
return delflag;
|
||||
}
|
||||
|
||||
public void setDelflag(String delflag) {
|
||||
this.delflag = delflag == null ? null : delflag.trim();
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks == null ? null : remarks.trim();
|
||||
}
|
||||
|
||||
public Date getUpdatetime() {
|
||||
return updatetime;
|
||||
}
|
||||
|
||||
public void setUpdatetime(Date updatetime) {
|
||||
this.updatetime = updatetime;
|
||||
}
|
||||
|
||||
public String getDeviceno() {
|
||||
return deviceno;
|
||||
}
|
||||
|
||||
public void setDeviceno(String deviceno) {
|
||||
this.deviceno = deviceno == null ? null : deviceno.trim();
|
||||
}
|
||||
|
||||
public Integer getBelonguserid() {
|
||||
return belonguserid;
|
||||
}
|
||||
|
||||
public void setBelonguserid(Integer belonguserid) {
|
||||
this.belonguserid = belonguserid;
|
||||
}
|
||||
|
||||
public Integer getExtractuserid() {
|
||||
return extractuserid;
|
||||
}
|
||||
|
||||
public void setExtractuserid(Integer extractuserid) {
|
||||
this.extractuserid = extractuserid;
|
||||
}
|
||||
|
||||
public String getRolecode() {
|
||||
return rolecode;
|
||||
}
|
||||
|
||||
public void setRolecode(String rolecode) {
|
||||
this.rolecode = rolecode == null ? null : rolecode.trim();
|
||||
}
|
||||
|
||||
public Date getInstocktime() {
|
||||
return instocktime;
|
||||
}
|
||||
|
||||
public void setInstocktime(Date instocktime) {
|
||||
this.instocktime = instocktime;
|
||||
}
|
||||
|
||||
public String getTransferstatus() {
|
||||
return transferstatus;
|
||||
}
|
||||
|
||||
public void setTransferstatus(String transferstatus) {
|
||||
this.transferstatus = transferstatus == null ? null : transferstatus.trim();
|
||||
}
|
||||
|
||||
public Date getBindtime() {
|
||||
return bindtime;
|
||||
}
|
||||
|
||||
public void setBindtime(Date bindtime) {
|
||||
this.bindtime = bindtime;
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class TbIntegral implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String userId;
|
||||
|
||||
private BigDecimal num;
|
||||
|
||||
private String status;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(BigDecimal num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status == null ? null : status.trim();
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
public class TbIntegralFlow implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String userId;
|
||||
|
||||
private BigDecimal num;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(BigDecimal 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;
|
||||
}
|
||||
}
|
||||
@@ -1,420 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 优惠券(TbMerchantCoupon)实体类
|
||||
*
|
||||
* @author lyf
|
||||
* @since 2024-04-02 09:22:41
|
||||
*/
|
||||
public class TbMerchantCoupon implements Serializable {
|
||||
private static final long serialVersionUID = 391103766508753856L;
|
||||
/**
|
||||
* 自增
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 状态0-关闭 1 正常
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 优惠券名称
|
||||
*/
|
||||
private String title;
|
||||
|
||||
private String templateId;
|
||||
|
||||
private String shopId;
|
||||
|
||||
private String shopSnap;
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date fromTime;
|
||||
/**
|
||||
* 到期时间
|
||||
*/
|
||||
private Date toTime;
|
||||
/**
|
||||
* 限领数量
|
||||
*/
|
||||
private String limitNumber;
|
||||
private String useNumber;
|
||||
/**
|
||||
* 发放数量
|
||||
*/
|
||||
private Integer number;
|
||||
/**
|
||||
* 剩余数量
|
||||
*/
|
||||
private String leftNumber;
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private Double amount;
|
||||
/**
|
||||
* 订单满赠金额
|
||||
*/
|
||||
private Double limitAmount;
|
||||
/**
|
||||
* 是否显示0-不显示 1显示
|
||||
*/
|
||||
private Integer isShow;
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String pic;
|
||||
/**
|
||||
* 0-满减 1-折扣
|
||||
*/
|
||||
private Integer type;
|
||||
/**
|
||||
* 折扣 ,一位小数
|
||||
*/
|
||||
private Float ratio;
|
||||
/**
|
||||
* 最大折扣金额
|
||||
*/
|
||||
private Double maxRatioAmount;
|
||||
/**
|
||||
* 优惠券途径,首充|分销
|
||||
*/
|
||||
private String track;
|
||||
/**
|
||||
* 品类product 商品券 ---cateogry 品类券common -通 用券
|
||||
*/
|
||||
private String classType;
|
||||
/**
|
||||
* 有效期类型:0-toTime有效 1-effectDays有效
|
||||
*/
|
||||
private Integer effectType;
|
||||
/**
|
||||
* 领取之日有效天数
|
||||
*/
|
||||
private Integer effectDays;
|
||||
/**
|
||||
* 关联商品Id
|
||||
*/
|
||||
private String relationIds;
|
||||
|
||||
private String relationList;
|
||||
/**
|
||||
* 发放人
|
||||
*/
|
||||
private String editor;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
private String note;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
/**
|
||||
* 支持堂食
|
||||
*/
|
||||
private Integer furnishMeal;
|
||||
/**
|
||||
* 支持配送
|
||||
*/
|
||||
private Integer furnishExpress;
|
||||
/**
|
||||
* 支持自提
|
||||
*/
|
||||
private Integer furnishDraw;
|
||||
/**
|
||||
* 支持虚拟
|
||||
*/
|
||||
private Integer furnishVir;
|
||||
|
||||
private Integer disableDistribute;
|
||||
/**
|
||||
* 商户Id
|
||||
*/
|
||||
private String merchantId;
|
||||
|
||||
|
||||
public String getUseNumber() {
|
||||
return useNumber;
|
||||
}
|
||||
|
||||
public void setUseNumber(String useNumber) {
|
||||
this.useNumber = useNumber;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public String getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(String shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public String getShopSnap() {
|
||||
return shopSnap;
|
||||
}
|
||||
|
||||
public void setShopSnap(String shopSnap) {
|
||||
this.shopSnap = shopSnap;
|
||||
}
|
||||
|
||||
public Date getFromTime() {
|
||||
return fromTime;
|
||||
}
|
||||
|
||||
public void setFromTime(Date fromTime) {
|
||||
this.fromTime = fromTime;
|
||||
}
|
||||
|
||||
public Date getToTime() {
|
||||
return toTime;
|
||||
}
|
||||
|
||||
public void setToTime(Date toTime) {
|
||||
this.toTime = toTime;
|
||||
}
|
||||
|
||||
public String getLimitNumber() {
|
||||
return limitNumber;
|
||||
}
|
||||
|
||||
public void setLimitNumber(String limitNumber) {
|
||||
this.limitNumber = limitNumber;
|
||||
}
|
||||
|
||||
public Integer getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(Integer number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public String getLeftNumber() {
|
||||
return leftNumber;
|
||||
}
|
||||
|
||||
public void setLeftNumber(String leftNumber) {
|
||||
this.leftNumber = leftNumber;
|
||||
}
|
||||
|
||||
public Double getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(Double amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public Double getLimitAmount() {
|
||||
return limitAmount;
|
||||
}
|
||||
|
||||
public void setLimitAmount(Double limitAmount) {
|
||||
this.limitAmount = limitAmount;
|
||||
}
|
||||
|
||||
public Integer getIsShow() {
|
||||
return isShow;
|
||||
}
|
||||
|
||||
public void setIsShow(Integer isShow) {
|
||||
this.isShow = isShow;
|
||||
}
|
||||
|
||||
public String getPic() {
|
||||
return pic;
|
||||
}
|
||||
|
||||
public void setPic(String pic) {
|
||||
this.pic = pic;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Float getRatio() {
|
||||
return ratio;
|
||||
}
|
||||
|
||||
public void setRatio(Float ratio) {
|
||||
this.ratio = ratio;
|
||||
}
|
||||
|
||||
public Double getMaxRatioAmount() {
|
||||
return maxRatioAmount;
|
||||
}
|
||||
|
||||
public void setMaxRatioAmount(Double maxRatioAmount) {
|
||||
this.maxRatioAmount = maxRatioAmount;
|
||||
}
|
||||
|
||||
public String getTrack() {
|
||||
return track;
|
||||
}
|
||||
|
||||
public void setTrack(String track) {
|
||||
this.track = track;
|
||||
}
|
||||
|
||||
public String getClassType() {
|
||||
return classType;
|
||||
}
|
||||
|
||||
public void setClassType(String classType) {
|
||||
this.classType = classType;
|
||||
}
|
||||
|
||||
public Integer getEffectType() {
|
||||
return effectType;
|
||||
}
|
||||
|
||||
public void setEffectType(Integer effectType) {
|
||||
this.effectType = effectType;
|
||||
}
|
||||
|
||||
public Integer getEffectDays() {
|
||||
return effectDays;
|
||||
}
|
||||
|
||||
public void setEffectDays(Integer effectDays) {
|
||||
this.effectDays = effectDays;
|
||||
}
|
||||
|
||||
public String getRelationIds() {
|
||||
return relationIds;
|
||||
}
|
||||
|
||||
public void setRelationIds(String relationIds) {
|
||||
this.relationIds = relationIds;
|
||||
}
|
||||
|
||||
public String getRelationList() {
|
||||
return relationList;
|
||||
}
|
||||
|
||||
public void setRelationList(String relationList) {
|
||||
this.relationList = relationList;
|
||||
}
|
||||
|
||||
public String getEditor() {
|
||||
return editor;
|
||||
}
|
||||
|
||||
public void setEditor(String editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Long getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Long updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Integer getFurnishMeal() {
|
||||
return furnishMeal;
|
||||
}
|
||||
|
||||
public void setFurnishMeal(Integer furnishMeal) {
|
||||
this.furnishMeal = furnishMeal;
|
||||
}
|
||||
|
||||
public Integer getFurnishExpress() {
|
||||
return furnishExpress;
|
||||
}
|
||||
|
||||
public void setFurnishExpress(Integer furnishExpress) {
|
||||
this.furnishExpress = furnishExpress;
|
||||
}
|
||||
|
||||
public Integer getFurnishDraw() {
|
||||
return furnishDraw;
|
||||
}
|
||||
|
||||
public void setFurnishDraw(Integer furnishDraw) {
|
||||
this.furnishDraw = furnishDraw;
|
||||
}
|
||||
|
||||
public Integer getFurnishVir() {
|
||||
return furnishVir;
|
||||
}
|
||||
|
||||
public void setFurnishVir(Integer furnishVir) {
|
||||
this.furnishVir = furnishVir;
|
||||
}
|
||||
|
||||
public Integer getDisableDistribute() {
|
||||
return disableDistribute;
|
||||
}
|
||||
|
||||
public void setDisableDistribute(Integer disableDistribute) {
|
||||
this.disableDistribute = disableDistribute;
|
||||
}
|
||||
|
||||
public String getMerchantId() {
|
||||
return merchantId;
|
||||
}
|
||||
|
||||
public void setMerchantId(String merchantId) {
|
||||
this.merchantId = merchantId;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@Data
|
||||
public class TbParams implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private BigDecimal integralRatio;
|
||||
private BigDecimal twoRatio;
|
||||
|
||||
private BigDecimal tradeRatio;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,128 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class TbPlussDeviceGoods implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String code;
|
||||
|
||||
private String name;
|
||||
|
||||
private String devicelogo;
|
||||
|
||||
private String introdesc;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private Integer status;
|
||||
|
||||
private Integer tagid;
|
||||
|
||||
private String depositflag;
|
||||
|
||||
private Date createtime;
|
||||
|
||||
private Date updatetime;
|
||||
|
||||
private String detail;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code == null ? null : code.trim();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
public String getDevicelogo() {
|
||||
return devicelogo;
|
||||
}
|
||||
|
||||
public void setDevicelogo(String devicelogo) {
|
||||
this.devicelogo = devicelogo == null ? null : devicelogo.trim();
|
||||
}
|
||||
|
||||
public String getIntrodesc() {
|
||||
return introdesc;
|
||||
}
|
||||
|
||||
public void setIntrodesc(String introdesc) {
|
||||
this.introdesc = introdesc == null ? null : introdesc.trim();
|
||||
}
|
||||
|
||||
public Integer getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(Integer sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Integer getTagid() {
|
||||
return tagid;
|
||||
}
|
||||
|
||||
public void setTagid(Integer tagid) {
|
||||
this.tagid = tagid;
|
||||
}
|
||||
|
||||
public String getDepositflag() {
|
||||
return depositflag;
|
||||
}
|
||||
|
||||
public void setDepositflag(String depositflag) {
|
||||
this.depositflag = depositflag == null ? null : depositflag.trim();
|
||||
}
|
||||
|
||||
public Date getCreatetime() {
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setCreatetime(Date createtime) {
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public Date getUpdatetime() {
|
||||
return updatetime;
|
||||
}
|
||||
|
||||
public void setUpdatetime(Date updatetime) {
|
||||
this.updatetime = updatetime;
|
||||
}
|
||||
|
||||
public String getDetail() {
|
||||
return detail;
|
||||
}
|
||||
|
||||
public void setDetail(String detail) {
|
||||
this.detail = detail == null ? null : detail.trim();
|
||||
}
|
||||
}
|
||||
@@ -1,207 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TbReceiptSales implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String logo;
|
||||
|
||||
private Boolean showContactInfo;
|
||||
|
||||
private Boolean showMember;
|
||||
|
||||
private Boolean showMemberCode;
|
||||
|
||||
private Boolean showMemberScore;
|
||||
|
||||
private Boolean showMemberWallet;
|
||||
|
||||
private String footerRemark;
|
||||
|
||||
private Boolean showCashCharge;
|
||||
|
||||
private Boolean showSerialNo;
|
||||
|
||||
private Boolean bigSerialNo;
|
||||
|
||||
private String headerText;
|
||||
|
||||
private String headerTextAlign;
|
||||
|
||||
private String footerText;
|
||||
|
||||
private String footerTextAlign;
|
||||
|
||||
private String footerImage;
|
||||
|
||||
private String prePrint;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title == null ? null : title.trim();
|
||||
}
|
||||
|
||||
public String getLogo() {
|
||||
return logo;
|
||||
}
|
||||
|
||||
public void setLogo(String logo) {
|
||||
this.logo = logo == null ? null : logo.trim();
|
||||
}
|
||||
|
||||
public Boolean getShowContactInfo() {
|
||||
return showContactInfo;
|
||||
}
|
||||
|
||||
public void setShowContactInfo(Boolean showContactInfo) {
|
||||
this.showContactInfo = showContactInfo;
|
||||
}
|
||||
|
||||
public Boolean getShowMember() {
|
||||
return showMember;
|
||||
}
|
||||
|
||||
public void setShowMember(Boolean showMember) {
|
||||
this.showMember = showMember;
|
||||
}
|
||||
|
||||
public Boolean getShowMemberCode() {
|
||||
return showMemberCode;
|
||||
}
|
||||
|
||||
public void setShowMemberCode(Boolean showMemberCode) {
|
||||
this.showMemberCode = showMemberCode;
|
||||
}
|
||||
|
||||
public Boolean getShowMemberScore() {
|
||||
return showMemberScore;
|
||||
}
|
||||
|
||||
public void setShowMemberScore(Boolean showMemberScore) {
|
||||
this.showMemberScore = showMemberScore;
|
||||
}
|
||||
|
||||
public Boolean getShowMemberWallet() {
|
||||
return showMemberWallet;
|
||||
}
|
||||
|
||||
public void setShowMemberWallet(Boolean showMemberWallet) {
|
||||
this.showMemberWallet = showMemberWallet;
|
||||
}
|
||||
|
||||
public String getFooterRemark() {
|
||||
return footerRemark;
|
||||
}
|
||||
|
||||
public void setFooterRemark(String footerRemark) {
|
||||
this.footerRemark = footerRemark == null ? null : footerRemark.trim();
|
||||
}
|
||||
|
||||
public Boolean getShowCashCharge() {
|
||||
return showCashCharge;
|
||||
}
|
||||
|
||||
public void setShowCashCharge(Boolean showCashCharge) {
|
||||
this.showCashCharge = showCashCharge;
|
||||
}
|
||||
|
||||
public Boolean getShowSerialNo() {
|
||||
return showSerialNo;
|
||||
}
|
||||
|
||||
public void setShowSerialNo(Boolean showSerialNo) {
|
||||
this.showSerialNo = showSerialNo;
|
||||
}
|
||||
|
||||
public Boolean getBigSerialNo() {
|
||||
return bigSerialNo;
|
||||
}
|
||||
|
||||
public void setBigSerialNo(Boolean bigSerialNo) {
|
||||
this.bigSerialNo = bigSerialNo;
|
||||
}
|
||||
|
||||
public String getHeaderText() {
|
||||
return headerText;
|
||||
}
|
||||
|
||||
public void setHeaderText(String headerText) {
|
||||
this.headerText = headerText == null ? null : headerText.trim();
|
||||
}
|
||||
|
||||
public String getHeaderTextAlign() {
|
||||
return headerTextAlign;
|
||||
}
|
||||
|
||||
public void setHeaderTextAlign(String headerTextAlign) {
|
||||
this.headerTextAlign = headerTextAlign == null ? null : headerTextAlign.trim();
|
||||
}
|
||||
|
||||
public String getFooterText() {
|
||||
return footerText;
|
||||
}
|
||||
|
||||
public void setFooterText(String footerText) {
|
||||
this.footerText = footerText == null ? null : footerText.trim();
|
||||
}
|
||||
|
||||
public String getFooterTextAlign() {
|
||||
return footerTextAlign;
|
||||
}
|
||||
|
||||
public void setFooterTextAlign(String footerTextAlign) {
|
||||
this.footerTextAlign = footerTextAlign == null ? null : footerTextAlign.trim();
|
||||
}
|
||||
|
||||
public String getFooterImage() {
|
||||
return footerImage;
|
||||
}
|
||||
|
||||
public void setFooterImage(String footerImage) {
|
||||
this.footerImage = footerImage == null ? null : footerImage.trim();
|
||||
}
|
||||
|
||||
public String getPrePrint() {
|
||||
return prePrint;
|
||||
}
|
||||
|
||||
public void setPrePrint(String prePrint) {
|
||||
this.prePrint = prePrint == null ? null : prePrint.trim();
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Long getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Long updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TbReleaseFlow implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String userId;
|
||||
|
||||
private BigDecimal num;
|
||||
|
||||
private String type;
|
||||
private String operationType;
|
||||
|
||||
private String remark;
|
||||
private String nickName;
|
||||
|
||||
private String fromSource;
|
||||
|
||||
private Date createTime;
|
||||
private String createTr;
|
||||
private String openId;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class TbRenewalsPayLog implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String payType;
|
||||
|
||||
private String shopId;
|
||||
|
||||
private String orderId;
|
||||
|
||||
private String openId;
|
||||
|
||||
private String userId;
|
||||
|
||||
private String transactionId;
|
||||
|
||||
private BigDecimal amount;
|
||||
|
||||
private Byte status;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String attach;
|
||||
|
||||
private Long expiredAt;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPayType() {
|
||||
return payType;
|
||||
}
|
||||
|
||||
public void setPayType(String payType) {
|
||||
this.payType = payType == null ? null : payType.trim();
|
||||
}
|
||||
|
||||
public String getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(String shopId) {
|
||||
this.shopId = shopId == null ? null : shopId.trim();
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId == null ? null : orderId.trim();
|
||||
}
|
||||
|
||||
public String getOpenId() {
|
||||
return openId;
|
||||
}
|
||||
|
||||
public void setOpenId(String openId) {
|
||||
this.openId = openId == null ? null : openId.trim();
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
public String getTransactionId() {
|
||||
return transactionId;
|
||||
}
|
||||
|
||||
public void setTransactionId(String transactionId) {
|
||||
this.transactionId = transactionId == null ? null : transactionId.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public Byte getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Byte status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark == null ? null : remark.trim();
|
||||
}
|
||||
|
||||
public String getAttach() {
|
||||
return attach;
|
||||
}
|
||||
|
||||
public void setAttach(String attach) {
|
||||
this.attach = attach == null ? null : attach.trim();
|
||||
}
|
||||
|
||||
public Long getExpiredAt() {
|
||||
return expiredAt;
|
||||
}
|
||||
|
||||
public void setExpiredAt(Long expiredAt) {
|
||||
this.expiredAt = expiredAt;
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Long getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Long updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TbShopCashSpread implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Long getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Long updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TbShopCashSpreadWithBLOBs extends TbShopCashSpread implements Serializable {
|
||||
private String saleReceipt;
|
||||
|
||||
private String triplicateReceipt;
|
||||
|
||||
private String screenConfig;
|
||||
|
||||
private String tagConfig;
|
||||
|
||||
private String scaleConfig;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getSaleReceipt() {
|
||||
return saleReceipt;
|
||||
}
|
||||
|
||||
public void setSaleReceipt(String saleReceipt) {
|
||||
this.saleReceipt = saleReceipt == null ? null : saleReceipt.trim();
|
||||
}
|
||||
|
||||
public String getTriplicateReceipt() {
|
||||
return triplicateReceipt;
|
||||
}
|
||||
|
||||
public void setTriplicateReceipt(String triplicateReceipt) {
|
||||
this.triplicateReceipt = triplicateReceipt == null ? null : triplicateReceipt.trim();
|
||||
}
|
||||
|
||||
public String getScreenConfig() {
|
||||
return screenConfig;
|
||||
}
|
||||
|
||||
public void setScreenConfig(String screenConfig) {
|
||||
this.screenConfig = screenConfig == null ? null : screenConfig.trim();
|
||||
}
|
||||
|
||||
public String getTagConfig() {
|
||||
return tagConfig;
|
||||
}
|
||||
|
||||
public void setTagConfig(String tagConfig) {
|
||||
this.tagConfig = tagConfig == null ? null : tagConfig.trim();
|
||||
}
|
||||
|
||||
public String getScaleConfig() {
|
||||
return scaleConfig;
|
||||
}
|
||||
|
||||
public void setScaleConfig(String scaleConfig) {
|
||||
this.scaleConfig = scaleConfig == null ? null : scaleConfig.trim();
|
||||
}
|
||||
}
|
||||
@@ -1,208 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class TbShopCurrency implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String shopId;
|
||||
|
||||
private BigDecimal prepareAmount;
|
||||
|
||||
private String currency;
|
||||
|
||||
private Byte decimalsDigits;
|
||||
|
||||
private String discountRound;
|
||||
|
||||
private String merchantId;
|
||||
|
||||
private Byte smallChange;
|
||||
|
||||
private Byte enableCustomDiscount;
|
||||
|
||||
private BigDecimal maxDiscount;
|
||||
|
||||
private Double maxPercent;
|
||||
|
||||
private String bizDuration;
|
||||
|
||||
private Byte allowWebPay;
|
||||
|
||||
private Byte isAutoToZero;
|
||||
|
||||
private Byte isIncludeTaxPrice;
|
||||
|
||||
private String taxNumber;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
private Byte autoLockScreen;
|
||||
|
||||
private Byte voiceNotification;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(String shopId) {
|
||||
this.shopId = shopId == null ? null : shopId.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getPrepareAmount() {
|
||||
return prepareAmount;
|
||||
}
|
||||
|
||||
public void setPrepareAmount(BigDecimal prepareAmount) {
|
||||
this.prepareAmount = prepareAmount;
|
||||
}
|
||||
|
||||
public String getCurrency() {
|
||||
return currency;
|
||||
}
|
||||
|
||||
public void setCurrency(String currency) {
|
||||
this.currency = currency == null ? null : currency.trim();
|
||||
}
|
||||
|
||||
public Byte getDecimalsDigits() {
|
||||
return decimalsDigits;
|
||||
}
|
||||
|
||||
public void setDecimalsDigits(Byte decimalsDigits) {
|
||||
this.decimalsDigits = decimalsDigits;
|
||||
}
|
||||
|
||||
public String getDiscountRound() {
|
||||
return discountRound;
|
||||
}
|
||||
|
||||
public void setDiscountRound(String discountRound) {
|
||||
this.discountRound = discountRound == null ? null : discountRound.trim();
|
||||
}
|
||||
|
||||
public String getMerchantId() {
|
||||
return merchantId;
|
||||
}
|
||||
|
||||
public void setMerchantId(String merchantId) {
|
||||
this.merchantId = merchantId == null ? null : merchantId.trim();
|
||||
}
|
||||
|
||||
public Byte getSmallChange() {
|
||||
return smallChange;
|
||||
}
|
||||
|
||||
public void setSmallChange(Byte smallChange) {
|
||||
this.smallChange = smallChange;
|
||||
}
|
||||
|
||||
public Byte getEnableCustomDiscount() {
|
||||
return enableCustomDiscount;
|
||||
}
|
||||
|
||||
public void setEnableCustomDiscount(Byte enableCustomDiscount) {
|
||||
this.enableCustomDiscount = enableCustomDiscount;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxDiscount() {
|
||||
return maxDiscount;
|
||||
}
|
||||
|
||||
public void setMaxDiscount(BigDecimal maxDiscount) {
|
||||
this.maxDiscount = maxDiscount;
|
||||
}
|
||||
|
||||
public Double getMaxPercent() {
|
||||
return maxPercent;
|
||||
}
|
||||
|
||||
public void setMaxPercent(Double maxPercent) {
|
||||
this.maxPercent = maxPercent;
|
||||
}
|
||||
|
||||
public String getBizDuration() {
|
||||
return bizDuration;
|
||||
}
|
||||
|
||||
public void setBizDuration(String bizDuration) {
|
||||
this.bizDuration = bizDuration == null ? null : bizDuration.trim();
|
||||
}
|
||||
|
||||
public Byte getAllowWebPay() {
|
||||
return allowWebPay;
|
||||
}
|
||||
|
||||
public void setAllowWebPay(Byte allowWebPay) {
|
||||
this.allowWebPay = allowWebPay;
|
||||
}
|
||||
|
||||
public Byte getIsAutoToZero() {
|
||||
return isAutoToZero;
|
||||
}
|
||||
|
||||
public void setIsAutoToZero(Byte isAutoToZero) {
|
||||
this.isAutoToZero = isAutoToZero;
|
||||
}
|
||||
|
||||
public Byte getIsIncludeTaxPrice() {
|
||||
return isIncludeTaxPrice;
|
||||
}
|
||||
|
||||
public void setIsIncludeTaxPrice(Byte isIncludeTaxPrice) {
|
||||
this.isIncludeTaxPrice = isIncludeTaxPrice;
|
||||
}
|
||||
|
||||
public String getTaxNumber() {
|
||||
return taxNumber;
|
||||
}
|
||||
|
||||
public void setTaxNumber(String taxNumber) {
|
||||
this.taxNumber = taxNumber == null ? null : taxNumber.trim();
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Long getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Long updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Byte getAutoLockScreen() {
|
||||
return autoLockScreen;
|
||||
}
|
||||
|
||||
public void setAutoLockScreen(Byte autoLockScreen) {
|
||||
this.autoLockScreen = autoLockScreen;
|
||||
}
|
||||
|
||||
public Byte getVoiceNotification() {
|
||||
return voiceNotification;
|
||||
}
|
||||
|
||||
public void setVoiceNotification(Byte voiceNotification) {
|
||||
this.voiceNotification = voiceNotification;
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class TbShopCurrencyWithBLOBs extends TbShopCurrency implements Serializable {
|
||||
private String discountConfigs;
|
||||
|
||||
private String serviceCharge;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public String getDiscountConfigs() {
|
||||
return discountConfigs;
|
||||
}
|
||||
|
||||
public void setDiscountConfigs(String discountConfigs) {
|
||||
this.discountConfigs = discountConfigs == null ? null : discountConfigs.trim();
|
||||
}
|
||||
|
||||
public String getServiceCharge() {
|
||||
return serviceCharge;
|
||||
}
|
||||
|
||||
public void setServiceCharge(String serviceCharge) {
|
||||
this.serviceCharge = serviceCharge == null ? null : serviceCharge.trim();
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
//分配金额
|
||||
public class TbSplitAccounts implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private Integer merchantId;//商户ID
|
||||
|
||||
private Integer shopId;//店铺ID
|
||||
|
||||
private BigDecimal couponsPrice;//优惠券价值
|
||||
|
||||
private BigDecimal conponsAmount;//优惠券面额
|
||||
private BigDecimal originAmount;//
|
||||
|
||||
private String isSplit;
|
||||
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date splitTime;
|
||||
|
||||
private String tradeDay;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TbUserCoupons implements Serializable{
|
||||
private Integer id;
|
||||
|
||||
private String userId;
|
||||
private String detail;
|
||||
private Integer orderId;
|
||||
|
||||
private BigDecimal couponsPrice;
|
||||
|
||||
private BigDecimal couponsAmount;
|
||||
private TbOrderInfo orderInfo;
|
||||
|
||||
private String status;
|
||||
private String isDouble;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
private Date endTime;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TbWiningParams implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private BigDecimal minPrice;
|
||||
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
private Integer winingNum;
|
||||
|
||||
private Integer winingUserNum;
|
||||
private String status;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TbWiningUser implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String orderNo;
|
||||
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
private String isUser;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private String isRefund;
|
||||
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
private String refundNo;
|
||||
|
||||
private String refundPayType;
|
||||
|
||||
private String tradeDay;
|
||||
|
||||
private Date refundTime;
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
public TbWiningUser(){
|
||||
super();
|
||||
}
|
||||
public TbWiningUser(String userName,String orderNo,BigDecimal orderAmount,
|
||||
String isUser,String tradeDay){
|
||||
this.createTime = new Date();
|
||||
this.userName = userName;
|
||||
this.orderNo = orderNo;
|
||||
this.orderAmount = orderAmount;
|
||||
this.isUser = isUser;
|
||||
this.tradeDay = tradeDay;
|
||||
this.isRefund = "true";
|
||||
this.refundAmount = BigDecimal.ZERO;
|
||||
this.refundPayType = "WX";
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class TbYhqParams implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
private String name;
|
||||
|
||||
private BigDecimal minPrice;
|
||||
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
private String status;
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,378 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ViewOrder implements Serializable {
|
||||
private BigDecimal aliPaidAmount;
|
||||
|
||||
private Integer id;
|
||||
|
||||
private BigDecimal amount;
|
||||
|
||||
private BigDecimal bankPaidAmount;
|
||||
|
||||
private String billingId;
|
||||
|
||||
private BigDecimal cashPaidAmount;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Integer deductScore;
|
||||
|
||||
private BigDecimal depositPaidAmount;
|
||||
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
private BigDecimal freightAmount;
|
||||
|
||||
private Byte isMaster;
|
||||
|
||||
private Byte isVip;
|
||||
|
||||
private String masterId;
|
||||
|
||||
private String memberId;
|
||||
|
||||
private String orderNo;
|
||||
|
||||
private String orderType;
|
||||
|
||||
private BigDecimal otherPaidAmount;
|
||||
|
||||
private Long paidTime;
|
||||
|
||||
private BigDecimal payAmount;
|
||||
|
||||
private Integer productScore;
|
||||
|
||||
private String productType;
|
||||
|
||||
private String refOrderId;
|
||||
|
||||
private Byte refundAble;
|
||||
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
private String sendType;
|
||||
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
private String shopId;
|
||||
|
||||
private BigDecimal smallChange;
|
||||
|
||||
private String status;
|
||||
|
||||
private String tableId;
|
||||
|
||||
private String tableParty;
|
||||
|
||||
private String terminalSnap;
|
||||
|
||||
private String userId;
|
||||
|
||||
private BigDecimal virtualPaidAmount;
|
||||
|
||||
private BigDecimal wxPaidAmount;
|
||||
|
||||
private String cartList;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public BigDecimal getAliPaidAmount() {
|
||||
return aliPaidAmount;
|
||||
}
|
||||
|
||||
public void setAliPaidAmount(BigDecimal aliPaidAmount) {
|
||||
this.aliPaidAmount = aliPaidAmount;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getBankPaidAmount() {
|
||||
return bankPaidAmount;
|
||||
}
|
||||
|
||||
public void setBankPaidAmount(BigDecimal bankPaidAmount) {
|
||||
this.bankPaidAmount = bankPaidAmount;
|
||||
}
|
||||
|
||||
public String getBillingId() {
|
||||
return billingId;
|
||||
}
|
||||
|
||||
public void setBillingId(String billingId) {
|
||||
this.billingId = billingId == null ? null : billingId.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getCashPaidAmount() {
|
||||
return cashPaidAmount;
|
||||
}
|
||||
|
||||
public void setCashPaidAmount(BigDecimal cashPaidAmount) {
|
||||
this.cashPaidAmount = cashPaidAmount;
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Integer getDeductScore() {
|
||||
return deductScore;
|
||||
}
|
||||
|
||||
public void setDeductScore(Integer deductScore) {
|
||||
this.deductScore = deductScore;
|
||||
}
|
||||
|
||||
public BigDecimal getDepositPaidAmount() {
|
||||
return depositPaidAmount;
|
||||
}
|
||||
|
||||
public void setDepositPaidAmount(BigDecimal depositPaidAmount) {
|
||||
this.depositPaidAmount = depositPaidAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getDiscountAmount() {
|
||||
return discountAmount;
|
||||
}
|
||||
|
||||
public void setDiscountAmount(BigDecimal discountAmount) {
|
||||
this.discountAmount = discountAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getFreightAmount() {
|
||||
return freightAmount;
|
||||
}
|
||||
|
||||
public void setFreightAmount(BigDecimal freightAmount) {
|
||||
this.freightAmount = freightAmount;
|
||||
}
|
||||
|
||||
public Byte getIsMaster() {
|
||||
return isMaster;
|
||||
}
|
||||
|
||||
public void setIsMaster(Byte isMaster) {
|
||||
this.isMaster = isMaster;
|
||||
}
|
||||
|
||||
public Byte getIsVip() {
|
||||
return isVip;
|
||||
}
|
||||
|
||||
public void setIsVip(Byte isVip) {
|
||||
this.isVip = isVip;
|
||||
}
|
||||
|
||||
public String getMasterId() {
|
||||
return masterId;
|
||||
}
|
||||
|
||||
public void setMasterId(String masterId) {
|
||||
this.masterId = masterId == null ? null : masterId.trim();
|
||||
}
|
||||
|
||||
public String getMemberId() {
|
||||
return memberId;
|
||||
}
|
||||
|
||||
public void setMemberId(String memberId) {
|
||||
this.memberId = memberId == null ? null : memberId.trim();
|
||||
}
|
||||
|
||||
public String getOrderNo() {
|
||||
return orderNo;
|
||||
}
|
||||
|
||||
public void setOrderNo(String orderNo) {
|
||||
this.orderNo = orderNo == null ? null : orderNo.trim();
|
||||
}
|
||||
|
||||
public String getOrderType() {
|
||||
return orderType;
|
||||
}
|
||||
|
||||
public void setOrderType(String orderType) {
|
||||
this.orderType = orderType == null ? null : orderType.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getOtherPaidAmount() {
|
||||
return otherPaidAmount;
|
||||
}
|
||||
|
||||
public void setOtherPaidAmount(BigDecimal otherPaidAmount) {
|
||||
this.otherPaidAmount = otherPaidAmount;
|
||||
}
|
||||
|
||||
public Long getPaidTime() {
|
||||
return paidTime;
|
||||
}
|
||||
|
||||
public void setPaidTime(Long paidTime) {
|
||||
this.paidTime = paidTime;
|
||||
}
|
||||
|
||||
public BigDecimal getPayAmount() {
|
||||
return payAmount;
|
||||
}
|
||||
|
||||
public void setPayAmount(BigDecimal payAmount) {
|
||||
this.payAmount = payAmount;
|
||||
}
|
||||
|
||||
public Integer getProductScore() {
|
||||
return productScore;
|
||||
}
|
||||
|
||||
public void setProductScore(Integer productScore) {
|
||||
this.productScore = productScore;
|
||||
}
|
||||
|
||||
public String getProductType() {
|
||||
return productType;
|
||||
}
|
||||
|
||||
public void setProductType(String productType) {
|
||||
this.productType = productType == null ? null : productType.trim();
|
||||
}
|
||||
|
||||
public String getRefOrderId() {
|
||||
return refOrderId;
|
||||
}
|
||||
|
||||
public void setRefOrderId(String refOrderId) {
|
||||
this.refOrderId = refOrderId == null ? null : refOrderId.trim();
|
||||
}
|
||||
|
||||
public Byte getRefundAble() {
|
||||
return refundAble;
|
||||
}
|
||||
|
||||
public void setRefundAble(Byte refundAble) {
|
||||
this.refundAble = refundAble;
|
||||
}
|
||||
|
||||
public BigDecimal getRefundAmount() {
|
||||
return refundAmount;
|
||||
}
|
||||
|
||||
public void setRefundAmount(BigDecimal refundAmount) {
|
||||
this.refundAmount = refundAmount;
|
||||
}
|
||||
|
||||
public String getSendType() {
|
||||
return sendType;
|
||||
}
|
||||
|
||||
public void setSendType(String sendType) {
|
||||
this.sendType = sendType == null ? null : sendType.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getSettlementAmount() {
|
||||
return settlementAmount;
|
||||
}
|
||||
|
||||
public void setSettlementAmount(BigDecimal settlementAmount) {
|
||||
this.settlementAmount = settlementAmount;
|
||||
}
|
||||
|
||||
public String getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(String shopId) {
|
||||
this.shopId = shopId == null ? null : shopId.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getSmallChange() {
|
||||
return smallChange;
|
||||
}
|
||||
|
||||
public void setSmallChange(BigDecimal smallChange) {
|
||||
this.smallChange = smallChange;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status == null ? null : status.trim();
|
||||
}
|
||||
|
||||
public String getTableId() {
|
||||
return tableId;
|
||||
}
|
||||
|
||||
public void setTableId(String tableId) {
|
||||
this.tableId = tableId == null ? null : tableId.trim();
|
||||
}
|
||||
|
||||
public String getTableParty() {
|
||||
return tableParty;
|
||||
}
|
||||
|
||||
public void setTableParty(String tableParty) {
|
||||
this.tableParty = tableParty == null ? null : tableParty.trim();
|
||||
}
|
||||
|
||||
public String getTerminalSnap() {
|
||||
return terminalSnap;
|
||||
}
|
||||
|
||||
public void setTerminalSnap(String terminalSnap) {
|
||||
this.terminalSnap = terminalSnap == null ? null : terminalSnap.trim();
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId == null ? null : userId.trim();
|
||||
}
|
||||
|
||||
public BigDecimal getVirtualPaidAmount() {
|
||||
return virtualPaidAmount;
|
||||
}
|
||||
|
||||
public void setVirtualPaidAmount(BigDecimal virtualPaidAmount) {
|
||||
this.virtualPaidAmount = virtualPaidAmount;
|
||||
}
|
||||
|
||||
public BigDecimal getWxPaidAmount() {
|
||||
return wxPaidAmount;
|
||||
}
|
||||
|
||||
public void setWxPaidAmount(BigDecimal wxPaidAmount) {
|
||||
this.wxPaidAmount = wxPaidAmount;
|
||||
}
|
||||
|
||||
public String getCartList() {
|
||||
return cartList;
|
||||
}
|
||||
|
||||
public void setCartList(String cartList) {
|
||||
this.cartList = cartList == null ? null : cartList.trim();
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.rabbit;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chaozhanggui.system.cashierservice.redis.RedisUtil;
|
||||
import com.chaozhanggui.system.cashierservice.service.IntegralService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@RabbitListener(queues = {RabbitConstants.INTEGRAL_QUEUE_PUT})
|
||||
@Service
|
||||
public class IntegralConsumer {
|
||||
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
private IntegralService integralService;
|
||||
@RabbitHandler
|
||||
public void listener(String message) {
|
||||
try {
|
||||
JSONObject jsonObject = JSON.parseObject(message);
|
||||
integralService.integralAdd(jsonObject);
|
||||
} catch (Exception e) {
|
||||
e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -76,10 +76,6 @@ public class CartService {
|
||||
private TbOrderDetailMapper orderDetailMapper;
|
||||
@Autowired
|
||||
private TbShopTableMapper shopTableMapper;
|
||||
@Autowired
|
||||
private TbUserCouponsMapper userCouponsMapper;
|
||||
@Autowired
|
||||
private TbSystemCouponsMapper systemCouponsMapper;
|
||||
private final TbUserShopMsgMapper tbUserShopMsgMapper;
|
||||
private final WechatUtil wechatUtil;
|
||||
|
||||
@@ -966,63 +962,6 @@ public class CartService {
|
||||
//生成订单
|
||||
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
|
||||
|
||||
//优惠卷
|
||||
String isBuyYhq = "false";
|
||||
String isuseYhq = "false";
|
||||
if (jsonObject.containsKey("isYhq") && jsonObject.getString("isYhq").equals("1")) {
|
||||
couponId = jsonObject.getString("couponsId");
|
||||
//1:购买优惠券,0:自己持有优惠券
|
||||
Integer couponsId = jsonObject.getInteger("couponsId");
|
||||
if (jsonObject.getString("isBuyYhq").equals("1")) {
|
||||
TbSystemCoupons systemCoupons = systemCouponsMapper.selectByPrimaryKey(couponsId);
|
||||
if (Objects.isNull(systemCoupons) || !systemCoupons.getStatus().equals("0")) {
|
||||
log.info("开始处理订单");
|
||||
responseData.put("status", "fail");
|
||||
responseData.put("msg", "优惠券已售空");
|
||||
responseData.put("type", jsonObject.getString("type"));
|
||||
responseData.put("data", "");
|
||||
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(responseData.toString(), tableCartKey, jsonObject.getString("userId"), true);
|
||||
log.info("消息推送");
|
||||
return Result.fail("优惠券已售空");
|
||||
}
|
||||
if (N.gt(systemCoupons.getCouponsAmount(), totalAmount)) {
|
||||
log.info("开始处理订单");
|
||||
responseData.put("status", "fail");
|
||||
responseData.put("msg", "订单金额小于优惠价金额");
|
||||
responseData.put("type", jsonObject.getString("type"));
|
||||
responseData.put("data", "");
|
||||
PushToAppChannelHandlerAdapter.getInstance().AppSendInfo(responseData.toString(), tableCartKey, jsonObject.getString("userId"), true);
|
||||
log.info("消息推送");
|
||||
return Result.fail("订单金额小于优惠价金额");
|
||||
}
|
||||
totalAmount = totalAmount.add(systemCoupons.getCouponsPrice()).subtract(systemCoupons.getCouponsAmount());
|
||||
originAmount = originAmount.add(systemCoupons.getCouponsPrice());
|
||||
couponAmount = systemCoupons.getCouponsAmount();
|
||||
systemCoupons.setStatus("1");
|
||||
systemCouponsMapper.updateByPrimaryKeySelective(systemCoupons);
|
||||
TbUserCoupons userCoupons = new TbUserCoupons();
|
||||
userCoupons.setEndTime(DateUtils.getNewDate(new Date(), 3, systemCoupons.getDayNum()));
|
||||
userCoupons.setCouponsAmount(systemCoupons.getCouponsAmount());
|
||||
userCoupons.setCouponsPrice(systemCoupons.getCouponsPrice());
|
||||
userCoupons.setStatus("1");
|
||||
userCoupons.setUserId(userId);
|
||||
userCoupons.setCreateTime(new Date());
|
||||
userCouponsMapper.insert(userCoupons);
|
||||
couponId = userCoupons.getId() + "";
|
||||
couponAmount = userCoupons.getCouponsAmount();
|
||||
} else {
|
||||
TbUserCoupons userCoupons = userCouponsMapper.selectByPrimaryKey(couponsId);
|
||||
|
||||
totalAmount = totalAmount.subtract(userCoupons.getCouponsAmount());
|
||||
userCoupons.setStatus("1");
|
||||
userCoupons.setEndTime(DateUtils.getNewDate(new Date(), 5, 30));
|
||||
userCouponsMapper.updateByPrimaryKeySelective(userCoupons);
|
||||
couponAmount = userCoupons.getCouponsAmount();
|
||||
}
|
||||
isuseYhq = "true";
|
||||
|
||||
}
|
||||
|
||||
if (orderInfo != null) {
|
||||
log.info("订单状态:" + orderInfo.getStatus());
|
||||
if (!"unpaid".equals(orderInfo.getStatus())) {
|
||||
@@ -1044,8 +983,6 @@ public class CartService {
|
||||
orderInfo.setOrderAmount(totalAmount.add(packAMount));
|
||||
orderInfo.setFreightAmount(BigDecimal.ZERO);
|
||||
orderInfo.setProductAmount(saleAmount);
|
||||
orderInfo.setIsBuyCoupon(isBuyYhq);
|
||||
orderInfo.setIsUseCoupon(isuseYhq);
|
||||
orderInfo.setRemark(remark);
|
||||
orderInfo.setUserId(userId);
|
||||
if (hasNewInfo) {
|
||||
@@ -1061,8 +998,6 @@ public class CartService {
|
||||
orderInfo.setMerchantId(String.valueOf(tbMerchantAccount.getId()));
|
||||
orderInfo.setUserCouponId(couponId);
|
||||
orderInfo.setOriginAmount(originAmount);
|
||||
orderInfo.setIsBuyCoupon(isBuyYhq);
|
||||
orderInfo.setIsUseCoupon(isuseYhq);
|
||||
orderInfo.setUserCouponAmount(couponAmount);
|
||||
orderInfo.setRemark(remark);
|
||||
orderInfo.setUserId(userId);
|
||||
@@ -1354,84 +1289,6 @@ public class CartService {
|
||||
TbShopTable shopTable = shopTableMapper.selectQRcode(jsonObject.getString("tableId"));
|
||||
//生成订单
|
||||
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
|
||||
String isBuyYhq = "false";
|
||||
String isuseYhq = "false";
|
||||
if (jsonObject.containsKey("isYhq") && jsonObject.getString("isYhq").equals("1")) {
|
||||
couponId = jsonObject.getString("couponsId");
|
||||
//1:购买优惠券,0:自己持有优惠券
|
||||
Integer couponsId = jsonObject.getInteger("couponsId");
|
||||
if (jsonObject.getString("isBuyYhq").equals("1")) {
|
||||
TbSystemCoupons systemCoupons = systemCouponsMapper.selectByPrimaryKey(couponsId);
|
||||
if (Objects.isNull(systemCoupons) || !systemCoupons.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(), tableCartKey, jsonObject.getString("userId"), true);
|
||||
log.info("消息推送");
|
||||
return;
|
||||
}
|
||||
if (N.gt(systemCoupons.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(), tableCartKey, jsonObject.getString("userId"), true);
|
||||
log.info("消息推送");
|
||||
return;
|
||||
}
|
||||
totalAmount = totalAmount.add(systemCoupons.getCouponsPrice()).subtract(systemCoupons.getCouponsAmount());
|
||||
originAmount = originAmount.add(systemCoupons.getCouponsPrice());
|
||||
couponAmount = systemCoupons.getCouponsAmount();
|
||||
systemCoupons.setStatus("1");
|
||||
systemCouponsMapper.updateByPrimaryKeySelective(systemCoupons);
|
||||
TbUserCoupons userCoupons = new TbUserCoupons();
|
||||
userCoupons.setEndTime(DateUtils.getNewDate(new Date(), 3, systemCoupons.getDayNum()));
|
||||
userCoupons.setCouponsAmount(systemCoupons.getCouponsAmount());
|
||||
userCoupons.setCouponsPrice(systemCoupons.getCouponsPrice());
|
||||
userCoupons.setStatus("1");
|
||||
userCoupons.setUserId(userId);
|
||||
userCoupons.setCreateTime(new Date());
|
||||
userCouponsMapper.insert(userCoupons);
|
||||
couponId = userCoupons.getId() + "";
|
||||
couponAmount = userCoupons.getCouponsAmount();
|
||||
} else {
|
||||
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(), tableCartKey, 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(), tableCartKey, jsonObject.getString("userId"), true);
|
||||
log.info("消息推送");
|
||||
return;
|
||||
}
|
||||
totalAmount = totalAmount.subtract(userCoupons.getCouponsAmount());
|
||||
userCoupons.setStatus("1");
|
||||
userCoupons.setEndTime(DateUtils.getNewDate(new Date(), 5, 30));
|
||||
userCouponsMapper.updateByPrimaryKeySelective(userCoupons);
|
||||
couponAmount = userCoupons.getCouponsAmount();
|
||||
}
|
||||
isuseYhq = "true";
|
||||
|
||||
}
|
||||
if (Objects.nonNull(orderInfo)) {
|
||||
log.info("订单状态:" + orderInfo.getStatus());
|
||||
if (!"unpaid".equals(orderInfo.getStatus())) {
|
||||
@@ -1456,16 +1313,12 @@ public class CartService {
|
||||
orderInfo.setOrderAmount(totalAmount.add(packAMount));
|
||||
orderInfo.setFreightAmount(BigDecimal.ZERO);
|
||||
orderInfo.setProductAmount(saleAmount);
|
||||
orderInfo.setIsBuyCoupon(isBuyYhq);
|
||||
orderInfo.setIsUseCoupon(isuseYhq);
|
||||
orderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||
} else {
|
||||
orderInfo = getOrder(totalAmount, packAMount, shopTable, tbMerchantAccount.getId().toString(), jsonObject, originAmount);
|
||||
orderInfo.setMerchantId(String.valueOf(tbMerchantAccount.getId()));
|
||||
orderInfo.setUserCouponId(couponId);
|
||||
orderInfo.setOriginAmount(originAmount);
|
||||
orderInfo.setIsBuyCoupon(isBuyYhq);
|
||||
orderInfo.setIsUseCoupon(isuseYhq);
|
||||
orderInfo.setUserCouponAmount(couponAmount);
|
||||
|
||||
JSONObject object = new JSONObject();
|
||||
|
||||
@@ -1,117 +0,0 @@
|
||||
package com.chaozhanggui.system.cashierservice.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
||||
import com.chaozhanggui.system.cashierservice.redis.RedisUtil;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class IntegralService {
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
@Autowired
|
||||
private TbOrderInfoMapper orderInfoMapper;
|
||||
@Autowired
|
||||
private TbUserInfoMapper userInfoMapper;
|
||||
@Autowired
|
||||
private TbProductMapper productMapper;
|
||||
@Autowired
|
||||
private TbProductSkuMapper productSkuMapper;
|
||||
@Autowired
|
||||
private TbShopInfoMapper shopInfoMapper;
|
||||
@Autowired
|
||||
private TbShopUserMapper tbShopUserMapper;
|
||||
@Resource
|
||||
private TbReleaseFlowMapper integralFlowMapper;
|
||||
@Autowired
|
||||
private TbUserCouponsMapper userCouponsMapper;
|
||||
@Autowired
|
||||
private TbSplitAccountsMapper splitAccountsMapper;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void integralAdd(JSONObject jsonObject) throws ParseException {
|
||||
String type = jsonObject.getString("type");
|
||||
if (type.equals("trade")){
|
||||
//优惠券兑换积分
|
||||
Integer integralId = jsonObject.getInteger("integralId");
|
||||
TbUserCoupons userCoupons = userCouponsMapper.selectByPrimaryKey(integralId);
|
||||
if (Objects.isNull(userCoupons) || !"0".equals(userCoupons.getStatus())){
|
||||
throw new MsgException("优惠券已被使用");
|
||||
}
|
||||
userCoupons.setStatus("trade");
|
||||
userCoupons.setUpdateTime(new Date());
|
||||
userCouponsMapper.updateByPrimaryKeySelective(userCoupons);
|
||||
TbParams params = tbShopUserMapper.selectParams();
|
||||
TbReleaseFlow integralFlow = new TbReleaseFlow();
|
||||
integralFlow.setNum(userCoupons.getCouponsAmount().multiply(params.getTradeRatio()));
|
||||
integralFlow.setCreateTime(new Date());
|
||||
integralFlow.setFromSource(userCoupons.getId()+"");
|
||||
integralFlow.setType("TRADEADD");
|
||||
integralFlow.setUserId(userCoupons.getUserId());
|
||||
integralFlowMapper.insert(integralFlow);
|
||||
TbUserInfo userInfo = userInfoMapper.selectByPrimaryKey(Integer.valueOf(userCoupons.getUserId()));
|
||||
if (Objects.nonNull(userInfo)){
|
||||
userInfo.setTotalScore(userInfo.getTotalScore() + integralFlow.getNum().intValue());
|
||||
userInfoMapper.updateByPrimaryKeySelective(userInfo);
|
||||
}
|
||||
}else {
|
||||
Integer orderId = jsonObject.getInteger("orderId");
|
||||
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
|
||||
if (StringUtils.isNotBlank(orderInfo.getUserCouponId())){
|
||||
TbUserCoupons userCoupons = userCouponsMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getUserCouponId()));
|
||||
if (Objects.nonNull(userCoupons)){
|
||||
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
||||
TbSplitAccounts splitAccounts = new TbSplitAccounts();
|
||||
splitAccounts.setConponsAmount(userCoupons.getCouponsAmount());
|
||||
splitAccounts.setCreateTime(new Date());
|
||||
splitAccounts.setIsSplit("false");
|
||||
splitAccounts.setMerchantId(Integer.valueOf(shopInfo.getMerchantId()));
|
||||
splitAccounts.setShopId(shopInfo.getId());
|
||||
splitAccounts.setOrderAmount(orderInfo.getPayAmount());
|
||||
splitAccounts.setTradeDay(DateUtils.getDay());
|
||||
splitAccounts.setOriginAmount(orderInfo.getOriginAmount());
|
||||
splitAccountsMapper.insert(splitAccounts);
|
||||
}
|
||||
}
|
||||
if (Objects.isNull(orderInfo)) {
|
||||
log.error("该订单不存在");
|
||||
return;
|
||||
}
|
||||
TbShopInfo shopInfo = shopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
||||
if (Objects.isNull(shopInfo) || !"true".equals(shopInfo.getIsOpenYhq())){
|
||||
log.error("该店铺未开启优惠券功能");
|
||||
return;
|
||||
}
|
||||
|
||||
TbParams params = tbShopUserMapper.selectParams();
|
||||
TbUserCoupons userCoupons = new TbUserCoupons();
|
||||
userCoupons.setUserId(orderInfo.getUserId());
|
||||
userCoupons.setCouponsAmount(orderInfo.getOrderAmount().subtract(orderInfo.getUserCouponAmount()).multiply(params.getIntegralRatio()));
|
||||
userCoupons.setStatus("0");
|
||||
userCoupons.setOrderId(orderId);
|
||||
userCoupons.setCouponsPrice(userCoupons.getCouponsAmount().multiply(new BigDecimal("0.5")));
|
||||
userCoupons.setCreateTime(new Date());
|
||||
userCoupons.setEndTime(DateUtils.getNewDate(new Date(),3,30));
|
||||
//执行插入方法
|
||||
userCouponsMapper.insert(userCoupons);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,40 +3,35 @@ package com.chaozhanggui.system.cashierservice.service;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chaozhanggui.system.cashierservice.constant.TableConstant;
|
||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.ShopEatTypeInfoDTO;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbOrderDetailMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbOrderInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopTableMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderDetail;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbOrderInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopTable;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.OrderVo;
|
||||
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
||||
import com.chaozhanggui.system.cashierservice.mapper.MpCashierCartMapper;
|
||||
import com.chaozhanggui.system.cashierservice.mapper.MpOrderDetailMapper;
|
||||
import com.chaozhanggui.system.cashierservice.mapper.MpOrderInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.mapper.MpShopInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.rabbit.RabbitProducer;
|
||||
import com.chaozhanggui.system.cashierservice.redis.RedisCst;
|
||||
import com.chaozhanggui.system.cashierservice.redis.RedisUtil;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import com.chaozhanggui.system.cashierservice.util.N;
|
||||
import com.chaozhanggui.system.cashierservice.util.RedisUtils;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -46,8 +41,6 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class OrderService {
|
||||
|
||||
@Resource
|
||||
private RabbitProducer producer;
|
||||
|
||||
@Resource
|
||||
private TbOrderInfoMapper orderInfoMapper;
|
||||
@@ -57,36 +50,10 @@ public class OrderService {
|
||||
|
||||
@Resource
|
||||
private TbShopTableMapper shopTableMapper;
|
||||
@Resource
|
||||
private TbProductSkuMapper productSkuMapper;
|
||||
|
||||
@Resource
|
||||
private TbUserInfoMapper userInfoMapper;
|
||||
@Autowired
|
||||
private TbWiningUserMapper tbWiningUserMapper;
|
||||
|
||||
@Resource
|
||||
private TbOrderDetailMapper tbOrderDetailMapper;
|
||||
@Autowired
|
||||
private TbReleaseFlowMapper releaseFlowMapper;
|
||||
@Resource
|
||||
private TbParamsMapper paramsMapper;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private RedisUtils redisUtils;
|
||||
@Resource
|
||||
private TbUserCouponsMapper userCouponsMapper;
|
||||
@Resource
|
||||
private TbSystemCouponsMapper systemCouponsMapper;
|
||||
@Autowired
|
||||
private TbYhqParamsMapper yhqParamsMapper;
|
||||
@Autowired
|
||||
private TbShopUserMapper shopUserMapper;
|
||||
|
||||
|
||||
@Autowired
|
||||
private TbOrderInfoMapper tbOrderInfoMapper;
|
||||
@Autowired
|
||||
private MpCashierCartMapper mpCashierCartMapper;
|
||||
@Autowired
|
||||
@@ -280,181 +247,6 @@ public class OrderService {
|
||||
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result tradeIntegral(String userId, String id) throws ParseException {
|
||||
updateIntegral(userId, id);
|
||||
return Result.success(CodeEnum.ENCRYPT);
|
||||
}
|
||||
|
||||
private void updateIntegral(String userId, String id) throws ParseException {
|
||||
|
||||
boolean lock_coin = redisUtils.lock(RedisCst.INTEGRAL_COIN_KEY + userId, 5000, TimeUnit.MILLISECONDS);
|
||||
if (lock_coin) {
|
||||
TbUserCoupons userCoupons = userCouponsMapper.selectByPrimaryKey(Integer.valueOf(id));
|
||||
if (Objects.isNull(userCoupons) || !userCoupons.getStatus().equals("0")) {
|
||||
throw new MsgException("该优惠券已被使用");
|
||||
}
|
||||
TbParams params = paramsMapper.selectByPrimaryKey(1);
|
||||
BigDecimal jfAmount = params.getTradeRatio().multiply(userCoupons.getCouponsAmount());
|
||||
TbUserInfo tbShopUser = userInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
|
||||
tbShopUser.setTotalScore(tbShopUser.getTotalScore()+jfAmount.intValue());
|
||||
userInfoMapper.updateByPrimaryKeySelective(tbShopUser);
|
||||
userCoupons.setStatus("2");
|
||||
userCoupons.setUpdateTime(new Date());
|
||||
userCouponsMapper.updateByPrimaryKeySelective(userCoupons);
|
||||
TbSystemCoupons systemCoupons = new TbSystemCoupons();
|
||||
systemCoupons.setEndTime(DateUtils.getNewDate(new Date(),3,30));
|
||||
systemCoupons.setCouponsAmount(userCoupons.getCouponsAmount());
|
||||
systemCoupons.setCouponsPrice(userCoupons.getCouponsPrice());
|
||||
systemCoupons.setStatus("0");
|
||||
systemCoupons.setName(userCoupons.getCouponsAmount()+"无门槛优惠券");
|
||||
systemCoupons.setCreateTime(new Date());
|
||||
String typeName = findName(userCoupons.getCouponsAmount());
|
||||
systemCoupons.setTypeName(typeName);
|
||||
systemCouponsMapper.insert(systemCoupons);
|
||||
TbReleaseFlow releaseFlow = new TbReleaseFlow();
|
||||
releaseFlow.setNum(jfAmount);
|
||||
releaseFlow.setCreateTime(new Date());
|
||||
releaseFlow.setFromSource("OWER");
|
||||
releaseFlow.setUserId(userId);
|
||||
releaseFlow.setOperationType("ADD");
|
||||
releaseFlow.setType("EXCHANGEADD");
|
||||
releaseFlow.setRemark("兑换增加");
|
||||
releaseFlowMapper.insert(releaseFlow);
|
||||
redisUtils.releaseLock(RedisCst.INTEGRAL_COIN_KEY + userId);
|
||||
} else {
|
||||
updateIntegral(userId, id);
|
||||
}
|
||||
}
|
||||
|
||||
private String findName(BigDecimal amount) {
|
||||
List<TbYhqParams> list = yhqParamsMapper.selectAll();
|
||||
String typeName = "";
|
||||
for (TbYhqParams yhqParams:list){
|
||||
if (N.egt(amount,yhqParams.getMinPrice()) && N.gt(yhqParams.getMaxPrice(),amount)){
|
||||
typeName = yhqParams.getName();
|
||||
break;
|
||||
}
|
||||
}
|
||||
return typeName;
|
||||
}
|
||||
|
||||
|
||||
public Result mineCoupons(String userId, String orderId,String status, Integer page, Integer size) {
|
||||
BigDecimal amount=null;
|
||||
if(ObjectUtil.isNotNull(orderId)&&ObjectUtil.isNotEmpty(orderId)){
|
||||
TbOrderInfo orderInfo= tbOrderInfoMapper.selectByPrimaryKey(Integer.valueOf(orderId));
|
||||
amount=orderInfo.getOriginAmount();
|
||||
}
|
||||
|
||||
|
||||
PageHelper.startPage(page, size);
|
||||
List<TbUserCoupons> list = userCouponsMapper.selectByUserId(userId,status,amount);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
||||
}
|
||||
|
||||
public Result findCoupons(String type, Integer page, Integer size) {
|
||||
PageHelper.startPage(page, size);
|
||||
List<TbSystemCoupons> list = systemCouponsMapper.selectAll(type);
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
||||
}
|
||||
|
||||
public Result findWiningUser() {
|
||||
String day = DateUtils.getDay();
|
||||
List<TbWiningUser> list = tbWiningUserMapper.selectAllByTrade(day);
|
||||
return Result.success(CodeEnum.SUCCESS, list);
|
||||
}
|
||||
|
||||
public Result getYhqPara() {
|
||||
List<TbYhqParams> list = yhqParamsMapper.selectAll();
|
||||
return Result.success(CodeEnum.SUCCESS, list);
|
||||
}
|
||||
|
||||
public Result testPay(Integer orderId) {
|
||||
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
|
||||
orderInfo.setStatus("closed");
|
||||
orderInfo.setPayType("wx_lite");
|
||||
orderInfo.setPayOrderNo("test");
|
||||
orderInfo.setPayAmount(orderInfo.getOrderAmount());
|
||||
orderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
||||
JSONObject jsonObject=new JSONObject();
|
||||
jsonObject.put("token",0);
|
||||
jsonObject.put("type","wxcreate");
|
||||
jsonObject.put("orderId",orderId.toString());
|
||||
producer.putOrderCollect(jsonObject.toJSONString());
|
||||
JSONObject coupons = new JSONObject();
|
||||
coupons.put("type","buy");
|
||||
coupons.put("orderId",orderId);
|
||||
producer.printCoupons(coupons.toJSONString());
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
public Result getYhqDouble(Integer orderId) {
|
||||
TbUserCoupons userCoupons = userCouponsMapper.selectByOrderId(orderId);
|
||||
if (Objects.nonNull(userCoupons)){
|
||||
TbOrderInfo orderInfo = orderInfoMapper.selectByPrimaryKey(orderId);
|
||||
userCoupons.setOrderInfo(orderInfo);
|
||||
}
|
||||
return Result.success(CodeEnum.SUCCESS,userCoupons);
|
||||
}
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result yhqDouble(Integer conponsId) {
|
||||
TbUserCoupons userCoupons = userCouponsMapper.selectByPrimaryKey(conponsId);
|
||||
if (Objects.isNull(userCoupons) || userCoupons.getIsDouble().equals("true")){
|
||||
throw new MsgException("该优惠券翻倍已领取");
|
||||
}
|
||||
modityDouble(conponsId);
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
private void modityDouble(Integer conponsId) {
|
||||
|
||||
boolean lock_coin = redisUtils.lock(RedisCst.COUPONS_COIN_KEY + conponsId, 5000, TimeUnit.MILLISECONDS);
|
||||
if (lock_coin) {
|
||||
TbUserCoupons userCoupons = userCouponsMapper.selectByPrimaryKey(conponsId);
|
||||
if (Objects.isNull(userCoupons) || !userCoupons.getStatus().equals("0") || userCoupons.getIsDouble().equals("true")) {
|
||||
throw new MsgException("该优惠券已翻倍");
|
||||
}
|
||||
TbParams params = shopUserMapper.selectParams();
|
||||
userCoupons.setIsDouble("true");
|
||||
userCoupons.setCouponsAmount(userCoupons.getCouponsAmount().multiply(params.getTwoRatio()));
|
||||
userCoupons.setCouponsPrice(userCoupons.getCouponsPrice().multiply(params.getTwoRatio()));
|
||||
userCoupons.setUpdateTime(new Date());
|
||||
userCouponsMapper.updateByPrimaryKeySelective(userCoupons);
|
||||
redisUtils.releaseLock(RedisCst.COUPONS_COIN_KEY + conponsId);
|
||||
} else {
|
||||
modityDouble(conponsId);
|
||||
}
|
||||
}
|
||||
|
||||
public Result mineWinner(Integer userId, Integer page, Integer size) {
|
||||
PageHelper.startPage(page, size);
|
||||
List<TbOrderInfo> list = orderInfoMapper.selectWinnerByUserId(userId);
|
||||
for (TbOrderInfo tbOrderInfo:list){
|
||||
if (StringUtils.isNotEmpty(tbOrderInfo.getWinnnerNo())){
|
||||
tbOrderInfo.setIsWinner("true");
|
||||
}else {
|
||||
tbOrderInfo.setIsWinner("false");
|
||||
}
|
||||
}
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
if (page > pageInfo.getPages()) {
|
||||
pageInfo.setList(Collections.emptyList());
|
||||
}
|
||||
return Result.success(CodeEnum.SUCCESS, pageInfo);
|
||||
}
|
||||
|
||||
public Result kc() {
|
||||
List<TbProductSku> list = productSkuMapper.selectAll();
|
||||
for (TbProductSku productSku:list){
|
||||
redisUtil.saveMessage(RedisCst.PRODUCT + productSku.getShopId() + ":" +productSku.getId(),"10000");
|
||||
}
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
public Object orderDetail(Integer orderId) {
|
||||
|
||||
TbOrderInfo orderInfo = mpOrderInfoMapper.selectOne(new LambdaQueryWrapper<TbOrderInfo>()
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
@@ -5,22 +5,22 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||
import cn.hutool.extra.qrcode.QrConfig;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbReleaseFlow;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbShopUserMapper;
|
||||
import com.chaozhanggui.system.cashierservice.dao.TbUserInfoMapper;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopUser;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbUserInfo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.IntegralFlowVo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.IntegralVo;
|
||||
import com.chaozhanggui.system.cashierservice.entity.vo.OpenMemberVo;
|
||||
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
||||
import com.chaozhanggui.system.cashierservice.redis.RedisCst;
|
||||
import com.chaozhanggui.system.cashierservice.sign.CodeEnum;
|
||||
import com.chaozhanggui.system.cashierservice.sign.Result;
|
||||
import com.chaozhanggui.system.cashierservice.util.*;
|
||||
import com.chaozhanggui.system.cashierservice.util.CacheMap;
|
||||
import com.chaozhanggui.system.cashierservice.util.JSONUtil;
|
||||
import com.chaozhanggui.system.cashierservice.util.MD5Util;
|
||||
import com.chaozhanggui.system.cashierservice.util.RedisUtils;
|
||||
import com.chaozhanggui.system.cashierservice.wxUtil.WxAccountUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -35,8 +35,6 @@ import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Service
|
||||
public class UserService {
|
||||
@@ -45,14 +43,8 @@ public class UserService {
|
||||
@Autowired
|
||||
private TbShopUserMapper shopUserMapper;
|
||||
@Autowired
|
||||
private TbReleaseFlowMapper releaseFlowMapper;
|
||||
@Autowired
|
||||
private TbUserInfoMapper userInfoMapper;
|
||||
@Autowired
|
||||
private TbUserCouponsMapper userCouponsMapper;
|
||||
@Autowired
|
||||
private TbSystemCouponsMapper systemCouponsMapper;
|
||||
@Autowired
|
||||
RedisUtils redisUtils;
|
||||
@Qualifier("tbShopInfoMapper")
|
||||
@Autowired
|
||||
@@ -69,48 +61,6 @@ public class UserService {
|
||||
this.resourceLoader = resourceLoader;
|
||||
}
|
||||
|
||||
public JSONObject modityIntegral(IntegralVo integralVo, String userSign) {
|
||||
JSONObject object = (JSONObject) JSONObject.toJSON(integralVo);
|
||||
if (N.gt(BigDecimal.ZERO, integralVo.getNum())) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "fail");
|
||||
result.put("msg", "积分数量不允许小于0");
|
||||
result.put("data", "");
|
||||
return result;
|
||||
}
|
||||
object.put("userSign", userSign);
|
||||
|
||||
JSONObject jsonObject = JSONUtil.sortJSONObject(object, CacheMap.map);
|
||||
System.out.println(jsonObject.toJSONString());
|
||||
String sign = MD5Util.encrypt(jsonObject.toJSONString());
|
||||
if (!sign.equals(integralVo.getSign())) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "fail");
|
||||
result.put("msg", "签名验证失败");
|
||||
result.put("data", "");
|
||||
return result;
|
||||
}
|
||||
TbShopUser shopUser = shopUserMapper.selectByOpenId(integralVo.getOpenId());
|
||||
if (Objects.isNull(shopUser)) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "fail");
|
||||
result.put("msg", "用户不存在");
|
||||
result.put("data", "");
|
||||
return result;
|
||||
}
|
||||
boolean falg = updateIntegral(shopUser.getUserId(), integralVo.getNum(), integralVo.getType());
|
||||
if (!falg) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "fail");
|
||||
result.put("msg", "余额不足");
|
||||
result.put("data", "");
|
||||
return result;
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "success");
|
||||
result.put("msg", "操作成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
IntegralVo integralVo = new IntegralVo();
|
||||
@@ -125,136 +75,9 @@ public class UserService {
|
||||
System.out.println("加密后签名:" + sign);
|
||||
}
|
||||
|
||||
private Boolean updateIntegral(String userId, BigDecimal num, String type) {
|
||||
|
||||
boolean lock_coin = redisUtils.lock(RedisCst.INTEGRAL_COIN_KEY + userId, 5000, TimeUnit.MILLISECONDS);
|
||||
if (lock_coin) {
|
||||
TbUserInfo tbShopUser = userInfoMapper.selectByPrimaryKey(Integer.valueOf(userId));
|
||||
boolean flag = true;
|
||||
if (type.equals("sub")) {
|
||||
if (num.intValue() < tbShopUser.getTotalScore()) {
|
||||
flag = false;
|
||||
} else {
|
||||
tbShopUser.setTotalScore(tbShopUser.getTotalScore() - num.intValue());
|
||||
}
|
||||
} else if (type.equals("add")) {
|
||||
tbShopUser.setTotalScore(tbShopUser.getTotalScore() + num.intValue());
|
||||
}
|
||||
if (flag) {
|
||||
TbReleaseFlow releaseFlow = new TbReleaseFlow();
|
||||
releaseFlow.setNum(num);
|
||||
releaseFlow.setCreateTime(new Date());
|
||||
releaseFlow.setFromSource("OWER");
|
||||
releaseFlow.setUserId(userId);
|
||||
if (type.equals("sub")) {
|
||||
releaseFlow.setType("BUYSUB");
|
||||
releaseFlow.setOperationType("SUB");
|
||||
releaseFlow.setRemark("购买商品扣除");
|
||||
} else if (type.equals("sub")) {
|
||||
releaseFlow.setType("THREEADD");
|
||||
releaseFlow.setOperationType("ADD");
|
||||
releaseFlow.setRemark("退货增加");
|
||||
}
|
||||
releaseFlowMapper.insert(releaseFlow);
|
||||
userInfoMapper.updateByPrimaryKeySelective(tbShopUser);
|
||||
}
|
||||
redisUtils.releaseLock(RedisCst.INTEGRAL_COIN_KEY + userId);
|
||||
return flag;
|
||||
} else {
|
||||
return updateIntegral(userId, num, type);
|
||||
}
|
||||
}
|
||||
|
||||
public JSONObject userIntegral(IntegralFlowVo integralFlowVo, String userSign) {
|
||||
JSONObject object = (JSONObject) JSONObject.toJSON(integralFlowVo);
|
||||
object.put("userSign", userSign);
|
||||
JSONObject jsonObject = JSONUtil.sortJSONObject(object, CacheMap.map);
|
||||
System.out.println(jsonObject.toJSONString());
|
||||
String sign = MD5Util.encrypt(jsonObject.toJSONString());
|
||||
if (!sign.equals(integralFlowVo.getSign())) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "fail");
|
||||
result.put("msg", "签名验证失败");
|
||||
result.put("data", "");
|
||||
return result;
|
||||
}
|
||||
TbUserInfo shopUser = userInfoMapper.selectByOpenId(integralFlowVo.getOpenId());
|
||||
if (Objects.isNull(shopUser)) {
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "fail");
|
||||
result.put("msg", "用户不存在");
|
||||
result.put("data", "");
|
||||
return result;
|
||||
}
|
||||
PageHelper.startPage(integralFlowVo.getPage(), integralFlowVo.getPageSize());
|
||||
PageHelper.orderBy("id DESC");
|
||||
List<TbReleaseFlow> list = releaseFlowMapper.selectByUserId(shopUser.getId().toString());
|
||||
for (TbReleaseFlow tbReleaseFlow:list){
|
||||
tbReleaseFlow.setCreateTr(DateUtils.getStrTime(tbReleaseFlow.getCreateTime()));
|
||||
}
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "success");
|
||||
result.put("msg", "成功");
|
||||
result.put("data", list);
|
||||
return result;
|
||||
}
|
||||
|
||||
public JSONObject userAllIntegral(IntegralFlowVo integralFlowVo, String userSign) {
|
||||
// JSONObject object = (JSONObject) JSONObject.toJSON(integralFlowVo);
|
||||
// object.put("userSign", userSign);
|
||||
// JSONObject jsonObject = JSONUtil.sortJSONObject(object, CacheMap.notOpenMap);
|
||||
// System.out.println(jsonObject.toJSONString());
|
||||
// String sign = MD5Util.encrypt(jsonObject.toJSONString());
|
||||
// if (!sign.equals(integralFlowVo.getSign())) {
|
||||
// JSONObject result = new JSONObject();
|
||||
// result.put("status", "fail");
|
||||
// result.put("msg", "签名验证失败");
|
||||
// result.put("data", "");
|
||||
// return result;
|
||||
// }
|
||||
PageHelper.startPage(integralFlowVo.getPage(), integralFlowVo.getPageSize());
|
||||
PageHelper.orderBy("id DESC");
|
||||
List<TbReleaseFlow> list = releaseFlowMapper.selectAll();
|
||||
for (TbReleaseFlow tbReleaseFlow:list){
|
||||
tbReleaseFlow.setCreateTr(DateUtils.getStrTime(tbReleaseFlow.getCreateTime()));
|
||||
}
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "success");
|
||||
result.put("msg", "成功");
|
||||
result.put("data", pageInfo);
|
||||
return result;
|
||||
}
|
||||
|
||||
public JSONObject userAll(IntegralFlowVo integralFlowVo, String userSign) {
|
||||
// JSONObject object = (JSONObject) JSONObject.toJSON(integralFlowVo);
|
||||
// object.put("userSign", userSign);
|
||||
// JSONObject jsonObject = JSONUtil.sortJSONObject(object, CacheMap.notOpenMap);
|
||||
// System.out.println(jsonObject.toJSONString());
|
||||
// String sign = MD5Util.encrypt(jsonObject.toJSONString());
|
||||
// if (!sign.equals(integralFlowVo.getSign())) {
|
||||
// JSONObject result = new JSONObject();
|
||||
// result.put("status", "fail");
|
||||
// result.put("msg", "签名验证失败");
|
||||
// result.put("data", "");
|
||||
// return result;
|
||||
// }
|
||||
PageHelper.startPage(integralFlowVo.getPage(), integralFlowVo.getPageSize());
|
||||
PageHelper.orderBy("id DESC");
|
||||
List<TbUserInfo> list = userInfoMapper.selectAll();
|
||||
PageInfo pageInfo = new PageInfo(list);
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", "success");
|
||||
result.put("msg", "成功");
|
||||
result.put("data", pageInfo);
|
||||
return result;
|
||||
}
|
||||
|
||||
public int userCoupon(String userId, BigDecimal orderNum) {
|
||||
int userNum = userCouponsMapper.selectByUserIdAndAmount(userId,orderNum);
|
||||
int sysNum = systemCouponsMapper.selectByAmount(orderNum);
|
||||
return userNum+sysNum;
|
||||
}
|
||||
|
||||
public String getSubQrCode(String shopId) throws Exception {
|
||||
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(shopId));
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,178 +1,22 @@
|
||||
package com.chaozhanggui.system.cashierservice.task;
|
||||
|
||||
import com.chaozhanggui.system.cashierservice.dao.*;
|
||||
import com.chaozhanggui.system.cashierservice.entity.*;
|
||||
import com.chaozhanggui.system.cashierservice.service.TbShopSongOrderService;
|
||||
import com.chaozhanggui.system.cashierservice.util.DateUtils;
|
||||
import com.chaozhanggui.system.cashierservice.util.NicknameGenerator;
|
||||
import com.chaozhanggui.system.cashierservice.util.RandomUtil;
|
||||
import lombok.SneakyThrows;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.ParseException;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
@Component
|
||||
public class TaskScheduler {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(TaskScheduler.class);
|
||||
@Autowired
|
||||
private TbWiningUserMapper tbWiningUserMapper;
|
||||
@Autowired
|
||||
private TbOrderInfoMapper orderInfoMapper;
|
||||
@Autowired
|
||||
private TbWiningParamsMapper winingParamsMapper;
|
||||
@Autowired
|
||||
private TbUserInfoMapper userInfoMapper;
|
||||
@Autowired
|
||||
private TbReleaseFlowMapper releaseFlowMapper;
|
||||
@Autowired
|
||||
private TbUserCouponsMapper userCouponsMapper;
|
||||
|
||||
private final TbShopSongOrderService shopSongOrderService;
|
||||
|
||||
public TaskScheduler(@Qualifier("tbShopSongOrderServiceImpl") TbShopSongOrderService shopSongOrderService) {
|
||||
this.shopSongOrderService = shopSongOrderService;
|
||||
}
|
||||
|
||||
//更新订单状态
|
||||
// @Scheduled(fixedRate = 1000000)
|
||||
public void orderStatus() throws InterruptedException {
|
||||
for (int i = 0;i<10;i++){
|
||||
TbReleaseFlow releaseFlow = new TbReleaseFlow();
|
||||
BigDecimal orderAmount = RandomUtil.getRandomBigDecimal(BigDecimal.ONE, new BigDecimal("100"));
|
||||
releaseFlow.setNum(orderAmount);
|
||||
releaseFlow.setCreateTime(new Date());
|
||||
releaseFlow.setFromSource("OWER");
|
||||
releaseFlow.setUserId("15");
|
||||
releaseFlow.setOperationType("ADD");
|
||||
releaseFlow.setType("EXCHANGEADD");
|
||||
releaseFlow.setRemark("兑换增加");
|
||||
releaseFlowMapper.insert(releaseFlow);
|
||||
}
|
||||
for (int i = 0;i<10;i++){
|
||||
TbReleaseFlow releaseFlow = new TbReleaseFlow();
|
||||
BigDecimal orderAmount = RandomUtil.getRandomBigDecimal(BigDecimal.ONE, new BigDecimal("100"));
|
||||
releaseFlow.setNum(orderAmount);
|
||||
releaseFlow.setCreateTime(new Date());
|
||||
releaseFlow.setFromSource("OWER");
|
||||
releaseFlow.setUserId("15");
|
||||
releaseFlow.setOperationType("SUB");
|
||||
releaseFlow.setType("BUYSUB");
|
||||
releaseFlow.setRemark("购买商品扣除");
|
||||
releaseFlowMapper.insert(releaseFlow);
|
||||
}
|
||||
for (int i = 0;i<10;i++){
|
||||
TbReleaseFlow releaseFlow = new TbReleaseFlow();
|
||||
BigDecimal orderAmount = RandomUtil.getRandomBigDecimal(BigDecimal.ONE, new BigDecimal("100"));
|
||||
releaseFlow.setNum(orderAmount);
|
||||
releaseFlow.setCreateTime(new Date());
|
||||
releaseFlow.setFromSource("OWER");
|
||||
releaseFlow.setOperationType("ADD");
|
||||
releaseFlow.setUserId("15");
|
||||
releaseFlow.setType("THREEADD");
|
||||
releaseFlow.setRemark("退货增加");
|
||||
releaseFlowMapper.insert(releaseFlow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Scheduled(cron = "0 1 0 * * ?")
|
||||
public void winningUser() {
|
||||
String day = DateUtils.getDay();
|
||||
List<TbWiningParams> list = winingParamsMapper.selectAll();
|
||||
ThreadPoolExecutor es = new ThreadPoolExecutor(5, 10, 60L, TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<Runnable>(), new ThreadFactory() {
|
||||
@Override
|
||||
public Thread newThread(Runnable r) {
|
||||
Thread t = new Thread(r);
|
||||
t.setDaemon(true);
|
||||
return t;
|
||||
}
|
||||
});
|
||||
for (TbWiningParams winingParams : list) {
|
||||
es.submit(new winingUser(winingParams, day));
|
||||
}
|
||||
es.shutdown();
|
||||
|
||||
}
|
||||
|
||||
class winingUser implements Runnable {
|
||||
private TbWiningParams winingParams;
|
||||
private String day;
|
||||
|
||||
public winingUser(TbWiningParams winingParams, String day) {
|
||||
this.winingParams = winingParams;
|
||||
this.day = day;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
List<TbOrderInfo> list = orderInfoMapper.selectByTradeDay(day, winingParams.getMinPrice(), winingParams.getMaxPrice());
|
||||
int num = winingParams.getWiningUserNum();
|
||||
List<TbOrderInfo> newList = new ArrayList<>();
|
||||
Map<Integer, Integer> map = new HashMap<>();
|
||||
int noUserNum = winingParams.getWiningNum() - num;
|
||||
if (list.size() < num) {
|
||||
noUserNum = winingParams.getWiningNum();
|
||||
} else {
|
||||
for (int i = 0; i < num; i++) {
|
||||
TbOrderInfo orderInfo = RandomUtil.selectWinner(list, map);
|
||||
newList.add(orderInfo);
|
||||
map.put(orderInfo.getId(), 1);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < noUserNum; i++) {
|
||||
long endDate = DateUtils.convertDate1(day + " 00:00:00").getTime();
|
||||
long startDate = DateUtils.convertDate1(DateUtils.getSdfDayTimes(DateUtils.getNewDate(new Date(), 3, -1))+" 00:00:00").getTime();
|
||||
String orderNo = generateOrderNumber(startDate, endDate);
|
||||
String userName = NicknameGenerator.generateRandomWeChatNickname();
|
||||
BigDecimal orderAmount = RandomUtil.getRandomBigDecimal(winingParams.getMinPrice(), winingParams.getMaxPrice());
|
||||
TbWiningUser winingUser = new TbWiningUser(userName, orderNo, orderAmount, "false", day);
|
||||
tbWiningUserMapper.insert(winingUser);
|
||||
}
|
||||
for (TbOrderInfo orderInfo:newList){
|
||||
TbUserInfo userInfo = userInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getUserId()));
|
||||
TbWiningUser winingUser = new TbWiningUser(userInfo.getNickName(), orderInfo.getOrderNo(), orderInfo.getPayAmount(), "true", day);
|
||||
tbWiningUserMapper.insert(winingUser);
|
||||
TbUserCoupons userCoupons = new TbUserCoupons();
|
||||
userCoupons.setUserId(orderInfo.getUserId());
|
||||
userCoupons.setCouponsAmount(orderInfo.getOrderAmount().subtract(orderInfo.getUserCouponAmount()));
|
||||
userCoupons.setStatus("0");
|
||||
userCoupons.setOrderId(orderInfo.getId());
|
||||
userCoupons.setCouponsPrice(userCoupons.getCouponsAmount().multiply(new BigDecimal("0.5")));
|
||||
userCoupons.setCreateTime(new Date());
|
||||
userCoupons.setEndTime(DateUtils.getNewDate(new Date(),3,30));
|
||||
//执行插入方法
|
||||
userCouponsMapper.insert(userCoupons);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String generateOrderNumber(long startTimestamp, long endTimestamp) {
|
||||
long date = getRandomTimestamp(startTimestamp, endTimestamp);
|
||||
Random random = new Random();
|
||||
int randomNum = random.nextInt(900) + 100;
|
||||
return "WX" + date + randomNum;
|
||||
}
|
||||
|
||||
public static long getRandomTimestamp(long startTimestamp, long endTimestamp) {
|
||||
long randomMilliseconds = ThreadLocalRandom.current().nextLong(startTimestamp, endTimestamp);
|
||||
return randomMilliseconds;
|
||||
}
|
||||
|
||||
@Scheduled(fixedRate = 60000 * 60)
|
||||
public void clearSongOrder() {
|
||||
log.info("定时任务执行,清楚过期歌曲订单");
|
||||
|
||||
Reference in New Issue
Block a user