Browse Source

修改事件导出Excel格式

develop
王兴琳 9 months ago
parent
commit
ce187f458f
  1. 4
      zc-business/pom.xml
  2. 14
      zc-business/src/main/java/com/zc/business/domain/DcEvent.java
  3. 14
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  4. 3
      zc-business/src/main/resources/mapper/business/DcEventMapper.xml

4
zc-business/pom.xml

@ -39,6 +39,10 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-system</artifactId>
</dependency>
</dependencies>
<groupId>com.zc</groupId>
<version>1.0.0</version>

14
zc-business/src/main/java/com/zc/business/domain/DcEvent.java

@ -40,8 +40,10 @@ public class DcEvent extends BaseEntity {
* 所属部门
*/
@ApiModelProperty("所属部门")
@Excel(name = "所属部门")
private Long deptId;
@Excel(name = "所属部门")
private String deptName;
/**
* 所在桩号
*/
@ -59,7 +61,8 @@ public class DcEvent extends BaseEntity {
* 2-
* 3-
*/
@Excel(name = "方向")
@Excel(name = "方向", readConverterExp = "1=上行,3=下行")
//@Excel(name = "方向")
@ApiModelProperty("方向")
private String direction;
/**
@ -196,10 +199,10 @@ public class DcEvent extends BaseEntity {
/**
* 是否处在隧道
*/
@Excel(name = "是否处在隧道")
@Excel(name = "是否处在隧道" , readConverterExp = "0=否,1=是")
@ApiModelProperty("是否处在隧道 0 表示 false,1 表示 true")
private Integer inTunnel;
@Excel(name = "高速")
//@Excel(name = "高速")
@ApiModelProperty("高速公路")
private Long roadId;
@ -210,9 +213,10 @@ public class DcEvent extends BaseEntity {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty("发生时间")
private Date occurrenceTime;
@Excel(name = "是否是感知事件")
@Excel(name = "是否是感知事件" , readConverterExp = "0=否,1=是")
@ApiModelProperty("是否是感知事件 0 表示 false,1 表示 true")
private Integer isPerceived;
@Excel(name = "影响车道")
@ApiModelProperty("影响车道 车道占用:0-应急1-行1,2-行2,3-行3,4-行4")
private String lang;

14
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -8,6 +8,7 @@ import java.util.Map;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.service.ISysDeptService;
import com.zc.business.domain.*;
import com.zc.business.mapper.*;
import com.zc.business.service.IDcEventService;
@ -54,6 +55,9 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
private DcProcessConfigMapper dcProcessConfigMapper;
@Autowired
private DcWarningMapper dcWarningMapper;
//部门信息
@Autowired
private ISysDeptService deptService;
@ -89,6 +93,16 @@ private DcEventAbnormalWeatherMapper dcEventAbnormalWeatherMapper;
String replace1 = dcEvent.getEndStakeMark().replace(" ", "+");
dcEvent.setEndStakeMark(replace1);
}
List<DcEvent> dcEventList = dcEventMapper.selectDcEventList(dcEvent);
for (DcEvent dcEvents : dcEventList) {
// 根据 deptId 获取部门名称
Long deptId = dcEvents.getDeptId();
String deptName = deptService.selectDeptById(deptId).getDeptName();
// 将部门名称赋值给 deptName 字段
dcEvents.setDeptName(deptName);
}
return dcEventMapper.selectDcEventList(dcEvent);
}

3
zc-business/src/main/resources/mapper/business/DcEventMapper.xml

@ -246,7 +246,8 @@
event_source_tips,
occurrence_time,
in_tunnel,
road_id
road_id,
lang
FROM
dc_event
LEFT JOIN sys_user on dc_event.user_id = sys_user.user_id

Loading…
Cancel
Save