This commit is contained in:
liuchengqian 2025-06-04 13:39:43 +08:00
parent 6e003adc8c
commit ddae56c44f
7 changed files with 19 additions and 18 deletions

View File

@ -107,7 +107,7 @@ public class FirePointController {
try { try {
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, ReptileUtils.reptileBatch(), locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, ReptileUtils.reptileBatch(), locale);
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); // e.printStackTrace();
} }
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, null, locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, null, locale);
} }

View File

@ -27,6 +27,7 @@ import javax.servlet.http.HttpServletRequest;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationErrorList; import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationErrorList;
import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject; import static com.xkrs.common.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@ -214,18 +215,18 @@ public class SysUserController {
* 查看用户信息 * 查看用户信息
*/ */
@GetMapping("/selectAllUser") @GetMapping("/selectAllUser")
public String selectAllUser(@RequestHeader(value = "Authorization") String token) { public String selectAllUser(@RequestHeader(value = "Authorization") String token,//
@RequestParam(value = "page", defaultValue = "1") int page,//
@RequestParam(value = "size", defaultValue = "10") int size//
) {
// 验证token // 验证token
String tokenUserName = TokenUtil.obtainUserNameByToken(token); String tokenUserName = TokenUtil.obtainUserNameByToken(token);
SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName); SysUserEntity sysUserEntity = sysUserDao.selectByUserName(tokenUserName);
if (sysUserEntity == null) { if (sysUserEntity == null) {
return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR, "您还没有注册登录,请先注册登录", locale); return outputEncapsulationObject(PromptMessageEnum.USER_LOGIN_ERROR, "您还没有注册登录,请先注册登录", locale);
} }
List<SysUserEntity> sysUserEntityList = sysUserDao.findAll(Sort.by(Sort.Direction.DESC, "id")); List<SysUserEntity> sysUserEntityList = sysUserDao.selectUser(size, (page - 1) * size);
List<SysUserVo> sysUserVoList = new ArrayList<>(); List<SysUserVo> sysUserVoList = sysUserEntityList.stream().map(SysUserConvertUtils::convert).collect(Collectors.toList());
for (SysUserEntity sysUser : sysUserEntityList) {
sysUserVoList.add(SysUserConvertUtils.convert(sysUser));
}
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, sysUserVoList, locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, sysUserVoList, locale);
} }

View File

@ -8,6 +8,8 @@ import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param; import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.List;
@Component @Component
public interface SysUserDao extends JpaRepository<SysUserEntity, Long>, JpaSpecificationExecutor<SysUserEntity> { public interface SysUserDao extends JpaRepository<SysUserEntity, Long>, JpaSpecificationExecutor<SysUserEntity> {
@ -27,6 +29,9 @@ public interface SysUserDao extends JpaRepository<SysUserEntity, Long>, JpaSpeci
@Query(value = "SELECT * FROM sys_user WHERE user_name = :userName", nativeQuery = true) @Query(value = "SELECT * FROM sys_user WHERE user_name = :userName", nativeQuery = true)
SysUserEntity selectByUserName(@Param("userName") String userName); SysUserEntity selectByUserName(@Param("userName") String userName);
@Query(value = "SELECT * FROM sys_user ORDER BY id DESC LIMIT ?1 OFFSET ?2", nativeQuery = true)
List<SysUserEntity> selectUser(int limit, int offset);
/** /**
* 删除系统用户危险操作 * 删除系统用户危险操作
*/ */

View File

@ -69,7 +69,7 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService {
if (!checkSatelliteTypeWrapper.getData1()) { if (!checkSatelliteTypeWrapper.getData1()) {
return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, checkSatelliteTypeWrapper.getData2(), locale); return outputEncapsulationObject(PromptMessageEnum.PROCESS_FAIL, checkSatelliteTypeWrapper.getData2(), locale);
} }
log.info("insertFirePoint 接收到火点信息:" + firePointQo.toString()); // log.info("insertFirePoint 接收到火点信息:" + firePointQo.toString());
//解构接收的数据 //解构接收的数据
String fireCode = firePointQo.getFireCode(); String fireCode = firePointQo.getFireCode();
Long satelliteTimeTs = firePointQo.getSatelliteTimeTs(); Long satelliteTimeTs = firePointQo.getSatelliteTimeTs();
@ -122,7 +122,7 @@ public class DispatchFirePointServiceImpl implements DispatchFirePointService {
firePointPushManager.pushNotification(firePointOrdinaryEntity);//将火点消息通知用户 firePointPushManager.pushNotification(firePointOrdinaryEntity);//将火点消息通知用户
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功", locale); return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功", locale);
} }
ErrorInfoLogUtils.log("高德逆地理编码异常,出现问题的火点详情:" + firePointOrdinaryEntity.toString()); // ErrorInfoLogUtils.log("高德逆地理编码异常,出现问题的火点详情:" + firePointOrdinaryEntity.toString());
//使用网络方式解析地址信息失败就使用接收到的数据结合字典表对实体类对象赋值入库 //使用网络方式解析地址信息失败就使用接收到的数据结合字典表对实体类对象赋值入库
StreetEntity streetEntity = obtainInfoByCountyCode(countyCode); StreetEntity streetEntity = obtainInfoByCountyCode(countyCode);
if (streetEntity != null) { if (streetEntity != null) {

View File

@ -25,7 +25,7 @@ public class JsonUtils {
try { try {
return MAPPER.readValue(json, clazz); return MAPPER.readValue(json, clazz);
} catch (JsonProcessingException e) { } catch (JsonProcessingException e) {
throw new RuntimeException(e); return null;
} }
} }

View File

@ -49,14 +49,9 @@ public class TimeRangeUtils {
public static List<DataWrapper2<LocalDateTime, LocalDateTime>> getVipRangeList(String vipTimeRangeJson) { public static List<DataWrapper2<LocalDateTime, LocalDateTime>> getVipRangeList(String vipTimeRangeJson) {
List<DataWrapper2<LocalDateTime, LocalDateTime>> vipRangeList = new ArrayList<>();//VIP范围结果列表 List<DataWrapper2<LocalDateTime, LocalDateTime>> vipRangeList = new ArrayList<>();//VIP范围结果列表
List<VipTimeRangeBean.VipTimeRangeItemBean> list = new ArrayList<>();//Json解析的VIP范围列表 List<VipTimeRangeBean.VipTimeRangeItemBean> list = new ArrayList<>();//Json解析的VIP范围列表
try {
VipTimeRangeBean vipTimeRangeBean = JsonUtils.deserialize(vipTimeRangeJson, VipTimeRangeBean.class); VipTimeRangeBean vipTimeRangeBean = JsonUtils.deserialize(vipTimeRangeJson, VipTimeRangeBean.class);
if (vipTimeRangeBean.getList() == null || vipTimeRangeBean.getList().size() == 0) { if (vipTimeRangeBean != null && vipTimeRangeBean.getList() != null && !vipTimeRangeBean.getList().isEmpty()) {
throw new RuntimeException("VipTimeRangeJson Error");
}
list.addAll(vipTimeRangeBean.getList()); list.addAll(vipTimeRangeBean.getList());
} catch (Exception e) {
e.printStackTrace();
} }
for (VipTimeRangeBean.VipTimeRangeItemBean item : list) { for (VipTimeRangeBean.VipTimeRangeItemBean item : list) {
DateTimeUtils.checkDateTimeFormat(item.getStartTime()); DateTimeUtils.checkDateTimeFormat(item.getStartTime());

View File

@ -33,7 +33,7 @@ import java.security.cert.X509Certificate;
*/ */
public class HttpClientUtils { public class HttpClientUtils {
private static final boolean printLog = true; private static final boolean printLog = false;
private static final Logger log = LoggerFactory.getLogger(HttpClientUtils.class); private static final Logger log = LoggerFactory.getLogger(HttpClientUtils.class);