jiangbiao 1 年之前
父節點
當前提交
b448baf02e

+ 298 - 301
master/src/main/java/com/ruoyi/project/production/controller/TPpeMainController.java

@@ -76,12 +76,10 @@ public class TPpeMainController extends BaseController {
                 main.setCmldefRemark(tPpeCmldefLockers.get(0).getRemarks());
             List<TPpeStaffLocker> tPpeStaffLockers = tPpeStaffLockerService.selectTPpeStaffLockerListByMainId(main.getId());
             main.setStaffLockers(tPpeStaffLockers);
-            if (CollectionUtils.isNotEmpty(tPpeStaffLockers))
-                main.setStaffRemark(tPpeStaffLockers.get(0).getRemarks());
+            if (CollectionUtils.isNotEmpty(tPpeStaffLockers)) main.setStaffRemark(tPpeStaffLockers.get(0).getRemarks());
             List<TPpeWardrobe> tPpeWardrobes = tPpeWardrobeService.selectTPpeWardrobeListByMainId(main.getId());
             main.setWardrobes(tPpeWardrobes);
-            if (CollectionUtils.isNotEmpty(tPpeWardrobes))
-                main.setWardrobeRemark(tPpeWardrobes.get(0).getRemarks());
+            if (CollectionUtils.isNotEmpty(tPpeWardrobes)) main.setWardrobeRemark(tPpeWardrobes.get(0).getRemarks());
         }
         return AjaxResult.success(main);
     }
@@ -204,295 +202,319 @@ public class TPpeMainController extends BaseController {
             row3.setHeightInPoints(80);
             // endregion
             int lastRowNum = 6; //记录最后一行
+            int startRow = 8;
+            int endRow = 13;
+            int startCol = 14;
+            int endCol = 17;
             //region 第一张表格
-            //第四行
-            XSSFRow row4 = sheet.createRow(3);
-            row4.setHeightInPoints(44.5F);
-            createVoidCell(0, 18, row4);
-            XSSFCell row4Cell = row4.createCell(0);
-            row4Cell.setCellValue("自行车棚员工PPE柜");
-            for (Cell cell : row4) {
-                cell.setCellStyle(getStyle(workbook, "Arial", 22, true));
-            }
-
-            //第五行
-            XSSFRow row5 = sheet.createRow(4);
-            row5.setHeightInPoints(37.5F);
-            createVoidCell(0, 18, row5);
-            XSSFCell row5Cell1 = row5.createCell(0);
-            row5Cell1.setCellValue("PPE种类");
-            row5Cell1.setCellStyle(getStyle(workbook, "Arial", 18, true));
-            XSSFCell row5Cell2 = row5.createCell(1);
-            row5Cell2.setCellValue("检查内容");
-            for (Cell cell : row5) {
-                if (cell.getColumnIndex() != 0) {
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+            String remarks = null;
+            List<TPpeStaffLocker> tPpeStaffLockers = tPpeStaffLockerService.selectTPpeStaffLockerListByMainId(main.getId());
+            if (CollectionUtils.isNotEmpty(tPpeStaffLockers)) {
+                startRow += tPpeStaffLockers.size() + 2;
+                endRow += tPpeStaffLockers.size() + 2;
+                //第四行
+                XSSFRow row4 = sheet.createRow(3);
+                row4.setHeightInPoints(44.5F);
+                createVoidCell(0, 18, row4);
+                XSSFCell row4Cell = row4.createCell(0);
+                row4Cell.setCellValue("自行车棚员工PPE柜");
+                for (Cell cell : row4) {
+                    cell.setCellStyle(getStyle(workbook, "Arial", 22, true));
                 }
-            }
-
 
-            //第六行
-            XSSFRow row6 = sheet.createRow(5);
-            row6.setHeightInPoints(53.5F);
-            createVoidCell(0, 18, row6);
-            XSSFCell row6Cell2 = row6.createCell(1);
-            row6Cell2.setCellValue("应配备岗位");
-            XSSFCell row6Cell3 = row6.createCell(2);
-            row6Cell3.setCellValue("是否配备①");
-            XSSFCell row6Cell6 = row6.createCell(5);
-            row6Cell6.setCellValue("是否无破损、未被污染");
-            XSSFCell row6Cell8 = row6.createCell(9);
-            row6Cell8.setCellValue("摆放符合要求⑥");
-            XSSFCell row6Cell10 = row6.createCell(11);
-            row6Cell10.setCellValue("是否按要求贴“使用时间卡”②");
-            XSSFCell row6Cell12 = row6.createCell(13);
-            row6Cell12.setCellValue("是否在使用有效期内③");
-            XSSFCell row6Cell14 = row6.createCell(15);
-            row6Cell14.setCellValue("检验合格的标识在有效期内④");
-            XSSFCell row6Cell16 = row6.createCell(17);
-            row6Cell16.setCellValue("是否配有专用湿巾");
-            for (Cell cell : row6) {
-                if (cell.getColumnIndex() != 0) {
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                //第五行
+                XSSFRow row5 = sheet.createRow(4);
+                row5.setHeightInPoints(37.5F);
+                createVoidCell(0, 18, row5);
+                XSSFCell row5Cell1 = row5.createCell(0);
+                row5Cell1.setCellValue("PPE种类");
+                row5Cell1.setCellStyle(getStyle(workbook, "Arial", 18, true));
+                XSSFCell row5Cell2 = row5.createCell(1);
+                row5Cell2.setCellValue("检查内容");
+                for (Cell cell : row5) {
+                    if (cell.getColumnIndex() != 0) {
+                        cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                    }
                 }
-            }
 
-            //第七行
-            XSSFRow row7 = sheet.createRow(6);
-            row7.setHeightInPoints(40);
-            createVoidCell(0, 18, row7);
-            row7.createCell(2).setCellValue("是");
-            row7.createCell(3).setCellValue("N.A");
-            row7.createCell(4).setCellValue("否");
-            row7.createCell(5).setCellValue("是");
-            row7.createCell(7).setCellValue("否");
-            row7.createCell(9).setCellValue("是");
-            row7.createCell(10).setCellValue("否");
-            row7.createCell(11).setCellValue("是");
-            row7.createCell(12).setCellValue("否");
-            row7.createCell(13).setCellValue("是");
-            row7.createCell(14).setCellValue("否");
-            row7.createCell(15).setCellValue("是");
-            row7.createCell(16).setCellValue("否");
-            row7.createCell(17).setCellValue("是");
-            row7.createCell(18).setCellValue("否");
-            for (Cell cell : row7) {
-                if (cell.getColumnIndex() != 0 && cell.getColumnIndex() != 1) {
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, false));
-                } else {
-                    cell.setCellStyle(getStyle(workbook, "Arial", 18, true));
-                }
-            }
-            //合并
-            sheet.addMergedRegion(new CellRangeAddress(3, 3, 0, 18));
-            sheet.addMergedRegion(new CellRangeAddress(4, 4, 1, 18));
-            sheet.addMergedRegion(new CellRangeAddress(4, 6, 0, 0));
-            sheet.addMergedRegion(new CellRangeAddress(5, 6, 1, 1));
-            sheet.addMergedRegion(new CellRangeAddress(5, 5, 2, 4));
-            sheet.addMergedRegion(new CellRangeAddress(5, 5, 5, 8));
-            sheet.addMergedRegion(new CellRangeAddress(5, 5, 9, 10));
-            sheet.addMergedRegion(new CellRangeAddress(5, 5, 11, 12));
-            sheet.addMergedRegion(new CellRangeAddress(5, 5, 13, 14));
-            sheet.addMergedRegion(new CellRangeAddress(5, 5, 15, 16));
-            sheet.addMergedRegion(new CellRangeAddress(5, 5, 17, 18));
-            sheet.addMergedRegion(new CellRangeAddress(6, 6, 5, 6));
-            sheet.addMergedRegion(new CellRangeAddress(6, 6, 7, 8));
 
-            List<TPpeStaffLocker> tPpeStaffLockers = tPpeStaffLockerService.selectTPpeStaffLockerListByMainId(main.getId());
-            String remarks = "";
-            for (int i = 0; i < tPpeStaffLockers.size(); i++) {
-                TPpeStaffLocker tPpeStaffLocker = tPpeStaffLockers.get(i);
-                lastRowNum++;
-                XSSFRow row = sheet.createRow(lastRowNum);
-                row.setHeightInPoints(70);
-                createVoidCell(0, 18, row);
-                row.createCell(0).setCellValue(tPpeStaffLocker.getPpeType());
-                if (tPpeStaffLocker.getUsePost().contains(",")) {
-                    tPpeStaffLocker.setUsePost(tPpeStaffLocker.getUsePost().replace(",", "、"));
+                //第六行
+                XSSFRow row6 = sheet.createRow(5);
+                row6.setHeightInPoints(53.5F);
+                createVoidCell(0, 18, row6);
+                XSSFCell row6Cell2 = row6.createCell(1);
+                row6Cell2.setCellValue("应配备岗位");
+                XSSFCell row6Cell3 = row6.createCell(2);
+                row6Cell3.setCellValue("是否配备①");
+                XSSFCell row6Cell6 = row6.createCell(5);
+                row6Cell6.setCellValue("是否无破损、未被污染");
+                XSSFCell row6Cell8 = row6.createCell(9);
+                row6Cell8.setCellValue("摆放符合要求⑥");
+                XSSFCell row6Cell10 = row6.createCell(11);
+                row6Cell10.setCellValue("是否按要求贴“使用时间卡”②");
+                XSSFCell row6Cell12 = row6.createCell(13);
+                row6Cell12.setCellValue("是否在使用有效期内③");
+                XSSFCell row6Cell14 = row6.createCell(15);
+                row6Cell14.setCellValue("检验合格的标识在有效期内④");
+                XSSFCell row6Cell16 = row6.createCell(17);
+                row6Cell16.setCellValue("是否配有专用湿巾");
+                for (Cell cell : row6) {
+                    if (cell.getColumnIndex() != 0) {
+                        cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                    }
                 }
-                row.createCell(1).setCellValue(tPpeStaffLocker.getUsePost());
-                row.createCell(2).setCellValue(getValue("是", tPpeStaffLocker.getIsEquip()));
-                row.createCell(3).setCellValue(getValue("N.A", tPpeStaffLocker.getIsEquip(), tPpeStaffLocker.getUsePost()));
-                row.createCell(4).setCellValue(getValue("否", tPpeStaffLocker.getIsEquip()));
-                row.createCell(5).setCellValue(getValue("是", tPpeStaffLocker.getIsPollution()));
-                row.createCell(7).setCellValue(getValue("否", tPpeStaffLocker.getIsPollution()));
-                row.createCell(9).setCellValue(getValue("是", tPpeStaffLocker.getPutAsRequired()));
-                row.createCell(10).setCellValue(getValue("否", tPpeStaffLocker.getPutAsRequired()));
-                row.createCell(11).setCellValue(getValue("是", tPpeStaffLocker.getIsRequire()));
-                row.createCell(12).setCellValue(getValue("否", tPpeStaffLocker.getIsRequire()));
-                row.createCell(13).setCellValue(getValue("是", tPpeStaffLocker.getIsValidity()));
-                row.createCell(14).setCellValue(getValue("否", tPpeStaffLocker.getIsValidity()));
-                row.createCell(15).setCellValue(getValue("是", tPpeStaffLocker.getIsIdentification()));
-                row.createCell(16).setCellValue(getValue("否", tPpeStaffLocker.getIsIdentification()));
-                row.createCell(17).setCellValue(getValue("是", tPpeStaffLocker.getIsWetTissue()));
-                row.createCell(18).setCellValue(getValue("否", tPpeStaffLocker.getIsWetTissue()));
-                for (Cell cell : row) {
-                    if (cell.getColumnIndex() == 0 || cell.getColumnIndex() == 1) {
-                        if (i % 2 == 0 && cell.getColumnIndex() != 18 && cell.getColumnIndex() != 17)
-                            cell.setCellStyle(getStyle(workbook, "宋体", 18, false, true));
-                        else
-                            cell.setCellStyle(getStyle(workbook, "宋体", 18, false));
-                    } else if (StringUtils.isNotEmpty(cell.getStringCellValue()) && ("/".equals(cell.getStringCellValue()) || "N.A".equals(cell.getStringCellValue()))) {
-                        if (i % 2 == 0 && cell.getColumnIndex() != 18 && cell.getColumnIndex() != 17) {
-                            cell.setCellStyle(getStyle(workbook, "Arial", 18, false, true));
-                        } else {
-                            cell.setCellStyle(getStyle(workbook, "Arial", 18, false));
-                        }
+
+                //第七行
+                XSSFRow row7 = sheet.createRow(6);
+                row7.setHeightInPoints(40);
+                createVoidCell(0, 18, row7);
+                row7.createCell(2).setCellValue("是");
+                row7.createCell(3).setCellValue("N.A");
+                row7.createCell(4).setCellValue("否");
+                row7.createCell(5).setCellValue("是");
+                row7.createCell(7).setCellValue("否");
+                row7.createCell(9).setCellValue("是");
+                row7.createCell(10).setCellValue("否");
+                row7.createCell(11).setCellValue("是");
+                row7.createCell(12).setCellValue("否");
+                row7.createCell(13).setCellValue("是");
+                row7.createCell(14).setCellValue("否");
+                row7.createCell(15).setCellValue("是");
+                row7.createCell(16).setCellValue("否");
+                row7.createCell(17).setCellValue("是");
+                row7.createCell(18).setCellValue("否");
+                for (Cell cell : row7) {
+                    if (cell.getColumnIndex() != 0 && cell.getColumnIndex() != 1) {
+                        cell.setCellStyle(getStyle(workbook, "等线", 18, false));
                     } else {
-                        if (i % 2 == 0 && cell.getColumnIndex() != 18 && cell.getColumnIndex() != 17) {
-                            cell.setCellStyle(getStyle(workbook, "Wingdings 2", 18, false, true));
+                        cell.setCellStyle(getStyle(workbook, "Arial", 18, true));
+                    }
+                }
+                //合并
+                sheet.addMergedRegion(new CellRangeAddress(3, 3, 0, 18));
+                sheet.addMergedRegion(new CellRangeAddress(4, 4, 1, 18));
+                sheet.addMergedRegion(new CellRangeAddress(4, 6, 0, 0));
+                sheet.addMergedRegion(new CellRangeAddress(5, 6, 1, 1));
+                sheet.addMergedRegion(new CellRangeAddress(5, 5, 2, 4));
+                sheet.addMergedRegion(new CellRangeAddress(5, 5, 5, 8));
+                sheet.addMergedRegion(new CellRangeAddress(5, 5, 9, 10));
+                sheet.addMergedRegion(new CellRangeAddress(5, 5, 11, 12));
+                sheet.addMergedRegion(new CellRangeAddress(5, 5, 13, 14));
+                sheet.addMergedRegion(new CellRangeAddress(5, 5, 15, 16));
+                sheet.addMergedRegion(new CellRangeAddress(5, 5, 17, 18));
+                sheet.addMergedRegion(new CellRangeAddress(6, 6, 5, 6));
+                sheet.addMergedRegion(new CellRangeAddress(6, 6, 7, 8));
+                remarks = "";
+                for (int i = 0; i < tPpeStaffLockers.size(); i++) {
+                    TPpeStaffLocker tPpeStaffLocker = tPpeStaffLockers.get(i);
+                    lastRowNum++;
+                    XSSFRow row = sheet.createRow(lastRowNum);
+                    row.setHeightInPoints(70);
+                    createVoidCell(0, 18, row);
+                    row.createCell(0).setCellValue(tPpeStaffLocker.getPpeType());
+                    if (tPpeStaffLocker.getUsePost().contains(",")) {
+                        tPpeStaffLocker.setUsePost(tPpeStaffLocker.getUsePost().replace(",", "、"));
+                    }
+                    row.createCell(1).setCellValue(tPpeStaffLocker.getUsePost());
+                    row.createCell(2).setCellValue(getValue("是", tPpeStaffLocker.getIsEquip()));
+                    row.createCell(3).setCellValue(getValue("N.A", tPpeStaffLocker.getIsEquip(), tPpeStaffLocker.getUsePost()));
+                    row.createCell(4).setCellValue(getValue("否", tPpeStaffLocker.getIsEquip()));
+                    row.createCell(5).setCellValue(getValue("是", tPpeStaffLocker.getIsPollution()));
+                    row.createCell(7).setCellValue(getValue("否", tPpeStaffLocker.getIsPollution()));
+                    row.createCell(9).setCellValue(getValue("是", tPpeStaffLocker.getPutAsRequired()));
+                    row.createCell(10).setCellValue(getValue("否", tPpeStaffLocker.getPutAsRequired()));
+                    row.createCell(11).setCellValue(getValue("是", tPpeStaffLocker.getIsRequire()));
+                    row.createCell(12).setCellValue(getValue("否", tPpeStaffLocker.getIsRequire()));
+                    row.createCell(13).setCellValue(getValue("是", tPpeStaffLocker.getIsValidity()));
+                    row.createCell(14).setCellValue(getValue("否", tPpeStaffLocker.getIsValidity()));
+                    row.createCell(15).setCellValue(getValue("是", tPpeStaffLocker.getIsIdentification()));
+                    row.createCell(16).setCellValue(getValue("否", tPpeStaffLocker.getIsIdentification()));
+                    row.createCell(17).setCellValue(getValue("是", tPpeStaffLocker.getIsWetTissue()));
+                    row.createCell(18).setCellValue(getValue("否", tPpeStaffLocker.getIsWetTissue()));
+                    for (Cell cell : row) {
+                        if (cell.getColumnIndex() == 0 || cell.getColumnIndex() == 1) {
+                            if (i % 2 == 0 && cell.getColumnIndex() != 18 && cell.getColumnIndex() != 17)
+                                cell.setCellStyle(getStyle(workbook, "宋体", 18, false, true));
+                            else cell.setCellStyle(getStyle(workbook, "宋体", 18, false));
+                        } else if (StringUtils.isNotEmpty(cell.getStringCellValue()) && ("/".equals(cell.getStringCellValue()) || "N.A".equals(cell.getStringCellValue()))) {
+                            if (i % 2 == 0 && cell.getColumnIndex() != 18 && cell.getColumnIndex() != 17) {
+                                cell.setCellStyle(getStyle(workbook, "Arial", 18, false, true));
+                            } else {
+                                cell.setCellStyle(getStyle(workbook, "Arial", 18, false));
+                            }
                         } else {
-                            cell.setCellStyle(getStyle(workbook, "Wingdings 2", 18, false));
+                            if (i % 2 == 0 && cell.getColumnIndex() != 18 && cell.getColumnIndex() != 17) {
+                                cell.setCellStyle(getStyle(workbook, "Wingdings 2", 18, false, true));
+                            } else {
+                                cell.setCellStyle(getStyle(workbook, "Wingdings 2", 18, false));
+                            }
                         }
                     }
+                    sheet.addMergedRegion(new CellRangeAddress(row.getRowNum(), row.getRowNum(), 5, 6));
+                    sheet.addMergedRegion(new CellRangeAddress(row.getRowNum(), row.getRowNum(), 7, 8));
+                    remarks = tPpeStaffLocker.getRemarks();
                 }
-                sheet.addMergedRegion(new CellRangeAddress(row.getRowNum(), row.getRowNum(), 5, 6));
-                sheet.addMergedRegion(new CellRangeAddress(row.getRowNum(), row.getRowNum(), 7, 8));
-                remarks = tPpeStaffLocker.getRemarks();
-            }
-            sheet.addMergedRegion(new CellRangeAddress(7, lastRowNum, 17, 17));
-            sheet.addMergedRegion(new CellRangeAddress(7, lastRowNum, 18, 18));
-            XSSFRow row21 = sheet.createRow(++lastRowNum);
-            row21.setHeightInPoints(100);
-            createVoidCell(0, 18, row21);
-            row21.createCell(0).setCellValue("备注");
-            row21.createCell(1).setCellValue(remarks);
-            for (Cell cell : row21) {
-                if (cell.getColumnIndex() == 0)
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, true));
-                else
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, false));
+                sheet.addMergedRegion(new CellRangeAddress(7, lastRowNum, 17, 17));
+                sheet.addMergedRegion(new CellRangeAddress(7, lastRowNum, 18, 18));
+                XSSFRow row21 = sheet.createRow(++lastRowNum);
+                row21.setHeightInPoints(100);
+                createVoidCell(0, 18, row21);
+                row21.createCell(0).setCellValue("备注");
+                row21.createCell(1).setCellValue(remarks);
+                for (Cell cell : row21) {
+                    if (cell.getColumnIndex() == 0) cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                    else cell.setCellStyle(getStyle(workbook, "等线", 18, false));
+                }
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 1, 18));
+                sheet.createRow(++lastRowNum).setHeightInPoints(40);
             }
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 1, 18));
-            sheet.createRow(++lastRowNum).setHeightInPoints(40);
             // endregion
 
             //region 第二张表格
             remarks = "";
-            XSSFRow row23 = sheet.createRow(++lastRowNum);
-            row23.setHeightInPoints(40);
-            createVoidCell(0, 10, row23);
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 0, 10));
-            row23.createCell(0).setCellValue("自行车棚防化靴/防化服柜");
-
-            XSSFRow row24 = sheet.createRow(++lastRowNum);
-            row24.setHeightInPoints(37.5F);
-            createVoidCell(0, 10, row24);
-            XSSFCell row24Cell1 = row24.createCell(0);
-            row24Cell1.setCellValue("PPE种类");
-            row24Cell1.setCellStyle(getStyle(workbook, "Arial", 18, true));
-            XSSFCell row24Cell2 = row24.createCell(1);
-            row24Cell2.setCellValue("检查内容");
-            for (Cell cell : row24) {
-                if (cell.getColumnIndex() != 0) {
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+            List<TPpeCmldefLocker> tPpeCmldefLockers = tPpeCmldefLockerService.selectTPpeCmldefLockerListByMainId(main.getId());
+            if (CollectionUtils.isNotEmpty(tPpeCmldefLockers)) {
+                startRow += tPpeCmldefLockers.size() + 6;
+                endRow += tPpeCmldefLockers.size() + 6;
+                XSSFRow row23 = sheet.createRow(++lastRowNum);
+                row23.setHeightInPoints(40);
+                createVoidCell(0, 10, row23);
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 0, 10));
+                row23.createCell(0).setCellValue("自行车棚防化靴/防化服柜");
+
+                XSSFRow row24 = sheet.createRow(++lastRowNum);
+                row24.setHeightInPoints(37.5F);
+                createVoidCell(0, 10, row24);
+                XSSFCell row24Cell1 = row24.createCell(0);
+                row24Cell1.setCellValue("PPE种类");
+                row24Cell1.setCellStyle(getStyle(workbook, "Arial", 18, true));
+                XSSFCell row24Cell2 = row24.createCell(1);
+                row24Cell2.setCellValue("检查内容");
+                for (Cell cell : row24) {
+                    if (cell.getColumnIndex() != 0) {
+                        cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                    }
                 }
-            }
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum + 2, 0, 0));
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 1, 10));
-
-            XSSFRow row25 = sheet.createRow(++lastRowNum);
-            row25.setHeightInPoints(53.5F);
-            createVoidCell(0, 10, row25);
-            XSSFCell row25Cell2 = row25.createCell(1);
-            row25Cell2.setCellValue("应配备岗位");
-            XSSFCell row25Cell3 = row25.createCell(2);
-            row25Cell3.setCellValue("是否配备①");
-            XSSFCell row25Cell6 = row25.createCell(5);
-            row25Cell6.setCellValue("是否无破损、未被污染");
-            XSSFCell row25Cell8 = row25.createCell(7);
-            row25Cell8.setCellValue("摆放符合要求⑥");
-            XSSFCell row25Cell14 = row25.createCell(9);
-            row25Cell14.setCellValue("检验合格的标识在有效期内④");
-            for (Cell cell : row25) {
-                if (cell.getColumnIndex() != 0) {
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum + 2, 0, 0));
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 1, 10));
+
+                XSSFRow row25 = sheet.createRow(++lastRowNum);
+                row25.setHeightInPoints(53.5F);
+                createVoidCell(0, 10, row25);
+                XSSFCell row25Cell2 = row25.createCell(1);
+                row25Cell2.setCellValue("应配备岗位");
+                XSSFCell row25Cell3 = row25.createCell(2);
+                row25Cell3.setCellValue("是否配备①");
+                XSSFCell row25Cell6 = row25.createCell(5);
+                row25Cell6.setCellValue("是否无破损、未被污染");
+                XSSFCell row25Cell8 = row25.createCell(7);
+                row25Cell8.setCellValue("摆放符合要求⑥");
+                XSSFCell row25Cell14 = row25.createCell(9);
+                row25Cell14.setCellValue("检验合格的标识在有效期内④");
+                for (Cell cell : row25) {
+                    if (cell.getColumnIndex() != 0) {
+                        cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                    }
                 }
-            }
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum + 1, 1, 1));
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 2, 4));
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 5, 6));
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 7, 8));
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 9, 10));
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum + 1, 1, 1));
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 2, 4));
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 5, 6));
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 7, 8));
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 9, 10));
 
-            XSSFRow row26 = sheet.createRow(++lastRowNum);
-            row26.setHeightInPoints(40);
-            createVoidCell(0, 10, row26);
-            row26.createCell(2).setCellValue("是");
-            row26.createCell(3).setCellValue("N.A");
-            row26.createCell(4).setCellValue("否");
-            row26.createCell(5).setCellValue("是");
-            row26.createCell(6).setCellValue("否");
-            row26.createCell(7).setCellValue("是");
-            row26.createCell(8).setCellValue("否");
-            row26.createCell(9).setCellValue("是");
-            row26.createCell(10).setCellValue("否");
-            for (Cell cell : row26) {
-                if (cell.getColumnIndex() != 0 && cell.getColumnIndex() != 1) {
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, false));
-                } else {
-                    cell.setCellStyle(getStyle(workbook, "Arial", 18, true));
+                XSSFRow row26 = sheet.createRow(++lastRowNum);
+                row26.setHeightInPoints(40);
+                createVoidCell(0, 10, row26);
+                row26.createCell(2).setCellValue("是");
+                row26.createCell(3).setCellValue("N.A");
+                row26.createCell(4).setCellValue("否");
+                row26.createCell(5).setCellValue("是");
+                row26.createCell(6).setCellValue("否");
+                row26.createCell(7).setCellValue("是");
+                row26.createCell(8).setCellValue("否");
+                row26.createCell(9).setCellValue("是");
+                row26.createCell(10).setCellValue("否");
+                for (Cell cell : row26) {
+                    if (cell.getColumnIndex() != 0 && cell.getColumnIndex() != 1) {
+                        cell.setCellStyle(getStyle(workbook, "等线", 18, false));
+                    } else {
+                        cell.setCellStyle(getStyle(workbook, "Arial", 18, true));
+                    }
                 }
-            }
-            for (Cell cell : row23) {
-                cell.setCellStyle(getStyle(workbook, "Arial", 22, true));
-            }
-            List<TPpeCmldefLocker> tPpeCmldefLockers = tPpeCmldefLockerService.selectTPpeCmldefLockerListByMainId(main.getId());
-            for (int i = 0; i < tPpeCmldefLockers.size(); i++) {
-                TPpeCmldefLocker tPpeCmldefLocker = tPpeCmldefLockers.get(i);
-                lastRowNum++;
-                XSSFRow row = sheet.createRow(lastRowNum);
-                row.setHeightInPoints(70);
-                createVoidCell(0, 10, row);
-                row.createCell(0).setCellValue(tPpeCmldefLocker.getPpeType());
-                if (tPpeCmldefLocker.getUsePost().contains(",")) {
-                    tPpeCmldefLocker.setUsePost(tPpeCmldefLocker.getUsePost().replace(",", "、"));
+                for (Cell cell : row23) {
+                    cell.setCellStyle(getStyle(workbook, "Arial", 22, true));
                 }
-                row.createCell(1).setCellValue(tPpeCmldefLocker.getUsePost());
-                row.createCell(2).setCellValue(getValue("是", tPpeCmldefLocker.getIsEquip()));
-                row.createCell(3).setCellValue(getValue("N.A", tPpeCmldefLocker.getIsEquip(), tPpeCmldefLocker.getUsePost()));
-                row.createCell(4).setCellValue(getValue("否", tPpeCmldefLocker.getIsEquip()));
-                row.createCell(5).setCellValue(getValue("是", tPpeCmldefLocker.getIsPollution()));
-                row.createCell(6).setCellValue(getValue("否", tPpeCmldefLocker.getIsPollution()));
-                row.createCell(7).setCellValue(getValue("是", tPpeCmldefLocker.getPutAsRequired()));
-                row.createCell(8).setCellValue(getValue("否", tPpeCmldefLocker.getPutAsRequired()));
-                row.createCell(9).setCellValue(getValue("是", tPpeCmldefLocker.getIsIdentification()));
-                row.createCell(10).setCellValue(getValue("否", tPpeCmldefLocker.getIsIdentification()));
-                for (Cell cell : row) {
-                    if (cell.getColumnIndex() == 0 || cell.getColumnIndex() == 1) {
-                        if (i % 2 == 0)
-                            cell.setCellStyle(getStyle(workbook, "宋体", 18, false, true));
-                        else
-                            cell.setCellStyle(getStyle(workbook, "宋体", 18, false));
-                    } else if (StringUtils.isNotEmpty(cell.getStringCellValue()) && "N.A".equals(cell.getStringCellValue())) {
-                        if (i % 2 == 0) {
-                            cell.setCellStyle(getStyle(workbook, "Arial", 18, false, true));
-                        } else {
-                            cell.setCellStyle(getStyle(workbook, "Arial", 18, false));
-                        }
-                    } else {
-                        if (i % 2 == 0) {
-                            cell.setCellStyle(getStyle(workbook, "Wingdings 2", 18, false, true));
+                for (int i = 0; i < tPpeCmldefLockers.size(); i++) {
+                    TPpeCmldefLocker tPpeCmldefLocker = tPpeCmldefLockers.get(i);
+                    lastRowNum++;
+                    XSSFRow row = sheet.createRow(lastRowNum);
+                    row.setHeightInPoints(70);
+                    createVoidCell(0, 10, row);
+                    row.createCell(0).setCellValue(tPpeCmldefLocker.getPpeType());
+                    if (tPpeCmldefLocker.getUsePost().contains(",")) {
+                        tPpeCmldefLocker.setUsePost(tPpeCmldefLocker.getUsePost().replace(",", "、"));
+                    }
+                    row.createCell(1).setCellValue(tPpeCmldefLocker.getUsePost());
+                    row.createCell(2).setCellValue(getValue("是", tPpeCmldefLocker.getIsEquip()));
+                    row.createCell(3).setCellValue(getValue("N.A", tPpeCmldefLocker.getIsEquip(), tPpeCmldefLocker.getUsePost()));
+                    row.createCell(4).setCellValue(getValue("否", tPpeCmldefLocker.getIsEquip()));
+                    row.createCell(5).setCellValue(getValue("是", tPpeCmldefLocker.getIsPollution()));
+                    row.createCell(6).setCellValue(getValue("否", tPpeCmldefLocker.getIsPollution()));
+                    row.createCell(7).setCellValue(getValue("是", tPpeCmldefLocker.getPutAsRequired()));
+                    row.createCell(8).setCellValue(getValue("否", tPpeCmldefLocker.getPutAsRequired()));
+                    row.createCell(9).setCellValue(getValue("是", tPpeCmldefLocker.getIsIdentification()));
+                    row.createCell(10).setCellValue(getValue("否", tPpeCmldefLocker.getIsIdentification()));
+                    for (Cell cell : row) {
+                        if (cell.getColumnIndex() == 0 || cell.getColumnIndex() == 1) {
+                            if (i % 2 == 0) cell.setCellStyle(getStyle(workbook, "宋体", 18, false, true));
+                            else cell.setCellStyle(getStyle(workbook, "宋体", 18, false));
+                        } else if (StringUtils.isNotEmpty(cell.getStringCellValue()) && "N.A".equals(cell.getStringCellValue())) {
+                            if (i % 2 == 0) {
+                                cell.setCellStyle(getStyle(workbook, "Arial", 18, false, true));
+                            } else {
+                                cell.setCellStyle(getStyle(workbook, "Arial", 18, false));
+                            }
                         } else {
-                            cell.setCellStyle(getStyle(workbook, "Wingdings 2", 18, false));
+                            if (i % 2 == 0) {
+                                cell.setCellStyle(getStyle(workbook, "Wingdings 2", 18, false, true));
+                            } else {
+                                cell.setCellStyle(getStyle(workbook, "Wingdings 2", 18, false));
+                            }
                         }
                     }
+                    remarks = tPpeCmldefLocker.getRemarks();
                 }
-                remarks = tPpeCmldefLocker.getRemarks();
-            }
-            XSSFRow row27 = sheet.createRow(++lastRowNum);
-            row27.setHeightInPoints(100);
-            createVoidCell(0, 10, row27);
-            row27.createCell(0).setCellValue("备注");
-            row27.createCell(1).setCellValue(remarks);
-            for (Cell cell : row27) {
-                if (cell.getColumnIndex() == 0)
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, true));
-                else
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, false));
+                XSSFRow row27 = sheet.createRow(++lastRowNum);
+                row27.setHeightInPoints(100);
+                createVoidCell(0, 10, row27);
+                row27.createCell(0).setCellValue("备注");
+                row27.createCell(1).setCellValue(remarks);
+                for (Cell cell : row27) {
+                    if (cell.getColumnIndex() == 0) cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                    else cell.setCellStyle(getStyle(workbook, "等线", 18, false));
+                }
+                sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 1, 10));
+                sheet.createRow(++lastRowNum).setHeightInPoints(40);
+
+                // 图片路径
+                String templatePath1 = "static/ppeImg/ppe1.png";
+                ByteArrayOutputStream byteArrayOut1 = new ByteArrayOutputStream();
+                BufferedImage bufferImg1 = ImageIO.read(getClass().getClassLoader().getResourceAsStream(templatePath1));
+                ImageIO.write(bufferImg1, "png", byteArrayOut1);
+                XSSFClientAnchor anchor1 = new XSSFClientAnchor(0, 0, 0, 0, 12, 23, 15, 28);
+                XSSFDrawing patriarch1 = sheet.createDrawingPatriarch();
+                patriarch1.createPicture(anchor1, workbook.addPicture(byteArrayOut1.toByteArray(), XSSFWorkbook.PICTURE_TYPE_PNG));
+                byteArrayOut1.close();
+
+                String templatePath2 = "static/ppeImg/ppe2.png";
+                ByteArrayOutputStream byteArrayOut2 = new ByteArrayOutputStream();
+                BufferedImage bufferImg2 = ImageIO.read(getClass().getClassLoader().getResourceAsStream(templatePath2));
+                ImageIO.write(bufferImg2, "png", byteArrayOut2);
+                XSSFClientAnchor anchor2 = new XSSFClientAnchor(0, 0, 0, 0, 16, 23, 19, 29);
+                XSSFDrawing patriarch2 = sheet.createDrawingPatriarch();
+                patriarch2.createPicture(anchor2, workbook.addPicture(byteArrayOut2.toByteArray(), XSSFWorkbook.PICTURE_TYPE_PNG));
+                byteArrayOut2.close();
             }
-            sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 1, 10));
-            sheet.createRow(++lastRowNum).setHeightInPoints(40);
             //endregion
 
             //region 第三张表格
@@ -571,10 +593,8 @@ public class TPpeMainController extends BaseController {
             row33.createCell(0).setCellValue("备注");
             row33.createCell(1).setCellValue(remarks);
             for (Cell cell : row33) {
-                if (cell.getColumnIndex() == 0)
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, true));
-                else
-                    cell.setCellStyle(getStyle(workbook, "等线", 18, false));
+                if (cell.getColumnIndex() == 0) cell.setCellStyle(getStyle(workbook, "等线", 18, true));
+                else cell.setCellStyle(getStyle(workbook, "等线", 18, false));
             }
             sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 1, 12));
             sheet.createRow(++lastRowNum).setHeightInPoints(40);
@@ -598,9 +618,7 @@ public class TPpeMainController extends BaseController {
             createVoidCell(0, 18, row39);
             row39.setHeightInPoints(121.5F);
             XSSFCell row39cell = row39.createCell(0);
-            row39cell.setCellValue(workbook.getCreationHelper().createRichTextString("①、“是否配备”如果实际配备选择“是”;\n" +
-                    "               如果不需要配备而没有配备选择“N.A”;\n" +
-                    "               如果是应配备而没有配备选择“否”。"));
+            row39cell.setCellValue(workbook.getCreationHelper().createRichTextString("①、“是否配备”如果实际配备选择“是”;\n" + "               如果不需要配备而没有配备选择“N.A”;\n" + "               如果是应配备而没有配备选择“否”。"));
             row39cell.setCellStyle(style3);
             sheet.addMergedRegion(new CellRangeAddress(lastRowNum, lastRowNum, 0, 18));
 
@@ -671,34 +689,16 @@ public class TPpeMainController extends BaseController {
             //endregion
 
             //region 插入图片
-            // 图片路径
-            String templatePath1 = "static/ppeImg/ppe1.png";
-            ByteArrayOutputStream byteArrayOut1 = new ByteArrayOutputStream();
-            BufferedImage bufferImg1 = ImageIO.read(getClass().getClassLoader().getResourceAsStream(templatePath1));
-            ImageIO.write(bufferImg1, "png", byteArrayOut1);
-            XSSFClientAnchor anchor1 = new XSSFClientAnchor(0, 0, 0, 0, 12, 23, 15, 28);
-            XSSFDrawing patriarch1 = sheet.createDrawingPatriarch();
-            patriarch1.createPicture(anchor1, workbook.addPicture(byteArrayOut1.toByteArray(), XSSFWorkbook.PICTURE_TYPE_PNG));
-            byteArrayOut1.close();
-
-            String templatePath2 = "static/ppeImg/ppe2.png";
-            ByteArrayOutputStream byteArrayOut2 = new ByteArrayOutputStream();
-            BufferedImage bufferImg2 = ImageIO.read(getClass().getClassLoader().getResourceAsStream(templatePath2));
-            ImageIO.write(bufferImg2, "png", byteArrayOut2);
-            XSSFClientAnchor anchor2 = new XSSFClientAnchor(0, 0, 0, 0, 16, 23, 19, 29);
-            XSSFDrawing patriarch2 = sheet.createDrawingPatriarch();
-            patriarch2.createPicture(anchor2, workbook.addPicture(byteArrayOut2.toByteArray(), XSSFWorkbook.PICTURE_TYPE_PNG));
-            byteArrayOut2.close();
-
             String templatePath3 = "static/ppeImg/ppe3.png";
             ByteArrayOutputStream byteArrayOut3 = new ByteArrayOutputStream();
             BufferedImage bufferImg3 = ImageIO.read(getClass().getClassLoader().getResourceAsStream(templatePath3));
             ImageIO.write(bufferImg3, "png", byteArrayOut3);
-            XSSFClientAnchor anchor3 = new XSSFClientAnchor(0, 0, 0, 0, 14, 31, 17, 36);
+            XSSFClientAnchor anchor3 = new XSSFClientAnchor(0, 0, 0, 0, startCol, startRow, endCol, endRow);
             XSSFDrawing patriarch3 = sheet.createDrawingPatriarch();
             patriarch3.createPicture(anchor3, workbook.addPicture(byteArrayOut3.toByteArray(), XSSFWorkbook.PICTURE_TYPE_PNG));
-            byteArrayOut2.close();
+            byteArrayOut3.close();
             //endregion
+
             String fileName = ExcelUtil.encodingFilename("main");
             OutputStream os = Files.newOutputStream(Paths.get(ExcelUtil.getAbsoluteFile(fileName)));
             workbook.write(os);
@@ -714,14 +714,13 @@ public class TPpeMainController extends BaseController {
             return "*";
         }
         if (current.equals("N.A")) {
-            if (post[0].equals("所有岗位"))
-                return "/";
+            if (post[0].equals("所有岗位")) return "/";
             else if (current.equals(value)) {
                 return "R";
             } else {
                 return "*";
             }
-        } else if (value.equals("N.A")) {
+        } else if (value.equals("N.A") && current.equals("N.A")) {
             return "N.A";
         } else if (current.equals(value)) {
             return "R";
@@ -774,12 +773,10 @@ public class TPpeMainController extends BaseController {
                 main.setCmldefRemark(tPpeCmldefLockers.get(0).getRemarks());
             List<TPpeStaffLocker> tPpeStaffLockers = tPpeStaffLockerService.selectTPpeStaffLockerListByMainId(main.getId());
             main.setStaffLockers(tPpeStaffLockers);
-            if (CollectionUtils.isNotEmpty(tPpeStaffLockers))
-                main.setStaffRemark(tPpeStaffLockers.get(0).getRemarks());
+            if (CollectionUtils.isNotEmpty(tPpeStaffLockers)) main.setStaffRemark(tPpeStaffLockers.get(0).getRemarks());
             List<TPpeWardrobe> tPpeWardrobes = tPpeWardrobeService.selectTPpeWardrobeListByMainId(main.getId());
             main.setWardrobes(tPpeWardrobes);
-            if (CollectionUtils.isNotEmpty(tPpeWardrobes))
-                main.setWardrobeRemark(tPpeWardrobes.get(0).getRemarks());
+            if (CollectionUtils.isNotEmpty(tPpeWardrobes)) main.setWardrobeRemark(tPpeWardrobes.get(0).getRemarks());
         }
         return AjaxResult.success(main);
     }

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

@@ -0,0 +1,174 @@
+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;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.project.production.domain.*;
+import com.ruoyi.project.production.service.ITPpeMatrixService;
+import com.ruoyi.project.production.service.ITPpePersonService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * ppe矩阵管理Controller
+ *
+ * @author ssy
+ * @date 2023-12-11
+ */
+@RestController
+@RequestMapping("/production/matrix")
+public class TPpeMatrixController extends BaseController {
+    @Autowired
+    private ITPpeMatrixService tPpeMatrixService;
+
+    @Autowired
+    private ITPpePersonService tPpePersonService;
+
+    /**
+     * 查询ppe矩阵管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:matrix:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TPpeMatrix tPpeMatrix) {
+        startPage();
+        List<TPpeMatrix> list = tPpeMatrixService.selectTPpeMatrixList(tPpeMatrix);
+        return getDataTable(list);
+    }
+
+    @GetMapping("/listByPost")
+    public AjaxResult listByPost(TPpeMain tPpeMain) {
+        TPpePerson person = tPpePersonService.selectTPpePersonByEmployeeid(tPpeMain.getStaffId());
+        TPpeMain main = new TPpeMain();
+        List<TPpeWardrobe> wardrobes = new ArrayList<>();
+        wardrobes.add(new TPpeWardrobe());
+        main.setWardrobes(wardrobes);
+        String post = "";
+        if ("1".equals(person.getSex())) {
+            return AjaxResult.success(main);
+        }
+        Set<String> checkItems = new HashSet<>();
+        TPpeMatrix tPpeMatrix = new TPpeMatrix();
+        if ("1".equals(person.getBoiler())) {
+            tPpeMatrix.setUsePost("裂解");
+            post += "裂解、";
+            for (TPpeMatrix ppeMatrix : tPpeMatrixService.selectTPpeMatrixList(tPpeMatrix)) {
+                checkItems.add(ppeMatrix.getPpeType());
+            }
+        }
+        if ("1".equals(person.getCracking())) {
+            tPpeMatrix.setUsePost("热区");
+            post += "热区、";
+            for (TPpeMatrix ppeMatrix : tPpeMatrixService.selectTPpeMatrixList(tPpeMatrix)) {
+                if (StringUtils.isNotEmpty(ppeMatrix.getAssigner()) && ppeMatrix.getAssigner().contains(tPpeMain.getStaffId()) && ppeMatrix.getPpeType().contains("指定人")) {
+                    checkItems.add(ppeMatrix.getPpeType());
+                }else if(!ppeMatrix.getPpeType().contains("指定人")){
+                    checkItems.add(ppeMatrix.getPpeType());
+                }
+
+            }
+        }
+        if ("1".equals(person.getHotarea())) {
+            tPpeMatrix.setUsePost("冷区");
+            post += "冷区、";
+            for (TPpeMatrix ppeMatrix : tPpeMatrixService.selectTPpeMatrixList(tPpeMatrix)) {
+                checkItems.add(ppeMatrix.getPpeType());
+            }
+        }
+        if ("1".equals(person.getColdarea())) {
+            tPpeMatrix.setUsePost("PGU/AEU");
+            post += "PGU/AEU、";
+            for (TPpeMatrix ppeMatrix : tPpeMatrixService.selectTPpeMatrixList(tPpeMatrix)) {
+                checkItems.add(ppeMatrix.getPpeType());
+            }
+        }
+        if ("1".equals(person.getOperator())) {
+            tPpeMatrix.setUsePost("白班操作员");
+            post += "白班操作员、";
+            for (TPpeMatrix ppeMatrix : tPpeMatrixService.selectTPpeMatrixList(tPpeMatrix)) {
+                checkItems.add(ppeMatrix.getPpeType());
+            }
+        }
+        if (post.endsWith("、")) {
+            post = post.substring(0, post.length() - 1);
+        }
+        List<TPpeStaffLocker> staffLockers = new ArrayList<>();
+        List<TPpeCmldefLocker> cmldefLockers = new ArrayList<>();
+        for (String checkItem : checkItems) {
+            if (checkItem.contains("防化服") || checkItem.contains("防化靴")) {
+                TPpeCmldefLocker tPpeCmldefLocker = new TPpeCmldefLocker();
+                tPpeCmldefLocker.setPpeType(checkItem);
+                tPpeCmldefLocker.setUsePost(post);
+                cmldefLockers.add(tPpeCmldefLocker);
+            } else {
+                TPpeStaffLocker tPpeStaffLocker = new TPpeStaffLocker();
+                tPpeStaffLocker.setPpeType(checkItem);
+                tPpeStaffLocker.setUsePost(post);
+                staffLockers.add(tPpeStaffLocker);
+            }
+        }
+        main.setStaffLockers(staffLockers);
+        main.setCmldefLockers(cmldefLockers);
+        return AjaxResult.success(main);
+    }
+
+    /**
+     * 导出ppe矩阵管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('production:matrix:export')")
+    @Log(title = "ppe矩阵管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TPpeMatrix tPpeMatrix) {
+        List<TPpeMatrix> list = tPpeMatrixService.selectTPpeMatrixList(tPpeMatrix);
+        ExcelUtil<TPpeMatrix> util = new ExcelUtil<TPpeMatrix>(TPpeMatrix.class);
+        return util.exportExcel(list, "matrix");
+    }
+
+    /**
+     * 获取ppe矩阵管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('production:matrix:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tPpeMatrixService.selectTPpeMatrixById(id));
+    }
+
+    /**
+     * 新增ppe矩阵管理
+     */
+    @PreAuthorize("@ss.hasPermi('production:matrix:add')")
+    @Log(title = "ppe矩阵管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TPpeMatrix tPpeMatrix) {
+        return toAjax(tPpeMatrixService.insertTPpeMatrix(tPpeMatrix));
+    }
+
+    /**
+     * 修改ppe矩阵管理
+     */
+    @PreAuthorize("@ss.hasPermi('production:matrix:edit')")
+    @Log(title = "ppe矩阵管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TPpeMatrix tPpeMatrix) {
+        return toAjax(tPpeMatrixService.updateTPpeMatrix(tPpeMatrix));
+    }
+
+    /**
+     * 删除ppe矩阵管理
+     */
+    @PreAuthorize("@ss.hasPermi('production:matrix:remove')")
+    @Log(title = "ppe矩阵管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tPpeMatrixService.deleteTPpeMatrixByIds(ids));
+    }
+}

+ 204 - 0
master/src/main/java/com/ruoyi/project/production/domain/TPpeMatrix.java

@@ -0,0 +1,204 @@
+package com.ruoyi.project.production.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+/**
+ * ppe矩阵管理对象 t_ppe_matrix
+ *
+ * @author ssy
+ * @date 2023-12-11
+ */
+public class TPpeMatrix extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** ID */
+    private Long id;
+
+    /** PPE种类 */
+    @Excel(name = "PPE种类")
+    private String ppeType;
+
+    /** 应配备岗位 */
+    @Excel(name = "应配备岗位")
+    private String usePost;
+
+    /** 指定人 */
+    @Excel(name = "指定人")
+    private String assigner;
+
+    /** 删除状态 */
+    private Long delFlag;
+
+    /** 创建人 */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /** 修改人 */
+    @Excel(name = "修改人")
+    private String updaterCode;
+
+    /** 修改时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd" , timezone = "GMT+8")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /** 备注 */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /** 部门编号 */
+    @Excel(name = "部门编号")
+    private Long deptId;
+
+    /** 是否指定人 */
+    @Excel(name = "是否指定人")
+    private String isAssigner;
+
+    private String deptName;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setPpeType(String ppeType)
+    {
+        this.ppeType = ppeType;
+    }
+
+    public String getPpeType()
+    {
+        return ppeType;
+    }
+    public void setUsePost(String usePost)
+    {
+        this.usePost = usePost;
+    }
+
+    public String getUsePost()
+    {
+        return usePost;
+    }
+    public void setAssigner(String assigner)
+    {
+        this.assigner = assigner;
+    }
+
+    public String getAssigner()
+    {
+        return assigner;
+    }
+    public void setDelFlag(Long delFlag)
+    {
+        this.delFlag = delFlag;
+    }
+
+    public Long getDelFlag()
+    {
+        return delFlag;
+    }
+    public void setCreaterCode(String createrCode)
+    {
+        this.createrCode = createrCode;
+    }
+
+    public String getCreaterCode()
+    {
+        return createrCode;
+    }
+    public void setCreatedate(Date createdate)
+    {
+        this.createdate = createdate;
+    }
+
+    public Date getCreatedate()
+    {
+        return createdate;
+    }
+    public void setUpdaterCode(String updaterCode)
+    {
+        this.updaterCode = updaterCode;
+    }
+
+    public String getUpdaterCode()
+    {
+        return updaterCode;
+    }
+    public void setUpdatedate(Date updatedate)
+    {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate()
+    {
+        return updatedate;
+    }
+    public void setRemarks(String remarks)
+    {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks()
+    {
+        return remarks;
+    }
+    public void setDeptId(Long deptId)
+    {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId()
+    {
+        return deptId;
+    }
+    public void setIsAssigner(String isAssigner)
+    {
+        this.isAssigner = isAssigner;
+    }
+
+    public String getIsAssigner()
+    {
+        return isAssigner;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("ppeType", getPpeType())
+            .append("usePost", getUsePost())
+            .append("assigner", getAssigner())
+            .append("delFlag", getDelFlag())
+            .append("createrCode", getCreaterCode())
+            .append("createdate", getCreatedate())
+            .append("updaterCode", getUpdaterCode())
+            .append("updatedate", getUpdatedate())
+            .append("remarks", getRemarks())
+            .append("deptId", getDeptId())
+            .append("isAssigner", getIsAssigner())
+            .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/production/mapper/TPpeMatrixMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.production.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.production.domain.TPpeMatrix;
+
+/**
+ * ppe矩阵管理Mapper接口
+ * 
+ * @author ssy
+ * @date 2023-12-11
+ */
+public interface TPpeMatrixMapper 
+{
+    /**
+     * 查询ppe矩阵管理
+     * 
+     * @param id ppe矩阵管理ID
+     * @return ppe矩阵管理
+     */
+    public TPpeMatrix selectTPpeMatrixById(Long id);
+
+    /**
+     * 查询ppe矩阵管理列表
+     * 
+     * @param tPpeMatrix ppe矩阵管理
+     * @return ppe矩阵管理集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TPpeMatrix> selectTPpeMatrixList(TPpeMatrix tPpeMatrix);
+
+    /**
+     * 新增ppe矩阵管理
+     * 
+     * @param tPpeMatrix ppe矩阵管理
+     * @return 结果
+     */
+    public int insertTPpeMatrix(TPpeMatrix tPpeMatrix);
+
+    /**
+     * 修改ppe矩阵管理
+     * 
+     * @param tPpeMatrix ppe矩阵管理
+     * @return 结果
+     */
+    public int updateTPpeMatrix(TPpeMatrix tPpeMatrix);
+
+    /**
+     * 删除ppe矩阵管理
+     * 
+     * @param id ppe矩阵管理ID
+     * @return 结果
+     */
+    public int deleteTPpeMatrixById(Long id);
+
+    /**
+     * 批量删除ppe矩阵管理
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTPpeMatrixByIds(Long[] ids);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/production/service/ITPpeMatrixService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.production.service;
+
+import java.util.List;
+import com.ruoyi.project.production.domain.TPpeMatrix;
+
+/**
+ * ppe矩阵管理Service接口
+ * 
+ * @author ssy
+ * @date 2023-12-11
+ */
+public interface ITPpeMatrixService 
+{
+    /**
+     * 查询ppe矩阵管理
+     * 
+     * @param id ppe矩阵管理ID
+     * @return ppe矩阵管理
+     */
+    public TPpeMatrix selectTPpeMatrixById(Long id);
+
+    /**
+     * 查询ppe矩阵管理列表
+     * 
+     * @param tPpeMatrix ppe矩阵管理
+     * @return ppe矩阵管理集合
+     */
+    public List<TPpeMatrix> selectTPpeMatrixList(TPpeMatrix tPpeMatrix);
+
+    /**
+     * 新增ppe矩阵管理
+     * 
+     * @param tPpeMatrix ppe矩阵管理
+     * @return 结果
+     */
+    public int insertTPpeMatrix(TPpeMatrix tPpeMatrix);
+
+    /**
+     * 修改ppe矩阵管理
+     * 
+     * @param tPpeMatrix ppe矩阵管理
+     * @return 结果
+     */
+    public int updateTPpeMatrix(TPpeMatrix tPpeMatrix);
+
+    /**
+     * 批量删除ppe矩阵管理
+     * 
+     * @param ids 需要删除的ppe矩阵管理ID
+     * @return 结果
+     */
+    public int deleteTPpeMatrixByIds(Long[] ids);
+
+    /**
+     * 删除ppe矩阵管理信息
+     * 
+     * @param id ppe矩阵管理ID
+     * @return 结果
+     */
+    public int deleteTPpeMatrixById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/production/service/impl/TPpeMatrixServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.production.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.production.mapper.TPpeMatrixMapper;
+import com.ruoyi.project.production.domain.TPpeMatrix;
+import com.ruoyi.project.production.service.ITPpeMatrixService;
+
+/**
+ * ppe矩阵管理Service业务层处理
+ *
+ * @author ssy
+ * @date 2023-12-11
+ */
+@Service
+public class TPpeMatrixServiceImpl implements ITPpeMatrixService
+{
+    @Autowired
+    private TPpeMatrixMapper tPpeMatrixMapper;
+
+    /**
+     * 查询ppe矩阵管理
+     *
+     * @param id ppe矩阵管理ID
+     * @return ppe矩阵管理
+     */
+    @Override
+    public TPpeMatrix selectTPpeMatrixById(Long id)
+    {
+        return tPpeMatrixMapper.selectTPpeMatrixById(id);
+    }
+
+    /**
+     * 查询ppe矩阵管理列表
+     *
+     * @param tPpeMatrix ppe矩阵管理
+     * @return ppe矩阵管理
+     */
+    @Override
+    public List<TPpeMatrix> selectTPpeMatrixList(TPpeMatrix tPpeMatrix)
+    {
+        return tPpeMatrixMapper.selectTPpeMatrixList(tPpeMatrix);
+    }
+
+    /**
+     * 新增ppe矩阵管理
+     *
+     * @param tPpeMatrix ppe矩阵管理
+     * @return 结果
+     */
+    @Override
+    public int insertTPpeMatrix(TPpeMatrix tPpeMatrix)
+    {
+        return tPpeMatrixMapper.insertTPpeMatrix(tPpeMatrix);
+    }
+
+    /**
+     * 修改ppe矩阵管理
+     *
+     * @param tPpeMatrix ppe矩阵管理
+     * @return 结果
+     */
+    @Override
+    public int updateTPpeMatrix(TPpeMatrix tPpeMatrix)
+    {
+        return tPpeMatrixMapper.updateTPpeMatrix(tPpeMatrix);
+    }
+
+    /**
+     * 批量删除ppe矩阵管理
+     *
+     * @param ids 需要删除的ppe矩阵管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTPpeMatrixByIds(Long[] ids)
+    {
+        return tPpeMatrixMapper.deleteTPpeMatrixByIds(ids);
+    }
+
+    /**
+     * 删除ppe矩阵管理信息
+     *
+     * @param id ppe矩阵管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTPpeMatrixById(Long id)
+    {
+        return tPpeMatrixMapper.deleteTPpeMatrixById(id);
+    }
+}

+ 116 - 0
master/src/main/resources/mybatis/production/TPpeMatrixMapper.xml

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.project.production.mapper.TPpeMatrixMapper">
+    
+    <resultMap type="TPpeMatrix" id="TPpeMatrixResult">
+        <result property="id"    column="id"    />
+        <result property="ppeType"    column="ppe_type"    />
+        <result property="usePost"    column="use_post"    />
+        <result property="assigner"    column="assigner"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createrCode"    column="creater_code"    />
+        <result property="createdate"    column="createdate"    />
+        <result property="updaterCode"    column="updater_code"    />
+        <result property="updatedate"    column="updatedate"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="deptId"    column="dept_id"    />
+        <result property="isAssigner"    column="is_assigner"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTPpeMatrixVo">
+        select d.id, d.ppe_type, d.use_post, d.assigner, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.remarks, d.dept_id, d.is_assigner ,s.dept_name from t_ppe_matrix d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTPpeMatrixList" parameterType="TPpeMatrix" resultMap="TPpeMatrixResult">
+        <include refid="selectTPpeMatrixVo"/>
+        <where>  
+            <if test="ppeType != null  and ppeType != ''"> and ppe_type = #{ppeType}</if>
+            <if test="usePost != null  and usePost != ''"> and use_post = #{usePost}</if>
+            <if test="assigner != null  and assigner != ''"> and assigner = #{assigner}</if>
+            <if test="createrCode != null  and createrCode != ''"> and creater_code = #{createrCode}</if>
+            <if test="createdate != null "> and createdate = #{createdate}</if>
+            <if test="updaterCode != null  and updaterCode != ''"> and updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            <if test="isAssigner != null  and isAssigner != ''"> and is_assigner = #{isAssigner}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectTPpeMatrixById" parameterType="Long" resultMap="TPpeMatrixResult">
+        <include refid="selectTPpeMatrixVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertTPpeMatrix" parameterType="TPpeMatrix">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_ppe_matrix.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_ppe_matrix
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="ppeType != null">ppe_type,</if>
+            <if test="usePost != null">use_post,</if>
+            <if test="assigner != null">assigner,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createrCode != null">creater_code,</if>
+            <if test="createdate != null">createdate,</if>
+            <if test="updaterCode != null">updater_code,</if>
+            <if test="updatedate != null">updatedate,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="deptId != null">dept_id,</if>
+            <if test="isAssigner != null">is_assigner,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="ppeType != null">#{ppeType},</if>
+            <if test="usePost != null">#{usePost},</if>
+            <if test="assigner != null">#{assigner},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createrCode != null">#{createrCode},</if>
+            <if test="createdate != null">#{createdate},</if>
+            <if test="updaterCode != null">#{updaterCode},</if>
+            <if test="updatedate != null">#{updatedate},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="isAssigner != null">#{isAssigner},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTPpeMatrix" parameterType="TPpeMatrix">
+        update t_ppe_matrix
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="ppeType != null">ppe_type = #{ppeType},</if>
+            <if test="usePost != null">use_post = #{usePost},</if>
+            <if test="assigner != null">assigner = #{assigner},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createrCode != null">creater_code = #{createrCode},</if>
+            <if test="createdate != null">createdate = #{createdate},</if>
+            <if test="updaterCode != null">updater_code = #{updaterCode},</if>
+            <if test="updatedate != null">updatedate = #{updatedate},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+            <if test="isAssigner != null">is_assigner = #{isAssigner},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTPpeMatrixById" parameterType="Long">
+        update t_ppe_matrix set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTPpeMatrixByIds" parameterType="String">
+        update t_ppe_matrix set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+    
+</mapper>

+ 62 - 0
ui/src/api/production/matrix.js

@@ -0,0 +1,62 @@
+import request from '@/utils/request'
+
+// 查询ppe矩阵管理列表
+export function listMatrix(query) {
+  return request({
+    url: '/production/matrix/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询ppe矩阵管理列表
+export function listMatrixByPost(query) {
+  return request({
+    url: '/production/matrix/listByPost',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询ppe矩阵管理详细
+export function getMatrix(id) {
+  return request({
+    url: '/production/matrix/' + id,
+    method: 'get'
+  })
+}
+
+// 新增ppe矩阵管理
+export function addMatrix(data) {
+  return request({
+    url: '/production/matrix',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改ppe矩阵管理
+export function updateMatrix(data) {
+  return request({
+    url: '/production/matrix',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除ppe矩阵管理
+export function delMatrix(id) {
+  return request({
+    url: '/production/matrix/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出ppe矩阵管理
+export function exportMatrix(query) {
+  return request({
+    url: '/production/matrix/export',
+    method: 'get',
+    params: query
+  })
+}

+ 408 - 0
ui/src/views/production/matrix/index.vue

@@ -0,0 +1,408 @@
+<template>
+  <div class="app-container">
+    <el-form-item label="岗位" prop="usePost">
+      <el-select v-model="queryParams.usePost" placeholder="请选择应配备岗位" clearable size="small">
+        <el-option
+          v-for="dict in usePostOptions"
+          :key="dict.dictValue"
+          :label="dict.dictLabel"
+          :value="dict.dictValue"
+        />
+      </el-select>
+    </el-form-item>
+    <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="PPE种类" prop="ppeType">
+        <el-input
+          v-model="queryParams.ppeType"
+          placeholder="请输入PPE种类"
+          clearable
+          size="small"
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <el-row :gutter="10" class="mb8">
+      <el-col :span="1.5">
+        <el-button
+          type="primary"
+          icon="el-icon-plus"
+          size="mini"
+          @click="handleAdd"
+          v-hasPermi="['production:matrix:add']"
+        >新增</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="success"
+          icon="el-icon-edit"
+          size="mini"
+          :disabled="single"
+          @click="handleUpdate"
+          v-hasPermi="['production:matrix:edit']"
+        >修改</el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="danger"
+          icon="el-icon-delete"
+          size="mini"
+          :disabled="multiple"
+          @click="handleDelete"
+          v-hasPermi="['production:matrix:remove']"
+        >删除</el-button>
+      </el-col>
+	  <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+    </el-row>
+
+    <el-table v-loading="loading" :data="matrixList" @selection-change="handleSelectionChange" :span-method="mergeMethod" :height="clientHeight" border>
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="岗位" align="center" prop="usePost" :formatter="usePostFormat" />
+      <el-table-column label="PPE种类" align="center" prop="ppeType" :show-overflow-tooltip="true"/>
+      <el-table-column label="指定人" align="center" prop="assigner" :show-overflow-tooltip="true"/>
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['production:matrix:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['production:matrix:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改ppe矩阵管理对话框 -->
+    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="PPE种类" prop="ppeType">
+          <el-input v-model="form.ppeType" placeholder="请输入PPE种类" />
+        </el-form-item>
+        <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"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="是否指定人" prop="isAssigner">
+          <el-checkbox v-model="form.isAssigner">是否指定人?</el-checkbox>
+        </el-form-item>
+        <el-form-item label="指定人" prop="assigner" v-if="form.isAssigner">
+          <el-input v-model="form.assigner" placeholder="请输入指定人" />
+        </el-form-item>
+        <el-form-item label="备注" prop="remarks">
+          <el-input v-model="form.remarks" placeholder="请输入备注" />
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="submitForm">确 定</el-button>
+        <el-button @click="cancel">取 消</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { listMatrix, getMatrix, delMatrix, addMatrix, updateMatrix, exportMatrix, importTemplate} from "@/api/production/matrix";
+import { treeselect } from "@/api/system/dept";
+import { getToken } from "@/utils/auth";
+import Treeselect from "@riophae/vue-treeselect";
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+
+export default {
+  name: "Matrix",
+  components: { Treeselect },
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: false,
+      // 总条数
+      total: 0,
+      // ppe矩阵管理表格数据
+      matrixList: [],
+      // 弹出层标题
+      title: "",
+      // 部门树选项
+      deptOptions: undefined,
+      clientHeight:300,
+      // 是否显示弹出层
+      open: false,
+      // 应配备岗位字典
+      usePostOptions: [],
+        // 用户导入参数
+        upload: {
+            // 是否显示弹出层(用户导入)
+            open: false,
+            // 弹出层标题(用户导入)
+            title: "",
+            // 是否禁用上传
+            isUploading: false,
+            // 是否更新已经存在的用户数据
+            updateSupport: 0,
+            // 设置上传的请求头部
+            headers: { Authorization: "Bearer " + getToken() },
+            // 上传的地址
+            url: process.env.VUE_APP_BASE_API + "/production/matrix/importData"
+        },
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        ppeType: null,
+        usePost: null,
+        assigner: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        remarks: null,
+        deptId: null,
+        isAssigner: null
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        deptId: [
+          { required: true, message: "部门编号不能为空", trigger: "blur" }
+        ],
+      }
+    };
+  },
+  watch: {
+        // 根据名称筛选部门树
+        deptName(val) {
+            this.$refs.tree.filter(val);
+        }
+   },
+  created() {
+      //设置表格高度对应屏幕高度
+      this.$nextTick(() => {
+          this.clientHeight = document.body.clientHeight -250
+      })
+    this.getList();
+    this.getTreeselect();
+    this.getDicts("PPE_POST").then(response => {
+      this.usePostOptions = response.data;
+    });
+  },
+  methods: {
+    /** 查询ppe矩阵管理列表 */
+    getList() {
+      this.loading = true;
+      listMatrix(this.queryParams).then(response => {
+        this.matrixList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+     /** 查询部门下拉树结构 */
+     getTreeselect() {
+          treeselect().then(response => {
+              this.deptOptions = response.data;
+          });
+     },
+    // 应配备岗位字典翻译
+    usePostFormat(row, column) {
+      return this.selectDictLabel(this.usePostOptions, row.usePost);
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        ppeType: null,
+        usePost: null,
+        assigner: null,
+        delFlag: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        remarks: null,
+        deptId: null,
+        isAssigner: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加ppe矩阵管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getMatrix(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改ppe矩阵管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateMatrix(this.form).then(response => {
+              this.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addMatrix(this.form).then(response => {
+              this.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$confirm('是否确认删除?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return delMatrix(ids);
+        }).then(() => {
+          this.getList();
+          this.msgSuccess("删除成功");
+        })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      const queryParams = this.queryParams;
+      this.$confirm('是否确认导出所有ppe矩阵管理数据项?', "警告", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(function() {
+          return exportMatrix(queryParams);
+        }).then(response => {
+          this.download(response.msg);
+        })
+    },
+      /** 导入按钮操作 */
+      handleImport() {
+          this.upload.title = "用户导入";
+          this.upload.open = true;
+      },
+      /** 下载模板操作 */
+      importTemplate() {
+          importTemplate().then(response => {
+              this.download(response.msg);
+          });
+      },
+      // 文件上传中处理
+      handleFileUploadProgress(event, file, fileList) {
+          this.upload.isUploading = true;
+      },
+      // 文件上传成功处理
+      handleFileSuccess(response, file, fileList) {
+          this.upload.open = false;
+          this.upload.isUploading = false;
+          this.$refs.upload.clearFiles();
+          this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
+          this.getList();
+      },
+      // 提交上传文件
+      submitFileForm() {
+          this.$refs.upload.submit();
+      },
+
+    //合并单元格
+    mergeMethod({row, column, rowIndex, columnIndex}) {
+      // console.log(row)
+      if (columnIndex===1) {
+        const _row = this.setTable(this.matrixList).merge[rowIndex];
+        const _col = _row > 0 ? 1 : 0;
+        return {
+          rowspan: _row,
+          colspan: _col
+        };
+      }
+    },
+    //单元格整理
+    setTable(tableData) {
+      //    console.log(tableData)
+      let spanArr = [],
+        concat = 0;
+      tableData.forEach((item, index) => {
+        if (index === 0) {
+          spanArr.push(1);
+        } else {
+          if (item.usePost === tableData[index - 1].usePost) {
+            //第一列需合并相同内容的判断条件
+            spanArr[concat] += 1;
+            spanArr.push(0);
+          } else {
+            spanArr.push(1);
+            concat = index;
+          }
+        }
+      });
+      return {
+        merge: spanArr
+      };
+    },
+  }
+};
+</script>

+ 186 - 273
ui/src/views/production/person/index.vue

@@ -187,42 +187,25 @@
         <div v-if="detail.row.sex!=1">
           <el-table :data="detail.staffLocker" border>
             <el-table-column align="center" label="自行车棚员工PPE柜">
-              <el-table-column align="center" label="PPE种类" prop="ppeType">
-                <template slot-scope="scope">
-                  <div v-if="detail.isEdit||detail.isAdd">
-                    <el-input v-model="scope.row.ppeType" placehoder="请输入PPE种类"/>
-                  </div>
-                  <span v-else>{{ scope.row.ppeType }}</span>
-                </template>
-              </el-table-column>
+              <el-table-column align="center" label="PPE种类" prop="ppeType"/>
               <el-table-column align="center" label="检查内容">
-                <el-table-column align="center" label="应配备岗位" prop="usePost">
-                  <template slot-scope="scope">
-                    <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.usePost" clearable multiple placeholder="请选择应配备岗位"
-                                 size="small">
-                        <el-option
-                          v-for="dict in ppePostOptions"
-                          :key="dict.dictValue"
-                          :label="dict.dictLabel"
-                          :value="dict.dictValue"
-                        />
-                      </el-select>
-                    </div>
-                    <span v-else>{{ scope.row.usePost }}</span>
-                  </template>
-                </el-table-column>
+                <el-table-column align="center" label="应配备岗位" prop="usePost"/>
                 <el-table-column align="center" label="是否配备" prop="isEquip">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.isEquip" clearable placeholder="请选择是否配备" size="small">
+<!--                      <el-select v-model="scope.row.isEquip" clearable placeholder="请选择是否配备" size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
                           :key="dict.dictValue"
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.isEquip">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isEquip }}</span>
                   </template>
@@ -230,7 +213,7 @@
                 <el-table-column align="center" label="是否无破损、未被污染" prop="isPollution">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.isPollution" clearable placeholder="请选择是否无破损、未被污染"
+<!--                      <el-select v-model="scope.row.isPollution" clearable placeholder="请选择是否无破损、未被污染"
                                  size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -238,7 +221,12 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.isPollution">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isPollution }}</span>
                   </template>
@@ -246,7 +234,7 @@
                 <el-table-column align="center" label="摆放符合要求" prop="putAsRequired">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.putAsRequired" clearable placeholder="请选择是否摆放符合要求"
+<!--                      <el-select v-model="scope.row.putAsRequired" clearable placeholder="请选择是否摆放符合要求"
                                  size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -254,7 +242,12 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.putAsRequired">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.putAsRequired }}</span>
                   </template>
@@ -262,7 +255,7 @@
                 <el-table-column align="center" label="是否按要求贴“使用时间卡”" prop="isRequire">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.isRequire" clearable placeholder="请选择是否按要求贴“使用时间卡"
+<!--                      <el-select v-model="scope.row.isRequire" clearable placeholder="请选择是否按要求贴“使用时间卡"
                                  size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -270,7 +263,12 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.isRequire">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isRequire }}</span>
                   </template>
@@ -278,7 +276,7 @@
                 <el-table-column align="center" label="是否在使用有效期内" prop="isValidity">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.isValidity" clearable placeholder="请选择是否在使用有效期内"
+<!--                      <el-select v-model="scope.row.isValidity" clearable placeholder="请选择是否在使用有效期内"
                                  size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -286,7 +284,12 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.isValidity">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isValidity }}</span>
                   </template>
@@ -294,7 +297,7 @@
                 <el-table-column align="center" label="检验合格的标识在有效期内" prop="isIdentification">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.isIdentification" clearable
+<!--                      <el-select v-model="scope.row.isIdentification" clearable
                                  placeholder="请选择是否检验合格的标识在有效期内" size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -302,7 +305,12 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.isIdentification">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isIdentification }}</span>
                   </template>
@@ -310,7 +318,7 @@
                 <el-table-column align="center" label="是否配有专用湿巾" prop="isWetTissue">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="detail.isWetTissue" clearable placeholder="请选择是否配有专用湿巾"
+<!--                      <el-select v-model="detail.isWetTissue" clearable placeholder="请选择是否配有专用湿巾"
                                  size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -318,25 +326,30 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="detail.isWetTissue">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isWetTissue }}</span>
                   </template>
                 </el-table-column>
               </el-table-column>
-              <el-table-column
-                v-if="detail.isAdd||detail.isEdit"
-                label="操作"
-                width="100px">
-                <template slot-scope="scope">
-                  <el-button
-                    size="small"
-                    type="text"
-                    @click.native.prevent="deleteRow(scope.$index, detail.staffLocker)">
-                    移除
-                  </el-button>
-                </template>
-              </el-table-column>
+              <!--              <el-table-column
+                              v-if="detail.isAdd||detail.isEdit"
+                              label="操作"
+                              width="100px">
+                              <template slot-scope="scope">
+                                <el-button
+                                  size="small"
+                                  type="text"
+                                  @click.native.prevent="deleteRow(scope.$index, detail.staffLocker)">
+                                  移除
+                                </el-button>
+                              </template>
+                            </el-table-column>-->
             </el-table-column>
           </el-table>
           <div v-if="detail.isAdd||detail.isEdit" style="margin-top: 10px">
@@ -348,55 +361,38 @@
               {{ detail.staffRemark }}
             </el-descriptions-item>
           </el-descriptions>
-          <div>
-            <el-button v-if="detail.isAdd||detail.isEdit"
-                       icon="el-icon-plus"
-                       type="text"
-                       @click="addRow(detail.staffLocker)">
-              添加一行
-            </el-button>
-          </div>
+          <!--          <div>
+                      <el-button v-if="detail.isAdd||detail.isEdit"
+                                 icon="el-icon-plus"
+                                 type="text"
+                                 @click="addRow(detail.staffLocker)">
+                        添加一行
+                      </el-button>
+                    </div>-->
         </div>
 
         <div v-if="detail.row.sex!=1">
           <el-table :data="detail.cmldefLocker" border style="margin: 20px 0 0 0;">
             <el-table-column align="center" label="自行车棚防化靴/防化服柜">
-              <el-table-column align="center" label="PPE种类" prop="ppeType">
-                <template slot-scope="scope">
-                  <div v-if="detail.isEdit||detail.isAdd">
-                    <el-input v-model="scope.row.ppeType" placehoder="请输入PPE种类"/>
-                  </div>
-                  <span v-else>{{ scope.row.ppeType }}</span>
-                </template>
-              </el-table-column>
+              <el-table-column align="center" label="PPE种类" prop="ppeType"/>
               <el-table-column align="center" label="检查内容">
-                <el-table-column align="center" label="应配备岗位" prop="usePost">
-                  <template slot-scope="scope">
-                    <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.usePost" clearable multiple placeholder="请选择应配备岗位"
-                                 size="small">
-                        <el-option
-                          v-for="dict in ppePostOptions"
-                          :key="dict.dictValue"
-                          :label="dict.dictLabel"
-                          :value="dict.dictValue"
-                        />
-                      </el-select>
-                    </div>
-                    <span v-else>{{ scope.row.usePost }}</span>
-                  </template>
-                </el-table-column>
+                <el-table-column align="center" label="应配备岗位" prop="usePost"/>
                 <el-table-column align="center" label="是否配备" prop="isEquip">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.isEquip" clearable placeholder="请选择是否配备" size="small">
+<!--                      <el-select v-model="scope.row.isEquip" clearable placeholder="请选择是否配备" size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
                           :key="dict.dictValue"
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.isEquip">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isEquip }}</span>
                   </template>
@@ -404,7 +400,7 @@
                 <el-table-column align="center" label="是否无破损、未被污染" prop="isPollution">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.isPollution" clearable placeholder="请选择是否无破损、未被污染"
+<!--                      <el-select v-model="scope.row.isPollution" clearable placeholder="请选择是否无破损、未被污染"
                                  size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -412,7 +408,12 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.isPollution">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isPollution }}</span>
                   </template>
@@ -420,7 +421,7 @@
                 <el-table-column align="center" label="摆放符合要求" prop="putAsRequired">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.putAsRequired" clearable placeholder="请选择是否摆放符合要求"
+<!--                      <el-select v-model="scope.row.putAsRequired" clearable placeholder="请选择是否摆放符合要求"
                                  size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -428,7 +429,12 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.putAsRequired">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.putAsRequired }}</span>
                   </template>
@@ -436,7 +442,7 @@
                 <el-table-column align="center" label="检验合格的标识在有效期内" prop="isIdentification">
                   <template slot-scope="scope">
                     <div v-if="detail.isEdit||detail.isAdd">
-                      <el-select v-model="scope.row.isIdentification" clearable
+<!--                      <el-select v-model="scope.row.isIdentification" clearable
                                  placeholder="请选择是否检验合格的标识在有效期内" size="small">
                         <el-option
                           v-for="dict in ppeCheckOptions"
@@ -444,25 +450,30 @@
                           :label="dict.dictLabel"
                           :value="dict.dictValue"
                         />
-                      </el-select>
+                      </el-select>-->
+                      <el-radio-group v-model="scope.row.isIdentification">
+                        <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                          {{ dict.dictLabel }}
+                        </el-radio-button>
+                      </el-radio-group>
                     </div>
                     <span v-else>{{ scope.row.isIdentification }}</span>
                   </template>
                 </el-table-column>
               </el-table-column>
-              <el-table-column
-                v-if="detail.isAdd||detail.isEdit"
-                label="操作"
-                width="100px">
-                <template slot-scope="scope">
-                  <el-button
-                    size="small"
-                    type="text"
-                    @click.native.prevent="deleteRow(scope.$index, detail.cmldefLocker)">
-                    移除
-                  </el-button>
-                </template>
-              </el-table-column>
+              <!--              <el-table-column
+                              v-if="detail.isAdd||detail.isEdit"
+                              label="操作"
+                              width="100px">
+                              <template slot-scope="scope">
+                                <el-button
+                                  size="small"
+                                  type="text"
+                                  @click.native.prevent="deleteRow(scope.$index, detail.cmldefLocker)">
+                                  移除
+                                </el-button>
+                              </template>
+                            </el-table-column>-->
             </el-table-column>
           </el-table>
           <div v-if="detail.isAdd||detail.isEdit" style="margin-top: 10px">
@@ -474,14 +485,14 @@
               {{ detail.cmldefRemark }}
             </el-descriptions-item>
           </el-descriptions>
-          <div>
-            <el-button v-if="detail.isAdd||detail.isEdit"
-                       icon="el-icon-plus"
-                       type="text"
-                       @click="addRow(detail.cmldefLocker)">
-              添加一行
-            </el-button>
-          </div>
+          <!--          <div>
+                      <el-button v-if="detail.isAdd||detail.isEdit"
+                                 icon="el-icon-plus"
+                                 type="text"
+                                 @click="addRow(detail.cmldefLocker)">
+                        添加一行
+                      </el-button>
+                    </div>-->
         </div>
 
         <el-table :data="detail.wardrobe" border style="margin: 20px 0 0 0;">
@@ -490,7 +501,7 @@
               <el-table-column align="center" label="没有存放污染工作服/工作鞋">
                 <template slot-scope="scope">
                   <div v-if="detail.isEdit||detail.isAdd">
-                    <el-select v-model="scope.row.noPollution" clearable
+<!--                    <el-select v-model="scope.row.noPollution" clearable
                                placeholder="请选择是否没有存放污染工作服/工作鞋" size="small">
                       <el-option
                         v-for="dict in ppeCheckOptions"
@@ -498,7 +509,12 @@
                         :label="dict.dictLabel"
                         :value="dict.dictValue"
                       />
-                    </el-select>
+                    </el-select>-->
+                    <el-radio-group v-model="scope.row.noPollution">
+                      <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                        {{ dict.dictLabel }}
+                      </el-radio-button>
+                    </el-radio-group>
                   </div>
                   <span v-else>{{ scope.row.noPollution }}</span>
                 </template>
@@ -506,7 +522,7 @@
               <el-table-column align="center" label="摆放符合要求">
                 <template slot-scope="scope">
                   <div v-if="detail.isEdit||detail.isAdd">
-                    <el-select v-model="scope.row.putAsRequired" clearable
+<!--                    <el-select v-model="scope.row.putAsRequired" clearable
                                placeholder="请选择是否摆放符合要求" size="small">
                       <el-option
                         v-for="dict in ppeCheckOptions"
@@ -514,7 +530,12 @@
                         :label="dict.dictLabel"
                         :value="dict.dictValue"
                       />
-                    </el-select>
+                    </el-select>-->
+                    <el-radio-group v-model="scope.row.putAsRequired">
+                      <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                        {{ dict.dictLabel }}
+                      </el-radio-button>
+                    </el-radio-group>
                   </div>
                   <span v-else>{{ scope.row.putAsRequired }}</span>
                 </template>
@@ -522,7 +543,7 @@
               <el-table-column align="center" label="未存放食物/饮料">
                 <template slot-scope="scope">
                   <div v-if="detail.isEdit||detail.isAdd">
-                    <el-select v-model="scope.row.noFood" clearable
+<!--                    <el-select v-model="scope.row.noFood" clearable
                                placeholder="请选择是否未存放食物/饮料" size="small">
                       <el-option
                         v-for="dict in ppeCheckOptions"
@@ -530,24 +551,29 @@
                         :label="dict.dictLabel"
                         :value="dict.dictValue"
                       />
-                    </el-select>
+                    </el-select>-->
+                    <el-radio-group v-model="scope.row.noFood">
+                      <el-radio-button :label="dict.dictLabel"  v-for="dict in ppeCheckOptions">
+                        {{ dict.dictLabel }}
+                      </el-radio-button>
+                    </el-radio-group>
                   </div>
                   <span v-else>{{ scope.row.noFood }}</span>
                 </template>
               </el-table-column>
-              <el-table-column
-                v-if="detail.isAdd||detail.isEdit"
-                label="操作"
-                width="100px">
-                <template slot-scope="scope">
-                  <el-button
-                    size="small"
-                    type="text"
-                    @click.native.prevent="deleteRow(scope.$index, detail.wardrobe)">
-                    移除
-                  </el-button>
-                </template>
-              </el-table-column>
+              <!--              <el-table-column
+                              v-if="detail.isAdd||detail.isEdit"
+                              label="操作"
+                              width="100px">
+                              <template slot-scope="scope">
+                                <el-button
+                                  size="small"
+                                  type="text"
+                                  @click.native.prevent="deleteRow(scope.$index, detail.wardrobe)">
+                                  移除
+                                </el-button>
+                              </template>
+                            </el-table-column>-->
             </el-table-column>
           </el-table-column>
         </el-table>
@@ -560,14 +586,14 @@
             {{ detail.wardrobeRemark }}
           </el-descriptions-item>
         </el-descriptions>
-        <div>
-          <el-button v-if="detail.isAdd||detail.isEdit"
-                     icon="el-icon-plus"
-                     type="text"
-                     @click="addRow(detail.wardrobe)">
-            添加一行
-          </el-button>
-        </div>
+        <!--        <div>
+                  <el-button v-if="detail.isAdd||detail.isEdit"
+                             icon="el-icon-plus"
+                             type="text"
+                             @click="addRow(detail.wardrobe)">
+                    添加一行
+                  </el-button>
+                </div>-->
 
         <div v-if="!detail.isEdit&&!detail.isAdd&&detail.checker&&detail.checkDate"
              style="width: 100%;font-size: 20px;text-align: center;margin-top: 20px">
@@ -600,6 +626,7 @@ import {getToken} from "@/utils/auth";
 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";
 
 export default {
   name: "Person",
@@ -802,137 +829,23 @@ export default {
       this.detail.oldStaffLocker = this.detail.staffLocker;
       this.detail.oldCmldefLocker = this.detail.cmldefLocker;
       this.detail.oldWardrobe = this.detail.wardrobe;
-      if (this.detail.row.sex != 1) {
-        this.detail.isWetTissue = '是';
-        this.detail.staffLocker = [
-          {
-            ppeType: '安全帽',
-            usePost: ['所有岗位'],
-            isIdentification: 'N.A',
-            isValidity: '是',
-            isRequire: 'N.A',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          },
-          {
-            ppeType: '耳罩',
-            usePost: ['所有岗位'],
-            isIdentification: 'N.A',
-            isValidity: 'N.A',
-            isRequire: 'N.A',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          },
-          {
-            ppeType: '皮革工作手套',
-            usePost: ['所有岗位'],
-            isIdentification: 'N.A',
-            isValidity: 'N.A',
-            isRequire: 'N.A',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          },
-          {
-            ppeType: 'Ansell38-628合成橡胶手套',
-            usePost: ['所有岗位'],
-            isIdentification: 'N.A',
-            isValidity: '是',
-            isRequire: 'N.A',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          },
-          {
-            ppeType: 'Ansell37-675.676丁腈橡胶手套',
-            usePost: ['所有岗位'],
-            isIdentification: 'N.A',
-            isValidity: '是',
-            isRequire: 'N.A',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          },
-          {
-            ppeType: '安全眼镜',
-            usePost: ['所有岗位'],
-            isIdentification: 'N.A',
-            isValidity: 'N.A',
-            isRequire: 'N.A',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          },
-          {
-            ppeType: '3S宽视野全面罩',
-            usePost: ['所有岗位'],
-            isIdentification: '是',
-            isValidity: 'N.A',
-            isRequire: 'N.A',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          },
-          {
-            ppeType: '滤罐93ABEK2Hg/St型',
-            usePost: ['所有岗位'],
-            isIdentification: 'N.A',
-            isValidity: '是',
-            isRequire: '是',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          }, {
-            ppeType: '防化眼镜',
-            usePost: ['裂解', '热区', 'PGU&AEU', '白班操作员']
-          },
-          {
-            ppeType: '滤罐90AX型',
-            usePost: ['裂解', '热区', 'PGU&AEU']
-          },
-          {
-            ppeType: '防护面罩',
-            usePost: ['裂解', '热区', '白班操作员']
-          },
-          {
-            ppeType: '看火眼镜',
-            usePost: ['裂解']
-          },
-          {
-            ppeType: '优越410半面罩',
-            usePost: ['裂解', '白班操作员']
-          }
-        ];
-      }
-      if (this.detail.row.sex != 1) {
-        this.detail.cmldefLocker = [
-          {
-            ppeType: '防化靴',
-            usePost: ['热区指定人', '白班操作员'],
-            isIdentification: 'N.A',
-            putAsRequired: '是',
-            isPollution: '是',
-            isEquip: '是'
-          },
-          {
-            ppeType: '连体防化服MC5000',
-            usePost: ['热区指定人', '白班操作员'],
-            isIdentification: '是',
-            putAsRequired: '是',
-            isPollution: 'N.A',
-            isEquip: '是'
-          }
-        ];
-      }
-      this.detail.wardrobe = [
-        {
-          noPollution: '是',
-          putAsRequired: '是',
-          noFood: '是'
-        }
-      ];
+      this.detail.isWetTissue = '是';
+      this.detail.staffLocker = [];
+      this.detail.cmldefLocker = [];
+      this.detail.wardrobe = [];
+      listMatrixByPost({staffId: this.detail.row.employeeid}).then(res => {
+        if (res.data.staffLockers)
+          res.data.staffLockers.forEach(item => {
+            item.usePost = item.usePost.split('、');
+          })
+        if (res.data.cmldefLockers)
+          res.data.cmldefLockers.forEach(item => {
+            item.usePost = item.usePost.split('、');
+          })
+        this.detail.staffLocker = res.data.staffLockers;
+        this.detail.cmldefLocker = res.data.cmldefLockers;
+        this.detail.wardrobe = res.data.wardrobes;
+      })
     },
     cancelDetail() {
       this.detail.isEdit = false;
@@ -963,12 +876,12 @@ export default {
       this.getMainList(row);
     },
     getMainList(row) {
-      this.detail.loading=true;
+      this.detail.loading = true;
       this.detail.queryParams.staffId = this.detail.row.employeeid || row.employeeid;
       listMain(this.detail.queryParams).then(res => {
         this.detail.mainList = res.rows;
         this.detail.total = res.total;
-        this.detail.loading=false;
+        this.detail.loading = false;
       })
     },
     getDetail(row) {
@@ -1176,7 +1089,7 @@ export default {
     /** 导出按钮操作 */
     exportCheck(row) {
       const queryParams = this.detail.queryParams;
-      queryParams.id=row.id;
+      queryParams.id = row.id;
       this.$confirm('是否确认导出?', "警告", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",