From f1598fbfda78cfacaa0e9b3362d2251ce834881e Mon Sep 17 00:00:00 2001 From: star <2755454208@qq.com> Date: Fri, 8 Nov 2024 17:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=A5=E8=A3=85=E5=AE=9A?= =?UTF-8?q?=E6=A3=80=E7=AE=A1=E7=90=86=E5=92=8C=E5=B7=A5=E8=A3=85=E5=AE=9A?= =?UTF-8?q?=E6=A3=80=E7=BB=93=E6=9E=9C=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/InventoryTaskController.java | 16 +++++++++++++++ .../inventoryRequestController.java | 14 +++++++++++++ .../ktg/mes/qc/domain/InventoryRequest.java | 20 ++++++++++++++++++- .../com/ktg/mes/qc/domain/InventoryTask.java | 13 ++++++++++++ .../impl/InventoryRequestServiceImpl.java | 11 +++++++++- 5 files changed, 72 insertions(+), 2 deletions(-) diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/InventoryTaskController.java b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/InventoryTaskController.java index 080b894..ce3ea67 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/InventoryTaskController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/InventoryTaskController.java @@ -6,6 +6,8 @@ import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.domain.AjaxResult; import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.enums.BusinessType; +import com.ktg.common.utils.poi.ExcelUtil; +import com.ktg.mes.md.domain.BaseKnife; import com.ktg.mes.qc.domain.InventoryTask; import com.ktg.mes.qc.domain.QcDefect; import com.ktg.mes.qc.service.InventoryTaskService; @@ -13,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; import static com.ktg.common.utils.PageUtils.startPage; @@ -40,6 +43,19 @@ public class InventoryTaskController extends BaseController { return getDataTable(list); } + /** + * 导出工装定检列表 + */ + @Log(title = "工装定检", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, InventoryTask inventoryTask) + { + List list = inventoryTaskService.getList(inventoryTask); + ExcelUtil util = new ExcelUtil(InventoryTask.class); + util.exportExcel(response, list, "工装定检数据数据"); + } + + /** * 修改任务 */ diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/inventoryRequestController.java b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/inventoryRequestController.java index 1d9f559..b67c8c5 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/controller/inventoryRequestController.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/controller/inventoryRequestController.java @@ -5,14 +5,17 @@ import com.ktg.common.core.controller.BaseController; import com.ktg.common.core.domain.AjaxResult; import com.ktg.common.core.page.TableDataInfo; import com.ktg.common.enums.BusinessType; +import com.ktg.common.utils.poi.ExcelUtil; import com.ktg.mes.qc.domain.InventoryRequest; import com.ktg.mes.qc.domain.InventoryTask; import com.ktg.mes.qc.service.InventoryRequestService; import com.ktg.mes.qc.service.InventoryTaskService; +import com.ktg.mes.wm.domain.WmsInPlan; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; import java.util.List; import static com.ktg.common.utils.SecurityUtils.getUsername; @@ -90,4 +93,15 @@ public class inventoryRequestController extends BaseController { return toAjax(inventoryRequestService.deleteInventoryRequestByIds(requestIDs)); } + /** + * 导出定检列表 + */ + @Log(title = "定检结果", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, InventoryRequest inventoryRequest) + { + List list = inventoryRequestService.queryInventoryRequestList(inventoryRequest); + ExcelUtil util = new ExcelUtil(InventoryRequest.class); + util.exportExcel(response, list, "入库计划数据"); + } } diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/InventoryRequest.java b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/InventoryRequest.java index 688a827..480f768 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/InventoryRequest.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/InventoryRequest.java @@ -1,5 +1,6 @@ package com.ktg.mes.qc.domain; +import com.ktg.common.annotation.Excel; import com.ktg.common.core.domain.BaseEntity; import java.sql.Timestamp; @@ -14,33 +15,42 @@ public class InventoryRequest extends BaseEntity { private Long requestId; //结果编码 + @Excel(name = "结果编码") private String requestCode; //点检人 + @Excel(name = "点检人") private String frockUser; //计划id private Long frockId; //点检计划 + @Excel(name = "点检计划") private String frockName; //物料id private String mrlWlGid; - //物料id + //物料 private String mrlWlName; //结果名称 + @Excel(name = "结果名称") private String resultName; //点检结果 private String frockResult; + //点检结果 + @Excel(name = "点检结果") + private String frockResultName; //点检异常 + @Excel(name = "点检异常") private String frockError; //点检时间 + @Excel(name = "点检时间") private Timestamp frockDate; //备注 @@ -164,6 +174,14 @@ public class InventoryRequest extends BaseEntity { this.mrlWlName = mrlWlName; } + public String getFrockResultName() { + return frockResultName; + } + + public void setFrockResultName(String frockResultName) { + this.frockResultName = frockResultName; + } + @Override public String toString() { return "InventoryRequest{" + diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/InventoryTask.java b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/InventoryTask.java index 21a407a..4febcb8 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/domain/InventoryTask.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/domain/InventoryTask.java @@ -1,5 +1,6 @@ package com.ktg.mes.qc.domain; +import com.ktg.common.annotation.Excel; import com.ktg.common.core.domain.BaseEntity; import java.sql.Timestamp; @@ -16,34 +17,46 @@ public class InventoryTask extends BaseEntity { //id private Long wmsInventoryID; //编码 + @Excel(name = "编码") private String wmsInventoryCode; //名称 + @Excel(name = "名称") private String name; //分类Id private String uomId; //分类名称 + @Excel(name = "分类名称") private String uomName; //物料Id名称 private String productId; //物料名称 + @Excel(name = "物料名称") private String productName; //点检模型 private String mrlModel; //点检模型名称 + @Excel(name = "点检模型名称") private String mrlModelName; //点检周期 + @Excel(name = "点检周期") private String mrlPeriod; //计划规则 + @Excel(name = "计划规则") private String planPeriod; //开始时间 + @Excel(name = "开始时间") private Timestamp startTime; //结束时间 + @Excel(name = "结束时间") private Timestamp finishTime; //上次检测时间 + @Excel(name = "上次检测时间") private Timestamp superiorTime; //下次检测时间 + @Excel(name = "下次检测时间") private Timestamp belowTime; //工装定检预警 + @Excel(name = "工装定检预警") private String mrlWarning; //是否完成 private int isSuccess; diff --git a/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/InventoryRequestServiceImpl.java b/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/InventoryRequestServiceImpl.java index 4788c83..900b460 100644 --- a/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/InventoryRequestServiceImpl.java +++ b/ktg-mes/src/main/java/com/ktg/mes/qc/service/impl/InventoryRequestServiceImpl.java @@ -81,6 +81,15 @@ public class InventoryRequestServiceImpl implements InventoryRequestService { @Override public List queryInventoryRequestList(InventoryRequest inventoryRequest) { - return inventoryRequestMapper.getPage(inventoryRequest); + List page = inventoryRequestMapper.getPage(inventoryRequest); + for (InventoryRequest request : page) { + if (request.getFrockResult().equals("0")) { + request.setFrockResultName("合格"); + request.setFrockError(""); + } else if (request.getFrockResult().equals("1")) { + request.setFrockResultName("不合格"); + } + } + return page; } }