Commit 4ca161dd authored by “yiyousong”'s avatar “yiyousong”
parents 3cd987b2 41f78743
......@@ -45,7 +45,7 @@ fi
if [ -e "$BASEDIR" ]
then
JAVA_OPTS="-Xms512M -Xmx1024M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
JAVA_OPTS="-Xms1024M -Xmx2048M -Xss256K -XX:+UseAdaptiveSizePolicy -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:GCTimeRatio=39 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -Xloggc:$GC_PATH -XX:+HeapDumpOnOutOfMemoryError -XX:ErrorFile=$HS_ERR_PATH -XX:HeapDumpPath=$HEAP_DUMP_PATH"
fi
CLASSPATH=$CLASSPATH_PREFIX:
......
......@@ -333,6 +333,11 @@ public class UserEntity extends UserEntityExt implements IUser {
return super.getSiteIds();
}
@Override
public String getAreaCodes() {
return null;
}
/**
* 设置 站点id
* @param siteId
......
package com.mortals.xhx.module.device.service;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.device.dao.DeviceDao;
import com.mortals.xhx.module.device.model.DeviceEntity;
......@@ -11,7 +12,7 @@ import com.mortals.xhx.module.device.model.DeviceEntity;
* @author zxfei
* @date 2023-02-25
*/
public interface DeviceService extends ICRUDService<DeviceEntity,Long>{
public interface DeviceService extends ICRUDCacheService<DeviceEntity,Long> {
DeviceDao getDao();
......
......@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.DeviceMethodEnum;
import com.mortals.xhx.common.code.DeviceStatusEnum;
......@@ -32,7 +33,7 @@ import java.util.Date;
*/
@Service("deviceService")
@Slf4j
public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, DeviceEntity, Long> implements DeviceService {
public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, DeviceEntity, Long> implements DeviceService {
@Autowired
private IDeviceFeign deviceFeign;
......@@ -42,6 +43,12 @@ public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, Device
private String password;
@Override
protected String getExtKey(DeviceEntity data) {
return data.getDeviceCode();
}
@Override
public void active(String deviceCode, Context context) {
DeviceEntity deviceEntity = this.selectOne(new DeviceQuery().deviceCode(deviceCode));
......
package com.mortals.xhx.module.device.web;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
......@@ -131,6 +132,28 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
return jsonObject.toJSONString();
}
/**
* 检测设备状态
*/
@PostMapping(value = "check")
@UnAuth
public String deviceCheck(@RequestBody DeviceEntity deviceEntity) {
JSONObject jsonObject = new JSONObject();
Map<String, Object> model = new HashMap<>();
String busiDesc = this.getModuleDesc() + "设备";
try {
DeviceEntity entity = this.service.getExtCache(deviceEntity.getDeviceCode());
jsonObject.put(KEY_RESULT_DATA, entity);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
} catch (Exception e) {
log.error("检测设备消息", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
@Override
protected int saveAfter(DeviceEntity entity, Map<String, Object> model, Context context) throws AppException {
if (ObjectUtils.isEmpty(entity.getUpdateTime())) {
......
......@@ -18,15 +18,7 @@ POST {{baseUrl}}/device/list
Authorization: {{authToken}}
Content-Type: application/json
{
"deviceId":157,
"deviceName":"1e0x2f",
"deviceCode":"kfttm3",
"deviceSrc":2,
"deviceStatus":848,
"page":1,
"size":10
}
{"deviceCode":"B8-13-32-86-8F-A8","page":1,"size":-1}
###设备更新与保存
......
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