## 添加商品加购处理;
This commit is contained in:
parent
3153d96c46
commit
37166d8a71
|
@ -11,11 +11,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 等级的dto
|
* 等级的dto
|
||||||
* @Author: sui q
|
|
||||||
* @Time: 2022/9/24 15:06
|
|
||||||
* @Classname: GradeDTO
|
|
||||||
* @PackageName: com.hzs.system.config.dto
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
|
@ -95,7 +91,6 @@ public class GradeDTO implements Serializable {
|
||||||
/**
|
/**
|
||||||
* 图片
|
* 图片
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String image;
|
private String image;
|
||||||
/**
|
/**
|
||||||
* 色值
|
* 色值
|
||||||
|
@ -108,18 +103,8 @@ public class GradeDTO implements Serializable {
|
||||||
private String icon;
|
private String icon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 等级数量
|
* 加购数量
|
||||||
*/
|
*/
|
||||||
private Integer boxNumber;
|
private Integer boxNumber;
|
||||||
|
|
||||||
/**
|
|
||||||
* 总数量
|
|
||||||
*/
|
|
||||||
private Integer boxTotal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小市场数量
|
|
||||||
*/
|
|
||||||
private Integer boxSmallTotal;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
package com.hzs.sale.order.controller.api;
|
package com.hzs.sale.order.controller.api;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.hzs.common.core.annotation.RepeatSubmit;
|
import com.hzs.common.core.annotation.RepeatSubmit;
|
||||||
import com.hzs.common.core.constant.CacheConstants;
|
import com.hzs.common.core.constant.CacheConstants;
|
||||||
import com.hzs.common.core.constant.HttpStatus;
|
import com.hzs.common.core.constant.HttpStatus;
|
||||||
import com.hzs.common.core.constant.msg.MemberMsgConstants;
|
import com.hzs.common.core.constant.msg.MemberMsgConstants;
|
||||||
import com.hzs.common.core.constant.msg.SaOrderMsgConstants;
|
import com.hzs.common.core.constant.msg.SaOrderMsgConstants;
|
||||||
import com.hzs.common.core.enums.EOrderType;
|
import com.hzs.common.core.enums.*;
|
||||||
import com.hzs.common.core.utils.StringUtils;
|
import com.hzs.common.core.utils.StringUtils;
|
||||||
import com.hzs.common.core.web.domain.AjaxResult;
|
import com.hzs.common.core.web.domain.AjaxResult;
|
||||||
import com.hzs.common.domain.member.ext.CuMemberAccountExt;
|
import com.hzs.common.domain.member.ext.CuMemberAccountExt;
|
||||||
|
@ -16,10 +17,24 @@ import com.hzs.common.security.utils.SecurityUtils;
|
||||||
import com.hzs.sale.order.controller.ParentOrderController;
|
import com.hzs.sale.order.controller.ParentOrderController;
|
||||||
import com.hzs.sale.order.param.OrderParam;
|
import com.hzs.sale.order.param.OrderParam;
|
||||||
import com.hzs.sale.order.param.OrderReturn;
|
import com.hzs.sale.order.param.OrderReturn;
|
||||||
|
import com.hzs.sale.order.service.impl.SaOrderHandle;
|
||||||
|
import com.hzs.sale.order.vo.CheckBeforeConfirmVO;
|
||||||
|
import com.hzs.sale.shopping.param.CarWaresInfoParam;
|
||||||
|
import com.hzs.sale.shopping.vo.CarWaresInfoVo;
|
||||||
|
import com.hzs.sale.shopping.vo.ShoppingCartRedis;
|
||||||
import com.hzs.sale.shopping.vo.ShoppingCartVO;
|
import com.hzs.sale.shopping.vo.ShoppingCartVO;
|
||||||
|
import com.hzs.sale.shopping.vo.WaresItemVo;
|
||||||
|
import com.hzs.sale.wares.service.IBdWaresSpecsSkuService;
|
||||||
|
import com.hzs.system.config.IGradeServiceApi;
|
||||||
|
import com.hzs.system.config.dto.GradeDTO;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他订单(升级、复购)订单
|
* 其他订单(升级、复购)订单
|
||||||
*/
|
*/
|
||||||
|
@ -28,6 +43,14 @@ import org.springframework.web.bind.annotation.*;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ApiOthSaOrderController extends ParentOrderController {
|
public class ApiOthSaOrderController extends ParentOrderController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SaOrderHandle saOrderHandle;
|
||||||
|
@Autowired
|
||||||
|
private IBdWaresSpecsSkuService iBdWaresSpecsSkuService;
|
||||||
|
|
||||||
|
@DubboReference
|
||||||
|
IGradeServiceApi iGradeServiceApi;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提供确认订单的方法
|
* 提供确认订单的方法
|
||||||
*
|
*
|
||||||
|
@ -180,4 +203,82 @@ public class ApiOthSaOrderController extends ParentOrderController {
|
||||||
return AjaxResult.error(cuMemberAccountExt.getErrorMsg());
|
return AjaxResult.error(cuMemberAccountExt.getErrorMsg());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单前校验
|
||||||
|
*
|
||||||
|
* @param param
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/check-before-confirm")
|
||||||
|
public AjaxResult checkBeforeConfirm(CarWaresInfoParam param) {
|
||||||
|
if (null == param.getSpecialArea() || CollectionUtil.isEmpty(param.getShoppingIds())) {
|
||||||
|
return AjaxResult.error("参数不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
CheckBeforeConfirmVO vo = CheckBeforeConfirmVO.builder()
|
||||||
|
.flag(EYesNo.YES.getIntValue())
|
||||||
|
.build();
|
||||||
|
|
||||||
|
Integer pkCountry = SecurityUtils.getPkCountry();
|
||||||
|
Long userId = SecurityUtils.getUserId();
|
||||||
|
|
||||||
|
if (ESpecialArea.REGISTER_AREA.getValue() == param.getSpecialArea()
|
||||||
|
|| ESpecialArea.UPGRADE_AREA.getValue() == param.getSpecialArea()) {
|
||||||
|
// 2025.07.29 注册、升级专区需要处理加购
|
||||||
|
String key = CacheConstants.SHOPPIN_GCART + pkCountry + "_" + userId;
|
||||||
|
Map<String, Object> shoppingCartRedisMap = redisService.getCacheMap(key);
|
||||||
|
if (shoppingCartRedisMap.containsKey(key)) {
|
||||||
|
Map<String, String> innerShopMap = (Map<String, String>) shoppingCartRedisMap.get(key);
|
||||||
|
if (null != innerShopMap) {
|
||||||
|
// 业绩
|
||||||
|
BigDecimal achieveAmount = BigDecimal.ZERO;
|
||||||
|
// 加购商品数量
|
||||||
|
Integer addPurchase = 0;
|
||||||
|
for (String shoppingId : param.getShoppingIds()) {
|
||||||
|
for (String innkey : innerShopMap.keySet()) {
|
||||||
|
String value = innerShopMap.get(innkey);
|
||||||
|
ShoppingCartRedis shoppingCartRedis = JSONUtil.toBean(value, ShoppingCartRedis.class);
|
||||||
|
if (shoppingCartRedis.getShoppingId().equals(shoppingId)) {
|
||||||
|
WaresItemVo waresItemVo = iBdWaresSpecsSkuService.listWaresItemsNew(param.getSpecialArea(),
|
||||||
|
shoppingCartRedis.getWaresCode(), shoppingCartRedis.getProductGroup(), shoppingCartRedis.getNumber());
|
||||||
|
if (EWaresType.ADD_PURCHASE.getValue().equals(waresItemVo.getIsMakerGift())) {
|
||||||
|
// 是加购商品,需要累计数量
|
||||||
|
addPurchase += shoppingCartRedis.getNumber();
|
||||||
|
}
|
||||||
|
// 累计业绩
|
||||||
|
achieveAmount = achieveAmount.add(waresItemVo.getAchieveAmount());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GradeDTO gradeDTO = saOrderHandle.getMemberGradeAndAwardByCountry(BigDecimal.ZERO, achieveAmount, pkCountry, EUpgradeWay.COVER.getValue() + "");
|
||||||
|
if (null != gradeDTO) {
|
||||||
|
if (EOrderType.REGISTER_ORDER.getValue() == param.getSpecialArea()
|
||||||
|
|| EOrderType.UPGRADE_ORDER.getValue() == param.getSpecialArea()) {
|
||||||
|
// 2025.05.13 新添加需求,开网初期报单660给1980等级,报单1980给9900等级
|
||||||
|
if (EGrade.YOU_KE.getValue() == gradeDTO.getGradeValue()) {
|
||||||
|
GradeDTO newGradeDTO = iGradeServiceApi.getGradeByGradeValue(EGrade.MAKER.getValue(), pkCountry).getData();
|
||||||
|
if (null != newGradeDTO) {
|
||||||
|
gradeDTO = newGradeDTO;
|
||||||
|
}
|
||||||
|
} else if (EGrade.MAKER.getValue() == gradeDTO.getGradeValue()) {
|
||||||
|
GradeDTO newGradeDTO = iGradeServiceApi.getGradeByGradeValue(EGrade.VIP.getValue(), pkCountry).getData();
|
||||||
|
if (null != newGradeDTO) {
|
||||||
|
gradeDTO = newGradeDTO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 当前等级可以购买多少加购商品
|
||||||
|
if (addPurchase > gradeDTO.getBoxNumber()) {
|
||||||
|
vo.setFlag(EYesNo.NO.getIntValue());
|
||||||
|
vo.setMsg("当前等级只能购买, " + gradeDTO.getBoxNumber() + " 件加购商品。");
|
||||||
|
return AjaxResult.success(vo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return AjaxResult.success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,13 +65,13 @@ public class ApiRegSaOrderController extends ParentOrderController {
|
||||||
return ajaxResult;
|
return ajaxResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (orderParam.getDeleteList() == null || orderParam.getDeleteList().size() == 0) {
|
if (null == orderParam.getDeleteList() || orderParam.getDeleteList().size() == 0) {
|
||||||
return AjaxResult.error(SaOrderMsgConstants.SPECIAL_AREA_NOT_EMPTY);
|
return AjaxResult.error(SaOrderMsgConstants.SPECIAL_AREA_NOT_EMPTY);
|
||||||
}
|
}
|
||||||
|
|
||||||
initSecurityOrderParam(orderParam);
|
initSecurityOrderParam(orderParam);
|
||||||
// 验证必输项
|
// 验证必输项
|
||||||
if (source == null
|
if (null == source
|
||||||
|| validateFieldNotNull(orderParam, orderParam.getValidConfirmField())
|
|| validateFieldNotNull(orderParam, orderParam.getValidConfirmField())
|
||||||
|| !checkRecMsgBoolean(orderParam)) {
|
|| !checkRecMsgBoolean(orderParam)) {
|
||||||
return AjaxResult.error(MemberMsgConstants.REQUIRED_NOT_EMPTY);
|
return AjaxResult.error(MemberMsgConstants.REQUIRED_NOT_EMPTY);
|
||||||
|
|
|
@ -744,7 +744,7 @@ public class SaOrderHandle {
|
||||||
* @param settleOrderPv 订单业绩
|
* @param settleOrderPv 订单业绩
|
||||||
* @param pkCountry 国家
|
* @param pkCountry 国家
|
||||||
*/
|
*/
|
||||||
GradeDTO getMemberGradeAndAwardByCountry(BigDecimal settleOrderAmount, BigDecimal settleOrderPv, Integer pkCountry, String upgradeWay) {
|
public GradeDTO getMemberGradeAndAwardByCountry(BigDecimal settleOrderAmount, BigDecimal settleOrderPv, Integer pkCountry, String upgradeWay) {
|
||||||
List<GradeDTO> gradeList = iGradeServiceApi.queryGradeConfigByCondition(pkCountry).getData();
|
List<GradeDTO> gradeList = iGradeServiceApi.queryGradeConfigByCondition(pkCountry).getData();
|
||||||
|
|
||||||
if (gradeList != null && gradeList.size() > 0) {
|
if (gradeList != null && gradeList.size() > 0) {
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.hzs.sale.order.vo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下单前校验返回VO
|
||||||
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
public class CheckBeforeConfirmVO implements Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否通过(0=是,1=否)
|
||||||
|
*/
|
||||||
|
private Integer flag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 错误提示
|
||||||
|
*/
|
||||||
|
private String msg;
|
||||||
|
|
||||||
|
}
|
|
@ -22,8 +22,6 @@ import java.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购物车操作处理
|
* 购物车操作处理
|
||||||
*
|
|
||||||
* @author hzs
|
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -33,9 +31,9 @@ public class ApiShoppingCartController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IShoppingCartService shoppingCartService;
|
private IShoppingCartService iShoppingCartService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBdWaresSpecsSkuService bdWaresSpecsSkuService;
|
private IBdWaresSpecsSkuService iBdWaresSpecsSkuService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加购物车
|
* 添加购物车
|
||||||
|
@ -103,7 +101,7 @@ public class ApiShoppingCartController extends BaseController {
|
||||||
if (shoppingCartRedisMap.containsKey(key)) {
|
if (shoppingCartRedisMap.containsKey(key)) {
|
||||||
Map<String, String> innerShopMap;
|
Map<String, String> innerShopMap;
|
||||||
innerShopMap = (Map<String, String>) shoppingCartRedisMap.get(key);
|
innerShopMap = (Map<String, String>) shoppingCartRedisMap.get(key);
|
||||||
shoppingCartOld = shoppingCartService.getShopping(innerShopMap, shoppingCartVO.getSpecialArea(), shoppingCartVO.getPkCountry());
|
shoppingCartOld = iShoppingCartService.getShopping(innerShopMap, shoppingCartVO.getSpecialArea(), shoppingCartVO.getPkCountry());
|
||||||
} else {
|
} else {
|
||||||
shoppingCartOld = new ArrayList<>();
|
shoppingCartOld = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
@ -143,7 +141,7 @@ public class ApiShoppingCartController extends BaseController {
|
||||||
}
|
}
|
||||||
if (shoppingCartPkCountry.equals(shoppingCartRedisPkCountry)) {
|
if (shoppingCartPkCountry.equals(shoppingCartRedisPkCountry)) {
|
||||||
if (null != shoppingCartRedis.getWaresCode()) {
|
if (null != shoppingCartRedis.getWaresCode()) {
|
||||||
CuWaresParams cuWaresParams = bdWaresSpecsSkuService.queryWaresSpecsSkuCount(shoppingCartRedisSpecialArea, shoppingCartRedis.getWaresCode(), userId, shoppingCartRedisPkCountry);
|
CuWaresParams cuWaresParams = iBdWaresSpecsSkuService.queryWaresSpecsSkuCount(shoppingCartRedisSpecialArea, shoppingCartRedis.getWaresCode(), userId, shoppingCartRedisPkCountry);
|
||||||
if (null != cuWaresParams && CollectionUtil.isNotEmpty(cuWaresParams.getProductParams())
|
if (null != cuWaresParams && CollectionUtil.isNotEmpty(cuWaresParams.getProductParams())
|
||||||
&& CollectionUtil.isNotEmpty(cuWaresParams.getProductParams().get(0).getWaresItemsParamsList())) {
|
&& CollectionUtil.isNotEmpty(cuWaresParams.getProductParams().get(0).getWaresItemsParamsList())) {
|
||||||
count += shoppingCartRedis.getNumber();
|
count += shoppingCartRedis.getNumber();
|
||||||
|
@ -196,7 +194,7 @@ public class ApiShoppingCartController extends BaseController {
|
||||||
if (shoppingCartRedisSpecialArea.equals(shoppingCartSpecialArea)
|
if (shoppingCartRedisSpecialArea.equals(shoppingCartSpecialArea)
|
||||||
&& shoppingCartPkCountry.equals(shoppingCartRedisPkCountry)) {
|
&& shoppingCartPkCountry.equals(shoppingCartRedisPkCountry)) {
|
||||||
if (null != shoppingCartRedis.getWaresCode()) {
|
if (null != shoppingCartRedis.getWaresCode()) {
|
||||||
CuWaresParams cuWaresParams = bdWaresSpecsSkuService.queryWaresSpecsSkuCount(shoppingCartSpecialArea, shoppingCartRedis.getWaresCode(), userId, shoppingCartPkCountry);
|
CuWaresParams cuWaresParams = iBdWaresSpecsSkuService.queryWaresSpecsSkuCount(shoppingCartSpecialArea, shoppingCartRedis.getWaresCode(), userId, shoppingCartPkCountry);
|
||||||
if (null != cuWaresParams && CollectionUtil.isNotEmpty(cuWaresParams.getProductParams())
|
if (null != cuWaresParams && CollectionUtil.isNotEmpty(cuWaresParams.getProductParams())
|
||||||
&& CollectionUtil.isNotEmpty(cuWaresParams.getProductParams().get(0).getWaresItemsParamsList())) {
|
&& CollectionUtil.isNotEmpty(cuWaresParams.getProductParams().get(0).getWaresItemsParamsList())) {
|
||||||
smallCount += shoppingCartRedis.getNumber();
|
smallCount += shoppingCartRedis.getNumber();
|
||||||
|
@ -228,7 +226,7 @@ public class ApiShoppingCartController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/batchDelShopping")
|
@PostMapping("/batchDelShopping")
|
||||||
public AjaxResult batchDelShopping(@RequestBody ShoppingCartVO sop) {
|
public AjaxResult batchDelShopping(@RequestBody ShoppingCartVO sop) {
|
||||||
shoppingCartService.batchDelShopping(SecurityUtils.getUserId(), sop);
|
iShoppingCartService.batchDelShopping(SecurityUtils.getUserId(), sop);
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,7 +286,7 @@ public class ApiShoppingCartController extends BaseController {
|
||||||
String value = innerShopMap.get(innkey);
|
String value = innerShopMap.get(innkey);
|
||||||
ShoppingCartRedis shoppingCartRedis = JSONUtil.toBean(value, ShoppingCartRedis.class);
|
ShoppingCartRedis shoppingCartRedis = JSONUtil.toBean(value, ShoppingCartRedis.class);
|
||||||
if (shoppingCartRedis.getShoppingId().equals(shoppingId)) {
|
if (shoppingCartRedis.getShoppingId().equals(shoppingId)) {
|
||||||
WaresItemVo waresItemVo = bdWaresSpecsSkuService.selectWaresItemsVO(SecurityUtils.getUserId(), shoppingCartRedis.getPkCountry(), scr.getSpecialArea(),
|
WaresItemVo waresItemVo = iBdWaresSpecsSkuService.selectWaresItemsVO(SecurityUtils.getUserId(), shoppingCartRedis.getPkCountry(), scr.getSpecialArea(),
|
||||||
shoppingCartRedis.getWaresCode(), shoppingCartRedis.getProductGroup(), shoppingCartRedis.getNumber());
|
shoppingCartRedis.getWaresCode(), shoppingCartRedis.getProductGroup(), shoppingCartRedis.getNumber());
|
||||||
priceAmount = priceAmount.add(waresItemVo.getPriceAmount());
|
priceAmount = priceAmount.add(waresItemVo.getPriceAmount());
|
||||||
achieveAmount = achieveAmount.add(waresItemVo.getAchieveAmount());
|
achieveAmount = achieveAmount.add(waresItemVo.getAchieveAmount());
|
||||||
|
|
|
@ -1,23 +1,9 @@
|
||||||
package com.hzs.sale.shopping.param;/**
|
package com.hzs.sale.shopping.param;
|
||||||
* @Description:
|
|
||||||
* @Author: yuhui
|
|
||||||
* @Time: 2023/3/20 15:40
|
|
||||||
* @Classname: CarWaresInfoParam
|
|
||||||
* @PackageName: com.hzs.sale.shopping.param
|
|
||||||
*/
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
*@BelongsProject: hzs_cloud
|
|
||||||
*@BelongsPackage: com.hzs.sale.shopping.param
|
|
||||||
*@Author: yh
|
|
||||||
*@CreateTime: 2023-03-20 15:40
|
|
||||||
*@Description: TODO
|
|
||||||
*@Version: 1.0
|
|
||||||
*/
|
|
||||||
@Data
|
@Data
|
||||||
public class CarWaresInfoParam {
|
public class CarWaresInfoParam {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,4 @@
|
||||||
package com.hzs.sale.shopping.vo;/**
|
package com.hzs.sale.shopping.vo;
|
||||||
* @Description:
|
|
||||||
* @Author: yuhui
|
|
||||||
* @Time: 2023/3/20 15:36
|
|
||||||
* @Classname: CarWaresInfo
|
|
||||||
* @PackageName: com.hzs.sale.shopping.vo
|
|
||||||
*/
|
|
||||||
|
|
||||||
import com.hzs.common.core.annotation.BigDecimalFormat;
|
import com.hzs.common.core.annotation.BigDecimalFormat;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -13,21 +7,16 @@ import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*@BelongsProject: hzs_cloud 购物车下单商品展示信息
|
* 购物车下单商品展示信息
|
||||||
*@BelongsPackage: com.hzs.sale.shopping.vo
|
|
||||||
*@Author: yh
|
|
||||||
*@CreateTime: 2023-03-20 15:36
|
|
||||||
*@Description: TODO
|
|
||||||
*@Version: 1.0
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class CarWaresInfoVo {
|
public class CarWaresInfoVo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品信息
|
* 商品信息
|
||||||
*/
|
*/
|
||||||
private List<WaresItemVo> orderItemsParams;
|
private List<WaresItemVo> orderItemsParams;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 总计金额
|
* 总计金额
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -5,11 +5,7 @@ import lombok.Data;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 购物车产品SKU组合缓存实体类
|
* 购物车产品SKU组合缓存实体类
|
||||||
* @Author: zhangjing
|
|
||||||
* @Time: 2022/9/16 11:11
|
|
||||||
* @Classname: ShoppingCartVO
|
|
||||||
* @PackageName: com.hzs.common.domain.sale.ext
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class ProductGroup implements Serializable {
|
public class ProductGroup implements Serializable {
|
||||||
|
|
|
@ -78,9 +78,14 @@ public interface IBdWaresSpecsSkuService extends IService<BdWaresSpecsSku> {
|
||||||
*/
|
*/
|
||||||
List<WaresItemWaresInfo> selectByPkIds(List<Integer> pkWaresSpecsSku);
|
List<WaresItemWaresInfo> selectByPkIds(List<Integer> pkWaresSpecsSku);
|
||||||
|
|
||||||
/*
|
/**
|
||||||
|
* 查询购物车商品信息
|
||||||
|
*/
|
||||||
|
WaresItemVo listWaresItemsNew(Integer specialArea, String waresCode, List<ProductGroup> productGroup, Integer quantity);
|
||||||
|
|
||||||
|
/**
|
||||||
* 查询商品封装为返回到会员端商品信息
|
* 查询商品封装为返回到会员端商品信息
|
||||||
**/
|
*/
|
||||||
WaresItemVo selectWaresItemsVO(Long pkMember, Integer pkCountry, Integer specialArea, String waresCode, List<ProductGroup> productGroup, Integer quantity);
|
WaresItemVo selectWaresItemsVO(Long pkMember, Integer pkCountry, Integer specialArea, String waresCode, List<ProductGroup> productGroup, Integer quantity);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -390,6 +390,30 @@ public class BdWaresSpecsSkuServiceImpl extends ServiceImpl<BdWaresSpecsSkuMappe
|
||||||
return baseMapper.selectByPkIds(pkWaresSpecsSku);
|
return baseMapper.selectByPkIds(pkWaresSpecsSku);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WaresItemVo listWaresItemsNew(Integer specialArea, String waresCode, List<ProductGroup> productGroup, Integer quantity) {
|
||||||
|
WaresItemVo waresItemVo = WaresItemVo.builder().build();
|
||||||
|
|
||||||
|
if (CollectionUtil.isNotEmpty(productGroup)) {
|
||||||
|
waresItemVo = baseMapper.selectWaresItemsVO(specialArea, waresCode, productGroup);
|
||||||
|
waresItemVo.setQuantity(quantity);
|
||||||
|
waresItemVo.setSkuQuantity(waresItemVo.getQuantity());
|
||||||
|
waresItemVo.setPrice(BigDecimal.ZERO);
|
||||||
|
waresItemVo.setPriceAmount(BigDecimal.ZERO);
|
||||||
|
waresItemVo.setAchieve(BigDecimal.ZERO);
|
||||||
|
waresItemVo.setAchieveAmount(BigDecimal.ZERO);
|
||||||
|
|
||||||
|
for (WaresItemWaresInfo waresItemWaresInfo : waresItemVo.getWaresItemsParamList()) {
|
||||||
|
waresItemVo.setPrice(ComputeUtil.computeAdd(waresItemVo.getPrice(), ComputeUtil.computeMultiply(waresItemWaresInfo.getPrice(), waresItemWaresInfo.getQuantity())));
|
||||||
|
waresItemVo.setAchieve(ComputeUtil.computeAdd(waresItemVo.getAchieve(), ComputeUtil.computeMultiply(waresItemWaresInfo.getAchieve(), waresItemWaresInfo.getQuantity())));
|
||||||
|
}
|
||||||
|
|
||||||
|
waresItemVo.setPriceAmount(ComputeUtil.computeMultiply(waresItemVo.getPrice(), waresItemVo.getQuantity()));
|
||||||
|
waresItemVo.setAchieveAmount(ComputeUtil.computeMultiply(waresItemVo.getAchieve(), waresItemVo.getQuantity()));
|
||||||
|
}
|
||||||
|
return waresItemVo;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public WaresItemVo selectWaresItemsVO(Long pkMember, Integer pkCountry, Integer specialArea, String waresCode, List<ProductGroup> productGroup, Integer quantity) {
|
public WaresItemVo selectWaresItemsVO(Long pkMember, Integer pkCountry, Integer specialArea, String waresCode, List<ProductGroup> productGroup, Integer quantity) {
|
||||||
WaresItemVo waresItemVo = WaresItemVo.builder().build();
|
WaresItemVo waresItemVo = WaresItemVo.builder().build();
|
||||||
|
|
|
@ -49,7 +49,8 @@
|
||||||
be.pk_air_postage,be.pk_ocean_postage,bw.pk_id pk_wares,be.is_maker_gift,be.pre_sale_status,
|
be.pk_air_postage,be.pk_ocean_postage,bw.pk_id pk_wares,be.is_maker_gift,be.pre_sale_status,
|
||||||
be.pk_special_currency,bw.wares_code, bw.wares_name, bd.is_gift is_gift,
|
be.pk_special_currency,bw.wares_code, bw.wares_name, bd.is_gift is_gift,
|
||||||
bd.pk_product,bs.price,bs.achieve,bp.pk_supplier,bp.shipping_channel,bp.product_code,
|
bd.pk_product,bs.price,bs.achieve,bp.pk_supplier,bp.shipping_channel,bp.product_code,
|
||||||
bs.ass_achieve,b.specs_name,b.specs_name_id from bd_wares bw
|
bs.ass_achieve,b.specs_name,b.specs_name_id
|
||||||
|
from bd_wares bw
|
||||||
inner join bd_wares_extend be
|
inner join bd_wares_extend be
|
||||||
on bw.pk_id = be.pk_wares
|
on bw.pk_id = be.pk_wares
|
||||||
inner join bd_wares_detail bd
|
inner join bd_wares_detail bd
|
||||||
|
|
|
@ -327,7 +327,8 @@
|
||||||
select bw.wares_code,bw.cover1,bw.WARES_NAME,be.is_maker_gift,
|
select bw.wares_code,bw.cover1,bw.WARES_NAME,be.is_maker_gift,
|
||||||
bs.price price,bs.achieve achieve,bs.ass_achieve ass_achieve,
|
bs.price price,bs.achieve achieve,bs.ass_achieve ass_achieve,
|
||||||
bd.pk_id pk_wares_detail,bs.pk_id pk_wares_specs_sku,bp.product_name,
|
bd.pk_id pk_wares_detail,bs.pk_id pk_wares_specs_sku,bp.product_name,
|
||||||
bs.spec_cover,#{item.quantity} quantity from BD_WARES bw
|
bs.spec_cover,#{item.quantity} quantity
|
||||||
|
from BD_WARES bw
|
||||||
inner join bd_wares_extend be
|
inner join bd_wares_extend be
|
||||||
on bw.pk_id = be.pk_wares
|
on bw.pk_id = be.pk_wares
|
||||||
inner join bd_wares_detail bd
|
inner join bd_wares_detail bd
|
||||||
|
|
|
@ -27,14 +27,4 @@ public class SysConstants {
|
||||||
*/
|
*/
|
||||||
public static final String SPECIAL_CODE = "BD68880628";
|
public static final String SPECIAL_CODE = "BD68880628";
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 血缘累计业绩30万
|
|
||||||
*/
|
|
||||||
public static final BigDecimal TOTAL_AREA_PV = new BigDecimal("300000");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小区业绩累计10万
|
|
||||||
*/
|
|
||||||
public static final BigDecimal SMALL_AREA_PV = new BigDecimal("100000");
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,11 @@ public enum EWaresType {
|
||||||
*/
|
*/
|
||||||
PRODUCT_188(2, "188商品"),
|
PRODUCT_188(2, "188商品"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 3=加购商品
|
||||||
|
*/
|
||||||
|
ADD_PURCHASE(3, "加购商品"),
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -157,7 +157,7 @@ public class BdWaresExtend extends BaseEntity {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品类型(1=普通商品,2=188商品) -- EWaresType
|
* 商品类型(1=普通商品,2=188商品,3=加购商品) -- EWaresType
|
||||||
*/
|
*/
|
||||||
@TableField("IS_MAKER_GIFT")
|
@TableField("IS_MAKER_GIFT")
|
||||||
private Integer isMakerGift;
|
private Integer isMakerGift;
|
||||||
|
|
|
@ -153,7 +153,7 @@ public class BdGrade extends BaseEntity {
|
||||||
private String icon;
|
private String icon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 等级数量
|
* 加购数量
|
||||||
*/
|
*/
|
||||||
@TableField("BOX_NUMBER")
|
@TableField("BOX_NUMBER")
|
||||||
private Integer boxNumber;
|
private Integer boxNumber;
|
||||||
|
|
|
@ -1,28 +1,21 @@
|
||||||
package com.hzs.common.domain.system.ext;
|
package com.hzs.common.domain.system.ext;
|
||||||
|
|
||||||
import com.hzs.common.core.annotation.Transaction;
|
|
||||||
import com.hzs.common.core.constant.EnumsPrefixConstants;
|
|
||||||
import com.hzs.common.domain.system.config.BdGradeScope;
|
import com.hzs.common.domain.system.config.BdGradeScope;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
|
||||||
* 等级范围
|
* 等级范围
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @author zhangjing
|
|
||||||
* @since 2022-10-24
|
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Data
|
@Data
|
||||||
public class BdGradeScopeExt extends BdGradeScope {
|
public class BdGradeScopeExt extends BdGradeScope {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 等级名称
|
* 等级名称
|
||||||
*/
|
*/
|
||||||
private String pkScopeVal;
|
private String pkScopeVal;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue