| | |
| | | package com.zy.asrs.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.core.common.Arith; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.domain.dto.AxisBean; |
| | | import com.zy.asrs.domain.dto.WorkChartAxis; |
| | | import com.zy.asrs.domain.vo.LocChartPie; |
| | | import com.zy.asrs.entity.RgvOneSign; |
| | | import com.zy.asrs.entity.WaitPakin; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.asrs.mapper.RgvOneSignMapper; |
| | | import com.zy.asrs.mapper.WaitPakinMapper; |
| | | import com.zy.asrs.service.ApiLogService; |
| | | import com.zy.asrs.service.WrkDetlService; |
| | | import com.zy.common.model.MatDto; |
| | | import com.zy.common.service.CommonService; |
| | |
| | | private SlaveProperties slaveProperties; |
| | | @Autowired |
| | | private WrkDetlService wrkDetlService; |
| | | @Autowired |
| | | private WaitPakinMapper waitPakinMapper; |
| | | @Autowired |
| | | private ApiLogService apiLogService; |
| | | @Autowired |
| | | private RgvOneSignMapper rgvOneSignMapper; |
| | | |
| | | /** |
| | | * 获取当前时间 |
| | |
| | | } else { |
| | | staProtocolPall = staProtocolPall.clone(); |
| | | } |
| | | String errorSta = ""; |
| | | boolean signSta = false; |
| | | |
| | | if (!staProtocolPall.isAutoing() || !staProtocolPall.isLoading() || staProtocolPall.getWorkNo() != 0 || !staProtocolPall.isPakMk()){ |
| | | return R.error("未就绪!!!"); |
| | | if (!staProtocolPall.isAutoing()){ |
| | | errorSta = errorSta+"站点非自动!!!"; |
| | | signSta = true; |
| | | } |
| | | if (!staProtocolPall.isLoading()){ |
| | | errorSta = errorSta+"站点无托盘!!!"; |
| | | signSta = true; |
| | | } |
| | | if (staProtocolPall.getWorkNo() != 0 ){ |
| | | errorSta = errorSta+"站点存在任务号!!!"; |
| | | signSta = true; |
| | | } |
| | | if (!staProtocolPall.isPakMk()){ |
| | | errorSta = errorSta+"站点存在锁定标记!!!"; |
| | | signSta = true; |
| | | } |
| | | if (signSta){ |
| | | try{ |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "中控申请获取"+palletizingNo+"站点当前条码信息", |
| | | "/monitor/barcode/two", |
| | | null, |
| | | null, |
| | | JSON.toJSONString(palletizingNo), |
| | | "未就绪!!!请等待... 原因:"+errorSta, |
| | | false |
| | | ); |
| | | }catch (Exception e){ |
| | | } |
| | | return R.error("未就绪!!!请等待... 原因:"+errorSta); |
| | | } |
| | | |
| | | // 获取条码扫描仪信息 |
| | |
| | | // Calendar calendar = Calendar.getInstance(); |
| | | // calendar.setTime(now); |
| | | if (Cools.isEmpty(barcode) || barcode.equals("")){ |
| | | try{ |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "中控申请获取"+palletizingNo+"站点当前条码信息", |
| | | "/monitor/barcode/two", |
| | | null, |
| | | null, |
| | | JSON.toJSONString(palletizingNo), |
| | | "未就绪!!!托盘条码为空!!!请检查!!!", |
| | | false |
| | | ); |
| | | }catch (Exception e){ |
| | | } |
| | | return R.error("未就绪!!!托盘条码为空!!!请检查!!!"); |
| | | } |
| | | return R.ok( |
| | | Cools.add("barcode", barcode).add("Date",now) |
| | | ); |
| | | if (waitPakinMapper.selectCount(new EntityWrapper<WaitPakin>().eq("zpallet", barcode))!=0){ |
| | | try{ |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "中控申请获取"+palletizingNo+"站点当前条码信息", |
| | | "/monitor/barcode/two", |
| | | null, |
| | | null, |
| | | JSON.toJSONString(palletizingNo), |
| | | "未就绪!!!托盘条码不为空但是已存在数据,不可重复使用!!!请检查!!!", |
| | | false |
| | | ); |
| | | }catch (Exception e){ |
| | | } |
| | | return R.error("未就绪!!!托盘条码不为空但是已存在数据,不可重复使用!!!请检查或重新获取!!!"); |
| | | } |
| | | |
| | | |
| | | RgvOneSign JarTwo = rgvOneSignMapper.selectOneSign(palletizingNo+"barcode"+barcode); |
| | | if (!Cools.isEmpty(JarTwo)){ |
| | | try{ |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "中控申请获取"+palletizingNo+"站点当前条码信息", |
| | | "/monitor/barcode/two", |
| | | null, |
| | | null, |
| | | JSON.toJSONString(palletizingNo), |
| | | "未就绪!!!条码更新中....", |
| | | false |
| | | ); |
| | | }catch (Exception e){ |
| | | } |
| | | return R.error("未就绪!!!条码更新中...."); |
| | | } |
| | | |
| | | try{ |
| | | rgvOneSignMapper.deleteBarcode(palletizingNo+"barcode"); |
| | | try{ |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "中控申请获取"+palletizingNo+"站点当前条码信息", |
| | | "/monitor/barcode/two", |
| | | null, |
| | | null, |
| | | JSON.toJSONString(palletizingNo), |
| | | JSON.toJSONString("清除托盘码标记成功!!!"), |
| | | true |
| | | ); |
| | | }catch (Exception e){ |
| | | } |
| | | } catch (Exception e){ |
| | | try{ |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "中控申请获取"+palletizingNo+"站点当前条码信息", |
| | | "/monitor/barcode/two", |
| | | null, |
| | | null, |
| | | JSON.toJSONString(palletizingNo), |
| | | JSON.toJSONString("清除托盘码标记异常!!!"), |
| | | false |
| | | ); |
| | | }catch (Exception e1){ |
| | | } |
| | | } |
| | | |
| | | Cools.CoolMap coolMap = Cools.add("barcode", barcode).add("Date", now); |
| | | try{ |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "中控申请获取"+palletizingNo+"站点当前条码信息", |
| | | "/monitor/barcode/two", |
| | | null, |
| | | null, |
| | | JSON.toJSONString(palletizingNo), |
| | | JSON.toJSONString("barcode:"+barcode), |
| | | true |
| | | ); |
| | | }catch (Exception e){ |
| | | } |
| | | return R.ok(coolMap); |
| | | } |
| | | |
| | | /** |
| | |
| | | @GetMapping("/led/useInfo") |
| | | public R monitorLedUseInfo(@RequestParam("ledId") Integer ledId) { |
| | | Integer count1 = wrkDetlService.count1(); |
| | | Integer count11 = wrkDetlService.count11(); |
| | | Integer count3 = wrkDetlService.count3(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("count1", count1); |
| | | map.put("count1", count1+count11); |
| | | map.put("count2", count3); |
| | | return R.ok().add(map); |
| | | } |