| | |
| | | import com.jcdm.common.core.domain.AjaxResult; |
| | | import com.jcdm.framework.websocket.WebSocketUsers; |
| | | import com.jcdm.main.constant.Constants; |
| | | import com.jcdm.main.da.cellData.domain.DaCellData; |
| | | import com.jcdm.main.da.cellData.service.IDaCellDataService; |
| | | import com.jcdm.main.da.collectionParamConf.domain.DaCollectionParamConf; |
| | | import com.jcdm.main.da.collectionParamConf.service.IDaCollectionParamConfService; |
| | | import com.jcdm.main.da.paramCollection.domain.DaParamCollection; |
| | |
| | | |
| | | public static IDaTestDeviceInterfaceTempService daTestDeviceInterfaceTempService; |
| | | |
| | | public static IDaCellDataService daCellDataService; |
| | | |
| | | /* @Value("${orderLineUrl}") |
| | | private static String orderLineUrl;*/ |
| | | |
| | |
| | | IDaCollectionParamConfService collectionParamConfService, |
| | | IDaParamCollectionService daParamCollectionService, |
| | | IOmProductionOrdeInfoService omProductionOrdeInfoService, |
| | | IDaTestDeviceInterfaceTempService daTestDeviceInterfaceTempService) { |
| | | IDaTestDeviceInterfaceTempService daTestDeviceInterfaceTempService, |
| | | IDaCellDataService daCellDataService) { |
| | | OPCUaSubscription.miloService = miloService; |
| | | OPCUaSubscription.daPassingStationCollectionService = daPassingStationCollectionService; |
| | | OPCUaSubscription.collectionParamConfService = collectionParamConfService; |
| | | OPCUaSubscription.daParamCollectionService = daParamCollectionService; |
| | | OPCUaSubscription.omProductionOrdeInfoService = omProductionOrdeInfoService; |
| | | OPCUaSubscription.daTestDeviceInterfaceTempService = daTestDeviceInterfaceTempService; |
| | | OPCUaSubscription.daCellDataService = daCellDataService; |
| | | } |
| | | |
| | | |
| | |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordSNDone").value(1).build());//没有要生产的工单 |
| | | } |
| | | }else if (Constants.RECORD_DATA.equals(tab)){//出入站 |
| | | if (Constants.ONE.equals(valueString)){//入站 |
| | | //1:告知MES托盘已到站,请求下发进站状态 |
| | | if (Constants.OP030.equals(device)){ |
| | | if (Constants.ONE.equals(valueString)){//入站 //1:告知MES托盘已到站,请求下发进站状态 |
| | | |
| | | //OP020 电芯挡位校验 |
| | | if (Constants.OP020.equals(device)){ |
| | | Integer result = 11; |
| | | Object cellGearObjcet = miloService.readFromOpcUa(thoroughfare + "." + device + ".CellGear").getValue(); |
| | | if (ObjectUtil.isNull(cellGearObjcet)){ |
| | | result = 16;//电芯挡位为空 |
| | | }else{ |
| | | String cellGear = cellGearObjcet.toString(); |
| | | List<String> cellCodeList = readCellCodeList(thoroughfare, device); |
| | | result = checkCellGear(thoroughfare, device,cellCodeList,cellGear);//校验电芯挡位和组别 |
| | | } |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".RecordDataDone").value(result).build()); |
| | | |
| | | }else if (Constants.OP030.equals(device)){ |
| | | //反馈电芯ocv检测结果 |
| | | boolean b = OCVResultFeedBack(thoroughfare, device);//进站对4个电芯校验 |
| | | //四个电芯的状态 |
| | |
| | | |
| | | result = savePassingStation(thoroughfare, device,cellCodeList);//保存过站 |
| | | if(result == 21) { |
| | | if(Constants.OP030.contains(device)){ |
| | | daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode1); |
| | | daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode2); |
| | | daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode3); |
| | | daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode4); |
| | | if(Constants.OP020.contains(device)){ |
| | | if(!cellCode1.isEmpty()){ |
| | | daCellDataService.deleteDaCellDataByGbCellCode(cellCode1); |
| | | } |
| | | if(!cellCode2.isEmpty()){ |
| | | daCellDataService.deleteDaCellDataByGbCellCode(cellCode2); |
| | | } |
| | | if(!cellCode3.isEmpty()){ |
| | | daCellDataService.deleteDaCellDataByGbCellCode(cellCode3); |
| | | } |
| | | if(!cellCode4.isEmpty()){ |
| | | daCellDataService.deleteDaCellDataByGbCellCode(cellCode4); |
| | | } |
| | | }else if(Constants.OP030.contains(device)){ |
| | | if(!cellCode1.isEmpty()){ |
| | | daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode1); |
| | | } |
| | | if(!cellCode2.isEmpty()){ |
| | | daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode2); |
| | | } |
| | | if(!cellCode3.isEmpty()){ |
| | | daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode3); |
| | | } |
| | | if(!cellCode4.isEmpty()) { |
| | | daTestDeviceInterfaceTempService.deleteDaTestDeviceInterfaceTempByProductNum(cellCode4); |
| | | } |
| | | } |
| | | result = saveParamCollection(device,cellCodeList);//保存参数,发送工厂MES |
| | | } |
| | |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * OP020校验电芯挡位 |
| | | * @param thoroughfare |
| | | * @param device |
| | | * @throws Exception |
| | | */ |
| | | private Integer checkCellGear(String thoroughfare, String device,List<String> cellCodeList,String cellGear) throws Exception { |
| | | Integer result = 11; |
| | | |
| | | for(int i = 0; i < cellCodeList.size(); i ++){ |
| | | Integer cellStatus = 1; |
| | | String cellCode = cellCodeList.get(i); |
| | | if(!cellCode.isEmpty()){ |
| | | List<DaCellData> list = daCellDataService.list(new LambdaQueryWrapper<DaCellData>() |
| | | .eq(DaCellData::getGbCellCode,cellCode)); |
| | | if(CollUtil.isNotEmpty(list)){ |
| | | DaCellData daCellData = list.get(0); |
| | | String cellValue = daCellData.getCellValue();//数据库中电芯挡位 |
| | | String cellSerial = daCellData.getCellSerial();//数据库中电芯组别 |
| | | if(!cellValue.isEmpty() && cellValue.equals(cellGear)){ |
| | | cellStatus = 1; |
| | | }else { |
| | | cellStatus = 2; |
| | | result = 17;//挡位校验不合格 |
| | | } |
| | | }else { |
| | | cellStatus = 2; |
| | | result = 17;//查不到要校验的挡位 |
| | | } |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + device + ".CellStatus_"+(i+1)).value(cellStatus).build()); |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | | * 030工位返回ocv测试结果 |
| | | * @param thoroughfare |