parent
ffae6718f8
commit
8160104cf9
@ -0,0 +1,25 @@
|
||||
package com.hw.mes.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Description: 生产计划明细VO对象4开始使用(with attach图纸)
|
||||
* @ClassName: MesProductPlanDetailAttachVo
|
||||
* @Author : xins
|
||||
* @Date :2024-03-08 15:51
|
||||
* @Version :1.0
|
||||
*/
|
||||
@Data
|
||||
public class MesProductPlanDetailAttachVo {
|
||||
|
||||
//生产计划ID
|
||||
@NotNull(message = "生产计划ID必须输入")
|
||||
private Long planId;
|
||||
|
||||
//生产计划ID
|
||||
@NotNull(message = "图纸ID必须输入")
|
||||
private Long attachId;
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.hw.mes.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Description: 生产计划明细VO对象4完成使用(with attach图纸)
|
||||
* @ClassName: MesProductPlanDetailAttachVo
|
||||
* @Author : xins
|
||||
* @Date :2024-03-08 15:51
|
||||
* @Version :1.0
|
||||
*/
|
||||
@Data
|
||||
public class MesProductPlanDetailCompleteAttachVo {
|
||||
|
||||
//生产计划明细ID
|
||||
@NotNull(message = "生产计划明细ID必须输入")
|
||||
private Long planDetailId;
|
||||
|
||||
//生产计划ID
|
||||
@NotNull(message = "图纸ID必须输入")
|
||||
private Long attachId;
|
||||
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
package com.hw.qms.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.common.security.annotation.RequiresPermissions;
|
||||
import com.hw.qms.domain.QmsQualityInstance;
|
||||
import com.hw.qms.service.IQmsQualityInstanceService;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 质检工单Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/qualityinstance")
|
||||
public class QmsQualityInstanceController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IQmsQualityInstanceService qmsQualityInstanceService;
|
||||
|
||||
/**
|
||||
* 查询质检工单列表
|
||||
*/
|
||||
@RequiresPermissions("qms:ualityinstance:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(QmsQualityInstance qmsQualityInstance)
|
||||
{
|
||||
startPage();
|
||||
List<QmsQualityInstance> list = qmsQualityInstanceService.selectQmsQualityInstanceList(qmsQualityInstance);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出质检工单列表
|
||||
*/
|
||||
@RequiresPermissions("qms:ualityinstance:export")
|
||||
@Log(title = "质检工单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, QmsQualityInstance qmsQualityInstance)
|
||||
{
|
||||
List<QmsQualityInstance> list = qmsQualityInstanceService.selectQmsQualityInstanceList(qmsQualityInstance);
|
||||
ExcelUtil<QmsQualityInstance> util = new ExcelUtil<QmsQualityInstance>(QmsQualityInstance.class);
|
||||
util.exportExcel(response, list, "质检工单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取质检工单详细信息
|
||||
*/
|
||||
@RequiresPermissions("qms:ualityinstance:query")
|
||||
@GetMapping(value = "/{qualityInstanceId}")
|
||||
public AjaxResult getInfo(@PathVariable("qualityInstanceId") Long qualityInstanceId)
|
||||
{
|
||||
return success(qmsQualityInstanceService.selectQmsQualityInstanceByQualityInstanceId(qualityInstanceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增质检工单
|
||||
*/
|
||||
@RequiresPermissions("qms:ualityinstance:add")
|
||||
@Log(title = "质检工单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody QmsQualityInstance qmsQualityInstance)
|
||||
{
|
||||
return toAjax(qmsQualityInstanceService.insertQmsQualityInstance(qmsQualityInstance));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改质检工单
|
||||
*/
|
||||
@RequiresPermissions("qms:ualityinstance:edit")
|
||||
@Log(title = "质检工单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody QmsQualityInstance qmsQualityInstance)
|
||||
{
|
||||
return toAjax(qmsQualityInstanceService.updateQmsQualityInstance(qmsQualityInstance));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除质检工单
|
||||
*/
|
||||
@RequiresPermissions("qms:ualityinstance:remove")
|
||||
@Log(title = "质检工单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{qualityInstanceIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] qualityInstanceIds)
|
||||
{
|
||||
return toAjax(qmsQualityInstanceService.deleteQmsQualityInstanceByQualityInstanceIds(qualityInstanceIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.hw.qms.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.hw.common.core.annotation.Excel;
|
||||
import com.hw.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 质检文件对象 qms_check_instance_file
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
public class QmsCheckInstanceFile extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键标识 */
|
||||
private Long checkInstanceFileId;
|
||||
|
||||
/** 关联类型(1质检工单实例) */
|
||||
@Excel(name = "关联类型(1质检工单实例)")
|
||||
private String targetType;
|
||||
|
||||
/** 关联类型为1时关联质检工单实例ID */
|
||||
@Excel(name = "关联类型为1时关联质检工单实例ID")
|
||||
private Long targetId;
|
||||
|
||||
/** 故障文件地址,一般是图片 */
|
||||
@Excel(name = "故障文件地址,一般是图片")
|
||||
private String faultFile;
|
||||
|
||||
public void setCheckInstanceFileId(Long checkInstanceFileId)
|
||||
{
|
||||
this.checkInstanceFileId = checkInstanceFileId;
|
||||
}
|
||||
|
||||
public Long getCheckInstanceFileId()
|
||||
{
|
||||
return checkInstanceFileId;
|
||||
}
|
||||
public void setTargetType(String targetType)
|
||||
{
|
||||
this.targetType = targetType;
|
||||
}
|
||||
|
||||
public String getTargetType()
|
||||
{
|
||||
return targetType;
|
||||
}
|
||||
public void setTargetId(Long targetId)
|
||||
{
|
||||
this.targetId = targetId;
|
||||
}
|
||||
|
||||
public Long getTargetId()
|
||||
{
|
||||
return targetId;
|
||||
}
|
||||
public void setFaultFile(String faultFile)
|
||||
{
|
||||
this.faultFile = faultFile;
|
||||
}
|
||||
|
||||
public String getFaultFile()
|
||||
{
|
||||
return faultFile;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("checkInstanceFileId", getCheckInstanceFileId())
|
||||
.append("targetType", getTargetType())
|
||||
.append("targetId", getTargetId())
|
||||
.append("faultFile", getFaultFile())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.qms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.qms.domain.QmsCheckInstanceFile;
|
||||
|
||||
/**
|
||||
* 质检文件Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
public interface QmsCheckInstanceFileMapper
|
||||
{
|
||||
/**
|
||||
* 查询质检文件
|
||||
*
|
||||
* @param checkInstanceFileId 质检文件主键
|
||||
* @return 质检文件
|
||||
*/
|
||||
public QmsCheckInstanceFile selectQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId);
|
||||
|
||||
/**
|
||||
* 查询质检文件列表
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 质检文件集合
|
||||
*/
|
||||
public List<QmsCheckInstanceFile> selectQmsCheckInstanceFileList(QmsCheckInstanceFile qmsCheckInstanceFile);
|
||||
|
||||
/**
|
||||
* 新增质检文件
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile);
|
||||
|
||||
/**
|
||||
* 修改质检文件
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile);
|
||||
|
||||
/**
|
||||
* 删除质检文件
|
||||
*
|
||||
* @param checkInstanceFileId 质检文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId);
|
||||
|
||||
/**
|
||||
* 批量删除质检文件
|
||||
*
|
||||
* @param checkInstanceFileIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsCheckInstanceFileByCheckInstanceFileIds(Long[] checkInstanceFileIds);
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.hw.qms.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.qms.domain.QmsQualityInstance;
|
||||
import com.hw.qms.domain.QmsQualityInstanceActivity;
|
||||
|
||||
/**
|
||||
* 质检工单Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
public interface QmsQualityInstanceMapper
|
||||
{
|
||||
/**
|
||||
* 查询质检工单
|
||||
*
|
||||
* @param qualityInstanceId 质检工单主键
|
||||
* @return 质检工单
|
||||
*/
|
||||
public QmsQualityInstance selectQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId);
|
||||
|
||||
/**
|
||||
* 查询质检工单列表
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 质检工单集合
|
||||
*/
|
||||
public List<QmsQualityInstance> selectQmsQualityInstanceList(QmsQualityInstance qmsQualityInstance);
|
||||
|
||||
/**
|
||||
* 新增质检工单
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQmsQualityInstance(QmsQualityInstance qmsQualityInstance);
|
||||
|
||||
/**
|
||||
* 修改质检工单
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQmsQualityInstance(QmsQualityInstance qmsQualityInstance);
|
||||
|
||||
/**
|
||||
* 删除质检工单
|
||||
*
|
||||
* @param qualityInstanceId 质检工单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId);
|
||||
|
||||
/**
|
||||
* 批量删除质检工单
|
||||
*
|
||||
* @param qualityInstanceIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsQualityInstanceByQualityInstanceIds(Long[] qualityInstanceIds);
|
||||
|
||||
/**
|
||||
* 批量删除质检工单实例节点
|
||||
*
|
||||
* @param qualityInstanceIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsQualityInstanceActivityByQualityInstanceIds(Long[] qualityInstanceIds);
|
||||
|
||||
/**
|
||||
* 批量新增质检工单实例节点
|
||||
*
|
||||
* @param qmsQualityInstanceActivityList 质检工单实例节点列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchQmsQualityInstanceActivity(List<QmsQualityInstanceActivity> qmsQualityInstanceActivityList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过质检工单主键删除质检工单实例节点信息
|
||||
*
|
||||
* @param qualityInstanceId 质检工单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsQualityInstanceActivityByQualityInstanceId(Long qualityInstanceId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询质检工单
|
||||
*
|
||||
* @param checkResultId 质检结果ID
|
||||
* @return 质检工单
|
||||
*/
|
||||
public QmsQualityInstance selectQmsQualityInstanceByCheckResultId(Long checkResultId);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.qms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.qms.domain.QmsCheckInstanceFile;
|
||||
|
||||
/**
|
||||
* 质检文件Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
public interface IQmsCheckInstanceFileService
|
||||
{
|
||||
/**
|
||||
* 查询质检文件
|
||||
*
|
||||
* @param checkInstanceFileId 质检文件主键
|
||||
* @return 质检文件
|
||||
*/
|
||||
public QmsCheckInstanceFile selectQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId);
|
||||
|
||||
/**
|
||||
* 查询质检文件列表
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 质检文件集合
|
||||
*/
|
||||
public List<QmsCheckInstanceFile> selectQmsCheckInstanceFileList(QmsCheckInstanceFile qmsCheckInstanceFile);
|
||||
|
||||
/**
|
||||
* 新增质检文件
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile);
|
||||
|
||||
/**
|
||||
* 修改质检文件
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile);
|
||||
|
||||
/**
|
||||
* 批量删除质检文件
|
||||
*
|
||||
* @param checkInstanceFileIds 需要删除的质检文件主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsCheckInstanceFileByCheckInstanceFileIds(Long[] checkInstanceFileIds);
|
||||
|
||||
/**
|
||||
* 删除质检文件信息
|
||||
*
|
||||
* @param checkInstanceFileId 质检文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId);
|
||||
}
|
@ -0,0 +1,71 @@
|
||||
package com.hw.qms.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.qms.domain.QmsQualityInstance;
|
||||
|
||||
/**
|
||||
* 质检工单Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
public interface IQmsQualityInstanceService
|
||||
{
|
||||
/**
|
||||
* 查询质检工单
|
||||
*
|
||||
* @param qualityInstanceId 质检工单主键
|
||||
* @return 质检工单
|
||||
*/
|
||||
public QmsQualityInstance selectQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId);
|
||||
|
||||
/**
|
||||
* 查询质检工单列表
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 质检工单集合
|
||||
*/
|
||||
public List<QmsQualityInstance> selectQmsQualityInstanceList(QmsQualityInstance qmsQualityInstance);
|
||||
|
||||
/**
|
||||
* 新增质检工单
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQmsQualityInstance(QmsQualityInstance qmsQualityInstance);
|
||||
|
||||
/**
|
||||
* 修改质检工单
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQmsQualityInstance(QmsQualityInstance qmsQualityInstance);
|
||||
|
||||
/**
|
||||
* 批量删除质检工单
|
||||
*
|
||||
* @param qualityInstanceIds 需要删除的质检工单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsQualityInstanceByQualityInstanceIds(Long[] qualityInstanceIds);
|
||||
|
||||
/**
|
||||
* 删除质检工单信息
|
||||
*
|
||||
* @param qualityInstanceId 质检工单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询质检工单
|
||||
*
|
||||
* @param checkResultId 质检结果ID
|
||||
* @return 质检工单
|
||||
*/
|
||||
public QmsQualityInstance selectQmsQualityInstanceByCheckResultId(Long checkResultId);
|
||||
}
|
@ -0,0 +1,93 @@
|
||||
package com.hw.qms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hw.qms.mapper.QmsCheckInstanceFileMapper;
|
||||
import com.hw.qms.domain.QmsCheckInstanceFile;
|
||||
import com.hw.qms.service.IQmsCheckInstanceFileService;
|
||||
|
||||
/**
|
||||
* 质检文件Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
@Service
|
||||
public class QmsCheckInstanceFileServiceImpl implements IQmsCheckInstanceFileService
|
||||
{
|
||||
@Autowired
|
||||
private QmsCheckInstanceFileMapper qmsCheckInstanceFileMapper;
|
||||
|
||||
/**
|
||||
* 查询质检文件
|
||||
*
|
||||
* @param checkInstanceFileId 质检文件主键
|
||||
* @return 质检文件
|
||||
*/
|
||||
@Override
|
||||
public QmsCheckInstanceFile selectQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId)
|
||||
{
|
||||
return qmsCheckInstanceFileMapper.selectQmsCheckInstanceFileByCheckInstanceFileId(checkInstanceFileId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询质检文件列表
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 质检文件
|
||||
*/
|
||||
@Override
|
||||
public List<QmsCheckInstanceFile> selectQmsCheckInstanceFileList(QmsCheckInstanceFile qmsCheckInstanceFile)
|
||||
{
|
||||
return qmsCheckInstanceFileMapper.selectQmsCheckInstanceFileList(qmsCheckInstanceFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增质检文件
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile)
|
||||
{
|
||||
return qmsCheckInstanceFileMapper.insertQmsCheckInstanceFile(qmsCheckInstanceFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改质检文件
|
||||
*
|
||||
* @param qmsCheckInstanceFile 质检文件
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateQmsCheckInstanceFile(QmsCheckInstanceFile qmsCheckInstanceFile)
|
||||
{
|
||||
return qmsCheckInstanceFileMapper.updateQmsCheckInstanceFile(qmsCheckInstanceFile);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除质检文件
|
||||
*
|
||||
* @param checkInstanceFileIds 需要删除的质检文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteQmsCheckInstanceFileByCheckInstanceFileIds(Long[] checkInstanceFileIds)
|
||||
{
|
||||
return qmsCheckInstanceFileMapper.deleteQmsCheckInstanceFileByCheckInstanceFileIds(checkInstanceFileIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除质检文件信息
|
||||
*
|
||||
* @param checkInstanceFileId 质检文件主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteQmsCheckInstanceFileByCheckInstanceFileId(Long checkInstanceFileId)
|
||||
{
|
||||
return qmsCheckInstanceFileMapper.deleteQmsCheckInstanceFileByCheckInstanceFileId(checkInstanceFileId);
|
||||
}
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
package com.hw.qms.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import com.hw.common.core.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.hw.qms.domain.QmsQualityInstanceActivity;
|
||||
import com.hw.qms.mapper.QmsQualityInstanceMapper;
|
||||
import com.hw.qms.domain.QmsQualityInstance;
|
||||
import com.hw.qms.service.IQmsQualityInstanceService;
|
||||
|
||||
/**
|
||||
* 质检工单Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-01-23
|
||||
*/
|
||||
@Service
|
||||
public class QmsQualityInstanceServiceImpl implements IQmsQualityInstanceService
|
||||
{
|
||||
@Autowired
|
||||
private QmsQualityInstanceMapper qmsQualityInstanceMapper;
|
||||
|
||||
/**
|
||||
* 查询质检工单
|
||||
*
|
||||
* @param qualityInstanceId 质检工单主键
|
||||
* @return 质检工单
|
||||
*/
|
||||
@Override
|
||||
public QmsQualityInstance selectQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId)
|
||||
{
|
||||
return qmsQualityInstanceMapper.selectQmsQualityInstanceByQualityInstanceId(qualityInstanceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询质检工单列表
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 质检工单
|
||||
*/
|
||||
@Override
|
||||
public List<QmsQualityInstance> selectQmsQualityInstanceList(QmsQualityInstance qmsQualityInstance)
|
||||
{
|
||||
return qmsQualityInstanceMapper.selectQmsQualityInstanceList(qmsQualityInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增质检工单
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertQmsQualityInstance(QmsQualityInstance qmsQualityInstance)
|
||||
{
|
||||
qmsQualityInstance.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = qmsQualityInstanceMapper.insertQmsQualityInstance(qmsQualityInstance);
|
||||
insertQmsQualityInstanceActivity(qmsQualityInstance);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改质检工单
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateQmsQualityInstance(QmsQualityInstance qmsQualityInstance)
|
||||
{
|
||||
qmsQualityInstance.setUpdateTime(DateUtils.getNowDate());
|
||||
qmsQualityInstanceMapper.deleteQmsQualityInstanceActivityByQualityInstanceId(qmsQualityInstance.getQualityInstanceId());
|
||||
insertQmsQualityInstanceActivity(qmsQualityInstance);
|
||||
return qmsQualityInstanceMapper.updateQmsQualityInstance(qmsQualityInstance);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除质检工单
|
||||
*
|
||||
* @param qualityInstanceIds 需要删除的质检工单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteQmsQualityInstanceByQualityInstanceIds(Long[] qualityInstanceIds)
|
||||
{
|
||||
qmsQualityInstanceMapper.deleteQmsQualityInstanceActivityByQualityInstanceIds(qualityInstanceIds);
|
||||
return qmsQualityInstanceMapper.deleteQmsQualityInstanceByQualityInstanceIds(qualityInstanceIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除质检工单信息
|
||||
*
|
||||
* @param qualityInstanceId 质检工单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteQmsQualityInstanceByQualityInstanceId(Long qualityInstanceId)
|
||||
{
|
||||
qmsQualityInstanceMapper.deleteQmsQualityInstanceActivityByQualityInstanceId(qualityInstanceId);
|
||||
return qmsQualityInstanceMapper.deleteQmsQualityInstanceByQualityInstanceId(qualityInstanceId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增质检工单实例节点信息
|
||||
*
|
||||
* @param qmsQualityInstance 质检工单对象
|
||||
*/
|
||||
public void insertQmsQualityInstanceActivity(QmsQualityInstance qmsQualityInstance)
|
||||
{
|
||||
List<QmsQualityInstanceActivity> qmsQualityInstanceActivityList = qmsQualityInstance.getQmsQualityInstanceActivityList();
|
||||
Long qualityInstanceId = qmsQualityInstance.getQualityInstanceId();
|
||||
if (StringUtils.isNotNull(qmsQualityInstanceActivityList))
|
||||
{
|
||||
List<QmsQualityInstanceActivity> list = new ArrayList<QmsQualityInstanceActivity>();
|
||||
for (QmsQualityInstanceActivity qmsQualityInstanceActivity : qmsQualityInstanceActivityList)
|
||||
{
|
||||
qmsQualityInstanceActivity.setQualityInstanceId(qualityInstanceId);
|
||||
list.add(qmsQualityInstanceActivity);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
qmsQualityInstanceMapper.batchQmsQualityInstanceActivity(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询质检工单
|
||||
*
|
||||
* @param checkResultId 质检结果ID
|
||||
* @return 质检工单
|
||||
*/
|
||||
@Override
|
||||
public QmsQualityInstance selectQmsQualityInstanceByCheckResultId(Long checkResultId)
|
||||
{
|
||||
return qmsQualityInstanceMapper.selectQmsQualityInstanceByCheckResultId(checkResultId);
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
<?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.QmsCheckInstanceFileMapper">
|
||||
|
||||
<resultMap type="QmsCheckInstanceFile" id="QmsCheckInstanceFileResult">
|
||||
<result property="checkInstanceFileId" column="check_instance_file_id" />
|
||||
<result property="targetType" column="target_type" />
|
||||
<result property="targetId" column="target_id" />
|
||||
<result property="faultFile" column="fault_file" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectQmsCheckInstanceFileVo">
|
||||
select check_instance_file_id, target_type, target_id, fault_file from qms_check_instance_file
|
||||
</sql>
|
||||
|
||||
<select id="selectQmsCheckInstanceFileList" parameterType="QmsCheckInstanceFile" resultMap="QmsCheckInstanceFileResult">
|
||||
<include refid="selectQmsCheckInstanceFileVo"/>
|
||||
<where>
|
||||
<if test="targetType != null and targetType != ''"> and target_type = #{targetType}</if>
|
||||
<if test="targetId != null "> and target_id = #{targetId}</if>
|
||||
<if test="faultFile != null and faultFile != ''"> and fault_file = #{faultFile}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQmsCheckInstanceFileByCheckInstanceFileId" parameterType="Long" resultMap="QmsCheckInstanceFileResult">
|
||||
<include refid="selectQmsCheckInstanceFileVo"/>
|
||||
where check_instance_file_id = #{checkInstanceFileId}
|
||||
</select>
|
||||
|
||||
<insert id="insertQmsCheckInstanceFile" parameterType="QmsCheckInstanceFile" useGeneratedKeys="true" keyProperty="checkInstanceFileId">
|
||||
insert into qms_check_instance_file
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="targetType != null and targetType != ''">target_type,</if>
|
||||
<if test="targetId != null">target_id,</if>
|
||||
<if test="faultFile != null and faultFile != ''">fault_file,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="targetType != null and targetType != ''">#{targetType},</if>
|
||||
<if test="targetId != null">#{targetId},</if>
|
||||
<if test="faultFile != null and faultFile != ''">#{faultFile},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateQmsCheckInstanceFile" parameterType="QmsCheckInstanceFile">
|
||||
update qms_check_instance_file
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="targetType != null and targetType != ''">target_type = #{targetType},</if>
|
||||
<if test="targetId != null">target_id = #{targetId},</if>
|
||||
<if test="faultFile != null and faultFile != ''">fault_file = #{faultFile},</if>
|
||||
</trim>
|
||||
where check_instance_file_id = #{checkInstanceFileId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQmsCheckInstanceFileByCheckInstanceFileId" parameterType="Long">
|
||||
delete from qms_check_instance_file where check_instance_file_id = #{checkInstanceFileId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQmsCheckInstanceFileByCheckInstanceFileIds" parameterType="String">
|
||||
delete from qms_check_instance_file where check_instance_file_id in
|
||||
<foreach item="checkInstanceFileId" collection="array" open="(" separator="," close=")">
|
||||
#{checkInstanceFileId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,157 @@
|
||||
<?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.QmsQualityInstanceMapper">
|
||||
|
||||
<resultMap type="QmsQualityInstance" id="QmsQualityInstanceResult">
|
||||
<result property="qualityInstanceId" column="quality_instance_id" />
|
||||
<result property="wfProcessId" column="wf_process_id" />
|
||||
<result property="wfInstanceStatus" column="wf_instance_status" />
|
||||
<result property="checkResultId" column="check_result_id" />
|
||||
<result property="qualityDescription" column="quality_description" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<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>
|
||||
|
||||
<resultMap id="QmsQualityInstanceQmsQualityInstanceActivityResult" type="QmsQualityInstance" extends="QmsQualityInstanceResult">
|
||||
<collection property="qmsQualityInstanceActivityList" notNullColumn="sub_instance_activity_id" javaType="java.util.List" resultMap="QmsQualityInstanceActivityResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="QmsQualityInstanceActivity" id="QmsQualityInstanceActivityResult">
|
||||
<result property="instanceActivityId" column="sub_instance_activity_id" />
|
||||
<result property="qualityInstanceId" column="sub_quality_instance_id" />
|
||||
<result property="processActivityId" column="sub_process_activity_id" />
|
||||
<result property="processHandleResolution" column="sub_process_handle_resolution" />
|
||||
<result property="processHandleDesc" column="sub_process_handle_desc" />
|
||||
<result property="processHandleStatus" column="sub_process_handle_status" />
|
||||
<result property="processStepOrder" column="sub_process_step_order" />
|
||||
<result property="startTime" column="sub_start_time" />
|
||||
<result property="endTime" column="sub_end_time" />
|
||||
<result property="handleUserId" column="sub_handle_user_id" />
|
||||
<result property="handleBy" column="sub_handle_by" />
|
||||
<result property="handleTime" column="sub_handle_time" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
<result property="transferUserId" column="sub_transfer_user_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectQmsQualityInstanceVo">
|
||||
select quality_instance_id, wf_process_id, wf_instance_status, check_result_id, quality_description, start_time, end_time, create_by, create_time, update_by, update_time from qms_quality_instance
|
||||
</sql>
|
||||
|
||||
<select id="selectQmsQualityInstanceList" parameterType="QmsQualityInstance" resultMap="QmsQualityInstanceResult">
|
||||
<include refid="selectQmsQualityInstanceVo"/>
|
||||
<where>
|
||||
<if test="wfProcessId != null "> and wf_process_id = #{wfProcessId}</if>
|
||||
<if test="wfInstanceStatus != null and wfInstanceStatus != ''"> and wf_instance_status = #{wfInstanceStatus}</if>
|
||||
<if test="checkResultId != null "> and check_result_id = #{checkResultId}</if>
|
||||
<if test="qualityDescription != null and qualityDescription != ''"> and quality_description = #{qualityDescription}</if>
|
||||
<if test="startTime != null "> and start_time = #{startTime}</if>
|
||||
<if test="endTime != null "> and end_time = #{endTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQmsQualityInstanceByQualityInstanceId" parameterType="Long" resultMap="QmsQualityInstanceQmsQualityInstanceActivityResult">
|
||||
select a.quality_instance_id, a.wf_process_id, a.wf_instance_status, a.check_result_id, a.quality_description, a.start_time, a.end_time, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.instance_activity_id as sub_instance_activity_id, b.quality_instance_id as sub_quality_instance_id, b.process_activity_id as sub_process_activity_id, b.process_handle_resolution as sub_process_handle_resolution, b.process_handle_desc as sub_process_handle_desc, b.process_handle_status as sub_process_handle_status, b.process_step_order as sub_process_step_order, b.start_time as sub_start_time, b.end_time as sub_end_time, b.handle_user_id as sub_handle_user_id, b.handle_by as sub_handle_by, b.handle_time as sub_handle_time, b.create_by as sub_create_by, b.create_time as sub_create_time, b.transfer_user_id as sub_transfer_user_id
|
||||
from qms_quality_instance a
|
||||
left join qms_quality_instance_activity b on b.quality_instance_id = a.quality_instance_id
|
||||
where a.quality_instance_id = #{qualityInstanceId}
|
||||
</select>
|
||||
|
||||
<insert id="insertQmsQualityInstance" parameterType="QmsQualityInstance" useGeneratedKeys="true" keyProperty="qualityInstanceId">
|
||||
insert into qms_quality_instance
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="wfProcessId != null">wf_process_id,</if>
|
||||
<if test="wfInstanceStatus != null and wfInstanceStatus != ''">wf_instance_status,</if>
|
||||
<if test="checkResultId != null">check_result_id,</if>
|
||||
<if test="qualityDescription != null">quality_description,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</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="wfProcessId != null">#{wfProcessId},</if>
|
||||
<if test="wfInstanceStatus != null and wfInstanceStatus != ''">#{wfInstanceStatus},</if>
|
||||
<if test="checkResultId != null">#{checkResultId},</if>
|
||||
<if test="qualityDescription != null">#{qualityDescription},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</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="updateQmsQualityInstance" parameterType="QmsQualityInstance">
|
||||
update qms_quality_instance
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="wfProcessId != null">wf_process_id = #{wfProcessId},</if>
|
||||
<if test="wfInstanceStatus != null and wfInstanceStatus != ''">wf_instance_status = #{wfInstanceStatus},</if>
|
||||
<if test="checkResultId != null">check_result_id = #{checkResultId},</if>
|
||||
<if test="qualityDescription != null">quality_description = #{qualityDescription},</if>
|
||||
<if test="startTime != null">start_time = #{startTime},</if>
|
||||
<if test="endTime != null">end_time = #{endTime},</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 quality_instance_id = #{qualityInstanceId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQmsQualityInstanceByQualityInstanceId" parameterType="Long">
|
||||
delete from qms_quality_instance where quality_instance_id = #{qualityInstanceId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQmsQualityInstanceByQualityInstanceIds" parameterType="String">
|
||||
delete from qms_quality_instance where quality_instance_id in
|
||||
<foreach item="qualityInstanceId" collection="array" open="(" separator="," close=")">
|
||||
#{qualityInstanceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQmsQualityInstanceActivityByQualityInstanceIds" parameterType="String">
|
||||
delete from qms_quality_instance_activity where quality_instance_id in
|
||||
<foreach item="qualityInstanceId" collection="array" open="(" separator="," close=")">
|
||||
#{qualityInstanceId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQmsQualityInstanceActivityByQualityInstanceId" parameterType="Long">
|
||||
delete from qms_quality_instance_activity where quality_instance_id = #{qualityInstanceId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchQmsQualityInstanceActivity">
|
||||
insert into qms_quality_instance_activity( 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) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.instanceActivityId}, #{item.qualityInstanceId}, #{item.processActivityId}, #{item.processHandleResolution}, #{item.processHandleDesc}, #{item.processHandleStatus}, #{item.processStepOrder}, #{item.startTime}, #{item.endTime}, #{item.handleUserId}, #{item.handleBy}, #{item.handleTime}, #{item.createBy}, #{item.createTime}, #{item.transferUserId})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectQmsQualityInstanceByCheckResultId" parameterType="Long" resultMap="QmsQualityInstanceQmsQualityInstanceActivityResult">
|
||||
select a.quality_instance_id, a.wf_process_id, a.wf_instance_status, a.check_result_id, a.quality_description, a.start_time, a.end_time, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.instance_activity_id as sub_instance_activity_id, b.quality_instance_id as sub_quality_instance_id, b.process_activity_id as sub_process_activity_id, b.process_handle_resolution as sub_process_handle_resolution, b.process_handle_desc as sub_process_handle_desc, b.process_handle_status as sub_process_handle_status, b.process_step_order as sub_process_step_order, b.start_time as sub_start_time, b.end_time as sub_end_time, b.handle_user_id as sub_handle_user_id, b.handle_by as sub_handle_by, b.handle_time as sub_handle_time, b.create_by as sub_create_by, b.create_time as sub_create_time, b.transfer_user_id as sub_transfer_user_id
|
||||
from qms_quality_instance a
|
||||
left join qms_quality_instance_activity b on b.quality_instance_id = a.quality_instance_id
|
||||
where a.check_result_id = #{checkResultId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue