|
@@ -13,6 +13,7 @@ import com.xy.service.factory.cmd.CmdService;
|
|
|
import com.xy.utils.R;
|
|
|
import com.xy.utils.SysDictUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+import lombok.Getter;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
@@ -37,15 +38,18 @@ public class TaskCmdServiceImpl implements CmdService {
|
|
|
activityInfoService.abort(new ActivityInfoDto.Abort().setDeviceId(mqttDto.getDeviceId()));
|
|
|
}
|
|
|
//版本升级
|
|
|
- if (type.equals(EnumMqttCmdTempletTask.APPUPDATE.getCode())) {
|
|
|
- Integer value = SysDictUtils.getValue(EnumAppUpdateStatus.Code.CODE.getCode(), EnumAppUpdateStatus.CMD.getCode(), Integer.class);
|
|
|
- DeviceVersionUpDto.SaveOrUpdate saveOrUpdate = new DeviceVersionUpDto.SaveOrUpdate()
|
|
|
- .setDeviceId(mqttDto.getDeviceId())
|
|
|
- .setDeviceVersion(data.getStr("version"))
|
|
|
- .setAccumSendNum(1);
|
|
|
- saveOrUpdate.setCmdValue(mqttDto.getPater().getData().toString());
|
|
|
- saveOrUpdate.setStatus(value);
|
|
|
- deviceVersionUpService.saveOrUpdate(saveOrUpdate);
|
|
|
+ if (Type.APP.getType().equals(type)) {
|
|
|
+ String task = data.getStr("task");
|
|
|
+ if (Task.UPDATE.getTask().equals(task)) {
|
|
|
+ Integer value = SysDictUtils.getValue(EnumAppUpdateStatus.Code.CODE.getCode(), EnumAppUpdateStatus.CMD.getCode(), Integer.class);
|
|
|
+ DeviceVersionUpDto.SaveOrUpdate saveOrUpdate = new DeviceVersionUpDto.SaveOrUpdate()
|
|
|
+ .setDeviceId(mqttDto.getDeviceId())
|
|
|
+ .setDeviceVersion(data.getStr("version"))
|
|
|
+ .setAccumSendNum(1);
|
|
|
+ saveOrUpdate.setCmdValue(mqttDto.getPater().getData().toString());
|
|
|
+ saveOrUpdate.setStatus(value);
|
|
|
+ deviceVersionUpService.saveOrUpdate(saveOrUpdate);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return R.ok();
|
|
@@ -66,4 +70,30 @@ public class TaskCmdServiceImpl implements CmdService {
|
|
|
}
|
|
|
return R.ok();
|
|
|
}
|
|
|
+
|
|
|
+ @Getter
|
|
|
+ @AllArgsConstructor
|
|
|
+ public enum Type {
|
|
|
+
|
|
|
+ APP("app", "机器app指令"),
|
|
|
+
|
|
|
+ ;
|
|
|
+
|
|
|
+ private String type;
|
|
|
+
|
|
|
+ private String msg;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Getter
|
|
|
+ @AllArgsConstructor
|
|
|
+ public enum Task {
|
|
|
+
|
|
|
+ UPDATE("update", "机器app升级指令"),
|
|
|
+
|
|
|
+ ;
|
|
|
+
|
|
|
+ private String task;
|
|
|
+
|
|
|
+ private String msg;
|
|
|
+ }
|
|
|
}
|