Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -105,7 +105,3 @@ justauth:
|
|||||||
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
|
||||||
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
|
||||||
|
|
||||||
erp:
|
|
||||||
address: hana-dev.yncic.com
|
|
||||||
sapsys: ZTDEV203
|
|
||||||
|
|
||||||
|
|||||||
@@ -114,8 +114,8 @@ zt:
|
|||||||
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
- ${spring.boot.admin.context-path}/** # 不处理 Spring Boot Admin 的请求
|
||||||
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
- ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求
|
||||||
swagger:
|
swagger:
|
||||||
title: 管理后台
|
title: Base 模块
|
||||||
description: 提供管理员管理的所有功能
|
description: 提供基础管理模块的所有功能
|
||||||
version: ${zt.info.version}
|
version: ${zt.info.version}
|
||||||
tenant: # 多租户相关配置项
|
tenant: # 多租户相关配置项
|
||||||
enable: true
|
enable: true
|
||||||
|
|||||||
@@ -61,7 +61,13 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
app: base-server
|
app: base-server
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- name: http
|
||||||
|
protocol: TCP
|
||||||
port: 48100
|
port: 48100
|
||||||
targetPort: 48100
|
targetPort: 48100
|
||||||
nodePort: 30097
|
nodePort: 30097
|
||||||
|
- name: xxl-job
|
||||||
|
protocol: TCP
|
||||||
|
port: 9999
|
||||||
|
targetPort: 9999
|
||||||
|
nodePort: 30197
|
||||||
|
|||||||
8
pom.xml
8
pom.xml
@@ -20,7 +20,7 @@
|
|||||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<revision>3.0.39</revision>
|
<revision>3.0.42</revision>
|
||||||
<!-- Maven 相关 -->
|
<!-- Maven 相关 -->
|
||||||
<java.version>17</java.version>
|
<java.version>17</java.version>
|
||||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||||
@@ -212,6 +212,12 @@
|
|||||||
<config.namespace>liss</config.namespace>
|
<config.namespace>liss</config.namespace>
|
||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>qsj</id>
|
||||||
|
<properties>
|
||||||
|
<config.namespace>qsj</config.namespace>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.zt.plat.module.api;
|
||||||
|
|
||||||
|
import com.zt.plat.module.api.dto.AccountDTO;
|
||||||
|
import com.zt.plat.module.api.dto.MaterialOtherDTO;
|
||||||
|
import com.zt.plat.module.base.enums.ApiConstants;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@FeignClient(name = ApiConstants.NAME)
|
||||||
|
@Tag(name = "RPC 服务 - base")
|
||||||
|
public interface BaseApi {
|
||||||
|
|
||||||
|
String PREFIX = ApiConstants.PREFIX + "/base";
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getAccountNoPage")
|
||||||
|
@Operation(summary = "账户条款数据不分页查询")
|
||||||
|
List<AccountDTO> getAccountNoPage(AccountDTO respVO);
|
||||||
|
|
||||||
|
@GetMapping(PREFIX + "/getMaterialOtherNoPage")
|
||||||
|
@Operation(summary = "物料拓展关系数据不分页查询")
|
||||||
|
List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO);
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.zt.plat.module.api.dto;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "RPC 服务 DTO")
|
||||||
|
@Data
|
||||||
|
public class AccountDTO {
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private String accountName;
|
||||||
|
|
||||||
|
private String bankAccount;
|
||||||
|
|
||||||
|
private String accountNumber;
|
||||||
|
|
||||||
|
private String taxNumber;
|
||||||
|
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.zt.plat.module.api.dto;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
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 MaterialOtherDTO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "物料编码")
|
||||||
|
private String materialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "物料名称", example = "王五")
|
||||||
|
private String materialName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP物料编码")
|
||||||
|
private String erpMaterialNumber;
|
||||||
|
|
||||||
|
@Schema(description = "ERP物料名称", example = "李四")
|
||||||
|
private String erpMaterialName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP物料计量单位")
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素缩写")
|
||||||
|
private String abbreviation;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素名称", example = "赵六")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "金属元素编码")
|
||||||
|
private String coding;
|
||||||
|
|
||||||
|
@Schema(description = "品位单位")
|
||||||
|
private String gradeUnit;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "小数位数")
|
||||||
|
private Long decimalValue;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.zt.plat.module.base.enums;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.enums.RpcConstants;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API 相关的枚举
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
*/
|
||||||
|
public class ApiConstants {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 服务名
|
||||||
|
*
|
||||||
|
* 注意,需要保证和 spring.application.name 保持一致
|
||||||
|
*/
|
||||||
|
public static final String NAME = "base-server";
|
||||||
|
|
||||||
|
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/base";
|
||||||
|
|
||||||
|
public static final String VERSION = "1.0.0";
|
||||||
|
|
||||||
|
public static final String TABLE_FIELD_SPLY_ERP_CPN_NUM = "NUM";
|
||||||
|
}
|
||||||
@@ -4,9 +4,7 @@ import com.zt.plat.framework.common.exception.ErrorCode;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* base 错误码枚举类
|
* base 错误码枚举类
|
||||||
*
|
|
||||||
* base 系统,使用 1-xxx-xxx-xxx 段
|
* base 系统,使用 1-xxx-xxx-xxx 段
|
||||||
*
|
|
||||||
* @author ZT
|
* @author ZT
|
||||||
*/
|
*/
|
||||||
public interface ErrorCodeConstants {
|
public interface ErrorCodeConstants {
|
||||||
@@ -21,5 +19,14 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode COMPANY_RELATIVITY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode COMPANY_RELATIVITY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||||
ErrorCode WAREHOUSE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
ErrorCode WAREHOUSE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||||
ErrorCode FACTORY_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
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, "部门持有指标不存在");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ public enum DeleteStatusEnum {
|
|||||||
|
|
||||||
STATUS_DRF(TmplStsEnum.DRAFT.getCode(), new HashSet<>() {{add(TmplStsEnum.DRAFT.getCode());}}),
|
STATUS_DRF(TmplStsEnum.DRAFT.getCode(), new HashSet<>() {{add(TmplStsEnum.DRAFT.getCode());}}),
|
||||||
STATUS_PUB(TmplStsEnum.PUBLISHED.getCode(), new HashSet<>()),
|
STATUS_PUB(TmplStsEnum.PUBLISHED.getCode(), new HashSet<>()),
|
||||||
STATUS_STOP(TmplStsEnum.STOPPED.getCode(), new HashSet<>());
|
STATUS_STOP(TmplStsEnum.STOPPED.getCode(), new HashSet<>(){{add(TmplStsEnum.STOPPED.getCode());}}),
|
||||||
|
STATUS_START(TmplStsEnum.START.getCode(), new HashSet<>());
|
||||||
|
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ import com.zt.plat.framework.common.exception.ErrorCode;
|
|||||||
public interface ErrorCodeConstants {
|
public interface ErrorCodeConstants {
|
||||||
|
|
||||||
// ========== 示例模块 1-001-000-000 ==========
|
// ========== 示例模块 1-001-000-000 ==========
|
||||||
|
//模块 base 错误码区间[1-027-000-000 ~1-028-000-000)
|
||||||
ErrorCode TMPL_TP_NOT_EXISTS = new ErrorCode(1_027_000_500, "模板分类不存在");
|
ErrorCode TMPL_TP_NOT_EXISTS = new ErrorCode(1_027_000_500, "模板分类不存在");
|
||||||
ErrorCode TMPL_FLD_NOT_EXISTS = new ErrorCode(1_027_000_501, "模板字段不存在");
|
ErrorCode TMPL_FLD_NOT_EXISTS = new ErrorCode(1_027_000_501, "模板字段不存在");
|
||||||
ErrorCode TMPL_FLD_CODE_EXISTS = new ErrorCode(1_027_000_502, "字段编码已存在");
|
ErrorCode TMPL_FLD_CODE_EXISTS = new ErrorCode(1_027_000_502, "字段编码已存在");
|
||||||
ErrorCode TMPL_ITM_NOT_EXISTS = new ErrorCode(1_027_000_503, "模板条款不存在");
|
ErrorCode TMPL_ITM_NOT_EXISTS = new ErrorCode(1_027_000_503, "模板条款不存在");
|
||||||
|
ErrorCode TMPL_ITM_NAME_EXISTS = new ErrorCode(1_027_000_503, "模板条款名字已存在");
|
||||||
ErrorCode TEMPLATE_INSTANCE_NOT_EXISTS = new ErrorCode(1_027_000_504, "模板实例不存在");
|
ErrorCode TEMPLATE_INSTANCE_NOT_EXISTS = new ErrorCode(1_027_000_504, "模板实例不存在");
|
||||||
ErrorCode TMPL_TP_SATUS_ERROR = new ErrorCode(1_027_000_506, "状态变更失败");
|
ErrorCode TMPL_TP_SATUS_ERROR = new ErrorCode(1_027_000_506, "状态变更失败");
|
||||||
ErrorCode TMPL_TP_DEl_ERROR = new ErrorCode(1_027_000_507, "模版分类删除失败");
|
ErrorCode TMPL_TP_DEl_ERROR = new ErrorCode(1_027_000_507, "模版分类删除失败");
|
||||||
@@ -23,6 +25,13 @@ public interface ErrorCodeConstants {
|
|||||||
ErrorCode NOT_FOUND_CLASS= new ErrorCode(1_027_000_516, "找不到对应的类");
|
ErrorCode NOT_FOUND_CLASS= new ErrorCode(1_027_000_516, "找不到对应的类");
|
||||||
ErrorCode UTIL_NOT_INIT= new ErrorCode(1_027_000_517, "工具类为未初始化");
|
ErrorCode UTIL_NOT_INIT= new ErrorCode(1_027_000_517, "工具类为未初始化");
|
||||||
ErrorCode TMPL_INS_FLD_CODE_EXISTS = new ErrorCode(1_027_000_518, "字段已存在");
|
ErrorCode TMPL_INS_FLD_CODE_EXISTS = new ErrorCode(1_027_000_518, "字段已存在");
|
||||||
|
ErrorCode TMPL_ITM_EXISTS = new ErrorCode(1_027_000_519, "模板条款已存在");
|
||||||
|
ErrorCode TMPL_INSC_BSN_REL_NOT_EXISTS = new ErrorCode(1_027_000_539, "模板实例与业务中间不存在");
|
||||||
|
ErrorCode TEMPLATE_INSTANCE_FILE_NOT_EXISTS = new ErrorCode(1_027_000_520, "模板实例文件不存在");
|
||||||
|
ErrorCode FILE_PULL_EER = new ErrorCode(1_027_000_521, "文件获取失败");
|
||||||
|
ErrorCode FILE_UPLOAD_EER = new ErrorCode(1_027_000_523, "文件上传失败");
|
||||||
|
ErrorCode TMPL_INSC_ITM_BSN_NOT_EXISTS = new ErrorCode(1_027_000_524, "业务实例条款不存在");
|
||||||
|
ErrorCode TMPL_INSC_DAT_BSN_NOT_EXISTS = new ErrorCode(1_027_000_530, "业务实例字段不存在");
|
||||||
//Illegal operation type
|
//Illegal operation type
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ public enum PublishStatusEnum {
|
|||||||
|
|
||||||
STATUS_DRF(TmplStsEnum.DRAFT.getCode(), new HashSet<>() {{add(TmplStsEnum.DRAFT.getCode());}}),
|
STATUS_DRF(TmplStsEnum.DRAFT.getCode(), new HashSet<>() {{add(TmplStsEnum.DRAFT.getCode());}}),
|
||||||
STATUS_PUB(TmplStsEnum.PUBLISHED.getCode(), new HashSet<>()),
|
STATUS_PUB(TmplStsEnum.PUBLISHED.getCode(), new HashSet<>()),
|
||||||
STATUS_STOP(TmplStsEnum.STOPPED.getCode(), new HashSet<>() );
|
STATUS_STOP(TmplStsEnum.STOPPED.getCode(), new HashSet<>() ),
|
||||||
|
STATUS_START(TmplStsEnum.START.getCode(), new HashSet<>() {{add(TmplStsEnum.START.getCode());}});
|
||||||
|
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ public enum TmplStsEnum {
|
|||||||
// 已发布状态
|
// 已发布状态
|
||||||
PUBLISHED("PUB", "已发布"),
|
PUBLISHED("PUB", "已发布"),
|
||||||
// 已停用状态
|
// 已停用状态
|
||||||
STOPPED("STOP", "已停用");
|
STOPPED("STOP", "已停用"),
|
||||||
|
START("START", "已启用");
|
||||||
|
|
||||||
// 获取状态编码
|
// 获取状态编码
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ public enum UpdateStatusEnum {
|
|||||||
STATUS_STOP(TmplStsEnum.STOPPED.getCode(), new HashSet<>() {{
|
STATUS_STOP(TmplStsEnum.STOPPED.getCode(), new HashSet<>() {{
|
||||||
add(TmplStsEnum.DRAFT.getCode());
|
add(TmplStsEnum.DRAFT.getCode());
|
||||||
add(TmplStsEnum.STOPPED.getCode());
|
add(TmplStsEnum.STOPPED.getCode());
|
||||||
}});
|
}}),
|
||||||
|
STATUS_START(TmplStsEnum.START.getCode(), new HashSet<>());
|
||||||
|
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -42,6 +42,12 @@
|
|||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.zt.plat</groupId>
|
||||||
|
<artifactId>zt-module-erp-api</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 业务组件 -->
|
<!-- 业务组件 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zt.plat</groupId>
|
<groupId>com.zt.plat</groupId>
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
package com.zt.plat.module.base.api;
|
||||||
|
|
||||||
|
import com.zt.plat.module.api.BaseApi;
|
||||||
|
import com.zt.plat.module.api.dto.AccountDTO;
|
||||||
|
import com.zt.plat.module.api.dto.MaterialOtherDTO;
|
||||||
|
import com.zt.plat.module.base.service.base.AccountService;
|
||||||
|
import com.zt.plat.module.base.service.base.MaterialOtherService;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP Api 实现类
|
||||||
|
*
|
||||||
|
* @author ZT
|
||||||
|
* @author jason
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@Validated
|
||||||
|
public class BaseApiImpl implements BaseApi {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AccountService accountService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private MaterialOtherService materialOtherService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AccountDTO> getAccountNoPage(AccountDTO respVO) {
|
||||||
|
return accountService.getAccountNoPage(respVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MaterialOtherDTO> getMaterialOtherNoPage(MaterialOtherDTO respVO) {
|
||||||
|
return materialOtherService.getMaterialOtherNoPage(respVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -101,4 +101,12 @@ public class MaterialInfomationController {
|
|||||||
BeanUtils.toBean(list, MaterialInfomationRespVO.class));
|
BeanUtils.toBean(list, MaterialInfomationRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getOneTest")
|
||||||
|
@Operation(summary = "测试获取生产版本")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:material-infomation:query')")
|
||||||
|
public CommonResult<String> getTest() {
|
||||||
|
String getOneTest = materialInfomationService.getOneTest();
|
||||||
|
return success(getOneTest);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.base;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||||
|
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||||
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
|
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||||
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
|
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxRespVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.base.vo.TaxSaveReqVO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.base.TaxDO;
|
||||||
|
import com.zt.plat.module.base.service.base.TaxService;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.annotation.Resource;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.Valid;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||||
|
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 税码信息")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/tax")
|
||||||
|
@Validated
|
||||||
|
public class TaxController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TaxService taxService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建税码信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:create')")
|
||||||
|
public CommonResult<TaxRespVO> createTax(@Valid @RequestBody TaxSaveReqVO createReqVO) {
|
||||||
|
return success(taxService.createTax(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新税码信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:update')")
|
||||||
|
public CommonResult<Boolean> updateTax(@Valid @RequestBody TaxSaveReqVO updateReqVO) {
|
||||||
|
taxService.updateTax(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除税码信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTax(@RequestParam("id") Long id) {
|
||||||
|
taxService.deleteTax(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除税码信息")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTaxList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
taxService.deleteTaxListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得税码信息")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:query')")
|
||||||
|
public CommonResult<TaxRespVO> getTax(@RequestParam("id") Long id) {
|
||||||
|
TaxDO tax = taxService.getTax(id);
|
||||||
|
return success(BeanUtils.toBean(tax, TaxRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得税码信息分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:query')")
|
||||||
|
public CommonResult<PageResult<TaxRespVO>> getTaxPage(@Valid TaxPageReqVO pageReqVO) {
|
||||||
|
PageResult<TaxDO> pageResult = taxService.getTaxPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, TaxRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出税码信息 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tax:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTaxExcel(@Valid TaxPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TaxDO> list = taxService.getTaxPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "税码信息.xls", "数据", TaxRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TaxRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.zt.plat.module.base.controller.admin.base.vo;
|
package com.zt.plat.module.base.controller.admin.base.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import com.zt.plat.framework.common.pojo.PageParam;
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
@@ -41,4 +43,10 @@ public class AccountPageReqVO extends PageParam {
|
|||||||
@Schema(description = "客商公司名称")
|
@Schema(description = "客商公司名称")
|
||||||
private String customerName;
|
private String customerName;
|
||||||
|
|
||||||
|
@Schema(description = "地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -52,4 +52,12 @@ public class AccountRespVO {
|
|||||||
@ExcelProperty("客商公司名称")
|
@ExcelProperty("客商公司名称")
|
||||||
private String customerName;
|
private String customerName;
|
||||||
|
|
||||||
|
@Schema(description = "地址")
|
||||||
|
@ExcelProperty("地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "电话")
|
||||||
|
@ExcelProperty("电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,6 @@ public class AccountSaveReqVO {
|
|||||||
private String taxNumber;
|
private String taxNumber;
|
||||||
|
|
||||||
@Schema(description = "是否启用")
|
@Schema(description = "是否启用")
|
||||||
@ExcelProperty("是否启用")
|
|
||||||
private String isEnable;
|
private String isEnable;
|
||||||
|
|
||||||
@Schema(description = "客商公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "客商公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@@ -43,4 +42,10 @@ public class AccountSaveReqVO {
|
|||||||
@Schema(description = "客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "客商公司名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotEmpty(message = "客商公司名称不能为空")
|
@NotEmpty(message = "客商公司名称不能为空")
|
||||||
private String customerName;
|
private String customerName;
|
||||||
|
|
||||||
|
@Schema(description = "地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@Schema(description = "电话")
|
||||||
|
private String phone;
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ public class CompanyRelativityPageReqVO extends PageParam {
|
|||||||
@Schema(description = "负责人")
|
@Schema(description = "负责人")
|
||||||
private String manager;
|
private String manager;
|
||||||
|
|
||||||
@Schema(description = "部门来源")
|
@Schema(description = "部门来源(字典编码:sply_cpn_rel_sts)(1:外部部门;2:同步部门;)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
private String departmentSource;
|
private String departmentSource;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -16,6 +16,15 @@ public class FactoryPageReqVO extends PageParam {
|
|||||||
@Schema(description = "公司编码")
|
@Schema(description = "公司编码")
|
||||||
private String companyNumber;
|
private String companyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称")
|
||||||
|
private String cpnName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司名称", example = "张三")
|
||||||
|
private String erpCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司编码")
|
||||||
|
private String erpCompanyNumber;
|
||||||
|
|
||||||
@Schema(description = "工厂名称", example = "赵六")
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,18 @@ public class FactoryRespVO {
|
|||||||
@ExcelProperty("公司编码")
|
@ExcelProperty("公司编码")
|
||||||
private String companyNumber;
|
private String companyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称")
|
||||||
|
@ExcelProperty("公司名称")
|
||||||
|
private String cpnName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司名称", example = "张三")
|
||||||
|
@ExcelProperty("ERP公司名称")
|
||||||
|
private String erpCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司编码")
|
||||||
|
@ExcelProperty("ERP公司编码")
|
||||||
|
private String erpCompanyNumber;
|
||||||
|
|
||||||
@Schema(description = "工厂名称", example = "赵六")
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
@ExcelProperty("工厂名称")
|
@ExcelProperty("工厂名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -13,6 +13,15 @@ public class FactorySaveReqVO {
|
|||||||
@Schema(description = "公司编码")
|
@Schema(description = "公司编码")
|
||||||
private String companyNumber;
|
private String companyNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称")
|
||||||
|
private String cpnName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司名称", example = "张三")
|
||||||
|
private String erpCompanyName;
|
||||||
|
|
||||||
|
@Schema(description = "ERP公司编码")
|
||||||
|
private String erpCompanyNumber;
|
||||||
|
|
||||||
@Schema(description = "工厂名称", example = "赵六")
|
@Schema(description = "工厂名称", example = "赵六")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class MaterialOtherPageReqVO extends PageParam {
|
|||||||
private LocalDateTime[] createTime;
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
@Schema(description = "小数位数")
|
@Schema(description = "小数位数")
|
||||||
private Long decimal;
|
private Long decimalValue;
|
||||||
|
|
||||||
@Schema(description = "是否启用")
|
@Schema(description = "是否启用")
|
||||||
private String isEnable;
|
private String isEnable;
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ public class MaterialOtherRespVO {
|
|||||||
|
|
||||||
@Schema(description = "小数位数")
|
@Schema(description = "小数位数")
|
||||||
@ExcelProperty("小数位数")
|
@ExcelProperty("小数位数")
|
||||||
private Long decimal;
|
private Long decimalValue;
|
||||||
|
|
||||||
@Schema(description = "是否启用")
|
@Schema(description = "是否启用")
|
||||||
@ExcelProperty("是否启用")
|
@ExcelProperty("是否启用")
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class MaterialOtherSaveReqVO {
|
|||||||
private String gradeUnit;
|
private String gradeUnit;
|
||||||
|
|
||||||
@Schema(description = "小数位数")
|
@Schema(description = "小数位数")
|
||||||
private Long decimal;
|
private Long decimalValue;
|
||||||
|
|
||||||
@Schema(description = "是否启用")
|
@Schema(description = "是否启用")
|
||||||
private String isEnable;
|
private String isEnable;
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.base.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
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 TaxPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "类型(字典: SPLY_BSN_TP)", example = "2")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "类别")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@Schema(description = "税码")
|
||||||
|
private String taxCoding;
|
||||||
|
|
||||||
|
@Schema(description = "税码描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "税率")
|
||||||
|
private BigDecimal tax;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "王五")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.base.vo;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 税码信息 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class TaxRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26656")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "类型(字典: SPLY_BSN_TP)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@ExcelProperty("类型(字典: SPLY_BSN_TP)")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "类别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("类别")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@Schema(description = "税码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("税码")
|
||||||
|
private String taxCoding;
|
||||||
|
|
||||||
|
@Schema(description = "税码描述")
|
||||||
|
@ExcelProperty("税码描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "税率")
|
||||||
|
@ExcelProperty("税率")
|
||||||
|
private BigDecimal tax;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
@ExcelProperty("是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
@ExcelProperty("公司编码")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "王五")
|
||||||
|
@ExcelProperty("公司名称")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.base.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 税码信息新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TaxSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "26656")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "类型(字典: SPLY_BSN_TP)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||||
|
@NotEmpty(message = "类型(字典: SPLY_BSN_TP)不能为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "类别", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "类别不能为空")
|
||||||
|
private String category;
|
||||||
|
|
||||||
|
@Schema(description = "税码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "税码不能为空")
|
||||||
|
private String taxCoding;
|
||||||
|
|
||||||
|
@Schema(description = "税码描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "税率")
|
||||||
|
private BigDecimal tax;
|
||||||
|
|
||||||
|
@Schema(description = "是否启用")
|
||||||
|
private String isEnable;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
private String customerNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司名称", example = "王五")
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,6 +22,13 @@ public class WarehousePageReqVO extends PageParam {
|
|||||||
@Schema(description = "仓库编码")
|
@Schema(description = "仓库编码")
|
||||||
private String coding;
|
private String coding;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
private String cpnName;
|
||||||
|
@Schema(description = "erp工厂名称")
|
||||||
|
private String erpFactoryName;
|
||||||
|
@Schema(description = "erp工厂编码")
|
||||||
|
private String erpFactoryNumber;
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
@Schema(description = "创建时间")
|
||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] createTime;
|
private LocalDateTime[] createTime;
|
||||||
|
|||||||
@@ -20,6 +20,13 @@ public class WarehouseRespVO {
|
|||||||
@ExcelProperty("工厂编码")
|
@ExcelProperty("工厂编码")
|
||||||
private String factoryNumber;
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
private String cpnName;
|
||||||
|
@Schema(description = "erp工厂名称")
|
||||||
|
private String erpFactoryName;
|
||||||
|
@Schema(description = "erp工厂编码")
|
||||||
|
private String erpFactoryNumber;
|
||||||
|
|
||||||
@Schema(description = "仓库名称", example = "李四")
|
@Schema(description = "仓库名称", example = "李四")
|
||||||
@ExcelProperty("仓库名称")
|
@ExcelProperty("仓库名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ public class WarehouseSaveReqVO {
|
|||||||
@Schema(description = "工厂编码")
|
@Schema(description = "工厂编码")
|
||||||
private String factoryNumber;
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@Schema(description = "公司编码")
|
||||||
|
private String cpnName;
|
||||||
|
@Schema(description = "erp工厂名称")
|
||||||
|
private String erpFactoryName;
|
||||||
|
@Schema(description = "erp工厂编码")
|
||||||
|
private String erpFactoryNumber;
|
||||||
|
|
||||||
@Schema(description = "仓库名称", example = "李四")
|
@Schema(description = "仓库名称", example = "李四")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
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<BusinessAlgorithmRespVO> createBusinessAlgorithm(@Valid @RequestBody BusinessAlgorithmSaveReqVO createReqVO) {
|
||||||
|
return success(businessAlgorithmService.createBusinessAlgorithm(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新业务算法")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-algorithm:update')")
|
||||||
|
public CommonResult<Boolean> 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<Boolean> 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<Boolean> 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<BusinessAlgorithmRespVO> 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<PageResult<BusinessAlgorithmRespVO>> getBusinessAlgorithmPage(@Valid BusinessAlgorithmPageReqVO pageReqVO) {
|
||||||
|
PageResult<BusinessAlgorithmDO> 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<BusinessAlgorithmDO> list = businessAlgorithmService.getBusinessAlgorithmPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "业务算法.xls", "数据", BusinessAlgorithmRespVO.class,
|
||||||
|
BeanUtils.toBean(list, BusinessAlgorithmRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
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<BusinessDepartmentIndicatorRespVO> createBusinessDepartmentIndicator(@Valid @RequestBody BusinessDepartmentIndicatorSaveReqVO createReqVO) {
|
||||||
|
return success(businessDepartmentIndicatorService.createBusinessDepartmentIndicator(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新部门持有指标")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-department-indicator:update')")
|
||||||
|
public CommonResult<Boolean> 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<Boolean> 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<Boolean> 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<BusinessDepartmentIndicatorRespVO> 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<PageResult<BusinessDepartmentIndicatorRespVO>> getBusinessDepartmentIndicatorPage(@Valid BusinessDepartmentIndicatorPageReqVO pageReqVO) {
|
||||||
|
PageResult<BusinessDepartmentIndicatorDO> 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<BusinessDepartmentIndicatorDO> list = businessDepartmentIndicatorService.getBusinessDepartmentIndicatorPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "部门持有指标.xls", "数据", BusinessDepartmentIndicatorRespVO.class,
|
||||||
|
BeanUtils.toBean(list, BusinessDepartmentIndicatorRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.businessdictionarytype;
|
||||||
|
|
||||||
|
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.businessdictionarytype.vo.*;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.businessdictionarytype.BusinessDictionaryTypeDO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.businessdictionarytype.BusinessDictionaryDataDO;
|
||||||
|
import com.zt.plat.module.base.service.businessdictionarytype.BusinessDictionaryTypeService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 业务字典类型")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/business-dictionary-type")
|
||||||
|
@Validated
|
||||||
|
public class BusinessDictionaryTypeController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private BusinessDictionaryTypeService businessDictionaryTypeService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建业务字典类型")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:create')")
|
||||||
|
public CommonResult<BusinessDictionaryTypeRespVO> createBusinessDictionaryType(@Valid @RequestBody BusinessDictionaryTypeSaveReqVO createReqVO) {
|
||||||
|
return success(businessDictionaryTypeService.createBusinessDictionaryType(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新业务字典类型")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:update')")
|
||||||
|
public CommonResult<Boolean> updateBusinessDictionaryType(@Valid @RequestBody BusinessDictionaryTypeSaveReqVO updateReqVO) {
|
||||||
|
businessDictionaryTypeService.updateBusinessDictionaryType(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除业务字典类型")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:delete')")
|
||||||
|
public CommonResult<Boolean> deleteBusinessDictionaryType(@RequestParam("id") Long id) {
|
||||||
|
businessDictionaryTypeService.deleteBusinessDictionaryType(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除业务字典类型")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:delete')")
|
||||||
|
public CommonResult<Boolean> deleteBusinessDictionaryTypeList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
businessDictionaryTypeService.deleteBusinessDictionaryTypeListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得业务字典类型")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:query')")
|
||||||
|
public CommonResult<BusinessDictionaryTypeRespVO> getBusinessDictionaryType(@RequestParam("id") Long id) {
|
||||||
|
BusinessDictionaryTypeDO businessDictionaryType = businessDictionaryTypeService.getBusinessDictionaryType(id);
|
||||||
|
return success(BeanUtils.toBean(businessDictionaryType, BusinessDictionaryTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得业务字典类型分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:query')")
|
||||||
|
public CommonResult<PageResult<BusinessDictionaryTypeRespVO>> getBusinessDictionaryTypePage(@Valid BusinessDictionaryTypePageReqVO pageReqVO) {
|
||||||
|
PageResult<BusinessDictionaryTypeDO> pageResult = businessDictionaryTypeService.getBusinessDictionaryTypePage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, BusinessDictionaryTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出业务字典类型 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportBusinessDictionaryTypeExcel(@Valid BusinessDictionaryTypePageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<BusinessDictionaryTypeDO> list = businessDictionaryTypeService.getBusinessDictionaryTypePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "业务字典类型.xls", "数据", BusinessDictionaryTypeRespVO.class,
|
||||||
|
BeanUtils.toBean(list, BusinessDictionaryTypeRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== 子表(业务字典数据) ====================
|
||||||
|
|
||||||
|
@GetMapping("/business-dictionary-data/list-by-dictionary-type-id")
|
||||||
|
@Operation(summary = "获得业务字典数据列表")
|
||||||
|
@Parameter(name = "dictionaryTypeId", description = "字典类型")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dictionary-type:query')")
|
||||||
|
public CommonResult<List<BusinessDictionaryDataDO>> getBusinessDictionaryDataListByDictionaryTypeId(@RequestParam("dictionaryTypeId") Long dictionaryTypeId) {
|
||||||
|
return success(businessDictionaryTypeService.getBusinessDictionaryDataListByDictionaryTypeId(dictionaryTypeId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.businessdictionarytype.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 BusinessDictionaryTypePageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "字典名称", example = "王五")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "字典类型", example = "1")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "状态(0正常 1停用)", example = "2")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.businessdictionarytype.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 BusinessDictionaryTypeRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11771")
|
||||||
|
@ExcelProperty("主键ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "字典名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@ExcelProperty("字典名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "字典类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@ExcelProperty("字典类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "状态(0正常 1停用)", example = "2")
|
||||||
|
@ExcelProperty("状态(0正常 1停用)")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
@ExcelProperty("备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.businessdictionarytype.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.businessdictionarytype.BusinessDictionaryDataDO;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务字典类型新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class BusinessDictionaryTypeSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11771")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "字典名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||||
|
@NotEmpty(message = "字典名称不能为空")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "字典类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||||
|
@NotEmpty(message = "字典类型不能为空")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@Schema(description = "状态(0正常 1停用)", example = "2")
|
||||||
|
private Long status;
|
||||||
|
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
@Schema(description = "删除时间")
|
||||||
|
private LocalDateTime delTime;
|
||||||
|
|
||||||
|
@Schema(description = "业务字典数据列表")
|
||||||
|
private List<BusinessDictionaryDataDO> businessDictionaryDatas;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
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<BusinessDimensionRespVO> createBusinessDimension(@Valid @RequestBody BusinessDimensionSaveReqVO createReqVO) {
|
||||||
|
return success(businessDimensionService.createBusinessDimension(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新经营指标维度")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-dimension:update')")
|
||||||
|
public CommonResult<Boolean> 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<Boolean> 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<Boolean> 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<BusinessDimensionRespVO> 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<PageResult<BusinessDimensionRespVO>> getBusinessDimensionPage(@Valid BusinessDimensionPageReqVO pageReqVO) {
|
||||||
|
PageResult<BusinessDimensionDO> 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<List<BusinessDimensionRespVO>> getBusinessDimensionListByParentId(@RequestParam(value = "parentId", required = false) Long parentId,
|
||||||
|
@RequestParam(value = "level", required = false) Integer level) {
|
||||||
|
List<BusinessDimensionDO> 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<BusinessDimensionDO> list = businessDimensionService.getBusinessDimensionPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "经营指标维度.xls", "数据", BusinessDimensionRespVO.class,
|
||||||
|
BeanUtils.toBean(list, BusinessDimensionRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
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<BusinessIndicatorRespVO> createBusinessIndicator(@Valid @RequestBody BusinessIndicatorSaveReqVO createReqVO) {
|
||||||
|
return success(businessIndicatorService.createBusinessIndicator(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新经营指标")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-indicator:update')")
|
||||||
|
public CommonResult<Boolean> 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<Boolean> 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<Boolean> 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<BusinessIndicatorRespVO> 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<PageResult<BusinessIndicatorRespVO>> getBusinessIndicatorPage(@Valid BusinessIndicatorPageReqVO pageReqVO) {
|
||||||
|
PageResult<BusinessIndicatorRespVO> 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<BusinessIndicatorDO> 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<List<BusinessIndicatorRespVO>> getBusinessIndicatorListByParentId(@RequestParam(value = "parentId", required = false) Long parentId) {
|
||||||
|
List<BusinessIndicatorDO> list = businessIndicatorService.getBusinessIndicatorListByParentId(parentId);
|
||||||
|
return success(BeanUtils.toBean(list, BusinessIndicatorRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,105 @@
|
|||||||
|
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<BusinessRuleRespVO> createBusinessRule(@Valid @RequestBody BusinessRuleSaveReqVO createReqVO) {
|
||||||
|
return success(businessRuleService.createBusinessRule(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新业务规则")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:business-rule:update')")
|
||||||
|
public CommonResult<Boolean> 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<Boolean> 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<Boolean> 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<BusinessRuleRespVO> 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<PageResult<BusinessRuleRespVO>> getBusinessRulePage(@Valid BusinessRulePageReqVO pageReqVO) {
|
||||||
|
PageResult<BusinessRuleDO> 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<BusinessRuleDO> list = businessRuleService.getBusinessRulePage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "业务规则.xls", "数据", BusinessRuleRespVO.class,
|
||||||
|
BeanUtils.toBean(list, BusinessRuleRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import com.zt.plat.module.base.service.tmpltp.TemplateInstanceService;
|
|||||||
import com.zt.plat.module.infra.api.file.FileApi;
|
import com.zt.plat.module.infra.api.file.FileApi;
|
||||||
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
|
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -42,6 +43,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
@Tag(name = "管理后台 - 模板实例")
|
@Tag(name = "管理后台 - 模板实例")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/base/template-instance")
|
@RequestMapping("/base/template-instance")
|
||||||
@@ -55,15 +57,16 @@ public class TemplateInstanceController extends AbstractFileUploadController {
|
|||||||
setFileUploadInfo(annotation);
|
setFileUploadInfo(annotation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TemplateInstanceService templateInstanceService;
|
private TemplateInstanceService templateInstanceService;
|
||||||
|
|
||||||
//上传文件
|
//上传文件
|
||||||
@PostMapping("/save-file")
|
// @PostMapping("/save-file")
|
||||||
@Operation(summary = "上传文件", description = "上传文件,传入文件对象和模版实例id")
|
// @Operation(summary = "上传文件", description = "上传文件,传入文件对象和模版实例id")
|
||||||
public CommonResult<Map<String, Object>> uploadFile(@NotEmpty(message = "文件不能为空") @RequestParam("file") MultipartFile file,@RequestParam("id") String id) {
|
// public CommonResult<Map<String, Object>> uploadFile(@NotEmpty(message = "文件不能为空") @RequestParam("file") MultipartFile file,@RequestParam("id") String id) {
|
||||||
return success(templateInstanceService.saveFile(file,id));
|
// return success(templateInstanceService.saveFile(file,id));
|
||||||
}
|
// }
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建模板实例")
|
@Operation(summary = "创建模板实例")
|
||||||
@@ -102,13 +105,18 @@ public class TemplateInstanceController extends AbstractFileUploadController {
|
|||||||
@Operation(summary = "获得模板实例")
|
@Operation(summary = "获得模板实例")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:template-instance:query')")
|
@PreAuthorize("@ss.hasPermission('bse:template-instance:query')")
|
||||||
public CommonResult<TemplateInstanceRespVO> getTemplateInstance(@RequestParam("id") Long id) {
|
public CommonResult<TemplateInstanceRespVO> getTemplateInstance(@Valid @NotEmpty(message = "编号不能为空") @RequestParam("id") String id) {
|
||||||
TemplateInstanceDO templateInstance = templateInstanceService.getTemplateInstance(id);
|
TemplateInstanceDO templateInstance = templateInstanceService.getTemplateInstance(Long.valueOf(id));
|
||||||
TemplateInstanceRespVO templateInstanceRespVO = BeanUtils.toBean(templateInstance, TemplateInstanceRespVO.class);
|
TemplateInstanceRespVO templateInstanceRespVO = BeanUtils.toBean(templateInstance, TemplateInstanceRespVO.class);
|
||||||
|
if (templateInstanceRespVO != null) {
|
||||||
templateInstanceService.getDetailedInfo(templateInstanceRespVO);
|
templateInstanceService.getDetailedInfo(templateInstanceRespVO);
|
||||||
|
log.info("==================模板实例详情查询成功=================");
|
||||||
return success(templateInstanceRespVO);
|
return success(templateInstanceRespVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return success(null);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得模板实例分页")
|
@Operation(summary = "获得模板实例分页")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:template-instance:query')")
|
@PreAuthorize("@ss.hasPermission('bse:template-instance:query')")
|
||||||
@@ -116,7 +124,9 @@ public class TemplateInstanceController extends AbstractFileUploadController {
|
|||||||
PageResult<TemplateInstanceDO> pageResult = templateInstanceService.getTemplateInstancePage(pageReqVO);
|
PageResult<TemplateInstanceDO> pageResult = templateInstanceService.getTemplateInstancePage(pageReqVO);
|
||||||
PageResult<TemplateInstanceRespVO> templateInstanceRespVOPageResult = BeanUtils.toBean(pageResult, TemplateInstanceRespVO.class);
|
PageResult<TemplateInstanceRespVO> templateInstanceRespVOPageResult = BeanUtils.toBean(pageResult, TemplateInstanceRespVO.class);
|
||||||
templateInstanceRespVOPageResult.getList().forEach(templateInstanceRespVO -> {
|
templateInstanceRespVOPageResult.getList().forEach(templateInstanceRespVO -> {
|
||||||
|
if (templateInstanceRespVO != null) {
|
||||||
templateInstanceService.getDetailedInfo(templateInstanceRespVO);
|
templateInstanceService.getDetailedInfo(templateInstanceRespVO);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return success(templateInstanceRespVOPageResult);
|
return success(templateInstanceRespVOPageResult);
|
||||||
}
|
}
|
||||||
@@ -150,8 +160,12 @@ public class TemplateInstanceController extends AbstractFileUploadController {
|
|||||||
public CommonResult<PageResult<TemplateInstanceRespVO>> listExcludingDisabled(@Valid TemplateInstancePageReqVO pageReqVO) {
|
public CommonResult<PageResult<TemplateInstanceRespVO>> listExcludingDisabled(@Valid TemplateInstancePageReqVO pageReqVO) {
|
||||||
PageResult<TemplateInstanceRespVO> templateInstanceRespVOPageResult = BeanUtils.toBean(templateInstanceService.listExcludingDisabled(pageReqVO), TemplateInstanceRespVO.class);
|
PageResult<TemplateInstanceRespVO> templateInstanceRespVOPageResult = BeanUtils.toBean(templateInstanceService.listExcludingDisabled(pageReqVO), TemplateInstanceRespVO.class);
|
||||||
templateInstanceRespVOPageResult.getList().forEach(
|
templateInstanceRespVOPageResult.getList().forEach(
|
||||||
templateInstanceRespVO ->
|
templateInstanceRespVO -> {
|
||||||
templateInstanceService.getDetailedInfo(templateInstanceRespVO));
|
if (templateInstanceRespVO != null) {
|
||||||
|
templateInstanceService.getDetailedInfo(templateInstanceRespVO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
return success(templateInstanceRespVOPageResult);
|
return success(templateInstanceRespVOPageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,6 +177,7 @@ public class TemplateInstanceController extends AbstractFileUploadController {
|
|||||||
templateInstanceService.setDisableOrEnable(reqVO);
|
templateInstanceService.setDisableOrEnable(reqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//根据id获取实例版本号
|
//根据id获取实例版本号
|
||||||
@GetMapping("/get-version")
|
@GetMapping("/get-version")
|
||||||
@Operation(summary = "根据id获取实例版本号")
|
@Operation(summary = "根据id获取实例版本号")
|
||||||
@@ -184,4 +199,11 @@ public class TemplateInstanceController extends AbstractFileUploadController {
|
|||||||
public CommonResult<List<TemplateInstanceRespVO>> listByTemplateCode(@RequestParam("cdg") @Valid @NotEmpty(message = "模版编号不能为空") String templateCode) {
|
public CommonResult<List<TemplateInstanceRespVO>> listByTemplateCode(@RequestParam("cdg") @Valid @NotEmpty(message = "模版编号不能为空") String templateCode) {
|
||||||
return success(templateInstanceService.listByCdg(templateCode));
|
return success(templateInstanceService.listByCdg(templateCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//通过实例id获取字段和条款详情
|
||||||
|
@GetMapping("/field-and-clause-detail")
|
||||||
|
@Operation(summary = "通过实例id获取字段和条款详情")
|
||||||
|
public CommonResult<FieldAndClauseRespVO> getFieldAndClauseDetail(@Valid @NotEmpty(message = "模版实例id不能为空") @RequestParam("id") String id) {
|
||||||
|
return success(templateInstanceService.getFieldAndClauseDetail(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -115,6 +115,4 @@ public class TemplateInstanceDataController implements BusinessControllerMarker
|
|||||||
ExcelUtils.write(response, "实例字段值.xls", "数据", TemplateInstanceDataRespVO.class,
|
ExcelUtils.write(response, "实例字段值.xls", "数据", TemplateInstanceDataRespVO.class,
|
||||||
BeanUtils.toBean(list, TemplateInstanceDataRespVO.class));
|
BeanUtils.toBean(list, TemplateInstanceDataRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,123 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelPageReqVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelRespVO;
|
||||||
|
import com.zt.plat.module.base.controller.admin.templtp.vo.TmplInscBsnRelSaveReqVO;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscBsnRelDO;
|
||||||
|
import com.zt.plat.module.base.service.tmpltp.TmplInscBsnRelService;
|
||||||
|
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.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 模板实例与业务中间")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/tmpl-insc-bsn-rel")
|
||||||
|
@Validated
|
||||||
|
public class TmplInscBsnRelController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmplInscBsnRelService tmplInscBsnRelService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建模板实例与业务中间")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:create')")
|
||||||
|
public CommonResult<TmplInscBsnRelRespVO> createTmplInscBsnRel(@Valid @RequestBody TmplInscBsnRelSaveReqVO createReqVO) {
|
||||||
|
return success(tmplInscBsnRelService.createTmplInscBsnRel(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新模板实例与业务中间")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:update')")
|
||||||
|
public CommonResult<Boolean> updateTmplInscBsnRel(@Valid @RequestBody TmplInscBsnRelSaveReqVO updateReqVO) {
|
||||||
|
tmplInscBsnRelService.updateTmplInscBsnRel(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除模板实例与业务中间")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscBsnRel(@RequestParam("id") Long id) {
|
||||||
|
tmplInscBsnRelService.deleteTmplInscBsnRel(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除模板实例与业务中间")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscBsnRelList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
tmplInscBsnRelService.deleteTmplInscBsnRelListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得模板实例与业务中间")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
|
||||||
|
public CommonResult<TmplInscBsnRelRespVO> getTmplInscBsnRel(@RequestParam("id") Long id) {
|
||||||
|
TmplInscBsnRelDO tmplInscBsnRel = tmplInscBsnRelService.getTmplInscBsnRel(id);
|
||||||
|
TmplInscBsnRelRespVO tmplInscBsnRelRespVO = BeanUtils.toBean(tmplInscBsnRel, TmplInscBsnRelRespVO.class);
|
||||||
|
if (tmplInscBsnRelRespVO != null) {
|
||||||
|
tmplInscBsnRelService.getTmplInscBsnRelDetails(tmplInscBsnRelRespVO);
|
||||||
|
}
|
||||||
|
return success(tmplInscBsnRelRespVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得模板实例与业务中间分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:query')")
|
||||||
|
public CommonResult<PageResult<TmplInscBsnRelRespVO>> getTmplInscBsnRelPage(@Valid TmplInscBsnRelPageReqVO pageReqVO) {
|
||||||
|
PageResult<TmplInscBsnRelDO> pageResult = tmplInscBsnRelService.getTmplInscBsnRelPage(pageReqVO);
|
||||||
|
PageResult<TmplInscBsnRelRespVO> tmplInscBsnRelRespVOPageResult = BeanUtils.toBean(pageResult, TmplInscBsnRelRespVO.class);
|
||||||
|
tmplInscBsnRelRespVOPageResult.getList().forEach(tmplInscBsnRelRespVO -> {
|
||||||
|
if (tmplInscBsnRelRespVO != null) {
|
||||||
|
tmplInscBsnRelService.getTmplInscBsnRelDetails(tmplInscBsnRelRespVO);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return success(tmplInscBsnRelRespVOPageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出模板实例与业务中间 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-bsn-rel:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTmplInscBsnRelExcel(@Valid TmplInscBsnRelPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TmplInscBsnRelDO> list = tmplInscBsnRelService.getTmplInscBsnRelPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "模板实例与业务中间.xls", "数据", TmplInscBsnRelRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TmplInscBsnRelRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscDatBsnDO;
|
||||||
|
import com.zt.plat.module.base.service.tmpltp.TmplInscDatBsnService;
|
||||||
|
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.templtp.vo.*;
|
||||||
|
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 业务实例字段值")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/tmpl-insc-dat-bsn")
|
||||||
|
@Validated
|
||||||
|
public class TmplInscDatBsnController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmplInscDatBsnService tmplInscDatBsnService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建业务实例字段值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:create')")
|
||||||
|
public CommonResult<TmplInscDatBsnRespVO> createTmplInscDatBsn(@Valid @RequestBody TmplInscDatBsnSaveReqVO createReqVO) {
|
||||||
|
return success(tmplInscDatBsnService.createTmplInscDatBsn(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新业务实例字段值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:update')")
|
||||||
|
public CommonResult<Boolean> updateTmplInscDatBsn(@Valid @RequestBody TmplInscDatBsnSaveReqVO updateReqVO) {
|
||||||
|
tmplInscDatBsnService.updateTmplInscDatBsn(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除业务实例字段值")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscDatBsn(@RequestParam("id") String id) {
|
||||||
|
tmplInscDatBsnService.deleteTmplInscDatBsn(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除业务实例字段值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscDatBsnList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
tmplInscDatBsnService.deleteTmplInscDatBsnListByIds(req.getIds().stream().map(String::valueOf).toList());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得业务实例字段值")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:query')")
|
||||||
|
public CommonResult<TmplInscDatBsnRespVO> getTmplInscDatBsn(@RequestParam("id") String id) {
|
||||||
|
TmplInscDatBsnDO tmplInscDatBsn = tmplInscDatBsnService.getTmplInscDatBsn(id);
|
||||||
|
return success(BeanUtils.toBean(tmplInscDatBsn, TmplInscDatBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得业务实例字段值分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:query')")
|
||||||
|
public CommonResult<PageResult<TmplInscDatBsnRespVO>> getTmplInscDatBsnPage(@Valid TmplInscDatBsnPageReqVO pageReqVO) {
|
||||||
|
PageResult<TmplInscDatBsnDO> pageResult = tmplInscDatBsnService.getTmplInscDatBsnPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, TmplInscDatBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出业务实例字段值 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-dat-bsn:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTmplInscDatBsnExcel(@Valid TmplInscDatBsnPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TmplInscDatBsnDO> list = tmplInscDatBsnService.getTmplInscDatBsnPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "业务实例字段值.xls", "数据", TmplInscDatBsnRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TmplInscDatBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp;
|
||||||
|
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplInscItmBsnDO;
|
||||||
|
import com.zt.plat.module.base.service.tmpltp.TmplInscItmBsnService;
|
||||||
|
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.templtp.vo.*;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 业务实例条款值")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/base/tmpl-insc-itm-bsn")
|
||||||
|
@Validated
|
||||||
|
public class TmplInscItmBsnController implements BusinessControllerMarker {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TmplInscItmBsnService tmplInscItmBsnService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建业务实例条款值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:create')")
|
||||||
|
public CommonResult<TmplInscItmBsnRespVO> createTmplInscItmBsn(@Valid @RequestBody TmplInscItmBsnSaveReqVO createReqVO) {
|
||||||
|
return success(tmplInscItmBsnService.createTmplInscItmBsn(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新业务实例条款值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:update')")
|
||||||
|
public CommonResult<Boolean> updateTmplInscItmBsn(@Valid @RequestBody TmplInscItmBsnSaveReqVO updateReqVO) {
|
||||||
|
tmplInscItmBsnService.updateTmplInscItmBsn(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除业务实例条款值")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscItmBsn(@RequestParam("id") String id) {
|
||||||
|
tmplInscItmBsnService.deleteTmplInscItmBsn(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除业务实例条款值")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:delete')")
|
||||||
|
public CommonResult<Boolean> deleteTmplInscItmBsnList(@RequestBody BatchDeleteReqVO req) {
|
||||||
|
tmplInscItmBsnService.deleteTmplInscItmBsnListByIds(req.getIds());
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得业务实例条款值")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:query')")
|
||||||
|
public CommonResult<TmplInscItmBsnRespVO> getTmplInscItmBsn(@RequestParam("id") String id) {
|
||||||
|
TmplInscItmBsnDO tmplInscItmBsn = tmplInscItmBsnService.getTmplInscItmBsn(id);
|
||||||
|
return success(BeanUtils.toBean(tmplInscItmBsn, TmplInscItmBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得业务实例条款值分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:query')")
|
||||||
|
public CommonResult<PageResult<TmplInscItmBsnRespVO>> getTmplInscItmBsnPage(@Valid TmplInscItmBsnPageReqVO pageReqVO) {
|
||||||
|
PageResult<TmplInscItmBsnDO> pageResult = tmplInscItmBsnService.getTmplInscItmBsnPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, TmplInscItmBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出业务实例条款值 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('base:tmpl-insc-itm-bsn:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportTmplInscItmBsnExcel(@Valid TmplInscItmBsnPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<TmplInscItmBsnDO> list = tmplInscItmBsnService.getTmplInscItmBsnPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "业务实例条款值.xls", "数据", TmplInscItmBsnRespVO.class,
|
||||||
|
BeanUtils.toBean(list, TmplInscItmBsnRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ package com.zt.plat.module.base.controller.admin.templtp;
|
|||||||
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
import com.zt.plat.module.base.controller.admin.templtp.vo.*;
|
||||||
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplTpDO;
|
import com.zt.plat.module.base.dal.dataobject.tmpltp.TmplTpDO;
|
||||||
import com.zt.plat.module.base.service.tmpltp.TmplTpService;
|
import com.zt.plat.module.base.service.tmpltp.TmplTpService;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -85,8 +86,8 @@ public class TmplTpController extends AbstractFileUploadController implements Bu
|
|||||||
@Operation(summary = "获得模板分类")
|
@Operation(summary = "获得模板分类")
|
||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:tmpl-tp:query')")
|
@PreAuthorize("@ss.hasPermission('bse:tmpl-tp:query')")
|
||||||
public CommonResult<TmplTpRespVO> getTmplTp(@RequestParam("id") Long id) {
|
public CommonResult<TmplTpRespVO> getTmplTp(@Valid @NotEmpty(message = "编号不能为空") @RequestParam("id") String id) {
|
||||||
TmplTpDO tmplTp = tmplTpService.getTmplTp(id);
|
TmplTpDO tmplTp = tmplTpService.getTmplTp(Long.valueOf(id));
|
||||||
return success(BeanUtils.toBean(tmplTp, TmplTpRespVO.class));
|
return success(BeanUtils.toBean(tmplTp, TmplTpRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,10 +115,10 @@ public class TmplTpController extends AbstractFileUploadController implements Bu
|
|||||||
@GetMapping("/field-and-clause")
|
@GetMapping("/field-and-clause")
|
||||||
@Operation(summary = "获得字段和条款",description = "字段和条款回显,传入模版分类的id")
|
@Operation(summary = "获得字段和条款",description = "字段和条款回显,传入模版分类的id")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:tmpl-tp:query')")
|
@PreAuthorize("@ss.hasPermission('bse:tmpl-tp:query')")
|
||||||
public CommonResult<Map<String, Object>> getFieldAndClause(@RequestParam("id") Long id) {
|
public CommonResult<Map<String, Object>> getFieldAndClause(@Valid @NotEmpty(message = "编号不能为空")@RequestParam("id") String id) {
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put("field", tmplTpService.getField(id));
|
map.put("field", tmplTpService.getField(Long.valueOf(id)));
|
||||||
map.put("clause", tmplTpService.getClause(id));
|
map.put("clause", tmplTpService.getClause(Long.valueOf(id)));
|
||||||
return success(map);
|
return success(map);
|
||||||
}
|
}
|
||||||
//获取分类树
|
//获取分类树
|
||||||
|
|||||||
@@ -31,9 +31,24 @@ public class OnlyOfficeCallbackController {
|
|||||||
@PostMapping("/callback/{id}")
|
@PostMapping("/callback/{id}")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
@TenantIgnore
|
@TenantIgnore
|
||||||
public ResponseEntity<Map<String, Integer>> handleCallback(@RequestBody OnlyOfficeCallback callback, @PathVariable String id) {
|
public ResponseEntity<Map<String, Integer>> handleCallback(@RequestBody OnlyOfficeCallback callback, @PathVariable String id,@RequestParam("fileName") String fileName) {
|
||||||
// 处理回调逻辑
|
// 处理回调逻辑
|
||||||
callbackService.processCallback(callback,id);
|
callbackService.processCallback(callback,id,fileName);
|
||||||
|
// 返回必须的响应,否则OnlyOffice会显示错误
|
||||||
|
Map<String, Integer> response = new HashMap<>();
|
||||||
|
response.put("error", 0);
|
||||||
|
return new ResponseEntity<>(response, HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理OnlyOffice文档编辑服务发送的回调
|
||||||
|
*/
|
||||||
|
@PostMapping("/contract /callback/{id}")
|
||||||
|
@PermitAll
|
||||||
|
@TenantIgnore
|
||||||
|
public ResponseEntity<Map<String, Integer>> handleContractCallback(@RequestBody OnlyOfficeCallback callback, @PathVariable String id,@RequestParam("fileName") String fileName) {
|
||||||
|
// 处理回调逻辑
|
||||||
|
callbackService.processContractCallback(callback,id,fileName);
|
||||||
// 返回必须的响应,否则OnlyOffice会显示错误
|
// 返回必须的响应,否则OnlyOffice会显示错误
|
||||||
Map<String, Integer> response = new HashMap<>();
|
Map<String, Integer> response = new HashMap<>();
|
||||||
response.put("error", 0);
|
response.put("error", 0);
|
||||||
|
|||||||
@@ -8,5 +8,12 @@ public interface OnlyOfficeCallbackService {
|
|||||||
* 处理OnlyOffice回调
|
* 处理OnlyOffice回调
|
||||||
* @param callback 回调数据
|
* @param callback 回调数据
|
||||||
*/
|
*/
|
||||||
void processCallback(OnlyOfficeCallback callback,String id);
|
void processCallback(OnlyOfficeCallback callback,String id,String fileName);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理OnlyOffice回调
|
||||||
|
* @param callback 回调数据
|
||||||
|
*/
|
||||||
|
void processContractCallback(OnlyOfficeCallback callback,String id,String fileName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
package com.zt.plat.module.base.controller.admin.templtp.onlyoffice.service;
|
package com.zt.plat.module.base.controller.admin.templtp.onlyoffice.service;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.Action;
|
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.Action;
|
||||||
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.History;
|
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.History;
|
||||||
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.OnlyOfficeCallback;
|
import com.zt.plat.module.base.controller.admin.templtp.onlyoffice.pojo.OnlyOfficeCallback;
|
||||||
|
import com.zt.plat.module.base.service.tmpltp.TemplateInstanceService;
|
||||||
import com.zt.plat.module.infra.api.file.FileApi;
|
import com.zt.plat.module.infra.api.file.FileApi;
|
||||||
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
|
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
|
||||||
|
import com.zt.plat.module.infra.api.file.dto.FileRespDTO;
|
||||||
|
import com.zt.plat.module.system.api.dept.DeptApi;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
@@ -13,6 +17,8 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.zt.plat.module.base.controller.admin.templtp.onlyoffice.util.UrlFileDownloader.downloadFileAsMultipart;
|
import static com.zt.plat.module.base.controller.admin.templtp.onlyoffice.util.UrlFileDownloader.downloadFileAsMultipart;
|
||||||
|
|
||||||
@@ -21,55 +27,56 @@ import static com.zt.plat.module.base.controller.admin.templtp.onlyoffice.util.U
|
|||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService {
|
public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService {
|
||||||
|
|
||||||
private final FileApi fileApi;
|
private final FileApi fileApi;
|
||||||
|
private final TemplateInstanceService templateInstanceService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processCallback(OnlyOfficeCallback callback,String id) {
|
public void processCallback(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
log.info("Received OnlyOffice callback for document: {}", callback.getKey());
|
log.info("收到OnlyOffice文档回调: {}", callback.getKey());
|
||||||
log.info("Callback status: {}", callback.getStatus());
|
log.info("回调状态: {}", callback.getStatus());
|
||||||
|
|
||||||
// 根据不同的状态处理回调
|
// 根据不同的状态处理回调
|
||||||
switch (callback.getStatus()) {
|
switch (callback.getStatus()) {
|
||||||
case 1:
|
case 1:
|
||||||
handleEditingStatus(callback,id);
|
handleEditingStatus(callback, id,fileName);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
handleDocumentSaved(callback,id);
|
handleDocumentSaved(callback, id,fileName);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
handleSaveError(callback,id);
|
handleSaveError(callback, id,fileName);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
handleDocumentClosedWithoutChanges(callback,id);
|
handleDocumentClosedWithoutChanges(callback, id,fileName);
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
handleForcedSave(callback,id);
|
handleForcedSave(callback, id,fileName);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
handleForcedSaveError(callback,id);
|
handleForcedSaveError(callback, id,fileName);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
log.warn("Received unknown callback status: {}", callback.getStatus());
|
log.warn("收到未知的回调状态: {}", callback.getStatus());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理文档正在编辑的状态
|
* 处理文档正在编辑的状态
|
||||||
*/
|
*/
|
||||||
private void handleEditingStatus(OnlyOfficeCallback callback,String id) {
|
private void handleEditingStatus(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
log.info("Document {} is being edited by users: {}",
|
log.info("文档 {} 正在被以下用户编辑: {}",
|
||||||
callback.getKey(), callback.getUsers());
|
callback.getKey(), callback.getUsers());
|
||||||
|
|
||||||
// 处理用户操作(连接或断开连接)
|
// 处理用户操作(连接或断开连接)
|
||||||
if (callback.getActions() != null) {
|
if (callback.getActions() != null) {
|
||||||
for (Action action : callback.getActions()) {
|
for (Action action : callback.getActions()) {
|
||||||
String actionType = switch (action.getType()) {
|
String actionType = switch (action.getType()) {
|
||||||
case 0 -> "disconnected from";
|
case 0 -> "断开了连接";
|
||||||
case 1 -> "connected to";
|
case 1 -> "连接成功";
|
||||||
case 2 -> "clicked force save in";
|
case 2 -> "在中点击了强制保存";
|
||||||
default -> "performed unknown action in";
|
default -> "在中执行了未知操作";
|
||||||
};
|
};
|
||||||
log.info("User {} {}", action.getUserId(), actionType);
|
log.info("用户 {} {}", action.getUserId(), actionType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,9 +84,9 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
/**
|
/**
|
||||||
* 处理文档已保存的状态
|
* 处理文档已保存的状态
|
||||||
*/
|
*/
|
||||||
private void handleDocumentSaved(OnlyOfficeCallback callback,String id) {
|
private void handleDocumentSaved(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
log.info("Document {} is ready to be saved", callback.getKey());
|
log.info("文档 {} 已准备好保存", callback.getKey());
|
||||||
saveDocument(callback,id);
|
saveDocument(callback, id,fileName);
|
||||||
|
|
||||||
// 处理历史记录
|
// 处理历史记录
|
||||||
// handleHistoryChanges(callback,id);
|
// handleHistoryChanges(callback,id);
|
||||||
@@ -88,26 +95,26 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
/**
|
/**
|
||||||
* 处理保存错误的状态
|
* 处理保存错误的状态
|
||||||
*/
|
*/
|
||||||
private void handleSaveError(OnlyOfficeCallback callback,String id) {
|
private void handleSaveError(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
log.error("Error saving document {}", callback.getKey());
|
log.error("保存文档 {} 时出错", callback.getKey());
|
||||||
// 可以在这里添加错误处理逻辑,如发送通知等
|
// 可以在这里添加错误处理逻辑,如发送通知等
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理文档关闭且无更改的状态
|
* 处理文档关闭且无更改的状态
|
||||||
*/
|
*/
|
||||||
private void handleDocumentClosedWithoutChanges(OnlyOfficeCallback callback,String id) {
|
private void handleDocumentClosedWithoutChanges(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
log.info("Document {} closed without changes", callback.getKey());
|
log.info("文档 {} 已关闭,未做任何更改", callback.getKey());
|
||||||
// 可以在这里添加清理资源等逻辑
|
// 可以在这里添加清理资源等逻辑
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 处理强制保存的状态
|
* 处理强制保存的状态
|
||||||
*/
|
*/
|
||||||
private void handleForcedSave(OnlyOfficeCallback callback,String id) {
|
private void handleForcedSave(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
log.info("Document {} forced save. Type: {}",
|
log.info("文档 {} 执行强制保存。类型: {}",
|
||||||
callback.getKey(), callback.getForceSaveType());
|
callback.getKey(), callback.getForceSaveType());
|
||||||
saveDocument(callback,id);
|
saveDocument(callback, id,fileName);
|
||||||
|
|
||||||
// 处理历史记录
|
// 处理历史记录
|
||||||
handleHistoryChanges(callback, id);
|
handleHistoryChanges(callback, id);
|
||||||
@@ -121,15 +128,15 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
/**
|
/**
|
||||||
* 处理强制保存错误的状态
|
* 处理强制保存错误的状态
|
||||||
*/
|
*/
|
||||||
private void handleForcedSaveError(OnlyOfficeCallback callback,String id) {
|
private void handleForcedSaveError(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
log.error("Error during forced save of document {}", callback.getKey());
|
log.error("文档 {} 强制保存时出错", callback.getKey());
|
||||||
// 可以在这里添加错误处理逻辑
|
// 可以在这里添加错误处理逻辑
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存文档到存储
|
* 保存文档到存储
|
||||||
*/
|
*/
|
||||||
private void saveDocument(OnlyOfficeCallback callback,String id) {
|
private void saveDocument(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
if (callback.getUrl() == null) {
|
if (callback.getUrl() == null) {
|
||||||
log.error("文件路径为空");
|
log.error("文件路径为空");
|
||||||
return;
|
return;
|
||||||
@@ -139,19 +146,33 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
MultipartFile file = downloadFileAsMultipart(callback.getUrl());
|
MultipartFile file = downloadFileAsMultipart(callback.getUrl());
|
||||||
// 1. 验证文件是否为空
|
// 1. 验证文件是否为空
|
||||||
|
|
||||||
|
|
||||||
// 2. 获取并验证文件名
|
|
||||||
String fileName = file.getOriginalFilename();
|
|
||||||
|
|
||||||
String directory = "模版实例";
|
String directory = "模版实例";
|
||||||
FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO();
|
FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO();
|
||||||
fileCreateReqDTO.setName(fileName);
|
fileCreateReqDTO.setName(fileName);
|
||||||
fileCreateReqDTO.setContent(file.getBytes());
|
fileCreateReqDTO.setContent(file.getBytes());
|
||||||
fileCreateReqDTO.setType(file.getContentType()); // 使用真实的MIME类型
|
fileCreateReqDTO.setType(file.getContentType()); // 使用真实的MIME类型
|
||||||
fileCreateReqDTO.setDirectory(directory); // 设置文件存储目录
|
fileCreateReqDTO.setDirectory(directory); // 设置文件存储目录
|
||||||
|
if (file.getSize() <=0){
|
||||||
|
log.error("文件大小为0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
// 7. 调用文件服务创建文件
|
// 7. 调用文件服务创建文件
|
||||||
CommonResult<String> result = fileApi.createFile(fileCreateReqDTO);
|
CommonResult<FileRespDTO> result = fileApi.createFileWithReturn(fileCreateReqDTO);
|
||||||
|
if (result.isSuccess()) {
|
||||||
|
// 创建文件成功,处理结果
|
||||||
|
result.getData().setContent(null);
|
||||||
|
log.info("文件创建成功,文件ID:{}", result.getData());
|
||||||
|
// 创建文件成功,处理结果
|
||||||
|
FileRespDTO fileRespDTO = result.getData();
|
||||||
|
Map<String, Object> fileInfo = new HashMap<>();
|
||||||
|
fileInfo.put("id",String.valueOf(fileRespDTO.getId()));
|
||||||
|
fileInfo.put("name", fileRespDTO.getName());
|
||||||
|
fileInfo.put("directory", fileRespDTO.getDirectory());
|
||||||
|
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo));
|
||||||
|
} else {
|
||||||
|
// 创建文件失败,处理错误
|
||||||
|
log.error("文件创建失败,错误信息:{}", result.getMsg());
|
||||||
|
}
|
||||||
log.info("文件创建结果:{}", result);
|
log.info("文件创建结果:{}", result);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
@@ -165,14 +186,14 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
private void handleHistoryChanges(OnlyOfficeCallback callback, String id) {
|
private void handleHistoryChanges(OnlyOfficeCallback callback, String id) {
|
||||||
History history = callback.getHistory();
|
History history = callback.getHistory();
|
||||||
if (history != null) {
|
if (history != null) {
|
||||||
log.info("Processing document history changes for {}", callback.getKey());
|
log.info("正在处理文档 {} 的历史记录变更", callback.getKey());
|
||||||
// 这里可以实现处理历史记录的逻辑
|
// 这里可以实现处理历史记录的逻辑
|
||||||
// 例如:调用refreshHistory方法更新历史记录
|
// 例如:调用refreshHistory方法更新历史记录
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理变更历史URL
|
// 处理变更历史URL
|
||||||
if (callback.getChangesUrl() != null) {
|
if (callback.getChangesUrl() != null) {
|
||||||
log.info("Changes URL for document {}: {}", callback.getKey(), callback.getChangesUrl());
|
log.info("文档 {} 的变更历史URL: {}", callback.getKey(), callback.getChangesUrl());
|
||||||
// 这里可以实现保存变更历史的逻辑
|
// 这里可以实现保存变更历史的逻辑
|
||||||
// 例如:下载变更历史并使用setHistoryData方法存储
|
// 例如:下载变更历史并使用setHistoryData方法存储
|
||||||
}
|
}
|
||||||
@@ -182,10 +203,165 @@ public class OnlyOfficeCallbackServiceImpl implements OnlyOfficeCallbackService
|
|||||||
* 处理表单提交数据
|
* 处理表单提交数据
|
||||||
*/
|
*/
|
||||||
private void handleFormSubmission(OnlyOfficeCallback callback, String id) {
|
private void handleFormSubmission(OnlyOfficeCallback callback, String id) {
|
||||||
log.info("Processing form submission for document {}", callback.getKey());
|
log.info("正在处理文档 {} 的表单提交", callback.getKey());
|
||||||
// 这里可以实现处理表单数据的逻辑
|
// 这里可以实现处理表单数据的逻辑
|
||||||
// 例如:从formsDataUrl下载并解析表单数据
|
// 例如:从formsDataUrl下载并解析表单数据
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processContractCallback(OnlyOfficeCallback callback, String id, String fileName) {
|
||||||
|
log.info("收到OnlyOffice文档回调: {}", callback.getKey());
|
||||||
|
log.info("回调状态: {}", callback.getStatus());
|
||||||
|
|
||||||
|
// 根据不同的状态处理回调
|
||||||
|
switch (callback.getStatus()) {
|
||||||
|
case 1:
|
||||||
|
handleContractEditingStatus(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
handleContractDocumentSaved(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
handleContractSaveError(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
handleContractDocumentClosedWithoutChanges(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
handleContractForcedSave(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
handleContractForcedSaveError(callback, id,fileName);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
log.warn("收到未知的回调状态: {}", callback.getStatus());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理文档正在编辑的状态
|
||||||
|
*/
|
||||||
|
private void handleContractEditingStatus(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.info("文档 {} 正在被以下用户编辑: {}",
|
||||||
|
callback.getKey(), callback.getUsers());
|
||||||
|
|
||||||
|
// 处理用户操作(连接或断开连接)
|
||||||
|
if (callback.getActions() != null) {
|
||||||
|
for (Action action : callback.getActions()) {
|
||||||
|
String actionType = switch (action.getType()) {
|
||||||
|
case 0 -> "断开了连接";
|
||||||
|
case 1 -> "连接成功";
|
||||||
|
case 2 -> "在中点击了强制保存";
|
||||||
|
default -> "在中执行了未知操作";
|
||||||
|
};
|
||||||
|
log.info("用户 {} {}", action.getUserId(), actionType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理文档已保存的状态
|
||||||
|
*/
|
||||||
|
private void handleContractDocumentSaved(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.info("文档 {} 已准备好保存", callback.getKey());
|
||||||
|
saveContractDocument(callback, id,fileName);
|
||||||
|
|
||||||
|
// 处理历史记录
|
||||||
|
// handleHistoryChanges(callback,id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理保存错误的状态
|
||||||
|
*/
|
||||||
|
private void handleContractSaveError(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.error("保存文档 {} 时出错", callback.getKey());
|
||||||
|
// 可以在这里添加错误处理逻辑,如发送通知等
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理文档关闭且无更改的状态
|
||||||
|
*/
|
||||||
|
private void handleContractDocumentClosedWithoutChanges(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.info("文档 {} 已关闭,未做任何更改", callback.getKey());
|
||||||
|
// 可以在这里添加清理资源等逻辑
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理强制保存的状态
|
||||||
|
*/
|
||||||
|
private void handleContractForcedSave(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.info("文档 {} 执行强制保存。类型: {}",
|
||||||
|
callback.getKey(), callback.getForceSaveType());
|
||||||
|
saveContractDocument(callback, id,fileName);
|
||||||
|
|
||||||
|
// 处理历史记录
|
||||||
|
handleHistoryChanges(callback, id);
|
||||||
|
|
||||||
|
// 如果是表单提交,处理表单数据
|
||||||
|
if (callback.getForceSaveType() == 3 && callback.getFormsDataUrl() != null) {
|
||||||
|
handleFormSubmission(callback, id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理强制保存错误的状态
|
||||||
|
*/
|
||||||
|
private void handleContractForcedSaveError(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
log.error("文档 {} 强制保存时出错", callback.getKey());
|
||||||
|
// 可以在这里添加错误处理逻辑
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存文档到存储
|
||||||
|
*/
|
||||||
|
private void saveContractDocument(OnlyOfficeCallback callback, String id,String fileName) {
|
||||||
|
if (callback.getUrl() == null) {
|
||||||
|
log.error("文件路径为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
MultipartFile file = downloadFileAsMultipart(callback.getUrl());
|
||||||
|
// 1. 验证文件是否为空
|
||||||
|
|
||||||
|
String directory = "模版实例";
|
||||||
|
FileCreateReqDTO fileCreateReqDTO = new FileCreateReqDTO();
|
||||||
|
fileCreateReqDTO.setName(fileName);
|
||||||
|
fileCreateReqDTO.setContent(file.getBytes());
|
||||||
|
fileCreateReqDTO.setType(file.getContentType()); // 使用真实的MIME类型
|
||||||
|
fileCreateReqDTO.setDirectory(directory); // 设置文件存储目录
|
||||||
|
if (file.getSize() <=0){
|
||||||
|
log.error("文件大小为0");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 7. 调用文件服务创建文件
|
||||||
|
CommonResult<FileRespDTO> result = fileApi.createFileWithReturn(fileCreateReqDTO);
|
||||||
|
if (result.isSuccess()) {
|
||||||
|
// 创建文件成功,处理结果
|
||||||
|
result.getData().setContent(null);
|
||||||
|
log.info("文件创建成功,文件ID:{}", result.getData());
|
||||||
|
// 创建文件成功,处理结果
|
||||||
|
FileRespDTO fileRespDTO = result.getData();
|
||||||
|
Map<String, Object> fileInfo = new HashMap<>();
|
||||||
|
fileInfo.put("id",String.valueOf(fileRespDTO.getId()));
|
||||||
|
fileInfo.put("name", fileRespDTO.getName());
|
||||||
|
fileInfo.put("directory", fileRespDTO.getDirectory());
|
||||||
|
templateInstanceService.updateTemplateInstanceFileUrlByInstanceId(id, JSONObject.toJSONString(fileInfo));
|
||||||
|
} else {
|
||||||
|
// 创建文件失败,处理错误
|
||||||
|
log.error("文件创建失败,错误信息:{}", result.getMsg());
|
||||||
|
}
|
||||||
|
log.info("文件创建结果:{}", result);
|
||||||
|
} catch (IOException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,9 @@ public class UrlFileDownloader {
|
|||||||
String contentType = connection.getContentType() == null ? "application/octet-stream" : connection.getContentType();
|
String contentType = connection.getContentType() == null ? "application/octet-stream" : connection.getContentType();
|
||||||
// 3. 读取文件字节内容
|
// 3. 读取文件字节内容
|
||||||
byte[] fileBytes = readFileBytes(connection.getInputStream());
|
byte[] fileBytes = readFileBytes(connection.getInputStream());
|
||||||
|
if (fileBytes.length == 0){
|
||||||
|
throw new IOException("文件内容为空");
|
||||||
|
}
|
||||||
// 4. 使用自定义MultipartFile实现类封装(不依赖Spring Test)
|
// 4. 使用自定义MultipartFile实现类封装(不依赖Spring Test)
|
||||||
return new CustomMultipartFile(
|
return new CustomMultipartFile(
|
||||||
"file", // 表单字段名(与上传接口的@RequestParam("file")对应)
|
"file", // 表单字段名(与上传接口的@RequestParam("file")对应)
|
||||||
@@ -79,7 +81,7 @@ public class UrlFileDownloader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 从URL和响应头中提取文件名
|
* 从URL和响应头中提取文件名。
|
||||||
*/
|
*/
|
||||||
private static String getFileNameFromUrl(String fileUrl, URLConnection connection) {
|
private static String getFileNameFromUrl(String fileUrl, URLConnection connection) {
|
||||||
// 优先从响应头的Content-Disposition获取(如:attachment;filename="test.pdf")
|
// 优先从响应头的Content-Disposition获取(如:attachment;filename="test.pdf")
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.util.List;
|
|||||||
@Schema(description = "管理后台 - 实例启用与禁用 Request VO")
|
@Schema(description = "管理后台 - 实例启用与禁用 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class DisableEnableReqVO {
|
public class DisableEnableReqVO {
|
||||||
@Schema(description = "实例主键(id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
@Schema(description = "实例主键(id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "['1','2']")
|
||||||
@NotEmpty(message = "实例主键不能为空")
|
@NotEmpty(message = "实例主键不能为空")
|
||||||
private List<String> ids;
|
private List<String> ids;
|
||||||
@Schema(description = "操作类型;操作类型type,type的值启用为enable,禁用为disable", requiredMode = Schema.RequiredMode.REQUIRED, example = "enable")
|
@Schema(description = "操作类型;操作类型type,type的值启用为enable,禁用为disable", requiredMode = Schema.RequiredMode.REQUIRED, example = "enable")
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 合同动态表单 响应 VO")
|
||||||
|
@Data
|
||||||
|
public class FieldAndClauseRespVO {
|
||||||
|
@Schema(description = "模板分类")
|
||||||
|
List<TmplFldRespVO> tmplFldRespVOS;
|
||||||
|
@Schema(description = "条款")
|
||||||
|
List<TmplItmRespVO> tmplItmRespVOS;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,7 +21,7 @@ public class TemplateInstanceDataSaveReqVO {
|
|||||||
private String fldKy;
|
private String fldKy;
|
||||||
|
|
||||||
@Schema(description = "用户填写的值", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "用户填写的值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotEmpty(message = "用户填写的值不能为空")
|
// @NotEmpty(message = "用户填写的值不能为空")
|
||||||
private String fldVal;
|
private String fldVal;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class TemplateInstanceItemSaveReqVO {
|
|||||||
private String itmId;
|
private String itmId;
|
||||||
|
|
||||||
@Schema(description = "用户填写的值", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "用户填写的值", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotEmpty(message = "用户填写的值不能为空")
|
// @NotEmpty(message = "用户填写的值不能为空")
|
||||||
private String val;
|
private String val;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.module.system.api.dept.dto.DeptDetailRespDTO;
|
||||||
|
import com.zt.plat.module.system.api.dept.dto.DeptRespDTO;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -59,12 +61,23 @@ public class TemplateInstanceRespVO {
|
|||||||
@Schema(description = "发布时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "发布时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@ExcelProperty("发布时间")
|
@ExcelProperty("发布时间")
|
||||||
private LocalDateTime publishTime;
|
private LocalDateTime publishTime;
|
||||||
|
|
||||||
|
|
||||||
@Schema(description = "使用部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
@Schema(description = "使用部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
private List<String> deptIds;
|
private List<String> deptIds;
|
||||||
@Schema(description = "实例字段;这个是实例字段绑定的字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
@Schema(description = "实例字段;这个是实例字段绑定的字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
private List<TemplateInstanceDataRespVO> templateInstanceDataRespVOS;
|
private List<TemplateInstanceDataRespVO> templateInstanceDataRespVOS;
|
||||||
@Schema(description = "实例条款;这个是实例条款绑定的条款;", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
@Schema(description = "实例条款;这个是实例条款绑定的条款;", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
private List<TemplateInstanceItemRespVO> instanceItemRespVOS;
|
private List<TemplateInstanceItemRespVO> instanceItemRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "使用部门编", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
private List<DeptRespDTO> DeptRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "模版分类名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试分类名称")
|
||||||
|
@ExcelProperty("模版分类名称")
|
||||||
|
private String tpName;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
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 TmplInscBsnRelPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "业务主键", example = "30969")
|
||||||
|
private Long bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例主键", example = "10551")
|
||||||
|
private String inscId;
|
||||||
|
|
||||||
|
@Schema(description = "文件内容")
|
||||||
|
private String cntt;
|
||||||
|
|
||||||
|
@Schema(description = "版本号,如v1.0")
|
||||||
|
private String ver;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.module.system.api.dept.dto.DeptRespDTO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 模板实例与业务中间 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class TmplInscBsnRelRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14132")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "业务主键", example = "30969")
|
||||||
|
@ExcelProperty("业务主键")
|
||||||
|
private Long bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例主键", example = "10551")
|
||||||
|
@ExcelProperty("实例主键")
|
||||||
|
private String inscId;
|
||||||
|
|
||||||
|
@Schema(description = "文件内容")
|
||||||
|
@ExcelProperty("文件内容")
|
||||||
|
private String cntt;
|
||||||
|
|
||||||
|
@Schema(description = "版本号,如v1.0")
|
||||||
|
@ExcelProperty("版本号,如v1.0")
|
||||||
|
private String ver;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "使用部门编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
private List<String> deptIds;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "实例字段;这个是实例字段绑定的字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
private List<TemplateInstanceDataRespVO> templateInstanceDataRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "实例条款;这个是实例条款绑定的条款;", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
private List<TemplateInstanceItemRespVO> instanceItemRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "使用部门编", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
private List<DeptRespDTO> DeptRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "模版实例名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "测试分类名称")
|
||||||
|
@ExcelProperty("模版实例名称")
|
||||||
|
private String inscName;
|
||||||
|
|
||||||
|
@Schema(description = "业务实例字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
@ExcelProperty("业务实例字段")
|
||||||
|
private List<TmplInscDatBsnRespVO> tmplInscDatBsnRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "业务实例条款", requiredMode = Schema.RequiredMode.REQUIRED, example = "")
|
||||||
|
@ExcelProperty("业务实例条款")
|
||||||
|
private List<TmplInscItmBsnRespVO> tmplInscItmBsnRespVOS;
|
||||||
|
|
||||||
|
@Schema(description = "创建人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建人")
|
||||||
|
private String creator;
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 模板实例与业务中间新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscBsnRelSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "14132")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
@Schema(description = "业务主键", example = "30969")
|
||||||
|
private Long bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例主键", example = "10551")
|
||||||
|
private String inscId;
|
||||||
|
|
||||||
|
@Schema(description = "文件内容")
|
||||||
|
private String cntt;
|
||||||
|
|
||||||
|
@Schema(description = "版本号,如v1.0")
|
||||||
|
private String ver;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例字段值分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscDatBsnPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", example = "4270")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "字段标识,关联字段库")
|
||||||
|
private String inscFldId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
private String fldVal;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDate[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例字段值 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class TmplInscDatBsnRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8260")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4270")
|
||||||
|
@ExcelProperty("关联中间表业务主键")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "字段标识,关联实例字段库", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("字段主键,关联实例字段库")
|
||||||
|
private String inscFldId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
@ExcelProperty("用户填写的值")
|
||||||
|
private String fldVal;
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "字段标识")
|
||||||
|
@ExcelProperty("字段标识")
|
||||||
|
private String fldKy;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDate createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例字段值新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscDatBsnSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8260")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "4270")
|
||||||
|
@NotEmpty(message = "关联中间表业务主键不能为空")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "字段标识,关联实例字段库", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "字段标识,关联实例字段库不能为空")
|
||||||
|
private String inscFldId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
private String fldVal;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例条款值分页 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscItmBsnPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", example = "17128")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例条款主键,关联实例字段库", example = "15878")
|
||||||
|
private String instceItmId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
private String val;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDate[] createTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.*;
|
||||||
|
import com.alibaba.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例条款值 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class TmplInscItmBsnRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30559")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128")
|
||||||
|
@ExcelProperty("关联中间表业务主键")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例条款主键,关联实例字段库", requiredMode = Schema.RequiredMode.REQUIRED, example = "15878")
|
||||||
|
@ExcelProperty("实例条款主键,关联字段库")
|
||||||
|
private String inscItmId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
@ExcelProperty("用户填写的值")
|
||||||
|
private String val;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDate createTime;
|
||||||
|
|
||||||
|
@Schema(description = "条款名", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("条款名")
|
||||||
|
private String itmName;
|
||||||
|
|
||||||
|
@Schema(description = "条款主键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("条款主键")
|
||||||
|
private String itmId;
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.zt.plat.module.base.controller.admin.templtp.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 业务实例条款值新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class TmplInscItmBsnSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "30559")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "关联中间表业务主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17128")
|
||||||
|
@NotEmpty(message = "关联中间表业务主键不能为空")
|
||||||
|
private String bsnId;
|
||||||
|
|
||||||
|
@Schema(description = "实例条款主键,关联实例字段库", requiredMode = Schema.RequiredMode.REQUIRED, example = "15878")
|
||||||
|
@NotEmpty(message = "实例条款主键,关联实例字段库不能为空")
|
||||||
|
private String instceItmId;
|
||||||
|
|
||||||
|
@Schema(description = "用户填写的值")
|
||||||
|
private String val;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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<BusinessAlgorithmDO> {
|
||||||
|
|
||||||
|
default PageResult<BusinessAlgorithmDO> selectPage(BusinessAlgorithmPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessAlgorithmDO>()
|
||||||
|
.eqIfPresent(BusinessAlgorithmDO::getTypeValue, reqVO.getTypeValue())
|
||||||
|
.eqIfPresent(BusinessAlgorithmDO::getStatusValue, reqVO.getStatusValue())
|
||||||
|
.eqIfPresent(BusinessAlgorithmDO::getCode, reqVO.getCode())
|
||||||
|
.likeIfPresent(BusinessAlgorithmDO::getName, reqVO.getName())
|
||||||
|
.orderByDesc(BusinessAlgorithmDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
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<BusinessDepartmentIndicatorDO> {
|
||||||
|
|
||||||
|
default PageResult<BusinessDepartmentIndicatorDO> selectPage(BusinessDepartmentIndicatorPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessDepartmentIndicatorDO>()
|
||||||
|
.eqIfPresent(BusinessDepartmentIndicatorDO::getIndicatorId, reqVO.getIndicatorId())
|
||||||
|
.eqIfPresent(BusinessDepartmentIndicatorDO::getIsKey, reqVO.getIsKey())
|
||||||
|
.orderByDesc(BusinessDepartmentIndicatorDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dao.businessdictionarytype;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
|
import com.zt.plat.module.base.dal.dataobject.businessdictionarytype.BusinessDictionaryDataDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务字典数据 Mapper
|
||||||
|
*
|
||||||
|
* @author yangxiaofeng
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BusinessDictionaryDataMapper extends BaseMapperX<BusinessDictionaryDataDO> {
|
||||||
|
|
||||||
|
default List<BusinessDictionaryDataDO> selectListByDictionaryTypeId(Long dictionaryTypeId) {
|
||||||
|
return selectList(BusinessDictionaryDataDO::getDictionaryTypeId, dictionaryTypeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int deleteByDictionaryTypeId(Long dictionaryTypeId) {
|
||||||
|
return delete(BusinessDictionaryDataDO::getDictionaryTypeId, dictionaryTypeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
default int deleteByDictionaryTypeIds(List<Long> dictionaryTypeIds) {
|
||||||
|
return deleteBatch(BusinessDictionaryDataDO::getDictionaryTypeId, dictionaryTypeIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dao.businessdictionarytype;
|
||||||
|
|
||||||
|
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.businessdictionarytype.BusinessDictionaryTypeDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import com.zt.plat.module.base.controller.admin.businessdictionarytype.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务字典类型 Mapper
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BusinessDictionaryTypeMapper extends BaseMapperX<BusinessDictionaryTypeDO> {
|
||||||
|
|
||||||
|
default PageResult<BusinessDictionaryTypeDO> selectPage(BusinessDictionaryTypePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessDictionaryTypeDO>()
|
||||||
|
.likeIfPresent(BusinessDictionaryTypeDO::getName, reqVO.getName())
|
||||||
|
.likeIfPresent(BusinessDictionaryTypeDO::getType, reqVO.getType())
|
||||||
|
.eqIfPresent(BusinessDictionaryTypeDO::getStatus, reqVO.getStatus())
|
||||||
|
.orderByDesc(BusinessDictionaryTypeDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
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<BusinessDimensionDO> {
|
||||||
|
|
||||||
|
default PageResult<BusinessDimensionDO> selectPage(BusinessDimensionPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessDimensionDO>()
|
||||||
|
.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<BusinessDimensionDO> selectListByParentId(Long parentId, Integer level) {
|
||||||
|
LambdaQueryWrapperX<BusinessDimensionDO> queryWrapper = new LambdaQueryWrapperX<BusinessDimensionDO>();
|
||||||
|
|
||||||
|
// 构建层次查询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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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<BusinessIndicatorDO> {
|
||||||
|
|
||||||
|
default PageResult<BusinessIndicatorDO> selectPage(BusinessIndicatorPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessIndicatorDO>()
|
||||||
|
.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<BusinessIndicatorDO> selectListByParentId(Long parentId) {
|
||||||
|
LambdaQueryWrapperX<BusinessIndicatorDO> queryWrapper = new LambdaQueryWrapperX<BusinessIndicatorDO>()
|
||||||
|
.orderByDesc(BusinessIndicatorDO::getId);
|
||||||
|
|
||||||
|
// 如果parentId 是 null,查询根节点(parentId 为 null 的节点)
|
||||||
|
if (parentId == null) {
|
||||||
|
queryWrapper.isNull(BusinessIndicatorDO::getParentId);
|
||||||
|
} else {
|
||||||
|
queryWrapper.eq(BusinessIndicatorDO::getParentId, parentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
return selectList(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
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<BusinessRuleDO> {
|
||||||
|
|
||||||
|
default PageResult<BusinessRuleDO> selectPage(BusinessRulePageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<BusinessRuleDO>()
|
||||||
|
.eqIfPresent(BusinessRuleDO::getStatusValue, reqVO.getStatusValue())
|
||||||
|
.eqIfPresent(BusinessRuleDO::getTypeValue, reqVO.getTypeValue())
|
||||||
|
.eqIfPresent(BusinessRuleDO::getCode, reqVO.getCode())
|
||||||
|
.likeIfPresent(BusinessRuleDO::getName, reqVO.getName())
|
||||||
|
.orderByDesc(BusinessRuleDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 账户条款 DO
|
* 账户条款 DO
|
||||||
@@ -102,4 +103,10 @@ public class AccountDO extends BusinessBaseDO {
|
|||||||
@TableField("UPDATER_NAME")
|
@TableField("UPDATER_NAME")
|
||||||
private String updaterName;
|
private String updaterName;
|
||||||
|
|
||||||
|
@TableField("ADDRESS")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@TableField("PHONE")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 工厂 DO
|
* 工厂 DO
|
||||||
@@ -33,6 +34,24 @@ public class FactoryDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("CPN_NUM")
|
@TableField("CPN_NUM")
|
||||||
private String companyNumber;
|
private String companyNumber;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
@TableField("CPN_NAME")
|
||||||
|
private String cpnName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP公司名称
|
||||||
|
*/
|
||||||
|
@TableField("ERP_CPN_NAME")
|
||||||
|
private String erpCompanyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ERP公司编码
|
||||||
|
*/
|
||||||
|
@TableField("ERP_CPN_NUM")
|
||||||
|
private String erpCompanyNumber;
|
||||||
/**
|
/**
|
||||||
* 工厂名称
|
* 工厂名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class MaterialOtherDO extends BusinessBaseDO {
|
|||||||
* 小数位数
|
* 小数位数
|
||||||
*/
|
*/
|
||||||
@TableField("DEC")
|
@TableField("DEC")
|
||||||
private Long decimal;
|
private Long decimalValue;
|
||||||
/**
|
/**
|
||||||
* 创建人名称
|
* 创建人名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dataobject.base;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
/**
|
||||||
|
* 税码信息 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理-1
|
||||||
|
*/
|
||||||
|
@TableName("sply_tax")
|
||||||
|
@KeySequence("sply_tax_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class TaxDO extends BusinessBaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 类型(字典: SPLY_BSN_TP)
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 类别
|
||||||
|
*/
|
||||||
|
private String category;
|
||||||
|
/**
|
||||||
|
* 税码
|
||||||
|
*/
|
||||||
|
private String taxCoding;
|
||||||
|
/**
|
||||||
|
* 税码描述
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 税率
|
||||||
|
*/
|
||||||
|
private BigDecimal tax;
|
||||||
|
/**
|
||||||
|
* 是否启用
|
||||||
|
*/
|
||||||
|
private String isEnable;
|
||||||
|
/**
|
||||||
|
* 公司编码
|
||||||
|
*/
|
||||||
|
private String customerNumber;
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
private String customerName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.base.dal.dataobject.base;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
/**
|
/**
|
||||||
* 仓库 DO
|
* 仓库 DO
|
||||||
@@ -33,6 +34,14 @@ public class WarehouseDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("FACT_NUM")
|
@TableField("FACT_NUM")
|
||||||
private String factoryNumber;
|
private String factoryNumber;
|
||||||
|
|
||||||
|
@TableField("CPN_NAME")
|
||||||
|
private String cpnName;
|
||||||
|
@TableField("ERP_FACT_NAME")
|
||||||
|
private String erpFactoryName;
|
||||||
|
@TableField("ERP_FACT_NUM")
|
||||||
|
private String erpFactoryNumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 仓库名称
|
* 仓库名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,57 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dataobject.businessdictionarytype;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务字典数据 DO
|
||||||
|
*
|
||||||
|
* @author yangxiaofeng
|
||||||
|
*/
|
||||||
|
@TableName("bse_bsn_dic_dat")
|
||||||
|
@KeySequence("bse_bsn_dic_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class BusinessDictionaryDataDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 上级字典
|
||||||
|
*/
|
||||||
|
@TableField("PRN_ID")
|
||||||
|
private Long parentId;
|
||||||
|
/**
|
||||||
|
* 字典类型
|
||||||
|
*/
|
||||||
|
@TableField("DIC_TP_ID")
|
||||||
|
private Long dictionaryTypeId;
|
||||||
|
/**
|
||||||
|
* 排序号
|
||||||
|
*/
|
||||||
|
@TableField("SRT")
|
||||||
|
private Long sort;
|
||||||
|
/**
|
||||||
|
* 字典标签
|
||||||
|
*/
|
||||||
|
@TableField("LBL")
|
||||||
|
private String label;
|
||||||
|
/**
|
||||||
|
* 字典值
|
||||||
|
*/
|
||||||
|
@TableField("VAL")
|
||||||
|
private String value;
|
||||||
|
/**
|
||||||
|
* 状态(0正常 1停用)
|
||||||
|
*/
|
||||||
|
@TableField("STS")
|
||||||
|
private Long status;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.zt.plat.module.base.dal.dataobject.businessdictionarytype;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 业务字典类型 DO
|
||||||
|
*
|
||||||
|
* @author 后台管理
|
||||||
|
*/
|
||||||
|
@TableName("bse_bsn_dic_tp")
|
||||||
|
@KeySequence("bse_bsn_dic_tp_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
/**
|
||||||
|
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||||
|
*/
|
||||||
|
public class BusinessDictionaryTypeDO extends BaseDO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键ID
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 字典名称
|
||||||
|
*/
|
||||||
|
@TableField("NAME")
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 字典类型
|
||||||
|
*/
|
||||||
|
@TableField("TP")
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 状态(0正常 1停用)
|
||||||
|
*/
|
||||||
|
@TableField("STS")
|
||||||
|
private Long status;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField("RMK")
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 删除时间
|
||||||
|
*/
|
||||||
|
@TableField("DEL_TM")
|
||||||
|
private LocalDateTime delTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user