|
@@ -431,6 +431,7 @@ public class ProjectService {
|
|
|
String companyAllCode = kwsCompany.getCompanyAllCode();
|
|
String companyAllCode = kwsCompany.getCompanyAllCode();
|
|
|
String maxDeviceCode = deviceMapper.getMaxDeviceCodeAndSplit(15, 6);
|
|
String maxDeviceCode = deviceMapper.getMaxDeviceCodeAndSplit(15, 6);
|
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(maxDeviceCode)) {
|
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(maxDeviceCode)) {
|
|
|
|
|
+ maxDeviceCode = StringUtils.addZeroForNum(String.valueOf(Long.parseLong(maxDeviceCode) + 1), 6);
|
|
|
deviceCode = companyAllCode + maxDeviceCode;
|
|
deviceCode = companyAllCode + maxDeviceCode;
|
|
|
} else {
|
|
} else {
|
|
|
deviceCode = companyAllCode + StringUtils.addZeroForNum("1", 6);
|
|
deviceCode = companyAllCode + StringUtils.addZeroForNum("1", 6);
|
|
@@ -446,7 +447,9 @@ public class ProjectService {
|
|
|
kwsDevice.setRelevanceLevel(level);
|
|
kwsDevice.setRelevanceLevel(level);
|
|
|
kwsDevice.setUpdateTime(LocalDateTime.now());
|
|
kwsDevice.setUpdateTime(LocalDateTime.now());
|
|
|
kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
|
- level = "2";
|
|
|
|
|
|
|
+ if (!String.valueOf(id).equals(bindDeviceId)){
|
|
|
|
|
+ level = "2";
|
|
|
|
|
+ }
|
|
|
deviceMapper.updateById(kwsDevice);
|
|
deviceMapper.updateById(kwsDevice);
|
|
|
}
|
|
}
|
|
|
KwsDevice kwsDevice = deviceMapper.selectByPrimaryKey(id);
|
|
KwsDevice kwsDevice = deviceMapper.selectByPrimaryKey(id);
|
|
@@ -1819,7 +1822,9 @@ public class ProjectService {
|
|
|
kwsDevice.setOnline(0);
|
|
kwsDevice.setOnline(0);
|
|
|
kwsDevice.setUpdateTime(LocalDateTime.now());
|
|
kwsDevice.setUpdateTime(LocalDateTime.now());
|
|
|
kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
kwsDevice.setUpdateBy(headerData.getUpdateBy() == null ? null : Long.parseLong(headerData.getUpdateBy()));
|
|
|
- level = "2";
|
|
|
|
|
|
|
+ if (!String.valueOf(id).equals(bindDeviceId)) {
|
|
|
|
|
+ level = "2";
|
|
|
|
|
+ }
|
|
|
deviceMapper.updateById(kwsDevice);
|
|
deviceMapper.updateById(kwsDevice);
|
|
|
}
|
|
}
|
|
|
KwsDevice kwsDevice = deviceMapper.selectByPrimaryKey(id);
|
|
KwsDevice kwsDevice = deviceMapper.selectByPrimaryKey(id);
|