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));
......
...@@ -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,19 +805,35 @@ public class StaticInfoServiceImpl implements StaticInfoService { ...@@ -804,19 +805,35 @@ 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());
//获取当前运行的方案号 //获取当前运行的方案号
CoordinationStatus coordinationStatus = crossPlan(crossSchemeRingsDTO.getCrossId()); Integer integer = planMap.get(crossSchemeRingsDTO.getCrossId());
if (ObjectUtil.isEmpty(coordinationStatus)) { /*if (ObjectUtil.isEmpty(integer)){
//获取方案号失败 CoordinationStatus coordinationStatus = crossPlan(crossSchemeRingsDTO.getCrossId());
log.error("请求方案环图前,获取当前运行方案号失败,crossId:{}", crossSchemeRingsDTO.getCrossId()); if (ObjectUtil.isEmpty(coordinationStatus)) {
return null; //获取方案号失败
} else if ("255".equals(coordinationStatus.getCoordPatternStatus())) { log.error("请求方案环图前,获取当前运行方案号失败,crossId:{}", crossSchemeRingsDTO.getCrossId());
return null;
} else if ("255".equals(coordinationStatus.getCoordPatternStatus())) {
//黃闪
CrossSchemeRings crossSchemeRings = new CrossSchemeRings();
crossSchemeRings.setSpot(crossSchemeRingsDTO.getCrossId());
crossSchemeRings.setPattern(coordinationStatus.getCoordPatternStatus());
return crossSchemeRings;
}
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 crossSchemeRings = new CrossSchemeRings();
crossSchemeRings.setSpot(crossSchemeRingsDTO.getCrossId()); crossSchemeRings.setSpot(crossSchemeRingsDTO.getCrossId());
crossSchemeRings.setPattern(coordinationStatus.getCoordPatternStatus()); crossSchemeRings.setPattern(String.valueOf(integer));
return crossSchemeRings; return crossSchemeRings;
} }
messageContent.addElement(HttpConstants.PATTERN).setText(coordinationStatus.getCoordPatternStatus());
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