From e7ff00a506c9290dcd75c5e087cae0efbf6fa5c1 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期一, 11 七月 2022 17:01:56 +0800 Subject: [PATCH] 导出不带截图接口 --- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java | 65 ++++++++++++++++++++++++++++++-- 1 files changed, 61 insertions(+), 4 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java index 9e94005..956f57c 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java @@ -3301,6 +3301,14 @@ } @Override + public R checkExport(String account, String password,String oldPassword) { + if(new BCryptPasswordEncoder().matches(password, oldPassword)){ + return R.ok(); + } + return R.fail(); + } + + @Override public R newIndexData(Integer type, Long streetId) { IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(null); IndexDataAnalysisVO vo=new IndexDataAnalysisVO(); @@ -3349,7 +3357,12 @@ vo.setRealUsersMonth(realUsersMonth); vo.setRealUser(getStreetRealUser(realUsersTotal)); vo.setRealUserRate(getRate(vo.getAllUser(),vo.getRealUser())); - vo.setUserActivityXAll(getTwentyDays()); + List<Date> twentyDays = getTwentyDays(); + SimpleDateFormat sdf1=new SimpleDateFormat("MM"); + for (Date twentyDay : twentyDays) { + sdf1.format(twentyDay); + } + vo.setUserActivityXAll(getTwentyDays()); vo.setUserActivityXMonth(getMonthTwentyDays()); List<String> addUserYAll=new ArrayList<>(); List<String> addUserYMonth=new ArrayList<>(); @@ -3374,10 +3387,37 @@ vo.setActiveUserYMonth(activeUserYMonth); if (type.equals(BYSTREET) || type.equals(ALLCOMMUNITY) || type.equals(ALLSTREET)){ //获取其他用户 - vo.setOtherUser(indexDataKanbanVO.getAllUser()-vo.getAllUser()); - vo.setOtherUserRate(getRate(indexDataKanbanVO.getAllUser(),vo.getAllUser())); + vo.setOtherUser(indexDataKanbanVO.getAllUser()-countUser(vo.getUserProportionTotal())); + vo.setOtherUserRate(getRate(indexDataKanbanVO.getAllUser(),vo.getOtherUser())); } return R.ok(vo); + } + + @Override + public R uuPush(String washPhone,String phone,String washName,Integer orderStatus) { + if(StringUtils.isNotEmpty(phone)){ + SysUserDO sysUserDO=userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone,phone).orderByDesc(SysUserDO::getCreateAt).last("limit 1")); + if(sysUserDO!=null&&StringUtils.isNotEmpty(sysUserDO.getOpenid())){ + String status=""; + switch (orderStatus){ + case 2 : status="等待分配车美";break; + case 3 : status="已分配车美";break; + case 4 : status="车美已开始服务";break; + case 5 : status="车美已结束服务";break; + case 6 : status="订单确认完成";break; + case 9 : status="订单已取消";break; + } + WxXCXTempSend util = new WxXCXTempSend(); + try { + String accessToken = util.getAccessToken(); + WxUtil.sendUuWash(sysUserDO.getOpenid(),accessToken,status,washName,washPhone,phone,"Eft5ksvsnOQANy2uNOGY43CC3pb33eDGA_lgCEoxuiw"); + } catch (Exception e) { + e.printStackTrace(); + } + + } + } + return R.ok(); } /** @@ -3426,7 +3466,7 @@ private Double getRate(Integer total,Integer count){ if (0 != total && null != total){ if (0 != count && null != count){ - BigDecimal div = NumberUtil.div(count.toString(), total.toString(),1); + BigDecimal div = NumberUtil.div(count.toString(), total.toString(),2); return div.doubleValue(); } } @@ -3451,4 +3491,21 @@ return count; } + /** + * 计算当前统计范围内的所有用户数 + * */ + public Integer countUser(List<UserProportion> list){ + Integer count=0; + if (list.size()>0){ + for (UserProportion proportion : list) { + if (org.apache.commons.lang3.ObjectUtils.isNotEmpty(proportion)){ + if (org.apache.commons.lang3.ObjectUtils.isNotEmpty(proportion.getUser())){ + count+=proportion.getUser(); + } + } + } + } + return count; + } + } -- Gitblit v1.7.1