fix(订单中心):机库查询设备任务等逻辑优化
This commit is contained in:
+7
-1
@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -75,7 +76,12 @@ public class ApiDeviceController {
|
||||
String property = MapUtil.getStrValue(param, "control");
|
||||
String value = MapUtil.getStrValue(param, "order_no");
|
||||
Assert.notNull(value,"任务编号不能为空");
|
||||
|
||||
String orderStatus = orderCenterService.getOrderStatusByOrderNo(value);
|
||||
if (!StringUtils.isEmpty(orderStatus)) {
|
||||
if (!orderStatus.equals("1")){
|
||||
return Result.succeed("设备已执行");
|
||||
}
|
||||
}
|
||||
try {
|
||||
if (ControlEnum.contains(ControlEnum.valueOf(property.toUpperCase()))) {
|
||||
jsonObject = gson.fromJson(controlMessageConstant.CONTROL_MESSAGE_MAP.get(property), JsonObject.class);
|
||||
|
||||
+5
@@ -4,6 +4,8 @@ import com.central.common.constant.ServiceNameConstants;
|
||||
import com.central.common.model.Result;
|
||||
import com.central.device.feign.fallback.OrderCenterServiceFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
@@ -20,4 +22,7 @@ public interface OrderCenterService {
|
||||
|
||||
@PostMapping("/status")
|
||||
Result updateOrderStatusDoing(@RequestBody String orderNo);
|
||||
|
||||
@GetMapping("/status/{orderNo}")
|
||||
String getOrderStatusByOrderNo(@PathVariable("orderNo") String orderNo);
|
||||
}
|
||||
|
||||
+5
@@ -26,6 +26,11 @@ public class OrderCenterServiceFallbackFactory implements FallbackFactory<OrderC
|
||||
public Result updateOrderStatusDoing(String orderNo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOrderStatusByOrderNo(String orderNo) {
|
||||
return "";
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user