refactor(service): 优化用户方案获取接口,增加categoryId参数支持
- 在IQuotationUserPlanDefaultService和IQuotationUserPlanModelItemService接口中新增categoryId参数 - 修改实现类和Mapper以支持根据categoryId查询用户方案 - 更新ShoppingController中获取用户方案逻辑,传入categoryId以精准匹配方案 - 在ProductSeriesController中调整字典项查询,支持多语言环境 - 调整ShoppingSearchVO,注释部分与业务无关字段,简化数据结构 - 更新.gitignore,添加CLAUDE.md文件忽略配置
This commit is contained in:
parent
c1dbc48cfe
commit
fd8b061bf0
|
|
@ -38,3 +38,4 @@ logs
|
|||
.codegraph
|
||||
.claude
|
||||
.claude.json
|
||||
CLAUDE.md
|
||||
|
|
@ -5,6 +5,7 @@ import com.nflg.mobilebroken.common.pojo.ApiResult;
|
|||
import com.nflg.mobilebroken.common.pojo.PageData;
|
||||
import com.nflg.mobilebroken.common.pojo.request.*;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.*;
|
||||
import com.nflg.mobilebroken.common.util.MultilingualUtil;
|
||||
import com.nflg.mobilebroken.repository.entity.DictionaryItem;
|
||||
import com.nflg.mobilebroken.repository.service.IDictionaryItemService;
|
||||
import com.nflg.mobilebroken.repository.service.IProductMobilebrokenIntroService;
|
||||
|
|
@ -39,7 +40,7 @@ public class ProductSeriesController extends ControllerBase{
|
|||
*/
|
||||
@GetMapping("/getModuleList")
|
||||
public ApiResult<List<DictionaryItem>> getModuleList(){
|
||||
return ApiResult.success(dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_PRODUCT_MODULE));
|
||||
return ApiResult.success(dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_PRODUCT_MODULE, MultilingualUtil.getLanguage()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -71,19 +71,9 @@ public class ShoppingSearchVO {
|
|||
private Integer targetId;
|
||||
|
||||
/**
|
||||
* 油漆要求
|
||||
* 其他要求总费用
|
||||
*/
|
||||
private String paintRequirements;
|
||||
|
||||
/**
|
||||
* 其他要求
|
||||
*/
|
||||
private String otherRequirements;
|
||||
|
||||
/**
|
||||
* 其他要求费用
|
||||
*/
|
||||
private BigDecimal otherFee;
|
||||
private BigDecimal otherRequirementsFee;
|
||||
|
||||
/**
|
||||
* 标配价格
|
||||
|
|
@ -115,45 +105,45 @@ public class ShoppingSearchVO {
|
|||
*/
|
||||
private BigDecimal serviceFee;
|
||||
|
||||
/**
|
||||
* 交货方式,字典id
|
||||
*/
|
||||
private Long deliveryMethod;
|
||||
|
||||
/**
|
||||
* 交货时间
|
||||
*/
|
||||
private String deliveryDate;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
private String deliveryAddress;
|
||||
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
private BigDecimal deliveryFee;
|
||||
|
||||
/**
|
||||
* 付款方式
|
||||
*/
|
||||
private String paymentMethod;
|
||||
|
||||
/**
|
||||
* 付款方式产生的费用
|
||||
*/
|
||||
private BigDecimal paymentFee;
|
||||
|
||||
/**
|
||||
* 币种,字典id
|
||||
*/
|
||||
private Long currency;
|
||||
|
||||
/**
|
||||
* 汇率
|
||||
*/
|
||||
private BigDecimal exchangeRate;
|
||||
// /**
|
||||
// * 交货方式,字典id
|
||||
// */
|
||||
// private Long deliveryMethod;
|
||||
//
|
||||
// /**
|
||||
// * 交货时间
|
||||
// */
|
||||
// private String deliveryDate;
|
||||
//
|
||||
// /**
|
||||
// * 交货地点
|
||||
// */
|
||||
// private String deliveryAddress;
|
||||
//
|
||||
// /**
|
||||
// * 运费
|
||||
// */
|
||||
// private BigDecimal deliveryFee;
|
||||
//
|
||||
// /**
|
||||
// * 付款方式
|
||||
// */
|
||||
// private String paymentMethod;
|
||||
//
|
||||
// /**
|
||||
// * 付款方式产生的费用
|
||||
// */
|
||||
// private BigDecimal paymentFee;
|
||||
//
|
||||
// /**
|
||||
// * 币种,字典id
|
||||
// */
|
||||
// private Long currency;
|
||||
//
|
||||
// /**
|
||||
// * 汇率
|
||||
// */
|
||||
// private BigDecimal exchangeRate;
|
||||
|
||||
/**
|
||||
* 创建人类型,0:内部人员;1:代理商
|
||||
|
|
|
|||
|
|
@ -224,14 +224,16 @@ public class ShoppingController extends ControllerBase {
|
|||
}
|
||||
if (!request.getShowLowestPrice()) {
|
||||
//方案
|
||||
QuotationUserPlanModelItem planModelItem = userPlanModelItemService.getEffectiveForUser(request.getModelId(), AppUserUtil.isAgent() ? 1 : 0, AppUserUtil.getUserId());
|
||||
QuotationUserPlanModelItem planModelItem = userPlanModelItemService.getEffectiveForUser(request.getModelId()
|
||||
, AppUserUtil.isAgent() ? 1 : 0, AppUserUtil.getUserId(),categoryId);
|
||||
if (Objects.nonNull(planModelItem)) {
|
||||
log.debug("机型【{}】方案为{},系数:{}", request.getModelNo(), planModelItem.getName(), planModelItem.getRatio());
|
||||
standardRatio = NumberUtil.multiply(standardRatio, planModelItem.getRatio());
|
||||
log.debug("机型【{}】标准配件系数为{},可选配件系数为{}", request.getModelNo(), standardRatio, optionalRatio);
|
||||
vo.setPlanItemId(planModelItem.getId());
|
||||
} else {
|
||||
QuotationUserPlanDefault userPlanDefault = userPlanDefaultService.getEffectiveForUser(AppUserUtil.isAgent() ? 1 : 0, AppUserUtil.getUserId());
|
||||
QuotationUserPlanDefault userPlanDefault = userPlanDefaultService.getEffectiveForUser(AppUserUtil.isAgent() ? 1 : 0
|
||||
, AppUserUtil.getUserId(), categoryId);
|
||||
if (Objects.nonNull(userPlanDefault)) {
|
||||
vo.setDefaultRatio(userPlanDefault.getRatio());
|
||||
log.debug("用户方案默认系数为{}", userPlanDefault.getRatio());
|
||||
|
|
|
|||
|
|
@ -22,5 +22,5 @@ public interface QuotationUserPlanModelItemMapper extends BaseMapper<QuotationUs
|
|||
|
||||
List<PlanSearchItemVO> search(ModelConfigSearchRequest request,Integer userType, Integer userId);
|
||||
|
||||
QuotationUserPlanModelItem getEffectiveForUser(Long modelId,Integer userType, Integer userId);
|
||||
QuotationUserPlanModelItem getEffectiveForUser(Long modelId,Integer userType, Integer userId,Long categoryId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,5 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface IQuotationUserPlanDefaultService extends IService<QuotationUserPlanDefault> {
|
||||
|
||||
QuotationUserPlanDefault getEffectiveForUser(int userType, Integer userId);
|
||||
QuotationUserPlanDefault getEffectiveForUser(int userType, Integer userId,Long categoryId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,5 +23,5 @@ public interface IQuotationUserPlanModelItemService extends IService<QuotationUs
|
|||
|
||||
List<PlanSearchItemVO> search(ModelConfigSearchRequest request,Integer userType, Integer userId);
|
||||
|
||||
QuotationUserPlanModelItem getEffectiveForUser(Long modelId,Integer userType, Integer userId);
|
||||
QuotationUserPlanModelItem getEffectiveForUser(Long modelId,Integer userType, Integer userId,Long categoryId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,11 @@ import org.springframework.stereotype.Service;
|
|||
public class QuotationUserPlanDefaultServiceImpl extends ServiceImpl<QuotationUserPlanDefaultMapper, QuotationUserPlanDefault> implements IQuotationUserPlanDefaultService {
|
||||
|
||||
@Override
|
||||
public QuotationUserPlanDefault getEffectiveForUser(int userType, Integer userId) {
|
||||
public QuotationUserPlanDefault getEffectiveForUser(int userType, Integer userId,Long categoryId) {
|
||||
return lambdaQuery()
|
||||
.eq(QuotationUserPlanDefault::getCreateByType, userType)
|
||||
.eq(QuotationUserPlanDefault::getCreateById, userId)
|
||||
.eq(QuotationUserPlanDefault::getAreaId, categoryId)
|
||||
.one();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class QuotationUserPlanModelItemServiceImpl extends ServiceImpl<Quotation
|
|||
}
|
||||
|
||||
@Override
|
||||
public QuotationUserPlanModelItem getEffectiveForUser(Long modelId,Integer userType, Integer userId) {
|
||||
return baseMapper.getEffectiveForUser(modelId,userType, userId);
|
||||
public QuotationUserPlanModelItem getEffectiveForUser(Long modelId,Integer userType, Integer userId,Long categoryId) {
|
||||
return baseMapper.getEffectiveForUser(modelId,userType, userId,categoryId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,6 @@
|
|||
FROM quotation_user_plan_model qupm
|
||||
INNER JOIN quotation_user_plan_model_item qupmi ON qupm.id=qupmi.plan_id
|
||||
WHERE qupm.`status`=1 AND qupm.create_by_type=#{userType} AND qupm.create_by_id=#{userId} AND qupmi.is_default=1
|
||||
AND qupmi.model_id=#{modelId}
|
||||
AND qupmi.model_id=#{modelId} and qupmi.area_id=#{categoryId}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue