Browse Source

Merge branch 'master' of http://139.196.39.194:9021/chenc/sen-yu-new-service

huxy 2 years ago
parent
commit
670c6fd80d

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

@@ -577,9 +577,13 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 
 		 try {
 
-			 Date date1 = sf.parse(entity.getLatestDateOfShipment());
-			 String lasttime = sf.format(date1);
-			 entity.setLatestDateOfShipment(lasttime);
+		 	if(oConvertUtils.isNotEmpty(entity.getLatestDateOfShipment())){
+				Date date1 = sf.parse(entity.getLatestDateOfShipment());
+				String lasttime = sf.format(date1);
+				entity.setLatestDateOfShipment(lasttime);
+			}else{
+				entity.setLatestDateOfShipment("");
+			}
 
 			 // 只要不是成品,需要做汇总操作,汇总条件为报关品名+HSCODE
 			 if(entity.getReadyFabric().equals("成衣")){
@@ -593,6 +597,10 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 					 tatolVolume = tatolVolume.add(li.getVolume());
 					 li.setDestination(entity.getArriveInCountry());
 				 }
+				 //总数量
+				 entity.setTatolNumber(tatolNumber);
+				 //总金额
+				 entity.setTatolMoney(tatolMoney);
 			 }else{
 				 readyFabric = "申报要素-面辅料";
 				 list = syShippingOrderMapper.queryEelementMerge(id);
@@ -604,17 +612,17 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 					 tatolVolume = tatolVolume.add(li.getVolume());
 					 li.setDestination(entity.getArriveInCountry());
 				 }
+				 //总毛重
+				 entity.setTotalGrossWeight(entity.getTotalGrossWeight());
+				 //总净重
+				 entity.setTotalNetWeight(entity.getTotalNetWeight());
+				 //总数量
+				 entity.setTatolNumber(tatolNumber);
+				 //总金额
+				 entity.setTatolMoney(tatolMoney);
+			     //总体积
+			     entity.setTotalVolume(entity.getTatolVolume());
 			 }
-			 //总毛重
-			 entity.setTotalGrossWeight(totalGrossWeight);
-			 //总净重
-			 entity.setTotalNetweight(totalNetweight);
-			 //总数量
-			 entity.setTatolNumber(tatolNumber);
-			 //总金额
-			 entity.setTatolMoney(tatolMoney);
-			 //总体积
-			 entity.setTotalVolume(tatolVolume);
 
 			 //判空
 			 if(oConvertUtils.isEmpty(entity.getUnitInOperation())){

+ 1 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/entity/SyShippingOrder.java

@@ -253,8 +253,7 @@ public class SyShippingOrder {
 	private String dutyParagraph;
 
 	//总净重
-	@TableField(exist = false)
-	private BigDecimal totalNetweight;
+	private BigDecimal totalNetWeight;
 
 	//区分成衣或者面料
 	private String readyFabric;

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/syShippingOrder/mapper/xml/SyShippingOrderMapper.xml

@@ -5,7 +5,7 @@
     <select id="syShippingOrderPageList" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrder">
   select a.id,a.shipping_order_number as shippingOrderNumber,b.order_number as orderNumber,a.export_invoice_no as exportInvoiceNo,
   b.distribution_point as distributionPoint,a.unit_in_operation as unitInOperation,a.box_number as boxNumber,b.garment_factory as garmentFactory,
-  sum(b.gross_weight) as totalGrossWeight,case when b.ready_fabric != '成衣' then b.volume else sum(b.volume) end as totalVolume,b.box_number as planQuantity,b.client_abbreviation as clientAbbreviation,
+  a.total_gross_weight as totalGrossWeight,case when b.ready_fabric != '成衣' then b.volume else a.total_volume end as totalVolume,b.box_number as planQuantity,b.client_abbreviation as clientAbbreviation,
   a.money,a.the_actual_shipping_date as theActualShippingDate,a.exchange_earnings_text as exchangeEarningsText,
   a.consignee,a.bill_of_lading_or_carriage_receipt as billOfLadingOrCarriageReceipt,a.the_final_shipping_date as theFinalShippingDate,
   a.addressee,a.trade_country as tradeCountry,a.arrive_in_country as arriveInCountry,a.export_port as exportPort,
@@ -110,7 +110,7 @@ group by b.hs_code,b.declaration_name
     <select id="queryEelement" resultType="org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem">
 
 select GROUP_CONCAT(a.id) as id,b.hs_code as hsCode,b.declaration_name as declarationName,b.english_product_name as englishProductName,sum(a.number) as number,a.unit_price as unitPrice,
-sum(a.number*a.unit_price) as totalPrice,sum(a.gross_weight) as grossWeight,sum(a.net_weight) as netWeight,a.master_metering as pcs,sum(a.volume) as volume,
+sum(a.number*a.unit_price) as totalPrice,a.gross_weight as grossWeight,a.net_weight as netWeight,a.master_metering as pcs,a.volume as volume,
 'USD' as curr,'CHAIN' as dree,'宁波其他/宁波象山县' as place,'照章征税' as certificate,a.style_number as styleNumber,a.smail_po as smailPo,
 a.order_number as orderNumber,a.client_abbreviation as clientAbbreviation
  from sy_shipping_order_item a

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

@@ -108,7 +108,8 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
 
         //子表集合
         List<SyShippingOrderItem> itemList = new ArrayList<>();
-
+        //总净重
+        BigDecimal totalNetWeight = BigDecimal.ZERO;
         //总毛重
         BigDecimal totalGrossWeight = BigDecimal.ZERO;
         //总体积
@@ -149,8 +150,13 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
                     fabricItemIdList.add(str);
                 }
 
-                totalVolume = totalVolume.add(li.getVolume());//总体积
+                if(oConvertUtils.isEmpty(li.getVolume())){
+                    totalVolume = totalVolume.add(BigDecimal.ZERO);
+                }else {
+                    totalVolume = totalVolume.add(li.getVolume());//总体积
+                }
                 totalGrossWeight = totalGrossWeight.add(li.getGrossWeight());//总毛重
+                totalNetWeight = totalNetWeight.add(li.getNetWeight());//总净重
                 if(li.getReadyFabric().equals("面料")){
                     //查询装箱单面料子表数据
                     QueryWrapper<SyPackingListFabricItem> queryWrapper = new QueryWrapper<SyPackingListFabricItem>();
@@ -307,7 +313,8 @@ public class SyShippingOrderServiceImpl extends ServiceImpl<SyShippingOrderMappe
             syShippingOrder.setTotalVolume(totalVolume);
             //总箱数
             syShippingOrder.setBoxNumber(new BigDecimal(totalBox));
-
+            //总净重
+            syShippingOrder.setTotalNetWeight(totalNetWeight);
 
             syShippingOrderItemService.saveBatch(itemList);
         }