dev:岗位管理-代码修改

main
SondonYong 2025-11-05 16:42:45 +08:00
parent cd583ba3c8
commit dfda3c995f
9 changed files with 32 additions and 10 deletions

View File

@ -24,7 +24,7 @@ public class ZcloudUserFacadeImpl implements ZcloudUserFacade {
return MultiResponse.of(objects);
}
// @Override
@Override
public SingleResponse<ZcloudUserCo> getInfoByUserId(Long aLong) {
return null;
}

View File

@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
/**
* web-adapter
*
*
* @Author SondonYong
* @Date 2025-10-31 17:24:04
*/

View File

@ -41,7 +41,7 @@ public class PostAddExe {
}
// 岗位部门关联
if(res && cmd.getSupervisionFlag() == 1) {
if(res && cmd.getSupervisionFlag() != null && cmd.getSupervisionFlag() == 1) {
List<PostDepartmentE> postDepartmentEList = postE.addDepartmentIds(postId, cmd.getDepartmentIds());
if(CollUtil.isNotEmpty(postDepartmentEList)){
res = postDepartmentGateway.addList(postDepartmentEList);

View File

@ -34,13 +34,24 @@ public class PostUpdateExe {
boolean res = postGateway.update(postE);
// 岗位关联部门
if(res && postUpdateCmd.getSupervisionFlag() == 1){
if(res && postUpdateCmd.getSupervisionFlag() != null && postUpdateCmd.getSupervisionFlag() == 1){
postDepartmentGateway.deletedPostDepartment(postE.getId());
List<PostDepartmentE> postDepartmentEList = postE.addDepartmentIds(postE.getId(), postUpdateCmd.getDepartmentIds());
if(CollUtil.isNotEmpty(postDepartmentEList)){
res = postDepartmentGateway.addList(postDepartmentEList);
}
}else {
// 修改时如果改为不是监管岗位, 则删除岗位-部门关联表数据
if(res && postUpdateCmd.getSupervisionFlag() != null && postUpdateCmd.getSupervisionFlag() == 0){
postDepartmentGateway.deletedPostDepartment(postE.getId());
}
if(res && postUpdateCmd.getSupervisionFlag() == null){
postDepartmentGateway.deletedPostDepartment(postE.getId());
}
}
/**
*
*/
if (!res) {
throw new BizException("修改失败");

View File

@ -82,6 +82,11 @@ public class PostQueryExe {
return PageResponse.of(postCOList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
}
/**
*
* @param qry
* @return
*/
public MultiResponse<PostCO> execute(PostListQry qry) {
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
@ -132,6 +137,11 @@ public class PostQueryExe {
return postCOResponse;
}
/**
*
* @param id
* @return
*/
public SingleResponse<PostCO> execute(Long id) {
SingleResponse<PostDO> postDO = postRepository.getInfoById(id);
SingleResponse<PostCO> postCO = new SingleResponse<>();

View File

@ -33,7 +33,6 @@ public class PostServiceImpl implements PostServiceI {
@Override
public PageResponse<PostCO> listPage(PostPageQry qry) {
return postQueryExe.execute(qry);
}
@ -45,13 +44,11 @@ public class PostServiceImpl implements PostServiceI {
@Override
public SingleResponse<PostCO> getInfoById(Long id) {
return postQueryExe.execute(id);
}
@Override
public SingleResponse add(PostAddCmd cmd) {
postAddExe.execute(cmd);
return SingleResponse.buildSuccess();
}

View File

@ -1,6 +1,5 @@
package com.zcloud.basic.info.dto;
import com.alibaba.cola.dto.PageQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -5,7 +5,6 @@ import com.zcloud.gbscommon.utils.UuidUtil;
import lombok.Data;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;

View File

@ -13,7 +13,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
@ -44,6 +43,9 @@ public class PostGatewayImpl implements PostGateway {
if(StringUtils.isEmpty(d.getPostId())){
d.setPostId(UuidUtil.get32UUID());
}
if(d.getSupervisionFlag() == null){
d.setSupervisionFlag(0);
}
postRepository.save(d);
return d.getId();
}
@ -63,6 +65,10 @@ public class PostGatewayImpl implements PostGateway {
PostDO d = new PostDO();
BeanUtils.copyProperties(postE, d);
if(d.getSupervisionFlag() == null){
d.setSupervisionFlag(0);
}
postRepository.updateById(d);
return true;
}