Browse Source

施工建设事件修改

develop
王兴琳 4 months ago
parent
commit
2f9a9e4cdf
  1. 7
      zc-business/src/main/java/com/zc/business/controller/DcRoadConditionInformationController.java
  2. 1
      zc-business/src/main/java/com/zc/business/enums/UniversalEnum.java
  3. 3
      zc-business/src/main/java/com/zc/business/service/IDcRoadConditionInformationService.java
  4. 20
      zc-business/src/main/java/com/zc/business/service/impl/DcRoadConditionInformationServiceImpl.java
  5. 2
      zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml
  6. 13
      zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml

7
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<DcRoadConditionInformation> list = dcRoadConditionInformationService.selectlistTime();
return getDataTable(list);
Map<String,String> list = dcRoadConditionInformationService.selectlistTime();
return AjaxResult.success(list);
}
/**

1
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"),

3
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<DcRoadConditionInformation> selectlistTime();
Map<String,String> selectlistTime();
}

20
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<DcRoadConditionInformation> selectlistTime() {
return dcRoadConditionInformationMapper.selectlistTime();
public Map<String,String> selectlistTime() {
List<DcRoadConditionInformation> dcRoadConditionInformations = dcRoadConditionInformationMapper.selectlistTime();
if (! dcRoadConditionInformations.isEmpty()) {
Map<String,String> 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<>();
}
}

2
zc-business/src/main/resources/mapper/business/DcEventConstructionMapper.xml

@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="localRoadName" column="local_road_name" />
<result property="location" column="location" />
<result property="constructionMethod" column="construction_method" />
<result property="rampId" column="ramp_id" />
<result property="dcFacility.facilityName" column="facility_name" />
<result property="dcFacility.facilityType" column="facility_type" />
@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectDcEventConstructionVoById">
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,

13
zc-business/src/main/resources/mapper/business/DcRoadConditionInformationMapper.xml

@ -24,10 +24,15 @@
</select>
<select id="selectlistTime" parameterType="DcRoadConditionInformation" resultMap="DcRoadConditionInformationResult">
SELECT id, create_time
FROM dc_road_condition_information
WHERE DATE(create_time) = CURDATE()
ORDER BY create_time asc;
SELECT id, create_time, update_time, other_config
FROM (
SELECT id, create_time, update_time, other_config
FROM dc_road_condition_information
WHERE DATE(create_time) = CURDATE()
ORDER BY create_time DESC
LIMIT 10
) AS subquery
ORDER BY create_time ASC;
</select>
<select id="selectDcRoadConditionInformationById" parameterType="Long" resultMap="DcRoadConditionInformationResult">

Loading…
Cancel
Save