|
@@ -94,12 +94,12 @@ public class TrialMaterialMobilizationServiceImpl extends BaseServiceImpl<TrialM
|
|
|
if (ObjectUtil.isEmpty(SecureUtil.getUserId())) {
|
|
|
throw new ServiceException("获取用户信息失败");
|
|
|
}
|
|
|
- boolean b=true;
|
|
|
if(StringUtils.isNotEmpty(obj.getMaterialNumber())){
|
|
|
- b= trialNumberRuleService.checkTrialNumberIsExist(obj.getMaterialNumber(), 1,obj.getContractId());
|
|
|
- }
|
|
|
- if(!b){
|
|
|
- throw new ServiceException("编号已存在");
|
|
|
+ Long count = baseMapper.selectCount(Wrappers.<TrialMaterialMobilization>lambdaQuery().eq(TrialMaterialMobilization::getMaterialNumber, obj.getMaterialNumber())
|
|
|
+ .ne( obj.getId() != null,TrialMaterialMobilization::getId, obj.getId()));
|
|
|
+ if (count > 0) {
|
|
|
+ throw new ServiceException("编号已存在");
|
|
|
+ }
|
|
|
}
|
|
|
obj.setUserId(SecureUtil.getUserId());
|
|
|
this.saveOrUpdate(obj);
|