Browse Source

托书推送,发运明细导出,预托书取消回写

zengtx 2 năm trước cách đây
mục cha
commit
efd705fd34

+ 11 - 11
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/letterDeposit/service/impl/SyLetterDepositServiceImpl.java

@@ -187,11 +187,11 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
                     syLetterDepositItemList.add(itenPojo);
 
                     //回写发运明细是否被参照
-                    String shippingIds = syper.getSyDeclarationElementsItemId();
-                    SyShippingDetailsItem syshippingItem = new SyShippingDetailsItem();
-                    syshippingItem.setId(shippingIds);
-                    syshippingItem.setIsReference(1);
-                    syShippingDetailsItemService.updateById(syshippingItem);
+//                    String shippingIds = syper.getSyDeclarationElementsItemId();
+//                    SyShippingDetailsItem syshippingItem = new SyShippingDetailsItem();
+//                    syshippingItem.setId(shippingIds);
+//                    syshippingItem.setIsReference(1);
+//                    syShippingDetailsItemService.updateById(syshippingItem);
                 }
                 //回写预装箱单主表预托书号
                 String preId = li.getSyPreAssembledPackingListId();
@@ -336,13 +336,13 @@ public class SyLetterDepositServiceImpl extends ServiceImpl<SyLetterDepositMappe
             syPreAssembledPackingListService.updateById(entit);
 
             //查询预装箱单子表
-            SyPreAssembledPackingListItem entity = syPreAssembledPackingListItemService.getById(li.getSyPreAssembledPackingListItemId());
+            //SyPreAssembledPackingListItem entity = syPreAssembledPackingListItemService.getById(li.getSyPreAssembledPackingListItemId());
             //回写发运明细是否被参照
-            String shippingIds = entity.getSyDeclarationElementsItemId();
-            SyShippingDetailsItem syshippingItem = new SyShippingDetailsItem();
-            syshippingItem.setId(shippingIds);
-            syshippingItem.setIsReference(0);
-            syShippingDetailsItemService.updateById(syshippingItem);
+//            String shippingIds = entity.getSyDeclarationElementsItemId();
+//            SyShippingDetailsItem syshippingItem = new SyShippingDetailsItem();
+//            syshippingItem.setId(shippingIds);
+//            syshippingItem.setIsReference(0);
+//            syShippingDetailsItemService.updateById(syshippingItem);
         }
         //删除子表
         syLetterDepositMapper.syLetterDepositItemDelete(id);

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

@@ -536,11 +536,15 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 
 			  //集合转map
 			  for(SyShippingDetailsVo li:itemList){
+
 			  	if(oConvertUtils.isEmpty(li.getElementsId())){
 					result.setSuccess(false);
 					result.setMessage("报关要素未维护,不允许导出!");
 					return result;
 				}
+				  if(oConvertUtils.isEmpty(li.getGarmentFactory())){
+					  li.setGarmentFactory(" ");
+				  }
 			  	//如果面料是光还 供应商(柒厂) =供应商 如果是印花布 则根据 将供应商柒厂) 是印花布的材料来源供应商 这2列都需要带值
 				  String sub = li.getInventoryCcode().substring(0,2);
 			  	  String sub2 = "";
@@ -658,7 +662,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 				  }
 				  builder1.deleteCharAt(builder1.length()-1);
 				  //创建列名放在第一行
-				  String[] params =("成衣工厂*款号*小po*分销点*起始箱号*结束箱号*item NO./SKU NO./UPC NO./PACKS CODE*PREACKSKU*"+builder+"颜色*计划装箱数量*净重/箱*毛重/箱*外箱长度*外箱宽度*外箱高度*净净重*客户简称*配码规格*箱数*总件数*总毛重*总净重*发运明细子表ID*发运明细分组ID*发运明细主表ID*申报要素ID").split("\\*");
+				  String[] params =("成衣工厂*款号*小po*分销点*起始箱号*结束箱号*item NO./SKU NO./UPC NO./PACKS CODE*PREACKSKU*"+builder+"颜色*计划装箱数量*净重/箱*毛重/箱*外箱长度*外箱宽度*外箱高度*客户简称*配码规格*箱数*总件数*总毛重*总净重*总体积*发运明细子表ID*发运明细分组ID*发运明细主表ID*申报要素ID").split("\\*");
 				  String[] params1 =syPreList.get(index).toString(builder.toString(),builder1.toString()).split("\\*");
 				  String[] params2= {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","AA","AB","AC","AD","AE","AF","AG","AH","AI","AJ","AK","AL","AM","AN","AO","AP","AQ","AR","AS","AT","AU","AV","AW","AX","AY","AZ"};
 
@@ -666,6 +670,10 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 				  String box = "";
 				  String gross = "";
 				  String net = "";
+				  String length = "";
+				  String wide = "";
+				  String heigt = "";
+				  String sunBox = "";
 
 				  Row row1 = sheet.createRow(0);
 				  Row row2 = sheet.createRow(1);
@@ -681,6 +689,18 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 					  if(params[x].equals("毛重/箱")){
 						  gross = params2[x];
 					  }
+					  if(params[x].equals("外箱长度")){
+						  length = params2[x];
+					  }
+					  if(params[x].equals("外箱宽度")){
+						  wide = params2[x];
+					  }
+					  if(params[x].equals("外箱高度")){
+						  heigt = params2[x];
+					  }
+					  if(params[x].equals("箱数")){
+						  sunBox = params2[x];
+					  }
 
 					  Cell cell = row1.createCell(x);
 					  cell.setCellValue(params[x]);
@@ -699,28 +719,32 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 						  cell1.setCellValue(params1[x]);
 					  }
 					  //计算箱数
-					  if(x == params.length-8){
+					  if(x == params.length-9){
 						  Cell cell1 = row2.createCell(x);
 						  cell1.setCellFormula("SUM(F2-E2+1)");
 						  //cell1.setCellValue("=");
 					  }
 					  //总件数=所有尺码值*箱数
-					  if(x == params.length-7){
+					  if(x == params.length-8){
 						  Cell cell1 = row2.createCell(x);
 						  cell1.setCellFormula("SUM("+params2[8]+"2:"+params2[size]+"2)*"+box+"2");
 						  //cell1.setCellValue("=");
 					  }
 					  //总毛重
-					  if(x == params.length-6){
+					  if(x == params.length-7){
 						  Cell cell1 = row2.createCell(x);
 						  cell1.setCellFormula("ROUND(SUM("+gross+"2*"+box+"2),2)");
 					  }
 					  //总净重
-					  if(x == params.length-5){
+					  if(x == params.length-6){
 						  Cell cell1 = row2.createCell(x);
 						  cell1.setCellFormula("ROUND(SUM("+net+"2*"+box+"2),2)");
 					  }
-
+					  //总体积 =长*宽*高*总箱数/1000000
+					  if(x == params.length-5){
+						  Cell cell1 = row2.createCell(x);
+						  cell1.setCellFormula("ROUND(SUM("+length+"2*"+wide+"2*"+heigt+"2*"+sunBox+"2/1000000),3)");
+					  }
 				  }
 				  index++;
 			  }
@@ -1466,7 +1490,7 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 	  * @return
 	  */
 	 @GetMapping(value = "/queryLatelyDeclarationElements")
-	 public Result<SyDeclarationElements> queryLatelyDeclarationElements(String hscode,
+	 public Result<SyDeclarationElements> queryLatelyDeclarationElements(String hscode,String itemNumber,
 																   HttpServletRequest request, HttpServletResponse response) {
 
 		 Result<SyDeclarationElements> result = new Result<SyDeclarationElements>();

+ 3 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/SyShippingDetailsItem.java

@@ -415,6 +415,9 @@ public class SyShippingDetailsItem {
 				this.customerAbbreviation = orderDataVo.getCustomerAbbreviation();
 				this.garmentFactory = orderDataVo.getGarmentFactory();
 			}
+		}else{
+			this.customerAbbreviation = orderDataVo.getCustomerAbbreviation();
+			this.garmentFactory = orderDataVo.getGarmentFactory();
 		}
 
         this.customerName = orderDataVo.getCustomerName();

+ 2 - 2
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyPreAssembledPackingListVo.java

@@ -200,8 +200,8 @@ public class SyPreAssembledPackingListVo {
 //        String fwSplit = fw[0]+"~"+fw[fw.length-1];
         return garmentFactory+"*"+itemNumber+"*"+smallPo+"*"+distributionPoint+"*"+""+
                 "*"+""+"*"+""+"*"+""+"*"+builder+color+"*"+plannedShippingQuantity+
-                "*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+
-                customerAbb+"*"+codingRules+"*"+""+"*"+""+"*"+""+"*"+""+"*"+builder1+"*"+groupId+"*"+id+"*"+elenmentId;
+                "*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+
+                customerAbb+"*"+codingRules+"*"+""+"*"+""+"*"+""+"*"+""+"*"+""+"*"+builder1+"*"+groupId+"*"+id+"*"+elenmentId;
     }
 
 

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

@@ -175,7 +175,7 @@ ${ew.customSqlSegment} and  t.inventoryCcode not LIKE '19%'
            a.sales_type_text as salesTypeText,a.customer_abbreviation as customerAbbreviation,a.customer_name as customerName,b.surplus_num as surplusNum,DATE_FORMAT(b.pre_completion_date,'%Y-%m-%d') as preCompletionDate,
            a.brand_side as brandSide,a.exchange_rate as exchangeRate,b.specification_and_model as specificationAndModel,a.account as account,b.inventory_code as inventoryCode,b.weight as weight,
            b.distribution_point as distributionPoint,b.pack_id as packId,b.unit_price_including_tax as unitPriceIncludingTax,b.number_of_sets as numberOfSets,b.guangpei_gate_width as guangpeiGateWidth,
-           b.supplier_code as supplierCode,a.garment_nmb as garmentNmb,a.garment_factory as garmentFactory,DATE_FORMAT(b.pre_delivery_date,'%Y-%m-%d') as preDeliveryDate,b.box_number as boxNumber,
+           b.supplier_code as supplierCode,a.garment_nmb as garmentNmb,b.garment_factory as garmentFactory,DATE_FORMAT(b.pre_delivery_date,'%Y-%m-%d') as preDeliveryDate,b.box_number as boxNumber,
            a.whole_order_total as wholeOrderTotal,a.sales_department as salesDepartment,a.salesman as salesman,a.currency_text as currencyText,a.third_party as thirdParty,
             a.deposit_ratio as depositRatio,a.deposit as deposit,a.collaborative_route as collaborativeRoute,a.term_of_payment as termOfPayment,a.end_customer as endCustomer,
              a.order_remarks as orderRemarks,a.price_remarks as priceRemarks,a.order_change_description as orderChangeDescription,b.supplier as supplier,b.i_tax_price as iTaxPrice,

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

@@ -1422,6 +1422,13 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 		 try {
 			 //查询主表信息
 			 SyShippingOrder entity = syShippingOrderService.getById(syShippingOrder.getId());
+			 if(oConvertUtils.isEmpty(entity.getTheFinalShippingDate())){
+				 result.setResult(0);
+				 result.setMessage("推送失败!请维护最终船期!");
+				 result.setSuccess(false);
+				 return result;
+
+			 }
 			 String rateDate = sf.format(entity.getTheFinalShippingDate());
 			 //判断是否已提交
 			 if(entity.getTheDocumentsState().equals("0")){