ly 2 жил өмнө
parent
commit
9456cf4711

+ 66 - 4
master/src/main/java/com/ruoyi/project/common/controller/CBPSHomeDataController.java

@@ -45,15 +45,77 @@ public class CBPSHomeDataController extends BaseController {
 
     @GetMapping("/countNum")
     public AjaxResult getCountNum() {
-        List<TSafetyapproval> safeList = tSafetyapprovalService.selectTSafetyapprovalList(new TSafetyapproval());
-        List<TFireapproval> fireList = tFireapprovalService.selectTFireapprovalList(new TFireapproval());
-        List<TEnvironapproval> envList = tEnvironapprovalService.selectTEnvironapprovalList(new TEnvironapproval());
-        List<THealthapproval> healthList = tHealthapprovalService.selectTHealthapprovalList(new THealthapproval());
         HashMap<String, Integer> result = new HashMap<>();
+        List<TSafetyapproval> safeList = tSafetyapprovalService.selectTSafetyapprovalList(new TSafetyapproval());
+        int safeWarnNum = 0;
+        for (TSafetyapproval t: safeList
+             ) {
+            if (t.getNextreviewdate() != null) {
+                long now = System.currentTimeMillis();
+                long diff = t.getNextreviewdate().getTime() - now;
+                long nd = 1000 * 24 * 60 * 60;
+                long editDifference = diff / nd;
+                if (editDifference < 30) {
+                    safeWarnNum ++;
+                    continue;
+                }
+            }
+        }
         result.put("safeNum", safeList.size());
+        result.put("safeWarnNum", safeWarnNum);
+
+        List<TFireapproval> fireList = tFireapprovalService.selectTFireapprovalList(new TFireapproval());
+        int fireWarnNum = 0;
+        for (TFireapproval t: fireList
+        ) {
+            if (t.getNextreviewdate() != null) {
+                long now = System.currentTimeMillis();
+                long diff = t.getNextreviewdate().getTime() - now;
+                long nd = 1000 * 24 * 60 * 60;
+                long editDifference = diff / nd;
+                if (editDifference < 30) {
+                    fireWarnNum ++;
+                    continue;
+                }
+            }
+        }
         result.put("fireNum", fireList.size());
+        result.put("fireWarnNum", fireWarnNum);
+        List<TEnvironapproval> envList = tEnvironapprovalService.selectTEnvironapprovalList(new TEnvironapproval());
+        int envWarnNum = 0;
+        for (TEnvironapproval t: envList
+        ) {
+            if (t.getNextreviewdate() != null) {
+                long now = System.currentTimeMillis();
+                long diff = t.getNextreviewdate().getTime() - now;
+                long nd = 1000 * 24 * 60 * 60;
+                long editDifference = diff / nd;
+                if (editDifference < 30) {
+                    envWarnNum ++;
+                    continue;
+                }
+            }
+        }
         result.put("envNum", envList.size());
+        result.put("envWarnNum", envWarnNum);
+
+        List<THealthapproval> healthList = tHealthapprovalService.selectTHealthapprovalList(new THealthapproval());
+        int healthWarnNum = 0;
+        for (TEnvironapproval t: envList
+        ) {
+            if (t.getNextreviewdate() != null) {
+                long now = System.currentTimeMillis();
+                long diff = t.getNextreviewdate().getTime() - now;
+                long nd = 1000 * 24 * 60 * 60;
+                long editDifference = diff / nd;
+                if (editDifference < 30) {
+                    healthWarnNum ++;
+                    continue;
+                }
+            }
+        }
         result.put("healthNum", healthList.size());
+        result.put("healthWarnNum", healthWarnNum);
         return AjaxResult.success(result);
     }
 

+ 8 - 7
master/src/main/java/com/ruoyi/project/production/service/impl/TSaiApplyServiceImpl.java

@@ -24,6 +24,7 @@ import com.ruoyi.project.production.mapper.TSaiApplyMapper;
 import com.ruoyi.project.production.domain.TSaiApply;
 import com.ruoyi.project.production.service.ITSaiApplyService;
 
+import javax.annotation.Resource;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.Size;
 
@@ -36,22 +37,22 @@ import javax.validation.constraints.Size;
 @Service
 public class TSaiApplyServiceImpl implements ITSaiApplyService
 {
-    @Autowired
+    @Resource
     private TSaiApplyMapper tSaiApplyMapper;
 
-    @Autowired
+    @Resource
     private SysDeptMapper sysDeptMapper;
 
-    @Autowired
+    @Resource
     private SysUserMapper sysUserMapper;
 
-    @Autowired
+    @Resource
     private ISysDictTypeService iSysDictTypeService;
 
-    @Autowired
+    @Resource
     private SysUserRoleMapper userRoleMapper;
 
-    @Autowired
+    @Resource
     private ISysUserService userService;
 
     /**
@@ -79,13 +80,13 @@ public class TSaiApplyServiceImpl implements ITSaiApplyService
     @Override
     public List<TSaiApply> selectTSaiApplyList(SaiApplyQueryVO tSaiApply)
     {
+        List<TSaiApply> tSaiApplies = tSaiApplyMapper.selectTSaiApplyList(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) {
             String applicantDept = saiApply.getApplicantDept();

+ 6 - 0
master/src/main/java/com/ruoyi/project/training/controller/TWorkcertificateCbpsController.java

@@ -58,6 +58,12 @@ public class TWorkcertificateCbpsController extends BaseController
 
     public AjaxResult syncData() {
         List<String> delList = tWorkcertificateCbpsMapper.queryNeedDeleteIds();
+        if (delList.size() > 0){
+            for (String id : delList
+                 ) {
+                tWorkcertificateCbpsMapper.deleteTWorkcertificateCbpsByStaffId(id);
+            }
+        }
 
         List<String> addList = tWorkcertificateCbpsMapper.queryNeedInsertIds();
         if (addList.size() > 0) {

+ 2 - 0
master/src/main/java/com/ruoyi/project/training/mapper/TWorkcertificateCbpsMapper.java

@@ -64,4 +64,6 @@ public interface TWorkcertificateCbpsMapper
     List<String> queryNeedDeleteIds();
 
     List<String> queryNeedInsertIds();
+
+    int deleteTWorkcertificateCbpsByStaffId(String id);
 }

+ 6 - 0
master/src/main/resources/mybatis/training/TWorkcertificateCbpsMapper.xml

@@ -240,6 +240,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         update t_workcertificate_cbps set del_flag = 2 where id = #{id}
     </update>
 
+    <update id="deleteTWorkcertificateCbpsByStaffId" parameterType="String">
+        update t_workcertificate_cbps set del_flag = 2 where EMPLOYEEID = #{staffId}
+    </update>
+
+
+
     <update id="deleteTWorkcertificateCbpsByIds" parameterType="String">
         update t_workcertificate_cbps set del_flag = 2 where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">

+ 4 - 4
ui/src/api/common/homedataCbps.js

@@ -3,28 +3,28 @@ import request from '@/utils/request'
 // 查询4个统计
 export function countNum() {
   return request({
-    url: '/byx/home/countNum',
+    url: '/cbps/home/countNum',
     method: 'get',
   })
 }
 // 查询装置程序清单统计
 export function procedureCount() {
   return request({
-    url: '/byx/home/procedureCount',
+    url: '/cbps/home/procedureCount',
     method: 'get',
   })
 }
 // 统计培训
 export function trainCount() {
   return request({
-    url: '/byx/home/trainCount',
+    url: '/cbps/home/trainCount',
     method: 'get',
   })
 }
 // 根据时间统计
 export function getLine() {
   return request({
-    url: '/byx/home/getLine',
+    url: '/cbps/home/getLine',
     method: 'get',
   })
 }

+ 220 - 0
ui/src/views/dashboard/hcq/PanelGroup.vue

@@ -0,0 +1,220 @@
+<template>
+  <el-row :gutter="40" class="panel-group">
+    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
+      <div class="card-panel" @click="handleSetLineChartData('newVisitis')">
+        <div class="card-panel-icon-wrapper icon-people">
+          <svg-icon icon-class="anquan" class-name="card-panel-icon"/>
+        </div>
+        <div class="card-panel-description">
+          <div class="card-panel-text">
+              安全
+            <el-badge v-if="safeWarnNum > 0" :value="safeWarnNum" :max="99" class="item" >
+            </el-badge>
+          </div>
+          <count-to :start-val="0" :end-val="safeNum" :duration="2600" class="card-panel-num"/>
+        </div>
+      </div>
+    </el-col>
+    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
+      <div class="card-panel" @click="handleSetLineChartData('messages')">
+        <div class="card-panel-icon-wrapper icon-message">
+          <svg-icon icon-class="huanbao" class-name="card-panel-icon"/>
+        </div>
+        <div class="card-panel-description">
+          <div class="card-panel-text">
+            环保
+            <el-badge v-if="envWarnNum > 0" :value="envWarnNum" :max="99" class="item" >
+            </el-badge>
+          </div>
+          <count-to :start-val="0" :end-val="envNum" :duration="3000" class="card-panel-num"/>
+        </div>
+      </div>
+    </el-col>
+    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
+      <div class="card-panel" @click="handleSetLineChartData('purchases')">
+        <div class="card-panel-icon-wrapper icon-money">
+          <svg-icon icon-class="xiaofang" class-name="card-panel-icon"/>
+        </div>
+        <div class="card-panel-description">
+          <div class="card-panel-text">
+            消防
+            <el-badge v-if="fireWarnNum > 0" :value="fireWarnNum" :max="99" class="item" >
+            </el-badge>
+          </div>
+          <count-to :start-val="0" :end-val="fireNum" :duration="3200" class="card-panel-num"/>
+        </div>
+      </div>
+    </el-col>
+    <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
+      <div class="card-panel" @click="handleSetLineChartData('shoppings')">
+        <div class="card-panel-icon-wrapper icon-shopping">
+          <svg-icon icon-class="weisheng" class-name="card-panel-icon"/>
+        </div>
+        <div class="card-panel-description">
+          <div class="card-panel-text">
+            卫生
+            <el-badge v-if="healthWarnNum > 0" :value="healthWarnNum" :max="99" class="item" >
+            </el-badge>
+          </div>
+          <count-to :start-val="0" :end-val="healthNum" :duration="3600" class="card-panel-num"/>
+        </div>
+      </div>
+    </el-col>
+  </el-row>
+</template>
+
+<script>
+import CountTo from 'vue-count-to'
+import {countNum} from "@/api/common/homedataCbps";
+
+export default {
+  components: {
+    CountTo
+  },
+  data() {
+    return {
+      healthNum: 0,
+      envNum: 0,
+      fireNum: 0,
+      safeNum: 0,
+      healthWarnNum: 0,
+      envWarnNum: 0,
+      fireWarnNum: 0,
+      safeWarnNum: 0,
+    }
+  },
+  created() {
+    countNum().then(res => {
+      this.healthNum = res.data.healthNum;
+      this.envNum = res.data.envNum;
+      this.fireNum = res.data.fireNum;
+      this.safeNum = res.data.safeNum;
+
+      this.healthWarnNum = res.data.healthWarnNum;
+      this.envWarnNum = res.data.envWarnNum;
+      this.fireWarnNum = res.data.fireWarnNum;
+      this.safeWarnNum = res.data.safeWarnNum;
+    })
+  },
+  methods: {
+    handleSetLineChartData(type) {
+      this.$emit('handleSetLineChartData', type)
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.panel-group {
+  margin-top: 18px;
+
+  .card-panel-col {
+    margin-bottom: 32px;
+  }
+  .item {
+    margin-bottom: 0px;
+    margin-top: -40px;
+  }
+
+  .card-panel {
+    height: 108px;
+    cursor: pointer;
+    font-size: 12px;
+    position: relative;
+    overflow: hidden;
+    color: #666;
+    background: #fff;
+    box-shadow: 4px 4px 40px rgba(0, 0, 0, .05);
+    border-color: rgba(0, 0, 0, .05);
+
+    &:hover {
+      .card-panel-icon-wrapper {
+        color: #fff;
+      }
+
+      .icon-people {
+        background: #40c9c6;
+      }
+
+      .icon-message {
+        background: #36a3f7;
+      }
+
+      .icon-money {
+        background: #f4516c;
+      }
+
+      .icon-shopping {
+        background: #34bfa3
+      }
+    }
+
+    .icon-people {
+      color: #40c9c6;
+    }
+
+    .icon-message {
+      color: #36a3f7;
+    }
+
+    .icon-money {
+      color: #f4516c;
+    }
+
+    .icon-shopping {
+      color: #34bfa3
+    }
+
+    .card-panel-icon-wrapper {
+      float: left;
+      margin: 14px 0 0 14px;
+      padding: 16px;
+      transition: all 0.38s ease-out;
+      border-radius: 6px;
+    }
+
+    .card-panel-icon {
+      float: left;
+      font-size: 48px;
+    }
+
+    .card-panel-description {
+      float: right;
+      font-weight: bold;
+      margin: 26px;
+      margin-left: 0px;
+
+      .card-panel-text {
+        line-height: 18px;
+        color: rgba(0, 0, 0, 0.45);
+        font-size: 22px;
+        margin-bottom: 12px;
+        width: 90px;
+      }
+
+      .card-panel-num {
+        font-size: 20px;
+      }
+    }
+  }
+}
+
+@media (max-width: 550px) {
+  .card-panel-description {
+    display: none;
+  }
+
+  .card-panel-icon-wrapper {
+    float: none !important;
+    width: 100%;
+    height: 100%;
+    margin: 0 !important;
+
+    .svg-icon {
+      display: block;
+      margin: 14px auto !important;
+      float: none !important;
+    }
+  }
+}
+</style>

+ 1 - 1
ui/src/views/hcqhome.vue

@@ -50,7 +50,7 @@
 </template>
 
 <script>
-import PanelGroup from './dashboard/PanelGroup'
+import PanelGroup from './dashboard/hcq/PanelGroup'
 import LineChart from './dashboard/LineChart'
 import RaddarChart from './dashboard/hcq/RaddarChart'
 import PieChart from './dashboard/hcq/PieChart'

+ 4 - 0
ui/src/views/training/trainingrecords/index.vue

@@ -392,6 +392,8 @@
         <span>{{ $t('需参加培训,已经完成培训人员') }}</span>
         <svg-icon icon-class="rectanglered" class="rectangleRed"></svg-icon>
         <span style="line-height: 40px">{{ $t('需参加培训,尚未进行培训人员') }}</span>
+        <span style="line-height: 40px;margin-left: 22px;">╳ 需要参加培训</span>
+        <span style="line-height: 40px;margin-left: 22px;">⚪ 不需要参加培训</span>
       </div>
       <el-table v-if="tableShow" border :data="companylevelList"
                 v-loading="companyTrainingLoad"
@@ -457,6 +459,8 @@
           <span>{{ $t('需参加培训,已经完成培训人员') }}</span>
           <svg-icon icon-class="rectanglered" class="rectangleRed"></svg-icon>
           <span style="line-height: 40px">{{ $t('需参加培训,尚未进行培训人员') }}</span>
+          <span style="line-height: 40px;margin-left: 22px;">╳ 需要参加培训</span>
+          <span style="line-height: 40px;margin-left: 22px;">⚪ 不需要参加培训</span>
         </el-row>
       </el-form>
       <el-table v-if="tableShow" border :data="devicelevelList"