feat(ebom): 添加ebom导入模板下载接口
This commit is contained in:
parent
d92ecb727f
commit
bb6ef479e9
|
|
@ -1,24 +1,30 @@
|
|||
package com.nflg.product.bomnew.api.user;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.mzt.logapi.context.LogRecordContext;
|
||||
import com.mzt.logapi.starter.annotation.LogRecord;
|
||||
import com.nflg.product.base.core.api.BaseApi;
|
||||
import com.nflg.product.base.core.conmon.util.SessionUtil;
|
||||
import com.nflg.product.bomnew.mapper.master.BomNewEbomChildMapper;
|
||||
import com.nflg.product.bomnew.pojo.dto.EbomExcelDTO;
|
||||
import com.nflg.product.bomnew.pojo.vo.ImportOriginalBomVO;
|
||||
import com.nflg.product.bomnew.pojo.vo.OperationErrorMsgVO;
|
||||
import com.nflg.product.bomnew.service.BomNewEbomParentService;
|
||||
import com.nflg.product.bomnew.service.BomNewOriginalParentService;
|
||||
import com.nflg.product.bomnew.service.BomNewOriginalParentV2Service;
|
||||
import com.nflg.product.bomnew.service.EBomImportService;
|
||||
import com.nflg.product.bomnew.util.EecExcelUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import nflg.product.common.vo.ResultVO;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
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.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
|
@ -66,7 +72,7 @@ public class EbomV2Api extends BaseApi {
|
|||
return ResultVO.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation("导入")
|
||||
@ApiOperation("从excel导入数据")
|
||||
@PostMapping("importBom")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@LogRecord(success = "原始BOM-导入:文件名:{{#fileNme}},操作结果:{{#_ret}}",
|
||||
|
|
@ -85,4 +91,18 @@ public class EbomV2Api extends BaseApi {
|
|||
originalParentService.getBaseMapper().upOriginalMaterialUse();
|
||||
return ResultVO.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* EBOM导入模板下载
|
||||
* @param response
|
||||
* @throws IOException
|
||||
*/
|
||||
@GetMapping("getEBomExcelTemplate")
|
||||
@ApiOperation("EBOM导入模板下载")
|
||||
public void getEBomExcelTemplate(HttpServletResponse response) throws IOException {
|
||||
EecExcelUtil.setResponseExcelHeader(response, "EBOM导入模板");
|
||||
new Workbook("物料导入", "")
|
||||
.addSheet(new ListSheet<>("sheet1", ImmutableList.of(new EbomExcelDTO())))
|
||||
.writeTo(response.getOutputStream());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue