|
@@ -2,47 +2,29 @@ package com.ruoyi.project.sems.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
-import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
|
-import com.ruoyi.common.utils.document.DocumentHandler;
|
|
|
|
-import com.ruoyi.common.utils.document.PDFTemplateUtil;
|
|
|
|
|
|
+import com.ruoyi.common.utils.StringUtils;
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
|
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
|
|
import com.ruoyi.framework.web.controller.BaseController;
|
|
import com.ruoyi.framework.web.controller.BaseController;
|
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
|
import com.ruoyi.framework.web.domain.AjaxResult;
|
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
|
import com.ruoyi.framework.web.page.TableDataInfo;
|
|
-import com.ruoyi.project.approve.damain.DevTask;
|
|
|
|
-import com.ruoyi.project.listener.semsApprove.*;
|
|
|
|
import com.ruoyi.project.sems.domain.*;
|
|
import com.ruoyi.project.sems.domain.*;
|
|
-import com.ruoyi.project.sems.mapper.TApproveMapper;
|
|
|
|
import com.ruoyi.project.sems.service.*;
|
|
import com.ruoyi.project.sems.service.*;
|
|
import com.ruoyi.project.system.domain.SysDictData;
|
|
import com.ruoyi.project.system.domain.SysDictData;
|
|
import com.ruoyi.project.system.domain.SysPlant;
|
|
import com.ruoyi.project.system.domain.SysPlant;
|
|
-import com.ruoyi.project.system.domain.SysUser;
|
|
|
|
import com.ruoyi.project.system.service.ISysDictTypeService;
|
|
import com.ruoyi.project.system.service.ISysDictTypeService;
|
|
import com.ruoyi.project.system.service.ISysPlantService;
|
|
import com.ruoyi.project.system.service.ISysPlantService;
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
import com.ruoyi.project.system.service.ISysUserService;
|
|
-import freemarker.template.Template;
|
|
|
|
-import org.activiti.engine.*;
|
|
|
|
-import org.activiti.engine.history.HistoricProcessInstance;
|
|
|
|
-import org.activiti.engine.history.HistoricTaskInstance;
|
|
|
|
-import org.activiti.engine.history.HistoricTaskInstanceQuery;
|
|
|
|
-import org.activiti.engine.impl.identity.Authentication;
|
|
|
|
-import org.activiti.engine.runtime.ProcessInstance;
|
|
|
|
-import org.activiti.engine.task.Comment;
|
|
|
|
-import org.activiti.engine.task.Task;
|
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
|
|
|
+import org.activiti.engine.HistoryService;
|
|
|
|
+import org.activiti.engine.RuntimeService;
|
|
|
|
+import org.activiti.engine.TaskService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
-import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
-import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
-import javax.servlet.http.HttpServletResponse;
|
|
|
|
-import java.io.IOException;
|
|
|
|
-import java.io.OutputStream;
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.text.DecimalFormat;
|
|
import java.text.DecimalFormat;
|
|
-import java.text.SimpleDateFormat;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -113,43 +95,43 @@ public class SpecHomeController extends BaseController
|
|
|
|
|
|
);
|
|
);
|
|
//查询管道长度
|
|
//查询管道长度
|
|
- List<TSpecdevYlgd> gdList = tSpecdevYlgdService.list(new QueryWrapper<TSpecdevYlgd>()
|
|
|
|
- .eq("STATUS" , 1)
|
|
|
|
- .eq("del_flag" , 0)
|
|
|
|
- .in("plant_code",plantIds)
|
|
|
|
-// .in("unit",unitIds)
|
|
|
|
-// .eq(!StringUtils.isBlank((String)params.get("plantName")) , "plant_code" ,params.get("plantName"))
|
|
|
|
-// .and(unitIds.size()>0 ,i -> i.in("unit",unitIds).or().in("plant_code",unitIds).or().isNull("unit"))
|
|
|
|
- );
|
|
|
|
- double allLength = 0;
|
|
|
|
- for (int i = 0; i < gdList.size(); i++) {
|
|
|
|
- double gdLength = 0;
|
|
|
|
- if (!StringUtils.isBlank(gdList.get(i).getLength())) {
|
|
|
|
- if (gdList.get(i).getLength().indexOf("\n") > -1) {
|
|
|
|
- String[] arr = gdList.get(i).getLength().split("\n");
|
|
|
|
- for (int j = 0; j < arr.length; j++) {
|
|
|
|
- try {
|
|
|
|
- gdLength += Double.parseDouble(arr[j]);
|
|
|
|
- }catch (NumberFormatException e) {
|
|
|
|
- logger.error(JSON.toJSONString(e));
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }else {
|
|
|
|
- try {
|
|
|
|
- gdLength = Double.parseDouble(gdList.get(i).getLength());
|
|
|
|
- }catch (NumberFormatException e) {
|
|
|
|
- logger.error(JSON.toJSONString(e));
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- allLength += gdLength;
|
|
|
|
- }
|
|
|
|
- DecimalFormat df = new DecimalFormat("0.00#");
|
|
|
|
- System.out.println(df.format(allLength));
|
|
|
|
|
|
+// List<TSpecdevYlgd> gdList = tSpecdevYlgdService.list(new QueryWrapper<TSpecdevYlgd>()
|
|
|
|
+// .eq("STATUS" , 1)
|
|
|
|
+// .eq("del_flag" , 0)
|
|
|
|
+// .in("plant_code",plantIds)
|
|
|
|
+//// .in("unit",unitIds)
|
|
|
|
+//// .eq(!StringUtils.isBlank((String)params.get("plantName")) , "plant_code" ,params.get("plantName"))
|
|
|
|
+//// .and(unitIds.size()>0 ,i -> i.in("unit",unitIds).or().in("plant_code",unitIds).or().isNull("unit"))
|
|
|
|
+// );
|
|
|
|
+// double allLength = 0;
|
|
|
|
+// for (int i = 0; i < gdList.size(); i++) {
|
|
|
|
+// double gdLength = 0;
|
|
|
|
+// if (!StringUtils.isBlank(gdList.get(i).getLength())) {
|
|
|
|
+// if (gdList.get(i).getLength().indexOf("\n") > -1) {
|
|
|
|
+// String[] arr = gdList.get(i).getLength().split("\n");
|
|
|
|
+// for (int j = 0; j < arr.length; j++) {
|
|
|
|
+// try {
|
|
|
|
+// gdLength += Double.parseDouble(arr[j]);
|
|
|
|
+// }catch (NumberFormatException e) {
|
|
|
|
+// logger.error(JSON.toJSONString(e));
|
|
|
|
+// continue;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }else {
|
|
|
|
+// try {
|
|
|
|
+// gdLength = Double.parseDouble(gdList.get(i).getLength());
|
|
|
|
+// }catch (NumberFormatException e) {
|
|
|
|
+// logger.error(JSON.toJSONString(e));
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+// allLength += gdLength;
|
|
|
|
+// }
|
|
|
|
+ //DecimalFormat df = new DecimalFormat("0.00#");
|
|
|
|
+ //System.out.println(df.format(allLength));
|
|
Map<String, Object> mapylgd = new HashMap<String, Object>();
|
|
Map<String, Object> mapylgd = new HashMap<String, Object>();
|
|
mapylgd.put("ylgdAll_num", ylgdAll);
|
|
mapylgd.put("ylgdAll_num", ylgdAll);
|
|
- mapylgd.put("ylgd_length", df.format(allLength));
|
|
|
|
|
|
+ //mapylgd.put("ylgd_length", df.format(allLength));
|
|
//压力容器
|
|
//压力容器
|
|
int ylrqAll = tSpecdevYlrqService.count(new QueryWrapper<TSpecdevYlrq>()
|
|
int ylrqAll = tSpecdevYlrqService.count(new QueryWrapper<TSpecdevYlrq>()
|
|
.eq("STATUS" , 1)
|
|
.eq("STATUS" , 1)
|
|
@@ -219,6 +201,47 @@ public class SpecHomeController extends BaseController
|
|
return AjaxResult.success(res);
|
|
return AjaxResult.success(res);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @RequestMapping(value="ylgcLength")
|
|
|
|
+ public AjaxResult sumYlgcLength(@RequestBody Map<String, Object> params){
|
|
|
|
+ List plantIds = (List) params.get("plantIds");
|
|
|
|
+// 查询管道长度
|
|
|
|
+ List<TSpecdevYlgd> gdList = tSpecdevYlgdService.list(new QueryWrapper<TSpecdevYlgd>()
|
|
|
|
+ .eq("STATUS" , 1)
|
|
|
|
+ .eq("del_flag" , 0)
|
|
|
|
+ .in("plant_code",plantIds)
|
|
|
|
+// .in("unit",unitIds)
|
|
|
|
+// .eq(!StringUtils.isBlank((String)params.get("plantName")) , "plant_code" ,params.get("plantName"))
|
|
|
|
+// .and(unitIds.size()>0 ,i -> i.in("unit",unitIds).or().in("plant_code",unitIds).or().isNull("unit"))
|
|
|
|
+ );
|
|
|
|
+ double allLength = 0;
|
|
|
|
+ for (int i = 0; i < gdList.size(); i++) {
|
|
|
|
+ double gdLength = 0;
|
|
|
|
+ if (!StringUtils.isBlank(gdList.get(i).getLength())) {
|
|
|
|
+ if (gdList.get(i).getLength().indexOf("\n") > -1) {
|
|
|
|
+ String[] arr = gdList.get(i).getLength().split("\n");
|
|
|
|
+ for (int j = 0; j < arr.length; j++) {
|
|
|
|
+ try {
|
|
|
|
+ gdLength += Double.parseDouble(arr[j]);
|
|
|
|
+ }catch (NumberFormatException e) {
|
|
|
|
+ logger.error(JSON.toJSONString(e));
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ try {
|
|
|
|
+ gdLength = Double.parseDouble(gdList.get(i).getLength());
|
|
|
|
+ }catch (NumberFormatException e) {
|
|
|
|
+ logger.error(JSON.toJSONString(e));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ allLength += gdLength;
|
|
|
|
+ }
|
|
|
|
+ DecimalFormat df = new DecimalFormat("0.00#");
|
|
|
|
+ System.out.println(df.format(allLength));
|
|
|
|
+ return AjaxResult.success(df.format(allLength));
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 压力容器数据
|
|
* 压力容器数据
|
|
*/
|
|
*/
|