1. 新增物料相关接口
2. 修复部分服务因为包名设置错误导致无法采集日志的错误
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
package com.zt.plat.module.base.api.businessdictionarytype;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.base.api.businessdictionarytype.dto.BusinessDictionaryDataDTO;
|
||||
import com.zt.plat.module.base.api.businessdictionarytype.dto.BusinessDictionaryTypePageReqDTO;
|
||||
import com.zt.plat.module.base.api.businessdictionarytype.dto.BusinessDictionaryTypeRespDTO;
|
||||
import com.zt.plat.module.base.api.businessdictionarytype.dto.BusinessDictionaryTypeSaveReqDTO;
|
||||
import com.zt.plat.module.base.controller.admin.businessdictionarytype.vo.BusinessDictionaryTypePageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.businessdictionarytype.vo.BusinessDictionaryTypeRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.businessdictionarytype.vo.BusinessDictionaryTypeSaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.businessdictionarytype.BusinessDictionaryDataDO;
|
||||
import com.zt.plat.module.base.dal.dataobject.businessdictionarytype.BusinessDictionaryTypeDO;
|
||||
import com.zt.plat.module.base.service.businessdictionarytype.BusinessDictionaryTypeService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class BusinessDictionaryTypeApiImpl implements BusinessDictionaryTypeApi {
|
||||
|
||||
@Resource
|
||||
private BusinessDictionaryTypeService businessDictionaryTypeService;
|
||||
|
||||
@Override
|
||||
public CommonResult<BusinessDictionaryTypeRespDTO> createBusinessDictionaryType(BusinessDictionaryTypeSaveReqDTO createReqDTO) {
|
||||
BusinessDictionaryTypeRespVO respVO = businessDictionaryTypeService.createBusinessDictionaryType(convertSaveReq(createReqDTO));
|
||||
return success(BeanUtils.toBean(respVO, BusinessDictionaryTypeRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateBusinessDictionaryType(BusinessDictionaryTypeSaveReqDTO updateReqDTO) {
|
||||
businessDictionaryTypeService.updateBusinessDictionaryType(convertSaveReq(updateReqDTO));
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteBusinessDictionaryType(Long id) {
|
||||
businessDictionaryTypeService.deleteBusinessDictionaryType(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteBusinessDictionaryTypeList(List<Long> ids) {
|
||||
businessDictionaryTypeService.deleteBusinessDictionaryTypeListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<BusinessDictionaryTypeRespDTO> getBusinessDictionaryType(Long id) {
|
||||
BusinessDictionaryTypeDO typeDO = businessDictionaryTypeService.getBusinessDictionaryType(id);
|
||||
return success(BeanUtils.toBean(typeDO, BusinessDictionaryTypeRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<BusinessDictionaryTypeRespDTO>> getBusinessDictionaryTypePage(BusinessDictionaryTypePageReqDTO pageReqDTO) {
|
||||
BusinessDictionaryTypePageReqVO pageReqVO = BeanUtils.toBean(pageReqDTO, BusinessDictionaryTypePageReqVO.class);
|
||||
PageResult<BusinessDictionaryTypeDO> pageResult = businessDictionaryTypeService.getBusinessDictionaryTypePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, BusinessDictionaryTypeRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<BusinessDictionaryDataDTO>> getBusinessDictionaryDataListByDictionaryTypeId(Long dictionaryTypeId) {
|
||||
List<BusinessDictionaryDataDO> list = businessDictionaryTypeService.getBusinessDictionaryDataListByDictionaryTypeId(dictionaryTypeId);
|
||||
return success(BeanUtils.toBean(list, BusinessDictionaryDataDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<BusinessDictionaryDataDTO>> getBusinessDictionaryDataListByType(String type) {
|
||||
List<BusinessDictionaryDataDO> list = businessDictionaryTypeService.getBusinessDictionaryDataListByType(type);
|
||||
return success(BeanUtils.toBean(list, BusinessDictionaryDataDTO.class));
|
||||
}
|
||||
|
||||
private BusinessDictionaryTypeSaveReqVO convertSaveReq(BusinessDictionaryTypeSaveReqDTO dto) {
|
||||
BusinessDictionaryTypeSaveReqVO reqVO = BeanUtils.toBean(dto, BusinessDictionaryTypeSaveReqVO.class);
|
||||
if (dto.getBusinessDictionaryDatas() != null && !dto.getBusinessDictionaryDatas().isEmpty()) {
|
||||
reqVO.setBusinessDictionaryDatas(BeanUtils.toBean(dto.getBusinessDictionaryDatas(), BusinessDictionaryDataDO.class));
|
||||
}
|
||||
return reqVO;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.base.api.departmentmaterial;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialPageReqDTO;
|
||||
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialRespDTO;
|
||||
import com.zt.plat.module.base.api.departmentmaterial.dto.DepartmentMaterialSaveReqDTO;
|
||||
import com.zt.plat.module.base.controller.admin.departmentmaterial.vo.DepartmentMaterialPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.departmentmaterial.vo.DepartmentMaterialRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.departmentmaterial.vo.DepartmentMaterialSaveReqVO;
|
||||
import com.zt.plat.module.base.service.departmentmaterial.DepartmentMaterialService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class DepartmentMaterialApiImpl implements DepartmentMaterialApi {
|
||||
|
||||
@Resource
|
||||
private DepartmentMaterialService departmentMaterialService;
|
||||
|
||||
@Override
|
||||
public CommonResult<DepartmentMaterialRespDTO> createDepartmentMaterial(DepartmentMaterialSaveReqDTO createReqDTO) {
|
||||
DepartmentMaterialRespVO respVO = departmentMaterialService.createDepartmentMaterial(BeanUtils.toBean(createReqDTO, DepartmentMaterialSaveReqVO.class));
|
||||
return success(BeanUtils.toBean(respVO, DepartmentMaterialRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateDepartmentMaterial(DepartmentMaterialSaveReqDTO updateReqDTO) {
|
||||
departmentMaterialService.updateDepartmentMaterial(BeanUtils.toBean(updateReqDTO, DepartmentMaterialSaveReqVO.class));
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteDepartmentMaterial(Long id) {
|
||||
departmentMaterialService.deleteDepartmentMaterial(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteDepartmentMaterialList(List<Long> ids) {
|
||||
departmentMaterialService.deleteDepartmentMaterialListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<DepartmentMaterialRespDTO> getDepartmentMaterial(Long id) {
|
||||
DepartmentMaterialRespVO respVO = departmentMaterialService.getDepartmentMaterial(id);
|
||||
return success(BeanUtils.toBean(respVO, DepartmentMaterialRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<DepartmentMaterialRespDTO>> getDepartmentMaterialPage(DepartmentMaterialPageReqDTO pageReqDTO) {
|
||||
DepartmentMaterialPageReqVO pageReqVO = BeanUtils.toBean(pageReqDTO, DepartmentMaterialPageReqVO.class);
|
||||
PageResult<DepartmentMaterialRespVO> pageResult = departmentMaterialService.getDepartmentMaterialPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DepartmentMaterialRespDTO.class));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.zt.plat.module.base.api.materialclasses;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import com.zt.plat.module.base.api.materialclasses.dto.MaterialClassesPageReqDTO;
|
||||
import com.zt.plat.module.base.api.materialclasses.dto.MaterialClassesRespDTO;
|
||||
import com.zt.plat.module.base.api.materialclasses.dto.MaterialClassesSaveReqDTO;
|
||||
import com.zt.plat.module.base.api.materialclasses.dto.MaterialClassesTreeRespDTO;
|
||||
import com.zt.plat.module.base.controller.admin.materialclasses.vo.MaterialClassesPageReqVO;
|
||||
import com.zt.plat.module.base.controller.admin.materialclasses.vo.MaterialClassesRespVO;
|
||||
import com.zt.plat.module.base.controller.admin.materialclasses.vo.MaterialClassesSaveReqVO;
|
||||
import com.zt.plat.module.base.dal.dataobject.materialclasses.MaterialClassesDO;
|
||||
import com.zt.plat.module.base.service.materialclasses.MaterialClassesService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@RestController
|
||||
@Validated
|
||||
public class MaterialClassesApiImpl implements MaterialClassesApi {
|
||||
|
||||
@Resource
|
||||
private MaterialClassesService materialClassesService;
|
||||
|
||||
@Override
|
||||
public CommonResult<MaterialClassesRespDTO> createMaterialClasses(MaterialClassesSaveReqDTO createReqDTO) {
|
||||
MaterialClassesRespVO respVO = materialClassesService.createMaterialClasses(BeanUtils.toBean(createReqDTO, MaterialClassesSaveReqVO.class));
|
||||
return success(BeanUtils.toBean(respVO, MaterialClassesRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> updateMaterialClasses(MaterialClassesSaveReqDTO updateReqDTO) {
|
||||
materialClassesService.updateMaterialClasses(BeanUtils.toBean(updateReqDTO, MaterialClassesSaveReqVO.class));
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteMaterialClasses(Long id) {
|
||||
materialClassesService.deleteMaterialClasses(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<Boolean> deleteMaterialClassesList(List<Long> ids) {
|
||||
materialClassesService.deleteMaterialClassesListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<MaterialClassesRespDTO> getMaterialClasses(Long id) {
|
||||
MaterialClassesDO classesDO = materialClassesService.getMaterialClasses(id);
|
||||
return success(BeanUtils.toBean(classesDO, MaterialClassesRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<PageResult<MaterialClassesRespDTO>> getMaterialClassesPage(MaterialClassesPageReqDTO pageReqDTO) {
|
||||
MaterialClassesPageReqVO pageReqVO = BeanUtils.toBean(pageReqDTO, MaterialClassesPageReqVO.class);
|
||||
PageResult<MaterialClassesDO> pageResult = materialClassesService.getMaterialClassesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaterialClassesRespDTO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public CommonResult<List<MaterialClassesTreeRespDTO>> getMaterialClassesTree() {
|
||||
List<MaterialClassesDO> list = materialClassesService.getMaterialClassesList();
|
||||
return success(buildTree(list));
|
||||
}
|
||||
|
||||
private List<MaterialClassesTreeRespDTO> buildTree(List<MaterialClassesDO> list) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
Map<Long, MaterialClassesTreeRespDTO> nodeMap = new LinkedHashMap<>();
|
||||
list.stream()
|
||||
.sorted(Comparator.comparing(MaterialClassesDO::getId))
|
||||
.forEach(item -> nodeMap.put(item.getId(), BeanUtils.toBean(item, MaterialClassesTreeRespDTO.class)));
|
||||
List<MaterialClassesTreeRespDTO> roots = new ArrayList<>();
|
||||
nodeMap.values().forEach(node -> {
|
||||
Long parentId = node.getParentId();
|
||||
if (parentId == null || parentId == 0 || !nodeMap.containsKey(parentId)) {
|
||||
roots.add(node);
|
||||
} else {
|
||||
nodeMap.get(parentId).getChildren().add(node);
|
||||
}
|
||||
});
|
||||
return roots;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
<configuration>
|
||||
<!-- 引用 Spring Boot 的 logback 基础配置 -->
|
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
|
||||
<!-- 变量 yudao.info.base-package,基础业务包 -->
|
||||
<springProperty scope="context" name="yudao.info.base-package" source="yudao.info.base-package"/>
|
||||
<!-- 变量 zt.info.base-package,基础业务包 -->
|
||||
<springProperty scope="context" name="zt.info.base-package" source="zt.info.base-package"/>
|
||||
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level:级别从左显示 5 个字符宽度,%msg:日志消息,%n是换行符 -->
|
||||
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user