|
|
@@ -118,8 +118,13 @@ public class IotServiceImpl extends SuperService {
|
|
|
if (ObjectUtils.isNotEmpty(nameTemp) && !nameTemp.getId().equals(template.getId())) {
|
|
|
return ResultContent.buildFail(String.format(ResultMessage.NAME_EXIST, param.getName()));
|
|
|
}
|
|
|
+ IotTemplate codeTemp = iotTemplateDao.findTopByProductCode(param.getProductCode());
|
|
|
+ if (ObjectUtils.isNotEmpty(codeTemp) && !codeTemp.getId().equals(template.getId())) {
|
|
|
+ return ResultContent.buildFail(String.format("%s已存在", param.getProductCode()));
|
|
|
+ }
|
|
|
template.setName(param.getName());
|
|
|
template.setRemark(param.getRemark());
|
|
|
+ template.setProductCode(param.getProductCode());
|
|
|
} else {
|
|
|
// 添加
|
|
|
if (param.getDeviceCategory() == null) {
|