|
@@ -1,16 +1,14 @@
|
|
|
package com.jjt.biz.controller;
|
|
package com.jjt.biz.controller;
|
|
|
|
|
|
|
|
import com.jjt.biz.service.IApiYrService;
|
|
import com.jjt.biz.service.IApiYrService;
|
|
|
-import com.jjt.biz.vo.YrCompareBackReq;
|
|
|
|
|
-import com.jjt.biz.vo.YrCompareReq;
|
|
|
|
|
-import com.jjt.biz.vo.YrLineCurrVO;
|
|
|
|
|
-import com.jjt.biz.vo.YrTwinVO;
|
|
|
|
|
|
|
+import com.jjt.biz.vo.*;
|
|
|
import com.jjt.common.constant.CacheConstants;
|
|
import com.jjt.common.constant.CacheConstants;
|
|
|
import com.jjt.common.core.controller.BaseController;
|
|
import com.jjt.common.core.controller.BaseController;
|
|
|
import com.jjt.common.core.domain.R;
|
|
import com.jjt.common.core.domain.R;
|
|
|
import com.jjt.common.core.redis.RedisCache;
|
|
import com.jjt.common.core.redis.RedisCache;
|
|
|
import com.jjt.dye.domain.DyeHourLine;
|
|
import com.jjt.dye.domain.DyeHourLine;
|
|
|
import com.jjt.dye.service.IDyeHourLineService;
|
|
import com.jjt.dye.service.IDyeHourLineService;
|
|
|
|
|
+import com.jjt.utils.MesService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
@@ -20,6 +18,9 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
+import java.util.function.Function;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* swagger 用户测试方法
|
|
* swagger 用户测试方法
|
|
@@ -38,6 +39,8 @@ public class ApiYrController extends BaseController {
|
|
|
private String path;
|
|
private String path;
|
|
|
@Resource
|
|
@Resource
|
|
|
private IDyeHourLineService hourLineService;
|
|
private IDyeHourLineService hourLineService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private MesService mesService;
|
|
|
|
|
|
|
|
@ApiOperation("染整线数字孪生")
|
|
@ApiOperation("染整线数字孪生")
|
|
|
@GetMapping("/api/yr/data")
|
|
@GetMapping("/api/yr/data")
|
|
@@ -47,6 +50,8 @@ public class ApiYrController extends BaseController {
|
|
|
YrTwinVO vo = redisCache.getCacheObject(CacheConstants.RZ_MOCK);
|
|
YrTwinVO vo = redisCache.getCacheObject(CacheConstants.RZ_MOCK);
|
|
|
startPage();
|
|
startPage();
|
|
|
List<DyeHourLine> list = hourLineService.selectDyeHourLineListLast();
|
|
List<DyeHourLine> list = hourLineService.selectDyeHourLineListLast();
|
|
|
|
|
+ List<OrderFlowerVO> mesFlower = mesService.data();
|
|
|
|
|
+ Map<String, OrderFlowerVO> orderFlowerMap = mesFlower.stream().collect(Collectors.toMap(OrderFlowerVO::getLine, Function.identity()));
|
|
|
List<YrLineCurrVO> currVOS = new ArrayList<>();
|
|
List<YrLineCurrVO> currVOS = new ArrayList<>();
|
|
|
list.forEach(dhl -> {
|
|
list.forEach(dhl -> {
|
|
|
YrLineCurrVO curr = new YrLineCurrVO();
|
|
YrLineCurrVO curr = new YrLineCurrVO();
|
|
@@ -54,6 +59,10 @@ public class ApiYrController extends BaseController {
|
|
|
curr.setSpeed(dhl.getSpeed());
|
|
curr.setSpeed(dhl.getSpeed());
|
|
|
curr.setTgTmp(dhl.getTmpTg());
|
|
curr.setTgTmp(dhl.getTmpTg());
|
|
|
curr.setDxTmp(dhl.getTmpDx());
|
|
curr.setDxTmp(dhl.getTmpDx());
|
|
|
|
|
+
|
|
|
|
|
+ OrderFlowerVO orderFlowerVO = orderFlowerMap.get(dhl.getLine());
|
|
|
|
|
+ curr.setOrder(orderFlowerVO == null ? "" : orderFlowerVO.getBillNo());
|
|
|
|
|
+ curr.setColor(orderFlowerVO == null ? "" : orderFlowerVO.getDefine20() + "(" + orderFlowerVO.getDefine12() + ")");
|
|
|
currVOS.add(curr);
|
|
currVOS.add(curr);
|
|
|
});
|
|
});
|
|
|
vo.setCurr(currVOS);
|
|
vo.setCurr(currVOS);
|