|
@@ -56,6 +56,7 @@ public class QrFormatServiceImpl implements QrFormatService {
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void saveQrFormat(SaveQrFormatReq req) {
|
|
public void saveQrFormat(SaveQrFormatReq req) {
|
|
Long qrFormatId = req.getId();
|
|
Long qrFormatId = req.getId();
|
|
|
|
+ //1-校验入参
|
|
// 修改码格式时的条件限制
|
|
// 修改码格式时的条件限制
|
|
QrFormat qrFormat;
|
|
QrFormat qrFormat;
|
|
if (qrFormatId != null) {
|
|
if (qrFormatId != null) {
|
|
@@ -66,10 +67,8 @@ public class QrFormatServiceImpl implements QrFormatService {
|
|
throw new BusinessException("码格式不可编辑");
|
|
throw new BusinessException("码格式不可编辑");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- // 同部门下码格式名称不可重复
|
|
|
|
|
|
+ //码格式名称不可重复
|
|
QueryWrapper<QrFormat> qrFormatQw = new QueryWrapper<>();
|
|
QueryWrapper<QrFormat> qrFormatQw = new QueryWrapper<>();
|
|
- qrFormatQw.eq("dept_id", req.getDeptId());
|
|
|
|
qrFormatQw.eq("name", req.getName());
|
|
qrFormatQw.eq("name", req.getName());
|
|
qrFormatQw.eq("is_delete", 0);
|
|
qrFormatQw.eq("is_delete", 0);
|
|
if (qrFormatId != null) {
|
|
if (qrFormatId != null) {
|
|
@@ -80,9 +79,9 @@ public class QrFormatServiceImpl implements QrFormatService {
|
|
throw new BusinessException("码格式名称已存在");
|
|
throw new BusinessException("码格式名称已存在");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //2-保存数据
|
|
// copy属性值
|
|
// copy属性值
|
|
qrFormat = PojoConverterUtils.copy(req, QrFormat.class);
|
|
qrFormat = PojoConverterUtils.copy(req, QrFormat.class);
|
|
-
|
|
|
|
// 新增or修改
|
|
// 新增or修改
|
|
Long userId = UserUtil.getUser().getId();
|
|
Long userId = UserUtil.getUser().getId();
|
|
qrFormat.setUpdateBy(userId);
|
|
qrFormat.setUpdateBy(userId);
|
|
@@ -93,10 +92,8 @@ public class QrFormatServiceImpl implements QrFormatService {
|
|
qrFormatMapper.insert(qrFormat);
|
|
qrFormatMapper.insert(qrFormat);
|
|
}
|
|
}
|
|
|
|
|
|
- // 是否进行重复率验证
|
|
|
|
-// if (QrFormatVerifyUniqueEnum.VERIFY_UNIQUE.is(qrFormat.getVerifyUnique())) {
|
|
|
|
- executorService.execute(new VerifyUniqueTask(qrFormat, qrFormatMapper));
|
|
|
|
-// }
|
|
|
|
|
|
+ //3-异步进行重复率验证
|
|
|
|
+ executorService.execute(new VerifyUniqueTask(qrFormat, qrFormatMapper));
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|