Browse Source

2025-06-16

物料件正式物料模板调整
流程干预调整
master
fengyuan_yang 9 months ago
parent
commit
6741e1d9db
  1. 56
      src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java
  2. 10
      src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java
  3. 6
      src/main/java/com/spring/modules/request/mapper/RequestManageMapper.java
  4. 30
      src/main/java/com/spring/modules/request/service/impl/RequestManageServiceImpl.java
  5. 21
      src/main/resources/mapper/request/RequestManageMapper.xml

56
src/main/java/com/spring/modules/part/service/impl/MasterPartInformationServiceImpl.java

@ -258,10 +258,19 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo
MasterPartInformationEntity masterPartInformation = masterPartInformationMapper.selectOne(new QueryWrapper<MasterPartInformationEntity>().eq("part_no", data.getPartNo()));
// 检查物料模板
List<PartSubPropertiesValueData> mpData = masterPartInformationMapper.queryCodeNo(data);
if (mpData.isEmpty() || !mpData.get(0).getCodeNo().equals(data.getCodeNo())) {
// 修改了物料模板
PartSubPropertiesValueData valueData = new PartSubPropertiesValueData();
BeanUtils.copyProperties(data,valueData);
// 如果前端传空值 则删除PLM数据
// 原有新没有删除明细
if (!StringUtils.isNotBlank(data.getCodeNo())) {
// 删除物料的属性和属性值
partInformationMapper.deletePartSubPropertiesValueHeader(valueData);
partInformationMapper.deletePartSubPropertiesValue(valueData);
} else {
// 前端有选择模板 之前是空值 或者 有值但修改了
// 原没有新有插入明细 || 原有新有不一样删除明细然后插入新模板的明细
if (mpData.isEmpty() || !mpData.get(0).getCodeNo().equals(data.getCodeNo())) {
// 修改了物料模板
// 删除物料的属性和属性值
partInformationMapper.deletePartSubPropertiesValueHeader(valueData);
partInformationMapper.deletePartSubPropertiesValue(valueData);
@ -269,6 +278,8 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo
partInformationMapper.savePartSubPropertiesValueHeader(valueData);
partInformationMapper.savePartSubPropertiesValue(valueData);
}
}
// 修改物料
masterPartInformationMapper.masterPartInformationEdit(data);
// 判断有没有 inventPart有则修改 inventPart 净重和体积
@ -295,9 +306,6 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo
throw new RuntimeException("IFS 物料件编辑异常信息:" + updateResponse.get("resultMsg"));
}
// 2025-06-03 如果修改了模板 则调用技术等级修改接口
if (mpData.isEmpty() || !mpData.get(0).getCodeNo().equals(data.getCodeNo())) {
// 先调用查询 有则修改 无则新增
PartIfsCatalogModel partIfsCatalogModel = new PartIfsCatalogModel(); // 模板对象
partIfsCatalogModel.setLuName(luName);
partIfsCatalogModel.setKeyRef("PART_NO=" + data.getPartNo() + "^"); // 物料编码
@ -306,19 +314,41 @@ public class MasterPartInformationServiceImpl extends ServiceImpl<MasterPartInfo
partIfsCatalogModel.setOkYesNo(okYesNo);
partIfsCatalogModel.setOkSign(ifsUser.getIfsUsername());
partIfsCatalogModel.setDtOk(DateUtils.getStringNow2());
Map<String, String> getMasterPartModelResponse = technicalClassBean.getTechnicalClass(srv, partIfsCatalogModel);
if (!"200".equals(getMasterPartModelResponse.get("resultCode"))) {
// 新增
// PLM修改前无模板 PLM修改后有模板 调新增
if (StringUtils.isNotBlank(data.getCodeNo()) && mpData.isEmpty()) {
Map<String, String> addMasterPartModelResponse = technicalClassBean.syncTechnicalClass(srv, partIfsCatalogModel);
if (!"200".equals(addMasterPartModelResponse.get("resultCode"))) {
throw new RuntimeException("IFS 物料件模板新增异常:" + addMasterPartModelResponse.get("resultMsg"));
}
} else {
// 修改
Map<String, String> updateMasterPartModelResponse = technicalClassBean.modifyTechnicalClass(srv, partIfsCatalogModel);
if (!"200".equals(updateMasterPartModelResponse.get("resultCode"))) {
throw new RuntimeException("IFS 物料件模板修改异常:" + updateMasterPartModelResponse.get("resultMsg"));
} else if (!mpData.isEmpty() && !StringUtils.isNotBlank(data.getCodeNo())) {
// PLM修改前有模板 PLM修改后无模板 删除属性明细 删除模板主记录
List<PartIfsCatalogProperty> propertyList = partInformationMapper.getMasterPartPropertyList(data.getSite(), data.getPartNo(), data.getCodeNo(), "MP");
if (!propertyList.isEmpty()) {
Map<String, String> deleteMasterPartPropertyResponse = technicalClassBean.removeTechnicalClassAttributes(srv, propertyList);
if (!"200".equals(deleteMasterPartPropertyResponse.get("resultCode"))) {
throw new RuntimeException("IFS物料属性删除异常:" + deleteMasterPartPropertyResponse.get("resultMsg"));
}
}
Map<String, String> deleteMasterPartModelResponse = technicalClassBean.removeTechnicalClass(srv, partIfsCatalogModel);
if (!"200".equals(deleteMasterPartModelResponse.get("resultCode"))) {
throw new RuntimeException("IFS 物料件模板删除异常:" + deleteMasterPartModelResponse.get("resultMsg"));
}
} else if (!mpData.isEmpty() && StringUtils.isNotBlank(data.getCodeNo()) && !mpData.get(0).getCodeNo().equals(data.getCodeNo())) {
// PLM修改前有模板 PLM修改后有模板 不一样 删除属性明细 删除模板主记录 新增主记录
List<PartIfsCatalogProperty> propertyList = partInformationMapper.getMasterPartPropertyList(data.getSite(), data.getPartNo(), data.getCodeNo(), "MP");
if (!propertyList.isEmpty()) {
Map<String, String> deleteMasterPartPropertyResponse = technicalClassBean.removeTechnicalClassAttributes(srv, propertyList);
if (!"200".equals(deleteMasterPartPropertyResponse.get("resultCode"))) {
throw new RuntimeException("IFS物料属性删除异常:" + deleteMasterPartPropertyResponse.get("resultMsg"));
}
}
Map<String, String> deleteMasterPartModelResponse = technicalClassBean.removeTechnicalClass(srv, partIfsCatalogModel);
if (!"200".equals(deleteMasterPartModelResponse.get("resultCode"))) {
throw new RuntimeException("IFS 物料件模板删除异常:" + deleteMasterPartModelResponse.get("resultMsg"));
}
Map<String, String> addMasterPartModelResponse = technicalClassBean.syncTechnicalClass(srv, partIfsCatalogModel);
if (!"200".equals(addMasterPartModelResponse.get("resultCode"))) {
throw new RuntimeException("IFS 物料件模板新增异常:" + addMasterPartModelResponse.get("resultMsg"));
}
}
}

10
src/main/java/com/spring/modules/part/service/impl/PartInformationServiceImpl.java

@ -4102,7 +4102,8 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
if (!"200".equals(updateResponse.get("resultCode"))) {
throw new RuntimeException("IFS物料件修改异常:" + updateResponse.get("resultMsg"));
}
} else { // 调用新增接口
} else {
// 调用新增接口
Map<String, String> addResponse = masterServiceBean.syncPartCatalog(srv, partIfsCatalog);
if (!"200".equals(addResponse.get("resultCode"))) {
throw new RuntimeException("IFS物料件新增异常:" + addResponse.get("resultMsg"));
@ -4122,12 +4123,13 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
throw new RuntimeException("IFS 物料件模板新增异常:" + addMasterPartModelResponse.get("resultMsg"));
}
}
}
List<PartIfsCatalogProperty> propertyList = partInformationMapper.getMasterPartPropertyList(site, ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP"); // 属性对象
// 批量编辑属性
List<PartIfsCatalogProperty> propertyList = partInformationMapper.getMasterPartPropertyList(site, ifsPart.getPartNo(), ifsPart.getCodeNo(), "MP");
if (!propertyList.isEmpty()) {
Map<String, String> addMasterPartPropertyResponse = technicalClassBean.modifyTechnicalClassAttributes(srv, propertyList);
if (!"200".equals(addMasterPartPropertyResponse.get("resultCode"))) {
throw new RuntimeException("IFS 物料件属性新增异常:" + addMasterPartPropertyResponse.get("resultMsg"));
throw new RuntimeException("IFS 物料件属性编辑异常:" + addMasterPartPropertyResponse.get("resultMsg"));
}
}
}
}

6
src/main/java/com/spring/modules/request/mapper/RequestManageMapper.java

@ -178,4 +178,10 @@ public interface RequestManageMapper extends BaseMapper<PlmRequestHeaderEntity>
@Param("documentType") String documentType, @Param("documentStatus") String documentStatus, @Param("page") int page, @Param("limit") int limit);
void updateProcessInterventionFlag2(ProcessFormVo inData);
void updateProcessNodeByIntervention1(@Param("site") String site, @Param("documentNo") String documentNo, @Param("isRemark") int isRemark, @Param("nodeConclusion1") String nodeConclusion, @Param("nodeConclusion2")Object o);
void updateProcessNodeByIntervention2(@Param("site") String site, @Param("documentNo") String documentNo, @Param("isRemark") int isRemark, @Param("nodeConclusion1")Object o, @Param("nodeConclusion2") String nodeConclusion, @Param("userName") String userId);
List<ProcessFormVo> getStepIdFromProcessForm(@Param("site") String site, @Param("documentNo") String documentNo, @Param("isRemark") int isRemark);
}

30
src/main/java/com/spring/modules/request/service/impl/RequestManageServiceImpl.java

@ -41,6 +41,7 @@ import com.spring.modules.sampleManagement.service.Impl.TechnicalSpecificationSe
import com.spring.modules.sys.dao.SysUserDao;
import com.spring.modules.sys.entity.SysUserEntity;
import com.spring.modules.test.service.impl.TestInformationServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -470,6 +471,35 @@ public class RequestManageServiceImpl extends ServiceImpl<RequestManageMapper, P
} else if (Constant.BM.equals(inData.getDocumentType())) {
technicalSpecificationService.submitQuotationToFlow(vo);
}
} else {
// 修改单据的节点结论和驳回意见
requestManageMapper.updateProcessNodeByIntervention1(inData.getSite(), inData.getDocumentNo(), 0, "Y", null); // 把Y改成null
requestManageMapper.updateProcessNodeByIntervention2(inData.getSite(), inData.getDocumentNo(), 1, null, "Y", data.getUserId()); // 把null改成Y, update_date, update_by
// 修改该变更单的 stepId
List<ProcessFormVo> processList = requestManageMapper.getStepIdFromProcessForm(inData.getSite(), inData.getDocumentNo(), 0); // plm_process_form
if (processList.isEmpty()) {
throw new RuntimeException("流程干预后,未获取到下一个节点!");
}
ParamData paramData = new ParamData();
paramData.setSite(inData.getSite());
paramData.setDocNo(inData.getDocumentNo());
paramData.setStepId(processList.get(0).getStepId());
if (Constant.ECN.equals(inData.getDocumentType())) {
paramData.setTableName("plm_change_request");
} else if (Constant.DY_PR.equals(inData.getDocumentType())) {
paramData.setTableName("plm_proofing_information");
} else if (Constant.TEST.equals(inData.getDocumentType())) {
paramData.setTableName("plm_test_information");
} else if (Constant.TOOL.equals(inData.getDocumentType())) {
paramData.setTableName("plm_project_tool_applyHeader");
} else if (Constant.QUOTATION.equals(inData.getDocumentType())) {
paramData.setTableName("plm_quotation_information");
} else if (Constant.BM.equals(inData.getDocumentType())) {
paramData.setTableName("plm_technical_specification_sheet");
paramData.setRevisionNo(inData.getRevisionNo());
}
changeManagementMapper.updateStepId2(paramData);
}
}
}

21
src/main/resources/mapper/request/RequestManageMapper.xml

@ -504,4 +504,25 @@
<select id="getProcessFlowInformation2" resultType="com.spring.modules.change.vo.ProcessFormVo">
EXEC dbo.get_process_form_infor #{site}, #{workflowId}, #{documentNo}, #{workflowName}, #{nodeId}, #{nodeName}, #{createBy}, #{updateBy}, #{documentType}, #{documentStatus}, #{page}, #{limit}
</select>
<update id="updateProcessNodeByIntervention1">
update plm_process_form
set node_conclusion = #{nodeConclusion2}
where site = #{site} and document_no = #{documentNo} and is_remark = #{isRemark} and node_conclusion = #{nodeConclusion1}
</update>
<update id="updateProcessNodeByIntervention2">
update plm_process_form
set node_conclusion = #{nodeConclusion2},
update_date = getDate(),
update_by = #{userName}
where site = #{site} and document_no = #{documentNo} and is_remark = #{isRemark} and (node_conclusion = #{nodeConclusion1} or node_conclusion = '')
</update>
<select id="getStepIdFromProcessForm" resultType="com.spring.modules.change.vo.ProcessFormVo">
select
step_id
from plm_process_form
where site = #{site} and document_no = #{documentNo} and is_remark = #{isRemark}
</select>
</mapper>
Loading…
Cancel
Save