|
@@ -10,6 +10,7 @@ import com.bowintek.practice.filter.exception.BaseResponse;
|
|
import com.bowintek.practice.filter.exception.RespGenerstor;
|
|
import com.bowintek.practice.filter.exception.RespGenerstor;
|
|
import com.bowintek.practice.model.WlUserExpendSetting;
|
|
import com.bowintek.practice.model.WlUserExpendSetting;
|
|
import com.bowintek.practice.services.service.AccountService;
|
|
import com.bowintek.practice.services.service.AccountService;
|
|
|
|
+import com.bowintek.practice.services.service.ApplyFormService;
|
|
import com.bowintek.practice.services.service.OrganizationService;
|
|
import com.bowintek.practice.services.service.OrganizationService;
|
|
import com.bowintek.practice.services.service.WellInfoService;
|
|
import com.bowintek.practice.services.service.WellInfoService;
|
|
import com.bowintek.practice.util.RemoteHelper;
|
|
import com.bowintek.practice.util.RemoteHelper;
|
|
@@ -47,6 +48,8 @@ public class WellInfoController {
|
|
@Autowired
|
|
@Autowired
|
|
private AccountService accountService;
|
|
private AccountService accountService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private ApplyFormService applyFormService;
|
|
|
|
+ @Autowired
|
|
private RemoteHelper remoteHelper;
|
|
private RemoteHelper remoteHelper;
|
|
@Autowired
|
|
@Autowired
|
|
private AppConfig appConfig;
|
|
private AppConfig appConfig;
|
|
@@ -74,11 +77,13 @@ public class WellInfoController {
|
|
public BaseResponse getOrganizationTree() {
|
|
public BaseResponse getOrganizationTree() {
|
|
return RespGenerstor.success(organizationService.getListTree("HBlQAIBGob"));
|
|
return RespGenerstor.success(organizationService.getListTree("HBlQAIBGob"));
|
|
}
|
|
}
|
|
|
|
+
|
|
@GetMapping("/getWellBaseInfo")
|
|
@GetMapping("/getWellBaseInfo")
|
|
public BaseResponse getWellBaseInfo(String well_id) {
|
|
public BaseResponse getWellBaseInfo(String well_id) {
|
|
HashMap<String, Object> wellInfo = wellInfoService.getWellInfo(well_id);
|
|
HashMap<String, Object> wellInfo = wellInfoService.getWellInfo(well_id);
|
|
return RespGenerstor.success(wellInfo);
|
|
return RespGenerstor.success(wellInfo);
|
|
}
|
|
}
|
|
|
|
+
|
|
@GetMapping("/getWellInfo")
|
|
@GetMapping("/getWellInfo")
|
|
public BaseResponse getWellInfo(String well_id) {
|
|
public BaseResponse getWellInfo(String well_id) {
|
|
|
|
|
|
@@ -92,6 +97,16 @@ public class WellInfoController {
|
|
HashMap<String, Object> lastHistoryAssignment = wellInfoService.getLastHistoryAssignment(well_id);
|
|
HashMap<String, Object> lastHistoryAssignment = wellInfoService.getLastHistoryAssignment(well_id);
|
|
List<HashMap<String, Object>> dataIndexList = wellInfoService.selectDataIndexList(well_id);
|
|
List<HashMap<String, Object>> dataIndexList = wellInfoService.selectDataIndexList(well_id);
|
|
|
|
|
|
|
|
+ List<HashMap<String, Object>> userApplyFileList = applyFormService.selectApplyFormFileList(null, null, accountService.getLoginUserID());
|
|
|
|
+ dataIndexList.forEach(data -> {
|
|
|
|
+ boolean isApply = userApplyFileList.stream().filter(uf -> uf.get("well_common_name").toString().equals(data.get("well_common_name").toString())
|
|
|
|
+ && uf.get("file_name").toString().equals(data.get("file_name").toString())).count() > 0;
|
|
|
|
+ data.put("isApply", isApply);
|
|
|
|
+
|
|
|
|
+ boolean isDown = userApplyFileList.stream().filter(uf -> Integer.parseInt(uf.get("status").toString()) == 2 && uf.get("well_common_name").toString().equals(data.get("well_common_name").toString())
|
|
|
|
+ && uf.get("file_name").toString().equals(data.get("file_name").toString())).count() > 0;
|
|
|
|
+ data.put("isDown", isDown);
|
|
|
|
+ });
|
|
HashMap<String, Object> result = new HashMap<>();
|
|
HashMap<String, Object> result = new HashMap<>();
|
|
result.put("dataModel", wellInfo);
|
|
result.put("dataModel", wellInfo);
|
|
result.put("boreholeInterList", boreholeInterList);//业务解释列表
|
|
result.put("boreholeInterList", boreholeInterList);//业务解释列表
|
|
@@ -106,19 +121,21 @@ public class WellInfoController {
|
|
result.put("dataIndexList", dataIndexList);
|
|
result.put("dataIndexList", dataIndexList);
|
|
return RespGenerstor.success(result);
|
|
return RespGenerstor.success(result);
|
|
}
|
|
}
|
|
|
|
+
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@GetMapping("/getTestHistoryList")
|
|
@GetMapping("/getTestHistoryList")
|
|
public BaseResponse<PageInfo<HashMap<String, Object>>> getTestHistoryList(@RequestParam("page") int page, @RequestParam("rows") int rows,
|
|
public BaseResponse<PageInfo<HashMap<String, Object>>> getTestHistoryList(@RequestParam("page") int page, @RequestParam("rows") int rows,
|
|
- String well_id) throws Exception {
|
|
|
|
|
|
+ String well_id) throws Exception {
|
|
|
|
|
|
PageInfo<HashMap<String, Object>> result = wellInfoService.selectTestHistoryList(page, rows, well_id);
|
|
PageInfo<HashMap<String, Object>> result = wellInfoService.selectTestHistoryList(page, rows, well_id);
|
|
|
|
|
|
return RespGenerstor.success(result);
|
|
return RespGenerstor.success(result);
|
|
}
|
|
}
|
|
|
|
+
|
|
@ResponseBody
|
|
@ResponseBody
|
|
@GetMapping("/getAnalyticalAssaysList")
|
|
@GetMapping("/getAnalyticalAssaysList")
|
|
public BaseResponse<PageInfo<HashMap<String, Object>>> getAnalyticalAssaysList(@RequestParam("page") int page, @RequestParam("rows") int rows,
|
|
public BaseResponse<PageInfo<HashMap<String, Object>>> getAnalyticalAssaysList(@RequestParam("page") int page, @RequestParam("rows") int rows,
|
|
- String well_id) throws Exception {
|
|
|
|
|
|
+ String well_id) throws Exception {
|
|
|
|
|
|
PageInfo<HashMap<String, Object>> result = wellInfoService.selectAnalyticalAssaysList(page, rows, well_id);
|
|
PageInfo<HashMap<String, Object>> result = wellInfoService.selectAnalyticalAssaysList(page, rows, well_id);
|
|
|
|
|
|
@@ -146,6 +163,16 @@ public class WellInfoController {
|
|
@GetMapping("/getWellDocumentList")
|
|
@GetMapping("/getWellDocumentList")
|
|
public BaseResponse getWellDocumentList(String wellId) {
|
|
public BaseResponse getWellDocumentList(String wellId) {
|
|
List<HashMap<String, Object>> dataIndexList = wellInfoService.selectDataIndexList(wellId);
|
|
List<HashMap<String, Object>> dataIndexList = wellInfoService.selectDataIndexList(wellId);
|
|
|
|
+ List<HashMap<String, Object>> userApplyFileList = applyFormService.selectApplyFormFileList(null, null, accountService.getLoginUserID());
|
|
|
|
+ dataIndexList.forEach(data -> {
|
|
|
|
+ boolean isApply = userApplyFileList.stream().filter(uf -> uf.get("well_common_name").toString().equals(data.get("well_common_name").toString())
|
|
|
|
+ && uf.get("file_name").toString().equals(data.get("file_name").toString())).count() > 0;
|
|
|
|
+ data.put("isApply", isApply);
|
|
|
|
+
|
|
|
|
+ boolean isDown = userApplyFileList.stream().filter(uf -> Integer.parseInt(uf.get("status").toString()) == 2 && uf.get("well_common_name").toString().equals(data.get("well_common_name").toString())
|
|
|
|
+ && uf.get("file_name").toString().equals(data.get("file_name").toString())).count() > 0;
|
|
|
|
+ data.put("isDown", isDown);
|
|
|
|
+ });
|
|
return RespGenerstor.success(dataIndexList);
|
|
return RespGenerstor.success(dataIndexList);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -158,6 +185,7 @@ public class WellInfoController {
|
|
public BaseResponse getWellPurposeTree() {
|
|
public BaseResponse getWellPurposeTree() {
|
|
return RespGenerstor.success(wellInfoService.getWellPurposeTree());
|
|
return RespGenerstor.success(wellInfoService.getWellPurposeTree());
|
|
}
|
|
}
|
|
|
|
+
|
|
@GetMapping("/getWellTypeTree")
|
|
@GetMapping("/getWellTypeTree")
|
|
public BaseResponse getWellTypeTree() {
|
|
public BaseResponse getWellTypeTree() {
|
|
return RespGenerstor.success(wellInfoService.getWellTypeTree());
|
|
return RespGenerstor.success(wellInfoService.getWellTypeTree());
|
|
@@ -199,15 +227,16 @@ public class WellInfoController {
|
|
os.close();
|
|
os.close();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
private byte[] doc2Docx(byte[] bytes) {
|
|
private byte[] doc2Docx(byte[] bytes) {
|
|
long old = System.currentTimeMillis();
|
|
long old = System.currentTimeMillis();
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
try {
|
|
try {
|
|
- com.aspose.words.License aposeLic = new com.aspose.words.License();
|
|
|
|
|
|
+ com.aspose.words.License aposeLic = new com.aspose.words.License();
|
|
InputStream license = ClassLoader.getSystemClassLoader().getResourceAsStream("license.xml");
|
|
InputStream license = ClassLoader.getSystemClassLoader().getResourceAsStream("license.xml");
|
|
aposeLic.setLicense(license);
|
|
aposeLic.setLicense(license);
|
|
|
|
|
|
- com.aspose.words.Document wb = new com.aspose.words.Document(new ByteArrayInputStream(bytes));
|
|
|
|
|
|
+ com.aspose.words.Document wb = new com.aspose.words.Document(new ByteArrayInputStream(bytes));
|
|
|
|
|
|
wb.save(outputStream, SaveFormat.DOCX);
|
|
wb.save(outputStream, SaveFormat.DOCX);
|
|
bytes = outputStream.toByteArray();
|
|
bytes = outputStream.toByteArray();
|
|
@@ -222,11 +251,13 @@ public class WellInfoController {
|
|
outputStream.close();
|
|
outputStream.close();
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- } ;
|
|
|
|
|
|
+ }
|
|
|
|
+ ;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return bytes;
|
|
return bytes;
|
|
}
|
|
}
|
|
|
|
+
|
|
private byte[] xls2pdf(byte[] bytes) {
|
|
private byte[] xls2pdf(byte[] bytes) {
|
|
long old = System.currentTimeMillis();
|
|
long old = System.currentTimeMillis();
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
|
@@ -254,7 +285,8 @@ public class WellInfoController {
|
|
outputStream.close();
|
|
outputStream.close();
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- } ;
|
|
|
|
|
|
+ }
|
|
|
|
+ ;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return bytes;
|
|
return bytes;
|