Commit 5dc0ec7a authored by 单奇雲's avatar 单奇雲

Merge branch 'dev_upgrade' of http://172.16.10.76/station/YeeAmosFireAutoSysRoot into dev_upgrade

parents b1d72671 8bb63e3a
package com.yeejoin.amos.fas.business.controller; package com.yeejoin.amos.fas.business.controller;
import com.yeejoin.amos.fas.business.service.impl.ContingencyInstanceImpl;
import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance; import com.yeejoin.amos.fas.business.service.intfc.IContingencyInstance;
import com.yeejoin.amos.fas.business.service.intfc.IContingencyOriginalDataService; import com.yeejoin.amos.fas.business.service.intfc.IContingencyOriginalDataService;
import com.yeejoin.amos.fas.core.common.request.CommonPageable; import com.yeejoin.amos.fas.core.common.request.CommonPageable;
import com.yeejoin.amos.fas.core.common.request.CommonRequest; import com.yeejoin.amos.fas.core.common.request.CommonRequest;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import com.yeejoin.amos.fas.core.util.CommonResponseUtil; import com.yeejoin.amos.fas.core.util.CommonResponseUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
...@@ -18,9 +16,12 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -18,9 +16,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled; import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import javax.xml.bind.ValidationEvent; import java.util.HashMap;
import java.util.*; import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping(value = "/api/timeline") @RequestMapping(value = "/api/timeline")
...@@ -56,7 +57,6 @@ public class TimeLineController extends BaseController{ ...@@ -56,7 +57,6 @@ public class TimeLineController extends BaseController{
@RequestParam("contingencyPlanId") String contingencyPlanId, @RequestParam("contingencyPlanId") String contingencyPlanId,
@RequestParam("stepState") String stepState) throws Exception{ @RequestParam("stepState") String stepState) throws Exception{
Map<String,String> map = new HashMap<>(); Map<String,String> map = new HashMap<>();
map.put("batchNo",batchNo); map.put("batchNo",batchNo);
map.put("stepCode",stepCode); map.put("stepCode",stepCode);
...@@ -64,8 +64,9 @@ public class TimeLineController extends BaseController{ ...@@ -64,8 +64,9 @@ public class TimeLineController extends BaseController{
map.put("confirm",confirm); map.put("confirm",confirm);
map.put("contingencyPlanId",contingencyPlanId); map.put("contingencyPlanId",contingencyPlanId);
map.put("stepState",stepState); map.put("stepState",stepState);
map.put("token",getToken());
map.put("product",getProduct());
fireQueue.addLast(map); fireQueue.addLast(map);
return CommonResponseUtil.success("SUCCESS"); return CommonResponseUtil.success("SUCCESS");
} }
...@@ -78,13 +79,14 @@ public class TimeLineController extends BaseController{ ...@@ -78,13 +79,14 @@ public class TimeLineController extends BaseController{
return; return;
Map<String,String> map = fireQueue.getFirst(); Map<String,String> map = fireQueue.getFirst();
String batchNo = map.get("batchNo"); String batchNo = map.get("batchNo");
String stepCode = map.get("stepCode"); String stepCode = map.get("stepCode");
String buttonCode = map.get("buttonCode"); String buttonCode = map.get("buttonCode");
String confirm = map.get("confirm"); String confirm = map.get("confirm");
String contingencyPlanId = map.get("contingencyPlanId"); String contingencyPlanId = map.get("contingencyPlanId");
String stepState = map.get("stepState"); String stepState = map.get("stepState");
String token = map.get("token");
String product = map.get("product");
try try
{ {
log.info("fireQueue-size:"+fireQueue.size()); log.info("fireQueue-size:"+fireQueue.size());
...@@ -92,7 +94,8 @@ public class TimeLineController extends BaseController{ ...@@ -92,7 +94,8 @@ public class TimeLineController extends BaseController{
log.info("buttonCode:" + map.get("buttonCode")); log.info("buttonCode:" + map.get("buttonCode"));
log.info("confirm:" + map.get("confirm")); log.info("confirm:" + map.get("confirm"));
log.info("stepState:" + map.get("stepState")); log.info("stepState:" + map.get("stepState"));
RequestContext.setToken(token);
RequestContext.setProduct(product);
iContingencyInstance.setButtonExecuted(batchNo,contingencyPlanId,buttonCode,confirm); iContingencyInstance.setButtonExecuted(batchNo,contingencyPlanId,buttonCode,confirm);
iContingencyInstance.fire(batchNo,stepCode,contingencyPlanId,buttonCode,confirm,stepState); iContingencyInstance.fire(batchNo,stepCode,contingencyPlanId,buttonCode,confirm,stepState);
}catch (Exception e) }catch (Exception e)
......
...@@ -47,6 +47,7 @@ import org.springframework.util.CollectionUtils; ...@@ -47,6 +47,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static com.yeejoin.amos.fas.business.constants.FasConstant.token; import static com.yeejoin.amos.fas.business.constants.FasConstant.token;
...@@ -323,11 +324,11 @@ public class View3dServiceImpl implements IView3dService { ...@@ -323,11 +324,11 @@ public class View3dServiceImpl implements IView3dService {
//2.按照 风险等级id进行分组,加工数据 //2.按照 风险等级id进行分组,加工数据
Map<Long,List<RiskPointRpnChangeBo>> map = risks.stream().collect(Collectors.groupingBy(RiskPointRpnChangeBo::getRiskLevelId)); Map<Long,List<RiskPointRpnChangeBo>> map = risks.stream().collect(Collectors.groupingBy(RiskPointRpnChangeBo::getRiskLevelId));
List<RiskLevel> riskLevelList = iRiskLevelDao.findAll(); List<RiskLevel> riskLevelList = iRiskLevelDao.findAll();
Map<Long,String> riskLevelMap = riskLevelList.stream().collect(Collectors.toMap(RiskLevel::getId,RiskLevel::getName)); Map<Long,RiskLevel> riskLevelMap = riskLevelList.stream().collect(Collectors.toMap(RiskLevel::getId, Function.identity()));
map.forEach((k,v)->{ map.forEach((k,v)->{
SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo(); SafetyIndexDetailVo safetyIndexDetailVo = new SafetyIndexDetailVo();
safetyIndexDetailVo.setTypeCode(Long.toString(k)); safetyIndexDetailVo.setTypeCode(String.valueOf(riskLevelMap.get(k).getLevel()));
safetyIndexDetailVo.setTypeName(riskLevelMap.get(k)); safetyIndexDetailVo.setTypeName(riskLevelMap.get(k).getName());
safetyIndexDetailVo.setContent(getErrorContentVos(v)); safetyIndexDetailVo.setContent(getErrorContentVos(v));
resultList.add(safetyIndexDetailVo); resultList.add(safetyIndexDetailVo);
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment