🔀 合并主干 master 到 dev

This commit is contained in:
2026-11-04 18:24:39 +08:00
208 changed files with 10586 additions and 1835 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;
}
@@ -203,14 +203,18 @@ public class Dept extends TenantEntity {
/**
* 是否平台公司:0否,1是
* ALWAYS:保证「否(0)」也能更新落库,避免被字段策略跳过
*/
@Schema(description = "是否平台公司:0否,1是")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Integer isPlatformCompany;
/**
* 是否业务部门:0否,1是
* ALWAYS:保证「否(0)」也能更新落库,避免被字段策略跳过
*/
@Schema(description = "是否业务部门:0否,1是")
@TableField(updateStrategy = FieldStrategy.ALWAYS)
private Integer isBusinessDept;
/**
@@ -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;
}
@@ -67,6 +67,18 @@ public class RoleDataScopeVO implements Serializable {
return scope;
}
/**
* 无组织可见(未配置数据权限时的默认结果)
*/
public static RoleDataScopeVO none() {
RoleDataScopeVO scope = new RoleDataScopeVO();
scope.setScopeType(RoleDataScopeType.CUSTOM.getCode());
scope.setAllDept(false);
scope.setOwnCreate(false);
scope.setDeptIds(Collections.emptyList());
return scope;
}
public static RoleDataScopeVO ownCreate() {
RoleDataScopeVO scope = new RoleDataScopeVO();
scope.setScopeType(RoleDataScopeType.OWN_CREATE.getCode());
@@ -103,6 +103,18 @@ public class ContractChange extends TenantEntity {
@Schema(description = "乙方")
private String partyB;
@Schema(description = "甲方客商明细JSON")
private String partyAJson;
@Schema(description = "乙方客商明细JSON")
private String partyBJson;
@Schema(description = "丙方客商明细JSON")
private String partyCJson;
@Schema(description = "丙方")
private String partyC;
@Schema(description = "开始日期")
private LocalDate startDate;
@@ -204,12 +216,6 @@ public class ContractChange extends TenantEntity {
@Schema(description = "其他事项说明")
private String remark;
@Schema(description = "合规客商风险等级(展示用)")
private String hcsRiskLevel;
@Schema(description = "合规客商黑名单状态(展示用)")
private String hcsBlackStatus;
@Schema(description = "审批状态")
private String approvalStatus;
@@ -67,6 +67,12 @@ public class ContractManage extends TenantEntity {
@Schema(description = "合同负责部门")
private String organizationName;
@Schema(description = "平台公司ID")
private Long platformCompanyId;
@Schema(description = "平台公司")
private String platformCompanyName;
@Schema(description = "合同类别")
private String contractCategory;
@@ -79,6 +85,18 @@ public class ContractManage extends TenantEntity {
@Schema(description = "乙方")
private String partyB;
@Schema(description = "甲方客商明细JSON")
private String partyAJson;
@Schema(description = "乙方客商明细JSON")
private String partyBJson;
@Schema(description = "丙方客商明细JSON")
private String partyCJson;
@Schema(description = "丙方")
private String partyC;
@Schema(description = "开始日期")
private LocalDate startDate;
@@ -240,15 +258,6 @@ public class ContractManage extends TenantEntity {
@Schema(description = "合规履约计划ID(C103-9 返回 fdExeplanId)")
private String hcsExeplanId;
@Schema(description = "合规客商风险等级(C101-1,甲方/乙方取高)")
private String hcsRiskLevel;
@Schema(description = "合规客商黑名单状态(C101-1,甲方/乙方取是)")
private String hcsBlackStatus;
@Schema(description = "合规风险校验时间")
private LocalDateTime hcsRiskTime;
@Schema(description = "合规特批流程ID(C103-8 返回)")
private String hcsSpecFdId;
@@ -52,6 +52,9 @@ public class CustomerArchive extends TenantEntity {
@Schema(description = "客商编号")
private String customerCode;
@Schema(description = "供应商编码(金蝶A901-1供应商查询返回number,建档/同步时落库)")
private String supplierCode;
@Schema(description = "客商简称")
private String shortName;
@@ -182,4 +185,19 @@ public class CustomerArchive extends TenantEntity {
@Schema(description = "金蝶推送时间")
private LocalDateTime kingdeeSyncTime;
@Schema(description = "合规客商风险等级(C101-1,每日定时刷新):0=低风险,1=中风险,2=高风险")
private String hcsRiskLevel;
@Schema(description = "合规客商黑名单状态(C101-1,每日定时刷新):yes=是,no=否,handing=处理中")
private String kingdeeBlackStatus;
@Schema(description = "合规客商风险最近查询时间(C101-1)")
private LocalDateTime hcsRiskTime;
@Schema(description = "金蝶黑名单失信类别(A801-5 awrp_combofield_title,缺失兜底 awrp_combofield)")
private String kingdeeBlackCategory;
@Schema(description = "金蝶黑名单列入事由(A801-5 awrp_textareafield)")
private String kingdeeBlackReason;
}
@@ -160,6 +160,18 @@ public class FormalSettlement extends TenantEntity {
* 金蝶同步状态:unsynced-未同步 synced-已同步 failed-同步失败
*/
private String kingdeeSyncStatus;
/**
* 金蝶推送失败原因(仅 failed 态展示;重推成功转 synced 后残留原因不再回显)
*/
private String kingdeeFailReason;
/**
* 金蝶冲销状态:unwrittenoff-未冲销 writtenoff-已冲销(null=未推送金蝶或未校验)
*/
private String kingdeeWriteOffStatus;
/**
* 金蝶冲销状态确认时间(定时回写/预检回写时间)
*/
private LocalDateTime kingdeeWriteOffTime;
/**
* 附件JSON
*/
@@ -167,6 +167,10 @@ public class InvoiceApplication extends TenantEntity {
* 金蝶同步状态:unsynced-未同步 synced-已同步 failed-同步失败 invoiced-开票完成(终态)
*/
private String kingdeeStatus;
/**
* 金蝶推送失败原因(仅 failed 态展示;重推成功转 synced 后残留原因不再回显)
*/
private String kingdeeFailReason;
/**
* 同步金蝶时间
*/
@@ -77,4 +77,11 @@ public class InvoiceApplicationInvoice extends TenantEntity {
@Schema(description = "A303-5 返回原文JSON留档")
private String rawJson;
/** 履约开票记录ID(C108-1 返回;非空即已推送,扫描据此幂等跳过) */
private String hcsPerfFdId;
/** 履约开票记录推送失败重试次数 */
private Integer hcsPerfRetryCount;
/** 履约开票记录最近推送失败原因(成功后清空) */
private String hcsPerfSyncMsg;
}
@@ -55,4 +55,10 @@ public class InvoiceReceiptSettlement extends TenantEntity {
private BigDecimal settlementAmount;
private BigDecimal receivedInvoiceAmount;
private BigDecimal allocatedInvoiceAmount;
/** 履约收票记录ID(C108-1 返回;非空即已推送,扫描据此幂等跳过) */
private String hcsPerfFdId;
/** 履约收票记录推送失败重试次数 */
private Integer hcsPerfRetryCount;
/** 履约收票记录最近推送失败原因(成功后清空) */
private String hcsPerfSyncMsg;
}
@@ -52,68 +52,96 @@ public class KingdeeReceiptFlow extends TenantEntity {
private static final long serialVersionUID = 1L;
/**
* 金蝶认领公告id(A301-2 返回 id,认领推送 A301-3 必填)
* 金蝶认领公告id(历史 A301-2 同步遗留,A301-1 口径不再使用,恒为空)
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long billId;
/**
* 金蝶付款人id(A301-2 公告对应往来单位 id,认领推送 A301-3 用)
* 金蝶付款人id(历史 A301-2 同步遗留,A301-1 口径不再使用,恒为空)
*/
private String payerId;
/**
* 公告认领状态(A301-2 claimstatus:0未认领/1已认领)
* 公告认领状态(历史 A301-2 同步遗留,A301-1 口径不再使用,恒为空)
*/
private String kingdeeClaimStatus;
/**
* 我已认领(A301-2 claimme)
* 我已认领(历史 A301-2 同步遗留,A301-1 口径不再使用,恒为空)
*/
private Boolean claimMe;
/**
* 未认领金额(A301-2 unclaimamount)
* 未匹配收款金额(A301-1 unmatchamountrec,金蝶参考展示,不参与认领额度)
*/
private BigDecimal unclaimedAmount;
private BigDecimal unmatchAmountRec;
/**
* 手续费(A301-2 fee)
* 已匹配收款金额(A301-1 matchamountrec)
*/
private BigDecimal matchAmountRec;
/**
* 已匹配付款金额(A301-1 matchamountpay)
*/
private BigDecimal matchAmountPay;
/**
* 未匹配付款金额(A301-1 unmatchamountpay)
*/
private BigDecimal unmatchAmountPay;
/**
* 已结算金额(A301-1 settleamount)
*/
private BigDecimal settleAmount;
/**
* 未结算金额(A301-1 unsettleamount)
*/
private BigDecimal unsettleAmount;
/**
* 手续费(A301-1 fee)
*/
private BigDecimal fee;
/**
* 收款人(A301-2 recpayee)
* 收款人(A301-1 收款公司名称 org_name)
*/
private String payeeName;
/**
* 收款通知单号(A301-2 billno)
* 收款人(公司).编码(A301-1 org_number)
*/
private String orgNumber;
/**
* 核算组织.编码(A301-1 openorg_number)
*/
private String openOrgNumber;
/**
* 金蝶收款单号(A301-1 billno)
*/
private String receiptNoticeNo;
/**
* 付款人名称(A301-2 recviewpayer)
* 付款人名称(A301-1 payername)
*/
private String payerName;
/**
* 收款金额(A301-2 reamount)
* 收款金额(A301-1 actrecamt)
*/
private BigDecimal receiptAmount;
/**
* 对方单位名称(A301-2 oppunit)
* 对方单位名称(A301-1 付款人名称)
*/
private String counterpartyName;
/**
* 对方银行账号(A301-2 oppbanknumber)
* 对方银行账号(A301-1 付款账户 payeracctbanknum)
*/
private String counterpartyAccount;
/**
* 对方开户行(A301-2 oppbank)
* 对方开户行(A301-1 付款银行 payerbankname)
*/
private String counterpartyBank;
/**
* 摘要(A301-2 description)
* 摘要(A301-1 txt_description)
*/
private String summary;
/**
* 交易日期(A301-2 tradetime)
* 交易日期(A301-1 业务日期 bizdate)
*/
private LocalDateTime transactionTime;
/**
* 明细流水号(A301-2 detailid,回退 tradedetailno / bankdetailno,幂等键)
* 明细流水号(收款单号 billno,幂等键;C104-2 按此定位合规侧收款流水)
*/
private String detailSerialNo;
/**
@@ -125,27 +153,27 @@ public class KingdeeReceiptFlow extends TenantEntity {
*/
private String claimStatus;
/**
* 推送状态(none未推送/pushed已推送/failed推送失败;已推送为终态闸门,不允许二次推送)
* 推送状态(none未推送/pushed已推送/failed推送失败;历史 A301-3 推送遗留,A301-1 口径下恒为 none,仅存量的已推送数据保留展示)
*/
private String pushStatus;
/**
* 最近一次推送失败原因(成功后清空)
* 最近一次推送失败原因(历史 A301-3 推送遗留)
*/
private String pushFailReason;
/**
* 首次推送金蝶成功时间
* 首次推送金蝶成功时间(历史 A301-3 推送遗留)
*/
private LocalDateTime pushedTime;
/**
* 金蝶推送来源单据编码(分摊结算单号下划线拼接,推送时生成落库;分摊不变则重试编码不变,A301-1 回写匹配键)
* 金蝶推送来源单据编码(历史 A301-3 推送遗留,A301-1 口径不再生成)
*/
private String awrpSrcCode;
/**
* 金蝶收款单号(推送响应回填 / A301-1 回写推进)
* 金蝶收款单号(A301-1 同步落库 billno)
*/
private String kingdeeBillNo;
/**
* 金蝶回写状态(none未推送/pushed已推送/approved审核通过/received已收款/failed失败)
* 金蝶单据状态(A301-1 billstatus 映射:none未推送/pushed已推送/approved审核通过/received已收款/failed失败,同步时随单据刷新)
*/
private String kingdeeBillStatus;
/**
@@ -86,6 +86,12 @@ public class LoadingManage extends TenantEntity {
@Schema(description = "承运商合同ID")
private Long carrierContractId;
@Schema(description = "承运客商明细行ID")
private String carrierPartyId;
@Schema(description = "承运客商角色:B/C")
private String carrierPartyRole;
@Schema(description = "发货地址")
private String departureAddress;
@@ -117,6 +117,8 @@ public class PaymentApplication extends TenantEntity {
private String kingdeeBillId;
/** 金蝶同步状态:unsynced 未生成 / synced 已生成 / paying 付款中 / paid 已付款 / closed 已关闭 / failed 生成失败 */
private String kingdeeStatus;
/** 金蝶推送失败原因(仅 failed 态展示;重推成功转 synced 后残留原因不再回显) */
private String kingdeeFailReason;
/** 附件信息JSON */
private String attachmentsJson;
/** 备注 */
@@ -141,6 +143,8 @@ public class PaymentApplication extends TenantEntity {
private String hcsSpecFdId;
/** 特批状态:none/need/pushing/processing/approved/rejected */
private String hcsSpecStatus;
/** 合规付款特批结果附件ID(paymentLegal/result 回调 fileUrl,C103-5 下载入参、金蝶附件联带用) */
private String hcsSpecAttachFdId;
/** 履约记录ID(C108-1 返回,C108-2 更新必传) */
private String hcsPerfFdId;
}
@@ -0,0 +1,96 @@
/**
* 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.transport.pojo.entity;
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;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
* 收款认领合规推送记录实体类
* <p>
* C107-1 认领记录推送结果落库(认领主单 × 合同一条):成功持久化合规侧 fdId 供 C107-3 作废引用,
* 失败落推送标记与原因(仅记标记,不做定时重试)。
*
* @author Chill
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("blade_receipt_claim_hcs_record")
@Schema(description = "收款认领合规推送记录")
public class ReceiptClaimHcsRecord extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* 认领主单id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long receiptClaimId;
/**
* 收款流水id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long receiptFlowId;
/**
* 合同id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long contractId;
/**
* 合同编号
*/
private String contractNo;
/**
* 该认领主单分摊到本合同的认领金额
*/
private BigDecimal claimAmount;
/**
* 合规侧认领记录fdId(C107-1 返回,C107-3 作废必填引用)
*/
private String hcsClaimRecordFdId;
/**
* 推送状态(success推送成功/failed推送失败/voided已作废)
*/
private String pushStatus;
/**
* 推送失败原因(成功后清空)
*/
private String failReason;
/**
* 推送成功时间
*/
private LocalDateTime pushedTime;
}
@@ -30,6 +30,8 @@ public class SettlementAdjustment extends TenantEntity {
private String currentNode;
private String currentProcessor;
private String kingdeeSyncStatus;
/** 金蝶推送失败原因(随结算单推送失败落库,仅 failed 态展示) */
private String kingdeeFailReason;
/**
* 金蝶单据号(未推送场景回填原结算单金蝶单号;重推场景回填新单金蝶单号)
*/
@@ -136,6 +136,12 @@ public class Waybill extends TenantEntity {
@Schema(description = "承运商合同ID")
private Long carrierContractId;
@Schema(description = "承运客商明细行ID")
private String carrierPartyId;
@Schema(description = "承运客商角色:B/C")
private String carrierPartyRole;
@Schema(description = "司机ID")
private Long driverId;
@@ -0,0 +1,54 @@
/**
* 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.transport.pojo.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* 营业执照 OCR 识别结果。
*
* @author Chill
*/
@Data
@Schema(description = "营业执照OCR识别结果")
public class BusinessLicenseOcrVO implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* 按第三方返回 key 聚合的字段,例如 uscc、company_name、legal_name。
*/
@Schema(description = "识别字段,键为第三方 OCR 的 key")
private Map<String, String> fields = new LinkedHashMap<>();
}
@@ -67,4 +67,12 @@ public class ContractChangeVO extends ContractChange {
@Schema(description = "同步状态名称")
private String syncStatusName;
@TableField(exist = false)
@Schema(description = "客商风险等级(甲乙双方关联客商档案实时组装,等级取高):0=低风险,1=中风险,2=高风险")
private String hcsRiskLevel;
@TableField(exist = false)
@Schema(description = "客商黑名单状态(甲乙双方关联客商档案实时组装,任一方金蝶黑名单命中记是):yes/no")
private String kingdeeBlackStatus;
}
@@ -64,7 +64,7 @@ public class ContractManageVO extends ContractManage {
private Boolean hcsSynced;
@TableField(exist = false)
@Schema(description = "生效类型筛选")
@Schema(description = "合同状态筛选")
private String effectiveType;
@TableField(exist = false)
@@ -87,4 +87,16 @@ public class ContractManageVO extends ContractManage {
@Schema(description = "审核状态名称")
private String approvalStatusName;
@TableField(exist = false)
@Schema(description = "客商风险等级(甲乙双方关联客商档案实时组装,等级取高):0=低风险,1=中风险,2=高风险")
private String hcsRiskLevel;
@TableField(exist = false)
@Schema(description = "客商黑名单状态(甲乙双方关联客商档案实时组装,任一方金蝶黑名单命中记是):yes/no")
private String kingdeeBlackStatus;
@TableField(exist = false)
@Schema(description = "客商风险明细文案(甲乙双方风险信息合并,列表悬浮展示,与客商列表/表单实时提示同口径)")
private String hcsRiskDetail;
}
@@ -106,4 +106,12 @@ public class CustomerArchiveVO extends CustomerArchive {
@Schema(description = "已付金额合计(元)")
private BigDecimal usedFundLimit;
@TableField(exist = false)
@Schema(description = "客商风险筛选值:blacklist黑名单/high高风险/middle中风险/low低风险")
private String customerRisk;
@TableField(exist = false)
@Schema(description = "客商风险明细(后台组装:合同系统风险等级+金蝶黑名单失信类别/列入事由)")
private String hcsRiskDetail;
}
@@ -63,6 +63,9 @@ public class CustomerRiskVO implements Serializable {
@Schema(description = "风险等级名称(服务端转义:黑名单/高风险/中风险/低风险,黑名单优先;无等级为空)")
private String riskLevelName;
@Schema(description = "是否命中金蝶黑名单(A801-5,黑名单展示口径;红字细分由前端按等级+本标记翻译)")
private Boolean kingdeeBlackHit;
@Schema(description = "是否高风险/黑名单客商(外部客商专用,内部组织恒为 false)")
private Boolean risky;
@@ -26,6 +26,7 @@
package org.springblade.transport.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.transport.pojo.entity.InvoiceApplicationLine;
@@ -44,4 +45,8 @@ import java.util.List;
public class InvoiceApplicationSheetVO extends InvoiceApplicationSheet {
@Serial private static final long serialVersionUID = 1L;
@TableField(exist = false) private List<InvoiceApplicationLine> lines;
@Schema(description = "开票状态名称(按金蝶回写的发票结果实时推导:已开票/未开票)")
@TableField(exist = false) private String invoiceStatusName;
@Schema(description = "金蝶开票结果备注(本张发票经 A303-5 回写的发票号、开票日期、价税合计汇总)")
@TableField(exist = false) private String kingdeeResultRemark;
}
@@ -55,4 +55,17 @@ public class LoadingCarrierContractVO implements Serializable {
@Schema(description = "承运商名称")
private String carrierName;
@Schema(description = "承运客商明细行ID")
private String carrierPartyId;
@Schema(description = "承运客商角色:B/C")
private String carrierPartyRole;
@Schema(description = "统一信用代码")
private String creditCode;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "客商档案ID")
private Long customerId;
}
@@ -34,4 +34,17 @@ public class MasterOrderCarrierVO implements Serializable {
@Schema(description = "承运商名称")
private String carrierName;
@Schema(description = "承运客商明细行ID")
private String carrierPartyId;
@Schema(description = "承运客商角色:B/C")
private String carrierPartyRole;
@Schema(description = "统一信用代码")
private String creditCode;
@JsonSerialize(using = ToStringSerializer.class)
@Schema(description = "客商档案ID")
private Long customerId;
}
@@ -35,6 +35,9 @@ import org.springblade.core.tool.utils.StringUtil;
import org.springblade.system.pojo.entity.User;
import org.springblade.system.feign.IUserClient;
import java.util.Collections;
import java.util.List;
import static org.springblade.core.cache.constant.CacheConstant.USER_CACHE;
import static org.springblade.core.launch.constant.FlowConstant.TASK_USR_PREFIX;
@@ -47,6 +50,7 @@ import static org.springblade.core.launch.constant.FlowConstant.TASK_USR_PREFIX;
public class UserCache {
private static final String USER_CACHE_ID = "user:id:";
private static final String USER_CACHE_ACCOUNT = "user:account:";
private static final String USER_CACHE_MANAGE_DEPT = "user:manage-dept:";
private static IUserClient userClient;
@@ -89,6 +93,26 @@ public class UserCache {
}
}
/**
* 获取用户「数据管理权限」组织(含下级展开)
*
* @param userId 用户主键
* @return 可管理组织 ID 集合
*/
@SuppressWarnings("unchecked")
public static List<Long> getManageDeptIds(Long userId) {
if (userId == null || userId <= 0) {
return Collections.emptyList();
}
try {
List<Long> deptIdList = CacheUtil.get(USER_CACHE, USER_CACHE_MANAGE_DEPT, userId, () -> loadManageDeptIds(userId));
return deptIdList == null ? Collections.emptyList() : deptIdList;
} catch (RuntimeException exception) {
log.warn("用户数据管理组织缓存读取失败,改为直连查询, userId={}", userId, exception);
return loadManageDeptIds(userId);
}
}
/**
* 获取用户姓名
*
@@ -153,6 +177,14 @@ public class UserCache {
return result.getData();
}
private static List<Long> loadManageDeptIds(Long userId) {
R<List<Long>> result = getUserClient().manageDeptIds(userId);
if (result == null || !result.isSuccess() || result.getData() == null) {
return Collections.emptyList();
}
return result.getData();
}
private static void clearBrokenUserCache() {
CacheUtil.clear(USER_CACHE);
CacheUtil.clear(USER_CACHE, Boolean.FALSE);
@@ -37,6 +37,8 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
/**
* User Feign接口类
*
@@ -62,6 +64,7 @@ public interface IUserClient {
String REGISTER_USER = API_PREFIX + "/register-user";
String REMOVE_USER = API_PREFIX + "/remove-user";
String BIND_WX_MINI_OPENID = API_PREFIX + "/bind-wx-mini-openid";
String MANAGE_DEPT_IDS = API_PREFIX + "/manage-dept-ids";
/**
* 获取用户信息
@@ -72,6 +75,15 @@ public interface IUserClient {
@GetMapping(USER_BY_ID)
R<User> userInfoById(@RequestParam("userId") Long userId);
/**
* 解析用户「数据管理权限」组织(含下级)
*
* @param userId 用户主键
* @return 可管理组织 ID 集合
*/
@GetMapping(MANAGE_DEPT_IDS)
R<List<Long>> manageDeptIds(@RequestParam("userId") Long userId);
/**
* 根据账号获取用户信息