|
@@ -22,6 +22,7 @@ import com.xy.dto.SysWorkUser.ListDto;
|
|
import com.xy.dto.SysWorkUser.SysWorkVo;
|
|
import com.xy.dto.SysWorkUser.SysWorkVo;
|
|
import com.xy.dto.be.MercDto;
|
|
import com.xy.dto.be.MercDto;
|
|
import com.xy.entity.DeviceCreateIds;
|
|
import com.xy.entity.DeviceCreateIds;
|
|
|
|
+import com.xy.entity.DeviceInfo;
|
|
import com.xy.mapper.DeviceCreateIdsMapper;
|
|
import com.xy.mapper.DeviceCreateIdsMapper;
|
|
import com.xy.service.be.MercService;
|
|
import com.xy.service.be.MercService;
|
|
import com.xy.utils.*;
|
|
import com.xy.utils.*;
|
|
@@ -71,6 +72,8 @@ public class DeviceCreateIdsServiceImpl extends ServiceImpl<DeviceCreateIdsMappe
|
|
|
|
|
|
private final MercService mercService;
|
|
private final MercService mercService;
|
|
|
|
|
|
|
|
+ private final DeviceInfoServiceImpl deviceInfoService;
|
|
|
|
+
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@PostMapping("save")
|
|
@PostMapping("save")
|
|
@ApiOperation("添加")
|
|
@ApiOperation("添加")
|
|
@@ -213,11 +216,12 @@ public class DeviceCreateIdsServiceImpl extends ServiceImpl<DeviceCreateIdsMappe
|
|
@PostMapping("getQrCode")
|
|
@PostMapping("getQrCode")
|
|
@ApiOperation("获取二维码")
|
|
@ApiOperation("获取二维码")
|
|
public R<List<String>> getQrCode(@RequestBody @Validated DeviceQualityDto.Qrcode qrcode) {
|
|
public R<List<String>> getQrCode(@RequestBody @Validated DeviceQualityDto.Qrcode qrcode) {
|
|
- DeviceCreateIds deviceCreateIds = getById(qrcode.getDeviceId());
|
|
|
|
- //查询商户特有二维码地址
|
|
|
|
|
|
+ //默认二维码
|
|
String qrUrl = SysDictUtils.getValue(EnumDeviceQrCode.Code.CODE.getCode(), EnumDeviceQrCode.URL.getCode(), String.class);
|
|
String qrUrl = SysDictUtils.getValue(EnumDeviceQrCode.Code.CODE.getCode(), EnumDeviceQrCode.URL.getCode(), String.class);
|
|
- if (Emptys.check(deviceCreateIds.getDeviceQrMercId()) && deviceCreateIds.getDeviceQrMercId() > 0) {
|
|
|
|
- MercDeviceQrConfigDto.Vo mercDeviceQrConfig = mercDeviceQrConfigService.obj(new MercDeviceQrConfigDto.Vo().setMercId(deviceCreateIds.getDeviceQrMercId())).getData();
|
|
|
|
|
|
+ //查询商户特有二维码地址
|
|
|
|
+ DeviceInfo deviceInfo = deviceInfoService.getById(qrcode.getDeviceId());
|
|
|
|
+ if (Emptys.check(deviceInfo.getMercId())) {
|
|
|
|
+ MercDeviceQrConfigDto.Vo mercDeviceQrConfig = mercDeviceQrConfigService.getQrUrl(new MercDeviceQrConfigDto.GetQrUrl().setMercId(deviceInfo.getMercId())).getData();
|
|
if (Emptys.check(mercDeviceQrConfig)) {
|
|
if (Emptys.check(mercDeviceQrConfig)) {
|
|
qrUrl = mercDeviceQrConfig.getQrUrl() + "?deviceId=";
|
|
qrUrl = mercDeviceQrConfig.getQrUrl() + "?deviceId=";
|
|
}
|
|
}
|
|
@@ -229,6 +233,7 @@ public class DeviceCreateIdsServiceImpl extends ServiceImpl<DeviceCreateIdsMappe
|
|
.set(qrUrl + deviceId);
|
|
.set(qrUrl + deviceId);
|
|
JList<String> deviceIdInfos = new JArrayList<String>()
|
|
JList<String> deviceIdInfos = new JArrayList<String>()
|
|
.set(deviceId);
|
|
.set(deviceId);
|
|
|
|
+ DeviceCreateIds deviceCreateIds = getById(qrcode.getDeviceId());
|
|
if (deviceCreateIds.getDeviceType() == deviceType) {
|
|
if (deviceCreateIds.getDeviceType() == deviceType) {
|
|
deviceIds.clear();
|
|
deviceIds.clear();
|
|
deviceIdInfos.clear();
|
|
deviceIdInfos.clear();
|
|
@@ -251,20 +256,15 @@ public class DeviceCreateIdsServiceImpl extends ServiceImpl<DeviceCreateIdsMappe
|
|
List<String> deviceIdInfos = new ArrayList<>();
|
|
List<String> deviceIdInfos = new ArrayList<>();
|
|
List<DeviceCreateIds> updateDeviceCreateIds = new ArrayList<>();
|
|
List<DeviceCreateIds> updateDeviceCreateIds = new ArrayList<>();
|
|
JList<DeviceCreateIds> deviceCreateIdss = new JArrayList<>(listByIds(exportQrCode.getDeviceIds()));
|
|
JList<DeviceCreateIds> deviceCreateIdss = new JArrayList<>(listByIds(exportQrCode.getDeviceIds()));
|
|
- //查询商户特有二维码地址
|
|
|
|
- JMap<Long, MercDeviceQrConfigDto.Vo> mercDeviceQrConfigsJMas;
|
|
|
|
- JList<Long> mercIds = deviceCreateIdss.filter().isNotNull(DeviceCreateIds::getDeviceQrMercId).gt(DeviceCreateIds::getDeviceQrMercId, 0).list().getProperty(DeviceCreateIds::getDeviceQrMercId);
|
|
|
|
- if (Emptys.check(mercIds)) {
|
|
|
|
- List<MercDeviceQrConfigDto.Vo> mercDeviceQrConfigs = mercDeviceQrConfigService.list(new MercDeviceQrConfigDto.SelectList().setMercId(mercIds)).getData();
|
|
|
|
- mercDeviceQrConfigsJMas = new JArrayList<>(mercDeviceQrConfigs).toMap(MercDeviceQrConfigDto.Vo::getMercId).cover();
|
|
|
|
- } else {
|
|
|
|
- mercDeviceQrConfigsJMas = new JHashMap<>();
|
|
|
|
- }
|
|
|
|
|
|
+ List<DeviceInfo> deviceInfos = deviceInfoService.listByIds(exportQrCode.getDeviceIds());
|
|
|
|
+ JMap<Long, DeviceInfo> deviceInfoJMaps = new JArrayList<>(deviceInfos).toMap(DeviceInfo::getDeviceId).cover();
|
|
//循环
|
|
//循环
|
|
deviceCreateIdss.forEach(deviceCreateIds -> {
|
|
deviceCreateIdss.forEach(deviceCreateIds -> {
|
|
String qrUrl = url;
|
|
String qrUrl = url;
|
|
- if (Emptys.check(deviceCreateIds.getDeviceQrMercId())) {
|
|
|
|
- MercDeviceQrConfigDto.Vo mercDeviceQrConfig = mercDeviceQrConfigsJMas.get(deviceCreateIds.getDeviceQrMercId());
|
|
|
|
|
|
+ //查询商户特有二维码地址
|
|
|
|
+ DeviceInfo deviceInfo = deviceInfoJMaps.get(deviceCreateIds.getDeviceId());
|
|
|
|
+ if (Emptys.check(deviceInfo.getMercId())) {
|
|
|
|
+ MercDeviceQrConfigDto.Vo mercDeviceQrConfig = mercDeviceQrConfigService.getQrUrl(new MercDeviceQrConfigDto.GetQrUrl().setMercId(deviceInfo.getMercId())).getData();
|
|
if (Emptys.check(mercDeviceQrConfig)) {
|
|
if (Emptys.check(mercDeviceQrConfig)) {
|
|
qrUrl = mercDeviceQrConfig.getQrUrl() + "?deviceId=";
|
|
qrUrl = mercDeviceQrConfig.getQrUrl() + "?deviceId=";
|
|
}
|
|
}
|