feat(quotation): 新增报价模型价格配置功能
- 在 AdminPermissionRoleApiMapMapper.xml 中增加模块名称查询和选中状态字段 - 新增 ModelPriceVO 数据传输对象用于价格信息传递 - 扩展 IQuotationModelPriceService 接口并实现 getAllModelPrice 方法 - 完善 IQuotationModelRatioAgentService 接口并添加搜索功能 - 修复 QuotationModelRatioAgent 实体类中的状态字段拼写错误 - 修正 QuotationModelRatioAgentItem 中的 modelId 字段类型为 Long - 新增 RatioAgentSearchVO 视图对象用于代理商搜索结果 - 在 NumberUtil 工具类中添加 BigDecimal 乘法运算方法 - 更新 PermissionRoleApiMapVO 增加模块名称和选中状态属性 - 实现代理商配置系数的搜索和保存功能 - 优化动态表头生成逻辑并处理空值情况 - 完善价格计算和数据映射逻辑
This commit is contained in:
parent
6e5a1375cd
commit
8c12488b2d
|
|
@ -0,0 +1,24 @@
|
|||
package com.nflg.mobilebroken.common.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
public class ModelPriceVO {
|
||||
|
||||
/**
|
||||
* 机型表batch_number
|
||||
*/
|
||||
private Long modelId;
|
||||
|
||||
/**
|
||||
* 价格区域,字典id
|
||||
*/
|
||||
private Long areaId;
|
||||
|
||||
/**
|
||||
* 价格,单位:元
|
||||
*/
|
||||
private BigDecimal amount;
|
||||
}
|
||||
|
|
@ -29,6 +29,11 @@ public class PermissionRoleApiMapVO {
|
|||
*/
|
||||
private Long apiId;
|
||||
|
||||
/**
|
||||
* 模块名称
|
||||
*/
|
||||
private String moduleName;
|
||||
|
||||
/**
|
||||
* 功能名称
|
||||
*/
|
||||
|
|
@ -40,22 +45,27 @@ public class PermissionRoleApiMapVO {
|
|||
private Integer type;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
* 是否选中
|
||||
*/
|
||||
private String createBy;
|
||||
private Boolean selected=false;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 最后更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
// /**
|
||||
// * 创建人
|
||||
// */
|
||||
// private String createBy;
|
||||
//
|
||||
// /**
|
||||
// * 创建时间
|
||||
// */
|
||||
// private LocalDateTime createTime;
|
||||
//
|
||||
// /**
|
||||
// * 最后更新人
|
||||
// */
|
||||
// private String updateBy;
|
||||
//
|
||||
// /**
|
||||
// * 最后更新时间
|
||||
// */
|
||||
// private LocalDateTime updateTime;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,11 @@ public class NumberUtil {
|
|||
}
|
||||
return df.format(number);
|
||||
}
|
||||
|
||||
public static BigDecimal multiply(BigDecimal num1, BigDecimal num2) {
|
||||
if (Objects.isNull(num1) || Objects.isNull(num2)) {
|
||||
return null;
|
||||
}
|
||||
return num1.multiply(num2);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +1,32 @@
|
|||
package com.nflg.mobilebroken.quotation.controller.admin;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.mobilebroken.common.constant.Constant;
|
||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||
import com.nflg.mobilebroken.common.pojo.PageData;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ModelConfigSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.DynamicHeaderVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelSimpleVO;
|
||||
import com.nflg.mobilebroken.common.util.*;
|
||||
import com.nflg.mobilebroken.quotation.controller.ControllerBase;
|
||||
import com.nflg.mobilebroken.repository.entity.AppUser;
|
||||
import com.nflg.mobilebroken.repository.entity.DictionaryItem;
|
||||
import com.nflg.mobilebroken.repository.entity.TBaseCustomer;
|
||||
import com.nflg.mobilebroken.repository.service.IAppUserService;
|
||||
import com.nflg.mobilebroken.repository.service.IDictionaryItemService;
|
||||
import com.nflg.mobilebroken.repository.service.ITBaseCustomerService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.nflg.mobilebroken.quotation.pojo.vo.RatioAgentSearchVO;
|
||||
import com.nflg.mobilebroken.repository.entity.*;
|
||||
import com.nflg.mobilebroken.repository.service.*;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 代理商配置系数
|
||||
|
|
@ -36,6 +44,15 @@ public class RatioAgentController extends ControllerBase {
|
|||
@Resource
|
||||
private IDictionaryItemService dictionaryItemService;
|
||||
|
||||
@Resource
|
||||
private IQuotationModelRatioAgentService ratioAgentService;
|
||||
|
||||
@Resource
|
||||
private IQuotationModelRatioAgentItemService ratioAgentItemService;
|
||||
|
||||
@Resource
|
||||
private IQuotationModelPriceService priceService;
|
||||
|
||||
/**
|
||||
* 获取动态表头
|
||||
*/
|
||||
|
|
@ -75,26 +92,185 @@ public class RatioAgentController extends ControllerBase {
|
|||
if (Objects.nonNull(category)) {
|
||||
categoryName = category.getName();
|
||||
} else {
|
||||
categoryName = "未知";
|
||||
categoryName = null;
|
||||
}
|
||||
} else {
|
||||
categoryName = "未知";
|
||||
categoryName = null;
|
||||
}
|
||||
if (StrUtil.isNotBlank(categoryName)) {
|
||||
DynamicHeaderVO avo = new DynamicHeaderVO()
|
||||
.setProp(user.getId().toString())
|
||||
.setLabel(user.getName())
|
||||
.setChildren(new ArrayList<>() {
|
||||
{
|
||||
add(new DynamicHeaderVO().setProp(user.getId().toString() + "-standardPrice").setLabel("标配价(" + categoryName + ")"));
|
||||
add(new DynamicHeaderVO().setProp(user.getId().toString() + "-standardRatio").setLabel("标配系数"));
|
||||
add(new DynamicHeaderVO().setProp(user.getId().toString() + "-optionalRatio").setLabel("选配系数"));
|
||||
add(new DynamicHeaderVO().setProp(user.getId().toString() + "-salePrice").setLabel("市场价(" + categoryName + ")"));
|
||||
}
|
||||
});
|
||||
vos.add(avo);
|
||||
}
|
||||
DynamicHeaderVO avo = new DynamicHeaderVO()
|
||||
.setProp(user.getId().toString())
|
||||
.setLabel(user.getName())
|
||||
.setChildren(new ArrayList<>() {
|
||||
{
|
||||
add(new DynamicHeaderVO().setProp("standardPrice").setLabel("标配价(" + categoryName + ")"));
|
||||
add(new DynamicHeaderVO().setProp("standardRatio").setLabel("标配系数"));
|
||||
add(new DynamicHeaderVO().setProp("optionalRatio").setLabel("选配系数"));
|
||||
add(new DynamicHeaderVO().setProp("salePrice").setLabel("市场价(" + categoryName + ")"));
|
||||
}
|
||||
});
|
||||
vos.add(avo);
|
||||
});
|
||||
return ApiResult.success(vos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*/
|
||||
@PostMapping("/search")
|
||||
public ApiResult<RatioAgentSearchVO> search(@Valid @RequestBody ModelConfigSearchRequest request) {
|
||||
RatioAgentSearchVO vo = new RatioAgentSearchVO();
|
||||
QuotationModelRatioAgent ratioAgent = ratioAgentService.lambdaQuery()
|
||||
.eq(QuotationModelRatioAgent::getStatus, 1)
|
||||
.one();
|
||||
vo.setInfo(ratioAgent);
|
||||
IPage<ProductModelSimpleVO> pdatas = ratioAgentService.search(request);
|
||||
if (CollectionUtil.isEmpty(pdatas.getRecords())) {
|
||||
vo.setPageData(PageData.empty());
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
List<TBaseCustomer> customers = customerService.lambdaQuery()
|
||||
.select(TBaseCustomer::getId, TBaseCustomer::getCategoryId)
|
||||
.eq(TBaseCustomer::getDelIs, 0)
|
||||
.eq(TBaseCustomer::getEnableState, 1)
|
||||
.list();
|
||||
List<DictionaryItem> categories = dictionaryItemService.getListByDictionaryCode(Constant.DICTIONARY_DIRECT_SALES_CATEGORY);
|
||||
List<AppUser> users = appUserService.lambdaQuery()
|
||||
.eq(AppUser::getIsDel, false)
|
||||
.eq(AppUser::getIsPrimary, true)
|
||||
.list();
|
||||
List<QuotationModelRatioAgentItem> items = Objects.isNull(ratioAgent) ? Collections.emptyList() : ratioAgentItemService.lambdaQuery()
|
||||
.eq(QuotationModelRatioAgentItem::getRatioId, ratioAgent.getId())
|
||||
.list();
|
||||
List<ModelPriceVO> prices = priceService.getAllModelPrice();
|
||||
PageData<Map<String, Object>> mdatas = new PageData<>();
|
||||
mdatas.setPage((int) pdatas.getCurrent());
|
||||
mdatas.setPageSize((int) pdatas.getSize());
|
||||
mdatas.setTotal((int) pdatas.getTotal());
|
||||
mdatas.setItems(pdatas.getRecords()
|
||||
.stream()
|
||||
.map(data -> {
|
||||
Map<String, Object> map = new LinkedHashMap<>();
|
||||
map.put("modelId", data.getBatchNumber());
|
||||
map.put("modelNo", data.getNo());
|
||||
ModelPriceVO modelPrice = prices.stream()
|
||||
.filter(it -> it.getModelId().equals(data.getBatchNumber()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
users.forEach(user -> {
|
||||
TBaseCustomer customer = customers.stream()
|
||||
.filter(cit -> StrUtil.split(user.getCompanyId(), ',').contains(cit.getId().toString()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (Objects.nonNull(customer)) {
|
||||
DictionaryItem category = categories.stream()
|
||||
.filter(cit -> cit.getId().equals(customer.getCategoryId()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (Objects.nonNull(category)) {
|
||||
QuotationModelRatioAgentItem item = items.stream()
|
||||
.filter(it -> it.getModelId().equals(data.getBatchNumber())
|
||||
&& it.getUserId().equals(user.getId()))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
BigDecimal price = Objects.nonNull(modelPrice) ? modelPrice.getAmount() : null;
|
||||
BigDecimal standardRatio = Objects.nonNull(item) ? item.getStandardRatio() : null;
|
||||
map.put(user.getId().toString() + "-standardPrice", NumberUtil.format(price));
|
||||
map.put(user.getId().toString() + "-standardRatio", NumberUtil.format(standardRatio));
|
||||
map.put(user.getId().toString() + "-optionalRatio", NumberUtil.format(Objects.nonNull(item) ? item.getOptionalRatio() : null));
|
||||
map.put(user.getId().toString() + "-salePrice", NumberUtil.format(NumberUtil.multiply(price, standardRatio)));
|
||||
}
|
||||
}
|
||||
});
|
||||
return map;
|
||||
}).collect(Collectors.toList())
|
||||
);
|
||||
vo.setPageData(mdatas);
|
||||
return ApiResult.success(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
@Transactional
|
||||
@PostMapping("/save")
|
||||
public ApiResult<Void> save(@RequestBody @NotEmpty List<Map<String, Object>> datas) {
|
||||
VUtils.trueThrowBusinessError(CollectionUtil.isEmpty(datas)).throwMessage("请选择要保存的数据!");
|
||||
List<Long> modelIds = datas.stream().map(data -> Long.parseLong(data.get("modelId").toString())).collect(Collectors.toList());
|
||||
QuotationModelRatioAgent ratioAgent = ratioAgentService.lambdaQuery()
|
||||
.eq(QuotationModelRatioAgent::getStatus, 1)
|
||||
.one();
|
||||
List<QuotationModelRatioAgentItem> items = Objects.isNull(ratioAgent) ? new ArrayList<>() : ratioAgentItemService.lambdaQuery()
|
||||
.eq(QuotationModelRatioAgentItem::getRatioId, ratioAgent.getId())
|
||||
.in(QuotationModelRatioAgentItem::getModelId, modelIds)
|
||||
.list();
|
||||
Long id = IdUtil.getId();
|
||||
if (Objects.nonNull(ratioAgent)) {
|
||||
ratioAgent.setId(id);
|
||||
ratioAgent.setYear(String.valueOf(LocalDateTime.now().getYear()));
|
||||
String version = ratioAgent.getVersion().substring(2);
|
||||
String day = version.split("-")[0];
|
||||
int index = Integer.parseInt(version.split("-")[1]);
|
||||
String today = DateTimeUtil.format(LocalDate.now(), "yyMMdd");
|
||||
if (today.equals(day)) {
|
||||
ratioAgent.setVersion("BP" + day + "-" + StrUtil.padPre(String.valueOf(index + 1), 2, '0'));
|
||||
} else {
|
||||
ratioAgent.setVersion("BP" + today + "-01");
|
||||
}
|
||||
} else {
|
||||
ratioAgent = new QuotationModelRatioAgent()
|
||||
.setId(id)
|
||||
.setYear(String.valueOf(LocalDateTime.now().getYear()))
|
||||
.setVersion("BP" + DateTimeUtil.format(LocalDate.now(), "yyMMdd") + "-01")
|
||||
.setStatus(1)
|
||||
.setCreateByType(0)
|
||||
.setCreateById(AdminUserUtil.getUserId())
|
||||
.setCreateBy(AdminUserUtil.getUserName())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
}
|
||||
datas.forEach(data -> {
|
||||
Long modelId = Long.parseLong(data.get("modelId").toString());
|
||||
data.remove("modelId");
|
||||
data.remove("modelNo");
|
||||
data.forEach((key, value) -> {
|
||||
if (Objects.nonNull(value)) {
|
||||
Integer userId = Integer.parseInt(key.split("-")[0]);
|
||||
String type = key.split("-")[1];
|
||||
if ("standardRatio".equals(type) || "optionalRatio".equals(type)) {
|
||||
QuotationModelRatioAgentItem item = items.stream()
|
||||
.filter(it -> it.getUserId().equals(userId)
|
||||
&& it.getModelId().equals(modelId))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
if (Objects.isNull(item)) {
|
||||
item = new QuotationModelRatioAgentItem()
|
||||
.setModelId(modelId)
|
||||
.setUserId(userId);
|
||||
items.add(item);
|
||||
}
|
||||
if ("standardRatio".equals(type)) {
|
||||
item.setStandardRatio(new BigDecimal(value.toString()));
|
||||
}
|
||||
if ("optionalRatio".equals(type)) {
|
||||
item.setOptionalRatio(new BigDecimal(value.toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
ratioAgentService.lambdaUpdate()
|
||||
.set(QuotationModelRatioAgent::getStatus, 2)
|
||||
.eq(QuotationModelRatioAgent::getStatus, 1)
|
||||
.update();
|
||||
ratioAgentService.save(ratioAgent);
|
||||
if (CollectionUtil.isNotEmpty(items)) {
|
||||
items.forEach(item -> {
|
||||
item.setId(IdUtil.getId());
|
||||
item.setRatioId(id);
|
||||
});
|
||||
ratioAgentItemService.saveBatch(items);
|
||||
}
|
||||
return ApiResult.success();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nflg.mobilebroken.quotation.pojo.vo;
|
||||
|
||||
import com.nflg.mobilebroken.common.pojo.PageData;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioAgent;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class RatioAgentSearchVO {
|
||||
|
||||
private QuotationModelRatioAgent info;
|
||||
|
||||
private PageData<Map<String, Object>> pageData;
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ public class QuotationModelRatioAgent implements Serializable {
|
|||
/**
|
||||
* 状态,0:草稿;1:已发布;2:已废弃
|
||||
*/
|
||||
private Integer staus;
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 创建人类型,0:内部用户;1:代理商账号
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class QuotationModelRatioAgentItem implements Serializable {
|
|||
/**
|
||||
* 机型id
|
||||
*/
|
||||
private Integer modelId;
|
||||
private Long modelId;
|
||||
|
||||
/**
|
||||
* 代理商账号id
|
||||
|
|
|
|||
|
|
@ -4,8 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ModelConfigSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceConfigVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceVO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelPrice;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelPriceItemArea;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -18,4 +22,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
public interface QuotationModelPriceMapper extends BaseMapper<QuotationModelPrice> {
|
||||
|
||||
IPage<ModelPriceConfigVO> search(ModelConfigSearchRequest request, Page<?> page);
|
||||
|
||||
List<ModelPriceVO> getAllModelPrice();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ModelConfigSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelSimpleVO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioAgent;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
|
|
@ -13,4 +17,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface QuotationModelRatioAgentMapper extends BaseMapper<QuotationModelRatioAgent> {
|
||||
|
||||
IPage<ProductModelSimpleVO> search(ModelConfigSearchRequest request, Page<?> page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,13 @@ package com.nflg.mobilebroken.repository.service;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ModelConfigSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceConfigVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceVO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelPrice;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelPriceItemArea;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
@ -19,4 +22,6 @@ import javax.validation.Valid;
|
|||
public interface IQuotationModelPriceService extends IService<QuotationModelPrice> {
|
||||
|
||||
IPage<ModelPriceConfigVO> search(ModelConfigSearchRequest request);
|
||||
|
||||
List<ModelPriceVO> getAllModelPrice();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ModelConfigSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelSimpleVO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioAgent;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-代理商系数 服务类
|
||||
|
|
@ -13,4 +18,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface IQuotationModelRatioAgentService extends IService<QuotationModelRatioAgent> {
|
||||
|
||||
IPage<ProductModelSimpleVO> search(ModelConfigSearchRequest request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.nflg.mobilebroken.common.constant.Constant;
|
|||
import com.nflg.mobilebroken.common.pojo.request.ModelConfigSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceConfigAreaVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceConfigVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPriceVO;
|
||||
import com.nflg.mobilebroken.repository.entity.*;
|
||||
import com.nflg.mobilebroken.repository.mapper.QuotationModelPriceMapper;
|
||||
import com.nflg.mobilebroken.repository.service.*;
|
||||
|
|
@ -101,6 +102,11 @@ public class QuotationModelPriceServiceImpl extends ServiceImpl<QuotationModelPr
|
|||
return pdata;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ModelPriceVO> getAllModelPrice() {
|
||||
return baseMapper.getAllModelPrice();
|
||||
}
|
||||
|
||||
private ModelPriceConfigVO generateVO(Long modelId, QuotationModelConfigItem configItem, List<QuotationModelConfigItem> items
|
||||
, List<QuotationModelPriceItem> priceItems, List<QuotationModelPriceItemArea> areaPrices, List<DictionaryItem> areas) {
|
||||
ModelPriceConfigVO vo = new ModelPriceConfigVO()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ModelConfigSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ProductModelSimpleVO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationModelRatioAgent;
|
||||
import com.nflg.mobilebroken.repository.mapper.QuotationModelRatioAgentMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IQuotationModelRatioAgentService;
|
||||
|
|
@ -17,4 +21,8 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class QuotationModelRatioAgentServiceImpl extends ServiceImpl<QuotationModelRatioAgentMapper, QuotationModelRatioAgent> implements IQuotationModelRatioAgentService {
|
||||
|
||||
@Override
|
||||
public IPage<ProductModelSimpleVO> search(ModelConfigSearchRequest request) {
|
||||
return baseMapper.search(request,new Page<>(request.getPage(),request.getPageSize()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,15 +3,17 @@
|
|||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.AdminPermissionRoleApiMapMapper">
|
||||
|
||||
<select id="getList" resultType="com.nflg.mobilebroken.common.pojo.vo.PermissionRoleApiMapVO">
|
||||
SELECT map.*, t.table_name, api.api_name
|
||||
SELECT map.*, t.table_name,aa.module_name,api.api_name,true as 'selected'
|
||||
FROM admin_permission_role_api_map map
|
||||
INNER JOIN admin_permission_table t ON map.table_id = t.id
|
||||
INNER JOIN admin_permission_api api ON api.table_id = map.table_id
|
||||
INNER JOIN admin_permission_table t ON map.table_id = t.id
|
||||
INNER JOIN admin_permission_api api ON api.table_id = map.table_id
|
||||
INNER JOIN admin_api aa ON aa.id=api.api_id
|
||||
WHERE map.role_id = #{id}
|
||||
</select>
|
||||
<select id="getApiList" resultType="com.nflg.mobilebroken.common.pojo.vo.PermissionRoleApiMapVO">
|
||||
SELECT t.id AS 'table_id', api.id as 'api_id', null AS 'type', t.table_desc AS 'table_name', api.api_name
|
||||
SELECT t.id AS 'table_id', api.id as 'api_id', null AS 'type', t.table_desc AS 'table_name',aa.module_name, api.api_name
|
||||
FROM admin_permission_api api
|
||||
INNER JOIN admin_permission_table t ON api.table_id = t.id
|
||||
INNER JOIN admin_permission_table t ON api.table_id = t.id
|
||||
INNER JOIN admin_api aa ON aa.id=api.api_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -29,4 +29,11 @@
|
|||
</if>
|
||||
order by qmp.price_status,qmp.update_time desc,pm.id
|
||||
</select>
|
||||
|
||||
<select id="getAllModelPrice" resultType="com.nflg.mobilebroken.common.pojo.vo.ModelPriceVO">
|
||||
SELECT qmp.model_id,qmpia.area_id,qmpia.amount
|
||||
FROM quotation_model_price qmp
|
||||
INNER JOIN quotation_model_price_item_area qmpia ON qmpia.price_id=qmp.id AND qmpia.price_item_id=0
|
||||
WHERE qmp.price_status=1
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -2,4 +2,25 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.QuotationModelRatioAgentMapper">
|
||||
|
||||
<select id="search" resultType="com.nflg.mobilebroken.common.pojo.vo.ProductModelSimpleVO">
|
||||
SELECT pm.batch_number,pm.no
|
||||
FROM product_model pm
|
||||
LEFT JOIN product_type pt on pm.type_number=pt.batch_number AND pt.state=1
|
||||
LEFT JOIN product_series ps ON pm.series_number=ps.batch_number AND ps.state=1
|
||||
LEFT JOIN dictionary_item di ON di.id=pm.module_id
|
||||
WHERE pm.state=1
|
||||
<if test="request.moduleId!=null">
|
||||
AND pm.module_id=#{request.moduleId}
|
||||
</if>
|
||||
<if test="request.seriesNumber!=null">
|
||||
AND pm.series_number=#{request.seriesNumber}
|
||||
</if>
|
||||
<if test="request.typeNumber!=null">
|
||||
AND pm.type_number=#{request.typeNumber}
|
||||
</if>
|
||||
<if test="request.no!=null and request.no!=''">
|
||||
AND pm.`no` like concat('%', #{request.no}, '%')
|
||||
</if>
|
||||
order by pm.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue