From 0527684883bc620febe0a1360f661cc2a7f16e00 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 29 十一月 2024 17:21:35 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/funingyunwei

---
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java |   37 ++++++++++++++++++++++++++++++++-----
 1 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java
index b6b00ca..a75c198 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/YwContractRevenueServiceImpl.java
@@ -1,5 +1,6 @@
 package com.doumee.service.business.impl;
 
+import com.doumee.biz.system.SystemDictDataBiz;
 import com.doumee.core.constants.ResponseStatus;
 import com.doumee.core.exception.BusinessException;
 import com.doumee.core.model.LoginUserInfo;
@@ -67,6 +68,10 @@
     @Autowired
     private SystemUserMapper systemUserMapper;
 
+    @Autowired
+    private SystemDictDataBiz systemDictDataBiz;
+
+
 
     @Override
     @Transactional(rollbackFor = {Exception.class,BusinessException.class})
@@ -112,8 +117,10 @@
         ywContractRevenue.setContractId(ywContractBill.getContractId());
         //鏍规嵁鏀舵敮鎯呭喌 鏇存柊璐﹀崟鏁版嵁
         //鏌ヨ褰撳墠璐﹀崟涓� 宸叉敮浠樼殑璐圭敤
-        List<YwContractRevenue> ywContractRevenueList = ywContractRevenueMapper.selectList(new QueryWrapper<YwContractRevenue>().lambda().eq(YwContractRevenue::getIsdeleted,Constants.ZERO)
+        List<YwContractRevenue> ywContractRevenueList = ywContractRevenueMapper.selectList(new QueryWrapper<YwContractRevenue>()
+                .lambda().eq(YwContractRevenue::getIsdeleted,Constants.ZERO)
                 .eq(YwContractRevenue::getStatus,Constants.ZERO)
+                .eq(YwContractRevenue::getBillId,ywContractRevenue.getBillId())
         );
         //宸叉敮浠橀噾棰�
         BigDecimal payTotal = BigDecimal.ZERO;
@@ -147,14 +154,14 @@
             //寰呮敮浠樼殑娴佹按 濡傛灉涓烘敹鍏� 鍒欐瘮瀵� 閲戦鍊�  濡傛灉鏄敮鍑� 鍒欒幏鍙栫粷瀵瑰�� 杩涜瀵规瘮
             if(Constants.equalsInteger(ywContractRevenue.getRevenueType(),Constants.ZERO)){
                 //濡傛灉鏀粯閲戦 澶т簬 寰呮敮浠橀噾棰� 鍒欐彁绀哄紓甯� 濡傛灉鏀粯閲戦灏忎簬 寰呮敮浠橀噾棰� 鍒欑姸鎬佷笉鍙樺寲 鍏朵粬鐘舵�� 寮傚父
-                if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())>Constants.ZERO){
+                if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())<Constants.ZERO){
                     throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璇疯緭鍏ユ纭殑閲戦锛�");
                 }else if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())==Constants.ZERO){
                     ywContractBill.setPayStatus(Constants.ONE);
                 }
             }else{
                 waitPayTotal = waitPayTotal.abs();
-                if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())>Constants.ZERO){
+                if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())<Constants.ZERO){
                     throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璇疯緭鍏ユ纭殑閲戦锛�");
                 }else if(waitPayTotal.compareTo(ywContractRevenue.getActReceivableFee())==Constants.ZERO){
                     ywContractBill.setPayStatus(Constants.ONE);
@@ -239,6 +246,26 @@
 
        this.getRecordData(ywContractRevenue);
 
+        //闄勪欢鏁版嵁
+        List<Multifile> multifileList = multifileMapper.selectJoinList(Multifile.class,new MPJLambdaWrapper<Multifile>()
+                .selectAll(Multifile.class)
+                .selectAs(SystemUser::getRealname,Multifile::getUserName)
+                .leftJoin(SystemUser.class,SystemUser::getId,Multifile::getCreator)
+                .eq(Multifile::getObjId,id)
+                .eq(Multifile::getIsdeleted,Constants.ZERO)
+                .eq(Multifile::getObjType,Constants.MultiFile.FN_CONTRACT_REVENUE_FILE.getKey()));
+        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifileList)){
+            String path = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode()
+                    +systemDictDataBiz.queryByCode(Constants.FTP,Constants.YW_CONTRACT_BILL).getCode();
+            for (Multifile multifile:multifileList) {
+                if(StringUtils.isNotBlank(multifile.getFileurl())){
+                    multifile.setFileurlFull(path + multifile.getFileurl());
+                }
+            }
+            ywContractRevenue.setMultifileList(multifileList);
+        }
+
+
         return ywContractRevenue;
     }
 
@@ -289,11 +316,11 @@
         if(Objects.isNull(ywContract)){
             throw new BusinessException(ResponseStatus.DATA_EMPTY);
         }
-        if(Constants.equalsInteger(ywContract.getStatus(),Constants.THREE)){
+        if(Constants.equalsInteger(ywContract.getStatus(),Constants.FOUR)){
             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鍚堝悓鐘舵�佸凡娴佽浆,鏃犳硶鎿嶄綔");
         }
         if(Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.ONE)
-            || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.TWO)){
+            || Constants.equalsInteger(ywContractBill.getPayStatus(),Constants.FIVE)){
             throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璐﹀崟鐘舵�佸凡娴佽浆,鏃犳硶鎿嶄綔");
         }
         //鏌ヨ璐﹀崟涓� 鎵�鏈夌殑璐﹀崟

--
Gitblit v1.9.3