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 index ed1df8a1..83dbfdc4 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java @@ -1,6 +1,7 @@ package com.zc.business.controller; import java.util.List; +import java.util.Map; import javax.servlet.http.HttpServletResponse; import com.zc.business.domain.DcRoadConditionInformation; @@ -47,10 +48,10 @@ public class DcRoadConditionInformationController extends BaseController return getDataTable(list); } @GetMapping("/listTime") - public TableDataInfo listTime() + public AjaxResult listTime() { - List list = dcRoadConditionInformationService.selectlistTime(); - return getDataTable(list); + Map list = dcRoadConditionInformationService.selectlistTime(); + return AjaxResult.success(list); } /** diff --git a/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java b/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java index a48e23ca..5c107781 100644 --- a/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java +++ b/zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java @@ -1242,6 +1242,7 @@ public enum UniversalEnum { // 纯汉字时间格式 时分 PURE_CHINESE_CHARACTER_TIME_FORMAT_TIME_DIVISION(0, "HH时mm分"), + PURE_CHINESE_CHARACTER_TIME_FORMAT_TIME(0, "HH:mm"), // 时间格式 TIME_FORMAT_YEARS_MONTH_DAY(0, "yyyy-MM-dd"), 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 index 7fccc8a8..b023fe9a 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java @@ -3,6 +3,7 @@ package com.zc.business.service; import com.zc.business.domain.DcRoadConditionInformation; import java.util.List; +import java.util.Map; /** * 路况信息Service接口 @@ -60,6 +61,6 @@ public interface IDcRoadConditionInformationService */ int deleteDcRoadConditionInformationById(Long id); - List selectlistTime(); + Map selectlistTime(); } 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 index 4d7f9ffd..2b7e9cae 100644 --- 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 @@ -1,8 +1,14 @@ package com.zc.business.service.impl; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.LinkedHashMap; import java.util.List; +import java.util.Map; + import com.ruoyi.common.utils.DateUtils; import com.zc.business.domain.DcRoadConditionInformation; +import com.zc.business.enums.UniversalEnum; import com.zc.business.mapper.DcRoadConditionInformationMapper; import com.zc.business.service.IDcRoadConditionInformationService; import org.springframework.beans.factory.annotation.Autowired; @@ -96,7 +102,17 @@ public class DcRoadConditionInformationServiceImpl implements IDcRoadConditionIn } @Override - public List selectlistTime() { - return dcRoadConditionInformationMapper.selectlistTime(); + public Map selectlistTime() { + List dcRoadConditionInformations = dcRoadConditionInformationMapper.selectlistTime(); + if (! dcRoadConditionInformations.isEmpty()) { + Map map =new LinkedHashMap<>(); + for (DcRoadConditionInformation dcRoadConditionInformation : dcRoadConditionInformationMapper.selectlistTime()) { + SimpleDateFormat sdf = new SimpleDateFormat(UniversalEnum.PURE_CHINESE_CHARACTER_TIME_FORMAT_TIME.getValue()); + String formattedDate = sdf.format(dcRoadConditionInformation.getCreateTime()); + map.put(formattedDate, dcRoadConditionInformation.getOtherConfig()); + } + return map; + } + return new LinkedHashMap<>(); } } diff --git a/zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml b/zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml index 2b9f861c..aedffd2a 100644 --- a/zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml @@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT dc_event_construction.id as id, + dc_event_construction.ramp_id as ramp_id, dc_event_construction.construction_method as construction_method, dc_event_construction.control_mode as control_mode, dc_event_construction.location_type as location_type, diff --git a/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml b/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml index a1f67076..d1800b11 100644 --- a/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml @@ -24,10 +24,15 @@