From c11c055d22176c1118dba1b0eaf93cafb1868380 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 12 Jan 2026 20:09:38 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-12=201=E3=80=81IPQC=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E2=80=9C=E5=8A=A0=E5=B7=A5=E4=B8=AD=E5=BF=83?= =?UTF-8?q?=E2=80=9D=E5=B1=9E=E6=80=A7=202=E3=80=81=E6=A3=80=E9=AA=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=88=97=E8=A1=A8=EF=BC=8C=E2=80=9C=E6=A0=87?= =?UTF-8?q?=E5=87=86=E5=80=BC=E2=80=9D=E3=80=81=E2=80=9C=E4=B8=8A=E9=99=90?= =?UTF-8?q?=E5=80=BC=E2=80=9D=E3=80=81=E2=80=9C=E4=B8=8B=E9=99=90=E5=80=BC?= =?UTF-8?q?=E2=80=9D=E4=B8=89=E4=B8=AA=E5=88=97=E5=85=81=E8=AE=B8=E7=BC=96?= =?UTF-8?q?=E8=BE=91=203=E3=80=81=E3=80=90=E6=A8=A1=E6=9D=BF=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E3=80=91=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E9=9C=80=E8=A6=81=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/base/entity/WorkCenterData.java | 9 ++ .../modules/pms/data/QcFAIRecordData.java | 2 + .../gaotao/modules/pms/mapper/QcMapper.java | 8 ++ .../pms/service/Impl/QcServiceImpl.java | 40 +++++++- .../mapper/orderIssure/IssureNotifyMapper.xml | 3 +- src/main/resources/mapper/pms/QcMapper.xml | 94 +++++++++++++++---- 6 files changed, 137 insertions(+), 19 deletions(-) diff --git a/src/main/java/com/gaotao/modules/base/entity/WorkCenterData.java b/src/main/java/com/gaotao/modules/base/entity/WorkCenterData.java index cf329db..e9c5c1a 100644 --- a/src/main/java/com/gaotao/modules/base/entity/WorkCenterData.java +++ b/src/main/java/com/gaotao/modules/base/entity/WorkCenterData.java @@ -97,6 +97,15 @@ public class WorkCenterData { private int add; private String bu; private String buNo; + private String userName; + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } public String getBu() { return bu; diff --git a/src/main/java/com/gaotao/modules/pms/data/QcFAIRecordData.java b/src/main/java/com/gaotao/modules/pms/data/QcFAIRecordData.java index 5df435b..28aaac2 100644 --- a/src/main/java/com/gaotao/modules/pms/data/QcFAIRecordData.java +++ b/src/main/java/com/gaotao/modules/pms/data/QcFAIRecordData.java @@ -182,6 +182,8 @@ public class QcFAIRecordData extends QueryPage { private Integer subDetailRecordNum; // 加工中心 private String workCenterNo; + // 加工中心 + private String workCenterDesc; // 单位编码 private String umId; // 单位名称 diff --git a/src/main/java/com/gaotao/modules/pms/mapper/QcMapper.java b/src/main/java/com/gaotao/modules/pms/mapper/QcMapper.java index c33a5fd..3e5b7f5 100644 --- a/src/main/java/com/gaotao/modules/pms/mapper/QcMapper.java +++ b/src/main/java/com/gaotao/modules/pms/mapper/QcMapper.java @@ -317,6 +317,14 @@ public interface QcMapper { List getExistingIPQCItems(Map params); void insertIPQCItemDetail(Map params); + + Integer getMaxOrderIdForIPQC(Map params); + + Integer getMaxOrderIdForIQC(Map params); + + Integer getMaxOrderIdForFQC(Map params); + + Integer getMaxOrderIdForOQC(Map params); void deleteIPQCItemDetail(Map params); diff --git a/src/main/java/com/gaotao/modules/pms/service/Impl/QcServiceImpl.java b/src/main/java/com/gaotao/modules/pms/service/Impl/QcServiceImpl.java index f615bf6..775130a 100644 --- a/src/main/java/com/gaotao/modules/pms/service/Impl/QcServiceImpl.java +++ b/src/main/java/com/gaotao/modules/pms/service/Impl/QcServiceImpl.java @@ -2880,11 +2880,18 @@ public class QcServiceImpl implements QcService { targetTemplateId = "*"; } + // 获取当前检验单的最大orderId + Integer maxOrderId = qcMapper.getMaxOrderIdForIPQC(queryParams); + if (maxOrderId == null) { + maxOrderId = 0; + } + int nextOrderId = maxOrderId + 1; + // 遍历选中的模板 for (Map template : templateList) { String templateId = (String) template.get("templateId"); - // 查询模板的所有检验项目 + // 查询模板的所有检验项目(按orderId排序) Map templateItemParams = new HashMap<>(); templateItemParams.put("site", site); templateItemParams.put("buNo", buNo); @@ -2894,7 +2901,7 @@ public class QcServiceImpl implements QcService { // 查询当前检验单已有的项目编码,避免重复导入 List existingItemNos = qcMapper.getExistingItemNos(queryParams); - // 插入模板项目 + // 插入模板项目(按顺序赋予新的orderId) for (EamPropertiesItemData item : templateItems) { // 跳过已存在的项目 if (existingItemNos.contains(item.getItemNo())) { @@ -2915,9 +2922,11 @@ public class QcServiceImpl implements QcService { insertParams.put("valueType", item.getValueType()); insertParams.put("valueTypeDb", item.getValueTypeDb()); insertParams.put("foreignFlag", foreignFlag); + insertParams.put("orderId", nextOrderId); qcMapper.insertIPQCItemDetail(insertParams); importCount++; + nextOrderId++; } } } @@ -3048,6 +3057,13 @@ public class QcServiceImpl implements QcService { targetTemplateId = "*"; } + // 获取当前检验单的最大orderId + Integer maxOrderId = qcMapper.getMaxOrderIdForIQC(queryParams); + if (maxOrderId == null) { + maxOrderId = 0; + } + int nextOrderId = maxOrderId + 1; + for (Map template : templateList) { String templateId = (String) template.get("templateId"); @@ -3071,9 +3087,11 @@ public class QcServiceImpl implements QcService { insertParams.put("itemNo", item.getItemNo()); insertParams.put("templateId", targetTemplateId); insertParams.put("foreignFlag", foreignFlag); + insertParams.put("orderId", nextOrderId); qcMapper.insertIQCItemDetail(insertParams); importCount++; + nextOrderId++; } } } @@ -3202,6 +3220,13 @@ public class QcServiceImpl implements QcService { targetTemplateId = "*"; } + // 获取当前检验单的最大orderId + Integer maxOrderId = qcMapper.getMaxOrderIdForFQC(queryParams); + if (maxOrderId == null) { + maxOrderId = 0; + } + int nextOrderId = maxOrderId + 1; + for (Map template : templateList) { String templateId = (String) template.get("templateId"); @@ -3225,9 +3250,11 @@ public class QcServiceImpl implements QcService { insertParams.put("itemNo", item.getItemNo()); insertParams.put("templateId", targetTemplateId); insertParams.put("foreignFlag", foreignFlag); + insertParams.put("orderId", nextOrderId); qcMapper.insertFQCItemDetail(insertParams); importCount++; + nextOrderId++; } } } @@ -3356,6 +3383,13 @@ public class QcServiceImpl implements QcService { targetTemplateId = "*"; } + // 获取当前检验单的最大orderId + Integer maxOrderId = qcMapper.getMaxOrderIdForOQC(queryParams); + if (maxOrderId == null) { + maxOrderId = 0; + } + int nextOrderId = maxOrderId + 1; + for (Map template : templateList) { String templateId = (String) template.get("templateId"); @@ -3379,9 +3413,11 @@ public class QcServiceImpl implements QcService { insertParams.put("itemNo", item.getItemNo()); insertParams.put("templateId", targetTemplateId); insertParams.put("foreignFlag", foreignFlag); + insertParams.put("orderId", nextOrderId); qcMapper.insertOQCItemDetail(insertParams); importCount++; + nextOrderId++; } } } diff --git a/src/main/resources/mapper/orderIssure/IssureNotifyMapper.xml b/src/main/resources/mapper/orderIssure/IssureNotifyMapper.xml index 5511254..429941e 100644 --- a/src/main/resources/mapper/orderIssure/IssureNotifyMapper.xml +++ b/src/main/resources/mapper/orderIssure/IssureNotifyMapper.xml @@ -650,7 +650,8 @@ WorkCenterNo, WorkCenterDesc from WorkCenter - where site = #{site} and bu_no = #{buNo} + where site in (select site from AccessSite where userID = #{username}) + and bu_no in (select bu_no from AccessBu where username = #{username}) diff --git a/src/main/resources/mapper/pms/QcMapper.xml b/src/main/resources/mapper/pms/QcMapper.xml index 14bff29..b2d65a7 100644 --- a/src/main/resources/mapper/pms/QcMapper.xml +++ b/src/main/resources/mapper/pms/QcMapper.xml @@ -562,11 +562,13 @@ isnull(dbo.joint_name(a.site, a.bu_no, a.inspection_no, 'responsible'), '') as responsiblePersonName, a.pass_qty, a.not_pass_qty, - a.batch_qualified_qty + a.batch_qualified_qty, + w.WorkCenterDesc FROM qc_ipqc_record as a left join part as d on a.site = d.site and a.bu_no = d.bu_no and a.part_no = d.partNo left join sys_user as u on a.inspector_no = u.username left join WorkCenterResource as r on a.site = r.site and a.resource_id = r.resourceId and a.work_center_no = r.workCenterNo + left join WorkCenter as w on a.site = w.site and a.work_center_no = w.workCenterNo and a.bu_no = w.bu_no left join UM as um on a.site = um.site and a.um_id = um.UMID a.site in (select site from AccessSite where userID = #{query.userName}) @@ -616,6 +618,9 @@ AND a.resource_id = #{query.resourceId} + + AND a.work_center_no = #{query.workCenterNo} + AND a.inspector_date >= #{query.startDate} @@ -725,7 +730,10 @@ unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, - number_value = #{numberValue,jdbcType=DECIMAL} + number_value = #{numberValue,jdbcType=DECIMAL}, + default_value = #{defaultValue}, + min_value = #{minValue,jdbcType=DECIMAL}, + max_value = #{maxValue,jdbcType=DECIMAL} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} @@ -1139,7 +1147,10 @@ unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, - number_value = #{numberValue,jdbcType=DECIMAL} + number_value = #{numberValue,jdbcType=DECIMAL}, + default_value = #{defaultValue}, + min_value = #{minValue,jdbcType=DECIMAL}, + max_value = #{maxValue,jdbcType=DECIMAL} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} @@ -1532,7 +1543,10 @@ unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, - number_value = #{numberValue,jdbcType=DECIMAL} + number_value = #{numberValue,jdbcType=DECIMAL}, + default_value = #{defaultValue}, + min_value = #{minValue,jdbcType=DECIMAL}, + max_value = #{maxValue,jdbcType=DECIMAL} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo} @@ -2518,7 +2532,8 @@ value_type, site, bu_no, - foreign_flag + foreign_flag, + order_id ) VALUES ( #{inspectionNo}, #{orderNo}, @@ -2532,9 +2547,19 @@ #{valueType}, #{site}, #{buNo}, - #{foreignFlag} + #{foreignFlag}, + #{orderId} ) + + + @@ -2576,7 +2601,7 @@ ORDER BY t.template_id - + @@ -2675,7 +2701,8 @@ value_type, site, bu_no, - foreign_flag + foreign_flag, + order_id ) VALUES ( #{inspectionNo}, #{templateId}, @@ -2688,9 +2715,19 @@ (SELECT ValueType FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), #{site}, #{buNo}, - #{foreignFlag} + #{foreignFlag}, + #{orderId} ) + + + @@ -2809,7 +2846,8 @@ value_type, site, bu_no, - foreign_flag + foreign_flag, + order_id ) VALUES ( #{inspectionNo}, #{templateId}, @@ -2822,9 +2860,19 @@ (SELECT ValueType FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), #{site}, #{buNo}, - #{foreignFlag} + #{foreignFlag}, + #{orderId} ) + + + @@ -2943,7 +2991,8 @@ value_type, site, bu_no, - foreign_flag + foreign_flag, + order_id ) VALUES ( #{inspectionNo}, #{templateId}, @@ -2956,9 +3005,19 @@ (SELECT ValueType FROM eam_properties_item WHERE site = #{site} AND bu_no = #{buNo} AND ItemNo = #{itemNo}), #{site}, #{buNo}, - #{foreignFlag} + #{foreignFlag}, + #{orderId} ) + + + @@ -3551,7 +3610,10 @@ unqualified_quantity = #{unqualifiedQuantity,jdbcType=DECIMAL}, sampling_qty = #{samplingQty,jdbcType=DECIMAL}, text_value = #{textValue}, - number_value = #{numberValue,jdbcType=DECIMAL} + number_value = #{numberValue,jdbcType=DECIMAL}, + default_value = #{defaultValue}, + min_value = #{minValue,jdbcType=DECIMAL}, + max_value = #{maxValue,jdbcType=DECIMAL} WHERE inspection_no = #{inspectionNo} and item_no = #{itemNo} and site = #{site} and bu_no = #{buNo}