|
@@ -13,6 +13,8 @@ import com.zd.common.core.security.TokenService;
|
|
|
import com.zd.common.core.utils.BeanUtils;
|
|
import com.zd.common.core.utils.BeanUtils;
|
|
|
import com.zd.common.core.utils.SecurityUtils;
|
|
import com.zd.common.core.utils.SecurityUtils;
|
|
|
import com.zd.common.core.utils.SpringUtils;
|
|
import com.zd.common.core.utils.SpringUtils;
|
|
|
|
|
+import com.zd.laboratory.api.feign.RemoteLaboratoryService;
|
|
|
|
|
+import com.zd.model.constant.HttpStatus;
|
|
|
import com.zd.model.domain.ResultData;
|
|
import com.zd.model.domain.ResultData;
|
|
|
import com.zd.model.enums.DeviceOnOffEnum;
|
|
import com.zd.model.enums.DeviceOnOffEnum;
|
|
|
import com.zd.model.enums.DeviceStatusEnum;
|
|
import com.zd.model.enums.DeviceStatusEnum;
|
|
@@ -22,6 +24,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -36,6 +39,9 @@ public class HardwareRfidServiceImpl extends ServiceImpl<HardwareRfidMapper, Har
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RemoteLaboratoryService remoteLaboratoryService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public int batchInsert(List<HardwareRfid> list) {
|
|
public int batchInsert(List<HardwareRfid> list) {
|
|
|
return baseMapper.batchInsert(list);
|
|
return baseMapper.batchInsert(list);
|
|
@@ -71,7 +77,30 @@ public class HardwareRfidServiceImpl extends ServiceImpl<HardwareRfidMapper, Har
|
|
|
}
|
|
}
|
|
|
HardwareRfid hardwareRfid = new HardwareRfid();
|
|
HardwareRfid hardwareRfid = new HardwareRfid();
|
|
|
BeanUtils.copyProperties(hardwareRfidVo, hardwareRfid);
|
|
BeanUtils.copyProperties(hardwareRfidVo, hardwareRfid);
|
|
|
- return baseMapper.selectPage(page, new LambdaQueryWrapper<HardwareRfid>().setEntity(hardwareRfid).orderByDesc(HardwareRfid::getCreateTime));
|
|
|
|
|
|
|
+ Page<HardwareRfid> hardwareRfidPage = baseMapper.selectPage(page, new LambdaQueryWrapper<HardwareRfid>().setEntity(hardwareRfid).orderByDesc(HardwareRfid::getCreateTime));
|
|
|
|
|
+ List<HardwareRfid> records = hardwareRfidPage.getRecords();
|
|
|
|
|
+ try {
|
|
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
|
|
+ for (HardwareRfid record : records) {
|
|
|
|
|
+ if (sb.indexOf(String.valueOf(record.getSubjectId())) < 0) {
|
|
|
|
|
+ sb.append(record.getSubjectId()).append(",");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ String substring = sb.substring(0, sb.length() - 1);
|
|
|
|
|
+ ResultData positionBySubId = remoteLaboratoryService.getPositionBySubId(substring);
|
|
|
|
|
+ if (positionBySubId != null && positionBySubId.getCode().equals(HttpStatus.SUCCESS)) {
|
|
|
|
|
+ for (HardwareRfid rfid : records) {
|
|
|
|
|
+ Map<Long, Map<String, Object>> data = (Map<Long, Map<String, Object>>) positionBySubId.getData();
|
|
|
|
|
+ Map<String, Object> stringObjectMap = data.get(String.valueOf(rfid.getSubjectId()));
|
|
|
|
|
+ rfid.setDeptName((String) stringObjectMap.get("deptName"));
|
|
|
|
|
+ rfid.setPosition((String) stringObjectMap.get("position"));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("远程调用查询实验室位置异常!{}", e);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ return hardwareRfidPage;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|