|
|
@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.nl.common.domain.query.PageQuery; |
|
|
|
import org.nl.common.exception.BadRequestException; |
|
|
|
import org.nl.common.utils.FileUtil; |
|
|
|
import org.nl.wms.sch.data.service.MaterialDataService; |
|
|
|
import org.nl.wms.sch.data.service.dao.mapper.MaterialDataMapper; |
|
|
|
import org.nl.wms.sch.data.service.dto.MaterialDataDto; |
|
|
@ -16,15 +17,15 @@ import org.nl.wms.sch.material.service.dao.Material; |
|
|
|
import org.nl.wms.sch.material.service.dao.mapper.MaterialMapper; |
|
|
|
import org.nl.wms.sch.report.service.dto.ReportDto; |
|
|
|
import org.nl.wms.sch.report.service.dto.ReportQuery; |
|
|
|
import org.nl.wms.sch.report.service.dto.YlDto; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
@ -33,6 +34,8 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
|
|
|
|
/** |
|
|
|
* @description 服务实现 |
|
|
|
* @author psh |
|
|
@ -53,4 +56,34 @@ public class MaterialDataServiceImpl extends ServiceImpl<MaterialDataMapper, Mat |
|
|
|
return pages; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void download(MaterialDataRequest query, PageQuery pageQuery, HttpServletResponse response) throws IOException { |
|
|
|
pageQuery.setSize(99999); |
|
|
|
IPage<MaterialDataResponse> pages = new Page<>(pageQuery.getPage() + 1, pageQuery.getSize()); |
|
|
|
materialDataMapper.set(); |
|
|
|
pages = materialDataMapper.queryAll(pages, query); |
|
|
|
List<Map<String, Object>> list = new ArrayList<>(); |
|
|
|
for(MaterialDataResponse materialDataResponse:pages.getRecords()){ |
|
|
|
Map<String, Object> mp = new LinkedHashMap<>(); |
|
|
|
mp.put("客户编码",materialDataResponse.getSupplierCode()); |
|
|
|
mp.put("客户名称",materialDataResponse.getSupplierName()); |
|
|
|
mp.put("物料编码",materialDataResponse.getProductName()); |
|
|
|
mp.put("日期",materialDataResponse.getDate()); |
|
|
|
mp.put("规格",materialDataResponse.getSpecification()); |
|
|
|
mp.put("来料批次",materialDataResponse.getBatch()); |
|
|
|
mp.put("棒源等级",materialDataResponse.getBarLevel()); |
|
|
|
mp.put("昨日结存实际长度(mm)",materialDataResponse.getSc_length()); |
|
|
|
mp.put("昨日结存实际重量(KG)",materialDataResponse.getSy_weight()); |
|
|
|
mp.put("来料入库实际长度(mm)",materialDataResponse.getLl_length()); |
|
|
|
mp.put("来料入库实际重量(KG)",materialDataResponse.getLl_weight()); |
|
|
|
mp.put("领料批次",materialDataResponse.getPickingBatch()); |
|
|
|
mp.put("生产领料实际长度(mm)",materialDataResponse.getSc_length()); |
|
|
|
mp.put("生产领料实际重量(KG)",materialDataResponse.getSc_weight()); |
|
|
|
mp.put("结存实际长度(mm)",materialDataResponse.getJc_length()); |
|
|
|
mp.put("结存实际重量(KG)",materialDataResponse.getJc_weight()); |
|
|
|
list.add(mp); |
|
|
|
} |
|
|
|
FileUtil.downloadExcel(list, response); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|