Kaynağa Gözat

已知问题修改

y 2 yıl önce
ebeveyn
işleme
adf3a0f3ed

+ 7 - 0
.gitignore

@@ -0,0 +1,7 @@
+/.idea/
+/src/main/resources/application-dev.yml
+/target/
+/src/test/
+
+/src/main/resources/application-pre.yml
+/..gitignore

+ 3 - 0
src/main/java/com/ydtech/modules/inv/model/InvAccountOpDto.java

@@ -13,4 +13,7 @@ import java.util.Map;
 public class InvAccountOpDto {
     private List<Map<String, String>> head;
     private List<Map<String, String>> maps;
+    private int pageNo;
+    private int pageSize;
+    private int total;
 }

+ 3 - 3
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountExcelServiceImpl.java

@@ -151,11 +151,11 @@ public class InvAccountExcelServiceImpl extends ServiceImpl<InvAccountExcelMappe
             if (!insAccountOperateService.saveBatch(list)) {
                 throw new RuntimeException("添加转账信息失败");
             }
-
             JSONObject outProfit = invAccountExcel.getOutProfit();
             JSONObject entProfit = invAccountExcel.getEntProfit();
-            outJsonUtil(invAccountExcel, outProfit, outAccount, outAccountCard,list.get(0).getAccountOperateId());
-            entJsonUtil(invAccountExcel, entProfit, enterAccount, enterAccountCard, list.get(1).getAccountOperateId());
+
+            outJsonUtil(invAccountExcel, outProfit, outAccount, outAccountCard,invAccountOperate.getAccountOperateId());
+            entJsonUtil(invAccountExcel, entProfit, enterAccount, enterAccountCard, invAccountOperate1.getAccountOperateId());
 
         } else {
             //内转外部转账

+ 12 - 1
src/main/java/com/ydtech/modules/inv/service/impl/InvAccountServiceImpl.java

@@ -2,6 +2,7 @@ package com.ydtech.modules.inv.service.impl;
 
 import com.alibaba.excel.util.ListUtils;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ydtech.core.page.HttpResult;
 import com.ydtech.core.page.PageRequest;
@@ -275,14 +276,24 @@ public class InvAccountServiceImpl extends ServiceImpl<InvAccountMapper, InvAcco
     @Override
     public HttpResult look(InvAccountQueryVo invAccountQueryVo) {
         List<InvAccount> insAccounts = insAccountMapper.selectAccountsList(invAccountQueryVo);
+
+
+
         List<InvAccountProfit> invAccountProfitList = invAccountProfitService.list();
         List<InvAccountOp> list = invAccountOpService.list();
 
         List<Map<String, String>> head = head(invAccountProfitList);
         List<Map<String, String>> maps = dataList(insAccounts, list, invAccountProfitList);
+
+        List<Map<String, String>> subList = maps.stream().skip((invAccountQueryVo.getPageNo()-1)*invAccountQueryVo.getPageSize()).limit(invAccountQueryVo.getPageSize()).
+                collect(Collectors.toList());
+
         InvAccountOpDto invAccountOpDto = new InvAccountOpDto();
         invAccountOpDto.setHead(head);
-        invAccountOpDto.setMaps(maps);
+        invAccountOpDto.setMaps(subList);
+        invAccountOpDto.setTotal(maps.size());
+        invAccountOpDto.setPageSize(invAccountQueryVo.getPageSize());
+        invAccountOpDto.setPageNo(invAccountQueryVo.getPageNo());
         return HttpResult.ok("",invAccountOpDto);
     }
 

+ 3 - 12
src/main/java/com/ydtech/modules/inv/utils/TransferUtils.java

@@ -80,20 +80,14 @@ public class TransferUtils {
      * 转账成功后添加支出账户操作信息
      */
     public static InvAccountOperate insertOutAccountOperate(InvAccountExcel insAccountExcel) {
-        JSONObject outProfit1 = insAccountExcel.getOutProfit();
         //支出公司
         InvAccountOperate insAccountOperate = new InvAccountOperate();
         InvAccountOperate operate = operate(insAccountExcel, insAccountOperate);
         operate.setRevenueOutlay("1");
-        JSONObject outProfit = insAccountExcel.getOutProfit();
-        for (Map.Entry<String, Object> entry : outProfit.entrySet()) {
-            outProfit.put(entry.getKey(), new BigDecimal(String.valueOf(entry.getValue())).negate().toString());
-        }
-        operate.setOutProfit(outProfit);
+        operate.setOutProfit(insAccountExcel.getOutProfit());
         operate.setCreateTime(LocalDateTime.now());
         operate.setRemark(insAccountExcel.getRemark());
         operate.setOutCardNum(insAccountExcel.getOutCardNum());
-        insAccountExcel.setOutProfit(outProfit1);
         return operate;
     }
 
@@ -227,11 +221,8 @@ public class TransferUtils {
         for (Map.Entry<String, Object> entry : entProfit.entrySet()) {
             entAmount = entAmount.add(new BigDecimal(entry.getValue().toString()));
         }
-        if (!String.valueOf(outAmount).equals("100")) {
-            throw new SystemException("支出金额未完全分配");
-        }
-        if (!String.valueOf(entAmount).equals("100")) {
-            throw new SystemException("收入金额未完全分配");
+        if (!(new BigDecimal(String.valueOf(entAmount)).add(new BigDecimal(String.valueOf(outAmount)))).toString().equals("0")) {
+            throw new SystemException("金额未完全分配");
         }
         return true;
     }