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