## 雨汐团队只有自己的复购、重消商品才累盒数;
This commit is contained in:
parent
2d31fc206a
commit
7873bcba15
|
@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||
import com.hzs.common.core.constant.*;
|
||||
import com.hzs.common.core.domain.R;
|
||||
import com.hzs.common.core.enums.*;
|
||||
import com.hzs.common.core.enums.retail.ERetailWaresPrice;
|
||||
import com.hzs.common.core.exception.ServiceException;
|
||||
import com.hzs.common.core.service.RedisService;
|
||||
import com.hzs.common.core.utils.*;
|
||||
|
@ -35,10 +34,10 @@ import com.hzs.sale.order.param.OrderItemsParam;
|
|||
import com.hzs.sale.order.param.WaresNumberParam;
|
||||
import com.hzs.sale.order.service.*;
|
||||
import com.hzs.sale.order.service.impl.SaOrderHandle;
|
||||
import com.hzs.sale.product.service.IBdProductService;
|
||||
import com.hzs.sale.wares.service.IBdWaresDetailService;
|
||||
import com.hzs.sale.wares.service.IBdWaresExtendService;
|
||||
import com.hzs.sale.wares.service.IBdWaresRangeService;
|
||||
import com.hzs.sale.wares.service.IBdWaresService;
|
||||
import com.hzs.system.base.ICurrencyServiceApi;
|
||||
import com.hzs.system.base.dto.CurrencyDTO;
|
||||
import com.hzs.system.config.IAwardsServiceApi;
|
||||
|
@ -72,6 +71,8 @@ public class RetailOrderServiceImpl implements IRetailOrderService {
|
|||
@Autowired
|
||||
private ISaOrderWaresService iSaOrderWaresService;
|
||||
@Autowired
|
||||
private IBdWaresService iBdWaresService;
|
||||
@Autowired
|
||||
private IBdWaresExtendService iBdWaresExtendService;
|
||||
@Autowired
|
||||
private IBdWaresDetailService iBdWaresDetailService;
|
||||
|
@ -278,6 +279,15 @@ public class RetailOrderServiceImpl implements IRetailOrderService {
|
|||
|
||||
// 当前盒数
|
||||
BigDecimal boxNum = BigDecimal.ZERO;
|
||||
// 2025.08.02 雨汐团队,普通复购、重消品不累计盒数
|
||||
List<String> tmpBoxWaresList = new ArrayList<>();
|
||||
if (ESpecialArea.RETAIL_REPURCHASE.getEnable() == orderParam.getSpecialArea()
|
||||
|| ESpecialArea.RETAIL_RESCISSION.getEnable() == orderParam.getSpecialArea()) {
|
||||
if (RetailConstants.VERTEX_PK_ID.equals(cuMember.getPkVertex())) {
|
||||
tmpBoxWaresList = iBdWaresService.listWaresCodeByVertex(RetailConstants.VERTEX_PK_ID);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// // 2025.03.11 添加需求,复购专区、重消专区,指定盒数商品每用户每月限购50件
|
||||
// this.checkWaresLimit(cuMember.getPkId(), orderParam.getSpecialArea(), waresDetailExtList, boxProductList);
|
||||
|
@ -303,8 +313,23 @@ public class RetailOrderServiceImpl implements IRetailOrderService {
|
|||
}
|
||||
|
||||
if (boxWaresList.contains(waresDetailExt.getWaresCode())) {
|
||||
// 商品是盒数商品,需要累计数量
|
||||
boxNum = boxNum.add(waresDetailExt.getBoxNum().multiply(new BigDecimal(orderItems.getWaresQuantity())));
|
||||
if (ESpecialArea.RETAIL_REPURCHASE.getEnable() == orderParam.getSpecialArea()
|
||||
|| ESpecialArea.RETAIL_RESCISSION.getEnable() == orderParam.getSpecialArea()) {
|
||||
if (RetailConstants.VERTEX_PK_ID.equals(cuMember.getPkVertex())) {
|
||||
// 雨汐团队,复购、重消盒数品
|
||||
if (tmpBoxWaresList.contains(waresDetailExt.getWaresCode())) {
|
||||
// 商品是盒数商品,需要累计数量
|
||||
boxNum = boxNum.add(waresDetailExt.getBoxNum().multiply(new BigDecimal(orderItems.getWaresQuantity())));
|
||||
}
|
||||
} else {
|
||||
// 商品是盒数商品,需要累计数量
|
||||
boxNum = boxNum.add(waresDetailExt.getBoxNum().multiply(new BigDecimal(orderItems.getWaresQuantity())));
|
||||
}
|
||||
} else {
|
||||
// 商品是盒数商品,需要累计数量
|
||||
boxNum = boxNum.add(waresDetailExt.getBoxNum().multiply(new BigDecimal(orderItems.getWaresQuantity())));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -149,4 +149,12 @@ public interface BdWaresMapper extends BaseMapper<BdWares> {
|
|||
@Param("pkProduct") Integer pkProduct,
|
||||
@Param("specialArea") Integer specialArea);
|
||||
|
||||
/**
|
||||
* 根据体系获取盒数商品编码
|
||||
*
|
||||
* @param pkVertex
|
||||
* @return
|
||||
*/
|
||||
List<String> listWaresCodeByVertex(@Param("pkVertex") Long pkVertex);
|
||||
|
||||
}
|
||||
|
|
|
@ -221,4 +221,12 @@ public interface IBdWaresService extends IService<BdWares> {
|
|||
*/
|
||||
List<BdWaresDetail> listBoxProductAndWares(List<String> boxWaresList, Integer pkProduct, Integer specialArea);
|
||||
|
||||
/**
|
||||
* 根据体系获取盒数商品编码
|
||||
*
|
||||
* @param pkVertex
|
||||
* @return
|
||||
*/
|
||||
List<String> listWaresCodeByVertex(Long pkVertex);
|
||||
|
||||
}
|
||||
|
|
|
@ -1171,4 +1171,8 @@ public class BdWaresServiceImpl extends ServiceImpl<BdWaresMapper, BdWares> impl
|
|||
return baseMapper.listBoxProduct(boxWaresList, pkProduct, specialArea);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listWaresCodeByVertex(Long pkVertex) {
|
||||
return baseMapper.listWaresCodeByVertex(pkVertex);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -473,4 +473,17 @@
|
|||
order by bw.wares_code
|
||||
</select>
|
||||
|
||||
<!-- 根据体系获取盒数商品编码 -->
|
||||
<select id="listWaresCodeByVertex" resultType="string">
|
||||
select bw.wares_code
|
||||
from bd_wares_authority bwa
|
||||
inner join bd_wares bw
|
||||
on bw.pk_id = bwa.pk_wares
|
||||
and bw.del_flag = 0
|
||||
and bw.special_area in (43, 44)
|
||||
where bwa.del_flag = 0
|
||||
and bwa.pk_member in
|
||||
(select pk_member from bd_vertex bv where bv.pk_id = #{pkVertex})
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue