From 9bfe692752f1dc1a2a0c0c825a88335de30b92f6 Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期五, 15 十月 2021 09:58:20 +0800 Subject: [PATCH] Merge branch 'test_warehouse' into test --- springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java | 84 +++++++++++++++++++++++++++-------------- 1 files changed, 55 insertions(+), 29 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 7fcbbc4..319dace 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 @@ -14,6 +14,10 @@ import javax.annotation.Resource; +import cn.hutool.core.util.IdcardUtil; +import com.panzhihua.common.model.dtos.DataKanBansDto; +import com.panzhihua.service_user.dao.*; +import com.panzhihua.service_user.model.dos.*; import org.apache.commons.lang.time.DateFormatUtils; import org.apache.commons.lang.time.DateUtils; import org.springframework.beans.BeanUtils; @@ -81,34 +85,6 @@ import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.common.utlis.WxUtil; import com.panzhihua.common.utlis.WxXCXTempSend; -import com.panzhihua.service_user.dao.ComMngFamilyInfoDAO; -import com.panzhihua.service_user.dao.ComMngUserTagDAO; -import com.panzhihua.service_user.dao.EventGridMemberBuildingRelationMapper; -import com.panzhihua.service_user.dao.LcCompareMemberCodeMapper; -import com.panzhihua.service_user.dao.RoleDAO; -import com.panzhihua.service_user.dao.SysMenuDAO; -import com.panzhihua.service_user.dao.SysOperLogDAO; -import com.panzhihua.service_user.dao.SysRoleMenuDAO; -import com.panzhihua.service_user.dao.SysUserAgreementDAO; -import com.panzhihua.service_user.dao.SysUserFeedbackDAO; -import com.panzhihua.service_user.dao.SysUserInputDAO; -import com.panzhihua.service_user.dao.SysUserNoticeDAO; -import com.panzhihua.service_user.dao.SysUserRoleDAO; -import com.panzhihua.service_user.dao.UserDao; -import com.panzhihua.service_user.model.dos.ComMngFamilyInfoDO; -import com.panzhihua.service_user.model.dos.ComMngUserTagDO; -import com.panzhihua.service_user.model.dos.EventGridMemberBuildingRelationDO; -import com.panzhihua.service_user.model.dos.LcCompareCodeMemberDO; -import com.panzhihua.service_user.model.dos.SysMenuDO; -import com.panzhihua.service_user.model.dos.SysOperLogDO; -import com.panzhihua.service_user.model.dos.SysRoleDO; -import com.panzhihua.service_user.model.dos.SysRoleMenuDO; -import com.panzhihua.service_user.model.dos.SysUserAgreementDO; -import com.panzhihua.service_user.model.dos.SysUserDO; -import com.panzhihua.service_user.model.dos.SysUserFeedbackDO; -import com.panzhihua.service_user.model.dos.SysUserInputDO; -import com.panzhihua.service_user.model.dos.SysUserNoticeDO; -import com.panzhihua.service_user.model.dos.SysUserRoleDO; import com.panzhihua.service_user.model.dtos.DataKanbanDTO; import com.panzhihua.service_user.service.EventGridMemberBuildingRelationService; import com.panzhihua.service_user.service.UserService; @@ -158,6 +134,8 @@ private EventGridMemberBuildingRelationMapper eventGridMemberBuildingRelationMapper; @Resource private LcCompareMemberCodeMapper lcCompareMemberCodeMapper; + @Resource + private ComActFourMemberDao comActFourMemberDao; // @Resource // private GridService gridService; @@ -346,6 +324,8 @@ loginUserInfoVO.setRoles(set); } loginUserInfoVO.setIsmemberrole(2); + loginUserInfoVO.setIsFourMember(2); + loginUserInfoVO.setIsCommunityWorker(2); // 志愿者状态 String phone = sysUserDO.getPhone(); Long userCommunityId = sysUserDO.getCommunityId(); @@ -363,12 +343,18 @@ int state = comMngVolunteerMngVO.getState().intValue(); loginUserInfoVO.setVolunteerStatus(state); } + //是否四长四员 + Integer countFourMember=comActFourMemberDao.selectCount(new QueryWrapper<ComActFourMember>().lambda().eq(ComActFourMember::getIdCard,sysUserDO.getIdCard())); + if(countFourMember>0){ + loginUserInfoVO.setIsFourMember(1); + } // 是否是"管理员"或者 本社区 "社区团队"、"党委成员" Integer countTeam = userDao.selectCountTeam(phone, userCommunityId); Integer selectCountMemberRole = userDao.selectCountMemberRole(phone, userCommunityId); Integer isSysUser = userDao.selectCountSysUser(phone, userCommunityId); if (countTeam != null && countTeam > 0) { loginUserInfoVO.setIsmemberrole(1); + loginUserInfoVO.setIsCommunityWorker(1); } else if (selectCountMemberRole != null && selectCountMemberRole > 0) { loginUserInfoVO.setIsmemberrole(1); } else if (isSysUser != null && isSysUser > 0) { @@ -799,7 +785,7 @@ sysUserDO.setIdCard(idCard); // 通过身份证号判断性别以及出生日期 sysUserDO.setSex(IdCard.sex(idCard)); - sysUserDO.setBirthday(IdCard.birthDay(idCard)); + sysUserDO.setBirthday(IdcardUtil.getBirthDate(idCard)); if (!StringUtils.isEmpty(loginUserInfoVO.getJob())) { sysUserDO.setJob(loginUserInfoVO.getJob()); } @@ -2692,4 +2678,44 @@ } } } + + @Override + public R dataKanBans(DataKanBansDto dataKanBansDto){ + IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(); + List<String> communityUserX = new ArrayList<>(); + List<Integer> communityUserY = new ArrayList<>(); + + List<String> communityActiveUserX = new ArrayList<>(); + List<Integer> communityActiveUserY = new ArrayList<>(); + List<Integer> communityActiveUserZ = new ArrayList<>(); + + List<DataKanbanDTO> dataKanbanDTOS = null; + if(dataKanBansDto.getType() != null && dataKanBansDto.getType().equals(DataKanBansDto.type.by)){ + dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(); + }else{ + dataKanbanDTOS = userDao.selectCommunityUserOrder(); + } + if (!ObjectUtils.isEmpty(dataKanbanDTOS)) { + dataKanbanDTOS.forEach(dataKanbanDTO -> { + communityUserX.add(dataKanbanDTO.getName()); + communityUserY.add(dataKanbanDTO.getNum()); + }); + } + + // 获取最近七天数据 + List<Date> serverndays = com.panzhihua.common.utlis.DateUtils.getOldDays(); + serverndays.forEach(date -> { + // 查询社区活动数量 + DataKanbanDTO dataKanbanDTO = userDao.selectCommunityAddUserOrder(date); + communityActiveUserX.add(DateFormatUtils.format(date, "MM-dd")); + communityActiveUserY.add(dataKanbanDTO.getNum()); + communityActiveUserZ.add(dataKanbanDTO.getDayNum()); + }); + indexDataKanbanVO.setCommunityActiveUserX(communityActiveUserX); + indexDataKanbanVO.setCommunityAddUserY(communityActiveUserY); + indexDataKanbanVO.setCommunityActiveUserY(communityActiveUserZ); + indexDataKanbanVO.setCommunityUserX(communityUserX); + indexDataKanbanVO.setCommunityUserY(communityUserY); + return R.ok(indexDataKanbanVO); + } } -- Gitblit v1.7.1