✨ 新增业务部门配置并按平台公司生成合同号与金蝶部门码

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-02 21:10:45 +08:00
parent 91dddd0e02
commit fd3ca7496d
24 changed files with 912 additions and 40 deletions
@@ -65,6 +65,7 @@ public class SysCache {
private static final String ROLE_NAMES_ID = "roleNames:id:";
private static final String ROLE_ALIAS_ID = "roleAlias:id:";
private static final String ROLE_ALIASES_ID = "roleAliases:id:";
private static final String BUSINESS_DEPT_CONFIG = "businessDeptConfig:platformDept:";
public static final String TENANT_ID = "tenant:id:";
public static final String TENANT_TENANT_ID = "tenant:tenantId:";
public static final String TENANT_PACKAGE_ID = "tenant:packageId:";
@@ -381,4 +382,21 @@ public class SysCache {
}, Boolean.FALSE);
}
/**
* 按平台公司 + 业务部门获取业务部门配置
*
* @param platformCompanyId 平台公司ID
* @param businessDeptId 业务部门ID
* @return 业务部门配置
*/
public static BusinessDeptConfig getBusinessDeptConfig(Long platformCompanyId, Long businessDeptId) {
if (platformCompanyId == null || businessDeptId == null) {
return null;
}
return CacheUtil.get(SYS_CACHE, BUSINESS_DEPT_CONFIG, platformCompanyId + StringPool.DASH + businessDeptId, () -> {
R<BusinessDeptConfig> result = getSysClient().getBusinessDeptConfig(platformCompanyId, businessDeptId);
return result.getData();
});
}
}
@@ -76,6 +76,7 @@ public interface ISysClient {
String MEASUREMENT_UNITS = API_PREFIX + "/measurement-units";
String PERMISSIONS = API_PREFIX + "/permissions";
String INVOICE_ITEMS = API_PREFIX + "/invoice-items";
String BUSINESS_DEPT_CONFIG = API_PREFIX + "/business-dept-config";
/**
* 获取菜单
@@ -345,4 +346,15 @@ public interface ISysClient {
@GetMapping(INVOICE_ITEMS)
R<List<InvoiceItem>> getInvoiceItems();
/**
* 按平台公司 + 业务部门获取业务部门配置
*
* @param platformCompanyId 平台公司ID
* @param businessDeptId 业务部门ID
* @return 业务部门配置
*/
@GetMapping(BUSINESS_DEPT_CONFIG)
R<BusinessDeptConfig> getBusinessDeptConfig(@RequestParam("platformCompanyId") Long platformCompanyId,
@RequestParam("businessDeptId") Long businessDeptId);
}
@@ -189,4 +189,9 @@ public class ISysClientFallback implements ISysClient {
return R.fail("获取数据失败");
}
@Override
public R<BusinessDeptConfig> getBusinessDeptConfig(Long platformCompanyId, Long businessDeptId) {
return R.fail("获取数据失败");
}
}
@@ -0,0 +1,87 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.entity;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.io.Serial;
/**
* 业务部门配置实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_business_dept_config")
@Schema(description = "业务部门配置")
public class BusinessDeptConfig extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "平台公司ID")
private Long platformCompanyId;
@Schema(description = "平台公司名称")
private String platformCompanyName;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "业务部门ID")
private Long businessDeptId;
@Schema(description = "业务部门名称")
private String businessDeptName;
@Schema(description = "合同编码前缀")
private String contractCodePrefix;
@Schema(description = "初始流水号")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Integer initialSerial;
@Schema(description = "金蝶公司代码")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String kingdeeCompanyCode;
@Schema(description = "金蝶部门代码")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String kingdeeDeptCode;
@Schema(description = "备注")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private String remark;
}
@@ -0,0 +1,57 @@
/**
* BladeX Commercial License Agreement
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
* <p>
* Use of this software is governed by the Commercial License Agreement
* obtained after purchasing a license from BladeX.
* <p>
* 1. This software is for development use only under a valid license
* from BladeX.
* <p>
* 2. Redistribution of this software's source code to any third party
* without a commercial license is strictly prohibited.
* <p>
* 3. Licensees may copyright their own code but cannot use segments
* from this software for such purposes. Copyright of this software
* remains with BladeX.
* <p>
* Using this software signifies agreement to this License, and the software
* must not be used for illegal purposes.
* <p>
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
* not liable for any claims arising from secondary or illegal development.
* <p>
* Author: Chill Zhuang (bladejava@qq.com)
*/
package org.springblade.system.pojo.vo;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.system.pojo.entity.BusinessDeptConfig;
import java.io.Serial;
/**
* 业务部门配置视图实体类
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Schema(description = "业务部门配置")
public class BusinessDeptConfigVO extends BusinessDeptConfig {
@Serial
private static final long serialVersionUID = 1L;
@TableField(exist = false)
@Schema(description = "创建人姓名")
private String createUserName;
@TableField(exist = false)
@Schema(description = "更新人姓名")
private String updateUserName;
}