From 5f43e1b56e4eea254b24f3a4e1762ad211c73045 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Thu, 10 Mar 2022 20:50:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B4=A8=E6=A3=80=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/newpro/service/QcSourceService.java | 3 ++ .../service/impl/QcSourceServiceImpl.java | 30 ++++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/xkrs/newpro/service/QcSourceService.java b/src/main/java/com/xkrs/newpro/service/QcSourceService.java index 78c5223..4f20edc 100644 --- a/src/main/java/com/xkrs/newpro/service/QcSourceService.java +++ b/src/main/java/com/xkrs/newpro/service/QcSourceService.java @@ -4,6 +4,9 @@ import com.xkrs.newpro.model.qo.QcSourceQoInsert; public interface QcSourceService { + /** + * 添加质检数据 + */ String insertQcSource(QcSourceQoInsert insertQo); } 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 b83bc5b..3c01ad0 100644 --- a/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java +++ b/src/main/java/com/xkrs/newpro/service/impl/QcSourceServiceImpl.java @@ -1,13 +1,18 @@ package com.xkrs.newpro.service.impl; +import com.xkrs.encapsulation.PromptMessageEnum; import com.xkrs.newpro.dao.QcSourceDao; +import com.xkrs.newpro.model.entity.QcSourceEntity; import com.xkrs.newpro.model.qo.QcSourceQoInsert; import com.xkrs.newpro.service.QcSourceService; +import com.xkrs.newpro.utils.LocalDateUtils; import org.springframework.context.i18n.LocaleContextHolder; import javax.annotation.Resource; import java.util.Locale; +import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject; + public class QcSourceServiceImpl implements QcSourceService { private Locale locale = LocaleContextHolder.getLocale(); @@ -15,8 +20,31 @@ public class QcSourceServiceImpl implements QcSourceService { @Resource private QcSourceDao qcSourceDao; + /** + * 添加质检数据 + */ @Override public String insertQcSource(QcSourceQoInsert insertQo) { - return null; + + String batchNo = insertQo.getBatchNo(); + String machineNo = insertQo.getMachineNo(); + String materialNo = insertQo.getMaterialNo(); + String mouldNo = insertQo.getMouldNo(); + String varietyNo = insertQo.getVarietyNo(); + String qcItemNo = insertQo.getQcItemNo(); + String qcValue = insertQo.getQcValue(); + + QcSourceEntity entity = new QcSourceEntity(); + entity.setCreateTime(LocalDateUtils.getFormatDateToSecond()); + entity.setBatchNo(batchNo); + entity.setMachineNo(machineNo); + entity.setMaterialNo(materialNo); + entity.setMouldNo(mouldNo); + entity.setVarietyNo(varietyNo); + entity.setQcItemNo(qcItemNo); + entity.setQcValue(qcValue); + qcSourceDao.save(entity); + + return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); } }