diff --git a/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/base/enums/ErrorCodeConstants.java b/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/base/enums/ErrorCodeConstants.java index f2e0c5af..5bccb318 100644 --- a/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/base/enums/ErrorCodeConstants.java +++ b/zt-module-base/zt-module-base-api/src/main/java/com/zt/plat/module/base/enums/ErrorCodeConstants.java @@ -22,15 +22,7 @@ public interface ErrorCodeConstants { ErrorCode WAREHOUSE_CODE_EXISTS = new ErrorCode(1_001_000_002, "库位编码已存在"); ErrorCode FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_001, "工厂不存在"); ErrorCode TAX_NOT_EXISTS = new ErrorCode(1_001_000_001, "公司关系不存在"); - - - ErrorCode BUSINESS_RULE_NOT_EXISTS = new ErrorCode(1_027_100_001, "规则模型不存在"); - ErrorCode BUSINESS_ALGORITHM_NOT_EXISTS = new ErrorCode(1_027_100_002, "算法模型不存在"); - ErrorCode BUSINESS_DIMENSION_NOT_EXISTS = new ErrorCode(1_027_200_001, "经营指标维度不存在"); - ErrorCode BUSINESS_INDICATOR_NOT_EXISTS = new ErrorCode(1_027_200_002, "经营指标不存在"); ErrorCode BUSINESS_DICTIONARY_TYPE_NOT_EXISTS = new ErrorCode(1_027_200_003, "业务字典类型不存在"); - ErrorCode BUSINESS_DEPARTMENT_INDICATOR_NOT_EXISTS = new ErrorCode(1_027_200_004, "部门持有指标不存在"); - // ========== 模板文档管理系统 1-006-xxx-xxx ========== // 模板分类 1-006-001-xxx ErrorCode TEMPLATE_CATEGORY_NOT_EXISTS = new ErrorCode(1_006_001_001, "模板分类不存在"); diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/BusinessAlgorithmController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/BusinessAlgorithmController.java deleted file mode 100644 index bcf41273..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/BusinessAlgorithmController.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessalgorithm; - -import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; - -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.*; -import jakarta.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; -import com.zt.plat.framework.common.pojo.PageParam; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.CommonResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import static com.zt.plat.framework.common.pojo.CommonResult.success; - -import com.zt.plat.framework.excel.core.util.ExcelUtils; - -import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; -import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; - -import com.zt.plat.module.base.controller.admin.businessalgorithm.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessalgorithm.BusinessAlgorithmDO; -import com.zt.plat.module.base.service.businessalgorithm.BusinessAlgorithmService; - -@Tag(name = "管理后台 - 业务算法") -@RestController -@RequestMapping("/base/business-algorithm") -@Validated -public class BusinessAlgorithmController implements BusinessControllerMarker { - - - @Resource - private BusinessAlgorithmService businessAlgorithmService; - - @PostMapping("/create") - @Operation(summary = "创建业务算法") - @PreAuthorize("@ss.hasPermission('base:business-algorithm:create')") - public CommonResult createBusinessAlgorithm(@Valid @RequestBody BusinessAlgorithmSaveReqVO createReqVO) { - return success(businessAlgorithmService.createBusinessAlgorithm(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新业务算法") - @PreAuthorize("@ss.hasPermission('base:business-algorithm:update')") - public CommonResult updateBusinessAlgorithm(@Valid @RequestBody BusinessAlgorithmSaveReqVO updateReqVO) { - businessAlgorithmService.updateBusinessAlgorithm(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除业务算法") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('base:business-algorithm:delete')") - public CommonResult deleteBusinessAlgorithm(@RequestParam("id") Long id) { - businessAlgorithmService.deleteBusinessAlgorithm(id); - return success(true); - } - - @DeleteMapping("/delete-list") - @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除业务算法") - @PreAuthorize("@ss.hasPermission('base:business-algorithm:delete')") - public CommonResult deleteBusinessAlgorithmList(@RequestBody BatchDeleteReqVO req) { - businessAlgorithmService.deleteBusinessAlgorithmListByIds(req.getIds()); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得业务算法") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('base:business-algorithm:query')") - public CommonResult getBusinessAlgorithm(@RequestParam("id") Long id) { - BusinessAlgorithmDO businessAlgorithm = businessAlgorithmService.getBusinessAlgorithm(id); - return success(BeanUtils.toBean(businessAlgorithm, BusinessAlgorithmRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得业务算法分页") - @PreAuthorize("@ss.hasPermission('base:business-algorithm:query')") - public CommonResult> getBusinessAlgorithmPage(@Valid BusinessAlgorithmPageReqVO pageReqVO) { - PageResult pageResult = businessAlgorithmService.getBusinessAlgorithmPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessAlgorithmRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出业务算法 Excel") - @PreAuthorize("@ss.hasPermission('base:business-algorithm:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportBusinessAlgorithmExcel(@Valid BusinessAlgorithmPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessAlgorithmService.getBusinessAlgorithmPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "业务算法.xls", "数据", BusinessAlgorithmRespVO.class, - BeanUtils.toBean(list, BusinessAlgorithmRespVO.class)); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmPageReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmPageReqVO.java deleted file mode 100644 index 16ed9f49..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmPageReqVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessalgorithm.vo; - -import lombok.*; -import io.swagger.v3.oas.annotations.media.Schema; -import com.zt.plat.framework.common.pojo.PageParam; - -@Schema(description = "管理后台 - 业务算法分页 Request VO") -@Data -public class BusinessAlgorithmPageReqVO extends PageParam { - - @Schema(description = "类型") - private String typeValue; - - @Schema(description = "状态") - private String statusValue; - - @Schema(description = "算法编码") - private String code; - - @Schema(description = "算法名称", example = "王五") - private String name; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmRespVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmRespVO.java deleted file mode 100644 index 04fa4504..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmRespVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessalgorithm.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; - -@Schema(description = "管理后台 - 业务算法 Response VO") -@Data -@ExcelIgnoreUnannotated -public class BusinessAlgorithmRespVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24454") - @ExcelProperty("主键ID") - private Long id; - - @Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("类型") - private String typeValue; - - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("状态") - private String statusValue; - - @Schema(description = "算法编码", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("算法编码") - private String code; - - @Schema(description = "算法名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @ExcelProperty("算法名称") - private String name; - - @Schema(description = "算法描述", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("算法描述") - private String description; - - @Schema(description = "算法代码") - @ExcelProperty("算法代码") - private String coding; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建时间") - private LocalDateTime createTime; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmSaveReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmSaveReqVO.java deleted file mode 100644 index 4f9863e5..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessalgorithm/vo/BusinessAlgorithmSaveReqVO.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessalgorithm.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import jakarta.validation.constraints.*; - -@Schema(description = "管理后台 - 业务算法新增/修改 Request VO") -@Data -public class BusinessAlgorithmSaveReqVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "24454") - private Long id; - - @Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "类型不能为空") - private String typeValue; - - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "状态不能为空") - private String statusValue; - - @Schema(description = "算法编码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "算法编码不能为空") - private String code; - - @Schema(description = "算法名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @NotEmpty(message = "算法名称不能为空") - private String name; - - @Schema(description = "算法描述", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "算法描述不能为空") - private String description; - - @Schema(description = "算法代码") - private String coding; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/BusinessDepartmentIndicatorController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/BusinessDepartmentIndicatorController.java deleted file mode 100644 index ff8185a6..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/BusinessDepartmentIndicatorController.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessdepartmentindicator; - -import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; - -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; - -import jakarta.validation.*; -import jakarta.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; -import com.zt.plat.framework.common.pojo.PageParam; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.CommonResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import static com.zt.plat.framework.common.pojo.CommonResult.success; - -import com.zt.plat.framework.excel.core.util.ExcelUtils; - -import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; -import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; - -import com.zt.plat.module.base.controller.admin.businessdepartmentindicator.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessdepartmentindicator.BusinessDepartmentIndicatorDO; -import com.zt.plat.module.base.service.businessdepartmentindicator.BusinessDepartmentIndicatorService; - -@Tag(name = "管理后台 - 部门持有指标") -@RestController -@RequestMapping("/base/business-department-indicator") -@Validated -public class BusinessDepartmentIndicatorController implements BusinessControllerMarker { - - - @Resource - private BusinessDepartmentIndicatorService businessDepartmentIndicatorService; - - @PostMapping("/create") - @Operation(summary = "创建部门持有指标") - @PreAuthorize("@ss.hasPermission('base:business-department-indicator:create')") - public CommonResult createBusinessDepartmentIndicator(@Valid @RequestBody BusinessDepartmentIndicatorSaveReqVO createReqVO) { - return success(businessDepartmentIndicatorService.createBusinessDepartmentIndicator(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新部门持有指标") - @PreAuthorize("@ss.hasPermission('base:business-department-indicator:update')") - public CommonResult updateBusinessDepartmentIndicator(@Valid @RequestBody BusinessDepartmentIndicatorSaveReqVO updateReqVO) { - businessDepartmentIndicatorService.updateBusinessDepartmentIndicator(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除部门持有指标") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('base:business-department-indicator:delete')") - public CommonResult deleteBusinessDepartmentIndicator(@RequestParam("id") Long id) { - businessDepartmentIndicatorService.deleteBusinessDepartmentIndicator(id); - return success(true); - } - - @DeleteMapping("/delete-list") - @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除部门持有指标") - @PreAuthorize("@ss.hasPermission('base:business-department-indicator:delete')") - public CommonResult deleteBusinessDepartmentIndicatorList(@RequestBody BatchDeleteReqVO req) { - businessDepartmentIndicatorService.deleteBusinessDepartmentIndicatorListByIds(req.getIds()); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得部门持有指标") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('base:business-department-indicator:query')") - public CommonResult getBusinessDepartmentIndicator(@RequestParam("id") Long id) { - BusinessDepartmentIndicatorDO businessDepartmentIndicator = businessDepartmentIndicatorService.getBusinessDepartmentIndicator(id); - return success(BeanUtils.toBean(businessDepartmentIndicator, BusinessDepartmentIndicatorRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得部门持有指标分页") - @PreAuthorize("@ss.hasPermission('base:business-department-indicator:query')") - public CommonResult> getBusinessDepartmentIndicatorPage(@Valid BusinessDepartmentIndicatorPageReqVO pageReqVO) { - PageResult pageResult = businessDepartmentIndicatorService.getBusinessDepartmentIndicatorPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessDepartmentIndicatorRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出部门持有指标 Excel") - @PreAuthorize("@ss.hasPermission('base:business-department-indicator:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportBusinessDepartmentIndicatorExcel(@Valid BusinessDepartmentIndicatorPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessDepartmentIndicatorService.getBusinessDepartmentIndicatorPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "部门持有指标.xls", "数据", BusinessDepartmentIndicatorRespVO.class, - BeanUtils.toBean(list, BusinessDepartmentIndicatorRespVO.class)); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorPageReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorPageReqVO.java deleted file mode 100644 index 4c3693b9..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorPageReqVO.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessdepartmentindicator.vo; - -import lombok.*; -import io.swagger.v3.oas.annotations.media.Schema; -import com.zt.plat.framework.common.pojo.PageParam; - -@Schema(description = "管理后台 - 部门持有指标分页 Request VO") -@Data -public class BusinessDepartmentIndicatorPageReqVO extends PageParam { - - @Schema(description = "指标ID", example = "11268") - private Long indicatorId; - - @Schema(description = "是否关键指标") - private Integer isKey; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorRespVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorRespVO.java deleted file mode 100644 index 5f517dc8..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorRespVO.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessdepartmentindicator.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; - -import java.time.LocalDateTime; - -import com.alibaba.excel.annotation.*; - -@Schema(description = "管理后台 - 部门持有指标 Response VO") -@Data -@ExcelIgnoreUnannotated -public class BusinessDepartmentIndicatorRespVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32066") - @ExcelProperty("主键ID") - private Long id; - - @Schema(description = "指标ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11268") - @ExcelProperty("指标ID") - private Long indicatorId; - - @Schema(description = "计量单位ID", example = "16200") - @ExcelProperty("计量单位ID") - private Long unitId; - - @Schema(description = "规则ID", example = "11174") - @ExcelProperty("规则ID") - private Long ruleId; - - @Schema(description = "算法ID", example = "20986") - @ExcelProperty("算法ID") - private Long algorithmId; - - @Schema(description = "实体ID", example = "2678") - @ExcelProperty("实体ID") - private Long entityId; - - @Schema(description = "值") - @ExcelProperty("值") - private String value; - - @Schema(description = "是否关键指标") - @ExcelProperty("是否关键指标") - private Integer isKey; - - @Schema(description = "排序号") - @ExcelProperty("排序号") - private Long sort; - - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("备注") - private String remark; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建时间") - private LocalDateTime createTime; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorSaveReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorSaveReqVO.java deleted file mode 100644 index 8598898d..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdepartmentindicator/vo/BusinessDepartmentIndicatorSaveReqVO.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessdepartmentindicator.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import jakarta.validation.constraints.*; - -@Schema(description = "管理后台 - 部门持有指标新增/修改 Request VO") -@Data -public class BusinessDepartmentIndicatorSaveReqVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32066") - private Long id; - - @Schema(description = "指标ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11268") - @NotNull(message = "指标ID不能为空") - private Long indicatorId; - - @Schema(description = "计量单位ID", example = "16200") - private Long unitId; - - @Schema(description = "规则ID", example = "11174") - private Long ruleId; - - @Schema(description = "算法ID", example = "20986") - private Long algorithmId; - - @Schema(description = "实体ID", example = "2678") - private Long entityId; - - @Schema(description = "值") - private String value; - - @Schema(description = "是否关键指标") - private Integer isKey; - - @Schema(description = "排序号") - private Long sort; - - @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "备注不能为空") - private String remark; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/BusinessDimensionController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/BusinessDimensionController.java deleted file mode 100644 index f7ef5f2a..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/BusinessDimensionController.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessdimension; - -import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; - -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; - -import jakarta.validation.constraints.*; -import jakarta.validation.*; -import jakarta.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; -import com.zt.plat.framework.common.pojo.PageParam; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.CommonResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import static com.zt.plat.framework.common.pojo.CommonResult.success; - -import com.zt.plat.framework.excel.core.util.ExcelUtils; - -import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; -import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; - -import com.zt.plat.module.base.controller.admin.businessdimension.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessdimension.BusinessDimensionDO; -import com.zt.plat.module.base.service.businessdimension.BusinessDimensionService; - -@Tag(name = "管理后台 - 经营指标维度") -@RestController -@RequestMapping("/base/business-dimension") -@Validated -public class BusinessDimensionController implements BusinessControllerMarker { - - - @Resource - private BusinessDimensionService businessDimensionService; - - @PostMapping("/create") - @Operation(summary = "创建经营指标维度") - @PreAuthorize("@ss.hasPermission('base:business-dimension:create')") - public CommonResult createBusinessDimension(@Valid @RequestBody BusinessDimensionSaveReqVO createReqVO) { - return success(businessDimensionService.createBusinessDimension(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新经营指标维度") - @PreAuthorize("@ss.hasPermission('base:business-dimension:update')") - public CommonResult updateBusinessDimension(@Valid @RequestBody BusinessDimensionSaveReqVO updateReqVO) { - businessDimensionService.updateBusinessDimension(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除经营指标维度") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('base:business-dimension:delete')") - public CommonResult deleteBusinessDimension(@RequestParam("id") Long id) { - businessDimensionService.deleteBusinessDimension(id); - return success(true); - } - - @DeleteMapping("/delete-list") - @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除经营指标维度") - @PreAuthorize("@ss.hasPermission('base:business-dimension:delete')") - public CommonResult deleteBusinessDimensionList(@RequestBody BatchDeleteReqVO req) { - businessDimensionService.deleteBusinessDimensionListByIds(req.getIds()); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得经营指标维度") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('base:business-dimension:query')") - public CommonResult getBusinessDimension(@RequestParam("id") Long id) { - BusinessDimensionDO businessDimension = businessDimensionService.getBusinessDimension(id); - return success(BeanUtils.toBean(businessDimension, BusinessDimensionRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得经营指标维度分页") - @PreAuthorize("@ss.hasPermission('base:business-dimension:query')") - public CommonResult> getBusinessDimensionPage(@Valid BusinessDimensionPageReqVO pageReqVO) { - PageResult pageResult = businessDimensionService.getBusinessDimensionPage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessDimensionRespVO.class)); - } - - @GetMapping("/list-by-parent-id") - @Operation(summary = "获得经营指标维度列表通过父级ID") - @Parameter(name = "parentId", description = "父级ID", example = "0") - @PreAuthorize("@ss.hasPermission('base:business-dimension:query')") - public CommonResult> getBusinessDimensionListByParentId(@RequestParam(value = "parentId", required = false) Long parentId, - @RequestParam(value = "level", required = false) Integer level) { - List list = businessDimensionService.getBusinessDimensionListByParentId(parentId, level); - return success(BeanUtils.toBean(list, BusinessDimensionRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出经营指标维度 Excel") - @PreAuthorize("@ss.hasPermission('base:business-dimension:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportBusinessDimensionExcel(@Valid BusinessDimensionPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessDimensionService.getBusinessDimensionPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "经营指标维度.xls", "数据", BusinessDimensionRespVO.class, - BeanUtils.toBean(list, BusinessDimensionRespVO.class)); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionPageReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionPageReqVO.java deleted file mode 100644 index 45b7db1a..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionPageReqVO.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessdimension.vo; - -import lombok.*; -import io.swagger.v3.oas.annotations.media.Schema; -import com.zt.plat.framework.common.pojo.PageParam; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.LocalDateTime; - -import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; - -@Schema(description = "管理后台 - 经营指标维度分页 Request VO") -@Data -public class BusinessDimensionPageReqVO extends PageParam { - - @Schema(description = "维度类型") - private String typeValue; - - @Schema(description = "维度编码") - private String code; - - @Schema(description = "维度名称", example = "王五") - private String name; - - @Schema(description = "创建时间") - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) - private LocalDateTime[] createTime; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionRespVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionRespVO.java deleted file mode 100644 index 57b0b363..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionRespVO.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessdimension.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; -import com.zt.plat.framework.excel.core.annotations.DictFormat; -import com.zt.plat.framework.excel.core.convert.DictConvert; - -@Schema(description = "管理后台 - 经营指标维度 Response VO") -@Data -@ExcelIgnoreUnannotated -public class BusinessDimensionRespVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5174") - @ExcelProperty("主键ID") - private Long id; - - @Schema(description = "父级ID", example = "29218") - @ExcelProperty("父级ID") - private Long parentId; - - @Schema(description = "维度类型", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty(value = "维度类型", converter = DictConvert.class) - @DictFormat("demo_contract") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 - private String typeValue; - - @Schema(description = "维度编码", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("维度编码") - private String code; - - @Schema(description = "维度名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @ExcelProperty("维度名称") - private String name; - - @Schema(description = "备注") - @ExcelProperty("备注") - private String remark; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建时间") - private LocalDateTime createTime; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionSaveReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionSaveReqVO.java deleted file mode 100644 index 52d9b416..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessdimension/vo/BusinessDimensionSaveReqVO.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessdimension.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import jakarta.validation.constraints.*; - -@Schema(description = "管理后台 - 经营指标维度新增/修改 Request VO") -@Data -public class BusinessDimensionSaveReqVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5174") - private Long id; - - @Schema(description = "父级ID", example = "29218") - private Long parentId; - - @Schema(description = "维度类型", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "维度类型不能为空") - private String typeValue; - - @Schema(description = "维度编码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "维度编码不能为空") - private String code; - - @Schema(description = "维度名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") - @NotEmpty(message = "维度名称不能为空") - private String name; - - @Schema(description = "备注") - private String remark; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/BusinessIndicatorController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/BusinessIndicatorController.java deleted file mode 100644 index 41febaf2..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/BusinessIndicatorController.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessindicator; - -import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; -import com.zt.plat.framework.business.annotation.FileUploadController; -import com.zt.plat.framework.business.controller.AbstractFileUploadController; - -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.*; -import jakarta.servlet.http.*; -import java.util.*; -import java.io.IOException; - -import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; -import com.zt.plat.framework.common.pojo.PageParam; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.CommonResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import static com.zt.plat.framework.common.pojo.CommonResult.success; - -import com.zt.plat.framework.excel.core.util.ExcelUtils; - -import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; -import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; - -import com.zt.plat.module.base.controller.admin.businessindicator.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessindicator.BusinessIndicatorDO; -import com.zt.plat.module.base.service.businessindicator.BusinessIndicatorService; - -@Tag(name = "管理后台 - 经营指标") -@RestController -@RequestMapping("/base/business-indicator") -@Validated -@FileUploadController(source = "base.businessindicator") -public class BusinessIndicatorController extends AbstractFileUploadController implements BusinessControllerMarker{ - - static { - FileUploadController annotation = BusinessIndicatorController.class.getAnnotation(FileUploadController.class); - if (annotation != null) { - setFileUploadInfo(annotation); - } - } - - @Resource - private BusinessIndicatorService businessIndicatorService; - - @PostMapping("/create") - @Operation(summary = "创建经营指标") - @PreAuthorize("@ss.hasPermission('base:business-indicator:create')") - public CommonResult createBusinessIndicator(@Valid @RequestBody BusinessIndicatorSaveReqVO createReqVO) { - return success(businessIndicatorService.createBusinessIndicator(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新经营指标") - @PreAuthorize("@ss.hasPermission('base:business-indicator:update')") - public CommonResult updateBusinessIndicator(@Valid @RequestBody BusinessIndicatorSaveReqVO updateReqVO) { - businessIndicatorService.updateBusinessIndicator(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除经营指标") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('base:business-indicator:delete')") - public CommonResult deleteBusinessIndicator(@RequestParam("id") Long id) { - businessIndicatorService.deleteBusinessIndicator(id); - return success(true); - } - - @DeleteMapping("/delete-list") - @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除经营指标") - @PreAuthorize("@ss.hasPermission('base:business-indicator:delete')") - public CommonResult deleteBusinessIndicatorList(@RequestBody BatchDeleteReqVO req) { - businessIndicatorService.deleteBusinessIndicatorListByIds(req.getIds()); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得经营指标") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('base:business-indicator:query')") - public CommonResult getBusinessIndicator(@RequestParam("id") Long id) { -// BusinessIndicatorDO businessIndicator = businessIndicatorService.getBusinessIndicator(id); -// 使用getBusinessIndicatorPageWithRelations方法 - BusinessIndicatorPageReqVO pageReqVO = new BusinessIndicatorPageReqVO(); - pageReqVO.setId(id); - BusinessIndicatorRespVO businessIndicator = businessIndicatorService.getBusinessIndicatorPageWithRelations(pageReqVO).getList().get(0); - return success(BeanUtils.toBean(businessIndicator, BusinessIndicatorRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得经营指标分页") - @PreAuthorize("@ss.hasPermission('base:business-indicator:query')") - public CommonResult> getBusinessIndicatorPage(@Valid BusinessIndicatorPageReqVO pageReqVO) { - PageResult pageResult = businessIndicatorService.getBusinessIndicatorPageWithRelations(pageReqVO); - return success(pageResult); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出经营指标 Excel") - @PreAuthorize("@ss.hasPermission('base:business-indicator:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportBusinessIndicatorExcel(@Valid BusinessIndicatorPageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessIndicatorService.getBusinessIndicatorPage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "经营指标.xls", "数据", BusinessIndicatorRespVO.class, - BeanUtils.toBean(list, BusinessIndicatorRespVO.class)); - } - - @GetMapping("/list-by-parent-id") - @Operation(summary = "获得经营指标列表通过父级ID") - @Parameter(name = "parentId", description = "父级ID", example = "0") - @PreAuthorize("@ss.hasPermission('base:business-indicator:query')") - public CommonResult> getBusinessIndicatorListByParentId(@RequestParam(value = "parentId", required = false) Long parentId) { - List list = businessIndicatorService.getBusinessIndicatorListByParentId(parentId); - return success(BeanUtils.toBean(list, BusinessIndicatorRespVO.class)); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorPageReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorPageReqVO.java deleted file mode 100644 index c8aed6b7..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorPageReqVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessindicator.vo; - -import lombok.*; -import io.swagger.v3.oas.annotations.media.Schema; -import com.zt.plat.framework.common.pojo.PageParam; - -@Schema(description = "管理后台 - 经营指标分页 Request VO") -@Data -public class BusinessIndicatorPageReqVO extends PageParam { - - @Schema(description = "指标编码") - private String code; - - @Schema(description = "指标名称", example = "芋艿") - private String name; - - @Schema(description = "指标ID") - private Long id; - - @Schema(description = "维度ID") - private Long dimensionId; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorRespVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorRespVO.java deleted file mode 100644 index 023fa704..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorRespVO.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessindicator.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; - -@Schema(description = "管理后台 - 经营指标 Response VO") -@Data -@ExcelIgnoreUnannotated -public class BusinessIndicatorRespVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3512") - @ExcelProperty("主键ID") - private Long id; - - @Schema(description = "父级ID", example = "12917") - @ExcelProperty("父级ID") - private Long parentId; - - @Schema(description = "指标编码", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("指标编码") - private String code; - - @Schema(description = "指标名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") - @ExcelProperty("指标名称") - private String name; - - @Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("数据类型") - private String dataValue; - - @Schema(description = "计量单位量ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17208") - @ExcelProperty("计量单位量ID") - private Long quantityId; - - @Schema(description = "计量单位ID", example = "31355") - @ExcelProperty("计量单位ID") - private Long unitId; - - @Schema(description = "算法ID", example = "2240") - @ExcelProperty("算法ID") - private Long algorithmId; - - @Schema(description = "规则ID", example = "32155") - @ExcelProperty("规则ID") - private Long ruleId; - - @Schema(description = "维度ID", example = "7598") - @ExcelProperty("维度ID") - private Long dimensionId; - - @Schema(description = "周期类型值", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("周期类型值") - private String cycleValue; - - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("状态") - private String statusValue; - - @Schema(description = "是否可修改") - @ExcelProperty("是否可修改") - private Integer isModify; - - @Schema(description = "用户ID", example = "13550") - @ExcelProperty("用户ID") - private Long userId; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建时间") - private LocalDateTime createTime; - - // 新增关联名称字段 - @Schema(description = "算法模型名称") - private String algorithmName; - - @Schema(description = "算法类型值") - private String algorithmTypeValue; - - @Schema(description = "规则模型名称") - private String ruleName; - - @Schema(description = "规则类型值") - private String ruleTypeValue; - - @Schema(description = "负责人名称") - private String userName; - - @Schema(description = "指标描述") - private String description; - - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorSaveReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorSaveReqVO.java deleted file mode 100644 index 3affba4b..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessindicator/vo/BusinessIndicatorSaveReqVO.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessindicator.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import jakarta.validation.constraints.*; - -@Schema(description = "管理后台 - 经营指标新增/修改 Request VO") -@Data -public class BusinessIndicatorSaveReqVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "3512") - private Long id; - - @Schema(description = "父级ID", example = "12917") - private Long parentId; - - @Schema(description = "指标编码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "指标编码不能为空") - private String code; - - @Schema(description = "指标名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") - @NotEmpty(message = "指标名称不能为空") - private String name; - - @Schema(description = "指标描述", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "指标描述不能为空") - private String description; - - @Schema(description = "数据类型", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "数据类型不能为空") - private String dataValue; - - @Schema(description = "计量单位量ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "17208") - private Long quantityId; - - @Schema(description = "计量单位ID", example = "31355") - private Long unitId; - - @Schema(description = "算法ID", example = "2240") - private Long algorithmId; - - @Schema(description = "规则ID", example = "32155") - private Long ruleId; - - @Schema(description = "维度ID", example = "7598") - private Long dimensionId; - - @Schema(description = "周期类型值", requiredMode = Schema.RequiredMode.REQUIRED) - private String cycleValue; - - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "状态不能为空") - private String statusValue; - - @Schema(description = "是否可修改") - private boolean isModify; - - @Schema(description = "负责人ID", example = "13550") - private Long userId; - - @Schema(description = "负责部门") - private String departmentId; -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/BusinessRuleController.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/BusinessRuleController.java deleted file mode 100644 index 7b629902..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/BusinessRuleController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessrule; - -import org.springframework.web.bind.annotation.*; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import com.zt.plat.framework.business.interceptor.BusinessControllerMarker; - -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Operation; -import jakarta.validation.*; -import jakarta.servlet.http.*; -import java.util.*; -import java.io.IOException; -import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO; -import com.zt.plat.framework.common.pojo.PageParam; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.pojo.CommonResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import static com.zt.plat.framework.common.pojo.CommonResult.success; - -import com.zt.plat.framework.excel.core.util.ExcelUtils; - -import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog; -import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*; - -import com.zt.plat.module.base.controller.admin.businessrule.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessrule.BusinessRuleDO; -import com.zt.plat.module.base.service.businessrule.BusinessRuleService; - -@Tag(name = "管理后台 - 业务规则") -@RestController -@RequestMapping("/base/business-rule") -@Validated -public class BusinessRuleController implements BusinessControllerMarker { - - - @Resource - private BusinessRuleService businessRuleService; - - @PostMapping("/create") - @Operation(summary = "创建业务规则") - @PreAuthorize("@ss.hasPermission('base:business-rule:create')") - public CommonResult createBusinessRule(@Valid @RequestBody BusinessRuleSaveReqVO createReqVO) { - return success(businessRuleService.createBusinessRule(createReqVO)); - } - - @PutMapping("/update") - @Operation(summary = "更新业务规则") - @PreAuthorize("@ss.hasPermission('base:business-rule:update')") - public CommonResult updateBusinessRule(@Valid @RequestBody BusinessRuleSaveReqVO updateReqVO) { - businessRuleService.updateBusinessRule(updateReqVO); - return success(true); - } - - @DeleteMapping("/delete") - @Operation(summary = "删除业务规则") - @Parameter(name = "id", description = "编号", required = true) - @PreAuthorize("@ss.hasPermission('base:business-rule:delete')") - public CommonResult deleteBusinessRule(@RequestParam("id") Long id) { - businessRuleService.deleteBusinessRule(id); - return success(true); - } - - @DeleteMapping("/delete-list") - @Parameter(name = "ids", description = "编号", required = true) - @Operation(summary = "批量删除业务规则") - @PreAuthorize("@ss.hasPermission('base:business-rule:delete')") - public CommonResult deleteBusinessRuleList(@RequestBody BatchDeleteReqVO req) { - businessRuleService.deleteBusinessRuleListByIds(req.getIds()); - return success(true); - } - - @GetMapping("/get") - @Operation(summary = "获得业务规则") - @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('base:business-rule:query')") - public CommonResult getBusinessRule(@RequestParam("id") Long id) { - BusinessRuleDO businessRule = businessRuleService.getBusinessRule(id); - return success(BeanUtils.toBean(businessRule, BusinessRuleRespVO.class)); - } - - @GetMapping("/page") - @Operation(summary = "获得业务规则分页") - @PreAuthorize("@ss.hasPermission('base:business-rule:query')") - public CommonResult> getBusinessRulePage(@Valid BusinessRulePageReqVO pageReqVO) { - PageResult pageResult = businessRuleService.getBusinessRulePage(pageReqVO); - return success(BeanUtils.toBean(pageResult, BusinessRuleRespVO.class)); - } - - @GetMapping("/export-excel") - @Operation(summary = "导出业务规则 Excel") - @PreAuthorize("@ss.hasPermission('base:business-rule:export')") - @ApiAccessLog(operateType = EXPORT) - public void exportBusinessRuleExcel(@Valid BusinessRulePageReqVO pageReqVO, - HttpServletResponse response) throws IOException { - pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE); - List list = businessRuleService.getBusinessRulePage(pageReqVO).getList(); - // 导出 Excel - ExcelUtils.write(response, "业务规则.xls", "数据", BusinessRuleRespVO.class, - BeanUtils.toBean(list, BusinessRuleRespVO.class)); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRulePageReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRulePageReqVO.java deleted file mode 100644 index 62533325..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRulePageReqVO.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessrule.vo; - -import lombok.*; -import io.swagger.v3.oas.annotations.media.Schema; -import com.zt.plat.framework.common.pojo.PageParam; - -@Schema(description = "管理后台 - 业务规则分页 Request VO") -@Data -public class BusinessRulePageReqVO extends PageParam { - - @Schema(description = "状态") - private String statusValue; - - @Schema(description = "类型") - private String typeValue; - - @Schema(description = "规则编码") - private String code; - - @Schema(description = "规则名称", example = "李四") - private String name; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRuleRespVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRuleRespVO.java deleted file mode 100644 index e6409f4f..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRuleRespVO.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessrule.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import java.time.LocalDateTime; -import com.alibaba.excel.annotation.*; - -@Schema(description = "管理后台 - 业务规则 Response VO") -@Data -@ExcelIgnoreUnannotated -public class BusinessRuleRespVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32088") - @ExcelProperty("主键ID") - private Long id; - - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("状态") - private String statusValue; - - @Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("类型") - private String typeValue; - - @Schema(description = "规则编码", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("规则编码") - private String code; - - @Schema(description = "规则名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @ExcelProperty("规则名称") - private String name; - - @Schema(description = "规则描述", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("规则描述") - private String description; - - @Schema(description = "规则表达式") - @ExcelProperty("规则表达式") - private String expression; - - @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) - @ExcelProperty("创建时间") - private LocalDateTime createTime; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRuleSaveReqVO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRuleSaveReqVO.java deleted file mode 100644 index 1025c8e4..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/controller/admin/businessrule/vo/BusinessRuleSaveReqVO.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.zt.plat.module.base.controller.admin.businessrule.vo; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.*; -import jakarta.validation.constraints.*; - -@Schema(description = "管理后台 - 业务规则新增/修改 Request VO") -@Data -public class BusinessRuleSaveReqVO { - - @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "32088") - private Long id; - - @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "状态不能为空") - private String statusValue; - - @Schema(description = "类型", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "类型不能为空") - private String typeValue; - - @Schema(description = "规则编码", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "规则编码不能为空") - private String code; - - @Schema(description = "规则名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四") - @NotEmpty(message = "规则名称不能为空") - private String name; - - @Schema(description = "规则描述", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "规则描述不能为空") - private String description; - - @Schema(description = "规则表达式") - private String expression; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessalgorithm/BusinessAlgorithmMapper.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessalgorithm/BusinessAlgorithmMapper.java deleted file mode 100644 index 8aa7ae38..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessalgorithm/BusinessAlgorithmMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.zt.plat.module.base.dal.dao.businessalgorithm; - -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import com.zt.plat.module.base.dal.dataobject.businessalgorithm.BusinessAlgorithmDO; -import org.apache.ibatis.annotations.Mapper; -import com.zt.plat.module.base.controller.admin.businessalgorithm.vo.*; - -/** - * 业务算法 Mapper - * - * @author yangxiaofeng - */ -@Mapper -public interface BusinessAlgorithmMapper extends BaseMapperX { - - default PageResult selectPage(BusinessAlgorithmPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessAlgorithmDO::getTypeValue, reqVO.getTypeValue()) - .eqIfPresent(BusinessAlgorithmDO::getStatusValue, reqVO.getStatusValue()) - .eqIfPresent(BusinessAlgorithmDO::getCode, reqVO.getCode()) - .likeIfPresent(BusinessAlgorithmDO::getName, reqVO.getName()) - .orderByDesc(BusinessAlgorithmDO::getId)); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessdepartmentindicator/BusinessDepartmentIndicatorMapper.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessdepartmentindicator/BusinessDepartmentIndicatorMapper.java deleted file mode 100644 index 464bbcb5..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessdepartmentindicator/BusinessDepartmentIndicatorMapper.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.zt.plat.module.base.dal.dao.businessdepartmentindicator; - -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import com.zt.plat.module.base.dal.dataobject.businessdepartmentindicator.BusinessDepartmentIndicatorDO; -import org.apache.ibatis.annotations.Mapper; -import com.zt.plat.module.base.controller.admin.businessdepartmentindicator.vo.*; - -/** - * 部门持有指标 Mapper - * - * @author YangXiaofeng - */ -@Mapper -public interface BusinessDepartmentIndicatorMapper extends BaseMapperX { - - default PageResult selectPage(BusinessDepartmentIndicatorPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessDepartmentIndicatorDO::getIndicatorId, reqVO.getIndicatorId()) - .eqIfPresent(BusinessDepartmentIndicatorDO::getIsKey, reqVO.getIsKey()) - .orderByDesc(BusinessDepartmentIndicatorDO::getId)); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessdimension/BusinessDimensionMapper.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessdimension/BusinessDimensionMapper.java deleted file mode 100644 index ff240bd2..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessdimension/BusinessDimensionMapper.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.zt.plat.module.base.dal.dao.businessdimension; - -import java.util.*; - -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import com.zt.plat.module.base.dal.dataobject.businessdimension.BusinessDimensionDO; -import org.apache.ibatis.annotations.Mapper; -import com.zt.plat.module.base.controller.admin.businessdimension.vo.*; - -/** - * 经营指标维度 Mapper - * - * @author 陈鹏 - */ -@Mapper -public interface BusinessDimensionMapper extends BaseMapperX { - - default PageResult selectPage(BusinessDimensionPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessDimensionDO::getTypeValue, reqVO.getTypeValue()) - .eqIfPresent(BusinessDimensionDO::getCode, reqVO.getCode()) - .likeIfPresent(BusinessDimensionDO::getName, reqVO.getName()) - .betweenIfPresent(BusinessDimensionDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(BusinessDimensionDO::getId)); - } - - // 获取子节点, 递归查询 - default List selectListByParentId(Long parentId, Integer level) { - LambdaQueryWrapperX queryWrapper = new LambdaQueryWrapperX(); - - // 构建层次查询SQL - StringBuilder hierarchySql = new StringBuilder(); - hierarchySql.append("START WITH "); - - if (parentId == null) { - hierarchySql.append("PRN_ID IS NULL "); - } else { - hierarchySql.append("PRN_ID = ").append(parentId); - } - - if (level == null) - hierarchySql.append(" CONNECT BY PRIOR PRN_ID = ID "); - else if (level < 0) //对level取绝对值 - hierarchySql.append(" CONNECT BY PRIOR PRN_ID = ID AND LEVEL <= ").append(-level); - else - hierarchySql.append(" CONNECT BY PRIOR ID = PRN_ID AND LEVEL <= ").append(level); - hierarchySql.append(" ORDER SIBLINGS BY ID DESC"); - queryWrapper.last(hierarchySql.toString()); - - return selectList(queryWrapper); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessindicator/BusinessIndicatorMapper.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessindicator/BusinessIndicatorMapper.java deleted file mode 100644 index c1c1ca69..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessindicator/BusinessIndicatorMapper.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.zt.plat.module.base.dal.dao.businessindicator; - -import java.util.*; - -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import com.zt.plat.module.base.dal.dataobject.businessindicator.BusinessIndicatorDO; -import org.apache.ibatis.annotations.Mapper; -import com.zt.plat.module.base.controller.admin.businessindicator.vo.*; - -/** - * 经营指标 Mapper - * - * @author chengpeng - */ -@Mapper -public interface BusinessIndicatorMapper extends BaseMapperX { - - default PageResult selectPage(BusinessIndicatorPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .likeIfPresent(BusinessIndicatorDO::getCode, reqVO.getCode()) - .likeIfPresent(BusinessIndicatorDO::getName, reqVO.getName()) - .eqIfPresent(BusinessIndicatorDO::getDimensionId, reqVO.getDimensionId()) - .eqIfPresent(BusinessIndicatorDO::getId, reqVO.getId()) - .orderByDesc(BusinessIndicatorDO::getId)); - } - - default List selectListByParentId(Long parentId) { - LambdaQueryWrapperX queryWrapper = new LambdaQueryWrapperX() - .orderByDesc(BusinessIndicatorDO::getId); - - // 如果parentId 是 null,查询根节点(parentId 为 null 的节点) - if (parentId == null) { - queryWrapper.isNull(BusinessIndicatorDO::getParentId); - } else { - queryWrapper.eq(BusinessIndicatorDO::getParentId, parentId); - } - - return selectList(queryWrapper); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessrule/BusinessRuleMapper.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessrule/BusinessRuleMapper.java deleted file mode 100644 index c9f08d8b..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dao/businessrule/BusinessRuleMapper.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.zt.plat.module.base.dal.dao.businessrule; - -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX; -import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX; -import com.zt.plat.module.base.dal.dataobject.businessrule.BusinessRuleDO; -import org.apache.ibatis.annotations.Mapper; -import com.zt.plat.module.base.controller.admin.businessrule.vo.*; - -/** - * 业务规则 Mapper - * - * @author yangxiaofeng - */ -@Mapper -public interface BusinessRuleMapper extends BaseMapperX { - - default PageResult selectPage(BusinessRulePageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(BusinessRuleDO::getStatusValue, reqVO.getStatusValue()) - .eqIfPresent(BusinessRuleDO::getTypeValue, reqVO.getTypeValue()) - .eqIfPresent(BusinessRuleDO::getCode, reqVO.getCode()) - .likeIfPresent(BusinessRuleDO::getName, reqVO.getName()) - .orderByDesc(BusinessRuleDO::getId)); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessalgorithm/BusinessAlgorithmDO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessalgorithm/BusinessAlgorithmDO.java deleted file mode 100644 index 866aa066..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessalgorithm/BusinessAlgorithmDO.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.zt.plat.module.base.dal.dataobject.businessalgorithm; - -import com.zt.plat.framework.mybatis.core.dataobject.BaseDO; -import lombok.*; -import com.baomidou.mybatisplus.annotation.*; -/** -* 业务算法 DO -* -* @author yangxiaofeng -*/ -@TableName("bse_bsn_alg") -@KeySequence("bse_bsn_alg_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class BusinessAlgorithmDO extends BaseDO { - - /** - * 主键ID - */ - @TableId(type = IdType.ASSIGN_ID) - private Long id; - /** - * 类型 - */ - @TableField("TP_VAL") - private String typeValue; - /** - * 状态 - */ - @TableField("STS_VAL") - private String statusValue; - /** - * 算法编码 - */ - @TableField("CD") - private String code; - /** - * 算法名称 - */ - @TableField("NAME") - private String name; - /** - * 算法描述 - */ - @TableField("DSP") - private String description; - /** - * 算法代码 - */ - @TableField("CDG") - private String coding; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessdepartmentindicator/BusinessDepartmentIndicatorDO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessdepartmentindicator/BusinessDepartmentIndicatorDO.java deleted file mode 100644 index d06ad9b0..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessdepartmentindicator/BusinessDepartmentIndicatorDO.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.zt.plat.module.base.dal.dataobject.businessdepartmentindicator; - -import lombok.*; -import com.baomidou.mybatisplus.annotation.*; -import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO; -/** - * 部门持有指标 DO - * - * @author YangXiaofeng - */ -@TableName("bse_bsn_dept_ind") -@KeySequence("bse_bsn_dept_ind_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -/** - * 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO - */ -public class BusinessDepartmentIndicatorDO extends BusinessBaseDO { - - - - /** - * 主键ID - */ - @TableId(type = IdType.ASSIGN_ID) - private Long id; - /** - * 指标ID - */ - @TableField("IND_ID") - private Long indicatorId; - /** - * 计量单位ID - */ - @TableField("UNT_ID") - private Long unitId; - /** - * 规则ID - */ - @TableField("RUL_ID") - private Long ruleId; - /** - * 算法ID - */ - @TableField("ALG_ID") - private Long algorithmId; - /** - * 实体ID - */ - @TableField("ENTY_ID") - private Long entityId; - /** - * 值 - */ - @TableField("VAL") - private String value; - /** - * 是否关键指标 - */ - @TableField("IS_KY") - private Integer isKey; - /** - * 排序号 - */ - @TableField("SRT") - private Long sort; - /** - * 备注 - */ - @TableField("RMK") - private String remark; - - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessdimension/BusinessDimensionDO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessdimension/BusinessDimensionDO.java deleted file mode 100644 index 3f56e189..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessdimension/BusinessDimensionDO.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.zt.plat.module.base.dal.dataobject.businessdimension; - -import com.zt.plat.framework.mybatis.core.dataobject.BaseDO; -import lombok.*; -import com.baomidou.mybatisplus.annotation.*; -/** -* 经营指标维度 DO -* -* @author 陈鹏 -*/ -@TableName("bse_bsn_dim") -@KeySequence("bse_bsn_dim_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class BusinessDimensionDO extends BaseDO { - - - - /** - * 主键ID - */ - @TableId(type = IdType.ASSIGN_ID) - private Long id; - /** - * 父级ID - */ - @TableField("PRN_ID") - private Long parentId; - /** - * 维度类型 - */ - @TableField("TP_VAL") - private String typeValue; - /** - * 维度编码 - */ - @TableField("CD") - private String code; - /** - * 维度名称 - */ - @TableField("NAME") - private String name; - /** - * 备注 - */ - @TableField("RMK") - private String remark; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessindicator/BusinessIndicatorDO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessindicator/BusinessIndicatorDO.java deleted file mode 100644 index c2367be5..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessindicator/BusinessIndicatorDO.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.zt.plat.module.base.dal.dataobject.businessindicator; - -import com.zt.plat.framework.mybatis.core.dataobject.BaseDO; -import lombok.*; -import com.baomidou.mybatisplus.annotation.*; -/** -* 经营指标 DO -* -* @author chengpeng -*/ -@TableName("bse_bsn_ind") -@KeySequence("bse_bsn_ind_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class BusinessIndicatorDO extends BaseDO { - - - - /** - * 主键ID - */ - @TableId(type = IdType.ASSIGN_ID) - private Long id; - /** - * 父级ID - */ - @TableField("PRN_ID") - private Long parentId; - /** - * 指标编码 - */ - @TableField("CD") - private String code; - /** - * 指标名称 - */ - @TableField("NAME") - private String name; - /** - * 指标描述 - */ - @TableField("DSP") - private String description; - /** - * 数据类型 - */ - @TableField("DAT_VAL") - private String dataValue; - /** - * 计量单位量ID - */ - @TableField("QTY_ID") - private Long quantityId; - /** - * 计量单位ID - */ - @TableField("UNT_ID") - private Long unitId; - /** - * 算法ID - */ - @TableField("ALG_ID") - private Long algorithmId; - /** - * 规则ID - */ - @TableField("RUL_ID") - private Long ruleId; - /** - * 维度ID - */ - @TableField("DIM_ID") - private Long dimensionId; - /** - * 周期类型值 - */ - @TableField("CYCL_VAL") - private String cycleValue; - /** - * 状态 - */ - @TableField("STS_VAL") - private String statusValue; - /** - * 是否可修改 - */ - @TableField("IS_MDF") - private Integer isModify; - /** - * 用户ID - */ - @TableField("USER_ID") - private Long userId; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessrule/BusinessRuleDO.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessrule/BusinessRuleDO.java deleted file mode 100644 index c36e9cff..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/dal/dataobject/businessrule/BusinessRuleDO.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.zt.plat.module.base.dal.dataobject.businessrule; - -import com.zt.plat.framework.mybatis.core.dataobject.BaseDO; -import lombok.*; -import com.baomidou.mybatisplus.annotation.*; - -/** -* 业务规则 DO -* -* @author yangxiaofeng -*/ -@TableName("bse_bsn_rul") -@KeySequence("bse_bsn_rul_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class BusinessRuleDO extends BaseDO { - - - - /** - * 主键ID - */ - @TableId(type = IdType.ASSIGN_ID) - private Long id; - /** - * 状态 - */ - @TableField("STS_VAL") - private String statusValue; - /** - * 类型 - */ - @TableField("TP_VAL") - private String typeValue; - /** - * 规则编码 - */ - @TableField("CD") - private String code; - /** - * 规则名称 - */ - @TableField("NAME") - private String name; - /** - * 规则描述 - */ - @TableField("DSP") - private String description; - /** - * 规则表达式 - */ - @TableField("EPSSN") - private String expression; - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessalgorithm/BusinessAlgorithmService.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessalgorithm/BusinessAlgorithmService.java deleted file mode 100644 index 88556dfe..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessalgorithm/BusinessAlgorithmService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.zt.plat.module.base.service.businessalgorithm; - -import java.util.*; -import jakarta.validation.*; -import com.zt.plat.module.base.controller.admin.businessalgorithm.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessalgorithm.BusinessAlgorithmDO; -import com.zt.plat.framework.common.pojo.PageResult; - -/** - * 业务算法 Service 接口 - * - * @author yangxiaofeng - */ -public interface BusinessAlgorithmService { - - /** - * 创建业务算法 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - BusinessAlgorithmRespVO createBusinessAlgorithm(@Valid BusinessAlgorithmSaveReqVO createReqVO); - - /** - * 更新业务算法 - * - * @param updateReqVO 更新信息 - */ - void updateBusinessAlgorithm(@Valid BusinessAlgorithmSaveReqVO updateReqVO); - - /** - * 删除业务算法 - * - * @param id 编号 - */ - void deleteBusinessAlgorithm(Long id); - - /** - * 批量删除业务算法 - * - * @param ids 编号 - */ - void deleteBusinessAlgorithmListByIds(List ids); - - /** - * 获得业务算法 - * - * @param id 编号 - * @return 业务算法 - */ - BusinessAlgorithmDO getBusinessAlgorithm(Long id); - - /** - * 获得业务算法分页 - * - * @param pageReqVO 分页查询 - * @return 业务算法分页 - */ - PageResult getBusinessAlgorithmPage(BusinessAlgorithmPageReqVO pageReqVO); - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessalgorithm/BusinessAlgorithmServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessalgorithm/BusinessAlgorithmServiceImpl.java deleted file mode 100644 index 04dd1d94..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessalgorithm/BusinessAlgorithmServiceImpl.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.zt.plat.module.base.service.businessalgorithm; - -import cn.hutool.core.collection.CollUtil; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import java.util.*; -import com.zt.plat.module.base.controller.admin.businessalgorithm.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessalgorithm.BusinessAlgorithmDO; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import com.zt.plat.module.base.dal.dao.businessalgorithm.BusinessAlgorithmMapper; -import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.module.base.enums.ErrorCodeConstants.*; - -/** - * 业务算法 Service 实现类 - * - * @author yangxiaofeng - */ -@Service -@Validated -public class BusinessAlgorithmServiceImpl implements BusinessAlgorithmService { - - @Resource - private BusinessAlgorithmMapper businessAlgorithmMapper; - - @Override - public BusinessAlgorithmRespVO createBusinessAlgorithm(BusinessAlgorithmSaveReqVO createReqVO) { - // 插入 - BusinessAlgorithmDO businessAlgorithm = BeanUtils.toBean(createReqVO, BusinessAlgorithmDO.class); - businessAlgorithmMapper.insert(businessAlgorithm); - // 返回 - return BeanUtils.toBean(businessAlgorithm, BusinessAlgorithmRespVO.class); - } - - @Override - public void updateBusinessAlgorithm(BusinessAlgorithmSaveReqVO updateReqVO) { - // 校验存在 - validateBusinessAlgorithmExists(updateReqVO.getId()); - // 更新 - BusinessAlgorithmDO updateObj = BeanUtils.toBean(updateReqVO, BusinessAlgorithmDO.class); - businessAlgorithmMapper.updateById(updateObj); - } - - @Override - public void deleteBusinessAlgorithm(Long id) { - // 校验存在 - validateBusinessAlgorithmExists(id); - // 删除 - businessAlgorithmMapper.deleteById(id); - } - - @Override - public void deleteBusinessAlgorithmListByIds(List ids) { - // 校验存在 - validateBusinessAlgorithmExists(ids); - // 删除 - businessAlgorithmMapper.deleteByIds(ids); - } - - private void validateBusinessAlgorithmExists(List ids) { - List list = businessAlgorithmMapper.selectByIds(ids); - if (CollUtil.isEmpty(list) || list.size() != ids.size()) { - throw exception(BUSINESS_ALGORITHM_NOT_EXISTS); - } - } - - private void validateBusinessAlgorithmExists(Long id) { - if (businessAlgorithmMapper.selectById(id) == null) { - throw exception(BUSINESS_ALGORITHM_NOT_EXISTS); - } - } - - @Override - public BusinessAlgorithmDO getBusinessAlgorithm(Long id) { - return businessAlgorithmMapper.selectById(id); - } - - @Override - public PageResult getBusinessAlgorithmPage(BusinessAlgorithmPageReqVO pageReqVO) { - return businessAlgorithmMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdepartmentindicator/BusinessDepartmentIndicatorService.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdepartmentindicator/BusinessDepartmentIndicatorService.java deleted file mode 100644 index b48af9e0..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdepartmentindicator/BusinessDepartmentIndicatorService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.zt.plat.module.base.service.businessdepartmentindicator; - -import java.util.*; -import jakarta.validation.*; -import com.zt.plat.module.base.controller.admin.businessdepartmentindicator.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessdepartmentindicator.BusinessDepartmentIndicatorDO; -import com.zt.plat.framework.common.pojo.PageResult; - -/** - * 部门持有指标 Service 接口 - * - * @author YangXiaofeng - */ -public interface BusinessDepartmentIndicatorService { - - /** - * 创建部门持有指标 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - BusinessDepartmentIndicatorRespVO createBusinessDepartmentIndicator(@Valid BusinessDepartmentIndicatorSaveReqVO createReqVO); - - /** - * 更新部门持有指标 - * - * @param updateReqVO 更新信息 - */ - void updateBusinessDepartmentIndicator(@Valid BusinessDepartmentIndicatorSaveReqVO updateReqVO); - - /** - * 删除部门持有指标 - * - * @param id 编号 - */ - void deleteBusinessDepartmentIndicator(Long id); - - /** - * 批量删除部门持有指标 - * - * @param ids 编号 - */ - void deleteBusinessDepartmentIndicatorListByIds(List ids); - - /** - * 获得部门持有指标 - * - * @param id 编号 - * @return 部门持有指标 - */ - BusinessDepartmentIndicatorDO getBusinessDepartmentIndicator(Long id); - - /** - * 获得部门持有指标分页 - * - * @param pageReqVO 分页查询 - * @return 部门持有指标分页 - */ - PageResult getBusinessDepartmentIndicatorPage(BusinessDepartmentIndicatorPageReqVO pageReqVO); - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdepartmentindicator/BusinessDepartmentIndicatorServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdepartmentindicator/BusinessDepartmentIndicatorServiceImpl.java deleted file mode 100644 index 173e6ea4..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdepartmentindicator/BusinessDepartmentIndicatorServiceImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.zt.plat.module.base.service.businessdepartmentindicator; - -import cn.hutool.core.collection.CollUtil; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; - -import java.util.*; -import com.zt.plat.module.base.controller.admin.businessdepartmentindicator.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessdepartmentindicator.BusinessDepartmentIndicatorDO; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.util.object.BeanUtils; - -import com.zt.plat.module.base.dal.dao.businessdepartmentindicator.BusinessDepartmentIndicatorMapper; - -import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.module.base.enums.ErrorCodeConstants.*; - -/** - * 部门持有指标 Service 实现类 - * - * @author YangXiaofeng - */ -@Service -@Validated -public class BusinessDepartmentIndicatorServiceImpl implements BusinessDepartmentIndicatorService { - - @Resource - private BusinessDepartmentIndicatorMapper businessDepartmentIndicatorMapper; - - @Override - public BusinessDepartmentIndicatorRespVO createBusinessDepartmentIndicator(BusinessDepartmentIndicatorSaveReqVO createReqVO) { - // 插入 - BusinessDepartmentIndicatorDO businessDepartmentIndicator = BeanUtils.toBean(createReqVO, BusinessDepartmentIndicatorDO.class); - businessDepartmentIndicatorMapper.insert(businessDepartmentIndicator); - // 返回 - return BeanUtils.toBean(businessDepartmentIndicator, BusinessDepartmentIndicatorRespVO.class); - } - - @Override - public void updateBusinessDepartmentIndicator(BusinessDepartmentIndicatorSaveReqVO updateReqVO) { - // 校验存在 - validateBusinessDepartmentIndicatorExists(updateReqVO.getId()); - // 更新 - BusinessDepartmentIndicatorDO updateObj = BeanUtils.toBean(updateReqVO, BusinessDepartmentIndicatorDO.class); - businessDepartmentIndicatorMapper.updateById(updateObj); - } - - @Override - public void deleteBusinessDepartmentIndicator(Long id) { - // 校验存在 - validateBusinessDepartmentIndicatorExists(id); - // 删除 - businessDepartmentIndicatorMapper.deleteById(id); - } - - @Override - public void deleteBusinessDepartmentIndicatorListByIds(List ids) { - // 校验存在 - validateBusinessDepartmentIndicatorExists(ids); - // 删除 - businessDepartmentIndicatorMapper.deleteByIds(ids); - } - - private void validateBusinessDepartmentIndicatorExists(List ids) { - List list = businessDepartmentIndicatorMapper.selectByIds(ids); - if (CollUtil.isEmpty(list) || list.size() != ids.size()) { - throw exception(BUSINESS_DEPARTMENT_INDICATOR_NOT_EXISTS); - } - } - - private void validateBusinessDepartmentIndicatorExists(Long id) { - if (businessDepartmentIndicatorMapper.selectById(id) == null) { - throw exception(BUSINESS_DEPARTMENT_INDICATOR_NOT_EXISTS); - } - } - - @Override - public BusinessDepartmentIndicatorDO getBusinessDepartmentIndicator(Long id) { - return businessDepartmentIndicatorMapper.selectById(id); - } - - @Override - public PageResult getBusinessDepartmentIndicatorPage(BusinessDepartmentIndicatorPageReqVO pageReqVO) { - return businessDepartmentIndicatorMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdimension/BusinessDimensionService.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdimension/BusinessDimensionService.java deleted file mode 100644 index aad5c2ad..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdimension/BusinessDimensionService.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.zt.plat.module.base.service.businessdimension; - -import java.util.*; -import jakarta.validation.*; -import com.zt.plat.module.base.controller.admin.businessdimension.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessdimension.BusinessDimensionDO; -import com.zt.plat.framework.common.pojo.PageResult; - -/** - * 经营指标维度 Service 接口 - * - * @author 陈鹏 - */ -public interface BusinessDimensionService { - - /** - * 创建经营指标维度 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - BusinessDimensionRespVO createBusinessDimension(@Valid BusinessDimensionSaveReqVO createReqVO); - - /** - * 更新经营指标维度 - * - * @param updateReqVO 更新信息 - */ - void updateBusinessDimension(@Valid BusinessDimensionSaveReqVO updateReqVO); - - /** - * 删除经营指标维度 - * - * @param id 编号 - */ - void deleteBusinessDimension(Long id); - - /** - * 批量删除经营指标维度 - * - * @param ids 编号 - */ - void deleteBusinessDimensionListByIds(List ids); - - /** - * 获得经营指标维度 - * - * @param id 编号 - * @return 经营指标维度 - */ - BusinessDimensionDO getBusinessDimension(Long id); - - /** - * 获得经营指标维度分页 - * - * @param pageReqVO 分页查询 - * @return 经营指标维度分页 - */ - PageResult getBusinessDimensionPage(BusinessDimensionPageReqVO pageReqVO); - - /** - * 根据父级ID获取经营指标维度列表 - * - * @param parentId 父级ID - * @return 经营指标维度列表 - */ - List getBusinessDimensionListByParentId(Long parentId, Integer level); - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdimension/BusinessDimensionServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdimension/BusinessDimensionServiceImpl.java deleted file mode 100644 index c149ece9..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessdimension/BusinessDimensionServiceImpl.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.zt.plat.module.base.service.businessdimension; - -import cn.hutool.core.collection.CollUtil; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import java.util.*; -import com.zt.plat.module.base.controller.admin.businessdimension.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessdimension.BusinessDimensionDO; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.util.object.BeanUtils; -import com.zt.plat.module.base.dal.dao.businessdimension.BusinessDimensionMapper; -import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.module.base.enums.ErrorCodeConstants.*; - -/** - * 经营指标维度 Service 实现类 - * - * @author 陈鹏 - */ -@Service -@Validated -public class BusinessDimensionServiceImpl implements BusinessDimensionService { - - @Resource - private BusinessDimensionMapper businessDimensionMapper; - - @Override - public BusinessDimensionRespVO createBusinessDimension(BusinessDimensionSaveReqVO createReqVO) { - // 插入 - BusinessDimensionDO businessDimension = BeanUtils.toBean(createReqVO, BusinessDimensionDO.class); - businessDimensionMapper.insert(businessDimension); - // 返回 - return BeanUtils.toBean(businessDimension, BusinessDimensionRespVO.class); - } - - @Override - public void updateBusinessDimension(BusinessDimensionSaveReqVO updateReqVO) { - // 校验存在 - validateBusinessDimensionExists(updateReqVO.getId()); - // 更新 - BusinessDimensionDO updateObj = BeanUtils.toBean(updateReqVO, BusinessDimensionDO.class); - businessDimensionMapper.updateById(updateObj); - } - - @Override - public void deleteBusinessDimension(Long id) { - // 校验存在 - validateBusinessDimensionExists(id); - // 删除 - businessDimensionMapper.deleteById(id); - } - - @Override - public void deleteBusinessDimensionListByIds(List ids) { - // 校验存在 - validateBusinessDimensionExists(ids); - // 删除 - businessDimensionMapper.deleteByIds(ids); - } - - private void validateBusinessDimensionExists(List ids) { - List list = businessDimensionMapper.selectByIds(ids); - if (CollUtil.isEmpty(list) || list.size() != ids.size()) { - throw exception(BUSINESS_DIMENSION_NOT_EXISTS); - } - } - - private void validateBusinessDimensionExists(Long id) { - if (businessDimensionMapper.selectById(id) == null) { - throw exception(BUSINESS_DIMENSION_NOT_EXISTS); - } - } - - @Override - public BusinessDimensionDO getBusinessDimension(Long id) { - return businessDimensionMapper.selectById(id); - } - - @Override - public PageResult getBusinessDimensionPage(BusinessDimensionPageReqVO pageReqVO) { - return businessDimensionMapper.selectPage(pageReqVO); - } - - @Override - public List getBusinessDimensionListByParentId(Long parentId, Integer level) { - return businessDimensionMapper.selectListByParentId(parentId, level); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessindicator/BusinessIndicatorService.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessindicator/BusinessIndicatorService.java deleted file mode 100644 index 69b78ee5..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessindicator/BusinessIndicatorService.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.zt.plat.module.base.service.businessindicator; - -import java.util.*; -import jakarta.validation.*; -import com.zt.plat.module.base.controller.admin.businessindicator.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessindicator.BusinessIndicatorDO; -import com.zt.plat.framework.common.pojo.PageResult; - -/** - * 经营指标 Service 接口 - * - * @author chengpeng - */ -public interface BusinessIndicatorService { - - /** - * 创建经营指标 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - BusinessIndicatorRespVO createBusinessIndicator(@Valid BusinessIndicatorSaveReqVO createReqVO); - - /** - * 更新经营指标 - * - * @param updateReqVO 更新信息 - */ - void updateBusinessIndicator(@Valid BusinessIndicatorSaveReqVO updateReqVO); - - /** - * 删除经营指标 - * - * @param id 编号 - */ - void deleteBusinessIndicator(Long id); - - /** - * 批量删除经营指标 - * - * @param ids 编号 - */ - void deleteBusinessIndicatorListByIds(List ids); - - /** - * 获得经营指标 - * - * @param id 编号 - * @return 经营指标 - */ - BusinessIndicatorDO getBusinessIndicator(Long id); - - /** - * 获得经营指标分页 - * - * @param pageReqVO 分页查询 - * @return 经营指标分页 - */ - PageResult getBusinessIndicatorPage(BusinessIndicatorPageReqVO pageReqVO); - - /** - * 获得经营指标分页(包含关联信息) - * - * @param pageReqVO 分页查询 - * @return 经营指标分页(包含算法模型类型、算法类型、规则类型、规则模型、负责人相关名称信息) - */ - PageResult getBusinessIndicatorPageWithRelations(BusinessIndicatorPageReqVO pageReqVO); - - /** - * 根据父级ID获取经营指标列表 - * - * @param parentId 父级ID - * @return 经营指标列表 - */ - List getBusinessIndicatorListByParentId(Long parentId); - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessindicator/BusinessIndicatorServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessindicator/BusinessIndicatorServiceImpl.java deleted file mode 100644 index 4facb9d0..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessindicator/BusinessIndicatorServiceImpl.java +++ /dev/null @@ -1,183 +0,0 @@ -package com.zt.plat.module.base.service.businessindicator; - -import cn.hutool.core.collection.CollUtil; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; - -import java.util.*; -import com.zt.plat.module.base.controller.admin.businessindicator.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessindicator.BusinessIndicatorDO; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.util.object.BeanUtils; - -import com.zt.plat.module.base.dal.dao.businessindicator.BusinessIndicatorMapper; - -import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.module.base.enums.ErrorCodeConstants.*; - -import com.zt.plat.module.base.dal.dataobject.businessalgorithm.BusinessAlgorithmDO; -import com.zt.plat.module.base.dal.dataobject.businessrule.BusinessRuleDO; -import com.zt.plat.module.base.dal.dao.businessalgorithm.BusinessAlgorithmMapper; -import com.zt.plat.module.base.dal.dao.businessrule.BusinessRuleMapper; -import com.zt.plat.module.system.api.user.AdminUserApi; -import com.zt.plat.module.system.api.user.dto.AdminUserRespDTO; - -/** - * 经营指标 Service 实现类 - * - * @author chengpeng - */ -@Service -@Validated -public class BusinessIndicatorServiceImpl implements BusinessIndicatorService { - - @Resource - private BusinessIndicatorMapper businessIndicatorMapper; - - @Resource - private BusinessAlgorithmMapper businessAlgorithmMapper; - - @Resource - private BusinessRuleMapper businessRuleMapper; - - @Resource - private AdminUserApi adminUserApi; - - @Override - public BusinessIndicatorRespVO createBusinessIndicator(BusinessIndicatorSaveReqVO createReqVO) { - // 插入 - BusinessIndicatorDO businessIndicator = BeanUtils.toBean(createReqVO, BusinessIndicatorDO.class); - businessIndicatorMapper.insert(businessIndicator); - // 返回 - return BeanUtils.toBean(businessIndicator, BusinessIndicatorRespVO.class); - } - - @Override - public void updateBusinessIndicator(BusinessIndicatorSaveReqVO updateReqVO) { - // 校验存在 - validateBusinessIndicatorExists(updateReqVO.getId()); - // 更新 - BusinessIndicatorDO updateObj = BeanUtils.toBean(updateReqVO, BusinessIndicatorDO.class); - businessIndicatorMapper.updateById(updateObj); - } - - @Override - public void deleteBusinessIndicator(Long id) { - // 校验存在 - validateBusinessIndicatorExists(id); - // 删除 - businessIndicatorMapper.deleteById(id); - } - - @Override - public void deleteBusinessIndicatorListByIds(List ids) { - // 校验存在 - validateBusinessIndicatorExists(ids); - // 删除 - businessIndicatorMapper.deleteByIds(ids); - } - - private void validateBusinessIndicatorExists(List ids) { - List list = businessIndicatorMapper.selectByIds(ids); - if (CollUtil.isEmpty(list) || list.size() != ids.size()) { - throw exception(BUSINESS_INDICATOR_NOT_EXISTS); - } - } - - private void validateBusinessIndicatorExists(Long id) { - if (businessIndicatorMapper.selectById(id) == null) { - throw exception(BUSINESS_INDICATOR_NOT_EXISTS); - } - } - - @Override - public BusinessIndicatorDO getBusinessIndicator(Long id) { - return businessIndicatorMapper.selectById(id); - } - - @Override - public PageResult getBusinessIndicatorPage(BusinessIndicatorPageReqVO pageReqVO) { - return businessIndicatorMapper.selectPage(pageReqVO); - } - - @Override - public PageResult getBusinessIndicatorPageWithRelations(BusinessIndicatorPageReqVO pageReqVO) { - // 查询经营指标分页数据 - PageResult pageResult = businessIndicatorMapper.selectPage(pageReqVO); - - // 转换为 VO 对象 - List voList = BeanUtils.toBean(pageResult.getList(), BusinessIndicatorRespVO.class); - - // 收集需要关联查询的 ID 列表 - Set algorithmIds = new HashSet<>(); - Set ruleIds = new HashSet<>(); - Set userIds = new HashSet<>(); - - for (BusinessIndicatorDO indicator : pageResult.getList()) { - if (indicator.getAlgorithmId() != null) { - algorithmIds.add(indicator.getAlgorithmId()); - } - if (indicator.getRuleId() != null) { - ruleIds.add(indicator.getRuleId()); - } - if (indicator.getUserId() != null) { - userIds.add(indicator.getUserId()); - } - } - - // 批量查询关联数据 - List algorithms = algorithmIds.isEmpty() ? Collections.emptyList() : - businessAlgorithmMapper.selectBatchIds(algorithmIds); - List rules = ruleIds.isEmpty() ? Collections.emptyList() : - businessRuleMapper.selectBatchIds(ruleIds); - Map userMap = userIds.isEmpty() ? Collections.emptyMap() : - adminUserApi.getUserMap(userIds); - - // 建立 ID 到对象的映射 - Map algorithmMap = new HashMap<>(); - Map ruleMap = new HashMap<>(); - - for (BusinessAlgorithmDO algorithm : algorithms) { - algorithmMap.put(algorithm.getId(), algorithm); - } - - for (BusinessRuleDO rule : rules) { - ruleMap.put(rule.getId(), rule); - } - - // 填充关联信息 - for (int i = 0; i < pageResult.getList().size(); i++) { - BusinessIndicatorDO indicator = pageResult.getList().get(i); - BusinessIndicatorRespVO vo = voList.get(i); - - // 填充算法相关信息 - if (indicator.getAlgorithmId() != null && algorithmMap.containsKey(indicator.getAlgorithmId())) { - BusinessAlgorithmDO algorithm = algorithmMap.get(indicator.getAlgorithmId()); - vo.setAlgorithmName(algorithm.getName()); - vo.setAlgorithmTypeValue(algorithm.getTypeValue()); - } - - // 填充规则相关信息 - if (indicator.getRuleId() != null && ruleMap.containsKey(indicator.getRuleId())) { - BusinessRuleDO rule = ruleMap.get(indicator.getRuleId()); - vo.setRuleName(rule.getName()); - vo.setRuleTypeValue(rule.getTypeValue()); - } - - // 填充用户相关信息 - if (indicator.getUserId() != null && userMap.containsKey(indicator.getUserId())) { - AdminUserRespDTO user = userMap.get(indicator.getUserId()); - vo.setUserName(user.getNickname()); - } - } - - return new PageResult<>(voList, pageResult.getTotal()); - } - - @Override - public List getBusinessIndicatorListByParentId(Long parentId) { - return businessIndicatorMapper.selectListByParentId(parentId); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessrule/BusinessRuleService.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessrule/BusinessRuleService.java deleted file mode 100644 index 645fb7d4..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessrule/BusinessRuleService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.zt.plat.module.base.service.businessrule; - -import java.util.*; -import jakarta.validation.*; -import com.zt.plat.module.base.controller.admin.businessrule.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessrule.BusinessRuleDO; -import com.zt.plat.framework.common.pojo.PageResult; - -/** - * 业务规则 Service 接口 - * - * @author yangxiaofeng - */ -public interface BusinessRuleService { - - /** - * 创建业务规则 - * - * @param createReqVO 创建信息 - * @return 编号 - */ - BusinessRuleRespVO createBusinessRule(@Valid BusinessRuleSaveReqVO createReqVO); - - /** - * 更新业务规则 - * - * @param updateReqVO 更新信息 - */ - void updateBusinessRule(@Valid BusinessRuleSaveReqVO updateReqVO); - - /** - * 删除业务规则 - * - * @param id 编号 - */ - void deleteBusinessRule(Long id); - - /** - * 批量删除业务规则 - * - * @param ids 编号 - */ - void deleteBusinessRuleListByIds(List ids); - - /** - * 获得业务规则 - * - * @param id 编号 - * @return 业务规则 - */ - BusinessRuleDO getBusinessRule(Long id); - - /** - * 获得业务规则分页 - * - * @param pageReqVO 分页查询 - * @return 业务规则分页 - */ - PageResult getBusinessRulePage(BusinessRulePageReqVO pageReqVO); - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessrule/BusinessRuleServiceImpl.java b/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessrule/BusinessRuleServiceImpl.java deleted file mode 100644 index 7c9ea642..00000000 --- a/zt-module-base/zt-module-base-server/src/main/java/com/zt/plat/module/base/service/businessrule/BusinessRuleServiceImpl.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.zt.plat.module.base.service.businessrule; - -import cn.hutool.core.collection.CollUtil; -import org.springframework.stereotype.Service; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; - -import java.util.*; -import com.zt.plat.module.base.controller.admin.businessrule.vo.*; -import com.zt.plat.module.base.dal.dataobject.businessrule.BusinessRuleDO; -import com.zt.plat.framework.common.pojo.PageResult; -import com.zt.plat.framework.common.util.object.BeanUtils; - -import com.zt.plat.module.base.dal.dao.businessrule.BusinessRuleMapper; - -import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception; -import static com.zt.plat.module.base.enums.ErrorCodeConstants.*; - -/** - * 业务规则 Service 实现类 - * - * @author yangxiaofeng - */ -@Service -@Validated -public class BusinessRuleServiceImpl implements BusinessRuleService { - - @Resource - private BusinessRuleMapper businessRuleMapper; - - @Override - public BusinessRuleRespVO createBusinessRule(BusinessRuleSaveReqVO createReqVO) { - // 插入 - BusinessRuleDO businessRule = BeanUtils.toBean(createReqVO, BusinessRuleDO.class); - businessRuleMapper.insert(businessRule); - // 返回 - return BeanUtils.toBean(businessRule, BusinessRuleRespVO.class); - } - - @Override - public void updateBusinessRule(BusinessRuleSaveReqVO updateReqVO) { - // 校验存在 - validateBusinessRuleExists(updateReqVO.getId()); - // 更新 - BusinessRuleDO updateObj = BeanUtils.toBean(updateReqVO, BusinessRuleDO.class); - businessRuleMapper.updateById(updateObj); - } - - @Override - public void deleteBusinessRule(Long id) { - // 校验存在 - validateBusinessRuleExists(id); - // 删除 - businessRuleMapper.deleteById(id); - } - - @Override - public void deleteBusinessRuleListByIds(List ids) { - // 校验存在 - validateBusinessRuleExists(ids); - // 删除 - businessRuleMapper.deleteByIds(ids); - } - - private void validateBusinessRuleExists(List ids) { - List list = businessRuleMapper.selectByIds(ids); - if (CollUtil.isEmpty(list) || list.size() != ids.size()) { - throw exception(BUSINESS_RULE_NOT_EXISTS); - } - } - - private void validateBusinessRuleExists(Long id) { - if (businessRuleMapper.selectById(id) == null) { - throw exception(BUSINESS_RULE_NOT_EXISTS); - } - } - - @Override - public BusinessRuleDO getBusinessRule(Long id) { - return businessRuleMapper.selectById(id); - } - - @Override - public PageResult getBusinessRulePage(BusinessRulePageReqVO pageReqVO) { - return businessRuleMapper.selectPage(pageReqVO); - } - -} \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/resources/logback-spring.xml b/zt-module-base/zt-module-base-server/src/main/resources/logback-spring.xml index 1af842df..176c069a 100644 --- a/zt-module-base/zt-module-base-server/src/main/resources/logback-spring.xml +++ b/zt-module-base/zt-module-base-server/src/main/resources/logback-spring.xml @@ -19,7 +19,7 @@ - + diff --git a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessalgorithm/BusinessAlgorithmMapper.xml b/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessalgorithm/BusinessAlgorithmMapper.xml deleted file mode 100644 index 329c5e2a..00000000 --- a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessalgorithm/BusinessAlgorithmMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessdepartmentindicator/BusinessDepartmentIndicatorMapper.xml b/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessdepartmentindicator/BusinessDepartmentIndicatorMapper.xml deleted file mode 100644 index aeeb01f6..00000000 --- a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessdepartmentindicator/BusinessDepartmentIndicatorMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessdimension/BusinessDimensionMapper.xml b/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessdimension/BusinessDimensionMapper.xml deleted file mode 100644 index 5d482cd6..00000000 --- a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessdimension/BusinessDimensionMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessindicator/BusinessIndicatorMapper.xml b/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessindicator/BusinessIndicatorMapper.xml deleted file mode 100644 index 570838a9..00000000 --- a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessindicator/BusinessIndicatorMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessrule/BusinessRuleMapper.xml b/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessrule/BusinessRuleMapper.xml deleted file mode 100644 index c47664a0..00000000 --- a/zt-module-base/zt-module-base-server/src/main/resources/mapper/businessrule/BusinessRuleMapper.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - \ No newline at end of file