Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java
master
赵鹏 1 month ago
parent
commit
c23c7652d7
  1. 30
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java
  2. 9
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java
  3. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseSaveReqVO.java
  4. 94
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/EnterprisesUserController.java
  5. 34
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserPageReqVO.java
  6. 39
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserRespVO.java
  7. 30
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserSaveReqVO.java
  8. 39
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprisesuser/EnterprisesUserDO.java
  9. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java
  10. 30
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprisesuser/EnterprisesUserMapper.java
  11. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java
  12. 26
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java
  13. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java
  14. 1
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java
  15. 56
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserService.java
  16. 75
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserServiceImpl.java
  17. 3
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/qualification/EnterpriseQualificationServiceImpl.java
  18. 18
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/bigviewdata/BigViewDataMapper.xml
  19. 13
      yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml

30
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/BigViewDataController.java

@ -1,6 +1,9 @@
package cn.iocoder.yudao.module.system.controller.admin.bigviewdata;
import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.BigViewEnterpriseCountGroup;
import cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeCountResVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeGroupCountVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO;
import cn.iocoder.yudao.module.system.service.bigviewdata.BigViewDataService;
import cn.iocoder.yudao.module.system.service.home.HomeService;
@ -23,19 +26,36 @@ public class BigViewDataController {
@Resource
private BigViewDataService bigViewDataService;
@Resource
private HomeService homeService;
@GetMapping("/getLeftFist")
private List<String> leftFirst() {
return null;
@GetMapping("/getLeftFirst")
private HomeCountResVO leftFirst(HomeSelectVO homeSelectVO) {
return homeService.appCount1(homeSelectVO);
}
@GetMapping("/getLeftSecond ")
@GetMapping("/getLeftSecond")
private BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) {
return bigViewDataService.getLeftSecond(homeSelectVO);
}
@GetMapping("/getLeftThird")
private List<String> getLeftThird(HomeSelectVO homeSelectVO) {
private List<HomeGroupCountVO> getLeftThird(HomeSelectVO homeSelectVO) {
return bigViewDataService.getLeftThird(homeSelectVO);
}
@GetMapping("/getRightFist")
private List<HomeGroupCountVO> getRightFist(HomeSelectVO homeSelectVO) {
return bigViewDataService.getRightFist(homeSelectVO);
}
@GetMapping("/getRightSecond")
private List<StatusCountVO> getRightSecond(HomeSelectVO homeSelectVO) {
return bigViewDataService.getRightSecond(homeSelectVO);
}
@GetMapping("/getRightThird")
private List<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO) {
return bigViewDataService.getRightThird(homeSelectVO);
}
}

9
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java

@ -0,0 +1,9 @@
package cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo;
import lombok.Data;
@Data
public class StatusCountVO {
private Integer status;
private Integer count;
}

3
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseSaveReqVO.java

@ -45,7 +45,7 @@ public class EnterpriseSaveReqVO {
@Schema(description = "环保负责人姓名", example = "张三")
private String contactName;
@Schema(description = "企业环保负责人联系电话")
@Schema(description = "企业环保负责人联系电话", maxLength = 20)
private String environmentalContactPhone;
@Schema(description = "企业注册号")
@ -60,7 +60,6 @@ public class EnterpriseSaveReqVO {
@Schema(description = "企业经纬度")
private String gpsLocation;
@Schema(description = "签到半径")
private String signRadius;

94
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/EnterprisesUserController.java

@ -0,0 +1,94 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprisesuser;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
import cn.iocoder.yudao.module.system.controller.admin.enterprisesuser.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisesuser.EnterprisesUserDO;
import cn.iocoder.yudao.module.system.service.enterprisesuser.EnterprisesUserService;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
@Tag(name = "管理后台 - 环保员工与企业对照")
@RestController
@RequestMapping("/system/enterprises-user")
@Validated
public class EnterprisesUserController {
@Resource
private EnterprisesUserService enterprisesUserService;
@PostMapping("/create")
@Operation(summary = "创建环保员工与企业对照")
@PreAuthorize("@ss.hasPermission('system:enterprises-user:create')")
public CommonResult<Long> createEnterprisesUser(@Valid @RequestBody EnterprisesUserSaveReqVO createReqVO) {
return success(enterprisesUserService.createEnterprisesUser(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新环保员工与企业对照")
@PreAuthorize("@ss.hasPermission('system:enterprises-user:update')")
public CommonResult<Boolean> updateEnterprisesUser(@Valid @RequestBody EnterprisesUserSaveReqVO updateReqVO) {
enterprisesUserService.updateEnterprisesUser(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除环保员工与企业对照")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('system:enterprises-user:delete')")
public CommonResult<Boolean> deleteEnterprisesUser(@RequestParam("id") Long id) {
enterprisesUserService.deleteEnterprisesUser(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得环保员工与企业对照")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('system:enterprises-user:query')")
public CommonResult<EnterprisesUserRespVO> getEnterprisesUser(@RequestParam("id") Long id) {
EnterprisesUserDO enterprisesUser = enterprisesUserService.getEnterprisesUser(id);
return success(BeanUtils.toBean(enterprisesUser, EnterprisesUserRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得环保员工与企业对照分页")
@PreAuthorize("@ss.hasPermission('system:enterprises-user:query')")
public CommonResult<PageResult<EnterprisesUserRespVO>> getEnterprisesUserPage(@Valid EnterprisesUserPageReqVO pageReqVO) {
PageResult<EnterprisesUserDO> pageResult = enterprisesUserService.getEnterprisesUserPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, EnterprisesUserRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出环保员工与企业对照 Excel")
@PreAuthorize("@ss.hasPermission('system:enterprises-user:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportEnterprisesUserExcel(@Valid EnterprisesUserPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<EnterprisesUserDO> list = enterprisesUserService.getEnterprisesUserPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "环保员工与企业对照.xls", "数据", EnterprisesUserRespVO.class,
BeanUtils.toBean(list, EnterprisesUserRespVO.class));
}
}

34
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserPageReqVO.java

@ -0,0 +1,34 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprisesuser.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 环保员工与企业对照分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class EnterprisesUserPageReqVO extends PageParam {
@Schema(description = "用户id", example = "145")
private Long userId;
@Schema(description = "企业id", example = "24973")
private Long enterprisesId;
@Schema(description = "创建者")
private String creator;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "更新者")
private String updater;
}

39
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserRespVO.java

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprisesuser.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 环保员工与企业对照 Response VO")
@Data
@ExcelIgnoreUnannotated
public class EnterprisesUserRespVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29164")
@ExcelProperty("主键")
private Long id;
@Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "145")
@ExcelProperty("用户id")
private Long userId;
@Schema(description = "企业id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24973")
@ExcelProperty("企业id")
private Long enterprisesId;
@Schema(description = "创建者")
@ExcelProperty("创建者")
private String createBy;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "更新者")
@ExcelProperty("更新者")
private String updateBy;
}

30
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserSaveReqVO.java

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.system.controller.admin.enterprisesuser.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import javax.validation.constraints.NotNull;
import java.util.*;
@Schema(description = "管理后台 - 环保员工与企业对照新增/修改 Request VO")
@Data
public class EnterprisesUserSaveReqVO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "29164")
private Long id;
@Schema(description = "用户id", requiredMode = Schema.RequiredMode.REQUIRED, example = "145")
@NotNull(message = "用户id不能为空")
private Long userId;
@Schema(description = "企业id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24973")
@NotNull(message = "企业id不能为空")
private Long enterprisesId;
@Schema(description = "创建者")
private String createBy;
@Schema(description = "更新者")
private String updateBy;
}

39
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprisesuser/EnterprisesUserDO.java

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.system.dal.dataobject.enterprisesuser;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 环保员工与企业对照 DO
*
* @author 芋道源码
*/
@TableName("user_enterprises")
@KeySequence("user_enterprises_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class EnterprisesUserDO extends BaseDO {
/**
* 主键
*/
@TableId
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 企业id
*/
private Long enterprisesId;
}

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/bigviewdata/BigViewDataMapper.java

@ -1,6 +1,7 @@
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.bigviewdata.vo.StatusCountVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO;
import org.apache.ibatis.annotations.Mapper;
@ -8,7 +9,14 @@ import java.util.List;
@Mapper
public interface BigViewDataMapper {
/*
执法记录分组统计
*/
List<NameCountVO> enterpriseCountGroup(HomeSelectVO homeSelectVO);
/*
执法记录状态统计
*/
List<StatusCountVO> selectStatusCount(HomeSelectVO homeSelectVO);
}

30
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprisesuser/EnterprisesUserMapper.java

@ -0,0 +1,30 @@
package cn.iocoder.yudao.module.system.dal.mysql.enterprisesuser;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisesuser.EnterprisesUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.enterprisesuser.vo.*;
/**
* 环保员工与企业对照 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface EnterprisesUserMapper extends BaseMapperX<EnterprisesUserDO> {
default PageResult<EnterprisesUserDO> selectPage(EnterprisesUserPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<EnterprisesUserDO>()
.eqIfPresent(EnterprisesUserDO::getUserId, reqVO.getUserId())
.eqIfPresent(EnterprisesUserDO::getEnterprisesId, reqVO.getEnterprisesId())
.eqIfPresent(EnterprisesUserDO::getCreator, reqVO.getCreator())
.betweenIfPresent(EnterprisesUserDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(EnterprisesUserDO::getUpdater, reqVO.getUpdater())
.orderByDesc(EnterprisesUserDO::getId));
}
}

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataService.java

@ -1,6 +1,8 @@
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.StatusCountVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeGroupCountVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeSelectVO;
import java.util.List;
@ -8,5 +10,11 @@ import java.util.List;
public interface BigViewDataService {
BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO);
List<String> getLeftThird(HomeSelectVO homeSelectVO);
List<HomeGroupCountVO> getLeftThird(HomeSelectVO homeSelectVO);
List<HomeGroupCountVO> getRightFist(HomeSelectVO homeSelectVO);
List<StatusCountVO> getRightSecond(HomeSelectVO homeSelectVO);
List<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO);
}

26
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/bigviewdata/BigViewDataServiceImpl.java

@ -1,12 +1,11 @@
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.bigviewdata.vo.StatusCountVO;
import cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeGroupCountVO;
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 cn.iocoder.yudao.module.system.dal.mysql.taskinfo.TaskInfoMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@ -18,6 +17,8 @@ public class BigViewDataServiceImpl implements BigViewDataService {
@Resource
private BigViewDataMapper bigViewDataMapper;
@Resource
private TaskInfoMapper taskInfoMapper;
@Override
public BigViewEnterpriseCountGroup getLeftSecond(HomeSelectVO homeSelectVO) {
@ -37,7 +38,22 @@ public class BigViewDataServiceImpl implements BigViewDataService {
}
@Override
public List<String> getLeftThird(HomeSelectVO homeSelectVO) {
public List<HomeGroupCountVO> getLeftThird(HomeSelectVO homeSelectVO) {
return taskInfoMapper.selectHomeGroupCount(homeSelectVO);
}
@Override
public List<HomeGroupCountVO> getRightFist(HomeSelectVO homeSelectVO) {
return null;
}
@Override
public List<StatusCountVO> getRightSecond(HomeSelectVO homeSelectVO) {
return bigViewDataMapper.selectStatusCount(homeSelectVO);
}
@Override
public List<HomeGroupCountVO> getRightThird(HomeSelectVO homeSelectVO) {
return null;
}
}

10
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.system.service.enterprise;
import cn.iocoder.yudao.module.infra.api.file.FileApi;
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.enterprisesuser.EnterprisesUserDO;
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.permission.RoleDO;
@ -10,6 +11,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.permission.UserRoleDO;
import cn.iocoder.yudao.module.system.dal.dataobject.taskinfo.TaskInfoDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.enterpriseauditlog.EnterpriseAuditLogMapper;
import cn.iocoder.yudao.module.system.dal.mysql.enterprisesuser.EnterprisesUserMapper;
import cn.iocoder.yudao.module.system.dal.mysql.enterprisetag.EnterpriseTagMapper;
import cn.iocoder.yudao.module.system.dal.mysql.fileInfo.FileInfoMapper;
import cn.iocoder.yudao.module.system.dal.mysql.permission.RoleMapper;
@ -21,6 +23,7 @@ import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.tomcat.jni.FileInfo;
import org.checkerframework.checker.units.qual.A;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
@ -66,6 +69,8 @@ public class EnterpriseServiceImpl implements EnterpriseService {
private AdminUserService adminUserService;
@Resource
private AdminUserMapper adminUserMapper;
@Resource
private EnterprisesUserMapper enterprisesUserMapper;
//企业图片
public final static Long DEFAULT_DICT_DATA_QY = 1L;
@ -111,6 +116,11 @@ public class EnterpriseServiceImpl implements EnterpriseService {
user.setMobile(createReqVO.getEnvironmentalContactPhone());
adminUserMapper.updateById(user);
//用户与企业绑定
EnterprisesUserDO enterprisesUserDO = new EnterprisesUserDO();
enterprisesUserDO.setUserId(getLoginUserId());
enterprisesUserDO.setEnterprisesId(enterprise.getId());
enterprisesUserMapper.insert(enterprisesUserDO);
if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) {
for (Long fileId : createReqVO.getFileIds()) {

1
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java

@ -62,7 +62,6 @@ public interface EnterpriseInspectionsService {
*/
PageResult<EnterpriseInspectionsDO> getEnterpriseInspectionsPage(EnterpriseInspectionsPageReqVO pageReqVO);
List<EnterpriseInspectionsDO> getEnterpriseInspectionsList(EnterpriseInspectionsPageReqVO pageReqVO);
List<SelectUserChangeVO> changeSelectUser(Long deptId);

56
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserService.java

@ -0,0 +1,56 @@
package cn.iocoder.yudao.module.system.service.enterprisesuser;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.enterprisesuser.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisesuser.EnterprisesUserDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import javax.validation.Valid;
/**
* 环保员工与企业对照 Service 接口
*
* @author 芋道源码
*/
public interface EnterprisesUserService {
/**
* 创建环保员工与企业对照
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createEnterprisesUser(@Valid EnterprisesUserSaveReqVO createReqVO);
/**
* 更新环保员工与企业对照
*
* @param updateReqVO 更新信息
*/
void updateEnterprisesUser(@Valid EnterprisesUserSaveReqVO updateReqVO);
/**
* 删除环保员工与企业对照
*
* @param id 编号
*/
void deleteEnterprisesUser(Long id);
/**
* 获得环保员工与企业对照
*
* @param id 编号
* @return 环保员工与企业对照
*/
EnterprisesUserDO getEnterprisesUser(Long id);
/**
* 获得环保员工与企业对照分页
*
* @param pageReqVO 分页查询
* @return 环保员工与企业对照分页
*/
PageResult<EnterprisesUserDO> getEnterprisesUserPage(EnterprisesUserPageReqVO pageReqVO);
}

75
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserServiceImpl.java

@ -0,0 +1,75 @@
package cn.iocoder.yudao.module.system.service.enterprisesuser;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.module.system.controller.admin.enterprisesuser.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.enterprisesuser.EnterprisesUserDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.system.dal.mysql.enterprisesuser.EnterprisesUserMapper;
import javax.annotation.Resource;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
/**
* 环保员工与企业对照 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class EnterprisesUserServiceImpl implements EnterprisesUserService {
@Resource
private EnterprisesUserMapper enterprisesUserMapper;
@Override
public Long createEnterprisesUser(EnterprisesUserSaveReqVO createReqVO) {
// 插入
EnterprisesUserDO enterprisesUser = BeanUtils.toBean(createReqVO, EnterprisesUserDO.class);
enterprisesUserMapper.insert(enterprisesUser);
// 返回
return enterprisesUser.getId();
}
@Override
public void updateEnterprisesUser(EnterprisesUserSaveReqVO updateReqVO) {
// 校验存在
validateEnterprisesUserExists(updateReqVO.getId());
// 更新
EnterprisesUserDO updateObj = BeanUtils.toBean(updateReqVO, EnterprisesUserDO.class);
enterprisesUserMapper.updateById(updateObj);
}
@Override
public void deleteEnterprisesUser(Long id) {
// 校验存在
validateEnterprisesUserExists(id);
// 删除
enterprisesUserMapper.deleteById(id);
}
private void validateEnterprisesUserExists(Long id) {
if (enterprisesUserMapper.selectById(id) == null) {
throw exception(ENTERPRISE_EXISTS);
}
}
@Override
public EnterprisesUserDO getEnterprisesUser(Long id) {
return enterprisesUserMapper.selectById(id);
}
@Override
public PageResult<EnterprisesUserDO> getEnterprisesUserPage(EnterprisesUserPageReqVO pageReqVO) {
return enterprisesUserMapper.selectPage(pageReqVO);
}
}

3
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/qualification/EnterpriseQualificationServiceImpl.java

@ -46,6 +46,7 @@ public class EnterpriseQualificationServiceImpl implements EnterpriseQualificati
@Override
public Long createEnterpriseQualification(EnterpriseQualificationSaveReqVO createReqVO) {
// 插入
createReqVO.setEnterpriseAuth(createReqVO.getEnterpriseAuth().toUpperCase());
EnterpriseQualificationDO enterpriseQualification = BeanUtils.toBean(createReqVO, EnterpriseQualificationDO.class);
enterpriseQualificationMapper.insert(enterpriseQualification);
@ -98,4 +99,4 @@ public class EnterpriseQualificationServiceImpl implements EnterpriseQualificati
return enterpriseQualificationMapper.selectPage(pageReqVO);
}
}
}

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

@ -21,4 +21,22 @@
group by
e.department_id
</select>
<select id="selectStatusCount"
resultType="cn.iocoder.yudao.module.system.controller.admin.bigviewdata.vo.StatusCountVO">
SELECT
status,
COUNT(*) AS count
FROM (
SELECT il.*
FROM inspections_log il
JOIN (
SELECT inspections_id, MAX(create_time) AS max_create_time
FROM inspections_log
GROUP BY inspections_id
) AS latest
ON il.inspections_id = latest.inspections_id
AND il.create_time = latest.max_create_time
) AS latest_records
GROUP BY status;
</select>
</mapper>

13
yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml

@ -58,7 +58,7 @@
ORDER BY t.create_time DESC
</select>
<select id="selectHomeGroupCount" resultType="cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeGroupCountVO">
<select id="selectHomeGroupCount" resultType="cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeGroupCountVO">
SELECT
<if test="deptId != null and deptId != ''">
su.`real_name` as name,
@ -99,8 +99,7 @@
</if>
</select>
<select id="selectEnterpriseNum"
resultType="cn.iocoder.yudao.module.system.controller.admin.home.vo.EnterpriseNumVO">
<select id="selectEnterpriseNum" resultType="cn.iocoder.yudao.module.system.controller.admin.home.vo.EnterpriseNumVO">
select
DATEDIFF(NOW(),eq.expiry_date) AS count,
e.enterprises_name as name
@ -124,8 +123,7 @@
ORDER BY count DESC;
</select>
<select id="selectEnterpriseStatus"
resultType="cn.iocoder.yudao.module.system.controller.admin.home.vo.EnterpriseNumVO">
<select id="selectEnterpriseStatus" resultType="cn.iocoder.yudao.module.system.controller.admin.home.vo.EnterpriseNumVO">
SELECT
DISTINCT e.enterprises_name as name,
sum(CASE WHEN il.status=3 THEN 1 ELSE 0 END) as count
@ -147,8 +145,8 @@
</where>
GROUP BY ei.id order by count desc;
</select>
<select id="selectHomeExecFinish"
resultType="cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeExecFinishVO">
<select id="selectHomeExecFinish" resultType="cn.iocoder.yudao.module.system.controller.admin.home.vo.HomeExecFinishVO">
SELECT
count( DISTINCT ei.id) as execCount,
SUM(CASE WHEN il.status = 2 THEN 1 ELSE 0 END) AS finishCount
@ -170,7 +168,6 @@
</foreach>
</if>
GROUP By t.id
</select>
</mapper>

Loading…
Cancel
Save