优化null传参

This commit is contained in:
liuchengqian 2022-03-11 14:58:46 +08:00
parent 2e7a107e93
commit 34d9d84456
3 changed files with 14 additions and 22 deletions

View File

@ -45,9 +45,9 @@ public class QcItemServiceImpl implements QcItemService {
QcItemEntity entity = new QcItemEntity(); QcItemEntity entity = new QcItemEntity();
entity.setCreateTime(LocalDateUtils.getCurrentSecond()); entity.setCreateTime(LocalDateUtils.getCurrentSecond());
entity.setUpdateTime(""); entity.setUpdateTime("");
entity.setNo(no); entity.setNo(LocalStringUtils.formatEmptyValue(no));
entity.setName(name); entity.setName(LocalStringUtils.formatEmptyValue(name));
entity.setType(type); entity.setType(LocalStringUtils.formatEmptyValue(type));
qcItemDao.save(entity); qcItemDao.save(entity);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
@ -68,7 +68,7 @@ public class QcItemServiceImpl implements QcItemService {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验项目,请先添加检验项目!", locale); return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验项目,请先添加检验项目!", locale);
} }
qcItemDao.updateNameById(id, LocalDateUtils.getCurrentSecond(), name); qcItemDao.updateNameById(id, LocalDateUtils.getCurrentSecond(), LocalStringUtils.formatEmptyValue(name));
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale);
} }

View File

@ -40,13 +40,13 @@ public class QcSourceServiceImpl implements QcSourceService {
QcSourceEntity entity = new QcSourceEntity(); QcSourceEntity entity = new QcSourceEntity();
entity.setCreateTime(LocalDateUtils.getCurrentSecond()); entity.setCreateTime(LocalDateUtils.getCurrentSecond());
entity.setBatchNo(batchNo); entity.setBatchNo(LocalStringUtils.formatEmptyValue(batchNo));
entity.setMachineNo(machineNo); entity.setMachineNo(LocalStringUtils.formatEmptyValue(machineNo));
entity.setMaterialNo(materialNo); entity.setMaterialNo(LocalStringUtils.formatEmptyValue(materialNo));
entity.setMouldNo(mouldNo); entity.setMouldNo(LocalStringUtils.formatEmptyValue(mouldNo));
entity.setVarietyNo(varietyNo); entity.setVarietyNo(LocalStringUtils.formatEmptyValue(varietyNo));
entity.setQcItemNo(qcItemNo); entity.setQcItemNo(LocalStringUtils.formatEmptyValue(qcItemNo));
entity.setQcValue(qcValue); entity.setQcValue(LocalStringUtils.formatEmptyValue(qcValue));
qcSourceDao.save(entity); qcSourceDao.save(entity);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);

View File

@ -59,8 +59,8 @@ public class QcSpecServiceImpl implements QcSpecService {
QcSpecEntity entity = new QcSpecEntity(); QcSpecEntity entity = new QcSpecEntity();
entity.setCreateTime(LocalDateUtils.getCurrentSecond()); entity.setCreateTime(LocalDateUtils.getCurrentSecond());
entity.setUpdateTime(""); entity.setUpdateTime("");
entity.setVarietyNo(varietyNo); entity.setVarietyNo(LocalStringUtils.formatEmptyValue(varietyNo));
entity.setQcItemNo(qcItemNo); entity.setQcItemNo(LocalStringUtils.formatEmptyValue(qcItemNo));
entity.setMax(LocalStringUtils.formatEmptyValue(max)); entity.setMax(LocalStringUtils.formatEmptyValue(max));
entity.setMean(LocalStringUtils.formatEmptyValue(mean)); entity.setMean(LocalStringUtils.formatEmptyValue(mean));
entity.setMin(LocalStringUtils.formatEmptyValue(min)); entity.setMin(LocalStringUtils.formatEmptyValue(min));
@ -93,15 +93,7 @@ public class QcSpecServiceImpl implements QcSpecService {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验规格,请先添加检验规格!", locale); return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该检验规格,请先添加检验规格!", locale);
} }
qcSpecDao.updateQcSpecById(id, qcSpecDao.updateQcSpecById(id, LocalDateUtils.getCurrentSecond(), LocalStringUtils.formatEmptyValue(max), LocalStringUtils.formatEmptyValue(mean), LocalStringUtils.formatEmptyValue(min), LocalStringUtils.formatEmptyValue(unit), LocalStringUtils.formatEmptyValue(method), LocalStringUtils.formatEmptyValue(standard), LocalStringUtils.formatEmptyValue(remark));
LocalDateUtils.getCurrentSecond(),
LocalStringUtils.formatEmptyValue(max),
LocalStringUtils.formatEmptyValue(mean),
LocalStringUtils.formatEmptyValue(min),
LocalStringUtils.formatEmptyValue(unit),
LocalStringUtils.formatEmptyValue(method),
LocalStringUtils.formatEmptyValue(standard),
LocalStringUtils.formatEmptyValue(remark));
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "修改成功!", locale);
} }