Commit 068d2950 by lijingjing

委托对原铝重取字段原始值添加;

parent 05d37edf
......@@ -521,6 +521,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
if (StringUtils.isNotBlank(sample.getCode())) {
sample.setCode(sample.getCode().trim().toUpperCase());
retakeSourceCodeHandle(sample);
RestAssert.fail(entrustSampleService.isRepeatSampleCode(sample), String.format("样品编号【%s】重复!", sample.getCode()));
}
}
......@@ -565,6 +566,23 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return true;
}
private void retakeSourceCodeHandle(EntrustSample sample) {
// 判定是否原铝重取
String name = sample.getName();
if (!"原铝重取".equals(name)) {
return;
}
String code = sample.getCode();
if (StringUtils.isBlank(code)) {
return;
}
if (!code.startsWith("Y")) {
code = "Y" + code;
}
// Y2201291027C
sample.setSourceCode(code.substring(0, 7) + "-" + code.substring(7, 11));
}
@Override
public Boolean saveOutEntrust(EntrustDTO dto, Account account) {
RestAssert.fail(CollectionUtils.isEmpty(dto.getSampleDTOList()), "外委样品不能为空");
......@@ -756,6 +774,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
if (StringUtils.isNotBlank(sample.getCode())) {
sample.setCode(sample.getCode().trim().toUpperCase());
retakeSourceCodeHandle(sample);
RestAssert.fail(entrustSampleService.isRepeatSampleCode(sample), String.format("样品编号【%s】重复!", sample.getCode()));
}
}
......@@ -1693,6 +1712,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
// 额外处理样品编号空格,大写
sampleCodeHandler(sample);
// 处理重取原编号
retakeSourceCodeHandle(sample);
RestAssert.fail(entrustSampleService.isRepeatSampleCode(sample), String.format("样品编号【%s】重复!", sample.getCode()));
}
entrustSampleService.updateBatchById(sampleList);
......
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