台站管理,探测器管理保存方法moddate赋值代码去除
This commit is contained in:
parent
82f69d9e7a
commit
06bb6146ab
|
@ -101,6 +101,7 @@ public class GardsDetectors implements Serializable {
|
|||
@TableField(value = "MODDATE")
|
||||
@NotNull(message = "不能为空", groups = {InsertGroup.class, UpdateGroup.class})
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
private Date moddate;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
package org.jeecg.common.util;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
@Component
|
||||
public class SSEUtil {
|
||||
private static Map<String, SseEmitter> sseCache = new ConcurrentHashMap<>();
|
||||
|
||||
public SseEmitter subscribe(String id) {
|
||||
// 超时时间设置为1小时
|
||||
SseEmitter sseEmitter = new SseEmitter(3600_000L);
|
||||
sseCache.put(id, sseEmitter);
|
||||
sseEmitter.onTimeout(() -> sseCache.remove(id));
|
||||
sseEmitter.onCompletion(() -> System.out.println("完成!!!"));
|
||||
return sseEmitter;
|
||||
}
|
||||
|
||||
public String push(String id, String content) throws IOException {
|
||||
SseEmitter sseEmitter = sseCache.get(id);
|
||||
if (sseEmitter != null) {
|
||||
sseEmitter.send(content);
|
||||
}
|
||||
return "over";
|
||||
}
|
||||
|
||||
public String over(String id) {
|
||||
SseEmitter sseEmitter = sseCache.get(id);
|
||||
if (sseEmitter != null) {
|
||||
sseEmitter.complete();
|
||||
sseCache.remove(id);
|
||||
}
|
||||
return "over";
|
||||
}
|
||||
|
||||
}
|
|
@ -16,7 +16,7 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class IDataServiceImpl implements IDataService {
|
||||
public class DataServiceImpl implements IDataService {
|
||||
|
||||
@Value("${inland.url}")
|
||||
private String url; // 本地数据源url,即为主数据源
|
|
@ -1,7 +1,9 @@
|
|||
package org.jeecg.modules.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.jeecg.modules.system.entity.SysTaskStationSystem;
|
||||
|
||||
@Mapper
|
||||
public interface SysTaskStationMapper extends BaseMapper<SysTaskStationSystem> {
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.base.entity.postgre.SysUser;
|
||||
import org.jeecg.modules.system.model.SysUserSysDepartModel;
|
||||
|
@ -20,6 +21,7 @@ import java.util.List;
|
|||
* @Author scott
|
||||
* @since 2018-12-20
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysUserMapper extends BaseMapper<SysUser> {
|
||||
/**
|
||||
* 通过用户账号查询用户信息
|
||||
|
|
|
@ -86,7 +86,6 @@ public class GardsDetectorsServiceImpl extends ServiceImpl<GardsDetectorsMapper,
|
|||
return result;
|
||||
}
|
||||
}
|
||||
gardsDetectors.setModdate(new Date());
|
||||
this.baseMapper.insert(gardsDetectors);
|
||||
result.success("Save successfully");
|
||||
this.findDetectors();
|
||||
|
|
|
@ -102,7 +102,6 @@ public class GardsStationsServiceImpl extends ServiceImpl<GardsStationsMapper, G
|
|||
return result;
|
||||
}
|
||||
}
|
||||
gardsStations.setModdate(new Date());
|
||||
this.baseMapper.insert(gardsStations);
|
||||
result.setSuccess(true);
|
||||
result.success("Save successfully");
|
||||
|
|
Loading…
Reference in New Issue
Block a user