dev:岗位管理-代码修改
parent
cd583ba3c8
commit
dfda3c995f
|
|
@ -24,7 +24,7 @@ public class ZcloudUserFacadeImpl implements ZcloudUserFacade {
|
||||||
return MultiResponse.of(objects);
|
return MultiResponse.of(objects);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
@Override
|
||||||
public SingleResponse<ZcloudUserCo> getInfoByUserId(Long aLong) {
|
public SingleResponse<ZcloudUserCo> getInfoByUserId(Long aLong) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* web-adapter
|
* web-adapter
|
||||||
*
|
* 岗位管理
|
||||||
* @Author SondonYong
|
* @Author SondonYong
|
||||||
* @Date 2025-10-31 17:24:04
|
* @Date 2025-10-31 17:24:04
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -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());
|
List<PostDepartmentE> postDepartmentEList = postE.addDepartmentIds(postId, cmd.getDepartmentIds());
|
||||||
if(CollUtil.isNotEmpty(postDepartmentEList)){
|
if(CollUtil.isNotEmpty(postDepartmentEList)){
|
||||||
res = postDepartmentGateway.addList(postDepartmentEList);
|
res = postDepartmentGateway.addList(postDepartmentEList);
|
||||||
|
|
|
||||||
|
|
@ -34,13 +34,24 @@ public class PostUpdateExe {
|
||||||
boolean res = postGateway.update(postE);
|
boolean res = postGateway.update(postE);
|
||||||
|
|
||||||
// 岗位关联部门
|
// 岗位关联部门
|
||||||
if(res && postUpdateCmd.getSupervisionFlag() == 1){
|
if(res && postUpdateCmd.getSupervisionFlag() != null && postUpdateCmd.getSupervisionFlag() == 1){
|
||||||
postDepartmentGateway.deletedPostDepartment(postE.getId());
|
postDepartmentGateway.deletedPostDepartment(postE.getId());
|
||||||
List<PostDepartmentE> postDepartmentEList = postE.addDepartmentIds(postE.getId(), postUpdateCmd.getDepartmentIds());
|
List<PostDepartmentE> postDepartmentEList = postE.addDepartmentIds(postE.getId(), postUpdateCmd.getDepartmentIds());
|
||||||
if(CollUtil.isNotEmpty(postDepartmentEList)){
|
if(CollUtil.isNotEmpty(postDepartmentEList)){
|
||||||
res = postDepartmentGateway.addList(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) {
|
if (!res) {
|
||||||
throw new BizException("修改失败");
|
throw new BizException("修改失败");
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,11 @@ public class PostQueryExe {
|
||||||
return PageResponse.of(postCOList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
return PageResponse.of(postCOList, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询集合
|
||||||
|
* @param qry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public MultiResponse<PostCO> execute(PostListQry qry) {
|
public MultiResponse<PostCO> execute(PostListQry qry) {
|
||||||
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
Map<String, Object> params = PageQueryHelper.toHashMap(qry);
|
||||||
|
|
||||||
|
|
@ -132,6 +137,11 @@ public class PostQueryExe {
|
||||||
return postCOResponse;
|
return postCOResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单条
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public SingleResponse<PostCO> execute(Long id) {
|
public SingleResponse<PostCO> execute(Long id) {
|
||||||
SingleResponse<PostDO> postDO = postRepository.getInfoById(id);
|
SingleResponse<PostDO> postDO = postRepository.getInfoById(id);
|
||||||
SingleResponse<PostCO> postCO = new SingleResponse<>();
|
SingleResponse<PostCO> postCO = new SingleResponse<>();
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,6 @@ public class PostServiceImpl implements PostServiceI {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResponse<PostCO> listPage(PostPageQry qry) {
|
public PageResponse<PostCO> listPage(PostPageQry qry) {
|
||||||
|
|
||||||
return postQueryExe.execute(qry);
|
return postQueryExe.execute(qry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,13 +44,11 @@ public class PostServiceImpl implements PostServiceI {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse<PostCO> getInfoById(Long id) {
|
public SingleResponse<PostCO> getInfoById(Long id) {
|
||||||
|
|
||||||
return postQueryExe.execute(id);
|
return postQueryExe.execute(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SingleResponse add(PostAddCmd cmd) {
|
public SingleResponse add(PostAddCmd cmd) {
|
||||||
|
|
||||||
postAddExe.execute(cmd);
|
postAddExe.execute(cmd);
|
||||||
return SingleResponse.buildSuccess();
|
return SingleResponse.buildSuccess();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.zcloud.basic.info.dto;
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
import com.alibaba.cola.dto.PageQuery;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import com.zcloud.gbscommon.utils.UuidUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@ import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -44,6 +43,9 @@ public class PostGatewayImpl implements PostGateway {
|
||||||
if(StringUtils.isEmpty(d.getPostId())){
|
if(StringUtils.isEmpty(d.getPostId())){
|
||||||
d.setPostId(UuidUtil.get32UUID());
|
d.setPostId(UuidUtil.get32UUID());
|
||||||
}
|
}
|
||||||
|
if(d.getSupervisionFlag() == null){
|
||||||
|
d.setSupervisionFlag(0);
|
||||||
|
}
|
||||||
postRepository.save(d);
|
postRepository.save(d);
|
||||||
return d.getId();
|
return d.getId();
|
||||||
}
|
}
|
||||||
|
|
@ -63,6 +65,10 @@ public class PostGatewayImpl implements PostGateway {
|
||||||
|
|
||||||
PostDO d = new PostDO();
|
PostDO d = new PostDO();
|
||||||
BeanUtils.copyProperties(postE, d);
|
BeanUtils.copyProperties(postE, d);
|
||||||
|
if(d.getSupervisionFlag() == null){
|
||||||
|
d.setSupervisionFlag(0);
|
||||||
|
}
|
||||||
|
|
||||||
postRepository.updateById(d);
|
postRepository.updateById(d);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue