@@ -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 { | |||||
} |
@@ -1,10 +1,22 @@ | |||||
package com.ningdatech.pmapi.organization.controller; | 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 io.swagger.annotations.ApiModelProperty; | ||||
import lombok.RequiredArgsConstructor; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.stereotype.Controller; | import org.springframework.stereotype.Controller; | ||||
import org.springframework.validation.annotation.Validated; | |||||
import org.springframework.web.bind.annotation.PostMapping; | 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.RequestMapping; | ||||
import org.springframework.web.bind.annotation.RestController; | |||||
import javax.validation.Valid; | |||||
/** | /** | ||||
* <p> | * <p> | ||||
@@ -14,14 +26,27 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||||
* @author Lierbao | * @author Lierbao | ||||
* @since 2023-02-09 | * @since 2023-02-09 | ||||
*/ | */ | ||||
@Controller | |||||
@Slf4j | |||||
@Validated | |||||
@RestController | |||||
@RequiredArgsConstructor | |||||
@Api(value = "DingOrganizationController", tags = "单位管理") | |||||
@RequestMapping("/api/v1/organization") | @RequestMapping("/api/v1/organization") | ||||
public class DingOrganizationController { | public class DingOrganizationController { | ||||
private final OrganizationManage organizationManage; | |||||
@ApiModelProperty("单位成员配置") | @ApiModelProperty("单位成员配置") | ||||
@PostMapping("/member/config") | @PostMapping("/member/config") | ||||
public void organizationManage() { | public void organizationManage() { | ||||
} | } | ||||
@ApiModelProperty("单位列表筛选") | |||||
@PostMapping("/list") | |||||
public PageVo<ResOrganizationListVO> organizationList(@Valid @RequestBody ReqOrganizationListPO reqOrganizationListPO) { | |||||
return organizationManage.organizationList(reqOrganizationListPO); | |||||
} | |||||
} | } |
@@ -57,14 +57,14 @@ public class OrganizationProcdefController { | |||||
@ApiOperation(value = "单位流程配置启用", notes = "单位流程配置启用") | @ApiOperation(value = "单位流程配置启用", notes = "单位流程配置启用") | ||||
@PutMapping("/enable/{processDefId}") | @PutMapping("/enable/{processDefId}") | ||||
public String enableProcess(@PathVariable String processDefId) { | public String enableProcess(@PathVariable String processDefId) { | ||||
orgProcessModelService.enableProcess(processDefId,Boolean.FALSE); | |||||
orgProcessModelService.enableProcess(processDefId, Boolean.FALSE); | |||||
return "启用成功"; | return "启用成功"; | ||||
} | } | ||||
@ApiOperation(value = "单位流程配置禁用", notes = "单位流程配置禁用") | @ApiOperation(value = "单位流程配置禁用", notes = "单位流程配置禁用") | ||||
@PutMapping("/disable/{processDefId}") | @PutMapping("/disable/{processDefId}") | ||||
public String disableProcess(@PathVariable String processDefId) { | public String disableProcess(@PathVariable String processDefId) { | ||||
orgProcessModelService.enableProcess(processDefId,Boolean.TRUE); | |||||
orgProcessModelService.enableProcess(processDefId, Boolean.TRUE); | |||||
return "禁用成功"; | return "禁用成功"; | ||||
} | } | ||||
@@ -1,8 +1,21 @@ | |||||
package com.ningdatech.pmapi.organization.manage; | 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 lombok.RequiredArgsConstructor; | ||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import java.util.stream.Collectors; | |||||
/** | /** | ||||
* @author liuxinxin | * @author liuxinxin | ||||
* @date 2023/1/13 下午2:55 | * @date 2023/1/13 下午2:55 | ||||
@@ -11,7 +24,34 @@ import org.springframework.stereotype.Component; | |||||
@RequiredArgsConstructor | @RequiredArgsConstructor | ||||
public class OrganizationManage { | 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; | |||||
} | |||||
} | } |
@@ -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; | |||||
} |
@@ -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; | |||||
} |
@@ -55,4 +55,10 @@ public class UserInfoController { | |||||
userInfoManage.userInfoDetailEdit(reqUserDetailEditPO); | userInfoManage.userInfoDetailEdit(reqUserDetailEditPO); | ||||
} | } | ||||
@ApiOperation(value = "获取当前登陆用户详情信息", notes = "用户详情") | |||||
@PostMapping("/current-user-info") | |||||
public ResUserDetailVO currentUserInfo() { | |||||
return userInfoManage.currentUserInfo(); | |||||
} | |||||
} | } |
@@ -93,7 +93,7 @@ public class UserInfoManage { | |||||
return null; | return null; | ||||
} | } | ||||
ResUserDetailVO resUserDetailVO = new ResUserDetailVO(); | ResUserDetailVO resUserDetailVO = new ResUserDetailVO(); | ||||
resUserDetailVO.setRealName(userInfo.getRealName()); | |||||
resUserDetailVO.setUserId(userInfo.getId()); | resUserDetailVO.setUserId(userInfo.getId()); | ||||
resUserDetailVO.setPhoneNo(userInfo.getMobile()); | resUserDetailVO.setPhoneNo(userInfo.getMobile()); | ||||
resUserDetailVO.setStatus(userInfo.getAvailable()); | resUserDetailVO.setStatus(userInfo.getAvailable()); | ||||
@@ -141,6 +141,7 @@ public class UserInfoManage { | |||||
.accountId(dingEmployeeInfo.getAccountId()) | .accountId(dingEmployeeInfo.getAccountId()) | ||||
.username(dingEmployeeInfo.getEmployeeName()) | .username(dingEmployeeInfo.getEmployeeName()) | ||||
.realName(dingEmployeeInfo.getEmployeeName()) | .realName(dingEmployeeInfo.getEmployeeName()) | ||||
.employeeCode(dingEmployeeInfo.getEmployeeCode()) | |||||
.available(UserAvailableEnum.DISABLE.name()) | .available(UserAvailableEnum.DISABLE.name()) | ||||
.createBy(-1L) | .createBy(-1L) | ||||
.updateBy(-1L) | .updateBy(-1L) | ||||
@@ -153,4 +154,7 @@ public class UserInfoManage { | |||||
} | } | ||||
public ResUserDetailVO currentUserInfo() { | |||||
return null; | |||||
} | |||||
} | } |
@@ -17,6 +17,9 @@ public class ResUserDetailVO { | |||||
@ApiModelProperty("userId") | @ApiModelProperty("userId") | ||||
private Long userId; | private Long userId; | ||||
@ApiModelProperty("用户姓名") | |||||
private String realName; | |||||
@ApiModelProperty("手机号") | @ApiModelProperty("手机号") | ||||
private String phoneNo; | private String phoneNo; | ||||