From 4f6f6298853ac84f5df355f68b93569bf496d327 Mon Sep 17 00:00:00 2001 From: zhangyue Date: Tue, 18 Nov 2025 14:31:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E3=80=81=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7=E3=80=81?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/info/domain/model/ImgFilesE.java | 8 ++++---- .../info/gatewayimpl/DepartmentGatewayImpl.java | 17 ++++++++++------- .../repository/impl/UserRepositoryImpl.java | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/web-domain/src/main/java/com/zcloud/basic/info/domain/model/ImgFilesE.java b/web-domain/src/main/java/com/zcloud/basic/info/domain/model/ImgFilesE.java index 340c518..810156d 100644 --- a/web-domain/src/main/java/com/zcloud/basic/info/domain/model/ImgFilesE.java +++ b/web-domain/src/main/java/com/zcloud/basic/info/domain/model/ImgFilesE.java @@ -66,14 +66,14 @@ public class ImgFilesE extends BaseE { //环境 private String env; - public String initAdd(Long tenantId, ImgFilesE baseImgFilesE) { + public String initAdd(Long tenantId, ImgFilesE baseImgFilesE) throws Exception { MultipartFile[] files = baseImgFilesE.getFiles(); Long corpinfoId = ObjectUtils.isEmpty(baseImgFilesE.getCorpinfoId()) ? tenantId : baseImgFilesE.getCorpinfoId(); - String filePath = corpinfoId.toString() + "/" + DateUtil.getMonth() + "/" + baseImgFilesE.getPath() + "/"; + String filePath = corpinfoId.toString() + "/" + DateUtil.getMonth() + "/" + baseImgFilesE.getPath(); // 文件上传并获取上传路径 - String resultFilePath = FileUpload.fileUp(files[0], filePath, Tools.get32UUID()); - return filePath + resultFilePath; + String resultFilePath = Smb.saveFile(files[0], filePath); + return resultFilePath; } public List initBatchAdd(Long tenantId, ImgFilesE baseImgFilesE) throws Exception { diff --git a/web-infrastructure/src/main/java/com/zcloud/basic/info/gatewayimpl/DepartmentGatewayImpl.java b/web-infrastructure/src/main/java/com/zcloud/basic/info/gatewayimpl/DepartmentGatewayImpl.java index efcdbd4..7169227 100644 --- a/web-infrastructure/src/main/java/com/zcloud/basic/info/gatewayimpl/DepartmentGatewayImpl.java +++ b/web-infrastructure/src/main/java/com/zcloud/basic/info/gatewayimpl/DepartmentGatewayImpl.java @@ -1,10 +1,13 @@ package com.zcloud.basic.info.gatewayimpl; 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 com.jjb.saas.system.client.dept.facade.DeptFacade; +import com.jjb.saas.system.client.dept.request.DeptAddCmd; import com.jjb.saas.system.client.dept.request.FacadeAddDeptCmd; +import com.jjb.saas.system.client.dept.response.DeptDetailCO; import com.jjb.saas.system.enums.org.DeptTypeEnum; import com.zcloud.basic.info.domain.gateway.DepartmentGateway; import com.zcloud.basic.info.domain.model.DepartmentE; @@ -47,18 +50,18 @@ public class DepartmentGatewayImpl implements DepartmentGateway { if(StringUtils.isEmpty(d.getDepartmentId())){ d.setDepartmentId(Tools.get32UUID()); } - departmentRepository.save(d); SSOUser ssoUser = AuthContext.getCurrentUser(); System.out.println(ssoUser.getTenantId()); + SingleResponse deptDetailCO = deptFacade.getDetail(departmentE.getParentId()); // 需要调用GBS,新增 - FacadeAddDeptCmd deptCmd = new FacadeAddDeptCmd(); - deptCmd.setLinkId(d.getId()); - deptCmd.setLinkName(departmentE.getName()); - deptCmd.setParentId(departmentE.getParentId()); - deptCmd.setDeptTypeEnum(DeptTypeEnum.DEPARTMENT.getValue()); + DeptAddCmd deptCmd = new DeptAddCmd(); + deptCmd.setDeptName(departmentE.getName()); + deptCmd.setParentIds(deptDetailCO.getData().getParentIds()); //TODO gbs部门表 sys_dept tenant_id,parent_ids,add_type_enum,存储错误,导致gbs页面看不到,参数还没有,待定 - Response response = deptFacade.addDept(deptCmd); + SingleResponse response = deptFacade.add(deptCmd); + d.setId(response.getData()); + departmentRepository.save(d); log.info("DepartmentAddExe,新增部门调用GBS返回:"+response.toString()); return d.getId(); } diff --git a/web-infrastructure/src/main/java/com/zcloud/basic/info/persistence/repository/impl/UserRepositoryImpl.java b/web-infrastructure/src/main/java/com/zcloud/basic/info/persistence/repository/impl/UserRepositoryImpl.java index 95d2f3f..ad35741 100644 --- a/web-infrastructure/src/main/java/com/zcloud/basic/info/persistence/repository/impl/UserRepositoryImpl.java +++ b/web-infrastructure/src/main/java/com/zcloud/basic/info/persistence/repository/impl/UserRepositoryImpl.java @@ -171,8 +171,8 @@ public class UserRepositoryImpl extends BaseRepositoryImpl i List roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd); userAddCmd.setRoleDepts(roleDeptAddCmdList); - Response userid = userFacade.add(userAddCmd); - + SingleResponse gbsResult = userFacade.add(userAddCmd); + userDO.setId(gbsResult.getData()); save(userDO); }