diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingEmployeeInfoController.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingEmployeeInfoController.java deleted file mode 100644 index 46358ef..0000000 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingEmployeeInfoController.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.ningdatech.pmapi.organization.controller; - - -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.stereotype.Controller; - -/** - *

- * 前端控制器 - *

- * - * @author Lierbao - * @since 2023-02-11 - */ -@Controller -@RequestMapping("/pmapi.organization/ding-employee-info") -public class DingEmployeeInfoController { - -} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java index 2ce1a10..f16e421 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/DingOrganizationController.java @@ -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; /** *

@@ -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 organizationList(@Valid @RequestBody ReqOrganizationListPO reqOrganizationListPO) { + return organizationManage.organizationList(reqOrganizationListPO); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java index 2ed8f47..94cb5f5 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/controller/OrganizationProcdefController.java @@ -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 "禁用成功"; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java index 24b7171..69e314a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/manage/OrganizationManage.java @@ -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 organizationList(ReqOrganizationListPO reqOrganizationListPO) { + String orgName = reqOrganizationListPO.getOrgName(); + + Page 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 records = page.getRecords(); + + List 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 pageVo = new PageVo<>(); + pageVo.setTotal(total); + pageVo.setRecords(resVOList); + return pageVo; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqOrganizationListPO.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqOrganizationListPO.java new file mode 100644 index 0000000..b0a4e43 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/po/ReqOrganizationListPO.java @@ -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; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/ResOrganizationListVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/ResOrganizationListVO.java new file mode 100644 index 0000000..89007ef --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/organization/model/vo/ResOrganizationListVO.java @@ -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; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java index 683d334..e12d07e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/controller/UserInfoController.java @@ -55,4 +55,10 @@ public class UserInfoController { userInfoManage.userInfoDetailEdit(reqUserDetailEditPO); } + @ApiOperation(value = "获取当前登陆用户详情信息", notes = "用户详情") + @PostMapping("/current-user-info") + public ResUserDetailVO currentUserInfo() { + return userInfoManage.currentUserInfo(); + } + } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java index 78cd657..31caf14 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java @@ -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; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java index 7b65b6a..f5badb4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/model/vo/ResUserDetailVO.java @@ -17,6 +17,9 @@ public class ResUserDetailVO { @ApiModelProperty("userId") private Long userId; + @ApiModelProperty("用户姓名") + private String realName; + @ApiModelProperty("手机号") private String phoneNo;