|
@@ -3,20 +3,15 @@ package com.fjhx.service.production.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.fjhx.base.BaseIdEntity;
|
|
|
-import com.fjhx.entity.FileInfo;
|
|
|
import com.fjhx.entity.production.ProductionLine;
|
|
|
import com.fjhx.mapper.production.ProductionLineMapper;
|
|
|
import com.fjhx.params.production.ProductionLineEx;
|
|
|
import com.fjhx.params.production.ProductionLineVo;
|
|
|
import com.fjhx.service.production.ProductionLineService;
|
|
|
-import com.fjhx.utils.FileClientUtil;
|
|
|
import com.fjhx.utils.WrapperUtil;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -37,40 +32,23 @@ public class ProductionLineServiceImpl extends ServiceImpl<ProductionLineMapper,
|
|
|
.keyword("pl.name") // 生产线名称
|
|
|
.createTimeDesc("pl")
|
|
|
.getWrapper();
|
|
|
- Page<ProductionLineEx> page = baseMapper.getPage(createPage(condition), wrapper);
|
|
|
|
|
|
- List<ProductionLineEx> records = page.getRecords();
|
|
|
- if (records.size() == 0) {
|
|
|
- return page;
|
|
|
- }
|
|
|
-
|
|
|
- List<Long> productionLineIdList = records.stream().map(BaseIdEntity::getId).collect(Collectors.toList());
|
|
|
-
|
|
|
- Map<Long, List<FileInfo>> fileInfoListMap = FileClientUtil.getFileInfoListMap(productionLineIdList);
|
|
|
- for (ProductionLineEx productionLineEx : records) {
|
|
|
- productionLineEx.setFileInfoList(fileInfoListMap.get(productionLineEx.getId()));
|
|
|
- }
|
|
|
-
|
|
|
- return page;
|
|
|
+ return baseMapper.getPage(createPage(condition), wrapper);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void add(ProductionLineVo productionLineVo) {
|
|
|
save(productionLineVo);
|
|
|
- FileClientUtil.bindingFile(productionLineVo.getId(), productionLineVo.getFileInfoList());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void edit(ProductionLineVo productionLineVo) {
|
|
|
updateById(productionLineVo);
|
|
|
- FileClientUtil.againBindingFile(productionLineVo.getId(), productionLineVo.getFileInfoList());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void delete(ProductionLineVo productionLineVo) {
|
|
|
removeById(productionLineVo.getId());
|
|
|
- FileClientUtil.relieveBindingFile(productionLineVo.getId());
|
|
|
-
|
|
|
}
|
|
|
|
|
|
}
|