|
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.github.zuihou.base.R;
|
|
import com.github.zuihou.base.R;
|
|
import com.github.zuihou.base.controller.SuperController;
|
|
import com.github.zuihou.base.controller.SuperController;
|
|
|
|
+import com.github.zuihou.business.DemoLine.DemoCacheKey;
|
|
|
|
+import com.github.zuihou.business.DemoLine.YunjianConstant;
|
|
import com.github.zuihou.business.edgeLibrary.dto.StockInfoSaveDTO;
|
|
import com.github.zuihou.business.edgeLibrary.dto.StockInfoSaveDTO;
|
|
import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
import com.github.zuihou.business.edgeLibrary.entity.Storge;
|
|
import com.github.zuihou.business.edgeLibrary.service.StorgeService;
|
|
import com.github.zuihou.business.edgeLibrary.service.StorgeService;
|
|
@@ -16,6 +18,7 @@ import com.github.zuihou.business.operationManagementCenter.service.OrderService
|
|
import com.github.zuihou.business.operationManagementCenter.service.OrderTaskService;
|
|
import com.github.zuihou.business.operationManagementCenter.service.OrderTaskService;
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
|
|
import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProductionresourceBizService;
|
|
import com.github.zuihou.business.productionResourceCenter.service.ProductionresourceBizService;
|
|
|
|
+import com.github.zuihou.business.util.MsgUtil;
|
|
import com.github.zuihou.common.constant.CacheKey;
|
|
import com.github.zuihou.common.constant.CacheKey;
|
|
import com.github.zuihou.common.constant.CodeRuleModule;
|
|
import com.github.zuihou.common.constant.CodeRuleModule;
|
|
import com.github.zuihou.common.constant.DictionaryKey;
|
|
import com.github.zuihou.common.constant.DictionaryKey;
|
|
@@ -34,6 +37,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Stream;
|
|
import java.util.stream.Stream;
|
|
|
|
|
|
@@ -54,6 +58,9 @@ public class OrderTaskController extends SuperController<OrderTaskService, Long,
|
|
@Autowired
|
|
@Autowired
|
|
private StorgeService storgeService;
|
|
private StorgeService storgeService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private MsgUtil msgUtil;
|
|
|
|
+
|
|
@ApiOperation(value = "新增自定义订单", notes = "新增自定义订单")
|
|
@ApiOperation(value = "新增自定义订单", notes = "新增自定义订单")
|
|
@PostMapping("/save")
|
|
@PostMapping("/save")
|
|
public R<OrderTask> save(@RequestBody OrderTaskSaveDTO data) {
|
|
public R<OrderTask> save(@RequestBody OrderTaskSaveDTO data) {
|
|
@@ -117,6 +124,9 @@ public class OrderTaskController extends SuperController<OrderTaskService, Long,
|
|
}
|
|
}
|
|
OrderTask orderTask = baseService.getOne(new LambdaQueryWrapper<OrderTask>().eq(OrderTask::getOrderId, orderId).last("limit 1"));
|
|
OrderTask orderTask = baseService.getOne(new LambdaQueryWrapper<OrderTask>().eq(OrderTask::getOrderId, orderId).last("limit 1"));
|
|
if(orderTask==null || StringUtil.isEmpty(orderTask.getStart()) || StringUtil.isEmpty(orderTask.getGoal())) return R.fail("订单任务尚未配置");
|
|
if(orderTask==null || StringUtil.isEmpty(orderTask.getStart()) || StringUtil.isEmpty(orderTask.getGoal())) return R.fail("订单任务尚未配置");
|
|
|
|
+ String CFTJ = (null == msgUtil.redis_get(DemoCacheKey.CFTJ)? "":msgUtil.redis_get(DemoCacheKey.CFTJ).toString());
|
|
|
|
+ if (!"".equals(CFTJ)) return fail("请勿重复提交");
|
|
|
|
+ msgUtil.redis_set(DemoCacheKey.CFTJ , data, 5, TimeUnit.SECONDS);
|
|
boolean bool = baseService.prodNode(orderTask, planId);
|
|
boolean bool = baseService.prodNode(orderTask, planId);
|
|
return bool? success(orderTask) : fail("保存失败");
|
|
return bool? success(orderTask) : fail("保存失败");
|
|
}
|
|
}
|