Compare commits
4 Commits
6f282679f8
...
3274cd0fd5
| Author | SHA1 | Date |
|---|---|---|
|
|
3274cd0fd5 | |
|
|
dfda3c995f | |
|
|
cd583ba3c8 | |
|
|
da84291f31 |
|
|
@ -24,7 +24,7 @@ public class ZcloudUserFacadeImpl implements ZcloudUserFacade {
|
|||
return MultiResponse.of(objects);
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public SingleResponse<ZcloudUserCo> getInfoByUserId(Long aLong) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import com.alibaba.cola.dto.MultiResponse;
|
|||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -17,11 +16,10 @@ import lombok.AllArgsConstructor;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* web-adapter
|
||||
*
|
||||
* 岗位管理
|
||||
* @Author SondonYong
|
||||
* @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());
|
||||
if(CollUtil.isNotEmpty(postDepartmentEList)){
|
||||
res = postDepartmentGateway.addList(postDepartmentEList);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
||||
import com.zcloud.basic.info.domain.gateway.PostGateway;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.domain.gateway.UserGateway;
|
||||
import com.zcloud.basic.info.persistence.dataobject.UserDO;
|
||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -29,7 +28,7 @@ public class PostRemoveExe {
|
|||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
// 校验是否有人员使用该岗位
|
||||
// 这段代码后续放到user的方法中, 校验是否有人员使用该岗位
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq("post_id", id);
|
||||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
|
|
@ -53,7 +52,7 @@ public class PostRemoveExe {
|
|||
throw new BizException("岗位ID不能为空");
|
||||
}
|
||||
|
||||
// 校验是否有人员使用该岗位
|
||||
// 这段代码后续放到user的方法中, 校验是否有人员使用该岗位
|
||||
QueryWrapper<UserDO> queryWrapper = new QueryWrapper();
|
||||
queryWrapper.in("post_id", ids);
|
||||
queryWrapper.eq("delete_enum", "FALSE");
|
||||
|
|
|
|||
|
|
@ -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("修改失败");
|
||||
|
|
|
|||
|
|
@ -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<>();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -41,7 +40,7 @@ public class PostListQry {
|
|||
// 部门id
|
||||
private Long departmentId;
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "eqCorpinfoId", required = true)
|
||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||
// 企业id
|
||||
private Long corpinfoId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,21 +27,21 @@ public class PostPageQry extends PageQuery {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "监管端/企业端标识,1-监管端, 2-企业端", name = "departmentId", required = true)
|
||||
@ApiModelProperty(value = "监管端/企业端标识,1-监管端, 2-企业端", name = "corpFlag", required = true)
|
||||
@NotNull(message = "监管端/企业端标识不能为空")
|
||||
// 监管端/企业端标识,1-监管端, 2-企业端
|
||||
private Integer corpFlag;
|
||||
|
||||
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||
@ApiModelProperty(value = "部门id", name = "eqDepartmentId", required = true)
|
||||
@NotNull(message = "部门id不能为空")
|
||||
// 部门id
|
||||
private Long eqDepartmentId;
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "departmentId")
|
||||
@ApiModelProperty(value = "企业id", name = "eqCorpinfoId")
|
||||
// 企业id
|
||||
private Long eqCorpinfoId;
|
||||
|
||||
@ApiModelProperty(value = "岗位名称", name = "departmentId")
|
||||
@ApiModelProperty(value = "岗位名称", name = "likePostName")
|
||||
// 岗位名称
|
||||
private String likePostName;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue