Browse Source

-破锁管理

jiangbiao 2 years ago
parent
commit
946fa23a28

+ 1 - 1
master/src/main/java/com/ruoyi/framework/task/TodoTask.java

@@ -34,7 +34,7 @@ public class TodoTask extends BaseController {
                         .taskCandidateOrAssigned(item.getUserId().toString())
                         //                .taskAssignee(getUserId().toString())
                         .orderByTaskCreateTime().desc().list();//参与者,组任务查询
-                logger.info("==========================任务列表:{}",taskList);
+                //logger.info("==========================任务列表:{}",taskList);
                 String username = item.getNickName();
                 String loginName = item.getUserName();
                 String usernameEN = PinyinHelper.convertToPinyinString(username, " ", PinyinFormat.WITHOUT_TONE);

+ 213 - 0
master/src/main/java/com/ruoyi/project/apply/controller/TApplyLockController.java

@@ -0,0 +1,213 @@
+package com.ruoyi.project.apply.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.ruoyi.common.utils.file.ExcelUtils;
+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.apply.domain.TApplyLock;
+import com.ruoyi.project.apply.service.ITApplyLockService;
+import com.ruoyi.project.system.domain.SysDept;
+import com.ruoyi.project.system.service.ISysDeptService;
+import org.apache.poi.ss.usermodel.Cell;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.apache.poi.ss.usermodel.Workbook;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.IOException;
+import java.util.*;
+
+/**
+ * 破锁管理Controller
+ *
+ * @author ruoyi
+ * @date 2023-03-06
+ */
+@RestController
+@RequestMapping("/apply/lock")
+public class TApplyLockController extends BaseController {
+    @Autowired
+    private ITApplyLockService tApplyLockService;
+
+    @Autowired
+    private ISysDeptService iSysDeptService;
+
+    /**
+     * 查询破锁管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('apply:lock:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(TApplyLock tApplyLock) {
+        startPage();
+        List<TApplyLock> list = tApplyLockService.selectTApplyLockList(tApplyLock);
+        return getDataTable(list);
+    }
+
+    @PreAuthorize("@ss.hasPermi('apply:lock:list')")
+    @GetMapping("/listAllLock")
+    public AjaxResult listAllLock(TApplyLock tApplyLock) {
+        List<TApplyLock> list = tApplyLockService.selectTApplyLockList(tApplyLock);
+        List<List<TApplyLock>> result = new ArrayList<>();
+        List<TApplyLock> item = new ArrayList<>();
+        int count = 1;
+        for (int i = 0; i < list.size(); i++) {
+            item.add(list.get(i));
+            if (count == 35) {
+                count = 0;
+                result.add(item);
+                item = new ArrayList<>();
+            } else if ((list.size() % 35)==(list.size()-i)) {
+                result.add(list.subList(i, list.size()));
+                break;
+            }
+            count++;
+        }
+        return AjaxResult.success(result);
+    }
+
+    /**
+     * 导出破锁管理列表
+     */
+    @PreAuthorize("@ss.hasPermi('apply:lock:export')")
+    @Log(title = "破锁管理", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(TApplyLock tApplyLock) {
+        List<TApplyLock> list = tApplyLockService.selectTApplyLockList(tApplyLock);
+        ExcelUtil<TApplyLock> util = new ExcelUtil<TApplyLock>(TApplyLock.class);
+        return util.exportExcel(list, "lock");
+    }
+
+    /**
+     * 获取破锁管理详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('apply:lock:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return AjaxResult.success(tApplyLockService.selectTApplyLockById(id));
+    }
+
+    /**
+     * 新增破锁管理
+     */
+    @PreAuthorize("@ss.hasPermi('apply:lock:add')")
+    @Log(title = "破锁管理", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody TApplyLock tApplyLock) {
+        tApplyLock.setCreaterCode(getUserId().toString());
+        tApplyLock.setCreatedate(new Date());
+        return toAjax(tApplyLockService.insertTApplyLock(tApplyLock));
+    }
+
+    /**
+     * 修改破锁管理
+     */
+    @PreAuthorize("@ss.hasPermi('apply:lock:edit')")
+    @Log(title = "破锁管理", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody TApplyLock tApplyLock) {
+        return toAjax(tApplyLockService.updateTApplyLock(tApplyLock));
+    }
+
+    /**
+     * 删除破锁管理
+     */
+    @PreAuthorize("@ss.hasPermi('apply:lock:remove')")
+    @Log(title = "破锁管理", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(tApplyLockService.deleteTApplyLockByIds(ids));
+    }
+
+    @PreAuthorize("@ss.hasPermi('apply:lock:add')")
+    @Log(title = "破锁管理", businessType = BusinessType.INSERT)
+    @PostMapping("/importData")
+    public AjaxResult importData(@RequestParam("file") MultipartFile file) throws IOException {
+        //获取操作人员ID
+        Long userId = getUserId();
+        //报错行数统计
+        List<Integer> failRow = new ArrayList<Integer>();
+        Workbook workbook = ExcelUtils.getWorkBook(file);
+        Sheet sheet = workbook.getSheetAt(0);
+        List<TApplyLock> list = new ArrayList<>();
+        int rowNum = sheet.getPhysicalNumberOfRows();
+        //部门查询
+        List<SysDept> dept = iSysDeptService.selectDeptList(new SysDept());
+        int failNumber = 0;
+        for (int i = 1; i < rowNum; i++) {
+            try {
+                logger.info("读取行数:" + i);
+                Row row = sheet.getRow(i);
+                int cellNum = row.getPhysicalNumberOfCells();
+                TApplyLock entity = new TApplyLock();
+                for (int j = 0; j < cellNum; j++) {
+                    Cell cell = row.getCell(j);
+                    //  cell.setCellType(CellType.STRING);
+                    String cellValue = ExcelUtils.getCellValue(cell);
+                    logger.info("cellValue:" + cellValue);
+                    if (j == 0) {
+                        entity.setUnit(cellValue);
+                    } else if (j == 1) {
+                        entity.setLockPost(cellValue);
+                    } else if (j == 2) {
+                        entity.setPidNo(cellValue);
+                    } else if (j == 3) {
+                        entity.setLockCode(cellValue);
+                    } else if (j == 4) {
+                        entity.setMedium(cellValue);
+                    } else if (j == 5) {
+                        entity.setPosition(cellValue);
+                    } else if (j == 6) {
+                        entity.setReason(cellValue);
+                    } else if (j == 7) {
+                        entity.setTechnology(cellValue);
+                    } else if (j == 8) {
+                        entity.setRiskLevel(cellValue);
+                    } else if (j == 9) {
+                        entity.setLockSize(cellValue);
+                    } else if (j == 10) {
+                        entity.setValveStatus(cellValue);
+                    } else if (j == 11) {
+                        for (SysDept d : dept) {
+                            if (d.getDeptName().equals(cellValue.trim())) {
+                                entity.setDeptId(d.getDeptId());//部门编号
+                            }
+                        }
+                    }
+                }
+                entity.setCreaterCode(userId.toString());
+                entity.setCreatedate(new Date());
+                logger.info("entity:" + entity);
+                list.add(entity);
+            } catch (Exception e) {
+                logger.error("Exception:{}", e.getMessage());
+                failNumber++;
+                failRow.add(i + 1);
+            }
+        }
+        int successNumber = 0;
+        int failNum = 0;
+        for (TApplyLock t : list
+        ) {
+            failNum++;
+            try {
+                tApplyLockService.insertTApplyLock(t);
+                successNumber++;
+            } catch (Exception e) {
+                failNumber++;
+                failRow.add(failNum + 1);
+            }
+        }
+        logger.info("list:" + JSON.toJSONString(list));
+        logger.info("successNumber:" + String.valueOf(successNumber));
+        logger.info("failNumber:" + String.valueOf(failNumber));
+        logger.info("failRow:" + String.valueOf(failRow));
+        return AjaxResult.success(String.valueOf(successNumber), failRow);
+    }
+}

+ 340 - 0
master/src/main/java/com/ruoyi/project/apply/domain/TApplyLock.java

@@ -0,0 +1,340 @@
+package com.ruoyi.project.apply.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+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;
+
+import java.util.Date;
+
+/**
+ * 破锁管理对象 t_apply_lock
+ *
+ * @author ruoyi
+ * @date 2023-03-06
+ */
+public class TApplyLock extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 唯一标识ID
+     */
+    private Long id;
+
+    /**
+     * 单元
+     */
+    @Excel(name = "单元")
+    private String unit;
+
+    /**
+     * 岗位
+     */
+    @Excel(name = "岗位")
+    private String lockPost;
+
+    /**
+     * P&ID图号
+     */
+    @Excel(name = "P&ID图号")
+    private String pidNo;
+
+    /**
+     * 编号
+     */
+    @Excel(name = "编号")
+    private String lockCode;
+
+    /**
+     * 介质
+     */
+    @Excel(name = "介质")
+    private String medium;
+
+    /**
+     * 位置描述
+     */
+    @Excel(name = "位置描述")
+    private String position;
+
+    /**
+     * 锁开锁关原因
+     */
+    @Excel(name = "锁开锁关原因")
+    private String reason;
+
+    /**
+     * 安全阀/工艺
+     */
+    @Excel(name = "安全阀/工艺")
+    private String technology;
+
+    /**
+     * 风险等级
+     */
+    @Excel(name = "风险等级")
+    private String riskLevel;
+
+    /**
+     * 尺寸
+     */
+    @Excel(name = "尺寸")
+    private String lockSize;
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注")
+    private String remarks;
+
+    /**
+     * 状态
+     */
+    @Excel(name = "状态")
+    private Long status;
+
+    /**
+     * 删除标识
+     */
+    private Long delFlag;
+
+    /**
+     * 创建人
+     */
+    @Excel(name = "创建人")
+    private String createrCode;
+
+    /**
+     * 阀门状态
+     */
+    @Excel(name = "阀门状态")
+    private String valveStatus;
+
+    /**
+     * 部门名称
+     */
+    @Excel(name = "部门名称")
+    @TableField(exist = false)
+    private String deptName;
+
+    /**
+     * 创建时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date createdate;
+
+    /**
+     * 修改人
+     */
+    @Excel(name = "修改人")
+    private Long updaterCode;
+
+    /**
+     * 修改时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date updatedate;
+
+    /**
+     * 部门id
+     */
+    @Excel(name = "部门id")
+    private Long deptId;
+
+    public String getDeptName() {
+        return deptName;
+    }
+
+    public void setDeptName(String deptName) {
+        this.deptName = deptName;
+    }
+
+    public String getValveStatus() {
+        return valveStatus;
+    }
+
+    public void setValveStatus(String valveStatus) {
+        this.valveStatus = valveStatus;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setUnit(String unit) {
+        this.unit = unit;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public void setLockPost(String lockPost) {
+        this.lockPost = lockPost;
+    }
+
+    public String getLockPost() {
+        return lockPost;
+    }
+
+    public void setPidNo(String pidNo) {
+        this.pidNo = pidNo;
+    }
+
+    public String getPidNo() {
+        return pidNo;
+    }
+
+    public void setLockCode(String lockCode) {
+        this.lockCode = lockCode;
+    }
+
+    public String getLockCode() {
+        return lockCode;
+    }
+
+    public void setMedium(String medium) {
+        this.medium = medium;
+    }
+
+    public String getMedium() {
+        return medium;
+    }
+
+    public void setPosition(String position) {
+        this.position = position;
+    }
+
+    public String getPosition() {
+        return position;
+    }
+
+    public void setReason(String reason) {
+        this.reason = reason;
+    }
+
+    public String getReason() {
+        return reason;
+    }
+
+    public void setTechnology(String technology) {
+        this.technology = technology;
+    }
+
+    public String getTechnology() {
+        return technology;
+    }
+
+    public void setRiskLevel(String riskLevel) {
+        this.riskLevel = riskLevel;
+    }
+
+    public String getRiskLevel() {
+        return riskLevel;
+    }
+
+    public void setLockSize(String lockSize) {
+        this.lockSize = lockSize;
+    }
+
+    public String getLockSize() {
+        return lockSize;
+    }
+
+    public void setRemarks(String remarks) {
+        this.remarks = remarks;
+    }
+
+    public String getRemarks() {
+        return remarks;
+    }
+
+    public void setStatus(Long status) {
+        this.status = status;
+    }
+
+    public Long getStatus() {
+        return status;
+    }
+
+    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(Long updaterCode) {
+        this.updaterCode = updaterCode;
+    }
+
+    public Long getUpdaterCode() {
+        return updaterCode;
+    }
+
+    public void setUpdatedate(Date updatedate) {
+        this.updatedate = updatedate;
+    }
+
+    public Date getUpdatedate() {
+        return updatedate;
+    }
+
+    public void setDeptId(Long deptId) {
+        this.deptId = deptId;
+    }
+
+    public Long getDeptId() {
+        return deptId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("unit", getUnit())
+                .append("lockPost", getLockPost())
+                .append("pidNo", getPidNo())
+                .append("lockCode", getLockCode())
+                .append("medium", getMedium())
+                .append("position", getPosition())
+                .append("reason", getReason())
+                .append("technology", getTechnology())
+                .append("riskLevel", getRiskLevel())
+                .append("lockSize", getLockSize())
+                .append("remarks", getRemarks())
+                .append("status", getStatus())
+                .append("delFlag", getDelFlag())
+                .append("createrCode", getCreaterCode())
+                .append("createdate", getCreatedate())
+                .append("updaterCode", getUpdaterCode())
+                .append("updatedate", getUpdatedate())
+                .append("deptId", getDeptId())
+                .toString();
+    }
+}

+ 63 - 0
master/src/main/java/com/ruoyi/project/apply/mapper/TApplyLockMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.project.apply.mapper;
+
+import java.util.List;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+import com.ruoyi.project.apply.domain.TApplyLock;
+
+/**
+ * 破锁管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-03-06
+ */
+public interface TApplyLockMapper 
+{
+    /**
+     * 查询破锁管理
+     * 
+     * @param id 破锁管理ID
+     * @return 破锁管理
+     */
+    public TApplyLock selectTApplyLockById(Long id);
+
+    /**
+     * 查询破锁管理列表
+     * 
+     * @param tApplyLock 破锁管理
+     * @return 破锁管理集合
+     */
+    @DataScope(deptAlias = "d")
+    public List<TApplyLock> selectTApplyLockList(TApplyLock tApplyLock);
+
+    /**
+     * 新增破锁管理
+     * 
+     * @param tApplyLock 破锁管理
+     * @return 结果
+     */
+    public int insertTApplyLock(TApplyLock tApplyLock);
+
+    /**
+     * 修改破锁管理
+     * 
+     * @param tApplyLock 破锁管理
+     * @return 结果
+     */
+    public int updateTApplyLock(TApplyLock tApplyLock);
+
+    /**
+     * 删除破锁管理
+     * 
+     * @param id 破锁管理ID
+     * @return 结果
+     */
+    public int deleteTApplyLockById(Long id);
+
+    /**
+     * 批量删除破锁管理
+     * 
+     * @param ids 需要删除的数据ID
+     * @return 结果
+     */
+    public int deleteTApplyLockByIds(Long[] ids);
+}

+ 61 - 0
master/src/main/java/com/ruoyi/project/apply/service/ITApplyLockService.java

@@ -0,0 +1,61 @@
+package com.ruoyi.project.apply.service;
+
+import java.util.List;
+import com.ruoyi.project.apply.domain.TApplyLock;
+
+/**
+ * 破锁管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-03-06
+ */
+public interface ITApplyLockService 
+{
+    /**
+     * 查询破锁管理
+     * 
+     * @param id 破锁管理ID
+     * @return 破锁管理
+     */
+    public TApplyLock selectTApplyLockById(Long id);
+
+    /**
+     * 查询破锁管理列表
+     * 
+     * @param tApplyLock 破锁管理
+     * @return 破锁管理集合
+     */
+    public List<TApplyLock> selectTApplyLockList(TApplyLock tApplyLock);
+
+    /**
+     * 新增破锁管理
+     * 
+     * @param tApplyLock 破锁管理
+     * @return 结果
+     */
+    public int insertTApplyLock(TApplyLock tApplyLock);
+
+    /**
+     * 修改破锁管理
+     * 
+     * @param tApplyLock 破锁管理
+     * @return 结果
+     */
+    public int updateTApplyLock(TApplyLock tApplyLock);
+
+    /**
+     * 批量删除破锁管理
+     * 
+     * @param ids 需要删除的破锁管理ID
+     * @return 结果
+     */
+    public int deleteTApplyLockByIds(Long[] ids);
+
+    /**
+     * 删除破锁管理信息
+     * 
+     * @param id 破锁管理ID
+     * @return 结果
+     */
+    public int deleteTApplyLockById(Long id);
+}

+ 93 - 0
master/src/main/java/com/ruoyi/project/apply/service/impl/TApplyLockServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.project.apply.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.project.apply.mapper.TApplyLockMapper;
+import com.ruoyi.project.apply.domain.TApplyLock;
+import com.ruoyi.project.apply.service.ITApplyLockService;
+
+/**
+ * 破锁管理Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2023-03-06
+ */
+@Service
+public class TApplyLockServiceImpl implements ITApplyLockService
+{
+    @Autowired
+    private TApplyLockMapper tApplyLockMapper;
+
+    /**
+     * 查询破锁管理
+     *
+     * @param id 破锁管理ID
+     * @return 破锁管理
+     */
+    @Override
+    public TApplyLock selectTApplyLockById(Long id)
+    {
+        return tApplyLockMapper.selectTApplyLockById(id);
+    }
+
+    /**
+     * 查询破锁管理列表
+     *
+     * @param tApplyLock 破锁管理
+     * @return 破锁管理
+     */
+    @Override
+    public List<TApplyLock> selectTApplyLockList(TApplyLock tApplyLock)
+    {
+        return tApplyLockMapper.selectTApplyLockList(tApplyLock);
+    }
+
+    /**
+     * 新增破锁管理
+     *
+     * @param tApplyLock 破锁管理
+     * @return 结果
+     */
+    @Override
+    public int insertTApplyLock(TApplyLock tApplyLock)
+    {
+        return tApplyLockMapper.insertTApplyLock(tApplyLock);
+    }
+
+    /**
+     * 修改破锁管理
+     *
+     * @param tApplyLock 破锁管理
+     * @return 结果
+     */
+    @Override
+    public int updateTApplyLock(TApplyLock tApplyLock)
+    {
+        return tApplyLockMapper.updateTApplyLock(tApplyLock);
+    }
+
+    /**
+     * 批量删除破锁管理
+     *
+     * @param ids 需要删除的破锁管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTApplyLockByIds(Long[] ids)
+    {
+        return tApplyLockMapper.deleteTApplyLockByIds(ids);
+    }
+
+    /**
+     * 删除破锁管理信息
+     *
+     * @param id 破锁管理ID
+     * @return 结果
+     */
+    @Override
+    public int deleteTApplyLockById(Long id)
+    {
+        return tApplyLockMapper.deleteTApplyLockById(id);
+    }
+}

+ 157 - 0
master/src/main/resources/mybatis/apply/TApplyLockMapper.xml

@@ -0,0 +1,157 @@
+<?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.apply.mapper.TApplyLockMapper">
+
+    <resultMap type="TApplyLock" id="TApplyLockResult">
+        <result property="id"    column="id"    />
+        <result property="unit"    column="unit"    />
+        <result property="lockPost"    column="lock_post"    />
+        <result property="pidNo"    column="pid_no"    />
+        <result property="lockCode"    column="lock_code"    />
+        <result property="medium"    column="medium"    />
+        <result property="position"    column="position"    />
+        <result property="reason"    column="reason"    />
+        <result property="technology"    column="technology"    />
+        <result property="riskLevel"    column="risk_level"    />
+        <result property="lockSize"    column="lock_size"    />
+        <result property="remarks"    column="remarks"    />
+        <result property="status"    column="status"    />
+        <result property="valveStatus"    column="valve_status"    />
+        <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="deptId"    column="dept_id"    />
+        <result property="deptName" column="dept_name" />
+    </resultMap>
+
+    <sql id="selectTApplyLockVo">
+        select d.id, d.unit, d.lock_post, d.pid_no, d.lock_code, d.medium, d.position, d.reason, d.technology, d.risk_level, d.lock_size, d.remarks, d.status, d.valve_status, d.del_flag, d.creater_code, d.createdate, d.updater_code, d.updatedate, d.dept_id ,s.dept_name from t_apply_lock d
+      left join sys_dept s on s.dept_id = d.dept_id
+    </sql>
+
+    <select id="selectTApplyLockList" parameterType="TApplyLock" resultMap="TApplyLockResult">
+        <include refid="selectTApplyLockVo"/>
+        <where>
+            <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
+            <if test="lockPost != null  and lockPost != ''"> and lock_post = #{lockPost}</if>
+            <if test="pidNo != null  and pidNo != ''"> and pid_no = #{pidNo}</if>
+            <if test="lockCode != null  and lockCode != ''"> and lock_code = #{lockCode}</if>
+            <if test="medium != null  and medium != ''"> and medium = #{medium}</if>
+            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="reason != null  and reason != ''"> and reason = #{reason}</if>
+            <if test="technology != null  and technology != ''"> and technology = #{technology}</if>
+            <if test="riskLevel != null  and riskLevel != ''"> and risk_level = #{riskLevel}</if>
+            <if test="lockSize != null  and lockSize != ''"> and lock_size = #{lockSize}</if>
+            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
+            <if test="status != null "> and status = #{status}</if>
+            <if test="valveStatus != null "> and valve_status = #{valveStatus}</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 updater_code = #{updaterCode}</if>
+            <if test="updatedate != null "> and updatedate = #{updatedate}</if>
+            <if test="deptId != null "> and dept_id = #{deptId}</if>
+            and d.del_flag = 0
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+        order by createdate asc
+    </select>
+
+    <select id="selectTApplyLockById" parameterType="Long" resultMap="TApplyLockResult">
+        <include refid="selectTApplyLockVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertTApplyLock" parameterType="TApplyLock">
+        <selectKey keyProperty="id" resultType="long" order="BEFORE">
+            SELECT seq_t_apply_lock.NEXTVAL as id FROM DUAL
+        </selectKey>
+        insert into t_apply_lock
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="unit != null">unit,</if>
+            <if test="lockPost != null">lock_post,</if>
+            <if test="pidNo != null">pid_no,</if>
+            <if test="lockCode != null">lock_code,</if>
+            <if test="medium != null">medium,</if>
+            <if test="position != null">position,</if>
+            <if test="reason != null">reason,</if>
+            <if test="technology != null">technology,</if>
+            <if test="riskLevel != null">risk_level,</if>
+            <if test="lockSize != null">lock_size,</if>
+            <if test="remarks != null">remarks,</if>
+            <if test="status != null">status,</if>
+            <if test="valveStatus != null">valve_status,</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="deptId != null">dept_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="unit != null">#{unit},</if>
+            <if test="lockPost != null">#{lockPost},</if>
+            <if test="pidNo != null">#{pidNo},</if>
+            <if test="lockCode != null">#{lockCode},</if>
+            <if test="medium != null">#{medium},</if>
+            <if test="position != null">#{position},</if>
+            <if test="reason != null">#{reason},</if>
+            <if test="technology != null">#{technology},</if>
+            <if test="riskLevel != null">#{riskLevel},</if>
+            <if test="lockSize != null">#{lockSize},</if>
+            <if test="remarks != null">#{remarks},</if>
+            <if test="status != null">#{status},</if>
+            <if test="valveStatus != null">#{valveStatus},</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="deptId != null">#{deptId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateTApplyLock" parameterType="TApplyLock">
+        update t_apply_lock
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="unit != null">unit = #{unit},</if>
+            <if test="lockPost != null">lock_post = #{lockPost},</if>
+            <if test="pidNo != null">pid_no = #{pidNo},</if>
+            <if test="lockCode != null">lock_code = #{lockCode},</if>
+            <if test="medium != null">medium = #{medium},</if>
+            <if test="position != null">position = #{position},</if>
+            <if test="reason != null">reason = #{reason},</if>
+            <if test="technology != null">technology = #{technology},</if>
+            <if test="riskLevel != null">risk_level = #{riskLevel},</if>
+            <if test="lockSize != null">lock_size = #{lockSize},</if>
+            <if test="remarks != null">remarks = #{remarks},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="valveStatus != null">valve_status = #{valveStatus},</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="deptId != null">dept_id = #{deptId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="deleteTApplyLockById" parameterType="Long">
+        update t_apply_lock set del_flag = 2 where id = #{id}
+    </update>
+
+    <update id="deleteTApplyLockByIds" parameterType="String">
+        update t_apply_lock set del_flag = 2 where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </update>
+
+</mapper>

+ 61 - 0
ui/src/api/apply/lock.js

@@ -0,0 +1,61 @@
+import request from '@/utils/request'
+
+// 查询破锁管理列表
+export function listLock(query) {
+  return request({
+    url: '/apply/lock/list',
+    method: 'get',
+    params: query
+  })
+}
+// 查询破锁管理列表
+export function listAllLock(query) {
+  return request({
+    url: '/apply/lock/listAllLock',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询破锁管理详细
+export function getLock(id) {
+  return request({
+    url: '/apply/lock/' + id,
+    method: 'get'
+  })
+}
+
+// 新增破锁管理
+export function addLock(data) {
+  return request({
+    url: '/apply/lock',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改破锁管理
+export function updateLock(data) {
+  return request({
+    url: '/apply/lock',
+    method: 'put',
+    data: data
+  })
+}
+
+// 删除破锁管理
+export function delLock(id) {
+  return request({
+    url: '/apply/lock/' + id,
+    method: 'delete'
+  })
+}
+
+// 导出破锁管理
+export function exportLock(query) {
+  return request({
+    url: '/apply/lock/export',
+    method: 'get',
+    params: query
+  })
+}

+ 1 - 1
ui/src/views/apply/lock/index.vue → ui/src/views/apply/lock/lock-dashboard.vue

@@ -24,7 +24,7 @@
 import LockEu from "@/views/apply/lock/lock-eu";
 import LockXx from "@/views/apply/lock/lock-xx";
 export default {
-  name: "index",
+  name: "lock-dashboard",
   components: {LockXx, LockEu},
   data() {
     return {

+ 147 - 55
ui/src/views/apply/lock/lock-eu.vue

@@ -1,66 +1,121 @@
 <template>
-  <div class="app-container" :style="`height:${height}px`">
-    <table>
-      <tr>
-        <th :colspan="colspan">
-          <span style="font-size: 22px">蒸汽裂解装置锁开&锁关摆放看板(EU)</span><br/>
-          <span style="font-size: 18px">LO&LC display board of Steam Cracker plant(EU)</span>
-        </th>
-      </tr>
-      <tr>
-        <td v-for="(item) in data" :class="status1.includes(item.id) ? 'grey' : (status2.includes(item.id) ? 'green':(status3.includes(item.id) ? 'yellow':'red'))">
-          <el-popover
-            placement="bottom"
-            trigger="click">
-            <el-button type="info" round @click="changeColor(1)">状态1</el-button>
-            <el-button type="danger" round @click="changeColor(4)">状态2</el-button>
-            <el-button type="warning" round @click="changeColor(3)">状态3</el-button>
-            <el-button type="success" round @click="changeColor(2)">状态4</el-button>
-            <el-button slot="reference" type="text"  @click="openDialog(item.id)"
-                      style="color: #fff" >
-              <i class="el-icon-timer" v-if="status1.includes(item.id)"/>
-              <i class="el-icon-lock" v-else-if="status2.includes(item.id)"/>
-              <i class="el-icon-circle-close" v-else-if="status3.includes(item.id)"/>
-              <i class="el-icon-unlock" v-else/>
-              <br/>
-              <span>{{ item.code }}</span>
-            </el-button>
-          </el-popover>
-        </td>
-      </tr>
-    </table>
+  <div class="app-container" :style="`height:${height}px`" id="parent"  >
+    <vue-draggable-resizable v-drag
+                             w="auto" h="auto" :draggable="dragMove" style="background-color:#fff;padding: 0px 20px">
+      <div class="zoom" @wheel.prevent="handleTableWheel($event)" ref="branch">
+        <table v-loading="loading">
+          <tr>
+            <th :colspan="colspan">
+              <span v-if="!loading" style="font-size: 40px">蒸汽裂解装置锁开&锁关摆放看板(EU)</span><br/>
+              <!--              <span style="font-size: 18px">LO&LC display board of Steam Cracker plant(EU)</span>-->
+            </th>
+          </tr>
+          <tr v-for="(list) in data">
+            <td v-for="(item) in list">
+              <el-button type="text" @click="handleClick,openDialog(item.id)"
+                         style="color: #fff;padding: 5px;height: 100%;font-weight: bold"
+                         :class=" item.status==2? 'grey' : (item.status==1 ? 'red':'green')">
+                <i class="el-icon-unlock" v-if="item.status==1"/>
+                <i class="el-icon-circle-close" v-else-if="item.status==2"/>
+                <i class="el-icon-lock" v-else/>
+                <br/>
+                <br/>
+                <span>{{ item.lockCode.substring(0, item.lockCode.indexOf('-')) }}</span>
+                <br><br>
+                <span>{{ item.lockCode.substring(item.lockCode.indexOf('-'), item.lockCode.length) }}</span>
+
+              </el-button>
+            </td>
+          </tr>
+        </table>
+      </div>
+    </vue-draggable-resizable>
+    <el-dialog :visible.sync="visible">
+      <el-button type="info" round @click="changeColor(1)">状态1</el-button>
+      <el-button type="danger" round @click="changeColor(2)">状态2</el-button>
+      <el-button type="warning" round @click="changeColor(3)">状态3</el-button>
+      <el-button type="success" round @click="changeColor(4)">状态4</el-button>
+    </el-dialog>
   </div>
 </template>
 
 <script>
+import VueDraggableResizable from 'vue-draggable-resizable'
+import {listAllLock, listLock} from "@/api/apply/lock";
+
 export default {
+  components: {VueDraggableResizable},
   name: "lock-eu",
+  directives: {
+    drag(el) {
+      const oDiv = el
+      // 拖拽时间标识
+      let firstTime = ''
+      let lastTime = ''
+      document.onselectstart = function () {
+        return false
+      }
+      oDiv.onmousedown = function (e) {
+        // 为了区分点击还是拖拽,使用时间差来判断,200毫秒内为点击,200毫秒外为拖拽,初始化为点击
+        document.getElementById('parent').setAttribute('drag-flag', false)
+        firstTime = new Date().getTime()
+        // 判断下当前时间与初始时间差,大于200毫秒则判断状态为拖拽
+
+
+        // 鼠标抬起时清除事件
+        document.onmouseup = function (e) {
+          lastTime = new Date().getTime()
+          console.log("firstTime:::" + firstTime)
+          console.log("lastTime:::" + lastTime)
+          console.log("lastTime-firstTime:::" + (lastTime - firstTime))
+          if (lastTime - firstTime > 100) {
+            document.getElementById('parent').setAttribute('drag-flag', true)
+          }
+          document.onmousemove = null
+          document.onmouseup = null
+        }
+        return false
+      }
+    }
+  },
   data() {
     return {
       clientHeight: 300,
-      data: [
-        {id: 1, code: '编号00001'},
-        {id: 2, code: '编号00002'},
-        {id: 3, code: '编号00003'},
-        {id: 4, code: '编号00004'},
-        {id: 5, code: '编号00005'},
-        {id: 6, code: '编号00006'},
-        {id: 7, code: '编号00007'},
-        {id: 8, code: '编号00008'},
-        {id: 9, code: '编号00009'},
-        {id: 0, code: '编号00010'}
-      ],
+      dragMove: true,
+      drawer: false,
+      data: [],
       index: null,
-      status1: [1, 0],
-      status2: [4, 6],
-      status3: [3, 5],
-      status4: [2, 7, 8, 9],
+      loading:true,
       visible: false,
       height: document.body.clientHeight - 155,
-      colspan:35
+      colspan: 35,
+      clickFlag: true,// 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 20,
+        unit: null,
+        lockPost: '裂解',
+        pidNo: null,
+        lockCode: null,
+        medium: null,
+        position: null,
+        reason: null,
+        technology: null,
+        riskLevel: null,
+        lockSize: null,
+        remarks: null,
+        status: null,
+        createrCode: null,
+        createdate: null,
+        updaterCode: null,
+        updatedate: null,
+        valveStatus: null,
+        deptId: null
+      },
     }
   },
   created() {
+    this.getList();
   },
   mounted() {
     window.onresize = () => {    //写在mounted中,onresize事件会在页面大小被调整时触发
@@ -78,8 +133,46 @@ export default {
     },
   },
   methods: {
+    /** 查询破锁管理列表 */
+    getList() {
+      this.loading = true;
+      listAllLock(this.queryParams).then(response => {
+        this.data = response.data;
+        console.log(this.data)
+        this.loading=false;
+      });
+    },
+    handleClick() {
+      setTimeout(function () {
+
+        // 点击事件触发时,判断当前状态是拖拽还是点击,若是拖拽,直接返回不继续执行
+        const isDrag = document.getElementById('parent').getAttribute('drag-flag')
+        if (isDrag == 'true') {
+          return
+        }
+      }, 50)
+    },
+    handleTableWheel(event) {
+      let obj = this.$refs['branch']
+      return this.tableZoom(obj, event)
+    },
+    tableZoom(obj, event) {
+      // 一开始默认是100%
+      let zoom = parseInt(obj.style.zoom, 10) || 100
+      // 滚轮滚一下wheelDelta的值增加或减少120
+      zoom += event.wheelDelta / 12
+      if (zoom > 25) {
+        obj.style.zoom = zoom + '%'
+      }
+      return false
+    },
     openDialog(index) {
-      // this.visible = true;
+      // 点击事件触发时,判断当前状态是拖拽还是点击,若是拖拽,直接返回不继续执行
+      const isDrag = document.getElementById('parent').getAttribute('drag-flag')
+      if (isDrag === 'true') {
+        return
+      }
+      this.visible = true;
       this.index = index
     },
     changeColor(type) {
@@ -115,7 +208,7 @@ export default {
 
 <style scoped>
 table {
-  width: 100%;
+  width: auto;
   border: 1px solid #d0d0d0;
   border-collapse: collapse;
 }
@@ -135,12 +228,12 @@ tr {
 }
 
 td {
-  width: 3.5%;
-  height: 100px;
+  height: 200px;
   border: 1px solid #d0d0d0;
   border-collapse: collapse;
   vertical-align: middle;
   text-align: center;
+  padding: 20px 10px 20px 10px;
 }
 
 i {
@@ -149,13 +242,12 @@ i {
 }
 
 el-button {
-  width: 95%;
-  height: 95%;
+  width: 140px;
+  height: auto;
 }
 
 .green {
-  color: #fff;
-  background-color:#67C23A;
+  background-color: #67C23A;
 }
 
 .red {