pom.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/example/jz/controller/WxAppController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/example/jz/service/impl/CauseServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/example/jz/service/impl/WorkbenchServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/test/java/com/example/jz/JzApplicationTests.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
pom.xml
@@ -48,7 +48,7 @@ <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> <version>3.3.2</version> <version>3.4.2</version> </dependency> <!-- httpclient--> <dependency> src/main/java/com/example/jz/controller/WxAppController.java
@@ -17,6 +17,7 @@ import lombok.SneakyThrows; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.ResponseEntity; @@ -36,9 +37,11 @@ private final String wxApp_accessToken_verify_url = "https://api.weixin.qq.com/cgi-bin/token"; private final String appid = "wxebbb232d366dae09"; @Value("${wx.appid}") private String appid; private final String secret = "9a160c97c821eaa163240e8ec9185b77"; @Value("${wx.secret}") private String secret; private final String js_code = ""; src/main/java/com/example/jz/service/impl/CauseServiceImpl.java
@@ -172,25 +172,26 @@ public PageParam<CauseReportVo> getReporterList(Integer causeId) { PageParam<Report> PageParam = new PageParam<>(); PageParam<Report> reportPageParam = reportDao.selectPage(PageParam, new QueryWrapper<Report>().eq("cause_id", causeId).orderByDesc("ctime")); List<CauseReportVo> causeReportVos = reportPageParam.getRecords().stream() .map( a -> { CauseReportVo causeReportVo = new CauseReportVo(); User user = userDao.selectOne(new QueryWrapper<User>().eq("id", a.getUserId())); BeanUtils.copyProperties(a, causeReportVo); causeReportVo.setMobile(user.getUserMobile()); causeReportVo.setIdcard(user.getUserIdcard().replaceAll("(?<=[\\d]{3})\\d(?=[\\d]{4})", "*")); causeReportVo.setReporterName(user.getRealName()); if (causeReportVo.getIsInGroup()==1) { causeReportVo.setGroupId(groupDao.selectOne(new QueryWrapper<Group>().eq("cause_id",causeId)).getId()); } return causeReportVo; } ).collect(Collectors.toList()); PageParam<CauseReportVo> causeReportVoPageParam = new PageParam<>(); BeanUtils.copyProperties(reportPageParam, causeReportVoPageParam); causeReportVoPageParam.setRecords(causeReportVos); if (!reportPageParam.getRecords().isEmpty()){ List<CauseReportVo> causeReportVos = reportPageParam.getRecords().stream() .map( a -> { CauseReportVo causeReportVo = new CauseReportVo(); User user = userDao.selectOne(new QueryWrapper<User>().eq("id", a.getUserId())); BeanUtils.copyProperties(a, causeReportVo); causeReportVo.setMobile(user.getUserMobile()); causeReportVo.setIdcard(user.getUserIdcard().replaceAll("(?<=[\\d]{3})\\d(?=[\\d]{4})", "*")); causeReportVo.setReporterName(user.getRealName()); if (causeReportVo.getIsInGroup()==1) { causeReportVo.setGroupId(groupDao.selectOne(new QueryWrapper<Group>().eq("cause_id",causeId)).getId()); } return causeReportVo; } ).collect(Collectors.toList()); causeReportVoPageParam.setRecords(causeReportVos); } return causeReportVoPageParam; } src/main/java/com/example/jz/service/impl/WorkbenchServiceImpl.java
@@ -3,8 +3,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.example.jz.dao.*; import com.example.jz.modle.entity.*; import com.example.jz.modle.vo.ReportVo; import com.example.jz.modle.vo.MessageVo; import com.example.jz.modle.vo.ReportVo; import com.example.jz.service.WorkbenchService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -69,30 +69,36 @@ //查询待审核人 List<Report> reports = reportDao.selectList(new QueryWrapper<Report>().eq("status", 0).orderByDesc("ctime").last("limit 5")); ArrayList<ReportVo> reportVos = new ArrayList<>(); reports.forEach(a -> { User user = userDao.selectOne(new QueryWrapper<User>().eq("id", a.getUserId())); ReportVo reportVo = new ReportVo(); reportVo.setReporterName(user.getRealName()); String regex = "(?<=[\\d]{3})\\d(?=[\\d]{4})"; reportVo.setIdcard(user.getUserIdcard().replaceAll(regex, "*")); reportVo.setMobile(user.getUserMobile()); reportVo.setId(a.getId()); reportVos.add(reportVo); }); if(!reports.isEmpty()){ reports.forEach(a -> { User user = userDao.selectOne(new QueryWrapper<User>().eq("id", a.getUserId())); ReportVo reportVo = new ReportVo(); if (user!=null){ reportVo.setReporterName(user.getRealName()); String regex = "(?<=[\\d]{3})\\d(?=[\\d]{4})"; reportVo.setIdcard(user.getUserIdcard().replaceAll(regex, "*")); reportVo.setMobile(user.getUserMobile()); } reportVo.setId(a.getId()); reportVos.add(reportVo); }); } return reportVos; } @Override public List<MessageVo> getGroupMessage() { ArrayList<MessageVo> messageVos = new ArrayList<>(); messageDao.selectList(new QueryWrapper<Message>().orderByDesc("ctime")).stream() .filter(item->item.getUserId()!=null).limit(5).forEach(a -> { MessageVo messageVo = new MessageVo(); messageVo.setGroupName(groupDao.selectOne(new QueryWrapper<Group>().eq("id", a.getGroupId())).getGroupName()); BeanUtils.copyProperties(a, messageVo); messageVo.setUserName(a.getReportName()); messageVos.add(messageVo); }); if (!messageVos.isEmpty()){ messageDao.selectList(new QueryWrapper<Message>().orderByDesc("ctime")).stream() .filter(item->item.getUserId()!=null).limit(5).forEach(a -> { MessageVo messageVo = new MessageVo(); messageVo.setGroupName(groupDao.selectOne(new QueryWrapper<Group>().eq("id", a.getGroupId())).getGroupName()); BeanUtils.copyProperties(a, messageVo); messageVo.setUserName(a.getReportName()); messageVos.add(messageVo); }); } return messageVos; } } src/main/resources/application.yml
@@ -1,6 +1,6 @@ # 端口号 server: port: 8081 port: 8888 # spring配置 spring: @@ -31,9 +31,9 @@ # minio配置 minio: address: http://119.28.5.249:9000 accessKey: minioadmin secretKey: minioadmin address: http://42.193.1.25:9000 accessKey: satori secretKey: 12345678 bucketName: img # mybatis配置 @@ -44,4 +44,9 @@ id-type: auto field-strategy: NOT_NULL configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #小程序 wx: appid: wx15ee01704b3c9dd0 secret: a96eaee73d9de507d8412b7d2959b927 src/test/java/com/example/jz/JzApplicationTests.java
@@ -22,7 +22,7 @@ @Test void test() { System.out.println(defaultPwdEncoder.encode("123456")); System.out.println(defaultPwdEncoder.encode("qyjz2022!@#")); } }