shi'sen'yuan 3 жил өмнө
parent
commit
c5a4260de4

+ 41 - 23
master/src/main/java/com/ruoyi/project/plant/controller/TStaffmgrController.java

@@ -17,12 +17,8 @@ import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import com.ruoyi.project.system.service.ITAlarmPrincipalService;
-import com.ruoyi.project.training.domain.TTrainingParticipants;
-import com.ruoyi.project.training.domain.TTrainingrecords;
-import com.ruoyi.project.training.domain.TWorklicense;
-import com.ruoyi.project.training.service.ITTrainingParticipantsService;
-import com.ruoyi.project.training.service.ITTrainingrecordsService;
-import com.ruoyi.project.training.service.ITWorklicenseService;
+import com.ruoyi.project.training.domain.*;
+import com.ruoyi.project.training.service.*;
 import org.apache.commons.lang.StringUtils;
 import org.apache.poi.ss.usermodel.*;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -71,6 +67,15 @@ public class TStaffmgrController extends BaseController
     @Autowired
     private ITWorklicenseService tWorklicenseService;
 
+    @Autowired
+    private ITTrainingRegularService tTrainingRegularService;
+
+    @Autowired
+    private ITTrainingDeviceService tTrainingDeviceService;
+
+    @Autowired
+    private ITTrainingService tTrainingService;
+
     /**
      * 查询人员管理列表
      */
@@ -81,23 +86,6 @@ public class TStaffmgrController extends BaseController
         ServletUtils.getParameter("sexs");
         startPage();
         List<TStaffmgr> list = tStaffmgrService.selectTStaffmgrList(tStaffmgr);
-        /*List<TTrainingParticipants> tTrainingParticipants = tTrainingParticipantsService.selectTTrainingParticipantsList(new TTrainingParticipants());
-        SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
-        for (int i = 0; i < list.size(); i++) {
-            double time = 0;
-            for (TTrainingParticipants t : tTrainingParticipants) {
-                if (t.getStaffId().equals(list.get(i).getStaffid())) {
-                    if (t.getStartDate() != null) {
-                        if (sdf.format(t.getStartDate()).equals(sdf.format(new Date()))) {
-                            if (t.getTrainingDuration() != null) {
-                                time = time + Double.parseDouble(t.getTrainingDuration());
-                            }
-                        }
-                    }
-                }
-            }
-            list.get(i).setTrainingTime(String.valueOf(time));
-        }*/
         return getDataTable(list);
     }
 
@@ -307,6 +295,36 @@ public class TStaffmgrController extends BaseController
             tWorklicense.setDeptId(tStaffmgr.getDeptId());
             tWorklicenseService.insertTWorklicense(tWorklicense);
         }
+        if (tStaffmgr.getUnit().equals("10")) {
+            SimpleDateFormat sdfYear = new SimpleDateFormat("yyyy");
+            TTrainingRegular regular = new TTrainingRegular();
+            regular.setYear(sdfYear.format(new Date()));
+            List<TTrainingRegular> tTrainingRegulars = tTrainingRegularService.selectTTrainingRegularList(regular);
+            for (TTrainingRegular r : tTrainingRegulars) {
+                if (r.getNotPlan().equals("true")) {
+                    String[] posts = r.getActualpostId().split(",");
+                    for (String post : posts) {
+                        if (post.equals(tStaffmgr.getActualpost())) {
+                            TTraining training = tTrainingService.selectTTrainingByRegularId(r.getId());
+                            if (training.getStartDate() == null) {
+                                TTrainingDevice tTrainingDevice = new TTrainingDevice();
+                                tTrainingDevice.setStaffId(tStaffmgr.getStaffid());
+                                tTrainingDevice.setRegularId(training.getId());
+                                tTrainingDevice.setStartDate(r.getPlanTrainingdate());
+                                tTrainingDevice.setSupplementary("0");
+                                tTrainingDeviceService.insertTTrainingDevice(tTrainingDevice);
+                            } else {
+                                TTrainingDevice tTrainingDevice = new TTrainingDevice();
+                                tTrainingDevice.setStaffId(tStaffmgr.getStaffid());
+                                tTrainingDevice.setRegularId(training.getId());
+                                tTrainingDevice.setSupplementary("2");
+                                tTrainingDeviceService.insertTTrainingDevice(tTrainingDevice);
+                            }
+                        }
+                    }
+                }
+            }
+        }
         return toAjax(insertResult);
     }
 

+ 24 - 3
master/src/main/java/com/ruoyi/project/training/controller/TTrainingDeviceController.java

@@ -2,12 +2,14 @@ package com.ruoyi.project.training.controller;
 
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
 import com.ruoyi.project.plant.domain.TStaffmgr;
 import com.ruoyi.project.plant.service.ITStaffmgrService;
 import com.ruoyi.project.training.domain.TTraining;
 import com.ruoyi.project.training.domain.TTrainingRegular;
+import com.ruoyi.project.training.service.ITTrainingRegularService;
 import com.ruoyi.project.training.service.ITTrainingService;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -47,6 +49,9 @@ public class TTrainingDeviceController extends BaseController
     @Autowired
     private ITTrainingService tTrainingService;
 
+    @Autowired
+    private ITTrainingRegularService tTrainingRegularService;
+
     /**
      * 查询人员-装置级培训关系列表
      */
@@ -95,13 +100,25 @@ public class TTrainingDeviceController extends BaseController
                 TTrainingDevice d = new TTrainingDevice();
                 for (TTrainingDevice t : list) {
                     if (t.getStaffId().equals(s.getStaffid()) && t.getRegularId().equals(tTrainings.get(i).getId())) {
-                        m = 1;
-                        d = t;
+                        if (tTrainings.get(i).getTrainingType().equals("10")) {
+                            if (tTrainings.get(i).getStartDate() == null) {
+                                m = 2;
+                            }else {
+                                m = 1;
+                                d = t;
+                            }
+                        }else {
+                            m = 1;
+                            d = t;
+                        }
                     }
                 }
                 if (m == 0) {
                     device.add("⚪");
                     deviceDate.add("N.A");
+                }else if (m == 2) {
+                    device.add("╳");
+                    deviceDate.add("尚未开始培训");
                 }else {
                     if (d.getSupplementary().equals("1")) {
                         device.add("╳");
@@ -119,7 +136,11 @@ public class TTrainingDeviceController extends BaseController
                         }
                     }else if (d.getSupplementary().equals("2")){
                         device.add("新员工");
-                        deviceDate.add(sdf.format(d.getStartDate()));
+                        if (d.getStartDate() != null) {
+                            deviceDate.add(sdf.format(d.getStartDate()));
+                        }else {
+                            deviceDate.add("-");
+                        }
                     }
                 }
             }

+ 3 - 0
ui/src/assets/styles/ruoyi.scss

@@ -285,6 +285,9 @@
  .companyUrgent {
    background: rgb(203, 0, 0);
  }
+ .companyNot {
+   background: rgba(255, 248, 112, 0.96);
+ }
 
  /* MOC背景颜色样式 */
  .cellMoc {

+ 0 - 303
ui/src/views/plant/targetmeasures/index.vue

@@ -72,14 +72,6 @@
             @click="handleUpdate(scope.row)"
             v-hasPermi="['plant:targetlist:edit']"
           >{{ $t('修改') }}</el-button>
-          <!--<el-button
-            size="mini"
-            type="text"
-            icon="el-icon-document"
-            @click="handleAction(scope.row)"
-            v-hasPermi="['plant:targetmeasures:edit']"
-            v-if="scope.row.parentId !== 0"
-          >{{ $t('行动项') }}</el-button>-->
           <el-button
             size="mini"
             type="text"
@@ -193,70 +185,6 @@
       </div>
     </el-dialog>
 
-    <!-- 行动项对话框 -->
-    <el-dialog v-dialogDrag :title="actionTitle" :visible.sync="actionOpen" width="1000px" append-to-body>
-      <el-form :inline="true" :model="actionQueryParams">
-        <el-form-item>
-          <el-button v-hasPermi="['plant:targetaction:add']" type="primary" @click="addAction()">{{ $t('新增') }}</el-button>
-        </el-form-item>
-      </el-form>
-      <el-table v-loading="actionLoading" :data="targetactionList" border>
-        <el-table-column :label="$t('行动项')" align="center" header-align="center" prop="actionItem">
-          <template slot-scope="scope">
-            <el-input v-if="scope.row.isEdit" v-model="scope.row.actionItem" :placeholder="$t('请输入') + $t('行动项')" />
-            <span v-else>{{ scope.row.actionItem }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('负责人')" align="center" header-align="center" prop="principal">
-          <template slot-scope="scope">
-            <el-select v-if="scope.row.isEdit" v-model="scope.row.principal" filterable multiple :placeholder="$t('请选择') + $t('人员')">
-              <el-option
-                v-for="dict in principalOptions"
-                :key="dict.staffid"
-                :label="dict.name"
-                :value="dict.staffid">
-                <span style="float: left">{{ dict.name }}</span>
-                <span style="float: right; color: #8492a6; font-size: 13px">{{ dict.staffid }}</span>
-              </el-option>
-            </el-select>
-            <span v-else>{{ scope.row.principalName }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('计划完成时间')" align="center" header-align="center" prop="expectedDate">
-          <template slot-scope="scope">
-            <el-date-picker
-              v-if="scope.row.isEdit"
-              v-model="scope.row.expectedDate"
-              type="date"
-              value-format="yyyy-MM-dd"
-              :placeholder="$t('请选择') + $t('计划完成时间')">
-            </el-date-picker>
-            <span v-else>{{ parseTime(scope.row.expectedDate, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('完成时间')" align="center" header-align="center" prop="completionDate">
-          <template slot-scope="scope">
-            <el-date-picker
-              v-if="scope.row.isEdit"
-              v-model="scope.row.completionDate"
-              type="date"
-              value-format="yyyy-MM-dd"
-              :placeholder="$t('请选择') + $t('完成时间')">
-            </el-date-picker>
-            <span v-else>{{ parseTime(scope.row.completionDate, '{y}-{m}-{d}') }}</span>
-          </template>
-        </el-table-column>
-        <el-table-column :label="$t('操作')" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
-          <template slot-scope="scope">
-            <el-button v-hasPermi="['plant:targetaction:edit']" type="text" size="small" v-if="scope.row.isEdit" @click="saveAction(scope.row)">{{ $t('保存') }}</el-button>
-            <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelAction(scope.row, scope.$index)">{{ $t('取消') }}</el-button>
-            <el-button v-hasPermi="['plant:targetaction:edit']" v-if="!scope.row.isEdit" @click="editAction(scope.row)" type="text" size="mini">{{ $t('编辑') }}</el-button>
-            <el-button v-hasPermi="['plant:targetaction:edit']" v-if="!scope.row.isEdit" type="text" size="small" @click="deleteAction(scope.row)">{{ $t('删除') }}</el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-    </el-dialog>
-
     <!-- 下载对话框 -->
     <el-dialog v-dialogDrag :title="download.title" :visible.sync="download.open" width="400px" append-to-body>
       <el-form :model="queryParams" ref="queryForm" label-width="68px">
@@ -361,7 +289,6 @@
 
 <script>
   import { getTargetmeasures, delTargetmeasures, addTargetmeasures, updateTargetmeasures, exportTargetmeasures, importTemplate} from "@/api/plant/targetmeasures";
-  import { listTargetaction, getTargetaction, delTargetaction, addTargetaction, updateTargetaction} from "@/api/plant/targetaction";
   import { listMeasures, getTargetlist } from "@/api/plant/targetlist";
   import { listStaffmgr } from "@/api/plant/staffmgr";
   import { treeselect } from "@/api/system/dept";
@@ -378,7 +305,6 @@
       return {
         // 遮罩层
         loading: true,
-        actionLoading: true,
         // 选中数组
         ids: [],
         // 非单个禁用
@@ -402,13 +328,11 @@
         principalOptions: [],
         // 弹出层标题
         title: "",
-        actionTitle: "",
         // 部门树选项
         deptOptions: undefined,
         clientHeight:300,
         // 是否显示弹出层
         open: false,
-        actionOpen: false,
         // 用户导入参数
         upload: {
           // 是否显示弹出层(用户导入)
@@ -471,11 +395,6 @@
         staffmgrPrincipal: {
           actualposts: null
         },
-        actionQueryParams: {
-          pageNum: 1,
-          pageSize: 20,
-          targetreviewId: null,
-        },
         // 表单参数
         form: {},
         // 表单校验
@@ -565,94 +484,6 @@
           this.principalOptions = response.rows;
         });
       },
-      //根据分数显示颜色提示
-      tableCellClassName({ row, column, rowIndex, columnIndex }) {
-        if (columnIndex == 8){
-          return this.changeColor(row.firstquarterStatus)
-        }
-        if (columnIndex == 10){
-          return this.changeColor(row.halfyearStatus)
-        }
-        if (columnIndex == 12){
-          return this.changeColor(row.threequarterStatus)
-        }
-        if (columnIndex == 14){
-          return this.changeColor(row.annualStatus)
-        }
-      },
-      changeColor (value) {
-        if (value == 1){
-          return 'cellFinish'
-        }else if( value == 2) {
-          return 'cellCare'
-        }else if( value == 3) {
-          return 'cellUrgent'
-        }
-      },
-      //变换季度状态
-      statusFinish (index, row) {
-        const id = row.measuresId;
-        getTargetmeasures(id).then(response => {
-          this.form = response.data;
-          this.$nextTick(() => {
-            if (index == 1) {
-              this.form.firstquarterStatus = 1;
-            }else if (index == 2) {
-              this.form.halfyearStatus = 1;
-            }else if (index == 3) {
-              this.form.threequarterStatus = 1;
-            }else if (index == 4) {
-              this.form.annualStatus = 1;
-            }
-            updateTargetmeasures(this.form).then(response => {
-              this.msgSuccess(this.$t('修改成功'));
-              this.getList();
-            });
-          })
-        });
-      },
-      statusCare (index, row) {
-        const id = row.measuresId;
-        getTargetmeasures(id).then(response => {
-          this.form = response.data;
-            this.$nextTick(() => {
-              if (index == 1) {
-                this.form.firstquarterStatus = 2;
-              }else if (index == 2) {
-                this.form.halfyearStatus = 2;
-              }else if (index == 3) {
-                this.form.threequarterStatus = 2;
-              }else if (index == 4) {
-                this.form.annualStatus = 2;
-              }
-              updateTargetmeasures(this.form).then(response => {
-                this.msgSuccess(this.$t('修改成功'));
-                this.getList();
-              });
-            })
-        });
-      },
-      statusUrgent (index, row) {
-        const id = row.measuresId;
-        getTargetmeasures(id).then(response => {
-          this.form = response.data;
-          this.$nextTick(() => {
-            if (index == 1) {
-              this.form.firstquarterStatus = 3;
-            }else if (index == 2) {
-              this.form.halfyearStatus = 3;
-            }else if (index == 3) {
-              this.form.threequarterStatus = 3;
-            }else if (index == 4) {
-              this.form.annualStatus = 3;
-            }
-            updateTargetmeasures(this.form).then(response => {
-              this.msgSuccess(this.$t('修改成功'));
-              this.getList();
-            });
-          })
-        });
-      },
       // 取消按钮
       cancel() {
         this.open = false;
@@ -692,24 +523,6 @@
         };
         this.resetForm("form");
       },
-      //行动项表单重置
-      actionReset() {
-        this.actionForm = {
-          id: null,
-          targetreviewId: null,
-          actionItem: null,
-          principal: null,
-          principalName: null,
-          expectedDate: null,
-          completionDate: null,
-          delFlag: null,
-          createrCode: null,
-          createdate: null,
-          updaterCode: null,
-          updatedate: null,
-        };
-        this.resetForm("actionForm");
-      },
       /** 搜索按钮操作 */
       handleQuery() {
         this.queryParams.pageNum = 1;
@@ -806,122 +619,6 @@
           this.msgSuccess(this.$t('删除成功'));
         })
       },
-      /** 行动项按钮操作 */
-      handleAction(row) {
-        let _this = this
-        this.actionReset();
-        this.actionLoading = true;
-        this.actionQueryParams.targetreviewId = row.measuresId
-        listTargetaction(this.actionQueryParams).then(response => {
-          response.rows.forEach(element => {
-            element["isEdit"] = false
-          });
-          response.rows.forEach(element => {
-            element["isAdd"] = false
-          });
-          this.targetactionList = response.rows;
-          this.targetactionList.forEach(function (value,key,arr) {
-            let principal = null;
-            let principalName = null;
-            if (value.principal != null) {
-              principal = value.principal.split(",");
-              principal.forEach(function (id, index) {
-                _this.principalOptions.forEach(function (item) {
-                  if (item.staffid === id) {
-                    if (index === 0) {
-                      principalName = item.name
-                    }else {
-                      principalName = principalName + "," + item.name
-                    }
-                  }
-                });
-              });
-            }
-            _this.targetactionList[key].principal = principal;
-            _this.targetactionList[key].principalName = principalName;
-          })
-          this.actionLoading = false;
-          this.actionOpen = true;
-          this.actionTitle = this.$t('行动项');
-        });
-      },
-      /** 新增行动项按钮操作 */
-      addAction() {
-        this.targetactionList.push({
-          targetreviewId: this.actionQueryParams.targetreviewId,
-          actionItem: '',
-          expectedDate: '',
-          completionDate: '',
-          isEdit: true,
-          isAdd: true
-        });
-      },
-      /** 保存行动项按钮操作 */
-      saveAction(row) {
-        row.isEdit = false;
-        var that = this;
-        that.actionLoading = true;
-        this.actionForm = row;
-        this.actionForm.targetreviewId = this.actionQueryParams.targetreviewId;
-        var principal = null;
-        this.actionForm.principal.forEach(function (value,key,arr) {
-          if (key != 0) {
-            principal = principal + "," + value;
-          }else if (key == 0) {
-            principal = value;
-          }
-        })
-        this.actionForm.principal = principal;
-        if (row.isAdd == true) {
-          addTargetaction(this.actionForm).then(response => {
-            this.msgSuccess(this.$t('新增成功'));
-            this.actionOpen = false;
-            this.getList();
-          });
-        }else {
-          updateTargetaction(this.actionForm).then(response => {
-            this.msgSuccess(this.$t('修改成功'));
-            this.actionOpen = false;
-            this.getList();
-          });
-        }
-      },
-      /** 取消行动项按钮操作 */
-      cancelAction(row, index) {
-        // 如果是新增的数据
-        if (row.isAdd) {
-          this.targetactionList.splice(index, 1)
-        } else {
-          // 不是新增的数据  还原数据
-          for (const i in row.oldRow) {
-            row[i] = row.oldRow[i]
-          }
-          row.isEdit = false
-        }
-      },
-      /** 修改行动项按钮操作 */
-      editAction(row) {
-        // 备份原始数据
-        row['oldRow'] = JSON.parse(JSON.stringify(row));
-        this.$nextTick(() => {
-          row.isEdit = true;
-        })
-      },
-      /** 删除行动项按钮操作 */
-      deleteAction(row) {
-        const ids = row.id || this.ids;
-        this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
-          confirmButtonText: this.$t('确定'),
-          cancelButtonText: this.$t('取消'),
-          type: "warning"
-        }).then(function() {
-          return delTargetaction(ids);
-        }).then(() => {
-          this.getList();
-          this.actionOpen = false;
-          this.msgSuccess(this.$t('删除成功'));
-        })
-      },
       /** 导出按钮操作 */
       handleExport() {
         this.download.open = true;

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

@@ -974,6 +974,9 @@ export default {
       if (value === "-"){
         return 'companyUrgent'
       }
+      if (value === "尚未开始培训") {
+        return 'companyNot'
+      }
     },
     /** 查询培训成绩列表 */
     getList() {