1. 巡检单信息
This commit is contained in:
parent
05dbe74b1c
commit
e66dc52858
|
|
@ -33,7 +33,6 @@ public class InspectionConfig extends BaseEntity {
|
|||
@NotNull(message = "配置id 不能为空", groups = Update.class)
|
||||
@Null(message = "配置id 必须为空", groups = Create.class)
|
||||
private Long configId;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
|
|
@ -41,20 +40,17 @@ public class InspectionConfig extends BaseEntity {
|
|||
@Condition(name = "task_id", type = Condition.ConditionType.eq)
|
||||
@NotNull(message = "所属任务不能为空", groups = Create.class)
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 对应部门Id
|
||||
*/
|
||||
@TableField(value = "dept_id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 配置名称 name
|
||||
*/
|
||||
@TableField(value = "config_name")
|
||||
@Condition(name = "config_name", type = Condition.ConditionType.eq)
|
||||
private String configName;
|
||||
|
||||
/**
|
||||
* 配置别名
|
||||
*/
|
||||
|
|
@ -62,7 +58,6 @@ public class InspectionConfig extends BaseEntity {
|
|||
@Condition(name = "`alias`", type = Condition.ConditionType.eq)
|
||||
@NotNull(message = "巡检单别名不能为空", groups = {Update.class,Create.class})
|
||||
private String alias;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
|
|
@ -70,4 +65,9 @@ public class InspectionConfig extends BaseEntity {
|
|||
@Condition(name = "`template`", type = Condition.ConditionType.eq)
|
||||
@NotNull(message = "巡检单模板名称不能为空", groups = {Update.class,Create.class})
|
||||
private String template;
|
||||
/**
|
||||
* 模板所属路径
|
||||
*/
|
||||
@TableField(value = "template_url")
|
||||
private String templateUrl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 这里才是对应的data
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/18 15:39
|
||||
*/
|
||||
|
|
@ -25,12 +26,6 @@ public class InspectionData extends BaseEntity {
|
|||
*/
|
||||
@TableId(value = "data_id", type = IdType.ASSIGN_ID)
|
||||
private Long dataId;
|
||||
|
||||
/**
|
||||
* 任务id
|
||||
*/
|
||||
@TableField(value = "config_id")
|
||||
private Long configId;
|
||||
/**
|
||||
* 详情id
|
||||
*/
|
||||
|
|
@ -41,40 +36,14 @@ public class InspectionData extends BaseEntity {
|
|||
*/
|
||||
@TableField(value = "ins_id")
|
||||
private Long insId;
|
||||
|
||||
/**
|
||||
* 对应部门Id
|
||||
*/
|
||||
@TableField(value = "dept_id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 配置对应key
|
||||
*/
|
||||
@TableField(value = "config_key")
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* 配置对应value
|
||||
*/
|
||||
@TableField(value = "config_value")
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* key 对应类型
|
||||
*/
|
||||
@TableField(value = "config_type")
|
||||
private Short configType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 对应模板别名
|
||||
*/
|
||||
@TableField(value = "`alias`")
|
||||
private String alias;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,13 +37,6 @@ public class InspectionDetail extends BaseEntity {
|
|||
@TableField(value = "config_id")
|
||||
@NotNull(message = "config_id 不能为空", groups = {Create.class, Update.class})
|
||||
private Long configId;
|
||||
|
||||
/**
|
||||
* 对应部门Id
|
||||
*/
|
||||
@TableField(value = "dept_id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 配置对应label
|
||||
*/
|
||||
|
|
@ -56,7 +49,6 @@ public class InspectionDetail extends BaseEntity {
|
|||
@TableField(value = "config_key")
|
||||
@NotNull(message = "config_key 不能为空", groups = {Create.class, Update.class})
|
||||
private String configKey;
|
||||
|
||||
/**
|
||||
* key 对应类型
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ public class DetailsVO implements Serializable {
|
|||
* 配置对应key
|
||||
*/
|
||||
private String configKey;
|
||||
/**
|
||||
* 对应的配置值
|
||||
*/
|
||||
private String configValue;
|
||||
|
||||
/**
|
||||
* key 对应类型
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.chushang.inspection.work.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 电子巡检单对应 数值
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/28 17:58
|
||||
*/
|
||||
@Data
|
||||
public class ConfigDataVO {
|
||||
/**
|
||||
* 数据id
|
||||
*/
|
||||
private Long dataId;
|
||||
/**
|
||||
* 工单id
|
||||
*/
|
||||
private String wrkId;
|
||||
/**
|
||||
* data
|
||||
* key 对应值
|
||||
*/
|
||||
private String configValue;
|
||||
/**
|
||||
* data
|
||||
* 备注信息
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* detail
|
||||
* 详情id
|
||||
*/
|
||||
private Long detailId;
|
||||
/**
|
||||
* key
|
||||
*/
|
||||
private String configKey;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private Integer configType;
|
||||
/**
|
||||
* label
|
||||
*/
|
||||
private String configLabel;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
package com.chushang.inspection.work.vo;
|
||||
|
||||
import com.chushang.inspection.project.vo.DetailsVO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -17,35 +16,28 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class InspectionConfigVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 配置id
|
||||
*/
|
||||
private Long inspectionConfig;
|
||||
|
||||
private Long configId;
|
||||
/**
|
||||
* 名称
|
||||
* 配置名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
private String configName;
|
||||
/**
|
||||
* 别名
|
||||
* 模板别名
|
||||
*/
|
||||
private String alias;
|
||||
|
||||
/**
|
||||
* 模板名称
|
||||
*/
|
||||
private String template;
|
||||
/**
|
||||
* 模板路径
|
||||
*/
|
||||
private String template;
|
||||
|
||||
private String templateUrl;
|
||||
/**
|
||||
* 详细信息
|
||||
*/
|
||||
// @RelationOneToMany(
|
||||
// selfField = "inspectionConfig",
|
||||
// targetField = "inspectionConfig",
|
||||
// targetTable = "inspection_details",
|
||||
// selectColumns = {"id", "inspection_config", "label", "value as configValue"}
|
||||
// )
|
||||
private List<DetailsVO> details;
|
||||
private List<ConfigDataVO> details;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,19 @@
|
|||
package com.chushang.inspection.project.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.chushang.datascope.annotation.DataScope;
|
||||
import com.chushang.inspection.project.po.InspectionData;
|
||||
import com.chushang.inspection.work.vo.InspectionConfigVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/18 15:39
|
||||
*/
|
||||
public interface InspectionDataMapper extends BaseMapper<InspectionData> {
|
||||
@DataScope(deptAlias = "ic")
|
||||
List<InspectionConfigVO> listInspections(@Param("wrkId") Long wrkId, @Param("query") CommonParam query);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@ package com.chushang.inspection.project.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.chushang.inspection.project.po.InspectionData;
|
||||
import com.chushang.inspection.work.vo.InspectionConfigVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
|
|
@ -10,4 +13,5 @@ import com.chushang.inspection.project.po.InspectionData;
|
|||
public interface InspectionDataService extends IService<InspectionData>{
|
||||
|
||||
|
||||
List<InspectionConfigVO> listInspections(Long wrkId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,29 @@
|
|||
package com.chushang.inspection.project.service.impl;
|
||||
|
||||
import com.chushang.common.mybatis.page.CommonParam;
|
||||
import com.chushang.inspection.project.service.InspectionDataService;
|
||||
import com.chushang.inspection.work.vo.InspectionConfigVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.chushang.inspection.project.po.InspectionData;
|
||||
import com.chushang.inspection.project.mapper.InspectionDataMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/18 15:39
|
||||
*/
|
||||
@Service
|
||||
public class InspectionDataServiceImpl extends ServiceImpl<InspectionDataMapper, InspectionData> implements InspectionDataService {
|
||||
|
||||
/**
|
||||
* 根据工单id 查询对应的 巡检单信息
|
||||
* @param wrkId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<InspectionConfigVO> listInspections(Long wrkId) {
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
return baseMapper.listInspections(wrkId, commonParam);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,8 +35,6 @@ import com.chushang.inspection.work.mapper.WrkInfoMapper;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
|
|
@ -130,7 +128,8 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
.eq(WrkImg::getImgType, -1)
|
||||
.last(Operator.LIMIT_ONE.getCharacter())).getRealPath());
|
||||
}
|
||||
// todo 巡检单还没搞
|
||||
// 巡检单还没搞
|
||||
infoDetail.setInspections(inspectionDataService.listInspections(wrkId));
|
||||
return infoDetail;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,27 +1,46 @@
|
|||
<?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.chushang.inspection.project.mapper.InspectionDataMapper">
|
||||
<resultMap id="BaseResultMap" type="com.chushang.inspection.project.po.InspectionData">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table inspection_data-->
|
||||
<id column="data_id" jdbcType="BIGINT" property="dataId" />
|
||||
<result column="config_id" jdbcType="BIGINT" property="configId" />
|
||||
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
|
||||
<result column="config_key" jdbcType="VARCHAR" property="configKey" />
|
||||
<result column="config_value" jdbcType="VARCHAR" property="configValue" />
|
||||
<result column="config_type" jdbcType="SMALLINT" property="configType" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="alias" jdbcType="VARCHAR" property="alias" />
|
||||
<result column="version" jdbcType="BIGINT" property="version" />
|
||||
<result column="del_state" jdbcType="BOOLEAN" property="delState" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="inspectionConfigVOResult" type="com.chushang.inspection.work.vo.InspectionConfigVO">
|
||||
<id column="config_id" property="configId" />
|
||||
<result column="config_name" property="configName" />
|
||||
<result column="alias" property="alias" />
|
||||
<result column="template" property="template" />
|
||||
<result column="template_url" property="templateUrl" />
|
||||
<collection property="details" ofType="com.chushang.inspection.work.vo.ConfigDataVO">
|
||||
<id column="data_id" property="dataId" />
|
||||
<result column="detail_id" property="detailId" />
|
||||
<result column="config_key" property="configKey" />
|
||||
<result column="config_type" property="configType" />
|
||||
<result column="config_label" property="configLabel" />
|
||||
<result column="config_value" property="configValue" />
|
||||
<result column="remark" property="remark" />
|
||||
<result column="ins_id" property="wrkId" />
|
||||
</collection>
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
data_id, config_id, dept_id, config_key, config_value, config_type, remark, `alias`,
|
||||
version, del_state, create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
|
||||
<select id="listInspections" resultMap="inspectionConfigVOResult">
|
||||
SELECT id.data_id,
|
||||
id.config_value,
|
||||
id.remark,
|
||||
id.ins_id,
|
||||
idl.detail_id,
|
||||
idl.config_key,
|
||||
idl.config_type,
|
||||
idl.config_label,
|
||||
ic.config_id,
|
||||
ic.template,
|
||||
ic.alias,
|
||||
ic.config_name,
|
||||
ic.template_url
|
||||
FROM inspection_data id
|
||||
INNER JOIN inspection_detail idl ON id.detail_id = idl.detail_id
|
||||
INNER JOIN inspection_config ic ON ic.config_id = idl.config_id
|
||||
WHERE id.ins_id = #{wrkId}
|
||||
<if test="true">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue