From f504aa0120dbb201db5645529a67c5e398f7bfc7 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Sun, 5 Mar 2023 22:03:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9A=84VIP=E6=97=B6=E9=97=B4=E8=8C=83?= =?UTF-8?q?=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xkrs/common/config/WebSecurityConfig.java | 1 + .../DispatchFirePointController.java | 34 ++++++++++++++++++- .../xkrs/straw/utils/VipTimeRangeUtils.java | 2 +- 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java index 6dc567d..6c9a385 100644 --- a/src/main/java/com/xkrs/common/config/WebSecurityConfig.java +++ b/src/main/java/com/xkrs/common/config/WebSecurityConfig.java @@ -77,6 +77,7 @@ class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers(HttpMethod.GET, "/updateFirePointStreetCode").permitAll() .antMatchers(HttpMethod.GET, "/selectTodayFirePoint").permitAll() .antMatchers(HttpMethod.GET, "/api/user/selectVipUser").permitAll() + .antMatchers(HttpMethod.GET, "/debug").permitAll() // 所有其它请求需要身份认证 .anyRequest().authenticated() .and() diff --git a/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java b/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java index 964474b..433d462 100644 --- a/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java +++ b/src/main/java/com/xkrs/straw/controller/DispatchFirePointController.java @@ -1,10 +1,12 @@ package com.xkrs.straw.controller; import com.xkrs.service.impl.FirePointServiceImpl; +import com.xkrs.straw.dao.SysUserDao; import com.xkrs.straw.model.qo.AllFirePointQo; import com.xkrs.straw.service.DispatchFirePointService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; @@ -15,10 +17,40 @@ import javax.annotation.Resource; public class DispatchFirePointController { public static Logger log = LoggerFactory.getLogger(FirePointServiceImpl.class); - + @Resource + private SysUserDao sysUserDao; @Resource private DispatchFirePointService firePointService; + @GetMapping("/debug") + public String debug() { + +// List sysUserEntityList = sysUserDao.findAll(); +// for (SysUserEntity sysUserEntity : sysUserEntityList) { +// String addTime = sysUserEntity.getAddTime(); +// String vipTimeRangeJson = sysUserEntity.getVipTimeRangeJson(); +// if (!DateTimeUtil.isValidDateTime(addTime)) { +// return sysUserEntity.getUserName(); +// } +// if (!DateTimeUtil.isValidDateTime(vipTimeRangeJson)) { +// return sysUserEntity.getUserName(); +// } +// VipTimeRangeBean.VipTimeRangeItemBean vipTimeRangeItemBean = new VipTimeRangeBean.VipTimeRangeItemBean(); +// vipTimeRangeItemBean.setStartTime(addTime); +// vipTimeRangeItemBean.setEndTime(vipTimeRangeJson); +// List list = new ArrayList<>(); +// list.add(vipTimeRangeItemBean); +// VipTimeRangeBean vipTimeRangeBean = new VipTimeRangeBean(); +// vipTimeRangeBean.setList(list); +// String serialize = JsonUtils.serialize(vipTimeRangeBean); +// System.out.println("serialize = " + serialize); +// sysUserEntity.setVipTimeRangeJson(serialize); +// sysUserDao.save(sysUserEntity); +// } + return "OKkkkkkkk"; + } + + /** * 普通渠道推送火点到秸秆系统 */ diff --git a/src/main/java/com/xkrs/straw/utils/VipTimeRangeUtils.java b/src/main/java/com/xkrs/straw/utils/VipTimeRangeUtils.java index 7474e91..29dc8d0 100644 --- a/src/main/java/com/xkrs/straw/utils/VipTimeRangeUtils.java +++ b/src/main/java/com/xkrs/straw/utils/VipTimeRangeUtils.java @@ -198,7 +198,7 @@ public class VipTimeRangeUtils { VipTimeRangeBean vipTimeRangeBean = new VipTimeRangeBean(); vipTimeRangeBean.setList(list); String serialize = JsonUtils.serialize(vipTimeRangeBean); - System.out.printf("serialize = " + serialize); + System.out.println("serialize = " + serialize); } }