From 2e181dcf3058e23777653aac48e4cb1dddf7ccef Mon Sep 17 00:00:00 2001
From: purple7433 <743367900@qq.com>
Date: Tue, 19 Dec 2023 13:55:47 +0800
Subject: [PATCH] update

---
 .../claimAudit/ClaimAuditCmdServiceImpl.java  | 15 +++++++++--
 .../invoiceSetting/InvoiceSettingConvert.java | 25 +++++++++++++------
 2 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/ServiceSite/src/main/java/com/seasky/seaskyocr/application/command/claimAudit/ClaimAuditCmdServiceImpl.java b/ServiceSite/src/main/java/com/seasky/seaskyocr/application/command/claimAudit/ClaimAuditCmdServiceImpl.java
index 213bb373..5aa78eed 100644
--- a/ServiceSite/src/main/java/com/seasky/seaskyocr/application/command/claimAudit/ClaimAuditCmdServiceImpl.java
+++ b/ServiceSite/src/main/java/com/seasky/seaskyocr/application/command/claimAudit/ClaimAuditCmdServiceImpl.java
@@ -1161,6 +1161,7 @@ public class ClaimAuditCmdServiceImpl implements ClaimAuditCmdService {
         //todo 闇€姹�12935 绁ㄦ嵁鎶ごfpTitle
         String fpTitle = ClaimAuditUtil.getJsonValueForMoMing(ocrResult, "result$.invoices$.fpTitle");
         String fpType = ClaimAuditUtil.getJsonValueForMoMing(ocrResult, "result$.invoices$.fpType");
+        String fpAmount = ClaimAuditUtil.getJsonValueForMoMing(ocrResult, "result$.invoices$.fpAmount");
         if ("璐㈡斂绁ㄦ嵁".equals(fpType)) {
             fpTitle = "涓婃捣甯傝鏀夸簨涓氬崟浣嶈祫閲戝線鏉ョ粨绠楃エ鎹�";
         }
@@ -1182,7 +1183,8 @@ public class ClaimAuditCmdServiceImpl implements ClaimAuditCmdService {
                 otherAgg = agg;
             }
             if (ocrResult.contains(agg.getInvoiceName())) {
-                outMap.put("main", getMainList("invoiceType", !StringUtils.isEmpty(fpTitle) ? fpTitle : fjTitle1Line));
+                List<ClaimAuditOcrOut> claimAuditOcrOutList = new ArrayList<>();
+                claimAuditOcrOutList.addAll(getMainList("invoiceType", !StringUtils.isEmpty(fpTitle) ? fpTitle : fjTitle1Line));
                 outMap.put("detailList", getDetailList("goodsName", ocrResult));
                 outMap.put("ticketType", agg.getInvoiceType());
                 outMap.put("businessType", agg.getBusinessType());
@@ -1192,11 +1194,16 @@ public class ClaimAuditCmdServiceImpl implements ClaimAuditCmdService {
                 outMap.put("image", image);
                 outMap.put("source", source);
                 outMap.put("ocrId", ocrId);
+                if (otherAgg.getPropertyIdList().stream().anyMatch(new Long(13L)::equals)) {
+                    claimAuditOcrOutList.addAll(getMainList("allValoremTax", fpAmount));
+                }
+                outMap.put("main", claimAuditOcrOutList);
                 return outMap;
             }
         }
         //todo 娌℃湁鎵惧埌瀵瑰簲鐨勯檮浠剁エ  鎵剧エ绉嶅悕绉版槸 鏈煡绁ㄧ 鐨勫搴斾笂
-        outMap.put("main", getMainList("invoiceType", !StringUtils.isEmpty(fpTitle) ? fpTitle : fjTitle1Line));
+        List<ClaimAuditOcrOut> claimAuditOcrOutList = new ArrayList<>();
+        claimAuditOcrOutList.addAll(getMainList("invoiceType", !StringUtils.isEmpty(fpTitle) ? fpTitle : fjTitle1Line));
         outMap.put("detailList", getDetailList("goodsName", ocrResult));
         outMap.put("ticketType", StringUtils.isEmpty(otherAgg.getInvoiceType()) ? "" : otherAgg.getInvoiceType());
         outMap.put("businessType", StringUtils.isEmpty(otherAgg.getBusinessType()) ? "" : otherAgg.getBusinessType());
@@ -1206,6 +1213,10 @@ public class ClaimAuditCmdServiceImpl implements ClaimAuditCmdService {
         outMap.put("image", image);
         outMap.put("source", source);
         outMap.put("ocrId", ocrId);
+        if (otherAgg.getPropertyIdList().stream().anyMatch(new Long(13L)::equals)) {
+            claimAuditOcrOutList.addAll(getMainList("allValoremTax", fpAmount));
+        }
+        outMap.put("main", claimAuditOcrOutList);
         return outMap;
     }
 
diff --git a/ServiceSite/src/main/java/com/seasky/seaskyocr/infrastructure/repository/invoiceSetting/InvoiceSettingConvert.java b/ServiceSite/src/main/java/com/seasky/seaskyocr/infrastructure/repository/invoiceSetting/InvoiceSettingConvert.java
index 22e25972..d451e4a7 100644
--- a/ServiceSite/src/main/java/com/seasky/seaskyocr/infrastructure/repository/invoiceSetting/InvoiceSettingConvert.java
+++ b/ServiceSite/src/main/java/com/seasky/seaskyocr/infrastructure/repository/invoiceSetting/InvoiceSettingConvert.java
@@ -16,30 +16,39 @@ import java.util.stream.Collectors;
 
 public class InvoiceSettingConvert {
 
-    public static InvoiceSettingAggregate toAgg(InvoiceSettingPo po, List<InvoicePropertySettingPo> propertySettingPos ){
+    public static InvoiceSettingAggregate toAgg(InvoiceSettingPo po, List<InvoicePropertySettingPo> propertySettingPos) {
         InvoiceSettingAggregate agg = MapperUtils.INSTANCE.map(InvoiceSettingAggregate.class, po);
-        if (!StringUtils.isEmpty(po.getPropertyList())){
+        if (!StringUtils.isEmpty(po.getPropertyList())) {
             List<String> strings = Arrays.asList(po.getPropertyList().split(","));
             List<Long> collect = strings.stream().map(Long::parseLong).collect(Collectors.toList());
             agg.setPropertyIdList(collect);
         }
-        if (propertySettingPos.size()>0){
+        if (propertySettingPos.size() > 0) {
             List<InvoicePropertySettingVO> propertys = MapperUtils.INSTANCE.mapAsList(InvoicePropertySettingVO.class, propertySettingPos);
             agg.setInvoicePropertyList(propertys);
-        }else {
+        } else {
             agg.setInvoicePropertyList(new ArrayList<>());
         }
         return agg;
     }
 
-    public static List<InvoiceSettingAggregate> toAggList(List<InvoiceSettingPo> pos ){
-        List<InvoiceSettingAggregate> aggList = MapperUtils.INSTANCE.mapAsList(InvoiceSettingAggregate.class, pos);
+    public static List<InvoiceSettingAggregate> toAggList(List<InvoiceSettingPo> pos) {
+        List<InvoiceSettingAggregate> aggList = new ArrayList<>();
+        for (InvoiceSettingPo po : pos) {
+            InvoiceSettingAggregate agg = MapperUtils.INSTANCE.map(InvoiceSettingAggregate.class, po);
+            List<Long> propertyIdList = new ArrayList<>();
+            for (String id : po.getPropertyList().split(",")) {
+                propertyIdList.add(new Long(id));
+            }
+            agg.setPropertyIdList(propertyIdList);
+            aggList.add(agg);
+        }
         return aggList;
     }
 
-    public static InvoiceSettingPo toPo(InvoiceSettingAggregate agg){
+    public static InvoiceSettingPo toPo(InvoiceSettingAggregate agg) {
         InvoiceSettingPo po = MapperUtils.INSTANCE.map(InvoiceSettingPo.class, agg);
-        if (!ObjectUtils.isEmpty(agg.getPropertyIdList())){
+        if (!ObjectUtils.isEmpty(agg.getPropertyIdList())) {
             String join = Joiner.on(",").join(agg.getPropertyIdList());
             po.setPropertyList(join);
         }
-- 
GitLab