fix: 修复设备修改重复code的BUG以及工序的添加

This commit is contained in:
2023-03-31 09:57:51 +08:00
parent 08d7d1acdb
commit 0646a9d6ee
4 changed files with 13 additions and 2 deletions

View File

@@ -148,6 +148,7 @@ public class ProduceWorkorderServiceImpl implements ProduceWorkorderService {
String currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextIdStr());
dto.setCurrent_produce_person_id(currentUserId);
dto.setCreate_id(currentUserId);
dto.setCreate_name(nickName);
dto.setUpdate_id(currentUserId);

View File

@@ -100,7 +100,7 @@ public class DeviceServiceImpl implements DeviceService {
String where = "is_delete = '0' and device_code = '" + dto.getDevice_code() + "'";
JSONObject jsonObject = wo.query(where).uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject)) {
if (ObjectUtil.isNotEmpty(jsonObject) && !dto.getDevice_code().equals(jsonObject.getString("device_code"))) {
throw new BadRequestException("编码已存在!");
}