新增设备管理模块
This commit is contained in:
@@ -17,6 +17,10 @@
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<!-- Spring框架基本的核心工具 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
|
||||
177
gear-common/src/main/java/com/gear/common/annotation/Excel.java
Normal file
177
gear-common/src/main/java/com/gear/common/annotation/Excel.java
Normal file
@@ -0,0 +1,177 @@
|
||||
package com.gear.common.annotation;
|
||||
|
||||
import com.gear.common.utils.poi.ExcelHandlerAdapter;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 自定义导出Excel数据注解
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface Excel
|
||||
{
|
||||
/**
|
||||
* 导出时在excel中排序
|
||||
*/
|
||||
public int sort() default Integer.MAX_VALUE;
|
||||
|
||||
/**
|
||||
* 导出到Excel中的名字.
|
||||
*/
|
||||
public String name() default "";
|
||||
|
||||
/**
|
||||
* 日期格式, 如: yyyy-MM-dd
|
||||
*/
|
||||
public String dateFormat() default "";
|
||||
|
||||
/**
|
||||
* 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
|
||||
*/
|
||||
public String dictType() default "";
|
||||
|
||||
/**
|
||||
* 读取内容转表达式 (如: 0=男,1=女,2=未知)
|
||||
*/
|
||||
public String readConverterExp() default "";
|
||||
|
||||
/**
|
||||
* 分隔符,读取字符串组内容
|
||||
*/
|
||||
public String separator() default ",";
|
||||
|
||||
/**
|
||||
* BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
|
||||
*/
|
||||
public int scale() default -1;
|
||||
|
||||
/**
|
||||
* BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
|
||||
*/
|
||||
public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
|
||||
|
||||
/**
|
||||
* 导出类型(0数字 1字符串)
|
||||
*/
|
||||
public ColumnType cellType() default ColumnType.STRING;
|
||||
|
||||
/**
|
||||
* 导出时在excel中每个列的高度 单位为字符
|
||||
*/
|
||||
public double height() default 14;
|
||||
|
||||
/**
|
||||
* 导出时在excel中每个列的宽 单位为字符
|
||||
*/
|
||||
public double width() default 16;
|
||||
|
||||
/**
|
||||
* 文字后缀,如% 90 变成90%
|
||||
*/
|
||||
public String suffix() default "";
|
||||
|
||||
/**
|
||||
* 当值为空时,字段的默认值
|
||||
*/
|
||||
public String defaultValue() default "";
|
||||
|
||||
/**
|
||||
* 提示信息
|
||||
*/
|
||||
public String prompt() default "";
|
||||
|
||||
/**
|
||||
* 设置只能选择不能输入的列内容.
|
||||
*/
|
||||
public String[] combo() default {};
|
||||
|
||||
/**
|
||||
* 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
|
||||
*/
|
||||
public boolean isExport() default true;
|
||||
|
||||
/**
|
||||
* 另一个类中的属性名称,支持多级获取,以小数点隔开
|
||||
*/
|
||||
public String targetAttr() default "";
|
||||
|
||||
/**
|
||||
* 是否自动统计数据,在最后追加一行统计数据总和
|
||||
*/
|
||||
public boolean isStatistics() default false;
|
||||
|
||||
/**
|
||||
* 导出字段对齐方式(0:默认;1:靠左;2:居中;3:靠右)
|
||||
*/
|
||||
public Align align() default Align.AUTO;
|
||||
|
||||
/**
|
||||
* 自定义数据处理器
|
||||
*/
|
||||
public Class<?> handler() default ExcelHandlerAdapter.class;
|
||||
|
||||
/**
|
||||
* 自定义数据处理器参数
|
||||
*/
|
||||
public String[] args() default {};
|
||||
|
||||
public enum Align
|
||||
{
|
||||
AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
|
||||
private final int value;
|
||||
|
||||
Align(int value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 字段类型(0:导出导入;1:仅导出;2:仅导入)
|
||||
*/
|
||||
Type type() default Type.ALL;
|
||||
|
||||
public enum Type
|
||||
{
|
||||
ALL(0), EXPORT(1), IMPORT(2);
|
||||
private final int value;
|
||||
|
||||
Type(int value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ColumnType
|
||||
{
|
||||
NUMERIC(0), STRING(1), IMAGE(2);
|
||||
private final int value;
|
||||
|
||||
ColumnType(int value)
|
||||
{
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int value()
|
||||
{
|
||||
return this.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.gear.common.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Excel注解集
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Excels
|
||||
{
|
||||
public Excel[] value();
|
||||
}
|
||||
@@ -46,6 +46,21 @@ public class RuoYiConfig {
|
||||
*/
|
||||
@Getter
|
||||
private static boolean addressEnabled;
|
||||
/** 上传路径 */
|
||||
private static String profile;
|
||||
|
||||
public static String getProfile()
|
||||
{
|
||||
return profile;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下载路径
|
||||
*/
|
||||
public static String getDownloadPath()
|
||||
{
|
||||
return getProfile() + "/download/";
|
||||
}
|
||||
|
||||
public void setAddressEnabled(boolean addressEnabled) {
|
||||
RuoYiConfig.addressEnabled = addressEnabled;
|
||||
|
||||
@@ -72,5 +72,14 @@ public interface Constants {
|
||||
*/
|
||||
String TOKEN = "token";
|
||||
|
||||
/**
|
||||
* 字典管理缓存键前缀
|
||||
*/
|
||||
String SYS_DICT_KEY = "sys_dict:";
|
||||
/**
|
||||
* 资源映射路径 前缀
|
||||
*/
|
||||
String RESOURCE_PREFIX = "/profile";
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -128,5 +128,26 @@ public interface UserConstants {
|
||||
* 管理员ID
|
||||
*/
|
||||
Long ADMIN_ID = 1L;
|
||||
String DV_CHECK_STATUS_NOTCHECK = "O"; //未检验
|
||||
/**
|
||||
* 单据的状态类型
|
||||
*/
|
||||
String ORDER_STATUS_PREPARE = "PREPARE";
|
||||
String ORDER_STATUS_CONFIRMED = "CONFIRMED";
|
||||
String ORDER_STATUS_APPROVING = "APPROVING";
|
||||
String ORDER_STATUS_APPROVED = "APPROVED";
|
||||
String ORDER_STATUS_FINISHED = "FINISHED";
|
||||
String ORDER_STATUS_CANCELED = "CANCELED";
|
||||
String DV_PLAN_TYPE_CHECK = "CHECK"; //点检方案
|
||||
/**
|
||||
* 排班日历的查询方式
|
||||
*/
|
||||
String CAL_QUERY_BY_TYPE = "TYPE";
|
||||
String CAL_QUERY_BY_TEAM = "TEAM";
|
||||
String CAL_QUERY_BY_USER = "USER";
|
||||
String NOT_UNIQUE = "1";
|
||||
String UNIQUE = "0";
|
||||
String DV_REPAIR_CODE = "DV_REPAIR_CODE"; //维修单
|
||||
String MACHINERY_TYPE_CODE = "MACHINERY_TYPE_CODE";
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,15 @@
|
||||
package com.gear.common.core.controller;
|
||||
|
||||
import com.gear.common.constant.HttpStatus;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.domain.model.LoginUser;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.helper.LoginHelper;
|
||||
import com.gear.common.utils.PageUtils;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* web层通用数据处理
|
||||
@@ -66,4 +72,18 @@ public class BaseController {
|
||||
public String getUsername() {
|
||||
return LoginHelper.getUsername();
|
||||
}
|
||||
|
||||
protected void startPage()
|
||||
{
|
||||
PageUtils.startPage();
|
||||
}
|
||||
protected TableDataInfo getDataTable(List<?> list)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
package com.gear.common.core.domain;
|
||||
|
||||
import com.gear.common.constant.HttpStatus;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 操作消息提醒
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class AjaxResult extends HashMap<String, Object>
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 状态码 */
|
||||
public static final String CODE_TAG = "code";
|
||||
|
||||
/** 返回内容 */
|
||||
public static final String MSG_TAG = "msg";
|
||||
|
||||
/** 数据对象 */
|
||||
public static final String DATA_TAG = "data";
|
||||
|
||||
/**
|
||||
* 初始化一个新创建的 AjaxResult 对象,使其表示一个空消息。
|
||||
*/
|
||||
public AjaxResult()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化一个新创建的 AjaxResult 对象
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回内容
|
||||
*/
|
||||
public AjaxResult(int code, String msg)
|
||||
{
|
||||
super.put(CODE_TAG, code);
|
||||
super.put(MSG_TAG, msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化一个新创建的 AjaxResult 对象
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回内容
|
||||
* @param data 数据对象
|
||||
*/
|
||||
public AjaxResult(int code, String msg, Object data)
|
||||
{
|
||||
super.put(CODE_TAG, code);
|
||||
super.put(MSG_TAG, msg);
|
||||
if (StringUtils.isNotNull(data))
|
||||
{
|
||||
super.put(DATA_TAG, data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success()
|
||||
{
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功数据
|
||||
*
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(Object data)
|
||||
{
|
||||
return AjaxResult.success("操作成功", data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(String msg)
|
||||
{
|
||||
return AjaxResult.success(msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @param data 数据对象
|
||||
* @return 成功消息
|
||||
*/
|
||||
public static AjaxResult success(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.SUCCESS, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static AjaxResult error()
|
||||
{
|
||||
return AjaxResult.error("操作失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static AjaxResult error(String msg)
|
||||
{
|
||||
return AjaxResult.error(msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @param msg 返回内容
|
||||
* @param data 数据对象
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static AjaxResult error(String msg, Object data)
|
||||
{
|
||||
return new AjaxResult(HttpStatus.ERROR, msg, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回错误消息
|
||||
*
|
||||
* @param code 状态码
|
||||
* @param msg 返回内容
|
||||
* @return 警告消息
|
||||
*/
|
||||
public static AjaxResult error(int code, String msg)
|
||||
{
|
||||
return new AjaxResult(code, msg, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 方便链式调用
|
||||
*
|
||||
* @param key 键
|
||||
* @param value 值
|
||||
* @return 数据对象
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult put(String key, Object value)
|
||||
{
|
||||
super.put(key, value);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
package com.gear.common.core.page;
|
||||
|
||||
import com.gear.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 分页数据
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PageDomain
|
||||
{
|
||||
/** 当前记录起始索引 */
|
||||
private Integer pageNum;
|
||||
|
||||
/** 每页显示记录数 */
|
||||
private Integer pageSize;
|
||||
|
||||
/** 排序列 */
|
||||
private String orderByColumn;
|
||||
|
||||
/** 排序的方向desc或者asc */
|
||||
private String isAsc = "asc";
|
||||
|
||||
/** 分页参数合理化 */
|
||||
private Boolean reasonable = true;
|
||||
|
||||
public String getOrderBy()
|
||||
{
|
||||
if (StringUtils.isEmpty(orderByColumn))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
||||
}
|
||||
|
||||
public Integer getPageNum()
|
||||
{
|
||||
return pageNum;
|
||||
}
|
||||
|
||||
public void setPageNum(Integer pageNum)
|
||||
{
|
||||
this.pageNum = pageNum;
|
||||
}
|
||||
|
||||
public Integer getPageSize()
|
||||
{
|
||||
return pageSize;
|
||||
}
|
||||
|
||||
public void setPageSize(Integer pageSize)
|
||||
{
|
||||
this.pageSize = pageSize;
|
||||
}
|
||||
|
||||
public String getOrderByColumn()
|
||||
{
|
||||
return orderByColumn;
|
||||
}
|
||||
|
||||
public void setOrderByColumn(String orderByColumn)
|
||||
{
|
||||
this.orderByColumn = orderByColumn;
|
||||
}
|
||||
|
||||
public String getIsAsc()
|
||||
{
|
||||
return isAsc;
|
||||
}
|
||||
|
||||
public void setIsAsc(String isAsc)
|
||||
{
|
||||
if (StringUtils.isNotEmpty(isAsc))
|
||||
{
|
||||
// 兼容前端排序类型
|
||||
if ("ascending".equals(isAsc))
|
||||
{
|
||||
isAsc = "asc";
|
||||
}
|
||||
else if ("descending".equals(isAsc))
|
||||
{
|
||||
isAsc = "desc";
|
||||
}
|
||||
this.isAsc = isAsc;
|
||||
}
|
||||
}
|
||||
|
||||
public Boolean getReasonable()
|
||||
{
|
||||
if (StringUtils.isNull(reasonable))
|
||||
{
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
return reasonable;
|
||||
}
|
||||
|
||||
public void setReasonable(Boolean reasonable)
|
||||
{
|
||||
this.reasonable = reasonable;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.gear.common.core.page;
|
||||
|
||||
import com.gear.common.utils.ServletUtils;
|
||||
|
||||
/**
|
||||
* 表格数据处理
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class TableSupport
|
||||
{
|
||||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
public static final String PAGE_NUM = "pageNum";
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
public static final String PAGE_SIZE = "pageSize";
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
*/
|
||||
public static final String ORDER_BY_COLUMN = "orderByColumn";
|
||||
|
||||
/**
|
||||
* 排序的方向 "desc" 或者 "asc".
|
||||
*/
|
||||
public static final String IS_ASC = "isAsc";
|
||||
|
||||
/**
|
||||
* 分页参数合理化
|
||||
*/
|
||||
public static final String REASONABLE = "reasonable";
|
||||
|
||||
/**
|
||||
* 封装分页对象
|
||||
*/
|
||||
public static PageDomain getPageDomain()
|
||||
{
|
||||
PageDomain pageDomain = new PageDomain();
|
||||
pageDomain.setPageNum(ServletUtils.getParameterToInt(PAGE_NUM));
|
||||
pageDomain.setPageSize(ServletUtils.getParameterToInt(PAGE_SIZE));
|
||||
pageDomain.setOrderByColumn(ServletUtils.getParameter(ORDER_BY_COLUMN));
|
||||
pageDomain.setIsAsc(ServletUtils.getParameter(IS_ASC));
|
||||
pageDomain.setReasonable(ServletUtils.getParameterToBool(REASONABLE));
|
||||
return pageDomain;
|
||||
}
|
||||
|
||||
public static PageDomain buildPageRequest()
|
||||
{
|
||||
return getPageDomain();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.gear.common.core.text;
|
||||
|
||||
import com.gear.common.utils.StringUtils;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* 字符集工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class CharsetKit
|
||||
{
|
||||
/** ISO-8859-1 */
|
||||
public static final String ISO_8859_1 = "ISO-8859-1";
|
||||
/** UTF-8 */
|
||||
public static final String UTF_8 = "UTF-8";
|
||||
/** GBK */
|
||||
public static final String GBK = "GBK";
|
||||
|
||||
/** ISO-8859-1 */
|
||||
public static final Charset CHARSET_ISO_8859_1 = Charset.forName(ISO_8859_1);
|
||||
/** UTF-8 */
|
||||
public static final Charset CHARSET_UTF_8 = Charset.forName(UTF_8);
|
||||
/** GBK */
|
||||
public static final Charset CHARSET_GBK = Charset.forName(GBK);
|
||||
|
||||
/**
|
||||
* 转换为Charset对象
|
||||
*
|
||||
* @param charset 字符集,为空则返回默认字符集
|
||||
* @return Charset
|
||||
*/
|
||||
public static Charset charset(String charset)
|
||||
{
|
||||
return StringUtils.isEmpty(charset) ? Charset.defaultCharset() : Charset.forName(charset);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换字符串的字符集编码
|
||||
*
|
||||
* @param source 字符串
|
||||
* @param srcCharset 源字符集,默认ISO-8859-1
|
||||
* @param destCharset 目标字符集,默认UTF-8
|
||||
* @return 转换后的字符集
|
||||
*/
|
||||
public static String convert(String source, String srcCharset, String destCharset)
|
||||
{
|
||||
return convert(source, Charset.forName(srcCharset), Charset.forName(destCharset));
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换字符串的字符集编码
|
||||
*
|
||||
* @param source 字符串
|
||||
* @param srcCharset 源字符集,默认ISO-8859-1
|
||||
* @param destCharset 目标字符集,默认UTF-8
|
||||
* @return 转换后的字符集
|
||||
*/
|
||||
public static String convert(String source, Charset srcCharset, Charset destCharset)
|
||||
{
|
||||
if (null == srcCharset)
|
||||
{
|
||||
srcCharset = StandardCharsets.ISO_8859_1;
|
||||
}
|
||||
|
||||
if (null == destCharset)
|
||||
{
|
||||
destCharset = StandardCharsets.UTF_8;
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(source) || srcCharset.equals(destCharset))
|
||||
{
|
||||
return source;
|
||||
}
|
||||
return new String(source.getBytes(srcCharset), destCharset);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return 系统字符集编码
|
||||
*/
|
||||
public static String systemCharset()
|
||||
{
|
||||
return Charset.defaultCharset().name();
|
||||
}
|
||||
}
|
||||
1006
gear-common/src/main/java/com/gear/common/core/text/Convert.java
Normal file
1006
gear-common/src/main/java/com/gear/common/core/text/Convert.java
Normal file
File diff suppressed because it is too large
Load Diff
1368
gear-common/src/main/java/com/gear/common/excel/ExcelUtil.java
Normal file
1368
gear-common/src/main/java/com/gear/common/excel/ExcelUtil.java
Normal file
File diff suppressed because it is too large
Load Diff
183
gear-common/src/main/java/com/gear/common/utils/DictUtils.java
Normal file
183
gear-common/src/main/java/com/gear/common/utils/DictUtils.java
Normal file
@@ -0,0 +1,183 @@
|
||||
package com.gear.common.utils;
|
||||
|
||||
import com.gear.common.constant.Constants;
|
||||
import com.gear.common.core.domain.entity.SysDictData;
|
||||
import com.gear.common.utils.redis.RedisUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 字典工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class DictUtils
|
||||
{
|
||||
/**
|
||||
* 分隔符
|
||||
*/
|
||||
public static final String SEPARATOR = ",";
|
||||
|
||||
|
||||
/**
|
||||
* 设置字典缓存
|
||||
*
|
||||
* @param key 参数键
|
||||
* @param dictDatas 字典数据列表
|
||||
*/
|
||||
public static void setDictCache(String key, List<SysDictData> dictDatas)
|
||||
{
|
||||
RedisUtils.setCacheObject(getCacheKey(key), dictDatas);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字典缓存
|
||||
*
|
||||
* @param key 参数键
|
||||
* @return dictDatas 字典数据列表
|
||||
*/
|
||||
public static List<SysDictData> getDictCache(String key)
|
||||
{
|
||||
Object cacheObj = RedisUtils.getCacheObject(getCacheKey(key));
|
||||
if (StringUtils.isNotNull(cacheObj))
|
||||
{
|
||||
return StringUtils.cast(cacheObj);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典值获取字典标签
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典值
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String getDictLabel(String dictType, String dictValue)
|
||||
{
|
||||
return getDictLabel(dictType, dictValue, SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典标签获取字典值
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictLabel 字典标签
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String getDictValue(String dictType, String dictLabel)
|
||||
{
|
||||
return getDictValue(dictType, dictLabel, SEPARATOR);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典值获取字典标签
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典值
|
||||
* @param separator 分隔符
|
||||
* @return 字典标签
|
||||
*/
|
||||
public static String getDictLabel(String dictType, String dictValue, String separator)
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = getDictCache(dictType);
|
||||
|
||||
if (StringUtils.containsAny(separator, dictValue) && StringUtils.isNotEmpty((CharSequence) datas))
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
for (String value : dictValue.split(separator))
|
||||
{
|
||||
if (value.equals(dict.getDictValue()))
|
||||
{
|
||||
propertyString.append(dict.getDictLabel()).append(separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
if (dictValue.equals(dict.getDictValue()))
|
||||
{
|
||||
return dict.getDictLabel();
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典标签获取字典值
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictLabel 字典标签
|
||||
* @param separator 分隔符
|
||||
* @return 字典值
|
||||
*/
|
||||
public static String getDictValue(String dictType, String dictLabel, String separator)
|
||||
{
|
||||
StringBuilder propertyString = new StringBuilder();
|
||||
List<SysDictData> datas = getDictCache(dictType);
|
||||
|
||||
if (StringUtils.containsAny(separator, dictLabel) && StringUtils.isNotEmpty((CharSequence) datas))
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
for (String label : dictLabel.split(separator))
|
||||
{
|
||||
if (label.equals(dict.getDictLabel()))
|
||||
{
|
||||
propertyString.append(dict.getDictValue()).append(separator);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (SysDictData dict : datas)
|
||||
{
|
||||
if (dictLabel.equals(dict.getDictLabel()))
|
||||
{
|
||||
return dict.getDictValue();
|
||||
}
|
||||
}
|
||||
}
|
||||
return StringUtils.stripEnd(propertyString.toString(), separator);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除指定字典缓存
|
||||
*
|
||||
* @param key 字典键
|
||||
*/
|
||||
public static void removeDictCache(String key)
|
||||
{
|
||||
RedisUtils.deleteObject(getCacheKey(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 清空字典缓存
|
||||
*/
|
||||
public static void clearDictCache()
|
||||
{
|
||||
Collection<String> keys = RedisUtils.keys(Constants.SYS_DICT_KEY + "*");
|
||||
RedisUtils.deleteObject(keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置cache key
|
||||
*
|
||||
* @param configKey 参数键
|
||||
* @return 缓存键key
|
||||
*/
|
||||
public static String getCacheKey(String configKey)
|
||||
{
|
||||
return Constants.SYS_DICT_KEY + configKey;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.gear.common.utils;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.gear.common.core.page.PageDomain;
|
||||
import com.gear.common.core.page.TableSupport;
|
||||
import com.gear.common.utils.sql.SqlUtil;
|
||||
|
||||
/**
|
||||
* 分页工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class PageUtils extends PageHelper
|
||||
{
|
||||
/**
|
||||
* 设置请求分页数据
|
||||
*/
|
||||
public static void startPage()
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy());
|
||||
Boolean reasonable = pageDomain.getReasonable();
|
||||
PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理分页的线程变量
|
||||
*/
|
||||
public static void clearPage()
|
||||
{
|
||||
PageHelper.clearPage();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.gear.common.core.domain.entity.SysDictData;
|
||||
import lombok.AccessLevel;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.springframework.util.AntPathMatcher;
|
||||
@@ -12,6 +13,8 @@ import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static java.util.Objects.isNull;
|
||||
|
||||
/**
|
||||
* 字符串工具类
|
||||
*
|
||||
@@ -322,4 +325,18 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static boolean isNotNull(Object object)
|
||||
{
|
||||
return !isNull(object);
|
||||
}
|
||||
|
||||
public static boolean isNull(Object object)
|
||||
{
|
||||
return object == null;
|
||||
}
|
||||
|
||||
public static <T> T cast(Object obj)
|
||||
{
|
||||
return (T) obj;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.gear.common.utils.file;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* 文件类型工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class FileTypeUtils
|
||||
{
|
||||
/**
|
||||
* 获取文件类型
|
||||
* <p>
|
||||
* 例如: ruoyi.txt, 返回: txt
|
||||
*
|
||||
* @param file 文件名
|
||||
* @return 后缀(不含".")
|
||||
*/
|
||||
public static String getFileType(File file)
|
||||
{
|
||||
if (null == file)
|
||||
{
|
||||
return StringUtils.EMPTY;
|
||||
}
|
||||
return getFileType(file.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件类型
|
||||
* <p>
|
||||
* 例如: ruoyi.txt, 返回: txt
|
||||
*
|
||||
* @param fileName 文件名
|
||||
* @return 后缀(不含".")
|
||||
*/
|
||||
public static String getFileType(String fileName)
|
||||
{
|
||||
int separatorIndex = fileName.lastIndexOf(".");
|
||||
if (separatorIndex < 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return fileName.substring(separatorIndex + 1).toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文件类型
|
||||
*
|
||||
* @param photoByte 文件字节码
|
||||
* @return 后缀(不含".")
|
||||
*/
|
||||
public static String getFileExtendName(byte[] photoByte)
|
||||
{
|
||||
String strFileExtendName = "JPG";
|
||||
if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56)
|
||||
&& ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97))
|
||||
{
|
||||
strFileExtendName = "GIF";
|
||||
}
|
||||
else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70))
|
||||
{
|
||||
strFileExtendName = "JPG";
|
||||
}
|
||||
else if ((photoByte[0] == 66) && (photoByte[1] == 77))
|
||||
{
|
||||
strFileExtendName = "BMP";
|
||||
}
|
||||
else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71))
|
||||
{
|
||||
strFileExtendName = "PNG";
|
||||
}
|
||||
return strFileExtendName;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.gear.common.utils.file;
|
||||
|
||||
import com.gear.common.config.RuoYiConfig;
|
||||
import com.gear.common.constant.Constants;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 图片处理工具类
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class ImageUtils
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(ImageUtils.class);
|
||||
|
||||
public static byte[] getImage(String imagePath)
|
||||
{
|
||||
InputStream is = getFile(imagePath);
|
||||
try
|
||||
{
|
||||
return IOUtils.toByteArray(is);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("图片加载异常 {}", e);
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IOUtils.closeQuietly(is);
|
||||
}
|
||||
}
|
||||
|
||||
public static InputStream getFile(String imagePath)
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] result = readFile(imagePath);
|
||||
result = Arrays.copyOf(result, result.length);
|
||||
return new ByteArrayInputStream(result);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("获取图片异常 {}", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 读取文件为字节数据
|
||||
*
|
||||
* @param url 地址
|
||||
* @return 字节数据
|
||||
*/
|
||||
public static byte[] readFile(String url)
|
||||
{
|
||||
InputStream in = null;
|
||||
try
|
||||
{
|
||||
if (url.startsWith("http"))
|
||||
{
|
||||
// 网络地址
|
||||
URL urlObj = new URL(url);
|
||||
URLConnection urlConnection = urlObj.openConnection();
|
||||
urlConnection.setConnectTimeout(30 * 1000);
|
||||
urlConnection.setReadTimeout(60 * 1000);
|
||||
urlConnection.setDoInput(true);
|
||||
in = urlConnection.getInputStream();
|
||||
}
|
||||
else
|
||||
{
|
||||
// 本机地址
|
||||
String localPath = RuoYiConfig.getProfile();
|
||||
String downloadPath = localPath + StringUtils.substringAfter(url, Constants.RESOURCE_PREFIX);
|
||||
in = new FileInputStream(downloadPath);
|
||||
}
|
||||
return IOUtils.toByteArray(in);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("获取文件路径异常 {}", e);
|
||||
return null;
|
||||
}
|
||||
finally
|
||||
{
|
||||
IOUtils.closeQuietly(in);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.gear.common.utils.poi;
|
||||
|
||||
/**
|
||||
* Excel数据格式处理适配器
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ExcelHandlerAdapter
|
||||
{
|
||||
/**
|
||||
* 格式化
|
||||
*
|
||||
* @param value 单元格数据值
|
||||
* @param args excel注解args参数组
|
||||
*
|
||||
* @return 处理后的值
|
||||
*/
|
||||
Object format(Object value, String[] args);
|
||||
}
|
||||
39
gear-mes/pom.xml
Normal file
39
gear-mes/pom.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.gear</groupId>
|
||||
<artifactId>FURNITURE-OA</artifactId>
|
||||
<version>0.8.3</version>
|
||||
</parent>
|
||||
|
||||
<groupId>com.gear.mes</groupId>
|
||||
<artifactId>gear-mes</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.gear</groupId>
|
||||
<artifactId>gear-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.gear</groupId>
|
||||
<artifactId>gear-system</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvCheckMachinery;
|
||||
import com.gear.mes.dv.service.IDvCheckMachineryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检设备Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checkmachinery")
|
||||
public class DvCheckMachineryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvCheckMachineryService dvCheckMachineryService;
|
||||
|
||||
/**
|
||||
* 查询点检设备列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckMachinery dvCheckMachinery)
|
||||
{
|
||||
startPage();
|
||||
List<DvCheckMachinery> list = dvCheckMachineryService.selectDvCheckMachineryList(dvCheckMachinery);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出点检设备列表
|
||||
*/
|
||||
|
||||
@Log(title = "点检设备", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckMachinery dvCheckMachinery)
|
||||
{
|
||||
List<DvCheckMachinery> list = dvCheckMachineryService.selectDvCheckMachineryList(dvCheckMachinery);
|
||||
ExcelUtil.exportExcel(list, "点检设备数据", DvCheckMachinery.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点检设备详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(dvCheckMachineryService.selectDvCheckMachineryByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检设备
|
||||
*/
|
||||
|
||||
@Log(title = "点检设备", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvCheckMachinery dvCheckMachinery)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvCheckMachineryService.checkMachineryUnique(dvCheckMachinery))){
|
||||
return R.fail("设备已设置过点检计划!");
|
||||
}
|
||||
return toAjax(dvCheckMachineryService.insertDvCheckMachinery(dvCheckMachinery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检设备
|
||||
*/
|
||||
|
||||
@Log(title = "点检设备", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvCheckMachinery dvCheckMachinery)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvCheckMachineryService.checkMachineryUnique(dvCheckMachinery))){
|
||||
return R.fail("设备已设置过点检计划!");
|
||||
}
|
||||
return toAjax(dvCheckMachineryService.updateDvCheckMachinery(dvCheckMachinery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检设备
|
||||
*/
|
||||
|
||||
@Log(title = "点检设备", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public R<Void> remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(dvCheckMachineryService.deleteDvCheckMachineryByRecordIds(recordIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvCheckMachinery;
|
||||
import com.gear.mes.dv.domain.DvCheckPlan;
|
||||
import com.gear.mes.dv.domain.DvCheckSubject;
|
||||
import com.gear.mes.dv.domain.dto.DvCheckPlanDTO;
|
||||
import com.gear.mes.dv.service.IDvCheckMachineryService;
|
||||
import com.gear.mes.dv.service.IDvCheckPlanService;
|
||||
import com.gear.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checkplan")
|
||||
public class DvCheckPlanController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvCheckPlanService dvCheckPlanService;
|
||||
|
||||
@Autowired
|
||||
IDvCheckMachineryService dvCheckMachineryService;
|
||||
|
||||
@Autowired
|
||||
IDvCheckSubjectService dvCheckSubjectService;
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckPlan dvCheckPlan)
|
||||
{
|
||||
startPage();
|
||||
List<DvCheckPlan> list = dvCheckPlanService.selectDvCheckPlanList(dvCheckPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备点检计划头列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检计划头", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckPlan dvCheckPlan)
|
||||
{
|
||||
List<DvCheckPlan> list = dvCheckPlanService.selectDvCheckPlanList(dvCheckPlan);
|
||||
ExcelUtil.exportExcel(list, "设备点检计划头数据", DvCheckPlan.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检计划头详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{planId}")
|
||||
public AjaxResult getInfo(@PathVariable("planId") Long planId)
|
||||
{
|
||||
return AjaxResult.success(dvCheckPlanService.selectDvCheckPlanByPlanId(planId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检计划头
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检计划头", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvCheckPlan dvCheckPlan)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvCheckPlanService.checkPlanCodeUnique(dvCheckPlan))){
|
||||
return R.fail("编号已存在!");
|
||||
}
|
||||
return toAjax(dvCheckPlanService.insertDvCheckPlan(dvCheckPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检计划头
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检计划头", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvCheckPlan dvCheckPlan)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvCheckPlanService.checkPlanCodeUnique(dvCheckPlan))){
|
||||
return R.fail("编号已存在!");
|
||||
}
|
||||
if(UserConstants.ORDER_STATUS_FINISHED.equals(dvCheckPlan.getStatus())){
|
||||
DvCheckMachinery para1 = new DvCheckMachinery();
|
||||
para1.setPlanId(dvCheckPlan.getPlanId());
|
||||
List<DvCheckMachinery> machinerys = dvCheckMachineryService.selectDvCheckMachineryList(para1);
|
||||
if(!CollUtil.isNotEmpty(machinerys)){
|
||||
return R.fail("请指定设备!");
|
||||
}
|
||||
|
||||
DvCheckSubject para2 = new DvCheckSubject();
|
||||
para2.setPlanId(dvCheckPlan.getPlanId());
|
||||
List<DvCheckSubject> subjects = dvCheckSubjectService.selectDvCheckSubjectList(para2);
|
||||
if(!CollUtil.isNotEmpty(subjects)){
|
||||
return R.fail("请指定项目!");
|
||||
}
|
||||
}
|
||||
return toAjax(dvCheckPlanService.updateDvCheckPlan(dvCheckPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检计划头
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检计划头", businessType = BusinessType.DELETE)
|
||||
@Transactional
|
||||
@DeleteMapping("/{planIds}")
|
||||
public R<Void> remove(@PathVariable Long[] planIds)
|
||||
{
|
||||
for (Long planId:planIds
|
||||
) {
|
||||
DvCheckPlan plan = dvCheckPlanService.selectDvCheckPlanByPlanId(planId);
|
||||
if(!UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())){
|
||||
return R.fail("只能删除草稿状态单据!");
|
||||
}
|
||||
|
||||
dvCheckMachineryService.deleteByPlanId(planId);
|
||||
dvCheckSubjectService.deleteByPlanId(planId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return toAjax(dvCheckPlanService.deleteDvCheckPlanByPlanIds(planIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码和计划类型查询设备点检计划头列表
|
||||
* @return
|
||||
*/
|
||||
|
||||
@GetMapping("/getCheckPlan")
|
||||
public AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO) {
|
||||
return dvCheckPlanService.getCheckPlan(checkPlanDTO);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,168 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvCheckRecord;
|
||||
import com.gear.mes.dv.domain.DvCheckRecordLine;
|
||||
import com.gear.mes.dv.domain.DvCheckSubject;
|
||||
import com.gear.mes.dv.service.IDvCheckRecordLineService;
|
||||
import com.gear.mes.dv.service.IDvCheckRecordService;
|
||||
import com.gear.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检记录Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checkrecord")
|
||||
public class DvCheckRecordController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvCheckRecordService dvCheckRecordService;
|
||||
|
||||
@Autowired
|
||||
private IDvCheckSubjectService dvCheckSubjectService;
|
||||
|
||||
@Autowired
|
||||
private IDvCheckRecordLineService dvCheckRecordLineService;
|
||||
|
||||
/**
|
||||
* 查询设备点检记录列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
startPage();
|
||||
List<DvCheckRecord> list = dvCheckRecordService.selectDvCheckRecordList(dvCheckRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备点检记录列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
List<DvCheckRecord> list = dvCheckRecordService.selectDvCheckRecordList(dvCheckRecord);
|
||||
ExcelUtil.exportExcel(list, "设备点检记录数据", DvCheckRecord.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检记录详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(dvCheckRecordService.selectDvCheckRecordByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
dvCheckRecordService.insertDvCheckRecord(dvCheckRecord);
|
||||
|
||||
if(dvCheckRecord.getPlanId()!= null){
|
||||
//根据选择的点检计划自动生成对应的行信息
|
||||
DvCheckSubject param = new DvCheckSubject();
|
||||
param.setPlanId(dvCheckRecord.getPlanId());
|
||||
List<DvCheckSubject> subjectList = dvCheckSubjectService.selectDvCheckSubjectList(param);
|
||||
if(!CollectionUtils.isEmpty(subjectList)){
|
||||
for(DvCheckSubject subject : subjectList){
|
||||
DvCheckRecordLine line = new DvCheckRecordLine();
|
||||
line.setRecordId(dvCheckRecord.getRecordId());
|
||||
line.setSubjectId(subject.getSubjectId());
|
||||
line.setSubjectName(subject.getSubjectName());
|
||||
line.setSubjectType(subject.getSubjectType());
|
||||
line.setSubjectContent(subject.getSubjectContent());
|
||||
line.setSubjectStandard(subject.getSubjectStandard());
|
||||
line.setCheckStatus(UserConstants.YES);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return AjaxResult.success(dvCheckRecord.getRecordId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录", businessType = BusinessType.UPDATE)
|
||||
@Transactional
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
if(UserConstants.ORDER_STATUS_FINISHED.equals(dvCheckRecord.getStatus())){
|
||||
DvCheckRecordLine param = new DvCheckRecordLine();
|
||||
param.setRecordId(dvCheckRecord.getRecordId());
|
||||
List<DvCheckRecordLine> lineList = dvCheckRecordLineService.selectDvCheckRecordLineList(param);
|
||||
if(CollectionUtils.isEmpty(lineList)){
|
||||
return R.fail("请添加设备点检项目结果信息");
|
||||
}
|
||||
}
|
||||
|
||||
DvCheckRecord oldRecord = dvCheckRecordService.selectDvCheckRecordByRecordId(dvCheckRecord.getRecordId());
|
||||
if(oldRecord.getPlanId() != null && dvCheckRecord.getPlanId() != null && !dvCheckRecord.getPlanId().equals(oldRecord.getPlanId())){
|
||||
dvCheckRecordLineService.deleteDvCheckRecordLineByRecordId(dvCheckRecord.getRecordId());
|
||||
//根据选择的点检计划自动生成对应的行信息
|
||||
DvCheckSubject param = new DvCheckSubject();
|
||||
param.setPlanId(dvCheckRecord.getPlanId());
|
||||
List<DvCheckSubject> subjectList = dvCheckSubjectService.selectDvCheckSubjectList(param);
|
||||
if(!CollectionUtils.isEmpty(subjectList)){
|
||||
for(DvCheckSubject subject : subjectList){
|
||||
DvCheckRecordLine line = new DvCheckRecordLine();
|
||||
line.setRecordId(dvCheckRecord.getRecordId());
|
||||
line.setSubjectId(subject.getSubjectId());
|
||||
line.setSubjectName(subject.getSubjectName());
|
||||
line.setSubjectType(subject.getSubjectType());
|
||||
line.setSubjectContent(subject.getSubjectContent());
|
||||
line.setSubjectStandard(subject.getSubjectStandard());
|
||||
line.setCheckStatus(UserConstants.YES);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(dvCheckRecordService.updateDvCheckRecord(dvCheckRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录", businessType = BusinessType.DELETE)
|
||||
@Transactional
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public R<Void> remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
|
||||
for(Long recordId : recordIds){
|
||||
dvCheckRecordLineService.deleteDvCheckRecordLineByRecordId(recordId);
|
||||
}
|
||||
|
||||
return toAjax(dvCheckRecordService.deleteDvCheckRecordByRecordIds(recordIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvCheckRecordLine;
|
||||
import com.gear.mes.dv.service.IDvCheckRecordLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检记录行Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checkrecordline")
|
||||
public class DvCheckRecordLineController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvCheckRecordLineService dvCheckRecordLineService;
|
||||
|
||||
/**
|
||||
* 查询设备点检记录行列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
startPage();
|
||||
List<DvCheckRecordLine> list = dvCheckRecordLineService.selectDvCheckRecordLineList(dvCheckRecordLine);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备点检记录行列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录行", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
List<DvCheckRecordLine> list = dvCheckRecordLineService.selectDvCheckRecordLineList(dvCheckRecordLine);
|
||||
ExcelUtil.exportExcel(list, "设备点检记录行数据", DvCheckRecordLine.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检记录行详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{lineId}")
|
||||
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
|
||||
{
|
||||
return AjaxResult.success(dvCheckRecordLineService.selectDvCheckRecordLineByLineId(lineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检记录行
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录行", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
return toAjax(dvCheckRecordLineService.insertDvCheckRecordLine(dvCheckRecordLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检记录行
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录行", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
return toAjax(dvCheckRecordLineService.updateDvCheckRecordLine(dvCheckRecordLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检记录行
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录行", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{lineIds}")
|
||||
public R<Void> remove(@PathVariable Long[] lineIds)
|
||||
{
|
||||
return toAjax(dvCheckRecordLineService.deleteDvCheckRecordLineByLineIds(lineIds));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvCheckSubject;
|
||||
import com.gear.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检项目Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/checksubject")
|
||||
public class DvCheckSubjectController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvCheckSubjectService dvCheckSubjectService;
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
startPage();
|
||||
List<DvCheckSubject> list = dvCheckSubjectService.selectDvCheckSubjectList(dvCheckSubject);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出点检项目列表
|
||||
*/
|
||||
|
||||
@Log(title = "点检项目", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
List<DvCheckSubject> list = dvCheckSubjectService.selectDvCheckSubjectList(dvCheckSubject);
|
||||
ExcelUtil.exportExcel(list, "点检项目数据", DvCheckSubject.class, response);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取点检项目详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(dvCheckSubjectService.selectDvCheckSubjectByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*/
|
||||
|
||||
@Log(title = "点检项目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvCheckSubjectService.checkSubjectUnique(dvCheckSubject))){
|
||||
return R.fail("点检项目已经添加过!");
|
||||
}
|
||||
|
||||
return toAjax(dvCheckSubjectService.insertDvCheckSubject(dvCheckSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*/
|
||||
|
||||
@Log(title = "点检项目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvCheckSubjectService.checkSubjectUnique(dvCheckSubject))){
|
||||
return R.fail("点检项目已经添加过!");
|
||||
}
|
||||
return toAjax(dvCheckSubjectService.updateDvCheckSubject(dvCheckSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检项目
|
||||
*/
|
||||
|
||||
@Log(title = "点检项目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public R<Void> remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(dvCheckSubjectService.deleteDvCheckSubjectByRecordIds(recordIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.excel.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvMachinery;
|
||||
import com.gear.mes.dv.service.IDvMachineryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/machinery")
|
||||
public class DvMachineryController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvMachineryService dvMachineryService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvMachinery dvMachinery)
|
||||
{
|
||||
startPage();
|
||||
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(dvMachinery);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvMachinery dvMachinery)
|
||||
{
|
||||
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(dvMachinery);
|
||||
ExcelUtil<DvMachinery> util = new ExcelUtil<DvMachinery>(DvMachinery.class);
|
||||
util.exportExcel(response, list, "设备数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{machineryId}")
|
||||
public AjaxResult getInfo(@PathVariable("machineryId") Long machineryId)
|
||||
{
|
||||
return AjaxResult.success(dvMachineryService.selectDvMachineryByMachineryId(machineryId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*/
|
||||
|
||||
@Log(title = "设备", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvMachinery dvMachinery)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvMachineryService.checkRecptCodeUnique(dvMachinery))){
|
||||
return AjaxResult.error("编号已存在!");
|
||||
}
|
||||
return dvMachineryService.insertDvMachinery(dvMachinery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
|
||||
@Log(title = "设备", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvMachinery dvMachinery)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvMachineryService.checkRecptCodeUnique(dvMachinery))){
|
||||
return AjaxResult.error("编号已存在!");
|
||||
}
|
||||
return dvMachineryService.updateDvMachinery(dvMachinery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
|
||||
@Log(title = "设备", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{machineryIds}")
|
||||
public R<Void> remove(@PathVariable Long[] machineryIds)
|
||||
{
|
||||
return toAjax(dvMachineryService.deleteDvMachineryByMachineryIds(machineryIds));
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 依据上传的文件批量更新或新增设备
|
||||
// */
|
||||
//
|
||||
// @Log(title = "设备", businessType = BusinessType.IMPORT)
|
||||
// @PostMapping("/importData")
|
||||
// public AjaxResult importData(MultipartFile file,
|
||||
// @RequestParam(name = "updateSupport", defaultValue = "false") boolean updateSupport) throws Exception {
|
||||
// ExcelUtil<DvMachinery> util = new ExcelUtil<>(DvMachinery.class);
|
||||
// List<DvMachinery> dvMachineryList = util.importExcel(file.getInputStream());
|
||||
// String operName = LoginHelper.getUsername();
|
||||
// String message = dvMachineryService.importMachinery(dvMachineryList, updateSupport, operName);
|
||||
// return AjaxResult.success(message);
|
||||
// }
|
||||
|
||||
@PostMapping("/importTemplate")
|
||||
public void importTemplate(HttpServletResponse response)
|
||||
{
|
||||
ExcelUtil<DvMachinery> util = new ExcelUtil<DvMachinery>(DvMachinery.class);
|
||||
util.importTemplateExcel(response, "设备台账");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.excel.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvMachinery;
|
||||
import com.gear.mes.dv.domain.DvMachineryType;
|
||||
import com.gear.mes.dv.service.IDvMachineryService;
|
||||
import com.gear.mes.dv.service.IDvMachineryTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 设备类型Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/machinerytype")
|
||||
public class DvMachineryTypeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvMachineryTypeService dvMachineryTypeService;
|
||||
|
||||
@Autowired
|
||||
private IDvMachineryService dvMachineryService;
|
||||
/**
|
||||
* 查询设备类型列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(DvMachineryType dvMachineryType)
|
||||
{
|
||||
List<DvMachineryType> list = dvMachineryTypeService.selectDvMachineryTypeList(dvMachineryType);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备类型列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备类型", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvMachineryType dvMachineryType)
|
||||
{
|
||||
List<DvMachineryType> list = dvMachineryTypeService.selectDvMachineryTypeList(dvMachineryType);
|
||||
ExcelUtil<DvMachineryType> util = new ExcelUtil<DvMachineryType>(DvMachineryType.class);
|
||||
util.exportExcel(response, list, "设备类型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备类型详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{machineryTypeId}")
|
||||
public AjaxResult getInfo(@PathVariable("machineryTypeId") Long machineryTypeId)
|
||||
{
|
||||
return AjaxResult.success(dvMachineryTypeService.selectDvMachineryTypeByMachineryTypeId(machineryTypeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备类型
|
||||
*/
|
||||
|
||||
@Log(title = "设备类型", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvMachineryType dvMachineryType)
|
||||
{
|
||||
// 使用UUID生成设备类型编号
|
||||
String machineryTypeCode = "MT-" + UUID.randomUUID().toString().replace("-", "").substring(0, 12).toUpperCase();
|
||||
dvMachineryType.setMachineryTypeCode(machineryTypeCode);
|
||||
return toAjax(dvMachineryTypeService.insertDvMachineryType(dvMachineryType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备类型
|
||||
*/
|
||||
|
||||
@Log(title = "设备类型", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvMachineryType dvMachineryType)
|
||||
{
|
||||
return toAjax(dvMachineryTypeService.updateDvMachineryType(dvMachineryType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备类型
|
||||
*/
|
||||
|
||||
@Log(title = "设备类型", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{machineryTypeIds}")
|
||||
public R<Void> remove(@PathVariable Long[] machineryTypeIds)
|
||||
{
|
||||
for (Long typeId:machineryTypeIds
|
||||
) {
|
||||
DvMachinery param = new DvMachinery();
|
||||
param.setMachineryId(typeId);
|
||||
List<DvMachinery> machinerys = dvMachineryService.selectDvMachineryList(param);
|
||||
if(CollUtil.isNotEmpty(machinerys)){
|
||||
return R.fail("设备类型下已配置了设备,不能删除!");
|
||||
}
|
||||
}
|
||||
|
||||
return toAjax(dvMachineryTypeService.deleteDvMachineryTypeByMachineryTypeIds(machineryTypeIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.excel.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvMaintenRecord;
|
||||
import com.gear.mes.dv.service.IDvMaintenRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/maintenrecord")
|
||||
public class DvMaintenRecordController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvMaintenRecordService dvMaintenRecordService;
|
||||
|
||||
/**
|
||||
* 查询设备保养记录列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
startPage();
|
||||
List<DvMaintenRecord> list = dvMaintenRecordService.selectDvMaintenRecordList(dvMaintenRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备保养记录列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
List<DvMaintenRecord> list = dvMaintenRecordService.selectDvMaintenRecordList(dvMaintenRecord);
|
||||
ExcelUtil<DvMaintenRecord> util = new ExcelUtil<DvMaintenRecord>(DvMaintenRecord.class);
|
||||
util.exportExcel(response, list, "设备保养记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备保养记录详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(dvMaintenRecordService.selectDvMaintenRecordByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备保养记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
return toAjax(dvMaintenRecordService.insertDvMaintenRecord(dvMaintenRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备保养记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
return toAjax(dvMaintenRecordService.updateDvMaintenRecord(dvMaintenRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备保养记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public R<Void> remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(dvMaintenRecordService.deleteDvMaintenRecordByRecordIds(recordIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.excel.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvMaintenRecordLine;
|
||||
import com.gear.mes.dv.service.IDvMaintenRecordLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录行Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/maintenrecordline")
|
||||
public class DvMaintenRecordLineController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvMaintenRecordLineService dvMaintenRecordLineService;
|
||||
|
||||
/**
|
||||
* 查询设备保养记录行列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvMaintenRecordLine dvMaintenRecordLine)
|
||||
{
|
||||
startPage();
|
||||
List<DvMaintenRecordLine> list = dvMaintenRecordLineService.selectDvMaintenRecordLineList(dvMaintenRecordLine);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备保养记录行列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录行", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvMaintenRecordLine dvMaintenRecordLine)
|
||||
{
|
||||
List<DvMaintenRecordLine> list = dvMaintenRecordLineService.selectDvMaintenRecordLineList(dvMaintenRecordLine);
|
||||
ExcelUtil<DvMaintenRecordLine> util = new ExcelUtil<DvMaintenRecordLine>(DvMaintenRecordLine.class);
|
||||
util.exportExcel(response, list, "设备保养记录行数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备保养记录行详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{lineId}")
|
||||
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
|
||||
{
|
||||
return AjaxResult.success(dvMaintenRecordLineService.selectDvMaintenRecordLineByLineId(lineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备保养记录行
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录行", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvMaintenRecordLine dvMaintenRecordLine)
|
||||
{
|
||||
return toAjax(dvMaintenRecordLineService.insertDvMaintenRecordLine(dvMaintenRecordLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备保养记录行
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录行", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvMaintenRecordLine dvMaintenRecordLine)
|
||||
{
|
||||
return toAjax(dvMaintenRecordLineService.updateDvMaintenRecordLine(dvMaintenRecordLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备保养记录行
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录行", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{lineIds}")
|
||||
public R<Void> remove(@PathVariable Long[] lineIds)
|
||||
{
|
||||
return toAjax(dvMaintenRecordLineService.deleteDvMaintenRecordLineByLineIds(lineIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.excel.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvRepair;
|
||||
import com.gear.mes.dv.domain.dto.DvRepairDTO;
|
||||
import com.gear.mes.dv.service.IDvRepairService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/repair")
|
||||
public class DvRepairController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvRepairService dvRepairService;
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvRepair dvRepair)
|
||||
{
|
||||
startPage();
|
||||
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备维修单列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvRepair dvRepair)
|
||||
{
|
||||
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
|
||||
ExcelUtil<DvRepair> util = new ExcelUtil<DvRepair>(DvRepair.class);
|
||||
util.exportExcel(response, list, "设备维修单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备维修单详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{repairId}")
|
||||
public AjaxResult getInfo(@PathVariable("repairId") Long repairId)
|
||||
{
|
||||
return AjaxResult.success(dvRepairService.selectDvRepairByRepairId(repairId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvRepair dvRepair)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
|
||||
return R.fail("维修单编号已存!");
|
||||
}
|
||||
return toAjax(dvRepairService.insertDvRepair(dvRepair));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvRepair dvRepair)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
|
||||
return R.fail("维修单编号已存!");
|
||||
}
|
||||
return toAjax(dvRepairService.updateDvRepair(dvRepair));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{repairIds}")
|
||||
public R<Void> remove(@PathVariable Long[] repairIds)
|
||||
{
|
||||
return toAjax(dvRepairService.deleteDvRepairByRepairIds(repairIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码查询设备维修单列表
|
||||
*/
|
||||
|
||||
@GetMapping("/getRepairList")
|
||||
public AjaxResult getRepairList(DvRepairDTO repairDTO) {
|
||||
return dvRepairService.getRepairList(repairDTO);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.excel.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvRepairLine;
|
||||
import com.gear.mes.dv.service.IDvRepairLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单行Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/repairline")
|
||||
public class DvRepairLineController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvRepairLineService dvRepairLineService;
|
||||
|
||||
/**
|
||||
* 查询设备维修单行列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvRepairLine dvRepairLine)
|
||||
{
|
||||
startPage();
|
||||
List<DvRepairLine> list = dvRepairLineService.selectDvRepairLineList(dvRepairLine);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备维修单行列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvRepairLine dvRepairLine)
|
||||
{
|
||||
List<DvRepairLine> list = dvRepairLineService.selectDvRepairLineList(dvRepairLine);
|
||||
ExcelUtil<DvRepairLine> util = new ExcelUtil<DvRepairLine>(DvRepairLine.class);
|
||||
util.exportExcel(response, list, "设备维修单行数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备维修单行详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{lineId}")
|
||||
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
|
||||
{
|
||||
return AjaxResult.success(dvRepairLineService.selectDvRepairLineByLineId(lineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单行
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvRepairLine dvRepairLine)
|
||||
{
|
||||
return toAjax(dvRepairLineService.insertDvRepairLine(dvRepairLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单行
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvRepairLine dvRepairLine)
|
||||
{
|
||||
return toAjax(dvRepairLineService.updateDvRepairLine(dvRepairLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单行
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{lineIds}")
|
||||
public R<Void> remove(@PathVariable Long[] lineIds)
|
||||
{
|
||||
return toAjax(dvRepairLineService.deleteDvRepairLineByLineIds(lineIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.annotation.RepeatSubmit;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.core.validate.AddGroup;
|
||||
import com.gear.common.core.validate.EditGroup;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.poi.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.bo.DvSpecialEquipmentBo;
|
||||
import com.gear.mes.dv.domain.vo.DvSpecialEquipmentVo;
|
||||
import com.gear.mes.dv.service.IDvSpecialEquipmentService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/mes/specialEquipment")
|
||||
public class DvSpecialEquipmentController extends BaseController {
|
||||
|
||||
private final IDvSpecialEquipmentService iDvSpecialEquipmentService;
|
||||
|
||||
/**
|
||||
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DvSpecialEquipmentVo> list(DvSpecialEquipmentBo bo, PageQuery pageQuery) {
|
||||
return iDvSpecialEquipmentService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
|
||||
*/
|
||||
@Log(title = "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(DvSpecialEquipmentBo bo, HttpServletResponse response) {
|
||||
List<DvSpecialEquipmentVo> list = iDvSpecialEquipmentService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", DvSpecialEquipmentVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特种设备(包含锅炉、压力管道、电梯等特种设备信息)详细信息
|
||||
*
|
||||
* @param equipmentId 主键
|
||||
*/
|
||||
@GetMapping("/{equipmentId}")
|
||||
public R<DvSpecialEquipmentVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long equipmentId) {
|
||||
return R.ok(iDvSpecialEquipmentService.queryById(equipmentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
@Log(title = "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DvSpecialEquipmentBo bo) {
|
||||
return toAjax(iDvSpecialEquipmentService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
@Log(title = "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DvSpecialEquipmentBo bo) {
|
||||
return toAjax(iDvSpecialEquipmentService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*
|
||||
* @param equipmentIds 主键串
|
||||
*/
|
||||
@Log(title = "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{equipmentIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] equipmentIds) {
|
||||
return toAjax(iDvSpecialEquipmentService.deleteWithValidByIds(Arrays.asList(equipmentIds), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.gear.mes.dv.controller;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.excel.ExcelUtil;
|
||||
import com.gear.mes.dv.domain.DvSubject;
|
||||
import com.gear.mes.dv.service.IDvSubjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mes/dv/dvsubject")
|
||||
public class DvSubjectController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IDvSubjectService dvSubjectService;
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvSubject dvSubject)
|
||||
{
|
||||
startPage();
|
||||
List<DvSubject> list = dvSubjectService.selectDvSubjectList(dvSubject);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出设备点检保养项目列表
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检保养项目", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, DvSubject dvSubject)
|
||||
{
|
||||
List<DvSubject> list = dvSubjectService.selectDvSubjectList(dvSubject);
|
||||
ExcelUtil<DvSubject> util = new ExcelUtil<DvSubject>(DvSubject.class);
|
||||
util.exportExcel(response, list, "设备点检保养项目数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检保养项目详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{subjectId}")
|
||||
public AjaxResult getInfo(@PathVariable("subjectId") Long subjectId)
|
||||
{
|
||||
return AjaxResult.success(dvSubjectService.selectDvSubjectBySubjectId(subjectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检保养项目
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检保养项目", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvSubject dvSubject)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvSubjectService.checkSubjectCodeUnique(dvSubject))){
|
||||
return R.fail("项目编码已存在!");
|
||||
}
|
||||
return toAjax(dvSubjectService.insertDvSubject(dvSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检保养项目
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检保养项目", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvSubject dvSubject)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvSubjectService.checkSubjectCodeUnique(dvSubject))){
|
||||
return R.fail("项目编码已存在!");
|
||||
}
|
||||
return toAjax(dvSubjectService.updateDvSubject(dvSubject));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检保养项目
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检保养项目", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{subjectIds}")
|
||||
public R<Void> remove(@PathVariable Long[] subjectIds)
|
||||
{
|
||||
return toAjax(dvSubjectService.deleteDvSubjectBySubjectIds(subjectIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.gear.mes.dv.controller.mobile;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.mes.dv.domain.DvCheckRecordLine;
|
||||
import com.gear.mes.dv.service.IDvCheckRecordLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yinjinlu
|
||||
* @description
|
||||
* @date 2025/4/30
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/mobile/dv/checkrecordline")
|
||||
public class DvCheckRecordLineMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDvCheckRecordLineService dvCheckRecordLineService;
|
||||
|
||||
/**
|
||||
* 查询设备点检记录行列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
List<DvCheckRecordLine> list = dvCheckRecordLineService.selectDvCheckRecordLineList(dvCheckRecordLine);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检记录行详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{lineId}")
|
||||
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
|
||||
{
|
||||
return AjaxResult.success(dvCheckRecordLineService.selectDvCheckRecordLineByLineId(lineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检记录行
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录行", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
return toAjax(dvCheckRecordLineService.updateDvCheckRecordLine(dvCheckRecordLine));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
package com.gear.mes.dv.controller.mobile;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvCheckPlan;
|
||||
import com.gear.mes.dv.domain.DvCheckRecord;
|
||||
import com.gear.mes.dv.domain.DvCheckRecordLine;
|
||||
import com.gear.mes.dv.domain.DvCheckSubject;
|
||||
import com.gear.mes.dv.service.IDvCheckPlanService;
|
||||
import com.gear.mes.dv.service.IDvCheckRecordLineService;
|
||||
import com.gear.mes.dv.service.IDvCheckRecordService;
|
||||
import com.gear.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yinjinlu
|
||||
* @description
|
||||
* @date 2025/4/30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobile/dv/checkrecord")
|
||||
public class DvCheckRecordMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDvCheckRecordService dvCheckRecordService;
|
||||
|
||||
@Autowired
|
||||
private IDvCheckSubjectService dvCheckSubjectService;
|
||||
|
||||
@Autowired
|
||||
private IDvCheckRecordLineService dvCheckRecordLineService;
|
||||
|
||||
@Autowired
|
||||
private IDvCheckPlanService dvCheckPlanService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备点检记录列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
startPage();
|
||||
List<DvCheckRecord> list = dvCheckRecordService.selectDvCheckRecordList(dvCheckRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备点检记录详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(dvCheckRecordService.selectDvCheckRecordByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录", businessType = BusinessType.INSERT)
|
||||
@Transactional
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
dvCheckRecordService.insertDvCheckRecord(dvCheckRecord);
|
||||
//查找生效的点检方案,生成对应的行信息
|
||||
DvCheckPlan plan = dvCheckPlanService.selectDvCheckPlanByMachineryCodeAndType(dvCheckRecord.getMachineryCode(),UserConstants.DV_PLAN_TYPE_CHECK);
|
||||
|
||||
if(StringUtils.isNotNull(plan)){
|
||||
dvCheckRecord.setPlanId(plan.getPlanId());
|
||||
dvCheckRecord.setPlanCode(plan.getPlanCode());
|
||||
dvCheckRecord.setPlanName(plan.getPlanName());
|
||||
dvCheckRecord.setPlanType(plan.getPlanType());
|
||||
dvCheckRecordService.updateDvCheckRecord(dvCheckRecord);
|
||||
//根据选择的点检计划自动生成对应的行信息
|
||||
DvCheckSubject param = new DvCheckSubject();
|
||||
param.setPlanId(dvCheckRecord.getPlanId());
|
||||
List<DvCheckSubject> subjectList = dvCheckSubjectService.selectDvCheckSubjectList(param);
|
||||
if(!CollectionUtils.isEmpty(subjectList)){
|
||||
for(DvCheckSubject subject : subjectList){
|
||||
DvCheckRecordLine line = new DvCheckRecordLine();
|
||||
line.setRecordId(dvCheckRecord.getRecordId());
|
||||
line.setSubjectId(subject.getSubjectId());
|
||||
line.setSubjectCode(subject.getSubjectCode());
|
||||
line.setSubjectName(subject.getSubjectName());
|
||||
line.setSubjectType(subject.getSubjectType());
|
||||
line.setSubjectContent(subject.getSubjectContent());
|
||||
line.setSubjectStandard(subject.getSubjectStandard());
|
||||
line.setCheckStatus(UserConstants.DV_CHECK_STATUS_NOTCHECK);
|
||||
dvCheckRecordLineService.insertDvCheckRecordLine(line);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(dvCheckRecord);
|
||||
}else{
|
||||
return AjaxResult.error("当前设备未找到有效的点检方案,请先添加点检方案");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改设备点检记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录", businessType = BusinessType.UPDATE)
|
||||
@Transactional
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
if(UserConstants.ORDER_STATUS_FINISHED.equals(dvCheckRecord.getStatus())){
|
||||
DvCheckRecordLine param = new DvCheckRecordLine();
|
||||
param.setRecordId(dvCheckRecord.getRecordId());
|
||||
List<DvCheckRecordLine> lineList = dvCheckRecordLineService.selectDvCheckRecordLineList(param);
|
||||
if(CollectionUtils.isEmpty(lineList)){
|
||||
return R.fail("请添加设备点检项目结果信息");
|
||||
}
|
||||
}
|
||||
//如果设备不同则重新生成对应的点检行信息
|
||||
DvCheckRecord oldRecord = dvCheckRecordService.selectDvCheckRecordByRecordId(dvCheckRecord.getRecordId());
|
||||
if(!oldRecord.getMachineryCode().equals(dvCheckRecord.getMachineryCode())){
|
||||
dvCheckRecordLineService.deleteDvCheckRecordLineByRecordId(dvCheckRecord.getRecordId());
|
||||
DvCheckPlan plan = dvCheckPlanService.selectDvCheckPlanByMachineryCodeAndType(dvCheckRecord.getMachineryCode(),UserConstants.DV_PLAN_TYPE_CHECK);
|
||||
|
||||
if(StringUtils.isNotNull(plan)){
|
||||
dvCheckRecord.setPlanId(plan.getPlanId());
|
||||
dvCheckRecord.setPlanCode(plan.getPlanCode());
|
||||
dvCheckRecord.setPlanName(plan.getPlanName());
|
||||
dvCheckRecord.setPlanType(plan.getPlanType());
|
||||
dvCheckRecordService.updateDvCheckRecord(dvCheckRecord);
|
||||
//根据选择的点检计划自动生成对应的行信息
|
||||
DvCheckSubject param = new DvCheckSubject();
|
||||
param.setPlanId(dvCheckRecord.getPlanId());
|
||||
List<DvCheckSubject> subjectList = dvCheckSubjectService.selectDvCheckSubjectList(param);
|
||||
if(!CollectionUtils.isEmpty(subjectList)){
|
||||
for(DvCheckSubject subject : subjectList){
|
||||
DvCheckRecordLine line = new DvCheckRecordLine();
|
||||
line.setRecordId(dvCheckRecord.getRecordId());
|
||||
line.setSubjectId(subject.getSubjectId());
|
||||
line.setSubjectCode(subject.getSubjectCode());
|
||||
line.setSubjectName(subject.getSubjectName());
|
||||
line.setSubjectType(subject.getSubjectType());
|
||||
line.setSubjectContent(subject.getSubjectContent());
|
||||
line.setSubjectStandard(subject.getSubjectStandard());
|
||||
line.setCheckStatus(UserConstants.DV_CHECK_STATUS_NOTCHECK);
|
||||
dvCheckRecordLineService.insertDvCheckRecordLine(line);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
return R.fail("当前设备未找到有效的点检方案,请先添加点检方案");
|
||||
}
|
||||
}
|
||||
return toAjax(dvCheckRecordService.updateDvCheckRecord(dvCheckRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备点检记录", businessType = BusinessType.DELETE)
|
||||
@Transactional
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public R<Void> remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
|
||||
for(Long recordId : recordIds){
|
||||
dvCheckRecordLineService.deleteDvCheckRecordLineByRecordId(recordId);
|
||||
}
|
||||
|
||||
return toAjax(dvCheckRecordService.deleteDvCheckRecordByRecordIds(recordIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.controller.mobile;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.mes.dv.domain.DvMachinery;
|
||||
import com.gear.mes.dv.service.IDvMachineryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author yinjinlu
|
||||
* @description
|
||||
* @date 2025/4/30
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobile/dv/machinery")
|
||||
public class DvMachineryMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDvMachineryService dvMachineryService;
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvMachinery dvMachinery)
|
||||
{
|
||||
startPage();
|
||||
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(dvMachinery);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
|
||||
@Log(title = "设备", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody DvMachinery dvMachinery)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvMachineryService.checkRecptCodeUnique(dvMachinery))){
|
||||
return AjaxResult.error("编号已存在!");
|
||||
}
|
||||
return dvMachineryService.updateDvMachinery(dvMachinery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{machineryId}")
|
||||
public AjaxResult getInfo(@PathVariable("machineryId") Long machineryId)
|
||||
{
|
||||
return AjaxResult.success(dvMachineryService.selectDvMachineryByMachineryId(machineryId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.gear.mes.dv.controller.mobile;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.mes.dv.domain.DvMaintenRecordLine;
|
||||
import com.gear.mes.dv.service.IDvMaintenRecordLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录行Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobile/dv/maintenrecordline")
|
||||
public class DvMaintenRecordLineMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDvMaintenRecordLineService dvMaintenRecordLineService;
|
||||
|
||||
/**
|
||||
* 查询设备保养记录行列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(DvMaintenRecordLine dvMaintenRecordLine) {
|
||||
List<DvMaintenRecordLine> list = dvMaintenRecordLineService.selectDvMaintenRecordLineList(dvMaintenRecordLine);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备保养记录行详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{lineId}")
|
||||
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
|
||||
{
|
||||
return AjaxResult.success(dvMaintenRecordLineService.selectDvMaintenRecordLineByLineId(lineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备保养记录行
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录行", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvMaintenRecordLine dvMaintenRecordLine)
|
||||
{
|
||||
return toAjax(dvMaintenRecordLineService.updateDvMaintenRecordLine(dvMaintenRecordLine));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.gear.mes.dv.controller.mobile;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.mes.dv.domain.DvMaintenRecord;
|
||||
import com.gear.mes.dv.service.IDvMaintenRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2025-05-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobile/dv/maintenrecord")
|
||||
public class DvMaintenRecordMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDvMaintenRecordService dvMaintenRecordService;
|
||||
|
||||
/**
|
||||
* 查询设备保养记录列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
startPage();
|
||||
List<DvMaintenRecord> list = dvMaintenRecordService.selectDvMaintenRecordList(dvMaintenRecord);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备保养记录详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return AjaxResult.success(dvMaintenRecordService.selectDvMaintenRecordByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备保养记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
return toAjax(dvMaintenRecordService.insertDvMaintenRecord(dvMaintenRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备保养记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
return toAjax(dvMaintenRecordService.updateDvMaintenRecord(dvMaintenRecord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备保养记录
|
||||
*/
|
||||
|
||||
@Log(title = "设备保养记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public R<Void> remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(dvMaintenRecordService.deleteDvMaintenRecordByRecordIds(recordIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.gear.mes.dv.controller.mobile;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.mes.dv.domain.DvRepairLine;
|
||||
import com.gear.mes.dv.service.IDvRepairLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单行Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobile/dv/repairline")
|
||||
public class DvRepairLineMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDvRepairLineService dvRepairLineService;
|
||||
|
||||
/**
|
||||
* 查询设备维修单行列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(DvRepairLine dvRepairLine)
|
||||
{
|
||||
List<DvRepairLine> list = dvRepairLineService.selectDvRepairLineList(dvRepairLine);
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备维修单行详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{lineId}")
|
||||
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
|
||||
{
|
||||
return AjaxResult.success(dvRepairLineService.selectDvRepairLineByLineId(lineId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单行
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public R<Void> add(@RequestBody DvRepairLine dvRepairLine)
|
||||
{
|
||||
return toAjax(dvRepairLineService.insertDvRepairLine(dvRepairLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单行
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvRepairLine dvRepairLine)
|
||||
{
|
||||
return toAjax(dvRepairLineService.updateDvRepairLine(dvRepairLine));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单行
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单行", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{lineIds}")
|
||||
public R<Void> remove(@PathVariable Long[] lineIds)
|
||||
{
|
||||
return toAjax(dvRepairLineService.deleteDvRepairLineByLineIds(lineIds));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.gear.mes.dv.controller.mobile;
|
||||
|
||||
import com.gear.common.annotation.Log;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.controller.BaseController;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.core.domain.R;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.enums.BusinessType;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvRepair;
|
||||
import com.gear.mes.dv.service.IDvRepairService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 设备维修单Controller
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2025-05-06
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobile/dv/repair")
|
||||
public class DvRepairMobController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IDvRepairService dvRepairService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(DvRepair dvRepair)
|
||||
{
|
||||
startPage();
|
||||
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取设备维修单详细信息
|
||||
*/
|
||||
|
||||
@GetMapping(value = "/{repairId}")
|
||||
public AjaxResult getInfo(@PathVariable("repairId") Long repairId)
|
||||
{
|
||||
return AjaxResult.success(dvRepairService.selectDvRepairByRepairId(repairId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DvRepair dvRepair)
|
||||
{
|
||||
if(StringUtils.isNotNull(dvRepair.getRepairCode())){
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
|
||||
return AjaxResult.error("维修单编号已存!");
|
||||
}
|
||||
} else{
|
||||
dvRepair.setRepairCode("REPAIR-" + UUID.randomUUID().toString().replace("-", "").substring(0, 12).toUpperCase());
|
||||
}
|
||||
|
||||
//根据sourceDocType和sourceDocId 生成对应的维修单项目
|
||||
|
||||
dvRepairService.insertDvRepair(dvRepair);
|
||||
return AjaxResult.success(dvRepair);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public R<Void> edit(@RequestBody DvRepair dvRepair)
|
||||
{
|
||||
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
|
||||
return R.fail("维修单编号已存!");
|
||||
}
|
||||
return toAjax(dvRepairService.updateDvRepair(dvRepair));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单
|
||||
*/
|
||||
|
||||
@Log(title = "设备维修单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{repairIds}")
|
||||
public R<Void> remove(@PathVariable Long[] repairIds)
|
||||
{
|
||||
return toAjax(dvRepairService.deleteDvRepairByRepairIds(repairIds));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 点检设备对象 dv_check_machinery
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
@Data
|
||||
public class DvCheckMachinery extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流水号 */
|
||||
private Long recordId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private Long machineryId;
|
||||
|
||||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备点检计划头对象 dv_check_plan
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@Data
|
||||
public class DvCheckPlan extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 计划ID */
|
||||
private Long planId;
|
||||
|
||||
/** 计划编码 */
|
||||
@Excel(name = "计划编码")
|
||||
private String planCode;
|
||||
|
||||
/** 计划名称 */
|
||||
@Excel(name = "计划名称")
|
||||
private String planName;
|
||||
|
||||
private String planType;
|
||||
|
||||
/** 开始日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startDate;
|
||||
|
||||
/** 结束日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
/** 频率 */
|
||||
@Excel(name = "频率")
|
||||
private String cycleType;
|
||||
|
||||
/** 次数 */
|
||||
@Excel(name = "次数")
|
||||
private Long cycleCount;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备点检记录对象 dv_check_record
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@Data
|
||||
public class DvCheckRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 计划ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/** 计划编码 */
|
||||
@Excel(name = "计划编码")
|
||||
private String planCode;
|
||||
|
||||
/** 计划名称 */
|
||||
@Excel(name = "计划名称")
|
||||
private String planName;
|
||||
|
||||
/** 计划类型 */
|
||||
@Excel(name = "计划类型")
|
||||
private String planType;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private Long machineryId;
|
||||
|
||||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/** 点检时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
@Excel(name = "点检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date checkTime;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String nickName;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备点检记录行对象 dv_check_record_line
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@Data
|
||||
public class DvCheckRecordLine extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 计划ID */
|
||||
private Long lineId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long recordId;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
private Long subjectId;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 项目类型 */
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/** 项目内容 */
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/** 标准 */
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/** 点检结果 */
|
||||
@Excel(name = "点检结果")
|
||||
private String checkStatus;
|
||||
|
||||
/** 异常描述 */
|
||||
@Excel(name = "异常描述")
|
||||
private String checkResult;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 点检项目对象 dv_check_subject
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
@Data
|
||||
public class DvCheckSubject extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 流水号 */
|
||||
private Long recordId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private Long subjectId;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 项目类型 */
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/** 项目内容 */
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/** 标准 */
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备对象 dv_machinery
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@Data
|
||||
public class DvMachinery extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备类型ID */
|
||||
private Long machineryId;
|
||||
|
||||
/** 设备类型编码 */
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/** 设备类型名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/** 设备类型ID */
|
||||
@Excel(name = "设备类型ID")
|
||||
private Long machineryTypeId;
|
||||
|
||||
/** 设备类型编码 */
|
||||
@Excel(name = "设备类型编码")
|
||||
private String machineryTypeCode;
|
||||
|
||||
/** 设备类型名称 */
|
||||
@Excel(name = "设备类型名称")
|
||||
private String machineryTypeName;
|
||||
|
||||
/** 所属车间ID */
|
||||
@Excel(name = "所属车间ID")
|
||||
private Long workshopId;
|
||||
|
||||
/** 所属车间编码 */
|
||||
@Excel(name = "所属车间编码")
|
||||
private String workshopCode;
|
||||
|
||||
/** 所属车间名称 */
|
||||
@Excel(name = "所属车间名称")
|
||||
private String workshopName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
@Excel(name = "最近保养时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastMaintenTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
|
||||
@Excel(name = "最近点检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastCheckTime;
|
||||
|
||||
/** 设备状态 */
|
||||
@Excel(name = "设备状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.TreeEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备类型对象 dv_machinery_type
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@Data
|
||||
public class DvMachineryType extends TreeEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 设备类型ID */
|
||||
private Long machineryTypeId;
|
||||
|
||||
/** 设备类型编码 */
|
||||
@Excel(name = "设备类型编码")
|
||||
private String machineryTypeCode;
|
||||
|
||||
/** 设备类型名称 */
|
||||
@Excel(name = "设备类型名称")
|
||||
private String machineryTypeName;
|
||||
|
||||
/** 父类型ID */
|
||||
@Excel(name = "父类型ID")
|
||||
private Long parentTypeId;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
/** 祖级列表 */
|
||||
@TableField(exist = false)
|
||||
private String ancestors;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备保养记录对象 dv_mainten_record
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@Data
|
||||
public class DvMaintenRecord extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 计划ID */
|
||||
private Long recordId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long planId;
|
||||
|
||||
/** 计划编码 */
|
||||
@Excel(name = "计划编码")
|
||||
private String planCode;
|
||||
|
||||
/** 计划名称 */
|
||||
@Excel(name = "计划名称")
|
||||
private String planName;
|
||||
|
||||
/** 计划类型 */
|
||||
@Excel(name = "计划类型")
|
||||
private String planType;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private Long machineryId;
|
||||
|
||||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/** 保养时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "保养时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date maintenTime;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String userName;
|
||||
|
||||
/** 昵称 */
|
||||
@Excel(name = "昵称")
|
||||
private String nickName;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备保养记录行对象 dv_mainten_record_line
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@Data
|
||||
public class DvMaintenRecordLine extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 计划ID */
|
||||
private Long lineId;
|
||||
|
||||
/** 计划ID */
|
||||
@Excel(name = "计划ID")
|
||||
private Long recordId;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
private Long subjectId;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 项目类型 */
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/** 项目内容 */
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/** 标准 */
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/** 保养结果 */
|
||||
@Excel(name = "保养结果")
|
||||
private String maintenStatus;
|
||||
|
||||
/** 异常描述 */
|
||||
@Excel(name = "异常描述")
|
||||
private String maintenResult;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
|
||||
}
|
||||
116
gear-mes/src/main/java/com/gear/mes/dv/domain/DvRepair.java
Normal file
116
gear-mes/src/main/java/com/gear/mes/dv/domain/DvRepair.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 设备维修单对象 dv_repair
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
@Data
|
||||
public class DvRepair extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 维修单ID */
|
||||
private Long repairId;
|
||||
|
||||
/** 维修单编号 */
|
||||
@Excel(name = "维修单编号")
|
||||
private String repairCode;
|
||||
|
||||
/** 维修单名称 */
|
||||
@Excel(name = "维修单名称")
|
||||
private String repairName;
|
||||
|
||||
/** 设备ID */
|
||||
@Excel(name = "设备ID")
|
||||
private Long machineryId;
|
||||
|
||||
/** 设备编码 */
|
||||
@Excel(name = "设备编码")
|
||||
private String machineryCode;
|
||||
|
||||
/** 设备名称 */
|
||||
@Excel(name = "设备名称")
|
||||
private String machineryName;
|
||||
|
||||
/** 品牌 */
|
||||
@Excel(name = "品牌")
|
||||
private String machineryBrand;
|
||||
|
||||
/** 规格型号 */
|
||||
@Excel(name = "规格型号")
|
||||
private String machinerySpec;
|
||||
|
||||
/** 设备类型ID */
|
||||
@Excel(name = "设备类型ID")
|
||||
private Long machineryTypeId;
|
||||
|
||||
/** 报修日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "报修日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date requireDate;
|
||||
|
||||
/** 维修完成日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "维修完成日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date finishDate;
|
||||
|
||||
/** 验收日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "验收日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date confirmDate;
|
||||
|
||||
/** 维修结果 */
|
||||
@Excel(name = "维修结果")
|
||||
private String repairResult;
|
||||
|
||||
private Long acceptedId;
|
||||
|
||||
private String acceptedName;
|
||||
|
||||
/** 维修人员 */
|
||||
@Excel(name = "维修人员")
|
||||
private String acceptedBy;
|
||||
|
||||
private Long confirmId;
|
||||
|
||||
private String confirmName;
|
||||
/** 验收人员 */
|
||||
@Excel(name = "验收人员")
|
||||
private String confirmBy;
|
||||
|
||||
private String sourceDocType;
|
||||
|
||||
private Long sourceDocId;
|
||||
|
||||
private String sourceDocCode;
|
||||
|
||||
|
||||
/** 单据状态 */
|
||||
@Excel(name = "单据状态")
|
||||
private String status;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备维修单行对象 dv_repair_line
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
@Data
|
||||
public class DvRepairLine extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 行ID */
|
||||
private Long lineId;
|
||||
|
||||
/** 维修单ID */
|
||||
@Excel(name = "维修单ID")
|
||||
private Long repairId;
|
||||
|
||||
/** 项目ID */
|
||||
@Excel(name = "项目ID")
|
||||
private Long subjectId;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 项目类型 */
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/** 项目内容 */
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/** 标准 */
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/** 故障描述 */
|
||||
@Excel(name = "故障描述")
|
||||
private String malfunction;
|
||||
|
||||
/** 故障描述资源 */
|
||||
@Excel(name = "故障描述资源")
|
||||
private String malfunctionUrl;
|
||||
|
||||
/** 维修情况 */
|
||||
@Excel(name = "维修情况")
|
||||
private String repairDes;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)对象 dv_special_equipment
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("dv_special_equipment")
|
||||
public class DvSpecialEquipment extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@TableId(value = "equipment_id")
|
||||
private Long equipmentId;
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String equipmentCode;
|
||||
/**
|
||||
* 设备名称(如:锅炉、压力容器、压力管道、电梯、起重机械等)
|
||||
*/
|
||||
private String equipmentName;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specificationModel;
|
||||
/**
|
||||
* 制造单位
|
||||
*/
|
||||
private String manufacturer;
|
||||
/**
|
||||
* 制造日期
|
||||
*/
|
||||
private Date productionDate;
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
private Date installationDate;
|
||||
/**
|
||||
* 投入使用日期
|
||||
*/
|
||||
private Date useStartDate;
|
||||
/**
|
||||
* 特种设备注册编号
|
||||
*/
|
||||
private String registrationNo;
|
||||
/**
|
||||
* 安全负责人
|
||||
*/
|
||||
private String safetyManager;
|
||||
/**
|
||||
* 附件路径(多个附件用逗号分隔)
|
||||
*/
|
||||
private String attachment;
|
||||
/**
|
||||
* 检验周期(月)
|
||||
*/
|
||||
private Long inspectionCycle;
|
||||
/**
|
||||
* 上次检验时间
|
||||
*/
|
||||
private Date lastInspectionTime;
|
||||
/**
|
||||
* 下次检验时间
|
||||
*/
|
||||
private Date nextInspectionTime;
|
||||
/**
|
||||
* 当前状态(在用、停用、报废等)
|
||||
*/
|
||||
private String currentStatus;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 删除标志(0=正常,1=已删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
}
|
||||
59
gear-mes/src/main/java/com/gear/mes/dv/domain/DvSubject.java
Normal file
59
gear-mes/src/main/java/com/gear/mes/dv/domain/DvSubject.java
Normal file
@@ -0,0 +1,59 @@
|
||||
package com.gear.mes.dv.domain;
|
||||
|
||||
import com.gear.common.annotation.Excel;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目对象 dv_subject
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@Data
|
||||
public class DvSubject extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 项目ID */
|
||||
private Long subjectId;
|
||||
|
||||
/** 项目编码 */
|
||||
@Excel(name = "项目编码")
|
||||
private String subjectCode;
|
||||
|
||||
/** 项目名称 */
|
||||
@Excel(name = "项目名称")
|
||||
private String subjectName;
|
||||
|
||||
/** 项目类型 */
|
||||
@Excel(name = "项目类型")
|
||||
private String subjectType;
|
||||
|
||||
/** 项目内容 */
|
||||
@Excel(name = "项目内容")
|
||||
private String subjectContent;
|
||||
|
||||
/** 标准 */
|
||||
@Excel(name = "标准")
|
||||
private String subjectStandard;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
private String enableFlag;
|
||||
|
||||
/** 预留字段1 */
|
||||
private String attr1;
|
||||
|
||||
/** 预留字段2 */
|
||||
private String attr2;
|
||||
|
||||
/** 预留字段3 */
|
||||
private Long attr3;
|
||||
|
||||
/** 预留字段4 */
|
||||
private Long attr4;
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.gear.mes.dv.domain.bo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gear.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)业务对象 dv_special_equipment
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DvSpecialEquipmentBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String equipmentCode;
|
||||
|
||||
/**
|
||||
* 设备名称(如:锅炉、压力容器、压力管道、电梯、起重机械等)
|
||||
*/
|
||||
private String equipmentName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
private String specificationModel;
|
||||
|
||||
/**
|
||||
* 制造单位
|
||||
*/
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 制造日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date productionDate;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date installationDate;
|
||||
|
||||
/**
|
||||
* 投入使用日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date useStartDate;
|
||||
|
||||
/**
|
||||
* 特种设备注册编号
|
||||
*/
|
||||
private String registrationNo;
|
||||
|
||||
/**
|
||||
* 安全负责人
|
||||
*/
|
||||
private String safetyManager;
|
||||
|
||||
/**
|
||||
* 附件路径(多个附件用逗号分隔)
|
||||
*/
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 检验周期(月)
|
||||
*/
|
||||
private Long inspectionCycle;
|
||||
|
||||
/**
|
||||
* 上次检验时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastInspectionTime;
|
||||
|
||||
/**
|
||||
* 下次检验时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date nextInspectionTime;
|
||||
|
||||
/**
|
||||
* 当前状态(在用、停用、报废等)
|
||||
*/
|
||||
private String currentStatus;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.gear.mes.dv.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DvCheckPlanDTO {
|
||||
|
||||
private String planType;
|
||||
|
||||
private String machineryCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.gear.mes.dv.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DvRepairDTO {
|
||||
|
||||
private String machineryCode;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
package com.gear.mes.dv.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.gear.common.annotation.ExcelDictFormat;
|
||||
import com.gear.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)视图对象 dv_special_equipment
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DvSpecialEquipmentVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 设备ID
|
||||
*/
|
||||
@ExcelProperty(value = "设备ID")
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
@ExcelProperty(value = "设备编码")
|
||||
private String equipmentCode;
|
||||
|
||||
/**
|
||||
* 设备名称(如:锅炉、压力容器、压力管道、电梯、起重机械等)
|
||||
*/
|
||||
@ExcelProperty(value = "设备名称", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "如=:锅炉、压力容器、压力管道、电梯、起重机械等")
|
||||
private String equipmentName;
|
||||
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ExcelProperty(value = "规格型号")
|
||||
private String specificationModel;
|
||||
|
||||
/**
|
||||
* 制造单位
|
||||
*/
|
||||
@ExcelProperty(value = "制造单位")
|
||||
private String manufacturer;
|
||||
|
||||
/**
|
||||
* 制造日期
|
||||
*/
|
||||
@ExcelProperty(value = "制造日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date productionDate;
|
||||
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
@ExcelProperty(value = "安装日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date installationDate;
|
||||
|
||||
/**
|
||||
* 投入使用日期
|
||||
*/
|
||||
@ExcelProperty(value = "投入使用日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date useStartDate;
|
||||
|
||||
/**
|
||||
* 特种设备注册编号
|
||||
*/
|
||||
@ExcelProperty(value = "特种设备注册编号")
|
||||
private String registrationNo;
|
||||
|
||||
/**
|
||||
* 安全负责人
|
||||
*/
|
||||
@ExcelProperty(value = "安全负责人")
|
||||
private String safetyManager;
|
||||
|
||||
/**
|
||||
* 附件路径(多个附件用逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "附件路径", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "多=个附件用逗号分隔")
|
||||
private String attachment;
|
||||
|
||||
/**
|
||||
* 检验周期(月)
|
||||
*/
|
||||
@ExcelProperty(value = "检验周期", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "月=")
|
||||
private Long inspectionCycle;
|
||||
|
||||
/**
|
||||
* 上次检验时间
|
||||
*/
|
||||
@ExcelProperty(value = "上次检验时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastInspectionTime;
|
||||
|
||||
/**
|
||||
* 下次检验时间
|
||||
*/
|
||||
@ExcelProperty(value = "下次检验时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date nextInspectionTime;
|
||||
|
||||
/**
|
||||
* 当前状态(在用、停用、报废等)
|
||||
*/
|
||||
@ExcelProperty(value = "当前状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "在=用、停用、报废等")
|
||||
private String currentStatus;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckMachinery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检设备Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
public interface DvCheckMachineryMapper
|
||||
{
|
||||
/**
|
||||
* 查询点检设备
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 点检设备
|
||||
*/
|
||||
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检设备列表
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 点检设备集合
|
||||
*/
|
||||
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
public DvCheckMachinery checkMachineryUnique(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 新增点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 修改点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 删除点检设备
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除点检设备
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 根据计划头ID删除对应的设备列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 根据设备编码获取相关计划id
|
||||
* @param machineryCode
|
||||
* @return
|
||||
*/
|
||||
List<Long> getPlanId(@Param("machineryCode") String machineryCode);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckPlan;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public interface DvCheckPlanMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备点检计划头
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 设备点检计划头
|
||||
*/
|
||||
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头列表
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 设备点检计划头集合
|
||||
*/
|
||||
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan);
|
||||
|
||||
public DvCheckPlan checkPlanCodeUnique(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 新增设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 修改设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 删除设备点检计划头
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检计划头
|
||||
*
|
||||
* @param planIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanIds(Long[] planIds);
|
||||
|
||||
DvCheckPlan selectDvCheckPlanByMachineryCodeAndType(@Param("machineryCode") String machineryCode, @Param("planType") String planType);
|
||||
|
||||
List<DvCheckPlan> getByIds(@Param("planIds") List<Long> planIds,@Param("planType") String planType);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckRecordLine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检记录行Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
public interface DvCheckRecordLineMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备点检记录行
|
||||
*
|
||||
* @param lineId 设备点检记录行主键
|
||||
* @return 设备点检记录行
|
||||
*/
|
||||
public DvCheckRecordLine selectDvCheckRecordLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询设备点检记录行列表
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 设备点检记录行集合
|
||||
*/
|
||||
public List<DvCheckRecordLine> selectDvCheckRecordLineList(DvCheckRecordLine dvCheckRecordLine);
|
||||
|
||||
/**
|
||||
* 新增设备点检记录行
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine);
|
||||
|
||||
/**
|
||||
* 修改设备点检记录行
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine);
|
||||
|
||||
/**
|
||||
* 删除设备点检记录行
|
||||
*
|
||||
* @param lineId 设备点检记录行主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检记录行
|
||||
*
|
||||
* @param lineIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordLineByLineIds(Long[] lineIds);
|
||||
|
||||
/**
|
||||
* 根据记录ID删除设备点检记录行信息
|
||||
*
|
||||
* @param recordId 记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordLineByRecordId(Long recordId);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检记录Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
public interface DvCheckRecordMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备点检记录
|
||||
*
|
||||
* @param recordId 设备点检记录主键
|
||||
* @return 设备点检记录
|
||||
*/
|
||||
public DvCheckRecord selectDvCheckRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询设备点检记录列表
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 设备点检记录集合
|
||||
*/
|
||||
public List<DvCheckRecord> selectDvCheckRecordList(DvCheckRecord dvCheckRecord);
|
||||
|
||||
/**
|
||||
* 新增设备点检记录
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckRecord(DvCheckRecord dvCheckRecord);
|
||||
|
||||
/**
|
||||
* 修改设备点检记录
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckRecord(DvCheckRecord dvCheckRecord);
|
||||
|
||||
/**
|
||||
* 删除设备点检记录
|
||||
*
|
||||
* @param recordId 设备点检记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检记录
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordByRecordIds(Long[] recordIds);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckSubject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检项目Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
public interface DvCheckSubjectMapper
|
||||
{
|
||||
/**
|
||||
* 查询点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 点检项目
|
||||
*/
|
||||
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 点检项目集合
|
||||
*/
|
||||
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject);
|
||||
|
||||
|
||||
public DvCheckSubject checkSubjectUnique(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 删除点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除点检项目
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 根据计划ID删除对应的计划项目
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvMachinery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public interface DvMachineryMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 设备
|
||||
*/
|
||||
public DvMachinery selectDvMachineryByMachineryId(Long machineryId);
|
||||
|
||||
/**
|
||||
* 依据设备编码查询设备
|
||||
*
|
||||
* @param machineryCode 设备编码
|
||||
* @return 设备
|
||||
*/
|
||||
public List<DvMachinery> selectByMachineryCode(String machineryCode);
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 设备集合
|
||||
*/
|
||||
public List<DvMachinery> selectDvMachineryList(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMachinery(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMachinery(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryByMachineryId(Long machineryId);
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*
|
||||
* @param machineryIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryByMachineryIds(Long[] machineryIds);
|
||||
|
||||
DvMachinery checkRecptCodeUnique(DvMachinery dvMachinery);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvMachineryType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备类型Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public interface DvMachineryTypeMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备类型
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 设备类型
|
||||
*/
|
||||
public DvMachineryType selectDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
|
||||
|
||||
/**
|
||||
* 查询设备类型列表
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 设备类型集合
|
||||
*/
|
||||
public List<DvMachineryType> selectDvMachineryTypeList(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 新增设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMachineryType(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 修改设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMachineryType(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 删除设备类型
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
|
||||
|
||||
/**
|
||||
* 批量删除设备类型
|
||||
*
|
||||
* @param machineryTypeIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryTypeByMachineryTypeIds(Long[] machineryTypeIds);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvMaintenRecordLine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录行Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
public interface DvMaintenRecordLineMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备保养记录行
|
||||
*
|
||||
* @param lineId 设备保养记录行主键
|
||||
* @return 设备保养记录行
|
||||
*/
|
||||
public DvMaintenRecordLine selectDvMaintenRecordLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询设备保养记录行列表
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 设备保养记录行集合
|
||||
*/
|
||||
public List<DvMaintenRecordLine> selectDvMaintenRecordLineList(DvMaintenRecordLine dvMaintenRecordLine);
|
||||
|
||||
/**
|
||||
* 新增设备保养记录行
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine);
|
||||
|
||||
/**
|
||||
* 修改设备保养记录行
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine);
|
||||
|
||||
/**
|
||||
* 删除设备保养记录行
|
||||
*
|
||||
* @param lineId 设备保养记录行主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMaintenRecordLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 批量删除设备保养记录行
|
||||
*
|
||||
* @param lineIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMaintenRecordLineByLineIds(Long[] lineIds);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvMaintenRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
public interface DvMaintenRecordMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备保养记录
|
||||
*
|
||||
* @param recordId 设备保养记录主键
|
||||
* @return 设备保养记录
|
||||
*/
|
||||
public DvMaintenRecord selectDvMaintenRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询设备保养记录列表
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 设备保养记录集合
|
||||
*/
|
||||
public List<DvMaintenRecord> selectDvMaintenRecordList(DvMaintenRecord dvMaintenRecord);
|
||||
|
||||
/**
|
||||
* 新增设备保养记录
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMaintenRecord(DvMaintenRecord dvMaintenRecord);
|
||||
|
||||
/**
|
||||
* 修改设备保养记录
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMaintenRecord(DvMaintenRecord dvMaintenRecord);
|
||||
|
||||
/**
|
||||
* 删除设备保养记录
|
||||
*
|
||||
* @param recordId 设备保养记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMaintenRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除设备保养记录
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMaintenRecordByRecordIds(Long[] recordIds);
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvRepairLine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单行Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
public interface DvRepairLineMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单行
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 设备维修单行
|
||||
*/
|
||||
public DvRepairLine selectDvRepairLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单行列表
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 设备维修单行集合
|
||||
*/
|
||||
public List<DvRepairLine> selectDvRepairLineList(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 新增设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepairLine(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 修改设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepairLine(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 删除设备维修单行
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单行
|
||||
*
|
||||
* @param lineIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairLineByLineIds(Long[] lineIds);
|
||||
|
||||
public int deleteByRepairId(Long repairId);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvRepair;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
public interface DvRepairMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 设备维修单
|
||||
*/
|
||||
public DvRepair selectDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 设备维修单集合
|
||||
*/
|
||||
public List<DvRepair> selectDvRepairList(DvRepair dvRepair);
|
||||
|
||||
public DvRepair checkCodeUnique(DvRepair dvRepair);
|
||||
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 删除设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单
|
||||
*
|
||||
* @param repairIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds);
|
||||
|
||||
/**
|
||||
* 根据设备编码查询设备维修单列表
|
||||
*
|
||||
* @param machineryCode
|
||||
* @return
|
||||
*/
|
||||
List<DvRepair> getRepairList(@Param("machineryCode") String machineryCode);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.common.core.mapper.BaseMapperPlus;
|
||||
import com.gear.mes.dv.domain.DvSpecialEquipment;
|
||||
import com.gear.mes.dv.domain.vo.DvSpecialEquipmentVo;
|
||||
|
||||
/**
|
||||
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)Mapper接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
public interface DvSpecialEquipmentMapper extends BaseMapperPlus<DvSpecialEquipmentMapper, DvSpecialEquipment, DvSpecialEquipmentVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.gear.mes.dv.mapper;
|
||||
|
||||
import com.gear.mes.dv.domain.DvSubject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目Mapper接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public interface DvSubjectMapper
|
||||
{
|
||||
/**
|
||||
* 查询设备点检保养项目
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 设备点检保养项目
|
||||
*/
|
||||
public DvSubject selectDvSubjectBySubjectId(Long subjectId);
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目列表
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 设备点检保养项目集合
|
||||
*/
|
||||
public List<DvSubject> selectDvSubjectList(DvSubject dvSubject);
|
||||
|
||||
|
||||
public DvSubject checkSubjectCodeUnique(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 新增设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvSubject(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 修改设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvSubject(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 删除设备点检保养项目
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvSubjectBySubjectId(Long subjectId);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检保养项目
|
||||
*
|
||||
* @param subjectIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvSubjectBySubjectIds(Long[] subjectIds);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckMachinery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检设备Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
public interface IDvCheckMachineryService
|
||||
{
|
||||
/**
|
||||
* 查询点检设备
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 点检设备
|
||||
*/
|
||||
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检设备列表
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 点检设备集合
|
||||
*/
|
||||
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
public String checkMachineryUnique(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 新增点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 修改点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
|
||||
|
||||
/**
|
||||
* 批量删除点检设备
|
||||
*
|
||||
* @param recordIds 需要删除的点检设备主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除点检设备信息
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckMachineryByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 根据计划头ID删除对应的设备列表
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 根据设备编码获取相关计划id
|
||||
* @param machineryCode
|
||||
* @return
|
||||
*/
|
||||
List<Long> getPlanId(String machineryCode);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.mes.dv.domain.DvCheckPlan;
|
||||
import com.gear.mes.dv.domain.dto.DvCheckPlanDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public interface IDvCheckPlanService
|
||||
{
|
||||
/**
|
||||
* 查询设备点检计划头
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 设备点检计划头
|
||||
*/
|
||||
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头列表
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 设备点检计划头集合
|
||||
*/
|
||||
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 检查计划编码是否唯一
|
||||
* @param dvCheckPlan
|
||||
* @return
|
||||
*/
|
||||
public String checkPlanCodeUnique(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 新增设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 修改设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检计划头
|
||||
*
|
||||
* @param planIds 需要删除的设备点检计划头主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanIds(Long[] planIds);
|
||||
|
||||
/**
|
||||
* 删除设备点检计划头信息
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 根据设备编码和计划类型查询设备点检计划头列表
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO);
|
||||
|
||||
|
||||
public DvCheckPlan selectDvCheckPlanByMachineryCodeAndType(String machineryCode, String planType);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckRecordLine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检记录行Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
public interface IDvCheckRecordLineService
|
||||
{
|
||||
/**
|
||||
* 查询设备点检记录行
|
||||
*
|
||||
* @param lineId 设备点检记录行主键
|
||||
* @return 设备点检记录行
|
||||
*/
|
||||
public DvCheckRecordLine selectDvCheckRecordLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询设备点检记录行列表
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 设备点检记录行集合
|
||||
*/
|
||||
public List<DvCheckRecordLine> selectDvCheckRecordLineList(DvCheckRecordLine dvCheckRecordLine);
|
||||
|
||||
/**
|
||||
* 新增设备点检记录行
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine);
|
||||
|
||||
/**
|
||||
* 修改设备点检记录行
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检记录行
|
||||
*
|
||||
* @param lineIds 需要删除的设备点检记录行主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordLineByLineIds(Long[] lineIds);
|
||||
|
||||
/**
|
||||
* 删除设备点检记录行信息
|
||||
*
|
||||
* @param lineId 设备点检记录行主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 根据记录ID删除设备点检记录行信息
|
||||
*
|
||||
* @param recordId 记录ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordLineByRecordId(Long recordId);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检记录Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
public interface IDvCheckRecordService
|
||||
{
|
||||
/**
|
||||
* 查询设备点检记录
|
||||
*
|
||||
* @param recordId 设备点检记录主键
|
||||
* @return 设备点检记录
|
||||
*/
|
||||
public DvCheckRecord selectDvCheckRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询设备点检记录列表
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 设备点检记录集合
|
||||
*/
|
||||
public List<DvCheckRecord> selectDvCheckRecordList(DvCheckRecord dvCheckRecord);
|
||||
|
||||
/**
|
||||
* 新增设备点检记录
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckRecord(DvCheckRecord dvCheckRecord);
|
||||
|
||||
/**
|
||||
* 修改设备点检记录
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckRecord(DvCheckRecord dvCheckRecord);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检记录
|
||||
*
|
||||
* @param recordIds 需要删除的设备点检记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除设备点检记录信息
|
||||
*
|
||||
* @param recordId 设备点检记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckRecordByRecordId(Long recordId);
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvCheckSubject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检项目Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
public interface IDvCheckSubjectService
|
||||
{
|
||||
/**
|
||||
* 查询点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 点检项目
|
||||
*/
|
||||
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 点检项目集合
|
||||
*/
|
||||
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject);
|
||||
|
||||
|
||||
/**
|
||||
* 检查当前计划下,点检项目是否唯一
|
||||
* @param dvCheckSubject
|
||||
* @return
|
||||
*/
|
||||
public String checkSubjectUnique(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject);
|
||||
|
||||
/**
|
||||
* 批量删除点检项目
|
||||
*
|
||||
* @param recordIds 需要删除的点检项目主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除点检项目信息
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvCheckSubjectByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 根据计划ID删除对应的计划项目
|
||||
* @param planId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByPlanId(Long planId);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.mes.dv.domain.DvMachinery;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public interface IDvMachineryService
|
||||
{
|
||||
/**
|
||||
* 查询设备
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 设备
|
||||
*/
|
||||
public DvMachinery selectDvMachineryByMachineryId(Long machineryId);
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 设备集合
|
||||
*/
|
||||
public List<DvMachinery> selectDvMachineryList(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult insertDvMachinery(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
public AjaxResult updateDvMachinery(DvMachinery dvMachinery);
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*
|
||||
* @param machineryIds 需要删除的设备主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryByMachineryIds(Long[] machineryIds);
|
||||
|
||||
/**
|
||||
* 删除设备信息
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryByMachineryId(Long machineryId);
|
||||
|
||||
/**
|
||||
* 依据上传的文件,批量导入或更新设备信息
|
||||
*
|
||||
* @param machineryList 设备信息列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
public String importMachinery(List<DvMachinery> machineryList, Boolean isUpdateSupport, String operName);
|
||||
|
||||
/**
|
||||
* 查询编码是否唯一
|
||||
* @param dvMachinery
|
||||
* @return
|
||||
*/
|
||||
String checkRecptCodeUnique(DvMachinery dvMachinery);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvMachineryType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备类型Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
public interface IDvMachineryTypeService
|
||||
{
|
||||
/**
|
||||
* 查询设备类型
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 设备类型
|
||||
*/
|
||||
public DvMachineryType selectDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
|
||||
|
||||
/**
|
||||
* 查询设备类型列表
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 设备类型集合
|
||||
*/
|
||||
public List<DvMachineryType> selectDvMachineryTypeList(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 新增设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMachineryType(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 修改设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMachineryType(DvMachineryType dvMachineryType);
|
||||
|
||||
/**
|
||||
* 批量删除设备类型
|
||||
*
|
||||
* @param machineryTypeIds 需要删除的设备类型主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryTypeByMachineryTypeIds(Long[] machineryTypeIds);
|
||||
|
||||
/**
|
||||
* 删除设备类型信息
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvMaintenRecordLine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录行Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
public interface IDvMaintenRecordLineService
|
||||
{
|
||||
/**
|
||||
* 查询设备保养记录行
|
||||
*
|
||||
* @param lineId 设备保养记录行主键
|
||||
* @return 设备保养记录行
|
||||
*/
|
||||
public DvMaintenRecordLine selectDvMaintenRecordLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询设备保养记录行列表
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 设备保养记录行集合
|
||||
*/
|
||||
public List<DvMaintenRecordLine> selectDvMaintenRecordLineList(DvMaintenRecordLine dvMaintenRecordLine);
|
||||
|
||||
/**
|
||||
* 新增设备保养记录行
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine);
|
||||
|
||||
/**
|
||||
* 修改设备保养记录行
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine);
|
||||
|
||||
/**
|
||||
* 批量删除设备保养记录行
|
||||
*
|
||||
* @param lineIds 需要删除的设备保养记录行主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMaintenRecordLineByLineIds(Long[] lineIds);
|
||||
|
||||
/**
|
||||
* 删除设备保养记录行信息
|
||||
*
|
||||
* @param lineId 设备保养记录行主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMaintenRecordLineByLineId(Long lineId);
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvMaintenRecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
public interface IDvMaintenRecordService
|
||||
{
|
||||
/**
|
||||
* 查询设备保养记录
|
||||
*
|
||||
* @param recordId 设备保养记录主键
|
||||
* @return 设备保养记录
|
||||
*/
|
||||
public DvMaintenRecord selectDvMaintenRecordByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询设备保养记录列表
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 设备保养记录集合
|
||||
*/
|
||||
public List<DvMaintenRecord> selectDvMaintenRecordList(DvMaintenRecord dvMaintenRecord);
|
||||
|
||||
/**
|
||||
* 新增设备保养记录
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvMaintenRecord(DvMaintenRecord dvMaintenRecord);
|
||||
|
||||
/**
|
||||
* 修改设备保养记录
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvMaintenRecord(DvMaintenRecord dvMaintenRecord);
|
||||
|
||||
/**
|
||||
* 批量删除设备保养记录
|
||||
*
|
||||
* @param recordIds 需要删除的设备保养记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMaintenRecordByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除设备保养记录信息
|
||||
*
|
||||
* @param recordId 设备保养记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvMaintenRecordByRecordId(Long recordId);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvRepairLine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单行Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
public interface IDvRepairLineService
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单行
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 设备维修单行
|
||||
*/
|
||||
public DvRepairLine selectDvRepairLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单行列表
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 设备维修单行集合
|
||||
*/
|
||||
public List<DvRepairLine> selectDvRepairLineList(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 新增设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepairLine(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 修改设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepairLine(DvRepairLine dvRepairLine);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单行
|
||||
*
|
||||
* @param lineIds 需要删除的设备维修单行主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairLineByLineIds(Long[] lineIds);
|
||||
|
||||
/**
|
||||
* 删除设备维修单行信息
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairLineByLineId(Long lineId);
|
||||
|
||||
/**
|
||||
* 根据维修单头删除所有行信息
|
||||
* @param repairId
|
||||
* @return
|
||||
*/
|
||||
public int deleteByRepairId(Long repairId);
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.mes.dv.domain.DvRepair;
|
||||
import com.gear.mes.dv.domain.dto.DvRepairDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
public interface IDvRepairService
|
||||
{
|
||||
/**
|
||||
* 查询设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 设备维修单
|
||||
*/
|
||||
public DvRepair selectDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 设备维修单集合
|
||||
*/
|
||||
public List<DvRepair> selectDvRepairList(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 检测维修单编号是否唯一
|
||||
* @param dvRepair
|
||||
* @return
|
||||
*/
|
||||
public String checkCodeUnique(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvRepair(DvRepair dvRepair);
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单
|
||||
*
|
||||
* @param repairIds 需要删除的设备维修单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds);
|
||||
|
||||
/**
|
||||
* 删除设备维修单信息
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvRepairByRepairId(Long repairId);
|
||||
|
||||
/**
|
||||
* 根据设备编码查询设备维修单列表
|
||||
* @param repairDTO
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getRepairList(DvRepairDTO repairDTO);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.mes.dv.domain.bo.DvSpecialEquipmentBo;
|
||||
import com.gear.mes.dv.domain.vo.DvSpecialEquipmentVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)Service接口
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
public interface IDvSpecialEquipmentService {
|
||||
|
||||
/**
|
||||
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
DvSpecialEquipmentVo queryById(Long equipmentId);
|
||||
|
||||
/**
|
||||
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
|
||||
*/
|
||||
TableDataInfo<DvSpecialEquipmentVo> queryPageList(DvSpecialEquipmentBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
|
||||
*/
|
||||
List<DvSpecialEquipmentVo> queryList(DvSpecialEquipmentBo bo);
|
||||
|
||||
/**
|
||||
* 新增特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
Boolean insertByBo(DvSpecialEquipmentBo bo);
|
||||
|
||||
/**
|
||||
* 修改特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
Boolean updateByBo(DvSpecialEquipmentBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除特种设备(包含锅炉、压力管道、电梯等特种设备信息)信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gear.mes.dv.service;
|
||||
|
||||
import com.gear.mes.dv.domain.DvSubject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目Service接口
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
public interface IDvSubjectService
|
||||
{
|
||||
/**
|
||||
* 查询设备点检保养项目
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 设备点检保养项目
|
||||
*/
|
||||
public DvSubject selectDvSubjectBySubjectId(Long subjectId);
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目列表
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 设备点检保养项目集合
|
||||
*/
|
||||
public List<DvSubject> selectDvSubjectList(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 检查项目编码是否重复
|
||||
* @param dvSubject
|
||||
* @return
|
||||
*/
|
||||
public String checkSubjectCodeUnique(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 新增设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertDvSubject(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 修改设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDvSubject(DvSubject dvSubject);
|
||||
|
||||
/**
|
||||
* 批量删除设备点检保养项目
|
||||
*
|
||||
* @param subjectIds 需要删除的设备点检保养项目主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvSubjectBySubjectIds(Long[] subjectIds);
|
||||
|
||||
/**
|
||||
* 删除设备点检保养项目信息
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteDvSubjectBySubjectId(Long subjectId);
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvCheckMachinery;
|
||||
import com.gear.mes.dv.mapper.DvCheckMachineryMapper;
|
||||
import com.gear.mes.dv.service.IDvCheckMachineryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检设备Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-17
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckMachineryServiceImpl implements IDvCheckMachineryService
|
||||
{
|
||||
@Autowired
|
||||
private DvCheckMachineryMapper dvCheckMachineryMapper;
|
||||
|
||||
/**
|
||||
* 查询点检设备
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 点检设备
|
||||
*/
|
||||
@Override
|
||||
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId)
|
||||
{
|
||||
return dvCheckMachineryMapper.selectDvCheckMachineryByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询点检设备列表
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 点检设备
|
||||
*/
|
||||
@Override
|
||||
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery)
|
||||
{
|
||||
return dvCheckMachineryMapper.selectDvCheckMachineryList(dvCheckMachinery);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkMachineryUnique(DvCheckMachinery dvCheckMachinery) {
|
||||
DvCheckMachinery machinery = dvCheckMachineryMapper.checkMachineryUnique(dvCheckMachinery);
|
||||
Long recordId = dvCheckMachinery.getRecordId()==null?-1L:dvCheckMachinery.getRecordId();
|
||||
if(StringUtils.isNotNull(machinery) && machinery.getRecordId().longValue() != recordId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery)
|
||||
{
|
||||
dvCheckMachinery.setCreateTime(DateUtils.getNowDate());
|
||||
return dvCheckMachineryMapper.insertDvCheckMachinery(dvCheckMachinery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检设备
|
||||
*
|
||||
* @param dvCheckMachinery 点检设备
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery)
|
||||
{
|
||||
dvCheckMachinery.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvCheckMachineryMapper.updateDvCheckMachinery(dvCheckMachinery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除点检设备
|
||||
*
|
||||
* @param recordIds 需要删除的点检设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return dvCheckMachineryMapper.deleteDvCheckMachineryByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检设备信息
|
||||
*
|
||||
* @param recordId 点检设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckMachineryByRecordId(Long recordId)
|
||||
{
|
||||
return dvCheckMachineryMapper.deleteDvCheckMachineryByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPlanId(Long planId) {
|
||||
return dvCheckMachineryMapper.deleteByPlanId(planId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> getPlanId(String machineryCode) {
|
||||
return dvCheckMachineryMapper.getPlanId(machineryCode);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvCheckPlan;
|
||||
import com.gear.mes.dv.domain.dto.DvCheckPlanDTO;
|
||||
import com.gear.mes.dv.mapper.DvCheckPlanMapper;
|
||||
import com.gear.mes.dv.service.IDvCheckMachineryService;
|
||||
import com.gear.mes.dv.service.IDvCheckPlanService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检计划头Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckPlanServiceImpl implements IDvCheckPlanService
|
||||
{
|
||||
@Autowired
|
||||
private DvCheckPlanMapper dvCheckPlanMapper;
|
||||
|
||||
@Autowired
|
||||
private IDvCheckMachineryService dvCheckMachineryService;
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 设备点检计划头
|
||||
*/
|
||||
@Override
|
||||
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId)
|
||||
{
|
||||
return dvCheckPlanMapper.selectDvCheckPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备点检计划头列表
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 设备点检计划头
|
||||
*/
|
||||
@Override
|
||||
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan)
|
||||
{
|
||||
return dvCheckPlanMapper.selectDvCheckPlanList(dvCheckPlan);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkPlanCodeUnique(DvCheckPlan dvCheckPlan) {
|
||||
DvCheckPlan plan = dvCheckPlanMapper.checkPlanCodeUnique(dvCheckPlan);
|
||||
Long planId = dvCheckPlan.getPlanId()==null?-1L:dvCheckPlan.getPlanId();
|
||||
if(StringUtils.isNotNull(plan) && plan.getPlanId().longValue()!=planId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan)
|
||||
{
|
||||
dvCheckPlan.setCreateTime(DateUtils.getNowDate());
|
||||
return dvCheckPlanMapper.insertDvCheckPlan(dvCheckPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检计划头
|
||||
*
|
||||
* @param dvCheckPlan 设备点检计划头
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan)
|
||||
{
|
||||
dvCheckPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvCheckPlanMapper.updateDvCheckPlan(dvCheckPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备点检计划头
|
||||
*
|
||||
* @param planIds 需要删除的设备点检计划头主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckPlanByPlanIds(Long[] planIds)
|
||||
{
|
||||
return dvCheckPlanMapper.deleteDvCheckPlanByPlanIds(planIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检计划头信息
|
||||
*
|
||||
* @param planId 设备点检计划头主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckPlanByPlanId(Long planId)
|
||||
{
|
||||
return dvCheckPlanMapper.deleteDvCheckPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码和计划类型查询设备点检计划头列表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO) {
|
||||
// 根据设备编码获取相关计划id
|
||||
List<Long> planIds = dvCheckMachineryService.getPlanId(checkPlanDTO.getMachineryCode());
|
||||
if (planIds != null && planIds.size() > 0) {
|
||||
// 根据设备编码和计划类型获取相关设备点检计划头列表
|
||||
List<DvCheckPlan> list = dvCheckPlanMapper.getByIds(planIds, checkPlanDTO.getPlanType());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DvCheckPlan selectDvCheckPlanByMachineryCodeAndType(String machineryCode, String planType) {
|
||||
return dvCheckPlanMapper.selectDvCheckPlanByMachineryCodeAndType(machineryCode, planType);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.mes.dv.domain.DvCheckRecordLine;
|
||||
import com.gear.mes.dv.mapper.DvCheckRecordLineMapper;
|
||||
import com.gear.mes.dv.service.IDvCheckRecordLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检记录行Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckRecordLineServiceImpl implements IDvCheckRecordLineService
|
||||
{
|
||||
@Autowired
|
||||
private DvCheckRecordLineMapper dvCheckRecordLineMapper;
|
||||
|
||||
/**
|
||||
* 查询设备点检记录行
|
||||
*
|
||||
* @param lineId 设备点检记录行主键
|
||||
* @return 设备点检记录行
|
||||
*/
|
||||
@Override
|
||||
public DvCheckRecordLine selectDvCheckRecordLineByLineId(Long lineId)
|
||||
{
|
||||
return dvCheckRecordLineMapper.selectDvCheckRecordLineByLineId(lineId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备点检记录行列表
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 设备点检记录行
|
||||
*/
|
||||
@Override
|
||||
public List<DvCheckRecordLine> selectDvCheckRecordLineList(DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
return dvCheckRecordLineMapper.selectDvCheckRecordLineList(dvCheckRecordLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检记录行
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
dvCheckRecordLine.setCreateTime(DateUtils.getNowDate());
|
||||
return dvCheckRecordLineMapper.insertDvCheckRecordLine(dvCheckRecordLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检记录行
|
||||
*
|
||||
* @param dvCheckRecordLine 设备点检记录行
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine)
|
||||
{
|
||||
dvCheckRecordLine.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvCheckRecordLineMapper.updateDvCheckRecordLine(dvCheckRecordLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备点检记录行
|
||||
*
|
||||
* @param lineIds 需要删除的设备点检记录行主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckRecordLineByLineIds(Long[] lineIds)
|
||||
{
|
||||
return dvCheckRecordLineMapper.deleteDvCheckRecordLineByLineIds(lineIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检记录行信息
|
||||
*
|
||||
* @param lineId 设备点检记录行主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckRecordLineByLineId(Long lineId)
|
||||
{
|
||||
return dvCheckRecordLineMapper.deleteDvCheckRecordLineByLineId(lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteDvCheckRecordLineByRecordId(Long recordId) {
|
||||
return dvCheckRecordLineMapper.deleteDvCheckRecordLineByRecordId(recordId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.mes.dv.domain.DvCheckRecord;
|
||||
import com.gear.mes.dv.mapper.DvCheckRecordMapper;
|
||||
import com.gear.mes.dv.service.IDvCheckRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检记录Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckRecordServiceImpl implements IDvCheckRecordService
|
||||
{
|
||||
@Autowired
|
||||
private DvCheckRecordMapper dvCheckRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询设备点检记录
|
||||
*
|
||||
* @param recordId 设备点检记录主键
|
||||
* @return 设备点检记录
|
||||
*/
|
||||
@Override
|
||||
public DvCheckRecord selectDvCheckRecordByRecordId(Long recordId)
|
||||
{
|
||||
return dvCheckRecordMapper.selectDvCheckRecordByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备点检记录列表
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 设备点检记录
|
||||
*/
|
||||
@Override
|
||||
public List<DvCheckRecord> selectDvCheckRecordList(DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
return dvCheckRecordMapper.selectDvCheckRecordList(dvCheckRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检记录
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvCheckRecord(DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
dvCheckRecord.setCreateTime(DateUtils.getNowDate());
|
||||
return dvCheckRecordMapper.insertDvCheckRecord(dvCheckRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检记录
|
||||
*
|
||||
* @param dvCheckRecord 设备点检记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvCheckRecord(DvCheckRecord dvCheckRecord)
|
||||
{
|
||||
dvCheckRecord.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvCheckRecordMapper.updateDvCheckRecord(dvCheckRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备点检记录
|
||||
*
|
||||
* @param recordIds 需要删除的设备点检记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckRecordByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return dvCheckRecordMapper.deleteDvCheckRecordByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检记录信息
|
||||
*
|
||||
* @param recordId 设备点检记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckRecordByRecordId(Long recordId)
|
||||
{
|
||||
return dvCheckRecordMapper.deleteDvCheckRecordByRecordId(recordId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvCheckSubject;
|
||||
import com.gear.mes.dv.mapper.DvCheckSubjectMapper;
|
||||
import com.gear.mes.dv.service.IDvCheckSubjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 点检项目Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-18
|
||||
*/
|
||||
@Service
|
||||
public class DvCheckSubjectServiceImpl implements IDvCheckSubjectService
|
||||
{
|
||||
@Autowired
|
||||
private DvCheckSubjectMapper dvCheckSubjectMapper;
|
||||
|
||||
/**
|
||||
* 查询点检项目
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 点检项目
|
||||
*/
|
||||
@Override
|
||||
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId)
|
||||
{
|
||||
return dvCheckSubjectMapper.selectDvCheckSubjectByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询点检项目列表
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 点检项目
|
||||
*/
|
||||
@Override
|
||||
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
return dvCheckSubjectMapper.selectDvCheckSubjectList(dvCheckSubject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkSubjectUnique(DvCheckSubject dvCheckSubject) {
|
||||
DvCheckSubject subject = dvCheckSubjectMapper.checkSubjectUnique(dvCheckSubject);
|
||||
Long recordId = dvCheckSubject.getRecordId()==null?-1L:dvCheckSubject.getRecordId();
|
||||
if(StringUtils.isNotNull(subject) && subject.getRecordId().longValue() != recordId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
dvCheckSubject.setCreateTime(DateUtils.getNowDate());
|
||||
return dvCheckSubjectMapper.insertDvCheckSubject(dvCheckSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改点检项目
|
||||
*
|
||||
* @param dvCheckSubject 点检项目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject)
|
||||
{
|
||||
dvCheckSubject.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvCheckSubjectMapper.updateDvCheckSubject(dvCheckSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除点检项目
|
||||
*
|
||||
* @param recordIds 需要删除的点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除点检项目信息
|
||||
*
|
||||
* @param recordId 点检项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvCheckSubjectByRecordId(Long recordId)
|
||||
{
|
||||
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByPlanId(Long planId) {
|
||||
return dvCheckSubjectMapper.deleteByPlanId(planId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvMachinery;
|
||||
import com.gear.mes.dv.mapper.DvMachineryMapper;
|
||||
import com.gear.mes.dv.service.IDvMachineryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@Service
|
||||
public class DvMachineryServiceImpl implements IDvMachineryService
|
||||
{
|
||||
@Autowired
|
||||
private DvMachineryMapper dvMachineryMapper;
|
||||
|
||||
|
||||
// @Autowired
|
||||
// private WmBarCodeUtil wmBarCodeUtil;
|
||||
|
||||
/**
|
||||
* 查询设备
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 设备
|
||||
*/
|
||||
@Override
|
||||
public DvMachinery selectDvMachineryByMachineryId(Long machineryId)
|
||||
{
|
||||
return dvMachineryMapper.selectDvMachineryByMachineryId(machineryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 设备
|
||||
*/
|
||||
@Override
|
||||
public List<DvMachinery> selectDvMachineryList(DvMachinery dvMachinery)
|
||||
{
|
||||
return dvMachineryMapper.selectDvMachineryList(dvMachinery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult insertDvMachinery(DvMachinery dvMachinery)
|
||||
{
|
||||
List<DvMachinery> existing = dvMachineryMapper.selectByMachineryCode(dvMachinery.getMachineryCode());
|
||||
if (existing != null && existing.size() > 0) {
|
||||
return AjaxResult.error("设备编码重复");
|
||||
}
|
||||
dvMachinery.setCreateTime(DateUtils.getNowDate());
|
||||
dvMachineryMapper.insertDvMachinery(dvMachinery);
|
||||
// wmBarCodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_MACHINERY,dvMachinery.getMachineryId(),dvMachinery.getMachineryCode(),dvMachinery.getMachineryName());
|
||||
return AjaxResult.success("操作成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*
|
||||
* @param dvMachinery 设备
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult updateDvMachinery(DvMachinery dvMachinery)
|
||||
{
|
||||
dvMachinery.setUpdateTime(DateUtils.getNowDate());
|
||||
return AjaxResult.success(dvMachineryMapper.updateDvMachinery(dvMachinery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*
|
||||
* @param machineryIds 需要删除的设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvMachineryByMachineryIds(Long[] machineryIds)
|
||||
{
|
||||
return dvMachineryMapper.deleteDvMachineryByMachineryIds(machineryIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备信息
|
||||
*
|
||||
* @param machineryId 设备主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvMachineryByMachineryId(Long machineryId)
|
||||
{
|
||||
return dvMachineryMapper.deleteDvMachineryByMachineryId(machineryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 依据上传的文件更新或插入设备信息
|
||||
*/
|
||||
@Override
|
||||
public String importMachinery(List<DvMachinery> machineryList, Boolean isUpdateSupport, String operName) {
|
||||
if (machineryList == null || machineryList.isEmpty()) {
|
||||
return "导入数据为空";
|
||||
}
|
||||
int successCount = 0;
|
||||
int failureCount = 0;
|
||||
for (DvMachinery machinery : machineryList) {
|
||||
// 判断必填项是否为空
|
||||
if (ObjectUtil.isEmpty(machinery.getMachineryCode())) {
|
||||
failureCount++;
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(machinery.getMachineryName())) {
|
||||
failureCount++;
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(machinery.getMachineryTypeId())) {
|
||||
failureCount++;
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(machinery.getWorkshopId())) {
|
||||
failureCount++;
|
||||
continue;
|
||||
}
|
||||
if (ObjectUtil.isEmpty(machinery.getStatus())) {
|
||||
failureCount++;
|
||||
continue;
|
||||
}
|
||||
// 去除空格
|
||||
String machineryCode = machinery.getMachineryCode().trim();
|
||||
machinery.setCreateTime(new Date());
|
||||
List<DvMachinery> existing = dvMachineryMapper.selectByMachineryCode(machineryCode);
|
||||
if (existing != null && existing.size() > 0) {
|
||||
if (isUpdateSupport) {
|
||||
// 更新数据
|
||||
machinery.setMachineryId(existing.get(0).getMachineryId()); // 确保使用现有 ID 进行更新
|
||||
dvMachineryMapper.updateDvMachinery(machinery);
|
||||
successCount++;
|
||||
} else {
|
||||
// 不更新数据
|
||||
failureCount++;
|
||||
}
|
||||
} else {
|
||||
// 新增数据
|
||||
dvMachineryMapper.insertDvMachinery(machinery);
|
||||
successCount++;
|
||||
}
|
||||
}
|
||||
return String.format("操作用户:%s,导入完成,成功 %d 条,失败 %d 条。", operName, successCount, failureCount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkRecptCodeUnique(DvMachinery dvMachinery) {
|
||||
DvMachinery machinery = dvMachineryMapper.checkRecptCodeUnique(dvMachinery);
|
||||
Long machineryId = dvMachinery.getMachineryId() == null ? -1L : dvMachinery.getMachineryId();
|
||||
if (StringUtils.isNotNull(machinery) && machinery.getMachineryId().longValue() != machineryId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvMachineryType;
|
||||
import com.gear.mes.dv.mapper.DvMachineryTypeMapper;
|
||||
import com.gear.mes.dv.service.IDvMachineryTypeService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备类型Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-05-08
|
||||
*/
|
||||
@Service
|
||||
public class DvMachineryTypeServiceImpl implements IDvMachineryTypeService
|
||||
{
|
||||
@Autowired
|
||||
private DvMachineryTypeMapper dvMachineryTypeMapper;
|
||||
|
||||
/**
|
||||
* 查询设备类型
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 设备类型
|
||||
*/
|
||||
@Override
|
||||
public DvMachineryType selectDvMachineryTypeByMachineryTypeId(Long machineryTypeId)
|
||||
{
|
||||
return dvMachineryTypeMapper.selectDvMachineryTypeByMachineryTypeId(machineryTypeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备类型列表
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 设备类型
|
||||
*/
|
||||
@Override
|
||||
public List<DvMachineryType> selectDvMachineryTypeList(DvMachineryType dvMachineryType)
|
||||
{
|
||||
return dvMachineryTypeMapper.selectDvMachineryTypeList(dvMachineryType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvMachineryType(DvMachineryType dvMachineryType)
|
||||
{
|
||||
if(dvMachineryType.getParentTypeId()!= null){
|
||||
DvMachineryType parent = dvMachineryTypeMapper.selectDvMachineryTypeByMachineryTypeId(dvMachineryType.getParentTypeId());
|
||||
if(StringUtils.isNotNull(parent)){
|
||||
dvMachineryType.setAncestors(parent.getAncestors()+","+parent.getMachineryTypeId());
|
||||
}
|
||||
}
|
||||
dvMachineryType.setCreateTime(DateUtils.getNowDate());
|
||||
return dvMachineryTypeMapper.insertDvMachineryType(dvMachineryType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备类型
|
||||
*
|
||||
* @param dvMachineryType 设备类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvMachineryType(DvMachineryType dvMachineryType)
|
||||
{
|
||||
dvMachineryType.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvMachineryTypeMapper.updateDvMachineryType(dvMachineryType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备类型
|
||||
*
|
||||
* @param machineryTypeIds 需要删除的设备类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvMachineryTypeByMachineryTypeIds(Long[] machineryTypeIds)
|
||||
{
|
||||
return dvMachineryTypeMapper.deleteDvMachineryTypeByMachineryTypeIds(machineryTypeIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备类型信息
|
||||
*
|
||||
* @param machineryTypeId 设备类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvMachineryTypeByMachineryTypeId(Long machineryTypeId)
|
||||
{
|
||||
return dvMachineryTypeMapper.deleteDvMachineryTypeByMachineryTypeId(machineryTypeId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.mes.dv.domain.DvMaintenRecordLine;
|
||||
import com.gear.mes.dv.mapper.DvMaintenRecordLineMapper;
|
||||
import com.gear.mes.dv.service.IDvMaintenRecordLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录行Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@Service
|
||||
public class DvMaintenRecordLineServiceImpl implements IDvMaintenRecordLineService
|
||||
{
|
||||
@Autowired
|
||||
private DvMaintenRecordLineMapper dvMaintenRecordLineMapper;
|
||||
|
||||
/**
|
||||
* 查询设备保养记录行
|
||||
*
|
||||
* @param lineId 设备保养记录行主键
|
||||
* @return 设备保养记录行
|
||||
*/
|
||||
@Override
|
||||
public DvMaintenRecordLine selectDvMaintenRecordLineByLineId(Long lineId)
|
||||
{
|
||||
return dvMaintenRecordLineMapper.selectDvMaintenRecordLineByLineId(lineId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备保养记录行列表
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 设备保养记录行
|
||||
*/
|
||||
@Override
|
||||
public List<DvMaintenRecordLine> selectDvMaintenRecordLineList(DvMaintenRecordLine dvMaintenRecordLine)
|
||||
{
|
||||
return dvMaintenRecordLineMapper.selectDvMaintenRecordLineList(dvMaintenRecordLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备保养记录行
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine)
|
||||
{
|
||||
dvMaintenRecordLine.setCreateTime(DateUtils.getNowDate());
|
||||
return dvMaintenRecordLineMapper.insertDvMaintenRecordLine(dvMaintenRecordLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备保养记录行
|
||||
*
|
||||
* @param dvMaintenRecordLine 设备保养记录行
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine)
|
||||
{
|
||||
dvMaintenRecordLine.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvMaintenRecordLineMapper.updateDvMaintenRecordLine(dvMaintenRecordLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备保养记录行
|
||||
*
|
||||
* @param lineIds 需要删除的设备保养记录行主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvMaintenRecordLineByLineIds(Long[] lineIds)
|
||||
{
|
||||
return dvMaintenRecordLineMapper.deleteDvMaintenRecordLineByLineIds(lineIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备保养记录行信息
|
||||
*
|
||||
* @param lineId 设备保养记录行主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvMaintenRecordLineByLineId(Long lineId)
|
||||
{
|
||||
return dvMaintenRecordLineMapper.deleteDvMaintenRecordLineByLineId(lineId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.mes.dv.domain.DvMaintenRecord;
|
||||
import com.gear.mes.dv.mapper.DvMaintenRecordMapper;
|
||||
import com.gear.mes.dv.service.IDvMaintenRecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备保养记录Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2024-12-26
|
||||
*/
|
||||
@Service
|
||||
public class DvMaintenRecordServiceImpl implements IDvMaintenRecordService
|
||||
{
|
||||
@Autowired
|
||||
private DvMaintenRecordMapper dvMaintenRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询设备保养记录
|
||||
*
|
||||
* @param recordId 设备保养记录主键
|
||||
* @return 设备保养记录
|
||||
*/
|
||||
@Override
|
||||
public DvMaintenRecord selectDvMaintenRecordByRecordId(Long recordId)
|
||||
{
|
||||
return dvMaintenRecordMapper.selectDvMaintenRecordByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备保养记录列表
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 设备保养记录
|
||||
*/
|
||||
@Override
|
||||
public List<DvMaintenRecord> selectDvMaintenRecordList(DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
return dvMaintenRecordMapper.selectDvMaintenRecordList(dvMaintenRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备保养记录
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvMaintenRecord(DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
dvMaintenRecord.setCreateTime(DateUtils.getNowDate());
|
||||
return dvMaintenRecordMapper.insertDvMaintenRecord(dvMaintenRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备保养记录
|
||||
*
|
||||
* @param dvMaintenRecord 设备保养记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvMaintenRecord(DvMaintenRecord dvMaintenRecord)
|
||||
{
|
||||
dvMaintenRecord.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvMaintenRecordMapper.updateDvMaintenRecord(dvMaintenRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备保养记录
|
||||
*
|
||||
* @param recordIds 需要删除的设备保养记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvMaintenRecordByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return dvMaintenRecordMapper.deleteDvMaintenRecordByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备保养记录信息
|
||||
*
|
||||
* @param recordId 设备保养记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvMaintenRecordByRecordId(Long recordId)
|
||||
{
|
||||
return dvMaintenRecordMapper.deleteDvMaintenRecordByRecordId(recordId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.mes.dv.domain.DvRepairLine;
|
||||
import com.gear.mes.dv.mapper.DvRepairLineMapper;
|
||||
import com.gear.mes.dv.service.IDvRepairLineService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单行Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-08
|
||||
*/
|
||||
@Service
|
||||
public class DvRepairLineServiceImpl implements IDvRepairLineService
|
||||
{
|
||||
@Autowired
|
||||
private DvRepairLineMapper dvRepairLineMapper;
|
||||
|
||||
/**
|
||||
* 查询设备维修单行
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 设备维修单行
|
||||
*/
|
||||
@Override
|
||||
public DvRepairLine selectDvRepairLineByLineId(Long lineId)
|
||||
{
|
||||
return dvRepairLineMapper.selectDvRepairLineByLineId(lineId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备维修单行列表
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 设备维修单行
|
||||
*/
|
||||
@Override
|
||||
public List<DvRepairLine> selectDvRepairLineList(DvRepairLine dvRepairLine)
|
||||
{
|
||||
return dvRepairLineMapper.selectDvRepairLineList(dvRepairLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvRepairLine(DvRepairLine dvRepairLine)
|
||||
{
|
||||
dvRepairLine.setCreateTime(DateUtils.getNowDate());
|
||||
return dvRepairLineMapper.insertDvRepairLine(dvRepairLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单行
|
||||
*
|
||||
* @param dvRepairLine 设备维修单行
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvRepairLine(DvRepairLine dvRepairLine)
|
||||
{
|
||||
dvRepairLine.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvRepairLineMapper.updateDvRepairLine(dvRepairLine);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单行
|
||||
*
|
||||
* @param lineIds 需要删除的设备维修单行主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvRepairLineByLineIds(Long[] lineIds)
|
||||
{
|
||||
return dvRepairLineMapper.deleteDvRepairLineByLineIds(lineIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单行信息
|
||||
*
|
||||
* @param lineId 设备维修单行主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvRepairLineByLineId(Long lineId)
|
||||
{
|
||||
return dvRepairLineMapper.deleteDvRepairLineByLineId(lineId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByRepairId(Long repairId) {
|
||||
return dvRepairLineMapper.deleteByRepairId(repairId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.core.domain.AjaxResult;
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvRepair;
|
||||
import com.gear.mes.dv.domain.dto.DvRepairDTO;
|
||||
import com.gear.mes.dv.mapper.DvRepairMapper;
|
||||
import com.gear.mes.dv.service.IDvRepairService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备维修单Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-08-06
|
||||
*/
|
||||
@Service
|
||||
public class DvRepairServiceImpl implements IDvRepairService
|
||||
{
|
||||
@Autowired
|
||||
private DvRepairMapper dvRepairMapper;
|
||||
|
||||
/**
|
||||
* 查询设备维修单
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 设备维修单
|
||||
*/
|
||||
@Override
|
||||
public DvRepair selectDvRepairByRepairId(Long repairId)
|
||||
{
|
||||
return dvRepairMapper.selectDvRepairByRepairId(repairId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备维修单列表
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 设备维修单
|
||||
*/
|
||||
@Override
|
||||
public List<DvRepair> selectDvRepairList(DvRepair dvRepair)
|
||||
{
|
||||
return dvRepairMapper.selectDvRepairList(dvRepair);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkCodeUnique(DvRepair dvRepair) {
|
||||
DvRepair rp = dvRepairMapper.checkCodeUnique(dvRepair);
|
||||
Long repairId = dvRepair.getRepairId() ==null?-1L: dvRepair.getRepairId();
|
||||
if(StringUtils.isNotNull(rp) && repairId.longValue() != rp.getRepairId().longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvRepair(DvRepair dvRepair)
|
||||
{
|
||||
dvRepair.setCreateTime(DateUtils.getNowDate());
|
||||
return dvRepairMapper.insertDvRepair(dvRepair);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备维修单
|
||||
*
|
||||
* @param dvRepair 设备维修单
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvRepair(DvRepair dvRepair)
|
||||
{
|
||||
dvRepair.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvRepairMapper.updateDvRepair(dvRepair);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备维修单
|
||||
*
|
||||
* @param repairIds 需要删除的设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvRepairByRepairIds(Long[] repairIds)
|
||||
{
|
||||
return dvRepairMapper.deleteDvRepairByRepairIds(repairIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备维修单信息
|
||||
*
|
||||
* @param repairId 设备维修单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvRepairByRepairId(Long repairId)
|
||||
{
|
||||
return dvRepairMapper.deleteDvRepairByRepairId(repairId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备编码查询设备维修单列表
|
||||
* @param repairDTO
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AjaxResult getRepairList(DvRepairDTO repairDTO) {
|
||||
List<DvRepair> list = dvRepairMapper.getRepairList(repairDTO.getMachineryCode());
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.gear.common.core.domain.PageQuery;
|
||||
import com.gear.common.core.page.TableDataInfo;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvSpecialEquipment;
|
||||
import com.gear.mes.dv.domain.bo.DvSpecialEquipmentBo;
|
||||
import com.gear.mes.dv.domain.vo.DvSpecialEquipmentVo;
|
||||
import com.gear.mes.dv.mapper.DvSpecialEquipmentMapper;
|
||||
import com.gear.mes.dv.service.IDvSpecialEquipmentService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)Service业务层处理
|
||||
*
|
||||
* @author klp
|
||||
* @date 2025-08-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DvSpecialEquipmentServiceImpl implements IDvSpecialEquipmentService {
|
||||
|
||||
private final DvSpecialEquipmentMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
@Override
|
||||
public DvSpecialEquipmentVo queryById(Long equipmentId){
|
||||
return baseMapper.selectVoById(equipmentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DvSpecialEquipmentVo> queryPageList(DvSpecialEquipmentBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<DvSpecialEquipment> lqw = buildQueryWrapper(bo);
|
||||
Page<DvSpecialEquipmentVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
|
||||
*/
|
||||
@Override
|
||||
public List<DvSpecialEquipmentVo> queryList(DvSpecialEquipmentBo bo) {
|
||||
LambdaQueryWrapper<DvSpecialEquipment> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<DvSpecialEquipment> buildQueryWrapper(DvSpecialEquipmentBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<DvSpecialEquipment> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEquipmentCode()), DvSpecialEquipment::getEquipmentCode, bo.getEquipmentCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getEquipmentName()), DvSpecialEquipment::getEquipmentName, bo.getEquipmentName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSpecificationModel()), DvSpecialEquipment::getSpecificationModel, bo.getSpecificationModel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getManufacturer()), DvSpecialEquipment::getManufacturer, bo.getManufacturer());
|
||||
lqw.eq(bo.getProductionDate() != null, DvSpecialEquipment::getProductionDate, bo.getProductionDate());
|
||||
lqw.eq(bo.getInstallationDate() != null, DvSpecialEquipment::getInstallationDate, bo.getInstallationDate());
|
||||
lqw.eq(bo.getUseStartDate() != null, DvSpecialEquipment::getUseStartDate, bo.getUseStartDate());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRegistrationNo()), DvSpecialEquipment::getRegistrationNo, bo.getRegistrationNo());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSafetyManager()), DvSpecialEquipment::getSafetyManager, bo.getSafetyManager());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAttachment()), DvSpecialEquipment::getAttachment, bo.getAttachment());
|
||||
lqw.eq(bo.getInspectionCycle() != null, DvSpecialEquipment::getInspectionCycle, bo.getInspectionCycle());
|
||||
lqw.eq(bo.getLastInspectionTime() != null, DvSpecialEquipment::getLastInspectionTime, bo.getLastInspectionTime());
|
||||
lqw.eq(bo.getNextInspectionTime() != null, DvSpecialEquipment::getNextInspectionTime, bo.getNextInspectionTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCurrentStatus()), DvSpecialEquipment::getCurrentStatus, bo.getCurrentStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DvSpecialEquipmentBo bo) {
|
||||
DvSpecialEquipment add = BeanUtil.toBean(bo, DvSpecialEquipment.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setEquipmentId(add.getEquipmentId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DvSpecialEquipmentBo bo) {
|
||||
DvSpecialEquipment update = BeanUtil.toBean(bo, DvSpecialEquipment.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DvSpecialEquipment entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除特种设备(包含锅炉、压力管道、电梯等特种设备信息)
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.gear.mes.dv.service.impl;
|
||||
|
||||
import com.gear.common.constant.UserConstants;
|
||||
import com.gear.common.utils.DateUtils;
|
||||
import com.gear.common.utils.StringUtils;
|
||||
import com.gear.mes.dv.domain.DvSubject;
|
||||
import com.gear.mes.dv.mapper.DvSubjectMapper;
|
||||
import com.gear.mes.dv.service.IDvSubjectService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 设备点检保养项目Service业务层处理
|
||||
*
|
||||
* @author yinjinlu
|
||||
* @date 2022-06-16
|
||||
*/
|
||||
@Service
|
||||
public class DvSubjectServiceImpl implements IDvSubjectService
|
||||
{
|
||||
@Autowired
|
||||
private DvSubjectMapper dvSubjectMapper;
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 设备点检保养项目
|
||||
*/
|
||||
@Override
|
||||
public DvSubject selectDvSubjectBySubjectId(Long subjectId)
|
||||
{
|
||||
return dvSubjectMapper.selectDvSubjectBySubjectId(subjectId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备点检保养项目列表
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 设备点检保养项目
|
||||
*/
|
||||
@Override
|
||||
public List<DvSubject> selectDvSubjectList(DvSubject dvSubject)
|
||||
{
|
||||
return dvSubjectMapper.selectDvSubjectList(dvSubject);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String checkSubjectCodeUnique(DvSubject dvSubject) {
|
||||
DvSubject subject = dvSubjectMapper.checkSubjectCodeUnique(dvSubject);
|
||||
Long subjectId = dvSubject.getSubjectId()==null?-1L:dvSubject.getSubjectId();
|
||||
if(StringUtils.isNotNull(subject) && subject.getSubjectId().longValue() != subjectId.longValue()){
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDvSubject(DvSubject dvSubject)
|
||||
{
|
||||
dvSubject.setCreateTime(DateUtils.getNowDate());
|
||||
return dvSubjectMapper.insertDvSubject(dvSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备点检保养项目
|
||||
*
|
||||
* @param dvSubject 设备点检保养项目
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDvSubject(DvSubject dvSubject)
|
||||
{
|
||||
dvSubject.setUpdateTime(DateUtils.getNowDate());
|
||||
return dvSubjectMapper.updateDvSubject(dvSubject);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备点检保养项目
|
||||
*
|
||||
* @param subjectIds 需要删除的设备点检保养项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvSubjectBySubjectIds(Long[] subjectIds)
|
||||
{
|
||||
return dvSubjectMapper.deleteDvSubjectBySubjectIds(subjectIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备点检保养项目信息
|
||||
*
|
||||
* @param subjectId 设备点检保养项目主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDvSubjectBySubjectId(Long subjectId)
|
||||
{
|
||||
return dvSubjectMapper.deleteDvSubjectBySubjectId(subjectId);
|
||||
}
|
||||
}
|
||||
138
gear-mes/src/main/resources/mapper/dv/DvCheckMachineryMapper.xml
Normal file
138
gear-mes/src/main/resources/mapper/dv/DvCheckMachineryMapper.xml
Normal file
@@ -0,0 +1,138 @@
|
||||
<?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.gear.mes.dv.mapper.DvCheckMachineryMapper">
|
||||
|
||||
<resultMap type="DvCheckMachinery" id="DvCheckMachineryResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="machineryId" column="machinery_id" />
|
||||
<result property="machineryCode" column="machinery_code" />
|
||||
<result property="machineryName" column="machinery_name" />
|
||||
<result property="machineryBrand" column="machinery_brand" />
|
||||
<result property="machinerySpec" column="machinery_spec" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDvCheckMachineryVo">
|
||||
select record_id, plan_id, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_machinery
|
||||
</sql>
|
||||
|
||||
<select id="selectDvCheckMachineryList" parameterType="DvCheckMachinery" resultMap="DvCheckMachineryResult">
|
||||
<include refid="selectDvCheckMachineryVo"/>
|
||||
<where>
|
||||
<if test="planId != null "> and plan_id = #{planId}</if>
|
||||
<if test="machineryId != null "> and machinery_id = #{machineryId}</if>
|
||||
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
|
||||
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
|
||||
<if test="machineryBrand != null and machineryBrand != ''"> and machinery_brand = #{machineryBrand}</if>
|
||||
<if test="machinerySpec != null and machinerySpec != ''"> and machinery_spec = #{machinerySpec}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDvCheckMachineryByRecordId" parameterType="Long" resultMap="DvCheckMachineryResult">
|
||||
<include refid="selectDvCheckMachineryVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<select id="checkMachineryUnique" parameterType="DvCheckMachinery" resultMap="DvCheckMachineryResult">
|
||||
select record_id, cm.plan_id, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, cm.remark, cm.attr1, cm.attr2, cm.attr3, cm.attr4, cm.create_by, cm.create_time, cm.update_by, cm.update_time
|
||||
from dv_check_machinery cm
|
||||
left join dv_check_plan cp
|
||||
on cm.plan_id = cp.plan_id
|
||||
where cm.machinery_id = #{machineryId} and cp.plan_type = (
|
||||
select plan_type
|
||||
from dv_check_plan
|
||||
where plan_id = #{planId}
|
||||
) limit 1
|
||||
</select>
|
||||
<select id="getPlanId" resultType="java.lang.Long">
|
||||
select plan_id from dv_check_machinery
|
||||
where machinery_code = #{machineryCode}
|
||||
</select>
|
||||
|
||||
<insert id="insertDvCheckMachinery" parameterType="DvCheckMachinery" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into dv_check_machinery
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id,</if>
|
||||
<if test="machineryId != null">machinery_id,</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">machinery_code,</if>
|
||||
<if test="machineryName != null and machineryName != ''">machinery_name,</if>
|
||||
<if test="machineryBrand != null">machinery_brand,</if>
|
||||
<if test="machinerySpec != null">machinery_spec,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">#{planId},</if>
|
||||
<if test="machineryId != null">#{machineryId},</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">#{machineryCode},</if>
|
||||
<if test="machineryName != null and machineryName != ''">#{machineryName},</if>
|
||||
<if test="machineryBrand != null">#{machineryBrand},</if>
|
||||
<if test="machinerySpec != null">#{machinerySpec},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDvCheckMachinery" parameterType="DvCheckMachinery">
|
||||
update dv_check_machinery
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id = #{planId},</if>
|
||||
<if test="machineryId != null">machinery_id = #{machineryId},</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">machinery_code = #{machineryCode},</if>
|
||||
<if test="machineryName != null and machineryName != ''">machinery_name = #{machineryName},</if>
|
||||
<if test="machineryBrand != null">machinery_brand = #{machineryBrand},</if>
|
||||
<if test="machinerySpec != null">machinery_spec = #{machinerySpec},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDvCheckMachineryByRecordId" parameterType="Long">
|
||||
delete from dv_check_machinery where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDvCheckMachineryByRecordIds" parameterType="String">
|
||||
delete from dv_check_machinery where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByPlanId" parameterType="Long">
|
||||
delete from dv_check_machinery where plan_id = #{planId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
150
gear-mes/src/main/resources/mapper/dv/DvCheckPlanMapper.xml
Normal file
150
gear-mes/src/main/resources/mapper/dv/DvCheckPlanMapper.xml
Normal file
@@ -0,0 +1,150 @@
|
||||
<?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.gear.mes.dv.mapper.DvCheckPlanMapper">
|
||||
|
||||
<resultMap type="DvCheckPlan" id="DvCheckPlanResult">
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="planCode" column="plan_code" />
|
||||
<result property="planName" column="plan_name" />
|
||||
<result property="planType" column="plan_type" />
|
||||
<result property="startDate" column="start_date" />
|
||||
<result property="endDate" column="end_date" />
|
||||
<result property="cycleType" column="cycle_type" />
|
||||
<result property="cycleCount" column="cycle_count" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDvCheckPlanVo">
|
||||
select plan_id, plan_code, plan_name,plan_type, start_date, end_date, cycle_type, cycle_count,status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectDvCheckPlanList" parameterType="DvCheckPlan" resultMap="DvCheckPlanResult">
|
||||
<include refid="selectDvCheckPlanVo"/>
|
||||
<where>
|
||||
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
||||
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
|
||||
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
|
||||
<if test="startDate != null "> and start_date = #{startDate}</if>
|
||||
<if test="endDate != null "> and end_date = #{endDate}</if>
|
||||
<if test="cycleType != null and cycleType != ''"> and cycle_type = #{cycleType}</if>
|
||||
<if test="cycleCount != null "> and cycle_count = #{cycleCount}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectDvCheckPlanByPlanId" parameterType="Long" resultMap="DvCheckPlanResult">
|
||||
<include refid="selectDvCheckPlanVo"/>
|
||||
where plan_id = #{planId}
|
||||
</select>
|
||||
|
||||
<select id="checkPlanCodeUnique" parameterType="DvCheckPlan" resultMap="DvCheckPlanResult">
|
||||
<include refid="selectDvCheckPlanVo"/>
|
||||
where plan_code = #{planCode}
|
||||
</select>
|
||||
<select id="getByIds" resultType="com.gear.mes.dv.domain.DvCheckPlan" resultMap="DvCheckPlanResult">
|
||||
<include refid="selectDvCheckPlanVo"/>
|
||||
where plan_type = #{planType}
|
||||
and plan_id in
|
||||
<foreach collection="planIds" item="item" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectDvCheckPlanByMachineryCodeAndType" resultMap="DvCheckPlanResult">
|
||||
select pl.plan_id, pl.plan_code, pl.plan_name,pl.plan_type, pl.start_date, pl.end_date, pl.cycle_type, pl.cycle_count,pl.status, pl.remark, pl.create_time, pl.update_by, pl.update_time
|
||||
from dv_check_plan pl
|
||||
left join dv_check_machinery dv
|
||||
on pl.plan_id = dv.plan_id
|
||||
where plan_type = #{planType}
|
||||
and dv.machinery_code = #{machineryCode}
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertDvCheckPlan" parameterType="DvCheckPlan" useGeneratedKeys="true" keyProperty="planId">
|
||||
insert into dv_check_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planCode != null and planCode != ''">plan_code,</if>
|
||||
<if test="planName != null">plan_name,</if>
|
||||
<if test="planType != null and planType != ''">plan_type,</if>
|
||||
<if test="startDate != null">start_date,</if>
|
||||
<if test="endDate != null">end_date,</if>
|
||||
<if test="cycleType != null">cycle_type,</if>
|
||||
<if test="cycleCount != null">cycle_count,</if>
|
||||
<if test="status != null and status !=''">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="planCode != null and planCode != ''">#{planCode},</if>
|
||||
<if test="planName != null">#{planName},</if>
|
||||
<if test="planType != null and planType != ''">#{planType},</if>
|
||||
<if test="startDate != null">#{startDate},</if>
|
||||
<if test="endDate != null">#{endDate},</if>
|
||||
<if test="cycleType != null">#{cycleType},</if>
|
||||
<if test="cycleCount != null">#{cycleCount},</if>
|
||||
<if test="status != null and status !=''">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDvCheckPlan" parameterType="DvCheckPlan">
|
||||
update dv_check_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
|
||||
<if test="planName != null">plan_name = #{planName},</if>
|
||||
<if test="planType != null and planType != ''">plan_type = #{planType},</if>
|
||||
<if test="startDate != null">start_date = #{startDate},</if>
|
||||
<if test="endDate != null">end_date = #{endDate},</if>
|
||||
<if test="cycleType != null">cycle_type = #{cycleType},</if>
|
||||
<if test="cycleCount != null">cycle_count = #{cycleCount},</if>
|
||||
<if test="status != null and status !=''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where plan_id = #{planId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDvCheckPlanByPlanId" parameterType="Long">
|
||||
delete from dv_check_plan where plan_id = #{planId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDvCheckPlanByPlanIds" parameterType="String">
|
||||
delete from dv_check_plan where plan_id in
|
||||
<foreach item="planId" collection="array" open="(" separator="," close=")">
|
||||
#{planId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,134 @@
|
||||
<?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.gear.mes.dv.mapper.DvCheckRecordLineMapper">
|
||||
|
||||
<resultMap type="DvCheckRecordLine" id="DvCheckRecordLineResult">
|
||||
<result property="lineId" column="line_id" />
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="subjectId" column="subject_id" />
|
||||
<result property="subjectCode" column="subject_code" />
|
||||
<result property="subjectName" column="subject_name" />
|
||||
<result property="subjectType" column="subject_type" />
|
||||
<result property="subjectContent" column="subject_content" />
|
||||
<result property="subjectStandard" column="subject_standard" />
|
||||
<result property="checkStatus" column="check_status" />
|
||||
<result property="checkResult" column="check_result" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDvCheckRecordLineVo">
|
||||
select line_id, record_id, subject_id, subject_code, subject_name, subject_type, subject_content, subject_standard, check_status, check_result, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_record_line
|
||||
</sql>
|
||||
|
||||
<select id="selectDvCheckRecordLineList" parameterType="DvCheckRecordLine" resultMap="DvCheckRecordLineResult">
|
||||
<include refid="selectDvCheckRecordLineVo"/>
|
||||
<where>
|
||||
<if test="recordId != null "> and record_id = #{recordId}</if>
|
||||
<if test="subjectId != null "> and subject_id = #{subjectId}</if>
|
||||
<if test="subjectCode != null and subjectCode != ''"> and subject_code = #{subjectCode}</if>
|
||||
<if test="subjectName != null and subjectName != ''"> and subject_name like concat('%', #{subjectName}, '%')</if>
|
||||
<if test="subjectType != null and subjectType != ''"> and subject_type = #{subjectType}</if>
|
||||
<if test="subjectContent != null and subjectContent != ''"> and subject_content = #{subjectContent}</if>
|
||||
<if test="subjectStandard != null and subjectStandard != ''"> and subject_standard = #{subjectStandard}</if>
|
||||
<if test="checkStatus != null and checkStatus != ''"> and check_status = #{checkStatus}</if>
|
||||
<if test="checkResult != null and checkResult != ''"> and check_result = #{checkResult}</if>
|
||||
</where>
|
||||
order by line_id desc
|
||||
</select>
|
||||
|
||||
<select id="selectDvCheckRecordLineByLineId" parameterType="Long" resultMap="DvCheckRecordLineResult">
|
||||
<include refid="selectDvCheckRecordLineVo"/>
|
||||
where line_id = #{lineId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDvCheckRecordLine" parameterType="DvCheckRecordLine" useGeneratedKeys="true" keyProperty="lineId">
|
||||
insert into dv_check_record_line
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">record_id,</if>
|
||||
<if test="subjectId != null">subject_id,</if>
|
||||
<if test="subjectCode != null and subjectCode != ''">subject_code,</if>
|
||||
<if test="subjectName != null">subject_name,</if>
|
||||
<if test="subjectType != null">subject_type,</if>
|
||||
<if test="subjectContent != null and subjectContent != ''">subject_content,</if>
|
||||
<if test="subjectStandard != null">subject_standard,</if>
|
||||
<if test="checkStatus != null and checkStatus != ''">check_status,</if>
|
||||
<if test="checkResult != null">check_result,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
<if test="subjectId != null">#{subjectId},</if>
|
||||
<if test="subjectCode != null and subjectCode != ''">#{subjectCode},</if>
|
||||
<if test="subjectName != null">#{subjectName},</if>
|
||||
<if test="subjectType != null">#{subjectType},</if>
|
||||
<if test="subjectContent != null and subjectContent != ''">#{subjectContent},</if>
|
||||
<if test="subjectStandard != null">#{subjectStandard},</if>
|
||||
<if test="checkStatus != null and checkStatus != ''">#{checkStatus},</if>
|
||||
<if test="checkResult != null">#{checkResult},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDvCheckRecordLine" parameterType="DvCheckRecordLine">
|
||||
update dv_check_record_line
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="recordId != null">record_id = #{recordId},</if>
|
||||
<if test="subjectId != null">subject_id = #{subjectId},</if>
|
||||
<if test="subjectCode != null and subjectCode != ''">subject_code = #{subjectCode},</if>
|
||||
<if test="subjectName != null">subject_name = #{subjectName},</if>
|
||||
<if test="subjectType != null">subject_type = #{subjectType},</if>
|
||||
<if test="subjectContent != null and subjectContent != ''">subject_content = #{subjectContent},</if>
|
||||
<if test="subjectStandard != null">subject_standard = #{subjectStandard},</if>
|
||||
<if test="checkStatus != null and checkStatus != ''">check_status = #{checkStatus},</if>
|
||||
<if test="checkResult != null">check_result = #{checkResult},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where line_id = #{lineId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDvCheckRecordLineByLineId" parameterType="Long">
|
||||
delete from dv_check_record_line where line_id = #{lineId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDvCheckRecordLineByLineIds" parameterType="String">
|
||||
delete from dv_check_record_line where line_id in
|
||||
<foreach item="lineId" collection="array" open="(" separator="," close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDvCheckRecordLineByRecordId" parameterType="Long">
|
||||
delete from dv_check_record_line where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
158
gear-mes/src/main/resources/mapper/dv/DvCheckRecordMapper.xml
Normal file
158
gear-mes/src/main/resources/mapper/dv/DvCheckRecordMapper.xml
Normal file
@@ -0,0 +1,158 @@
|
||||
<?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.gear.mes.dv.mapper.DvCheckRecordMapper">
|
||||
|
||||
<resultMap type="DvCheckRecord" id="DvCheckRecordResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="planCode" column="plan_code" />
|
||||
<result property="planName" column="plan_name" />
|
||||
<result property="planType" column="plan_type" />
|
||||
<result property="machineryId" column="machinery_id" />
|
||||
<result property="machineryCode" column="machinery_code" />
|
||||
<result property="machineryName" column="machinery_name" />
|
||||
<result property="machineryBrand" column="machinery_brand" />
|
||||
<result property="machinerySpec" column="machinery_spec" />
|
||||
<result property="checkTime" column="check_time" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="status" column="status" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="attr1" column="attr1" />
|
||||
<result property="attr2" column="attr2" />
|
||||
<result property="attr3" column="attr3" />
|
||||
<result property="attr4" column="attr4" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectDvCheckRecordVo">
|
||||
select record_id, plan_id, plan_code, plan_name, plan_type, machinery_id, machinery_code, machinery_name, machinery_brand, machinery_spec, check_time, user_id, user_name, nick_name, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time from dv_check_record
|
||||
</sql>
|
||||
|
||||
<select id="selectDvCheckRecordList" parameterType="DvCheckRecord" resultMap="DvCheckRecordResult">
|
||||
<include refid="selectDvCheckRecordVo"/>
|
||||
<where>
|
||||
<if test="planId != null "> and plan_id = #{planId}</if>
|
||||
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
||||
<if test="planName != null and planName != ''"> and plan_name like concat('%', #{planName}, '%')</if>
|
||||
<if test="planType != null and planType != ''"> and plan_type = #{planType}</if>
|
||||
<if test="machineryId != null "> and machinery_id = #{machineryId}</if>
|
||||
<if test="machineryCode != null and machineryCode != ''"> and machinery_code = #{machineryCode}</if>
|
||||
<if test="machineryName != null and machineryName != ''"> and machinery_name like concat('%', #{machineryName}, '%')</if>
|
||||
<if test="machineryBrand != null and machineryBrand != ''"> and machinery_brand = #{machineryBrand}</if>
|
||||
<if test="machinerySpec != null and machinerySpec != ''"> and machinery_spec = #{machinerySpec}</if>
|
||||
<if test="checkTime != null "> and check_time = #{checkTime}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="nickName != null and nickName != ''"> and nick_name like concat('%', #{nickName}, '%')</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectDvCheckRecordByRecordId" parameterType="Long" resultMap="DvCheckRecordResult">
|
||||
<include refid="selectDvCheckRecordVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertDvCheckRecord" parameterType="DvCheckRecord" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into dv_check_record
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id,</if>
|
||||
<if test="planCode != null">plan_code,</if>
|
||||
<if test="planName != null">plan_name,</if>
|
||||
<if test="planType != null">plan_type,</if>
|
||||
<if test="machineryId != null">machinery_id,</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">machinery_code,</if>
|
||||
<if test="machineryName != null and machineryName != ''">machinery_name,</if>
|
||||
<if test="machineryBrand != null">machinery_brand,</if>
|
||||
<if test="machinerySpec != null">machinery_spec,</if>
|
||||
<if test="checkTime != null">check_time,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="attr1 != null">attr1,</if>
|
||||
<if test="attr2 != null">attr2,</if>
|
||||
<if test="attr3 != null">attr3,</if>
|
||||
<if test="attr4 != null">attr4,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">#{planId},</if>
|
||||
<if test="planCode != null">#{planCode},</if>
|
||||
<if test="planName != null">#{planName},</if>
|
||||
<if test="planType != null">#{planType},</if>
|
||||
<if test="machineryId != null">#{machineryId},</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">#{machineryCode},</if>
|
||||
<if test="machineryName != null and machineryName != ''">#{machineryName},</if>
|
||||
<if test="machineryBrand != null">#{machineryBrand},</if>
|
||||
<if test="machinerySpec != null">#{machinerySpec},</if>
|
||||
<if test="checkTime != null">#{checkTime},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="attr1 != null">#{attr1},</if>
|
||||
<if test="attr2 != null">#{attr2},</if>
|
||||
<if test="attr3 != null">#{attr3},</if>
|
||||
<if test="attr4 != null">#{attr4},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDvCheckRecord" parameterType="DvCheckRecord">
|
||||
update dv_check_record
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id = #{planId},</if>
|
||||
<if test="planCode != null">plan_code = #{planCode},</if>
|
||||
<if test="planName != null">plan_name = #{planName},</if>
|
||||
<if test="planType != null">plan_type = #{planType},</if>
|
||||
<if test="machineryId != null">machinery_id = #{machineryId},</if>
|
||||
<if test="machineryCode != null and machineryCode != ''">machinery_code = #{machineryCode},</if>
|
||||
<if test="machineryName != null and machineryName != ''">machinery_name = #{machineryName},</if>
|
||||
<if test="machineryBrand != null">machinery_brand = #{machineryBrand},</if>
|
||||
<if test="machinerySpec != null">machinery_spec = #{machinerySpec},</if>
|
||||
<if test="checkTime != null">check_time = #{checkTime},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null and userName != ''">user_name = #{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="attr1 != null">attr1 = #{attr1},</if>
|
||||
<if test="attr2 != null">attr2 = #{attr2},</if>
|
||||
<if test="attr3 != null">attr3 = #{attr3},</if>
|
||||
<if test="attr4 != null">attr4 = #{attr4},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteDvCheckRecordByRecordId" parameterType="Long">
|
||||
delete from dv_check_record where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteDvCheckRecordByRecordIds" parameterType="String">
|
||||
delete from dv_check_record where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user