处理服务循环依赖问题

This commit is contained in:
2023-03-27 14:24:07 +08:00
parent 5683e91301
commit 3e3287907c
3 changed files with 18 additions and 12 deletions

View File

@@ -16,6 +16,7 @@ import org.nl.common.enums.AcsTaskEnum;
import org.nl.common.utils.MapOf; import org.nl.common.utils.MapOf;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.pda.service.CacheLineHandService; import org.nl.wms.pda.service.CacheLineHandService;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.TaskService; import org.nl.wms.sch.service.TaskService;
@@ -35,10 +36,14 @@ import java.util.Map;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class AcsToWmsServiceImpl implements AcsToWmsService { public class AcsToWmsServiceImpl implements AcsToWmsService{
private final TaskService taskService;
private final AgvInstService agvInstService;
private final CacheLineHandService cacheLineHandService; @Autowired
private TaskService taskService;
@Autowired
private CacheLineHandService cacheLineHandService;
private final AgvInstService agvInstService;
@Override @Override
public Map<String, Object> apply(JSONObject jsonObject) { public Map<String, Object> apply(JSONObject jsonObject) {

View File

@@ -3,19 +3,20 @@ package org.nl.wms.ext.acs.service.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.nl.common.anno.Log;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.AcsUtil; import org.nl.common.utils.AcsUtil;
import org.nl.common.utils.MapOf; import org.nl.common.utils.MapOf;
import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map; import java.util.Map;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class WmsToAcsServiceImpl implements WmsToAcsService { public class WmsToAcsServiceImpl implements WmsToAcsService{
@Override @Override
public Map<String, Object> issueTaskToAcs(JSONArray arr) { public Map<String, Object> issueTaskToAcs(JSONArray arr) {
JSONArray form = new JSONArray(); JSONArray form = new JSONArray();

View File

@@ -61,15 +61,15 @@ public class CacheLineHandController{
@ApiOperation("规格下拉框查询") @ApiOperation("规格下拉框查询")
public CommonResult<JSONArray> semiMaterialSpecQuery(@RequestBody JSONObject form) { public CommonResult<JSONArray> semiMaterialSpecQuery(@RequestBody JSONObject form) {
log.info("海亮缓存线手持服务 [规格下拉框查询] 接口被请求, 请求参数-{}", form); log.info("海亮缓存线手持服务 [规格下拉框查询] 接口被请求, 请求参数-{}", form);
return RestBusinessTemplate.execute(() -> cacheLineHandService.semiMaterialSpecQuery(form.getString("form"))); return RestBusinessTemplate.execute(() -> cacheLineHandService.semiMaterialSpecQuery(form.getString("search_bar")));
} }
@PostMapping("/workProcedureQuery") @PostMapping("/workprocedureQuery")
@Log("工序下拉框查询") @Log("工序下拉框查询")
@ApiOperation("工序下拉框查询") @ApiOperation("工序下拉框查询")
public CommonResult<JSONArray> workProcedureQuery(@RequestBody JSONObject form) { public CommonResult<JSONArray> workProcedureQuery(@RequestBody JSONObject form) {
log.info("海亮缓存线手持服务 [工序下拉框查询] 接口被请求, 请求参数-{}", form); log.info("海亮缓存线手持服务 [工序下拉框查询] 接口被请求, 请求参数-{}", form);
return RestBusinessTemplate.execute(() -> cacheLineHandService.workProcedureQuery(form.getString("form"))); return RestBusinessTemplate.execute(() -> cacheLineHandService.workProcedureQuery(form.getString("search_bar")));
} }
@PostMapping("/deviceQuery") @PostMapping("/deviceQuery")
@@ -77,7 +77,7 @@ public class CacheLineHandController{
@ApiOperation("缓存线设备下拉框查询") @ApiOperation("缓存线设备下拉框查询")
public CommonResult<JSONArray> deviceQuery(@RequestBody JSONObject form) { public CommonResult<JSONArray> deviceQuery(@RequestBody JSONObject form) {
log.info("海亮缓存线手持服务 [缓存线设备下拉框查询] 接口被请求, 请求参数-{}", form); log.info("海亮缓存线手持服务 [缓存线设备下拉框查询] 接口被请求, 请求参数-{}", form);
return RestBusinessTemplate.execute(() -> cacheLineHandService.deviceQuery(form.getString("form"))); return RestBusinessTemplate.execute(() -> cacheLineHandService.deviceQuery(form.getString("search_bar")));
} }
@PostMapping("/instStatusQuery") @PostMapping("/instStatusQuery")
@@ -85,13 +85,13 @@ public class CacheLineHandController{
@ApiOperation("指令状态下拉框查询") @ApiOperation("指令状态下拉框查询")
public CommonResult<JSONArray> instStatusQuery(@RequestBody JSONObject form) { public CommonResult<JSONArray> instStatusQuery(@RequestBody JSONObject form) {
log.info("海亮缓存线手持服务 [指令状态下拉框查询] 接口被请求, 请求参数-{}", form); log.info("海亮缓存线手持服务 [指令状态下拉框查询] 接口被请求, 请求参数-{}", form);
return RestBusinessTemplate.execute(() -> cacheLineHandService.instStatusQuery(form.getString("form"))); return RestBusinessTemplate.execute(() -> cacheLineHandService.instStatusQuery(form.getString("search_bar")));
} }
@PostMapping("/instPageQuery") @PostMapping("/instPageQuery")
@Log("任务分页查询") @Log("任务分页查询")
@ApiOperation("任务分页数据") @ApiOperation("任务分页数据")
public CommonResult<Object> instPageQuery(@RequestBody Map<String,String> param, Pageable page) { public CommonResult<Map<String,Object>> instPageQuery(@RequestBody Map<String,String> param, Pageable page) {
log.info("海亮缓存线手持服务 [任务分页查询] 接口被请求, 请求参数-{}", param); log.info("海亮缓存线手持服务 [任务分页查询] 接口被请求, 请求参数-{}", param);
return RestBusinessTemplate.execute(() -> { return RestBusinessTemplate.execute(() -> {
if(null == param) { if(null == param) {