Commit b3565dfd authored by tangwei's avatar tangwei

修改bug

parent 4be025d2
......@@ -306,6 +306,7 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 41)
@ExplicitConstraint(indexNum = 41, sourceClass = CommonExplicitConstraint.class, method = "getEquipDefinition")
private String equipName;
@ExcelIgnore
......@@ -313,8 +314,9 @@ public class WaterResourceDto extends BaseDto {
private Long equipCategoryId;
// BUG 2935 优化项 分类从93060000 取得字典数据 by kongfm 2021-09-17
@ApiModelProperty("设施分类名称")
@ExplicitConstraint(indexNum = 42, sourceClass = CommonExplicitConstraint.class, method = "getEquipCategory")
@ExcelProperty(value = "设施分类名称", index = 42)
@ExcelIgnore
// @ExplicitConstraint(indexNum = 42, sourceClass = CommonExplicitConstraint.class, method = "getEquipCategory")
// @ExcelProperty(value = "设施分类名称", index = 42)
private String equipCategoryName;
@ApiModelProperty("设施编码")
......@@ -322,15 +324,15 @@ public class WaterResourceDto extends BaseDto {
private String equipCode;
@ApiModelProperty("维保周期")
@ExcelProperty(value = "维保周期(月)", index = 43)
@ExcelProperty(value = "维保周期(月)", index = 42)
private String maintenancePeriod;
@ApiModelProperty(value = "经度")
@ExcelProperty(value = "经度", index = 44)
@ExcelProperty(value = "经度", index = 43)
private Double longitude;
@ApiModelProperty(value = "纬度")
@ExcelProperty(value = "纬度", index = 45)
@ExcelProperty(value = "纬度", index = 44)
private Double latitude;
}
......@@ -32,7 +32,7 @@ public class TemplateCellWriteHandlerDate implements SheetWriteHandler {
/**
* 避免生成的导入模板下拉值获取不到
*/
private static final Integer LIMIT_NUMBER = 1;
private static final Integer LIMIT_NUMBER = 0;
......
......@@ -220,4 +220,7 @@ public interface EquipFeignClient {
@RequestMapping(value = "equipment-category/tree/{type}", method = RequestMethod.GET)
ResponseModel<List<LinkedHashMap<String, Object>>> getEquipmentCategory(@PathVariable String type);
@RequestMapping(value = "/equipment/listLike/{code}", method = RequestMethod.GET)
ResponseModel<List<LinkedHashMap<String, Object>>> listLikePage(@PathVariable String code);
}
......@@ -61,7 +61,7 @@ import java.util.stream.Collectors;
* @date 2021-06-29
*/
@RestController
@Api(tags = "消防水源Api")
@Api(tags = "stationApi")
@RequestMapping(value = "/water-resource")
public class WaterResourceController extends BaseController {
......
......@@ -159,6 +159,9 @@ public class DataSourcesImpl implements DataSources {
case "getEquipCategory":
str =getEquipCategory();
break;
case "getEquipDefinition":
str =getEquipDefinition();
break;
}
}
return str;
......@@ -424,4 +427,23 @@ public class DataSourcesImpl implements DataSources {
}
private String[] getEquipDefinition() {
String type = "9306";
ResponseModel<List<LinkedHashMap<String, Object>>> response = equipFeignClient.listLikePage(type);
List<LinkedHashMap<String, Object>> categoryList = response.getResult();
String[] str = null;
List<String> resultList = Lists.newArrayList();
if(categoryList!=null&&categoryList.size()>0){
categoryList.forEach(t -> {
resultList.add(t.get("name") + "@" + t.get("id")+ "@" +t.get("categoryId")+ "@" +t.get("unitName"));
});
str = resultList.toArray(new String[resultList.size()]);
}
return str;
}
}
......@@ -831,6 +831,15 @@ if (excelDtoList != null && excelDtoList.size() > 0) {
item.setEquipCategoryName(equipCategory[0]);
item.setEquipCategoryId(Long.parseLong(equipCategory[1]));
}
if (item.getEquipName() != null) {
String[] equipCategory = item.getEquipName().split("@");
item.setEquipId(Long.parseLong(equipCategory[1]));
item.setEquipName(equipCategory[0]);
item.setEquipCategoryId(Long.parseLong(equipCategory[2]));
item.setEquipCategoryName(equipCategory[3]);
}
item = Bean.toPo(getCurrentInfo(), item);
waterResourceServiceImpl.importByExcel(item);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment