Merge branch 'dev' into test
* dev: 组织架构物料管理增加克隆复制功能. http://172.16.46.63:31560/index.php?m=task&f=view&taskID=684 1. 统一计量单位菜单权限
This commit is contained in:
12
pom.xml
12
pom.xml
@@ -63,6 +63,10 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>${maven-compiler-plugin.version}</version>
|
<version>${maven-compiler-plugin.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
<!-- Java 9+ 推荐使用 release 参数 -->
|
||||||
|
<release>${java.version}</release>
|
||||||
<annotationProcessorPaths>
|
<annotationProcessorPaths>
|
||||||
<path>
|
<path>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -229,6 +233,14 @@
|
|||||||
<config.version>1.0.0</config.version>
|
<config.version>1.0.0</config.version>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>klw-dev</id>
|
||||||
|
<properties>
|
||||||
|
<env.name>dev</env.name>
|
||||||
|
<!--Nacos 配置-->
|
||||||
|
<config.namespace>klw</config.namespace>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.zt.plat.module.base.controller.admin.departmentmaterial;
|
package com.zt.plat.module.base.controller.admin.departmentmaterial;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -103,4 +105,21 @@ public class DepartmentMaterialController {
|
|||||||
list);
|
list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/clone")
|
||||||
|
@Operation(summary = "克隆组织架构物料")
|
||||||
|
@Parameter(name = "ids", description = "要克隆的数据ID", required = true)
|
||||||
|
@Parameter(name = "deptId", description = "目标组织架构ID", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:department-material:clone')")
|
||||||
|
@Transactional
|
||||||
|
public CommonResult<Boolean> getDepartmentMaterial(@RequestBody DepartmentMaterialCloneReqVO req) {
|
||||||
|
List<DepartmentMaterialRespVO> list = departmentMaterialService.getDepartmentMaterialByIds(req.getIds());
|
||||||
|
for (DepartmentMaterialRespVO departmentMaterial : list) {
|
||||||
|
DepartmentMaterialSaveReqVO createReqVO = BeanUtils.toBean(departmentMaterial, DepartmentMaterialSaveReqVO.class);
|
||||||
|
createReqVO.setId( null);
|
||||||
|
createReqVO.setDeptId(req.getDeptId());
|
||||||
|
departmentMaterialService.createDepartmentMaterial(createReqVO);
|
||||||
|
}
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.departmentmaterial.vo;
|
||||||
|
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 克隆组织架构物料 请求
|
||||||
|
* 2026/1/6 17:55
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class DepartmentMaterialCloneReqVO {
|
||||||
|
|
||||||
|
@NotEmpty(message = "批量克隆 ids 不能为空")
|
||||||
|
private List<Long> ids;
|
||||||
|
|
||||||
|
@NotEmpty(message = "目标组织架构ID不能为空")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -51,6 +51,14 @@ public interface DepartmentMaterialService {
|
|||||||
*/
|
*/
|
||||||
DepartmentMaterialRespVO getDepartmentMaterial(Long id);
|
DepartmentMaterialRespVO getDepartmentMaterial(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据多个ID获得组织架构物料列表
|
||||||
|
*
|
||||||
|
* @param ids 编号 list
|
||||||
|
* @return 组织架构物料列表
|
||||||
|
*/
|
||||||
|
List<DepartmentMaterialRespVO> getDepartmentMaterialByIds(List<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得组织架构物料分页
|
* 获得组织架构物料分页
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -106,7 +106,16 @@ public class DepartmentMaterialServiceImpl implements DepartmentMaterialService
|
|||||||
if (data == null) {
|
if (data == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return CollUtil.getFirst(decorateDepartmentMaterials(Collections.singletonList(data)));
|
return CollUtil.getFirst(decorateDepartmentMaterials(Collections.singletonList(data)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DepartmentMaterialRespVO> getDepartmentMaterialByIds(List<Long> ids) {
|
||||||
|
List<DepartmentMaterialDO> data = departmentMaterialMapper.selectByIds(ids);
|
||||||
|
if (org.apache.commons.collections4.CollectionUtils.isEmpty( data)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return decorateDepartmentMaterials(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user