Browse Source

工具属性的维护

master
DouDou 1 year ago
parent
commit
63bbe9a218
  1. 21
      src/main/java/com/spring/modules/base/dao/PropertiesMapper.java
  2. 44
      src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java
  3. 9
      src/main/java/com/spring/modules/part/mapper/PartInformationMapper.java
  4. 344
      src/main/resources/mapper/base/PropertiesMapper.xml
  5. 9
      src/main/resources/mapper/part/PartInformationMapper.xml

21
src/main/java/com/spring/modules/base/dao/PropertiesMapper.java

@ -335,6 +335,14 @@ public interface PropertiesMapper extends BaseMapper<PlmPropertiesItemData> {
List<PartSubPropertiesValueData> getPropertiesListByPartAndCodeNo(PartSubPropertiesValueData inData);
/**
* @description: 工具使用的方法查询属性
* @author LR
* @date 2025/1/26 15:35
* @version 1.0
*/
List<PartSubPropertiesValueData> getPropertiesListByPartAndCodeNoForTool(PartSubPropertiesValueData inData);
void updatePropertiesList(PartSubPropertiesValue inData);
void deleteModalDetailsForBM(PlmBmModelDetailData data);
@ -380,7 +388,7 @@ public interface PropertiesMapper extends BaseMapper<PlmPropertiesItemData> {
List<WorkCenterBMTypeData> searchWorkCenterBMType(WorkCenterBMTypeData data);
/**
* @Description TODO
* @Description
* @Title updateWorkCenterBMType
* @param data
* @author rq
@ -420,6 +428,16 @@ public interface PropertiesMapper extends BaseMapper<PlmPropertiesItemData> {
@Param("codeType")String codeType,
@Param("list") List<String> list);
/**
* @description: 查询属性编码的信息
* @author LR
* @date 2025/1/26 14:51
* @version 1.0
*/
List<PlmPropertiesItemData> searchPropertiesChoose(@Param("site")String site,
@Param("codeType")String codeType,
@Param("list") List<String> list);
/**
* @Description TODO
* @Title 单独插入属性
@ -435,4 +453,5 @@ public interface PropertiesMapper extends BaseMapper<PlmPropertiesItemData> {
Double getNewSeqNoForAlone(PartSubPropertiesValueData inData);
}

44
src/main/java/com/spring/modules/base/service/Impl/PropertiesServiceImpl.java

@ -289,9 +289,15 @@ public class PropertiesServiceImpl implements PropertiesService {
@Override
public List<PlmPropertiesItemData> searchPropertiesItemList(PlmPropertiesModelHeaderData inData){
//公共参数
String functionType = inData.getFunctionType();
List<String> 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<PartSubPropertiesValueData> getPropertiesListByPartAndCodeNo(PartSubPropertiesValueData inData){
List<PartSubPropertiesValueData> result= propertiesMapper.getPropertiesListByPartAndCodeNo(inData);
//公共参数
String recordType = inData.getRecordType();
List<PartSubPropertiesValueData> 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<PlmPropertiesItemAvailableData> availableList = partInformationMapper.getAvailableValueList(result.get(i));
result.get(i).setAvailableValueList(availableList);
//针对工具的情况 需要特殊设置
if("TL".equalsIgnoreCase(recordType) || "TLI".equalsIgnoreCase(recordType)){
List<PlmPropertiesItemAvailableData> availableList = partInformationMapper.getAvailableValueListForTool(result.get(i));
result.get(i).setAvailableValueList(availableList);
}else {
List<PlmPropertiesItemAvailableData> 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<Object> 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<Map<String, Object>> resultList = procedureDao.getProcedureData("plm_refreshPartSubPropertiesValue", params);
//针对工具和工具实例走特殊的方法
List<Map<String, Object>> 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)) {

9
src/main/java/com/spring/modules/part/mapper/PartInformationMapper.java

@ -37,6 +37,15 @@ public interface PartInformationMapper extends BaseMapper<PartInformationEntity>
List<PlmPropertiesItemAvailableData> getAvailableValueList(PartSubPropertiesValueData partSubPropertiesValueData);
/**
* @description: 获取可选值 工具使用
* @author LR
* @date 2025/1/26 15:41
* @version 1.0
*/
List<PlmPropertiesItemAvailableData> getAvailableValueListForTool(PartSubPropertiesValueData partSubPropertiesValueData);
void savePartItemValue(PartSubPropertiesValueData data);
List<AgentInformationEntity> getAgentList(AgentInformationEntity data);

344
src/main/resources/mapper/base/PropertiesMapper.xml

@ -4,22 +4,22 @@
<!-- 查询点检项目 -->
<select id="plmPropertiesItemSearch" parameterType="PlmPropertiesItemData" resultType="PlmPropertiesItemData">
SELECT ppi.site,
ItemNo,
ItemDesc,
DefaultValue,
ValueType,
ValueType_DB as valueTypeDb,
ValueChooseFlag,
CreatedDate,
CreatedBy,
ppi.update_date,
ppi.update_by,
MaxValue,
MinValue,
ItemType,
pt.function_type_desc
ItemNo,
ItemDesc,
DefaultValue,
ValueType,
ValueType_DB as valueTypeDb,
ValueChooseFlag,
CreatedDate,
CreatedBy,
ppi.update_date,
ppi.update_by,
MaxValue,
MinValue,
ItemType,
pt.function_type_desc
FROM plm_properties_item ppi
left join properties_type pt on pt.function_type = ppi.itemType
left join properties_type pt on pt.function_type = ppi.itemType
<where>
ppi.site = #{query.site}
<if test="query.itemType != null and query.itemType != ''">
@ -31,7 +31,7 @@
<if test="query.itemDesc != null and query.itemDesc != ''">
AND ppi.ItemDesc LIKE '%' + #{query.itemDesc} + '%'
</if>
<if test="query.valueType != null and query.valueType != ''">
<if test="query.valueType != null and query.valueType != ''">
AND ppi.valueType LIKE '%' + #{query.valueType} + '%'
</if>
</where>
@ -130,29 +130,29 @@
<select id="plmPropertiesModelSearch" parameterType="PlmPropertiesModelHeaderData"
resultType="PlmPropertiesModelHeaderData">
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
<where>
pmh.site = #{query.site}
<if test="query.codeNo != null and query.codeNo != ''">
@ -298,15 +298,15 @@
<select id="getItemLists" resultType="PlmPropertiesItemData">
SELECT a.itemNo,
a.ItemDesc
a.ItemDesc
FROM plm_properties_item a
LEFT JOIN plm_properties_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
LEFT JOIN plm_properties_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
<where>
a.ItemType = #{functionType}
and a.site = #{site}
AND b.code_no is null
and a.site = #{site}
AND b.code_no is null
<if test="itemNo != null and itemNo != ''">
AND a.ItemNo LIKE '%' + #{itemNo} + '%'
</if>
@ -342,18 +342,18 @@
<select id="searchPropertiesUnChoose" resultType="PlmPropertiesItemData">
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}
<if test="list != null and list.size() != 0">
and b.ItemNo not in (
<foreach collection="list" item="item" separator=",">
@ -363,6 +363,30 @@
</if>
</select>
<!--查询属性选择内容 -->
<select id="searchPropertiesChoose" resultType="PlmPropertiesItemData">
SELECT b.site,
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}
<if test="list != null and list.size() != 0">
and b.ItemNo in (
<foreach collection="list" item="item" separator=",">
#{item}
</foreach>
)
</if>
</select>
<select id="checkValueHeaderData" resultType="PartSubPropertiesValueHeaderData">
SELECT PartNo, Site, CodeNo, SubCodeSeqNo, SubCodeDesc, RecordType
from PartSubPropertiesValueHeader
@ -424,26 +448,26 @@
<select id="getItemModal" resultType="PartSubPropertiesValueData">
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
<where>
AND a.site = #{site}
and RecordType = 'IP'
AND a.PartNo = #{partNo,jdbcType=VARCHAR}
and RecordType = 'IP'
AND a.PartNo = #{partNo,jdbcType=VARCHAR}
</where>
</select>
@ -504,22 +528,22 @@
<select id="propertiesModelSearchForBM" parameterType="PlmBmModelHeaderData" resultType="PlmBmModelHeaderData">
SELECT site,
bu_no,
dbo.plm_get_bu_desc(site, bu_no) buDesc,
function_type,
code_no,
code_desc,
active,
created_date,
created_by,
update_date,
update_by,
delflag,
version,
edit_flag,
properties_code_no,
code_type,
dbo.get_properties_codeDesc(site, function_type, properties_code_no) properties_code_desc
bu_no,
dbo.plm_get_bu_desc(site, bu_no) buDesc,
function_type,
code_no,
code_desc,
active,
created_date,
created_by,
update_date,
update_by,
delflag,
version,
edit_flag,
properties_code_no,
code_type,
dbo.get_properties_codeDesc(site, function_type, properties_code_no) properties_code_desc
FROM plm_bm_model_header
<where>
and site = #{query.site} and delflag='N'
@ -582,15 +606,15 @@
<select id="getItemListsForBM" resultType="PlmPropertiesItemData">
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}
<where>
a.ItemType = #{functionType}
and a.site = #{site}
AND b.code_no is null
and a.site = #{site}
AND b.code_no is null
<if test="itemNo != null and itemNo != ''">
AND a.ItemNo LIKE '%' + #{itemNo} + '%'
</if>
@ -651,27 +675,53 @@
</insert>
<select id="getPropertiesListByPartAndCodeNo" resultType="PartSubPropertiesValueData">
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
<where>
AND a.site = #{site}
and a.RecordType = #{recordType}
and a.codeNo = #{codeNo}
AND a.PartNo = #{partNo,jdbcType=VARCHAR}
</where>
order by a.order_id
</select>
<select id="getPropertiesListByPartAndCodeNoForTool" resultType="PartSubPropertiesValueData">
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
FROM PartSubPropertiesValue a
left join plm_properties_item b on a.PropertiesItemNo = b.ItemNo and b.site = '*' and a.RecordType = b.ItemType
<where>
AND a.site = #{site}
and a.RecordType = #{recordType}
and a.codeNo = #{codeNo}
AND a.PartNo = #{partNo,jdbcType=VARCHAR}
and a.RecordType = #{recordType}
and a.codeNo = #{codeNo}
AND a.PartNo = #{partNo,jdbcType=VARCHAR}
</where>
order by a.order_id
</select>
@ -699,17 +749,17 @@
<select id="getUpItemdata" resultType="com.spring.modules.base.entity.PlmPropertiesModelDetail">
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 #{orderId} > order_id
and site = #{site}
@ -720,17 +770,17 @@
<select id="getDownItemdata" resultType="com.spring.modules.base.entity.PlmPropertiesModelDetail">
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 id="propertiesListSearch" resultType="com.spring.modules.base.entity.PlmPropertiesModelHeader">
SELECT site,
function_type,
code_no,
code_desc,
active,
created_date,
created_by,
update_date,
update_by,
delflag,
version
function_type,
code_no,
code_desc,
active,
created_date,
created_by,
update_date,
update_by,
delflag,
version
FROM plm_properties_model_header
<where>
site = #{site}
and active = 'Y'
and active = 'Y'
<if test="codeNo != null and codeNo != ''">
AND code_no like '%' + #{codeNo} + '%'
</if>
@ -778,8 +828,8 @@
<select id="searchWorkCenterBMType" resultType="WorkCenterBMTypeData">
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
<where>
a.site = #{site}
@ -835,7 +885,7 @@
<select id="searchBUPropertiesList" resultType="com.spring.modules.base.entity.Bu">
select a.bu_no, b.bu_desc
from properties_bu a
left join BU b on a.site = b.site and a.bu_no = b.bu_no
left join BU b on a.site = b.site and a.bu_no = b.bu_no
<where>
<if test="functionType != null and functionType != ''">
and a.function_type = #{functionType}

9
src/main/resources/mapper/part/PartInformationMapper.xml

@ -228,6 +228,15 @@
where itemNo = #{propertiesItemNo} and site = #{site} and ItemType = #{recordType}
</select>
<!--工具专用的方法-->
<select id="getAvailableValueListForTool" resultType="PlmPropertiesItemAvailableData">
select ItemNo, ValueNo, AvailableValue
from plm_properties_item_available
where itemNo = #{propertiesItemNo}
and site = '*'
and ItemType = #{recordType}
</select>
<!-- 编辑属性值 -->
<update id="savePartItemValue" >
update PartSubPropertiesValue

Loading…
Cancel
Save