Compare commits
No commits in common. "06d2957b4f8d677389ce792cc3a82283d90bf16f" and "5c683b4d4a99ffdf969782ba9898202ab35e15fa" have entirely different histories.
06d2957b4f
...
5c683b4d4a
|
|
@ -6,10 +6,14 @@ import com.zcloud.basic.info.api.PostServiceI;
|
||||||
import com.zcloud.basic.info.command.convertor.PostCoConvertor;
|
import com.zcloud.basic.info.command.convertor.PostCoConvertor;
|
||||||
import com.zcloud.basic.info.dto.PostListQry;
|
import com.zcloud.basic.info.dto.PostListQry;
|
||||||
import com.zcloud.basic.info.dto.clientobject.PostCO;
|
import com.zcloud.basic.info.dto.clientobject.PostCO;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.PostDepartmentCO;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.UserCO;
|
||||||
import com.zcloud.gbscommon.utils.DeepCopyUtil;
|
import com.zcloud.gbscommon.utils.DeepCopyUtil;
|
||||||
import com.zcloud.gbscommon.zcloudpost.facade.ZcloudPostFacade;
|
import com.zcloud.gbscommon.zcloudpost.facade.ZcloudPostFacade;
|
||||||
import com.zcloud.gbscommon.zcloudpost.request.ZcloudPostQry;
|
import com.zcloud.gbscommon.zcloudpost.request.ZcloudPostQry;
|
||||||
import com.zcloud.gbscommon.zcloudpost.response.ZcloudPostCO;
|
import com.zcloud.gbscommon.zcloudpost.response.ZcloudPostCO;
|
||||||
|
import com.zcloud.gbscommon.zcloudpost.response.ZcloudPostDepartmentCO;
|
||||||
|
import com.zcloud.gbscommon.zclouduser.response.ZcloudUserCo;
|
||||||
import org.apache.dubbo.config.annotation.DubboService;
|
import org.apache.dubbo.config.annotation.DubboService;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
|
@ -42,7 +46,7 @@ public class ZcloudPostFacadeImpl implements ZcloudPostFacade {
|
||||||
|
|
||||||
// 定义映射关系
|
// 定义映射关系
|
||||||
Map<Class<?>, Class<?>> mapping = new HashMap<>();
|
Map<Class<?>, Class<?>> mapping = new HashMap<>();
|
||||||
// mapping.put(PostDepartmentCO.class, ZcloudPostDepartmentCO.class);
|
mapping.put(PostDepartmentCO.class, ZcloudPostDepartmentCO.class);
|
||||||
|
|
||||||
// 单个对象
|
// 单个对象
|
||||||
ZcloudPostCO zcloudPostCO = DeepCopyUtil.deepCopy(postCO.getData(), ZcloudPostCO.class, mapping);
|
ZcloudPostCO zcloudPostCO = DeepCopyUtil.deepCopy(postCO.getData(), ZcloudPostCO.class, mapping);
|
||||||
|
|
@ -67,7 +71,7 @@ public class ZcloudPostFacadeImpl implements ZcloudPostFacade {
|
||||||
|
|
||||||
// 定义映射关系
|
// 定义映射关系
|
||||||
Map<Class<?>, Class<?>> mapping = new HashMap<>();
|
Map<Class<?>, Class<?>> mapping = new HashMap<>();
|
||||||
// mapping.put(PostDepartmentCO.class, ZcloudPostDepartmentCO.class);
|
mapping.put(PostDepartmentCO.class, ZcloudPostDepartmentCO.class);
|
||||||
|
|
||||||
// 集合
|
// 集合
|
||||||
List<ZcloudPostCO> zcloudPostCOList = DeepCopyUtil.copyList(list.getData(), ZcloudPostCO.class, mapping);
|
List<ZcloudPostCO> zcloudPostCOList = DeepCopyUtil.copyList(list.getData(), ZcloudPostCO.class, mapping);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.zcloud.basic.info.command;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
||||||
|
import com.zcloud.basic.info.domain.model.PostDepartmentE;
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentAddCmd;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentAddExe {
|
||||||
|
private final PostDepartmentGateway postDepartmentGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(PostDepartmentAddCmd cmd) {
|
||||||
|
PostDepartmentE postDepartmentE = new PostDepartmentE();
|
||||||
|
BeanUtils.copyProperties(cmd, postDepartmentE);
|
||||||
|
boolean res = false;
|
||||||
|
try {
|
||||||
|
res = postDepartmentGateway.add(postDepartmentE);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("保存失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.zcloud.basic.info.command;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentRemoveExe {
|
||||||
|
private final PostDepartmentGateway postDepartmentGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long id) {
|
||||||
|
boolean res = postDepartmentGateway.deletedPostDepartmentById(id);
|
||||||
|
if(!res){
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public boolean execute(Long[] ids) {
|
||||||
|
boolean res = postDepartmentGateway.deletedPostDepartmentByIds(ids);
|
||||||
|
if(!res){
|
||||||
|
throw new BizException("删除失败");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.zcloud.basic.info.command;
|
||||||
|
|
||||||
|
import com.alibaba.cola.exception.BizException;
|
||||||
|
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
||||||
|
import com.zcloud.basic.info.domain.model.PostDepartmentE;
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentUpdateCmd;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentUpdateExe {
|
||||||
|
private final PostDepartmentGateway postDepartmentGateway;
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void execute(PostDepartmentUpdateCmd postDepartmentUpdateCmd) {
|
||||||
|
PostDepartmentE postDepartmentE = new PostDepartmentE();
|
||||||
|
BeanUtils.copyProperties(postDepartmentUpdateCmd, postDepartmentE);
|
||||||
|
boolean res = postDepartmentGateway.update(postDepartmentE);
|
||||||
|
if (!res) {
|
||||||
|
throw new BizException("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.zcloud.basic.info.command.convertor;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.PostDepartmentCO;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
||||||
|
import org.mapstruct.Mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Mapper(componentModel = "spring")
|
||||||
|
public interface PostDepartmentCoConvertor {
|
||||||
|
/**
|
||||||
|
* @param postDepartmentDOs
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<PostDepartmentCO> converDOsToCOs(List<PostDepartmentDO> postDepartmentDOs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -6,9 +6,13 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||||
import com.zcloud.basic.info.command.convertor.DepartmentCoConvertor;
|
import com.zcloud.basic.info.command.convertor.DepartmentCoConvertor;
|
||||||
import com.zcloud.basic.info.domain.enums.CommonFlagEnum;
|
import com.zcloud.basic.info.domain.enums.CommonFlagEnum;
|
||||||
|
import com.zcloud.basic.info.domain.model.DepartmentE;
|
||||||
import com.zcloud.basic.info.dto.*;
|
import com.zcloud.basic.info.dto.*;
|
||||||
import com.zcloud.basic.info.dto.clientobject.*;
|
import com.zcloud.basic.info.dto.clientobject.*;
|
||||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.DepartmentSuperviseDO;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.PostDO;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
||||||
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
import com.zcloud.basic.info.persistence.repository.CorpInfoRepository;
|
||||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||||
import com.zcloud.basic.info.persistence.repository.DepartmentSuperviseRepository;
|
import com.zcloud.basic.info.persistence.repository.DepartmentSuperviseRepository;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,52 @@
|
||||||
|
package com.zcloud.basic.info.command.query;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.command.convertor.PostDepartmentCoConvertor;
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentPageQry;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.PostDepartmentCO;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
||||||
|
import com.zcloud.basic.info.persistence.repository.PostDepartmentRepository;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentQueryExe {
|
||||||
|
private final PostDepartmentRepository postDepartmentRepository;
|
||||||
|
private final PostDepartmentCoConvertor postDepartmentCoConvertor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页
|
||||||
|
*
|
||||||
|
* @param postDepartmentPageQry
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public PageResponse<PostDepartmentCO> execute(PostDepartmentPageQry postDepartmentPageQry) {
|
||||||
|
Map<String,Object> params = PageQueryHelper.toHashMap(postDepartmentPageQry);
|
||||||
|
PageResponse<PostDepartmentDO> pageResponse = postDepartmentRepository.listPage(params);
|
||||||
|
List<PostDepartmentCO> examCenterCOS = postDepartmentCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
|
}
|
||||||
|
|
||||||
|
public SingleResponse<PostDepartmentCO> execute(Long id) {
|
||||||
|
SingleResponse<PostDepartmentDO> postDepartmentDO = postDepartmentRepository.getInfoById(id);
|
||||||
|
SingleResponse<PostDepartmentCO> postDepartmentCO = new SingleResponse<>();
|
||||||
|
BeanUtils.copyProperties(postDepartmentDO, postDepartmentCO);
|
||||||
|
return postDepartmentCO;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.zcloud.basic.info.command.query;
|
package com.zcloud.basic.info.command.query;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import com.alibaba.cola.dto.MultiResponse;
|
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;
|
||||||
|
|
@ -54,9 +53,6 @@ public class UserQueryExe {
|
||||||
userE.dataProcessingRights(AuthContext.getTenantId(), params);
|
userE.dataProcessingRights(AuthContext.getTenantId(), params);
|
||||||
PageResponse<UserDO> pageResponse = userRepository.listPage(params);
|
PageResponse<UserDO> pageResponse = userRepository.listPage(params);
|
||||||
List<UserCO> examCenterCOS = userCoConvertor.converDOsToCOs(pageResponse.getData());
|
List<UserCO> examCenterCOS = userCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||||
if(CollUtil.isNotEmpty(examCenterCOS)){
|
|
||||||
examCenterCOS.forEach(this::desensitize);
|
|
||||||
}
|
|
||||||
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
return PageResponse.of(examCenterCOS, pageResponse.getTotalCount(), pageResponse.getPageSize(), pageResponse.getPageIndex());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,9 +70,7 @@ public class UserQueryExe {
|
||||||
List<UserCO> imgFilesCOList = userCoConvertor.converDOsToCOs(imgFilesDOList);
|
List<UserCO> imgFilesCOList = userCoConvertor.converDOsToCOs(imgFilesDOList);
|
||||||
//手机号脱敏
|
//手机号脱敏
|
||||||
//身份照脱敏
|
//身份照脱敏
|
||||||
if(CollUtil.isNotEmpty(imgFilesCOList)){
|
|
||||||
imgFilesCOList.forEach(this::desensitize);
|
imgFilesCOList.forEach(this::desensitize);
|
||||||
}
|
|
||||||
return MultiResponse.of(imgFilesCOList);
|
return MultiResponse.of(imgFilesCOList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.zcloud.basic.info.service;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.api.PostDepartmentServiceI;
|
||||||
|
import com.zcloud.basic.info.command.PostDepartmentAddExe;
|
||||||
|
import com.zcloud.basic.info.command.PostDepartmentRemoveExe;
|
||||||
|
import com.zcloud.basic.info.command.PostDepartmentUpdateExe;
|
||||||
|
import com.zcloud.basic.info.command.query.PostDepartmentQueryExe;
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentAddCmd;
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentPageQry;
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentUpdateCmd;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.PostDepartmentCO;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-app
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentServiceImpl implements PostDepartmentServiceI {
|
||||||
|
private final PostDepartmentAddExe postDepartmentAddExe;
|
||||||
|
private final PostDepartmentUpdateExe postDepartmentUpdateExe;
|
||||||
|
private final PostDepartmentRemoveExe postDepartmentRemoveExe;
|
||||||
|
private final PostDepartmentQueryExe postDepartmentQueryExe;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<PostDepartmentCO> listPage(PostDepartmentPageQry qry){
|
||||||
|
|
||||||
|
return postDepartmentQueryExe.execute(qry);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<PostDepartmentCO> getInfoById(Long id){
|
||||||
|
|
||||||
|
return postDepartmentQueryExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse add(PostDepartmentAddCmd cmd) {
|
||||||
|
|
||||||
|
postDepartmentAddExe.execute(cmd);
|
||||||
|
return SingleResponse.buildSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void edit(PostDepartmentUpdateCmd postDepartmentUpdateCmd) {
|
||||||
|
postDepartmentUpdateExe.execute(postDepartmentUpdateCmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove(Long id) {
|
||||||
|
postDepartmentRemoveExe.execute(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void removeBatch(Long[] ids) {
|
||||||
|
postDepartmentRemoveExe.execute(ids);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.zcloud.basic.info.api;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentAddCmd;
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentPageQry;
|
||||||
|
import com.zcloud.basic.info.dto.PostDepartmentUpdateCmd;
|
||||||
|
import com.zcloud.basic.info.dto.clientobject.PostDepartmentCO;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
public interface PostDepartmentServiceI {
|
||||||
|
PageResponse<PostDepartmentCO> listPage(PostDepartmentPageQry qry);
|
||||||
|
|
||||||
|
SingleResponse<PostDepartmentCO> getInfoById(Long id);
|
||||||
|
|
||||||
|
SingleResponse<PostDepartmentCO> add(PostDepartmentAddCmd cmd);
|
||||||
|
|
||||||
|
void edit(PostDepartmentUpdateCmd cmd);
|
||||||
|
|
||||||
|
void remove(Long id);
|
||||||
|
|
||||||
|
void removeBatch(Long[] ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -28,7 +28,8 @@ public class PostAddCmd extends Command {
|
||||||
@NotEmpty(message = "岗位名称不能为空")
|
@NotEmpty(message = "岗位名称不能为空")
|
||||||
private String postName;
|
private String postName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "岗位职责", name = "remarks")
|
@ApiModelProperty(value = "岗位职责", name = "remarks", required = true)
|
||||||
|
@NotEmpty(message = "岗位职责不能为空")
|
||||||
private String remarks;
|
private String remarks;
|
||||||
|
|
||||||
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
@ApiModelProperty(value = "企业id", name = "corpinfoId", required = true)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentAddCmd extends Command {
|
||||||
|
@ApiModelProperty(value = "岗位id", name = "postId", required = true)
|
||||||
|
@NotNull(message = "岗位id不能为空")
|
||||||
|
private Long postId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||||
|
@NotNull(message = "部门id不能为空")
|
||||||
|
private Long departmentId;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.PageQuery;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PostDepartmentPageQry extends PageQuery {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询条件操作前缀,支持以下几种数据库查询操作:
|
||||||
|
* - `like`: 模糊匹配查询,对应SQL的LIKE操作符
|
||||||
|
* - `eq`: 等值查询,对应SQL的=操作符
|
||||||
|
* - `gt`: 大于比较查询
|
||||||
|
* - `lt`: 小于比较查询
|
||||||
|
* - `ge`: 大于等于比较查询
|
||||||
|
* - `le`: 小于等于比较查询
|
||||||
|
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||||
|
*/
|
||||||
|
private Long eqPostId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentRemoveCmd extends Command {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键", name = "ids", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Long[] ids;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.zcloud.basic.info.dto;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.Command;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentUpdateCmd extends Command {
|
||||||
|
@ApiModelProperty(value = "主键", name = "id", required = true)
|
||||||
|
@NotNull(message = "主键不能为空")
|
||||||
|
private Long id;
|
||||||
|
@ApiModelProperty(value = "业务主键id", name = "postDepartmentId", required = true)
|
||||||
|
@NotEmpty(message = "业务主键id不能为空")
|
||||||
|
private String postDepartmentId;
|
||||||
|
@ApiModelProperty(value = "岗位id", name = "postId", required = true)
|
||||||
|
@NotNull(message = "岗位id不能为空")
|
||||||
|
private Long postId;
|
||||||
|
@ApiModelProperty(value = "部门id", name = "departmentId", required = true)
|
||||||
|
@NotNull(message = "部门id不能为空")
|
||||||
|
private Long departmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -24,8 +24,8 @@ public class UserCheckPassWordCmd extends Command {
|
||||||
@ApiModelProperty(value = "GBS用户id", name = "id", required = true)
|
@ApiModelProperty(value = "GBS用户id", name = "id", required = true)
|
||||||
@NotNull(message = "GBS用户id不能为空")
|
@NotNull(message = "GBS用户id不能为空")
|
||||||
private Long id;
|
private Long id;
|
||||||
@ApiModelProperty(value = "密码", name = "password")
|
@ApiModelProperty(value = "原密码", name = "password")
|
||||||
@NotEmpty(message = "密码不能为空")
|
@NotEmpty(message = "原密码不能为空")
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ public class UserPageQry extends PageQuery {
|
||||||
private Long eqDepartmentId;
|
private Long eqDepartmentId;
|
||||||
private Long eqPostId;
|
private Long eqPostId;
|
||||||
private Long eqRoleId;
|
private Long eqRoleId;
|
||||||
private Integer eqEmploymentFlag;
|
|
||||||
private String likeName;
|
private String likeName;
|
||||||
private String likeUsername;
|
private String likeUsername;
|
||||||
private Integer allFlag;
|
private Integer allFlag;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.zcloud.basic.info.dto.clientobject;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.ClientObject;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-client
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PostDepartmentCO extends ClientObject {
|
||||||
|
private Long id;
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
private String postDepartmentId;
|
||||||
|
//岗位id
|
||||||
|
@ApiModelProperty(value = "岗位id")
|
||||||
|
private Long postId;
|
||||||
|
//部门id
|
||||||
|
@ApiModelProperty(value = "部门id")
|
||||||
|
private Long departmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.zcloud.basic.info.domain.gateway;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.domain.model.PostDepartmentE;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
public interface PostDepartmentGateway {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
Boolean add(PostDepartmentE postDepartmentE) ;
|
||||||
|
|
||||||
|
Boolean addList(List<PostDepartmentE> postDepartmentEList) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
Boolean update(PostDepartmentE postDepartmentE);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
Boolean deletedPostDepartmentById(Long id);
|
||||||
|
Boolean deletedPostDepartment(Long postId);
|
||||||
|
Boolean deletedPostDepartment(Long[] postIds);
|
||||||
|
Boolean deletedPostDepartmentByIds(Long[] id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.zcloud.basic.info.domain.model;
|
||||||
|
|
||||||
|
import com.jjb.saas.framework.domain.model.BaseE;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-domain
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PostDepartmentE extends BaseE {
|
||||||
|
private Long id;
|
||||||
|
//业务主键id
|
||||||
|
private String postDepartmentId;
|
||||||
|
//岗位id
|
||||||
|
private Long postId;
|
||||||
|
//部门id
|
||||||
|
private Long departmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
package com.zcloud.basic.info.gatewayimpl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
||||||
|
import com.zcloud.basic.info.domain.model.PostDepartmentE;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
||||||
|
import com.zcloud.basic.info.persistence.repository.PostDepartmentRepository;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class PostDepartmentGatewayImpl implements PostDepartmentGateway {
|
||||||
|
private final PostDepartmentRepository postDepartmentRepository;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean add(PostDepartmentE postDepartmentE) {
|
||||||
|
PostDepartmentDO d = new PostDepartmentDO();
|
||||||
|
BeanUtils.copyProperties(postDepartmentE, d);
|
||||||
|
postDepartmentRepository.save(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean addList(List<PostDepartmentE> postDepartmentEList) {
|
||||||
|
if(CollUtil.isEmpty(postDepartmentEList)){
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
List<PostDepartmentDO> postDepartmentDOS = BeanUtil.copyToList(postDepartmentEList, PostDepartmentDO.class);
|
||||||
|
postDepartmentRepository.saveBatch(postDepartmentDOS);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean update(PostDepartmentE postDepartmentE) {
|
||||||
|
PostDepartmentDO d = new PostDepartmentDO();
|
||||||
|
BeanUtils.copyProperties(postDepartmentE, d);
|
||||||
|
postDepartmentRepository.updateById(d);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedPostDepartmentById(Long id) {
|
||||||
|
return postDepartmentRepository.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedPostDepartment(Long postId) {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.eq("post_id", postId);
|
||||||
|
return postDepartmentRepository.remove(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedPostDepartment(Long[] postIds) {
|
||||||
|
QueryWrapper queryWrapper = new QueryWrapper();
|
||||||
|
queryWrapper.in("post_id", Arrays.asList(postIds));
|
||||||
|
return postDepartmentRepository.remove(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Boolean deletedPostDepartmentByIds(Long[] ids) {
|
||||||
|
return postDepartmentRepository.removeByIds(Arrays.asList(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.zcloud.basic.info.persistence.dataobject;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
*
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("post_department")
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class PostDepartmentDO extends BaseDO {
|
||||||
|
//业务主键id
|
||||||
|
@ApiModelProperty(value = "业务主键id")
|
||||||
|
private String postDepartmentId;
|
||||||
|
//岗位id
|
||||||
|
@ApiModelProperty(value = "岗位id")
|
||||||
|
private Long postId;
|
||||||
|
//部门id
|
||||||
|
@ApiModelProperty(value = "部门id")
|
||||||
|
private Long departmentId;
|
||||||
|
|
||||||
|
public PostDepartmentDO(String postDepartmentId) {
|
||||||
|
this.postDepartmentId = postDepartmentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.zcloud.basic.info.persistence.mapper;
|
||||||
|
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface PostDepartmentMapper extends BaseMapper<PostDepartmentDO> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.zcloud.basic.info.persistence.repository;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
public interface PostDepartmentRepository extends BaseRepository<PostDepartmentDO> {
|
||||||
|
|
||||||
|
PageResponse<PostDepartmentDO> listPage(Map<String,Object> params);
|
||||||
|
|
||||||
|
List<PostDepartmentDO> list(Map<String,Object> params);
|
||||||
|
|
||||||
|
List<PostDepartmentDO> list(Long[] postIds);
|
||||||
|
|
||||||
|
SingleResponse<PostDepartmentDO> getInfoById(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,65 @@
|
||||||
|
package com.zcloud.basic.info.persistence.repository.impl;
|
||||||
|
|
||||||
|
import com.alibaba.cola.dto.MultiResponse;
|
||||||
|
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||||
|
import com.zcloud.basic.info.persistence.dataobject.PostDepartmentDO;
|
||||||
|
import com.zcloud.basic.info.persistence.mapper.PostDepartmentMapper;
|
||||||
|
import com.zcloud.basic.info.persistence.repository.PostDepartmentRepository;
|
||||||
|
import com.alibaba.cola.dto.SingleResponse;
|
||||||
|
import com.alibaba.cola.dto.PageResponse;
|
||||||
|
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||||
|
import com.zcloud.gbscommon.utils.Query;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* web-infrastructure
|
||||||
|
* @Author SondonYong
|
||||||
|
* @Date 2025-10-31 17:53:11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PostDepartmentRepositoryImpl extends BaseRepositoryImpl<PostDepartmentMapper, PostDepartmentDO> implements PostDepartmentRepository {
|
||||||
|
private final PostDepartmentMapper postDepartmentMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResponse<PostDepartmentDO> listPage(Map<String,Object> params) {
|
||||||
|
IPage<PostDepartmentDO> iPage = new Query<PostDepartmentDO>().getPage(params);
|
||||||
|
QueryWrapper<PostDepartmentDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
IPage<PostDepartmentDO> result = postDepartmentMapper.selectPage(iPage, queryWrapper);
|
||||||
|
return PageHelper.pageToResponse(result, result.getRecords());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PostDepartmentDO> list(Map<String, Object> params) {
|
||||||
|
QueryWrapper<PostDepartmentDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, params);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
List<PostDepartmentDO> postDepartmentDOS = postDepartmentMapper.selectList(queryWrapper);
|
||||||
|
return postDepartmentDOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PostDepartmentDO> list(Long[] postIds) {
|
||||||
|
QueryWrapper<PostDepartmentDO> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.in("post_id", postIds);
|
||||||
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
List<PostDepartmentDO> postDepartmentDOS = postDepartmentMapper.selectList(queryWrapper);
|
||||||
|
return postDepartmentDOS;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SingleResponse<PostDepartmentDO> getInfoById(Long id) {
|
||||||
|
return SingleResponse.of(postDepartmentMapper.selectById(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.zcloud.basic.info.persistence.mapper.PostDepartmentMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
||||||
Loading…
Reference in New Issue