|
@@ -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);
|