|
|
|
@ -215,6 +215,26 @@ public class MesEquipmentExtService implements IMesEquipmentExtService {
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), equipmentCode});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据设备代码集合查询加工不可用规则信息
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesProdRuleIgnoreCfg> getProdRuleIgnoreCfgListByWcEquips(String organizeCode, List<MesWcEquipment> wcEquipmentList) {
|
|
|
|
|
if (StringUtils.isEmpty(organizeCode) || CollectionUtils.isEmpty(wcEquipmentList)) return null;
|
|
|
|
|
List<String> equipmentCodeList = CollectionUtils.isEmpty(wcEquipmentList) ? null :
|
|
|
|
|
wcEquipmentList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getEquipmentCode()))).map(MesWcEquipment::getEquipmentCode).collect(Collectors.toList());
|
|
|
|
|
return getProdRuleIgnoreCfgListByEquips(organizeCode, equipmentCodeList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据设备代码集合查询加工不可用规则信息
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesProdRuleIgnoreCfg> getProdRuleIgnoreCfgListByEquips(String organizeCode, List<String> equipmentCodeList) {
|
|
|
|
|
if (StringUtils.isEmpty(organizeCode) || CollectionUtils.isEmpty(equipmentCodeList)) return null;
|
|
|
|
|
equipmentCodeList = equipmentCodeList.stream().filter(o -> StringUtils.isEmpty(o)).distinct().collect(Collectors.toList());
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
if (equipmentCodeList.size() == 1) DdlPreparedPack.getStringEqualPack(equipmentCodeList.get(0), MesPcnExtConstWords.EQUIPMENT_CODE, packBean);
|
|
|
|
|
else DdlPreparedPack.getInPackList(equipmentCodeList, MesPcnExtConstWords.EQUIPMENT_CODE, packBean);
|
|
|
|
|
return prodRuleIgnoreCfgRepository.findByHqlWhere(packBean);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据生产线代码查询加工不可用规则信息
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesProdRuleIgnoreCfg> getProdRuleIgnoreCfgListByCenter(String organizeCode, String workCenterCode) {
|
|
|
|
@ -222,13 +242,17 @@ public class MesEquipmentExtService implements IMesEquipmentExtService {
|
|
|
|
|
List<MesWcEquipment> wcEquipmentList = wcEquipmentRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_CENTER_CODE},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode});
|
|
|
|
|
List<String> equipmentCodeList = CollectionUtils.isEmpty(wcEquipmentList) ? null :
|
|
|
|
|
(wcEquipmentList.stream().filter(o -> (null != o && !StringUtils.isEmpty(o.getEquipmentCode()))).map(MesWcEquipment::getEquipmentCode).collect(Collectors.toList())).stream().filter(o -> null != o).distinct().collect(Collectors.toList());
|
|
|
|
|
if (CollectionUtils.isEmpty(equipmentCodeList)) return null;
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
if (equipmentCodeList.size() == 1) DdlPreparedPack.getStringEqualPack(equipmentCodeList.get(0), MesPcnExtConstWords.EQUIPMENT_CODE, packBean);
|
|
|
|
|
else DdlPreparedPack.getInPackList(equipmentCodeList, MesPcnExtConstWords.EQUIPMENT_CODE, packBean);
|
|
|
|
|
return prodRuleIgnoreCfgRepository.findByHqlWhere(packBean);
|
|
|
|
|
return getProdRuleIgnoreCfgListByWcEquips(organizeCode, wcEquipmentList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据工位代码查询加工不可用规则信息
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesProdRuleIgnoreCfg> getProdRuleIgnoreCfgListByCell(String organizeCode, String workCenterCode, String workCellCode) {
|
|
|
|
|
if (StringUtils.isEmpty(organizeCode) || StringUtils.isEmpty(workCenterCode) || StringUtils.isEmpty(workCellCode)) return null;
|
|
|
|
|
List<MesWcEquipment> wcEquipmentList = wcEquipmentRepository.findByProperty(
|
|
|
|
|
new String[]{MesPcnExtConstWords.ORGANIZE_CODE, MesPcnExtConstWords.IS_DELETED, MesPcnExtConstWords.IS_VALID, MesPcnExtConstWords.WORK_CENTER_CODE, MesPcnExtConstWords.WORK_CELL_CODE},
|
|
|
|
|
new Object[]{organizeCode, CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue(), CommonEnumUtil.IS_VAILD.VAILD.getValue(), workCenterCode, workCellCode});
|
|
|
|
|
return getProdRuleIgnoreCfgListByWcEquips(organizeCode, wcEquipmentList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//根据设备代码, 来源信息查询加工不可用规则信息
|
|
|
|
|