diff --git a/src/main/java/com/spring/modules/base/dao/PropertiesMapper.java b/src/main/java/com/spring/modules/base/dao/PropertiesMapper.java index 5b1c3639..fbdd1909 100644 --- a/src/main/java/com/spring/modules/base/dao/PropertiesMapper.java +++ b/src/main/java/com/spring/modules/base/dao/PropertiesMapper.java @@ -335,6 +335,14 @@ public interface PropertiesMapper extends BaseMapper { List getPropertiesListByPartAndCodeNo(PartSubPropertiesValueData inData); + /** + * @description: 工具使用的方法查询属性 + * @author LR + * @date 2025/1/26 15:35 + * @version 1.0 + */ + List getPropertiesListByPartAndCodeNoForTool(PartSubPropertiesValueData inData); + void updatePropertiesList(PartSubPropertiesValue inData); void deleteModalDetailsForBM(PlmBmModelDetailData data); @@ -380,7 +388,7 @@ public interface PropertiesMapper extends BaseMapper { List searchWorkCenterBMType(WorkCenterBMTypeData data); /** - * @Description TODO + * @Description * @Title updateWorkCenterBMType * @param data * @author rq @@ -420,6 +428,16 @@ public interface PropertiesMapper extends BaseMapper { @Param("codeType")String codeType, @Param("list") List list); + /** + * @description: 查询属性编码的信息 + * @author LR + * @date 2025/1/26 14:51 + * @version 1.0 + */ + List searchPropertiesChoose(@Param("site")String site, + @Param("codeType")String codeType, + @Param("list") List list); + /** * @Description TODO * @Title 单独插入属性 @@ -435,4 +453,5 @@ public interface PropertiesMapper extends BaseMapper { Double getNewSeqNoForAlone(PartSubPropertiesValueData inData); + } diff --git a/src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java b/src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java index 54f09150..312e98d7 100644 --- a/src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java +++ b/src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java @@ -289,9 +289,15 @@ public class PropertiesServiceImpl implements PropertiesService { @Override public List searchPropertiesItemList(PlmPropertiesModelHeaderData inData){ + //公共参数 + String functionType = inData.getFunctionType(); List list = inData.getList().stream().map(PlmPropertiesItemData::getPropertiesItemNo).collect(Collectors.toList()); - return propertiesMapper.searchPropertiesUnChoose(inData.getSite(),inData.getFunctionType(), list); - + //区分是否是工具方法过来的参数 + if("TL".equalsIgnoreCase(functionType) || "TLI".equalsIgnoreCase(functionType)){ + return propertiesMapper.searchPropertiesChoose("*", functionType, list); + }else { + return propertiesMapper.searchPropertiesUnChoose(inData.getSite(), functionType, list); + } } @Override @@ -405,12 +411,24 @@ public class PropertiesServiceImpl implements PropertiesService { @Override @Transactional public List getPropertiesListByPartAndCodeNo(PartSubPropertiesValueData inData){ - - List result= propertiesMapper.getPropertiesListByPartAndCodeNo(inData); + //公共参数 + String recordType = inData.getRecordType(); + List result = null; + if("TL".equalsIgnoreCase(recordType) || "TLI".equalsIgnoreCase(recordType)){ + result = propertiesMapper.getPropertiesListByPartAndCodeNoForTool(inData); + }else { + result = propertiesMapper.getPropertiesListByPartAndCodeNo(inData); + } for (int i = 0; i < result.size(); i++) { if ("Y".equals(result.get(i).getValueChooseFlag())) { - List availableList = partInformationMapper.getAvailableValueList(result.get(i)); - result.get(i).setAvailableValueList(availableList); + //针对工具的情况 需要特殊设置 + if("TL".equalsIgnoreCase(recordType) || "TLI".equalsIgnoreCase(recordType)){ + List availableList = partInformationMapper.getAvailableValueListForTool(result.get(i)); + result.get(i).setAvailableValueList(availableList); + }else { + List availableList = partInformationMapper.getAvailableValueList(result.get(i)); + result.get(i).setAvailableValueList(availableList); + } } } return result; @@ -605,12 +623,20 @@ public class PropertiesServiceImpl implements PropertiesService { @Transactional public void refreshPropertiesModal(PartSubPropertiesValueData inData){ List params = new ArrayList<>(); + String recordType = inData.getRecordType(); params.add(inData.getSite()); - params.add(inData.getRecordType()); + params.add(recordType); params.add(inData.getPartNo()); params.add(inData.getCodeNo()); - //执行方法 - List> resultList = procedureDao.getProcedureData("plm_refreshPartSubPropertiesValue", params); + //针对工具和工具实例走特殊的方法 + List> resultList = null; + if ("TL".equalsIgnoreCase(recordType) || "TLI".equalsIgnoreCase(recordType)){ + //执行方法 + resultList = procedureDao.getProcedureData("plm_refreshPartSubPropertiesValueForTool", params); + }else{ + //执行方法 + resultList = procedureDao.getProcedureData("plm_refreshPartSubPropertiesValue", params); + } //判断是否成功 String code = String.valueOf(resultList.get(0).get("resultCode")); if ("400".equalsIgnoreCase(code)) { diff --git a/src/main/java/com/spring/modules/part/mapper/PartInformationMapper.java b/src/main/java/com/spring/modules/part/mapper/PartInformationMapper.java index 60c739c2..33dc6a54 100644 --- a/src/main/java/com/spring/modules/part/mapper/PartInformationMapper.java +++ b/src/main/java/com/spring/modules/part/mapper/PartInformationMapper.java @@ -37,6 +37,15 @@ public interface PartInformationMapper extends BaseMapper List getAvailableValueList(PartSubPropertiesValueData partSubPropertiesValueData); + /** + * @description: 获取可选值 工具使用 + * @author LR + * @date 2025/1/26 15:41 + * @version 1.0 + */ + List getAvailableValueListForTool(PartSubPropertiesValueData partSubPropertiesValueData); + + void savePartItemValue(PartSubPropertiesValueData data); List getAgentList(AgentInformationEntity data); diff --git a/src/main/resources/mapper/base/PropertiesMapper.xml b/src/main/resources/mapper/base/PropertiesMapper.xml index 260cd4c9..d7739b1a 100644 --- a/src/main/resources/mapper/base/PropertiesMapper.xml +++ b/src/main/resources/mapper/base/PropertiesMapper.xml @@ -4,22 +4,22 @@ SELECT pmh.site, - pmh.function_type, - pmh.code_no, - pmh.code_desc, - pmh.active, - pmh.created_date, - pmh.created_by, - pmh.update_date, - pmh.update_by, - pmh.delflag, - pmh.version, - pmh.is_system, - pr.function_group_desc, - pg.menu_id as [group], - pmh.function_group, - pt.function_type_desc + pmh.function_type, + pmh.code_no, + pmh.code_desc, + pmh.active, + pmh.created_date, + pmh.created_by, + pmh.update_date, + pmh.update_by, + pmh.delflag, + pmh.version, + pmh.is_system, + pr.function_group_desc, + pg.menu_id as [group], + pmh.function_group, + pt.function_type_desc FROM plm_properties_model_header pmh - left join properties_group pg - on pg.site = pmh.site and pg.function_type = pmh.function_type and pg.code_no = pmh.code_no - left join properties_bu bu - on bu.site = pmh.site and bu.function_type = pmh.function_type and bu.code_no = pmh.code_no - left join properties_type pt on pt.function_type = pmh.function_type - left join properties_relationship pr - on pr.function_group = pmh.function_group and pr.function_type = pmh.function_type + left join properties_group pg + on pg.site = pmh.site and pg.function_type = pmh.function_type and pg.code_no = pmh.code_no + left join properties_bu bu + on bu.site = pmh.site and bu.function_type = pmh.function_type and bu.code_no = pmh.code_no + left join properties_type pt on pt.function_type = pmh.function_type + left join properties_relationship pr + on pr.function_group = pmh.function_group and pr.function_type = pmh.function_type pmh.site = #{query.site} @@ -298,15 +298,15 @@ SELECT b.site, - b.ItemType as functionType, - b.ItemNo, - b.ItemDesc, - b.DefaultValue, - b.ValueType, - b.ValueType_DB, - b.ValueChooseFlag, - b.MaxValue, - b.MinValue + b.ItemType as functionType, + b.ItemNo, + b.ItemDesc, + b.DefaultValue, + b.ValueType, + b.ValueType_DB, + b.ValueChooseFlag, + b.MaxValue, + b.MinValue FROM plm_properties_item b where b.ItemType = #{codeType} - and b.site = #{site} + and b.site = #{site} and b.ItemNo not in ( @@ -363,6 +363,30 @@ + + + SELECT a.PartNo - , a.Site - , a.CodeNo - , a.SubCodeSeqNo - , a.SubCodeDesc - , a.ItemNo - , a.PropertiesItemNo - , a.TextValue - , a.NumValue - , a.RecordType - , b.ItemDesc ItemDesc - , b.ValueType - , b.ValueType_DB - , b.ValueChooseFlag + , a.Site + , a.CodeNo + , a.SubCodeSeqNo + , a.SubCodeDesc + , a.ItemNo + , a.PropertiesItemNo + , a.TextValue + , a.NumValue + , a.RecordType + , b.ItemDesc ItemDesc + , b.ValueType + , b.ValueType_DB + , b.ValueChooseFlag FROM PartSubPropertiesValue a - left join plm_properties_item b - on a.PropertiesItemNo = b.ItemNo and a.site = b.site and a.RecordType = b.ItemType + left join plm_properties_item b + on a.PropertiesItemNo = b.ItemNo and a.site = b.site and a.RecordType = b.ItemType AND a.site = #{site} - and RecordType = 'IP' - AND a.PartNo = #{partNo,jdbcType=VARCHAR} + and RecordType = 'IP' + AND a.PartNo = #{partNo,jdbcType=VARCHAR} @@ -504,22 +528,22 @@ SELECT a.itemNo, - a.ItemDesc + a.ItemDesc FROM plm_properties_item a - LEFT JOIN plm_bm_model_detail b on b.function_type = #{functionType} and b.code_no = #{codeNo} and - b.properties_item_no = a.ItemNo and a.site = b.site and - b.bu_no = #{buNo} + LEFT JOIN plm_bm_model_detail b on b.function_type = #{functionType} and b.code_no = #{codeNo} and + b.properties_item_no = a.ItemNo and a.site = b.site and + b.bu_no = #{buNo} a.ItemType = #{functionType} - and a.site = #{site} - AND b.code_no is null + and a.site = #{site} + AND b.code_no is null AND a.ItemNo LIKE '%' + #{itemNo} + '%' @@ -651,27 +675,53 @@ + + @@ -699,17 +749,17 @@ select top 1 site, - function_type, - code_no, - properties_item_no, - seq_no, - created_date, - created_by, - update_date, - update_by, - delflag, - version, - order_id + function_type, + code_no, + properties_item_no, + seq_no, + created_date, + created_by, + update_date, + update_by, + delflag, + version, + order_id from plm_properties_model_detail where order_id > #{orderId} and site = #{site} @@ -750,20 +800,20 @@ select a.site, a.work_center_no, a.work_center_desc, b.itemType, c.type_desc from work_center a - left join WorkCenter_BMType b on a.site = b.site and a.work_center_no = b.workCenterNo - left join plm_route_itemType c on b.itemType = c.item_type + left join WorkCenter_BMType b on a.site = b.site and a.work_center_no = b.workCenterNo + left join plm_route_itemType c on b.itemType = c.item_type a.site = #{site} @@ -835,7 +885,7 @@ + + + update PartSubPropertiesValue