| | |
| | | * **/ |
| | | @GetMapping("/getOrderInformation") |
| | | public AjaxResult getOrderInformation() { |
| | | Map<String,String> resultMap = new HashMap<>(); |
| | | List list = new ArrayList<>(); |
| | | Map<String,Object> resultMap = new HashMap<>(); |
| | | List<OmProductionOrdeInfo> orderList = omProductionOrdeInfoService.list(new LambdaQueryWrapper<OmProductionOrdeInfo>().orderByDesc(OmProductionOrdeInfo::getCreateTime)); |
| | | OmProductionOrdeInfo order = orderList.get(0); // 获取最新的一条订单信息 |
| | | String workOrderNo = order.getWorkOrderNo(); |
| | |
| | | .eq(OmProductionOrdeInfo::getOrderStatus,"3") |
| | | .eq(OmProductionOrdeInfo::getWorkOrderNo,workOrderNo) |
| | | ); |
| | | double percent = (double) finishNum.size() / order.getPlanQty() * 100; // 将百分比表示为小数 |
| | | int roundedPercent = (int) Math.round(percent); // 四舍五入到整数 |
| | | list.add(roundedPercent); |
| | | list.add(roundedPercent); |
| | | resultMap.put("workOrderNo",workOrderNo); |
| | | resultMap.put("planQty",order.getPlanQty().toString()); |
| | | resultMap.put("actualQty",String.valueOf(finishNum.size())); |
| | | resultMap.put("waterLevel",list); |
| | | return AjaxResult.success(resultMap); |
| | | } |
| | | |
| | |
| | | lineData.add(omProductionOrdeInfo.getOrderCount()); |
| | | } |
| | | map.put("category",category); |
| | | map.put("lineData",lineData); |
| | | map.put("barData",lineData); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | |
| | | " inbound_time,\n" + |
| | | " outbound_time,\n" + |
| | | " DATEDIFF(SECOND, inbound_time, outbound_time) AS beatTime"); |
| | | queryWrapper.eq("sfc_code","2408270000011"); |
| | | queryWrapper.eq("sfc_code",getLatestCompletedWorkpiece()); |
| | | queryWrapper.orderByDesc("location_code"); |
| | | List<DaPassingStationCollection> list = daPassingStationCollectionService.list(queryWrapper); |
| | | for (DaPassingStationCollection daPassingStationCollection : list) { |
| | |
| | | return AjaxResult.success(resultList); |
| | | } |
| | | |
| | | // 获得最新完成工件状态为5 |
| | | public String getLatestCompletedWorkpiece(){ |
| | | QueryWrapper<OmProductionOrdeInfo> wrapper = new QueryWrapper<>(); |
| | | wrapper.select("TOP 1 *"); |
| | | wrapper.eq("order_status","5"); |
| | | wrapper.orderByDesc("actual_end_time"); |
| | | OmProductionOrdeInfo one = omProductionOrdeInfoService.getOne(wrapper); |
| | | return one.getProductNum(); |
| | | } |
| | | |
| | | public static int locationPassRate(int passRate,int total) { |
| | | double percentage = (double) passRate / total * 100; |
| | | long roundedNumber = Math.round(percentage); |