|
|
|
@ -3,6 +3,7 @@ package com.glxp.api.controller.inout;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.glxp.api.annotation.AuthRuleAnnotation;
|
|
|
|
@ -46,6 +47,8 @@ import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.net.URLEncoder;
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
@ -98,12 +101,20 @@ public class IoOrderDetailResultController extends BaseController {
|
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
|
@GetMapping("/udiwms/inout/resultDetail/filterOrderList")
|
|
|
|
|
public BaseResponse filterOrderList(FilterOrderDetailResultRequest orderDetailResultRequest) {
|
|
|
|
|
PageInfo<IoOrderDetailResultResponse> pageInfo = new PageInfo<>(getOrderResult(orderDetailResultRequest));
|
|
|
|
|
return ResultVOUtils.page(pageInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<IoOrderDetailResultResponse> getOrderResult(FilterOrderDetailResultRequest orderDetailResultRequest) {
|
|
|
|
|
if (CollUtil.isNotEmpty(orderDetailResultRequest.getList())) {
|
|
|
|
|
return orderDetailResultRequest.getList();
|
|
|
|
|
}
|
|
|
|
|
FilterOrderRequest filterOrderRequest = new FilterOrderRequest();
|
|
|
|
|
filterOrderRequest.setVueType(orderDetailResultRequest.getActionType());
|
|
|
|
|
List<String> actions = orderService.setActions(filterOrderRequest);
|
|
|
|
|
if (CollUtil.isEmpty(actions)) {
|
|
|
|
|
return ResultVOUtils.success("");
|
|
|
|
|
return Collections.emptyList();
|
|
|
|
|
}
|
|
|
|
|
orderDetailResultRequest.setActions(actions);
|
|
|
|
|
AuthAdmin authAdmin = customerService.getUserBean();
|
|
|
|
@ -122,13 +133,39 @@ public class IoOrderDetailResultController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
String fromName = orderDetailResultResponse.getFromName();
|
|
|
|
|
orderDetailResultResponse.setFromName(fromName);
|
|
|
|
|
}
|
|
|
|
|
return list;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
PageInfo<IoOrderDetailResultResponse> pageInfo = new PageInfo<>(list);
|
|
|
|
|
return ResultVOUtils.page(pageInfo);
|
|
|
|
|
@GetMapping("/udiwms/inout/resultDetail/exportExcel")
|
|
|
|
|
public void exportTemplate(FilterOrderDetailResultRequest orderDetailResultRequest, HttpServletResponse response) throws IOException {
|
|
|
|
|
// 模拟数据库获取数据
|
|
|
|
|
List<IoOrderDetailResultResponse> list = getOrderResult(orderDetailResultRequest);
|
|
|
|
|
|
|
|
|
|
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
|
|
|
|
|
response.setHeader("content-Type", "application/vnd.ms-excel");
|
|
|
|
|
response.setHeader("Content-Disposition",
|
|
|
|
|
"attachment;filename=" + URLEncoder.encode("出入库明细" + DateUtil.format(new Date(), "yyyy-MM-dd") + ".xlsx", StandardCharsets.UTF_8.name()));
|
|
|
|
|
|
|
|
|
|
EasyExcel.write(response.getOutputStream(), IoOrderDetailResultResponse.class).sheet().doWrite(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/udiwms/inout/resultDetail/selectExportExcel")
|
|
|
|
|
public void selectExportExcel(@RequestBody FilterOrderDetailResultRequest orderDetailResultRequest, HttpServletResponse response) throws IOException {
|
|
|
|
|
// 模拟数据库获取数据
|
|
|
|
|
List<IoOrderDetailResultResponse> list = getOrderResult(orderDetailResultRequest);
|
|
|
|
|
|
|
|
|
|
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
|
|
|
|
|
response.setHeader("content-Type", "application/vnd.ms-excel");
|
|
|
|
|
response.setHeader("Content-Disposition",
|
|
|
|
|
"attachment;filename=" + URLEncoder.encode("出入库明细" + DateUtil.format(new Date(), "yyyy-MM-dd") + ".xlsx", StandardCharsets.UTF_8.name()));
|
|
|
|
|
|
|
|
|
|
EasyExcel.write(response.getOutputStream(), IoOrderDetailResultResponse.class).sheet().doWrite(list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* pda下载业务单据详情复核
|
|
|
|
|
*/
|
|
|
|
|