From 9f2c3dfe63a3919de7da81bfe7822a38e3a3a654 Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Fri, 21 Feb 2025 11:58:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A7=E6=B3=95=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bigviewdata/BigViewDataController.java | 6 ++-- .../mysql/bigviewdata/BigViewDataMapper.java | 14 +++++++++ .../service/auth/AdminAuthServiceImpl.java | 7 +++-- .../bigviewdata/BigViewDataService.java | 4 ++- .../bigviewdata/BigViewDataServiceImpl.java | 30 ++++++++++++++++++- .../enterprise/EnterpriseServiceImpl.java | 30 +++++++++++++++---- .../mapper/bigviewdata/BigViewDataMapper.xml | 24 +++++++++++++++ 7 files changed, 102 insertions(+), 13 deletions(-) create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java index 64c43c5..f8bcd48 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java @@ -30,12 +30,12 @@ public class BigViewDataController { } @GetMapping("/getLeftSecond ") - private List getLeftSecond(HomeSelectVO homeSelectVO) { + private BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) { return bigViewDataService.getLeftSecond(homeSelectVO); } @GetMapping("/getLeftThird") - private List getLeftThird() { - return null; + private List getLeftThird(HomeSelectVO homeSelectVO) { + return bigViewDataService.getLeftThird(homeSelectVO); } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java new file mode 100644 index 0000000..9b45e61 --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.module.system.dal.mysql.bigviewdata; + +import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO; +import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface BigViewDataMapper { + + List enterpriseCountGroup(HomeSelectVO homeSelectVO); + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java index 74192e4..d40d2b9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java @@ -335,13 +335,16 @@ public class AdminAuthServiceImpl implements AdminAuthService { } else { SocialUserBindDO bind = socialUserBindMapper.selectByUserTypeAndSocialUserId(UserTypeEnum.MEMBER.getValue(), socialUserDO.getId()); - // 获得用户 +// // 获得用户 user = userService.getUser(bind.getUserId()); - user.setIsBand(true); if (user == null) { throw exception(USER_NOT_EXISTS); } + + user.setIsBand(true); + + } return user; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java index a5fdfce..48ca4ad 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java @@ -6,5 +6,7 @@ import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; import java.util.List; public interface BigViewDataService { - List getLeftSecond(HomeSelectVO homeSelectVO); + BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO); + + List getLeftThird(HomeSelectVO homeSelectVO); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java index 5e2b031..e196c31 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java @@ -1,15 +1,43 @@ package cn.iocoder.yudao.module.system.service.bigviewdata; import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewEnterpriseCountGroup; +import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO; import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO; +import cn.iocoder.yudao.module.system.dal.dataobject.enterprise.EnterpriseDO; +import cn.iocoder.yudao.module.system.dal.mysql.bigviewdata.BigViewDataMapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; @Service public class BigViewDataServiceImpl implements BigViewDataService { + + @Resource + private BigViewDataMapper bigViewDataMapper; + + @Override + public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) { + BigViewEnterpriseCountGroup enterpriseCountGroup = new BigViewEnterpriseCountGroup(); + final List nameCountVOS = bigViewDataMapper.enterpriseCountGroup(homeSelectVO); + enterpriseCountGroup.setEnterpriseCountGroup(nameCountVOS); + List countList = new ArrayList<>(); + if (nameCountVOS != null) { + nameCountVOS.forEach(item->{ + countList.add(item.getCount()); + }); + } + final Integer count = countList.stream().reduce(Integer::sum).orElse(0); + enterpriseCountGroup.setEnterpriseCount(count); + + return enterpriseCountGroup; + } + @Override - public List getLeftSecond(HomeSelectVO homeSelectVO) { + public List getLeftThird(HomeSelectVO homeSelectVO) { return null; } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java index 8d229e4..6d3f713 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.system.service.enterprise; +import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO; import cn.iocoder.yudao.module.system.dal.dataobject.enterpriseauditlog.EnterpriseAuditLogDO; import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO; import cn.iocoder.yudao.module.system.dal.dataobject.fileInfo.FileInfoDO; @@ -12,6 +13,7 @@ import cn.iocoder.yudao.module.system.dal.mysql.enterprisetag.EnterpriseTagMappe import cn.iocoder.yudao.module.system.dal.mysql.fileInfo.FileInfoMapper; import cn.iocoder.yudao.module.system.dal.mysql.permission.RoleMapper; import cn.iocoder.yudao.module.system.dal.mysql.permission.UserRoleMapper; +import cn.iocoder.yudao.module.system.dal.mysql.user.AdminUserMapper; import cn.iocoder.yudao.module.system.service.fileInfo.FileInfoService; import cn.iocoder.yudao.module.system.service.permission.RoleService; import cn.iocoder.yudao.module.system.service.user.AdminUserService; @@ -61,6 +63,8 @@ public class EnterpriseServiceImpl implements EnterpriseService { private UserRoleMapper userRoleMapper; @Resource private AdminUserService adminUserService; + @Resource + private AdminUserMapper adminUserMapper; @Override @Transactional @@ -72,12 +76,14 @@ public class EnterpriseServiceImpl implements EnterpriseService { if (enterpriseDO != null) { throw exception(ENTERPRISE_EXISTS); } - //专管员所属部门 -// final AdminUserDO user = adminUserService.getUser(createReqVO.getUserId()); -// if (user == null) { -// throw exception(USER_NOT_EXISTS); -// } -// createReqVO.setDeptId(user.getDeptId()); + + //查询邀请人部门 + final AdminUserDO user1 = adminUserService.getUser(createReqVO.getUserId()); + if (user1 == null) { + throw exception(USER_NOT_EXISTS); + } + //插入邀请人部门 + createReqVO.setDepartmentId(user1.getDeptId()); // 插入 EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class); enterpriseMapper.insert(enterprise); @@ -88,6 +94,18 @@ public class EnterpriseServiceImpl implements EnterpriseService { enterpriseAuditLogDO.setAudit(1); enterpriseAuditLogMapper.insert(enterpriseAuditLogDO); + //用户表修改用户真实姓名和手机号 + //专管员所属部门 + final AdminUserDO user = adminUserService.getUser(getLoginUserId()); + if (user == null) { + throw exception(USER_NOT_EXISTS); + } + + user.setRealName(createReqVO.getContactName()); + user.setMobile(createReqVO.getEnvironmentalContactPhone()); + adminUserMapper.updateById(user); + + if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) { for (Long fileId : createReqVO.getFileIds()) { FileInfoDO fileInfoDO = new FileInfoDO(); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml new file mode 100644 index 0000000..c4eb26c --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml @@ -0,0 +1,24 @@ + + + + + + + + +