Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -80,7 +80,7 @@ public class PointsGoodsRecordController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/rejectRefund")
|
@PostMapping("/rejectRefund")
|
||||||
public CzgResult<Boolean> rejectRefund(@RequestBody @Validated PointGoodsRefundDTO param) {
|
public CzgResult<Boolean> rejectRefund(@RequestBody @Validated PointGoodsRefundDTO param) {
|
||||||
return CzgResult.success(pointsGoodsService.cancelRefund(param, StpKit.USER.getLoginIdAsLong()));
|
return CzgResult.success(pointsGoodsService.cancelRefund(param, null, StpKit.USER.getShopId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -76,7 +76,7 @@ public class UPointGoodsController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/cancelRefund")
|
@PostMapping("/cancelRefund")
|
||||||
public CzgResult<Boolean> cancelRefund(@RequestBody @Validated PointGoodsRefundDTO param) {
|
public CzgResult<Boolean> cancelRefund(@RequestBody @Validated PointGoodsRefundDTO param) {
|
||||||
return CzgResult.success(pointsGoodsService.cancelRefund(param, StpKit.USER.getLoginIdAsLong()));
|
return CzgResult.success(pointsGoodsService.cancelRefund(param, StpKit.USER.getLoginIdAsLong(), null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public interface MkPointsGoodsService extends IService<MkPointsGoods> {
|
|||||||
//用户申请退款
|
//用户申请退款
|
||||||
boolean applyRefund(PointGoodsRefundDTO param, Long userId);
|
boolean applyRefund(PointGoodsRefundDTO param, Long userId);
|
||||||
|
|
||||||
boolean cancelRefund(PointGoodsRefundDTO param, Long userId);
|
boolean cancelRefund(PointGoodsRefundDTO param, Long userId, Long shopId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新商品数量
|
* 更新商品数量
|
||||||
|
|||||||
@@ -59,6 +59,9 @@ public class MkPointsConfigServiceImpl extends ServiceImpl<MkPointsConfigMapper,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BigDecimal awardPoints = NumberUtil.roundDown(NumberUtil.div(payAmount, consumeAmount), 0);
|
BigDecimal awardPoints = NumberUtil.roundDown(NumberUtil.div(payAmount, consumeAmount), 0);
|
||||||
|
if (awardPoints.compareTo(BigDecimal.ZERO) <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
mkPointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.ADD,
|
mkPointsUserService.alterPoints(null, shopUser.getId(), orderInfo.getShopId(), PointsConstant.ADD,
|
||||||
awardPoints.intValue(), orderInfo.getId(), StrUtil.format("消费¥{}送{}积分", payAmount, awardPoints.intValue()));
|
awardPoints.intValue(), orderInfo.getId(), StrUtil.format("消费¥{}送{}积分", payAmount, awardPoints.intValue()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,10 @@ public class MkPointsGoodsRecordServiceImpl extends ServiceImpl<MkPointsGoodsRec
|
|||||||
Page<MkPointsGoodsRecordDTO> pages = pageAs(
|
Page<MkPointsGoodsRecordDTO> pages = pageAs(
|
||||||
Page.of(param.getPage(), param.getSize())
|
Page.of(param.getPage(), param.getSize())
|
||||||
, query().eq(MkPointsGoodsRecord::getShopId, param.getShopId())
|
, query().eq(MkPointsGoodsRecord::getShopId, param.getShopId())
|
||||||
|
.between(MkPointsGoodsRecord::getCreateTime, param.getStartTime(), param.getEndTime())
|
||||||
.eq(MkPointsGoodsRecord::getShopUserId, param.getShopUserId())
|
.eq(MkPointsGoodsRecord::getShopUserId, param.getShopUserId())
|
||||||
.eq(MkPointsGoodsRecord::getStatus, param.getStatus())
|
.eq(MkPointsGoodsRecord::getStatus, param.getStatus())
|
||||||
|
.eq(MkPointsGoodsRecord::getIsDel, 0)
|
||||||
.like(MkPointsGoodsRecord::getPointsGoodsName, param.getPointsGoodsName())
|
.like(MkPointsGoodsRecord::getPointsGoodsName, param.getPointsGoodsName())
|
||||||
.like(MkPointsGoodsRecord::getGoodsCategory, param.getGoodsCategory())
|
.like(MkPointsGoodsRecord::getGoodsCategory, param.getGoodsCategory())
|
||||||
, MkPointsGoodsRecordDTO.class);
|
, MkPointsGoodsRecordDTO.class);
|
||||||
@@ -61,6 +63,7 @@ public class MkPointsGoodsRecordServiceImpl extends ServiceImpl<MkPointsGoodsRec
|
|||||||
.between(MkPointsGoodsRecord::getCreateTime, param.getStartTime(), param.getEndTime())
|
.between(MkPointsGoodsRecord::getCreateTime, param.getStartTime(), param.getEndTime())
|
||||||
.eq(MkPointsGoodsRecord::getShopUserId, param.getShopUserId())
|
.eq(MkPointsGoodsRecord::getShopUserId, param.getShopUserId())
|
||||||
.eq(MkPointsGoodsRecord::getStatus, param.getStatus())
|
.eq(MkPointsGoodsRecord::getStatus, param.getStatus())
|
||||||
|
.eq(MkPointsGoodsRecord::getIsDel, 0)
|
||||||
.like(MkPointsGoodsRecord::getPointsGoodsName, param.getPointsGoodsName())
|
.like(MkPointsGoodsRecord::getPointsGoodsName, param.getPointsGoodsName())
|
||||||
.like(MkPointsGoodsRecord::getGoodsCategory, param.getGoodsCategory());
|
.like(MkPointsGoodsRecord::getGoodsCategory, param.getGoodsCategory());
|
||||||
queryWrapper.select("count(*) as count,sum(extra_payment_amount) as totalAmount");
|
queryWrapper.select("count(*) as count,sum(extra_payment_amount) as totalAmount");
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean cancelRefund(PointGoodsRefundDTO param, Long userId) {
|
public boolean cancelRefund(PointGoodsRefundDTO param, Long userId, Long shopId) {
|
||||||
MkPointsGoodsRecord record1 = goodsRecordService.getById(param.getRecordId());
|
MkPointsGoodsRecord record1 = goodsRecordService.getById(param.getRecordId());
|
||||||
if (record1 == null) {
|
if (record1 == null) {
|
||||||
throw new CzgException("取消失败,订单不存在");
|
throw new CzgException("取消失败,订单不存在");
|
||||||
@@ -146,6 +146,7 @@ public class MkPointsGoodsServiceImpl extends ServiceImpl<MkPointsGoodsMapper, M
|
|||||||
.eq(MkPointsGoodsRecord::getId, param.getRecordId())
|
.eq(MkPointsGoodsRecord::getId, param.getRecordId())
|
||||||
.eq(MkPointsGoodsRecord::getOrderNo, param.getOrderNo())
|
.eq(MkPointsGoodsRecord::getOrderNo, param.getOrderNo())
|
||||||
.eq(MkPointsGoodsRecord::getUserId, userId)
|
.eq(MkPointsGoodsRecord::getUserId, userId)
|
||||||
|
.eq(MkPointsGoodsRecord::getShopId, shopId)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import com.mybatisflex.spring.service.impl.ServiceImpl;
|
|||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -116,6 +115,9 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long alterPoints(Long userId, Long shopUserId, Long shopId, PointsConstant floatType, Integer points, Long sourceId, String reason) {
|
public Long alterPoints(Long userId, Long shopUserId, Long shopId, PointsConstant floatType, Integer points, Long sourceId, String reason) {
|
||||||
|
if (points <= 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
MkPointsUser pointsUser = getPointsUser(shopId, shopUserId, userId);
|
MkPointsUser pointsUser = getPointsUser(shopId, shopUserId, userId);
|
||||||
if (floatType == null) {
|
if (floatType == null) {
|
||||||
throw new CzgException("积分变动类型不能为空");
|
throw new CzgException("积分变动类型不能为空");
|
||||||
@@ -162,7 +164,7 @@ public class MkPointsUserServiceImpl extends ServiceImpl<MkPointsUserMapper, MkP
|
|||||||
.setTitle(points > 0 ? "积分到账" : "积分扣除")
|
.setTitle(points > 0 ? "积分到账" : "积分扣除")
|
||||||
.setContent(StrUtil.format("{}提醒:{} 积分已成功{},积分可用于兑换好物、抵扣消费,快来解锁权益!",
|
.setContent(StrUtil.format("{}提醒:{} 积分已成功{},积分可用于兑换好物、抵扣消费,快来解锁权益!",
|
||||||
points > 0 ? "积分到账" : "积分扣除",
|
points > 0 ? "积分到账" : "积分扣除",
|
||||||
points,
|
Math.abs(points),
|
||||||
points > 0 ? "存储你的账户" : "使用"));
|
points > 0 ? "存储你的账户" : "使用"));
|
||||||
acUserMsgService.addUserMsg(msg);
|
acUserMsgService.addUserMsg(msg);
|
||||||
return record.getId();
|
return record.getId();
|
||||||
|
|||||||
Reference in New Issue
Block a user