Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-dc into develop

develop
xiepufeng 10 months ago
parent
commit
8352405b7e
  1. 6
      zc-business/src/main/java/com/zc/business/domain/DcShifts.java
  2. 3
      zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java
  3. 24
      zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java
  4. 4
      zc-business/src/main/java/com/zc/business/service/impl/DcTrafficIncidentsServiceImpl.java
  5. BIN
      zc-business/src/main/resources/excelTemplate/值班示例模板.xlsx
  6. 6
      zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml
  7. 2
      zc-business/src/main/resources/mapper/business/DcShiftsMapper.xml

6
zc-business/src/main/java/com/zc/business/domain/DcShifts.java

@ -67,17 +67,21 @@ public class DcShifts extends BaseEntity
@ApiModelProperty("备注") @ApiModelProperty("备注")
@Excel(name = "备注") @Excel(name = "备注")
private String remark; private String remark;
@ApiModelProperty("所属路管驻点名称") @ApiModelProperty("所属路管驻点名称")
@Excel(name = "所属路管驻点名称") @Excel(name = "所属路管驻点名称")
private String organizationName; private String organizationName;
@ApiModelProperty("排班 1-白班 2-夜班") @ApiModelProperty("排班 1-白班 2-夜班")
@Excel(name = "排班 1-白班 2-夜班") @Excel(name = "班次(白班和夜班)")
private String scheduling; private String scheduling;
@ApiModelProperty("驻点id") @ApiModelProperty("驻点id")
@Excel(name = "驻点id") @Excel(name = "驻点id")
private Long station; private Long station;
private JSONArray employeesJson; private JSONArray employeesJson;
public JSONArray getEmployeesJson() { public JSONArray getEmployeesJson() {

3
zc-business/src/main/java/com/zc/business/mapper/DcPerceivedEventsWarningMapper.java

@ -1,6 +1,5 @@
package com.zc.business.mapper; package com.zc.business.mapper;
import cn.hutool.core.lang.hash.Hash;
import com.zc.business.domain.DcEventType; import com.zc.business.domain.DcEventType;
import com.zc.business.domain.DcWarning; import com.zc.business.domain.DcWarning;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -39,6 +38,8 @@ public interface DcPerceivedEventsWarningMapper {
List<HashMap<String,Object>> selectWarningStateDay(DcWarning dcWarning); List<HashMap<String,Object>> selectWarningStateDay(DcWarning dcWarning);
//感知事件类型占比 //感知事件类型占比
List<HashMap<String,Object>> selectWarningTypeDay(DcWarning dcWarning); List<HashMap<String,Object>> selectWarningTypeDay(DcWarning dcWarning);
//事件总数量
int selectNumber();
//感知事件日趋势,传入某天的具体时间,结果按照那一天的小时分组 //感知事件日趋势,传入某天的具体时间,结果按照那一天的小时分组
List<HashMap<String,Object>> selectWarningTrendDay(DcWarning dcWarning); List<HashMap<String,Object>> selectWarningTrendDay(DcWarning dcWarning);
//感知事件月趋势,传入某月的具体时间,结果按照那一天分组 //感知事件月趋势,传入某月的具体时间,结果按照那一天分组

24
zc-business/src/main/java/com/zc/business/service/impl/DcShiftsServiceImpl.java

@ -275,21 +275,41 @@ public class DcShiftsServiceImpl implements IDcShiftsService
ExcelUtil<DcShifts> util = new ExcelUtil<DcShifts>(DcShifts.class); ExcelUtil<DcShifts> util = new ExcelUtil<DcShifts>(DcShifts.class);
List<DcShifts> equipmentList = util.importExcel(file.getInputStream()); List<DcShifts> equipmentList = util.importExcel(file.getInputStream());
//List<DcShifts> equipmentList = util.importExcel("值班人员数据",file.getInputStream(),0); //List<DcShifts> equipmentList = util.importExcel("值班人员数据",file.getInputStream(),0);
BeanValidators.validateWithException(validator, equipmentList);//对象属性验证 BeanValidators.validateWithException(validator, equipmentList);//对象属性验证
for (int i = 0; i < equipmentList.size(); i++) { for (int i = 0; i < equipmentList.size(); i++) {
DcShifts dcShifts = equipmentList.get(i);//获取第i条全部的数据,转换给实体类 DcShifts dcShifts = equipmentList.get(i);//获取第i条全部的数据,转换给实体类
String name = dcShifts.getName(); String name = dcShifts.getName();
String contactNumber = dcShifts.getContactNumber();//手机号 String contactNumber = dcShifts.getContactNumber();//手机号
String organizationName = dcShifts.getOrganizationName();//驻点
String scheduling = dcShifts.getScheduling();//排班
if (contactNumber == null || contactNumber.equals("")) { if (contactNumber == null || contactNumber.equals("")) {
msg = "没有获取到相关手机号信息,请输入手机号"; msg = "没有获取到相关手机号信息,请输入手机号";
throw new ServiceException(msg); throw new ServiceException(msg);
} }
if (scheduling == null || scheduling.equals("")) {
msg = "没有获取到相关排版信息,请输入排版信息";
throw new ServiceException(msg);
}
if (scheduling.equals("白班")){
dcShifts.setScheduling("1");
} else if (scheduling.equals("夜班")) {
dcShifts.setScheduling("2");
}else {
msg = "输入排版格式不正确,请重新输入";
throw new ServiceException(msg);
}
HashMap<String, Object> map = dcShiftsMapper.contactNumber(contactNumber);//手机号获取人员id HashMap<String, Object> map = dcShiftsMapper.contactNumber(contactNumber);//手机号获取人员id
if (map == null) { if (map == null) {
msg = "没有查询到" + name + "的手机号绑定的信息,请查看手机号是否正确"; msg = "没有查询到" + name + "的手机号绑定的信息,请查看手机号是否正确;是否在系统,人员值班中存在";
throw new ServiceException(msg);
}
HashMap<String, Object> stationIdMap = dcShiftsMapper.selectStationId(organizationName);//路管驻点名称查询路管驻点id
if (stationIdMap==null){
msg = "没有查询到" + organizationName + "的驻点信息,请查驻点输入是否正确";
throw new ServiceException(msg); throw new ServiceException(msg);
} }
Long stationId =(Long) stationIdMap.get("id");
dcShifts.setStation(stationId);//驻点id
Long id = (Long) map.get("id"); Long id = (Long) map.get("id");
dcShifts.setEmployeesId(id); dcShifts.setEmployeesId(id);
dcShifts.setCreateTime(DateUtils.getNowDate()); dcShifts.setCreateTime(DateUtils.getNowDate());

4
zc-business/src/main/java/com/zc/business/service/impl/DcTrafficIncidentsServiceImpl.java

@ -270,18 +270,22 @@ public class DcTrafficIncidentsServiceImpl implements IDcTrafficIncidentsService
Map<String,Object> smallCar = new HashMap<>(); Map<String,Object> smallCar = new HashMap<>();
smallCar.put("type","smallCar"); smallCar.put("type","smallCar");
smallCar.put("typeName","小型车");
smallCar.put("num",0); smallCar.put("num",0);
smallCar.put("allTime",0); smallCar.put("allTime",0);
Map<String,Object> trucks = new HashMap<>(); Map<String,Object> trucks = new HashMap<>();
trucks.put("type","trucks"); trucks.put("type","trucks");
trucks.put("typeName","货车");
trucks.put("num",0); trucks.put("num",0);
trucks.put("allTime",0); trucks.put("allTime",0);
Map<String,Object> buses = new HashMap<>(); Map<String,Object> buses = new HashMap<>();
buses.put("type","buses"); buses.put("type","buses");
buses.put("typeName","客车");
buses.put("num",0); buses.put("num",0);
buses.put("allTime",0); buses.put("allTime",0);
Map<String,Object> tankers = new HashMap<>(); Map<String,Object> tankers = new HashMap<>();
tankers.put("type","tankers"); tankers.put("type","tankers");
tankers.put("typeName","罐车");
tankers.put("num",0); tankers.put("num",0);
tankers.put("allTime",0); tankers.put("allTime",0);

BIN
zc-business/src/main/resources/excelTemplate/值班示例模板.xlsx

Binary file not shown.

6
zc-business/src/main/resources/mapper/business/DcPerceivedEventsWarningMapper.xml

@ -14,7 +14,7 @@
select event_type, event_name from dc_event_type select event_type, event_name from dc_event_type
</select> </select>
<select id="selectWarningById" resultType="com.zc.business.domain.DcWarning"> <select id="selectWarningById" resultType="com.zc.business.domain.DcWarning">
SELECT warning.`id`,warning.`stake_mark`, warning.`direction`, SELECT DISTINCT warning.`id`,warning.`stake_mark`, warning.`direction`,
mark.longitude,mark.latitude,warning.lane, mark.longitude,mark.latitude,warning.lane,
warning.`dept_id`,warning.`warning_state`,warning.`warning_time`, warning.`dept_id`,warning.`warning_state`,warning.`warning_time`,
warning.`user_id`, warning.`warning_source`,warning.`warning_level`, warning.`user_id`, warning.`warning_source`,warning.`warning_level`,
@ -281,7 +281,9 @@
GROUP BY QUARTER GROUP BY QUARTER
ORDER BY QUARTER; ORDER BY QUARTER;
</select> </select>
<select id="selectNumber" resultType="int">
select count(1) from dc_warning
</select>
</mapper> </mapper>

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

@ -70,7 +70,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectDcShiftsRecord" resultType="com.zc.business.domain.DcShiftsRecord"> <select id="selectDcShiftsRecord" resultType="com.zc.business.domain.DcShiftsRecord">
select record.id ,record.operator,record.operation_type, select record.id ,record.operator,record.operation_type,
user.nick_name, user.nick_name,record.station,
record.operation_time,record.modify_content, record.operation_time,record.modify_content,
record.shifts_date from dc_shifts_record as record record.shifts_date from dc_shifts_record as record
left join sys_user as user on record.operator=user.user_id left join sys_user as user on record.operator=user.user_id

Loading…
Cancel
Save