| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.core.common.Cools; |
| | | import com.core.exception.CoolException; |
| | | import com.zy.asrs.entity.BasCrnp; |
| | |
| | | int result = 0; |
| | | try { |
| | | BasStation basStation = basStationService |
| | | .selectOne(new EntityWrapper<BasStation>().eq("station_id", sourceStaNo)); |
| | | .getOne(new QueryWrapper<BasStation>().eq("station_id", sourceStaNo)); |
| | | if (basStation == null) { |
| | | News.error("站点{}不存在", sourceStaNo); |
| | | return null; |
| | |
| | | |
| | | requestParam.put("barcode", barcode); |
| | | requestParam.put("sourceStaNo", stationNo); |
| | | requestParam.put("locType1", locType1); |
| | | requestParam.put("locType1", locType1 == null ? 1 : locType1); |
| | | requestParam.put("row", Utils.getInTaskEnableRow(sourceStaNo)); |
| | | |
| | | response = new HttpHandler.Builder() |
| | |
| | | .setTimeout(30, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | if (response != null) { |
| | | if (!Cools.isEmpty(response)) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code") == 200) { |
| | | result = 1; |
| | |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | } |
| | | return response; |
| | | } |
| | |
| | | // 申请任务重新分配库位 |
| | | public synchronized String applyReassignTaskLocNo(Integer taskNo, Integer stationId) { |
| | | String wmsUrl = null; |
| | | Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | Config wmsSystemUriConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | if (wmsSystemUriConfig != null) { |
| | | wmsUrl = wmsSystemUriConfig.getValue(); |
| | | } |
| | |
| | | |
| | | String wmsSystemReassignInTaskUrl = null; |
| | | Config wmsSystemReassignInTaskUrlConfig = configService |
| | | .selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemReassignInTaskUrl")); |
| | | .getOne(new QueryWrapper<Config>().eq("code", "wmsSystemReassignInTaskUrl")); |
| | | if (wmsSystemReassignInTaskUrlConfig != null) { |
| | | wmsSystemReassignInTaskUrl = wmsSystemReassignInTaskUrlConfig.getValue(); |
| | | } |
| | |
| | | .setTimeout(30, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | if (response != null) { |
| | | if (!Cools.isEmpty(response)) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code") == 200) { |
| | | result = 1; |
| | |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | } |
| | | return response; |
| | | } |
| | |
| | | // 申请在库库位更换库位 |
| | | public synchronized String applyChangeLocNo(String locNo) { |
| | | String wmsUrl = null; |
| | | Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | Config wmsSystemUriConfig = configService.getOne(new QueryWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | if (wmsSystemUriConfig != null) { |
| | | wmsUrl = wmsSystemUriConfig.getValue(); |
| | | } |
| | |
| | | |
| | | String wmsSystemChangeLocNoUrl = null; |
| | | Config wmsSystemChangeLocNoUrlConfig = configService |
| | | .selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemChangeLocNoUrl")); |
| | | .getOne(new QueryWrapper<Config>().eq("code", "wmsSystemChangeLocNoUrl")); |
| | | if (wmsSystemChangeLocNoUrlConfig != null) { |
| | | wmsSystemChangeLocNoUrl = wmsSystemChangeLocNoUrlConfig.getValue(); |
| | | } |
| | |
| | | List<Integer> crnRows = new ArrayList<>(); |
| | | |
| | | if (findCrnNoResult.getCrnType().equals(SlaveType.Crn)) { |
| | | BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | BasCrnp basCrnp = basCrnpService.getOne(new QueryWrapper<BasCrnp>().eq("crn_no", crnNo)); |
| | | if (basCrnp == null) { |
| | | return null; |
| | | } |
| | |
| | | } |
| | | } else if (findCrnNoResult.getCrnType().equals(SlaveType.DualCrn)) { |
| | | BasDualCrnp basDualCrnp = basDualCrnpService |
| | | .selectOne(new EntityWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | .getOne(new QueryWrapper<BasDualCrnp>().eq("crn_no", crnNo)); |
| | | if (basDualCrnp == null) { |
| | | return null; |
| | | } |
| | |
| | | .build() |
| | | .doPost(); |
| | | |
| | | if (response != null) { |
| | | if (!Cools.isEmpty(response)) { |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | if (jsonObject.getInteger("code") == 200) { |
| | | result = 1; |
| | |
| | | httpRequestLog.setResponse(response); |
| | | httpRequestLog.setCreateTime(new Date()); |
| | | httpRequestLog.setResult(result); |
| | | httpRequestLogService.insert(httpRequestLog); |
| | | httpRequestLogService.save(httpRequestLog); |
| | | } |
| | | return response; |
| | | } |