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}