EBOM修复

This commit is contained in:
大米 2024-01-08 12:30:27 +08:00
parent 41c0b4346e
commit b98fe9b4b2
3 changed files with 20 additions and 4 deletions

View File

@ -26,6 +26,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
import java.util.concurrent.ExecutionException;
@ -68,7 +69,7 @@ public class PBomApi extends BaseApi {
@PostMapping("exportWorkDetailsListByPage")
@ApiOperation("导出工作列表")
public void exportWorkDetailsListByPage(@RequestBody BomNewPbomParentQuery query ,HttpServletResponse response) {
public void exportWorkDetailsListByPage(@RequestBody BomNewPbomParentQuery query ,HttpServletResponse response) throws IOException {
bomNewPbomParentService.exportWorkDetailsListByPage(query,response);
}

View File

@ -3,6 +3,7 @@ package com.nflg.product.bomnew.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.TypeReference;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -26,11 +27,14 @@ import nflg.product.common.constant.STATE;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.ttzero.excel.entity.ListMapSheet;
import org.ttzero.excel.entity.ListSheet;
import org.ttzero.excel.entity.Workbook;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
@ -160,8 +164,18 @@ public class BomNewPbomParentService extends ServiceImpl<BomNewPbomParentMapper,
return result;
}
public void exportWorkDetailsListByPage(BomNewPbomParentQuery query,HttpServletResponse response){
public void exportWorkDetailsListByPage(BomNewPbomParentQuery query,HttpServletResponse response) throws IOException {
EecExcelUtil.setResponseExcelHeader(response, "bom明细列表");
new Workbook().addSheet(new ListSheet<BomNewPbomParentVO>() {
Long n = 1L;
@Override
protected List<BomNewPbomParentVO> more() {
query.setPage(n);
n++;
List<BomNewPbomParentVO> result=workDetailsListByPage(query).getRecords();
return CollUtil.isNotEmpty(result)?result:null;
}
}).writeTo(response.getOutputStream());
}
public List<BomNewPbomParentVO> getChild(Long rowId) {

View File

@ -282,7 +282,8 @@ public class OriginalBomToEBomConvert extends BaseConvert {
childEntity.setParentRowId(parent.getEBomRowId()>0?parent.getEBomRowId(): parent.getRowId());
childEntity.setOrderNumber("001");
childEntity.setIdentityNo(StrUtil.join("-", parent.getMaterialNo(), material.getMaterialNo()));
childEntity.setDrawingNo(material.getDrawingNo());
//图号=物料编码
childEntity.setDrawingNo(material.getMaterialNo());
childEntity.setMaterialNo(material.getMaterialNo());
childEntity.setMaterialName(material.getMaterialName());
childEntity.setMaterialDesc(material.getMaterialDesc());