diff --git a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java index 00c60779..4f7ceb6d 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcEventController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcEventController.java @@ -72,7 +72,7 @@ public class DcEventController extends BaseController //@PreAuthorize("@ss.hasPermi('system:event:export')") @Log(title = "事件信息", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, DcEvent dcEvent) + public void export(HttpServletResponse response,@RequestBody DcEvent dcEvent) { List list = dcEventService.selectDcEventList(dcEvent); ExcelUtil util = new ExcelUtil(DcEvent.class); diff --git a/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java b/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java new file mode 100644 index 00000000..66713b66 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java @@ -0,0 +1,106 @@ +package com.zc.business.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zc.business.domain.DcRoadConditionInformation; +import com.zc.business.service.IDcRoadConditionInformationService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; + +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 路况信息Controller + * + * @author ruoyi + * @date 2024-07-02 + */ +@RestController +@RequestMapping("/system/information") +public class DcRoadConditionInformationController extends BaseController +{ + @Autowired + private IDcRoadConditionInformationService dcRoadConditionInformationService; + + /** + * 查询路况信息列表 + */ + //@PreAuthorize("@ss.hasPermi('system:information:list')") + @GetMapping("/list") + public TableDataInfo list(DcRoadConditionInformation dcRoadConditionInformation) + { + startPage(); + List list = dcRoadConditionInformationService.selectDcRoadConditionInformationList(dcRoadConditionInformation); + return getDataTable(list); + } + + /** + * 导出路况信息列表 + */ + //@PreAuthorize("@ss.hasPermi('system:information:export')") + @Log(title = "路况信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, DcRoadConditionInformation dcRoadConditionInformation) + { + List list = dcRoadConditionInformationService.selectDcRoadConditionInformationList(dcRoadConditionInformation); + ExcelUtil util = new ExcelUtil<>(DcRoadConditionInformation.class); + util.exportExcel(response, list, "路况信息数据"); + } + + /** + * 获取路况信息详细信息 + */ + //@PreAuthorize("@ss.hasPermi('system:information:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return AjaxResult.success(dcRoadConditionInformationService.selectDcRoadConditionInformationById(id)); + } + + /** + * 新增路况信息 + */ + // @PreAuthorize("@ss.hasPermi('system:information:add')") + @Log(title = "路况信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody DcRoadConditionInformation dcRoadConditionInformation) + { + return toAjax(dcRoadConditionInformationService.insertDcRoadConditionInformation(dcRoadConditionInformation)); + } + + /** + * 修改路况信息 + */ + // @PreAuthorize("@ss.hasPermi('system:information:edit')") + @Log(title = "路况信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody DcRoadConditionInformation dcRoadConditionInformation) + { + return toAjax(dcRoadConditionInformationService.updateDcRoadConditionInformation(dcRoadConditionInformation)); + } + + /** + * 删除路况信息 + */ + //@PreAuthorize("@ss.hasPermi('system:information:remove')") + @Log(title = "路况信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(dcRoadConditionInformationService.deleteDcRoadConditionInformationByIds(ids)); + } +} diff --git a/zc-business/src/main/java/com/zc/business/controller/DcTrafficFlowWarning.java b/zc-business/src/main/java/com/zc/business/controller/DcTrafficFlowWarning.java index b15cc53a..4442aab5 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcTrafficFlowWarning.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcTrafficFlowWarning.java @@ -35,7 +35,7 @@ public class DcTrafficFlowWarning { @Autowired private IDcTollStationStatisticsDataService iDcTollStationStatisticsDataService; - //@Scheduled(cron = "0/10 * * * * ?") + // @Scheduled(cron = "0/10 * * * * ?") @Scheduled(cron = "0 0 9 * * ?") public void DcTrafficFlow() throws ParseException { // 获取当前日期 diff --git a/zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java b/zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java index 1de21bf8..59ea6b56 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcTrafficStatisticsController.java @@ -46,7 +46,7 @@ import java.util.stream.Collectors; * * @author xiepufeng */ -//@Component +@Component @Api(tags = "交通数据统计") @RestController @RequestMapping("/business/traffic-statistics") @@ -745,6 +745,7 @@ public AjaxResult realTimeTrafficFlow(String startDate, String direction,String // 将获取到的交通指标数据封装为成功的结果并返回 return AjaxResult.success(jsonArray); } + @Scheduled(cron = "0 */1 * * * ?") // @Scheduled(cron = "0/30 * * * * ?") @ApiOperation("获取当前拥堵路段") @GetMapping("/current/getTheCurrentCongestedSection") diff --git a/zc-business/src/main/java/com/zc/business/domain/DcRoadConditionInformation.java b/zc-business/src/main/java/com/zc/business/domain/DcRoadConditionInformation.java new file mode 100644 index 00000000..092d008f --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/domain/DcRoadConditionInformation.java @@ -0,0 +1,55 @@ +package com.zc.business.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 路况信息对象 dc_road_condition_information + * + * @author ruoyi + * @date 2024-07-02 + */ +public class DcRoadConditionInformation extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Long id; + + /** 其他配置 */ + @Excel(name = "其他配置") + private String otherConfig; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setOtherConfig(String otherConfig) + { + this.otherConfig = otherConfig; + } + + public String getOtherConfig() + { + return otherConfig; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("otherConfig", getOtherConfig()) + .toString(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcRoadConditionInformationMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcRoadConditionInformationMapper.java new file mode 100644 index 00000000..190850be --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/mapper/DcRoadConditionInformationMapper.java @@ -0,0 +1,62 @@ +package com.zc.business.mapper; + +import com.zc.business.domain.DcRoadConditionInformation; + +import java.util.List; + +/** + * 路况信息Mapper接口 + * + * @author ruoyi + * @date 2024-07-02 + */ +public interface DcRoadConditionInformationMapper +{ + /** + * 查询路况信息 + * + * @param id 路况信息主键 + * @return 路况信息 + */ + public DcRoadConditionInformation selectDcRoadConditionInformationById(Long id); + + /** + * 查询路况信息列表 + * + * @param dcRoadConditionInformation 路况信息 + * @return 路况信息集合 + */ + List selectDcRoadConditionInformationList(DcRoadConditionInformation dcRoadConditionInformation); + + /** + * 新增路况信息 + * + * @param dcRoadConditionInformation 路况信息 + * @return 结果 + */ + int insertDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation); + + /** + * 修改路况信息 + * + * @param dcRoadConditionInformation 路况信息 + * @return 结果 + */ + int updateDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation); + + /** + * 删除路况信息 + * + * @param id 路况信息主键 + * @return 结果 + */ + int deleteDcRoadConditionInformationById(Long id); + + /** + * 批量删除路况信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + int deleteDcRoadConditionInformationByIds(Long[] ids); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java b/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java new file mode 100644 index 00000000..7deb570e --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java @@ -0,0 +1,62 @@ +package com.zc.business.service; + +import com.zc.business.domain.DcRoadConditionInformation; + +import java.util.List; + +/** + * 路况信息Service接口 + * + * @author ruoyi + * @date 2024-07-02 + */ +public interface IDcRoadConditionInformationService +{ + /** + * 查询路况信息 + * + * @param id 路况信息主键 + * @return 路况信息 + */ + public DcRoadConditionInformation selectDcRoadConditionInformationById(Long id); + + /** + * 查询路况信息列表 + * + * @param dcRoadConditionInformation 路况信息 + * @return 路况信息集合 + */ + List selectDcRoadConditionInformationList(DcRoadConditionInformation dcRoadConditionInformation); + + /** + * 新增路况信息 + * + * @param dcRoadConditionInformation 路况信息 + * @return 结果 + */ + int insertDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation); + + /** + * 修改路况信息 + * + * @param dcRoadConditionInformation 路况信息 + * @return 结果 + */ + int updateDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation); + + /** + * 批量删除路况信息 + * + * @param ids 需要删除的路况信息主键集合 + * @return 结果 + */ + int deleteDcRoadConditionInformationByIds(Long[] ids); + + /** + * 删除路况信息信息 + * + * @param id 路况信息主键 + * @return 结果 + */ + int deleteDcRoadConditionInformationById(Long id); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcRoadConditionInformationServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadConditionInformationServiceImpl.java new file mode 100644 index 00000000..e0e45b06 --- /dev/null +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcRoadConditionInformationServiceImpl.java @@ -0,0 +1,97 @@ +package com.zc.business.service.impl; + +import java.util.List; +import com.ruoyi.common.utils.DateUtils; +import com.zc.business.domain.DcRoadConditionInformation; +import com.zc.business.mapper.DcRoadConditionInformationMapper; +import com.zc.business.service.IDcRoadConditionInformationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * 路况信息Service业务层处理 + * + * @author ruoyi + * @date 2024-07-02 + */ +@Service +public class DcRoadConditionInformationServiceImpl implements IDcRoadConditionInformationService +{ + @Autowired + private DcRoadConditionInformationMapper dcRoadConditionInformationMapper; + + /** + * 查询路况信息 + * + * @param id 路况信息主键 + * @return 路况信息 + */ + @Override + public DcRoadConditionInformation selectDcRoadConditionInformationById(Long id) + { + return dcRoadConditionInformationMapper.selectDcRoadConditionInformationById(id); + } + + /** + * 查询路况信息列表 + * + * @param dcRoadConditionInformation 路况信息 + * @return 路况信息 + */ + @Override + public List selectDcRoadConditionInformationList(DcRoadConditionInformation dcRoadConditionInformation) + { + return dcRoadConditionInformationMapper.selectDcRoadConditionInformationList(dcRoadConditionInformation); + } + + /** + * 新增路况信息 + * + * @param dcRoadConditionInformation 路况信息 + * @return 结果 + */ + @Override + public int insertDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation) + { + dcRoadConditionInformation.setCreateTime(DateUtils.getNowDate()); + return dcRoadConditionInformationMapper.insertDcRoadConditionInformation(dcRoadConditionInformation); + } + + /** + * 修改路况信息 + * + * @param dcRoadConditionInformation 路况信息 + * @return 结果 + */ + @Override + public int updateDcRoadConditionInformation(DcRoadConditionInformation dcRoadConditionInformation) + { + dcRoadConditionInformation.setUpdateTime(DateUtils.getNowDate()); + return dcRoadConditionInformationMapper.updateDcRoadConditionInformation(dcRoadConditionInformation); + } + + /** + * 批量删除路况信息 + * + * @param ids 需要删除的路况信息主键 + * @return 结果 + */ + @Override + public int deleteDcRoadConditionInformationByIds(Long[] ids) + { + return dcRoadConditionInformationMapper.deleteDcRoadConditionInformationByIds(ids); + } + + /** + * 删除路况信息信息 + * + * @param id 路况信息主键 + * @return 结果 + */ + @Override + public int deleteDcRoadConditionInformationById(Long id) + { + return dcRoadConditionInformationMapper.deleteDcRoadConditionInformationById(id); + } +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficStatisticsServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficStatisticsServiceImpl.java index a8b7a1fe..e3eab352 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficStatisticsServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcTrafficStatisticsServiceImpl.java @@ -5,16 +5,16 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.type.TypeFactory; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.spring.SpringUtils; import com.zc.business.constant.RedisKeyConstants; -import com.zc.business.domain.DcCongestionSection; -import com.zc.business.domain.DcFacility; -import com.zc.business.domain.DcRoadSection; -import com.zc.business.domain.DcRoadSectionCongestion; +import com.zc.business.domain.*; import com.zc.business.enums.StakeMarkRange; import com.zc.business.enums.UniversalEnum; import com.zc.business.service.IDcFacilityService; +import com.zc.business.service.IDcRoadConditionInformationService; import com.zc.business.service.IDcRoadSectionService; import com.zc.business.service.IDcTrafficStatisticsService; import com.zc.business.utils.StakeMarkUtils; @@ -27,6 +27,7 @@ import okhttp3.Response; import okhttp3.ResponseBody; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.PostConstruct; @@ -56,6 +57,8 @@ public class DcTrafficStatisticsServiceImpl implements IDcTrafficStatisticsServi @Resource private IDcFacilityService facilityService; + @Autowired + private IDcRoadConditionInformationService dcRoadConditionInformationService; @Resource private IDcRoadSectionService roadSectionService; @@ -985,6 +988,10 @@ public class DcTrafficStatisticsServiceImpl implements IDcTrafficStatisticsServi } } + //插入 数据库 road_condition_information + DcRoadConditionInformation dcRoadConditionInformation =new DcRoadConditionInformation(); + dcRoadConditionInformation.setOtherConfig(jsonArray.toJSONString()); + dcRoadConditionInformationService.insertDcRoadConditionInformation(dcRoadConditionInformation); return jsonArray; } diff --git a/zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml b/zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml index 22921b1b..b4c8a6e1 100644 --- a/zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcGantryStatisticsDataMapper.xml @@ -226,7 +226,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT 'K099+750', 'K105+904', '平阴北立交' UNION ALL SELECT 'K105+904', 'K117+878', '平阴立交' UNION ALL SELECT 'K117+878', 'K126+233', '孔村枢纽' UNION ALL - SELECT 'K126+233', 'K145+933', '平阴南立交-' UNION ALL + SELECT 'K126+233', 'K145+933', '平阴南立交' UNION ALL SELECT 'K145+933', 'K155+652', '东平立交' UNION ALL SELECT 'K155+652', 'K173+950', '东平湖枢纽' UNION ALL SELECT 'K173+950', 'K179+396', '梁山东立交' UNION ALL diff --git a/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml b/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml new file mode 100644 index 00000000..df07b2a4 --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + select id, create_time, update_time, other_config from dc_road_condition_information + + + + + + + + insert into dc_road_condition_information + + id, + create_time, + update_time, + other_config, + + + #{id}, + #{createTime}, + #{updateTime}, + #{otherConfig}, + + + + + update dc_road_condition_information + + create_time = #{createTime}, + update_time = #{updateTime}, + other_config = #{otherConfig}, + + where id = #{id} + + + + delete from dc_road_condition_information where id = #{id} + + + + delete from dc_road_condition_information where id in + + #{id} + + + \ No newline at end of file