Browse Source

发运明细查询调整

zengtx 1 year ago
parent
commit
86bc1b12d6

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

@@ -146,7 +146,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 
 		Result<IPage<SyShippingDetailsVo>> result = new Result<IPage<SyShippingDetailsVo>>();
          //列表合计
-		 Double amountTo = 0.00;
+		 Double amountTo = 0.0000;
 
 		QueryWrapper<SyShippingDetailsVo> queryWrapper = new QueryWrapper<>();
 		SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
@@ -227,17 +227,11 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 		if(flourOrGarment.equals("0")){//面辅料
 			queryWrapper.eq("1",1);
 			 IPage<SyShippingDetailsVo> pageList = syShippingDetailsService.queryShippingDetailsGarment(page, queryWrapper);
+
 			  for(SyShippingDetailsVo str:pageList.getRecords()){
-				  //赋值报关信息
-				  SyDeclarationElements entity = syDeclarationElementsService.getById(str.getElementsId());
-				  if(oConvertUtils.isNotEmpty(entity)){
-					  str.setDeclarationName(entity.getDeclarationName());
-					  str.setHsCode(entity.getHsCode());
-					  str.setEnglishProductName(entity.getEnglishProductName());
-				  }
 				  amountTo = amountTo+str.getShipmentQuantity();
 			  }
-
+			//amountTo = pageList.getRecords().stream().mapToDouble(i -> i.getShipmentQuantity()).sum();
 			pageList.setRecords(pageList.getRecords().stream().sorted(Comparator.comparing(SyShippingDetailsVo::getCreateTime).reversed()).collect(Collectors.toList()));
 
 			result.setSuccess(true);
@@ -247,16 +241,17 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 			queryWrapper.eq("1",1);
 			IPage<SyShippingDetailsVo> pageList = syShippingDetailsService.queryShippingDetails(page, queryWrapper);
 
-			for(SyShippingDetailsVo str:pageList.getRecords()){
-				//赋值报关信息
-				SyDeclarationElements entity = syDeclarationElementsService.getById(str.getElementsId());
-				if(oConvertUtils.isNotEmpty(entity)){
-					str.setDeclarationName(entity.getDeclarationName());
-					str.setHsCode(entity.getHsCode());
-					str.setEnglishProductName(entity.getEnglishProductName());
-				}
-				amountTo = amountTo+str.getShipmentQuantity();
-			}
+			amountTo = pageList.getRecords().stream().mapToDouble(i -> i.getShipmentQuantity()).sum();
+//			for(SyShippingDetailsVo str:pageList.getRecords()){
+//				//赋值报关信息
+//				SyDeclarationElements entity = syDeclarationElementsService.getById(str.getElementsId());
+//				if(oConvertUtils.isNotEmpty(entity)){
+//					str.setDeclarationName(entity.getDeclarationName());
+//					str.setHsCode(entity.getHsCode());
+//					str.setEnglishProductName(entity.getEnglishProductName());
+//				}
+//				amountTo = amountTo+str.getShipmentQuantity();
+//			}
 
 			pageList.setRecords(pageList.getRecords().stream().sorted(Comparator.comparing(SyShippingDetailsVo::getCreateTime).reversed()).collect(Collectors.toList()));
 			result.setSuccess(true);

+ 4 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/mapper/xml/SyShippingDetailsMapper.xml

@@ -66,7 +66,7 @@ a.end_customer) as endCustomer,
 
 
 <select id="queryShippingDetails" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
-    select a.create_time as createTime,b.is_reference as isReference,a.id as id,GROUP_CONCAT(b.id) as itemIds,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,b.submit_status as submitStatus,
+    select e.declaration_name as declarationName,e.hs_code as hsCode,e.english_product_name as englishProductName,a.create_time as createTime,b.is_reference as isReference,a.id as id,GROUP_CONCAT(b.id) as itemIds,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,b.submit_status as submitStatus,
     b.customer_abbreviation as customerAbbreviation,b.sales_department as salesDepartment,b.salesman as salesman,a.customer as customer,b.specification_and_model as specificationAndModel,
     b.small_po as smallPo,b.pack_id as packId,b.pre_delivery_date as preDeliveryDate,b.order_date as orderDate,b.inventory_ccode as inventoryCcode,
     sum(b.shipment_quantity) as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,round(sum(b.order_quantity),4) as orderQuantity,
@@ -89,13 +89,14 @@ a.end_customer) as endCustomer,
      from sy_shipping_details a
 left join sy_shipping_details_item b
 on a.id = b.shipping_details_id and b.del_flag = 0
+left join sy_declaration_elements e  on b.elements_id = e.id
 ${ew.customSqlSegment} and  b.inventory_ccode LIKE '19%' and a.del_flag = 0
 GROUP BY b.group_id
 
 </select>
 
     <select id="queryShippingDetailsGarment" resultType="org.jeecg.modules.documents.shippingDetails.entity.VO.SyShippingDetailsVo">
-    select a.create_time as createTime,b.is_reference as isReference,a.id as id,GROUP_CONCAT(b.id) as itemIds,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,b.submit_status as submitStatus,
+    select e.declaration_name as declarationName,e.hs_code as hsCode,e.english_product_name as englishProductName,a.create_time as createTime,b.is_reference as isReference,a.id as id,GROUP_CONCAT(b.id) as itemIds,a.document_no as documentNo,a.document_date as documentDate,b.order_number as orderNumber,a.push_state,b.submit_status as submitStatus,
     b.customer_abbreviation as customerAbbreviation,b.sales_department as salesDepartment,b.salesman as salesman,a.customer as customer,b.specification_and_model as specificationAndModel,
     b.small_po as smallPo,b.pack_id as packId,b.pre_delivery_date as preDeliveryDate,b.order_date as orderDate,b.inventory_ccode as inventoryCcode,
     sum(b.shipment_quantity) as shipmentQuantity,b.customs_declaration_unit_price as customsDeclarationUnitPrice,sum(b.order_quantity) as orderQuantity,
@@ -118,6 +119,7 @@ GROUP BY b.group_id
      from sy_shipping_details a
 left join sy_shipping_details_item b
 on a.id = b.shipping_details_id and b.del_flag = 0
+left join sy_declaration_elements e  on b.elements_id = e.id
 ${ew.customSqlSegment}
 and a.del_flag = 0  and b.inventory_ccode not LIKE '19%'
 GROUP BY b.group_id