| | |
| | | import com.zy.common.entity.FindCrnNoResult; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.utils.RedisUtil; |
| | | import com.zy.core.News; |
| | | import com.zy.core.enums.RedisKeyType; |
| | | import com.zy.core.enums.SlaveType; |
| | | import com.zy.system.entity.Config; |
| | | import com.zy.system.service.ConfigService; |
| | |
| | | private BasDualCrnpService basDualCrnpService; |
| | | @Autowired |
| | | private BasStationService basStationService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | //申请入库任务 |
| | | public synchronized String applyInTask(String barcode, Integer sourceStaNo, Integer locType1) { |
| | | String wmsUrl = null; |
| | | Config wmsSystemUriConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemUri")); |
| | | if (wmsSystemUriConfig != null) { |
| | | wmsUrl = wmsSystemUriConfig.getValue(); |
| | | Object systemConfigMapObj = redisUtil.get(RedisKeyType.SYSTEM_CONFIG_MAP.key); |
| | | if (systemConfigMapObj == null) { |
| | | News.error("系统Config缓存失效"); |
| | | return null; |
| | | } |
| | | HashMap<String, String> systemConfigMap = (HashMap<String, String>) systemConfigMapObj; |
| | | |
| | | String wmsUrl = systemConfigMap.get("wmsSystemUri"); |
| | | if (wmsUrl == null) { |
| | | News.error("未配置WMS系统URI,配置文件Code编码:wmsSystemUri"); |
| | | return null; |
| | | } |
| | | |
| | | String wmsSystemInUrl = null; |
| | | Config wmsSystemInUrlConfig = configService.selectOne(new EntityWrapper<Config>().eq("code", "wmsSystemInUrl")); |
| | | if (wmsSystemInUrlConfig != null) { |
| | | wmsSystemInUrl = wmsSystemInUrlConfig.getValue(); |
| | | } |
| | | |
| | | if(wmsSystemInUrlConfig == null){ |
| | | String wmsSystemInUrl = systemConfigMap.get("wmsSystemInUrl"); |
| | | if(wmsSystemInUrl == null){ |
| | | News.error("未配置WMS入库接口地址,配置文件Code编码:wmsSystemInUrl"); |
| | | return null; |
| | | } |
| | |
| | | .setUri(wmsUrl) |
| | | .setPath(wmsSystemInUrl) |
| | | .setJson(JSON.toJSONString(requestParam)) |
| | | .setTimeout(360, TimeUnit.SECONDS) |
| | | .setTimeout(30, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | if (response != null) { |
| | |
| | | .setUri(wmsUrl) |
| | | .setPath(wmsSystemReassignInTaskUrl) |
| | | .setJson(JSON.toJSONString(requestParam)) |
| | | .setTimeout(360, TimeUnit.SECONDS) |
| | | .setTimeout(30, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | if (response != null) { |
| | |
| | | .setUri(wmsUrl) |
| | | .setPath(wmsSystemChangeLocNoUrl) |
| | | .setJson(JSON.toJSONString(requestParam)) |
| | | .setTimeout(360, TimeUnit.SECONDS) |
| | | .setTimeout(30, TimeUnit.SECONDS) |
| | | .build() |
| | | .doPost(); |
| | | |