Merge remote-tracking branch 'origin/main'
commit
8d922be8b1
|
|
@ -0,0 +1,60 @@
|
|||
package com.zcloud.basic.info.facade;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.api.CorpInfoServiceI;
|
||||
import com.zcloud.basic.info.command.convertor.CorpInfoCoConvertor;
|
||||
import com.zcloud.basic.info.dto.CorpFormAddCmd;
|
||||
import com.zcloud.basic.info.dto.CorpInfoAddCmd;
|
||||
import com.zcloud.basic.info.dto.CorpInfoPageQry;
|
||||
import com.zcloud.basic.info.dto.CorpInfoUpdateCmd;
|
||||
import com.zcloud.basic.info.dto.clientobject.CorpInfoCO;
|
||||
import com.zcloud.gbscommon.zcloudcorp.face.ZcloudCorpFacade;
|
||||
import com.zcloud.gbscommon.zcloudcorp.request.ZcloudCorpInfoAddCmd;
|
||||
import com.zcloud.gbscommon.zcloudcorp.request.ZcloudCorpInfoPageQry;
|
||||
import com.zcloud.gbscommon.zcloudcorp.request.ZcloudCorpInfoQry;
|
||||
import com.zcloud.gbscommon.zcloudcorp.request.ZcloudCorpInfoUpdateCmd;
|
||||
import com.zcloud.gbscommon.zcloudcorp.response.ZcloudCorpInfoCO;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@DubboService
|
||||
public class ZcloudCorpFacadeImpl implements ZcloudCorpFacade {
|
||||
@Resource
|
||||
private CorpInfoServiceI corpInfoService;
|
||||
@Resource
|
||||
private CorpInfoCoConvertor corpInfoCoConvertor;
|
||||
@Override
|
||||
public SingleResponse<ZcloudCorpInfoCO> getCorpInfoById(ZcloudCorpInfoQry zcloudCorpInfoQry) {
|
||||
CorpInfoCO info = corpInfoService.info(zcloudCorpInfoQry.getId());
|
||||
ZcloudCorpInfoCO zcloudCorpInfoCO = new ZcloudCorpInfoCO();
|
||||
BeanUtils.copyProperties(info, zcloudCorpInfoCO);
|
||||
return SingleResponse.of(zcloudCorpInfoCO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<ZcloudCorpInfoCO> pageByParentId(ZcloudCorpInfoPageQry zcloudCorpInfoPageQry) {
|
||||
CorpInfoPageQry qry = new CorpInfoPageQry();
|
||||
BeanUtils.copyProperties(zcloudCorpInfoPageQry, qry);
|
||||
PageResponse<CorpInfoCO> corpInfoCOPageResponse = corpInfoService.listPage(qry);
|
||||
List<ZcloudCorpInfoCO> zcloudPage = corpInfoCoConvertor.converCOsToDubboCOs(corpInfoCOPageResponse.getData());
|
||||
return PageResponse.of(zcloudPage, corpInfoCOPageResponse.getTotalCount(), corpInfoCOPageResponse.getPageSize(), corpInfoCOPageResponse.getPageIndex());
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse addCorp(ZcloudCorpInfoAddCmd zcloudCorpInfoAddCmd) {
|
||||
CorpInfoAddCmd addCmd =new CorpInfoAddCmd();
|
||||
BeanUtils.copyProperties(zcloudCorpInfoAddCmd, addCmd);
|
||||
return corpInfoService.add(addCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SingleResponse editCorp(ZcloudCorpInfoUpdateCmd zcloudCorpInfoUpdateCmd) {
|
||||
CorpInfoUpdateCmd updateCmd =new CorpInfoUpdateCmd();
|
||||
BeanUtils.copyProperties(zcloudCorpInfoUpdateCmd, updateCmd);
|
||||
return SingleResponse.buildSuccess();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +1,28 @@
|
|||
package com.zcloud.basic.info.facade;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import com.zcloud.basic.info.api.PostServiceI;
|
||||
import com.zcloud.basic.info.dto.PostListQry;
|
||||
import com.zcloud.basic.info.dto.clientobject.DepartmentCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.PostCO;
|
||||
import com.zcloud.basic.info.dto.clientobject.PostDepartmentCO;
|
||||
import com.zcloud.gbscommon.utils.DeepCopyUtil;
|
||||
import com.zcloud.gbscommon.zcloudpost.facade.ZcloudPostFacade;
|
||||
import com.zcloud.gbscommon.zcloudpost.request.ZcloudPostQry;
|
||||
import com.zcloud.gbscommon.zcloudpost.response.ZcloudPostCO;
|
||||
import com.zcloud.gbscommon.zcloudpost.response.ZcloudPostDepartmentCO;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author SondonYong
|
||||
|
|
@ -36,8 +44,18 @@ public class ZcloudPostFacadeImpl implements ZcloudPostFacade {
|
|||
return null;
|
||||
}
|
||||
|
||||
ZcloudPostCO zcloudPostCO = new ZcloudPostCO();
|
||||
BeanUtils.copyProperties(postCO.getData(), zcloudPostCO);
|
||||
// ZcloudPostCO zcloudPostCO = new ZcloudPostCO();
|
||||
// BeanUtils.copyProperties(postCO.getData(), zcloudPostCO);
|
||||
|
||||
// 定义映射关系
|
||||
Map<Class<?>, Class<?>> mapping = new HashMap<>();
|
||||
mapping.put(PostDepartmentCO.class, ZcloudPostDepartmentCO.class);
|
||||
|
||||
ZcloudPostCO zcloudPostCO = DeepCopyUtil.deepCopy(postCO.getData(), ZcloudPostCO.class, mapping);
|
||||
|
||||
// List<ZcloudPostDepartmentCO> zcloudPostDepartmentCOS = BeanUtil.copyToList(postCO.getData().getDepartmentList(), ZcloudPostDepartmentCO.class);
|
||||
|
||||
// zcloudPostCO.setDepartmentList(zcloudPostDepartmentCOS);
|
||||
|
||||
return SingleResponse.of(zcloudPostCO);
|
||||
}
|
||||
|
|
@ -52,7 +70,29 @@ public class ZcloudPostFacadeImpl implements ZcloudPostFacade {
|
|||
return null;
|
||||
}
|
||||
|
||||
List<ZcloudPostCO> zcloudPostCOList = BeanUtil.copyToList(list.getData(), ZcloudPostCO.class);
|
||||
Map<Class<?>, Class<?>> mapping = new HashMap<>();
|
||||
mapping.put(PostDepartmentCO.class, ZcloudPostDepartmentCO.class);
|
||||
|
||||
List<ZcloudPostCO> zcloudPostCOList = DeepCopyUtil.copyList(list.getData(), ZcloudPostCO.class, mapping);
|
||||
|
||||
// List<ZcloudPostCO> zcloudPostCOList = BeanUtil.copyToList(list.getData(), ZcloudPostCO.class);
|
||||
// List<ZcloudPostCO> zcloudPostCOList = list.getData().stream()
|
||||
// .map(postCO -> {
|
||||
// // 复制基本属性
|
||||
// ZcloudPostCO zcloudPostCO = BeanUtil.toBean(postCO, ZcloudPostCO.class);
|
||||
//
|
||||
// // 手动处理嵌套List
|
||||
// if (CollUtil.isNotEmpty(postCO.getDepartmentList())) {
|
||||
// List<ZcloudPostDepartmentCO> deptList = BeanUtil.copyToList(
|
||||
// postCO.getDepartmentList(),
|
||||
// ZcloudPostDepartmentCO.class
|
||||
// );
|
||||
// zcloudPostCO.setDepartmentList(deptList);
|
||||
// }
|
||||
//
|
||||
// return zcloudPostCO;
|
||||
// })
|
||||
// .collect(Collectors.toList());
|
||||
|
||||
return MultiResponse.of(zcloudPostCOList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,10 +68,10 @@ public class ImgFilesController {
|
|||
}
|
||||
|
||||
@ApiOperation("删除")
|
||||
@DeleteMapping("/{filePath}")
|
||||
public Response removeFile(@PathVariable("filePath") String filePath) {
|
||||
@DeleteMapping("/delete")
|
||||
public Response removeFile(@RequestParam String filePath) {
|
||||
imgFilesService.removeFile(filePath);
|
||||
return SingleResponse.buildSuccess();
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@ApiOperation("删除多个")
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import com.jjb.saas.system.client.dept.facade.DeptFacade;
|
|||
import com.jjb.saas.system.client.dept.request.FacadeUpdateDeptCmd;
|
||||
import com.zcloud.basic.info.domain.gateway.DepartmentGateway;
|
||||
import com.zcloud.basic.info.domain.model.DepartmentE;
|
||||
import com.zcloud.basic.info.domain.model.FacadeDepartmentE;
|
||||
import com.zcloud.basic.info.dto.DepartmentUpdateCmd;
|
||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||
|
|
@ -46,12 +47,11 @@ public class DepartmentUpdateExe {
|
|||
throw new BizException("修改失败");
|
||||
}
|
||||
|
||||
FacadeUpdateDeptCmd deptCmd = new FacadeUpdateDeptCmd();
|
||||
deptCmd.setLinkId(departmentE.getId());
|
||||
deptCmd.setLinkName(departmentE.getName());
|
||||
deptCmd.setParentId(departmentE.getParentId());
|
||||
deptFacade.updateDept(deptCmd);
|
||||
FacadeDepartmentE deptE =FacadeDepartmentE.initUpdate(departmentE);
|
||||
|
||||
FacadeUpdateDeptCmd deptCmd = new FacadeUpdateDeptCmd();
|
||||
BeanUtils.copyProperties(deptE, deptCmd);
|
||||
deptFacade.updateDept(deptCmd);
|
||||
if(!departmentDO.getName().equals(departmentE.getName())){
|
||||
//TODO 名字不一样,发送mq
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,19 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.command.convertor.ImgFilesCoConvertor;
|
||||
import com.zcloud.basic.info.domain.gateway.ImgFilesGateway;
|
||||
import com.zcloud.basic.info.domain.model.ImgFilesE;
|
||||
import com.zcloud.basic.info.persistence.dataobject.ImgFilesDO;
|
||||
import com.zcloud.basic.info.persistence.repository.ImgFilesRepository;
|
||||
import com.zcloud.gbscommon.utils.Smb;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* web-app
|
||||
|
|
@ -17,20 +25,29 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
@AllArgsConstructor
|
||||
public class ImgFilesRemoveExe {
|
||||
private final ImgFilesGateway imgFilesGateway;
|
||||
private final ImgFilesRepository imgFilesRepository;
|
||||
private final ImgFilesCoConvertor imgFilesCoConvertor;
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(String filePath) {
|
||||
|
||||
// if (!res) {
|
||||
// throw new BizException("删除失败");
|
||||
// }
|
||||
ImgFilesE imgFilesE = new ImgFilesE();
|
||||
try {
|
||||
imgFilesE.deleteFile(filePath);
|
||||
} catch (Exception e) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long[] ids) {
|
||||
boolean res = imgFilesGateway.deletedImgFilesByIds(ids);
|
||||
if (!res) {
|
||||
List<ImgFilesDO> imgFilesDOList = imgFilesRepository.listByIds(Arrays.asList(ids));
|
||||
List<ImgFilesE> imgFilesEList = imgFilesCoConvertor.converDOsToEs(imgFilesDOList);
|
||||
ImgFilesE imgFilesE = new ImgFilesE();
|
||||
try {
|
||||
imgFilesE.deleteFileList(imgFilesEList);
|
||||
imgFilesRepository.deleteList(ids);
|
||||
} catch (Exception e) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
||||
import com.zcloud.basic.info.domain.gateway.PostGateway;
|
||||
import com.zcloud.basic.info.domain.model.PostDepartmentE;
|
||||
|
|
@ -42,8 +43,10 @@ public class PostAddExe {
|
|||
// 岗位部门关联
|
||||
if(res && cmd.getSupervisionFlag() == 1) {
|
||||
List<PostDepartmentE> postDepartmentEList = postE.addDepartmentIds(postId, cmd.getDepartmentIds());
|
||||
if(CollUtil.isNotEmpty(postDepartmentEList)){
|
||||
res = postDepartmentGateway.addList(postDepartmentEList);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.zcloud.basic.info.command;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import com.zcloud.basic.info.domain.gateway.PostDepartmentGateway;
|
||||
import com.zcloud.basic.info.domain.gateway.PostGateway;
|
||||
|
|
@ -36,8 +37,10 @@ public class PostUpdateExe {
|
|||
if(res && postUpdateCmd.getSupervisionFlag() == 1){
|
||||
postDepartmentGateway.deletedPostDepartment(postE.getId());
|
||||
List<PostDepartmentE> postDepartmentEList = postE.addDepartmentIds(postE.getId(), postUpdateCmd.getDepartmentIds());
|
||||
if(CollUtil.isNotEmpty(postDepartmentEList)){
|
||||
res = postDepartmentGateway.addList(postDepartmentEList);
|
||||
}
|
||||
}
|
||||
|
||||
if (!res) {
|
||||
throw new BizException("修改失败");
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.zcloud.basic.info.dto.clientobject.CorpDepartmentCO;
|
|||
import com.zcloud.basic.info.dto.clientobject.CorpInfoCO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.CorpInfoDO;
|
||||
import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
||||
import com.zcloud.gbscommon.zcloudcorp.response.ZcloudCorpInfoCO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -30,5 +31,7 @@ public interface CorpInfoCoConvertor {
|
|||
List<DepartmentE> converDOsToDepartE(List<DepartmentDO> list);
|
||||
|
||||
List<CorpDepartmentCO> converCorpInfoToCorpDepartCOs(List<CorpDepartmentE> corpInfoList);
|
||||
|
||||
List<ZcloudCorpInfoCO> converCOsToDubboCOs(List<CorpInfoCO> data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public interface ImgFilesCoConvertor {
|
|||
*/
|
||||
List<ImgFilesCO> converDOsToCOs(List<ImgFilesDO> imgFilesDOs);
|
||||
List<ImgFilesDO> converEsToDOs(List<ImgFilesE> imgFilesEs);
|
||||
List<ImgFilesE> converDOsToEs(List<ImgFilesDO> imgFilesDOs);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.zcloud.basic.info.command.query;
|
|||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.jjb.saas.framework.auth.utils.AuthContext;
|
||||
import com.zcloud.basic.info.command.convertor.DepartmentCoConvertor;
|
||||
import com.zcloud.basic.info.domain.model.DepartmentE;
|
||||
import com.zcloud.basic.info.dto.CorpDepartmentQry;
|
||||
|
|
@ -15,6 +16,7 @@ import com.zcloud.basic.info.persistence.dataobject.DepartmentDO;
|
|||
import com.zcloud.basic.info.persistence.repository.DepartmentRepository;
|
||||
import com.zcloud.gbscommon.utils.PageQueryHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
@ -48,6 +50,10 @@ public class DepartmentQueryExe {
|
|||
}
|
||||
|
||||
public List<DepartmentTreeInfoCO> listTree(DepartmentTreeQry departmentQry) {
|
||||
if(Objects.isNull(departmentQry.getEqCorpinfoId())){
|
||||
departmentQry.setEqCorpinfoId(AuthContext.getTenantId());
|
||||
|
||||
}
|
||||
Map<String, Object> parmas = PageQueryHelper.toHashMap(departmentQry);
|
||||
List<DepartmentDO> pageResponse = departmentRepository.listTree(parmas);
|
||||
if(CollUtil.isEmpty(pageResponse)) {
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ public class DepartmentTreeQry {
|
|||
* - `ne`: 不等比较查询,对应SQL的!=操作符
|
||||
*/
|
||||
|
||||
@ApiModelProperty(value = "企业id", name = "eqCorpInfoId")
|
||||
private String eqCorpInfoId;
|
||||
@ApiModelProperty(value = "企业id", name = "eqCorpinfoId")
|
||||
private Long eqCorpinfoId;
|
||||
@ApiModelProperty(value = "父id", name = "eqParentId")
|
||||
private String eqParentId;
|
||||
private Long eqParentId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,15 @@ public class ImgFilesCO extends ClientObject {
|
|||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "文件列表")
|
||||
private List<ImgFilesCO> fileList;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "md5")
|
||||
private String md5;
|
||||
//乐观锁
|
||||
@ApiModelProperty(value = "乐观锁")
|
||||
private Integer version;
|
||||
|
|
@ -73,8 +82,6 @@ public class ImgFilesCO extends ClientObject {
|
|||
//环境
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
@ApiModelProperty
|
||||
private List<ImgFilesCO> fileList;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
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;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* web-domain
|
||||
*
|
||||
* @Author zhaokai
|
||||
* @Date 2025-10-30 10:10:48
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class FacadeDepartmentE extends BaseE {
|
||||
|
||||
//外部对象ID
|
||||
private Long linkId;
|
||||
//父级ID
|
||||
private Long parentId;
|
||||
|
||||
//外部对象名称
|
||||
private String linkName;
|
||||
|
||||
//区域父子级编码(逗号隔开)
|
||||
private String regionCode;
|
||||
|
||||
//区域名称
|
||||
private String regionCodeName;
|
||||
|
||||
|
||||
public static FacadeDepartmentE initUpdate(DepartmentE departmentE) {
|
||||
FacadeDepartmentE deptE = new FacadeDepartmentE();
|
||||
deptE.setLinkId(departmentE.getId());
|
||||
deptE.setLinkName(departmentE.getName());
|
||||
deptE.setParentId(departmentE.getParentId());
|
||||
return deptE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,10 +1,8 @@
|
|||
package com.zcloud.basic.info.domain.model;
|
||||
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import com.zcloud.gbscommon.utils.DateUtil;
|
||||
import com.zcloud.gbscommon.utils.FileUpload;
|
||||
import com.zcloud.gbscommon.utils.*;
|
||||
//import com.zcloud.gbscommon.utils.Smb;
|
||||
import com.zcloud.gbscommon.utils.Tools;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
|
@ -41,6 +39,8 @@ public class ImgFilesE extends BaseE {
|
|||
private String path;
|
||||
|
||||
private MultipartFile[] files;
|
||||
|
||||
private String md5;
|
||||
//乐观锁
|
||||
private Integer version;
|
||||
//创建人
|
||||
|
|
@ -66,15 +66,11 @@ public class ImgFilesE extends BaseE {
|
|||
//环境
|
||||
private String env;
|
||||
|
||||
public String initAdd(Long tenantId, ImgFilesE baseImgFilesE) throws InvocationTargetException, IllegalAccessException {
|
||||
public String initAdd(Long tenantId, ImgFilesE baseImgFilesE) {
|
||||
|
||||
MultipartFile[] files = baseImgFilesE.getFiles();
|
||||
List<ImgFilesE> imgFilesList = new ArrayList<ImgFilesE>();
|
||||
String foreignKey = ObjectUtils.isEmpty(baseImgFilesE.getForeignKey()) ? Tools.get32UUID() : baseImgFilesE.getForeignKey();
|
||||
Long corpinfoId = ObjectUtils.isEmpty(baseImgFilesE.getCorpinfoId()) ? tenantId : baseImgFilesE.getCorpinfoId();
|
||||
String filePath = corpinfoId.toString() + "/" + DateUtil.getMonth() + "/" + baseImgFilesE.getPath();
|
||||
ImgFilesE imgFile = new ImgFilesE();
|
||||
BeanUtils.copyProperties(baseImgFilesE, imgFile);
|
||||
String filePath = corpinfoId.toString() + "/" + DateUtil.getMonth() + "/" + baseImgFilesE.getPath()+ "/";
|
||||
// 文件上传并获取上传路径
|
||||
String resultFilePath = FileUpload.fileUp(files[0], filePath, Tools.get32UUID());
|
||||
return filePath + resultFilePath;
|
||||
|
|
@ -89,19 +85,30 @@ public class ImgFilesE extends BaseE {
|
|||
|
||||
for (MultipartFile file : files) {
|
||||
ImgFilesE imgFile = new ImgFilesE();
|
||||
BeanUtils.copyProperties(baseImgFilesE, imgFile);
|
||||
BeanUtils.copyProperties(imgFile, baseImgFilesE);
|
||||
// 文件上传并获取上传路径
|
||||
// Smb.saveFile(file, filePath);
|
||||
String resultFilePath = Smb.saveFile(file, filePath);
|
||||
imgFile.setImgFilesId(Tools.get32UUID());
|
||||
// imgFile.setFilePath(filePath+);
|
||||
imgFile.setFilePath(resultFilePath);
|
||||
imgFile.setType(baseImgFilesE.getType());
|
||||
imgFile.setForeignKey(foreignKey);
|
||||
imgFile.setFileName(file.getOriginalFilename());
|
||||
imgFile.setCorpinfoId(corpinfoId);
|
||||
// imgFile.setMd5(FileUtil.getMD5(file));
|
||||
imgFilesList.add(imgFile);
|
||||
}
|
||||
baseImgFilesE.setForeignKey(foreignKey);
|
||||
return imgFilesList;
|
||||
}
|
||||
|
||||
|
||||
public void deleteFile(String filePath) throws Exception {
|
||||
Smb.deleteFile(filePath);
|
||||
}
|
||||
public void deleteFileList(List<ImgFilesE> imgFilesEList) throws Exception {
|
||||
for (ImgFilesE imgFilesE: imgFilesEList) {
|
||||
Smb.deleteFile(imgFilesE.getFilePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ public class ImgFilesGatewayImpl implements ImgFilesGateway {
|
|||
|
||||
@Override
|
||||
public Boolean deletedImgFilesByIds(Long[] ids) {
|
||||
|
||||
return imgFilesRepository.removeByIds(Arrays.asList(ids));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
/**
|
||||
* web-infrastructure
|
||||
*
|
||||
* @Author zhangyue
|
||||
* @Date 2025-10-30 16:10:06
|
||||
*/
|
||||
|
|
@ -35,6 +36,9 @@ public class ImgFilesDO extends BaseDO {
|
|||
//企业id
|
||||
@ApiModelProperty(value = "企业id")
|
||||
private Long corpinfoId;
|
||||
//企业id
|
||||
@ApiModelProperty(value = "md5")
|
||||
private String md5;
|
||||
|
||||
public ImgFilesDO(String imgFilesId) {
|
||||
this.imgFilesId = imgFilesId;
|
||||
|
|
|
|||
|
|
@ -18,5 +18,8 @@ public interface ImgFilesRepository extends BaseRepository<ImgFilesDO> {
|
|||
|
||||
|
||||
List<ImgFilesDO> listAll(Map<String,Object> parmas);
|
||||
|
||||
|
||||
void deleteList(Long[] ids);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ public class DepartmentRepositoryImpl extends BaseRepositoryImpl<DepartmentMappe
|
|||
public List<DepartmentDO> listTree(Map<String, Object> parmas) {
|
||||
QueryWrapper<DepartmentDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper = PageQueryHelper.createPageQueryWrapper(queryWrapper, parmas);
|
||||
SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
queryWrapper.eq("tenant_id",ssoUser.getTenantId());
|
||||
// SSOUser ssoUser = AuthContext.getCurrentUser();
|
||||
// queryWrapper.eq("tenant_id",ssoUser.getTenantId());
|
||||
queryWrapper.orderByDesc("dep_order");
|
||||
List<DepartmentDO> departmentDOList = departmentMapper.selectList(queryWrapper);
|
||||
if (CollUtil.isEmpty(departmentDOList)) {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.zcloud.basic.info.persistence.repository.impl;
|
|||
import com.alibaba.cola.dto.MultiResponse;
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
|
|
@ -46,5 +47,14 @@ public class ImgFilesRepositoryImpl extends BaseRepositoryImpl<ImgFilesMapper, I
|
|||
// queryWrapper.select("id", "img_files_id", "file_path", "type", "foreign_key", "file_name", "corpinfo_id");
|
||||
return imgFilesMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteList(Long[] ids) {
|
||||
UpdateWrapper<ImgFilesDO> updateWrapper = new UpdateWrapper<>();
|
||||
updateWrapper.in("id", ids);
|
||||
updateWrapper.eq("delete_enum" ,"FALSE");
|
||||
updateWrapper.set("delete_enum", "TRUE");
|
||||
imgFilesMapper.update(null, updateWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue