Ver Fonte

完善工器具

hfxc226 há 2 anos atrás
pai
commit
907bc80cde

+ 19 - 0
platform-dao/src/main/java/com/platform/dao/dto/tool/BatchToolLogDTO.java

@@ -0,0 +1,19 @@
+package com.platform.dao.dto.tool;
+
+import com.platform.dao.dto.sb.SbMeasureLogDTO;
+import com.platform.dao.entity.tool.ToolLog;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class BatchToolLogDTO implements Serializable {
+
+    private List<ToolLogDTO> toolLogDTOList;
+
+    /**
+     * 在库ID集合
+     */
+    private List<String> toolIds;
+}

+ 85 - 86
platform-dao/src/main/java/com/platform/dao/dto/tool/ToolDTO.java

@@ -5,6 +5,8 @@ import com.platform.common.validation.group.UpdateGroup;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+
+import javax.persistence.Transient;
 import javax.validation.constraints.*;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -22,138 +24,135 @@ import java.math.BigDecimal;
 @EqualsAndHashCode(callSuper = true)
 public class ToolDTO extends BaseDTO implements Serializable {
 
-      /**
+    /**
      * 主键
      */
-        @NotNull(groups = {UpdateGroup.class}, message = "ID不能为空")
+    @NotNull(groups = {UpdateGroup.class}, message = "ID不能为空")
     private String id;
-          /**
+    /**
      * 工器具名称
      */
-          private String name;
-          /**
+    private String name;
+    /**
      * 工器具型号
      */
-          private String ggxh;
-          /**
+    private String ggxh;
+    /**
      * 编号
      */
-        private LocalDateTime no;
-      /**
-       * 编号开始
-       */
-      private LocalDateTime noStart;
-      /**
-       * 编号结束
-       */
-      private LocalDateTime noEnd;
-          /**
+    private String no;
+    /**
      * 数量
      */
-          private Integer num;
-          /**
+    private Integer num;
+    /**
      * 负责人
      */
-          private String checkUserId;
-          /**
+    private String checkUserId;
+    /**
      * 生产厂家
      */
-          private String producer;
-          /**
+    private String producer;
+    /**
      * 是否合格:0否,1是
      */
-          private String hgFlag;
-          /**
+    private String hgFlag;
+    /**
      * 是否需要检验:0否,1是
      */
-          private Integer checkFlag;
-          /**
+    private Integer checkFlag;
+    /**
      * 检测内容
      */
-        private LocalDateTime content;
-      /**
-       * 检测内容开始
-       */
-      private LocalDateTime contentStart;
-      /**
-       * 检测内容结束
-       */
-      private LocalDateTime contentEnd;
-          /**
+    private String content;
+    /**
      * 备注
      */
-          private String remark;
-          /**
+    private String remark;
+    /**
      * 创建日期
      */
-        private LocalDateTime createdTime;
-      /**
-       * 创建日期开始
-       */
-      private LocalDateTime createdTimeStart;
-      /**
-       * 创建日期结束
-       */
-      private LocalDateTime createdTimeEnd;
-          /**
+    private LocalDateTime createdTime;
+    /**
+     * 创建日期开始
+     */
+    private LocalDateTime createdTimeStart;
+    /**
+     * 创建日期结束
+     */
+    private LocalDateTime createdTimeEnd;
+    /**
      * 更新日期
      */
-        private LocalDateTime updateTime;
-      /**
-       * 更新日期开始
-       */
-      private LocalDateTime updateTimeStart;
-      /**
-       * 更新日期结束
-       */
-      private LocalDateTime updateTimeEnd;
-          /**
+    private LocalDateTime updateTime;
+    /**
+     * 更新日期开始
+     */
+    private LocalDateTime updateTimeStart;
+    /**
+     * 更新日期结束
+     */
+    private LocalDateTime updateTimeEnd;
+    /**
      * 创建人
      */
-          private String createdUserId;
-          /**
+    private String createdUserId;
+    /**
      * 创建人名称
      */
-          private String createdUserName;
-          /**
+    private String createdUserName;
+    /**
      * 更新人
      */
-          private String updateUserId;
-          /**
+    private String updateUserId;
+    /**
      * 更新人名称
      */
-          private String updateUserName;
-          /**
+    private String updateUserName;
+    /**
      * 存放地点
      */
-          private String position;
-          /**
+    private String position;
+    /**
      * 检测日期
      */
-          private String checkDate;
-          /**
+    private LocalDate checkDate;
+    /**
+     * 检测日期开始
+     */
+    private LocalDate checkDateStart;
+    /**
+     * 检测日期结束
+     */
+    private LocalDate checkDateEnd;
+    /**
      * 下次检测日期
      */
-        private LocalDate nextCheckDate;
-      /**
-       * 下次检测日期开始
-       */
-      private LocalDate nextCheckDateStart;
-      /**
-       * 下次检测日期结束
-       */
-      private LocalDate nextCheckDateEnd;
-          /**
+    private LocalDate nextCheckDate;
+    /**
+     * 下次检测日期开始
+     */
+    private LocalDate nextCheckDateStart;
+    /**
+     * 下次检测日期结束
+     */
+    private LocalDate nextCheckDateEnd;
+    /**
      * 检测周期
      */
-          private BigDecimal period;
-          /**
+    private Integer period;
+    /**
      * 预警天数
      */
-          private Integer warnDay;
-        /**
+    private Integer warnDay;
+    /**
      * 关键字
      */
-  private String keyword;
+    private String keyword;
 
+    /**
+     * 筛选快到期需要检定的
+     */
+    @Transient
+    private Integer status;
 }

+ 55 - 54
platform-dao/src/main/java/com/platform/dao/dto/tool/ToolLogDTO.java

@@ -5,6 +5,7 @@ import com.platform.common.validation.group.UpdateGroup;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+
 import javax.validation.constraints.*;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -21,90 +22,90 @@ import java.time.LocalDate;
 @EqualsAndHashCode(callSuper = true)
 public class ToolLogDTO extends BaseDTO implements Serializable {
 
-      /**
+    /**
      * 主键
      */
-        @NotNull(groups = {UpdateGroup.class}, message = "ID不能为空")
+    @NotNull(groups = {UpdateGroup.class}, message = "ID不能为空")
     private String id;
-          /**
+    /**
      * 检验人
      */
-          private String checkUserId;
-          /**
+    private String checkUserId;
+    /**
      * 检验说明
      */
-          private String requirement;
-          /**
+    private String requirement;
+    /**
      * 备注
      */
-          private String remark;
-          /**
+    private String remark;
+    /**
      * 创建人
      */
-          private String createdUserId;
-          /**
+    private String createdUserId;
+    /**
      * 更新人
      */
-          private String updateUserId;
-          /**
+    private String updateUserId;
+    /**
      * 创建人名称
      */
-          private String createdUserName;
-          /**
+    private String createdUserName;
+    /**
      * 更新人名称
      */
-          private String updateUserName;
-          /**
+    private String updateUserName;
+    /**
      * 创建时间
      */
-        private LocalDateTime createdTime;
-      /**
-       * 创建时间开始
-       */
-      private LocalDateTime createdTimeStart;
-      /**
-       * 创建时间结束
-       */
-      private LocalDateTime createdTimeEnd;
-          /**
+    private LocalDateTime createdTime;
+    /**
+     * 创建时间开始
+     */
+    private LocalDateTime createdTimeStart;
+    /**
+     * 创建时间结束
+     */
+    private LocalDateTime createdTimeEnd;
+    /**
      * 更新时间
      */
-        private LocalDateTime updateTime;
-      /**
-       * 更新时间开始
-       */
-      private LocalDateTime updateTimeStart;
-      /**
-       * 更新时间结束
-       */
-      private LocalDateTime updateTimeEnd;
-          /**
+    private LocalDateTime updateTime;
+    /**
+     * 更新时间开始
+     */
+    private LocalDateTime updateTimeStart;
+    /**
+     * 更新时间结束
+     */
+    private LocalDateTime updateTimeEnd;
+    /**
      * 工器具id
      */
-          private String toolId;
-          /**
+    private String toolId;
+    /**
      * 检测日期
      */
-        private LocalDate checkDate;
-      /**
-       * 检测日期开始
-       */
-      private LocalDate checkDateStart;
-      /**
-       * 检测日期结束
-       */
-      private LocalDate checkDateEnd;
-          /**
+    private LocalDate checkDate;
+    /**
+     * 检测日期开始
+     */
+    private LocalDate checkDateStart;
+    /**
+     * 检测日期结束
+     */
+    private LocalDate checkDateEnd;
+    /**
      * 检定图片路径
      */
-          private String imgPath;
-          /**
+    private String imgPath;
+    /**
      * 检定文件路径
      */
-          private String filePath;
-        /**
+    private String filePath;
+    /**
      * 关键字
      */
-  private String keyword;
+    private String keyword;
 
 }

+ 11 - 9
platform-dao/src/main/java/com/platform/dao/entity/tool/Tool.java

@@ -7,8 +7,10 @@ import javax.persistence.Table;
 import java.io.Serializable;
 import java.time.LocalDateTime;
 import java.time.LocalDate;
+
 import lombok.experimental.Accessors;
 import com.platform.common.bean.DataScope;
+
 import javax.persistence.Transient;
 import java.math.BigDecimal;
 
@@ -21,12 +23,12 @@ import java.math.BigDecimal;
 @Data
 @Accessors(chain = true)
 @Table(name = "t_tool")
-public class Tool implements Serializable{
+public class Tool implements Serializable {
 
     /**
      * 主键
      */
-        @Id
+    @Id
     private String id;
     /**
      * 工器具名称
@@ -39,7 +41,7 @@ public class Tool implements Serializable{
     /**
      * 编号
      */
-    private LocalDateTime no;
+    private String no;
     /**
      * 数量
      */
@@ -63,7 +65,7 @@ public class Tool implements Serializable{
     /**
      * 检测内容
      */
-    private LocalDateTime content;
+    private String content;
     /**
      * 备注
      */
@@ -99,7 +101,7 @@ public class Tool implements Serializable{
     /**
      * 检测日期
      */
-    private String checkDate;
+    private LocalDate checkDate;
     /**
      * 下次检测日期
      */
@@ -107,15 +109,15 @@ public class Tool implements Serializable{
     /**
      * 检测周期
      */
-    private BigDecimal period;
+    private Integer period;
     /**
      * 预警天数
      */
     private Integer warnDay;
 
-   /**
-    * 数据权限
-    */
+    /**
+     * 数据权限
+     */
     @Transient
     private DataScope dataScope;
 

+ 72 - 71
platform-dao/src/main/java/com/platform/dao/vo/export/tool/ExportToolLogVO.java

@@ -3,6 +3,7 @@ package com.platform.dao.vo.export.tool;
 import com.platform.office.annotation.Excel;
 import lombok.Data;
 import lombok.experimental.Accessors;
+
 import java.io.Serializable;
 import java.time.LocalDateTime;
 import java.time.LocalDate;
@@ -18,88 +19,88 @@ import java.time.LocalDate;
 public class ExportToolLogVO implements Serializable {
 
     /**
-   * 主键
-   */
-          @Excel(name = "主键", orderNum = "1")
-      private String id;
-    
+     * 主键
+     */
+    @Excel(name = "主键", orderNum = "1")
+    private String id;
+
     /**
-   * 检验人
-   */
-          @Excel(name = "检验人", orderNum = "2")
-      private String checkUserId;
-    
+     * 检验人
+     */
+    @Excel(name = "检验人", orderNum = "2")
+    private String checkUserId;
+
     /**
-   * 检验说明
-   */
-          @Excel(name = "检验说明", orderNum = "3")
-      private String requirement;
-    
+     * 检验说明
+     */
+    @Excel(name = "检验说明", orderNum = "3")
+    private String requirement;
+
     /**
-   * 备注
-   */
-          @Excel(name = "备注", orderNum = "4")
-      private String remark;
-    
+     * 备注
+     */
+    @Excel(name = "备注", orderNum = "4")
+    private String remark;
+
     /**
-   * 创建人
-   */
-          @Excel(name = "创建人", orderNum = "5")
-      private String createdUserId;
-    
+     * 创建人
+     */
+    @Excel(name = "创建人", orderNum = "5")
+    private String createdUserId;
+
     /**
-   * 更新人
-   */
-          @Excel(name = "更新人", orderNum = "6")
-      private String updateUserId;
-    
+     * 更新人
+     */
+    @Excel(name = "更新人", orderNum = "6")
+    private String updateUserId;
+
     /**
-   * 创建人名称
-   */
-          @Excel(name = "创建人名称", orderNum = "7")
-      private String createdUserName;
-    
+     * 创建人名称
+     */
+    @Excel(name = "创建人名称", orderNum = "7")
+    private String createdUserName;
+
     /**
-   * 更新人名称
-   */
-          @Excel(name = "更新人名称", orderNum = "8")
-      private String updateUserName;
-    
+     * 更新人名称
+     */
+    @Excel(name = "更新人名称", orderNum = "8")
+    private String updateUserName;
+
     /**
-   * 创建时间
-   */
-          @Excel(name = "创建时间", orderNum = "9")
-      private LocalDateTime createdTime;
-    
+     * 创建时间
+     */
+    @Excel(name = "创建时间", orderNum = "9")
+    private LocalDateTime createdTime;
+
     /**
-   * 更新时间
-   */
-          @Excel(name = "更新时间", orderNum = "10")
-      private LocalDateTime updateTime;
-    
+     * 更新时间
+     */
+    @Excel(name = "更新时间", orderNum = "10")
+    private LocalDateTime updateTime;
+
     /**
-   * 工器具id
-   */
-          @Excel(name = "工器具id", orderNum = "11")
-      private String toolId;
-    
+     * 工器具id
+     */
+    @Excel(name = "工器具id", orderNum = "11")
+    private String toolId;
+
     /**
-   * 检测日期
-   */
-          @Excel(name = "检测日期", orderNum = "12")
-      private LocalDate checkDate;
-    
+     * 检测日期
+     */
+    @Excel(name = "检测日期", orderNum = "12")
+    private LocalDate checkDate;
+
     /**
-   * 检定图片路径
-   */
-          @Excel(name = "检定图片路径", orderNum = "13")
-      private String imgPath;
-    
+     * 检定图片路径
+     */
+    @Excel(name = "检定图片路径", orderNum = "13")
+    private String imgPath;
+
     /**
-   * 检定文件路径
-   */
-          @Excel(name = "检定文件路径", orderNum = "14")
-      private String filePath;
-    
-  
+     * 检定文件路径
+     */
+    @Excel(name = "检定文件路径", orderNum = "14")
+    private String filePath;
+
+
 }

+ 109 - 132
platform-dao/src/main/java/com/platform/dao/vo/export/tool/ExportToolVO.java

@@ -3,6 +3,7 @@ package com.platform.dao.vo.export.tool;
 import com.platform.office.annotation.Excel;
 import lombok.Data;
 import lombok.experimental.Accessors;
+
 import java.io.Serializable;
 import java.time.LocalDateTime;
 import java.time.LocalDate;
@@ -19,136 +20,112 @@ import java.math.BigDecimal;
 public class ExportToolVO implements Serializable {
 
     /**
-   * 主键
-   */
-          @Excel(name = "主键", orderNum = "1")
-      private String id;
-    
-    /**
-   * 工器具名称
-   */
-          @Excel(name = "工器具名称", orderNum = "2")
-      private String name;
-    
-    /**
-   * 工器具型号
-   */
-          @Excel(name = "工器具型号", orderNum = "3")
-      private String ggxh;
-    
-    /**
-   * 编号
-   */
-          @Excel(name = "编号", orderNum = "4")
-      private LocalDateTime no;
-    
-    /**
-   * 数量
-   */
-          @Excel(name = "数量", orderNum = "5")
-      private Integer num;
-    
-    /**
-   * 负责人
-   */
-          @Excel(name = "负责人", orderNum = "6")
-      private String checkUserId;
-    
-    /**
-   * 生产厂家
-   */
-          @Excel(name = "生产厂家", orderNum = "7")
-      private String producer;
-    
-    /**
-   * 是否合格:0否,1是
-   */
-          @Excel(name = "是否合格:0否,1是", orderNum = "8")
-      private String hgFlag;
-    
-    /**
-   * 是否需要检验:0否,1是
-   */
-          @Excel(name = "是否需要检验:0否,1是", orderNum = "9")
-      private Integer checkFlag;
-    
-    /**
-   * 检测内容
-   */
-          @Excel(name = "检测内容", orderNum = "10")
-      private LocalDateTime content;
-    
-    /**
-   * 备注
-   */
-          @Excel(name = "备注", orderNum = "11")
-      private String remark;
-    
-    /**
-   * 创建日期
-   */
-          @Excel(name = "创建日期", orderNum = "12")
-      private LocalDateTime createdTime;
-    
-    /**
-   * 更新日期
-   */
-          @Excel(name = "更新日期", orderNum = "13")
-      private LocalDateTime updateTime;
-    
-    /**
-   * 创建人
-   */
-          @Excel(name = "创建人", orderNum = "14")
-      private String createdUserId;
-    
-    /**
-   * 创建人名称
-   */
-          @Excel(name = "创建人名称", orderNum = "15")
-      private String createdUserName;
-    
-    /**
-   * 更新人
-   */
-          @Excel(name = "更新人", orderNum = "16")
-      private String updateUserId;
-    
-    /**
-   * 更新人名称
-   */
-          @Excel(name = "更新人名称", orderNum = "17")
-      private String updateUserName;
-    
-    /**
-   * 存放地点
-   */
-          @Excel(name = "存放地点", orderNum = "18")
-      private String position;
-    
-    /**
-   * 检测日期
-   */
-          @Excel(name = "检测日期", orderNum = "19")
-      private String checkDate;
-    
-    /**
-   * 下次检测日期
-   */
-          @Excel(name = "下次检测日期", orderNum = "20")
-      private LocalDate nextCheckDate;
-    
-    /**
-   * 检测周期
-   */
-          @Excel(name = "检测周期", orderNum = "21")
-      private BigDecimal period;
-    
-    /**
-   * 预警天数
-   */
-          @Excel(name = "预警天数", orderNum = "22")
-      private Integer warnDay;
-    
-  
+     * 主键
+     */
+    @Excel(name = "主键", orderNum = "1")
+    private String id;
+
+    /**
+     * 工器具名称
+     */
+    @Excel(name = "工器具名称", orderNum = "2")
+    private String name;
+
+    /**
+     * 工器具型号
+     */
+    @Excel(name = "工器具型号", orderNum = "3")
+    private String ggxh;
+
+    /**
+     * 编号
+     */
+    @Excel(name = "编号", orderNum = "4")
+    private LocalDateTime no;
+
+    /**
+     * 数量
+     */
+    @Excel(name = "数量", orderNum = "5")
+    private Integer num;
+
+    /**
+     * 负责人
+     */
+    @Excel(name = "负责人", orderNum = "6")
+    private String checkUserId;
+
+    /**
+     * 生产厂家
+     */
+    @Excel(name = "生产厂家", orderNum = "7")
+    private String producer;
+
+    /**
+     * 是否合格:0否,1是
+     */
+    @Excel(name = "是否合格", orderNum = "8", dicCode="YES_NO")
+    private String hgFlag;
+
+    /**
+     * 是否需要检验:0否,1是
+     */
+    @Excel(name = "是否需要检验", orderNum = "9", dicCode="YES_NO")
+    private Integer checkFlag;
+
+    /**
+     * 检测内容
+     */
+    @Excel(name = "检测内容", orderNum = "10")
+    private LocalDateTime content;
+
+    /**
+     * 备注
+     */
+    @Excel(name = "备注", orderNum = "11")
+    private String remark;
+
+    /**
+     * 创建日期
+     */
+    @Excel(name = "创建日期", orderNum = "12")
+    private LocalDateTime createdTime;
+
+    /**
+     * 更新日期
+     */
+    @Excel(name = "更新日期", orderNum = "13")
+    private LocalDateTime updateTime;
+
+    /**
+     * 存放地点
+     */
+    @Excel(name = "存放地点", orderNum = "14")
+    private String position;
+
+    /**
+     * 检测日期
+     */
+    @Excel(name = "检测日期", orderNum = "15")
+    private String checkDate;
+
+    /**
+     * 下次检测日期
+     */
+    @Excel(name = "下次检测日期", orderNum = "16")
+    private LocalDate nextCheckDate;
+
+    /**
+     * 检测周期
+     */
+    @Excel(name = "检测周期", orderNum = "17")
+    private BigDecimal period;
+
+    /**
+     * 预警天数
+     */
+    @Excel(name = "预警天数", orderNum = "18")
+    private Integer warnDay;
+
+
 }

+ 45 - 45
platform-dao/src/main/java/com/platform/dao/vo/query/tool/ToolVO.java

@@ -6,6 +6,7 @@ import com.platform.common.bean.BaseDTO;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+
 import javax.validation.constraints.*;
 import java.io.Serializable;
 import java.time.LocalDateTime;
@@ -21,97 +22,96 @@ import java.math.BigDecimal;
 @Data
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = true)
-public class ToolVO extends BaseVO implements Serializable{
+public class ToolVO extends BaseVO implements Serializable {
 
     /**
      * 主键
      */
-        private String id;
-        /**
+    private String id;
+    /**
      * 工器具名称
      */
-        private String name;
-        /**
+    private String name;
+    /**
      * 工器具型号
      */
-        private String ggxh;
-        /**
+    private String ggxh;
+    /**
      * 编号
      */
-        private LocalDateTime no;
-        /**
+    private String no;
+    /**
      * 数量
      */
-        private Integer num;
-        /**
+    private Integer num;
+    /**
      * 负责人
      */
-        private String checkUserId;
-        /**
+    private String checkUserId;
+    /**
      * 生产厂家
      */
-        private String producer;
-        /**
+    private String producer;
+    /**
      * 是否合格:0否,1是
      */
-        private String hgFlag;
-        /**
+    private String hgFlag;
+    /**
      * 是否需要检验:0否,1是
      */
-        private Integer checkFlag;
-        /**
+    private Integer checkFlag;
+    /**
      * 检测内容
      */
-        private LocalDateTime content;
-        /**
+    private String content;
+    /**
      * 备注
      */
-        private String remark;
-        /**
+    private String remark;
+    /**
      * 创建日期
      */
-        private LocalDateTime createdTime;
-        /**
+    private LocalDateTime createdTime;
+    /**
      * 更新日期
      */
-        private LocalDateTime updateTime;
-        /**
+    private LocalDateTime updateTime;
+    /**
      * 创建人
      */
-        private String createdUserId;
-        /**
+    private String createdUserId;
+    /**
      * 创建人名称
      */
-        private String createdUserName;
-        /**
+    private String createdUserName;
+    /**
      * 更新人
      */
-        private String updateUserId;
-        /**
+    private String updateUserId;
+    /**
      * 更新人名称
      */
-        private String updateUserName;
-        /**
+    private String updateUserName;
+    /**
      * 存放地点
      */
-        private String position;
-        /**
+    private String position;
+    /**
      * 检测日期
      */
-        private String checkDate;
-        /**
+    private LocalDate checkDate;
+    /**
      * 下次检测日期
      */
-        private LocalDate nextCheckDate;
-        /**
+    private LocalDate nextCheckDate;
+    /**
      * 检测周期
      */
-        private BigDecimal period;
-        /**
+    private Integer period;
+    /**
      * 预警天数
      */
-        private Integer warnDay;
-    
+    private Integer warnDay;
 
 
 }

+ 104 - 106
platform-dao/src/main/resources/mapper/tool/ToolMapper.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.platform.dao.mapper.tool.ToolMapper">
     <sql id="Base_Column_List">
-                             tool.id,
+                                     tool.id,
                                      tool.name,
                                      tool.ggxh,
                                      tool.no,
@@ -24,9 +24,9 @@
                                      tool.next_check_date,
                                      tool.period,
                                      tool.warn_day
-                        </sql>
+    </sql>
     <sql id="Ref_Column_List">
-                                                                         tool.name,
+                                     tool.name,
                                      tool.ggxh,
                                      tool.no,
                                      tool.num,
@@ -41,113 +41,111 @@
                                      tool.next_check_date,
                                      tool.period,
                                      tool.warn_day
-                                </sql>
+    </sql>
     <sql id="List_Condition">
-                                    <if test="id != null and id != ''">
-                    and tool.id = #{id}
-                </if>
-                                                <if test="name != null and name != ''">
-                    and tool.name = #{name}
-                </if>
-                                                <if test="ggxh != null and ggxh != ''">
-                    and tool.ggxh = #{ggxh}
-                </if>
-                                                <if test="noStart != null">
-                    and tool.no <![CDATA[>=]]>; #{noStart}
-                </if>
-                <if test="noEnd != null">
-                    and tool.no <![CDATA[<=]]> #{noEnd}
-                </if>
-                <if test="no != null">
-                    and tool.no = #{no}
-                </if>
-                                                <if test="num != null">
-                    and tool.num = #{num}
-                </if>
-                                                <if test="checkUserId != null and checkUserId != ''">
-                    and tool.check_user_id = #{checkUserId}
-                </if>
-                                                <if test="producer != null and producer != ''">
-                    and tool.producer = #{producer}
-                </if>
-                                                <if test="hgFlag != null and hgFlag != ''">
-                    and tool.hg_flag = #{hgFlag}
-                </if>
-                                                <if test="checkFlag != null">
-                    and tool.check_flag = #{checkFlag}
-                </if>
-                                                <if test="contentStart != null">
-                    and tool.content <![CDATA[>=]]>; #{contentStart}
-                </if>
-                <if test="contentEnd != null">
-                    and tool.content <![CDATA[<=]]> #{contentEnd}
-                </if>
-                <if test="content != null">
-                    and tool.content = #{content}
-                </if>
-                                                <if test="remark != null and remark != ''">
-                    and tool.remark = #{remark}
-                </if>
-                                                <if test="createdTimeStart != null">
-                    and tool.created_time <![CDATA[>=]]>; #{createdTimeStart}
-                </if>
-                <if test="createdTimeEnd != null">
-                    and tool.created_time <![CDATA[<=]]> #{createdTimeEnd}
-                </if>
-                <if test="createdTime != null">
-                    and tool.created_time = #{createdTime}
-                </if>
-                                                <if test="updateTimeStart != null">
-                    and tool.update_time <![CDATA[>=]]>; #{updateTimeStart}
-                </if>
-                <if test="updateTimeEnd != null">
-                    and tool.update_time <![CDATA[<=]]> #{updateTimeEnd}
-                </if>
-                <if test="updateTime != null">
-                    and tool.update_time = #{updateTime}
-                </if>
-                                                <if test="createdUserId != null and createdUserId != ''">
-                    and tool.created_user_id = #{createdUserId}
-                </if>
-                                                <if test="createdUserName != null and createdUserName != ''">
-                    and tool.created_user_name = #{createdUserName}
-                </if>
-                                                <if test="updateUserId != null and updateUserId != ''">
-                    and tool.update_user_id = #{updateUserId}
-                </if>
-                                                <if test="updateUserName != null and updateUserName != ''">
-                    and tool.update_user_name = #{updateUserName}
-                </if>
-                                                <if test="position != null and position != ''">
-                    and tool.position = #{position}
-                </if>
-                                                <if test="checkDate != null and checkDate != ''">
-                    and tool.check_date = #{checkDate}
-                </if>
-                                                <if test="nextCheckDateStart != null">
-                    and tool.next_check_date <![CDATA[>=]]>; #{nextCheckDateStart}
-                </if>
-                <if test="nextCheckDateEnd != null">
-                    and tool.next_check_date <![CDATA[<=]]> #{nextCheckDateEnd}
-                </if>
-                <if test="nextCheckDate != null">
-                    and tool.next_check_date = #{nextCheckDate}
-                </if>
-                                                <if test="period != null">
-                    and tool.period = #{period}
-                </if>
-                                                <if test="warnDay != null">
-                    and tool.warn_day = #{warnDay}
-                </if>
-                            <if test="keyword != null and keyword != ''">
-            and tool.id like concat(concat('%',#{keyword}),'%')
+        <if test="id != null and id != ''">
+            and tool.id = #{id}
+        </if>
+        <if test="name != null and name != ''">
+            and tool.name = #{name}
+        </if>
+        <if test="ggxh != null and ggxh != ''">
+            and tool.ggxh = #{ggxh}
+        </if>
+        <if test="no != null">
+            and tool.no = #{no}
+        </if>
+        <if test="num != null">
+            and tool.num = #{num}
+        </if>
+        <if test="checkUserId != null and checkUserId != ''">
+            and tool.check_user_id = #{checkUserId}
+        </if>
+        <if test="producer != null and producer != ''">
+            and tool.producer = #{producer}
+        </if>
+        <if test="hgFlag != null and hgFlag != ''">
+            and tool.hg_flag = #{hgFlag}
+        </if>
+        <if test="checkFlag != null">
+            and tool.check_flag = #{checkFlag}
+        </if>
+        <if test="content != null">
+            and tool.content = #{content}
+        </if>
+        <if test="remark != null and remark != ''">
+            and tool.remark = #{remark}
+        </if>
+        <if test="createdTimeStart != null">
+            and tool.created_time <![CDATA[>=]]>; #{createdTimeStart}
+        </if>
+        <if test="createdTimeEnd != null">
+            and tool.created_time <![CDATA[<=]]> #{createdTimeEnd}
+        </if>
+        <if test="createdTime != null">
+            and tool.created_time = #{createdTime}
+        </if>
+        <if test="updateTimeStart != null">
+            and tool.update_time <![CDATA[>=]]>; #{updateTimeStart}
+        </if>
+        <if test="updateTimeEnd != null">
+            and tool.update_time <![CDATA[<=]]> #{updateTimeEnd}
+        </if>
+        <if test="updateTime != null">
+            and tool.update_time = #{updateTime}
+        </if>
+        <if test="createdUserId != null and createdUserId != ''">
+            and tool.created_user_id = #{createdUserId}
+        </if>
+        <if test="createdUserName != null and createdUserName != ''">
+            and tool.created_user_name = #{createdUserName}
+        </if>
+        <if test="updateUserId != null and updateUserId != ''">
+            and tool.update_user_id = #{updateUserId}
+        </if>
+        <if test="updateUserName != null and updateUserName != ''">
+            and tool.update_user_name = #{updateUserName}
+        </if>
+        <if test="position != null and position != ''">
+            and tool.position = #{position}
+        </if>
+        <if test="checkDateStart != null">
+            and tool.check_date <![CDATA[>=]]>; #{checkDateStart}
+        </if>
+        <if test="checkDateEnd != null">
+            and tool.check_date <![CDATA[<=]]> #{checkDateEnd}
+        </if>
+        <if test="checkDate != null and checkDate != ''">
+            and tool.check_date = #{checkDate}
+        </if>
+        <if test="nextCheckDateStart != null">
+            and tool.next_check_date <![CDATA[>=]]>; #{nextCheckDateStart}
+        </if>
+        <if test="nextCheckDateEnd != null">
+            and tool.next_check_date <![CDATA[<=]]> #{nextCheckDateEnd}
+        </if>
+        <if test="status != null">
+            and TIMESTAMPDIFF( DAY, CURDATE( ), tool.next_check_date ) <![CDATA[ <= ]]> tool.warn_day
+        </if>
+        <if test="nextCheckDate != null">
+            and tool.next_check_date = #{nextCheckDate}
+        </if>
+        <if test="period != null">
+            and tool.period = #{period}
+        </if>
+        <if test="warnDay != null">
+            and tool.warn_day = #{warnDay}
+        </if>
+        <if test="keyword != null and keyword != ''">
+            and tool.name like concat(concat('%',#{keyword}),'%')
         </if>
     </sql>
-    <select id="selectList" parameterType="com.platform.dao.dto.tool.ToolDTO" resultType="com.platform.dao.vo.query.tool.ToolVO">
+    <select id="selectList" parameterType="com.platform.dao.dto.tool.ToolDTO"
+            resultType="com.platform.dao.vo.query.tool.ToolVO">
         select tool.*
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                        from t_tool as tool
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <where>
-            <include refid="List_Condition" />
+        from t_tool as tool
+        <where>
+            <include refid="List_Condition"/>
         </where>
     </select>
 </mapper>

+ 9 - 0
platform-rest/src/main/java/com/platform/rest/controller/tool/ToolLogController.java

@@ -1,6 +1,8 @@
 package com.platform.rest.controller.tool;
 
 import com.platform.common.util.R;
+import com.platform.dao.dto.sb.BatchSbMeasureLog;
+import com.platform.dao.dto.tool.BatchToolLogDTO;
 import com.platform.dao.dto.tool.ToolLogDTO;
 import com.platform.dao.entity.tool.ToolLog;
 import com.platform.service.tool.ToolLogService;
@@ -56,6 +58,13 @@ public class ToolLogController {
       return new R<>(toolLogService.saveModelByDTO(toolLogDTO));
   }
 
+  @SysLog("批量新增工器具检定记录")
+  @PostMapping("/batch")
+  public R saveLongYanBatch(@RequestBody BatchToolLogDTO batchToolLogDTO) {
+    toolLogService.saveBatchToolLog(batchToolLogDTO);
+    return new R<>();
+  }
+
   /**
    * 修改记录
    *

+ 3 - 1
platform-service/src/main/java/com/platform/service/tool/ToolLogService.java

@@ -1,5 +1,6 @@
 package com.platform.service.tool;
 
+import com.platform.dao.dto.tool.BatchToolLogDTO;
 import com.platform.dao.vo.query.tool.ToolLogVO;
 import com.platform.dao.dto.tool.ToolLogDTO;
 import com.platform.dao.entity.tool.ToolLog;
@@ -32,4 +33,5 @@ public interface ToolLogService extends IBaseService<ToolLog, ToolLogDTO> {
      */
     AbstractPageResultBean<ToolLogVO> selectPageList(ToolLogDTO record, int pageNum, int pageSize);
 
-                                                                                                                                                                            }
+    void saveBatchToolLog(BatchToolLogDTO batchToolLogDTO);
+}

+ 11 - 0
platform-service/src/main/java/com/platform/service/tool/impl/ToolLogServiceImpl.java

@@ -2,6 +2,7 @@ package com.platform.service.tool.impl;
 import com.platform.common.bean.AbstractPageResultBean;
 import com.platform.dao.bean.MyPage;
 import com.github.pagehelper.PageHelper;
+import com.platform.dao.dto.tool.BatchToolLogDTO;
 import com.platform.dao.vo.query.tool.ToolLogVO;
 import com.platform.dao.dto.tool.ToolLogDTO;
 import com.platform.dao.entity.tool.ToolLog;
@@ -10,6 +11,7 @@ import com.platform.service.tool.ToolLogService;
 import org.springframework.stereotype.Service;
 import com.platform.service.base.impl.BaseServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 import tk.mybatis.mapper.weekend.Weekend;
 import tk.mybatis.mapper.weekend.WeekendCriteria;
 import lombok.AllArgsConstructor;
@@ -41,6 +43,15 @@ public class ToolLogServiceImpl extends BaseServiceImpl<ToolLogMapper, ToolLog,
         return new MyPage(mapper.selectList(record));
     }
 
+    @Override
+    public void saveBatchToolLog(BatchToolLogDTO batchToolLogDTO) {
+        if (!CollectionUtils.isEmpty(batchToolLogDTO.getToolLogDTOList())) {
+            batchToolLogDTO.getToolLogDTOList().forEach(item -> {
+                this.saveModelByDTO(item);
+            });
+        }
+    }
+
     @Override
     public AbstractPageResultBean<ToolLog> selectPageInfo(ToolLogDTO record, int pageNum, int pageSize) {
         PageHelper.startPage(pageNum, pageSize);