Merge remote-tracking branch 'origin/main'
commit
36bc4041fa
|
|
@ -8,6 +8,7 @@ import com.zcloud.basic.info.dto.DepartmentAddCmd;
|
|||
import com.zcloud.basic.info.dto.DepartmentPageQry;
|
||||
import com.zcloud.basic.info.dto.DepartmentUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
||||
import com.zcloud.gbscommon.zclouddepartment.face.ZcloudDepartmentFacade;
|
||||
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentAddCmd;
|
||||
import com.zcloud.gbscommon.zclouddepartment.request.ZcloudDepartmentPageQry;
|
||||
|
|
@ -33,7 +34,7 @@ public class ZcloudDepartmentFacadeImpl implements ZcloudDepartmentFacade {
|
|||
|
||||
@Override
|
||||
public SingleResponse<ZcloudDepartmentInfoCo> getDepartmentInfoById(Long id) {
|
||||
DepartmentCO info = departmentService.info(id);
|
||||
DepartmentInfoCO info = departmentService.info(id);
|
||||
ZcloudDepartmentInfoCo zcloudDepartmentInfoCo = new ZcloudDepartmentInfoCo();
|
||||
BeanUtils.copyProperties(info, zcloudDepartmentInfoCo);
|
||||
return SingleResponse.of(zcloudDepartmentInfoCo);
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class CorpInfoController {
|
|||
|
||||
@ApiOperation("分页")
|
||||
@PostMapping("/list")
|
||||
public PageResponse<CorpInfoCO> page(@RequestBody CorpInfoPageQry qry) {
|
||||
public PageResponse<CorpInfoCO> page(@Validated @RequestBody CorpInfoPageQry qry) {
|
||||
return corpInfoService.listPage(qry);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.jjb.saas.system.client.dept.facade.DeptFacade;
|
|||
import com.zcloud.basic.info.api.DepartmentServiceI;
|
||||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
|
@ -62,7 +63,7 @@ public class DepartmentController {
|
|||
|
||||
@ApiOperation("部门详情")
|
||||
@PostMapping("/info/{id}")
|
||||
public SingleResponse<DepartmentCO> getInfoById(@PathVariable("id") Long id) {
|
||||
public SingleResponse<DepartmentInfoCO> getInfoById(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(departmentService.info(id));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class DepartmentUpdateExe {
|
|||
|
||||
FacadeUpdateDeptCmd deptCmd = new FacadeUpdateDeptCmd();
|
||||
BeanUtils.copyProperties(deptE, deptCmd);
|
||||
deptFacade.updateDept(deptCmd);
|
||||
// deptFacade.updateDept(deptCmd);
|
||||
if(!departmentDO.getName().equals(departmentE.getName())){
|
||||
//TODO 名字不一样,发送mq
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import com.zcloud.basic.info.dto.DepartmentQry;
|
|||
import com.zcloud.basic.info.dto.DepartmentTreeQry;
|
||||
import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||
|
|
@ -44,6 +45,9 @@ public class DepartmentQueryExe {
|
|||
* @return
|
||||
*/
|
||||
public PageResponse<DepartmentCO> execute(DepartmentPageQry departmentPageQry) {
|
||||
if(departmentPageQry.getEqCorpinfoId() == null){
|
||||
departmentPageQry.setEqCorpinfoId(AuthContext.getTenantId());
|
||||
}
|
||||
Map<String, Object> parmas = PageQueryHelper.toHashMap(departmentPageQry);
|
||||
PageResponse<DepartmentDO> pageResponse = departmentRepository.listPage(parmas);
|
||||
List<DepartmentCO> examCenterCOS = departmentCoConvertor.converDOsToCOs(pageResponse.getData());
|
||||
|
|
@ -60,15 +64,28 @@ public class DepartmentQueryExe {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
List<DepartmentTreeInfoCO> examCenterCOS = departmentCoConvertor.converDOsToInfoCOs(pageResponse);
|
||||
//GBS部门第一次是1
|
||||
//GBS部门根节点父部门是1
|
||||
return Tools.buildEntityTree(examCenterCOS, "id", "parentId", "childrenList");
|
||||
}
|
||||
|
||||
|
||||
public DepartmentCO info(Long id) {
|
||||
public DepartmentInfoCO info(Long id) {
|
||||
DepartmentDO info = departmentRepository.getById(id);
|
||||
DepartmentCO departmentCO = new DepartmentCO();
|
||||
if (info == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
DepartmentInfoCO departmentCO = new DepartmentInfoCO();
|
||||
BeanUtils.copyProperties(info, departmentCO);
|
||||
|
||||
// 获取父部门名称
|
||||
if (departmentCO.getParentId() != null) {
|
||||
DepartmentDO departmentDO = departmentRepository.getById(departmentCO.getParentId());
|
||||
if (departmentDO != null) {
|
||||
departmentCO.setParentName(departmentDO.getName());
|
||||
}
|
||||
}
|
||||
|
||||
return departmentCO;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.zcloud.basic.info.command.query.DepartmentQueryExe;
|
|||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
|
|
@ -65,7 +66,7 @@ public class DepartmentServiceImpl implements DepartmentServiceI {
|
|||
}
|
||||
|
||||
@Override
|
||||
public DepartmentCO info(Long id) {
|
||||
public DepartmentInfoCO info(Long id) {
|
||||
return departmentQueryExe.info(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.alibaba.cola.dto.SingleResponse;
|
|||
import com.zcloud.basic.info.dto.*;
|
||||
import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentInfoCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentTreeInfoCO;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -28,7 +29,7 @@ public interface DepartmentServiceI {
|
|||
|
||||
List<DepartmentTreeInfoCO> listTree(DepartmentTreeQry qry);
|
||||
|
||||
DepartmentCO info(Long id);
|
||||
DepartmentInfoCO info(Long id);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
package com.zcloud.basic.info.dto;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
|
|
@ -23,15 +27,17 @@ public class CorpInfoPageQry extends PageQuery {
|
|||
* - `le`: 小于等于比较查询
|
||||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
private String likeCorpinfoId;
|
||||
private Long eqcorpinfoId;
|
||||
@ApiModelProperty(value = "企业名称", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
@ApiModelProperty(value = "企业名称", name = "likecorpName")
|
||||
private String likecorpName;
|
||||
private String eqtype;
|
||||
/**、
|
||||
* 区分监管、企业、相关方
|
||||
* 2025-11-05 罗刚提出将相关方中的普通相关方企业、驻港单位、货主单位合并成同一个列表
|
||||
* 0:监管 1:企业 2:相关方
|
||||
* 1:监管 2:企业 3:相关方
|
||||
*/
|
||||
@ApiModelProperty(value = "企业类型1:监管 2:企业 3:相关方", name = "enterpriseType", required = true)
|
||||
@NotNull(message = "企业类型不能为空")
|
||||
private Integer enterpriseType;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,8 +43,12 @@ public class DepartmentAddCmd extends Command {
|
|||
@ApiModelProperty(value = "部门排序", name = "depOrder", required = true)
|
||||
@NotNull(message = "部门排序不能为空")
|
||||
private Integer depOrder;
|
||||
@ApiModelProperty(value = "是否监管部门 0-否 1-是", name = "superviseFlag", required = true)
|
||||
@ApiModelProperty(value = "是否监管部门 0-否 1-是", name = "superviseFlag")
|
||||
private Integer superviseFlag;
|
||||
@ApiModelProperty(value = "是否安全管理部门 0-否 1-是", name = "securityFlag")
|
||||
private Integer securityFlag;
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class DepartmentPageQry extends PageQuery {
|
|||
@ApiModelProperty(value = "名称模糊查询", name = "likeName")
|
||||
private String likeName;
|
||||
@ApiModelProperty(value = "企业id", name = "eqCorpInfoId")
|
||||
private Long eqCorpInfoId;
|
||||
private Long eqCorpinfoId;
|
||||
@ApiModelProperty(value = "父id", name = "eqParentId")
|
||||
private Long eqParentId;
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -41,9 +41,12 @@ public class DepartmentUpdateCmd extends Command {
|
|||
private String levelName;
|
||||
@ApiModelProperty(value = "部门排序", name = "depOrder", required = true)
|
||||
private Integer depOrder;
|
||||
@ApiModelProperty(value = "是否监管部门 0-否 1-是", name = "superviseFlag", required = true)
|
||||
@ApiModelProperty(value = "是否监管部门 0-否 1-是", name = "superviseFlag")
|
||||
private Integer superviseFlag;
|
||||
|
||||
@ApiModelProperty(value = "是否安全管理部门 0-否 1-是", name = "securityFlag")
|
||||
private Integer securityFlag;
|
||||
@ApiModelProperty(value = "备注", name = "remarks")
|
||||
private String remarks;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public class DepartmentCO extends ClientObject {
|
|||
//父部门id
|
||||
@ApiModelProperty(value = "父部门id")
|
||||
private Long parentId;
|
||||
|
||||
//所属企业
|
||||
@ApiModelProperty(value = "所属企业")
|
||||
private Long corpinfoId;
|
||||
|
|
@ -42,6 +43,8 @@ public class DepartmentCO extends ClientObject {
|
|||
//是否监管部门 0-否 1-是
|
||||
@ApiModelProperty(value = "是否监管部门 0-否 1-是")
|
||||
private Integer superviseFlag;
|
||||
@ApiModelProperty(value = "是否安全管理部门 0-否 1-是", name = "securityFlag")
|
||||
private Integer securityFlag;
|
||||
|
||||
//乐观锁
|
||||
@ApiModelProperty(value = "乐观锁")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,87 @@
|
|||
package com.zcloud.basic.info.dto.clientobject;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
|
||||
/**
|
||||
* web-client
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-10-30 10:10:48
|
||||
*/
|
||||
@Data
|
||||
public class DepartmentInfoCO extends ClientObject {
|
||||
//主键
|
||||
@ApiModelProperty(value = "主键")
|
||||
private Long id;
|
||||
//部门id
|
||||
@ApiModelProperty(value = "部门id")
|
||||
private String departmentId;
|
||||
//名称
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
//父部门id
|
||||
@ApiModelProperty(value = "父部门id")
|
||||
private Long parentId;
|
||||
@ApiModelProperty(value = "父部门名称")
|
||||
private String parentName;
|
||||
//所属企业
|
||||
@ApiModelProperty(value = "所属企业")
|
||||
private Long corpinfoId;
|
||||
//部门级别编码
|
||||
@ApiModelProperty(value = "部门级别编码")
|
||||
private String level;
|
||||
//部门级别名称
|
||||
@ApiModelProperty(value = "部门级别名称")
|
||||
private String levelName;
|
||||
//部门排序
|
||||
@ApiModelProperty(value = "部门排序")
|
||||
private Integer depOrder;
|
||||
//是否监管部门 0-否 1-是
|
||||
@ApiModelProperty(value = "是否监管部门 0-否 1-是")
|
||||
private Integer superviseFlag;
|
||||
@ApiModelProperty(value = "是否安全管理部门 0-否 1-是", name = "securityFlag")
|
||||
private Integer securityFlag;
|
||||
|
||||
//乐观锁
|
||||
@ApiModelProperty(value = "乐观锁")
|
||||
private Integer version;
|
||||
//创建人
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private Long createId;
|
||||
//创建人姓名
|
||||
@ApiModelProperty(value = "创建人姓名")
|
||||
private String createName;
|
||||
//创建时间
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
//更新人
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private Long updateId;
|
||||
//修改人名称
|
||||
@ApiModelProperty(value = "修改人名称")
|
||||
private String updateName;
|
||||
//更新时间
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
//描述
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String remarks;
|
||||
//是否删除
|
||||
@ApiModelProperty(value = "是否删除")
|
||||
private String deleteEnum;
|
||||
//租户ID
|
||||
@ApiModelProperty(value = "租户ID")
|
||||
private Long tenantId;
|
||||
//机构ID
|
||||
@ApiModelProperty(value = "机构ID")
|
||||
private Long orgId;
|
||||
//环境
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
}
|
||||
|
||||
|
|
@ -11,18 +11,18 @@ import java.util.stream.Collectors;
|
|||
*/
|
||||
@Getter
|
||||
public enum CorpTypeEnum {
|
||||
OrdinaryEnterprises(0,"普通企业",1),
|
||||
groupUnits(1, "集团单位",0),
|
||||
share(2,"股份单位",1),
|
||||
serviceProvider(3, "相关方企业",2),
|
||||
cargoOwner(4, "货主单位",2),
|
||||
portUnit(5, "驻港单位",2);
|
||||
OrdinaryEnterprises(0,"普通企业",2),
|
||||
groupUnits(1, "集团单位",1),
|
||||
share(2,"股份单位",2),
|
||||
serviceProvider(3, "相关方企业",3),
|
||||
cargoOwner(4, "货主单位",3),
|
||||
portUnit(5, "驻港单位",3);
|
||||
|
||||
private static final Map<Integer, List<Integer>> ENTERPRISE_TYPE_CODE_MAP = new HashMap<>();
|
||||
|
||||
private final Integer code;
|
||||
private final String name;
|
||||
//传入的企业类型 0:监管 1:企业 2:相关方
|
||||
//传入的企业类型企业类型 1:监管 2:企业 3:相关方
|
||||
private final Integer enterpriseType;
|
||||
|
||||
CorpTypeEnum(Integer code, String name,Integer enterpriseType) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.zcloud.basic.info.domain.model;
|
|||
|
||||
import com.alibaba.cola.domain.Entity;
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
|
|
@ -35,6 +36,8 @@ public class DepartmentE extends BaseE {
|
|||
private Integer depOrder;
|
||||
//是否监管部门 0-否 1-是
|
||||
private Integer superviseFlag;
|
||||
//是否安全管理部门 0-否 1-是
|
||||
private Integer securityFlag;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ public class DepartmentDO extends BaseDO {
|
|||
//是否监管部门 0-否 1-是
|
||||
@ApiModelProperty(value = "是否监管部门 0-否 1-是")
|
||||
private Integer superviseFlag;
|
||||
@ApiModelProperty(value = "是否安全管理部门 0-否 1-是")
|
||||
private Integer securityFlag;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue