Browse Source

单位管理相关接口

master
liuxinxin 1 year ago
parent
commit
172bfdb9d3
9 changed files with 152 additions and 25 deletions
  1. +0
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingEmployeeInfoController.java
  2. +26
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java
  3. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java
  4. +41
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java
  5. +31
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqOrganizationListPO.java
  6. +38
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/ResOrganizationListVO.java
  7. +6
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java
  8. +5
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java
  9. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java

+ 0
- 20
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingEmployeeInfoController.java View File

@@ -1,20 +0,0 @@
package com.ningdatech.pmapi.organization.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author Lierbao
* @since 2023-02-11
*/
@Controller
@RequestMapping("/pmapi.organization/ding-employee-info")
public class DingEmployeeInfoController {

}

+ 26
- 1
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java View File

@@ -1,10 +1,22 @@
package com.ningdatech.pmapi.organization.controller;


import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.organization.manage.OrganizationManage;
import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO;
import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
* <p>
@@ -14,14 +26,27 @@ import org.springframework.web.bind.annotation.RequestMapping;
* @author Lierbao
* @since 2023-02-09
*/
@Controller

@Slf4j
@Validated
@RestController
@RequiredArgsConstructor
@Api(value = "DingOrganizationController", tags = "单位管理")
@RequestMapping("/api/v1/organization")
public class DingOrganizationController {

private final OrganizationManage organizationManage;

@ApiModelProperty("单位成员配置")
@PostMapping("/member/config")
public void organizationManage() {

}

@ApiModelProperty("单位列表筛选")
@PostMapping("/list")
public PageVo<ResOrganizationListVO> organizationList(@Valid @RequestBody ReqOrganizationListPO reqOrganizationListPO) {
return organizationManage.organizationList(reqOrganizationListPO);
}

}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java View File

@@ -57,14 +57,14 @@ public class OrganizationProcdefController {
@ApiOperation(value = "单位流程配置启用", notes = "单位流程配置启用")
@PutMapping("/enable/{processDefId}")
public String enableProcess(@PathVariable String processDefId) {
orgProcessModelService.enableProcess(processDefId,Boolean.FALSE);
orgProcessModelService.enableProcess(processDefId, Boolean.FALSE);
return "启用成功";
}

@ApiOperation(value = "单位流程配置禁用", notes = "单位流程配置禁用")
@PutMapping("/disable/{processDefId}")
public String disableProcess(@PathVariable String processDefId) {
orgProcessModelService.enableProcess(processDefId,Boolean.TRUE);
orgProcessModelService.enableProcess(processDefId, Boolean.TRUE);
return "禁用成功";
}



+ 41
- 1
pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java View File

@@ -1,8 +1,21 @@
package com.ningdatech.pmapi.organization.manage;

import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.model.po.ReqOrganizationListPO;
import com.ningdatech.pmapi.organization.model.vo.ResOrganizationListVO;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
* @author liuxinxin
* @date 2023/1/13 下午2:55
@@ -11,7 +24,34 @@ import org.springframework.stereotype.Component;
@RequiredArgsConstructor
public class OrganizationManage {

// private final
private final IDingOrganizationService iDingOrganizationService;

public PageVo<ResOrganizationListVO> organizationList(ReqOrganizationListPO reqOrganizationListPO) {
String orgName = reqOrganizationListPO.getOrgName();

Page<DingOrganization> page = iDingOrganizationService
.page(new Page<>(reqOrganizationListPO.getPageNumber(), reqOrganizationListPO.getPageSize())
, Wrappers.lambdaQuery(DingOrganization.class)
.like(StringUtils.isNotBlank(orgName), DingOrganization::getOrganizationName, orgName));

long total = page.getTotal();
List<DingOrganization> records = page.getRecords();

List<ResOrganizationListVO> resVOList = new ArrayList<>();
if (CollUtil.isNotEmpty(records)) {
resVOList = records.stream().map(r -> {
ResOrganizationListVO resOrganizationListVO = new ResOrganizationListVO();
resOrganizationListVO.setOrgCode(r.getOrganizationCode());
resOrganizationListVO.setOrgName(r.getOrganizationName());
// TODO 补充其他字段
return resOrganizationListVO;
}).collect(Collectors.toList());
}

PageVo<ResOrganizationListVO> pageVo = new PageVo<>();
pageVo.setTotal(total);
pageVo.setRecords(resVOList);
return pageVo;
}

}

+ 31
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqOrganizationListPO.java View File

@@ -0,0 +1,31 @@
package com.ningdatech.pmapi.organization.model.po;

import com.ningdatech.basic.model.PagePo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @author liuxinxin
* @date 2023/2/16 上午11:50
*/
@Data
@ApiModel("组织列表 请求PO")
public class ReqOrganizationListPO extends PagePo {

@ApiModelProperty("单位名称")
private String orgName;

@ApiModelProperty("浙政钉编码")
private String orgCode;

@ApiModelProperty("所属区域id")
private String regionId;

@ApiModelProperty("是否为主管单位")
private Boolean isCompetentUnit;

@ApiModelProperty("是否为上级条线主管单位")
private Boolean isSuperiorLineCompetentUnit;

}

+ 38
- 0
pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/ResOrganizationListVO.java View File

@@ -0,0 +1,38 @@
package com.ningdatech.pmapi.organization.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @author liuxinxin
* @date 2023/2/16 上午11:50
*/
@Data
@ApiModel("组织列表VO")
public class ResOrganizationListVO {

public String id;

@ApiModelProperty("单位名称")
private String orgName;

@ApiModelProperty("浙政钉编码")
private String orgCode;

@ApiModelProperty("财政编码")
private String fiscalCode;

@ApiModelProperty("所属区域id")
private String regionId;

@ApiModelProperty("所属区域")
private String regionName;

@ApiModelProperty("是否为主管单位")
private Boolean isCompetentUnit;

@ApiModelProperty("是否为上级条线主管单位")
private Boolean isSuperiorLineCompetentUnit;

}

+ 6
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java View File

@@ -55,4 +55,10 @@ public class UserInfoController {
userInfoManage.userInfoDetailEdit(reqUserDetailEditPO);
}

@ApiOperation(value = "获取当前登陆用户详情信息", notes = "用户详情")
@PostMapping("/current-user-info")
public ResUserDetailVO currentUserInfo() {
return userInfoManage.currentUserInfo();
}

}

+ 5
- 1
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -93,7 +93,7 @@ public class UserInfoManage {
return null;
}
ResUserDetailVO resUserDetailVO = new ResUserDetailVO();
resUserDetailVO.setRealName(userInfo.getRealName());
resUserDetailVO.setUserId(userInfo.getId());
resUserDetailVO.setPhoneNo(userInfo.getMobile());
resUserDetailVO.setStatus(userInfo.getAvailable());
@@ -141,6 +141,7 @@ public class UserInfoManage {
.accountId(dingEmployeeInfo.getAccountId())
.username(dingEmployeeInfo.getEmployeeName())
.realName(dingEmployeeInfo.getEmployeeName())
.employeeCode(dingEmployeeInfo.getEmployeeCode())
.available(UserAvailableEnum.DISABLE.name())
.createBy(-1L)
.updateBy(-1L)
@@ -153,4 +154,7 @@ public class UserInfoManage {
}


public ResUserDetailVO currentUserInfo() {
return null;
}
}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java View File

@@ -17,6 +17,9 @@ public class ResUserDetailVO {
@ApiModelProperty("userId")
private Long userId;

@ApiModelProperty("用户姓名")
private String realName;

@ApiModelProperty("手机号")
private String phoneNo;



Loading…
Cancel
Save