|
@@ -23,7 +23,6 @@ import com.xy.mapper.DeviceSimMapper;
|
|
import com.xy.util.ExcelUtils;
|
|
import com.xy.util.ExcelUtils;
|
|
import com.xy.utils.*;
|
|
import com.xy.utils.*;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
-import io.swagger.annotations.ApiModelProperty;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
@@ -206,7 +205,7 @@ public class DeviceSimServiceImpl extends ServiceImpl<DeviceSimMapper, DeviceSim
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
@ApiOperation("导出流量卡数据")
|
|
@ApiOperation("导出流量卡数据")
|
|
@PostMapping("download")
|
|
@PostMapping("download")
|
|
- public void download(@RequestBody DeviceSimDto.Page page) {
|
|
|
|
|
|
+ public void download(@RequestBody DeviceSimDto.Download download) {
|
|
//生成excel
|
|
//生成excel
|
|
String name = YitIdHelper.nextId() + ".xlsx";
|
|
String name = YitIdHelper.nextId() + ".xlsx";
|
|
String path = fileConfig.getPath() + File.separator + name;
|
|
String path = fileConfig.getPath() + File.separator + name;
|
|
@@ -216,8 +215,8 @@ public class DeviceSimServiceImpl extends ServiceImpl<DeviceSimMapper, DeviceSim
|
|
Map<String, SysDictRedis> simConfig = SysDictUtils.get(EnumSimConfig.Code.CODE.getCode());
|
|
Map<String, SysDictRedis> simConfig = SysDictUtils.get(EnumSimConfig.Code.CODE.getCode());
|
|
Integer value = Integer.valueOf(simConfig.get(EnumSimConfig.N_200.getCode()).getValue());
|
|
Integer value = Integer.valueOf(simConfig.get(EnumSimConfig.N_200.getCode()).getValue());
|
|
String theTime = DataTime.getStringAround(0, 0, value, 0, 0, 0);
|
|
String theTime = DataTime.getStringAround(0, 0, value, 0, 0, 0);
|
|
- page.setThisTime(LocalDateTime.now()).setTheTime(DataTime.toLocal(theTime));
|
|
|
|
- List<DeviceSimDto.PageVo> pageVos = baseMapper.page(page);
|
|
|
|
|
|
+ download.setThisTime(LocalDateTime.now()).setTheTime(DataTime.toLocal(theTime));
|
|
|
|
+ List<DeviceSimDto.PageVo> pageVos = baseMapper.page(download);
|
|
List<UploadSim> uploadSims = new ArrayList<>();
|
|
List<UploadSim> uploadSims = new ArrayList<>();
|
|
pageVos.forEach(pageVo -> {
|
|
pageVos.forEach(pageVo -> {
|
|
UploadSim uploadSim = new UploadSim();
|
|
UploadSim uploadSim = new UploadSim();
|
|
@@ -232,15 +231,16 @@ public class DeviceSimServiceImpl extends ServiceImpl<DeviceSimMapper, DeviceSim
|
|
uploadSims.add(uploadSim);
|
|
uploadSims.add(uploadSim);
|
|
});
|
|
});
|
|
//修改批次号
|
|
//修改批次号
|
|
- if (Emptys.check(page.getBatchNo()) && Emptys.check(page.getIsUpdateBatchNo()) && page.getIsUpdateBatchNo()) {
|
|
|
|
|
|
+ if (Emptys.check(download.getBatchNo()) && Emptys.check(download.getIsUpdateBatchNo()) && download.getIsUpdateBatchNo()) {
|
|
LocalDateTime now = LocalDateTime.now();
|
|
LocalDateTime now = LocalDateTime.now();
|
|
List<DeviceSim> deviceSims = new ArrayList<>(uploadSims.size());
|
|
List<DeviceSim> deviceSims = new ArrayList<>(uploadSims.size());
|
|
uploadSims.forEach(uploadSim -> {
|
|
uploadSims.forEach(uploadSim -> {
|
|
DeviceSim deviceSim = new DeviceSim()
|
|
DeviceSim deviceSim = new DeviceSim()
|
|
.setId(uploadSim.getSimId())
|
|
.setId(uploadSim.getSimId())
|
|
- .setBatchNo(page.getBatchNo())
|
|
|
|
|
|
+ .setBatchNo(download.getBatchNo())
|
|
.setWaitHandle(false)
|
|
.setWaitHandle(false)
|
|
.setUpdateTime(now);
|
|
.setUpdateTime(now);
|
|
|
|
+ deviceSims.add(deviceSim);
|
|
});
|
|
});
|
|
updateBatchById(deviceSims);
|
|
updateBatchById(deviceSims);
|
|
}
|
|
}
|