修改文件上传、新增用户、新增部门

main
zhangyue 2025-11-18 14:31:59 +08:00
parent ae0f84b10d
commit 4f6f629885
3 changed files with 16 additions and 13 deletions

View File

@ -66,14 +66,14 @@ public class ImgFilesE extends BaseE {
//环境 //环境
private String env; private String env;
public String initAdd(Long tenantId, ImgFilesE baseImgFilesE) { public String initAdd(Long tenantId, ImgFilesE baseImgFilesE) throws Exception {
MultipartFile[] files = baseImgFilesE.getFiles(); MultipartFile[] files = baseImgFilesE.getFiles();
Long corpinfoId = ObjectUtils.isEmpty(baseImgFilesE.getCorpinfoId()) ? tenantId : baseImgFilesE.getCorpinfoId(); 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()); String resultFilePath = Smb.saveFile(files[0], filePath);
return filePath + resultFilePath; return resultFilePath;
} }
public List<ImgFilesE> initBatchAdd(Long tenantId, ImgFilesE baseImgFilesE) throws Exception { public List<ImgFilesE> initBatchAdd(Long tenantId, ImgFilesE baseImgFilesE) throws Exception {

View File

@ -1,10 +1,13 @@
package com.zcloud.basic.info.gatewayimpl; package com.zcloud.basic.info.gatewayimpl;
import com.alibaba.cola.dto.Response; 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.model.SSOUser;
import com.jjb.saas.framework.auth.utils.AuthContext; import com.jjb.saas.framework.auth.utils.AuthContext;
import com.jjb.saas.system.client.dept.facade.DeptFacade; 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.request.FacadeAddDeptCmd;
import com.jjb.saas.system.client.dept.response.DeptDetailCO;
import com.jjb.saas.system.enums.org.DeptTypeEnum; import com.jjb.saas.system.enums.org.DeptTypeEnum;
import com.zcloud.basic.info.domain.gateway.DepartmentGateway; import com.zcloud.basic.info.domain.gateway.DepartmentGateway;
import com.zcloud.basic.info.domain.model.DepartmentE; import com.zcloud.basic.info.domain.model.DepartmentE;
@ -47,18 +50,18 @@ public class DepartmentGatewayImpl implements DepartmentGateway {
if(StringUtils.isEmpty(d.getDepartmentId())){ if(StringUtils.isEmpty(d.getDepartmentId())){
d.setDepartmentId(Tools.get32UUID()); d.setDepartmentId(Tools.get32UUID());
} }
departmentRepository.save(d);
SSOUser ssoUser = AuthContext.getCurrentUser(); SSOUser ssoUser = AuthContext.getCurrentUser();
System.out.println(ssoUser.getTenantId()); System.out.println(ssoUser.getTenantId());
SingleResponse<DeptDetailCO> deptDetailCO = deptFacade.getDetail(departmentE.getParentId());
// 需要调用GBS新增 // 需要调用GBS新增
FacadeAddDeptCmd deptCmd = new FacadeAddDeptCmd(); DeptAddCmd deptCmd = new DeptAddCmd();
deptCmd.setLinkId(d.getId()); deptCmd.setDeptName(departmentE.getName());
deptCmd.setLinkName(departmentE.getName()); deptCmd.setParentIds(deptDetailCO.getData().getParentIds());
deptCmd.setParentId(departmentE.getParentId());
deptCmd.setDeptTypeEnum(DeptTypeEnum.DEPARTMENT.getValue());
//TODO gbs部门表 sys_dept tenant_idparent_idsadd_type_enum存储错误导致gbs页面看不到参数还没有待定 //TODO gbs部门表 sys_dept tenant_idparent_idsadd_type_enum存储错误导致gbs页面看不到参数还没有待定
Response response = deptFacade.addDept(deptCmd); SingleResponse<Long> response = deptFacade.add(deptCmd);
d.setId(response.getData());
departmentRepository.save(d);
log.info("DepartmentAddExe,新增部门调用GBS返回"+response.toString()); log.info("DepartmentAddExe,新增部门调用GBS返回"+response.toString());
return d.getId(); return d.getId();
} }

View File

@ -171,8 +171,8 @@ public class UserRepositoryImpl extends BaseRepositoryImpl<UserMapper, UserDO> i
List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd); List<RoleDeptAddCmd> roleDeptAddCmdList = Collections.singletonList(roleDeptAddCmd);
userAddCmd.setRoleDepts(roleDeptAddCmdList); userAddCmd.setRoleDepts(roleDeptAddCmdList);
Response userid = userFacade.add(userAddCmd); SingleResponse<Long> gbsResult = userFacade.add(userAddCmd);
userDO.setId(gbsResult.getData());
save(userDO); save(userDO);
} }