登记收款附件bug修改

This commit is contained in:
luojiaquan
2026-09-15 18:06:40 +08:00
parent 73e425b12f
commit 662a09bf16
7 changed files with 50 additions and 13 deletions
@@ -19,12 +19,21 @@ public class BmsCustomerAttachment extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 业务模块:客户档案附件 */
public static final String BIZ_TYPE_CUSTOMER = "customer";
/** 业务模块:客户收款水单 */
public static final String BIZ_TYPE_CUSTOMER_RECEIPT = "customer_receipt";
/** 附件ID */
private Long attachmentId;
/** 所属客户ID */
private Long customerId;
/** 业务模块(customer客户档案附件 / customer_receipt客户收款水单),为空按客户档案处理 */
private String bizType;
/** 文件原始名称 */
@Excel(name = "文件名称")
private String fileName;
@@ -43,11 +52,11 @@ public class BmsCustomerAttachment extends BaseEntity
@Excel(name = "文件扩展名")
private String fileExtension;
/** 附件类型(0附件资料 1客户Logo 2合同文件 3其他) */
/** 附件类型(文件分类:0附件资料 1客户Logo 2合同文件 3其他) */
@Excel(name = "附件类型", readConverterExp = "0=附件资料,1=客户Logo,2=合同文件,3=其他")
private String attachmentType;
/** 关联业务ID(如收款单ID,attachment_type=3 时使用) */
/** 关联业务ID(业务模块内的单据ID,如收款单ID) */
private Long bizId;
/** 是否Logo(0否 1是) */
@@ -95,6 +95,14 @@ public interface BmsCustomerMapper
*/
public int deleteBmsCustomerAttachmentByCustomerId(Long customerId);
/**
* 按客户ID删除客户档案模块的附件(保留收款水单等其他业务模块附件)
*
* @param customerId 客户主键
* @return 结果
*/
public int deleteBmsCustomerProfileAttachmentByCustomerId(Long customerId);
/**
* 批量删除客户附件
*
@@ -41,6 +41,7 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService
{
BmsCustomerAttachment query = new BmsCustomerAttachment();
query.setCustomerId(customerId);
query.setBizType(BmsCustomerAttachment.BIZ_TYPE_CUSTOMER);
bmsCustomer.setAttachmentList(bmsCustomerMapper.selectBmsCustomerAttachmentList(query));
BmsCustomerCompany companyQuery = new BmsCustomerCompany();
companyQuery.setCustomerId(customerId);
@@ -84,6 +85,7 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService
for (BmsCustomerAttachment item : attachmentList)
{
item.setCustomerId(customerId);
item.setBizType(BmsCustomerAttachment.BIZ_TYPE_CUSTOMER);
if (item.getDelFlag() == null)
{
item.setDelFlag("0");
@@ -241,8 +243,8 @@ public class BmsCustomerServiceImpl implements IBmsCustomerService
SysUser user = SecurityUtils.getLoginUser().getUser();
bmsCustomer.setUpdateTime(DateUtils.getNowDate());
bmsCustomer.setUpdateBy(user.getUserName());
// 先逻辑删除原有附件,再按新列表重建(简化全量替换)
bmsCustomerMapper.deleteBmsCustomerAttachmentByCustomerId(bmsCustomer.getCustomerId());
// 仅重建客户档案模块的附件,收款水单等其他业务模块的附件保留不动
bmsCustomerMapper.deleteBmsCustomerProfileAttachmentByCustomerId(bmsCustomer.getCustomerId());
if (bmsCustomer.getAttachmentList() != null)
{
for (BmsCustomerAttachment item : bmsCustomer.getAttachmentList())
@@ -68,6 +68,7 @@ public class CustomerMoneyServiceImpl implements ICustomerMoneyService
if (receipt != null)
{
BmsCustomerAttachment query = new BmsCustomerAttachment();
query.setBizType(BmsCustomerAttachment.BIZ_TYPE_CUSTOMER_RECEIPT);
query.setBizId(id);
receipt.setAttachmentList(bmsCustomerMapper.selectBmsCustomerAttachmentList(query));
}
@@ -134,7 +135,7 @@ public class CustomerMoneyServiceImpl implements ICustomerMoneyService
receipt.setVersion(0);
customerMoneyMapper.insertReceipt(receipt);
// 收款附件:复用客户附件表,类型挂"其他(3)",biz_id 关联收款单
// 收款附件:复用客户附件表,业务模块挂 customer_receipt,biz_id 关联收款单
saveReceiptAttachments(receipt);
return 1;
}
@@ -274,7 +275,7 @@ public class CustomerMoneyServiceImpl implements ICustomerMoneyService
attachment.setAttachmentId(null);
attachment.setCustomerId(receipt.getCustomerId());
attachment.setBizId(receipt.getId());
attachment.setAttachmentType("3");
attachment.setBizType(BmsCustomerAttachment.BIZ_TYPE_CUSTOMER_RECEIPT);
if (!StringUtils.hasText(attachment.getIsLogo()))
{
attachment.setIsLogo("0");