所有报表加导出

This commit is contained in:
zds
2024-12-18 19:11:15 +08:00
parent c584d2c196
commit acaf6f96a0
21 changed files with 332 additions and 120 deletions

View File

@@ -3,6 +3,7 @@ package org.nl.wms.sch.material.controller;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
@@ -10,6 +11,7 @@ import org.nl.common.logging.annotation.Log;
import org.nl.wms.sch.material.service.IMaterialService;
import org.nl.wms.sch.material.service.dao.Material;
import org.nl.wms.sch.material.service.dto.MaterialQuery;
import org.nl.wms.sch.report.service.dto.ReportQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -22,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.util.Set;
/**
@@ -38,8 +41,8 @@ public class MaterialController {
private IMaterialService materialService;
@GetMapping
@Log("查询组盘信息管理")
@ApiOperation("查询组盘信息管理")
@Log("查询原材料入库记录")
@ApiOperation("查询原材料入库记录")
//@SaCheckPermission("@el.check('material:list')")
public ResponseEntity<Object> query(MaterialQuery whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(materialService.queryAll(whereJson,page)),HttpStatus.OK);
@@ -54,7 +57,13 @@ public class MaterialController {
return new ResponseEntity<>(HttpStatus.CREATED);
}
@SneakyThrows
@GetMapping("/download")
@Log("原材料入库导出")
@ApiOperation("原材料入库导出")
public void queryDownload(MaterialQuery whereJson, PageQuery page, HttpServletResponse response){
materialService.queryDownload(whereJson,page,response);
}
@Log("删除组盘信息管理")
@ApiOperation("删除组盘信息管理")

View File

@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.sch.material.service.dao.Material;
import org.nl.wms.sch.material.service.dto.MaterialQuery;
import org.nl.wms.sch.report.service.dto.ReportQuery;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
@@ -26,6 +29,7 @@ public interface IMaterialService extends IService<Material> {
*/
void create(Material entity);
void queryDownload(MaterialQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
/**
* 多选删除

View File

@@ -9,15 +9,20 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.FileUtil;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.sch.material.service.IMaterialService;
import org.nl.wms.sch.material.service.dao.Material;
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper;
import org.nl.wms.sch.material.service.dto.MaterialQuery;
import org.nl.wms.sch.report.service.dto.HwDto;
import org.nl.wms.sch.report.service.dto.ReportQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
@Slf4j
@Service
@@ -42,6 +47,48 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> i
return pages;
}
@Override
public void queryDownload(MaterialQuery query, PageQuery pageQuery, HttpServletResponse response) throws IOException {
pageQuery.setSize(99999);
IPage<Material> pages = this.queryAll(query,pageQuery);
List<Map<String, Object>> list = new ArrayList<>();
for(Material detailDto:pages.getRecords()){
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("入库单号",detailDto.getSimtOrderNo());
mp.put("场地",detailDto.getLocationCode());
mp.put("入库类型",detailDto.getSimtType());
mp.put("到货单号",detailDto.getDeliveryNo());
mp.put("扫描库位",detailDto.getWhlCode());
mp.put("托盘号",detailDto.getPalletSN());
mp.put("物料条码号",detailDto.getLotSN());
mp.put("物料编码",detailDto.getProductName());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("供应商编码",detailDto.getSupplierCode());
mp.put("规格",detailDto.getSpecification());
mp.put("批次号",detailDto.getBatch());
mp.put("数量",detailDto.getQty());
mp.put("来料长度",detailDto.getIncomingLength());
mp.put("来料重量",detailDto.getIncomingWeight());
mp.put("来料缺陷长度",detailDto.getIncomingchipping());
if("1".equals(detailDto.getGroup_bind_material_status())){
mp.put("绑定状态","待绑定");
}else if("2".equals(detailDto.getGroup_bind_material_status())){
mp.put("绑定状态","已绑定");
}else if("3".equals(detailDto.getGroup_bind_material_status())){
mp.put("绑定状态","已解绑");
}
if("1".equals(detailDto.getReturn_status())){
mp.put("回传状态","已入库回传");
}else{
mp.put("回传状态","未回传");
}
mp.put("创建时间",detailDto.getCreate_time());
list.add(mp);
}
FileUtil.downloadExcel(list, response);
}
@Override
public void create(Material entity) {
materialMapper.insert(entity);

View File

@@ -33,7 +33,13 @@ public class ReportController {
public ResponseEntity<Object> query(ReportQuery whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(reportService.queryAll(whereJson,page)),HttpStatus.OK);
}
@SneakyThrows
@GetMapping("/download")
@Log("导出")
@ApiOperation("导出")
public void queryDownload(ReportQuery whereJson, PageQuery page, HttpServletResponse response){
reportService.queryDownload(whereJson,page,response);
}
@GetMapping("/yl/detail")
@Log("原料库库存明细")
@ApiOperation("原料库库存明细")
@@ -43,9 +49,8 @@ public class ReportController {
}
@GetMapping("/yl/outdetail")
@Log("原料库工单库存明细")
@ApiOperation("原料库工单库存明细")
//@SaCheckPermission("@el.check('material:list')")
@Log("原料库工单")
@ApiOperation("原料库工单")
public ResponseEntity<Object> queryYlOutDetail(ReportQuery whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(reportService.queryYlOutDetail(whereJson,page)),HttpStatus.OK);
}
@@ -124,13 +129,20 @@ public class ReportController {
@SneakyThrows
@GetMapping("/yl/detail/download")
@Log("查询详情导出")
@ApiOperation("查询详情导出")
//@SaCheckPermission("@el.check('material:list')")
@Log("晶棒库库存明细详情导出")
@ApiOperation("晶棒库库存明细详情导出")
public void queryYlDetailDownload(ReportQuery whereJson, PageQuery page, HttpServletResponse response){
reportService.queryYlDetailDownload(whereJson,page,response);
}
@SneakyThrows
@GetMapping("/yl/outdetail/download")
@Log("晶棒库工单出库导出")
@ApiOperation("晶棒库工单出库导出")
public void queryYlOutDetailDownload(ReportQuery whereJson, PageQuery page, HttpServletResponse response){
reportService.queryYlOutDetailDownload(whereJson,page,response);
}
@SneakyThrows
@GetMapping("/yl/in/download")
@Log("查询详情导出")
@@ -175,6 +187,14 @@ public class ReportController {
reportService.queryHwInPendingDownload(whereJson,page,response);
}
@SneakyThrows
@GetMapping("/yl/movedetail2/download")
@Log("回温区移库快速回温区导出")
@ApiOperation("回温区移库快速回温区导出")
public void queryMoveDetail2Download(ReportQuery whereJson, PageQuery page, HttpServletResponse response){
reportService.queryMoveDetail2Download(whereJson,page,response);
}
@SneakyThrows
@GetMapping("/hw/out/download")
@Log("查询详情导出")

View File

@@ -91,7 +91,7 @@ public interface IReportService extends IService<ReportDto> {
* @param pageable
* @return
*/
IPage<YCLKCDto> queryMoveDetail2(ReportQuery whereJson, PageQuery pageable);
IPage<HwDto> queryMoveDetail2(ReportQuery whereJson, PageQuery pageable);
/**
* 原材入库明细--------
@@ -109,8 +109,12 @@ public interface IReportService extends IService<ReportDto> {
*/
IPage<YlDto> queryYlOut(ReportQuery whereJson, PageQuery pageable);
void queryDownload(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
void queryYlDetailDownload(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
void queryYlOutDetailDownload(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
void queryYlInDownload(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
void queryYlOutDownload(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
@@ -121,6 +125,8 @@ public interface IReportService extends IService<ReportDto> {
void queryHwInPendingDownload(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
void queryMoveDetail2Download(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
void queryHwOutDownload(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
void queryHwOutPendingDownload(ReportQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;

View File

@@ -29,7 +29,7 @@ public interface ReportMapper extends BaseMapper<ReportDto> {
IPage<YCLKCDto> queryMoveDetail(IPage<YCLKCDto> pages, ReportQuery query);
IPage<YCLKCDto> queryMoveDetail2(IPage<YCLKCDto> pages, ReportQuery query);
IPage<HwDto> queryMoveDetail2(IPage<HwDto> pages, ReportQuery query);
IPage<YlDto> queryYlIn(IPage<YlDto> pages, ReportQuery query);

View File

@@ -34,5 +34,9 @@ public class YCLKCDto implements Serializable {
private String ingotBatch;
/** 数量 */
private String number;
/** 客户来料批次号 */
private String standingTime;
/** 数量 */
private String usedTime;
}

View File

@@ -73,8 +73,8 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
}
@Override
public IPage<YCLKCDto> queryMoveDetail2(ReportQuery query, PageQuery pageQuery){
IPage<YCLKCDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());
public IPage<HwDto> queryMoveDetail2(ReportQuery query, PageQuery pageQuery){
IPage<HwDto> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize());
pages = reportMapper.queryMoveDetail2(pages, query);
return pages;
}
@@ -123,7 +123,26 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
pages = reportMapper.queryHwOutPending(pages, query);
return pages;
}
@Override
public void queryDownload(ReportQuery query, PageQuery pageQuery, HttpServletResponse response) throws IOException {
pageQuery.setSize(99999);
IPage<ReportDto> pages = this.queryAll(query,pageQuery);
List<Map<String, Object>> list = new ArrayList<>();
for(ReportDto detailDto:pages.getRecords()){
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("点位编码",detailDto.getPointCode());
mp.put("点位名称",detailDto.getPointCode());
mp.put("区域编码",detailDto.getRegionCode());
mp.put("区域名称",detailDto.getRegionName());
mp.put("子托号",detailDto.getSubTray());
mp.put("母拖号",detailDto.getMotherTray());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("批次",detailDto.getIngotBatch());
list.add(mp);
}
FileUtil.downloadExcel(list, response);
}
@Override
public void queryYlDetailDownload(ReportQuery query, PageQuery pageQuery, HttpServletResponse response) throws IOException {
pageQuery.setSize(99999);
@@ -137,25 +156,64 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
mp.put("区域名称",detailDto.getRegionName());
mp.put("子托号",detailDto.getSubTray());
mp.put("母拖号",detailDto.getMotherTray());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("物料编码",detailDto.getProductName());
if("1".equals(detailDto.getStatus())){
mp.put("出库状态","出库中");
}else{
mp.put("出库状态","未出库");
}
mp.put("工单编号",detailDto.getMoname());
mp.put("",detailDto.getLotSN());
mp.put("体编",detailDto.getLotSN());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("重量KG",detailDto.getIncomingWeight());
mp.put("折算系数",detailDto.getWeightCoefficientValue());
mp.put("来料长度",detailDto.getIncomingLength());
mp.put("来料重量",detailDto.getIncomingWeight());
mp.put("来料缺陷长度mm",detailDto.getIncomingchipping());
mp.put("有效长度mm",Double.parseDouble(detailDto.getIncomingLength()) - Double.parseDouble(detailDto.getIncomingchipping()));
list.add(mp);
}
FileUtil.downloadExcel(list, response);
}
@Override
public void queryYlOutDetailDownload(ReportQuery query, PageQuery pageQuery, HttpServletResponse response) throws IOException {
pageQuery.setSize(99999);
IPage<YCLKCDto> pages = this.queryYlOutDetail(query,pageQuery);
List<Map<String, Object>> list = new ArrayList<>();
for(YCLKCDto detailDto:pages.getRecords()){
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("点位名称",detailDto.getPointCode());
mp.put("区域名称",detailDto.getRegionName());
mp.put("子托号",detailDto.getSubTray());
mp.put("母拖号",detailDto.getMotherTray());
mp.put("工单编号",detailDto.getMoname());
if("0".equals(detailDto.getStatus())){
mp.put("工单状态","未提交");
}else if("1".equals(detailDto.getStatus())){
mp.put("工单状态","已提交");
}else if("2".equals(detailDto.getStatus())){
mp.put("工单状态","出库中");
}else if("3".equals(detailDto.getStatus())){
mp.put("工单状态","已出库");
}else if("4".equals(detailDto.getStatus())){
mp.put("工单状态","已出库回传");
}
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("每托数量(根)",detailDto.getNumber());
mp.put("入库时间",detailDto.getUpdateTime());
list.add(mp);
}
FileUtil.downloadExcel(list, response);
}
@Override
public void queryYlInDownload(ReportQuery query, PageQuery pageQuery, HttpServletResponse response) throws IOException {
pageQuery.setSize(99999);
@@ -169,14 +227,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
mp.put("区域名称",detailDto.getRegionName());
mp.put("子托号",detailDto.getSubTray());
mp.put("母拖号",detailDto.getMotherTray());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("物料编码",detailDto.getProductName());
mp.put("晶体编号",detailDto.getLotSN());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch());
mp.put("晶棒号",detailDto.getLotSN());
mp.put("来料长度",detailDto.getIncomingLength());
mp.put("来料重量",detailDto.getIncomingWeight());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("重量KG",detailDto.getIncomingWeight());
mp.put("折算系数",detailDto.getWeightCoefficientValue());
mp.put("来料长度mm",detailDto.getIncomingLength());
mp.put("来料缺陷长度mm",detailDto.getIncomingchipping());
mp.put("有效长度mm",Double.parseDouble(detailDto.getIncomingLength()) - Double.parseDouble(detailDto.getIncomingchipping()));
list.add(mp);
}
FileUtil.downloadExcel(list, response);
@@ -195,14 +258,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
mp.put("目的区域名称",detailDto.getRegionName2());
mp.put("子托号",detailDto.getSubTray());
mp.put("母拖号",detailDto.getMotherTray());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("出库时间",detailDto.getUpdateTime());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("物料编码",detailDto.getProductName());
mp.put("晶体编号",detailDto.getLotSN());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch());
mp.put("晶棒号",detailDto.getLotSN());
mp.put("来料长度",detailDto.getIncomingLength());
mp.put("来料重量",detailDto.getIncomingWeight());
mp.put("出库时间",detailDto.getUpdateTime());
mp.put("重量KG",detailDto.getIncomingWeight());
mp.put("折算系数",detailDto.getWeightCoefficientValue());
mp.put("来料长度mm",detailDto.getIncomingLength());
mp.put("来料缺陷长度mm",detailDto.getIncomingchipping());
mp.put("有效长度mm",Double.parseDouble(detailDto.getIncomingLength()) - Double.parseDouble(detailDto.getIncomingchipping()));
list.add(mp);
}
FileUtil.downloadExcel(list, response);
@@ -219,14 +287,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
mp.put("区域名称",detailDto.getRegionName());
mp.put("子托号",detailDto.getSubTray());
mp.put("母拖号",detailDto.getMotherTray());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch());
mp.put("回温时间",detailDto.getStandingTime());
mp.put("已回温时间",detailDto.getUsedTime());
mp.put("每托数量(根)",detailDto.getNumber());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("回温时间H",detailDto.getStandingTime());
mp.put("已回温时间H",detailDto.getUsedTime());
if((Double.parseDouble(detailDto.getStandingTime()) - Double.parseDouble(detailDto.getUsedTime()))>0){
mp.put("是否完成","未完成");
}else{
mp.put("是否完成","已完成");
}
list.add(mp);
}
FileUtil.downloadExcel(list, response);
@@ -241,15 +314,15 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("点位编码",detailDto.getPointCode());
mp.put("区域名称",detailDto.getRegionName());
mp.put("子托",detailDto.getSubTray());
mp.put("拖号",detailDto.getMotherTray());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("子托编码",detailDto.getSubTray());
mp.put("托编码",detailDto.getMotherTray());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch());
mp.put("已回温时间",detailDto.getUsedTime());
mp.put("每托数量(根)",detailDto.getNumber());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("已回温时间H",detailDto.getUsedTime());
list.add(mp);
}
FileUtil.downloadExcel(list, response);
@@ -264,19 +337,46 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("待入库点位编码",detailDto.getPointCode());
mp.put("待入库区域名称",detailDto.getRegionName());
mp.put("子托",detailDto.getSubTray());
mp.put("拖号",detailDto.getMotherTray());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("子托编码",detailDto.getSubTray());
mp.put("托编码",detailDto.getMotherTray());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch());
mp.put("每托数量(根)",detailDto.getNumber());
mp.put("更新时间",detailDto.getUpdateTime());
list.add(mp);
}
FileUtil.downloadExcel(list, response);
}
@Override
public void queryMoveDetail2Download(ReportQuery query, PageQuery pageQuery, HttpServletResponse response) throws IOException {
pageQuery.setSize(99999);
IPage<HwDto> pages = this.queryMoveDetail2(query,pageQuery);
List<Map<String, Object>> list = new ArrayList<>();
for(HwDto detailDto:pages.getRecords()){
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("点位编码",detailDto.getPointCode());
mp.put("区域名称",detailDto.getRegionName());
mp.put("子托编码",detailDto.getSubTray());
mp.put("母托编码",detailDto.getMotherTray());
if("1".equals(detailDto.getStatus())){
mp.put("提交状态","已提交");
}else{
mp.put("提交状态","未提交");
}
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("每托数量(根)",detailDto.getNumber());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("回温时间H",detailDto.getStandingTime());
mp.put("已回温时间H",detailDto.getUsedTime());
list.add(mp);
}
FileUtil.downloadExcel(list, response);
}
@Override
public void queryHwOutDownload(ReportQuery query, PageQuery pageQuery, HttpServletResponse response) throws IOException {
pageQuery.setSize(99999);
@@ -290,14 +390,19 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
mp.put("目的区域名称",detailDto.getRegionName2());
mp.put("子托号",detailDto.getSubTray());
mp.put("母拖号",detailDto.getMotherTray());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("出库时间",detailDto.getUpdateTime());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch());
mp.put("回温时间",detailDto.getStandingTime());
mp.put("已回温时间",detailDto.getUsedTime());
mp.put("每托数量(根)",detailDto.getNumber());
mp.put("出库时间",detailDto.getUpdateTime());
mp.put("回温时间H",detailDto.getStandingTime());
mp.put("已回温时间H",detailDto.getUsedTime());
if((Double.parseDouble(detailDto.getStandingTime()) - Double.parseDouble(detailDto.getUsedTime()))>0){
mp.put("是否完成","未完成");
}else{
mp.put("是否完成","已完成");
}
list.add(mp);
}
FileUtil.downloadExcel(list, response);
@@ -316,13 +421,13 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, ReportDto> impl
mp.put("目的区域名称",detailDto.getRegionName2());
mp.put("子托号",detailDto.getSubTray());
mp.put("母拖号",detailDto.getMotherTray());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("供应商名称",detailDto.getSupplierName());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("物料名称",detailDto.getProductDescription());
mp.put("来料批次号",detailDto.getIngotBatch());
mp.put("棒源等级",detailDto.getSiliconGrade());
mp.put("客户来料批次号",detailDto.getIngotBatch());
mp.put("已回温时间",detailDto.getUsedTime());
mp.put("每托数量(根)",detailDto.getNumber());
mp.put("入库时间",detailDto.getUpdateTime());
mp.put("已回温时间H",detailDto.getUsedTime());
list.add(mp);
}
FileUtil.downloadExcel(list, response);

View File

@@ -2,11 +2,13 @@ package org.nl.wms.sch.workorder.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.base.TableDataInfo;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.logging.annotation.Log;
import org.nl.wms.pdm.service.dao.PointDetailAdd;
import org.nl.wms.sch.report.service.dto.ReportQuery;
import org.nl.wms.sch.workorder.service.IWorkorderService;
import org.nl.wms.sch.workorder.service.dao.Workorder;
import org.nl.wms.sch.workorder.service.dto.WorkorderQuery;
@@ -16,6 +18,7 @@ import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.Set;
/**
@@ -38,7 +41,13 @@ public class WorkorderController {
public ResponseEntity<Object> query(WorkorderQuery whereJson, PageQuery page){
return new ResponseEntity<>(TableDataInfo.build(workorderService.queryAll(whereJson,page)),HttpStatus.OK);
}
@SneakyThrows
@GetMapping("/download")
@Log("导出")
@ApiOperation("导出")
public void queryDownload(WorkorderQuery whereJson, PageQuery page, HttpServletResponse response){
workorderService.queryDownload(whereJson,page,response);
}
@PostMapping
@Log("新增托盘出库工单")
@ApiOperation("新增托盘出库工单")

View File

@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery;
import org.nl.wms.pdm.service.dao.PointDetailAdd;
import org.nl.wms.sch.report.service.dto.ReportQuery;
import org.nl.wms.sch.workorder.service.dao.Workorder;
import org.nl.wms.sch.workorder.service.dto.WorkorderQuery;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Set;
@@ -20,6 +23,8 @@ public interface IWorkorderService extends IService<Workorder> {
*/
IPage<Workorder> queryAll(WorkorderQuery whereJson, PageQuery pageable);
void queryDownload(WorkorderQuery whereJson, PageQuery pageable, HttpServletResponse response) throws IOException;
/**
* 创建
* @param entity /

View File

@@ -12,6 +12,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.FileUtil;
import org.nl.wms.ext.service.AcsToWmsService;
import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pda.service.PdaService;
@@ -19,6 +20,8 @@ import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
import org.nl.wms.pdm.service.dao.PointDetailAdd;
import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.report.service.dto.HwDto;
import org.nl.wms.sch.report.service.dto.ReportQuery;
import org.nl.wms.sch.report.service.dto.YCLKCDto;
import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
@@ -33,10 +36,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@@ -75,6 +77,41 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
return pages;
}
@Override
public void queryDownload(WorkorderQuery query, PageQuery pageQuery, HttpServletResponse response) throws IOException {
pageQuery.setSize(99999);
IPage<Workorder> pages = this.queryAll(query,pageQuery);
List<Map<String, Object>> list = new ArrayList<>();
for(Workorder detailDto:pages.getRecords()){
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("出库单号",detailDto.getSomtOrderNo());
mp.put("生产工单",detailDto.getMoname());
mp.put("托号",detailDto.getPalletSN());
mp.put("晶棒号",detailDto.getLotSN());
mp.put("物料编码",detailDto.getProductName());
mp.put("物料描述",detailDto.getProductDescription());
if("0".equals(detailDto.getStatus())){
mp.put("工单状态","未提交");
}else if("1".equals(detailDto.getStatus())){
mp.put("工单状态","已提交");
}else if("2".equals(detailDto.getStatus())){
mp.put("工单状态","出库中");
}else if("3".equals(detailDto.getStatus())){
mp.put("工单状态","已出库");
}else if("4".equals(detailDto.getStatus())){
mp.put("工单状态","已出库回传");
}
mp.put("物料名称",detailDto.getProductDescription());
mp.put("客户编码",detailDto.getSupplierCode());
mp.put("客户名称",detailDto.getSupplierName());
mp.put("入库时间",DateUtil.format(detailDto.getCreateTime(),"yyyy-MM-dd HH:mm:ss"));
list.add(mp);
}
FileUtil.downloadExcel(list, response);
}
@Override
public void create(Workorder entity) {
workorderMapper.insert(entity);