This commit is contained in:
PQZ 2024-09-24 13:30:27 +08:00
parent 1097aba239
commit f39fe1a419
6 changed files with 7 additions and 7 deletions

View File

@ -39,7 +39,6 @@ public class CustomerCouponController {
**/
@PostMapping("/couponVerification")
@Operation(summary = "核销用户卡券")
@PreAuthorize("@ss.hasPermission('base:customer-coupon:create')")
public CommonResult<Boolean> createCustomerCoupon(@Valid @RequestBody CustomerCouponSaveReqVO saveReqVO) {
customerCouponService.couponVerification(saveReqVO);
return success(true);
@ -57,7 +56,6 @@ public class CustomerCouponController {
@DeleteMapping("/delete")
@Operation(summary = "删除用户卡券")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('base:customer-coupon:delete')")
public CommonResult<Boolean> deleteCustomerCoupon(@RequestParam("id") String id) {
customerCouponService.deleteCustomerCoupon(id);
return success(true);
@ -74,7 +72,6 @@ public class CustomerCouponController {
@GetMapping("/get")
@Operation(summary = "获得用户卡券")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:customer-coupon:query')")
public CommonResult<CustomerCouponRespVO> getCustomerCoupon(@RequestParam("id") String id) {
return success(customerCouponService.getCustomerCoupon(id));
}

View File

@ -129,7 +129,6 @@ public class CustomerMainController {
@GetMapping("/get")
@Operation(summary = "获得客户管理")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:customer-main:query')")
public CommonResult<CustomerMainRespVO> getCustomerMain(@RequestParam("id") String id) {
return success(customerMainService.getCustomerById(id));
}

View File

@ -147,6 +147,7 @@ public class CustomerActiveServiceImpl extends ServiceImpl<CustomerActiveMapper,
orderInfo.setOrderTime(LocalDateTime.now());
orderInfo.setIsOnline("01");
orderInfo.setOrderStatus("0");
orderInfo.setPayType(saveReqVO.getAccountType());
repairOrderInfoService.save(orderInfo);
//保存余额信息
// balanceService.updateByCusId(balance);

View File

@ -48,7 +48,7 @@ public class CustomerCouponServiceImpl extends ServiceImpl<CustomerCouponMapper,
public void couponVerification(CustomerCouponSaveReqVO saveReqVO) {
CustomerCoupon customerCoupon = getById(saveReqVO.getId());
//核销后剩余
BigDecimal newBalance = customerCoupon.getBalance().subtract(saveReqVO.getChangeBalance());
BigDecimal newBalance = customerCoupon.getBalance().subtract(customerCoupon.getUnitPrice());
customerCoupon.setBalance(newBalance);
if (newBalance.compareTo(BigDecimal.ZERO) == 0) {
customerCoupon.setIsValid(GENERAL_NO);
@ -62,9 +62,9 @@ public class CustomerCouponServiceImpl extends ServiceImpl<CustomerCouponMapper,
BALANCE_CHANGE_TYPE_KQHX,
BALANCE_CHANGE_MAIN_KQ,
saveReqVO.getOutRule(),
saveReqVO.getChangeBalance(),
saveReqVO.getUnitPrice(),
newBalance,
"核销" + saveReqVO.getCouponName() + saveReqVO.getChangeBalance() + "次/元,核销后剩余" + newBalance + "次/元"
"核销" + saveReqVO.getCouponName() + saveReqVO.getUnitPrice() + "次/元,核销后剩余" + newBalance + "次/元"
);
}

View File

@ -14,6 +14,8 @@ import javax.validation.constraints.*;
public class CustomerActiveSaveReqVO extends CustomerActive {
/**充值金额*/
private BigDecimal topUpAmount;
/**充值金额*/
private String accountType;
/**选中的优惠券*/
private List<MemberCoupon> selectCoupon;
}

View File

@ -28,5 +28,6 @@
WHERE
bcc.cus_id = #{cusId}
AND bcc.deleted = 0
AND bcc.is_valid = 1
</select>
</mapper>