From 9f33ffdd1f0978540da9120da46ff1d4e16f82ec Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Fri, 11 Mar 2022 16:30:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=AF=B7=E6=B1=82=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/xkrs/newpro/controller/QcSourceController.java | 5 +++-- src/main/java/com/xkrs/newpro/service/QcSourceService.java | 3 ++- .../com/xkrs/newpro/service/impl/QcSourceServiceImpl.java | 3 ++- .../java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/xkrs/newpro/controller/QcSourceController.java b/src/main/java/com/xkrs/newpro/controller/QcSourceController.java index 8259498..f269e6e 100644 --- a/src/main/java/com/xkrs/newpro/controller/QcSourceController.java +++ b/src/main/java/com/xkrs/newpro/controller/QcSourceController.java @@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; @@ -20,8 +21,8 @@ public class QcSourceController { * 添加检验数据 */ @PostMapping("/insertQcSource") - public String insertQcSource(QcSourceQoInsert insertQo) { - return qcSourceService.insertQcSource(insertQo); + public String insertQcSource(QcSourceQoInsert insertQo, @RequestParam(required = false, value = "picture") MultipartFile picture) { + return qcSourceService.insertQcSource(insertQo, picture); } /** diff --git a/src/main/java/com/xkrs/newpro/service/QcSourceService.java b/src/main/java/com/xkrs/newpro/service/QcSourceService.java index 1bdeb3d..725d403 100644 --- a/src/main/java/com/xkrs/newpro/service/QcSourceService.java +++ b/src/main/java/com/xkrs/newpro/service/QcSourceService.java @@ -2,13 +2,14 @@ package com.xkrs.newpro.service; import com.xkrs.newpro.model.qo.QcSourceQoDelete; import com.xkrs.newpro.model.qo.QcSourceQoInsert; +import org.springframework.web.multipart.MultipartFile; public interface QcSourceService { /** * 添加检验数据 */ - String insertQcSource(QcSourceQoInsert insertQo); + String insertQcSource(QcSourceQoInsert insertQo, MultipartFile picture); /** * 删除检验数据 diff --git a/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java b/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java index 211f6bb..a6862e7 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java @@ -10,6 +10,7 @@ import com.xkrs.newpro.utils.LocalDateUtils; import com.xkrs.newpro.utils.LocalStringUtils; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.util.List; @@ -31,7 +32,7 @@ public class QcSourceServiceImpl implements QcSourceService { * 添加检验数据 */ @Override - public String insertQcSource(QcSourceQoInsert insertQo) { + public String insertQcSource(QcSourceQoInsert insertQo, MultipartFile picture) { String batchNo = insertQo.getBatchNo(); String machineNo = insertQo.getMachineNo(); diff --git a/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java b/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java index 344fe09..5cd623f 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcSpecServiceImpl.java @@ -51,7 +51,7 @@ public class QcSpecServiceImpl implements QcSpecService { Optional entityByNo = qcItemDao.findByNo(qcItemNo); if (entityByNo.isEmpty()) { - return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验规格,请先添加检验规格!", locale); + return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验项目,请先添加检验项目!", locale); } Optional entityByVarietyNoAndQcItemNo = qcSpecDao.findByVarietyNoAndQcItemNo(varietyNo, qcItemNo);