过程检验ABC不良数据动态获取,抽样规则优化,物料组新增优化
parent
a3d169cbea
commit
af4f0111f1
@ -0,0 +1,69 @@
|
||||
package com.op.quality.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.quality.domain.QcCheckTaskDefect;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 来料检验任务--不良数量Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-01-11
|
||||
*/
|
||||
@Mapper
|
||||
public interface QcCheckTaskDefectMapper {
|
||||
/**
|
||||
* 查询来料检验任务--不良数量
|
||||
*
|
||||
* @param recordId 来料检验任务--不良数量主键
|
||||
* @return 来料检验任务--不良数量
|
||||
*/
|
||||
public QcCheckTaskDefect selectQcCheckTaskDefectByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--不良数量列表
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 来料检验任务--不良数量集合
|
||||
*/
|
||||
public List<QcCheckTaskDefect> selectQcCheckTaskDefectList(QcCheckTaskDefect qcCheckTaskDefect);
|
||||
|
||||
/**
|
||||
* 新增来料检验任务--不良数量
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcCheckTaskDefect(QcCheckTaskDefect qcCheckTaskDefect);
|
||||
|
||||
/**
|
||||
* 修改来料检验任务--不良数量
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcCheckTaskDefect(QcCheckTaskDefect qcCheckTaskDefect);
|
||||
|
||||
/**
|
||||
* 删除来料检验任务--不良数量
|
||||
*
|
||||
* @param recordId 来料检验任务--不良数量主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckTaskDefectByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 批量删除来料检验任务--不良数量
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckTaskDefectByRecordIds(String[] recordIds);
|
||||
|
||||
public int deleteQcCheckTaskDefectByBelongTo(String belongTo);
|
||||
|
||||
public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.op.quality.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.op.quality.domain.QcCheckTaskDefect;
|
||||
|
||||
/**
|
||||
* 来料检验任务--不良数量Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-01-11
|
||||
*/
|
||||
public interface IQcCheckTaskDefectService {
|
||||
/**
|
||||
* 查询来料检验任务--不良数量
|
||||
*
|
||||
* @param recordId 来料检验任务--不良数量主键
|
||||
* @return 来料检验任务--不良数量
|
||||
*/
|
||||
public QcCheckTaskDefect selectQcCheckTaskDefectByRecordId(String recordId);
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--不良数量列表
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 来料检验任务--不良数量集合
|
||||
*/
|
||||
public List<QcCheckTaskDefect> selectQcCheckTaskDefectList(QcCheckTaskDefect qcCheckTaskDefect);
|
||||
|
||||
/**
|
||||
* 新增来料检验任务--不良数量
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertQcCheckTaskDefect(QcCheckTaskDefect qcCheckTaskDefect);
|
||||
|
||||
/**
|
||||
* 修改来料检验任务--不良数量
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateQcCheckTaskDefect(QcCheckTaskDefect qcCheckTaskDefect);
|
||||
|
||||
/**
|
||||
* 批量删除来料检验任务--不良数量
|
||||
*
|
||||
* @param recordIds 需要删除的来料检验任务--不良数量主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckTaskDefectByRecordIds(String[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除来料检验任务--不良数量信息
|
||||
*
|
||||
* @param recordId 来料检验任务--不良数量主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteQcCheckTaskDefectByRecordId(String recordId);
|
||||
|
||||
public int deleteQcCheckTaskDefectByBelongTo(String belongTo);
|
||||
|
||||
public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo);
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package com.op.quality.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.op.quality.mapper.QcCheckTaskDefectMapper;
|
||||
import com.op.quality.domain.QcCheckTaskDefect;
|
||||
import com.op.quality.service.IQcCheckTaskDefectService;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 来料检验任务--不良数量Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2024-01-11
|
||||
*/
|
||||
@Service
|
||||
public class QcCheckTaskDefectServiceImpl implements IQcCheckTaskDefectService {
|
||||
@Autowired
|
||||
private QcCheckTaskDefectMapper qcCheckTaskDefectMapper;
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--不良数量
|
||||
*
|
||||
* @param recordId 来料检验任务--不良数量主键
|
||||
* @return 来料检验任务--不良数量
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public QcCheckTaskDefect selectQcCheckTaskDefectByRecordId(String recordId) {
|
||||
return qcCheckTaskDefectMapper.selectQcCheckTaskDefectByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询来料检验任务--不良数量列表
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 来料检验任务--不良数量
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<QcCheckTaskDefect> selectQcCheckTaskDefectList(QcCheckTaskDefect qcCheckTaskDefect) {
|
||||
return qcCheckTaskDefectMapper.selectQcCheckTaskDefectList(qcCheckTaskDefect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增来料检验任务--不良数量
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertQcCheckTaskDefect(QcCheckTaskDefect qcCheckTaskDefect) {
|
||||
qcCheckTaskDefect.setRecordId(IdUtils.fastSimpleUUID());
|
||||
qcCheckTaskDefect.setCreateBy(SecurityUtils.getUsername());
|
||||
qcCheckTaskDefect.setCreateTime(DateUtils.getNowDate());
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
String key = "#header.poolName";
|
||||
qcCheckTaskDefect.setFactoryCode(request.getHeader(key.substring(8)).replace("ds_",""));
|
||||
return qcCheckTaskDefectMapper.insertQcCheckTaskDefect(qcCheckTaskDefect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改来料检验任务--不良数量
|
||||
*
|
||||
* @param qcCheckTaskDefect 来料检验任务--不良数量
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateQcCheckTaskDefect(QcCheckTaskDefect qcCheckTaskDefect) {
|
||||
qcCheckTaskDefect.setUpdateTime(DateUtils.getNowDate());
|
||||
qcCheckTaskDefect.setUpdateBy(SecurityUtils.getUsername());
|
||||
return qcCheckTaskDefectMapper.updateQcCheckTaskDefect(qcCheckTaskDefect);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除来料检验任务--不良数量
|
||||
*
|
||||
* @param recordIds 需要删除的来料检验任务--不良数量主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteQcCheckTaskDefectByRecordIds(String[] recordIds) {
|
||||
return qcCheckTaskDefectMapper.deleteQcCheckTaskDefectByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除来料检验任务--不良数量信息
|
||||
*
|
||||
* @param recordId 来料检验任务--不良数量主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteQcCheckTaskDefectByRecordId(String recordId) {
|
||||
return qcCheckTaskDefectMapper.deleteQcCheckTaskDefectByRecordId(recordId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteQcCheckTaskDefectByBelongTo(String belongTo) {
|
||||
return qcCheckTaskDefectMapper.deleteQcCheckTaskDefectByBelongTo(belongTo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QcCheckTaskDefect> selectDefectByBelongTo(String belongTo) {
|
||||
return qcCheckTaskDefectMapper.selectDefectByBelongTo(belongTo);
|
||||
}
|
||||
}
|
@ -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.op.quality.mapper.QcCheckTaskDefectMapper">
|
||||
|
||||
<resultMap type="QcCheckTaskDefect" id="QcCheckTaskDefectResult">
|
||||
<result property="recordId" column="record_id" />
|
||||
<result property="defectCode" column="defect_code" />
|
||||
<result property="defectSubclass" column="defect_subclass" />
|
||||
<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" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="belongTo" column="belong_to" />
|
||||
<result property="okQuality" column="ok_quality" />
|
||||
<result property="noOkQuality" column="noOk_quality" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectQcCheckTaskDefectVo">
|
||||
select record_id, defect_code, defect_subclass, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, del_flag, belong_to, ok_quality, noOk_quality from qc_check_task_defect
|
||||
</sql>
|
||||
|
||||
<select id="selectQcCheckTaskDefectList" parameterType="QcCheckTaskDefect" resultMap="QcCheckTaskDefectResult">
|
||||
<include refid="selectQcCheckTaskDefectVo"/>
|
||||
<where>
|
||||
<if test="defectCode != null and defectCode != ''"> and defect_code = #{defectCode}</if>
|
||||
<if test="defectSubclass != null and defectSubclass != ''"> and defect_subclass = #{defectSubclass}</if>
|
||||
<if test="attr1 != null and attr1 != ''"> and attr1 = #{attr1}</if>
|
||||
<if test="attr2 != null and attr2 != ''"> and attr2 = #{attr2}</if>
|
||||
<if test="attr3 != null and attr3 != ''"> and attr3 = #{attr3}</if>
|
||||
<if test="attr4 != null and attr4 != ''"> and attr4 = #{attr4}</if>
|
||||
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||||
<if test="belongTo != null and belongTo != ''"> and belong_to = #{belongTo}</if>
|
||||
<if test="okQuality != null "> and ok_quality = #{okQuality}</if>
|
||||
<if test="noOkQuality != null "> and noOk_quality = #{noOkQuality}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectQcCheckTaskDefectByRecordId" parameterType="String" resultMap="QcCheckTaskDefectResult">
|
||||
<include refid="selectQcCheckTaskDefectVo"/>
|
||||
where record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertQcCheckTaskDefect" parameterType="QcCheckTaskDefect">
|
||||
insert into qc_check_task_defect
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">record_id,</if>
|
||||
<if test="defectCode != null">defect_code,</if>
|
||||
<if test="defectSubclass != null">defect_subclass,</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>
|
||||
<if test="factoryCode != null and factoryCode != ''">factory_code,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="belongTo != null">belong_to,</if>
|
||||
<if test="okQuality != null">ok_quality,</if>
|
||||
<if test="noOkQuality != null">noOk_quality,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="recordId != null">#{recordId},</if>
|
||||
<if test="defectCode != null">#{defectCode},</if>
|
||||
<if test="defectSubclass != null">#{defectSubclass},</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>
|
||||
<if test="factoryCode != null and factoryCode != ''">#{factoryCode},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="belongTo != null">#{belongTo},</if>
|
||||
<if test="okQuality != null">#{okQuality},</if>
|
||||
<if test="noOkQuality != null">#{noOkQuality},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateQcCheckTaskDefect" parameterType="QcCheckTaskDefect">
|
||||
update qc_check_task_defect
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="defectCode != null">defect_code = #{defectCode},</if>
|
||||
<if test="defectSubclass != null">defect_subclass = #{defectSubclass},</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>
|
||||
<if test="factoryCode != null and factoryCode != ''">factory_code = #{factoryCode},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="belongTo != null">belong_to = #{belongTo},</if>
|
||||
<if test="okQuality != null">ok_quality = #{okQuality},</if>
|
||||
<if test="noOkQuality != null">noOk_quality = #{noOkQuality},</if>
|
||||
</trim>
|
||||
where record_id = #{recordId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteQcCheckTaskDefectByRecordId" parameterType="String">
|
||||
delete from qc_check_task_defect where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQcCheckTaskDefectByRecordIds" parameterType="String">
|
||||
delete from qc_check_task_defect where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteQcCheckTaskDefectByBelongTo" parameterType="String">
|
||||
delete from qc_check_task_defect where belong_to = #{belongTo}
|
||||
</delete>
|
||||
|
||||
<select id="selectDefectByBelongTo" parameterType="QcCheckTaskDefect" resultMap="QcCheckTaskDefectResult">
|
||||
<include refid="selectQcCheckTaskDefectVo"/>
|
||||
where belong_to = #{belongTo}
|
||||
order by defect_code
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue