Sfoglia il codice sorgente

Merge remote-tracking branch 'origin/master'

wangggziwen 2 anni fa
parent
commit
9fd405cfff

+ 39 - 17
master/src/main/java/com/ruoyi/project/ehs/controller/TJobticketController.java

@@ -1,18 +1,19 @@
 package com.ruoyi.project.ehs.controller;
 
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
 import com.alibaba.fastjson.JSON;
-import com.deepoove.poi.data.Pictures;
-import com.deepoove.poi.data.Texts;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SpringContextUtils;
 import com.ruoyi.common.utils.file.ExcelUtils;
+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.domain.AjaxResult;
+import com.ruoyi.framework.web.page.TableDataInfo;
 import com.ruoyi.project.common.domain.DataEntity;
-import com.ruoyi.project.ehs.domain.TFirestandpipe;
+import com.ruoyi.project.ehs.domain.TJobticket;
 import com.ruoyi.project.ehs.mapper.TJobticketMapper;
+import com.ruoyi.project.ehs.service.ITJobticketService;
 import com.ruoyi.project.invoice.domain.TInvoiceWorkcontent;
 import com.ruoyi.project.system.domain.SysDept;
 import com.ruoyi.project.system.domain.SysDictData;
@@ -21,21 +22,19 @@ import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ISysUserService;
 import org.apache.commons.lang.StringUtils;
-import org.apache.poi.ss.usermodel.*;
-import org.springframework.security.access.prepost.PreAuthorize;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
-import com.ruoyi.framework.aspectj.lang.annotation.Log;
-import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
-import com.ruoyi.project.ehs.domain.TJobticket;
-import com.ruoyi.project.ehs.service.ITJobticketService;
-import com.ruoyi.framework.web.controller.BaseController;
-import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.framework.web.page.TableDataInfo;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
+import java.io.IOException;
+import java.text.SimpleDateFormat;
+import java.util.*;
 
 /**
  * 工作票Controller
@@ -98,6 +97,29 @@ public class TJobticketController extends BaseController {
         return list;
     }
 
+    //情况统计
+    @GetMapping("/statusData")
+    public List<DataEntity> statusData(Map param) {
+        param.put("params", new HashMap<>());
+        List<DataEntity> list = tJobticketMapper.selectStatusData(param);
+        List<SysDictData> dictList = iSysDictTypeService.selectDictDataByType("ZYPZT");
+        for (DataEntity d : list
+        ) {
+            for (SysDictData s : dictList
+            ) {
+                if (StringUtils.isBlank(d.getDataName())) {
+                    d.setDataName("未知");
+                    break;
+                }
+                if (s.getDictValue().equals(d.getDataName())) {
+                    d.setDataName(s.getDictLabel());
+                    break;
+                }
+            }
+        }
+        return list;
+    }
+
     /**
      * 导出工作票列表
      */

+ 4 - 3
master/src/main/java/com/ruoyi/project/ehs/mapper/TJobticketMapper.java

@@ -1,12 +1,12 @@
 package com.ruoyi.project.ehs.mapper;
 
-import java.util.List;
-import java.util.Map;
-
 import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
 import com.ruoyi.project.common.domain.DataEntity;
 import com.ruoyi.project.ehs.domain.TJobticket;
 
+import java.util.List;
+import java.util.Map;
+
 /**
  * 工作票Mapper接口
  *
@@ -71,6 +71,7 @@ public interface TJobticketMapper
     public int deleteTJobticketByIds(Long[] ids);
 
     List<DataEntity> selectFireData(Map param);
+    List<DataEntity> selectStatusData(Map param);
 
     /**
      * 查询是否重复记录数

+ 2 - 2
master/src/main/java/com/ruoyi/project/listener/invoiceApprove/InvoiceEndFailListener.java

@@ -63,7 +63,7 @@ public class InvoiceEndFailListener implements Serializable, ExecutionListener {
                     "<font color=\"#333333\" style=\"line-height: 20px; \"><font style=\"line-height: 22px; \" size=\"4\">" +
                     "亲爱的 username(loginName)</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
                     "Dear usernameEN(loginName)</font></font></h2>" +
-                    "<p>您的申请已作废<br>" +
+                    "<p><b>您的申请已作废</b><br>" +
                     "Your application has been voided:<br>" +
                     "任务名:<b>预约开票审批流程</b><br>" +
                     "Task Name: <b>Approval process of booking invoicing</b><br>" +
@@ -88,7 +88,7 @@ public class InvoiceEndFailListener implements Serializable, ExecutionListener {
             //拼接html
             String html = start + prime + end;
             logger.info("html:" + html);
-            mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:Your application has been voided (" + apNo + ")", html);
+            mailService.sendHtmlMail(email, "预约开票:您的申请已作废 Reserve Invoice:Your application has been voided (" + apNo + ")", html);
         }catch (Exception e) {
             logger.error("邮件发送失败" + JSON.toJSONString(e));
         }

+ 2 - 2
master/src/main/java/com/ruoyi/project/listener/invoiceApprove/InvoiceEndSuccessListener.java

@@ -79,7 +79,7 @@ public class InvoiceEndSuccessListener implements Serializable, ExecutionListene
                     "<font color=\"#333333\" style=\"line-height: 20px; \"><font style=\"line-height: 22px; \" size=\"4\">" +
                     "亲爱的 username(loginName)</font><br><font style=\"line-height: 22px; \" size=\"4\">" +
                     "Dear usernameEN(loginName)</font></font></h2>" +
-                    "<p>您的审批已完成<br>" +
+                    "<p><b>您的审批已完成</b><br>" +
                     "You have a new to-do task:<br>" +
                     "任务名:<b>预约开票审批流程</b><br>" +
                     "Task Name: <b>Approval process of booking invoicing</b><br>" +
@@ -104,7 +104,7 @@ public class InvoiceEndSuccessListener implements Serializable, ExecutionListene
             //拼接html
             String html = start + prime + end;
             logger.info("html:" + html);
-            mailService.sendHtmlMail(email, "预约开票:您有一个新的待办任务 Reserve Invoice:You have a new to-do task (" + apNo + ")", html);
+            mailService.sendHtmlMail(email, "预约开票:您的申请已完成审批 Reserve Invoice:Your application has been approved (" + apNo + ")", html);
         }catch (Exception e) {
             logger.error("邮件发送失败" + JSON.toJSONString(e));
         }

+ 11 - 0
master/src/main/resources/mybatis/ehs/TJobticketMapper.xml

@@ -271,4 +271,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         GROUP BY HPJB
         order by dataName
     </select>
+
+    <select id="selectStatusData" resultType="com.ruoyi.project.common.domain.DataEntity">
+        SELECT count(1) as dataNum,d.ZYPZT as dataName FROM t_jobticket d
+        <where>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        GROUP BY ZYPZT
+        order by dataName
+    </select>
 </mapper>

+ 6 - 0
ui/src/api/ehs/jobticket.js

@@ -16,6 +16,12 @@ export function fireData(query) {
     method: 'get',
     params: query
   })
+}export function statusData(query) {
+  return request({
+    url: '/ehs/jobticket/statusData',
+    method: 'get',
+    params: query
+  })
 }
 
 // 查询工作票详细

+ 25 - 11
ui/src/views/ehs/jobticket/index.vue

@@ -26,16 +26,17 @@
           />
         </el-select>
       </el-form-item>
-      <!--      <el-form-item :label="$t('新票/续票')" label-width="50" prop="xpxp">-->
-      <!--        <el-select v-model="queryParams.xpxp" :placeholder="$t('请选择') + $t('新票/续票')" clearable size="small" @change="handleQuery">-->
-      <!--          <el-option-->
-      <!--            v-for="dict in xpxpOptions"-->
-      <!--            :key="dict.dictValue"-->
-      <!--            :label="dict.dictLabel"-->
-      <!--            :value="dict.dictValue"-->
-      <!--          />-->
-      <!--        </el-select>-->
-      <!--      </el-form-item>-->
+      <el-form-item :label="$t('新票/续票')" label-width="50" prop="xpxp">
+        <el-select v-model="queryParams.xpxp" :placeholder="$t('请选择') + $t('新票/续票')" clearable size="small"
+                   @change="handleQuery">
+          <el-option
+            v-for="dict in xpxpOptions"
+            :key="dict.dictValue"
+            :label="dict.dictLabel"
+            :value="dict.dictValue"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item label="延期许可证号" prop="yqxkzh">
         <el-input
           v-model="queryParams.yqxkzh"
@@ -541,6 +542,18 @@
           </el-card>
         </el-col>
       </el-row>
+      <el-row>
+        <el-col>
+          <el-card class="box-card" shadow="hover">
+            <div slot="header" class="clearfix">
+              <span>{{ this.$t('作业票状态统计') }}</span>
+            </div>
+            <div class="text item">
+              <status-data></status-data>
+            </div>
+          </el-card>
+        </el-col>
+      </el-row>
     </el-drawer>
     <el-dialog title="延期作业许可" :visible.sync="guanlianVisible" width="30%" center>
       <el-form ref="form" :model="postponeform" :rules="rules1" label-width="80px">
@@ -596,11 +609,12 @@ import {getToken} from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import FireData from "./fireData";
+import StatusData from "./statusData";
 import {listTagAll} from "@/api/invoice/tag";
 
 export default {
   name: "Jobticket",
-  components: {FireData, Treeselect},
+  components: {FireData, Treeselect,StatusData},
   data() {
     return {
       //新票新增

+ 104 - 0
ui/src/views/ehs/jobticket/statusData.vue

@@ -0,0 +1,104 @@
+<template>
+  <div>
+    <div id="statusChart" :style="{width:width,height:height}"></div>
+  </div>
+</template>
+
+<script>
+  import { statusData } from "@/api/ehs/jobticket";
+  import mychart from "core-js/internals/task";
+
+  export default {
+    props: {
+      width: {
+        type: String,
+        default: '100%'
+      },
+      height: {
+        type: String,
+        default: '200px'
+      },
+    },
+    data() {
+      return {
+        option: {
+          title: {
+            left: 'center'
+          },
+          tooltip: {
+            trigger: 'item',
+            formatter: '{a} <br/>{b} : {c} ({d}%)'
+          },
+          legend: {
+            orient: 'horizontal',
+            top:'bottom',
+            data: []
+          },
+          toolbox: {
+            show: true,
+            feature: {
+              mark: {show: true},
+              magicType: {
+                show: true,
+                type: ['pie', 'funnel']
+              },
+              restore: {show: true},
+              saveAsImage: {show: true}
+            }
+          },
+          series: [
+            {
+              label: {
+                formatter: '{b}: ({d}%)'
+              },
+              name: this.$t('作业票状态'),
+              type: 'pie',
+              radius: ['40%', '60%'],
+              selectedMode: 'single',
+              data: [
+                {value: 335, name: this.$t('直接访问')},
+              ],
+              emphasis: {
+                label: {
+                  show: true,
+                  fontSize: '21',
+                  fontWeight: 'bold'
+                }
+              },
+            }
+          ]
+        },
+
+        // 查询参数
+        queryParams: {
+          item: 1,
+        },
+        chart: null,
+        chartData : []
+      }
+    },
+    mounted() {
+      this.$nextTick(() => {
+        statusData(this.queryParams).then(response => {
+          this.chartData = response;
+          for(let i = 0 ; i <this.chartData.length ; i++){
+            this.option.legend.data[i] = this.chartData[i].dataName
+            this.option.series[0].data[i] = {value:this.chartData[i].dataNum , name: this.chartData[i].dataName }
+          }
+          this.initChart()
+        });
+      })
+    },
+    methods: {
+      /** 获取当前年份 */
+      getNowTime() {
+        var now = new Date();
+      },
+      initChart() {
+        // 基于准备好的dom,初始化echarts实例
+        this.chart = this.echarts.init(document.getElementById('statusChart'))
+        this.chart.setOption(this.option)
+      }
+    }
+  }
+</script>