From 46a11a92b7f7734804dc57ac3e13146c0f4411d7 Mon Sep 17 00:00:00 2001 From: dx <1242347652@qq.com> Date: Fri, 21 Feb 2025 17:14:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=A4=A7=E5=B1=8F=E7=BB=93?= =?UTF-8?q?=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bigviewdata/BigViewDataController.java | 28 +++++- .../admin/bigviewdata/vo/StatusCountVO.java | 9 ++ .../enterprise/vo/EnterpriseSaveReqVO.java | 3 +- .../EnterprisesUserController.java | 94 +++++++++++++++++++ .../vo/EnterprisesUserPageReqVO.java | 34 +++++++ .../vo/EnterprisesUserRespVO.java | 39 ++++++++ .../vo/EnterprisesUserSaveReqVO.java | 30 ++++++ .../enterprisesuser/EnterprisesUserDO.java | 39 ++++++++ .../mysql/bigviewdata/BigViewDataMapper.java | 10 +- .../EnterprisesUserMapper.java | 30 ++++++ .../bigviewdata/BigViewDataService.java | 10 +- .../bigviewdata/BigViewDataServiceImpl.java | 26 ++++- .../enterprise/EnterpriseServiceImpl.java | 10 ++ .../EnterpriseInspectionsService.java | 1 - .../EnterprisesUserService.java | 56 +++++++++++ .../EnterprisesUserServiceImpl.java | 75 +++++++++++++++ .../EnterpriseQualificationServiceImpl.java | 3 +- .../mapper/bigviewdata/BigViewDataMapper.xml | 18 ++++ .../mapper/taskinfo/TaskInfoMapper.xml | 13 +-- 19 files changed, 505 insertions(+), 23 deletions(-) create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/EnterprisesUserController.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserPageReqVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserRespVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserSaveReqVO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprisesuser/EnterprisesUserDO.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprisesuser/EnterprisesUserMapper.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserService.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserServiceImpl.java 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 f8bcd48..e6a628e 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 @@ -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 leftFirst() { - return null; + 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 getLeftThird(HomeSelectVO homeSelectVO) { + private List getLeftThird(HomeSelectVO homeSelectVO) { return bigViewDataService.getLeftThird(homeSelectVO); } + + @GetMapping("/getRightFist") + private List getRightFist(HomeSelectVO homeSelectVO) { + return bigViewDataService.getRightFist(homeSelectVO); + } + + @GetMapping("/getRightSecond") + private List getRightSecond(HomeSelectVO homeSelectVO) { + return bigViewDataService.getRightSecond(homeSelectVO); + } + + @GetMapping("/getRightThird") + private List getRightThird(HomeSelectVO homeSelectVO) { + return bigViewDataService.getRightThird(homeSelectVO); + } } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/bigviewdata/vo/StatusCountVO.java new file mode 100644 index 0000000..0b6a796 --- /dev/null +++ b/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; +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseSaveReqVO.java index 868963a..abec0a9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseSaveReqVO.java +++ b/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; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/EnterprisesUserController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/EnterprisesUserController.java new file mode 100644 index 0000000..11c7156 --- /dev/null +++ b/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 createEnterprisesUser(@Valid @RequestBody EnterprisesUserSaveReqVO createReqVO) { + return success(enterprisesUserService.createEnterprisesUser(createReqVO)); + } + + @PutMapping("/update") + @Operation(summary = "更新环保员工与企业对照") + @PreAuthorize("@ss.hasPermission('system:enterprises-user:update')") + public CommonResult 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 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 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> getEnterprisesUserPage(@Valid EnterprisesUserPageReqVO pageReqVO) { + PageResult 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 list = enterprisesUserService.getEnterprisesUserPage(pageReqVO).getList(); + // 导出 Excel + ExcelUtils.write(response, "环保员工与企业对照.xls", "数据", EnterprisesUserRespVO.class, + BeanUtils.toBean(list, EnterprisesUserRespVO.class)); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserPageReqVO.java new file mode 100644 index 0000000..9474228 --- /dev/null +++ b/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; + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserRespVO.java new file mode 100644 index 0000000..38d11e6 --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprisesuser/vo/EnterprisesUserSaveReqVO.java new file mode 100644 index 0000000..f5badda --- /dev/null +++ b/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; + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprisesuser/EnterprisesUserDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprisesuser/EnterprisesUserDO.java new file mode 100644 index 0000000..317c56d --- /dev/null +++ b/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; + +} 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 index 9b45e61..7bf7f77 100644 --- 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 @@ -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 enterpriseCountGroup(HomeSelectVO homeSelectVO); + /* + 执法记录状态统计 + */ + List selectStatusCount(HomeSelectVO homeSelectVO); + } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprisesuser/EnterprisesUserMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprisesuser/EnterprisesUserMapper.java new file mode 100644 index 0000000..0139638 --- /dev/null +++ b/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 { + + default PageResult selectPage(EnterprisesUserPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .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)); + } + +} 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 48ca4ad..4123ff1 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 @@ -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 getLeftThird(HomeSelectVO homeSelectVO); + List getLeftThird(HomeSelectVO homeSelectVO); + + List getRightFist(HomeSelectVO homeSelectVO); + + List getRightSecond(HomeSelectVO homeSelectVO); + + List getRightThird(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 e196c31..599f148 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,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 getLeftThird(HomeSelectVO homeSelectVO) { + public List getLeftThird(HomeSelectVO homeSelectVO) { + return taskInfoMapper.selectHomeGroupCount(homeSelectVO); + } + + @Override + public List getRightFist(HomeSelectVO homeSelectVO) { + return null; + } + + @Override + public List getRightSecond(HomeSelectVO homeSelectVO) { + return bigViewDataMapper.selectStatusCount(homeSelectVO); + } + + @Override + public List getRightThird(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 6d3f713..7a3f9c0 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 @@ -2,6 +2,7 @@ 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.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; @@ -9,6 +10,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; @@ -20,6 +22,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; @@ -65,6 +68,8 @@ public class EnterpriseServiceImpl implements EnterpriseService { private AdminUserService adminUserService; @Resource private AdminUserMapper adminUserMapper; + @Resource + private EnterprisesUserMapper enterprisesUserMapper; @Override @Transactional @@ -105,6 +110,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()) { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java index 9f06899..50b64ab 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterpriseinspections/EnterpriseInspectionsService.java +++ b/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 getEnterpriseInspectionsPage(EnterpriseInspectionsPageReqVO pageReqVO); - List getEnterpriseInspectionsList(EnterpriseInspectionsPageReqVO pageReqVO); List changeSelectUser(Long deptId); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserService.java new file mode 100644 index 0000000..3096b3b --- /dev/null +++ b/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 getEnterprisesUserPage(EnterprisesUserPageReqVO pageReqVO); + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprisesuser/EnterprisesUserServiceImpl.java new file mode 100644 index 0000000..d524d31 --- /dev/null +++ b/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 getEnterprisesUserPage(EnterprisesUserPageReqVO pageReqVO) { + return enterprisesUserMapper.selectPage(pageReqVO); + } + +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/qualification/EnterpriseQualificationServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/qualification/EnterpriseQualificationServiceImpl.java index e760b63..4b6242c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/qualification/EnterpriseQualificationServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/qualification/EnterpriseQualificationServiceImpl.java @@ -34,6 +34,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); // 返回 @@ -73,4 +74,4 @@ public class EnterpriseQualificationServiceImpl implements EnterpriseQualificati return enterpriseQualificationMapper.selectPage(pageReqVO); } -} \ No newline at end of file +} 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 index c4eb26c..6b5a24c 100644 --- 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 @@ -21,4 +21,22 @@ group by e.department_id + diff --git a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml b/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml index 13641d8..0ed6499 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/resources/mapper/taskinfo/TaskInfoMapper.xml +++ b/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 su.`real_name` as name, @@ -99,8 +99,7 @@ - select DATEDIFF(NOW(),eq.expiry_date) AS count, e.enterprises_name as name @@ -124,8 +123,7 @@ ORDER BY count DESC; - SELECT DISTINCT e.enterprises_name as name, sum(CASE WHEN il.status=3 THEN 1 ELSE 0 END) as count @@ -147,8 +145,8 @@ GROUP BY ei.id order by count desc; - SELECT count( DISTINCT ei.id) as execCount, SUM(CASE WHEN il.status = 2 THEN 1 ELSE 0 END) AS finishCount @@ -170,7 +168,6 @@ GROUP By t.id -