|
@@ -48,10 +48,13 @@ public class AsyncHandler {
|
|
|
private KrBRegionProvinceServiceImpl krBRegionProvinceService;
|
|
|
|
|
|
@Autowired
|
|
|
+ private KrBRegionCityServiceImpl krBRegionCityService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private KrBLineService krBLineService;
|
|
|
|
|
|
@Autowired
|
|
|
- private BLineUploadLogService lineUploadLogService;
|
|
|
+ private KrBLineUploadLogService lineUploadLogService;
|
|
|
|
|
|
@Autowired
|
|
|
private KrBTowerService krBTowerService;
|
|
@@ -64,7 +67,7 @@ public class AsyncHandler {
|
|
|
|
|
|
@Async
|
|
|
@Transactional
|
|
|
- public void handleDocument(String provinceId, String fileSource, String lineName, AdminUserDetails userDetails, String charset) {
|
|
|
+ public void handleDocument(String provinceId, String cityId, String fileSource, String lineName, String robotName, String voltage, String lineStatus, Long serviceBegintimeTs, String beginTower, String endTower, AdminUserDetails userDetails, String charset) {
|
|
|
StringBuilder warnMsg = new StringBuilder();
|
|
|
KrBLine line = null;
|
|
|
Long userId = null;
|
|
@@ -87,9 +90,16 @@ public class AsyncHandler {
|
|
|
if (line == null) {
|
|
|
// 如果为空,则创建新线路
|
|
|
KrBLine newLine = new KrBLine();
|
|
|
- newLine.setCreatorId(userId);
|
|
|
- newLine.setLineName(lineName);
|
|
|
newLine.setProvinceId(provinceId);
|
|
|
+ newLine.setCityId(cityId);
|
|
|
+ newLine.setLineName(lineName);
|
|
|
+ newLine.setRobotName(robotName);
|
|
|
+ newLine.setVoltage(voltage);
|
|
|
+ newLine.setLineStatus(lineStatus);
|
|
|
+ newLine.setServiceBegintime(new Date(serviceBegintimeTs));
|
|
|
+ newLine.setBeginTower(beginTower);
|
|
|
+ newLine.setEndTower(endTower);
|
|
|
+ newLine.setCreatorId(userId);
|
|
|
newLine.setCreateTime(new Date());
|
|
|
krBLineService.save(newLine);
|
|
|
line = newLine;
|
|
@@ -134,21 +144,31 @@ public class AsyncHandler {
|
|
|
booleanHashMap.put(SecDirectoryName, true);
|
|
|
} else if ("杆塔信息录入.xlsx".equals(SecDirectoryName) || "杆塔信息录入.xls".equals(SecDirectoryName)) {
|
|
|
List<TowerExcelModel> modelArrayList = EasyExcel.read(ais, TowerExcelModel.class, null).sheet().doReadSync();
|
|
|
- BLine finalLine = line;
|
|
|
+ KrBLine finalLine = line;
|
|
|
towerList = modelArrayList.stream().map(model -> {
|
|
|
- BTower tower = new BTower();
|
|
|
- tower.setName(model.getName());
|
|
|
- tower.setShape(model.getShape());
|
|
|
- tower.setSort(model.getSort());
|
|
|
- tower.setHardwareType(model.getHardware());
|
|
|
+ KrBTower tower = new KrBTower();
|
|
|
+ tower.setLineId(finalLine.getId());
|
|
|
+ tower.setTowerName(model.getTowerName());
|
|
|
+ tower.setTowerNumber(model.getTowerNumber());
|
|
|
+ tower.setHardwareType(model.getHardwareType());
|
|
|
// 经纬度设置
|
|
|
String lonLat = model.getLonLat();
|
|
|
String[] lonLats = lonLat.split(",");
|
|
|
BigDecimal lon = CommonUtils.Dms2D(lonLats[0]);
|
|
|
BigDecimal lat = CommonUtils.Dms2D(lonLats[1]);
|
|
|
- tower.setLon(lon);
|
|
|
- tower.setLat(lat);
|
|
|
- tower.setLineId(finalLine.getId());
|
|
|
+ tower.setLongitude(lon);
|
|
|
+ tower.setLatitude(lat);
|
|
|
+ tower.setType(model.getType());
|
|
|
+ tower.setIsStation("是".equals(model.getIsStation()) ? 1 : 0);
|
|
|
+ tower.setIsWeather("是".equals(model.getIsWeather()) ? 1 : 0);
|
|
|
+ tower.setCircuit(model.getCircuit());
|
|
|
+ tower.setHeight(model.getHeight());
|
|
|
+ tower.setPracticalHeight(model.getPracticalHeight());
|
|
|
+ tower.setCornerDirection(model.getCornerDirection());
|
|
|
+ tower.setCornerNumber(model.getCornerNumber());
|
|
|
+ tower.setSpan(model.getSpan());
|
|
|
+ tower.setServuceBegintime(model.getServuceBegintime());
|
|
|
+ tower.setRemark(model.getRemark());
|
|
|
tower.setHasFile(0);
|
|
|
tower.setCreateTime(new Date());
|
|
|
return tower;
|
|
@@ -193,10 +213,10 @@ public class AsyncHandler {
|
|
|
lineUploadLogService.save(lineUploadLog);
|
|
|
|
|
|
// 后续更新塔是否包含资料
|
|
|
- QueryWrapper<BTower> towerWrapper = new QueryWrapper<>();
|
|
|
- towerWrapper.lambda().eq(BTower::getLineId, line.getId());
|
|
|
- List<BTower> oriTowerList = krBTowerService.list(towerWrapper);
|
|
|
- HashSet<BTower> towerSet = new HashSet<>(oriTowerList);
|
|
|
+ QueryWrapper<KrBTower> towerWrapper = new QueryWrapper<>();
|
|
|
+ towerWrapper.lambda().eq(KrBTower::getLineId, line.getId());
|
|
|
+ List<KrBTower> oriTowerList = krBTowerService.list(towerWrapper);
|
|
|
+ HashSet<KrBTower> towerSet = new HashSet<>(oriTowerList);
|
|
|
towerSet.addAll(towerList);
|
|
|
krBTowerService.setHasFile(new ArrayList<>(towerSet), userDetails);
|
|
|
|