|
|
|
@ -848,6 +848,48 @@ public class MesProductPlanServiceImpl implements IMesProductPlanService {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据planId获取生产派工SOP附件List列表
|
|
|
|
|
* @param attachType
|
|
|
|
|
* @param planId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesBaseAttachInfo> getDispatchAttachByPlanIdList(String attachType, Long planId) {
|
|
|
|
|
MesProductPlan queryProductPlan = new MesProductPlan();
|
|
|
|
|
queryProductPlan.setPlanId(planId);
|
|
|
|
|
List<MesProductPlan> mesProductPlans = mesProductPlanMapper.selectOnlyMesProductPlans(queryProductPlan);
|
|
|
|
|
if (mesProductPlans != null && !mesProductPlans.isEmpty()) {
|
|
|
|
|
MesProductPlan mesProductPlan = mesProductPlans.get(0);
|
|
|
|
|
try {
|
|
|
|
|
if (attachType.equals(MesConstants.MES_ATTACH_TYPE_DRAWING)) {
|
|
|
|
|
if (StringUtils.isEmpty(mesProductPlan.getAttachId())) {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
Long[] attachIds = Arrays.stream(mesProductPlan.getAttachId().split(","))
|
|
|
|
|
.map(String::trim)
|
|
|
|
|
.map(Long::parseLong)
|
|
|
|
|
.toArray(Long[]::new);
|
|
|
|
|
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(attachIds);
|
|
|
|
|
} else if (attachType.equals(MesConstants.MES_ATTACH_TYPE_SOP)) {
|
|
|
|
|
if (StringUtils.isEmpty(mesProductPlan.getSopId())) {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
Long[] sopIds = Arrays.stream(mesProductPlan.getSopId().split(","))
|
|
|
|
|
.map(String::trim)
|
|
|
|
|
.map(Long::parseLong)
|
|
|
|
|
.toArray(Long[]::new);
|
|
|
|
|
return mesBaseAttachInfoService.selectMesBaseAttachInfoByAttachIds(sopIds);
|
|
|
|
|
} else {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public String executeAssignTaskResultTask() {
|
|
|
|
|
// ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
|
|
|
|
|