|
|
@ -5,6 +5,7 @@ import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEquipmentLogExtService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.spot.IMesSpotCheckOrderService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.spot.IMesSpotCheckOrderService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.apiservice.util.MesPcnException;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.context.MesEquipVariableCollectContext;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesEquipmentSpotCheckModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesEquipmentSpotCheckModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSpotCheckOrderModel;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesSpotCheckOrderModel;
|
|
|
|
import cn.estsh.i3plus.icloud.core.sdk.ICoreUtilCloud;
|
|
|
|
import cn.estsh.i3plus.icloud.core.sdk.ICoreUtilCloud;
|
|
|
@ -196,11 +197,11 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//根据设备代码获取EQUIP_ID
|
|
|
|
//根据设备代码获取EQUIP_ID
|
|
|
|
MesEquipment mesEquipment = mesEquipmentExtService.getMesEquipment(org, model.getSpotCheckOrder().getEquipCode());
|
|
|
|
MesEquipment mesEquipment = mesEquipmentExtService.getMesEquipment(org, model.getSpotCheckOrder().getEquipCode());
|
|
|
|
Map<Long, List<MesEquipmentLog>> setMap = null;
|
|
|
|
Map<Long, List<MesEquipVariableCollectContext>> setMap = null;
|
|
|
|
//实际值地址数据Map
|
|
|
|
//实际值地址数据Map
|
|
|
|
Map<Long, List<MesEquipmentLog>> realMap = null;
|
|
|
|
Map<Long, List<MesEquipVariableCollectContext>> realMap = null;
|
|
|
|
//获取实际值值设备数据
|
|
|
|
//获取实际值值设备数据
|
|
|
|
List<MesEquipmentLog> realEquipmentLogList = new ArrayList<>();
|
|
|
|
List<MesEquipVariableCollectContext> realEquipmentLogList = new ArrayList<>();
|
|
|
|
if(!Objects.isNull(mesEquipment) && !StringUtils.isEmpty(mesEquipment.getEquipId())){
|
|
|
|
if(!Objects.isNull(mesEquipment) && !StringUtils.isEmpty(mesEquipment.getEquipId())){
|
|
|
|
//获取设定值设备变量ID
|
|
|
|
//获取设定值设备变量ID
|
|
|
|
List<Long> setEquipVariableIdList =
|
|
|
|
List<Long> setEquipVariableIdList =
|
|
|
@ -211,18 +212,18 @@ public class MesSpotCheckOrderService implements IMesSpotCheckOrderService {
|
|
|
|
model.getOrderResultList().stream().filter(k -> k.getSpotCheckItemType() == MesExtEnumUtil.SPOT_CHECK_ITEM_TYPE.AUTO.getValue()).map(MesSpotCheckOrderResult::getRealEquipVariableId).collect(Collectors.toList());
|
|
|
|
model.getOrderResultList().stream().filter(k -> k.getSpotCheckItemType() == MesExtEnumUtil.SPOT_CHECK_ITEM_TYPE.AUTO.getValue()).map(MesSpotCheckOrderResult::getRealEquipVariableId).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
|
|
//获取设定值设备数据
|
|
|
|
//获取设定值设备数据
|
|
|
|
List<MesEquipmentLog> setEquipmentLogList = new ArrayList<>();
|
|
|
|
List<MesEquipVariableCollectContext> setEquipmentLogList = new ArrayList<>();
|
|
|
|
for (List<Long> tmp : ListUtils.partition(setEquipVariableIdList, MesCommonConstant.MAX_PAGER_SIZE)) {
|
|
|
|
for (List<Long> tmp : ListUtils.partition(setEquipVariableIdList, MesCommonConstant.MAX_PAGER_SIZE)) {
|
|
|
|
setEquipmentLogList.addAll(mesEquipmentLogExtService.getEquipmentLogList(org,mesEquipment.getEquipId(),MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue(),tmp));
|
|
|
|
setEquipmentLogList.addAll(mesEquipmentLogExtService.getEquipmentLogCollectList(org, mesEquipment.getEquipId(), MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue(), MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PROCESS_FINISH.getValue(), tmp));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//设定值地址数据Map
|
|
|
|
//设定值地址数据Map
|
|
|
|
setMap = setEquipmentLogList.stream().collect(Collectors.groupingBy(MesEquipmentLog::getEquipVariableId));
|
|
|
|
setMap = setEquipmentLogList.stream().collect(Collectors.groupingBy(MesEquipVariableCollectContext::getEquipVariableId));
|
|
|
|
|
|
|
|
|
|
|
|
for (List<Long> tmp : ListUtils.partition(realEquipVariableIdList, MesCommonConstant.MAX_PAGER_SIZE)) {
|
|
|
|
for (List<Long> tmp : ListUtils.partition(realEquipVariableIdList, MesCommonConstant.MAX_PAGER_SIZE)) {
|
|
|
|
realEquipmentLogList.addAll(mesEquipmentLogExtService.getEquipmentLogList(org,mesEquipment.getEquipId(),MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue(),tmp));
|
|
|
|
realEquipmentLogList.addAll(mesEquipmentLogExtService.getEquipmentLogCollectList(org,mesEquipment.getEquipId(), MesExtEnumUtil.EQUIP_VARIABLE_NEED_NEW_VALUE.TRUE.getValue(), MesExtEnumUtil.EQUIP_VARIABLE_TYPE.PROCESS_FINISH.getValue(), tmp));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//实际值地址数据Map
|
|
|
|
//实际值地址数据Map
|
|
|
|
realMap = realEquipmentLogList.stream().collect(Collectors.groupingBy(MesEquipmentLog::getEquipVariableId));
|
|
|
|
realMap = realEquipmentLogList.stream().collect(Collectors.groupingBy(MesEquipVariableCollectContext::getEquipVariableId));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (MesSpotCheckOrderResult result : model.getOrderResultList()) {
|
|
|
|
for (MesSpotCheckOrderResult result : model.getOrderResultList()) {
|
|
|
|