fix:导出订单信息Excel调整
parent
3b41b6b3d3
commit
0c451fcbed
|
|
@ -78,7 +78,7 @@ public class VueInventoryExecutionController extends BaseController
|
||||||
}
|
}
|
||||||
projectOrderInfo.setProductCodeList(productCodeList);
|
projectOrderInfo.setProductCodeList(productCodeList);
|
||||||
}
|
}
|
||||||
String fileName = projectOrderInfoService.exportList(projectOrderInfo);
|
String fileName = projectOrderInfoService.exportMcpList(projectOrderInfo);
|
||||||
return AjaxResult.success(fileName);
|
return AjaxResult.success(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,10 @@ public class ProjectOrderInfoToolProvider extends AbstractMcpToolProvider {
|
||||||
item.put("projectName", orderInfo.getProjectName());
|
item.put("projectName", orderInfo.getProjectName());
|
||||||
item.put("agentName", orderInfo.getAgentName());
|
item.put("agentName", orderInfo.getAgentName());
|
||||||
item.put("orderStatus", DictUtils.getDictLabel("order_status", orderInfo.getOrderStatus()));
|
item.put("orderStatus", DictUtils.getDictLabel("order_status", orderInfo.getOrderStatus()));
|
||||||
|
item.put("orderStockingStatus", resolveOrderStockingStatus(orderInfo));
|
||||||
|
item.put("outerStatus", resolveOuterStatus(orderInfo));
|
||||||
|
item.put("signStatus", resolveSignStatus(orderInfo));
|
||||||
|
item.put("deliveryStatus", resolveDeliveryStatus(orderInfo));
|
||||||
item.put("ownerName", orderInfo.getDutyName());
|
item.put("ownerName", orderInfo.getDutyName());
|
||||||
item.put("orderChannel", getOrderChannelName(orderInfo.getOrderChannel()));
|
item.put("orderChannel", getOrderChannelName(orderInfo.getOrderChannel()));
|
||||||
item.put("supplierName", orderInfo.getSupplier());
|
item.put("supplierName", orderInfo.getSupplier());
|
||||||
|
|
@ -698,6 +702,54 @@ public class ProjectOrderInfoToolProvider extends AbstractMcpToolProvider {
|
||||||
return value == null ? "" : DateUtil.format(value, "yyyy-MM-dd");
|
return value == null ? "" : DateUtil.format(value, "yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String resolveOrderStockingStatus(ProjectOrderInfo orderInfo) {
|
||||||
|
if (orderInfo == null || isBlank(orderInfo.getOrderStockingStatus())) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
for (ProjectOrderInfo.OrderStockingStatusEnum item : ProjectOrderInfo.OrderStockingStatusEnum.values()) {
|
||||||
|
if (item.getCode().equals(orderInfo.getOrderStockingStatus())) {
|
||||||
|
return item.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return orderInfo.getOrderStockingStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String resolveOuterStatus(ProjectOrderInfo orderInfo) {
|
||||||
|
if (orderInfo == null || isBlank(orderInfo.getOuterStatus())) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
for (ProjectOrderInfo.OuterStatusEnum item : ProjectOrderInfo.OuterStatusEnum.values()) {
|
||||||
|
if (item.getCode().equals(orderInfo.getOuterStatus())) {
|
||||||
|
return item.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return orderInfo.getOuterStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String resolveSignStatus(ProjectOrderInfo orderInfo) {
|
||||||
|
if (orderInfo == null || isBlank(orderInfo.getSignStatus())) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
for (ProjectOrderInfo.SignStatusEnum item : ProjectOrderInfo.SignStatusEnum.values()) {
|
||||||
|
if (item.getCode().equals(orderInfo.getSignStatus())) {
|
||||||
|
return item.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return orderInfo.getSignStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
private String resolveDeliveryStatus(ProjectOrderInfo orderInfo) {
|
||||||
|
if (orderInfo == null || isBlank(orderInfo.getDeliveryStatus())) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
for (ProjectOrderInfo.DeliveryStatusEnum item : ProjectOrderInfo.DeliveryStatusEnum.values()) {
|
||||||
|
if (item.getCode().equals(orderInfo.getDeliveryStatus())) {
|
||||||
|
return item.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return orderInfo.getDeliveryStatus();
|
||||||
|
}
|
||||||
|
|
||||||
private String formatDateTime(Date value) {
|
private String formatDateTime(Date value) {
|
||||||
return value == null ? "" : DateUtil.format(value, "yyyy-MM-dd HH:mm:ss");
|
return value == null ? "" : DateUtil.format(value, "yyyy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
|
|
@ -755,6 +807,10 @@ public class ProjectOrderInfoToolProvider extends AbstractMcpToolProvider {
|
||||||
metadata.put("projectName", "项目名称");
|
metadata.put("projectName", "项目名称");
|
||||||
metadata.put("agentName", "代表处");
|
metadata.put("agentName", "代表处");
|
||||||
metadata.put("orderStatus", "订单状态");
|
metadata.put("orderStatus", "订单状态");
|
||||||
|
metadata.put("orderStockingStatus", "备货状态");
|
||||||
|
metadata.put("outerStatus", "出库状态");
|
||||||
|
metadata.put("signStatus", "签收状态");
|
||||||
|
metadata.put("deliveryStatus", "发货状态");
|
||||||
metadata.put("ownerName", "汇智责任人");
|
metadata.put("ownerName", "汇智责任人");
|
||||||
metadata.put("orderChannel", "下单通路");
|
metadata.put("orderChannel", "下单通路");
|
||||||
metadata.put("supplierName", "供货商");
|
metadata.put("supplierName", "供货商");
|
||||||
|
|
|
||||||
|
|
@ -684,6 +684,10 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
"projectName",
|
"projectName",
|
||||||
"agentName",
|
"agentName",
|
||||||
"orderStatus",
|
"orderStatus",
|
||||||
|
"orderStockingStatus",
|
||||||
|
"outerStatus",
|
||||||
|
"signStatus",
|
||||||
|
"deliveryStatus",
|
||||||
"ownerName",
|
"ownerName",
|
||||||
"orderChannel",
|
"orderChannel",
|
||||||
"supplierName",
|
"supplierName",
|
||||||
|
|
@ -745,6 +749,8 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
fieldNames.add(prefix + "Quantity" + i);
|
fieldNames.add(prefix + "Quantity" + i);
|
||||||
fieldNames.add(prefix + "SalesAmount" + i);
|
fieldNames.add(prefix + "SalesAmount" + i);
|
||||||
fieldNames.add(prefix + "CostAmount" + i);
|
fieldNames.add(prefix + "CostAmount" + i);
|
||||||
|
fieldNames.add(prefix + "GrossProfit" + i);
|
||||||
|
fieldNames.add(prefix + "GrossProfitRate" + i);
|
||||||
fieldNames.add(prefix + "TaxRate" + i);
|
fieldNames.add(prefix + "TaxRate" + i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -811,6 +817,14 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
return "代表处";
|
return "代表处";
|
||||||
case "orderStatus":
|
case "orderStatus":
|
||||||
return "订单状态";
|
return "订单状态";
|
||||||
|
case "orderStockingStatus":
|
||||||
|
return "备货状态";
|
||||||
|
case "outerStatus":
|
||||||
|
return "出库状态";
|
||||||
|
case "signStatus":
|
||||||
|
return "签收状态";
|
||||||
|
case "deliveryStatus":
|
||||||
|
return "发货状态";
|
||||||
case "ownerName":
|
case "ownerName":
|
||||||
return "汇智责任人";
|
return "汇智责任人";
|
||||||
case "orderChannel":
|
case "orderChannel":
|
||||||
|
|
@ -924,6 +938,12 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
}
|
}
|
||||||
return labelPrefix + "成本金额小计" + suffix.substring("CostAmount".length());
|
return labelPrefix + "成本金额小计" + suffix.substring("CostAmount".length());
|
||||||
}
|
}
|
||||||
|
if (suffix.startsWith("GrossProfitRate")) {
|
||||||
|
return labelPrefix + "毛利率" + suffix.substring("GrossProfitRate".length());
|
||||||
|
}
|
||||||
|
if (suffix.startsWith("GrossProfit")) {
|
||||||
|
return labelPrefix + "毛利" + suffix.substring("GrossProfit".length());
|
||||||
|
}
|
||||||
if (suffix.startsWith("TaxRate")) {
|
if (suffix.startsWith("TaxRate")) {
|
||||||
return labelPrefix + "税率" + suffix.substring("TaxRate".length());
|
return labelPrefix + "税率" + suffix.substring("TaxRate".length());
|
||||||
}
|
}
|
||||||
|
|
@ -1137,12 +1157,12 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
// 基础列范围(前 25 列)
|
// 基础列范围(前 25 列)
|
||||||
if (columnIndex >= 0 && columnIndex <= 33) {
|
if (columnIndex >= 0 && columnIndex <= 33) {
|
||||||
// 自适应列宽逻辑
|
// 自适应列宽逻辑
|
||||||
sheet.setColumnWidth(columnIndex, 256 * 30); // 设置固定宽度为 20 个字符
|
sheet.setColumnWidth(columnIndex, 256 * 20); // 设置固定宽度为 20 个字符
|
||||||
}
|
}
|
||||||
// 产品和服务列范围(从第 25 列开始)
|
// 产品和服务列范围(从第 25 列开始)
|
||||||
else {
|
else {
|
||||||
// 固定列宽逻辑
|
// 固定列宽逻辑
|
||||||
sheet.setColumnWidth(columnIndex, 256 * 10); // 设置固定宽度为 20 个字符
|
sheet.setColumnWidth(columnIndex, 256 * 15); // 设置固定宽度为 20 个字符
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -965,7 +965,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
max(t4.price) as price,
|
max(t4.price) as price,
|
||||||
t4.quantity as cg_num,
|
t4.quantity as cg_num,
|
||||||
t4.quantity - ifnull((select sum(bind_num) from oms_purchase_order_map as tt
|
t4.quantity - ifnull((select sum(bind_num) from oms_purchase_order_map as tt
|
||||||
where tt.order_id = t2.id and tt.purchase_id = t4.purchase_id and tt.product_code = t4.product_code), 0) as ky_num,
|
where tt.purchase_id = t4.purchase_id and tt.product_code = t4.product_code), 0) as ky_num,
|
||||||
t5.bind_num as ph_num,
|
t5.bind_num as ph_num,
|
||||||
t6.status,
|
t6.status,
|
||||||
(
|
(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue