Răsfoiți Sursa

Merge remote-tracking branch 'origin/dev_jzg_lipf_v20260518' into dev_jzg_lipf_v20260518

jiakai 4 luni în urmă
părinte
comite
1062e829dd

+ 1 - 1
commons/src/main/java/com/jzg/commons/entity/dto/AmountAuditEditParam.java

@@ -21,5 +21,5 @@ public class AmountAuditEditParam {
     private String picId;
 
     @Schema(description = "付款账户id")
-    private String accountId;
+    private String cardId;
 }

+ 10 - 0
tenant/organization/src/main/java/com/jzg/organization/mapper/InsPlyIncomeInvoiceLinkMapper.java

@@ -5,8 +5,18 @@ import com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceLink;
 import org.apache.ibatis.annotations.Delete;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Update;
 
 @Mapper
 public interface InsPlyIncomeInvoiceLinkMapper extends BaseMapper<InsPlyIncomeInvoiceLink> {
 
+    /**
+     * 删除发票和订单的关联关系
+     *
+     * @author lipf
+     * @date 2026/5/29 14:29
+     */
+    @Update("UPDATE ins_ply_income_invoice_link SET is_delete = 1 WHERE invoice_id = #{invoiceId} AND is_delete = 0")
+    void deleteByInvoiceId(@Param("invoiceId") String invoiceId);
+
 }

+ 4 - 6
tenant/organization/src/main/java/com/jzg/organization/mapper/InvAccountCardMapper.java

@@ -7,8 +7,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.jzg.commons.entity.account.vo.AccountCardVo;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.List;
-
 /**
 * @author dongxin
 * @description 针对表【inv_account_card(账户信息表)】的数据库操作Mapper
@@ -35,13 +33,13 @@ public interface InvAccountCardMapper extends BaseMapper<InvAccountCard> {
     /**
      * 查询业务员提现银行卡信息
      *
-     * @param systemCode 租户代码
-     * @param accountId 银行卡号
+     * @param systemCode    租户代码
+     * @param accountCardId 银行卡的序号
      * @author lipf
      * @date 2026/6/8 15:14
      */
-    List<InvAccountCard> queryByAccountId(@Param("accountId") String accountId,
-                                          @Param("systemCode") String systemCode);
+    InvAccountCard queryByAccountCardId(@Param("accountCardId") String accountCardId,
+                                        @Param("systemCode") String systemCode);
 
 }
 

+ 3 - 3
tenant/organization/src/main/java/com/jzg/organization/service/InvAccountCardService.java

@@ -8,8 +8,6 @@ import com.jzg.commons.entity.account.po.InvAccountCard;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.jzg.commons.entity.account.vo.AccountCardVo;
 
-import java.util.List;
-
 /**
 * @author dongxin
 * @description 针对表【inv_account_card(账户信息表)】的数据库操作Service
@@ -61,8 +59,10 @@ public interface InvAccountCardService extends IService<InvAccountCard> {
     /**
      * 根据银行卡账号查询银行卡信息
      *
+     * @param systemCode    租户代码
+     * @param accountCardId 付款账号的id
      * @author lipf
      * @date 2026/6/8 15:12
      */
-    List<InvAccountCard> queryByAccountId(String accountId, String systemCode);
+    InvAccountCard queryByAccountCardId(String accountCardId, String systemCode);
 }

+ 8 - 1
tenant/organization/src/main/java/com/jzg/organization/service/ReceivableService.java

@@ -329,7 +329,14 @@ public interface ReceivableService extends IService<InsPlyIncome> {
      */
     HttpResult<List<InsPlyIncome>> queryIncomeDatas(IncomeDataVO incomeDataVO);
 
-    Boolean deleteInvoiceById(String id);
+    /**
+     * 删除发票信息(便于重新开票)
+     *
+     * @param invoiceId 发票序号
+     * @author lipf
+     * @date 2026/6/9 9:13
+     */
+    Boolean deleteInvoiceById(String invoiceId);
 
     /**
      * 查询订单绑定的发票信息

+ 5 - 7
tenant/organization/src/main/java/com/jzg/organization/service/impl/InvAccountCardServiceImpl.java

@@ -19,8 +19,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-
 /**
 * @author dongxin
 * @description 针对表【inv_account_card(账户信息表)】的数据库操作Service实现
@@ -80,15 +78,15 @@ public class InvAccountCardServiceImpl extends ServiceImpl<InvAccountCardMapper,
     /**
      * 根据银行卡账号查询银行卡信息
      *
-     * @param accountId  租户银行卡的账号
-     * @param systemCode 租户代码
+     * @param accountCardId 租户银行卡的账号
+     * @param systemCode    租户代码
      * @author lipf
      * @date 2026/6/8 15:12
      */
     @Override
-    public List<InvAccountCard> queryByAccountId(String accountId, String systemCode) {
-        log.info("根据企业账号查询业务的付款账户信息。 accountId=[{}], systemCode=[{}]", accountId, systemCode);
-        return baseMapper.queryByAccountId(accountId, systemCode);
+    public InvAccountCard queryByAccountCardId(String accountCardId, String systemCode) {
+        log.info("根据企业账号查询业务的付款账户信息。 accountId=[{}], systemCode=[{}]", accountCardId, systemCode);
+        return baseMapper.queryByAccountCardId(accountCardId, systemCode);
     }
 }
 

+ 4 - 6
tenant/organization/src/main/java/com/jzg/organization/service/impl/ReceivableServiceImpl.java

@@ -3,7 +3,6 @@ package com.jzg.organization.service.impl;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.collection.ListUtil;
 import cn.hutool.core.date.DateTime;
-import cn.hutool.core.lang.Assert;
 import cn.hutool.core.lang.tree.Tree;
 import cn.hutool.core.lang.tree.TreeNodeConfig;
 import cn.hutool.core.lang.tree.TreeUtil;
@@ -26,7 +25,6 @@ import com.jzg.commons.entity.finance.po.*;
 import com.jzg.commons.entity.finance.vo.*;
 import com.jzg.commons.entity.orders.po.InsOrderAdjust;
 import com.jzg.commons.entity.po.EsmInsCompany;
-import com.jzg.commons.entity.po.InsFeeOrders;
 import com.jzg.commons.entity.po.PtlAgreement;
 import com.jzg.commons.entity.po.SysUploadFiles;
 import com.jzg.commons.entity.quote.vo.orders.InsOrdersVo;
@@ -539,10 +537,10 @@ public class ReceivableServiceImpl extends ServiceImpl<ReceivableMapper, InsPlyI
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public Boolean deleteInvoiceById(String id) {
-        log.info("私有协议-开票记录-删除: id=[{}]",id);
-        insPlyIncomeInvoiceLinkMapper.deleteById(id);
-        return insPlyIncomeInvoiceMapper.deleteById(id) > 0;
+    public Boolean deleteInvoiceById(String invoiceId) {
+        log.info("私有协议-开票记录-删除: id=[{}]", invoiceId);
+        insPlyIncomeInvoiceLinkMapper.deleteByInvoiceId(invoiceId);
+        return insPlyIncomeInvoiceMapper.deleteById(invoiceId) > 0;
     }
 
 

+ 4 - 8
tenant/organization/src/main/java/com/jzg/organization/service/impl/SysAmountAuditingServiceImpl.java

@@ -194,7 +194,7 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
         String userId = baseController.getUserId();
         String systemCode = baseController.getSystemCode();
         log.info("用户开始进行付款操作。userName=[{}],param=[{}]systemCode=[{}]",userName,JSONUtil.toJsonStr(param),systemCode);
-        if(StrUtil.isEmpty(param.getAccountId())){
+        if(StrUtil.isEmpty(param.getCardId())){
             return HttpResult.error("付款账户不能为空");
         }
         SysAmountAuditing audit = this.getById(param.getId());
@@ -205,7 +205,7 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
                 audit.setAuditingStatus(stateFailResult.getCurrentState());
                 audit.setPicId(param.getPicId());
                 audit.setVoucherId(param.getVoucherId());
-                audit.setAccountId(param.getAccountId());
+                audit.setAccountId(param.getCardId());
                 audit.setPaymentTime(LocalDateTime.now());
                 audit.setAuditingTime(LocalDateTime.now());
                 audit.setAuditingUserId(userId);
@@ -306,12 +306,8 @@ public class SysAmountAuditingServiceImpl extends ServiceImpl<SysAmountAuditingM
             }
         }
         changeLog.setUserId(ywyUserId);
-        List<InvAccountCard> accountCardVos = invAccountCardService.queryByAccountId(param.getAccountId(), systemCode);
-        if(CollUtil.size(accountCardVos) > 1){
-            throw new SystemException(String.format("租户%s下根据账号%s找到%d条",systemCode,param.getAccountId(),accountCardVos.size()));
-        }
-        if(CollUtil.isNotEmpty(accountCardVos)){
-            InvAccountCard accountCardVo = accountCardVos.get(0);
+        InvAccountCard accountCardVo = invAccountCardService.queryByAccountCardId(param.getCardId(), systemCode);
+        if(accountCardVo != null){
             changeLog.setBankCardIdIn(accountCardVo.getId());
             changeLog.setBankCardNoIn(accountCardVo.getBankCardNum());
         }

+ 2 - 2
tenant/organization/src/main/resources/mapper/InvAccountCardMapper.xml

@@ -81,7 +81,7 @@
         </where>
     </select>
     <!-- 查询业务员提现银行卡信息 lipf 2026年6月8日15:16:59 -->
-    <select id="queryByAccountId" resultType="com.jzg.commons.entity.account.po.InvAccountCard">
-        select * from inv_account_card iac where iac.account_id = #{accountId} and iac.system_code = #{systemCode}
+    <select id="queryByAccountCardId" resultType="com.jzg.commons.entity.account.po.InvAccountCard">
+        select * from inv_account_card iac where iac.id = #{accountCardId} and iac.system_code = #{systemCode}
     </select>
 </mapper>

+ 2 - 3
tenant/organization/src/main/resources/mapper/ReceivableMapper.xml

@@ -1221,9 +1221,8 @@
     <!-- 查询订单绑定的发票信息 lipf 2026年5月21日11:56:19 -->
     <select id="queryIncomeBindInvoice" resultType="com.jzg.commons.entity.finance.po.InsPlyIncomeInvoiceLink">
         SELECT  *  FROM
-        ins_ply_income_invoice_link
-        where
-        income_id IN
+        ins_ply_income_invoice_link ipiil
+        where  ipiil.is_delete = 0 and  ipiil.income_id IN
         <foreach collection="invoicingVo.incomeIds" item="id" open="(" separator="," close=")">
             #{id}
         </foreach>