## 雨汐团队只有自己的复购、重消商品才累盒数;

This commit is contained in:
cabbage 2025-08-02 12:04:15 +08:00
parent 834a7d7325
commit dc7d8f1e40
5 changed files with 62 additions and 4 deletions

View File

@ -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,9 +313,24 @@ public class RetailOrderServiceImpl implements IRetailOrderService {
}
if (boxWaresList.contains(waresDetailExt.getWaresCode())) {
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())));
}
}
}
// if (ESpecialArea.RETAIL_REGISTER.getValue() == orderParam.getSpecialArea()

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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>