|
@@ -6,9 +6,12 @@ import java.util.List;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
+import com.cpms.common.core.domain.entity.SysDictData;
|
|
|
import com.cpms.common.utils.DateUtils;
|
|
|
import com.cpms.common.utils.file.ExcelUtils;
|
|
|
import com.cpms.project.asset.service.ITLeakagePointsService;
|
|
|
+import com.cpms.system.service.ISysDictDataService;
|
|
|
+import com.cpms.system.service.ISysDictTypeService;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Sheet;
|
|
@@ -38,6 +41,9 @@ public class TLeakagePointsController extends BaseController
|
|
|
@Autowired
|
|
|
private ITLeakagePointsService tLeakagePointsService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysDictTypeService sysDictTypeService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询漏点清单列表
|
|
|
*/
|
|
@@ -112,6 +118,9 @@ public class TLeakagePointsController extends BaseController
|
|
|
public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
|
|
|
//获取操作人员ID
|
|
|
Long userId = getUserId();
|
|
|
+
|
|
|
+ List<SysDictData> dictData = sysDictTypeService.selectDictDataByType("leakage_result");
|
|
|
+ logger.info(JSON.toJSONString(dictData));
|
|
|
//报错行数统计
|
|
|
List<Integer> failRow = new ArrayList<>();
|
|
|
Workbook workbook = ExcelUtils.getWorkBook(file);
|
|
@@ -155,7 +164,11 @@ public class TLeakagePointsController extends BaseController
|
|
|
} else if (j == 10) {
|
|
|
entity.setPressurePlugging(cellValue);
|
|
|
} else if (j == 11) {
|
|
|
- entity.setLeakageEliminationResult(cellValue);
|
|
|
+ for (SysDictData data : dictData) {
|
|
|
+ if (data.getDictLabel().equals(cellValue)){
|
|
|
+ entity.setLeakageEliminationResult(data.getDictValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
} else if (j == 12) {
|
|
|
entity.setNextCheckDate(DateUtils.parseDate(cellValue));
|
|
|
} else if (j == 13) {
|