From 553e0eebeec5d229013986acf1f8c20f3e36ef0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E8=BE=89?= <2830717623@qq.com> Date: Fri, 3 Jul 2026 22:05:37 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mhd/system/api/domain/TmsOrderAddDTO.java | 4 ++-- .../domain/dto/wlhy/TmsAddressMultiDTO.java | 4 ++-- .../ContractManageApplicationService.java | 9 ++++++-- .../BillManageApplicationService.java | 22 +++++++++++++++++++ .../mapper/SettlementCustomersMapper.xml | 8 ++++++- 5 files changed, 40 insertions(+), 7 deletions(-) diff --git a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/TmsOrderAddDTO.java b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/TmsOrderAddDTO.java index 82564882a..fa83d63f0 100644 --- a/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/TmsOrderAddDTO.java +++ b/mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/domain/TmsOrderAddDTO.java @@ -46,8 +46,8 @@ TmsOrderAddDTO implements Serializable { @ApiModelProperty(value = "装货电话") private String loadingPhone=""; @ApiModelProperty(value = "装货时间日期(年月日)",required = true) - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private java.util.Date loadingDate; // @ApiModelProperty(value = "装货时间(上午、下午、24小时)") // private String loadingTime=""; diff --git a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/wlhy/TmsAddressMultiDTO.java b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/wlhy/TmsAddressMultiDTO.java index 80f4fc984..6ab2b6ccc 100644 --- a/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/wlhy/TmsAddressMultiDTO.java +++ b/mhd-common/mhd-common-core/src/main/java/com/mhd/common/core/domain/dto/wlhy/TmsAddressMultiDTO.java @@ -32,8 +32,8 @@ public class TmsAddressMultiDTO { @ApiModelProperty(value = "装卸货联系人电话") private String contactPhone; @ApiModelProperty(value = "装卸货日期(年月日)") - @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") - @DateTimeFormat(pattern="yyyy-MM-dd") + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") private Date layDate; @ApiModelProperty(value = "装卸货时间(上午、下午、24小时)") private String layTime; diff --git a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java index e2657b441..15ce56c67 100644 --- a/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java +++ b/mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/contractManage/ContractManageApplicationService.java @@ -759,6 +759,10 @@ public class ContractManageApplicationService { } //根据合同编码查询保存合同信息 ContractManagePO contractManagePO = contractManageDomainService.getInfoByCode1(contractManageDO.getOriginalContractNumber()); + //修改时,不管前端是否传明细,都需要先删除该合同原有的明细,避免明细为空时老明细仍在 + if (!isInsert) { + contractManageDetailMapper.delete(new LambdaQueryWrapper().eq(ContractManageDetail::getContractManageId, contractManageDO.getContractManageId())); + } //保存合同详情科目 List contractManageDetailDTOList = contractManageDO.getContractManageDetailDTOList(); if(null != contractManageDetailDTOList && contractManageDetailDTOList.size()>0){ @@ -830,8 +834,9 @@ public class ContractManageApplicationService { if (isInsert) { // 新增/复制时使用新插入的合同ID contractManageDetailDO.setContractManageId(contractManageDO.getContractManageId()); - } else if(null != contractManagePO){ - contractManageDetailDO.setContractManageId(contractManagePO.getContractManageId()); + } else { + // 修改时使用当前正在修改的合同ID,不能用 getInfoByCode1 查到的(避免多条合同 originalContractNumber 相同导致明细错绑) + contractManageDetailDO.setContractManageId(contractManageDO.getContractManageId()); } contractManageDetailDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId()); contractManageDetailDO.setOrganizationId(loginUser.getUserPo().getOrganizationId()); diff --git a/mhd_bms/src/main/java/com/mhd/bms/application/server/billManage/BillManageApplicationService.java b/mhd_bms/src/main/java/com/mhd/bms/application/server/billManage/BillManageApplicationService.java index 8566a717f..26740baec 100644 --- a/mhd_bms/src/main/java/com/mhd/bms/application/server/billManage/BillManageApplicationService.java +++ b/mhd_bms/src/main/java/com/mhd/bms/application/server/billManage/BillManageApplicationService.java @@ -420,6 +420,28 @@ public class BillManageApplicationService { newBill.setUpdateByName(loginUser.getUserPo().getUserName()); newBill.setUpdateTime(new Date()); newBill.setDelFlag(1); + // 复制后重置状态字段为初始值 + // 账单状态、对账状态、发票状态重置 + newBill.setBillState(1); // 1-未确认 + newBill.setBillStep(1); // 1-发起对账 + newBill.setReconciliationStatus(0); // 1-暂未确认 + newBill.setIsInvoice(0); // 0-未索取 + // 实收=0,未收=账单金额 + newBill.setActualReceivedAmount(BigDecimal.ZERO); + newBill.setBillAmountUnsettled(newBill.getBillAmount()); + newBill.setBillAmountSettlement(BigDecimal.ZERO); + // NC同步状态重置 + newBill.setSynchronousStatus(0); // 0-未同步 + newBill.setSkSynchronousStatus(0); // 0-未同步 + // 清空发票、收款、推送相关字段 + newBill.setApplyNumber(null); // 发票申请单号 + newBill.setSettlementTime(null); // 收款时间 + newBill.setSynchronousTime(null); // 应收单推送时间 + newBill.setSkSynchronousTime(null); // 收款单推送时间 + newBill.setInvoiceId(null); // 发票表ID + newBill.setInvoiceMakeTime(null); // 开票时间 + newBill.setNcId(null); // nc唯一标识(应收) + newBill.setSkNcId(null); // nc唯一标识(收款) // 保存新账单 boolean flag = billManageDomainService.saveEntity(newBill); if (!flag) { diff --git a/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml b/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml index 41ebc484f..54d6b7a3a 100644 --- a/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml +++ b/mhd_bms/src/main/resources/mapper/SettlementCustomersMapper.xml @@ -198,7 +198,13 @@ and a.main_role = #{settlementCustomersDO.mainRole} - and a.organization_id = #{settlementCustomersDO.organizationId} + AND ( + a.organization_id = #{settlementCustomersDO.organizationId} + OR b.org_code LIKE concat('%"code":"', #{settlementCustomersDO.organizationId}, '"%') + OR b.org_code LIKE concat('%code:', #{settlementCustomersDO.organizationId}, '%') + OR b.org_code LIKE concat('%code: ', #{settlementCustomersDO.organizationId}, '%') + OR b.org_code LIKE concat('%"code":', #{settlementCustomersDO.organizationId}, '%') + ) and a.top_organization_id = #{settlementCustomersDO.topOrganizationId}