Przeglądaj źródła

报销详情新增客户未归集金额

anderx 1 rok temu
rodzic
commit
229169f31c

+ 5 - 0
src/main/java/com/goafanti/common/dao/ExpenseAccountMapper.java

@@ -8,6 +8,7 @@ import com.goafanti.expenseAccount.bo.OutExpenseAccount;
 import com.goafanti.expenseAccount.bo.OutMyEAStatistics;
 import com.goafanti.expenseAccount.bo.OutMyEAStatistics;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
 
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
 
 
 public interface ExpenseAccountMapper {
 public interface ExpenseAccountMapper {
@@ -76,4 +77,8 @@ public interface ExpenseAccountMapper {
     void updateRemoveOrderNo(ExpenseAccount ea);
     void updateRemoveOrderNo(ExpenseAccount ea);
 
 
     List<ExpenseAccount> selectByOrderNo(String orderNo);
     List<ExpenseAccount> selectByOrderNo(String orderNo);
+
+    List<BigDecimal> getOrderNoNotCountAmount(String orderNo);
+
+    List<BigDecimal> getUidNotCountAmount(String uid);
 }
 }

+ 3 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -3,6 +3,7 @@ package com.goafanti.common.dao;
 import com.goafanti.admin.bo.OutFinanceCount;
 import com.goafanti.admin.bo.OutFinanceCount;
 import com.goafanti.common.model.OutPublicReleaseCount;
 import com.goafanti.common.model.OutPublicReleaseCount;
 import com.goafanti.common.model.PublicRelease;
 import com.goafanti.common.model.PublicRelease;
+import com.goafanti.common.model.PublicReleaseDetails;
 import com.goafanti.customer.bo.MyUserDetailsBo;
 import com.goafanti.customer.bo.MyUserDetailsBo;
 import com.goafanti.weChat.bo.*;
 import com.goafanti.weChat.bo.*;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -138,5 +139,7 @@ public interface PublicReleaseMapper {
     List<MyUserDetailsBo> selectByUid(String id);
     List<MyUserDetailsBo> selectByUid(String id);
 
 
     List<PublicRelease> selectByMainIdAndReviewer(@Param("id") Integer id, @Param("reviewerId") String reviewerId);
     List<PublicRelease> selectByMainIdAndReviewer(@Param("id") Integer id, @Param("reviewerId") String reviewerId);
+
+    List<PublicReleaseDetails> selectDetailsByPrid(Integer prid);
 }
 }
 
 

+ 17 - 1
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -746,7 +746,7 @@
     select b.id,b.check_no,b.total_amount,b.amount,b.aname,b.apply_dep,b.pay_dep,b.real_amount,b.type_other ,b.aid,b.create_time ,
     select b.id,b.check_no,b.total_amount,b.amount,b.aname,b.apply_dep,b.pay_dep,b.real_amount,b.type_other ,b.aid,b.create_time ,
            date_format(b.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,b.examine_name, dep.name applyDepName,dep2.name payDepName,
            date_format(b.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,b.examine_name, dep.name applyDepName,dep2.name payDepName,
            b.remarks,b.eaaid ,eap.name ,eap.bank ,eap.accounts ,b.status,b.process_status,
            b.remarks,b.eaaid ,eap.name ,eap.bank ,eap.accounts ,b.status,b.process_status,
-           c.id sonId,c.total_amount sonTotalAmount,c.settlement_amount sonSettlementAmount,c.amount sonAmount, c.`type` sonType,c.type_other sonTypeOther,
+           c.id sonId,c.total_amount sonTotalAmount,c.settlement_amount sonSettlementAmount,c.amount sonAmount, c.`type` sonType,c.type_other sonTypeOther,c.prid,
            c.user_names ,c.release_start ,c.release_end , c.district_name districtName,c.user_names userNames,c.secondary_type ,c.secondary_type_other,c.attachment_url,
            c.user_names ,c.release_start ,c.release_end , c.district_name districtName,c.user_names userNames,c.secondary_type ,c.secondary_type_other,c.attachment_url,
            c.duration,pr.plan,c.real_amount sonRealAmount,o.order_no,o.contract_no,pr.type publicReleaseType,tm.bid_type bidType,
            c.duration,pr.plan,c.real_amount sonRealAmount,o.order_no,o.contract_no,pr.type publicReleaseType,tm.bid_type bidType,
            c.debit_id debitId, debit.real_amount DebitRealAmount ,debit.settlement_amount DebitSettlementAmount,debit.liquidation_status DebitliquidationStatus,
            c.debit_id debitId, debit.real_amount DebitRealAmount ,debit.settlement_amount DebitSettlementAmount,debit.liquidation_status DebitliquidationStatus,
@@ -1125,4 +1125,20 @@
   from expense_account
   from expense_account
   where expense_main=0 and status in(1,2,3)   and order_no=#{orderNo}
   where expense_main=0 and status in(1,2,3)   and order_no=#{orderNo}
   </select>
   </select>
+    <select id="getOrderNoNotCountAmount" resultType="java.math.BigDecimal">
+      SELECT  d.real_amount
+      from t_order_new a left join public_release_details b on a.buyer_id =b.uid
+                         left join public_release c on b.prid =c.id
+                         left join expense_account d on c.id =d.prid
+      where a.order_no = #{orderNo}
+        and c.status in (1,2) and d.status in (1,2) and c.order_no is null
+    </select>
+  <select id="getUidNotCountAmount" resultType="java.math.BigDecimal">
+    SELECT  d.real_amount
+    from  public_release_details b
+                       left join public_release c on b.prid =c.id
+                       left join expense_account d on c.id =d.prid
+    where b.uid= #{uid}
+      and c.status in (1,2) and d.status in (1,2) and c.order_no is null
+  </select>
 </mapper>
 </mapper>

+ 6 - 0
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -1160,6 +1160,12 @@
         where a.main_id = #{id}
         where a.main_id = #{id}
         and b.reviewer_id = #{reviewerId}
         and b.reviewer_id = #{reviewerId}
     </select>
     </select>
+    <select id="selectDetailsByPrid" resultType="com.goafanti.common.model.PublicReleaseDetails">
+        select
+        a.id, a.prid, a.uid
+        from public_release_details a
+        where a.prid = #{prid}
+    </select>
 </mapper>
 </mapper>
 
 
 
 

+ 19 - 0
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -88,6 +88,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
     private OrderNewService orderNewService;
     private OrderNewService orderNewService;
     @Autowired
     @Autowired
     private OrderYearMaxDurationMapper orderYearMaxDurationMapper;
     private OrderYearMaxDurationMapper orderYearMaxDurationMapper;
+    @Autowired
+    private UserMapper userMapper;
 
 
 
 
 
 
@@ -1474,9 +1476,26 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                     }
                     }
 
 
                 }
                 }
+                //获取未归集的订单
+                List<BigDecimal> orderNoNotCountAmount = expenseAccountMapper.getOrderNoNotCountAmount(e.getOrderNo());
+                BigDecimal countAmount = orderNoNotCountAmount.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
                 String str = getString(e, out, count, yxyCount, zxsCount,qtCount,useOyd);
                 String str = getString(e, out, count, yxyCount, zxsCount,qtCount,useOyd);
+                str=str+",未归集:"+countAmount.stripTrailingZeros().toPlainString()+"元";
                 orderList.add(str);
                 orderList.add(str);
             }
             }
+            if (e.getPrid() !=null){
+                //获取未归集的订单
+                List<PublicReleaseDetails> list = publicReleaseMapper.selectDetailsByPrid(e.getPrid());
+
+                StringBuffer sb = new StringBuffer();
+                for (PublicReleaseDetails e2 : list) {
+                    User user = userMapper.selectByPrimaryKey(e2.getUid());
+                    List<BigDecimal> orderNoNotCountAmount = expenseAccountMapper.getUidNotCountAmount(e2.getUid());
+                    BigDecimal countAmount = orderNoNotCountAmount.stream().reduce(BigDecimal.ZERO, BigDecimal::add);
+                    sb.append(user.getNickname()).append(",未归集:").append(countAmount.stripTrailingZeros().toPlainString()).append("元,");
+                }
+                orderList.add(sb.substring(0,sb.length()-1));
+            }
             res.setStrList(orderList);
             res.setStrList(orderList);
         }
         }
 
 

+ 1 - 1
src/main/resources/props/config_local.properties

@@ -1,7 +1,7 @@
 dev.name=local
 dev.name=local
 jdbc.driverClassName=com.mysql.jdbc.Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 
 
-static.host=//static.jishutao.com/1.3.21
+static.host=//static.jishutao.com/1.3.23
 #static.host=//172.16.1.187/1.3.19
 #static.host=//172.16.1.187/1.3.19
 
 
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20240430?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #jdbc.url=jdbc\:mysql://localhost:3306/aft20240430?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false