测试问题提交

This commit is contained in:
liang.chao 2024-06-25 10:33:24 +08:00
parent 50de01d74d
commit 503d34ef03
1 changed files with 2 additions and 2 deletions

View File

@ -69,14 +69,14 @@ public class MaTypeServiceImpl implements ITypeService {
String level = maType1.getLevel();
maType.setLevel(String.valueOf(Integer.parseInt(level) + 1));
maType.setCreateTime(DateUtils.getNowDate());
int i = maTypeMapper.insertType(maType);
//根据类型名称判重
if (maType.getTypeName() != null && maType.getParentId() != null) {
int num = maTypeMapper.getMaType(maType);
if (num > 1) {
throw new ServiceException("机具类型名称与库中重复,请修改后重新提交!");
throw new RuntimeException("机具类型名称与库中重复,请修改后重新提交!");
}
}
int i = maTypeMapper.insertType(maType);
Long typeId = maType.getTypeId();
// 图片路径保存
if (StringUtils.isNotEmpty(maType.getPhotoName()) && StringUtils.isNotEmpty(maType.getPhotoUrl())) {