瀏覽代碼

发运明细面辅料导出,托书结汇发票

zengtx 2 年之前
父節點
當前提交
0925534cdb

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

@@ -505,6 +505,35 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 					result.setMessage("报关要素未维护,不允许导出!");
 					return result;
 				}
+			  	//如果面料是光还 供应商(柒厂) =供应商 如果是印花布 则根据 将供应商柒厂) 是印花布的材料来源供应商 这2列都需要带值
+				  String sub = li.getInventoryCcode().substring(0,2);
+			  	//03 = 光坯,04 = 印花
+                if(sub.equals("03")){
+					li.setSupplier(li.getSupplier());
+					li.setRSupplier(li.getSupplier());
+				}
+				  if(sub.equals("04")){
+					  li.setSupplier(li.getSupplier());
+					  li.setRSupplier(li.getRSupplier());
+				  }
+				  //转换计划号
+				  int indexof = li.getOrderNumber().indexOf("SY");
+				  if(indexof !=-1) {
+					  int g = li.getOrderNumber().indexOf("-", indexof);
+					  if (g < 0) {
+						  li.setOrderNumber(li.getOrderNumber().substring(indexof));
+					  } else {
+						  li.setOrderNumber(li.getOrderNumber().substring(indexof, g));
+					  }
+				  }
+				  //如果是辅料,报关数量取发运明细数量
+				  if(li.getInventoryCcode().equals("05")||li.getInventoryCcode().equals("06")||li.getInventoryCcode().equals("07")|| li.getInventoryCcode().equals("0299")|| li.getInventoryCcode().equals("0399") || li.getInventoryCcode().equals("0499")){
+					 li.setCustomsQuantity(li.getShipmentQuantity().toString());
+				  }else{
+					  li.setCustomsQuantity("");
+				  }
+
+
 				  Field[] fieldsList = li.getClass().getDeclaredFields();
 				  Map<String, Object> mapList = new HashMap<String, Object>();
 				  for (Field field : fieldsList) {
@@ -573,7 +602,8 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 			  int index = 0;
 			  while (sheets.hasNext()){
 				  Sheet sheet=(Sheet) sheets.next();
-				  workbook.setSheetName(index,"数据源"+(index+1));
+				  //页签命名规范 款号-分销点 用-后缀数字区分
+				  workbook.setSheetName(index,syPreList.get(index).getItemNumber()+"-"+syPreList.get(index).getDistributionPoint()+"-"+(index+1));
 				  StringBuilder builder = new StringBuilder();
 				  //获取尺码组
 				  List<SizeTable> sizeGroup = syPreAssembledPackingListItemMapper.querySize(syPreList.get(index).getId(),syPreList.get(index).getGroupId());
@@ -1307,4 +1337,5 @@ public class SyShippingDetailsController extends JeecgController<SyShippingDetai
 
 	 	return result;
 	 }
+
 }

+ 12 - 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/documents/shippingDetails/entity/VO/SyShippingDetailsVo.java

@@ -307,11 +307,23 @@ public class SyShippingDetailsVo {
     @ApiModelProperty(value = "二维表格")
     private List<SizeTable> sizeTables;
 
+    @ApiModelProperty(value = "物料分类")
+    private String inventoryCcode;
+    @ApiModelProperty(value = "染厂供应商")
+    private String rSupplier;
+    @ApiModelProperty(value = "门幅")
+    private String guangpeiGateWidth;
+    @ApiModelProperty(value = "克重")
+    private String weight;
+
     //单位
     private String masterMetering;
     //金额
     private BigDecimal price;
 
+    //报关数量
+    private String customsQuantity;
+
 
     //导出条件
     private String startTime;

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

@@ -245,8 +245,8 @@ ${ew.customSqlSegment}
        select t.* from( select a.document_date as documentDate,a.document_no as documentNo,b.salesman as salesman,b.submit_status as submitStatus,
        b.order_number as orderNumber,b.item_number as itemNumber,b.colour,b.pre_delivery_date as preDeliveryDate,b.sales_unit_price as salesUnitPrice,
         b.inventory_code as inventoryCode,b.inventory_name as inventoryName,c.declaration_name as declarationName,a.create_by as createBy,a.create_time as createTime,
-        b.material_composition as materialComposition,b.guangpei_gate_width as guangpeiGateWidth,b.weight,b.is_reference as isReference,
-        b.excess_quantity as excessQuantity,d.master_metering as masterMetering,b.garment_factory as garmentFactory,
+        b.material_composition as materialComposition,b.guangpei_gate_width as guangpeiGateWidth,b.weight as weight,b.is_reference as isReference,
+        b.excess_quantity as excessQuantity,d.master_metering as masterMetering,b.garment_factory as garmentFactory,b.shipment_quantity as shipmentQuantity,
         b.id as itemIds,a.id as id,b.elements_id as elementsId,b.r_supplier_code as rSupplierCode,b.r_supplier as rSupplier,
         b.supplier,b.supplier_code as supplierCode,b.specification_and_model as specificationAndModel,b.inventory_ccode as inventoryCcode
          from sy_shipping_details a

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

@@ -1020,6 +1020,58 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 				 map.put("item", listMap);
 				 map.put("list", maiTouList);
 
+				 Workbook workbook = ExcelExportUtil.exportExcel(params,map);
+				 ServletOutputStream outputStream = response.getOutputStream();
+				 workbook.write(outputStream);
+
+			 }else if(testName.equals("报关信息-结汇发票")){
+
+				 List<Map<String,Object>> taitouList = new ArrayList<>();
+
+				 //查询数据字典-公司抬头
+				 List<DictModel> test = sysDictService.queryDictItemsByCode("company_title");
+
+				 if(list.get(0).getClientAbbreviation().equals("宁波森语")){
+					 String split[] = test.get(0).getValue().split("\\+");
+					 for (int i = 0; i < split.length; i++) {
+						 Map<String, Object> maiTou = new HashMap<>();
+						 maiTou.put("name", split[i]);
+						 taitouList.add(maiTou);
+					 }
+					 entity.setClientAbbreviation(split[0]);
+				 }else{
+					 String split[] = test.get(1).getValue().split("\\+");
+					 for (int i = 0; i < split.length; i++) {
+						 Map<String, Object> maiTou = new HashMap<>();
+						 maiTou.put("name", split[i]);
+						 taitouList.add(maiTou);
+					 }
+					 entity.setClientAbbreviation(split[0]);
+				 }
+
+				 //转map
+				 Field[] fields = entity.getClass().getDeclaredFields();
+				 for (Field field : fields) {
+					 field.setAccessible(true);
+					 map.put(field.getName(), field.get(entity));
+				 }
+				 //集合转map
+				 for(SyShippingOrderItem li:list){
+					 Field[] fieldsList = li.getClass().getDeclaredFields();
+					 Map<String, Object> mapList = new HashMap<String, Object>();
+					 for (Field field : fieldsList) {
+						 field.setAccessible(true);
+						 mapList.put(field.getName(), field.get(li));
+					 }
+					 listMap.add(mapList);
+				 }
+
+				 map.put("item", listMap);
+				 map.put("list", taitouList);
+
+				 TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
+
+
 				 Workbook workbook = ExcelExportUtil.exportExcel(params,map);
 				 ServletOutputStream outputStream = response.getOutputStream();
 				 workbook.write(outputStream);