|
|
|
@ -29,6 +29,7 @@ import com.spring.modules.oss.dao.SysOssDao; |
|
|
|
import com.spring.modules.oss.entity.SysOssEntity; |
|
|
|
import com.spring.modules.part.entity.PartInformationEntity; |
|
|
|
import com.spring.modules.part.entity.RoutingToolEntity; |
|
|
|
import com.spring.modules.part.mapper.PartInformationMapper; |
|
|
|
import com.spring.modules.report.dao.ProcedureDao; |
|
|
|
import com.spring.modules.request.entity.PlmRequestDetailEntity; |
|
|
|
import com.spring.modules.request.entity.PlmRequestHeaderEntity; |
|
|
|
@ -37,10 +38,12 @@ import com.spring.modules.request.mapper.RequestManageMapper; |
|
|
|
import com.spring.modules.request.vo.PlmRequestDetailVo; |
|
|
|
import com.spring.modules.request.vo.PlmRequestHeaderVo; |
|
|
|
import com.spring.modules.request.vo.TableDataVo; |
|
|
|
import com.spring.modules.sampleManagement.data.PlmTechnicalSpecificationSheetData; |
|
|
|
import com.spring.modules.sys.dao.SysUserDao; |
|
|
|
import com.spring.modules.sys.entity.GetParamInData; |
|
|
|
import com.spring.modules.sys.entity.SysUserEntity; |
|
|
|
import com.spring.modules.sys.oauth2.TokenGenerator; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.apache.poi.ss.formula.functions.Offset; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
@ -1536,6 +1539,42 @@ public class ChangeManagementServiceImpl extends ServiceImpl<ChangeManagementMap |
|
|
|
List<PlmRequestDetailVo> nodeDetailLast = changeManagementMapper.queryNodeDetailLast(paramData.getSite(), paramData.getClassificationNo(), paramData.getWorkflowId()); |
|
|
|
paramData.setStepId(nodeDetailLast.get(0).getStepId()); |
|
|
|
changeManagementMapper.updateChangeStatus2(paramData); |
|
|
|
// 如果是ECN则执行升版操作 |
|
|
|
if ("ECN".equals(type)) { |
|
|
|
ChangeRequestEntity changeRequestEntity = new ChangeRequestEntity(); |
|
|
|
changeRequestEntity.setSite(paramData.getSite()); |
|
|
|
changeRequestEntity.setChangeNo(paramData.getDocNo()); |
|
|
|
List<ChangeRequestDetailEntity> codelist = changeManagementMapper.requestDetailSearch(changeRequestEntity); |
|
|
|
for (ChangeRequestDetailEntity detail : codelist) { |
|
|
|
// 查出BM版本号 |
|
|
|
PlmTechnicalSpecificationSheetData ptssd = changeManagementMapper.getTechnicalSpecification(detail.getSite(), detail.getCodeNo()); |
|
|
|
int revNo; |
|
|
|
try { |
|
|
|
revNo = Integer.parseInt(ptssd.getRevNo()) + 1; |
|
|
|
} catch (NumberFormatException e) { |
|
|
|
throw new RuntimeException("转换错误: 版本号不是一个有效的整数!"); |
|
|
|
} |
|
|
|
List<Object> params = new ArrayList<>(); |
|
|
|
params.add(detail.getSite()); |
|
|
|
params.add(detail.getCodeNo()); |
|
|
|
params.add(ptssd.getRevNo()); |
|
|
|
params.add(ptssd.getOriCodeNo()); |
|
|
|
params.add(revNo); |
|
|
|
params.add(paramData.getUserName()); |
|
|
|
//执行方法 |
|
|
|
List<Map<String, Object>> resultList = procedureDao.getProcedureData("plm_bm_upRevNo", params); |
|
|
|
//判断是否成功 |
|
|
|
String code = String.valueOf(resultList.get(0).get("resultCode")); |
|
|
|
if ("400".equalsIgnoreCase(code)) { |
|
|
|
String msg = String.valueOf(resultList.get(0).get("resultMsg")); |
|
|
|
throw new RuntimeException(msg); |
|
|
|
} |
|
|
|
// 如果有新物料编码,则停用之前的物料 |
|
|
|
if (StringUtils.isNotBlank(detail.getNewPartNo())) { |
|
|
|
changeManagementMapper.updatePartActive(detail.getSite(), detail.getPartNo()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else { // 未结束 |
|
|
|
// 存放isRemark为0的域控账号 |
|
|
|
Map<String, String> dcas = new HashMap<>(); |
|
|
|
|