充值优惠卷
This commit is contained in:
parent
d482faae0a
commit
4e1c3ef488
|
@ -128,7 +128,7 @@ public class WebSocketServer {
|
|||
int count = i1 / i;
|
||||
for (int i2 = 0; i2 < count; i2++) {
|
||||
UserRecharge userRecharge = new UserRecharge();
|
||||
userRecharge.setArtificerId(artificer.getArtificerId().intValue());
|
||||
userRecharge.setArtificerId(artificer.getArtificerId());
|
||||
userRecharge.setUserRecharge(new BigDecimal("1"));
|
||||
userRecharge.setType("1");
|
||||
upTime = DateUtil.offsetMinute(upTime, i);
|
||||
|
|
|
@ -389,10 +389,10 @@ public class AppArtificerController {
|
|||
int count = i1 / i;
|
||||
if(count>0){
|
||||
UserRecharge userRecharge = new UserRecharge();
|
||||
userRecharge.setArtificerId(artificer.getArtificerId().intValue());
|
||||
userRecharge.setArtificerId(artificer.getArtificerId());
|
||||
userRecharge.setUserRecharge(new BigDecimal(count));
|
||||
userRecharge.setType("1");
|
||||
userRecharge.setUserId(userId.intValue());
|
||||
userRecharge.setUserId(userId);
|
||||
upTime = DateUtil.offsetMinute(upTime, i1);
|
||||
userRecharge.setCreateTime(upTime.toString());
|
||||
userRechargeDao.insert(userRecharge);
|
||||
|
@ -428,10 +428,10 @@ public class AppArtificerController {
|
|||
int count = i1 / i;
|
||||
if(count>0){
|
||||
UserRecharge userRecharge = new UserRecharge();
|
||||
userRecharge.setArtificerId(artificer.getArtificerId().intValue());
|
||||
userRecharge.setArtificerId(artificer.getArtificerId());
|
||||
userRecharge.setUserRecharge(new BigDecimal(count));
|
||||
userRecharge.setType("1");
|
||||
userRecharge.setUserId(userId.intValue());
|
||||
userRecharge.setUserId(userId);
|
||||
upTime = DateUtil.offsetMinute(upTime, i1);
|
||||
userRecharge.setCreateTime(upTime.toString());
|
||||
userRechargeDao.insert(userRecharge);
|
||||
|
|
|
@ -33,9 +33,9 @@ public class UserRecharge implements Serializable {
|
|||
/**
|
||||
* 积分类型(1在线积分2储值积分)
|
||||
*/
|
||||
private Integer artificerId;
|
||||
private Integer userId;
|
||||
private Integer ordersId;
|
||||
private Long artificerId;
|
||||
private Long userId;
|
||||
private Long ordersId;
|
||||
/**
|
||||
* 用户充值积分
|
||||
*/
|
||||
|
|
|
@ -353,7 +353,7 @@ public class ArtificerServiceImpl extends ServiceImpl<ArtificerDao, Artificer> i
|
|||
userRecharge.setCreateTime(LocalDateTime.now().toString());
|
||||
BigDecimal bigDecimal = new BigDecimal(1);
|
||||
userRecharge.setUserRecharge(bigDecimal);
|
||||
userRecharge.setArtificerId(artificerId.intValue());
|
||||
userRecharge.setArtificerId(artificerId);
|
||||
userRechargeDao.insert(userRecharge);
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,22 @@ public class CollectMassage implements Serializable {
|
|||
@TableField(exist = false)
|
||||
private String content;
|
||||
@TableField(exist = false)
|
||||
private String type;
|
||||
private Integer type;
|
||||
@TableField(exist = false)
|
||||
private String remarks;
|
||||
/**
|
||||
* 服务分类ID
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private Integer classifyId;
|
||||
/**
|
||||
* 服务分类
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String classifyName;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String typeName;
|
||||
}
|
||||
|
|
|
@ -127,6 +127,7 @@ public class UserPackageOrderServiceImpl extends ServiceImpl<UserPackageOrderDao
|
|||
BigDecimal canCouponMoney = BigDecimal.ZERO;//当可用代金券时的金额
|
||||
BigDecimal canVipMoney = BigDecimal.ZERO;//当可用vip时的金额
|
||||
BigDecimal totalMoney = BigDecimal.ZERO;//总金额
|
||||
List<Integer> classifyIdArr = Lists.newArrayList();
|
||||
List<UserPackageOrdersMapping> ordersPackageList = userPackageOrder.getOrdersPackageList();
|
||||
for (UserPackageOrdersMapping ordersPackage : ordersPackageList) {
|
||||
MassagePackage massagePackage = massagePackageService.getById(ordersPackage.getPackageId());
|
||||
|
@ -138,6 +139,8 @@ public class UserPackageOrderServiceImpl extends ServiceImpl<UserPackageOrderDao
|
|||
canVipMoney = canVipMoney.add(sum);
|
||||
}
|
||||
totalMoney = totalMoney.add(sum);
|
||||
Integer classifyId = massagePackage.getClassifyId();
|
||||
classifyIdArr.add(classifyId);
|
||||
}
|
||||
|
||||
BigDecimal couponMinMoney = BigDecimal.ZERO;//所有代金券的使用额度总和
|
||||
|
@ -157,6 +160,11 @@ public class UserPackageOrderServiceImpl extends ServiceImpl<UserPackageOrderDao
|
|||
if (!couponUser.getStatus().equals(0)) {
|
||||
return Result.error("优惠券已被使用!");
|
||||
}
|
||||
if(couponUser.getClassifyId()!=0){
|
||||
if(!classifyIdArr.contains(couponUser.getClassifyId())){
|
||||
return Result.error("优惠券不满足使用条件!");
|
||||
}
|
||||
}
|
||||
couponMinMoney = couponMinMoney.add(couponUser.getMinMoney());
|
||||
CouponUserList.add(couponUser);
|
||||
BigDecimal money= couponUser.getMoney();
|
||||
|
@ -388,4 +396,5 @@ public class UserPackageOrderServiceImpl extends ServiceImpl<UserPackageOrderDao
|
|||
String format = sdf.format(date);
|
||||
return format + newString;
|
||||
}
|
||||
|
||||
}
|
|
@ -43,5 +43,8 @@ public class Coupon implements Serializable {
|
|||
@ApiModelProperty("优惠券类型")
|
||||
private Integer couType;
|
||||
|
||||
@ApiModelProperty("分类ID,0为通用,非0为具体分类ID")
|
||||
private Integer classifyId;
|
||||
|
||||
public Coupon() {}
|
||||
}
|
|
@ -59,6 +59,9 @@ public class CouponUser implements Serializable {
|
|||
@ApiModelProperty("领取id")
|
||||
private Long couponIssueId;
|
||||
|
||||
@ApiModelProperty("分类ID,0为通用,非0为具体分类ID")
|
||||
private Integer classifyId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String nickName;
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package com.sqx.modules.pay.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.sqx.common.utils.PageUtils;
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.coupon.service.CouponService;
|
||||
import com.sqx.modules.pay.entity.PayClassify;
|
||||
import com.sqx.modules.pay.entity.PayClassifyDetail;
|
||||
import com.sqx.modules.pay.service.PayClassifyDetailService;
|
||||
import com.sqx.modules.pay.service.PayClassifyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -31,7 +31,7 @@ public class PayClassifyController {
|
|||
@Autowired
|
||||
private PayClassifyService payClassifyService;
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
private PayClassifyDetailService payClassifyDetailService;
|
||||
|
||||
|
||||
@PostMapping("/insertPayClassify")
|
||||
|
@ -47,9 +47,6 @@ public class PayClassifyController {
|
|||
@ApiOperation("修改充值分类")
|
||||
public Result updatePayClassify(@RequestBody PayClassify payClassify){
|
||||
payClassifyService.updateById(payClassify);
|
||||
if(payClassify.getCouponId()==null){
|
||||
payClassifyService.updatePayClassifyCouponId(payClassify.getPayClassifyId());
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
@ -67,14 +64,10 @@ public class PayClassifyController {
|
|||
IPage<PayClassify> page1 = payClassifyService.page(pages);
|
||||
List<PayClassify> records = page1.getRecords();
|
||||
for(PayClassify payClassify:records){
|
||||
if(payClassify.getCouponId()!=null){
|
||||
payClassify.setCoupon(couponService.getById(payClassify.getCouponId()));
|
||||
}
|
||||
List<PayClassifyDetail> list = payClassifyDetailService.findList(payClassify.getPayClassifyId());
|
||||
payClassify.setDetailList(list);
|
||||
}
|
||||
return Result.success().put("data",new PageUtils(page1));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.sqx.modules.pay.controller;
|
||||
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.pay.entity.PayClassifyDetail;
|
||||
import com.sqx.modules.pay.service.PayClassifyDetailService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author fang
|
||||
* @date 2022/4/16
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@Api(value = "充值分类子表", tags = {"充值分类子表"})
|
||||
@RequestMapping(value = "/payClassify/detail")
|
||||
public class PayClassifyDetailController {
|
||||
|
||||
@Autowired
|
||||
private PayClassifyDetailService payClassifyDetailService;
|
||||
|
||||
@PostMapping("/insertPayClassifyDetail")
|
||||
@ApiOperation("添加充值分类子表")
|
||||
public Result insertPayClassifyDetail(@RequestBody PayClassifyDetail payClassifyDetail){
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
payClassifyDetail.setCreateTime(sdf.format(new Date()));
|
||||
payClassifyDetailService.save(payClassifyDetail);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/updatePayClassifyDetail")
|
||||
@ApiOperation("修改充值分类子表")
|
||||
public Result updatePayClassifyDetail(@RequestBody PayClassifyDetail payClassifyDetail){
|
||||
payClassifyDetailService.updateById(payClassifyDetail);
|
||||
if(payClassifyDetail.getCouponId()==null){
|
||||
payClassifyDetailService.updatePayClassifyDetailCouponId(payClassifyDetail.getPayClassifyDetailId());
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/deletePayClassifyDetail")
|
||||
@ApiOperation("删除充值分类子表")
|
||||
public Result deletePayClassifyDetail(Long payClassifyDetailId){
|
||||
payClassifyDetailService.removeById(payClassifyDetailId);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@GetMapping("/selectPayClassifyDetailList")
|
||||
@ApiOperation("查询充值分类子表")
|
||||
public Result selectPayClassifyDetailList(@RequestBody PayClassifyDetail payClassifyDetail){
|
||||
return Result.success().put("data",payClassifyDetailService.findList(payClassifyDetail.getPayClassifyId()));
|
||||
}
|
||||
|
||||
}
|
|
@ -24,6 +24,7 @@ import com.sqx.modules.app.dao.VipDetailsDao;
|
|||
import com.sqx.modules.app.entity.*;
|
||||
import com.sqx.modules.app.service.*;
|
||||
import com.sqx.modules.artificer.dao.OrdersDao;
|
||||
import com.sqx.modules.artificer.dao.UserRechargeDao;
|
||||
import com.sqx.modules.artificer.entity.*;
|
||||
import com.sqx.modules.artificer.service.*;
|
||||
import com.sqx.modules.bl.massage.entity.MassagePackage;
|
||||
|
@ -51,7 +52,9 @@ import com.sqx.modules.message.service.MessageService;
|
|||
import com.sqx.modules.pay.config.AliPayConstants;
|
||||
import com.sqx.modules.pay.dao.PayDetailsDao;
|
||||
import com.sqx.modules.pay.entity.PayClassify;
|
||||
import com.sqx.modules.pay.entity.PayClassifyDetail;
|
||||
import com.sqx.modules.pay.entity.PayDetails;
|
||||
import com.sqx.modules.pay.service.PayClassifyDetailService;
|
||||
import com.sqx.modules.pay.service.PayClassifyService;
|
||||
import com.sqx.modules.utils.AmountCalUtils;
|
||||
import com.sqx.modules.utils.SenInfoCheckUtil;
|
||||
|
@ -105,6 +108,8 @@ public class AliPayController {
|
|||
@Autowired
|
||||
private PayClassifyService payClassifyService;
|
||||
@Autowired
|
||||
private PayClassifyDetailService payClassifyDetailService;
|
||||
@Autowired
|
||||
private CouponUserService couponUserService;
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
|
@ -132,6 +137,8 @@ public class AliPayController {
|
|||
UserPackageDetailService userPackageDetailService;
|
||||
@Autowired
|
||||
UserPackageOrdersMappingService userPackageOrdersMappingService;
|
||||
@Autowired
|
||||
private UserRechargeDao userRechargeDao;
|
||||
|
||||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
|
@ -398,44 +405,62 @@ public class AliPayController {
|
|||
userMoneyDetails.setBalance(userNowMoney.getMoney());
|
||||
userMoneyDetails.setUserId(payDetails.getUserId());
|
||||
userMoneyDetails.setTitle("支付宝充值");
|
||||
userMoneyDetails.setContent("支付宝充值:"+payClassify.getPrice());
|
||||
userMoneyDetails.setContent("支付宝花费:"+payClassify.getPrice()+",钱包增加余额:"+payClassify.getMoney());
|
||||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setState(2);
|
||||
userMoneyDetails.setMoney(payClassify.getPrice());
|
||||
userMoneyDetails.setMoney(payClassify.getMoney());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
userMoneyDetails.setCreateTime(sdf.format(new Date()));
|
||||
userMoneyDetails.setBlRole(1);
|
||||
userMoneyDetails.setBlFlag(1);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
userMoneyDetails.setTitle("支付宝充值");
|
||||
userMoneyDetails.setContent("支付宝花费:"+payClassify.getPrice());
|
||||
userMoneyDetails.setMoney(payClassify.getPrice());
|
||||
userMoneyDetails.setType(2);
|
||||
userMoneyDetails.setBlRole(1);
|
||||
userMoneyDetails.setBlFlag(2);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
|
||||
|
||||
if(payClassify.getCouponId()!=null && payClassify.getGiveNum()>0){
|
||||
for(int i=0;i<payClassify.getGiveNum();i++){
|
||||
Coupon coupon = couponService.getById(payClassify.getCouponId());
|
||||
Integer endDate = coupon.getEndDate();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, endDate);
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
Date date = calendar.getTime();
|
||||
String expirationTime = sdf.format(date);
|
||||
CouponUser couponUser=new CouponUser();
|
||||
couponUser.setUserId(payDetails.getUserId());
|
||||
couponUser.setCouponName(coupon.getCouponName());
|
||||
couponUser.setCouponPicture(coupon.getCouponPicture());
|
||||
couponUser.setCreateTime(DateUtils.format(new Date()));
|
||||
couponUser.setExpirationTime(expirationTime);
|
||||
couponUser.setMinMoney(coupon.getMinMoney());
|
||||
couponUser.setMoney(coupon.getMoney());
|
||||
couponUser.setStatus(0);
|
||||
couponUserService.save(couponUser);
|
||||
List<PayClassifyDetail> list = payClassifyDetailService.findList(payClassify.getPayClassifyId());
|
||||
if(list!=null && list.size()>0){
|
||||
for(int m=0;m<list.size();m++){
|
||||
PayClassifyDetail pcd = list.get(m);
|
||||
Coupon coupon = pcd.getCoupon();
|
||||
for(int i=0;i<pcd.getGiveNum();i++){
|
||||
Integer endDate = coupon.getEndDate();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, endDate);
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
Date date = calendar.getTime();
|
||||
String expirationTime = sdf.format(date);
|
||||
CouponUser couponUser = new CouponUser();
|
||||
couponUser.setUserId(payDetails.getUserId());
|
||||
couponUser.setCouponName(coupon.getCouponName());
|
||||
couponUser.setCouponPicture(coupon.getCouponPicture());
|
||||
couponUser.setCreateTime(DateUtils.format(new Date()));
|
||||
couponUser.setExpirationTime(expirationTime);
|
||||
couponUser.setMinMoney(coupon.getMinMoney());
|
||||
couponUser.setMoney(coupon.getMoney());
|
||||
couponUser.setClassifyId(coupon.getClassifyId());
|
||||
couponUser.setStatus(0);
|
||||
couponUserService.save(couponUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//用户在充值余额时,指定技师ID,则充值成功后给指定技师增加业绩,入userRecharge表
|
||||
if(payDetails.getArtificerId()!=null){
|
||||
UserRecharge o = new UserRecharge();
|
||||
o.setUserRecharge(payClassify.getPrice());
|
||||
o.setType("2");
|
||||
o.setUserId(payDetails.getUserId());
|
||||
o.setArtificerId(payDetails.getArtificerId());
|
||||
o.setCreateTime(DateUtils.format(new Date()));
|
||||
userRechargeDao.insert(o);
|
||||
}
|
||||
|
||||
}else if(payDetails.getType()==4){
|
||||
Long couponIssueId = Long.parseLong(payDetails.getRemark());
|
||||
Long userId=payDetails.getUserId();
|
||||
|
@ -554,45 +579,7 @@ public class AliPayController {
|
|||
|
||||
}else if(payDetails.getType()==6){
|
||||
double money=payDetails.getMoney();
|
||||
//此处属于打赏,不涉及充值增代金券
|
||||
// if(StringUtils.isNotBlank(payDetails.getRemark())){
|
||||
// PayClassify payClassify = payClassifyService.getById(Long.parseLong(payDetails.getRemark()));
|
||||
// if(payClassify.getCouponId()!=null && payClassify.getGiveNum()>0){
|
||||
// for(int i=0;i<payClassify.getGiveNum();i++){
|
||||
// Coupon coupon = couponService.getById(payClassify.getCouponId());
|
||||
// Integer endDate = coupon.getEndDate();
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.add(Calendar.DATE, endDate);
|
||||
// calendar.add(Calendar.DATE, 1);
|
||||
// Date date = calendar.getTime();
|
||||
// String expirationTime = sdf.format(date);
|
||||
// CouponUser couponUser=new CouponUser();
|
||||
// couponUser.setUserId(payDetails.getUserId());
|
||||
// couponUser.setCouponName(coupon.getCouponName());
|
||||
// couponUser.setCouponPicture(coupon.getCouponPicture());
|
||||
// couponUser.setCreateTime(DateUtils.format(new Date()));
|
||||
// couponUser.setExpirationTime(expirationTime);
|
||||
// couponUser.setMinMoney(coupon.getMinMoney());
|
||||
// couponUser.setMoney(coupon.getMoney());
|
||||
// couponUser.setStatus(0);
|
||||
// couponUserService.save(couponUser);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//2024-06-15注释掉,user_money_artificer 表一直没用上。用的是 user_money_details 表
|
||||
long artificerId = Long.parseLong(payDetails.getRemark());
|
||||
// UserMoneyArtificer userMoneyArtificer = userMoneyArtificerService.getOne(new QueryWrapper<UserMoneyArtificer>().eq("user_id", payDetails.getUserId()).eq("artificer_id", artificerId));
|
||||
// if(userMoneyArtificer==null){
|
||||
// userMoneyArtificer=new UserMoneyArtificer();
|
||||
// userMoneyArtificer.setUserId(payDetails.getUserId());
|
||||
// userMoneyArtificer.setArtificerId(artificerId);
|
||||
// userMoneyArtificer.setMoney(BigDecimal.valueOf(money));
|
||||
// userMoneyArtificer.setCreateTime(DateUtils.format(new Date()));
|
||||
// userMoneyArtificerService.save(userMoneyArtificer);
|
||||
// }else{
|
||||
// userMoneyArtificerService.updateMoney(1, payDetails.getUserId(), artificerId,money);
|
||||
// }
|
||||
Artificer artificer = artificerService.getById(artificerId);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
//用户流水
|
||||
|
@ -881,7 +868,7 @@ public class AliPayController {
|
|||
@ApiOperation("支付宝支付订单")
|
||||
@RequestMapping(value = "/payOrderMoney", method = RequestMethod.POST)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result payOrderMoney(@RequestAttribute Long userId, Long payClassifyId, Integer type) {
|
||||
public Result payOrderMoney(@RequestAttribute Long userId, Long payClassifyId, Integer type, Long artificerId) {
|
||||
//通知页面地址
|
||||
CommonInfo one = commonInfoService.findOne(19);
|
||||
String returnUrl = one.getValue() + "/#/pages/my/index";
|
||||
|
@ -897,6 +884,7 @@ public class AliPayController {
|
|||
payDetails.setMoney(payClassify.getPrice().doubleValue());
|
||||
payDetails.setClassify(6);
|
||||
payDetails.setType(3);
|
||||
payDetails.setArtificerId(artificerId);
|
||||
payDetails.setRemark(String.valueOf(payClassifyId));
|
||||
payDetailsDao.insert(payDetails);
|
||||
if (type == 1) {
|
||||
|
|
|
@ -37,8 +37,8 @@ public class ApiWeiXinPayController {
|
|||
@Login
|
||||
@ApiOperation("微信充值余额")
|
||||
@PostMapping("/payMoney")
|
||||
public Result payMoney(@RequestAttribute("userId") Long userId,Long payClassifyId,Integer type,HttpServletRequest request) throws Exception {
|
||||
return wxService.payMoney(userId,payClassifyId,type,request);
|
||||
public Result payMoney(@RequestAttribute("userId") Long userId,Long payClassifyId,Integer type,Long artificerId,HttpServletRequest request) throws Exception {
|
||||
return wxService.payMoney(userId,payClassifyId,type,artificerId,request);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,8 +2,11 @@ package com.sqx.modules.pay.controller.app;
|
|||
|
||||
|
||||
import com.sqx.common.utils.Result;
|
||||
import com.sqx.modules.coupon.entity.Coupon;
|
||||
import com.sqx.modules.coupon.service.CouponService;
|
||||
import com.sqx.modules.pay.entity.PayClassify;
|
||||
import com.sqx.modules.pay.entity.PayClassifyDetail;
|
||||
import com.sqx.modules.pay.service.PayClassifyDetailService;
|
||||
import com.sqx.modules.pay.service.PayClassifyService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
@ -13,6 +16,7 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
@ -28,22 +32,40 @@ public class AppPayClassifyController {
|
|||
@Autowired
|
||||
private PayClassifyService payClassifyService;
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
|
||||
private PayClassifyDetailService payClassifyDetailService;
|
||||
|
||||
@GetMapping("/selectPayClassifyList")
|
||||
@ApiOperation("查询充值分类")
|
||||
public Result selectPayClassifyList(){
|
||||
List<PayClassify> list = payClassifyService.list();
|
||||
for(PayClassify payClassify:list){
|
||||
if(payClassify.getCouponId()!=null){
|
||||
payClassify.setCoupon(couponService.getById(payClassify.getCouponId()));
|
||||
for(PayClassify payClassify : list){
|
||||
BigDecimal sumMoney = BigDecimal.ZERO;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
BigDecimal price = payClassify.getPrice();
|
||||
BigDecimal money = payClassify.getMoney();
|
||||
sumMoney = sumMoney.add(money);
|
||||
if(price.compareTo(money) != 0){
|
||||
sb.append(money);
|
||||
sb.append("余额");
|
||||
sb.append(" ");
|
||||
}
|
||||
List<PayClassifyDetail> detailList = payClassifyDetailService.findList(payClassify.getPayClassifyId());
|
||||
for(PayClassifyDetail classifyDetail : detailList){
|
||||
Integer giveNum = classifyDetail.getGiveNum();
|
||||
sb.append(giveNum);
|
||||
sb.append("张");
|
||||
Coupon coupon = classifyDetail.getCoupon();
|
||||
BigDecimal couponMoney = coupon.getMoney();
|
||||
sb.append(couponMoney);
|
||||
sb.append("元卷");
|
||||
sb.append(" ");
|
||||
BigDecimal sumCouponMoney = couponMoney.multiply(new BigDecimal(giveNum));
|
||||
sumMoney = sumMoney.add(sumCouponMoney);
|
||||
}
|
||||
payClassify.setSumMoney(sumMoney);
|
||||
payClassify.setRemarks(sb.toString());
|
||||
}
|
||||
return Result.success().put("data",list);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.sqx.modules.pay.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.sqx.modules.pay.entity.PayClassifyDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author caolei
|
||||
* @date 2024/06/18
|
||||
*/
|
||||
@Mapper
|
||||
public interface PayClassifyDetailDao extends BaseMapper<PayClassifyDetail> {
|
||||
|
||||
List<PayClassifyDetail> findList(Long payClassifyId);
|
||||
|
||||
int updatePayClassifyDetailCouponId(Long payClassifyDetailId);
|
||||
|
||||
}
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description pay_classify
|
||||
|
@ -33,14 +34,17 @@ public class PayClassify implements Serializable {
|
|||
private BigDecimal money;
|
||||
|
||||
/**
|
||||
* 优惠券
|
||||
* 优惠券-作废
|
||||
*/
|
||||
private Long couponId;
|
||||
// private Long couponId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Coupon coupon;
|
||||
/**
|
||||
* 赠送数量-作废
|
||||
*/
|
||||
// private Integer giveNum;
|
||||
|
||||
private Integer giveNum;
|
||||
// @TableField(exist = false)
|
||||
// private Coupon coupon;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
|
@ -52,5 +56,23 @@ public class PayClassify implements Serializable {
|
|||
*/
|
||||
private String createTime;
|
||||
|
||||
/**
|
||||
* 子表列表
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<PayClassifyDetail> detailList;
|
||||
|
||||
/**
|
||||
* 获取金额
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private BigDecimal sumMoney;
|
||||
|
||||
/**
|
||||
* APP购买描述
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String remarks;
|
||||
|
||||
public PayClassify() {}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
package com.sqx.modules.pay.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.sqx.modules.coupon.entity.Coupon;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @description pay_classify_detail
|
||||
* @author caolei
|
||||
* @date 2024/06/18
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_classify_detail")
|
||||
public class PayClassifyDetail implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
/**
|
||||
* 充值分类子表id
|
||||
*/
|
||||
private Long payClassifyDetailId;
|
||||
/**
|
||||
* 充值分类id
|
||||
*/
|
||||
private Long payClassifyId;
|
||||
|
||||
/**
|
||||
* 优惠券
|
||||
*/
|
||||
private Long couponId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Coupon coupon;
|
||||
|
||||
private Integer giveNum;
|
||||
|
||||
/**
|
||||
* 时间
|
||||
*/
|
||||
private String createTime;
|
||||
|
||||
public PayClassifyDetail() {}
|
||||
}
|
|
@ -71,6 +71,11 @@ public class PayDetails implements Serializable {
|
|||
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 技师ID,用户充值时指定技师ID时,完成支付给技师充业绩
|
||||
*/
|
||||
private Long artificerId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String refundContent;
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.sqx.modules.pay.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.sqx.modules.pay.entity.PayClassifyDetail;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface PayClassifyDetailService extends IService<PayClassifyDetail> {
|
||||
|
||||
List<PayClassifyDetail> findList(Long payClassifyId);
|
||||
|
||||
int updatePayClassifyDetailCouponId(Long payClassifyDetailId);
|
||||
|
||||
}
|
|
@ -14,7 +14,7 @@ import java.math.BigDecimal;
|
|||
*/
|
||||
public interface WxService {
|
||||
|
||||
Result payMoney(Long userId, Long payClassifyId, Integer classify, HttpServletRequest request) throws Exception;
|
||||
Result payMoney(Long userId, Long payClassifyId, Integer classify, Long artificerId, HttpServletRequest request) throws Exception;
|
||||
|
||||
Result payOrder(Long id, Integer type,HttpServletRequest request) throws Exception;
|
||||
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.sqx.modules.pay.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.sqx.modules.coupon.entity.Coupon;
|
||||
import com.sqx.modules.coupon.service.CouponService;
|
||||
import com.sqx.modules.pay.dao.PayClassifyDetailDao;
|
||||
import com.sqx.modules.pay.entity.PayClassifyDetail;
|
||||
import com.sqx.modules.pay.service.PayClassifyDetailService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 充值分类子表
|
||||
*/
|
||||
@Service
|
||||
public class PayClassifyServiceDetailImpl extends ServiceImpl<PayClassifyDetailDao, PayClassifyDetail> implements PayClassifyDetailService {
|
||||
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
|
||||
@Override
|
||||
public List<PayClassifyDetail> findList(Long payClassifyId){
|
||||
List<PayClassifyDetail> list = baseMapper.findList(payClassifyId);
|
||||
for(int i=0;i<list.size();i++){
|
||||
PayClassifyDetail pcd = list.get(i);
|
||||
Coupon coupon = couponService.getById(pcd.getCouponId());
|
||||
pcd.setCoupon(coupon);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePayClassifyDetailCouponId(Long payClassifyDetailId){
|
||||
return baseMapper.updatePayClassifyDetailCouponId(payClassifyDetailId);
|
||||
}
|
||||
|
||||
}
|
|
@ -43,7 +43,9 @@ import com.sqx.modules.message.service.MessageService;
|
|||
import com.sqx.modules.pay.config.WXConfig;
|
||||
import com.sqx.modules.pay.dao.PayDetailsDao;
|
||||
import com.sqx.modules.pay.entity.PayClassify;
|
||||
import com.sqx.modules.pay.entity.PayClassifyDetail;
|
||||
import com.sqx.modules.pay.entity.PayDetails;
|
||||
import com.sqx.modules.pay.service.PayClassifyDetailService;
|
||||
import com.sqx.modules.pay.service.PayClassifyService;
|
||||
import com.sqx.modules.pay.service.WxService;
|
||||
import com.sqx.modules.utils.*;
|
||||
|
@ -99,6 +101,8 @@ public class WxServiceImpl implements WxService {
|
|||
@Autowired
|
||||
private PayClassifyService payClassifyService;
|
||||
@Autowired
|
||||
private PayClassifyDetailService payClassifyDetailService;
|
||||
@Autowired
|
||||
private CouponUserService couponUserService;
|
||||
@Autowired
|
||||
private CouponService couponService;
|
||||
|
@ -132,7 +136,7 @@ public class WxServiceImpl implements WxService {
|
|||
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
@Override
|
||||
public Result payMoney(Long userId,Long payClassifyId,Integer classify,HttpServletRequest request) throws Exception {
|
||||
public Result payMoney(Long userId,Long payClassifyId,Integer classify, Long artificerId,HttpServletRequest request) throws Exception {
|
||||
PayClassify payClassify = payClassifyService.getById(payClassifyId);
|
||||
String generalOrder = getGeneralOrder();
|
||||
PayDetails payDetails = new PayDetails();
|
||||
|
@ -143,25 +147,26 @@ public class WxServiceImpl implements WxService {
|
|||
payDetails.setMoney(payClassify.getPrice().doubleValue());
|
||||
payDetails.setClassify(classify);
|
||||
payDetails.setType(3);
|
||||
payDetails.setArtificerId(artificerId);
|
||||
payDetails.setRemark(String.valueOf(payClassifyId));
|
||||
payDetailsDao.insert(payDetails);
|
||||
//用户在服务中充值余额,算技师业绩增加userRecharge表
|
||||
//用户在服务中充值余额,算技师业绩增加userRecharge表, modify 2024-06-17 by caolei 改到支付成功后技师获取积分
|
||||
//查询用户在服务中的技师的订单id
|
||||
List<Orders> orders = ordersDao.selectList(Wrappers.<Orders>lambdaQuery().eq(Orders::getUserId, userId).eq(Orders::getStatus, 6).orderByDesc(Orders::getCreateTime));
|
||||
if(orders.size() > 0){
|
||||
Long ordersId = orders.get(0).getOrdersId();
|
||||
Long artificerId = orders.get(0).getArtificerId();
|
||||
BigDecimal b = new BigDecimal(payClassify.getPrice().toString());
|
||||
BigDecimal sum = b;
|
||||
UserRecharge o = new UserRecharge();
|
||||
o.setOrdersId(ordersId.intValue());
|
||||
o.setUserRecharge(sum);
|
||||
o.setType("2");
|
||||
o.setUserId(userId.intValue());
|
||||
o.setCreateTime(LocalDateTime.now().toString());
|
||||
o.setArtificerId(artificerId.intValue());
|
||||
userRechargeDao.insert(o);
|
||||
}
|
||||
// List<Orders> orders = ordersDao.selectList(Wrappers.<Orders>lambdaQuery().eq(Orders::getUserId, userId).eq(Orders::getStatus, 6).orderByDesc(Orders::getCreateTime));
|
||||
// if(orders.size() > 0){
|
||||
// Long ordersId = orders.get(0).getOrdersId();
|
||||
// Long artificerId = orders.get(0).getArtificerId();
|
||||
// BigDecimal b = new BigDecimal(payClassify.getPrice().toString());
|
||||
// BigDecimal sum = b;
|
||||
// UserRecharge o = new UserRecharge();
|
||||
// o.setOrdersId(ordersId.intValue());
|
||||
// o.setUserRecharge(sum);
|
||||
// o.setType("2");
|
||||
// o.setUserId(userId.intValue());
|
||||
// o.setCreateTime(LocalDateTime.now().toString());
|
||||
// o.setArtificerId(artificerId.intValue());
|
||||
// userRechargeDao.insert(o);
|
||||
// }
|
||||
return pay(payClassify.getPrice().doubleValue(), classify, userId, generalOrder,request);
|
||||
}
|
||||
|
||||
|
@ -870,44 +875,63 @@ public class WxServiceImpl implements WxService {
|
|||
//插入余额
|
||||
userMoneyDetails.setBalance(userNowMoney.getMoney());
|
||||
userMoneyDetails.setUserId(payDetails.getUserId());
|
||||
userMoneyDetails.setTitle("微信充值");
|
||||
userMoneyDetails.setContent("微信充值:"+payClassify.getPrice());
|
||||
userMoneyDetails.setTitle("支付宝充值");
|
||||
userMoneyDetails.setContent("支付宝花费:"+payClassify.getPrice()+",钱包增加余额:"+payClassify.getMoney());
|
||||
userMoneyDetails.setManipulateType(2);
|
||||
userMoneyDetails.setType(1);
|
||||
userMoneyDetails.setState(2);
|
||||
userMoneyDetails.setMoney(payClassify.getPrice());
|
||||
userMoneyDetails.setMoney(payClassify.getMoney());
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
userMoneyDetails.setCreateTime(sdf.format(new Date()));
|
||||
userMoneyDetails.setBlRole(1);
|
||||
userMoneyDetails.setBlFlag(1);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
userMoneyDetails.setTitle("支付宝充值");
|
||||
userMoneyDetails.setContent("支付宝花费:"+payClassify.getPrice());
|
||||
userMoneyDetails.setMoney(payClassify.getPrice());
|
||||
userMoneyDetails.setType(2);
|
||||
userMoneyDetails.setBlRole(1);
|
||||
userMoneyDetails.setBlFlag(2);
|
||||
userMoneyDetailsService.save(userMoneyDetails);
|
||||
|
||||
if(payClassify.getCouponId()!=null && payClassify.getGiveNum()>0){
|
||||
for(int i=0;i<payClassify.getGiveNum();i++){
|
||||
Coupon coupon = couponService.getById(payClassify.getCouponId());
|
||||
Integer endDate = coupon.getEndDate();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, endDate);
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
Date date = calendar.getTime();
|
||||
String expirationTime = sdf.format(date);
|
||||
CouponUser couponUser=new CouponUser();
|
||||
couponUser.setUserId(payDetails.getUserId());
|
||||
couponUser.setCouponName(coupon.getCouponName());
|
||||
couponUser.setCouponPicture(coupon.getCouponPicture());
|
||||
couponUser.setCreateTime(DateUtils.format(new Date()));
|
||||
couponUser.setExpirationTime(expirationTime);
|
||||
couponUser.setMinMoney(coupon.getMinMoney());
|
||||
couponUser.setMoney(coupon.getMoney());
|
||||
couponUser.setStatus(0);
|
||||
couponUserService.save(couponUser);
|
||||
List<PayClassifyDetail> list = payClassifyDetailService.findList(payClassify.getPayClassifyId());
|
||||
if(list!=null && list.size()>0){
|
||||
for(int m=0;m<list.size();m++){
|
||||
PayClassifyDetail pcd = list.get(m);
|
||||
Coupon coupon = pcd.getCoupon();
|
||||
for(int i=0;i<pcd.getGiveNum();i++){
|
||||
Integer endDate = coupon.getEndDate();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.add(Calendar.DATE, endDate);
|
||||
calendar.add(Calendar.DATE, 1);
|
||||
Date date = calendar.getTime();
|
||||
String expirationTime = sdf.format(date);
|
||||
CouponUser couponUser = new CouponUser();
|
||||
couponUser.setUserId(payDetails.getUserId());
|
||||
couponUser.setCouponName(coupon.getCouponName());
|
||||
couponUser.setCouponPicture(coupon.getCouponPicture());
|
||||
couponUser.setCreateTime(DateUtils.format(new Date()));
|
||||
couponUser.setExpirationTime(expirationTime);
|
||||
couponUser.setMinMoney(coupon.getMinMoney());
|
||||
couponUser.setMoney(coupon.getMoney());
|
||||
couponUser.setClassifyId(coupon.getClassifyId());
|
||||
couponUser.setStatus(0);
|
||||
couponUserService.save(couponUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//用户在充值余额时,指定技师ID,则充值成功后给指定技师增加业绩,入userRecharge表
|
||||
if(payDetails.getArtificerId()!=null){
|
||||
UserRecharge o = new UserRecharge();
|
||||
o.setUserRecharge(payClassify.getPrice());
|
||||
o.setType("2");
|
||||
o.setUserId(payDetails.getUserId());
|
||||
o.setArtificerId(payDetails.getArtificerId());
|
||||
o.setCreateTime(DateUtils.format(new Date()));
|
||||
userRechargeDao.insert(o);
|
||||
}
|
||||
|
||||
}else if(payDetails.getType()==4){
|
||||
Long couponIssueId = Long.parseLong(payDetails.getRemark());
|
||||
Long userId=payDetails.getUserId();
|
||||
|
@ -1026,46 +1050,7 @@ public class WxServiceImpl implements WxService {
|
|||
|
||||
}else if(payDetails.getType()==6){
|
||||
double money=payDetails.getMoney();
|
||||
|
||||
//此处属于打赏,不涉及充值增代金券
|
||||
// if(StringUtils.isNotBlank(payDetails.getRemark())){
|
||||
// PayClassify payClassify = payClassifyService.getById(Long.parseLong(payDetails.getRemark()));
|
||||
// if(payClassify.getCouponId()!=null && payClassify.getGiveNum()>0){
|
||||
// for(int i=0;i<payClassify.getGiveNum();i++){
|
||||
// Coupon coupon = couponService.getById(payClassify.getCouponId());
|
||||
// Integer endDate = coupon.getEndDate();
|
||||
// Calendar calendar = Calendar.getInstance();
|
||||
// calendar.add(Calendar.DATE, endDate);
|
||||
// calendar.add(Calendar.DATE, 1);
|
||||
// Date date = calendar.getTime();
|
||||
// String expirationTime = sdf.format(date);
|
||||
// CouponUser couponUser=new CouponUser();
|
||||
// couponUser.setUserId(payDetails.getUserId());
|
||||
// couponUser.setCouponName(coupon.getCouponName());
|
||||
// couponUser.setCouponPicture(coupon.getCouponPicture());
|
||||
// couponUser.setCreateTime(DateUtils.format(new Date()));
|
||||
// couponUser.setExpirationTime(expirationTime);
|
||||
// couponUser.setMinMoney(coupon.getMinMoney());
|
||||
// couponUser.setMoney(coupon.getMoney());
|
||||
// couponUser.setStatus(0);
|
||||
// couponUserService.save(couponUser);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//2024-06-15注释掉,user_money_artificer 表一直没用上。用的是 user_money_details 表
|
||||
long artificerId = Long.parseLong(payDetails.getRemark());
|
||||
// UserMoneyArtificer userMoneyArtificer = userMoneyArtificerService.getOne(new QueryWrapper<UserMoneyArtificer>().eq("user_id", payDetails.getUserId()).eq("artificer_id", artificerId));
|
||||
// if(userMoneyArtificer==null){
|
||||
// userMoneyArtificer=new UserMoneyArtificer();
|
||||
// userMoneyArtificer.setUserId(payDetails.getUserId());
|
||||
// userMoneyArtificer.setArtificerId(artificerId);
|
||||
// userMoneyArtificer.setMoney(BigDecimal.valueOf(money));
|
||||
// userMoneyArtificer.setCreateTime(DateUtils.format(new Date()));
|
||||
// userMoneyArtificerService.save(userMoneyArtificer);
|
||||
// }else{
|
||||
// userMoneyArtificerService.updateMoney(1, payDetails.getUserId(),artificerId, money);
|
||||
// }
|
||||
Artificer artificer = artificerService.getById(artificerId);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
//用户流水
|
||||
|
|
|
@ -12,14 +12,19 @@
|
|||
(case when a.flag = 1 then b.old_price else c.old_price end) as old_price,
|
||||
(case when a.flag = 1 then b.price else c.price end) as price,
|
||||
(case when a.flag = 1 then b.jianjie else c.content end) as content,
|
||||
(case when a.flag = 1 then '项目' else substr(d.value,3) end) as type,
|
||||
(case when a.flag = 1 then '-1' else c.type end) as type,
|
||||
(case when a.flag = 1 then '项目' else substr(d.value,3) end) as typeName,
|
||||
(case when a.flag = 1 then concat(duration,'分钟|',replace(b.labels,',',' '))
|
||||
else replace(c.labels,',',' ')
|
||||
end) as remarks
|
||||
else replace(c.labels,',',' ')
|
||||
end) as remarks,
|
||||
(case when a.flag = 1 then b.classify_id else c.classify_id end) as classify_id,
|
||||
(case when a.flag = 1 then x.value else y.value end) as classify_name
|
||||
from bl_collect_massage a
|
||||
left join massage_type b on a.project_id = b.massage_type_id
|
||||
left join bl_massage_package c on a.project_id = c.id
|
||||
left join sys_dict d on c.type = d.id
|
||||
left join sys_dict x on x.id = b.classify_id
|
||||
left join sys_dict y on y.id = c.classify_id
|
||||
where 1=1
|
||||
<if test="params.userId!=null">
|
||||
and a.user_id=#{params.userId}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.sqx.modules.pay.dao.PayClassifyDetailDao">
|
||||
|
||||
<select id="findList" resultType="com.sqx.modules.pay.entity.PayClassifyDetail">
|
||||
select
|
||||
a.pay_classify_detail_id,
|
||||
a.pay_classify_id,
|
||||
a.coupon_id,
|
||||
a.give_num,
|
||||
a.create_time
|
||||
from pay_classify_detail a
|
||||
where a.pay_classify_id = #{payClassifyId}
|
||||
order by a.pay_classify_detail_id desc
|
||||
</select>
|
||||
|
||||
<update id="updatePayClassifyDetailCouponId">
|
||||
update pay_classify_detail set coupon_id=null,give_num=null where pay_classify_detail_id=#{payClassifyDetailId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue