添加质检数据

This commit is contained in:
liuchengqian 2022-03-10 20:50:21 +08:00
parent 4ec6479321
commit 5f43e1b56e
2 changed files with 32 additions and 1 deletions

View File

@ -4,6 +4,9 @@ import com.xkrs.newpro.model.qo.QcSourceQoInsert;
public interface QcSourceService {
/**
* 添加质检数据
*/
String insertQcSource(QcSourceQoInsert insertQo);
}

View File

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