|
@@ -19,8 +19,10 @@ import com.xy.collections.map.JMap;
|
|
|
import com.xy.config.DeviceThreadPoolConfig;
|
|
|
import com.xy.dto.DeviceAnnualFeeDto;
|
|
|
import com.xy.dto.MqttUserDto;
|
|
|
+import com.xy.dto.be.MercDto;
|
|
|
import com.xy.entity.*;
|
|
|
import com.xy.mapper.DeviceAnnualFeeMapper;
|
|
|
+import com.xy.service.be.MercService;
|
|
|
import com.xy.utils.*;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
@@ -79,6 +81,8 @@ public class DeviceAnnualFeeServiceImpl extends ServiceImpl<DeviceAnnualFeeMappe
|
|
|
|
|
|
private MqttUserServiceImpl mqttUserService;
|
|
|
|
|
|
+ private MercService mercService;
|
|
|
+
|
|
|
@PostMapping("check")
|
|
|
@ApiOperation("检查")
|
|
|
public R<String> check(@RequestBody @Validated DeviceAnnualFeeDto.Check check) {
|
|
@@ -111,11 +115,15 @@ public class DeviceAnnualFeeServiceImpl extends ServiceImpl<DeviceAnnualFeeMappe
|
|
|
PageBean<DeviceAnnualFeeDto.Vo> pageBean = toPageBean(DeviceAnnualFeeDto.Vo.class, iPage);
|
|
|
List<DeviceAnnualFeeDto.Vo> records = pageBean.getRecords();
|
|
|
if (Emptys.check(records)) {
|
|
|
+ List<MercDto.Vo> mercs = mercService.list(new MercDto.SelectList().setMercIds(new JArrayList<>(records).getProperty(DeviceAnnualFeeDto.Vo::getMercId).comparing())).getData();
|
|
|
+ JMap<Long, MercDto.Vo> cover = new JArrayList<>(mercs).toMap(MercDto.Vo::getId).cover();
|
|
|
Map<String, SysDictRedis> stringSysDictRedisMap = SysDictUtils.get("merc_device_annual_fee");
|
|
|
for (DeviceAnnualFeeDto.Vo record : records) {
|
|
|
+ MercDto.Vo merc = cover.get(record.getMercId());
|
|
|
SysDictRedis sysDictRedis = stringSysDictRedisMap.get(String.valueOf(record.getMercId()));
|
|
|
JSONObject jsonObject = JSONUtil.parseObj(sysDictRedis.getValue());
|
|
|
- record.setMoney(jsonObject.getInt("money"));
|
|
|
+ record.setMoney(jsonObject.getInt("money"))
|
|
|
+ .setMercName(merc.getName());
|
|
|
}
|
|
|
}
|
|
|
return R.ok(pageBean);
|