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

添加样表设备部门过滤

parent 0e7131ae
......@@ -38,15 +38,6 @@ public interface IDeviceFeign extends IFeign {
@GetMapping(value = "/device/info")
Rest<DevicePdu> info(@RequestParam(value = "id") Long id);
/**
* 删除设备
*
* @param ids
* @return
*/
@GetMapping(value = "/device/delete")
Rest<Void> delete(Long[] ids,@RequestHeader("Authorization") String authorization);
/**
* 设备保存更新
......@@ -77,11 +68,6 @@ class DeviceFeignFallbackFactory implements FallbackFactory<IDeviceFeign> {
return Rest.fail("暂时无法获取设备详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除设备,请稍后再试!");
}
@Override
public Rest<RespData<DevicePdu>> save(DevicePdu devicePdu, String authorization) {
return Rest.fail("暂时无法保存设备,请稍后再试!");
......
......@@ -61,7 +61,6 @@ public class DeviceMatterDatumServiceImpl extends AbstractCRUDServiceImpl<Device
throw new AppException("当前设备关联事项已存在,不能新增!");
}
//entity.getMatterId()
if(!ObjectUtils.isEmpty(entity.getMatterId())){
MatterEntity matterEntity = matterService.get(entity.getMatterId());
if(!ObjectUtils.isEmpty(matterEntity)){
......
......@@ -26,9 +26,6 @@ public class DeviceServiceImpl extends AbstractCRUDServiceImpl<DeviceDao, Device
@Override
protected void saveBefore(DeviceEntity entity, Context context) throws AppException {
super.saveBefore(entity, context);
}
}
\ No newline at end of file
......@@ -8,6 +8,5 @@ public class HomeQueryPdu {
private String devicenum;
private Integer newSource;
}
package com.mortals.xhx.module.home.web;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
......@@ -24,6 +23,8 @@ import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import com.mortals.xhx.module.baseset.model.BasesetQuery;
import com.mortals.xhx.module.baseset.service.BasesetService;
import com.mortals.xhx.module.device.model.DeviceMatterDatumQuery;
import com.mortals.xhx.module.device.service.DeviceMatterDatumService;
import com.mortals.xhx.module.home.pdu.HomeQueryPdu;
import com.mortals.xhx.module.hotword.model.HotwordEntity;
import com.mortals.xhx.module.hotword.model.HotwordQuery;
......@@ -35,6 +36,7 @@ import com.mortals.xhx.module.matter.model.MatterQuery;
import com.mortals.xhx.module.matter.service.MatterDatumService;
import com.mortals.xhx.module.matter.service.MatterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -58,6 +60,8 @@ public class HomeController extends BaseJsonBodyController {
@Autowired
private ParamService paramService;
@Autowired
private DeviceMatterDatumService deviceMatterDatumService;
@Autowired
private ISiteFeign siteFeign;
@Autowired
private BasesetService basesetService;
......@@ -127,6 +131,11 @@ public class HomeController extends BaseJsonBodyController {
DeptPdu deptPdu = new DeptPdu();
deptPdu.setSiteId(queryPdu.getSiteId());
deptPdu.setSize(-1);
if(!ObjectUtils.isEmpty(queryPdu.getDevicenum())){
List<Long> deptIdList = deviceMatterDatumService.find(new DeviceMatterDatumQuery().deviceCode(queryPdu.getDevicenum())).stream().map(item -> item.getDeptId()).collect(Collectors.toList());
deptPdu.setIdList(deptIdList);
}
String resp = iApiBaseManagerFeign.getDeptByQuery(deptPdu);
ApiResp<JSONObject> apiResp = JSON.parseObject(resp, ApiResp.class);
if (apiResp.getCode() != YesNoEnum.YES.getValue()) {
......
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