Browse Source

企业添加字段+PC端接口

master
zy 2 months ago
parent
commit
fdb7095a4d
  1. 7
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/EnterpriseController.java
  2. 7
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterprisePageReqVO.java
  3. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseRespVO.java
  4. 9
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/enterprise/vo/EnterpriseSaveReqVO.java
  5. 16
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java
  6. 10
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/enterprise/EnterpriseDO.java
  7. 2
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/enterprise/EnterpriseMapper.java
  8. 9
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseService.java
  9. 24
      yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/enterprise/EnterpriseServiceImpl.java

7
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<Long> pccreateEnterprise(@RequestBody EnterpriseSaveReqVO createReqVO) {
return success(enterpriseService.pccreateEnterprise(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新企业")
// @PreAuthorize("@ss.hasPermission('system:enterprise:update')")

7
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;

10
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;

9
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;

16
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<PageResult<UserRespVO>> getPcUserPage(@Valid UserPageReqVO pageReqVO) {
// 获得用户分页列表
PageResult<AdminUserDO> pageResult = userService.getUserPage(pageReqVO);
if (CollUtil.isEmpty(pageResult.getList())) {
return success(new PageResult<>(pageResult.getTotal()));
}
// 拼接数据
Map<Long, DeptDO> 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<List<UserSimpleRespVO>> getSimpleUserList() {

10
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;
// /**
// * 管理部门

2
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<EnterpriseDO> {
.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<EnterpriseDO> {
.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())

9
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);
/**
* 更新企业
*

24
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) {
// 校验存在

Loading…
Cancel
Save