Преглед на файлове

1.修改文件上传大小限制为500M
2.目标协议查询报错
3.目标录入导入excel某些数据项可以为空
4.目标回顾查询报错
5.目标管理人员相关可以查询到离职人员信息
6.装置程序清单新增/修改时可以根据回顾频率和回顾时间计算出下次回顾时间

jiangbiao преди 3 години
родител
ревизия
9ad1be8739

+ 2 - 2
master/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java

@@ -21,9 +21,9 @@ import com.ruoyi.framework.config.RuoYiConfig;
 public class FileUploadUtils
 {
     /**
-     * 默认大小 50M
+     * 默认大小 500M
      */
-    public static final long DEFAULT_MAX_SIZE = 50 * 1024 * 1024;
+    public static final long DEFAULT_MAX_SIZE = 500 * 1024 * 1024;
 
     /**
      * 默认的文件名最大长度 100

+ 1 - 1
master/src/main/java/com/ruoyi/project/plant/controller/TTargetagreementController.java

@@ -81,7 +81,7 @@ public class TTargetagreementController extends BaseController
         List<SysDictData> partnersDict = iSysDictTypeService.selectDictDataByType("PARTNERS");
         for (TTargetagreement t : list) {
             List<TTargetyardstick> tTargetyardsticks = tTargetyardstickService.selectTTargetyardstickByAgreementId(t.getId());
-            if (!t.getActualpost().equals("24")) {
+            if (!"24".equals(t.getActualpost())) {
                 for (TTargetyardstick y : tTargetyardsticks) {
                     if (y.getPartners() != null) {
                         String[] partners = y.getPartners().split(",");

+ 43 - 41
master/src/main/java/com/ruoyi/project/plant/controller/TTargetlistController.java

@@ -190,57 +190,59 @@ public class TTargetlistController extends BaseController
             try {
                 logger.info("读取行数:" + i);
                 Row row = sheet.getRow(i);
-                int cellNum = row.getPhysicalNumberOfCells();
+                int cellNum = row.getLastCellNum();
                 TTargetlist entity = new TTargetlist();
                 String year = null;
                 for (int j = 0; j < cellNum; j++) {
                     Cell cell = row.getCell(j);
-                    cell.setCellType(CellType.STRING);
-                    String cellValue = ExcelUtils.getCellValue(cell);
-                    logger.info("cellValue:" + cellValue);
-                    if (j == 0) {
-                        for (SysDictData p : plant) {
-                            if (p.getDictLabel().equals(cellValue.trim())) {
-                                entity.setPlantCode(p.getDictValue());//装置名称
+                    if (cell != null) {
+                        cell.setCellType(CellType.STRING);
+                        String cellValue = ExcelUtils.getCellValue(cell);
+                        logger.info("cellValue:" + cellValue);
+                        if (j == 0) {
+                            for (SysDictData p : plant) {
+                                if (p.getDictLabel().equals(cellValue.trim())) {
+                                    entity.setPlantCode(p.getDictValue());//装置名称
+                                }
                             }
-                        }
-                    } else if (j == 1) {
-                        entity.setItem(cellValue);//序号
-                    } else if (j == 2) {
-                        entity.setDescription(cellValue);//内容
-                    } else if (j == 3) {
-                        entity.setTargets(cellValue);//目标
-                    } else if (j == 4) {
-                        if (!cellValue.equals("")) {
-                            entity.setYear(cellValue);//年度
-                            year = cellValue;
-                        }
-                    } else if (j == 5) {
-                        if (!cellValue.equals("")) {
-                            for (TTargetlist t : tTargetlists) {
-                                if (t.getItem().equals(cellValue.trim()) && t.getYear().equals(year)) {
-                                    entity.setParentId(t.getId());//父菜单ID
+                        } else if (j == 1) {
+                            entity.setItem(cellValue);//序号
+                        } else if (j == 2) {
+                            entity.setDescription(cellValue);//内容
+                        } else if (j == 3) {
+                            entity.setTargets(cellValue);//目标
+                        } else if (j == 4) {
+                            if (!cellValue.equals("")) {
+                                entity.setYear(cellValue);//年度
+                                year = cellValue;
+                            }
+                        } else if (j == 5) {
+                            if (!cellValue.equals("")) {
+                                for (TTargetlist t : tTargetlists) {
+                                    if (t.getItem().equals(cellValue.trim()) && t.getYear().equals(year)) {
+                                        entity.setParentId(t.getId());//父菜单ID
+                                    }
                                 }
+                            } else {
+                                entity.setParentId(Long.parseLong("0"));
                             }
-                        }else {
-                            entity.setParentId(Long.parseLong("0"));
-                        }
-                    } else if (j == 6) {
-                        entity.setYardstick(cellValue);//判断标准
-                    } else if (j == 7) {
-                        for (SysDictData p : partners) {
-                            if (p.getDictLabel().equals(cellValue)) {
-                                entity.setPartners(p.getDictValue());//合作者
+                        } else if (j == 6) {
+                            entity.setYardstick(cellValue);//判断标准
+                        } else if (j == 7) {
+                            for (SysDictData p : partners) {
+                                if (p.getDictLabel().equals(cellValue)) {
+                                    entity.setPartners(p.getDictValue());//合作者
+                                }
                             }
-                        }
-                    } else if (j == 8) {
-                        for (SysDept d : dept) {
-                            if (d.getDeptName().equals(cellValue.trim())) {
-                                entity.setDeptId(d.getDeptId());//部门编号
+                        } else if (j == 8) {
+                            for (SysDept d : dept) {
+                                if (d.getDeptName().equals(cellValue.trim())) {
+                                    entity.setDeptId(d.getDeptId());//部门编号
+                                }
                             }
+                        } else if (j == 9) {
+                            entity.setRemarks(cellValue);//备注
                         }
-                    } else if (j == 9) {
-                        entity.setRemarks(cellValue);//备注
                     }
                 }
                 entity.setCreaterCode(userId.toString());

+ 6 - 2
master/src/main/java/com/ruoyi/project/plant/controller/TTargetreviewController.java

@@ -13,6 +13,7 @@ import com.ruoyi.common.utils.document.DocumentHandler;
 import com.ruoyi.common.utils.document.PDFTemplateUtil;
 import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.project.plant.domain.TStaffmgr;
 import com.ruoyi.project.plant.domain.TTargetlist;
 import com.ruoyi.project.plant.service.ITStaffmgrService;
 import com.ruoyi.project.plant.service.ITTargetlistService;
@@ -77,10 +78,13 @@ public class TTargetreviewController extends BaseController
                 String[] principal = t.getPrincipal().split(",");
                 String name = "";
                 for (int i = 0; i < principal.length; i++) {
+                    TStaffmgr tStaffmgr = tStaffmgrService.selectTStaffmgrByStaffId(principal[i]);
                     if (i == 0) {
-                        name = tStaffmgrService.selectTStaffmgrByStaffId(principal[i]).getName();
+                        if (tStaffmgr!=null) {
+                            name = tStaffmgr.getName();
+                        }
                     }else {
-                        name = name + "," + tStaffmgrService.selectTStaffmgrByStaffId(principal[i]).getName();
+                        name = name + "," + tStaffmgr.getName();
                     }
                 }
                 t.setPrincipalName(name);

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

@@ -120,7 +120,7 @@
                 or team = 14
                 or team = 16
             </if>
-            and d.del_flag = 0
+            and (d.del_flag = 0 or d.del_flag = 9)
         </where>
         <!-- 数据范围过滤 -->
         ${params.dataScope}

+ 14 - 2
ui/src/views/components/PlantProgList/index.vue

@@ -225,7 +225,7 @@
         <el-row>
           <el-col :span="12">
             <el-form-item :label="$t('回顾频率')" prop="reviewFrequency" v-if="this.itemNum !== '5'">
-              <el-input v-model="form.reviewFrequency" :placeholder="$t('请输入') + $t('回顾频率')" />
+              <el-input v-model="form.reviewFrequency" :placeholder="$t('请输入') + $t('回顾频率')" @change="getNextDate()"/>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -234,6 +234,7 @@
                               v-model="form.reviewdate"
                               type="date"
                               value-format="yyyy-MM-dd"
+                              @change="getNextDate()"
                               :placeholder="$t('请选择') + $t('回顾日期')">
               </el-date-picker>
             </el-form-item>
@@ -359,7 +360,7 @@
     <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
       <el-upload
         ref="doc"
-        :limit="50"
+        :limit="500"
         :headers="doc.headers"
         :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
         :disabled="doc.isUploading"
@@ -492,6 +493,7 @@ import RcData from "./rcData";
 import ClassifyData from "./classifyData";
 
 import {formatDate} from "../../../utils";
+import dayjs from "dayjs";
 
 export default {
   name: "index",
@@ -684,6 +686,15 @@ export default {
 
   },
   methods: {
+    getNextDate(){
+      var reviewFrequency=this.form.reviewFrequency;
+      if (this.form.reviewdate!= null&&reviewFrequency!= null){
+        var s = reviewFrequency.substring(0, reviewFrequency.indexOf("/"));
+        console.log(s);
+        console.log(365/s);
+        this.form.nextreviewdate = dayjs(new Date(this.form.reviewdate)).add(365/s,'day').format("YYYY-MM-DD");
+      }
+    },
     /** 查询装置程序清单列表 */
     getList() {
       this.loading = true;
@@ -796,6 +807,7 @@ export default {
       this.reset();
       const id = row.id || this.ids
       getPlantproglist(id).then(response => {
+        console.log(response)
         this.form = response.data;
         this.open = true;
         this.title = this.$t('修改')  + this.$t('装置程序清单');