| | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.jcdm.main.constant.Constants; |
| | | import com.jcdm.main.om.productionOrde.domain.OmProductionOrdeInfo; |
| | | import com.jcdm.main.om.productionOrde.service.IOmProductionOrdeInfoService; |
| | | import com.kangaroohy.milo.model.ReadWriteEntity; |
| | | import com.kangaroohy.milo.service.MiloService; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | |
| | | { |
| | | @Autowired |
| | | private IBsFormulaChildInfoService bsFormulaChildInfoService; |
| | | |
| | | @Autowired |
| | | private IOmProductionOrdeInfoService omProductionOrdeInfoService; |
| | | |
| | | @Autowired |
| | | private MiloService miloService; |
| | |
| | | String str = thoroughfare+"."+bsFormulaChildInfo.getProcessesCode()+".MESScrew"; |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(str).value(stepNumber).build());//拧紧步骤 |
| | | if("OP230".equals(bsFormulaChildInfo.getProcessesCode())){ |
| | | List<OmProductionOrdeInfo> list = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().like(OmProductionOrdeInfo::getProductNum, bsFormulaChildInfo.getSfcBarcode())); |
| | | String sfcCode = list.get(0).getProductNum(); |
| | | //所有进站将进站时间写给PLC |
| | | SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | String currentDate = dateFormat.format(new Date()); |
| | | miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".StartTime").value(currentDate).build()); |
| | | miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".SNCode").value(bsFormulaChildInfo.getSfcBarcode()).build()); |
| | | miloService.writeToOpcUa(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".SNCode").value(sfcCode).build()); |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".RecordDataDone").value(11).build()); |
| | | }else if("OP220".equals(bsFormulaChildInfo.getProcessesCode())){ |
| | | miloService.writeToOpcShort(ReadWriteEntity.builder().identifier(thoroughfare + "." + bsFormulaChildInfo.getProcessesCode() + ".RecordDataDone").value(11).build()); |