Commit 0b5d307d authored by wanghao's avatar wanghao

1 基础信息维护-用户管理-燃气用户 大屏展示数据结构 接口联调

parent 72746377
......@@ -7,6 +7,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.core.domain.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 用户管理-燃气用户-安全装置加装维护对象 t_gasuser_safety_device_info
......@@ -45,6 +46,7 @@ public class TGasuserSafetyDeviceInfo extends BaseEntity
private String detectionMedium;
/** 设备安装时间 */
@DateTimeFormat(pattern = "yyyy-MM-dd") // 入参
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "设备安装时间", width = 30,format="yyyy-MM-dd")
private Date deviceInstallTime;
......
......@@ -95,7 +95,7 @@ public class TDetectorUserVillageSafetyDeviceInfoVo {
/**
* 设备安装时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
private Date deviceInstallTime;
/**
......
......@@ -4,6 +4,7 @@ import java.lang.reflect.Field;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -247,6 +248,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
private Map<String,List<Map<String,Object>>> noResidentsUserInit(List<TDetectorUserVillageSafetyDeviceInfoVo> noResidentsUsers){
Map<String,List<Map<String,Object>>> collect = new HashMap<>();
SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd");
// 按照用户类型分组
Map<String, List<TDetectorUserVillageSafetyDeviceInfoVo>> collectByType = noResidentsUsers.stream()
.collect(Collectors.groupingBy(TDetectorUserVillageSafetyDeviceInfoVo::getUserType));
......@@ -330,6 +332,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
safetyDeviceMapItem.put("deviceName", tDetectorUserVillageSafetyDeviceInfoVo.getDeviceName());
safetyDeviceMapItem.put("detctionMedium", tDetectorUserVillageSafetyDeviceInfoVo.getDetctionMedium());
safetyDeviceMapItem.put("deviceInstallTime", tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime());
if (tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime() != null) {
String format = targetFormat.format(tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime());
safetyDeviceMapItem.put("deviceInstallTime",format);
} else {
safetyDeviceMapItem.put("deviceInstallTime","");
}
safetyDeviceMapList.add(safetyDeviceMapItem);
}
}
......@@ -350,6 +358,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
//返回 userlist
List<Map<String,Object>> userMapList= new ArrayList<>();
SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd");
if (residentsUsers.size() > 0) {
// 如果没关联村的就不展示了
......@@ -399,7 +408,6 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
List<TDetectorUserVillageSafetyDeviceInfoVo> safetyDeviceInfoList = entry.getValue();
if (safetyDeviceInfoList.size() > 0) {
for (TDetectorUserVillageSafetyDeviceInfoVo tDetectorUserVillageSafetyDeviceInfoVo : safetyDeviceInfoList) {
//封装 设备信息
......@@ -408,7 +416,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
safetyDeviceMapItem.put("iotNo", tDetectorUserVillageSafetyDeviceInfoVo.getIotNo());
safetyDeviceMapItem.put("deviceName", tDetectorUserVillageSafetyDeviceInfoVo.getDeviceName());
safetyDeviceMapItem.put("detctionMedium", tDetectorUserVillageSafetyDeviceInfoVo.getDetctionMedium());
safetyDeviceMapItem.put("deviceInstallTime", tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime());
if (tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime() != null) {
String format = targetFormat.format(tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime());
safetyDeviceMapItem.put("deviceInstallTime",format);
} else {
safetyDeviceMapItem.put("deviceInstallTime","");
}
safetyDeviceMapList.add(safetyDeviceMapItem);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment