Commit 8fa379ad authored by zhoushiguang's avatar zhoushiguang

Merge remote-tracking branch 'origin/master'

parents 0305498e 16d28797
...@@ -77,4 +77,19 @@ public class InduceFontHistController { ...@@ -77,4 +77,19 @@ public class InduceFontHistController {
return jsonViewObject; return jsonViewObject;
} }
@ApiOperation(value = "通过字体id删除诱导屏字体信息", notes = "通过字体id删除诱导屏字体信息",
response = JsonViewObject.class, produces = MediaType.APPLICATION_JSON)
@GetMapping(value = "/deleteOneById", produces = MediaType.APPLICATION_JSON)
public JsonViewObject deleteOneById(@RequestParam("id") Integer id) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
try {
induceFontHistService.deleteOneById(id);
jsonViewObject.success("删除成功");
} catch (Exception e) {
jsonViewObject.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} byLastOne error", this.getClass().getSimpleName(), e);
}
return jsonViewObject;
}
} }
...@@ -28,4 +28,11 @@ public interface InduceFontHistService { ...@@ -28,4 +28,11 @@ public interface InduceFontHistService {
* @return * @return
*/ */
InduceFontHist getLastOne(String equipCode); InduceFontHist getLastOne(String equipCode);
/**
* 通过id删除诱导屏文字信息
* @param id
* @return
*/
void deleteOneById(Integer id);
} }
...@@ -60,4 +60,13 @@ public class InduceFontHistServiceImpl implements InduceFontHistService { ...@@ -60,4 +60,13 @@ public class InduceFontHistServiceImpl implements InduceFontHistService {
} }
return null; return null;
} }
@Override
public void deleteOneById(Integer id) {
if (Objects.nonNull(id)) {
InduceFontHist hist = new InduceFontHist();
hist.setId(id.longValue());
induceFontHistMapper.deleteById(id);
}
}
} }
...@@ -9,7 +9,7 @@ import java.util.List; ...@@ -9,7 +9,7 @@ import java.util.List;
*/ */
@Data @Data
public class StrategyControlSwitchReq { public class StrategyControlSwitchReq {
private List<Detail> req; private List<Detail> data;
@Data @Data
public static class Detail { public static class Detail {
......
...@@ -27,6 +27,7 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic ...@@ -27,6 +27,7 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
@Override @Override
public Result push(StrategyControlReq req) throws Exception { public Result push(StrategyControlReq req) throws Exception {
//String url = "http://37.12.182.50:8082/api/traffic/strategy/info"; //String url = "http://37.12.182.50:8082/api/traffic/strategy/info";
//String url = "http://37.12.182.50:8182/api/traffic/strategy/info";
try { try {
ObjectMapper mapper = JacksonUtils.getInstance(); ObjectMapper mapper = JacksonUtils.getInstance();
String resultStr = RestTemplateTool.post(url, mapper.writeValueAsString(req)); String resultStr = RestTemplateTool.post(url, mapper.writeValueAsString(req));
...@@ -45,7 +46,8 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic ...@@ -45,7 +46,8 @@ public class PushStrategyControlServiceImpl implements PushStrategyControlServic
@Override @Override
public Result switchPush(StrategyControlSwitchReq req) throws Exception { public Result switchPush(StrategyControlSwitchReq req) throws Exception {
String switchUrl = "http://37.12.182.50:8082/api/traffic/strategy/control"; //String switchUrl = "http://37.12.182.50:8082/api/traffic/strategy/control";
//String switchUrl = "http://37.12.182.50:8182/api/traffic/strategy/control";
try { try {
ObjectMapper mapper = JacksonUtils.getInstance(); ObjectMapper mapper = JacksonUtils.getInstance();
String resultStr = RestTemplateTool.post(switchUrl, mapper.writeValueAsString(req)); String resultStr = RestTemplateTool.post(switchUrl, mapper.writeValueAsString(req));
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.common.framework.Constants; import net.wanji.common.framework.Constants;
...@@ -246,6 +247,9 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -246,6 +247,9 @@ public class StrategyControlServiceImpl implements StrategyControlService {
histVO.setId(crossId); histVO.setId(crossId);
histVO.setName(resultEntity.getCrossName()); histVO.setName(resultEntity.getCrossName());
String coordinateByCrossId = BaseCrossInfoCache.getCoordinateByCrossId(crossId); String coordinateByCrossId = BaseCrossInfoCache.getCoordinateByCrossId(crossId);
if (StringUtils.isBlank(coordinateByCrossId)) {
continue;
}
histVO.setWkt(coordinateByCrossId.replace("POINT(", "").replace(" ", ",").replace(")", "")); histVO.setWkt(coordinateByCrossId.replace("POINT(", "").replace(" ", ",").replace(")", ""));
histVO.setStrategy(resultEntity.getCurrentAlgo()); histVO.setStrategy(resultEntity.getCurrentAlgo());
histVO.setStrategyName(StrategyCrossAlgoEnum.getDescByCode(resultEntity.getCurrentAlgo())); histVO.setStrategyName(StrategyCrossAlgoEnum.getDescByCode(resultEntity.getCurrentAlgo()));
...@@ -526,33 +530,37 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -526,33 +530,37 @@ public class StrategyControlServiceImpl implements StrategyControlService {
private List<StrategyControlDataExt> getCrossList(Date date) { private List<StrategyControlDataExt> getCrossList(Date date) {
List<StrategyControlDataExt> results = new ArrayList<>(); List<StrategyControlDataExt> results = new ArrayList<>();
List<HoloEventInfoPO> holoEventInfoPOS = holoEventMapper.selectAIList(date); List<StrategyCrossResultEntity> resultList = strategyCrossResultMapper.selectAICrossList(null);
if (!CollectionUtils.isEmpty(holoEventInfoPOS)) { if (!CollectionUtils.isEmpty(resultList)) {
for (HoloEventInfoPO holoEventInfoPO : holoEventInfoPOS) { for (StrategyCrossResultEntity entity : resultList) {
StrategyControlDataExt ext = new StrategyControlDataExt(); StrategyControlDataExt ext = new StrategyControlDataExt();
ext.setBizId(holoEventInfoPO.getCrossId()); ext.setBizId(entity.getCrossId());
ext.setCrossName(holoEventInfoPO.getRemark()); ext.setCrossName(entity.getCrossName());
String location = holoEventInfoPO.getExtend(); String location = entity.getResponseContent();
location = location.replace("POINT(", "").replace(" ", ",").replace(")", ""); location = location.replace("POINT(", "").replace(" ", ",").replace(")", "");
ext.setWkt(location); ext.setWkt(location);
String eventType = holoEventInfoPO.getType(); Integer currentAlgo = entity.getCurrentAlgo();
Integer alarmStatus = holoEventInfoPO.getAlarmStatus(); Date issueTime = entity.getIssueTime();
String optMethod = "效率提升"; Date current = new Date();
ext.setStatus(alarmStatus);
ext.setOptMethod(optMethod); // 优化时间大于5分钟,默认优化完
if (StringUtils.equals(eventType, "702")) { if (Objects.nonNull(issueTime) && current.getTime() - issueTime.getTime() > 5 * 60 * 1000) {
ext.setOptMethod("均衡调控"); currentAlgo = null;
} }
if (StringUtils.isBlank(eventType)) {
if (Objects.isNull(currentAlgo)) {
ext.setOptStatus("正常");
ext.setOptMethod("畅通"); ext.setOptMethod("畅通");
ext.setStatus(-1); } else if (Objects.equals(1, currentAlgo)) {
ext.setOptStatus("优化中");
ext.setOptMethod("均衡调控");
} else {
ext.setOptStatus("优化中");
ext.setOptMethod("效率提升");
} }
String desc = EventStatusEnum.getDesc(alarmStatus);
ext.setOptStatus(desc);
results.add(ext); results.add(ext);
} }
} }
results.sort(Comparator.comparing(StrategyControlDataExt::getStatus).reversed());
return results; return results;
} }
...@@ -717,9 +725,41 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -717,9 +725,41 @@ public class StrategyControlServiceImpl implements StrategyControlService {
strategyDailyPlanInfoMapper.insert(dailyPlanInfoEntity); strategyDailyPlanInfoMapper.insert(dailyPlanInfoEntity);
} }
} }
return JsonViewObject.newInstance().success(); StrategyControlVO strategyControlVO = convertDataList(list);
StrategyControlReq req = convertReq(strategyControlVO);
List<StrategyControlDataReq> data = req.getData();
for (StrategyControlDataReq datum : data) {
StrategyControlDataEntity strategyControlDataEntity = new StrategyControlDataEntity();
strategyControlDataEntity.setBizId(datum.getBiz_id());
strategyControlDataEntity.setBizType(datum.getBiz_type());
strategyControlDataEntity.setStrategy(datum.getStrategy());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
strategyControlDataEntity.setScheduleStart(simpleDateFormat.parse(datum.getSchedule_start()));
strategyControlDataEntity.setScheduleStart(simpleDateFormat.parse(datum.getSchedule_start()));
ObjectMapper instance = JacksonUtils.getInstance();
strategyControlDataEntity.setTime(instance.writeValueAsString(datum.getTime_table()));
strategyControlDataEntity.setFrequency(datum.getStrategy());
strategyControlDataEntity.setStatus(datum.getStatus());
strategyControlInfoMapper.insert(strategyControlDataEntity);
}
// 优化策略下发逻辑,保存是推送神思策略,下发时下发开关
log.error("下发神思策略信息详情: {}", JacksonUtils.getInstance().writeValueAsString(req));
Result result = pushStrategyControlService.push(req);
if (Objects.nonNull(result)) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
jsonViewObject.setCode(Integer.valueOf(result.getCode()));
jsonViewObject.setMessage(result.getMsg());
jsonViewObject.setContent(result.getData());
jsonViewObject.setStatus(StringUtils.equals("200", result.getCode()) ? Constants.JsonView.STATUS_SUCCESS : Constants.JsonView.STATUS_FAIL);
return jsonViewObject;
} else {
log.error("推送神思策略控制失败");
return JsonViewObject.newInstance().fail("推送神思策略控制失败!");
}
} catch (Exception e) { } catch (Exception e) {
log.error("策略管理数据保存失败,:{}", e); log.error("策略管理数据保存, 推送神思远程服务失败:{}", e);
throw new Exception(e); throw new Exception(e);
} }
} }
...@@ -736,7 +776,7 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -736,7 +776,7 @@ public class StrategyControlServiceImpl implements StrategyControlService {
planInfoEntity.setCrossId(executePlan.getCrossId()); planInfoEntity.setCrossId(executePlan.getCrossId());
planInfoEntity.setPlanId(executePlan.getPlanId()); planInfoEntity.setPlanId(executePlan.getPlanId());
planInfoEntity.setType(executePlan.getType()); planInfoEntity.setType(executePlan.getType());
planInfoEntity.setCompany("A厂商"); planInfoEntity.setCompany(executePlan.getCompany());
planInfoEntity.setStatus(executePlan.getStatus()); planInfoEntity.setStatus(executePlan.getStatus());
planInfoEntity.setStartTime(executePlan.getStartTime()); planInfoEntity.setStartTime(executePlan.getStartTime());
planInfoEntity.setEndTime(executePlan.getEndTime()); planInfoEntity.setEndTime(executePlan.getEndTime());
...@@ -760,20 +800,50 @@ public class StrategyControlServiceImpl implements StrategyControlService { ...@@ -760,20 +800,50 @@ public class StrategyControlServiceImpl implements StrategyControlService {
strategyControlDataEntity.setStatus(datum.getStatus()); strategyControlDataEntity.setStatus(datum.getStatus());
strategyControlInfoMapper.insert(strategyControlDataEntity); strategyControlInfoMapper.insert(strategyControlDataEntity);
} }
StrategyControlSwitchReq switchReq = getSwitchReq(req);
log.error("下发神思策略信息详情: {}", JacksonUtils.getInstance().writeValueAsString(req)); Result witchPustResult = pushStrategyControlService.switchPush(switchReq);
Result result = pushStrategyControlService.push(req); if (Objects.nonNull(witchPustResult)) {
//Result result = new Result("200", "成功", null);
if (Objects.nonNull(result)) {
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
jsonViewObject.setCode(Integer.valueOf(result.getCode())); jsonViewObject.setCode(Integer.valueOf(witchPustResult.getCode()));
jsonViewObject.setMessage(result.getMsg()); jsonViewObject.setMessage(witchPustResult.getMsg());
jsonViewObject.setContent(result.getData()); jsonViewObject.setStatus(StringUtils.equals("200", witchPustResult.getCode()) ? Constants.JsonView.STATUS_SUCCESS : Constants.JsonView.STATUS_FAIL);
jsonViewObject.setStatus(StringUtils.equals("200", result.getCode()) ? Constants.JsonView.STATUS_SUCCESS : Constants.JsonView.STATUS_FAIL);
StringBuilder sb = new StringBuilder();
List<LinkedHashMap<String, Object>> contentList = (List<LinkedHashMap<String, Object>>) witchPustResult.getData();
for (LinkedHashMap<String, Object> item : contentList) {
Object result = item.get("result");
if (Objects.equals(1, result)) {
sb.append(item.get("biz_id")).append(item.get("strategy")).append("策略控制成功");
jsonViewObject.setContent(sb);
} else {
sb.append(item.get("biz_id")).append(item.get("strategy")).append("策略控制失败");
jsonViewObject.setContent(sb);
}
}
return jsonViewObject; return jsonViewObject;
} else { } else {
return JsonViewObject.newInstance().fail("推送神思策略控制失败!"); log.error("推送神思策略控制开关失败");
return JsonViewObject.newInstance().fail("推送神思策略控制开关失败!");
}
}
private StrategyControlSwitchReq getSwitchReq(StrategyControlReq req) {
StrategyControlSwitchReq switchReq = new StrategyControlSwitchReq();
List<StrategyControlDataReq> data = req.getData();
if (!CollectionUtils.isEmpty(data)) {
List<StrategyControlSwitchReq.Detail> details = new ArrayList<>();
for (StrategyControlDataReq datum : data) {
StrategyControlSwitchReq.Detail detail = new StrategyControlSwitchReq.Detail();
detail.setBiz_id(datum.getBiz_id());
detail.setBiz_type(datum.getBiz_type());
detail.setStrategy(datum.getStrategy());
detail.setStatus(0);
details.add(detail);
}
switchReq.setData(details);
} }
return switchReq;
} }
/** /**
......
...@@ -7,21 +7,27 @@ ...@@ -7,21 +7,27 @@
<select id="selectAICrossList" resultType="net.wanji.opt.synthesis.pojo.StrategyCrossResultEntity"> <select id="selectAICrossList" resultType="net.wanji.opt.synthesis.pojo.StrategyCrossResultEntity">
select t1.id as cross_id, t1.name as cross_name, t2.current_algo, t2.issue_time select t1.id as crossId, t1.name as crossName, t2.issue_time, t2.current_algo, t2.response_code, t1.location as responseContent from
from t_base_cross_info t1 left join (select id, name, location from t_base_cross_info where is_signal = 1) t1
( left join (select cross_id, max(issue_time) issue_time, current_algo, response_code from t_strategy_cross_result group by cross_id) t2
select cross_id, cross_name, max(issue_time) issue_time, current_algo on t1.id = t2.cross_id
from t_strategy_cross_result and t2.issue_time > DATE_FORMAT(now(),'%Y-%m-%d 00:00:00')
where issue_time > #{date} and response_code = 200 order by t2.issue_time desc
union <!-- select t1.id as cross_id, t1.name as cross_name, t2.current_algo, t2.issue_time-->
select cross_id, cross_name, max(issue_time) issue_time, current_algo <!-- from t_base_cross_info t1 left join-->
from t_strategy_cross_result <!-- (-->
where issue_time > #{date} and response_code &lt; 0 <!-- select cross_id, cross_name, max(issue_time) issue_time, current_algo-->
group by cross_id <!-- from t_strategy_cross_result-->
order by issue_time <!-- where issue_time > #{date} and response_code = 200-->
) t2 on t1.id = t2.cross_id <!-- union-->
where t1.is_signal = 1 <!-- select cross_id, cross_name, max(issue_time) issue_time, current_algo-->
order by t2.issue_time desc; <!-- from t_strategy_cross_result-->
<!-- where issue_time > #{date} and response_code &lt; 0-->
<!-- group by cross_id-->
<!-- order by issue_time-->
<!-- ) t2 on t1.id = t2.cross_id-->
<!-- where t1.is_signal = 1-->
<!-- order by t2.issue_time desc;-->
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -24,7 +24,6 @@ import net.wanji.utc.hisense.pojo.dto.CrossSchemePhaseCountDownDTO; ...@@ -24,7 +24,6 @@ import net.wanji.utc.hisense.pojo.dto.CrossSchemePhaseCountDownDTO;
import net.wanji.utc.hisense.pojo.dto.PhaseCountDownDTO; import net.wanji.utc.hisense.pojo.dto.PhaseCountDownDTO;
import net.wanji.utc.hisense.service.SignalStatusService; import net.wanji.utc.hisense.service.SignalStatusService;
import net.wanji.utc.hisense.util.OkHttpClientUtil; import net.wanji.utc.hisense.util.OkHttpClientUtil;
import net.wanji.utc.hisense.util.OkHttpClientUtil;
import org.dom4j.Document; import org.dom4j.Document;
import org.dom4j.DocumentException; import org.dom4j.DocumentException;
import org.dom4j.DocumentHelper; import org.dom4j.DocumentHelper;
...@@ -54,6 +53,8 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -54,6 +53,8 @@ public class SignalStatusServiceImpl implements SignalStatusService {
private String shensiUrl; private String shensiUrl;
@Value("${hisenseLightsStatus.baiduUrl}") @Value("${hisenseLightsStatus.baiduUrl}")
private String baiduUrl; private String baiduUrl;
@Value("${hisenseLightsStatus.yiGouUrl}")
private String yiGouUrl;
@Override @Override
public List<SignalStatusLogPO> runningStatusAlarm(String crossId) throws DocumentException { public List<SignalStatusLogPO> runningStatusAlarm(String crossId) throws DocumentException {
...@@ -193,7 +194,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -193,7 +194,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
public void receiveLightStatus(List<HisenseLightStatusPojo> hisenseLightStatusPojos) throws Exception { public void receiveLightStatus(List<HisenseLightStatusPojo> hisenseLightStatusPojos) throws Exception {
ObjectMapper jackson = JacksonUtils.getInstance(); ObjectMapper jackson = JacksonUtils.getInstance();
pushOtherCompany(hisenseLightStatusPojos, jackson, shensiUrl, baiduUrl); pushOtherCompany(hisenseLightStatusPojos, jackson, shensiUrl, baiduUrl, yiGouUrl);
if (!CollectionUtils.isEmpty(hisenseLightStatusPojos)) { if (!CollectionUtils.isEmpty(hisenseLightStatusPojos)) {
for (HisenseLightStatusPojo hisenseLightStatusPojo : hisenseLightStatusPojos) { for (HisenseLightStatusPojo hisenseLightStatusPojo : hisenseLightStatusPojos) {
...@@ -209,6 +210,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -209,6 +210,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
if (Objects.isNull(crossInfo)) { if (Objects.isNull(crossInfo)) {
continue; continue;
} }
StaticInfoServiceImpl.planMap.put(crossInfo.getId(), content.getPlanId());
String crossId = crossInfo.getId(); String crossId = crossInfo.getId();
Long lastSignalMachineStamp = SignalDataCache.runningStatusStampMap.get(crossId); Long lastSignalMachineStamp = SignalDataCache.runningStatusStampMap.get(crossId);
if (Objects.isNull(lastSignalMachineStamp)) { if (Objects.isNull(lastSignalMachineStamp)) {
...@@ -260,7 +262,7 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -260,7 +262,7 @@ public class SignalStatusServiceImpl implements SignalStatusService {
} }
private static void pushOtherCompany(List<HisenseLightStatusPojo> hisenseLightStatusPojos, ObjectMapper jackson, private static void pushOtherCompany(List<HisenseLightStatusPojo> hisenseLightStatusPojos, ObjectMapper jackson,
String shensiUrl, String baiduUrl) { String shensiUrl, String baiduUrl, String yiGouUrl) {
try { try {
OkHttpClientUtil.jsonPost(shensiUrl, jackson.writeValueAsString(hisenseLightStatusPojos)); OkHttpClientUtil.jsonPost(shensiUrl, jackson.writeValueAsString(hisenseLightStatusPojos));
} catch (Exception e) { } catch (Exception e) {
...@@ -271,6 +273,11 @@ public class SignalStatusServiceImpl implements SignalStatusService { ...@@ -271,6 +273,11 @@ public class SignalStatusServiceImpl implements SignalStatusService {
} catch (Exception e) { } catch (Exception e) {
log.error("海信灯态推送百度失败:{}", e.getMessage()); log.error("海信灯态推送百度失败:{}", e.getMessage());
} }
try {
OkHttpClientUtil.jsonPost(yiGouUrl, jackson.writeValueAsString(hisenseLightStatusPojos));
} catch (Exception e) {
log.error("海信灯态推送易购失败:{}", e.getMessage());
}
} }
/** /**
......
...@@ -79,6 +79,7 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -79,6 +79,7 @@ public class StaticInfoServiceImpl implements StaticInfoService {
private CrossSchemeStageOptLogMapper crossSchemeStageOptLogMapper; private CrossSchemeStageOptLogMapper crossSchemeStageOptLogMapper;
@Resource @Resource
private BaseCrossSchemeMapper baseCrossSchemeMapper; private BaseCrossSchemeMapper baseCrossSchemeMapper;
public static Map<String, Integer> planMap = new HashMap<>();
@Override @Override
public List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO) throws Exception { public List<CrossInfoPO> crossBasicInfo(CrossInfoDTO crossInfoDTO) throws Exception {
...@@ -697,10 +698,10 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -697,10 +698,10 @@ public class StaticInfoServiceImpl implements StaticInfoService {
crossSchedulesPOMonthDays.setCrossId(crossId); crossSchedulesPOMonthDays.setCrossId(crossId);
crossSchedulesPOMonthDays.setScheduleNo(vNtcipTimeBaseScheduleView.getNTimeBaseScheduleNumber()); crossSchedulesPOMonthDays.setScheduleNo(vNtcipTimeBaseScheduleView.getNTimeBaseScheduleNumber());
crossSchedulesPOMonthDays.setName("调度" + vNtcipTimeBaseScheduleView.getNTimeBaseScheduleNumber()); crossSchedulesPOMonthDays.setName("调度" + vNtcipTimeBaseScheduleView.getNTimeBaseScheduleNumber());
crossSchedulesPOMonthDays.setWeek(null); crossSchedulesPOMonthDays.setWeek(0);
crossSchedulesPOMonthDays.setMonths(monthsStr); crossSchedulesPOMonthDays.setMonths(monthsStr);
crossSchedulesPOMonthDays.setDays(daysStr); crossSchedulesPOMonthDays.setDays(daysStr);
crossSchedulesPOMonthDays.setPlanId(0); crossSchedulesPOMonthDays.setPlanId(hisensePlanId);
results.add(crossSchedulesPOMonthDays); results.add(crossSchedulesPOMonthDays);
} }
} }
...@@ -804,6 +805,8 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -804,6 +805,8 @@ public class StaticInfoServiceImpl implements StaticInfoService {
Element messageContent = (Element) document.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT); Element messageContent = (Element) document.selectSingleNode(HttpConstants.SYSTEMSCRIPTION_MESSAGECONTENT);
messageContent.addElement(HttpConstants.SPOT).setText(crossInfoPOExt.getCode()); messageContent.addElement(HttpConstants.SPOT).setText(crossInfoPOExt.getCode());
//获取当前运行的方案号 //获取当前运行的方案号
Integer integer = planMap.get(crossSchemeRingsDTO.getCrossId());
/*if (ObjectUtil.isEmpty(integer)){
CoordinationStatus coordinationStatus = crossPlan(crossSchemeRingsDTO.getCrossId()); CoordinationStatus coordinationStatus = crossPlan(crossSchemeRingsDTO.getCrossId());
if (ObjectUtil.isEmpty(coordinationStatus)) { if (ObjectUtil.isEmpty(coordinationStatus)) {
//获取方案号失败 //获取方案号失败
...@@ -816,7 +819,21 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -816,7 +819,21 @@ public class StaticInfoServiceImpl implements StaticInfoService {
crossSchemeRings.setPattern(coordinationStatus.getCoordPatternStatus()); crossSchemeRings.setPattern(coordinationStatus.getCoordPatternStatus());
return crossSchemeRings; return crossSchemeRings;
} }
messageContent.addElement(HttpConstants.PATTERN).setText(coordinationStatus.getCoordPatternStatus()); integer = Integer.valueOf(coordinationStatus.getCoordPatternStatus());
}*/
if (ObjectUtil.isEmpty(integer)){
//获取方案号失败
log.error("请求方案环图前,获取当前运行方案号失败,没有该路口的灯态信息,crossId:{}", crossSchemeRingsDTO.getCrossId());
return null;
} else if (255 == integer) {
//黃闪
CrossSchemeRings crossSchemeRings = new CrossSchemeRings();
crossSchemeRings.setSpot(crossSchemeRingsDTO.getCrossId());
crossSchemeRings.setPattern(String.valueOf(integer));
return crossSchemeRings;
}
messageContent.addElement(HttpConstants.PATTERN).setText(String.valueOf(integer));
//给海信发送http请求 //给海信发送http请求
String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML()); String post = OkHttpClientUtil.xmlPost(hisenseUrl, document.asXML());
......
...@@ -224,7 +224,7 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe ...@@ -224,7 +224,7 @@ public class WanJiCommonStaticInfoServiceImpl implements WanJiCommonStaticInfoSe
if (code != 200){ if (code != 200){
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(crossSchemeRingsDTO)); JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(crossSchemeRingsDTO));
//插入命令操作日志 //插入命令操作日志
controlCommandStrategyService.insertCommandLog(now,jsonViewObject, jsonObject,10); // controlCommandStrategyService.insertCommandLog(now,jsonViewObject, jsonObject,10);
} }
} else { } else {
CrossSchemeRings crossSchemeRings = getCrossSchemeRings(crossSchemeRingsDTO); CrossSchemeRings crossSchemeRings = getCrossSchemeRings(crossSchemeRingsDTO);
......
package net.wanji.utc.util; package net.wanji.utc.util;
import cn.hutool.core.util.ObjectUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import net.wanji.databus.dao.entity.BaseCrossSchemePO;
import java.lang.reflect.Field;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList; import java.util.*;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.*;
@Slf4j @Slf4j
public class StringUtils extends org.apache.commons.lang3.StringUtils { public class StringUtils extends org.apache.commons.lang3.StringUtils {
public static void main(String[] args) {
// GreenwaveScenePO areaIndex = new GreenwaveScenePO();
// System.out.println(areaIndex.toString().replaceAll("=null",""));
// 替换为你的类
Class<BaseCrossSchemePO> clazz = BaseCrossSchemePO.class;
List<String> list = new ArrayList<>();
// 遍历所有字段
for (Field field : clazz.getDeclaredFields()) {
// 获取 @ApiModelProperty 注解
ApiModelProperty apiModelProperty = field.getAnnotation(ApiModelProperty.class);
if (apiModelProperty != null) {
System.out.print(field.getName() +"\t");
System.out.println(ObjectUtil.isNotEmpty(apiModelProperty.value())?apiModelProperty.value():apiModelProperty.name());
// list.add(apiModelProperty.value());
// 你可以继续打印其他属性如 notes, required 等
}
}
}
/** /**
* @description: 判断字符串是否为空 * @description: 判断字符串是否为空
......
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
AND schedules.`week` = #{week} AND schedules.`week` = #{week}
AND DATE_FORMAT( NOW(), '%H:%i' ) BETWEEN DATE_FORMAT( CAST( section.start_time AS TIME ), '%H:%i' ) AND DATE_FORMAT( NOW(), '%H:%i' ) BETWEEN DATE_FORMAT( CAST( section.start_time AS TIME ), '%H:%i' )
AND DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' ) AND DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' )
ORDER BY DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' ) DESC LIMIT 1 ORDER BY schedules.special_date, DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' ) DESC LIMIT 1
</select> </select>
<select id="selectSchemeByParams" resultType="net.wanji.databus.dao.entity.BaseCrossSchemePO"> <select id="selectSchemeByParams" resultType="net.wanji.databus.dao.entity.BaseCrossSchemePO">
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
AND schedules.`week` = #{week} AND schedules.`week` = #{week}
AND DATE_FORMAT( #{queryTime}, '%H:%i' ) BETWEEN DATE_FORMAT( CAST( section.start_time AS TIME ), '%H:%i' ) AND DATE_FORMAT( #{queryTime}, '%H:%i' ) BETWEEN DATE_FORMAT( CAST( section.start_time AS TIME ), '%H:%i' )
AND DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' ) AND DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' )
ORDER BY DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' ) DESC LIMIT 1 ORDER BY schedules.special_date, DATE_FORMAT( CAST( section.end_time AS TIME ), '%H:%i' ) DESC LIMIT 1
</select> </select>
......
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