调整比对
This commit is contained in:
parent
8c87b8f058
commit
73b5df914d
|
|
@ -8,6 +8,7 @@ import org.ttzero.excel.annotation.ExcelColumn;
|
|||
import org.ttzero.excel.annotation.MediaColumn;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
|
|
@ -50,8 +51,8 @@ public class CompareReportField {
|
|||
//@ExcelProperty("比对结果")
|
||||
@MediaColumn
|
||||
@ExcelColumn(value="比对结果")
|
||||
// @ColumnWidth(50)
|
||||
private File compareSymbol;
|
||||
@ColumnWidth(10)
|
||||
private InputStream compareSymbol;
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
|
|||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.nflg.product.bomnew.constant.EBomConstant;
|
||||
import com.nflg.product.bomnew.constant.MBomConstantEnum;
|
||||
import com.nflg.product.bomnew.mapper.master.BomNewMbomParentMapper;
|
||||
|
|
@ -68,14 +69,17 @@ public class BomNewMbomParentService extends ServiceImpl<BomNewMbomParentMapper,
|
|||
BomNewMbomMiddleVO parent = this.getBaseMapper().getParentById(item.getBomRowId());
|
||||
parent.setParentRowId(0l);
|
||||
parent.setBomRowId(parent.getRowId());
|
||||
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(ImmutableList.of(parent), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
|
||||
|
||||
List<BomNewMbomMiddleVO> childList = this.getBaseMapper().searchList(item.getRowId());
|
||||
|
||||
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(childList, EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
|
||||
IndexListTree.listToTree(parent, childList);
|
||||
page.getRecords().add(parent);
|
||||
}
|
||||
|
||||
|
||||
SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(page.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
|
||||
// SpringUtil.getBean(MaterialMainService.class).intiMaterialInfo(page.getRecords(), EBomConstant.EBOM_IGNORED_FIELDS_INIT_MATERIAL_DEFAULT2);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ import com.nflg.product.bomnew.util.VUtils;
|
|||
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
import org.ttzero.excel.entity.ListSheet;
|
||||
|
||||
import java.io.*;
|
||||
|
|
@ -65,6 +66,7 @@ public class CompareReportService {
|
|||
/**
|
||||
* 比较导出
|
||||
* ∑
|
||||
*
|
||||
* @param query
|
||||
*/
|
||||
public void compareBomExport(OutputStream filePath, CompareReportQuery query) throws IOException {
|
||||
|
|
@ -88,65 +90,41 @@ public class CompareReportService {
|
|||
continue;
|
||||
}
|
||||
excelList.add(compareReportField);
|
||||
|
||||
|
||||
if (ObjectUtil.equal(compareReportVO.getSymbol(), ReportConstant.SymbolEnum.EQ.getValue())
|
||||
|| ObjectUtil.equal(compareReportVO.getSymbol(), ReportConstant.SymbolEnum.NON_EQ.getValue())) {
|
||||
|
||||
compareReportField.setLevelNum(compareReportVO.getLeft().getLevelNum());
|
||||
compareReportField.setNum(compareReportVO.getLeft().getNum());
|
||||
compareReportField.setMaterialUnit(compareReportVO.getLeft().getMaterialUnit());
|
||||
|
||||
compareReportField.setLevelNum2(compareReportVO.getRight().getLevelNum());
|
||||
compareReportField.setNum2(compareReportVO.getRight().getNum());
|
||||
compareReportField.setMaterialUnit2(compareReportVO.getRight().getMaterialUnit());
|
||||
|
||||
if (ObjectUtil.equal(compareReportVO.getLeft().getTag(), ReportConstant.TagEnum.SIGMA.getValue())
|
||||
||ObjectUtil.equal(compareReportVO.getRight().getTag(),ReportConstant.TagEnum.SIGMA.getValue())
|
||||
) {
|
||||
|| ObjectUtil.equal(compareReportVO.getRight().getTag(), ReportConstant.TagEnum.SIGMA.getValue())) {
|
||||
compareReportField.setSumSymbol("Σ");
|
||||
}
|
||||
|
||||
|
||||
} else if (ObjectUtil.equal(compareReportVO.getSymbol(), ReportConstant.SymbolEnum.L_NULL.getValue())) {
|
||||
|
||||
compareReportField.setLevelNum(compareReportVO.getLeft().getLevelNum());
|
||||
compareReportField.setNum(compareReportVO.getLeft().getNum());
|
||||
compareReportField.setMaterialUnit(compareReportVO.getLeft().getMaterialUnit());
|
||||
|
||||
|
||||
if(ObjectUtil.equal(compareReportVO.getLeft().getTag(),ReportConstant.TagEnum.SIGMA.getValue())
|
||||
|
||||
) {
|
||||
if (ObjectUtil.equal(compareReportVO.getLeft().getTag(), ReportConstant.TagEnum.SIGMA.getValue())) {
|
||||
compareReportField.setSumSymbol("Σ");
|
||||
}
|
||||
compareReportField.setLevelNum2(null);
|
||||
compareReportField.setNum2(null);
|
||||
compareReportField.setMaterialUnit2(null);
|
||||
|
||||
} else if (ObjectUtil.equal(compareReportVO.getSymbol(), ReportConstant.SymbolEnum.NULL_R.getValue())) {
|
||||
|
||||
compareReportField.setLevelNum(null);
|
||||
compareReportField.setNum(null);
|
||||
compareReportField.setMaterialUnit(null);
|
||||
|
||||
compareReportField.setLevelNum2(compareReportVO.getRight().getLevelNum());
|
||||
compareReportField.setNum2(compareReportVO.getRight().getNum());
|
||||
compareReportField.setMaterialUnit2(compareReportVO.getRight().getMaterialUnit());
|
||||
if(ObjectUtil.equal(compareReportVO.getRight().getTag(),ReportConstant.TagEnum.SIGMA.getValue())
|
||||
|
||||
) {
|
||||
if (ObjectUtil.equal(compareReportVO.getRight().getTag(), ReportConstant.TagEnum.SIGMA.getValue())) {
|
||||
compareReportField.setSumSymbol("Σ");
|
||||
}
|
||||
}
|
||||
compareReportField.setCompareSymbol(getFile(compareReportVO.getSymbol()));
|
||||
|
||||
if(compareReportVO.getLeft()!=null){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// EasyExcel.write(filePath)
|
||||
|
|
@ -174,7 +152,7 @@ public class CompareReportService {
|
|||
}
|
||||
|
||||
|
||||
File getFile(Integer type) throws IOException {
|
||||
InputStream getFile(Integer type) throws IOException {
|
||||
|
||||
String filePath = "0.png";
|
||||
if (ObjectUtil.equal(type, ReportConstant.SymbolEnum.EQ.getValue())
|
||||
|
|
@ -192,26 +170,21 @@ File getFile(Integer type) throws IOException {
|
|||
} else if (ObjectUtil.equal(type, ReportConstant.SymbolEnum.NULL_R.getValue())) {
|
||||
filePath = "2.png";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ClassPathResource resource = new ClassPathResource("template/" + filePath);
|
||||
return resource.getInputStream();
|
||||
// byte[] bdata = FileCopyUtils.copyToByteArray(resource.getInputStream());
|
||||
// File input = resource.getFile();
|
||||
|
||||
File input = resource.getFile();
|
||||
|
||||
return input;
|
||||
// return input;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 左倾斜 或右倾斜
|
||||
*
|
||||
* @param leftNode
|
||||
* @param rightNode
|
||||
* @return
|
||||
|
|
@ -321,7 +294,7 @@ File getFile(Integer type) throws IOException {
|
|||
|
||||
compareReportVOList.add(compareReportVO);
|
||||
if (CollUtil.isNotEmpty(toCompareList)) {
|
||||
compareReportVOList.add(compareReportVO);
|
||||
|
||||
ForwardReportVO to = null;
|
||||
for (ForwardReportVO item :
|
||||
toCompareList) {
|
||||
|
|
@ -342,8 +315,8 @@ File getFile(Integer type) throws IOException {
|
|||
}
|
||||
//多层比较父级物料编码/图号
|
||||
if (queryType.compareTo(ReportConstant.QueryTypeEnum.MULTI.getValue()) == 0) {
|
||||
if (CollUtil.isEmpty(leftMaterialNoMap.get(from.getParentRowId()))
|
||||
|| CollUtil.isEmpty(rightMaterialNoMap.get(to.getParentRowId()))) {
|
||||
if (CollUtil.isEmpty(leftBomRowIdMap.get(from.getParentRowId()))
|
||||
|| CollUtil.isEmpty(leftBomRowIdMap.get(to.getParentRowId()))) {
|
||||
compareReportVO.setSymbol(ReportConstant.SymbolEnum.NON_EQ.getValue());
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public class EBomFormalTreeTask extends RecursiveTask<List<BomNewEbomParentForma
|
|||
|
||||
@Getter
|
||||
@Setter
|
||||
public static int levelNum=1;
|
||||
private int levelNum=1;
|
||||
|
||||
List<BomNewEbomParentFormalVO> result = new ArrayList<>();
|
||||
|
||||
|
|
@ -93,6 +93,7 @@ public class EBomFormalTreeTask extends RecursiveTask<List<BomNewEbomParentForma
|
|||
if(CollUtil.isNotEmpty(childBowIds)) {
|
||||
List<BomNewEbomParentFormalVO> bom = SpringUtil.getBean(BomNewEbomParentFormalService.class).getBaseMapper().getParentChildBatch(childBowIds);
|
||||
EBomFormalTreeTask task = new EBomFormalTreeTask(bom);
|
||||
task.setLevelNum(levelNum);
|
||||
task.fork();
|
||||
bomDetail.addAll(task.join());
|
||||
return bomDetail;
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ public class EBomForwardReport extends BaseForwardReport {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
List<BomNewEbomParentFormalVO> bomDetailList(Long bomRowId) {
|
||||
synchronized List<BomNewEbomParentFormalVO> bomDetailList(Long bomRowId) {
|
||||
List<BomNewEbomParentFormalVO> childList = SpringUtil.getBean(BomNewEbomParentFormalService.class).getBaseMapper().getParentChild(bomRowId);
|
||||
EBomFormalTreeTask task = new EBomFormalTreeTask(childList);
|
||||
ForkJoinPool pool = new ForkJoinPool();
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class OriginalBomFormalTreeTask extends RecursiveTask<List<BomOriginalLis
|
|||
|
||||
@Getter
|
||||
@Setter
|
||||
public static int levelNum=1;
|
||||
private int levelNum=1;
|
||||
|
||||
List<BomOriginalListVO> result = new ArrayList<>();
|
||||
|
||||
|
|
@ -92,6 +92,7 @@ public class OriginalBomFormalTreeTask extends RecursiveTask<List<BomOriginalLis
|
|||
if(CollUtil.isNotEmpty(childBowIds)) {
|
||||
List<BomOriginalListVO> bom = SpringUtil.getBean(BomNewOriginalParentService.class).getBaseMapper().getParentChildBatch(childBowIds);
|
||||
OriginalBomFormalTreeTask task = new OriginalBomFormalTreeTask(bom);
|
||||
task.setLevelNum(levelNum);
|
||||
task.fork();
|
||||
bomDetail.addAll(task.join());
|
||||
return bomDetail;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class PBomFormalTreeTask extends RecursiveTask<List<BomNewPbomParentForma
|
|||
|
||||
@Getter
|
||||
@Setter
|
||||
public static int levelNum=1;
|
||||
private int levelNum=1;
|
||||
|
||||
List<BomNewPbomParentFormalVO> result = new ArrayList<>();
|
||||
|
||||
|
|
@ -89,6 +89,7 @@ public class PBomFormalTreeTask extends RecursiveTask<List<BomNewPbomParentForma
|
|||
if(CollUtil.isNotEmpty(childBowIds)) {
|
||||
List<BomNewPbomParentFormalVO> bom = SpringUtil.getBean(BomNewPbomParentFormalService.class).getBaseMapper().getParentChildBatch(childBowIds);
|
||||
PBomFormalTreeTask task = new PBomFormalTreeTask(bom);
|
||||
task.setLevelNum(levelNum);
|
||||
task.fork();
|
||||
bomDetail.addAll(task.join());
|
||||
return bomDetail;
|
||||
|
|
|
|||
Loading…
Reference in New Issue