Browse Source

Merge branch 'master' of http://47.114.101.16:7070/ssy/newcpms

km林芳旭 2 years ago
parent
commit
f0aa83d561

+ 20 - 6
master/src/main/java/com/ruoyi/project/production/controller/TSaiApplyController.java

@@ -252,6 +252,15 @@ public class TSaiApplyController extends BaseController
     @GetMapping("/export")
     public AjaxResult export(SaiApplyQueryVO tSaiApply)
     {
+        List<SysUser> userList = userService.selectUserList(new SysUser());
+        Map<Long, String> nameMap = new HashMap<Long, String>();
+        Map<Long, String> staffIdMap = new HashMap<Long, String>();
+        for (SysUser sysUser : userList) {
+            nameMap.put(sysUser.getUserId(), sysUser.getNickName());
+            staffIdMap.put(sysUser.getUserId(), sysUser.getStaffId());
+        }
+
+
         // 实体类集合
         List<TSaiApply> list = tSaiApplyService.selectTSaiApplyList(tSaiApply);
         // 导出VO集合
@@ -269,7 +278,8 @@ public class TSaiApplyController extends BaseController
             vo.setNo(no + "");
             vo.setPlantName(entity.getApplicantDeptName());
             vo.setStaffName(entity.getApplicantName());
-            vo.setStaffId(userService.selectUserById(Long.parseLong(entity.getApplicant())).getStaffId());
+//            vo.setStaffId(userService.selectUserById(Long.parseLong(entity.getApplicant())).getStaffId());
+            vo.setStaffId(staffIdMap.get(Long.parseLong(entity.getApplicant())));
             vo.setMonth((entity.getApplyDate().getMonth() + 1) + "");
             vo.setDate(entity.getApplyDate().getDate()+ "");
             for (SysDictData sysDictData : saiUnsafeStatusDict) {
@@ -292,19 +302,23 @@ public class TSaiApplyController extends BaseController
                 vo.setIsRecorded(isRecorded == 1L ? "是" : "否");
             }
             String inspectors = entity.getInspectors();
-            if (inspectors != null && !"".equals(inspectors)) {
+            if (inspectors != null && !"".equals(inspectors) && !"null".equals(inspectors)) {
                 if (inspectors.indexOf(",") != -1) {
                     String[] split = inspectors.split(",");
                     String inspectorName = "";
                     for (int i = 0; i < split.length; i++) {
-                        inspectorName += userService.selectUserById(Long.parseLong(split[i])).getNickName();
-                        if (i < split.length - 1) {
-                            inspectorName += ",";
+                        if (split[i] != null && !"null".equals(split[i])) {
+//                            inspectorName += userService.selectUserById(Long.parseLong(split[i])).getNickName();
+                            inspectorName += nameMap.get(Long.parseLong(split[i]));
+                            if (i < split.length - 1) {
+                                inspectorName += ",";
+                            }
                         }
                     }
                     vo.setInspectors(inspectorName);
                 } else {
-                    vo.setInspectors(userService.selectUserById(Long.parseLong(inspectors)).getNickName());
+//                    vo.setInspectors(userService.selectUserById(Long.parseLong(inspectors)).getNickName());
+                    vo.setInspectors(nameMap.get(Long.parseLong(inspectors)));
                 }
             }
             vo.setValidateDate(entity.getActualFinishDate());

+ 6 - 6
master/src/main/java/com/ruoyi/project/production/service/impl/TDailyProductionReportServiceImpl.java

@@ -415,9 +415,9 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setPguAeuLossPercentage(this.roundDecimal(this.getCellDataString(sheet, 39, 18), 2));
             // rowIndex = 40
             String totalLoss = this.roundDecimal(this.getCellDataString(sheet, 40, 2), 0);
-            if (totalLoss.indexOf("-") != -1) {
-                totalLoss = totalLoss.substring(1);
-            }
+//            if (totalLoss.indexOf("-") != -1) {
+//                totalLoss = totalLoss.substring(1);
+//            }
             tDailyProductionReport.setTotalLoss(totalLoss);
             tDailyProductionReport.setPguOffgasProduced(this.roundDecimal(this.getCellDataString(sheet, 40, 10), 0));
             tDailyProductionReport.setPguOffgasChange(this.roundDecimal(this.getCellDataString(sheet, 40, 11), 0));
@@ -426,9 +426,9 @@ public class TDailyProductionReportServiceImpl implements ITDailyProductionRepor
             tDailyProductionReport.setPguAeuFeedLoadPercentage(this.roundPercentage(this.getCellDataString(sheet, 40, 18), 2));
             // rowIndex = 41
             String lossPercentage = this.roundDecimal(this.getCellDataString(sheet, 41, 2), 3);
-            if (lossPercentage.indexOf("-") != -1) {
-                lossPercentage = lossPercentage.substring(1);
-            }
+//            if (lossPercentage.indexOf("-") != -1) {
+//                lossPercentage = lossPercentage.substring(1);
+//            }
             tDailyProductionReport.setLossPercentage(lossPercentage);
             tDailyProductionReport.setPguTotalFeed(this.roundDecimal(this.getCellDataString(sheet, 41, 6), 0));
             tDailyProductionReport.setPguC5YeildPercentage(this.roundPercentage(this.getCellDataString(sheet, 41, 10), 2));

+ 35 - 6
master/src/main/java/com/ruoyi/project/production/service/impl/TSaiApplyServiceImpl.java

@@ -1,6 +1,9 @@
 package com.ruoyi.project.production.service.impl;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
@@ -14,6 +17,7 @@ import com.ruoyi.project.system.mapper.SysUserMapper;
 import com.ruoyi.project.system.mapper.SysUserRoleMapper;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ISysRoleService;
+import com.ruoyi.project.system.service.ISysUserService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.production.mapper.TSaiApplyMapper;
@@ -47,6 +51,9 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
     @Autowired
     private SysUserRoleMapper userRoleMapper;
 
+    @Autowired
+    private ISysUserService userService;
+
     /**
      * 查询SAI开项管理
      *
@@ -72,6 +79,12 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
     @Override
     public List<TSaiApply> selectTSaiApplyList(SaiApplyQueryVO tSaiApply)
     {
+        List<SysUser> userList = userService.selectUserList(new SysUser());
+        Map<Long, String> nameMap = new HashMap<Long, String>();
+        for (SysUser sysUser : userList) {
+            nameMap.put(sysUser.getUserId(), sysUser.getNickName());
+        }
+
         List<TSaiApply> tSaiApplies = tSaiApplyMapper.selectTSaiApplyList(tSaiApply);
         List<SysDictData> staffUnitDict = iSysDictTypeService.selectDictDataByType("STAFF_UNIT");
         for (TSaiApply saiApply : tSaiApplies) {
@@ -87,25 +100,41 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
                 }
             }
             if (applicant != null) {
-                saiApply.setApplicantName(sysUserMapper.selectUserById(Long.parseLong(applicant)).getNickName());
+//                saiApply.setApplicantName(sysUserMapper.selectUserById(Long.parseLong(applicant)).getNickName());
+                String applicantName = nameMap.get(Long.parseLong(applicant));
+                if (applicantName != null && !"null".equals(applicantName)) {
+                    saiApply.setApplicantName(applicantName);
+                }
             }
             if (handler != null) {
                 if (handler.indexOf(",") != -1) {
                     String[] split = handler.split(",");
                     String handlerName = "";
                     for (int i = 0; i < split.length; i++) {
-                        handlerName += sysUserMapper.selectUserById(Long.parseLong(split[i])).getNickName();
-                        if (i < split.length - 1) {
-                            handlerName += ",";
+//                        handlerName += sysUserMapper.selectUserById(Long.parseLong(split[i])).getNickName();
+                        String name = nameMap.get(Long.parseLong(split[i]));
+                        if (name != null && !"null".equals(name)) {
+                            handlerName += name;
+                            if (i < split.length - 1) {
+                                handlerName += ",";
+                            }
                         }
                     }
                     saiApply.setHandlerName(handlerName);
                 } else {
-                    saiApply.setHandlerName(sysUserMapper.selectUserById(Long.parseLong(handler)).getNickName());
+//                    saiApply.setHandlerName(sysUserMapper.selectUserById(Long.parseLong(handler)).getNickName());
+                    String handlerName = nameMap.get(Long.parseLong(handler));
+                    if (handlerName != null && !"null".equals(handlerName)) {
+                        saiApply.setHandlerName(handlerName);
+                    }
                 }
             }
             if (executor != null) {
-                saiApply.setExecutorName(sysUserMapper.selectUserById(Long.parseLong(executor)).getNickName());
+//                saiApply.setExecutorName(sysUserMapper.selectUserById(Long.parseLong(executor)).getNickName());
+                String executorName = nameMap.get(Long.parseLong(executor));
+                if (executorName != null && !"null".equals(executorName)) {
+                    saiApply.setExecutorName(executorName);
+                }
             }
         }
         boolean specialRole = this.isSpecialRole();

+ 20 - 20
ui/src/views/login.vue

@@ -193,7 +193,7 @@ export default {
     },
     /** Azure登录 */
     doAzureLogin() {
-      console.log("===> login.vue doAzureLogin()方法开始执行")
+      // console.log("===> login.vue doAzureLogin()方法开始执行")
       // 1. authorize请求链接
       // https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/authorize
 
@@ -209,46 +209,46 @@ export default {
 
       // window.location.href = 'https://login.microsoftonline.com/7503e40a-97ec-4eb9-bf6d-2836e57e882d/oauth2/v2.0/authorize?client_id=3db6f125-db4d-456b-a76e-a6d03182e845&redirect_uri=http%3A%2F%2Flocalhost%2Fcpms%2Findex.html&scope=api://3db6f125-db4d-456b-a76e-a6d03182e845/User.Read&response_type=code';
       window.location.href = 'https://login.microsoftonline.com/ecaa386b-c8df-4ce0-ad01-740cbdb5ba55/oauth2/v2.0/authorize?client_id=13848745-b09e-4105-a48b-180c0c9d13fd&redirect_uri=https%3A%2F%2Fcpms.basf-ypc.net.cn%2Fcpms%2Findex.html&scope=openid%20profile&response_type=code';
-      console.log("===> login.vue doAzureLogin()方法执行结束")
+      // console.log("===> login.vue doAzureLogin()方法执行结束")
       },
     /** Azure登录跳转 */
     toggleAzureLogin() {
-      console.log("===> login.vue toggleAzureLogin()方法开始执行")
+      // console.log("===> login.vue toggleAzureLogin()方法开始执行")
       let code = window.location.search.replace("?code=" , '');
-      console.log("code:");
-      console.log(code);
+      // console.log("code:");
+      // console.log(code);
       let messageIndex = code.indexOf("message");
-      console.log("messageIndex:");
-      console.log(messageIndex);
+      // console.log("messageIndex:");
+      // console.log(messageIndex);
       if (messageIndex == -1) { // url不包含message参数
         if (code) { // url包含code参数
           // authorization_code
           code = code.substring(0, code.indexOf("&"));
-          console.log("===> messageIndex == -1");
-          console.log("code:");
-          console.log(code);
+          // console.log("===> messageIndex == -1");
+          // console.log("code:");
+          // console.log(code);
           // redirect_url
           window.location.href = '#/azureLogin?code='+code;
         }
       } else {
-        console.log("===> messageIndex != -1");
+        // console.log("===> messageIndex != -1");
         // 解决中文参数乱码问题
         let questionMarkSplitStrings = decodeURI(window.location.href).split("?");
-        console.log("questionMarkSplitStrings:");
-        console.log(questionMarkSplitStrings);
+        // console.log("questionMarkSplitStrings:");
+        // console.log(questionMarkSplitStrings);
         let hashTagSplitStrings = questionMarkSplitStrings[1].split("#");
-        console.log("hashTagSplitStrings:");
-        console.log(hashTagSplitStrings);
+        // console.log("hashTagSplitStrings:");
+        // console.log(hashTagSplitStrings);
         let equalSignSplitStrings = hashTagSplitStrings[0].split("=");
-        console.log("equalSignSplitStrings:");
-        console.log(equalSignSplitStrings);
+        // console.log("equalSignSplitStrings:");
+        // console.log(equalSignSplitStrings);
         // ajax error message
         let message = equalSignSplitStrings[1];
-        console.log("message:");
-        console.log(message);
+        // console.log("message:");
+        // console.log(message);
         this.msgError(message + ",请联系管理员");
       }
-      console.log("===> login.vue toggleAzureLogin()方法执行结束")
+      // console.log("===> login.vue toggleAzureLogin()方法执行结束")
     },
   }
 };

+ 5 - 2
ui/src/views/monitor/elec/center.vue

@@ -274,8 +274,11 @@ export default {
       let data = this.latest24HourData;
       for (let i = 0; i < data.length; i++) {
         if (i % 4 == 0) {
-          hourArray.push(data[i].pullDate.toString().substr(14, 5));
-          carbonArray.push(data[i].carbonRealTime);
+          let dateString = data[i].pullDate.toString().substr(
+            data[i].pullDate.toString().indexOf("T") + 1, 
+            data[i].pullDate.toString().indexOf(".000") - data[i].pullDate.toString().indexOf("T") - 4);
+          hourArray.push(dateString);
+          carbonArray.push(data[i].carbonRealTime=="#VALUE!"?"0":data[i].carbonRealTime);
         }
       }
       hourArray.reverse();

+ 0 - 2
ui/src/views/monitor/elec/centerLeft1.vue

@@ -186,7 +186,6 @@ export default {
       });
     },
     initOneChart() {
-      console.log(this.latest30DayData);
       // 基于准备好的dom,初始化echarts实例
       this.chart = this.echarts.init(document.getElementById('oneGTGyChart'))
       const dateDay = [];
@@ -255,7 +254,6 @@ export default {
       })
     },
     initOneChartDialog() {
-      console.log("====")
       // 基于准备好的dom,初始化echarts实例
       this.chart1 = this.echarts.init(document.getElementById('oneGTGyChart1'))
       const dateDay = [];

+ 4 - 1
ui/src/views/monitor/elec/echart/bottom/bottomRightChart.vue

@@ -265,7 +265,10 @@ export default {
         if (i == 0) {
           latestDate = data[i].pullDate.toString().substr(5, 5);
         } else if (latestDate == data[i].pullDate.toString().substr(5, 5)) {
-          hourArray.push(data[i].pullDate.toString().substr(14, 5));
+          let dateString = data[i].pullDate.toString().substr(
+            data[i].pullDate.toString().indexOf("T") + 1, 
+            data[i].pullDate.toString().indexOf(".000") - data[i].pullDate.toString().indexOf("T") - 4);
+          hourArray.push(dateString);
           gasArray.push(data[i].gasUsed);
         }
       }

+ 0 - 1
ui/src/views/monitor/elec/elecindex.vue

@@ -587,7 +587,6 @@ export default {
       let { width, height } = this;
       let wh = window.innerHeight / height;
       let ww = window.innerWidth / width;
-      console.log(ww < wh ? ww : wh);
       return ww < wh ? ww : wh;
     },
     setScale() {

+ 0 - 2
ui/src/views/monitor/elecNew/centerLeft1.vue

@@ -186,7 +186,6 @@ export default {
       });
     },
     initOneChart() {
-      console.log(this.latest30DayData);
       // 基于准备好的dom,初始化echarts实例
       this.chart = this.echarts.init(document.getElementById('oneGTGyChart'))
       const dateDay = [];
@@ -255,7 +254,6 @@ export default {
       })
     },
     initOneChartDialog() {
-      console.log("====")
       // 基于准备好的dom,初始化echarts实例
       this.chart1 = this.echarts.init(document.getElementById('oneGTGyChart1'))
       const dateDay = [];

+ 0 - 1
ui/src/views/monitor/elecNew/elecindex.vue

@@ -587,7 +587,6 @@ export default {
       let { width, height } = this;
       let wh = window.innerHeight / height;
       let ww = window.innerWidth / width;
-      console.log(ww < wh ? ww : wh);
       return ww < wh ? ww : wh;
     },
     setScale() {

+ 2 - 2
ui/src/views/production/daily/index.vue

@@ -1263,7 +1263,7 @@
           <tr>
             <td class="bg-blue-light" colspan="2">Total loss</td>
             <td class="bg-yellow-light" @click="openDialog('total_loss', 'Total loss')">
-              <span v-if="!updating">{{reportData.totalLoss}}</span>
+              <span v-if="!updating">{{reportData.totalLoss}}</span>
               <el-input v-if="updating" size="mini" v-model="reportData.totalLoss"/>
             </td>
             <td class="no-border" colspan="6"></td>
@@ -1296,7 +1296,7 @@
           <tr>
             <td class="bg-blue-light" colspan="2">loss%</td>
             <td class="bg-yellow-light" @click="openDialog('loss_percentage', 'loss%')">
-              <span v-if="!updating">{{reportData.lossPercentage}}</span>
+              <span v-if="!updating">{{reportData.lossPercentage}}</span>
               <el-input v-if="updating" size="mini" v-model="reportData.lossPercentage"/>
             </td>
             <td class="no-border" colspan="2"></td>