jiangbiao 1 năm trước cách đây
mục cha
commit
31b9e4acdd

+ 3 - 0
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -130,6 +130,9 @@ public class TStaffmgrController extends BaseController
         TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(staffId);
         if (staffmgr != null) {
             staffmgr.setUserId(userId.toString());
+            if (staffmgr.getActualpost().contains("14")||staffmgr.getActualpost().contains("12")){
+                staffmgr.setChecker(true);
+            }
         }
         return AjaxResult.success(staffmgr);
     }

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

@@ -153,6 +153,16 @@ public class TStaffmgr extends BaseEntity
     /** PGU */
     private String coldarea;
 
+    private boolean isChecker;
+
+    public boolean isChecker() {
+        return isChecker;
+    }
+
+    public void setChecker(boolean checker) {
+        isChecker = checker;
+    }
+
     public String getBoiler() {
         return boiler;
     }

+ 9 - 5
master/src/main/java/com/ruoyi/project/production/controller/TPpePersonController.java

@@ -1,5 +1,6 @@
 package com.ruoyi.project.production.controller;
 
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -10,10 +11,10 @@ import com.ruoyi.project.plant.domain.TStaffmgr;
 import com.ruoyi.project.plant.service.ITStaffmgrService;
 import com.ruoyi.project.production.domain.TPpePerson;
 import com.ruoyi.project.production.service.ITPpePersonService;
+import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.service.ISysUserService;
 import com.ruoyi.project.training.domain.TWorklicense;
 import com.ruoyi.project.training.service.ITWorklicenseService;
-import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
@@ -91,7 +92,6 @@ public class TPpePersonController extends BaseController {
     @PostMapping
     public AjaxResult add(@RequestBody TPpePerson tPpePerson) {
         TStaffmgr tStaffmgr = new TStaffmgr();
-        tStaffmgr.setActualpost("36");
         tStaffmgr.setTeam("18");
         for (TStaffmgr staffmgr : tStaffmgrService.selectTStaffmgrList(tStaffmgr)) {
             TPpePerson person = new TPpePerson();
@@ -105,7 +105,11 @@ public class TPpePersonController extends BaseController {
             person.setHotarea("0");
             person.setColdarea("0");
             person.setDeptId(staffmgr.getDeptId());
-            person.setOperator("1");
+            if ("36".equals(staffmgr.getActualpost())) {
+                person.setOperator("1");
+            } else {
+                person.setOperator("0");
+            }
             insertOrUpdate(person);
         }
         for (TWorklicense tWorklicense : tWorklicenseService.selectTWorklicenseList(new TWorklicense())) {
@@ -134,12 +138,12 @@ public class TPpePersonController extends BaseController {
 
     private void insertOrUpdate(TPpePerson person) {
         TPpePerson ppePerson = tPpePersonService.selectTPpePersonByEmployeeid(person.getEmployeeid());
-        if ( ppePerson!= null) {
+        if (ppePerson != null) {
             person.setId(ppePerson.getId());
             person.setUpdatedate(new Date());
             person.setUpdaterCode(getUserId().toString());
             tPpePersonService.updateTPpePerson(person);
-        }else {
+        } else {
             person.setCreaterCode(getUserId().toString());
             person.setCreatedate(new Date());
             tPpePersonService.insertTPpePerson(person);

+ 8 - 0
ui/src/views/production/person/index.vue

@@ -111,6 +111,7 @@
         </el-form-item>
       </el-form>
       <el-button
+        v-if="isChecker&&currentTeam===detail.row.classes"
         icon="el-icon-plus"
         size="mini"
         type="primary"
@@ -625,6 +626,7 @@ import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
 import {addMain, exportMain, getMain, listMain} from "@/api/production/main";
 import {listMatrixByPost} from "@/api/production/matrix";
+import {getLoginStaffInfo} from "@/api/plant/staffmgr";
 
 export default {
   name: "Person",
@@ -663,6 +665,8 @@ export default {
         mainList: [],
         loading: false,
       },
+      isChecker: false,
+      currentTeam: "",
       // 装置名称字典
       plantCodeOptions: [],
       yesNoOptions: [],
@@ -778,6 +782,10 @@ export default {
     this.getDicts("PPE_CHECK").then(response => {
       this.ppeCheckOptions = response.data;
     });
+    getLoginStaffInfo().then(res => {
+      this.currentTeam = res.data.team
+      this.isChecker = res.data.checker
+    })
   },
   methods: {
     submitDetail() {