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);