|
@@ -18,10 +18,7 @@ import com.xy.dto.DeviceCreateIdsDto;
|
|
import com.xy.dto.DeviceQualityDto;
|
|
import com.xy.dto.DeviceQualityDto;
|
|
import com.xy.dto.DeviceRegisterDto;
|
|
import com.xy.dto.DeviceRegisterDto;
|
|
import com.xy.dto.be.MercDto;
|
|
import com.xy.dto.be.MercDto;
|
|
-import com.xy.entity.DeviceCreateIds;
|
|
|
|
-import com.xy.entity.DeviceRegister;
|
|
|
|
-import com.xy.entity.DeviceSysinfo;
|
|
|
|
-import com.xy.entity.MqttUser;
|
|
|
|
|
|
+import com.xy.entity.*;
|
|
import com.xy.mapper.DeviceCreateIdsMapper;
|
|
import com.xy.mapper.DeviceCreateIdsMapper;
|
|
import com.xy.mapper.DeviceRegisterMapper;
|
|
import com.xy.mapper.DeviceRegisterMapper;
|
|
import com.xy.service.be.MercService;
|
|
import com.xy.service.be.MercService;
|
|
@@ -75,6 +72,8 @@ public class DeviceRegisterServiceImpl extends ServiceImpl<DeviceRegisterMapper,
|
|
|
|
|
|
private MercService mercService;
|
|
private MercService mercService;
|
|
|
|
|
|
|
|
+ private DeviceInfoServiceImpl deviceInfoService;
|
|
|
|
+
|
|
@PostMapping("save")
|
|
@PostMapping("save")
|
|
@ApiOperation("添加")
|
|
@ApiOperation("添加")
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -126,6 +125,9 @@ public class DeviceRegisterServiceImpl extends ServiceImpl<DeviceRegisterMapper,
|
|
.setShowStatus(true)
|
|
.setShowStatus(true)
|
|
).getData();
|
|
).getData();
|
|
JMap<Long, DeviceQualityDto.Vo> map = new JArrayList<>(vos).toMap(DeviceQualityDto.Vo::getDeviceId).cover();
|
|
JMap<Long, DeviceQualityDto.Vo> map = new JArrayList<>(vos).toMap(DeviceQualityDto.Vo::getDeviceId).cover();
|
|
|
|
+ List<DeviceInfo> deviceInfos = deviceInfoService.listByIds(deviceIds);
|
|
|
|
+ JMap<Long, DeviceInfo> deviceInfoJMaps = new JArrayList<>(deviceInfos).toMap(DeviceInfo::getDeviceId).cover();
|
|
|
|
+
|
|
//查询机器ID号
|
|
//查询机器ID号
|
|
List<DeviceCreateIds> deviceCreateIds = deviceCreateIdsService.list(new LambdaQueryWrapper<DeviceCreateIds>()
|
|
List<DeviceCreateIds> deviceCreateIds = deviceCreateIdsService.list(new LambdaQueryWrapper<DeviceCreateIds>()
|
|
.in(DeviceCreateIds::getDeviceId, deviceIds)
|
|
.in(DeviceCreateIds::getDeviceId, deviceIds)
|
|
@@ -150,6 +152,11 @@ public class DeviceRegisterServiceImpl extends ServiceImpl<DeviceRegisterMapper,
|
|
if (Emptys.check(vo)) {
|
|
if (Emptys.check(vo)) {
|
|
deviceRegister.setFactoryState(vo.getFactoryState()).setQualityState(vo.getQualityState());
|
|
deviceRegister.setFactoryState(vo.getFactoryState()).setQualityState(vo.getQualityState());
|
|
}
|
|
}
|
|
|
|
+ DeviceInfo deviceInfo = deviceInfoJMaps.get(deviceRegister.getDeviceId());
|
|
|
|
+ if (Emptys.check(deviceInfo)) {
|
|
|
|
+ //货道数反显
|
|
|
|
+ deviceRegister.setAisleNum(deviceInfo.getAisleNum());
|
|
|
|
+ }
|
|
//机器ID号商户信息
|
|
//机器ID号商户信息
|
|
DeviceCreateIds deviceCreateIdsInfo = deviceCreateIdsJMaps.get(deviceRegister.getDeviceId());
|
|
DeviceCreateIds deviceCreateIdsInfo = deviceCreateIdsJMaps.get(deviceRegister.getDeviceId());
|
|
if (Emptys.check(deviceCreateIdsInfo)) {
|
|
if (Emptys.check(deviceCreateIdsInfo)) {
|