Commit 1d0f8556 authored by liuzeheng's avatar liuzeheng

execl 导出调整

parent 4611cced
......@@ -16,6 +16,7 @@ import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -25,7 +26,10 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
......@@ -54,6 +58,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -75,11 +80,168 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
}
public void caseStatus(List<Integer> status, OrderQueryDTO query){
if (CollectionUtils.isNotEmpty(status) && status.size()>0) {
List<Integer> statusList =new ArrayList<>() ;
status.forEach(statu->{
if(statu>10000){
combinedState(statu, query,statusList);
}
});
statusList.stream().distinct();
List<Integer> list= new ArrayList<>() ;
list.addAll(status.stream().filter(s->s <10000).collect(Collectors.toList())) ;
list.addAll(statusList.stream().distinct().collect(Collectors.toList()));
query.setStatusList(list) ;
}else if(CollectionUtils.isNotEmpty(status) && status.size()==0){
status =null;
}
}
private void combinedState(Integer asStatus, OrderQueryDTO query,List<Integer> statusList) {
switch (asStatus) {
case 12325:
//this.status = 12;
statusList.add(12);
query.setShipmentState(325);
break;
case 10501:
// 空运待出
//this.status = 5;
statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setAirShipment(1);
//this.auditType = 0;
if(CollectionUtils.isEmpty(query.getAuditType())){
List<Integer> audits= new ArrayList<>();
query.setAuditType(audits) ;
query.getAuditType().add(0) ;
}else {
query.getAuditType().add(0) ;
}
//this.abnormalState = 0;
if(CollectionUtils.isEmpty(query.getAbnormalState())){
List<Integer> audits= new ArrayList<>();
query.setAbnormalState(audits);
query.getAbnormalState().add(0) ;
}else {
query.getAbnormalState().add(0) ;
}
break;
case 10502:
// 空运可出
//this.status = 5;
statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setAirShipment(12) ; // 可出、备货中
break;
case 10503:
// 空运已备货
//this.status = 5;
statusList.add(5);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setAirShipment(4) ; // 已备货
break;
case 10504:
// 待排单
//this.status = 5;
statusList.add(5);
if (Objects.nonNull(query.getTransportId()) && query.getTransportId() == 3) {
// 空运无需判断备货状态 可出、备货中、已备货
query.setAirShipment(10) ;
}else {
// 兼容空运已入仓的可出、备货中、已备货,且无异常无审批,海运的已入仓无异常无审批
query.setAirShipment(20) ;
}
//this.auditType = 0;
if(CollectionUtils.isEmpty(query.getAuditType())){
List<Integer> audits= new ArrayList<>();
query.setAuditType(audits) ;
query.getAuditType().add(0);
}else {
query.getAuditType().add(0) ;
}
//this.abnormalState = 0;
if(CollectionUtils.isEmpty(query.getAbnormalState())){
List<Integer> audits= new ArrayList<>();
query.setAbnormalState(audits);
query.getAbnormalState().add(0) ;
}else {
query.getAbnormalState().add(0) ;
}
break;
case 132411:
// 空运已出货
//this.status = 32;
statusList.add(32);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setShipmentState(411);
break;
case 132412:
// 空运已出仓
//this.status = 32;
statusList.add(32);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setShipmentState(412);
break;
case 132409:
// 空运已理货
//this.status = 32;
statusList.add(32);
// 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setShipmentState( 409);
break;
case 118428:
// 空运已到港
//this.status = 18;
statusList.add(18);
//query.setTransportId(3); // 空运待出查询,只查空运的订单
if(Objects.nonNull(query.getTransportId())){
query.setTransportId(3);
}
query.setShipmentState( 428);
break;
}
}
@GetMapping("dept/search")
@ApiOperation(value = "参数搜索导出部门订单管理 Excel", notes = "参数搜索和指定部门订单导出管理")
......@@ -96,6 +258,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -114,6 +277,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -131,6 +295,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -148,6 +313,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -166,6 +332,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -186,6 +353,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -206,6 +374,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -226,6 +395,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -246,6 +416,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -268,6 +439,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -290,6 +462,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -312,6 +485,7 @@ public class OrderExportController {
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
reqDTO.setLang(I18nMessage.getLang());
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
fileMakeApi.sendFileMake(reqDTO);
return success(true);
......@@ -350,6 +524,7 @@ public class OrderExportController {
reqDTO.setFileSuffix("xlsx");
reqDTO.setTemporaryFile(true);
reqDTO.setUserType(2);
caseStatus(query.getStatus(),query);
reqDTO.setRequestParams(JSONObject.toJSONString(query));
return success(true);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment