| | |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.domain.enums.RgvStatusType; |
| | | import com.zy.asrs.domain.param.*; |
| | | import com.zy.asrs.domain.vo.*; |
| | | import com.zy.asrs.domain.vo.RgvMsgTableVo; |
| | | import com.zy.asrs.domain.vo.RgvStateTableVo; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.BasRgvErrMapper; |
| | | import com.zy.asrs.service.BasCircularShuttleService; |
| | | import com.zy.asrs.service.BasDevpPositionService; |
| | | import com.zy.asrs.service.BasRgvService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.asrs.service.impl.MainServiceImpl; |
| | | import com.zy.asrs.utils.NumUtils; |
| | | import com.zy.asrs.utils.Utils; |
| | | import com.zy.core.cache.MessageQueue; |
| | | import com.zy.core.cache.OutputQueue; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.rmi.CORBA.Util; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * RGV接口 |
| | |
| | | @Autowired |
| | | private BasRgvService basRgvService; |
| | | @Autowired |
| | | private BasDevpService basDevpService; |
| | | @Autowired |
| | | private MainServiceImpl mainService; |
| | | @Autowired |
| | | private BasRgvErrLogService basRgvErrLogService; |
| | | @Autowired |
| | | private BasDevpPositionService basDevpPositionService; |
| | | @Autowired |
| | |
| | | List<RingThroughParam> result = new ArrayList<>(); |
| | | List<BasDevpPosition> basDevpPositions = basDevpPositionService.selectList(new EntityWrapper<>()); |
| | | for (BasDevpPosition basDevpPosition : basDevpPositions){ |
| | | if (basDevpPosition.getDevNo() == 134){ |
| | | continue; |
| | | } |
| | | RingThroughParam ringThroughParam = new RingThroughParam(); |
| | | |
| | | ringThroughParam.setModeColor("#FFFFFF"); |
| | | ringThroughParam.setStatusColor("#FFFFFF"); |
| | | try{ |
| | | BasDevp basDevp = basDevpService.selectOne(new EntityWrapper<BasDevp>().eq("dev_no",basDevpPosition.getDevNo())); |
| | | if (basDevp.getAutoing().equals("Y")){ |
| | | if (basDevp.getLoading().equals("Y")){ |
| | | ringThroughParam.setModeColor("#ab1839"); |
| | | ringThroughParam.setStatusColor("#ab1839"); |
| | | } |
| | | if (basDevp.getLoading().equals("N")){ |
| | | ringThroughParam.setModeColor("#27AE60"); |
| | | ringThroughParam.setStatusColor("#27AE60"); |
| | | } |
| | | } else { |
| | | ringThroughParam.setModeColor("#C0392B"); |
| | | ringThroughParam.setStatusColor("#C0392B"); |
| | | } |
| | | |
| | | } catch (Exception e){ |
| | | System.out.println(e.getMessage()); |
| | | ringThroughParam.setModeColor("#000000"); |
| | | ringThroughParam.setStatusColor("#000000"); |
| | | |
| | | } |
| | | ringThroughParam.setIndex(basDevpPosition.getDevNo()); |
| | | // double[] doubles = Utils.RingThroughXYSta(perimeter, perimeter-basDevpPosition.getPlcPosition()); |
| | | // ringThroughParam.setValueX(doubles[0]>50? doubles[0]+6:doubles[0]-1); |
| | |
| | | // @ManagerAuth(memo = "作业信息") |
| | | public R ringThroughTaskWrkMast(){ |
| | | List<RgvWrkMastParam> result = new ArrayList<>(); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<>()); |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().in("wrk_sts",9,10).orderBy("wrk_sts",false) |
| | | .orderBy("rgv_no",true)); |
| | | for (WrkMast wrkMast : wrkMasts){ |
| | | RgvWrkMastParam rgvWrkMastParam = new RgvWrkMastParam(wrkMast); |
| | | if (Cools.isEmpty(rgvWrkMastParam.getRgvNo())){ |
| | |
| | | RgvProtocol rgvProtocol = rgvThread.getRgvProtocol(); |
| | | if (rgvProtocol != null) { |
| | | rgvCircularShuttleParam.setPosition(rgvProtocol.getRgvPos()); |
| | | rgvCircularShuttleParam.setTaskNo(rgvProtocol.taskNo1); |
| | | if (rgvCircularShuttleParam.getStatus()==0){ |
| | | rgvCircularShuttleParam.setStatus$(rgvProtocol.statusType.desc); |
| | | } |
| | | if (rgvProtocol.getAlarmList().isEmpty()){ |
| | | rgvCircularShuttleParam.setError(0); |
| | | rgvCircularShuttleParam.setError$("-"); |
| | | } else { |
| | | StringBuilder alarmList = new StringBuilder(); |
| | | for (Integer alarm : rgvProtocol.getAlarmList()){ |
| | | BasRgvErr rgvErr = basRgvErrMapper.selectById(alarm); |
| | | alarmList.append((rgvErr==null || rgvErr.getErrName()==null)? "未知异常:"+alarm:rgvErr.getErrName()); |
| | | if (alarm.equals(rgvProtocol.getAlarmList().get(rgvProtocol.getAlarmList().size() - 1))){ |
| | | break; |
| | | } |
| | | alarmList.append("---"); |
| | | } |
| | | rgvCircularShuttleParam.setError$(alarmList.toString()); |
| | | } |
| | | } |
| | | } |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/task/rgv/circular/shuttle/mast/position/data/v1") |
| | | // @ManagerAuth(memo = "作业信息") |
| | | public R rgvCircularShuttleV1(){ |
| | | List<BasRgvErrLog> result = new ArrayList<>(); |
| | | for (int i = 1 ; i<11; i ++){ |
| | | BasRgvErrLog basRgvErrLog = basRgvErrLogService.selectOne(new EntityWrapper<BasRgvErrLog>().eq("rgv_no", i).orderBy("id", false)); |
| | | if (basRgvErrLog!=null){ |
| | | result.add(basRgvErrLog); |
| | | } |
| | | } |
| | | return R.ok().add(result); |
| | | } |
| | | |
| | | } |