| | |
| | | import com.zy.asrs.domain.enums.SiteStatusType; |
| | | import com.zy.asrs.domain.param.SystemSwitchParam; |
| | | import com.zy.asrs.domain.vo.*; |
| | | import com.zy.asrs.entity.BasCrnError; |
| | | import com.zy.asrs.entity.BasDevp; |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.WrkMast; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.BasCrnErrorMapper; |
| | | import com.zy.asrs.mapper.LocMastMapper; |
| | | import com.zy.asrs.service.BasDevpService; |
| | | import com.zy.asrs.service.LocDetlService; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.asrs.service.WrkMastService; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.core.CrnThread; |
| | |
| | | import com.zy.core.model.protocol.StaProtocol; |
| | | import com.zy.core.properties.SlaveProperties; |
| | | import com.zy.core.properties.SystemProperties; |
| | | import com.zy.core.thread.BarcodeThread; |
| | | import com.zy.core.thread.MelsecCrnThread; |
| | | import com.zy.core.thread.ScaleThread; |
| | | import com.zy.core.thread.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | private LocMastMapper locMastMapper; |
| | | @Autowired |
| | | private BasCrnErrorMapper basCrnErrorMapper; |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | @Autowired |
| | | private LocDetlService locDetlService; |
| | | |
| | | @PostMapping("/system/running/status") |
| | | @ManagerAuth(memo = "系统运行状态") |
| | |
| | | List<LocLatestDataVo> vos = new ArrayList<>(); |
| | | List<LocMast> locMasts = locMastMapper.selectList(new EntityWrapper<LocMast>()); |
| | | for(LocMast locMast : locMasts){ |
| | | if(!locMast.equals("0100201")) continue; |
| | | LocLatestDataVo vo = new LocLatestDataVo(); |
| | | vo.setLocNo(locMast.getLocNo()); |
| | | vo.setLocSts(locMast.getLocSts()); |
| | |
| | | CrnDetailVo vo = new CrnDetailVo(); |
| | | for (CrnSlave crnSlave : slaveProperties.getCrn()) { |
| | | if (crnSlave.getId().equals(crnNo)) { |
| | | MelsecCrnThread crnThread = (MelsecCrnThread) SlaveConnection.get(SlaveType.Crn, crnSlave.getId()); |
| | | SiemensCrnThread crnThread=(SiemensCrnThread) SlaveConnection.get(SlaveType.Crn, crnSlave.getId()); |
| | | // MelsecCrnThread crnThread = (MelsecCrnThread) SlaveConnection.get(SlaveType.Crn, crnSlave.getId()); |
| | | CrnProtocol crnProtocol = crnThread.getCrnProtocol(); |
| | | vo.setCrnNo(crnNo); |
| | | vo.setWorkNo(crnProtocol.getTaskNo()); |
| | |
| | | return R.error(); |
| | | } |
| | | |
| | | @PostMapping("/loc/detail") |
| | | @ManagerAuth(memo = "库位数据详情") |
| | | public R locDetail(@RequestParam String locNo) { |
| | | if (Cools.isEmpty(locNo)) { |
| | | return R.parse(CodeRes.EMPTY); |
| | | } |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no",locNo)); |
| | | if(null == locMast || !locMast.getLocSts().equals("F")){ |
| | | return R.error("库位为空或非在库状态"); |
| | | } |
| | | LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no",locNo)); |
| | | if (null != locDetl){ |
| | | LocDetailVo vo = new LocDetailVo(); |
| | | vo.setLocNo(locDetl.getLocNo()); |
| | | vo.setLocSts(locMast.getLocSts()); |
| | | vo.setMatnr(locDetl.getMatnr()); |
| | | vo.setZpallet(locDetl.getZpallet()); |
| | | vo.setPackStatus(PackStatusType.process(locMast.getLocSts(),locMast.getPackStatus(),locMast.getFireStatus())); |
| | | return R.ok().add(vo); |
| | | } |
| | | return R.error(); |
| | | } |
| | | |
| | | @Deprecated |
| | | @PostMapping("/site/update") |
| | | @ManagerAuth(memo = "输送设备数据修改") |