Browse Source

执法任务

master
DX 1 month ago
parent
commit
9f2c3dfe63
  1. 6
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java
  2. 14
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java
  3. 7
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java
  4. 4
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java
  5. 30
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java
  6. 30
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java
  7. 24
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml

6
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 ") @GetMapping("/getLeftSecond ")
private List<BigViewEnterpriseCountGroup> getLeftSecond(HomeSelectVO homeSelectVO) { private BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) {
return bigViewDataService.getLeftSecond(homeSelectVO); return bigViewDataService.getLeftSecond(homeSelectVO);
} }
@GetMapping("/getLeftThird") @GetMapping("/getLeftThird")
private List<String> getLeftThird() { private List<String> getLeftThird(HomeSelectVO homeSelectVO) {
return null; return bigViewDataService.getLeftThird(homeSelectVO);
} }
} }

14
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<NameCountVO> enterpriseCountGroup(HomeSelectVO homeSelectVO);
}

7
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 { } else {
SocialUserBindDO bind = socialUserBindMapper.selectByUserTypeAndSocialUserId(UserTypeEnum.MEMBER.getValue(), socialUserDO.getId()); SocialUserBindDO bind = socialUserBindMapper.selectByUserTypeAndSocialUserId(UserTypeEnum.MEMBER.getValue(), socialUserDO.getId());
// 获得用户 // // 获得用户
user = userService.getUser(bind.getUserId()); user = userService.getUser(bind.getUserId());
user.setIsBand(true);
if (user == null) { if (user == null) {
throw exception(USER_NOT_EXISTS); throw exception(USER_NOT_EXISTS);
} }
user.setIsBand(true);
} }
return user; return user;

4
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; import java.util.List;
public interface BigViewDataService { public interface BigViewDataService {
List<BigViewEnterpriseCountGroup> getLeftSecond(HomeSelectVO homeSelectVO); BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO);
List<String> getLeftThird(HomeSelectVO homeSelectVO);
} }

30
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; 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.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.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 org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service @Service
public class BigViewDataServiceImpl implements BigViewDataService { public class BigViewDataServiceImpl implements BigViewDataService {
@Resource
private BigViewDataMapper bigViewDataMapper;
@Override
public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) {
BigViewEnterpriseCountGroup enterpriseCountGroup = new BigViewEnterpriseCountGroup();
final List<NameCountVO> nameCountVOS = bigViewDataMapper.enterpriseCountGroup(homeSelectVO);
enterpriseCountGroup.setEnterpriseCountGroup(nameCountVOS);
List<Integer> 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 @Override
public List<BigViewEnterpriseCountGroup> getLeftSecond(HomeSelectVO homeSelectVO) { public List<String> getLeftThird(HomeSelectVO homeSelectVO) {
return null; return null;
} }
} }

30
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; 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.enterpriseauditlog.EnterpriseAuditLogDO;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO; import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTagDO;
import cn.iocoder.yudao.module.system.dal.dataobject.fileInfo.FileInfoDO; 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.fileInfo.FileInfoMapper;
import cn.iocoder.yudao.module.system.dal.mysql.permission.RoleMapper; 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.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.fileInfo.FileInfoService;
import cn.iocoder.yudao.module.system.service.permission.RoleService; import cn.iocoder.yudao.module.system.service.permission.RoleService;
import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService;
@ -61,6 +63,8 @@ public class EnterpriseServiceImpl implements EnterpriseService {
private UserRoleMapper userRoleMapper; private UserRoleMapper userRoleMapper;
@Resource @Resource
private AdminUserService adminUserService; private AdminUserService adminUserService;
@Resource
private AdminUserMapper adminUserMapper;
@Override @Override
@Transactional @Transactional
@ -72,12 +76,14 @@ public class EnterpriseServiceImpl implements EnterpriseService {
if (enterpriseDO != null) { if (enterpriseDO != null) {
throw exception(ENTERPRISE_EXISTS); throw exception(ENTERPRISE_EXISTS);
} }
//专管员所属部门
// final AdminUserDO user = adminUserService.getUser(createReqVO.getUserId()); //查询邀请人部门
// if (user == null) { final AdminUserDO user1 = adminUserService.getUser(createReqVO.getUserId());
// throw exception(USER_NOT_EXISTS); if (user1 == null) {
// } throw exception(USER_NOT_EXISTS);
// createReqVO.setDeptId(user.getDeptId()); }
//插入邀请人部门
createReqVO.setDepartmentId(user1.getDeptId());
// 插入 // 插入
EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class); EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class);
enterpriseMapper.insert(enterprise); enterpriseMapper.insert(enterprise);
@ -88,6 +94,18 @@ public class EnterpriseServiceImpl implements EnterpriseService {
enterpriseAuditLogDO.setAudit(1); enterpriseAuditLogDO.setAudit(1);
enterpriseAuditLogMapper.insert(enterpriseAuditLogDO); 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) { if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) {
for (Long fileId : createReqVO.getFileIds()) { for (Long fileId : createReqVO.getFileIds()) {
FileInfoDO fileInfoDO = new FileInfoDO(); FileInfoDO fileInfoDO = new FileInfoDO();

24
yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.system.dal.mysql.bigviewdata.BigViewDataMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
<select id="enterpriseCountGroup"
resultType="cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.NameCountVO">
select
sd.name as name,
count(e.id) as count
from
enterprises e
left join system_dept sd on e.department_id = sd.id
group by
e.department_id
</select>
</mapper>
Loading…
Cancel
Save