From 3333fbc02512e9ff735a240ad2c9f4defa40796e Mon Sep 17 00:00:00 2001 From: ruanqi Date: Mon, 30 Sep 2024 13:21:09 +0800 Subject: [PATCH] 1127 --- .../base/controller/PropertiesController.java | 12 +++++++++ .../modules/base/dao/PropertiesMapper.java | 15 +++++++++++ .../service/Impl/PropertiesServiceImpl.java | 18 +++++++++++++ .../base/service/PropertiesService.java | 2 ++ .../mapper/base/PropertiesMapper.xml | 25 +++++++++++++++++-- 5 files changed, 70 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/spring/modules/base/controller/PropertiesController.java b/src/main/java/com/spring/modules/base/controller/PropertiesController.java index 9b76d806..60acb84b 100644 --- a/src/main/java/com/spring/modules/base/controller/PropertiesController.java +++ b/src/main/java/com/spring/modules/base/controller/PropertiesController.java @@ -657,6 +657,18 @@ public class PropertiesController extends AbstractController { return R.ok(); } + @PostMapping("/saveSubPropertiesValueForAlone") + @ResponseBody + public R saveSubPropertiesValueForAlone(@RequestBody List inData){ + propertiesService.saveSubPropertiesValueForAlone(inData); + return R.ok(); + } + @PostMapping("/deleteSubPropertiesValueForAlone") + @ResponseBody + public R deleteSubPropertiesValueForAlone(@RequestBody List inData){ + propertiesService.deleteSubPropertiesValueForAlone(inData); + return R.ok(); + } } 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 1c7ae390..56e25dab 100644 --- a/src/main/java/com/spring/modules/base/dao/PropertiesMapper.java +++ b/src/main/java/com/spring/modules/base/dao/PropertiesMapper.java @@ -417,4 +417,19 @@ public interface PropertiesMapper extends BaseMapper { @Param("codeType")String codeType, @Param("list") List list); + /** + * @Description TODO + * @Title 单独插入属性 + * @param + * @author rq + * @date 2024/9/30 10:45 + * @return null + * @throw + */ + void saveSubPropertiesValueForAlone(PartSubPropertiesValueData inData); + + void deleteSubPropertiesValueForAlone(PartSubPropertiesValueData inData); + + + 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 0d4445d3..0ed42a0a 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 @@ -514,4 +514,22 @@ public class PropertiesServiceImpl implements PropertiesService { throw new RuntimeException(msg); } } + + @Override + @Transactional + public void saveSubPropertiesValueForAlone(List inData){ + for (int i = 0; i inData){ + for (int i = 0; i > searchAllTypeRelationshipList(String functionType); void refreshPropertiesModal(PartSubPropertiesValueData inData); + void saveSubPropertiesValueForAlone(List inData); + void deleteSubPropertiesValueForAlone(List inData); } diff --git a/src/main/resources/mapper/base/PropertiesMapper.xml b/src/main/resources/mapper/base/PropertiesMapper.xml index 2423c97d..a3fb5e6a 100644 --- a/src/main/resources/mapper/base/PropertiesMapper.xml +++ b/src/main/resources/mapper/base/PropertiesMapper.xml @@ -635,7 +635,7 @@ order_id from plm_properties_model_detail where order_id > #{orderId} and site = insert into PartSubPropertiesValue (PartNo,Site,CodeNo,SubCodeSeqNo,SubCodeDesc ,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id) select #{partNo},#{site},#{codeNo},1,a.Code_Desc,b.seq_No,b.properties_item_no,case when c.ValueType_DB='T' then c.DefaultValue - else null end ,case when c.ValueType_DB='N' and c.DefaultValue!='' then c.DefaultValue else null end ,#{recordType} ,b.order_id + else null end ,case when c.ValueType_DB='N' and c.DefaultValue!='' then c.DefaultValue else null end ,#{recordType} ,isnull(b.order_id,999) from plm_properties_model_header a left join plm_properties_model_detail b on a.Code_No=b.Code_No and a.site=b.site and a.function_type=b.function_type left join plm_properties_item c on b.properties_item_no=c.ItemNo and b.site=c.site and a.function_type=c.itemType where a.Code_No=#{codeNo} and a.site=#{site} AND B.SITE IS NOT NULL AND A.function_type=#{recordType} @@ -643,6 +643,27 @@ order_id from plm_properties_model_detail where order_id > #{orderId} and site = insert into PartSubPropertiesValueHeader (PartNo,Site,CodeNo,SubCodeSeqNo,SubCodeDesc,RecordType) - select #{partNo},#{site},#{codeNo},1,Code_Desc,#{recordType} from plm_properties_model_header where Code_No=#{codeNo} and site=#{site} and function_type=#{recordType} + select #{partNo},#{site},#{codeNo},1,Code_Desc,#{recordType} from plm_properties_model_header + where Code_No=#{codeNo} and site=#{site} and function_type=#{recordType} + + + + insert into PartSubPropertiesValue (PartNo,Site,CodeNo,SubCodeSeqNo,SubCodeDesc + ,ItemNo,PropertiesItemNo,TextValue,NumValue,RecordType,order_id) + select #{partNo},#{site},#{codeNo},1,d.SubCodeDesc,#{itemNo,jdbcType=DOUBLE},#{propertiesItemNo},case when c.ValueType_DB='T' then c.DefaultValue + else null end ,case when c.ValueType_DB='N' and c.DefaultValue!='' then c.DefaultValue else null end ,#{recordType} ,#{itemNo,jdbcType=DOUBLE} + from plm_properties_item c + left join PartSubPropertiesValueHeader d on d.PartNo=#{partNo} and d.site=#{site} and CodeNo=#{codeNo} and RecordType=#{recordType} + where c.ItemNo=#{propertiesItemNo} and c.site=#{site} and c.itemType=#{recordType} + + + + delete from PartSubPropertiesValue where Site=#{site} and PartNo=#{partNo} and CodeNo=#{codeNo} and PropertiesItemNo=#{propertiesItemNo} and RecordType=#{recordType} + + + \ No newline at end of file