Compare commits
No commits in common. "3274cd0fd561aa104eb2be05283cf983b24685e4" and "6f282679f8ef8d26d111db78b8d104d51565641e" have entirely different histories.
3274cd0fd5
...
6f282679f8
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import com.alibaba.cola.dto.MultiResponse;
|
||||||
import com.alibaba.cola.dto.PageResponse;
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
import com.alibaba.cola.dto.Response;
|
import com.alibaba.cola.dto.Response;
|
||||||
import com.alibaba.cola.dto.SingleResponse;
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.jjb.saas.framework.auth.model.SSOUser;
|
||||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
|
@ -16,10 +17,11 @@ import lombok.AllArgsConstructor;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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() != null && cmd.getSupervisionFlag() == 1) {
|
if(res && 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);
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
||||||
import com.zcloud.basic.info.domain.gateway.PostGateway;
|
import com.zcloud.basic.info.domain.gateway.PostGateway;
|
||||||
import com.alibaba.cola.exception.BizException;
|
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.dataobject.UserDO;
|
||||||
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
import com.zcloud.basic.info.persistence.repository.UserRepository;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
@ -28,7 +29,7 @@ public class PostRemoveExe {
|
||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public boolean execute(Long id) {
|
public boolean execute(Long id) {
|
||||||
// 这段代码后续放到user的方法中, 校验是否有人员使用该岗位
|
// 校验是否有人员使用该岗位
|
||||||
QueryWrapper queryWrapper = new QueryWrapper();
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.eq("post_id", id);
|
queryWrapper.eq("post_id", id);
|
||||||
queryWrapper.eq("delete_enum", "FALSE");
|
queryWrapper.eq("delete_enum", "FALSE");
|
||||||
|
|
@ -52,7 +53,7 @@ public class PostRemoveExe {
|
||||||
throw new BizException("岗位ID不能为空");
|
throw new BizException("岗位ID不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
// 这段代码后续放到user的方法中, 校验是否有人员使用该岗位
|
// 校验是否有人员使用该岗位
|
||||||
QueryWrapper<UserDO> queryWrapper = new QueryWrapper();
|
QueryWrapper<UserDO> queryWrapper = new QueryWrapper();
|
||||||
queryWrapper.in("post_id", ids);
|
queryWrapper.in("post_id", ids);
|
||||||
queryWrapper.eq("delete_enum", "FALSE");
|
queryWrapper.eq("delete_enum", "FALSE");
|
||||||
|
|
|
||||||
|
|
@ -34,24 +34,13 @@ public class PostUpdateExe {
|
||||||
boolean res = postGateway.update(postE);
|
boolean res = postGateway.update(postE);
|
||||||
|
|
||||||
// 岗位关联部门
|
// 岗位关联部门
|
||||||
if(res && postUpdateCmd.getSupervisionFlag() != null && postUpdateCmd.getSupervisionFlag() == 1){
|
if(res && 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,11 +82,6 @@ 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);
|
||||||
|
|
||||||
|
|
@ -137,11 +132,6 @@ 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,6 +33,7 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,11 +45,13 @@ 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,5 +1,6 @@
|
||||||
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;
|
||||||
|
|
||||||
|
|
@ -40,7 +41,7 @@ public class PostListQry {
|
||||||
// 部门id
|
// 部门id
|
||||||
private Long departmentId;
|
private Long departmentId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
@ApiModelProperty(value = "企业id", name = "eqCorpinfoId", required = true)
|
||||||
// 企业id
|
// 企业id
|
||||||
private Long corpinfoId;
|
private Long corpinfoId;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,21 +27,21 @@ public class PostPageQry extends PageQuery {
|
||||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ApiModelProperty(value = "监管端/企业端标识,1-监管端, 2-企业端", name = "corpFlag", required = true)
|
@ApiModelProperty(value = "监管端/企业端标识,1-监管端, 2-企业端", name = "departmentId", required = true)
|
||||||
@NotNull(message = "监管端/企业端标识不能为空")
|
@NotNull(message = "监管端/企业端标识不能为空")
|
||||||
// 监管端/企业端标识,1-监管端, 2-企业端
|
// 监管端/企业端标识,1-监管端, 2-企业端
|
||||||
private Integer corpFlag;
|
private Integer corpFlag;
|
||||||
|
|
||||||
@ApiModelProperty(value = "部门id", name = "eqDepartmentId", required = true)
|
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||||
@NotNull(message = "部门id不能为空")
|
@NotNull(message = "部门id不能为空")
|
||||||
// 部门id
|
// 部门id
|
||||||
private Long eqDepartmentId;
|
private Long eqDepartmentId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业id", name = "eqCorpinfoId")
|
@ApiModelProperty(value = "企业id", name = "departmentId")
|
||||||
// 企业id
|
// 企业id
|
||||||
private Long eqCorpinfoId;
|
private Long eqCorpinfoId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "岗位名称", name = "likePostName")
|
@ApiModelProperty(value = "岗位名称", name = "departmentId")
|
||||||
// 岗位名称
|
// 岗位名称
|
||||||
private String likePostName;
|
private String likePostName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ 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,6 +13,7 @@ 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -43,9 +44,6 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
@ -65,10 +63,6 @@ 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