jiangbiao 1 yıl önce
ebeveyn
işleme
a6068a041c

+ 0 - 6
master/src/main/java/com/ruoyi/project/production/controller/TPpeMatrixController.java

@@ -37,7 +37,6 @@ public class TPpeMatrixController extends BaseController {
     /**
      * 查询ppe矩阵管理列表
      */
-    @PreAuthorize("@ss.hasPermi('production:matrix:list')")
     @GetMapping("/list")
     public TableDataInfo list(TPpeMatrix tPpeMatrix) {
         startPage();
@@ -138,7 +137,6 @@ public class TPpeMatrixController extends BaseController {
     /**
      * 导出ppe矩阵管理列表
      */
-    @PreAuthorize("@ss.hasPermi('production:matrix:export')")
     @Log(title = "ppe矩阵管理", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPpeMatrix tPpeMatrix) {
@@ -150,7 +148,6 @@ public class TPpeMatrixController extends BaseController {
     /**
      * 获取ppe矩阵管理详细信息
      */
-    @PreAuthorize("@ss.hasPermi('production:matrix:query')")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return AjaxResult.success(tPpeMatrixService.selectTPpeMatrixById(id));
@@ -159,7 +156,6 @@ public class TPpeMatrixController extends BaseController {
     /**
      * 新增ppe矩阵管理
      */
-    @PreAuthorize("@ss.hasPermi('production:matrix:add')")
     @Log(title = "ppe矩阵管理", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPpeMatrix tPpeMatrix) {
@@ -169,7 +165,6 @@ public class TPpeMatrixController extends BaseController {
     /**
      * 修改ppe矩阵管理
      */
-    @PreAuthorize("@ss.hasPermi('production:matrix:edit')")
     @Log(title = "ppe矩阵管理", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPpeMatrix tPpeMatrix) {
@@ -179,7 +174,6 @@ public class TPpeMatrixController extends BaseController {
     /**
      * 删除ppe矩阵管理
      */
-    @PreAuthorize("@ss.hasPermi('production:matrix:remove')")
     @Log(title = "ppe矩阵管理", businessType = BusinessType.DELETE)
     @DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids) {

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

@@ -1,6 +1,5 @@
 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;
@@ -11,7 +10,6 @@ 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;
@@ -92,7 +90,7 @@ public class TPpePersonController extends BaseController {
     @PostMapping
     public AjaxResult add(@RequestBody TPpePerson tPpePerson) {
         TStaffmgr tStaffmgr = new TStaffmgr();
-        tStaffmgr.setTeam("18");
+        tStaffmgr.setUnits("10");
         for (TStaffmgr staffmgr : tStaffmgrService.selectTStaffmgrList(tStaffmgr)) {
             TPpePerson person = new TPpePerson();
             person.setEmployeeid(staffmgr.getStaffid());
@@ -118,7 +116,6 @@ public class TPpePersonController extends BaseController {
                 person.setEmployeeid(tWorklicense.getEmployeeid());
                 person.setPlantCode(tWorklicense.getPlantCode());
                 person.setName(tWorklicense.getName());
-                person.setClasses(tWorklicense.getClasses());
                 TStaffmgr staffmgr = tStaffmgrService.selectTStaffmgrByStaffId(tWorklicense.getEmployeeid());
                 if (staffmgr != null)
                     person.setSex(staffmgr.getSex());
@@ -128,11 +125,19 @@ public class TPpePersonController extends BaseController {
                 person.setColdarea(tWorklicense.getColdarea());
                 person.setDeptId(tWorklicense.getDeptId());
                 person.setOperator("0");
-                insertOrUpdate(person);
+                TPpePerson ppePerson = tPpePersonService.selectTPpePersonByEmployeeid(person.getEmployeeid());
+                if (ppePerson != null) {
+                    person.setId(ppePerson.getId());
+                    person.setUpdatedate(new Date());
+                    person.setUpdaterCode(getUserId().toString());
+                    tPpePersonService.updateTPpePerson(person);
+                }
             } catch (Exception e) {
+                logger.info("================================:{}",tWorklicense.getEmployeeid());
                 e.printStackTrace();
             }
         }
+        tPpePersonService.deleteTPpePersonByShiftmgr();
         return AjaxResult.success();
     }
 

+ 1 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TPpePersonMapper.java

@@ -63,4 +63,5 @@ public interface TPpePersonMapper
      * @return 结果
      */
     public int deleteTPpePersonByIds(Long[] ids);
+    public int deleteTPpePersonByShiftmgr();
 }

+ 1 - 0
master/src/main/java/com/ruoyi/project/production/service/ITPpePersonService.java

@@ -60,4 +60,5 @@ public interface ITPpePersonService
      * @return 结果
      */
     public int deleteTPpePersonById(Long id);
+    public int deleteTPpePersonByShiftmgr();
 }

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

@@ -96,4 +96,10 @@ public class TPpePersonServiceImpl implements ITPpePersonService
     {
         return tPpePersonMapper.deleteTPpePersonById(id);
     }
+
+    @Override
+    public int deleteTPpePersonByShiftmgr()
+    {
+        return tPpePersonMapper.deleteTPpePersonByShiftmgr();
+    }
 }

+ 5 - 1
master/src/main/resources/mybatis/production/TPpePersonMapper.xml

@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}
-        order by createdate
+        order by classes
     </select>
 
     <select id="selectTPpePersonById" parameterType="Long" resultMap="TPpePersonResult">
@@ -69,6 +69,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where employeeid = #{employeeid}
     </select>
 
+    <delete id="deleteTPpePersonByShiftmgr">
+        delete  from t_ppe_person where EMPLOYEEID in(SELECT a.EMPLOYEEID FROM T_PPE_PERSON a MINUS SELECT b.STAFFID FROM T_STAFFMGR b where b.del_flag = 0 and b.unit='10')
+    </delete>
+
     <insert id="insertTPpePerson" parameterType="TPpePerson">
         <selectKey keyProperty="id" resultType="long" order="BEFORE">
             SELECT seq_t_ppe_person.NEXTVAL as id FROM DUAL

+ 6 - 0
ui/src/router/index.js

@@ -242,6 +242,12 @@ export const constantRoutes = [
         component: (resolve) => require(['@/views/production/quality/report'], resolve),
         name: 'report',
         meta: { title: '生成报告' }
+      },
+      {
+        path: 'matrix',
+        component: (resolve) => require(['@/views/production/matrix'], resolve),
+        name: 'matrix',
+        meta: { title: 'PPE矩阵管理' }
       }
     ]
   },

+ 53 - 57
ui/src/views/production/matrix/index.vue

@@ -4,20 +4,20 @@
       <el-form-item label="岗位" prop="usePost">
         <el-select v-model="queryParams.usePost" clearable placeholder="请选择应配备岗位" size="small">
           <el-option
-            v-for="dict in usePostOptions"
-            :key="dict.dictValue"
-            :label="dict.dictLabel"
-            :value="dict.dictValue"
+              v-for="dict in usePostOptions"
+              :key="dict.dictValue"
+              :label="dict.dictLabel"
+              :value="dict.dictValue"
           />
         </el-select>
       </el-form-item>
       <el-form-item label="PPE种类" prop="ppeType">
         <el-input
-          v-model="queryParams.ppeType"
-          clearable
-          placeholder="请输入PPE种类"
-          size="small"
-          @keyup.enter.native="handleQuery"
+            v-model="queryParams.ppeType"
+            clearable
+            placeholder="请输入PPE种类"
+            size="small"
+            @keyup.enter.native="handleQuery"
         />
       </el-form-item>
       <el-form-item>
@@ -29,33 +29,30 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
-          v-hasPermi="['production:matrix:add']"
-          icon="el-icon-plus"
-          size="mini"
-          type="primary"
-          @click="handleAdd"
+            icon="el-icon-plus"
+            size="mini"
+            type="primary"
+            @click="handleAdd"
         >新增
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-          v-hasPermi="['production:matrix:edit']"
-          :disabled="single"
-          icon="el-icon-edit"
-          size="mini"
-          type="success"
-          @click="handleUpdate"
+            :disabled="single"
+            icon="el-icon-edit"
+            size="mini"
+            type="success"
+            @click="handleUpdate"
         >修改
         </el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
-          v-hasPermi="['production:matrix:remove']"
-          :disabled="multiple"
-          icon="el-icon-delete"
-          size="mini"
-          type="danger"
-          @click="handleDelete"
+            :disabled="multiple"
+            icon="el-icon-delete"
+            size="mini"
+            type="danger"
+            @click="handleDelete"
         >删除
         </el-button>
       </el-col>
@@ -67,23 +64,22 @@
       <el-table-column align="center" type="selection" width="55"/>
       <el-table-column :formatter="usePostFormat" align="center" label="岗位" prop="usePost"/>
       <el-table-column :show-overflow-tooltip="true" align="center" label="PPE种类" prop="ppeType"/>
-      <el-table-column :show-overflow-tooltip="true" :formatter="personFormat" align="center" label="指定人" prop="assigner"/>
+      <el-table-column :formatter="personFormat" :show-overflow-tooltip="true" align="center" label="指定人"
+                       prop="assigner"/>
       <el-table-column align="center" class-name="small-padding fixed-width" label="操作">
         <template slot-scope="scope">
           <el-button
-            v-hasPermi="['production:matrix:edit']"
-            icon="el-icon-edit"
-            size="mini"
-            type="text"
-            @click="handleUpdate(scope.row)"
+              icon="el-icon-edit"
+              size="mini"
+              type="text"
+              @click="handleUpdate(scope.row)"
           >修改
           </el-button>
           <el-button
-            v-hasPermi="['production:matrix:remove']"
-            icon="el-icon-delete"
-            size="mini"
-            type="text"
-            @click="handleDelete(scope.row)"
+              icon="el-icon-delete"
+              size="mini"
+              type="text"
+              @click="handleDelete(scope.row)"
           >删除
           </el-button>
         </template>
@@ -91,12 +87,12 @@
     </el-table>
 
     <pagination
-      v-show="total>0"
-      :limit.sync="queryParams.pageSize"
-      :page-sizes="[20,50,100]"
-      :page.sync="queryParams.pageNum"
-      :total="total"
-      @pagination="getList"
+        v-show="total>0"
+        :limit.sync="queryParams.pageSize"
+        :page-sizes="[20,50,100]"
+        :page.sync="queryParams.pageNum"
+        :total="total"
+        @pagination="getList"
     />
 
     <!-- 添加或修改ppe矩阵管理对话框 -->
@@ -108,10 +104,10 @@
         <el-form-item label="应配备岗位" prop="usePost">
           <el-select v-model="form.usePost" placeholder="请选择应配备岗位">
             <el-option
-              v-for="dict in usePostOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel"
-              :value="dict.dictValue"
+                v-for="dict in usePostOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel"
+                :value="dict.dictValue"
             ></el-option>
           </el-select>
         </el-form-item>
@@ -121,10 +117,10 @@
         <el-form-item v-if="form.isAssigner" label="指定人" prop="assigner">
           <el-select v-model="form.assigner" clearable filterable multiple placeholder="请选择指定人">
             <el-option
-              v-for="dict in personOptions"
-              :key="dict.dictValue"
-              :label="dict.dictLabel+'_'+dict.dictValue"
-              :value="dict.dictValue"
+                v-for="dict in personOptions"
+                :key="dict.dictValue"
+                :label="dict.dictLabel+'_'+dict.dictValue"
+                :value="dict.dictValue"
             ></el-option>
           </el-select>
         </el-form-item>
@@ -248,8 +244,8 @@ export default {
       this.usePostOptions = response.data;
     });
     listAllPerson({}).then(res => {
-      res.data.forEach(item=>{
-        this.personOptions.push({dictValue:item.employeeid,dictLabel:item.name})
+      res.data.forEach(item => {
+        this.personOptions.push({dictValue: item.employeeid, dictLabel: item.name})
       })
     })
   },
@@ -275,7 +271,7 @@ export default {
     },
     // 指定人字典翻译
     personFormat(row, column) {
-      return this.selectDictLabels(this.personOptions, row.assigner,',');
+      return this.selectDictLabels(this.personOptions, row.assigner, ',');
     },
     // 取消按钮
     cancel() {
@@ -341,8 +337,8 @@ export default {
         if (valid) {
           if (this.form.assigner)
             this.form.assigner = this.form.assigner.join(',')
-          if (this.form.isAssigner){
-            this.form.isAssigner='1';
+          if (this.form.isAssigner) {
+            this.form.isAssigner = '1';
           }
           if (this.form.id != null) {
             updateMatrix(this.form).then(response => {
@@ -431,7 +427,7 @@ export default {
     setTable(tableData) {
       //    console.log(tableData)
       let spanArr = [],
-        concat = 0;
+          concat = 0;
       tableData.forEach((item, index) => {
         if (index === 0) {
           spanArr.push(1);

+ 25 - 4
ui/src/views/production/person/index.vue

@@ -56,6 +56,15 @@
         >同步人员数据
         </el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          icon="el-icon-s-operation"
+          size="mini"
+          type="warning"
+          @click="toMatrix"
+        >PPE矩阵管理
+        </el-button>
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -351,8 +360,10 @@
                             </el-table-column>-->
             </el-table-column>
           </el-table>
-          <div v-if="detail.isAdd||detail.isEdit" style="margin-top: 10px">
-            <el-input v-model="detail.staffRemark" placeholder="请输入备注" style="width: 100%"
+          <div v-if="detail.isAdd||detail.isEdit" style="margin-top: 10px" >
+            <el-image :preview-src-list="ppe1" :src="ppe1[0]" fit="cover"
+                      style="height: 60px;width: 3%;margin-right: 1%"/>
+            <el-input v-model="detail.staffRemark" placeholder="请输入备注" style="width: 96%"
                       type="textarea"/>
           </div>
           <el-descriptions v-else :column="1" border class="margin-top" size="default">
@@ -476,7 +487,9 @@
             </el-table-column>
           </el-table>
           <div v-if="detail.isAdd||detail.isEdit" style="margin-top: 10px">
-            <el-input v-model="detail.cmldefRemark" placeholder="请输入备注" style="width: 100%"
+            <el-image :preview-src-list="ppe2" :src="ppe2[0]" fit="cover"
+                      style="height: 60px;width: 3%;margin-right: 1%"/>
+            <el-input v-model="detail.cmldefRemark" placeholder="请输入备注" style="width: 96%"
                       type="textarea"/>
           </div>
           <el-descriptions v-else :column="1" border class="margin-top" size="default">
@@ -577,7 +590,9 @@
           </el-table-column>
         </el-table>
         <div v-if="detail.isAdd||detail.isEdit" style="margin-top: 10px">
-          <el-input v-model="detail.wardrobeRemark" placeholder="请输入备注" style="width: 100%"
+          <el-image :preview-src-list="ppe3" :src="ppe3[0]" fit="cover"
+                    style="height: 60px;width: 3%;margin-right: 1%"/>
+          <el-input v-model="detail.wardrobeRemark" placeholder="请输入备注" style="width: 96%;"
                     type="textarea"/>
         </div>
         <el-descriptions v-else :column="1" border class="margin-top" size="default">
@@ -636,6 +651,9 @@ export default {
   },
   data() {
     return {
+      ppe1: [process.env.VUE_APP_BASE_API+"/profile/ppeImg/ppe1.png"],
+      ppe2: [process.env.VUE_APP_BASE_API+"/profile/ppeImg/ppe2.png"],
+      ppe3: [process.env.VUE_APP_BASE_API+"/profile/ppeImg/ppe3.png"],
       detail: {
         total: 0,
         isEdit: false,
@@ -788,6 +806,9 @@ export default {
     })
   },
   methods: {
+    toMatrix(){
+        this.$router.push({ path: '/production/matrix', query: {}});
+    },
     submitDetail() {
       if (this.detail.staffLocker)
         this.detail.staffLocker.forEach(item => {