Commit ee79a584 by 李小龙

整理代码

parent f0dd9772
......@@ -43,7 +43,7 @@ public class PlatMenuDTOVO extends BaseIdDTO {
@NotBlank(message = "类型不能为空")
@Pattern(regexp = "1|2|3", message = "类型可选值 1目录 2菜单 3按钮")
@ApiModelProperty(value = "类型 1目录 2菜单 3按钮")
private String resourceType;
private String category;
@ApiModelProperty(value = "前端路径")
private String requestPath;
......
......@@ -33,8 +33,8 @@ public class PushCallback implements MqttCallback {
// 收到消息并设置返回字符串格式
String payload = new String(message.getPayload(), "UTF-8");
logger.info("接收消息主题:{}, 接收消息QoS:{}", topic, message.getQos());
logger.info("接收消息内容:payload格式:{}", payload);
//logger.info("接收消息主题:{}, 接收消息QoS:{}", topic, message.getQos());
//logger.info("接收消息内容:payload格式:{}", payload);
// 解析数据
DeviceInfo device = JSON.parseObject(payload, DeviceInfo.class);
......
......@@ -8,7 +8,10 @@ import com.makeit.common.response.ApiResponseEntity;
import com.makeit.common.response.ApiResponseUtils;
import com.makeit.dto.platform.device.PlatDeviceEditDTO;
import com.makeit.dto.platform.device.PlatDeviceQueryDTO;
import com.makeit.global.annotation.AuthIgnore;
import com.makeit.global.aspect.tenant.TenantIdIgnore;
import com.makeit.service.platform.device.PlatDeviceService;
import com.makeit.task.IotSyncTask;
import com.makeit.vo.platform.device.PlatDeviceListVO;
import com.makeit.vo.platform.device.PlatDeviceViewVO;
import io.swagger.annotations.Api;
......@@ -55,6 +58,18 @@ public class PlatDeviceController {
return ApiResponseUtils.success(platDeviceService.view(baseIdDTO.getId()));
}
@Autowired
private IotSyncTask iotSyncTask;
@ApiOperation("详情")
@PostMapping("iotSyncTask")
@AuthIgnore
@TenantIdIgnore
public ApiResponseEntity<Void> iotSyncTask(@RequestBody BaseIdDTO baseIdDTO) {
iotSyncTask.syncEquipmentInfo();
return ApiResponseUtils.success();
}
}
......@@ -45,7 +45,7 @@ public class PlatMenu extends BaseEntity {
/**
* 类型 1目录 2菜单/功能 3按钮/应用
*/
private String resourceType;
private String category;
/**
* 隐藏状态 0不隐藏 1隐藏
......
......@@ -418,11 +418,11 @@ public class PlatUserServiceImpl extends ServiceImpl<PlatUserMapper, PlatUser>
String button = SysEnum.MenuTypeEnum.BUTTON.getValue();
menuList.forEach(e -> {
if (menu.equals(e.getResourceType()) || button.equals(e.getResourceType())) {
if (menu.equals(e.getCategory()) || button.equals(e.getCategory())) {
buttonList.add(e);
}
if (catalogue.equals(e.getResourceType()) || menu.equals(e.getResourceType())||button.equals(e.getResourceType())) {
if (catalogue.equals(e.getCategory()) || menu.equals(e.getCategory())||button.equals(e.getCategory())) {
nonButtonList.add(e);
}
......
......@@ -177,13 +177,13 @@ implements PlatMenuService {
List<PlatMenu> exitList = list(new QueryWrapper<PlatMenu>().lambda()
.isNotNull(PlatMenu::getCode)
.in(PlatMenu::getResourceType, SysEnum.MenuTypeEnum.MENU.getValue(), SysEnum.MenuTypeEnum.BUTTON.getValue())
.in(PlatMenu::getCategory, SysEnum.MenuTypeEnum.MENU.getValue(), SysEnum.MenuTypeEnum.BUTTON.getValue())
);
Map<String, PlatMenu> exitCodeMap = StreamUtil.toMapDep(exitList, PlatMenu::getCode);
//查询数据库中已存在的权限
List<PlatMenu> exitButtonList = StreamUtil.filter(exitList, e -> SysEnum.MenuTypeEnum.BUTTON.getValue().equals(e.getResourceType()));
List<PlatMenu> exitButtonList = StreamUtil.filter(exitList, e -> SysEnum.MenuTypeEnum.BUTTON.getValue().equals(e.getCategory()));
Map<String, PlatMenu> exitButtonCodeMap = StreamUtil.toMap(exitButtonList, PlatMenu::getCode);
//加载项目中的权限
......@@ -292,7 +292,7 @@ implements PlatMenuService {
button.setCode(e);
button.setSort(0);
button.setStatus(CommonEnum.YES.getValue());
button.setResourceType(SysEnum.MenuTypeEnum.BUTTON.getValue());
button.setCategory(SysEnum.MenuTypeEnum.BUTTON.getValue());
button.setHiddenStatus(CommonEnum.NO.getValue());
button.setCacheStatus(CommonEnum.NO.getValue());
......@@ -329,7 +329,7 @@ implements PlatMenuService {
button.setParentId(TreeConst.TOP_LEVEL);
button.setSort(0);
button.setStatus(CommonEnum.YES.getValue());
button.setResourceType(SysEnum.MenuTypeEnum.BUTTON.getValue());
button.setCategory(SysEnum.MenuTypeEnum.BUTTON.getValue());
button.setHiddenStatus(CommonEnum.NO.getValue());
button.setCacheStatus(CommonEnum.NO.getValue());
......
......@@ -43,7 +43,6 @@ public class IotSyncTask {
* 新增和更新平台端设备表
*/
@Scheduled(cron = "0 0 */1 * * ?")
// @Scheduled(cron = "0 */1 * * * ?")
@TenantIdIgnore
public void syncEquipmentInfo() {
log.info("开始执行同步设备信息接口");
......
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 sign in to comment