更新了金额的数据类型BigDecimal
This commit is contained in:
parent
1c0d0bf8df
commit
1ed5d1f77b
|
@ -1,12 +1,22 @@
|
|||
package com.cultural.heritage.aop;
|
||||
|
||||
import com.cultural.heritage.annotation.AuthCheck;
|
||||
import com.cultural.heritage.common.ErrorCode;
|
||||
import com.cultural.heritage.constant.UserConstant;
|
||||
import com.cultural.heritage.exception.BusinessException;
|
||||
import com.cultural.heritage.model.entity.User;
|
||||
import com.cultural.heritage.model.enums.UserRoleEnum;
|
||||
import com.cultural.heritage.service.user.UserService;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
/**
|
||||
* 权限校验AOP
|
||||
|
@ -24,42 +34,42 @@ public class AuthInterceptor {
|
|||
@Around("@annotation(authCheck)")
|
||||
public Object doInterceptor(ProceedingJoinPoint joinPoint, AuthCheck authCheck) throws Throwable {
|
||||
// 接口的权限
|
||||
// String mustRole = authCheck.mustRole();
|
||||
// RequestAttributes requestAttributes = RequestContextHolder.currentRequestAttributes();
|
||||
// HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
|
||||
//
|
||||
// //当前登录用户
|
||||
// User loginUser = userService.getLoginUser(request);
|
||||
// //必须有该权限才通过
|
||||
// if (StringUtils.isNotBlank(mustRole)) {
|
||||
// //mustUserRoleEnum是接口权限
|
||||
// UserRoleEnum mustUserRoleEnum = UserRoleEnum.getEnumByValues(mustRole);
|
||||
// if(mustUserRoleEnum == null) {
|
||||
// throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
|
||||
// }
|
||||
// //用户权限
|
||||
// String userRole = loginUser.getUserRole();
|
||||
// //根据用户角色获取封装后的枚举类对象
|
||||
// UserRoleEnum userRoleEnum = UserRoleEnum.getEnumByValues(userRole);
|
||||
//
|
||||
// //如果被封号,直接拒绝
|
||||
// if (UserRoleEnum.BAN.equals(userRoleEnum)) {
|
||||
// throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
|
||||
// }
|
||||
//
|
||||
// //如果接口需要Boss权限,则需要判断用户是否是boss管理员
|
||||
// if (UserRoleEnum.BOSS.equals(mustUserRoleEnum)) {
|
||||
// if (!mustRole.equals(userRole)) {
|
||||
// throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
|
||||
// }
|
||||
// }
|
||||
// //如果接口需要管理员权限,则需要判断用户是否是boss或者admin管理员
|
||||
// if (UserRoleEnum.ADMIN.equals(mustUserRoleEnum)) {
|
||||
// if (!mustRole.equals(userRole) && !userRole.equals(UserConstant.BOSS_ROLE)) {
|
||||
// throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
String mustRole = authCheck.mustRole();
|
||||
RequestAttributes requestAttributes = RequestContextHolder.currentRequestAttributes();
|
||||
HttpServletRequest request = ((ServletRequestAttributes) requestAttributes).getRequest();
|
||||
|
||||
//当前登录用户
|
||||
User loginUser = userService.getLoginUser(request);
|
||||
//必须有该权限才通过
|
||||
if (StringUtils.isNotBlank(mustRole)) {
|
||||
//mustUserRoleEnum是接口权限
|
||||
UserRoleEnum mustUserRoleEnum = UserRoleEnum.getEnumByValues(mustRole);
|
||||
if(mustUserRoleEnum == null) {
|
||||
throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
|
||||
}
|
||||
//用户权限
|
||||
String userRole = loginUser.getUserRole();
|
||||
//根据用户角色获取封装后的枚举类对象
|
||||
UserRoleEnum userRoleEnum = UserRoleEnum.getEnumByValues(userRole);
|
||||
|
||||
//如果被封号,直接拒绝
|
||||
if (UserRoleEnum.BAN.equals(userRoleEnum)) {
|
||||
throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
|
||||
}
|
||||
|
||||
//如果接口需要Boss权限,则需要判断用户是否是boss管理员
|
||||
if (UserRoleEnum.BOSS.equals(mustUserRoleEnum)) {
|
||||
if (!mustRole.equals(userRole)) {
|
||||
throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
|
||||
}
|
||||
}
|
||||
//如果接口需要管理员权限,则需要判断用户是否是boss或者admin管理员
|
||||
if (UserRoleEnum.ADMIN.equals(mustUserRoleEnum)) {
|
||||
if (!mustRole.equals(userRole) && !userRole.equals(UserConstant.BOSS_ROLE)) {
|
||||
throw new BusinessException(ErrorCode.NO_AUTH_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
//通过权限校验,放行
|
||||
return joinPoint.proceed();
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class BookingDateController {
|
|||
@Scheduled(cron = "0 0 0 * * ?")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@GetMapping("/init")
|
||||
@Operation(summary = "初始化未来一天的预约日期", description = "参数:无,权限:自动调用,方法名:initCurrentBookingDate")
|
||||
@Operation(summary = "(自动调用)初始化未来一天的预约日期", description = "参数:无,权限:自动调用,方法名:initCurrentBookingDate")
|
||||
public void initCurrentBookingDate() {
|
||||
// 初始化预约日期
|
||||
List<BookingDate> bookingDateList = new ArrayList<>();
|
||||
|
@ -68,7 +68,7 @@ public class BookingDateController {
|
|||
* @return 当前预约类型未来四天的预约日期列表
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
@Operation(summary = "根据预约类别查询未来四天(包括今天)的预约日期", description = "参数:预约类型, 权限:所有人,方法名:listBookingDateByType")
|
||||
@Operation(summary = "(小程序端)根据预约类别查询未来四天(包括今天)的预约日期", description = "参数:预约类型, 权限:所有人,方法名:listBookingDateByType")
|
||||
public BaseResponse<List<BookingDateVO>> listBookingDateByType(@RequestBody CommonStringRequest commonStringRequest) {
|
||||
if (commonStringRequest == null || StringUtils.isBlank(commonStringRequest.getType())) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR);
|
||||
|
@ -95,7 +95,7 @@ public class BookingDateController {
|
|||
*/
|
||||
@PostMapping("/update")
|
||||
@AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@Operation(summary = "更新当天的预约情况", description = "参数:预约日期更新请求体, 权限:管理员(admin, boss),方法名:updateBookingDate")
|
||||
@Operation(summary = "Web端管理员更新当天的预约情况", description = "参数:预约日期更新请求体, 权限:管理员(admin, boss),方法名:updateBookingDate")
|
||||
public BaseResponse<Boolean> updateBookingDate(@RequestBody BookingDateUpdateRequest bookingDateUpdateRequest) {
|
||||
if (bookingDateUpdateRequest == null || bookingDateUpdateRequest.getId() <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR);
|
||||
|
|
|
@ -131,10 +131,11 @@ public class CartRecordController {
|
|||
|
||||
/**
|
||||
* 展示用户批量购买后的订单信息
|
||||
* @param cartRecordQueryVOList 订单商品查询列表
|
||||
* @param cartRecordQueryVOList 商品id和数量的集合
|
||||
* @return 订单商品信息列表
|
||||
*/
|
||||
@PostMapping("/cart/list")
|
||||
@Operation(summary = "展示用户批量购买后的订单信息", description = "参数:商品id和数量的集合,权限:所有人,方法名:listCartRecord")
|
||||
public BaseResponse<List<CartOrderVO>> listCartRecord(@RequestBody List<CartRecordQueryVO> cartRecordQueryVOList, HttpServletRequest request) {
|
||||
if (cartRecordQueryVOList == null) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR);
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "预约订单添加请求体", requiredProperties = {"type", "clothesType", "deposit", "contactsSnapshot",
|
||||
|
@ -30,7 +31,7 @@ public class AdvanceOrderAddRequest implements Serializable {
|
|||
* 定金
|
||||
*/
|
||||
@Schema(description = "定金", example = "100.00")
|
||||
private Double deposit;
|
||||
private BigDecimal deposit;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@Data
|
||||
|
@ -32,14 +33,14 @@ public class AdvanceOrderQueryRequest extends PageRequest implements Serializabl
|
|||
* 最小定金
|
||||
*/
|
||||
@Schema(description = "最小定金", example = "80")
|
||||
private Double minDeposit;
|
||||
private BigDecimal minDeposit;
|
||||
|
||||
|
||||
/**
|
||||
* 最大定金
|
||||
*/
|
||||
@Schema(description = "最大定金", example = "200")
|
||||
private Double maxDeposit;
|
||||
private BigDecimal maxDeposit;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "购物车记录添加请求体", requiredProperties = {"userId", "goodId", "quantity", "subtotal", "isGoodType"})
|
||||
|
@ -26,7 +27,7 @@ public class CartRecordAddRequest implements Serializable {
|
|||
* 小计
|
||||
*/
|
||||
@Schema(description = "小计(商品单价 * 数量)", example = "60")
|
||||
private Double subtotal;
|
||||
private BigDecimal subtotal;
|
||||
|
||||
/**
|
||||
* 是否是常规类商品
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "购物车记录更新请求体", requiredProperties = {"id", "userId", "goodId", "quantity", "subtotal"})
|
||||
|
@ -33,7 +34,7 @@ public class CartRecordUpdateRequest implements Serializable {
|
|||
* 小计
|
||||
*/
|
||||
@Schema(description = "小计(商品单价 * 数量)", example = "60")
|
||||
private Double subtotal;
|
||||
private BigDecimal subtotal;
|
||||
|
||||
|
||||
@Serial
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "服装等级添加请求体", requiredProperties = {"clothesType", "image", "minPrice", "maxPrice", "brief"})
|
||||
|
@ -28,14 +29,14 @@ public class ClothesGradeAddRequest implements Serializable {
|
|||
* 最低价格
|
||||
*/
|
||||
@Schema(description = "最低价格", example = "80.00")
|
||||
private Double minPrice;
|
||||
private BigDecimal minPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 最高价格
|
||||
*/
|
||||
@Schema(description = "最高价格", example = "160")
|
||||
private Double maxPrice;
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "服装等级更新请求体")
|
||||
|
@ -36,14 +37,14 @@ public class ClothesGradeUpdateRequest implements Serializable {
|
|||
* 最低价格
|
||||
*/
|
||||
@Schema(description = "最低价格", example = "80.00")
|
||||
private Double minPrice;
|
||||
private BigDecimal minPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 最高价格
|
||||
*/
|
||||
@Schema(description = "最高价格", example = "160")
|
||||
private Double maxPrice;
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@Data
|
||||
|
@ -45,7 +46,7 @@ public class ClothesInfoAddRequest implements Serializable {
|
|||
* 服装价格
|
||||
*/
|
||||
@Schema(description = "服装价格", example = "100.00")
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
@ -32,14 +33,14 @@ public class ClothesInfoQueryRequest extends PageRequest implements Serializable
|
|||
* 最低价格
|
||||
*/
|
||||
@Schema(description = "最低价格", example = "100.00")
|
||||
private Double minPrice;
|
||||
private BigDecimal minPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 最高价格
|
||||
*/
|
||||
@Schema(description = "最高价格", example = "200.00")
|
||||
private Double maxPrice;
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "服装添加请求体", requiredProperties = {"id", "name", "image", "effectImg", "intro", "price", "clothesType"})
|
||||
|
@ -50,7 +51,7 @@ public class ClothesInfoUpdateRequest implements Serializable {
|
|||
* 服装价格
|
||||
*/
|
||||
@Schema(description = "服装价格", example = "100.00")
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "优惠券添加请求体", requiredProperties =
|
||||
|
@ -22,7 +23,7 @@ public class CouponAddRequest implements Serializable {
|
|||
* 满减金额
|
||||
*/
|
||||
@Schema(description = "满减金额", example = "50")
|
||||
private Double conditionAmount;
|
||||
private BigDecimal conditionAmount;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "优惠券更新请求体", requiredProperties =
|
||||
|
@ -27,7 +28,7 @@ public class CouponUpdateRequest implements Serializable {
|
|||
* 满减金额
|
||||
*/
|
||||
@Schema(description = "满减金额", example = "50")
|
||||
private Double conditionAmount;
|
||||
private BigDecimal conditionAmount;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "商品添加请求体", requiredProperties = {"name", "type", "price", "goodImg", "intro",
|
||||
|
@ -28,7 +29,7 @@ public class GoodAddRequest implements Serializable {
|
|||
* 商品价格
|
||||
*/
|
||||
@Schema(description = "商品价格", example = "20.00")
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 商品图片
|
||||
|
|
|
@ -5,6 +5,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "商品更新请求体", requiredProperties = {"id", "name", "type", "price", "goodImg", "intro",
|
||||
|
@ -33,7 +34,7 @@ public class GoodUpdateRequest implements Serializable {
|
|||
* 商品价格
|
||||
*/
|
||||
@Schema(description = "商品价格", example = "20.00")
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 商品图片
|
||||
|
|
|
@ -8,6 +8,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
|
@ -61,7 +62,7 @@ public class OrderAddRequest implements Serializable {
|
|||
* 订单总金额
|
||||
*/
|
||||
@Schema(description = "订单总金额", example = "500")
|
||||
private Double totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
|
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订单明细添加请求体", requiredProperties = {"orderId", "goodSnapshot", "priceSnapshot", "quantity", "itemTotalAmount"})
|
||||
|
@ -30,7 +31,7 @@ public class OrderItemAddRequest implements Serializable {
|
|||
* 商品单价快照
|
||||
*/
|
||||
@Schema(description = "商品单价", example = "30")
|
||||
private Double priceSnapshot;
|
||||
private BigDecimal priceSnapshot;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -44,7 +45,7 @@ public class OrderItemAddRequest implements Serializable {
|
|||
* 订单项金额(单价 * 数量)
|
||||
*/
|
||||
@Schema(description = "订单项金额(单价 * 数量)", example = "300")
|
||||
private Double itemTotalAmount;
|
||||
private BigDecimal itemTotalAmount;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
|
@ -47,14 +48,14 @@ public class OrderQueryRequest extends PageRequest implements Serializable {
|
|||
* 订单最小金额
|
||||
*/
|
||||
@Schema(description = "订单最小金额", example = "50")
|
||||
private Double minTotalAmount;
|
||||
private BigDecimal minTotalAmount;
|
||||
|
||||
|
||||
/**
|
||||
* 订单最大金额
|
||||
*/
|
||||
@Schema(description = "订单最大金额", example = "350")
|
||||
private Double maxTotalAmount;
|
||||
private BigDecimal maxTotalAmount;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
|
@ -66,7 +67,7 @@ public class OrderMainInfoAddRequest implements Serializable {
|
|||
* 订单总金额
|
||||
*/
|
||||
@Schema(description = "订单总金额", example = "560")
|
||||
private Double totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订单优惠券信息", requiredProperties = {"name", "conditionAmount"})
|
||||
|
@ -21,7 +22,7 @@ public class CouponSnapshot implements Serializable {
|
|||
* 满减金额
|
||||
*/
|
||||
@Schema(description = "满减金额", example = "50")
|
||||
private Double conditionAmount;
|
||||
private BigDecimal conditionAmount;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Schema(description = "订单商品信息", requiredProperties = {"name", "type", "price", "goodImg", "festivalOrder", "reserveDate"})
|
||||
|
@ -27,7 +28,7 @@ public class GoodSnapshot implements Serializable {
|
|||
* 商品价格
|
||||
*/
|
||||
@Schema(description = "商品价格", example = "200.00")
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 商品图片
|
||||
|
|
|
@ -10,6 +10,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -42,7 +43,7 @@ public class AdvanceOrder implements Serializable {
|
|||
/**
|
||||
* 定金
|
||||
*/
|
||||
private Double deposit;
|
||||
private BigDecimal deposit;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -42,7 +43,7 @@ public class CartRecord implements Serializable {
|
|||
/**
|
||||
* 小计
|
||||
*/
|
||||
private Double subtotal;
|
||||
private BigDecimal subtotal;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -41,13 +42,13 @@ public class ClothesGrade implements Serializable {
|
|||
/**
|
||||
* 最低价格
|
||||
*/
|
||||
private Double minPrice;
|
||||
private BigDecimal minPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 最高价格
|
||||
*/
|
||||
private Double maxPrice;
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -53,7 +54,7 @@ public class ClothesInfo implements Serializable {
|
|||
/**
|
||||
* 服装价格
|
||||
*/
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -10,6 +10,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -34,7 +35,7 @@ public class Coupon implements Serializable {
|
|||
/**
|
||||
* 满减金额
|
||||
*/
|
||||
private Double conditionAmount;
|
||||
private BigDecimal conditionAmount;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
|
@ -37,7 +38,7 @@ public class Good {
|
|||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 商品图片
|
||||
|
|
|
@ -14,6 +14,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
@ -80,7 +81,7 @@ public class Order implements Serializable {
|
|||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
private Double totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,6 +11,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 订单明细
|
||||
|
@ -47,7 +48,7 @@ public class OrderItems implements Serializable {
|
|||
* 商品单价快照
|
||||
*/
|
||||
@Schema(description = "商品单价", example = "15.00")
|
||||
private Double priceSnapshot;
|
||||
private BigDecimal priceSnapshot;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -61,7 +62,7 @@ public class OrderItems implements Serializable {
|
|||
* 订单项金额(单价 * 数量)
|
||||
*/
|
||||
@Schema(description = "订单项金额(单价 * 数量)", example = "55.00")
|
||||
private Double itemTotalAmount;
|
||||
private BigDecimal itemTotalAmount;
|
||||
|
||||
/**
|
||||
* 预约日期
|
||||
|
|
|
@ -6,6 +6,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
|
@ -33,7 +34,7 @@ public class AdvanceOrderVO implements Serializable {
|
|||
/**
|
||||
* 定金
|
||||
*/
|
||||
private Double deposit;
|
||||
private BigDecimal deposit;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class CartRecordVO implements Serializable {
|
||||
|
@ -33,7 +34,7 @@ public class CartRecordVO implements Serializable {
|
|||
/**
|
||||
* 小计
|
||||
*/
|
||||
private Double subtotal;
|
||||
private BigDecimal subtotal;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ClothesGradeVO implements Serializable {
|
||||
|
@ -30,13 +31,13 @@ public class ClothesGradeVO implements Serializable {
|
|||
/**
|
||||
* 最低价格
|
||||
*/
|
||||
private Double minPrice;
|
||||
private BigDecimal minPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 最高价格
|
||||
*/
|
||||
private Double maxPrice;
|
||||
private BigDecimal maxPrice;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ClothesInfoLabelVO implements Serializable {
|
||||
|
@ -35,7 +36,7 @@ public class ClothesInfoLabelVO implements Serializable {
|
|||
/**
|
||||
* 服装价格
|
||||
*/
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ClothesInfoVO implements Serializable {
|
||||
|
@ -42,7 +43,7 @@ public class ClothesInfoVO implements Serializable {
|
|||
/**
|
||||
* 服装价格
|
||||
*/
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class GoodVO implements Serializable {
|
||||
|
@ -26,7 +27,7 @@ public class GoodVO implements Serializable {
|
|||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 商品图片
|
||||
|
|
|
@ -4,6 +4,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ServiceGoodCardVO implements Serializable {
|
||||
|
@ -26,7 +27,7 @@ public class ServiceGoodCardVO implements Serializable {
|
|||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private Double price;
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 商品图片
|
||||
|
|
|
@ -10,6 +10,7 @@ import lombok.Data;
|
|||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -64,7 +65,7 @@ public class OrderVO implements Serializable {
|
|||
/**
|
||||
* 订单总金额
|
||||
*/
|
||||
private Double totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 订单状态
|
||||
|
|
|
@ -16,6 +16,8 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Service
|
||||
public class AdvanceOrderServiceImpl extends ServiceImpl<AdvanceOrderMapper, AdvanceOrder> implements AdvanceOrderService {
|
||||
|
||||
|
@ -27,7 +29,7 @@ public class AdvanceOrderServiceImpl extends ServiceImpl<AdvanceOrderMapper, Adv
|
|||
public void validAdvanceOrder(AdvanceOrder advanceOrder) {
|
||||
String type = advanceOrder.getType();
|
||||
String clothesType = advanceOrder.getClothesType();
|
||||
Double deposit = advanceOrder.getDeposit();
|
||||
BigDecimal deposit = advanceOrder.getDeposit();
|
||||
ContactsSnapshot contactsSnapshot = advanceOrder.getContactsSnapshot();
|
||||
String specificDate = advanceOrder.getSpecificDate();
|
||||
String timeSlot = advanceOrder.getTimeSlot();
|
||||
|
@ -37,7 +39,7 @@ public class AdvanceOrderServiceImpl extends ServiceImpl<AdvanceOrderMapper, Adv
|
|||
String orderStatus = advanceOrder.getOrderStatus();
|
||||
Long userId = advanceOrder.getUserId();
|
||||
|
||||
if (ObjectUtils.isEmpty(deposit) || deposit <= 0) {
|
||||
if (ObjectUtils.isEmpty(deposit) || deposit.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "定金参数错误");
|
||||
}
|
||||
if (ObjectUtils.anyNull(contactsSnapshot, isIndoors, isMakeup, isPhotography, userId)) {
|
||||
|
@ -67,8 +69,8 @@ public class AdvanceOrderServiceImpl extends ServiceImpl<AdvanceOrderMapper, Adv
|
|||
public QueryWrapper<AdvanceOrder> getQueryWrapper(AdvanceOrderQueryRequest advanceOrderQueryRequest) {
|
||||
Long id = advanceOrderQueryRequest.getId();
|
||||
String type = advanceOrderQueryRequest.getType();
|
||||
Double minDeposit = advanceOrderQueryRequest.getMinDeposit();
|
||||
Double maxDeposit = advanceOrderQueryRequest.getMaxDeposit();
|
||||
BigDecimal minDeposit = advanceOrderQueryRequest.getMinDeposit();
|
||||
BigDecimal maxDeposit = advanceOrderQueryRequest.getMaxDeposit();
|
||||
String startTime = advanceOrderQueryRequest.getStartTime();
|
||||
String endTime = advanceOrderQueryRequest.getEndTime();
|
||||
String orderStatus = advanceOrderQueryRequest.getOrderStatus();
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
@ -33,8 +34,8 @@ public class ClothesGradeServiceImpl extends ServiceImpl<ClothesGradeMapper, Clo
|
|||
Long id = clothesGrade.getId();
|
||||
String clothesType = clothesGrade.getClothesType();
|
||||
String image = clothesGrade.getImage();
|
||||
Double minPrice = clothesGrade.getMinPrice();
|
||||
Double maxPrice = clothesGrade.getMaxPrice();
|
||||
BigDecimal minPrice = clothesGrade.getMinPrice();
|
||||
BigDecimal maxPrice = clothesGrade.getMaxPrice();
|
||||
String brief = clothesGrade.getBrief();
|
||||
|
||||
if (update) {
|
||||
|
@ -42,13 +43,13 @@ public class ClothesGradeServiceImpl extends ServiceImpl<ClothesGradeMapper, Clo
|
|||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "参数id错误");
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isEmpty(minPrice) || minPrice <= 0) {
|
||||
if (ObjectUtils.isEmpty(minPrice) || minPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "最低价格参数错误");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(maxPrice) || maxPrice <= 0) {
|
||||
if (ObjectUtils.isEmpty(maxPrice) || maxPrice.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "最高价格参数错误");
|
||||
}
|
||||
if (minPrice >= maxPrice) {
|
||||
if (minPrice.compareTo(BigDecimal.ZERO) >= maxPrice.compareTo(BigDecimal.ZERO)) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "最低价格不能高于最高价格");
|
||||
}
|
||||
if (StringUtils.isAnyBlank(clothesType, image, brief)) {
|
||||
|
|
|
@ -14,6 +14,8 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Service
|
||||
public class ClothesInfoServiceImpl extends ServiceImpl<ClothesInfoMapper, ClothesInfo> implements ClothesInfoService {
|
||||
|
||||
|
@ -28,7 +30,7 @@ public class ClothesInfoServiceImpl extends ServiceImpl<ClothesInfoMapper, Cloth
|
|||
String image = clothesInfo.getImage();
|
||||
String effectImg = clothesInfo.getEffectImg();
|
||||
String intro = clothesInfo.getIntro();
|
||||
Double price = clothesInfo.getPrice();
|
||||
BigDecimal price = clothesInfo.getPrice();
|
||||
String clothesType = clothesInfo.getClothesType();
|
||||
if (update) {
|
||||
if (id == null) {
|
||||
|
@ -38,7 +40,7 @@ public class ClothesInfoServiceImpl extends ServiceImpl<ClothesInfoMapper, Cloth
|
|||
if (StringUtils.isAnyBlank(name, image, effectImg, intro, clothesType)) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "参数不全");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(price) || price < 0) {
|
||||
if (ObjectUtils.isEmpty(price) || price.compareTo(BigDecimal.ZERO) < 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "价格参数错误");
|
||||
}
|
||||
}
|
||||
|
@ -51,8 +53,8 @@ public class ClothesInfoServiceImpl extends ServiceImpl<ClothesInfoMapper, Cloth
|
|||
public QueryWrapper<ClothesInfo> getQueryWrapper(ClothesInfoQueryRequest clothesInfoQueryRequest) {
|
||||
Long id = clothesInfoQueryRequest.getId();
|
||||
String name = clothesInfoQueryRequest.getName();
|
||||
Double minPrice = clothesInfoQueryRequest.getMinPrice();
|
||||
Double maxPrice = clothesInfoQueryRequest.getMaxPrice();
|
||||
BigDecimal minPrice = clothesInfoQueryRequest.getMinPrice();
|
||||
BigDecimal maxPrice = clothesInfoQueryRequest.getMaxPrice();
|
||||
String clothesType = clothesInfoQueryRequest.getClothesType();
|
||||
String sortField = clothesInfoQueryRequest.getSortField();
|
||||
String sortOrder = clothesInfoQueryRequest.getSortOrder();
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
|
@ -53,7 +54,7 @@ public class CartRecordServiceImpl extends ServiceImpl<CartRecordMapper, CartRec
|
|||
CartRecord cartRecord = this.baseMapper.selectOne(queryWrapper);
|
||||
if (cartRecord != null) {
|
||||
cartRecord.setQuantity(cartRecord.getQuantity() + cartRecordAddRequest.getQuantity());
|
||||
cartRecord.setSubtotal(cartRecord.getSubtotal() + cartRecordAddRequest.getSubtotal());
|
||||
cartRecord.setSubtotal(cartRecord.getSubtotal().add(cartRecordAddRequest.getSubtotal()));
|
||||
boolean result = this.updateById(cartRecord);
|
||||
ThrowUtils.throwIf(!result, ErrorCode.OPERATION_ERROR);
|
||||
} else {
|
||||
|
@ -104,7 +105,7 @@ public class CartRecordServiceImpl extends ServiceImpl<CartRecordMapper, CartRec
|
|||
Long userId = cartRecord.getUserId();
|
||||
Long goodId = cartRecord.getGoodId();
|
||||
Integer quantity = cartRecord.getQuantity();
|
||||
Double subtotal = cartRecord.getSubtotal();
|
||||
BigDecimal subtotal = cartRecord.getSubtotal();
|
||||
Integer isGoodType = cartRecord.getIsGoodType();
|
||||
if (update) {
|
||||
if (userId == null) {
|
||||
|
@ -118,7 +119,7 @@ public class CartRecordServiceImpl extends ServiceImpl<CartRecordMapper, CartRec
|
|||
if (ObjectUtils.isEmpty(quantity) || quantity < 1) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "请传递正确的商品数量");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(subtotal) || subtotal <= 0) {
|
||||
if (ObjectUtils.isEmpty(subtotal) || subtotal.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "价格错误");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(isGoodType) || isGoodType != 1 && isGoodType != 0) {
|
||||
|
|
|
@ -14,6 +14,7 @@ import org.apache.commons.lang3.ObjectUtils;
|
|||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Service
|
||||
|
@ -54,7 +55,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
|
|||
public void validCoupon(Coupon coupon, boolean update) {
|
||||
Long id = coupon.getId();
|
||||
String name = coupon.getName();
|
||||
Double conditionAmount = coupon.getConditionAmount();
|
||||
BigDecimal conditionAmount = coupon.getConditionAmount();
|
||||
Integer requirePoints = coupon.getRequirePoints();
|
||||
Integer totalNum = coupon.getTotalNum();
|
||||
Integer residueNum = coupon.getResidueNum();
|
||||
|
@ -70,7 +71,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
|
|||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "参数id错误");
|
||||
}
|
||||
}
|
||||
if (ObjectUtils.isEmpty(conditionAmount) || conditionAmount <= 0) {
|
||||
if (ObjectUtils.isEmpty(conditionAmount) || conditionAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "满减价格错误");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(requirePoints) || requirePoints <= 0) {
|
||||
|
|
|
@ -15,6 +15,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -79,7 +80,7 @@ public class GoodServiceImpl extends ServiceImpl<GoodMapper, Good> implements Go
|
|||
String label = good.getLabel();
|
||||
Integer inventory = good.getInventory();
|
||||
Integer festivalOrder = good.getFestivalOrder();
|
||||
Double price = good.getPrice();
|
||||
BigDecimal price = good.getPrice();
|
||||
|
||||
if (update) {
|
||||
if (id == null) {
|
||||
|
@ -95,7 +96,7 @@ public class GoodServiceImpl extends ServiceImpl<GoodMapper, Good> implements Go
|
|||
if (ObjectUtils.isEmpty(festivalOrder) || festivalOrder <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "节日参数错误");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(price) || price <= 0) {
|
||||
if (ObjectUtils.isEmpty(price) || price.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "商品价格不能小于等于0");
|
||||
}
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -61,8 +62,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||
}
|
||||
Long userId = orderQueryRequest.getUserId();
|
||||
Long orderId = orderQueryRequest.getOrderId();
|
||||
Double minTotalAmount = orderQueryRequest.getMinTotalAmount();
|
||||
Double maxTotalAmount = orderQueryRequest.getMaxTotalAmount();
|
||||
BigDecimal minTotalAmount = orderQueryRequest.getMinTotalAmount();
|
||||
BigDecimal maxTotalAmount = orderQueryRequest.getMaxTotalAmount();
|
||||
String orderStatus = orderQueryRequest.getOrderStatus();
|
||||
String orderNumber = orderQueryRequest.getOrderNumber();
|
||||
Date startTime = orderQueryRequest.getStartTime();
|
||||
|
@ -99,7 +100,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||
String orderNumber = orderMainInfoAddRequest.getOrderNumber();
|
||||
String orderStatus = orderMainInfoAddRequest.getOrderStatus();
|
||||
String note = orderMainInfoAddRequest.getNote();
|
||||
Double totalAmount = orderMainInfoAddRequest.getTotalAmount();
|
||||
BigDecimal totalAmount = orderMainInfoAddRequest.getTotalAmount();
|
||||
List<OrderItemMainInfoAddRequest> orderItemMainInfoAddRequestList = orderMainInfoAddRequest.getOrderItemMainInfoAddRequestList();
|
||||
|
||||
|
||||
|
@ -134,7 +135,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||
orderItemAddRequest.setGoodSnapshot(goodSnapshot);
|
||||
orderItemAddRequest.setPriceSnapshot(goodSnapshot.getPrice());
|
||||
orderItemAddRequest.setQuantity(quantity);
|
||||
orderItemAddRequest.setItemTotalAmount(goodSnapshot.getPrice() * quantity);
|
||||
orderItemAddRequest.setItemTotalAmount(goodSnapshot.getPrice().multiply(BigDecimal.valueOf(quantity)));
|
||||
orderItemAddRequest.setReservationDate(reservationDate);
|
||||
orderItemAddRequest.setTimeSlot(timeSlot);
|
||||
return orderItemAddRequest;
|
||||
|
@ -166,9 +167,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||
String orderNumber = order.getOrderNumber();
|
||||
Long userId = order.getUserId();
|
||||
String userName = order.getUserName();
|
||||
Double totalAmount = order.getTotalAmount();
|
||||
BigDecimal totalAmount = order.getTotalAmount();
|
||||
String orderStatus = order.getOrderStatus();
|
||||
if (ObjectUtils.isEmpty(totalAmount) || totalAmount <= 0) {
|
||||
if (ObjectUtils.isEmpty(totalAmount) || totalAmount.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
throw new BusinessException(ErrorCode.PARAMS_ERROR, "价格错误");
|
||||
}
|
||||
if (ObjectUtils.isEmpty(userId)) {
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
spring:
|
||||
datasource:
|
||||
# 生产环境
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://154.8.193.216:3306/feiyi?serverTimezone=Asia/Shanghai
|
||||
# username: feiyi
|
||||
# password: 123456asd
|
||||
|
||||
# 测试环境
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://123.249.108.160:3306/feiyi?serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://154.8.193.216:3306/feiyi?serverTimezone=Asia/Shanghai
|
||||
username: feiyi
|
||||
password: 123456asd
|
||||
|
||||
# 测试环境
|
||||
# driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# url: jdbc:mysql://123.249.108.160:3306/feiyi?serverTimezone=Asia/Shanghai
|
||||
# username: feiyi
|
||||
# password: 123456asd
|
||||
|
||||
hikari:
|
||||
max-lifetime: 120000
|
||||
data:
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
package com.cultural.heritage.test;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class Test {
|
||||
public static void main(String[] args) {
|
||||
// Date date = new Date();
|
||||
|
@ -22,5 +24,8 @@ public class Test {
|
|||
// System.out.println(StringUtils.isAnyBlank("333", "333", null, "dfs"));
|
||||
// System.out.println(StringUtils.isAnyBlank(null));
|
||||
// System.out.println(ObjectUtils.anyNull(null));
|
||||
Integer quantity = 10;
|
||||
BigDecimal bigDecimal = BigDecimal.valueOf(quantity);
|
||||
System.out.println(bigDecimal);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user