feat(quotation): 新增用户报价配置功能
- 在IQuotationModelRatioDirectService中添加getEffectiveByUser方法 - 为ProductModelController的add方法添加批次号生成 - 优化ProductModelParamsItem查询条件的格式 - 重构QuotationModelRatioDirectServiceImpl实现getEffectiveByUser方法 - 为RatioAgentConfigController中的项目添加IsPrimary字段设置 - 新增TargetUserVO和TargetUserItemVO数据传输对象 - 实现getTargetUsers接口返回报价对象列表 - 优化RatioConfigController中的搜索逻辑和数据绑定 - 更新RatioDirectConfigController使用新的查询方法 - 简化adminUserService的批量查询方式
This commit is contained in:
parent
d17bb88a4b
commit
c75c4456e2
|
|
@ -84,6 +84,7 @@ public class ProductModelController extends ControllerBase {
|
||||||
*/
|
*/
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
public ApiResult<Integer> add(@Valid @RequestBody ProductModelAddRequest request) {
|
public ApiResult<Integer> add(@Valid @RequestBody ProductModelAddRequest request) {
|
||||||
|
request.setBatchNumber(IdUtil.getSnowflakeNextId());
|
||||||
return ApiResult.success(productModelService.add(request));
|
return ApiResult.success(productModelService.add(request));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -247,7 +247,8 @@ public class RatioAgentConfigController extends ControllerBase {
|
||||||
if (Objects.isNull(item)) {
|
if (Objects.isNull(item)) {
|
||||||
item = new QuotationModelRatioAgentItem()
|
item = new QuotationModelRatioAgentItem()
|
||||||
.setModelId(modelId)
|
.setModelId(modelId)
|
||||||
.setUserId(userId);
|
.setUserId(userId)
|
||||||
|
.setIsPrimary(true);
|
||||||
items.add(item);
|
items.add(item);
|
||||||
}
|
}
|
||||||
if ("standardRatio".equals(type)) {
|
if ("standardRatio".equals(type)) {
|
||||||
|
|
|
||||||
|
|
@ -16,12 +16,11 @@ import com.nflg.mobilebroken.common.util.NumberUtil;
|
||||||
import com.nflg.mobilebroken.common.util.VUtils;
|
import com.nflg.mobilebroken.common.util.VUtils;
|
||||||
import com.nflg.mobilebroken.quotation.controller.ControllerBase;
|
import com.nflg.mobilebroken.quotation.controller.ControllerBase;
|
||||||
import com.nflg.mobilebroken.quotation.pojo.vo.RatioConfigSearchVO;
|
import com.nflg.mobilebroken.quotation.pojo.vo.RatioConfigSearchVO;
|
||||||
|
import com.nflg.mobilebroken.quotation.pojo.vo.TargetUserItemVO;
|
||||||
|
import com.nflg.mobilebroken.quotation.pojo.vo.TargetUserVO;
|
||||||
import com.nflg.mobilebroken.repository.entity.*;
|
import com.nflg.mobilebroken.repository.entity.*;
|
||||||
import com.nflg.mobilebroken.repository.service.*;
|
import com.nflg.mobilebroken.repository.service.*;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
@ -63,6 +62,44 @@ public class RatioConfigController extends ControllerBase {
|
||||||
@Resource
|
@Resource
|
||||||
private IAdminUserService adminUserService;
|
private IAdminUserService adminUserService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取报价对象
|
||||||
|
*/
|
||||||
|
@GetMapping("/getTargetUsers")
|
||||||
|
public ApiResult<TargetUserVO> getTargetUsers() {
|
||||||
|
boolean isMarketingDirector = AdminUserUtil.getRoles().contains(Constant.ROLE_CODE_MARKETING_DIRECTOR);
|
||||||
|
TargetUserVO vo = new TargetUserVO();
|
||||||
|
if (isMarketingDirector) {
|
||||||
|
List<QuotationModelRatioAgentItemDTO> agentItems = ratioAgentItemService.getEffectives();
|
||||||
|
vo.setAppUsers(
|
||||||
|
appUserService.lambdaQuery()
|
||||||
|
.in(AppUser::getId, agentItems.stream().map(QuotationModelRatioAgentItemDTO::getUserId).collect(Collectors.toList()))
|
||||||
|
.list()
|
||||||
|
.stream()
|
||||||
|
.map(u -> new TargetUserItemVO()
|
||||||
|
.setUserType(1)
|
||||||
|
.setUserId(u.getId())
|
||||||
|
.setUserName(u.getName())
|
||||||
|
)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
List<QuotationModelRatioDirectItemDTO> directItems = ratioDirectItemService.getEffectives();
|
||||||
|
vo.setAdminUsers(
|
||||||
|
adminUserService.lambdaQuery()
|
||||||
|
.in(AdminUser::getId, directItems.stream().map(QuotationModelRatioDirectItemDTO::getUserId).collect(Collectors.toList()))
|
||||||
|
.list()
|
||||||
|
.stream()
|
||||||
|
.map(u -> new TargetUserItemVO()
|
||||||
|
.setUserType(0)
|
||||||
|
.setUserId(u.getId())
|
||||||
|
.setUserName(u.getUserName())
|
||||||
|
)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return ApiResult.success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索
|
* 搜索
|
||||||
*/
|
*/
|
||||||
|
|
@ -258,8 +295,15 @@ public class RatioConfigController extends ControllerBase {
|
||||||
.orElse("")
|
.orElse("")
|
||||||
);
|
);
|
||||||
vos.add(vo);
|
vos.add(vo);
|
||||||
|
RatioConfigSearchVO vop;
|
||||||
|
if (isMarketingDirector) {
|
||||||
RatioConfigSearchVO voc = new RatioConfigSearchVO().setName("直销");
|
RatioConfigSearchVO voc = new RatioConfigSearchVO().setName("直销");
|
||||||
vo.getChildren().add(voc);
|
vo.getChildren().add(voc);
|
||||||
|
vop = voc;
|
||||||
|
} else {
|
||||||
|
vop = vo;
|
||||||
|
}
|
||||||
|
//TODO 添加方案
|
||||||
QuotationModelRatioDirectItemDTO dto = entry.getValue().stream()
|
QuotationModelRatioDirectItemDTO dto = entry.getValue().stream()
|
||||||
.filter(item -> item.getUserId().equals(request.getUserId()))
|
.filter(item -> item.getUserId().equals(request.getUserId()))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
|
|
@ -289,13 +333,14 @@ public class RatioConfigController extends ControllerBase {
|
||||||
.setStandardPrice(modelPrice.getAmount())
|
.setStandardPrice(modelPrice.getAmount())
|
||||||
.setStandardRatio(NumberUtil.format(pdto.getStandardRatio()))
|
.setStandardRatio(NumberUtil.format(pdto.getStandardRatio()))
|
||||||
.setOptionalRatio(NumberUtil.format(pdto.getOptionalRatio()));
|
.setOptionalRatio(NumberUtil.format(pdto.getOptionalRatio()));
|
||||||
voc.getChildren().add(vocp);
|
vop.getChildren().add(vocp);
|
||||||
RatioConfigSearchVO vocc = new RatioConfigSearchVO()
|
RatioConfigSearchVO vocc = new RatioConfigSearchVO()
|
||||||
.setName(cuser.getUserName())
|
.setName(cuser.getUserName())
|
||||||
.setStandardPrice(vocp.getSalePrice())
|
.setStandardPrice(vocp.getSalePrice())
|
||||||
.setStandardRatio(NumberUtil.format(dto.getStandardRatio()))
|
.setStandardRatio(NumberUtil.format(dto.getStandardRatio()))
|
||||||
.setOptionalRatio(NumberUtil.format(dto.getOptionalRatio()));
|
.setOptionalRatio(NumberUtil.format(dto.getOptionalRatio()));
|
||||||
vocp.getChildren().add(vocc);
|
vocp.getChildren().add(vocc);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
ModelPriceVO modelPrice = prices.stream()
|
ModelPriceVO modelPrice = prices.stream()
|
||||||
.filter(it -> it.getModelId().equals(dto.getModelId())
|
.filter(it -> it.getModelId().equals(dto.getModelId())
|
||||||
|
|
@ -307,7 +352,112 @@ public class RatioConfigController extends ControllerBase {
|
||||||
.setStandardPrice(modelPrice.getAmount())
|
.setStandardPrice(modelPrice.getAmount())
|
||||||
.setStandardRatio(NumberUtil.format(dto.getStandardRatio()))
|
.setStandardRatio(NumberUtil.format(dto.getStandardRatio()))
|
||||||
.setOptionalRatio(NumberUtil.format(dto.getOptionalRatio()));
|
.setOptionalRatio(NumberUtil.format(dto.getOptionalRatio()));
|
||||||
voc.getChildren().add(vocc);
|
vop.getChildren().add(vocc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
} else if (request.getUserType() == 1) {
|
||||||
|
List<QuotationModelRatioAgentItemDTO> agentItems = ratioAgentItemService.getEffectives();
|
||||||
|
List<QuotationModelRatioAgentItemDTO> afilterItems = agentItems.stream()
|
||||||
|
.filter(item -> item.getUserId().equals(request.getUserId()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
if (CollectionUtil.isNotEmpty(filterItems)) {
|
||||||
|
List<ModelPriceVO> prices = priceService.getAllModelPrice();
|
||||||
|
List<ProductModel> models = productModelService.getEffectives();
|
||||||
|
Map<Long, List<QuotationModelRatioAgentItemDTO>> fgroup = afilterItems.stream()
|
||||||
|
.collect(Collectors.groupingBy(QuotationModelRatioAgentItemDTO::getModelId));
|
||||||
|
pageData.setTotal(fgroup.keySet().size());
|
||||||
|
List<AppUser> appUsers = appUserService.lambdaQuery()
|
||||||
|
.in(AppUser::getId, agentItems.stream().map(QuotationModelRatioAgentItemDTO::getUserId).collect(Collectors.toList()))
|
||||||
|
.list();
|
||||||
|
List<TBaseCustomer> customers = customerService.lambdaQuery()
|
||||||
|
.select(TBaseCustomer::getId, TBaseCustomer::getCategoryId)
|
||||||
|
.eq(TBaseCustomer::getDelIs, 0)
|
||||||
|
.eq(TBaseCustomer::getEnableState, 1)
|
||||||
|
.list();
|
||||||
|
int index = 0, startIndex = (request.getPage() - 1) * request.getPageSize(), endIndex = request.getPage() * request.getPageSize();
|
||||||
|
for (Map.Entry<Long, List<QuotationModelRatioAgentItemDTO>> entry : fgroup.entrySet()) {
|
||||||
|
if (index >= startIndex && index < endIndex) {
|
||||||
|
RatioConfigSearchVO vo = new RatioConfigSearchVO()
|
||||||
|
.setModelNo(models.stream()
|
||||||
|
.filter(m -> m.getBatchNumber().equals(entry.getKey()))
|
||||||
|
.findFirst()
|
||||||
|
.map(ProductModel::getNo)
|
||||||
|
.orElse("")
|
||||||
|
);
|
||||||
|
vos.add(vo);
|
||||||
|
RatioConfigSearchVO vop;
|
||||||
|
if (isMarketingDirector) {
|
||||||
|
RatioConfigSearchVO voc = new RatioConfigSearchVO().setName("代理商");
|
||||||
|
vo.getChildren().add(voc);
|
||||||
|
vop = voc;
|
||||||
|
} else {
|
||||||
|
vop = vo;
|
||||||
|
}
|
||||||
|
//TODO 添加方案
|
||||||
|
QuotationModelRatioAgentItemDTO dto = entry.getValue().stream()
|
||||||
|
.filter(item -> item.getUserId().equals(request.getUserId()))
|
||||||
|
.findFirst()
|
||||||
|
.get();
|
||||||
|
AppUser cuser = appUsers.stream()
|
||||||
|
.filter(u -> u.getId().equals(dto.getUserId()))
|
||||||
|
.findFirst()
|
||||||
|
.get();
|
||||||
|
if (!cuser.getIsPrimary()) {
|
||||||
|
QuotationModelRatioAgentItemDTO pdto = agentItems.stream()
|
||||||
|
.filter(item -> item.getUserId().equals(dto.getParentId())
|
||||||
|
&& Objects.equals(item.getModelId(), dto.getModelId()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (Objects.nonNull(pdto)) {
|
||||||
|
AppUser puser = appUsers.stream()
|
||||||
|
.filter(u -> u.getId().equals(pdto.getUserId()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (Objects.nonNull(puser)) {
|
||||||
|
TBaseCustomer customer = customers.stream()
|
||||||
|
.filter(cit -> StrUtil.split(puser.getCompanyId(), ',').contains(cit.getId().toString()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (Objects.nonNull(customer)) {
|
||||||
|
ModelPriceVO modelPrice = prices.stream()
|
||||||
|
.filter(it -> it.getModelId().equals(pdto.getModelId())
|
||||||
|
&& it.getAreaId().equals(customer.getCategoryId()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
RatioConfigSearchVO vocp = new RatioConfigSearchVO()
|
||||||
|
.setName(puser.getName())
|
||||||
|
.setStandardPrice(modelPrice.getAmount())
|
||||||
|
.setStandardRatio(NumberUtil.format(pdto.getStandardRatio()))
|
||||||
|
.setOptionalRatio(NumberUtil.format(pdto.getOptionalRatio()));
|
||||||
|
vop.getChildren().add(vocp);
|
||||||
|
RatioConfigSearchVO vocc = new RatioConfigSearchVO()
|
||||||
|
.setName(cuser.getName())
|
||||||
|
.setStandardPrice(vocp.getSalePrice())
|
||||||
|
.setStandardRatio(NumberUtil.format(dto.getStandardRatio()))
|
||||||
|
.setOptionalRatio(NumberUtil.format(dto.getOptionalRatio()));
|
||||||
|
vocp.getChildren().add(vocc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TBaseCustomer customer = customers.stream()
|
||||||
|
.filter(cit -> StrUtil.split(cuser.getCompanyId(), ',').contains(cit.getId().toString()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
if (Objects.nonNull(customer)) {
|
||||||
|
ModelPriceVO modelPrice = prices.stream()
|
||||||
|
.filter(it -> it.getModelId().equals(dto.getModelId())
|
||||||
|
&& it.getAreaId().equals(customer.getCategoryId()))
|
||||||
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
|
RatioConfigSearchVO vocc = new RatioConfigSearchVO()
|
||||||
|
.setName(cuser.getName())
|
||||||
|
.setStandardPrice(modelPrice.getAmount())
|
||||||
|
.setStandardRatio(NumberUtil.format(dto.getStandardRatio()))
|
||||||
|
.setOptionalRatio(NumberUtil.format(dto.getOptionalRatio()));
|
||||||
|
vop.getChildren().add(vocc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -315,6 +465,7 @@ public class RatioConfigController extends ControllerBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ApiResult.success(pageData);
|
return ApiResult.success(pageData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -344,7 +495,8 @@ public class RatioConfigController extends ControllerBase {
|
||||||
return BigDecimal.ZERO;
|
return BigDecimal.ZERO;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindAgentChild(List<QuotationModelRatioAgentItemDTO> children, RatioConfigSearchVO vo, List<AppUser> users) {
|
private void bindAgentChild(List<QuotationModelRatioAgentItemDTO> children, RatioConfigSearchVO
|
||||||
|
vo, List<AppUser> users) {
|
||||||
children.forEach(child -> {
|
children.forEach(child -> {
|
||||||
AppUser user = users.stream()
|
AppUser user = users.stream()
|
||||||
.filter(u -> u.getId().equals(child.getUserId()))
|
.filter(u -> u.getId().equals(child.getUserId()))
|
||||||
|
|
@ -363,7 +515,8 @@ public class RatioConfigController extends ControllerBase {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void bindDirectChild(List<QuotationModelRatioDirectItemDTO> children, RatioConfigSearchVO vo, List<AdminUser> users) {
|
private void bindDirectChild(List<QuotationModelRatioDirectItemDTO> children, RatioConfigSearchVO
|
||||||
|
vo, List<AdminUser> users) {
|
||||||
children.forEach(child -> {
|
children.forEach(child -> {
|
||||||
AdminUser user = users.stream()
|
AdminUser user = users.stream()
|
||||||
.filter(u -> u.getId().equals(child.getUserId()))
|
.filter(u -> u.getId().equals(child.getUserId()))
|
||||||
|
|
|
||||||
|
|
@ -153,9 +153,7 @@ public class RatioDirectConfigController extends ControllerBase {
|
||||||
public ApiResult<RatioAgentSearchVO> search(@Valid @RequestBody ModelRatioDirectUserSearchRequest request) {
|
public ApiResult<RatioAgentSearchVO> search(@Valid @RequestBody ModelRatioDirectUserSearchRequest request) {
|
||||||
Long departmentId = AdminUserUtil.getDepartmentId();
|
Long departmentId = AdminUserUtil.getDepartmentId();
|
||||||
VUtils.trueThrowBusinessError(Objects.isNull(departmentId)).throwMessage("未设置部门,请联系管理员");
|
VUtils.trueThrowBusinessError(Objects.isNull(departmentId)).throwMessage("未设置部门,请联系管理员");
|
||||||
QuotationModelRatioDirect ratioAgent = ratioDirectService.lambdaQuery()
|
QuotationModelRatioDirect ratioAgent = ratioDirectService.getEffectiveByUser(AdminUserUtil.getUserId());
|
||||||
.eq(QuotationModelRatioDirect::getStatus, 1)
|
|
||||||
.one();
|
|
||||||
RatioAgentSearchVO vo = new RatioAgentSearchVO();
|
RatioAgentSearchVO vo = new RatioAgentSearchVO();
|
||||||
if (Objects.nonNull(ratioAgent)) {
|
if (Objects.nonNull(ratioAgent)) {
|
||||||
vo.setInfo(Convert.convert(QuotationModelRatioVO.class, ratioAgent));
|
vo.setInfo(Convert.convert(QuotationModelRatioVO.class, ratioAgent));
|
||||||
|
|
@ -170,10 +168,9 @@ public class RatioDirectConfigController extends ControllerBase {
|
||||||
List<TBaseDepartment> departments = departmentService.getChildByParentId(departmentId);
|
List<TBaseDepartment> departments = departmentService.getChildByParentId(departmentId);
|
||||||
users = adminUserService.getByDepartmentIds(departments.stream().map(TBaseDepartment::getId).collect(Collectors.toList()));
|
users = adminUserService.getByDepartmentIds(departments.stream().map(TBaseDepartment::getId).collect(Collectors.toList()));
|
||||||
} else {
|
} else {
|
||||||
users = adminUserService.lambdaQuery()
|
users = adminUserService.listByIds(CollectionUtil.union(request.getUserIds()
|
||||||
.in(AdminUser::getId, CollectionUtil.union(request.getUserIds()
|
, items.stream().map(QuotationModelRatioDirectItem::getUserId).collect(Collectors.toSet()))
|
||||||
, items.stream().map(QuotationModelRatioDirectItem::getUserId).collect(Collectors.toSet())))
|
);
|
||||||
.list();
|
|
||||||
}
|
}
|
||||||
boolean isMarketingDirector = AdminUserUtil.getRoles().contains(Constant.ROLE_CODE_MARKETING_DIRECTOR);
|
boolean isMarketingDirector = AdminUserUtil.getRoles().contains(Constant.ROLE_CODE_MARKETING_DIRECTOR);
|
||||||
List<DictionaryItem> categories = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_DIRECT_SALES_CATEGORY);
|
List<DictionaryItem> categories = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_DIRECT_SALES_CATEGORY);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.nflg.mobilebroken.quotation.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class TargetUserItemVO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户类型:0-系统用户;1-代理商
|
||||||
|
*/
|
||||||
|
private Integer userType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户名称
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.nflg.mobilebroken.quotation.pojo.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TargetUserVO {
|
||||||
|
|
||||||
|
private List<TargetUserItemVO> appUsers;
|
||||||
|
|
||||||
|
private List<TargetUserItemVO> adminUsers;
|
||||||
|
}
|
||||||
|
|
@ -17,4 +17,6 @@ import java.util.List;
|
||||||
public interface IQuotationModelRatioDirectService extends IService<QuotationModelRatioDirect> {
|
public interface IQuotationModelRatioDirectService extends IService<QuotationModelRatioDirect> {
|
||||||
|
|
||||||
List<RatioDirectEffectiveDTO> getEffectives();
|
List<RatioDirectEffectiveDTO> getEffectives();
|
||||||
|
|
||||||
|
QuotationModelRatioDirect getEffectiveByUser(Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.nflg.mobilebroken.repository.service.impl;
|
package com.nflg.mobilebroken.repository.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
|
|
||||||
|
|
@ -24,4 +24,12 @@ public class QuotationModelRatioDirectServiceImpl extends ServiceImpl<QuotationM
|
||||||
public List<RatioDirectEffectiveDTO> getEffectives() {
|
public List<RatioDirectEffectiveDTO> getEffectives() {
|
||||||
return baseMapper.getEffectives();
|
return baseMapper.getEffectives();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public QuotationModelRatioDirect getEffectiveByUser(Integer userId) {
|
||||||
|
return lambdaQuery()
|
||||||
|
.eq(QuotationModelRatioDirect::getStatus, 1)
|
||||||
|
.eq(QuotationModelRatioDirect::getCreateById, userId)
|
||||||
|
.one();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue