|
@@ -353,17 +353,30 @@ public class CustomMaintenanceServiceImpl implements CustomMaintenanceService {
|
|
|
excelParam.setOutfields("SID,OBJECTID,CODE,GASDATE,FINISHDATE,MATERIAL,SPEC,DIAMETER");
|
|
|
JSONArray geo = gisAboutService.exceloutList(excelParam);
|
|
|
|
|
|
- String material = geo.getJSONObject(0).getJSONObject("attributes").getString("MATERIAL");
|
|
|
- Integer dimameter = geo.getJSONObject(0).getJSONObject("attributes").getInteger("DIAMETER");
|
|
|
- String type = geo.getJSONObject(0).getJSONObject("attributes").getString("SPEC");
|
|
|
- addMaintenanceDevice.setType(type);
|
|
|
- addMaintenanceDevice.setTechParam("材质:" + (material == null ? "无" : material) + " 管径:" + (dimameter == null ? "无" : dimameter.toString()));
|
|
|
- Date gasDate = geo.getJSONObject(0).getJSONObject("attributes").getDate("GASDATE");
|
|
|
- Integer differentYear = null;
|
|
|
- if (gasDate != null) {
|
|
|
- differentYear = getDifferentYear(gasDate);
|
|
|
+ if(geo.size() >0){
|
|
|
+ String material = geo.getJSONObject(0).getJSONObject("attributes").getString("MATERIAL");
|
|
|
+ Integer dimameter = geo.getJSONObject(0).getJSONObject("attributes").getInteger("DIAMETER");
|
|
|
+ String type = geo.getJSONObject(0).getJSONObject("attributes").getString("SPEC");
|
|
|
+ addMaintenanceDevice.setType(type);
|
|
|
+ addMaintenanceDevice.setTechParam("材质:" + (material == null ? "无" : material) + " 管径:" + (dimameter == null ? "无" : dimameter.toString()));
|
|
|
+ Date gasDate = geo.getJSONObject(0).getJSONObject("attributes").getDate("GASDATE");
|
|
|
+ Integer differentYear = null;
|
|
|
+ if (gasDate != null) {
|
|
|
+ differentYear = getDifferentYear(gasDate);
|
|
|
+ }
|
|
|
+ addMaintenanceDevice.setUsedYears(differentYear == null ? null : differentYear.shortValue());
|
|
|
}
|
|
|
- addMaintenanceDevice.setUsedYears(differentYear == null ? null : differentYear.shortValue());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
addMaintenanceDevice.setMaintainUser(SecurityUtils.getUserId());
|
|
|
addMaintenanceDevice.setMaintainDate(Date8Util.getCurrentDate());
|