1、优化原片仓储
2、优化中空任务处理逻辑
3、修改中空理片笼向前端推送数据格式
| | |
| | | * 大理片笼任务类型 |
| | | * 1、钢化前进片 |
| | | * 2、钢化前出片 |
| | | * 3、钢化后进片 |
| | | * 4、钢化后出片 |
| | | * 4、钢化后进片 |
| | | * 5、钢化后出片 |
| | | */ |
| | | public static final Integer BIG_STORAGE_BEFORE_IN = 1; |
| | | public static final Integer BIG_STORAGE_BEFORE_OUT = 2; |
| | |
| | | WorkAssignmentMapper workAssignmentMapper; |
| | | |
| | | |
| | | private final static String ERP_URL = "http://192.168.2.100:8086"; |
| | | private final static String ERP_URL = "http://192.168.2.100:8086"; |
| | | // private final static String ERP_URL = "http://10.153.19.174:8086"; |
| | | |
| | | |
| | |
| | | log.info("报工数据reportingWork:{},reportingWorkDetails:{}", reportingWork, reportingWorkDetails); |
| | | try { |
| | | // 目标系统的API URL |
| | | |
| | | |
| | | String url1 = ERP_URL + "/reportingWork/mesReportingWork"; |
| | | String url2 = ERP_URL + "/reportingWork/mesSaveReportingWorkWorn"; |
| | | String url; |
| | |
| | | } |
| | | URL obj = new URL(url); |
| | | HttpURLConnection con = (HttpURLConnection) obj.openConnection(); |
| | | |
| | | // 设置请求方法和请求头 |
| | | con.setRequestMethod("POST"); |
| | | con.setRequestProperty("Content-Type", "application/json; utf-8"); |
| | |
| | | |
| | | // 创建 JSON 对象 |
| | | JSONObject result = new JSONObject(); |
| | | |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | |
| | | // 将 ReportingWork 转换为 JSONObject |
| | | |
| | | // 将 ReportingWorkDetail 列表转换为 JSONArray |
| | |
| | | result.put("qualityInsStatus", 0); |
| | | // 将 result 对象转换为字符串 |
| | | String jsonInputString = result.toString(); |
| | | System.out.println("jsonInputString : " + result); |
| | | log.info("jsonInputString :{} ", result); |
| | | // 发送请求 |
| | | try (OutputStream os = con.getOutputStream()) { |
| | | byte[] input = jsonInputString.getBytes("utf-8"); |
| | |
| | | |
| | | // 获取响应码 |
| | | int responseCode = con.getResponseCode(); |
| | | System.out.println("Response Code : " + responseCode); |
| | | log.info("Response Code :{} ", responseCode); |
| | | |
| | | // 获取响应内容 |
| | | try (BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream(), "utf-8"))) { |
| | |
| | | /** |
| | | * 栅格号 |
| | | */ |
| | | private String slot; |
| | | private Integer slot; |
| | | /** |
| | | * 设备id |
| | | */ |
| | |
| | | */ |
| | | String patternWarehousing(RawGlassRequest request); |
| | | |
| | | String UpdateQuantity(RawGlassRequest request); |
| | | String updateQuantity(RawGlassRequest request); |
| | | |
| | | String deleteWarehousing(Long slotId); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public String UpdateQuantity(RawGlassRequest request) { |
| | | public String updateQuantity(RawGlassRequest request) { |
| | | RawGlassStorageDetails one = getOne(new LambdaQueryWrapper<RawGlassStorageDetails>().eq(RawGlassStorageDetails::getSlot, request.getSlot()) |
| | | .eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN)); |
| | | if (null == one) { |
| | | RawGlassStorageDetails details = new RawGlassStorageDetails(); |
| | | BeanUtils.copyProperties(request, details); |
| | | details.setState(Const.RAW_GLASS_STATE_IN); |
| | | details.setShelf(request.getSlot()); |
| | | save(details); |
| | | }else{ |
| | | } else { |
| | | update( |
| | | new LambdaUpdateWrapper<RawGlassStorageDetails>() |
| | | .set(RawGlassStorageDetails::getRemainQuantity, request.getRemainQuantity()) |
| | |
| | | .set(RawGlassStorageDetails::getPatternThickness, request.getPatternThickness()) |
| | | .set(RawGlassStorageDetails::getFilmsId, request.getFilmsId()) |
| | | .eq(RawGlassStorageDetails::getSlot, request.getSlot()) |
| | | .eq(RawGlassStorageDetails::getSlot, Const.RAW_GLASS_STATE_IN)); |
| | | .eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN)); |
| | | } |
| | | return "success"; |
| | | } |
| | |
| | | return Boolean.FALSE; |
| | | } |
| | | |
| | | |
| | | List<RawGlassStorageDetails> loadStationList = rawGlassStorageDetailsService.list(new LambdaQueryWrapper<RawGlassStorageDetails>() |
| | | .inSql(RawGlassStorageDetails::getSlot, "select slot from raw_glass_storage_station where enable_state = 1") |
| | | .eq(RawGlassStorageDetails::getState, Const.RAW_GLASS_STATE_IN) |
| | |
| | | 200, "入库已完成,等待任务执行", rawGlassStorageDetailsService.patternWarehousing(request)); |
| | | } |
| | | |
| | | @ApiOperation("更新剩余数量") |
| | | @PostMapping("/updateQuantity") |
| | | public Result<Object> updateQuantity(@Validated @RequestBody RawGlassRequest request) { |
| | | return Result.success(rawGlassStorageDetailsService.updateQuantity(request)); |
| | | } |
| | | |
| | | @ApiOperation("删除原片") |
| | | @PostMapping("/deleteWarehousing") |
| | | public Result<Object> deleteWarehousing(Long slotId) { |
| | | return Result.success(rawGlassStorageDetailsService.deleteWarehousing(slotId)); |
| | | } |
| | | |
| | | @ApiOperation("原片出库") |
| | | @PostMapping("/outWarehousing") |
| | |
| | | return Result.build(200, "查询成功", rawGlassStorageDetailsService.patternUsage(width, height, thickness, films)); |
| | | } |
| | | |
| | | @ApiOperation("更新剩余数量") |
| | | @PostMapping("/updateQuantity") |
| | | public Result<Object> updateQuantity(@Validated @RequestBody RawGlassRequest request) { |
| | | return Result.success(rawGlassStorageDetailsService.UpdateQuantity(request)); |
| | | } |
| | | @ApiOperation("删除原片") |
| | | @PostMapping("/deleteWarehousing") |
| | | public Result<Object> deleteWarehousing(@RequestBody Long slotId) { |
| | | return Result.success(rawGlassStorageDetailsService.deleteWarehousing(slotId)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.mes.hollow.entity.dto.*; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageDetails)表服务接口 |
| | |
| | | |
| | | List<HollowBigStorageCageDetails> queryOutGlassList(String flowCardId, int cell); |
| | | |
| | | List<BigStorageVO> queryHollowbigStorageCageDetail(); |
| | | Map<Integer, List<BigStorageVO>> queryHollowbigStorageCageDetail(); |
| | | |
| | | /** |
| | | * 取出每组玻璃占用笼子的格子并计算格子内的最大组序号 |
| | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * (HollowBigStorageCageDetails)表服务实现类 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<BigStorageVO> queryHollowbigStorageCageDetail() { |
| | | return baseMapper.queryHollowbigStorageCageDetail(); |
| | | public Map<Integer, List<BigStorageVO>> queryHollowbigStorageCageDetail() { |
| | | List<BigStorageVO> bigStorageCages = baseMapper.queryHollowbigStorageCageDetail(); |
| | | return bigStorageCages.stream().collect(Collectors.groupingBy(item -> item.getDeviceId())); |
| | | } |
| | | |
| | | @Override |
| | |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | cell = 930; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | |
| | | if (null == hollowGlassOutRelationInfo) { |
| | | cell = 931; |
| | | hollowGlassOutRelationInfo = hollowGlassOutRelationInfoService |
| | | .getOne(new LambdaQueryWrapper<HollowGlassOutRelationInfo>() |
| | | .eq(HollowGlassOutRelationInfo::getCell, cell) |
| | | .eq(HollowGlassOutRelationInfo::getState, Const.HOLLOW_FLOW_CARD_START) |
| | | ); |
| | | } |
| | | |
| | | if (null != hollowGlassOutRelationInfo) { |
| | | //是否允许中空 |
| | |
| | | log.info("计算玻璃数量过程中出现错误,错误信息{}", e.getMessage()); |
| | | } |
| | | |
| | | // hollowGlassOutRelationInfoService.update |
| | | // 重置任务表数据 |
| | | bigStorageCageTaskService.updateOutTaskMessage(BIG_STORAGE_CAGE_OUT_TWO_TASK); |
| | | |
| | |
| | | t.quantity, |
| | | t1.child_width, |
| | | t1.child_height |
| | | |
| | | from pp.flow_card t |
| | | LEFT JOIN sd.order_glass_detail t1 |
| | | on t.order_id = t1.order_id |