diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java index 79b4ce8..5165da1 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java @@ -85,6 +85,13 @@ public class EnterpriseController { return success(enterpriseService.createEnterprise(createReqVO)); } + @PostMapping("/pccreate") + @Operation(summary = "PC端创建企业") +// @PreAuthorize("@ss.hasPermission('system:enterprise:create')") + public CommonResult pccreateEnterprise(@RequestBody EnterpriseSaveReqVO createReqVO) { + return success(enterpriseService.pccreateEnterprise(createReqVO)); + } + @PutMapping("/update") @Operation(summary = "更新企业") // @PreAuthorize("@ss.hasPermission('system:enterprise:update')") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java index bc7c1f1..24f3fa6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java @@ -39,6 +39,10 @@ public class EnterprisePageReqVO extends PageParam { @Schema(description = "企业地址") private String address; + @Schema(description = "企业状态") + private Long enterprisesStatus; + + @Schema(description = "环保负责人姓名", example = "张三") private String contactName; @@ -58,6 +62,9 @@ public class EnterprisePageReqVO extends PageParam { @Schema(description = "企业经纬度") private String gpsLocation; + @Schema(description = "签到半径") + private String signRadius; + @Schema(description = "创建人") private String create; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java index 34b0106..13e3a2d 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java @@ -44,6 +44,12 @@ public class EnterpriseRespVO { @ExcelProperty("企业地址") private String address; + + @Schema(description = "企业状态") + @ExcelProperty("企业状态") + private Long enterprisesStatus; + + @Schema(description = "环保负责人姓名", example = "张三") @ExcelProperty("环保负责人姓名") private String contactName; @@ -68,6 +74,10 @@ public class EnterpriseRespVO { @ExcelProperty("企业经纬度") private String gpsLocation; + @Schema(description = "签到半径") + @ExcelProperty("签到半径") + private String signRadius; + @Schema(description = "创建人") @ExcelProperty("创建人") private String createBy; 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 94374e7..eb2c43b 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 @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.system.controller.admin.enterprise.vo; +import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; @@ -34,6 +35,10 @@ public class EnterpriseSaveReqVO { @Schema(description = "企业地址") private String address; + @Schema(description = "企业状态") + private Long enterprisesStatus; + + @Schema(description = "环保负责人姓名", example = "张三") private String contactName; @@ -52,6 +57,10 @@ public class EnterpriseSaveReqVO { @Schema(description = "企业经纬度") private String gpsLocation; + + @Schema(description = "签到半径") + private String signRadius; + @Schema(description = "创建人") private String createBy; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java index fbbfa10..f559924 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java @@ -122,6 +122,22 @@ public class UserController { pageResult.getTotal())); } + + @GetMapping("/pcpage") + @Operation(summary = "获得用户分页列表") + public CommonResult> getPcUserPage(@Valid UserPageReqVO pageReqVO) { + // 获得用户分页列表 + PageResult pageResult = userService.getUserPage(pageReqVO); + if (CollUtil.isEmpty(pageResult.getList())) { + return success(new PageResult<>(pageResult.getTotal())); + } + // 拼接数据 + Map deptMap = deptService.getDeptMap( + convertList(pageResult.getList(), AdminUserDO::getDeptId)); + return success(new PageResult<>(UserConvert.INSTANCE.convertList(pageResult.getList(), deptMap), + pageResult.getTotal())); + } + @GetMapping({"/list-all-simple", "/simple-list"}) @Operation(summary = "获取用户精简信息列表", description = "只包含被开启的用户,主要用于前端的下拉选项") public CommonResult> getSimpleUserList() { diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java index bd3d76f..b14d2a6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java @@ -55,6 +55,11 @@ public class EnterpriseDO extends BaseDO { * 企业地址 */ private String address; + + /** + * 企业状态 + */ + private Long enterprisesStatus ; /** * 环保负责人姓名 */ @@ -79,6 +84,11 @@ public class EnterpriseDO extends BaseDO { * 企业经纬度 */ private String gpsLocation; + /** + * 签到半径 + */ + private String signRadius; + // /** // * 管理部门 diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java index 0db6b1d..6b6757b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java @@ -28,6 +28,7 @@ public interface EnterpriseMapper extends BaseMapperX { .eqIfPresent(EnterpriseDO::getRegion, reqVO.getRegion()) .likeIfPresent(EnterpriseDO::getEnterprisesName, reqVO.getEnterprisesName()) .eqIfPresent(EnterpriseDO::getAddress, reqVO.getAddress()) + .eqIfPresent(EnterpriseDO::getEnterprisesStatus, reqVO.getEnterprisesStatus()) .likeIfPresent(EnterpriseDO::getContactName, reqVO.getContactName()) .eqIfPresent(EnterpriseDO::getEnvironmentalContactPhone, reqVO.getEnvironmentalContactPhone()) .eqIfPresent(EnterpriseDO::getRegistrationNumber, reqVO.getRegistrationNumber()) @@ -52,6 +53,7 @@ public interface EnterpriseMapper extends BaseMapperX { .eqIfPresent(EnterpriseDO::getRegion, reqVO.getRegion()) .likeIfPresent(EnterpriseDO::getEnterprisesName, reqVO.getEnterprisesName()) .eqIfPresent(EnterpriseDO::getAddress, reqVO.getAddress()) + .eqIfPresent(EnterpriseDO::getEnterprisesStatus, reqVO.getEnterprisesStatus()) .likeIfPresent(EnterpriseDO::getContactName, reqVO.getContactName()) .eqIfPresent(EnterpriseDO::getEnvironmentalContactPhone, reqVO.getEnvironmentalContactPhone()) .eqIfPresent(EnterpriseDO::getRegistrationNumber, reqVO.getRegistrationNumber()) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java index db3951f..c747a68 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java @@ -23,6 +23,15 @@ public interface EnterpriseService { */ Long createEnterprise(EnterpriseSaveReqVO createReqVO); + /** + * PC创建企业 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long pccreateEnterprise(EnterpriseSaveReqVO createReqVO); + + /** * 更新企业 * 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 26d9f0f..0143068 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 @@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.system.dal.dataobject.enterprisetag.EnterpriseTag import cn.iocoder.yudao.module.system.dal.dataobject.fileInfo.FileInfoDO; import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; 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.enterprisetag.EnterpriseTagMapper; @@ -104,6 +105,29 @@ public class EnterpriseServiceImpl implements EnterpriseService { return enterprise.getId(); } + + + @Override + @Transactional + public Long pccreateEnterprise(EnterpriseSaveReqVO createReqVO) { + EnterpriseDO enterprise = BeanUtils.toBean(createReqVO, EnterpriseDO.class); + enterprise.setDepartmentId(1L); + enterpriseMapper.insert(enterprise); + if (createReqVO.getFileIds() != null && createReqVO.getFileIds().length > 0) { + for (Long fileId : createReqVO.getFileIds()) { + FileInfoDO fileInfoDO = new FileInfoDO(); + fileInfoDO.setDictData(1l); //文件类型 + fileInfoDO.setDictType(644l); + fileInfoDO.setUnitId(enterprise.getId().toString()); + fileInfoDO.setInfraFileId(fileId); + fileInfoMapper.insert(fileInfoDO); + } + } + // 返回 + return enterprise.getId(); + } + + @Override public void updateEnterprise(EnterpriseSaveReqVO updateReqVO) { // 校验存在