parent
8160104cf9
commit
bcc7736224
@ -0,0 +1,24 @@
|
||||
package com.hw.common.core.constant;
|
||||
|
||||
/**
|
||||
* @Description:工单常量定义
|
||||
* @ProjectName:HwMes
|
||||
* @Author:xins
|
||||
* @Date:2024-03-11 10:42
|
||||
* @Version:1.0
|
||||
*/
|
||||
public class WfConstants {
|
||||
|
||||
public static final Long WF_QUALITY_ABNORMAL_PROCESS_ID = 301L;
|
||||
|
||||
/**质检工单实例状态*/
|
||||
public static final String WF_INSTANCE_STATUS_START = "1";//已启动
|
||||
public static final String WF_INSTANCE_STATUS_FINISH = "3";//已结束
|
||||
|
||||
/**质检工单实例节点状态*/
|
||||
public static final String WF_PROCESS_HANDLE_STATUS_FINISH = "0";//已结束
|
||||
|
||||
|
||||
/**质检文件关联类型*/
|
||||
public static final String QMS_FILE_TARGET_TYPE_QUALITY_INSTANCE_ACTIVITY = "1";//质检工单实例节点
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.hw.qms.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.hw.common.core.annotation.Excel;
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 质检工单实例节点对象 qms_quality_instance_activity
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
@Data
|
||||
public class QmsQualityInstanceActivityVo extends BaseEntity
|
||||
{
|
||||
@NotNull(message="质检结果ID必须输入")
|
||||
private Long checkResultId;
|
||||
|
||||
@NotNull(message="质检流程步骤ID必须输入")
|
||||
private Long processActivityId;
|
||||
|
||||
@NotNull(message="质检流程步骤顺序必须输入")
|
||||
private Long processStepOrder;
|
||||
|
||||
@NotBlank(message="处理意见必须输入")
|
||||
/** 处理意见 */
|
||||
private String processHandleResolution;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.hw.qms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.qms.domain.QmsQualityInstanceActivity;
|
||||
import com.hw.qms.domain.QmsCheckInstanceFile;
|
||||
|
||||
/**
|
||||
* 质检工单实例节点Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-03-11
|
||||
*/
|
||||
public interface QmsQualityInstanceActivityMapper
|
||||
{
|
||||
/**
|
||||
* 查询质检工单实例节点
|
||||
*
|
||||
* @param instanceActivityId 质检工单实例节点主键
|
||||
* @return 质检工单实例节点
|
||||
*/
|
||||
public QmsQualityInstanceActivity selectQmsQualityInstanceActivityByInstanceActivityId(Long instanceActivityId);
|
||||
|
||||
/**
|
||||
* 查询质检工单实例节点列表
|
||||
*
|
||||
* @param qmsQualityInstanceActivity 质检工单实例节点
|
||||
* @return 质检工单实例节点集合
|
||||
*/
|
||||
public List<QmsQualityInstanceActivity> selectQmsQualityInstanceActivityList(QmsQualityInstanceActivity qmsQualityInstanceActivity);
|
||||
|
||||
/**
|
||||
* 新增质检工单实例节点
|
||||
*
|
||||
* @param qmsQualityInstanceActivity 质检工单实例节点
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQmsQualityInstanceActivity(QmsQualityInstanceActivity qmsQualityInstanceActivity);
|
||||
|
||||
/**
|
||||
* 修改质检工单实例节点
|
||||
*
|
||||
* @param qmsQualityInstanceActivity 质检工单实例节点
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQmsQualityInstanceActivity(QmsQualityInstanceActivity qmsQualityInstanceActivity);
|
||||
|
||||
/**
|
||||
* 删除质检工单实例节点
|
||||
*
|
||||
* @param instanceActivityId 质检工单实例节点主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsQualityInstanceActivityByInstanceActivityId(Long instanceActivityId);
|
||||
|
||||
/**
|
||||
* 批量删除质检工单实例节点
|
||||
*
|
||||
* @param instanceActivityIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsQualityInstanceActivityByInstanceActivityIds(Long[] instanceActivityIds);
|
||||
|
||||
/**
|
||||
* 批量删除质检文件
|
||||
*
|
||||
* @param instanceActivityIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsCheckInstanceFileByTargetIds(Long[] instanceActivityIds);
|
||||
|
||||
/**
|
||||
* 批量新增质检文件
|
||||
*
|
||||
* @param qmsCheckInstanceFileList 质检文件列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchQmsCheckInstanceFile(List<QmsCheckInstanceFile> qmsCheckInstanceFileList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过质检工单实例节点主键删除质检文件信息
|
||||
*
|
||||
* @param instanceActivityId 质检工单实例节点ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsCheckInstanceFileByTargetId(Long instanceActivityId);
|
||||
}
|
@ -0,0 +1,151 @@
|
||||
<?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.hw.qms.mapper.QmsQualityInstanceActivityMapper">
|
||||
|
||||
<resultMap type="QmsQualityInstanceActivity" id="QmsQualityInstanceActivityResult">
|
||||
<result property="instanceActivityId" column="instance_activity_id" />
|
||||
<result property="qualityInstanceId" column="quality_instance_id" />
|
||||
<result property="processActivityId" column="process_activity_id" />
|
||||
<result property="processHandleResolution" column="process_handle_resolution" />
|
||||
<result property="processHandleDesc" column="process_handle_desc" />
|
||||
<result property="processHandleStatus" column="process_handle_status" />
|
||||
<result property="processStepOrder" column="process_step_order" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="handleUserId" column="handle_user_id" />
|
||||
<result property="handleBy" column="handle_by" />
|
||||
<result property="handleTime" column="handle_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="transferUserId" column="transfer_user_id" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="QmsQualityInstanceActivityQmsCheckInstanceFileResult" type="QmsQualityInstanceActivity" extends="QmsQualityInstanceActivityResult">
|
||||
<collection property="qmsCheckInstanceFileList" notNullColumn="sub_check_instance_file_id" javaType="java.util.List" resultMap="QmsCheckInstanceFileResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="QmsCheckInstanceFile" id="QmsCheckInstanceFileResult">
|
||||
<result property="checkInstanceFileId" column="sub_check_instance_file_id" />
|
||||
<result property="targetType" column="sub_target_type" />
|
||||
<result property="targetId" column="sub_target_id" />
|
||||
<result property="faultFile" column="sub_fault_file" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectQmsQualityInstanceActivityVo">
|
||||
select instance_activity_id, quality_instance_id, process_activity_id, process_handle_resolution, process_handle_desc, process_handle_status, process_step_order, start_time, end_time, handle_user_id, handle_by, handle_time, create_by, create_time, transfer_user_id from qms_quality_instance_activity
|
||||
</sql>
|
||||
|
||||
<select id="selectQmsQualityInstanceActivityList" parameterType="QmsQualityInstanceActivity" resultMap="QmsQualityInstanceActivityResult">
|
||||
<include refid="selectQmsQualityInstanceActivityVo"/>
|
||||
<where>
|
||||
<if test="qualityInstanceId != null "> and quality_instance_id = #{qualityInstanceId}</if>
|
||||
<if test="processActivityId != null "> and process_activity_id = #{processActivityId}</if>
|
||||
<if test="processHandleResolution != null and processHandleResolution != ''"> and process_handle_resolution = #{processHandleResolution}</if>
|
||||
<if test="processHandleDesc != null and processHandleDesc != ''"> and process_handle_desc = #{processHandleDesc}</if>
|
||||
<if test="processHandleStatus != null and processHandleStatus != ''"> and process_handle_status = #{processHandleStatus}</if>
|
||||
<if test="processStepOrder != null "> and process_step_order = #{processStepOrder}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
<if test="handleUserId != null "> and handle_user_id = #{handleUserId}</if>
|
||||
<if test="handleBy != null and handleBy != ''"> and handle_by = #{handleBy}</if>
|
||||
<if test="handleTime != null "> and handle_time = #{handleTime}</if>
|
||||
<if test="transferUserId != null "> and transfer_user_id = #{transferUserId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQmsQualityInstanceActivityByInstanceActivityId" parameterType="Long" resultMap="QmsQualityInstanceActivityQmsCheckInstanceFileResult">
|
||||
select a.instance_activity_id, a.quality_instance_id, a.process_activity_id, a.process_handle_resolution, a.process_handle_desc, a.process_handle_status, a.process_step_order, a.start_time, a.end_time, a.handle_user_id, a.handle_by, a.handle_time, a.create_by, a.create_time, a.transfer_user_id,
|
||||
b.check_instance_file_id as sub_check_instance_file_id, b.target_type as sub_target_type, b.target_id as sub_target_id, b.fault_file as sub_fault_file
|
||||
from qms_quality_instance_activity a
|
||||
left join qms_check_instance_file b on b.target_id = a.instance_activity_id
|
||||
where a.instance_activity_id = #{instanceActivityId}
|
||||
</select>
|
||||
|
||||
<insert id="insertQmsQualityInstanceActivity" parameterType="QmsQualityInstanceActivity" useGeneratedKeys="true" keyProperty="instanceActivityId">
|
||||
insert into qms_quality_instance_activity
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="qualityInstanceId != null">quality_instance_id,</if>
|
||||
<if test="processActivityId != null">process_activity_id,</if>
|
||||
<if test="processHandleResolution != null and processHandleResolution != ''">process_handle_resolution,</if>
|
||||
<if test="processHandleDesc != null">process_handle_desc,</if>
|
||||
<if test="processHandleStatus != null">process_handle_status,</if>
|
||||
<if test="processStepOrder != null">process_step_order,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
<if test="handleUserId != null">handle_user_id,</if>
|
||||
<if test="handleBy != null">handle_by,</if>
|
||||
<if test="handleTime != null">handle_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="transferUserId != null">transfer_user_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="qualityInstanceId != null">#{qualityInstanceId},</if>
|
||||
<if test="processActivityId != null">#{processActivityId},</if>
|
||||
<if test="processHandleResolution != null and processHandleResolution != ''">#{processHandleResolution},</if>
|
||||
<if test="processHandleDesc != null">#{processHandleDesc},</if>
|
||||
<if test="processHandleStatus != null">#{processHandleStatus},</if>
|
||||
<if test="processStepOrder != null">#{processStepOrder},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
<if test="handleUserId != null">#{handleUserId},</if>
|
||||
<if test="handleBy != null">#{handleBy},</if>
|
||||
<if test="handleTime != null">#{handleTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="transferUserId != null">#{transferUserId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateQmsQualityInstanceActivity" parameterType="QmsQualityInstanceActivity">
|
||||
update qms_quality_instance_activity
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="qualityInstanceId != null">quality_instance_id = #{qualityInstanceId},</if>
|
||||
<if test="processActivityId != null">process_activity_id = #{processActivityId},</if>
|
||||
<if test="processHandleResolution != null and processHandleResolution != ''">process_handle_resolution = #{processHandleResolution},</if>
|
||||
<if test="processHandleDesc != null">process_handle_desc = #{processHandleDesc},</if>
|
||||
<if test="processHandleStatus != null">process_handle_status = #{processHandleStatus},</if>
|
||||
<if test="processStepOrder != null">process_step_order = #{processStepOrder},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</if>
|
||||
<if test="handleUserId != null">handle_user_id = #{handleUserId},</if>
|
||||
<if test="handleBy != null">handle_by = #{handleBy},</if>
|
||||
<if test="handleTime != null">handle_time = #{handleTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="transferUserId != null">transfer_user_id = #{transferUserId},</if>
|
||||
</trim>
|
||||
where instance_activity_id = #{instanceActivityId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQmsQualityInstanceActivityByInstanceActivityId" parameterType="Long">
|
||||
delete from qms_quality_instance_activity where instance_activity_id = #{instanceActivityId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQmsQualityInstanceActivityByInstanceActivityIds" parameterType="String">
|
||||
delete from qms_quality_instance_activity where instance_activity_id in
|
||||
<foreach item="instanceActivityId" collection="array" open="(" separator="," close=")">
|
||||
#{instanceActivityId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQmsCheckInstanceFileByTargetIds" parameterType="String">
|
||||
delete from qms_check_instance_file where target_id in
|
||||
<foreach item="targetId" collection="array" open="(" separator="," close=")">
|
||||
#{targetId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQmsCheckInstanceFileByTargetId" parameterType="Long">
|
||||
delete from qms_check_instance_file where target_id = #{targetId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchQmsCheckInstanceFile">
|
||||
insert into qms_check_instance_file( check_instance_file_id, target_type, target_id, fault_file) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.checkInstanceFileId}, #{item.targetType}, #{item.targetId}, #{item.faultFile})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
Loading…
Reference in New Issue