Parcourir la source

LY 培训类型 员工号重复

ly il y a 1 an
Parent
commit
29923f6339

+ 16 - 2
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -351,10 +351,11 @@ public class TStaffmgrController extends BaseController
      */
     @PreAuthorize("@ss.hasPermi('plant:staffmgr:list')")
     @GetMapping("/leftList")
-    public List<TStaffmgr> leftList(TStaffmgr tStaffmgr)
+    public TableDataInfo leftList(TStaffmgr tStaffmgr)
     {
+        startPage();
         List<TStaffmgr> list = tStaffmgrService.selectLeftTStaffmgrList(tStaffmgr);
-        return list;
+        return getDataTable(list);
     }
 
     //学历统计
@@ -477,6 +478,12 @@ public class TStaffmgrController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody TStaffmgr tStaffmgr)
     {
+        //判断是否重复员工
+        TStaffmgr tStaffmgr1 = tStaffmgrMapper.selectTStaffmgrByStaffId(tStaffmgr.getStaffid());
+        if (tStaffmgr1 != null) {
+            return AjaxResult.error("员工号已存在");
+        }
+
         int insertResult = tStaffmgrService.insertTStaffmgr(tStaffmgr);
         tStaffmgr.setCreaterCode(getUserId().toString());
         if (tStaffmgr.getUnit().equals("10") || tStaffmgr.getUnit().equals("18")|| tStaffmgr.getUnit().equals("20")|| tStaffmgr.getUnit().equals("30")) {
@@ -545,6 +552,13 @@ public class TStaffmgrController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody TStaffmgr tStaffmgr)
     {
+        //判断是否重复员工
+        TStaffmgr tStaffmgr1 = tStaffmgrMapper.selectTStaffmgrByStaffId(tStaffmgr.getStaffid());
+        if (tStaffmgr1 != null) {
+            if (tStaffmgr1.getId()!= tStaffmgr.getId()) {
+                return AjaxResult.error("员工号已存在");
+            }
+        }
         tStaffmgr.setPhoto(null);
         tStaffmgr.setUpdaterCode(getUserId().toString());
         tStaffmgr.setUpdatedate(new Date());

+ 1 - 0
master/src/main/java/com/ruoyi/project/plant/domain/TStaffmgr.java

@@ -136,6 +136,7 @@ public class TStaffmgr extends BaseEntity
     /** 是否退休 */
     private Integer isRetire;
 
+    /** 区域 */
     private String region;
 
 

+ 1 - 0
master/src/main/resources/mybatis/plant/TStaffmgrMapper.xml

@@ -311,6 +311,7 @@
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
+        order by d.left_date desc
     </select>
 
     <select id="selectTStaffmgrById" parameterType="Long" resultMap="TStaffmgrResult">

+ 19 - 4
ui/src/views/plant/staffmgr/index.vue

@@ -581,6 +581,13 @@
           </template>
         </el-table-column>
       </el-table>
+      <pagination
+        v-show="retireTotal>0"
+        :total="retireTotal"
+        :page.sync="retireQueryParams.pageNum"
+        :limit.sync="retireQueryParams.pageSize"
+        @pagination="getLeftData(retireQueryParams.isRetire)"
+      />
       <div slot="footer" class="dialog-footer">
         <!--        <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
         <el-button @click="left.open = false">{{ $t('返 回') }}</el-button>
@@ -661,6 +668,7 @@
         showSearch: false,
         // 总条数
         total: 0,
+        retireTotal: 0,
         // 人员管理表格数据
         staffmgrList: [],
         //目标措施树选项
@@ -791,6 +799,12 @@
           photo: null,
           specialDuty: null
         },
+        // 离职查询参数
+        retireQueryParams: {
+          pageNum: 1,
+          pageSize: 10,
+          isRetire: null
+        },
         querypIdParams: {
           units: '10,18,20',
         },
@@ -1207,15 +1221,16 @@
         this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
       },
       handleLeft(isRetire){
+        this.retireQueryParams.pageNum = 1
         this.left.open = true;
         isRetire == 0?this.left.title = this.$t('离职人员信息'):this.left.title =this.$t('退休人员信息');
         this.getLeftData(isRetire);
       },
       getLeftData(isRetire){
-        let params ={}
-        params.isRetire = isRetire
-        listLeftStaffmgr(params).then(response => {
-          this.left.staffmgrList = response;
+          this.retireQueryParams.isRetire = isRetire
+        listLeftStaffmgr(this.retireQueryParams).then(response => {
+          this.left.staffmgrList = response.rows;
+          this.retireTotal = response.total
         });
       },
       handleReLeft(row){

+ 1 - 0
ui/src/views/sems/safecheck/agent-dailycheck/index.vue

@@ -195,6 +195,7 @@
       v-show="total>0"
       :total="total"
       :page.sync="queryParams.pageNum"
+      :page-sizes="[20,100,300,500]"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />

+ 1 - 0
ui/src/views/sems/safecheck/agent-personweekcheck/index.vue

@@ -157,6 +157,7 @@
       v-show="total>0"
       :total="total"
       :page.sync="queryParams.pageNum"
+      :page-sizes="[20,100,300,500]"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />

+ 1 - 0
ui/src/views/sems/safecheck/dailycheck/index.vue

@@ -196,6 +196,7 @@
       v-show="total>0"
       :total="total"
       :page.sync="queryParams.pageNum"
+      :page-sizes="[20,100,300,500]"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />

+ 1 - 0
ui/src/views/sems/safecheck/personweekcheck/index.vue

@@ -158,6 +158,7 @@
       v-show="total>0"
       :total="total"
       :page.sync="queryParams.pageNum"
+      :page-sizes="[20,100,300,500]"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />

+ 1 - 0
ui/src/views/sems/safecheck/weekcheck/index.vue

@@ -146,6 +146,7 @@
       v-show="total>0"
       :total="total"
       :page.sync="queryParams.pageNum"
+      :page-sizes="[20,100,300,500]"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />

+ 10 - 3
ui/src/views/training/training/index.vue

@@ -116,10 +116,17 @@
         <!--<el-button type="primary" plain @click="selectCourse('12')">MOC类</el-button>-->
 <!--        <el-button type="primary" plain @click="selectCourse('14')">EHS类</el-button>-->
         <el-button type="primary" plain @click="selectCourse('16')">{{ $t('程序指导书更新类') }}</el-button>
-        <el-button type="primary" plain @click="selectCourse('18')">{{ $t('事件报告类') }}</el-button>
-        <el-button type="primary" plain @click="selectCourse('22')">GIS</el-button>
-        <el-button type="primary" plain @click="selectCourse('24')">GSA</el-button>
+        <el-button type="primary" plain @click="selectCourse('18')">{{ $t('事件报告和调查') }}</el-button>
+        <el-button type="primary" plain @click="selectCourse('40')">GIS/GSA</el-button>
         <el-button type="primary" plain @click="selectCourse('26')">{{ $t('事故信息') }}</el-button>
+
+        <el-button type="primary" plain @click="selectCourse('28')">BYC EHS月报</el-button>
+        <el-button type="primary" plain @click="selectCourse('30')">BYC事故信息</el-button>
+        <el-button type="primary" plain @click="selectCourse('32')">CBP EHS季度会</el-button>
+        <el-button type="primary" plain @click="selectCourse('33')">BASF事件分享</el-button>
+        <el-button type="primary" plain @click="selectCourse('34')">Lesson Learnt</el-button>
+        <el-button type="primary" plain @click="selectCourse('36')">职检报告</el-button>
+
         <el-button type="primary" plain @click="selectCourse('20')">{{ $t('其他') }}</el-button>
       </el-col>
     </el-row>