Browse Source

2026-09-21

iqc任务增加刀模
master
fengyuan_yang 23 hours ago
parent
commit
2516ca2438
  1. 4
      src/main/java/com/heai/modules/pms/data/QcTemplateData.java
  2. 2
      src/main/java/com/heai/modules/pms/mapper/QcMapper.java
  3. 20
      src/main/java/com/heai/modules/pms/service/Impl/QcServiceImpl.java
  4. 51
      src/main/resources/mapper/pms/QcMapper.xml

4
src/main/java/com/heai/modules/pms/data/QcTemplateData.java

@ -12,6 +12,10 @@ import java.util.List;
@Data
public class QcTemplateData extends QueryPage {
/**
* qc_attribute_template 自增主键
*/
private Integer id;
// 属性编码
private String attributeNo;
// 属性类别

2
src/main/java/com/heai/modules/pms/mapper/QcMapper.java

@ -293,6 +293,8 @@ public interface QcMapper {
*/
int copyIQCRecordForMachineInspect(QcFAIRecordData data);
String selectNextIQCInspectionNoByDate(QcFAIRecordData data);
List<String> selectMachineInspectNosBySourceInspectionNo(QcFAIRecordData data);
void saveSQCRecord(QcFAIRecordData qcFAIRecordData);

20
src/main/java/com/heai/modules/pms/service/Impl/QcServiceImpl.java

@ -1414,13 +1414,15 @@ public class QcServiceImpl implements QcService {
public void deletePartAttributeDetails(QcTemplateData data) {
if (data.getItemList() != null && !data.getItemList().isEmpty()) { // 批量删除
for (QcTemplateData partData : data.getItemList()) {
partData.setSite(data.getSite());
partData.setBuNo(data.getBuNo());
partData.setAttributeNo(data.getAttributeNo());
partData.setAttributeType(data.getAttributeType());
if (partData.getId() == null) {
throw new RuntimeException("缺少模板ID,无法删除!");
}
qcMapper.deletePartAttributeDetails(partData);
}
} else { // 单条删除
if (data.getId() == null) {
throw new RuntimeException("缺少模板ID,无法删除!");
}
qcMapper.deletePartAttributeDetails(data);
}
}
@ -1431,6 +1433,9 @@ public class QcServiceImpl implements QcService {
@Override
@Transactional
public void saveAttributeDetailed(QcTemplateData data) {
if (data.getId() == null) {
throw new RuntimeException("缺少模板ID,无法保存!");
}
qcMapper.saveAttributeDetailed(data);
// 更新修改时间
qcMapper.updatePartAttributeTime(data);
@ -4016,7 +4021,7 @@ public class QcServiceImpl implements QcService {
return false;
}
String type = recordData.getSubmissionType();
return "合格".equals(recordData.getInspectionResult())
return "合格".equals(getQmsInspectResult(recordData))
&& ("刀模进货检验-外观".equals(type) || "刀模维修检验-外观".equals(type));
}
@ -4043,14 +4048,14 @@ public class QcServiceImpl implements QcService {
}
/**
* 外观合格审核后生成对应的上机检验任务单
* 外观单按合格逻辑审核后生成对应的上机检验任务单结论仍保持原值
*/
private void generateIQCMachineInspectTask(QcFAIRecordData appearanceRecord) {
String machineType = toMachineInspectType(appearanceRecord.getSubmissionType());
if (StringUtils.isBlank(machineType)) {
return;
}
String newInspectionNo = "IQC" + qcMapper.selectIQCInspectionNo(appearanceRecord);
String newInspectionNo = qcMapper.selectNextIQCInspectionNoByDate(appearanceRecord);
QcFAIRecordData copyParam = new QcFAIRecordData();
copyParam.setSite(appearanceRecord.getSite());
@ -6037,6 +6042,7 @@ public class QcServiceImpl implements QcService {
SysUserEntity user = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
submitData.setUpdateBy(user != null ? user.getUsername() : data.getInspectorNo());
submitData.setSubmitList(Collections.singletonList(submitRecord));
submitData.setTriggerMachineInspect(data.getTriggerMachineInspect());
switch (type) {
case IQC:
saveIQCSubmitResult(submitData);

51
src/main/resources/mapper/pms/QcMapper.xml

@ -1357,6 +1357,7 @@
<!-- 查询类别模板 -->
<select id="searchPartAttributeDetails" resultType="com.heai.modules.pms.data.QcTemplateData" parameterType="com.heai.modules.pms.data.QcTemplateData">
SELECT
qat.id,
qat.site,
qat.bu_no,
qpa.attribute_no,
@ -1451,6 +1452,7 @@
<!-- 已有模板 -->
<select id="getPartTemplateList" resultType="com.heai.modules.pms.data.QcTemplateData" parameterType="com.heai.modules.pms.data.QcTemplateData">
SELECT
qat.id,
qt.template_id,
qt.template_name,
qit.inspection_type_name,
@ -1502,24 +1504,10 @@
</where>
</select>
<!-- 删除物料属性模板 -->
<!-- 删除物料属性模板(按自增id。需先执行:ALTER TABLE qc_attribute_template ADD id INT IDENTITY(1,1) NOT NULL;) -->
<delete id="deletePartAttributeDetails" parameterType="com.heai.modules.pms.data.QcTemplateData">
DELETE FROM qc_attribute_template
<where>
site = #{site} and bu_no = #{buNo} and attribute_no = #{attributeNo} and template_id = #{templateId} and attribute_type = #{attributeType}
<if test = "operation != null and operation != ''">
and operation = #{operation}
</if>
<if test = "resourceID != null and resourceID != ''">
and resource_id = #{resourceID}
</if>
<if test = "manufacturerID != null and manufacturerID != ''">
and manufacturer_id = #{manufacturerID}
</if>
<if test = "customerID != null and customerID != ''">
and customer_id = #{customerID}
</if>
</where>
WHERE id = #{id}
</delete>
<!-- 查询模板的基础数据 -->
@ -1548,18 +1536,7 @@
AC = #{ac,jdbcType=DECIMAL},
ipqc_inspection_method = #{ipqcInspectionMethod},
RE = #{re,jdbcType=DECIMAL}
<where>
site = #{site} and attribute_no = #{attributeNo} AND template_id = #{templateId} AND attribute_type = #{attributeType} and bu_no = #{buNo}
<if test = "operation != null and operation != ''">
AND operation = #{operation}
</if>
<if test = "resourceID != null and resourceID != ''">
AND resource_id = #{resourceID}
</if>
<if test = "manufacturerID != null and manufacturerID != ''">
AND manufacturer_id = #{manufacturerID}
</if>
</where>
WHERE id = #{id}
</update>
<!-- 更新物料属性修改时间 -->
@ -2579,6 +2556,18 @@
#{partNo}, #{rollQty}, #{samplingQty,jdbcType=DECIMAL}, #{ssrId}, #{seqNo}, #{batchRollNo}, #{specialRequirements}, #{workCenterNo}, #{rollNo}, #{umId},#{refInfo1},#{refInfo2})
</insert>
<!-- 上机检验单号:IQC + 当天日期 + 4位流水,按当天最大序号 +1 -->
<select id="selectNextIQCInspectionNoByDate" resultType="java.lang.String" parameterType="com.heai.modules.pms.data.QcFAIRecordData">
SELECT
'IQC' + CONVERT(varchar(8), GETDATE(), 112)
+ RIGHT('0000' + CONVERT(varchar(10), ISNULL(MAX(CONVERT(INT, SUBSTRING(inspection_no, 12, 4))), 0) + 1), 4)
FROM qc_iqc_record
WHERE site = #{site}
AND bu_no = #{buNo}
AND inspection_no LIKE 'IQC' + CONVERT(varchar(8), GETDATE(), 112) + '%'
AND LEN(inspection_no) = 15
</select>
<!-- 由外观检验单复制生成上机检验单。需先执行:ALTER TABLE qc_iqc_record ADD source_inspection_no VARCHAR(50) NULL; -->
<insert id="copyIQCRecordForMachineInspect" parameterType="com.heai.modules.pms.data.QcFAIRecordData">
INSERT INTO qc_iqc_record
@ -4410,7 +4399,11 @@
expiration_warning_date,
expiration_date,
ref_info1,
ref_info2
ref_info2,
submission_type,
supplier_no,
inspection_type_no,
part_desc
FROM qc_iqc_record
WHERE site = #{site} AND bu_no = #{buNo} AND inspection_no = #{inspectionNo}
</select>

Loading…
Cancel
Save