瀏覽代碼

报表和成衣面辅料的bug修复

huxy 9 月之前
父節點
當前提交
0d1a6325eb
共有 28 個文件被更改,包括 475 次插入153 次删除
  1. 53 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/controller/SyCostAllocationController.java
  2. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SyCostJson.java
  3. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/SyCostAllocationMapper.java
  4. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationAccidentMapper.xml
  5. 193 63
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationMapper.xml
  6. 17 5
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/service/impl/SyCostAllocationServiceImpl.java
  7. 11 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/controller/SyCostLossReviewController.java
  8. 4 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/entity/SyCostLossReview.java
  9. 3 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/SyCostLossReviewMapper.java
  10. 39 6
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/xml/SyCostLossReviewMapper.xml
  11. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/service/ISyCostLossReviewService.java
  12. 11 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/service/impl/SyCostLossReviewServiceImpl.java
  13. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java
  14. 2 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java
  15. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/controller/SyShippingOrderController.java
  16. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/service/impl/SyShippingOrderServiceImpl.java
  17. 2 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/PurchaseWarehousingController.java
  18. 14 3
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/controller/SyPreAssembledPackingListController.java
  19. 15 17
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/entity/SyPreAssembledPackingListItem.java
  20. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/service/impl/SyPreAssembledPackingListServiceImpl.java
  21. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/controller/SyPackingListFabricController.java
  22. 1 0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/entity/SyPackingListFabricItem.java
  23. 14 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/mapper/xml/SyPackingListFabricItemMapper.xml
  24. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/ISyPackingListFabricService.java
  25. 46 9
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java
  26. 2 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/xml/syPackingListTailoringMapper.xml
  27. 26 23
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java
  28. 7 2
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/JsonChangeUtils.java

+ 53 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/controller/SyCostAllocationController.java

@@ -5,6 +5,8 @@ import com.alibaba.excel.ExcelWriter;
 import com.alibaba.excel.write.metadata.WriteSheet;
 import com.alibaba.excel.write.metadata.fill.FillConfig;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -153,6 +155,57 @@ public class SyCostAllocationController {
             if(syCostAllocation==null){
                 return result.error500("找不到对应计划单号!!!");
             }
+            // 销售订单附件
+            List<AccessorItem> accessorItemList = new ArrayList<>();
+            List<SyCostJson> list = syCostAllocationService.queryByCostJson(plannum,0,1);
+            SyCostAllocation syCostAllocation2=new SyCostAllocation();
+            if(list.size()>0){
+                syCostAllocation2 = JSON.parseObject(JSON.toJSONString(list.get(0).getCostInfo()), SyCostAllocation.class);
+                syCostAllocation2.setAttachs(list.get(0).getAttachs());
+                if (org.jeecg.modules.system.util.oConvertUtils.isNotEmpty(syCostAllocation2.getGarmentContractno())) {
+                    accessorItemList = fabricLossMapper.getSoAccList(Arrays.asList(syCostAllocation2.getGarmentContractno().split(",")));
+                    accessorItemList.forEach(e -> e.setFileurl("/report/FabricLoss/getFile?fileId=" + e.getCFileId() + "&filename=" + e.getFilename()));
+                }
+                syCostAllocation2.setAccessorItemList(accessorItemList);
+                List<SyCostAllocationFabric> fabrics1 = (List<SyCostAllocationFabric>) syCostAllocation.getProcessUnitList().get(0).get("syCostAllocationFabricList");
+                List<SyCostAllocationIngredient> ingredients1=(List<SyCostAllocationIngredient>)  syCostAllocation.getProcessUnitList().get(0).get("syCostAllocationIngredientList");
+                JSONArray fabrics2 = syCostAllocation2.getProcessUnitList().get(0).getJSONArray("syCostAllocationFabricList");
+                JSONArray ingredients2=syCostAllocation2.getProcessUnitList().get(0).getJSONArray("syCostAllocationIngredientList");
+//                List<SyCostAllocationFabric> fabrics2 = JSONArray.parseArray(syCostAllocation2.getProcessUnitList().get(0).getJSONArray("syCostAllocationFabricList").toJSONString(), SyCostAllocationFabric.class);
+//                List<SyCostAllocationIngredient> ingredients2=JSONArray.parseArray(syCostAllocation2.getProcessUnitList().get(0).getJSONArray("syCostAllocationIngredientList").toJSONString(), SyCostAllocationIngredient.class);
+                for (int i=0;i<fabrics2.size();i++){
+                    SyCostAllocationFabric fabric2=JSONObject.parseObject(String.valueOf(fabrics2.getJSONObject(i)),SyCostAllocationFabric.class);
+                    for (SyCostAllocationFabric fabric1 :fabrics1){
+                        System.out.println("fabric1\t"+fabric1);
+                        System.out.println("fabric2\t"+fabric2);
+                        if (fabric2.getGoodsName().equals(fabric1.getGoodsName())
+                                &&fabric2.getUsageQuantity().doubleValue()==fabric1.getUsageQuantity().doubleValue()
+                                &&fabric2.getRemarks()!=null){
+                            fabric1.setRemarks(fabric2.getRemarks());
+                            for(SyCostAllocationFabric pilosity2 : fabric2.getPilosityFewerList()){
+                                for (SyCostAllocationFabric pilosity1 : fabric1.getPilosityFewerList()){
+                                    if (pilosity2.getGoodsName().equals(pilosity1.getGoodsName())
+                                        &&pilosity2.getPlanQuantity().doubleValue()==pilosity1.getPlanQuantity().doubleValue()
+                                        &&pilosity2.getRemarks()!=null){
+                                        pilosity1.setRemarks(pilosity2.getRemarks());
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+                for (int i=0;i<ingredients2.size();i++){
+                    SyCostAllocationIngredient fabric2=JSONObject.parseObject(String.valueOf(ingredients2.getJSONObject(i)),SyCostAllocationIngredient.class);
+                    for (SyCostAllocationIngredient fabric1 :ingredients1){
+                        if (fabric2.getGoodsName().equals(fabric1.getGoodsName())
+                                &&fabric2.getUsageQuantity().doubleValue()==fabric1.getUsageQuantity().doubleValue()
+                                &&fabric2.getSupper().equals(fabric1.getSupper())&&fabric2.getRemarks()!=null){
+                            fabric1.setRemarks(fabric2.getRemarks());
+                        }
+                    }
+                }
+            }
+
         }
         return Result.OK(syCostAllocation);
     }

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/entity/SyCostJson.java

@@ -17,6 +17,7 @@ import org.jeewx.api.wxuser.Test;
 import org.springframework.format.annotation.DateTimeFormat;
 import springfox.documentation.spring.web.json.Json;
 import java.io.Serializable;
+import java.math.RoundingMode;
 import java.util.Date;
 
 /**

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/SyCostAllocationMapper.java

@@ -20,6 +20,9 @@ public interface SyCostAllocationMapper extends BaseMapper<SyCostAllocation> {
     @DS("multi-three")
     List<SyCostAllocation> queryByCostHead(@Param("code") String planCode);
 
+    @DS("multi-three")
+    List<String> queryByCostHead2(@Param("code") String planCode);
+
     List<SyCostJson> queryByCostJson(@Param("planNum")String planNum,
                              @Param("pageStart")Integer pageStart,@Param("pageEnd")Integer pageEnd);
 

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationAccidentMapper.xml

@@ -28,7 +28,8 @@
 			it.business_people,it.garment_sales_order,material,it.quality_control,finance_remark
 		from incident_ticket it
 		join incident_ticket_children its on it.id=its.incident_ticket_id
-		where its.plan_number = #{code} GROUP BY its.incident_ticket_id
+		where its.plan_number = #{code}
+		GROUP BY its.incident_ticket_id,accident_type
 	</select>
 	<!--
 	SELECT ah.cPBVCode as accidentNum,ven.cVenAbbName as accidentUndertaker,sum(A.iOriSum) as amount,sum(a.iSum) as rmbamount

+ 193 - 63
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/mapper/xml/SyCostAllocationMapper.xml

@@ -22,103 +22,103 @@
             max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department,
             max(cc.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,
-            max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
-            sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
-        FROM  UFDATA_101_2021.dbo.SO_SODetails s     
+            max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal,
+            sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity
+        FROM  UFDATA_101_2021.dbo.SO_SODetails s
         inner JOIN UFDATA_101_2021.dbo.SO_SOMain ss on ss.ID= s.ID
 
         inner JOIN (
-                     SELECT      
-                     om.cCode AS omCode,     
-                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,     
-                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity      
-                     FROM     
-                     UFDATA_101_2021.dbo.OM_MOMain om     
-                     inner JOIN UFDATA_101_2021.dbo.OM_MODetails od ON om.MOID = od.MOID   
+                     SELECT
+                     om.cCode AS omCode,
+                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,
+                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity
+                     FROM
+                     UFDATA_101_2021.dbo.OM_MOMain om
+                     inner JOIN UFDATA_101_2021.dbo.OM_MODetails od ON om.MOID = od.MOID
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_101_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
       WHERE
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
                      and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
-                     ) o ON s.isosid  = o.isosid AND s.cInvCode = o.cInvCode     
-        inner JOIN UFDATA_101_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
-        inner JOIN UFDATA_101_2021.dbo.Inventory c on c.cInvCode=s.cInvCode     
-        inner JOIN UFDATA_101_2021.dbo.Person  pe ON ss.cPersonCode = pe.cPersonCode     
-        inner JOIN UFDATA_101_2021.dbo.Department de ON ss.cDepCode = de.cDepCode     
-        inner JOIN UFDATA_101_2021.dbo.Customer cc ON ss.cCusCode = cc.cCusCode     
+                     ) o ON s.isosid  = o.isosid AND s.cInvCode = o.cInvCode
+        inner JOIN UFDATA_101_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
+        inner JOIN UFDATA_101_2021.dbo.Inventory c on c.cInvCode=s.cInvCode
+        inner JOIN UFDATA_101_2021.dbo.Person  pe ON ss.cPersonCode = pe.cPersonCode
+        inner JOIN UFDATA_101_2021.dbo.Department de ON ss.cDepCode = de.cDepCode
+        inner JOIN UFDATA_101_2021.dbo.Customer cc ON ss.cCusCode = cc.cCusCode
         WHERE c.cInvCcode like '19%' GROUP BY v.cVenAbbName
-        
-        union all  
-        
+
+        union all
+
         SELECT max(ss.iExchRate) as exchangeRate,min(s.iTaxUnitPrice) as soPrice,'103' as pkOrg,
-            max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales, 
+            max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department,
             max(cu.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,
-            max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
-            sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
-        FROM  UFDATA_103_2021.dbo.SO_SODetails a     
-        inner JOIN UFDATA_103_2021.dbo.SO_SOMain b on b.ID= a.ID     
-        inner JOIN (     
-                     SELECT      
-                     om.cCode AS omCode, od.csoordercode,    
-                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,     
-                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity      
-                     FROM     
-                     UFDATA_103_2021.dbo.OM_MOMain om     
-                     inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID     
+            max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal,
+            sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity
+        FROM  UFDATA_103_2021.dbo.SO_SODetails a
+        inner JOIN UFDATA_103_2021.dbo.SO_SOMain b on b.ID= a.ID
+        inner JOIN (
+                     SELECT
+                     om.cCode AS omCode, od.csoordercode,
+                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,
+                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity
+                     FROM
+                     UFDATA_103_2021.dbo.OM_MOMain om
+                     inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
       WHERE
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
                      and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
-                     ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode     
-        inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
-        inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode     
-        inner JOIN UFDATA_103_2021.dbo.Person  pe ON b.cPersonCode = pe.cPersonCode     
+                     ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
+        inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Person  pe ON b.cPersonCode = pe.cPersonCode
         inner JOIN UFDATA_103_2021.dbo.Department de ON b.cDepCode = de.cDepCode
-        inner JOIN UFDATA_103_2021.dbo.Customer cc ON b.cCusCode = cc.cCusCode 
+        inner JOIN UFDATA_103_2021.dbo.Customer cc ON b.cCusCode = cc.cCusCode
         inner join UFDATA_102_2021.dbo.PO_Pomain f on f.cPOID=o.csoordercode
         inner join UFDATA_102_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
         inner join UFDATA_102_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
         inner join UFDATA_102_2021.dbo.so_somain ss on ss.id=s.id
 
-        inner join UFDATA_102_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode 
-        inner JOIN UFDATA_102_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode 
+        inner join UFDATA_102_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode
+        inner JOIN UFDATA_102_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode
         WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenAbbName
-        
-        
-        union all  
-        
+
+
+        union all
+
         SELECT max(ss.iExchRate) as exchangeRate,min(s.iTaxUnitPrice) as soPrice,'103' as pkOrg,
-            max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales, 
+            max(o.omCode) as planNum,max(s.cdefine22) as poStyleNum,max(pe.cPersonName) as exportSales,
             max(ss.cSOCode) as garmentContractno,max(de.cDepName) as department,
             max(cu.cCusAbbName) as customerShortame,v.cVenAbbName as processUnit,
-            max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal, 
-            sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity    
-        FROM  UFDATA_103_2021.dbo.SO_SODetails a     
-        inner JOIN UFDATA_103_2021.dbo.SO_SOMain b on b.ID= a.ID     
-        inner JOIN (     
-                     SELECT      
-                     om.cCode AS omCode, od.csoordercode,    
-                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,     
-                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity      
-                     FROM     
-                     UFDATA_103_2021.dbo.OM_MOMain om     
-                     inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID    
+            max(ss.iTaxRate) as taxrate,max(ss.cMaker) as preparedBy,sum(s.iNatSum) as salesordersLocaltotal,
+            sum(s.iSum) as salesrrdersOriginaltotal,sum(o.iQuantity) as planQuantity
+        FROM  UFDATA_103_2021.dbo.SO_SODetails a
+        inner JOIN UFDATA_103_2021.dbo.SO_SOMain b on b.ID= a.ID
+        inner JOIN (
+                     SELECT
+                     om.cCode AS omCode, od.csoordercode,
+                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,
+                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity
+                     FROM
+                     UFDATA_103_2021.dbo.OM_MOMain om
+                     inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID
    inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
     WHERE
                      om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
                      and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
-                     ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode     
-        inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode     
-        inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode     
-        inner JOIN UFDATA_103_2021.dbo.Person  pe ON b.cPersonCode = pe.cPersonCode     
+                     ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
+        inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Person  pe ON b.cPersonCode = pe.cPersonCode
         inner JOIN UFDATA_103_2021.dbo.Department de ON b.cDepCode = de.cDepCode
-        inner JOIN UFDATA_103_2021.dbo.Customer cc ON b.cCusCode = cc.cCusCode 
+        inner JOIN UFDATA_103_2021.dbo.Customer cc ON b.cCusCode = cc.cCusCode
         inner join UFDATA_101_2021.dbo.PO_Pomain f on f.cPOID=o.csoordercode
         inner join UFDATA_101_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
         inner join UFDATA_101_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
         inner join UFDATA_101_2021.dbo.so_somain ss on ss.id=s.id
-        inner join UFDATA_101_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode 
-        inner JOIN UFDATA_101_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode 
+        inner join UFDATA_101_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode
+        inner JOIN UFDATA_101_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode
         WHERE cc.cCusCode in ('T020001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%' GROUP BY v.cVenAbbName
      UNION ALL
 
@@ -211,6 +211,136 @@
 */
     </select>
 
+    <select id="queryByCostHead2" resultType="java.lang.String">
+        -- SS23-RPI-59960,SS23-PRI-59960-2
+
+      SELECT DISTINCT ss.cSOCode
+        FROM  UFDATA_101_2021.dbo.SO_SODetails s
+        inner JOIN UFDATA_101_2021.dbo.SO_SOMain ss on ss.ID= s.ID
+
+        inner JOIN (
+                     SELECT
+                     om.cCode AS omCode,
+                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,
+                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity
+                     FROM
+                     UFDATA_101_2021.dbo.OM_MOMain om
+                     inner JOIN UFDATA_101_2021.dbo.OM_MODetails od ON om.MOID = od.MOID
+   inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_101_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
+      WHERE
+                     om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
+                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
+                     ) o ON s.isosid  = o.isosid AND s.cInvCode = o.cInvCode
+        inner JOIN UFDATA_101_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
+        inner JOIN UFDATA_101_2021.dbo.Inventory c on c.cInvCode=s.cInvCode
+        inner JOIN UFDATA_101_2021.dbo.Person  pe ON ss.cPersonCode = pe.cPersonCode
+        inner JOIN UFDATA_101_2021.dbo.Department de ON ss.cDepCode = de.cDepCode
+        inner JOIN UFDATA_101_2021.dbo.Customer cc ON ss.cCusCode = cc.cCusCode
+        WHERE c.cInvCcode like '19%'
+
+        union all
+
+        SELECT DISTINCT ss.cSOCode
+        FROM  UFDATA_103_2021.dbo.SO_SODetails a
+        inner JOIN UFDATA_103_2021.dbo.SO_SOMain b on b.ID= a.ID
+        inner JOIN (
+                     SELECT
+                     om.cCode AS omCode, od.csoordercode,
+                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,
+                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity
+                     FROM
+                     UFDATA_103_2021.dbo.OM_MOMain om
+                     inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID
+   inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
+      WHERE
+                     om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
+                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
+                     ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
+        inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Person  pe ON b.cPersonCode = pe.cPersonCode
+        inner JOIN UFDATA_103_2021.dbo.Department de ON b.cDepCode = de.cDepCode
+        inner JOIN UFDATA_103_2021.dbo.Customer cc ON b.cCusCode = cc.cCusCode
+        inner join UFDATA_102_2021.dbo.PO_Pomain f on f.cPOID=o.csoordercode
+        inner join UFDATA_102_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
+        inner join UFDATA_102_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
+        inner join UFDATA_102_2021.dbo.so_somain ss on ss.id=s.id
+
+        inner join UFDATA_102_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode
+        inner JOIN UFDATA_102_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode
+        WHERE cc.cCusCode in ('T020001','0001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%'
+
+
+        union all
+
+        SELECT DISTINCT ss.cSOCode
+        FROM  UFDATA_103_2021.dbo.SO_SODetails a
+        inner JOIN UFDATA_103_2021.dbo.SO_SOMain b on b.ID= a.ID
+        inner JOIN (
+                     SELECT
+                     om.cCode AS omCode, od.csoordercode,
+                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,
+                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity
+                     FROM
+                     UFDATA_103_2021.dbo.OM_MOMain om
+                     inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID
+   inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
+    WHERE
+                     om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
+                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
+                     ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
+        inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Person  pe ON b.cPersonCode = pe.cPersonCode
+        inner JOIN UFDATA_103_2021.dbo.Department de ON b.cDepCode = de.cDepCode
+        inner JOIN UFDATA_103_2021.dbo.Customer cc ON b.cCusCode = cc.cCusCode
+        inner join UFDATA_101_2021.dbo.PO_Pomain f on f.cPOID=o.csoordercode
+        inner join UFDATA_101_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
+        inner join UFDATA_101_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
+        inner join UFDATA_101_2021.dbo.so_somain ss on ss.id=s.id
+        inner join UFDATA_101_2021.dbo.Person j on j.cPersonCode=ss.cPersonCode
+        inner JOIN UFDATA_101_2021.dbo.Customer cu ON ss.cCusCode = cu.cCusCode
+        WHERE cc.cCusCode in ('T020001') and ss.cCusCode not in ('T020001','0001') and c.cInvCcode like '19%'
+     UNION ALL
+
+             SELECT DISTINCT ss1.cSOCode
+        FROM  UFDATA_103_2021.dbo.SO_SODetails a
+        inner JOIN UFDATA_103_2021.dbo.SO_SOMain b on b.ID= a.ID
+        inner JOIN (
+                     SELECT
+                     om.cCode AS omCode, od.csoordercode,
+                     om.MOID AS ompoId,od.MODetailsID AS ompoIdItem,
+                     om.cVenCode AS supplierCode,od.cInvCode,od.isosid,od.iQuantity
+                     FROM
+                     UFDATA_103_2021.dbo.OM_MOMain om
+                     inner JOIN UFDATA_103_2021.dbo.OM_MODetails od ON om.MOID = od.MOID
+                        inner JOIN (select MOID,max(iSendQTY) as iSendQTY from UFDATA_103_2021.dbo.OM_MOMaterials GROUP BY MOID) ot on ot.MOID=om.MOID
+                           WHERE
+                     om.iVerifyStateNew = 2  and om.cCode like CONCAT(#{code},'%')
+                     and (om.cCloser is null or ( (od.iReceivedQTY is not null or od.iReceivedQTY != 0) and (ot.iSendQTY is not null or ot.iSendQTY !=0) )or om.cCloser='asuser')
+                     ) o ON a.isosid  = o.isosid AND a.cInvCode = o.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Vendor v ON o.supplierCode= v.cVenCode
+        inner JOIN UFDATA_103_2021.dbo.Inventory c on c.cInvCode=a.cInvCode
+        inner JOIN UFDATA_103_2021.dbo.Person  pe ON b.cPersonCode = pe.cPersonCode
+        inner JOIN UFDATA_103_2021.dbo.Department de ON b.cDepCode = de.cDepCode
+        inner JOIN UFDATA_103_2021.dbo.Customer cc ON b.cCusCode = cc.cCusCode
+        inner join UFDATA_102_2021.dbo.PO_Pomain f on f.cPOID=o.csoordercode
+        inner join UFDATA_102_2021.dbo.po_podetails g on g.POID=f.POID and g.ivouchrowno=a.iRowNo
+        inner join UFDATA_102_2021.dbo.SO_SODetails s on s.iSOsID=g.iorderdid
+        inner join UFDATA_102_2021.dbo.so_somain ss on ss.id=s.id
+
+				inner join UFDATA_101_2021.dbo.PO_Pomain f1 on f1.cPOID=ss.csocode
+        inner join UFDATA_101_2021.dbo.po_podetails g1 on g1.POID=f1.POID and g1.ivouchrowno=s.iRowNo
+        inner join UFDATA_101_2021.dbo.SO_SODetails s1 on s1.iSOsID=g1.iorderdid
+        inner join UFDATA_101_2021.dbo.so_somain ss1 on ss1.id=s1.id
+
+        inner join UFDATA_101_2021.dbo.Person j on j.cPersonCode=ss1.cPersonCode
+        inner JOIN UFDATA_101_2021.dbo.Customer cu ON ss1.cCusCode = cu.cCusCode
+        WHERE cc.cCusCode in ('0001') and ss.cCusCode in ('T020001') and c.cInvCcode like '19%'
+
+
+
+    </select>
 
     <select id="queryPurBillVouchByFabric" resultType="org.jeecg.modules.cost.entity.SyCostAllocation">
 

+ 17 - 5
jeecg-boot-module-system/src/main/java/org/jeecg/modules/cost/service/impl/SyCostAllocationServiceImpl.java

@@ -193,9 +193,12 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
         syCostAllocation = list.get(0);
 //        System.out.println("Arrays.asList(syCostAllocation.getGarmentContractno().split(\",\"))\t"+Arrays.asList(syCostAllocation.getGarmentContractno().split(",")));
         List<String> strs=Arrays.asList(syCostAllocation.getGarmentContractno().split(",")).stream().distinct().collect(Collectors.toList());
+        List<String> strs3= syCostAllocationMapper.queryByCostHead2(plannum);
 //        System.out.println("获取成衣strs.size\t"+strs.size());
-//        System.out.println("获取成衣strs\t"+strs);
-        syCostAllocation.setGarmentContractno(strs.toString().substring(1,strs.toString().length()-2));
+        System.out.println("获取成衣strs1\t"+strs);
+        System.out.println("获取成衣strs2\t"+strs3);
+        System.out.println("获取成衣strs.toString().substring(1,strs.toString().length()-2)\t"+strs3.toString().substring(1,strs3.toString().length()-1));
+        syCostAllocation.setGarmentContractno(strs.toString().substring(1,strs.toString().length()-1));
         // 销售订单附件
         List<AccessorItem> accessorItemList = new ArrayList<>();
         if (org.jeecg.modules.system.util.oConvertUtils.isNotEmpty(syCostAllocation.getGarmentContractno())) {
@@ -320,8 +323,12 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
                         for (FabricOMOrder fabricOMOrder:fabricLoss.getFabricOMOrderList2()) {
                             if(fabricOMOrder.getCInvName().equals(syTransfer.getGoodsName())){
                                 Double unitCost=fabricOMOrder.getFabricMoOrderRKList().stream().mapToDouble(FabricMoOrderRK::getIPrice).average().orElse(0d);
-                                syTransfer.setUnitCost(new BigDecimal(unitCost));
-                                syTransfer.setCost(syTransfer.getUnitCost().multiply(new BigDecimal(syTransfer.getNumber())).setScale(2, RoundingMode.HALF_UP));
+                                syTransfer.setUnitCost(new BigDecimal(unitCost).setScale(2, RoundingMode.HALF_UP));
+                                syTransfer.getUnitCost();
+                                BigDecimal unitCost1=syTransfer.getUnitCost();
+                                BigDecimal number2=new BigDecimal(syTransfer.getNumber()).setScale(4, RoundingMode.HALF_UP);
+                                syTransfer.setCost(unitCost1.multiply(number2).setScale(2, RoundingMode.HALF_UP));
+//                                System.out.println("GoodsName\t"+syTransfer.getGoodsName()+"UnitCost\t"+syTransfer.getUnitCost());
 //                                syTransfer.setCost(syTransfer.getUnitCost().multiply(new BigDecimal(syTransfer.getNumber())));
                                 cost=cost.add(syTransfer.getCost());
                             }
@@ -378,7 +385,7 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
                     }
                 }
 
-                syCostAllocation.setFabriccostIncludestax(usageQuantityTotal);
+                syCostAllocation.setFabriccostIncludestax(usageQuantityTotal.setScale(2,BigDecimal.ROUND_HALF_UP));
                 syCostAllocation.setFabriccostNotincludestax(notincludestaxTotal);
                 syCostAllocation.setFabriccostIncludestaxUsd(includestaxTotal);
             }else{
@@ -408,6 +415,11 @@ public class SyCostAllocationServiceImpl extends ServiceImpl<SyCostAllocationMap
                 }
             }
 
+//            List<String> strs2=Arrays.asList(Ingredient.getSupper().split(",")).stream().distinct().collect(Collectors.toList());
+//            System.out.println("Ingredient.getSupper()\t"+Ingredient.getSupper());
+//            System.out.println("strs2.toString().substring(1,strs2.toString().length()-1)\t"+strs2.toString().substring(1,strs2.toString().length()-1));
+//            System.out.println("strs2\t"+strs2);
+//            Ingredient.setSupper(strs2.toString().substring(1,strs2.toString().length()-1));
 //            2023.08.30 改为美元金额 = 人民币金额除以销售订单汇率
             if(oConvertUtils.isNotEmpty(Ingredient.getRmbAmount())){
                // Ingredient.setUsdAmount(Ingredient.getRmbAmount().divide(syCostAllocation.getExchangeRate(),2,BigDecimal.ROUND_HALF_UP));

+ 11 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/controller/SyCostLossReviewController.java

@@ -203,8 +203,18 @@ public class SyCostLossReviewController extends JeecgController<SyOrderData, ISy
        List<SyCostLossReview> list2 = syCostLossReviewService.querySyFabricLossByCode();
        Map<String, SyCostLossReview> map2 = list2.stream()
                .collect(Collectors.toMap(SyCostLossReview::getPlanNo, c2 -> c2));
+
+//       //赋值面损审批数据2
+//       List<SyCostLossReview> list2 = syCostLossReviewService.querySyFabricLossByCode2();
+//       Map<String, SyCostLossReview> map2 = list2.stream()
+//               .collect(Collectors.toMap(SyCostLossReview::getPlanNo, c2 -> c2));
+
        //赋值成本审批数据
-       List<SyCostLossReview> list3 = syCostLossReviewService.queryCostAllocationByCode();
+//       List<SyCostLossReview> list3 = syCostLossReviewService.queryCostAllocationByCode();
+//       Map<String, SyCostLossReview> map3 = list3.stream()
+//               .collect(Collectors.toMap(SyCostLossReview::getPlanNo, c3 -> c3));
+
+       List<SyCostLossReview> list3 = syCostLossReviewService.querySyFabricLossByCode2();
        Map<String, SyCostLossReview> map3 = list3.stream()
                .collect(Collectors.toMap(SyCostLossReview::getPlanNo, c3 -> c3));
 

+ 4 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/entity/SyCostLossReview.java

@@ -6,9 +6,12 @@ import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
+import org.jeecg.modules.splfi.entity.SyPackingListFabricItem;
 import org.jeecgframework.poi.excel.annotation.Excel;
 import org.springframework.format.annotation.DateTimeFormat;
 
+import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.Date;
 import java.util.List;
 
@@ -88,5 +91,4 @@ public class SyCostLossReview {
 	private String dverifyDateE;
 
 	List<String> sumList;
-
-}
+}

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/SyCostLossReviewMapper.java

@@ -33,6 +33,7 @@ public interface SyCostLossReviewMapper extends BaseMapper<SyCostLossReview> {
     IPage<CostAllocationReview> queryCostAllocation(@Param("status") List<String> status,@Param("sy")CostAllocationReview sy, Page<CostAllocationReview> page);
 
     List<SyCostLossReview> querySyFabricLossByCode();
+    List<SyCostLossReview> querySyFabricLossByCode2();
     List<SyCostLossReview> queryCostAllocationByCode();
 
     @DS("multi-one")
@@ -111,4 +112,6 @@ public interface SyCostLossReviewMapper extends BaseMapper<SyCostLossReview> {
     public int submitDateUpdate2(@Param("code") String code,@Param("stuta") String stuta,@Param("submitDate") String submitDate,@Param("submitBy") String submitBy);
 
     public int firstApproveDateUpdate2(@Param("code") String code,@Param("stuta") String stuta,@Param("firstApproveDate") String firstApproveDate,@Param("firstApproveBy") String firstApproveBy);
+
+    SyApprovalHistory getSyApprovalHistory(String planNum);
 }

+ 39 - 6
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/mapper/xml/SyCostLossReviewMapper.xml

@@ -278,8 +278,12 @@ GROUP BY planNo;
         status,
         cost_info ->> '$.pkorgAmount'  AS pkorgAmount,
         cost_info ->> '$.pkorgAmountrmb'  AS pkorgAmountrmb,
-        cost_info ->> '$.rejectDate'  AS rejectDate,
-        cost_info ->> '$.finalApproveDate'  AS finalApproveDate,
+        (select processing_time from sy_cost_approval_history
+        where plan_no=#{sy.planNum} and stuta='驳回'
+        order by processing_time limit 1)  AS rejectDate,
+        (select processing_time from sy_cost_approval_history
+        where plan_no=#{sy.planNum} and stuta='审批通过'
+        order by processing_time desc limit 1)  AS finalApproveDate,
         cost_info ->> '$.usdTotalexportprice'  AS usdTotalexportprice,
         cost_info ->> '$.rmbExportamount'  AS rmbExportamount,
         cost_info ->> '$.fabriccostNotincludestax'  AS fabriccostNotincludestax,
@@ -361,16 +365,39 @@ GROUP BY planNo;
 
     <select id="querySyFabricLossByCode" resultType="org.jeecg.modules.documents.costLossReview.entity.SyCostLossReview">
         select UPPER(plan_code) as planNo,
-        submit_date as fsubmitDate,reject_date as frejectDate,first_approve_date as ffirstApproveDate,
-        final_approve_date as ffinalApproveDate,status as fstatus
+        submit_date as fsubmitDate,
+        reject_date as frejectDate,
+        first_approve_date as ffirstApproveDate,
+        final_approve_date as ffinalApproveDate,
+        status as fstatus
         from sy_fabric_loss_report
 
     </select>
 
+    <select id="querySyFabricLossByCode2" resultType="org.jeecg.modules.documents.costLossReview.entity.SyCostLossReview">
+        select 	a.plan_num as planNo,
+        a.status cstatus,
+        (select processing_time from sy_cost_approval_history
+        where plan_no=a.plan_num and stuta='提交' order by processing_time limit 1) csubmitDate,
+        a.first_approve_date as cfirstApproveDate, -- 初审通过日期
+        (select processing_time from sy_cost_approval_history
+        where plan_no=a.plan_num and stuta='驳回' order by processing_time limit 1)  AS crejectDate, -- 返单日期
+        (select processing_time from sy_cost_approval_history
+        where plan_no=a.plan_num and stuta='审批通过' order by processing_time desc limit 1)  AS cfinalApproveDate, -- 终审通过日期
+        cost_info ->> '$.remarks'  AS remarks
+        from sy_cost_json a
+        left join sy_cost_approval_history b on a.plan_num = b.plan_no
+        group by a.plan_num
+
+    </select>
+
     <select id="queryCostAllocationByCode" resultType="org.jeecg.modules.documents.costLossReview.entity.SyCostLossReview">
         select UPPER(plan_num) as planNo,
-        submit_date as csubmitDate,reject_date as frejectDate,first_approve_date as ffirstApproveDate,
-        final_approve_date as cfinalApproveDate,status as cstatus
+        submit_date as csubmitDate, -- 交单日期
+        reject_date as frejectDate, -- 返单日期
+        first_approve_date as ffirstApproveDate, -- 初审通过日期
+        final_approve_date as cfinalApproveDate, -- 终审通过日期
+        status as cstatus
         from sy_cost_json
 
 
@@ -574,4 +601,10 @@ GROUP BY planNo;
      where plan_no = #{code} order by processing_time
 
     </select>
+
+    <select id="getSyApprovalHistory" resultType="org.jeecg.modules.documents.costLossReview.entity.SyApprovalHistory">
+        select * from sy_cost_approval_history
+        where plan_no=#{planNum} and stuta='审批通过'
+        order by processing_time limit 1
+    </select>
 </mapper>

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/service/ISyCostLossReviewService.java

@@ -24,6 +24,7 @@ public interface ISyCostLossReviewService extends IService<SyCostLossReview> {
      IPage<FabricLossReview> querySyFabricLossReport(List<String> status,FabricLossReview sy, Page<FabricLossReview> page);
      IPage<CostAllocationReview> queryCostAllocation(List<String> status,CostAllocationReview sy, Page<CostAllocationReview> page);
      List<SyCostLossReview> querySyFabricLossByCode();
+     List<SyCostLossReview> querySyFabricLossByCode2();
      List<SyCostLossReview> queryCostAllocationByCode();
      List<String> queryCodeBymaker(String maker);
      List<String> queryCodeByfstatus(List<String> status,String ffirstApproveDateB,String ffirstApproveDateE);

+ 11 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/costLossReview/service/impl/SyCostLossReviewServiceImpl.java

@@ -64,6 +64,11 @@ public class SyCostLossReviewServiceImpl extends ServiceImpl<SyCostLossReviewMap
         return syCostLossReviewMapper.querySyFabricLossByCode();
     }
 
+    @Override
+    public List<SyCostLossReview> querySyFabricLossByCode2() {
+        return syCostLossReviewMapper.querySyFabricLossByCode2();
+    }
+
     @Override
     public List<SyCostLossReview> queryCostAllocationByCode() {
         return syCostLossReviewMapper.queryCostAllocationByCode();
@@ -212,6 +217,7 @@ public class SyCostLossReviewServiceImpl extends ServiceImpl<SyCostLossReviewMap
         String currentState=costAllocationReview.getCurrentState();
         SyApprovalHistory syApprovalHistory=costAllocationReview.getSyApprovalHistory();
         SyCostJson syCostJson=syCostLossReviewMapper.getSyCostJson(costAllocationReview.getPlanNum());
+        SyApprovalHistory syApprovalHistory2=syCostLossReviewMapper.getSyApprovalHistory(costAllocationReview.getPlanNum());
         int i = 0;
         //判断状态是否为提交状态状态,如果是才可以取消提交
         if(currentState.equals("取消提交")){
@@ -251,7 +257,11 @@ public class SyCostLossReviewServiceImpl extends ServiceImpl<SyCostLossReviewMap
         if(currentState.equals("审批通过")){
             //查询面损表是否含有第一次审批日期
             if(oConvertUtils.isEmpty(syCostJson.getFirstApproveDate())){
-                i = syCostLossReviewMapper.firstApproveDateUpdate2(code,"完成",syApprovalHistory.getProcessingTime(),syApprovalHistory.getProcessedBy());
+                if (syApprovalHistory2==null){
+                    i = syCostLossReviewMapper.firstApproveDateUpdate2(code,"完成",syApprovalHistory.getProcessingTime(),syApprovalHistory.getProcessedBy());
+                }else{
+                    i = syCostLossReviewMapper.firstApproveDateUpdate2(code,"完成",syApprovalHistory2.getProcessingTime(),syApprovalHistory.getProcessedBy());
+                }
                 this.addSyCostApprovalHistory(syApprovalHistory);
             }else {
                 i = syCostLossReviewMapper.submit(code, "完成");

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/controller/SyShippingDetailsController.java

@@ -415,7 +415,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 			return result;
 		}
 
-		syShippingDetailsService.syShippingDetailsDelete(deduplicatedList,itemIds);
+		syShippingDetailsService.syShippingDetailsDelete(deduplicatedList,itemIds);// 418
 
 		result.setSuccess(true);
 		result.setMessage("删除成功");

+ 2 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/service/impl/SyShippingDetailsServiceImpl.java

@@ -292,9 +292,10 @@ public class SyShippingDetailsServiceImpl extends ServiceImpl<SyShippingDetailsM
         List<String> orderIds = list.stream()
                 .map(SyShippingDetailsItem::getSyOrderDataItemId)
                 .collect(Collectors.toList());
-        List<SyOrderDataItem> orderDataItemList = syOrderDataItemService.listByIds(orderIds);
+        List<SyOrderDataItem> orderDataItemList = new ArrayList<>();
 
         if (!list.isEmpty()) {
+            orderDataItemList = syOrderDataItemService.listByIds(orderIds); //295
             // 建立订单ID到子表项的映射
             Map<String, SyOrderDataItem> orderItemMap = new HashMap<>();
             for (SyOrderDataItem orderDataItem : orderDataItemList) {

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/controller/SyShippingOrderController.java

@@ -120,7 +120,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 		Result<IPage<SyShippingOrder>> result = new Result<IPage<SyShippingOrder>>();
 		QueryWrapper<SyShippingOrder> queryWrapper = new QueryWrapper<>();
 		if(oConvertUtils.isNotEmpty(syShippingOrder.getOrderNumber())){
-			queryWrapper.like("b.order_number",syShippingOrder.getOrderNumber());
+			queryWrapper.likeRight("b.order_number",syShippingOrder.getOrderNumber().trim());
 		}
 		if(oConvertUtils.isNotEmpty(shippingOrderDateB)){
 			queryWrapper.between("a.shipping_order_date",shippingOrderDateB,shippingOrderDateE);
@@ -135,7 +135,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 			queryWrapper.eq("a.id",list.get(0).getSyShippingOrderItemId());
 		}
 		if(oConvertUtils.isNotEmpty(syShippingOrder.getShippingOrderNumber())){
-			queryWrapper.like("a.shipping_order_number",syShippingOrder.getShippingOrderNumber().trim());
+			queryWrapper.likeRight("a.shipping_order_number",syShippingOrder.getShippingOrderNumber().trim());
 		}
 		if(oConvertUtils.isNotEmpty(syShippingOrder.getExportInvoiceNo())){
 			queryWrapper.eq("a.export_invoice_no",syShippingOrder.getExportInvoiceNo());

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/service/impl/SyShippingOrderServiceImpl.java

@@ -114,7 +114,7 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
 
         //子表集合
         List<SyShippingOrderItem> itemList = new ArrayList<>();
-        //总净重
+        //总净重 money totalPrice
         BigDecimal totalNetWeight = BigDecimal.ZERO;
         //总毛重
         BigDecimal totalGrossWeight = BigDecimal.ZERO;

+ 2 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/openApi/controller/PurchaseWarehousingController.java

@@ -172,6 +172,8 @@ public class PurchaseWarehousingController extends JeecgController<PurchaseWareh
       return super.importExcel(request, response, PurchaseWarehousing.class);
   }
 
+  @AutoLog(value = "采购入库-saveBath")
+  @ApiOperation(value="采购入库-saveBath", notes="采购入库-saveBath")
   @PostMapping(value = "/saveBath")
 //  @MultiTransactional(value = {DbTxConstants.DB1_TX, DbTxConstants.DB2_TX})
   public Result saveBath(@RequestBody JSONArray json){

+ 14 - 3
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/controller/SyPreAssembledPackingListController.java

@@ -2382,7 +2382,8 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
 //                                    strs.add(null);
 //                                }
                                 if(cell!=null){
-                                    FormulaEvaluator formulaEvaluator = new XSSFFormulaEvaluator((XSSFWorkbook) workbook1);
+                                    //FormulaEvaluator formulaEvaluator = new XSSFFormulaEvaluator((XSSFWorkbook) workbook1);
+                                    FormulaEvaluator formulaEvaluator =   workbook1.getCreationHelper().createFormulaEvaluator();
                                     //获取单元格内容的类型 =R17-Q17*0.35
                                     CellType cellType = cell.getCellType();
                                     //System.out.println("是公式吗\t"+(cellType.equals(CellType.FORMULA)==true?"是":"否"));
@@ -2390,12 +2391,17 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
                                     if (cellType.equals(CellType.FORMULA)){
                                         // System.out.println("formula cell\t"+cell);
                                         //获取公式,可以理解为已String类型获取cell的值输出
+//                                        cell.setCellType(CellType.FORMULA);//获取的都转换成FORMULA
                                         String cellFormula = cell.getCellFormula();
-                                        //System.out.println(cellFormula);
+//                                        System.out.print("\tcellFormula\t"+cellFormula);
                                         //执行公式,此处cell的值就是公式
                                         CellValue evaluate = formulaEvaluator.evaluate(cell);
                                         //System.out.println(evaluate.formatAsString());
-                                        strs.add(evaluate.formatAsString());
+                                        strs.add(evaluate.getNumberValue()+"");
+//                                        System.out.println("\tevaluate.formatAsString()\t"+evaluate.formatAsString());
+                                        Row row2=sheet.getRow(0);//列
+                                        Cell cell3=row2.getCell(i);
+//                                        System.out.print("\t"+cell3.toString()+"\t"+evaluate.getNumberValue()+"\t"+cell.toString());
                                     }else{
                                         // System.out.println("string cell\t"+cell);
                                         cell.setCellType(CellType.STRING);//获取的都转换成String
@@ -2404,7 +2410,11 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
                                                     sheet.getRow(0).getCell(i).getStringCellValue()+"未填值!");
                                         }
                                         strs.add(cell.toString());
+//                                        Row row2=sheet.getRow(0);//列
+//                                        Cell cell3=row2.getCell(i);
+//                                        System.out.print("\t"+cell3.toString()+"\t"+cell.toString());
                                     }
+//                                    System.out.print("\tcell\t"+cell);
                                 }else{
                                     strs.add(null);
                                 }
@@ -2412,6 +2422,7 @@ public class SyPreAssembledPackingListController extends JeecgController<SyPreAs
                         }
                     }
                 }
+                System.out.println();
                 if(x>0){
                     BigDecimal total=new BigDecimal("0");
                     for (String str : strs2){

+ 15 - 17
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/entity/SyPreAssembledPackingListItem.java

@@ -14,6 +14,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -344,12 +345,6 @@ public class SyPreAssembledPackingListItem implements Serializable {
 			endCaseNumber=parsms[5];
 			itemCode=parsms[6];
 			prepackSku=parsms[7];
-
-			if(parsms[8]==null|!isNumeric(parsms[8])){
-				//totalPack=new BigDecimal("0");//件数包
-			}else{
-				totalPack=new BigDecimal(parsms[8]);//件数包
-			}
 			//totalPack=new BigDecimal(parsms[8]);
 
 			colour=parsms[9];
@@ -357,7 +352,6 @@ public class SyPreAssembledPackingListItem implements Serializable {
 			totalPrice=new BigDecimal("0");//初始化
 			planQuantity=new BigDecimal(parsms[10]);
 			boxNumber=new BigDecimal(Double.parseDouble(endCaseNumber)-Double.parseDouble(startingBoxNumber)+1);//箱数
-			System.out.println("boxNumber\t"+boxNumber);
 			netWeight=new BigDecimal(parsms[11]);
 			grossWeight=new BigDecimal(parsms[12]);
 			outerBoxLength=new BigDecimal(parsms[13]);
@@ -373,21 +367,12 @@ public class SyPreAssembledPackingListItem implements Serializable {
 			}else{
 				withCode=parsms[17];//配码
 			}
-			if(parsms[18]==null||!isNumeric(parsms[18])){
-				//packBox=new BigDecimal("0");//件数包
-			}else{
-				packBox=new BigDecimal(parsms[18]);//件数包
-			}
 			/*if(parsms[19]==null||parsms[19].length()==0){
 				piecesBox=new BigDecimal("0");//件数包
 			}else{
 				piecesBox=new BigDecimal(parsms[8]);//件数包
 			}*/
-			if(parsms[20]==null||!isNumeric(parsms[20])){
-				//packs=new BigDecimal("0");//件数包
-			}else{
-				packs=new BigDecimal(parsms[20]);//件数包
-			}
+//			System.out.println("2 配码\t"+parsms[17]+"包数/箱\t"+parsms[18]+"件数/箱\t"+parsms[19]+"\t包数\t"+parsms[20]);
 			/*packBox=new BigDecimal(parsms[18]);//包数/箱
 			piecesBox=new BigDecimal(parsms[19]);//件数/箱
 			packs=new BigDecimal(parsms[20]);//包数*/
@@ -417,6 +402,19 @@ public class SyPreAssembledPackingListItem implements Serializable {
 			this.planSize=planSize.substring(0,planSize.length()-1);
 			this.piecesBox=new BigDecimal(piecesBox);//每箱件数
 			this.total=this.boxNumber.multiply(this.piecesBox);//数量
+			if(isNumeric(parsms[8])){
+				totalPack=new BigDecimal(parsms[8]);//件数包
+				//总件数 total
+//				if(isNumeric(parsms[18])){
+					System.out.println("this.piecesBox\t"+this.piecesBox+"\ttotalPack\t"+totalPack);
+					packBox=this.piecesBox.divide(totalPack,2,RoundingMode.HALF_UP ) ;//包数/箱
+//				}
+//				if(isNumeric(parsms[20])){
+//					packs=new BigDecimal(parsms[20]);//包数
+					packs=boxNumber.multiply(packBox);//包数
+//				}
+			}
+			System.out.println("\t包数/箱\t"+packBox+"\t件数/包\t"+totalPack+"\t包数\t"+packs);
 			this.totalNetWeight=this.boxNumber.multiply(this.netWeight);
 			this.totalGrossWeight=this.boxNumber.multiply(this.grossWeight);
 			this.totalVolume=this.boxNumber.multiply(this.outerBoxLength).multiply(this.outerBoxWidth).multiply(this.outerBoxHeight).divide(new BigDecimal(1000000));

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/spapl/service/impl/SyPreAssembledPackingListServiceImpl.java

@@ -970,7 +970,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 					throw new JeecgBootException("未找到配码规格\t"+item.getWithCode());
 				}
 				//System.out.println("size\t"+item.getSizeTables());默认配码规格
-				System.out.println("配码规格\t"+item.getWithCode());
+//				System.out.println("配码规格\t"+item.getWithCode());
 				total3=total3.add(item.getTotal());
 				int num2=0;
 				for (SizeTable size : item.getSizeTables()){
@@ -981,7 +981,7 @@ public class SyPreAssembledPackingListServiceImpl extends ServiceImpl<SyPreAssem
 					}else{
 						//ids+=""+map.get(size.getSize())+",";//获取出运明细子表id
 					}
-					System.out.println("尺码\t"+size.getSize()+"\t数量\t"+size.getProportion());
+//					System.out.println("尺码\t"+size.getSize()+"\t数量\t"+size.getProportion());
 					if(num2==0){
 						//SyShippingDetailsItem syshippings=syShippingDetailsItemMapper.selectById(size.getItemId());
 						if(main.getCustomerAbbreviation().equals("BW")||main.getCustomerAbbreviation().equals("DUNNES")){

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/controller/SyPackingListFabricController.java

@@ -930,7 +930,7 @@ public class SyPackingListFabricController implements Job {
 	@AutoLog(value = "手动同步辅料数据")
 	@ApiOperation(value="手动同步辅料数据", notes="手动同步辅料数据")
 	@GetMapping(value = "/getU8Data")
-	public Result<?> getU8Data(){
+	public Result<?> getU8Data() throws ParseException {
 		String massage=syPackingListFabricService.getU8Data();
 		return Result.OK(massage);
 	}

+ 1 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/entity/SyPackingListFabricItem.java

@@ -11,6 +11,7 @@ import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 import java.math.BigDecimal;
+import java.math.RoundingMode;
 import java.util.Date;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;

+ 14 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/mapper/xml/SyPackingListFabricItemMapper.xml

@@ -165,7 +165,8 @@
 			where id=t.elements_Id) declaration_Name,
 			(select declaration_unit from sy_declaration_elements
 			where id=t.elements_Id) declaration_unit, t.push_State, t.*
-			from ( 	SELECT
+			from
+			( 	SELECT
 			a.container_Number as containerNumber1, a.export_invoice_no,a.push_State,
 			a.garment_Factory, a.create_By as prepared_by,  b.*
 			FROM  sy_packing_list_fabric a
@@ -177,7 +178,7 @@
 				#{value}
 			</foreach>
 			ORDER BY  export_Invoice_No,dyelot_Number /*declaration_Name,plan_Lot_Number*/
-		) t
+			) t
 	</select>
 
 	<select id="getList"   resultType="org.jeecg.modules.splfi.entity.SyPackingListFabricItem">
@@ -194,14 +195,18 @@
 	<!--<select id="getu8Data"  resultMap="genderIsosid">-->
 	<select id="getu8Data"  resultMap="genderIsosid">
 		SELECT DISTINCT
-		left(sy_order_data_id,13) AS isosid
-		FROM `sy_shipping_details_item`
-		WHERE inventory_Ccode NOT LIKE '19%'
-		AND elements_Id IS NOT NULL
-		AND elements_Id !=''
-		and del_flag=0
-		and create_time >DATE_SUB(NOW(), INTERVAL 2 MONTH)
+			left(sy_order_data_id,13) AS isosid
+			FROM `sy_shipping_details_item`
+			left join sy_declaration_elements
+			on elements_id=sy_declaration_elements.id
+			WHERE inventory_Ccode NOT LIKE '19%'
+			AND elements_Id IS NOT NULL
+			AND elements_Id !=''
+			and sy_shipping_details_item.del_flag=0 
+		and sy_declaration_elements.del_flag=0
+		and sy_declaration_elements.create_time >DATE_SUB(NOW(), INTERVAL 2 MONTH)
 		and submit_Status='1'
+		ORDER BY isosid desc
 	</select>
 
 	<select id="getDocumentNos"  resultType="java.lang.String">

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/ISyPackingListFabricService.java

@@ -67,7 +67,7 @@ public interface ISyPackingListFabricService extends IService<SyPackingListFabri
 	//分页查询
 	IPage<SyPackingListFabric> selectPage(IPage<SyPackingListFabric> page,QueryWrapper<SyPackingListFabric> queryWrapper);
 
-	String getU8Data();
+	String getU8Data() throws ParseException;
 
 	String submitBatch(String[] ids);
 

+ 46 - 9
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splfi/service/impl/SyPackingListFabricServiceImpl.java

@@ -31,6 +31,7 @@ import org.jeecg.modules.documents.shippingDetails.service.impl.SyShippingDetail
 import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrder;
 import org.jeecg.modules.documents.syShippingOrder.mapper.SyShippingOrderMapper;
 import org.jeecg.modules.openApi.entity.DxpDataPlan;
+import org.jeecg.modules.openApi.mapper.DxpDataPlanMapper;
 import org.jeecg.modules.openApi.mapper.PurchaseWarehousingMapper;
 import org.jeecg.modules.openApi.service.IDxpDataPlanService;
 import org.jeecg.modules.openApi.service.ISenYuDataSourceOne;
@@ -239,6 +240,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			}
 			if(entity.getMasterMetering()!=null&&entity.getMasterMetering().equals("KG")){//计算总价
 				if(entity.getNetWeight()!=null){
+					setNetWeight(entity);//净重保留两位小数
 					entity.setTotalPrice(entity.getNetWeight().multiply(entity.getPrice()).setScale(2, RoundingMode.HALF_UP));//净重*单价
 				}
 			}else{
@@ -829,6 +831,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					}
 					if(s1.getMasterMetering().equals("KG")){//计算总价
 						if(s1.getNetWeight()==null){
+							setNetWeight(s1);//净重保留两位小数
 							s1.setTotalPrice(s1.getNetWeight().multiply(s1.getPrice()).setScale(2, RoundingMode.HALF_UP));//净重*单价
 						}else{
 							//throw new JeecgBootException("物料:"+s1.getInventoryName()+"请填写净重");
@@ -898,7 +901,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			List<String> documentNos=getDateNos(maps.size());
 			int num=0;
 			for (String str : maps.keySet()){
-				//SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS");
+				//SimpleDateFormat sf = new SimpleDateFormat("yyMMddHHmmssSSS"); totalPrice
 				//String dateNo ="ML"+sf.format(System.currentTimeMillis());//获取单据号
 				SyPackingListFabric syPackingListFabric =maps.get(str);
 				List<String> ids=new ArrayList<>();
@@ -971,6 +974,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 					}
 					if(item.getMasterMetering().equals("KG")){//计算总价
 						if(item.getNetWeight()!=null){
+							setNetWeight(item);//净重保留两位小数
 							item.setTotalPrice(item.getNetWeight().multiply(item.getPrice()).setScale(2, RoundingMode.HALF_UP));//净重*单价
 						}else{
 							//throw new JeecgBootException("单位为kg的物料请填写净重,用于计算金额");
@@ -1023,6 +1027,14 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 		return bool;
 	}
 
+
+	void setNetWeight(SyPackingListFabricItem item){
+		if (item.getNetWeight()!=null){
+			item.setNetWeight(item.getNetWeight().setScale(2, RoundingMode.HALF_UP));
+		}
+	}
+
+
 	/**
 	 * excel导入测试的数据
 	 * @param maps
@@ -1040,6 +1052,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			String name="";
 			int num=5;
 			for (SyPackingListFabricItem item :main.getSyPackingListFabricItem()){
+				setNetWeight(item);//净重保留两位小数
 				SyShippingDetailsItem syShippingDetailsItem=syShippingDetailsItemMapper.selectById(item.getSyShippingDetailsItemId());//获取物料分类和其他数据
 				//物料分类
 				if(syShippingDetailsItem!=null){//不为null
@@ -1052,7 +1065,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 						}
 					}else{
 						System.out.println("净重\t"+item.getNetWeight());
-						throw new JeecgBootException("第"+item.getNum()+"行找不到订单数据,获取不到单位");
+//						throw new JeecgBootException("第"+item.getNum()+"行找不到订单数据,获取不到单位");
 					}
 					item.setInventoryCcode(syShippingDetailsItem.getInventoryCcode());//物料分类
 					item.setPrice(syShippingDetailsItem.getSalesUnitPrice());//价格
@@ -1739,11 +1752,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 				if(item.getAccount().equals("102")&&mapt.get("account").equals("102")){//如果销售订单账套号等于102,当前推送到了102
 					//102销售发货单、102销售出库单
 					mapItem3.put("ITAXUNITPRICE",item.getPrice());
-				}else if(item.getAccount().equals("102")&&mapt.get("account").equals("102")){//如果销售订单账套号等于102,当前推送到了101
+				}else if(item.getAccount().equals("102")&&mapt.get("account").equals("101")){//如果销售订单账套号等于102,当前推送到了101
 					//101采购入库单
 					mapItem.put("IORITAXCOST",item.getPrice());//修改成报关单价
 				}
-				if(item.getAccount().equals("102")&&mapt.get("account").equals("102")){//采购发票
+				if(item.getAccount().equals("102")&&mapt.get("account").equals("101")){//采购发票
 					mapItem5.put("IORITAXCOST",item.getPrice());//改成使用报关单价
 				}
 				if(item.getAccount().equals("102")&&mapt.get("account").equals("102")){//销售发票
@@ -2198,6 +2211,9 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 
 	}*/
 
+	@Autowired
+	private DxpDataPlanMapper dxpDataPlanMapper;
+
 	/**
 	 * 从u8拉取数据 添加方式4
 	 * @return
@@ -2205,12 +2221,22 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 	//@Override
 	//@Scheduled(fixedRate=1000*60*3)
 	//@Transactional
-	public String getU8Data (){
+	public String getU8Data () throws ParseException {
 		String massage="";
 		int num=0;
 		int num1=0;
+		DxpDataPlan dxpDataPlan=dxpDataPlanMapper.selectById("0012");
+		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+		Date datetome = sf.parse(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(System.currentTimeMillis()));
+		dxpDataPlan.setLastTime(datetome);
+		if(dxpDataPlan.getItemUrl().equals("f")){
+			dxpDataPlan.setItemUrl("t");
+			dxpDataPlanMapper.updateById(dxpDataPlan);
+		}else{
+			System.out.println("正在执行中");
+			return "正在执行中";
+		}
 		long startTime = System.currentTimeMillis();
-		SimpleDateFormat sf = new SimpleDateFormat("yyMMdd");
 		String[] arrs = syPackingListFabricItemMapper.getu8Data();//获取发运明细已提交的辅料
 		List<String> documentNos=syPackingListFabricItemMapper.getDocumentNos();
 //		System.out.println("documentNos.size\t"+documentNos.size());
@@ -2226,6 +2252,8 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 			}
 		}
 		if(arrs.length<1){
+			dxpDataPlan.setItemUrl("f");
+			dxpDataPlanMapper.updateById(dxpDataPlan);
 			return "没有新的数据";
 		}
 		/*UpdateWrapper updateWrapper=new UpdateWrapper();
@@ -2472,6 +2500,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 							}
 							if(sy1.getMasterMetering().equals("KG")){//计算总价
 								if(sy1.getNetWeight()!=null){
+									setNetWeight(sy1);//净重保留两位小数
 									sy1.setTotalPrice(sy1.getNetWeight().multiply(sy1.getPrice()).setScale(2, RoundingMode.HALF_UP));//净重*单价
 								}
 							}else{
@@ -2519,12 +2548,16 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 						num1++;
 					}
 				}catch (Exception e){
+					dxpDataPlan.setItemUrl("f");
+					dxpDataPlanMapper.updateById(dxpDataPlan);
 					e.printStackTrace();
 				}
 			}
 		}
 		long endTime2 = System.currentTimeMillis();
 		System.out.println("自动拉取耗费时间:" + (endTime2 - startTime) + "ms");
+		dxpDataPlan.setItemUrl("f");
+		dxpDataPlanMapper.updateById(dxpDataPlan);
 		return "成功添加了"+num+"条数据!";
 	}
 
@@ -2544,7 +2577,11 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 
 	@Override
 	public void execute(JobExecutionContext context) throws JobExecutionException {
-		this.getU8Data();//定时任务直接调用本地方法
+		try {
+			this.getU8Data();//定时任务直接调用本地方法
+		} catch (ParseException e) {
+			e.printStackTrace();
+		}
 	}
 
 
@@ -2559,7 +2596,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 	public String pushInvoice(List<SyPackingListFabric> listFabrics) {
 		long startTime = System.currentTimeMillis();
 		String message="";
-		//List<SyPackingListFabricItem> listFabricItems=syPackingListFabricItemMapper.queryByList(id);
+		//List<SyPackingListFabricItem> listFabricItems=syPackingListFabricItemMapper.queryByList(id); totalPrice
 		//List<SyPackingListFabric> listFabrics=syPackingListFabricMapper.queryByList(id);//获取托书下所有的主表信息
 		List<String> codes=getList(listFabrics);//获取出库单号
 		System.out.println("面辅料查看出库单号\t"+codes);
@@ -2586,7 +2623,7 @@ public class SyPackingListFabricServiceImpl extends ServiceImpl<SyPackingListFab
 //					syPackingListFabric.setRemarks(syPackingListFabric.getRemarks()+"TC证书");
 //				}else{
 //					syPackingListFabric.setRemarks("TC证书");
-//				}
+//				} getCustomsDeclarationUnitPrice
 //			}
 			//System.out.println("codes.size\t"+codes.size());
 			System.out.println("codes\t"+codes);

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/mapper/xml/syPackingListTailoringMapper.xml

@@ -302,7 +302,7 @@
     </select>
 
     <select id="getIvouchrowno"   resultType="java.lang.String">
-        SELECT popos.ivouchrowno FROM
+        SELECT popos.iSOsID FROM
         so_sodetails soso
         LEFT JOIN UFDATA_103_2021.dbo.HY_DZ_K7_SYNERGISMLOGDID hy
         ON voucherno = soso.cSOCode
@@ -311,7 +311,7 @@
         ON popos.id = hy.predid
         WHERE soso.cSOCode = #{params3}
         AND hy.accid =  #{params4}
-        AND soso.iRowNo =  #{params5}
+        AND soso.iSOsID =  #{params5}
 
     </select>
 

+ 26 - 23
jeecg-boot-module-system/src/main/java/org/jeecg/modules/splt/service/impl/SyPackingListTailoringServiceImpl.java

@@ -1315,7 +1315,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 						orderDataItem=syPackingListTailoringMapper.getOmOrPoItem2("PO_PoDetails", "ID='"+item.getOmpoIdItem()+"'","ID");
 					}else{
 						if(orderData!=null&&orderData.containsKey("id")){
-							orderDataItem=syPackingListTailoringMapper.getOmOrPoItem2("PO_PoDetails", "poid='"+orderData.get("id")+"' and ivouchrowno='"+
+							orderDataItem=syPackingListTailoringMapper.getOmOrPoItem2("PO_PoDetails", "poid='"+orderData.get("id")+"' and iSOsID ='"+
 							((Map<String,String>)mapt.get("itemSort")).get(item.getId())+"'","ID");//根据行号获取信息
 						}
 					}
@@ -1390,7 +1390,7 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 					return "推送失败:"+mapt.get("account")+"的"+mapt.get("ordertype")+"子表的iSOsID为null";
 				}else{
 					Map<String,Object> orderDataItem2=syPackingListTailoringMapper.getSoMainItem(orderDataItem.get("iSOsID").toString());
-					mapSort.put(item.getId(),orderDataItem2.get("irowno").toString());
+					mapSort.put(item.getId(),orderDataItem2.get("iSOsID").toString());
 					mapItem3.put("ITAXUNITPRICE",orderDataItem2.get("iTaxUnitPrice"));//原币含税单价(如果传空,取来源单据)(以含税单价为准自动计算相关价格及金额)
 					mapItem3.put("ITAXRATE",orderDataItem2.get("iTaxRate"));//税率(如果传空,取来源单据,无来源单据,取存货档案对应的销项税率)
 					mapItem3.put("SOAUTOIDCOL","ISOSID");//来源单据明细ID对应字段名(如果取销售订单主键,需传固定值ISOSID)
@@ -1473,7 +1473,6 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 				}
 
 				if(!mapt.get("account").equals("101")){
-					//Order order=mapSort.get(item.getId());
 					String params1="UFDATA_103_2021";//当前数据库
 					String params2="UFDATA_102_2021";//目标数据库
 					String params4="1000000001";//当前账套
@@ -1622,20 +1621,22 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 						String consignmentName=maps.get(account).get("code");//获取销售发货单
 						List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
 						if(consignmentMaps!=null){
+							List<String> autoIds=new ArrayList<>();
 							for (Map map : consignmentMaps){
 								JSONObject jsonObject=mapList4.getJSONObject(0);//循环迭代
 								List<Map<String,Object>> mapItems4= (List<Map<String,Object>>) jsonObject.get("DETAILList");
 								for (Map itemMap4 :  mapItems4){
 									if(itemMap4.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap4.get("IQUANTITY").toString())
-											==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_SO")){//根据尺码判断
+											==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_SO")&&!autoIds.contains(map.get("iDLsID").toString())){//根据尺码判断
 										Object declarationName=itemMap4.get("CDEFINE31");
 										getcFree((JSONObject) itemMap4,map);
 										itemMap4.put("CDEFINE31",declarationName);
 										itemMap4.put("AUTOID_SO",map.get("iDLsID"));
+										autoIds.add(map.get("iDLsID").toString());
 									}
 								}
-								System.out.println("mapItems4\t"+mapItems4);
 							}
+							System.out.println("autoIds\t"+autoIds);
 						}
 						text(mapList4,"销售出库单");
 						JSONArray resturn4 = InterfaceConnUtils.doPost(mapList4,"saleout_import");//
@@ -1713,17 +1714,19 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		JSONObject jsonObject3=resturn3.getJSONObject(0);//销售发货单
 		String consignmentName=jsonObject3.get("U8ReceiptNo").toString();//获取销售发货单fadfad
 		List<Map<String,Object>> consignmentMaps= syPackingListTailoringMapper.getDispatchLists(consignmentName);
+		List<String> autoIds=new ArrayList<>();
 		if(consignmentMaps!=null){
 			for (Map map : consignmentMaps){
 				JSONObject jsonObject=mapList4.getJSONObject(0);//循环迭代
 				List<Map<String,Object>> mapItems4= (List<Map<String,Object>>) jsonObject.get("DETAILList");
 				for (Map itemMap4 :  mapItems4){
 					if(itemMap4.get("size").equals(map.get("cFree2"))&&(Double.parseDouble( itemMap4.get("IQUANTITY").toString())
-					==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_SO")){//根据尺码判断
+					==Double.parseDouble( map.get("iQuantity").toString()))&&!itemMap4.containsKey("AUTOID_SO")&&!autoIds.contains(map.get("iDLsID").toString())){//根据尺码判断
 						Object declarationName=itemMap4.get("CDEFINE31");
 						getcFree((JSONObject) itemMap4,map);
 						itemMap4.put("CDEFINE31",declarationName);
 						itemMap4.put("AUTOID_SO",map.get("iDLsID"));
+						autoIds.add(map.get("iDLsID").toString());
 					}
 				}
 				System.out.println("mapItems4\t"+mapItems4);
@@ -2027,8 +2030,8 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 		Map<String,List<String>> customers=getSuppliers(listTailorings);//key:供应商编码,value:出库单单据号
 		System.out.println(account+"采购customers\t"+customers);
 		if(account.equals("102")){
-			//customers=getSuppliers2(codes,listTailorings);//key:供应商编码,value:出库单id
-			customers=getSuppliers2(listTailorings);//key:供应商编码,value:出库单id
+			customers=getSuppliers2(codes,listTailorings);//key:供应商编码,value:出库单id
+//			customers=getSuppliers2(listTailorings);//key:供应商编码,value:出库单id
 		}
 		Map<String,List<SyPackingListTailoringItem>> listTailoringItemMaps=getListTailoringItemMaps(customers,listTailorings);//key:供应商编码,value:对应子表
 		Map<String,List<SyPackingListTailoring>> listTailoringMaps=getListTailoringMaps(customers,listTailorings);//key:供应商编码,value:对应主表
@@ -2607,21 +2610,21 @@ public class SyPackingListTailoringServiceImpl extends ServiceImpl<SyPackingList
 //	 * @param codes,listTailorings
 //	 * @return
 //	 */
-//	public Map<String,List<String>> getSuppliers2(List<String> codes,List<SyPackingListTailoring> listTailorings){
-//		List<Map<String,Object>> suppliers=syPackingListTailoringMapper.getSuppliers("rdrecord01",codes.toArray(new String[codes.size()]));
-//		Map<String,List<String>> mapLists=new HashMap<>();
-//		for (Map<String,Object> map : suppliers){
-//			if(mapLists.containsKey(map.get("cVenCode").toString())){
-//				mapLists.get(map.get("cVenCode").toString()).add(map.get("ccode").toString());
-//			}else{
-//				List<String> list=new ArrayList<>();
-//				list.add(map.get("ccode").toString());
-//				mapLists.put(map.get("cVenCode").toString(),list);
-//			}
-//		}
-//		System.out.println("mapLists\t"+mapLists);
-//		return mapLists;
-//	}
+	public Map<String,List<String>> getSuppliers2(List<String> codes,List<SyPackingListTailoring> listTailorings){
+		List<Map<String,Object>> suppliers=syPackingListTailoringMapper.getSuppliers("rdrecord01",codes.toArray(new String[codes.size()]));
+		Map<String,List<String>> mapLists=new HashMap<>();
+		for (Map<String,Object> map : suppliers){
+			if(mapLists.containsKey(map.get("cVenCode").toString())){
+				mapLists.get(map.get("cVenCode").toString()).add(map.get("ccode").toString());
+			}else{
+				List<String> list=new ArrayList<>();
+				list.add(map.get("ccode").toString());
+				mapLists.put(map.get("cVenCode").toString(),list);
+			}
+		}
+		System.out.println("mapLists\t"+mapLists);
+		return mapLists;
+	}
 
 	/**
 	 * 采购发票

+ 7 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/JsonChangeUtils.java

@@ -445,9 +445,14 @@ public class JsonChangeUtils implements ApplicationContextAware{
 
             Set<String> keysCfree = mapCfree.keySet();
             for (String key : keysCfree) {
+                //attributeCode 2
+                //attributeValue 3
+                //attributeFlag 4
                 ii++;
-                jf.put("attributeCode"+ii, key);
-                jf.put("attributeValue"+ii, map.get(key));
+                if(map.get(key)!=null){
+                    jf.put("attributeCode"+ii, key);
+                    jf.put("attributeValue"+ii, map.get(key));
+                }
                 String code = key.substring(key.length()-1);
                 jf.put("attributeFlag"+ii, mapbConfig.get("bConfigFree"+code));
             }