This commit is contained in:
moxiangrong
2024-03-05 14:38:24 +08:00
parent 09d4fd81c5
commit 912be34a6e
17 changed files with 70 additions and 20 deletions

View File

@ -52,4 +52,7 @@ public interface DictDataMapper extends BaseMapperX<DictDataDO> {
@Update("update system_dict_data set value = #{value} where label = #{label}")
void updateDictByLabel(@Param("label") String label, @Param("value") String value);
@Update("update yshop_store_product set distribution_purchase = #{distributionPurchase} where distribution_rule = 0")
void updateProductDistributionPurchase(@Param("distributionPurchase") String distributionPurchase);
}

View File

@ -21,6 +21,7 @@ import java.util.*;
import static co.yixiang.yshop.framework.common.exception.util.ServiceExceptionUtil.exception;
import static co.yixiang.yshop.module.system.enums.DictTypeConstants.*;
import static co.yixiang.yshop.module.system.enums.DistributorDictEnum.DISTRIBUTOR_PURCHASE;
import static co.yixiang.yshop.module.system.enums.ErrorCodeConstants.*;
/**
@ -226,6 +227,10 @@ public class DictDataServiceImpl implements DictDataService {
@Override
public void updateDistributorConfig(List<DictDataUpdateReqVO> reqVO) {
for (DictDataUpdateReqVO req : reqVO) {
// 自动返佣
if(DISTRIBUTOR_PURCHASE.getDictType().equals(req.getDictType())){
dictDataMapper.updateProductDistributionPurchase(req.getValue());
}
this.updateDictData(req);
}
}