Commit 8ff5393c authored by 赵啸非's avatar 赵啸非

添加设备相关

parent 40ea5c8a
Pipeline #2556 failed with stages
...@@ -11,4 +11,6 @@ public class DeptPdu { ...@@ -11,4 +11,6 @@ public class DeptPdu {
private Integer page; private Integer page;
/**分页每页显示数 -1为不分页*/ /**分页每页显示数 -1为不分页*/
private Integer size; private Integer size;
private String deptNumber;
} }
package com.mortals.xhx.module.device.service.impl; package com.mortals.xhx.module.device.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.PageInfo; import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.dept.DeptPdu;
import com.mortals.xhx.common.pdu.device.DevicePdu;
import com.mortals.xhx.feign.dept.IDeptFeign;
import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.module.device.dao.DeviceMatterDatumDao; import com.mortals.xhx.module.device.dao.DeviceMatterDatumDao;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceMatterDatumEntity; import com.mortals.xhx.module.device.model.DeviceMatterDatumEntity;
...@@ -38,6 +45,8 @@ public class DeviceMatterDatumServiceImpl extends AbstractCRUDServiceImpl<Device ...@@ -38,6 +45,8 @@ public class DeviceMatterDatumServiceImpl extends AbstractCRUDServiceImpl<Device
private DeviceService deviceService; private DeviceService deviceService;
@Autowired @Autowired
private MatterDatumService matterDatumService; private MatterDatumService matterDatumService;
@Autowired
private IDeptFeign deptFeign;
...@@ -68,9 +77,25 @@ public class DeviceMatterDatumServiceImpl extends AbstractCRUDServiceImpl<Device ...@@ -68,9 +77,25 @@ public class DeviceMatterDatumServiceImpl extends AbstractCRUDServiceImpl<Device
if(!ObjectUtils.isEmpty(matterEntity)){ if(!ObjectUtils.isEmpty(matterEntity)){
entity.setMatterCode(matterEntity.getMatterNo()); entity.setMatterCode(matterEntity.getMatterNo());
entity.setMatterName(matterEntity.getMatterName()); entity.setMatterName(matterEntity.getMatterName());
entity.setMateriaFullName(matterEntity.getMatterName());
entity.setDeptId(matterEntity.getDeptId()); entity.setDeptId(matterEntity.getDeptId());
DeptPdu deptPdu = new DeptPdu();
deptPdu.setDeptNumber(matterEntity.getDeptCode());
deptPdu.setSiteId(entity.getSiteId());
Rest<RespData<List<DeptPdu>>> rest = deptFeign.list(deptPdu);
if(YesNoEnum.YES.getValue()==rest.getCode()){
List<DeptPdu> data = rest.getData().getData();
if(!ObjectUtils.isEmpty(data)){
entity.setDeptId(data.get(0).getId());
}
}
entity.setDeptCode(matterEntity.getDeptCode()); entity.setDeptCode(matterEntity.getDeptCode());
entity.setDeptName(matterEntity.getDeptName()); entity.setDeptName(matterEntity.getDeptName());
entity.setSource(matterEntity.getSource());
entity.setIsRecommend(matterEntity.getIsRecommend());
} }
} }
......
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