Commit 479a3332 by lijingjing

石油焦编号,在提交时判断问题;

parent 5ceb20e7
...@@ -455,7 +455,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -455,7 +455,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
sample.setEntrustId(entrust.getId()); sample.setEntrustId(entrust.getId());
// 只有在提交时,才初始化样品编号 // 只有在提交时,才初始化样品编号
if (isSubmit) { if (isSubmit) {
if (StringUtils.isBlank(sample.getCode())) { // 判断是否样品为空时,需要考虑是否进场物资
// 若为进场物资,需要考虑是否为采样样品
// 若为采样样品,需要赋值采样样品编号
if (StringUtils.isBlank(sample.getCode()) || Objects.nonNull(sample.getSamplingId())) {
handleSampleCode(entrust, sample); handleSampleCode(entrust, sample);
} }
if (StringUtils.isNotBlank(sample.getCode())) { if (StringUtils.isNotBlank(sample.getCode())) {
...@@ -687,7 +690,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -687,7 +690,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
sample.setId(IdWorker.getId()); sample.setId(IdWorker.getId());
} }
if (isSubmit) { if (isSubmit) {
if (StringUtils.isBlank(sample.getCode())) { if (StringUtils.isBlank(sample.getCode()) || Objects.nonNull(sample.getSamplingId())) {
handleSampleCode(entrust, sample); handleSampleCode(entrust, sample);
} }
if (StringUtils.isNotBlank(sample.getCode())) { if (StringUtils.isNotBlank(sample.getCode())) {
...@@ -1598,7 +1601,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust> ...@@ -1598,7 +1601,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert.fail(CollectionUtils.isEmpty(sampleList), String.format("委托编号为的【%s】样品为空!", entrust.getCode())); RestAssert.fail(CollectionUtils.isEmpty(sampleList), String.format("委托编号为的【%s】样品为空!", entrust.getCode()));
// 若存在任何一个样品的编号为空,那么需要自动生成其编号 // 若存在任何一个样品的编号为空,那么需要自动生成其编号
for (EntrustSample sample : sampleList) { for (EntrustSample sample : sampleList) {
if (StringUtils.isBlank(sample.getCode())) { if (StringUtils.isBlank(sample.getCode()) || Objects.nonNull(sample.getSamplingId())) {
handleSampleCode(entrust, sample); handleSampleCode(entrust, sample);
} }
RestAssert.fail(entrustSampleService.isRepeatSampleCode(sample), String.format("样品编号【%s】重复!", sample.getCode())); RestAssert.fail(entrustSampleService.isRepeatSampleCode(sample), String.format("样品编号【%s】重复!", sample.getCode()));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment