Răsfoiți Sursa

对接修改,新增作业监控,新增作业监控详情

车车 11 luni în urmă
părinte
comite
c5a7aef865
28 a modificat fișierele cu 782 adăugiri și 33 ștergeri
  1. 23 3
      ktg-iscs/src/main/java/com/ktg/iscs/controller/IsJobTicketController.java
  2. 1 1
      ktg-iscs/src/main/java/com/ktg/iscs/domain/IsJobTicketUser.java
  3. 81 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/hardwareApi/JobTicketPointsVO.java
  4. 61 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/hardwareApi/JobTicketUserVO.java
  5. 6 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/hardwareApi/JobTicketVO.java
  6. 40 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticket/MonitorJobTicketDetailVO.java
  7. 47 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticket/MonitorTicketPageVO.java
  8. 69 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticketKey/IsJobTicketKeyVO.java
  9. 81 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticketLockset/IsJobTicketLocksetVO.java
  10. 90 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticketPoints/IsJobTicketPointsVO.java
  11. 7 2
      ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsJobTicketKeyMapper.java
  12. 7 2
      ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsJobTicketLocksetMapper.java
  13. 4 0
      ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsJobTicketMapper.java
  14. 4 0
      ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsJobTicketPointsMapper.java
  15. 11 1
      ktg-iscs/src/main/java/com/ktg/iscs/service/IIsJobTicketKeyService.java
  16. 5 1
      ktg-iscs/src/main/java/com/ktg/iscs/service/IIsJobTicketLocksetService.java
  17. 3 0
      ktg-iscs/src/main/java/com/ktg/iscs/service/IIsJobTicketPointsService.java
  18. 5 3
      ktg-iscs/src/main/java/com/ktg/iscs/service/IIsJobTicketService.java
  19. 13 5
      ktg-iscs/src/main/java/com/ktg/iscs/service/impl/HardwareApiServiceImpl.java
  20. 12 5
      ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketKeyServiceImpl.java
  21. 12 5
      ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketLocksetServiceImpl.java
  22. 6 0
      ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketPointsServiceImpl.java
  23. 109 5
      ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketServiceImpl.java
  24. 9 0
      ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsMaterialsServiceImpl.java
  25. 12 0
      ktg-iscs/src/main/resources/mapper/IsJobTicketKeyMapper.xml
  26. 14 0
      ktg-iscs/src/main/resources/mapper/IsJobTicketLocksetMapper.xml
  27. 34 0
      ktg-iscs/src/main/resources/mapper/IsJobTicketMapper.xml
  28. 16 0
      ktg-iscs/src/main/resources/mapper/IsJobTicketPointsMapper.xml

+ 23 - 3
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsJobTicketController.java

@@ -9,9 +9,7 @@ import com.ktg.common.utils.poi.ExcelUtil;
 import com.ktg.iscs.domain.IsJobTicket;
 import com.ktg.iscs.domain.dto.ticket.AddJobTicketDTO;
 import com.ktg.iscs.domain.dto.ticket.PageTicketDTO;
-import com.ktg.iscs.domain.vo.ticket.JobTicketDetailVO;
-import com.ktg.iscs.domain.vo.ticket.JobTicketUpdateProgressReqVO;
-import com.ktg.iscs.domain.vo.ticket.PageTicketVO;
+import com.ktg.iscs.domain.vo.ticket.*;
 import com.ktg.iscs.service.IIsJobTicketService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -125,4 +123,26 @@ public class IsJobTicketController extends BaseController
     public CommonResult<Boolean> updateTicketProgress(@RequestBody @Valid JobTicketUpdateProgressReqVO reqVO) {
         return CommonResult.success(isJobTicketService.updateTicketProgress(reqVO));
     }
+
+    @ApiOperation("监控作业票-分页")
+    @Parameters({
+            @Parameter(name = "page", description = "Page"),
+            @Parameter(name = "dto", description = "实体参数")
+    })
+    @GetMapping("/getMonitorJobTicketPage")
+    public CommonResult<Page<MonitorTicketPageVO>> getMonitorJobTicketPage(Page<IsJobTicket> page, PageTicketDTO dto)
+    {
+        return CommonResult.success(isJobTicketService.getMonitorJobTicketPage(page, dto));
+    }
+
+    @ApiOperation("监控作业票-详情")
+    @Parameter(name = "ticketId", description = "ticketId")
+    @GetMapping(value = "/selectMonitorJobTicketDetail")
+    public CommonResult<MonitorJobTicketDetailVO> selectMonitorJobTicketDetail(Long ticketId)
+    {
+        return CommonResult.success(isJobTicketService.selectMonitorJobTicketDetail(ticketId));
+    }
+
+
+
 }

+ 1 - 1
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsJobTicketUser.java

@@ -50,7 +50,7 @@ public class IsJobTicketUser extends BaseBean
     @Excel(name = "作业票角色")
     private String userRole;
 
-    @ApiModelProperty(value = "作业状态(0未开始,1 取锁具, 2取钥匙, 3待上锁,4 已上锁,5 已解锁)")
+    @ApiModelProperty(value = "作业状态(0未开始,1 取锁具, 2取钥匙, 3待上锁(待共锁),4 已上锁(已共锁),5 已解锁)")
     private Integer jobStatus;
 
     /** 删除标志(0代表存在 2代表删除) */

+ 81 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/hardwareApi/JobTicketPointsVO.java

@@ -0,0 +1,81 @@
+package com.ktg.iscs.domain.vo.hardwareApi;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ktg.common.annotation.Excel;
+import com.ktg.common.core.domain.model.BaseBean;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 作业票隔离点对象 is_job_ticket_points
+ *
+ * @author cgj
+ * @date 2024-10-18
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class JobTicketPointsVO extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 记录ID */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "记录ID")
+    private Long recordId;
+
+    /** 作业票ID */
+    @ApiModelProperty(value = "作业票ID")
+    @Excel(name = "作业票ID")
+    private Long ticketId;
+
+    /** 所属车间ID */
+    @ApiModelProperty(value = "所属车间ID")
+    @Excel(name = "所属车间ID")
+    private Long workshopId;
+
+    /** 所属区域ID */
+    @ApiModelProperty(value = "所属区域ID")
+    @Excel(name = "所属区域ID")
+    private Long workareaId;
+
+    /** 隔离点ID */
+    @ApiModelProperty(value = "隔离点ID")
+    @Excel(name = "隔离点ID")
+    private Long pointId;
+
+    /** 隔离点状态 */
+    @ApiModelProperty(value = "隔离点状态(0-未上锁 1-已上锁 2-已解锁)")
+    @Excel(name = "隔离点状态")
+    private String pointStatus;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+    @ApiModelProperty(value = "挂锁ID")
+    private Long lockId;
+
+    @ApiModelProperty(value = "上锁钥匙ID")
+    private Long lockedByKeyId;
+
+    @ApiModelProperty(value = "解锁钥匙ID")
+    private Long unlockedByKeyId;
+
+    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "上锁时间")
+    private Date lockTime;
+
+    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "解锁时间")
+    private Date unlockTime;
+
+    @ApiModelProperty(value = "前置隔离点ID")
+    private Long prePointId;
+
+}

+ 61 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/hardwareApi/JobTicketUserVO.java

@@ -0,0 +1,61 @@
+package com.ktg.iscs.domain.vo.hardwareApi;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.ktg.common.annotation.Excel;
+import com.ktg.common.core.domain.model.BaseBean;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 作业票用户对象 is_job_ticket_user
+ *
+ * @author cgj
+ * @date 2024-10-18
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class JobTicketUserVO extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 记录ID */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "记录ID")
+    private Long recordId;
+
+    /** 作业票ID */
+    @ApiModelProperty(value = "作业票ID")
+    @Excel(name = "作业票ID")
+    private Long ticketId;
+
+    /** 用户ID */
+    @ApiModelProperty(value = "用户ID")
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    /** 用户名称 */
+    @ApiModelProperty(value = "用户名称")
+    @Excel(name = "用户名称")
+    private String userName;
+
+    /** 用户类型 */
+    @ApiModelProperty(value = "用户类型(0上锁人 1公锁人)")
+    @Excel(name = "用户类型")
+    private String userType;
+
+    /** 作业票角色 */
+    @ApiModelProperty(value = "作业票角色")
+    @Excel(name = "作业票角色")
+    private String userRole;
+
+    @ApiModelProperty(value = "作业状态(0未开始,1 取锁具, 2取钥匙, 3待上锁,4 已上锁,5 已解锁)")
+    private Integer jobStatus;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+
+}

+ 6 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/hardwareApi/JobTicketVO.java

@@ -71,4 +71,10 @@ public class JobTicketVO extends BaseBean
     @ApiModelProperty(value = "作业票锁具对象")
     private List<JobTicketLocksetVO> ticketLocksetVOList;
 
+    @ApiModelProperty(value = "作业票关联用户")
+    private List<JobTicketUserVO> ticketUserVOList;
+
+    @ApiModelProperty(value = "作业票关联隔离点")
+    private List<JobTicketPointsVO> ticketPointsVOList;
+
 }

+ 40 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticket/MonitorJobTicketDetailVO.java

@@ -0,0 +1,40 @@
+package com.ktg.iscs.domain.vo.ticket;
+
+import com.ktg.iscs.domain.IsJobTicket;
+import com.ktg.iscs.domain.IsJobTicketUser;
+import com.ktg.iscs.domain.vo.ticketPoints.IsJobTicketPointsVO;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 作业票对象 is_job_ticket
+ *
+ * @author cgj
+ * @date 2024-10-18
+ */
+@Data
+public class MonitorJobTicketDetailVO
+{
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "作业信息")
+    private IsJobTicket jobTicket;
+
+    @ApiModelProperty(value = "上锁钥匙名称")
+    private String lockKeyName;
+
+    @ApiModelProperty(value = "解锁钥匙名称")
+    private String colockKeyName;
+
+    @ApiModelProperty(value = "关联上锁人信息")
+    private List<IsJobTicketUser> lockUserList;
+
+    @ApiModelProperty(value = "关联共锁人信息")
+    private List<IsJobTicketUser> colockUserList;
+
+    @ApiModelProperty(value = "关联隔离点信息")
+    private List<IsJobTicketPointsVO> ticketPointsList;
+
+}

+ 47 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticket/MonitorTicketPageVO.java

@@ -0,0 +1,47 @@
+package com.ktg.iscs.domain.vo.ticket;
+
+import com.ktg.common.core.domain.model.BaseBean;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 作业票对象 is_job_ticket
+ *
+ * @author cgj
+ * @date 2024-10-18
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class MonitorTicketPageVO extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "作业票ID")
+    private Long ticketId;
+
+    @ApiModelProperty(value = "作业票编号")
+    private String ticketCode;
+
+    @ApiModelProperty(value = "作业票名称")
+    private String ticketName;
+
+    @ApiModelProperty(value = "上锁总数")
+    private Integer lockNum;
+
+    @ApiModelProperty(value = "已上锁数")
+    private Integer lockedNum;
+
+    @ApiModelProperty(value = "已完成(解锁)上锁数")
+    private Integer removeLockNum;
+
+    @ApiModelProperty(value = "共锁总数")
+    private Integer colockNum;
+
+    @ApiModelProperty(value = "已共锁数")
+    private Integer colockedNum;
+
+    @ApiModelProperty(value = "已完成(解锁)共锁数")
+    private Integer removeColockNum;
+
+}

+ 69 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticketKey/IsJobTicketKeyVO.java

@@ -0,0 +1,69 @@
+package com.ktg.iscs.domain.vo.ticketKey;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ktg.common.annotation.Excel;
+import com.ktg.common.core.domain.model.BaseBean;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 作业票钥匙对象 is_job_ticket_key
+ *
+ * @author cgj
+ * @date 2024-11-19
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class IsJobTicketKeyVO extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "记录ID")
+    @TableId(type = IdType.AUTO)
+    private Long recordId;
+
+    @ApiModelProperty(value = "作业票ID")
+    @Excel(name = "作业票ID")
+    private Long ticketId;
+
+    @ApiModelProperty(value = "钥匙ID")
+    @Excel(name = "钥匙ID")
+    private Long keyId;
+
+    @ApiModelProperty(value = "钥匙Name")
+    private String keyName;
+
+    @ApiModelProperty(value = "取出硬件ID")
+    @Excel(name = "取出硬件ID")
+    private Long fromHardwareId;
+
+    @ApiModelProperty(value = "归还硬件ID")
+    @Excel(name = "归还硬件ID")
+    private Long toHardwareId;
+
+    @ApiModelProperty(value = "取出时间")
+    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd")
+    @Excel(name = "取出时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date collectTime;
+
+    @ApiModelProperty(value = "归还时间")
+    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd")
+    @Excel(name = "归还时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date giveBackTime;
+
+    @ApiModelProperty(value = "钥匙状态(0-待取出 1-已取出 2-已归还)")
+    @Excel(name = "钥匙状态(0-待取出 1-已取出 2-已归还)")
+    private String keyStatus;
+
+    @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+    @ApiModelProperty(value = "作业锁类型(0-上锁 1-解锁)")
+    private Integer ticketType;
+
+}

+ 81 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticketLockset/IsJobTicketLocksetVO.java

@@ -0,0 +1,81 @@
+package com.ktg.iscs.domain.vo.ticketLockset;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ktg.common.annotation.Excel;
+import com.ktg.common.core.domain.model.BaseBean;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 作业票锁具对象 is_job_ticket_lockset
+ *
+ * @author cgj
+ * @date 2024-11-19
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class IsJobTicketLocksetVO extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "记录ID")
+    @TableId(type = IdType.AUTO)
+    private Long recordId;
+
+    @ApiModelProperty(value = "作业票ID")
+    @Excel(name = "作业票ID")
+    private Long jobTicketId;
+
+    @ApiModelProperty(value = "隔离点ID")
+    @Excel(name = "隔离点ID")
+    private Long pointId;
+
+    @ApiModelProperty(value = "锁具ID")
+    @Excel(name = "锁具ID")
+    private Long locksetId;
+
+    @ApiModelProperty(value = "锁具Name")
+    private String locksetName;
+
+    @ApiModelProperty(value = "取出硬件ID")
+    @Excel(name = "取出硬件ID")
+    private Long fromHardwareId;
+
+    @ApiModelProperty(value = "归还硬件ID")
+    @Excel(name = "归还硬件ID")
+    private Long toHardwareId;
+
+    @ApiModelProperty(value = "所需锁具类型ID")
+    @Excel(name = "所需锁具类型ID")
+    private Long locksetTypeId;
+
+    @ApiModelProperty(value = "附件状态(0待取出(点击开始作业)" +
+            "1已取出(锁具出柜子)" +
+            "2待使用(上锁钥匙出机柜)" +
+            "3使用中(上锁钥匙还机柜)" +
+            "4待拆除(解锁钥匙出机柜)" +
+            "5待归还(解锁钥匙还机柜,但锁具为归还)" +
+            "6已归还(锁具还物资柜))")
+    @Excel(name = "附件状态")
+    private String locksetStatus;
+
+    @ApiModelProperty(value = "取出时间")
+    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd")
+    @Excel(name = "取出时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date collectTime;
+
+    @ApiModelProperty(value = "归还时间")
+    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd")
+    @Excel(name = "归还时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date giveBackTime;
+
+    @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+
+}

+ 90 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/ticketPoints/IsJobTicketPointsVO.java

@@ -0,0 +1,90 @@
+package com.ktg.iscs.domain.vo.ticketPoints;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ktg.common.annotation.Excel;
+import com.ktg.common.core.domain.model.BaseBean;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import java.util.Date;
+
+/**
+ * 作业票隔离点对象 is_job_ticket_points
+ *
+ * @author cgj
+ * @date 2024-10-18
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class IsJobTicketPointsVO extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 记录ID */
+    @TableId(type = IdType.AUTO)
+    @ApiModelProperty(value = "记录ID")
+    private Long recordId;
+
+    /** 作业票ID */
+    @ApiModelProperty(value = "作业票ID")
+    @Excel(name = "作业票ID")
+    private Long ticketId;
+
+    /** 所属车间ID */
+    @ApiModelProperty(value = "所属车间ID")
+    @Excel(name = "所属车间ID")
+    private Long workshopId;
+
+    /** 所属区域ID */
+    @ApiModelProperty(value = "所属区域ID")
+    @Excel(name = "所属区域ID")
+    private Long workareaId;
+
+    /** 隔离点ID */
+    @ApiModelProperty(value = "隔离点ID")
+    @Excel(name = "隔离点ID")
+    private Long pointId;
+
+    @ApiModelProperty(value = "隔离点Name")
+    private String pointName;
+
+    /** 隔离点状态 */
+    @ApiModelProperty(value = "隔离点状态(0-未上锁 1-已上锁 2-已解锁)")
+    @Excel(name = "隔离点状态")
+    private String pointStatus;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+    @ApiModelProperty(value = "挂锁ID")
+    private Long lockId;
+
+    @ApiModelProperty(value = "挂锁Name")
+    private String lockName;
+
+    @ApiModelProperty(value = "上锁钥匙ID")
+    private Long lockedByKeyId;
+
+    @ApiModelProperty(value = "解锁钥匙ID")
+    private Long unlockedByKeyId;
+
+    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "上锁时间")
+    private Date lockTime;
+
+    @JsonFormat(timezone="GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
+    @Schema(description = "解锁时间")
+    private Date unlockTime;
+
+    @ApiModelProperty(value = "前置隔离点ID")
+    private Long prePointId;
+
+    @ApiModelProperty(value = "锁具Name")
+    private String locksetName;
+
+}

+ 7 - 2
ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsJobTicketKeyMapper.java

@@ -1,9 +1,12 @@
 package com.ktg.iscs.mapper;
 
-import java.util.List;
-import org.apache.ibatis.annotations.Mapper;
 import com.ktg.common.mapper.BaseMapperX;
 import com.ktg.iscs.domain.IsJobTicketKey;
+import com.ktg.iscs.domain.vo.ticketKey.IsJobTicketKeyVO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 作业票钥匙Mapper接口
@@ -61,4 +64,6 @@ public interface IsJobTicketKeyMapper extends BaseMapperX<IsJobTicketKey>
      * @return 结果
      */
     int deleteIsJobTicketKeyByRecordIds(Long[] recordIds);
+
+    List<IsJobTicketKeyVO> getListByTicketId(@Param(value = "ticketId") Long ticketId);
 }

+ 7 - 2
ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsJobTicketLocksetMapper.java

@@ -1,9 +1,12 @@
 package com.ktg.iscs.mapper;
 
-import java.util.List;
-import org.apache.ibatis.annotations.Mapper;
 import com.ktg.common.mapper.BaseMapperX;
 import com.ktg.iscs.domain.IsJobTicketLockset;
+import com.ktg.iscs.domain.vo.ticketLockset.IsJobTicketLocksetVO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 作业票锁具Mapper接口
@@ -61,4 +64,6 @@ public interface IsJobTicketLocksetMapper extends BaseMapperX<IsJobTicketLockset
      * @return 结果
      */
     int deleteIsJobTicketLocksetByRecordIds(Long[] recordIds);
+
+    List<IsJobTicketLocksetVO> getListByTicketId(@Param(value = "ticketId") Long ticketId);
 }

+ 4 - 0
ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsJobTicketMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ktg.common.mapper.BaseMapperX;
 import com.ktg.iscs.domain.IsJobTicket;
 import com.ktg.iscs.domain.dto.ticket.PageTicketDTO;
+import com.ktg.iscs.domain.vo.ticket.MonitorTicketPageVO;
 import com.ktg.iscs.domain.vo.ticket.PageTicketVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -68,4 +69,7 @@ public interface IsJobTicketMapper extends BaseMapperX<IsJobTicket>
     int deleteIsJobTicketByTicketIds(Long[] ticketIds);
 
     Page<PageTicketVO> getIsJobTicketPage(Page<IsJobTicket> page, @Param(value = "dto") PageTicketDTO dto);
+
+    Page<MonitorTicketPageVO> getMonitorJobTicketPage(Page<IsJobTicket> page, @Param(value = "dto") PageTicketDTO dto);
+
 }

+ 4 - 0
ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsJobTicketPointsMapper.java

@@ -2,7 +2,9 @@ package com.ktg.iscs.mapper;
 
 import com.ktg.common.mapper.BaseMapperX;
 import com.ktg.iscs.domain.IsJobTicketPoints;
+import com.ktg.iscs.domain.vo.ticketPoints.IsJobTicketPointsVO;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -62,4 +64,6 @@ public interface IsJobTicketPointsMapper extends BaseMapperX<IsJobTicketPoints>
      * @return 结果
      */
     int deleteIsJobTicketPointsByRecordIds(Long[] recordIds);
+
+    List<IsJobTicketPointsVO> getListByTicketId(@Param(value = "ticketId") Long ticketId);
 }

+ 11 - 1
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsJobTicketKeyService.java

@@ -1,8 +1,10 @@
 package com.ktg.iscs.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import java.util.List;
 import com.ktg.iscs.domain.IsJobTicketKey;
+import com.ktg.iscs.domain.vo.ticketKey.IsJobTicketKeyVO;
+
+import java.util.List;
 
 /**
  * 作业票钥匙Service接口
@@ -59,4 +61,12 @@ public interface IIsJobTicketKeyService extends IService<IsJobTicketKey>
      * @return 结果
      */
     int deleteIsJobTicketKeyByRecordId(Long recordId);
+
+    /**
+     * 删除作业票钥匙信息
+     *
+     * @param ticketId 作业票主键
+     * @return 结果
+     */
+    List<IsJobTicketKeyVO> getListByTicketId(Long ticketId);
 }

+ 5 - 1
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsJobTicketLocksetService.java

@@ -1,8 +1,10 @@
 package com.ktg.iscs.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import java.util.List;
 import com.ktg.iscs.domain.IsJobTicketLockset;
+import com.ktg.iscs.domain.vo.ticketLockset.IsJobTicketLocksetVO;
+
+import java.util.List;
 
 /**
  * 作业票锁具Service接口
@@ -59,4 +61,6 @@ public interface IIsJobTicketLocksetService extends IService<IsJobTicketLockset>
      * @return 结果
      */
     int deleteIsJobTicketLocksetByRecordId(Long recordId);
+
+    List<IsJobTicketLocksetVO> getListByTicketId(Long ticketId);
 }

+ 3 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsJobTicketPointsService.java

@@ -2,6 +2,7 @@ package com.ktg.iscs.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.ktg.iscs.domain.IsJobTicketPoints;
+import com.ktg.iscs.domain.vo.ticketPoints.IsJobTicketPointsVO;
 
 import java.util.List;
 
@@ -60,4 +61,6 @@ public interface IIsJobTicketPointsService extends IService<IsJobTicketPoints>
      * @return 结果
      */
     int deleteIsJobTicketPointsByRecordId(Long recordId);
+
+    List<IsJobTicketPointsVO> getListByTicketId(Long ticketId);
 }

+ 5 - 3
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsJobTicketService.java

@@ -5,9 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.ktg.iscs.domain.IsJobTicket;
 import com.ktg.iscs.domain.dto.ticket.AddJobTicketDTO;
 import com.ktg.iscs.domain.dto.ticket.PageTicketDTO;
-import com.ktg.iscs.domain.vo.ticket.JobTicketDetailVO;
-import com.ktg.iscs.domain.vo.ticket.JobTicketUpdateProgressReqVO;
-import com.ktg.iscs.domain.vo.ticket.PageTicketVO;
+import com.ktg.iscs.domain.vo.ticket.*;
 
 import java.util.List;
 
@@ -76,4 +74,8 @@ public interface IIsJobTicketService extends IService<IsJobTicket>
     Page<PageTicketVO> getIsJobTicketPage(Page<IsJobTicket> page, PageTicketDTO dto);
 
     Boolean updateTicketProgress(JobTicketUpdateProgressReqVO reqVO);
+
+    Page<MonitorTicketPageVO> getMonitorJobTicketPage(Page<IsJobTicket> page, PageTicketDTO dto);
+
+    MonitorJobTicketDetailVO selectMonitorJobTicketDetail(Long ticketId);
 }

+ 13 - 5
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/HardwareApiServiceImpl.java

@@ -9,10 +9,7 @@ import com.ktg.iscs.domain.enums.KeyStatusEnum;
 import com.ktg.iscs.domain.enums.LockStatusEnum;
 import com.ktg.iscs.domain.enums.LocksetStatusEnum;
 import com.ktg.iscs.domain.enums.PointStatusEnum;
-import com.ktg.iscs.domain.vo.hardwareApi.JobTicketKeyVO;
-import com.ktg.iscs.domain.vo.hardwareApi.JobTicketLockVO;
-import com.ktg.iscs.domain.vo.hardwareApi.JobTicketLocksetVO;
-import com.ktg.iscs.domain.vo.hardwareApi.JobTicketVO;
+import com.ktg.iscs.domain.vo.hardwareApi.*;
 import com.ktg.iscs.service.*;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -50,7 +47,8 @@ public class HardwareApiServiceImpl implements HardwareApiService {
     private IIsHardwareService isHardwareService;
     @Autowired
     private IIsJobTicketPointsService iIsJobTicketPointsService;
-
+    @Autowired
+    private IIsJobTicketUserService iIsJobTicketUserService;
 
     @Override
     public Boolean updateTakeOutKey(TakeOutKeyDTO dto) {
@@ -457,10 +455,20 @@ public class HardwareApiServiceImpl implements HardwareApiService {
         List<IsJobTicketLockset> jobTicketLocksetList = iIsJobTicketLocksetService.list(Wrappers.<IsJobTicketLockset>lambdaQuery()
                 .eq(IsJobTicketLockset::getJobTicketId, ticketId));
         List<JobTicketLocksetVO> ticketLocksetVOList = BeanUtils.toBean(jobTicketLocksetList, JobTicketLocksetVO.class);
+        // 5.查询用户数据
+        List<IsJobTicketUser> jobTicketUserList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery()
+                .eq(IsJobTicketUser::getTicketId, ticketId));
+        List<JobTicketUserVO> ticketUserVOList = BeanUtils.toBean(jobTicketUserList, JobTicketUserVO.class);
+        // 6.查询隔离点数据
+        List<IsJobTicketPoints> jobTicketPointsList = iIsJobTicketPointsService.list(Wrappers.<IsJobTicketPoints>lambdaQuery()
+                .eq(IsJobTicketPoints::getTicketId, ticketId));
+        List<JobTicketPointsVO> ticketPointsVOList = BeanUtils.toBean(jobTicketPointsList, JobTicketPointsVO.class);
         // 5.组装数据
         jobTicketVO.setTicketKeyVOList(ticketKeyVOList);
         jobTicketVO.setTicketLockVOList(ticketLockVOList);
         jobTicketVO.setTicketLocksetVOList(ticketLocksetVOList);
+        jobTicketVO.setTicketUserVOList(ticketUserVOList);
+        jobTicketVO.setTicketPointsVOList(ticketPointsVOList);
         return jobTicketVO;
     }
 }

+ 12 - 5
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketKeyServiceImpl.java

@@ -1,15 +1,17 @@
 package com.ktg.iscs.service.impl;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import java.util.List;
 import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ktg.common.core.text.Convert;
 import com.ktg.common.utils.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.ktg.iscs.mapper.IsJobTicketKeyMapper;
 import com.ktg.iscs.domain.IsJobTicketKey;
+import com.ktg.iscs.domain.vo.ticketKey.IsJobTicketKeyVO;
+import com.ktg.iscs.mapper.IsJobTicketKeyMapper;
 import com.ktg.iscs.service.IIsJobTicketKeyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 作业票钥匙Service业务层处理
@@ -98,4 +100,9 @@ public class IsJobTicketKeyServiceImpl extends ServiceImpl<IsJobTicketKeyMapper,
     {
         return isJobTicketKeyMapper.deleteIsJobTicketKeyByRecordId(recordId);
     }
+
+    @Override
+    public List<IsJobTicketKeyVO> getListByTicketId(Long ticketId) {
+        return isJobTicketKeyMapper.getListByTicketId(ticketId);
+    }
 }

+ 12 - 5
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketLocksetServiceImpl.java

@@ -1,15 +1,17 @@
 package com.ktg.iscs.service.impl;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import java.util.List;
 import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ktg.common.core.text.Convert;
 import com.ktg.common.utils.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.ktg.iscs.mapper.IsJobTicketLocksetMapper;
 import com.ktg.iscs.domain.IsJobTicketLockset;
+import com.ktg.iscs.domain.vo.ticketLockset.IsJobTicketLocksetVO;
+import com.ktg.iscs.mapper.IsJobTicketLocksetMapper;
 import com.ktg.iscs.service.IIsJobTicketLocksetService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
 
 /**
  * 作业票锁具Service业务层处理
@@ -98,4 +100,9 @@ public class IsJobTicketLocksetServiceImpl extends ServiceImpl<IsJobTicketLockse
     {
         return isJobTicketLocksetMapper.deleteIsJobTicketLocksetByRecordId(recordId);
     }
+
+    @Override
+    public List<IsJobTicketLocksetVO> getListByTicketId(Long ticketId) {
+        return isJobTicketLocksetMapper.getListByTicketId(ticketId);
+    }
 }

+ 6 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketPointsServiceImpl.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ktg.common.core.text.Convert;
 import com.ktg.common.utils.DateUtils;
 import com.ktg.iscs.domain.IsJobTicketPoints;
+import com.ktg.iscs.domain.vo.ticketPoints.IsJobTicketPointsVO;
 import com.ktg.iscs.mapper.IsJobTicketPointsMapper;
 import com.ktg.iscs.service.IIsJobTicketPointsService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -99,4 +100,9 @@ public class IsJobTicketPointsServiceImpl extends ServiceImpl<IsJobTicketPointsM
     {
         return isJobTicketPointsMapper.deleteIsJobTicketPointsByRecordId(recordId);
     }
+
+    @Override
+    public List<IsJobTicketPointsVO> getListByTicketId(Long ticketId) {
+        return isJobTicketPointsMapper.getListByTicketId(ticketId);
+    }
 }

+ 109 - 5
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsJobTicketServiceImpl.java

@@ -14,9 +14,10 @@ import com.ktg.iscs.domain.dto.ticket.PageTicketDTO;
 import com.ktg.iscs.domain.enums.JobStatusEnum;
 import com.ktg.iscs.domain.enums.TicketStatusEnum;
 import com.ktg.iscs.domain.vo.points.PointDetailVO;
-import com.ktg.iscs.domain.vo.ticket.JobTicketDetailVO;
-import com.ktg.iscs.domain.vo.ticket.JobTicketUpdateProgressReqVO;
-import com.ktg.iscs.domain.vo.ticket.PageTicketVO;
+import com.ktg.iscs.domain.vo.ticket.*;
+import com.ktg.iscs.domain.vo.ticketKey.IsJobTicketKeyVO;
+import com.ktg.iscs.domain.vo.ticketLockset.IsJobTicketLocksetVO;
+import com.ktg.iscs.domain.vo.ticketPoints.IsJobTicketPointsVO;
 import com.ktg.iscs.mapper.IsJobTicketMapper;
 import com.ktg.iscs.service.*;
 import lombok.extern.slf4j.Slf4j;
@@ -25,7 +26,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 import static com.ktg.iscs.domain.constant.ErrorCodeConstants.*;
@@ -58,6 +61,8 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
     private IIsJobTicketLockService iIsJobTicketLockService;
     @Autowired
     private IIsJobTicketLocksetService iIsJobTicketLocksetService;
+    @Autowired
+    private IIsWorkareaService iIsWorkareaService;
 
     /**
      * 查询作业票
@@ -71,6 +76,13 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
         // 1.查询基础数据
         IsJobTicket jobTicket = isJobTicketMapper.selectIsJobTicketByTicketId(ticketId);
         JobTicketDetailVO jobTicketDetailVO = BeanUtils.toBean(jobTicket, JobTicketDetailVO.class);
+        // 1.1 查询工作区域数据
+        if (jobTicket != null && jobTicket.getWorkareaId() != null) {
+            IsWorkarea workarea = iIsWorkareaService.getById(jobTicket.getWorkareaId());
+            if (workarea != null) {
+                jobTicketDetailVO.setWorkareaName(workarea.getWorkareaName());
+            }
+        }
         // 2.查询作业票和隔离点的关联关系
         List<IsJobTicketPoints> isJobTicketPoints = iIsJobTicketPointsService.list(Wrappers.<IsJobTicketPoints>lambdaQuery()
                 .eq(IsJobTicketPoints::getTicketId, ticketId));
@@ -255,7 +267,7 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
                 jobTicketPoints.setWorkareaId(dto.getWorkareaId());
                 jobTicketPoints.setPointId(isJobTicketPoints.getPointId());
                 jobTicketPoints.setPrePointId(isJobTicketPoints.getPrePointId());
-                iIsJobTicketPointsService.save(isJobTicketPoints);
+                iIsJobTicketPointsService.save(jobTicketPoints);
             }
         }
         // 4.修改人员信息,先删后增
@@ -459,4 +471,96 @@ public class IsJobTicketServiceImpl extends ServiceImpl<IsJobTicketMapper, IsJob
         }
         return isCoLockerDone;
     }
+
+    @Override
+    public Page<MonitorTicketPageVO> getMonitorJobTicketPage(Page<IsJobTicket> page, PageTicketDTO dto) {
+        Page<MonitorTicketPageVO> monitorJobTicketPage = isJobTicketMapper.getMonitorJobTicketPage(page, dto);
+        for (MonitorTicketPageVO record : monitorJobTicketPage.getRecords()) {
+            // 初始值
+            record.setLockNum(0);
+            record.setLockedNum(0);
+            record.setRemoveLockNum(0);
+            record.setColockNum(0);
+            record.setColockedNum(0);
+            record.setRemoveColockNum(0);
+            // 1.获取关联的上锁人信息
+            List<IsJobTicketUser> jtlockerList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery()
+                    .eq(IsJobTicketUser::getTicketId, record.getTicketId())
+                    .eq(IsJobTicketUser::getUserRole, JTLOCKER.key));
+            if (!jtlockerList.isEmpty()) {
+                // 上锁总数
+                record.setLockNum(jtlockerList.size());
+                // 已上锁数
+                int lockedNum = (int) jtlockerList.stream()
+                        .filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.READY_TO_UNLOCK.status))
+                        .count();
+                record.setLockedNum(lockedNum);
+                // 已完成(解锁)上锁数
+                int removeLockNum = (int) jtlockerList.stream()
+                        .filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.UNLOCKED.status))
+                        .count();
+                record.setRemoveLockNum(removeLockNum);
+            }
+            //2.获取关联的共锁人信息
+            List<IsJobTicketUser> jtcolockerList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery()
+                    .eq(IsJobTicketUser::getTicketId, record.getTicketId())
+                    .eq(IsJobTicketUser::getUserRole, JTCOLOCKER.key));
+            if (!jtcolockerList.isEmpty()) {
+                // 上锁总数
+                record.setColockNum(jtcolockerList.size());
+                // 已上锁数
+                int colockedNum = (int) jtcolockerList.stream()
+                        .filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.READY_TO_UNLOCK.status))
+                        .count();
+                record.setColockedNum(colockedNum);
+                // 已完成(解锁)上锁数
+                int removeColockNum = (int) jtcolockerList.stream()
+                        .filter(o -> o.getJobStatus() != null && o.getJobStatus().equals(JobStatusEnum.UNLOCKED.status))
+                        .count();
+                record.setRemoveColockNum(removeColockNum);
+            }
+        }
+        return monitorJobTicketPage;
+    }
+
+    @Override
+    public MonitorJobTicketDetailVO selectMonitorJobTicketDetail(Long ticketId) {
+        Assert.notNull(ticketId, "作业票id不可为空!");
+        // 1.获取作业票
+        IsJobTicket isJobTicket = getById(ticketId);
+        Assert.notNull(isJobTicket, "作业票信息丢失了!");
+        // 2.获取关联钥匙
+        List<IsJobTicketKeyVO> listByTicketId = iIsJobTicketKeyService.getListByTicketId(ticketId);
+        // 3.获取上锁人信息
+        List<IsJobTicketUser> lockUserList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery()
+                .eq(IsJobTicketUser::getTicketId, ticketId)
+                .eq(IsJobTicketUser::getUserRole, JTLOCKER.key));
+        // 4.获取共锁人信息
+        List<IsJobTicketUser> colockUserList = iIsJobTicketUserService.list(Wrappers.<IsJobTicketUser>lambdaQuery()
+                .eq(IsJobTicketUser::getTicketId, ticketId)
+                .eq(IsJobTicketUser::getUserRole, JTCOLOCKER.key));
+        // 5.关联隔离点信息
+        List<IsJobTicketPointsVO> jobTicketPointsVOList = iIsJobTicketPointsService.getListByTicketId(ticketId);
+        // 5.1获取隔离点关联的锁具数据
+        List<IsJobTicketLocksetVO> ticketLocksetVOList = iIsJobTicketLocksetService.getListByTicketId(ticketId);
+        for (IsJobTicketPointsVO vo : jobTicketPointsVOList) {
+            String collect = ticketLocksetVOList.stream()
+                    .filter(o -> o.getPointId() != null && o.getPointId().equals(vo.getPointId()))
+                    .map(IsJobTicketLocksetVO::getLocksetName)
+                    .collect(Collectors.joining(", "));
+            vo.setLocksetName(collect);
+        }
+        MonitorJobTicketDetailVO vo = new MonitorJobTicketDetailVO();
+        vo.setJobTicket(isJobTicket);
+        if (!listByTicketId.isEmpty()) {
+            vo.setLockKeyName(listByTicketId.get(0).getKeyName());
+            vo.setColockKeyName(listByTicketId.get(1).getKeyName());
+        }
+        vo.setLockUserList(lockUserList);
+        vo.setColockUserList(colockUserList);
+        vo.setTicketPointsList(jobTicketPointsVOList);
+        return vo;
+    }
+
+
 }

+ 9 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsMaterialsServiceImpl.java

@@ -66,6 +66,10 @@ public class IsMaterialsServiceImpl extends ServiceImpl<IsMaterialsMapper, IsMat
      */
     @Override
     public int insertIsMaterials(IsMaterials isMaterials) {
+        // 1.检查物资编码有没有被使用
+        List<IsMaterials> list = list(Wrappers.<IsMaterials>lambdaQuery()
+                .eq(IsMaterials::getMaterialsCode, isMaterials.getMaterialsCode()));
+        Assert.isFalse(!list.isEmpty(), "该物资编码已被使用!");
         isMaterials.setCreateTime(DateUtils.getNowDate());
         return isMaterialsMapper.insertIsMaterials(isMaterials);
     }
@@ -78,6 +82,11 @@ public class IsMaterialsServiceImpl extends ServiceImpl<IsMaterialsMapper, IsMat
      */
     @Override
     public int updateIsMaterials(IsMaterials isMaterials) {
+        // 1.检查物资编码有没有被使用
+        List<IsMaterials> list = list(Wrappers.<IsMaterials>lambdaQuery()
+                .eq(IsMaterials::getMaterialsCode, isMaterials.getMaterialsCode())
+                .ne(IsMaterials::getMaterialsId, isMaterials.getMaterialsId()));
+        Assert.isFalse(!list.isEmpty(), "该物资编码已被使用!");
         isMaterials.setUpdateTime(DateUtils.getNowDate());
         return isMaterialsMapper.updateIsMaterials(isMaterials);
     }

+ 12 - 0
ktg-iscs/src/main/resources/mapper/IsJobTicketKeyMapper.xml

@@ -111,4 +111,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{recordId}
         </foreach>
     </delete>
+
+    <select id="getListByTicketId" resultType="com.ktg.iscs.domain.vo.ticketKey.IsJobTicketKeyVO">
+        SELECT
+            j.*,
+            k.key_name
+        FROM
+            is_job_ticket_key j
+                LEFT JOIN is_key k ON j.key_id = k.key_id
+        where j.ticket_id = #{ticketId}
+        order by j.record_id asc
+    </select>
+
 </mapper>

+ 14 - 0
ktg-iscs/src/main/resources/mapper/IsJobTicketLocksetMapper.xml

@@ -116,4 +116,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{recordId}
         </foreach>
     </delete>
+
+    <select id="getListByTicketId" resultType="com.ktg.iscs.domain.vo.ticketLockset.IsJobTicketLocksetVO">
+        SELECT
+            j.*,
+            l.lockset_name
+        FROM
+            is_job_ticket_lockset j
+                LEFT JOIN is_lockset l ON j.lockset_id = l.lockset_id
+        WHERE
+            j.job_ticket_id = #{ticketId}
+        ORDER BY
+            j.record_id ASC
+    </select>
+
 </mapper>

+ 34 - 0
ktg-iscs/src/main/resources/mapper/IsJobTicketMapper.xml

@@ -173,4 +173,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         GROUP BY j.ticket_id
         ORDER BY j.ticket_id DESC
     </select>
+    <select id="getMonitorJobTicketPage" resultType="com.ktg.iscs.domain.vo.ticket.MonitorTicketPageVO">
+        SELECT
+            j.*
+        FROM
+            is_job_ticket j
+        <where>
+            (j.ticket_status != 4 OR ( j.ticket_end_time > CURDATE() AND j.ticket_status = 4 ))
+            <if test="dto.ticketCode != null and dto.ticketCode.trim != ''">
+                and j.ticket_code like concat('%',#{dto.ticketCode},'%')
+            </if>
+            <if test="dto.ticketName != null and dto.ticketName.trim != ''">
+                and j.ticket_name like concat('%',#{dto.ticketName},'%')
+            </if>
+            <if test="dto.ticketStatus != null and dto.ticketStatus.trim != ''">
+                and j.ticket_status = #{dto.ticketStatus}
+            </if>
+            <if test="dto.workshopId != null">
+                and j.workshop_id = #{dto.workshopId}
+            </if>
+            <if test="dto.workareaId != null">
+                and j.workarea_id = #{dto.workareaId}
+            </if>
+            <if test="dto.ticketType != null and dto.ticketType.trim != ''">
+                and j.ticket_type = #{dto.ticketType}
+            </if>
+            <if test="dto.startTime != null and dto.startTime.trim != ''">
+                and j.create_time &gt;= #{dto.startTime}
+            </if>
+            <if test="dto.endTime != null and dto.endTime.trim != ''">
+                and j.create_time &lt;= #{dto.endTime}
+            </if>
+        </where>
+            order by j.ticket_id desc
+    </select>
 </mapper>

+ 16 - 0
ktg-iscs/src/main/resources/mapper/IsJobTicketPointsMapper.xml

@@ -117,4 +117,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{recordId}
         </foreach>
     </delete>
+
+    <select id="getListByTicketId" resultType="com.ktg.iscs.domain.vo.ticketPoints.IsJobTicketPointsVO">
+        SELECT
+            j.*,
+            i.point_name,
+            l.lock_name
+        FROM
+            is_job_ticket_points j
+                LEFT JOIN is_isolation_point i ON j.point_id = i.point_id
+                LEFT JOIN is_lock l ON j.lock_id = l.lock_id
+        WHERE
+            j.ticket_id = #{ticketId}
+        ORDER BY
+            j.record_id ASC
+    </select>
+
 </mapper>