Commit a1f02489 authored by 赵啸非's avatar 赵啸非

添加修改删除设备校验

parent 43d4748c
......@@ -170,7 +170,7 @@
<profile>
<id>xuanhan</id>
<properties>
<profiles.active>yibin</profiles.active>
<profiles.active>xuanhan</profiles.active>
<profiles.server.path>/m</profiles.server.path>
<profiles.publish.path>/home/publish</profiles.publish.path>
<profiles.server.port>18222</profiles.server.port>
......@@ -193,8 +193,8 @@
<profiles.sms.smsSendUrl>http://127.0.0.1:8089/api/index/index</profiles.sms.smsSendUrl>
<profiles.sms.apiId>k6BVS1PEbyzcJAE4</profiles.sms.apiId>
<profiles.sms.type>3</profiles.sms.type>
<profiles.log.path>D:/home/mortals/app/logs</profiles.log.path>
<profiles.filepath>D:/mortals/app/data</profiles.filepath>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.filepath>/mortals/app/data</profiles.filepath>
<profiles.log.level>INFO</profiles.log.level>
<profiles.nacos.server-addr>127.0.0.1:8848</profiles.nacos.server-addr>
<profiles.nacos.group>DEFAULT_GROUP</profiles.nacos.group>
......
......@@ -18,7 +18,7 @@ set HEAP_DUMP_PATH=%LOG_PATH%/heap_dump.hprof
set TEMP_PATH=%LOG_PATH%/temp/
if not exist "%TEMP_PATH%" md "%TEMP_PATH%"
rem jvm启动参数
set JAVA_OPTS=-Xms512M -Xmx512M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError
set JAVA_OPTS=-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+HeapDumpOnOutOfMemoryError
set JAVA_OPTS=%JAVA_OPTS% -XX:+PrintGCDateStamps -Xloggc:%GC_PATH%
set JAVA_OPTS=%JAVA_OPTS% -XX:ErrorFile=%HS_ERR_PATH%
set JAVA_OPTS=%JAVA_OPTS% -XX:HeapDumpPath=%HEAP_DUMP_PATH%
......
......@@ -936,9 +936,19 @@ public class DeviceApiController {
private void deviceDel(DeviceReq req) throws AppException {
log.info("【设备删除】【请求体】--> " + JSONObject.toJSONString(req));
//根据设备编码查询设备
DeviceEntity deviceEntity = checkDeviceExist(req);
deviceService.remove(new Long[]{deviceEntity.getId()}, null);
if (ObjectUtils.isEmpty(req.getDeviceCode())) {
throw new AppException(DEVICE_CODE_IS_EMPTY, DEVICE_CODE_IS_EMPTY_CONTENT);
}
DeviceEntity deviceEntity = deviceService.getExtCache(req.getDeviceCode());
if (ObjectUtils.isEmpty(deviceEntity)) {
throw new AppException(DEVICE_NOT_EXIST, DEVICE_NOT_EXIST_CONTENT);
}
//判断提交设备类型是否和已存在的一直
Long productId = deviceEntity.getProductId();
ProductEntity productCache = productService.getCache(productId.toString());
if(!ObjectUtils.isEmpty(productCache)&&req.getProductCode().equals(productCache.getProductCode())){
deviceService.remove(new Long[]{deviceEntity.getId()}, null);
}
}
private void deviceActive(DeviceReq req) throws AppException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment