|
|
|
@ -110,11 +110,14 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
|
|
|
|
|
* 获取缺陷记录
|
|
|
|
|
*/
|
|
|
|
|
MesPartInspection mesPartInspection = getMesPartInspection(res);
|
|
|
|
|
/**
|
|
|
|
|
* 获取零件缺陷明细列表
|
|
|
|
|
*/
|
|
|
|
|
List<MesPartInspectionDetail> mesPartInspectionDetails = getMesPartInspectionDetail(reworkTaskDetails);
|
|
|
|
|
|
|
|
|
|
List<MesPartInspectionDetail> mesPartInspectionDetails = null;
|
|
|
|
|
if (!CollectionUtils.isEmpty(reworkTaskDetails)) {
|
|
|
|
|
/**
|
|
|
|
|
* 获取零件缺陷明细列表
|
|
|
|
|
*/
|
|
|
|
|
mesPartInspectionDetails = getMesPartInspectionDetail(reworkTaskDetails);
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 组装返回信息
|
|
|
|
|
*/
|
|
|
|
@ -186,7 +189,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(requestModel.getOrganizeCode());
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(requestModel.getSn(), "sn", packBean);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(requestModel.getSn(), "productSn", packBean);
|
|
|
|
|
MesProduceSn mesProduceSn = mesProduceSnRepository.getByProperty(packBean);
|
|
|
|
|
if (mesProduceSn == null) {
|
|
|
|
|
MesPcnException.throwFlowException("条码信息不存在");
|
|
|
|
@ -211,12 +214,12 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
|
|
|
|
|
mesProductionAssembly.setRepeatAssemblySn(requestModel.getSn());
|
|
|
|
|
mesProductionAssemblyRepository.update(mesProductionAssembly);
|
|
|
|
|
|
|
|
|
|
mesProductionAssemblyRepository.insert(mesProductionRepeatAssembly);
|
|
|
|
|
mesProductionAssemblyRepository.save(mesProductionRepeatAssembly);
|
|
|
|
|
/**
|
|
|
|
|
* 需要更新NC标记后进入的表明细状态为已处理
|
|
|
|
|
*/
|
|
|
|
|
for (Long detailId : requestModel.getDetailIds()) {
|
|
|
|
|
reworkRecord(detailId);
|
|
|
|
|
for (String detailId : requestModel.getDetailIds().split(",")) {
|
|
|
|
|
reworkRecord(Long.valueOf(detailId));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("替换条码异常", e);
|
|
|
|
@ -230,9 +233,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(mesReworkTask.getSn(), "sn", packBean);
|
|
|
|
|
|
|
|
|
|
MesPartInspection mesPartInspection = mesPartInspectionRepository.getByProperty(packBean);
|
|
|
|
|
if (mesPartInspection == null) {
|
|
|
|
|
throw new ImppBusiException("返工单信息不存在");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return mesPartInspection;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -280,9 +281,7 @@ public class MesReworkTaskServiceImpl implements IMesReworkTaskService {
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(MesExtEnumUtil.REWORK_TASK_DETAIL_STATUS.REWORK_TASK_DETAIL_STATUS_10.getValue(), "status", packBean);
|
|
|
|
|
|
|
|
|
|
List<MesReworkTaskDetail> res = mesReworkTaskDetailRepository.findByHqlWhere(packBean);
|
|
|
|
|
if (CollectionUtils.isEmpty(res)) {
|
|
|
|
|
throw new ImppBusiException("返工单详情信息不存在");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return res;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|