|
@@ -669,119 +669,115 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
}
|
|
|
|
|
|
|
|
|
+ if (testName.equals("报关信息-报关单")) {
|
|
|
+ int size = 0;
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
- //String[] nameList = new String[]{"报关信息-报关单","报关信息-申报要素-成衣","报关信息-发票","报关信息-合同","报关信息-申报要素-面料","报关信息-装箱单"};
|
|
|
-
|
|
|
- if(testName.equals("报关信息-报关单")){
|
|
|
- int size = 0;
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
|
|
|
-
|
|
|
- //转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){
|
|
|
- size++;
|
|
|
- Field[] fieldsList = li.getClass().getDeclaredFields();
|
|
|
- Map<String, Object> mapList = new HashMap<String, Object>();
|
|
|
- for (Field field : fieldsList) {
|
|
|
+ //转map
|
|
|
+ Field[] fields = entity.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
field.setAccessible(true);
|
|
|
- mapList.put(field.getName(), field.get(li));
|
|
|
+ map.put(field.getName(), field.get(entity));
|
|
|
}
|
|
|
- mapList.put("size",size);
|
|
|
- listMap.add(mapList);
|
|
|
- }
|
|
|
- map.put("item", listMap);
|
|
|
-
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params,map);
|
|
|
-
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
-
|
|
|
- workbook.write(outputStream);
|
|
|
+ //集合转map
|
|
|
+ for (SyShippingOrderItem li : list) {
|
|
|
+ size++;
|
|
|
+ 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));
|
|
|
+ }
|
|
|
+ mapList.put("size", size);
|
|
|
+ listMap.add(mapList);
|
|
|
+ }
|
|
|
+ map.put("item", listMap);
|
|
|
+
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
+
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+
|
|
|
+ workbook.write(outputStream);
|
|
|
+
|
|
|
+ } else if (testName.equals("报关信息-申报要素")) {
|
|
|
+
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
+
|
|
|
+ QueryWrapper<SyShippingOrderItem> queryWrapper = new QueryWrapper<>();
|
|
|
+ queryWrapper.eq("sy_shipping_order_item_id", entity.getId()).eq("del_flag", 0).groupBy("elements_Id");
|
|
|
+ List<SyShippingOrderItem> itemList = syShippingOrderItemService.list(queryWrapper);
|
|
|
+
|
|
|
+ int i = 1;
|
|
|
+ for (SyShippingOrderItem li : itemList) {
|
|
|
+ map.put("name", "没用" + li.getReadyFabric());
|
|
|
+
|
|
|
+ Map<String, Object> map1 = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> map3 = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> map4 = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> map5 = new HashMap<String, Object>();
|
|
|
+ Map<String, Object> map6 = new HashMap<String, Object>();
|
|
|
+
|
|
|
+ //查询主表
|
|
|
+ SyDeclarationElements elementEntity = syDeclarationElementsService.getById(li.getElementsId());
|
|
|
+ //查询子表
|
|
|
+ QueryWrapper<SyDeclarationElementsItem> itemQueryWrapper = new QueryWrapper<>();
|
|
|
+ itemQueryWrapper.eq("sy_declaration_elements_id", li.getElementsId()).eq("del_flag", 0).orderByAsc("create_time");
|
|
|
+ List<SyDeclarationElementsItem> itemList1 = syDeclarationElementsItemService.list(itemQueryWrapper);
|
|
|
+ if (itemList1.size() == 0) {
|
|
|
+ map1.put("name", i + "、商品编码:");
|
|
|
+ map1.put("value", "");
|
|
|
+ listMap.add(map1);
|
|
|
+
|
|
|
+ map3.put("name", "商品描述:");
|
|
|
+ map3.put("value", "");
|
|
|
+ listMap.add(map3);
|
|
|
+
|
|
|
+ map4.put("name", "申报要素:");
|
|
|
+ map4.put("value", "");
|
|
|
+ listMap.add(map4);
|
|
|
+ } else {
|
|
|
+ map1.put("name", i + "、商品编码:");
|
|
|
+ map1.put("value", elementEntity.getHsCode());
|
|
|
+ listMap.add(map1);
|
|
|
+
|
|
|
+ map3.put("name", "商品描述:");
|
|
|
+ map3.put("value", "");
|
|
|
+ listMap.add(map3);
|
|
|
+
|
|
|
+ map4.put("name", "申报要素:");
|
|
|
+ map4.put("value", "");
|
|
|
+ listMap.add(map4);
|
|
|
+
|
|
|
+ int m = 1;
|
|
|
+ for (SyDeclarationElementsItem li1 : itemList1) {
|
|
|
+ Map<String, Object> map2 = new HashMap<String, Object>();
|
|
|
+ if (li1.getTypeValue().equals("品名")) {
|
|
|
+ li1.setDescribeText(elementEntity.getDeclarationName());
|
|
|
+ }
|
|
|
+ map2.put("name", m + "、" + li1.getTypeValue() + ":");
|
|
|
+ map2.put("value", li1.getDescribeText());
|
|
|
+ listMap.add(map2);
|
|
|
+ m++;
|
|
|
+ }
|
|
|
+ i++;
|
|
|
|
|
|
- }
|
|
|
- else if(testName.equals("报关信息-申报要素")){
|
|
|
-
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
|
|
|
-
|
|
|
- QueryWrapper<SyShippingOrderItem> queryWrapper = new QueryWrapper<>();
|
|
|
- queryWrapper.eq("sy_shipping_order_item_id",entity.getId()).eq("del_flag",0).groupBy("elements_Id");
|
|
|
- List<SyShippingOrderItem> itemList = syShippingOrderItemService.list(queryWrapper);
|
|
|
-
|
|
|
- int i = 1;
|
|
|
- for(SyShippingOrderItem li:itemList) {
|
|
|
- map.put("name", "没用" + li.getReadyFabric());
|
|
|
-
|
|
|
- Map<String, Object> map1 = new HashMap<String, Object>();
|
|
|
- Map<String, Object> map3 = new HashMap<String, Object>();
|
|
|
- Map<String, Object> map4 = new HashMap<String, Object>();
|
|
|
- Map<String, Object> map5 = new HashMap<String, Object>();
|
|
|
- Map<String, Object> map6 = new HashMap<String, Object>();
|
|
|
-
|
|
|
- //查询主表
|
|
|
- SyDeclarationElements elementEntity = syDeclarationElementsService.getById(li.getElementsId());
|
|
|
- //查询子表
|
|
|
- QueryWrapper<SyDeclarationElementsItem> itemQueryWrapper = new QueryWrapper<>();
|
|
|
- itemQueryWrapper.eq("sy_declaration_elements_id", li.getElementsId()).eq("del_flag", 0).orderByAsc("create_time");
|
|
|
- List<SyDeclarationElementsItem> itemList1 = syDeclarationElementsItemService.list(itemQueryWrapper);
|
|
|
- if (itemList1.size() == 0) {
|
|
|
- map1.put("name", i + "、商品编码:");
|
|
|
- map1.put("value", "");
|
|
|
- listMap.add(map1);
|
|
|
-
|
|
|
- map3.put("name", "商品描述:");
|
|
|
- map3.put("value", "");
|
|
|
- listMap.add(map3);
|
|
|
-
|
|
|
- map4.put("name", "申报要素:");
|
|
|
- map4.put("value", "");
|
|
|
- listMap.add(map4);
|
|
|
- } else {
|
|
|
- map1.put("name", i + "、商品编码:");
|
|
|
- map1.put("value", elementEntity.getHsCode());
|
|
|
- listMap.add(map1);
|
|
|
-
|
|
|
- map3.put("name", "商品描述:");
|
|
|
- map3.put("value", "");
|
|
|
- listMap.add(map3);
|
|
|
-
|
|
|
- map4.put("name", "申报要素:");
|
|
|
- map4.put("value", "");
|
|
|
- listMap.add(map4);
|
|
|
-
|
|
|
- int m = 1;
|
|
|
- for (SyDeclarationElementsItem li1 : itemList1) {
|
|
|
- Map<String, Object> map2 = new HashMap<String, Object>();
|
|
|
- if (li1.getTypeValue().equals("品名")) {
|
|
|
- li1.setDescribeText(elementEntity.getDeclarationName());
|
|
|
- }
|
|
|
- map2.put("name", m + "、" + li1.getTypeValue() + ":");
|
|
|
- map2.put("value", li1.getDescribeText());
|
|
|
- listMap.add(map2);
|
|
|
- m++;
|
|
|
- }
|
|
|
- i++;
|
|
|
-
|
|
|
- map6.put("name", "等......");
|
|
|
- map6.put("value", "");
|
|
|
- listMap.add(map6);
|
|
|
- map5.put("name", "");
|
|
|
- map5.put("value", "");
|
|
|
- listMap.add(map5);
|
|
|
+ map6.put("name", "等......");
|
|
|
+ map6.put("value", "");
|
|
|
+ listMap.add(map6);
|
|
|
+ map5.put("name", "");
|
|
|
+ map5.put("value", "");
|
|
|
+ listMap.add(map5);
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- map.put("readyFabric",readyFabric);
|
|
|
- map.put("list", listMap);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("readyFabric", readyFabric);
|
|
|
+ map.put("list", listMap);
|
|
|
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params,map);
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
// else if(testName.equals("报关信息-申报要素-面料")){
|
|
|
//
|
|
|
// List<Map<String, Object>> listMap1 = new ArrayList<Map<String, Object>>();
|
|
@@ -853,211 +849,276 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
// workbook.write(outputStream);
|
|
|
//
|
|
|
// }
|
|
|
- else if(testName.equals("报关信息-发票")){
|
|
|
-
|
|
|
- List<Map<String,Object>> maiTouList = new ArrayList<Map<String,Object>>();
|
|
|
-
|
|
|
- boolean boo = true;
|
|
|
- //重新赋值
|
|
|
- entity.setLatestDateOfShipment(sf.format(date));
|
|
|
- //出口口岸转大写拼音
|
|
|
- String exportPort = py.toPinYin(entity.getExportPort());
|
|
|
- entity.setExportPort(exportPort);
|
|
|
- //目的港+,+运抵国别转英文
|
|
|
- //查询数据字典获取英文
|
|
|
- List<DictModel> sysDicts = sysDictService.queryDictItemsByCode("port_of_destination");
|
|
|
- for(DictModel di:sysDicts){
|
|
|
- if(di.getText().equals(entity.getDestinationPort())){
|
|
|
- entity.setDestinationPort(di.getValue());
|
|
|
+ else if (testName.equals("报关信息-发票")) {
|
|
|
+
|
|
|
+ List<Map<String, Object>> maiTouList = new ArrayList<Map<String, Object>>();
|
|
|
+
|
|
|
+ boolean boo = true;
|
|
|
+ //重新赋值
|
|
|
+ entity.setLatestDateOfShipment(sf.format(date));
|
|
|
+ //出口口岸转大写拼音
|
|
|
+ String exportPort = py.toPinYin(entity.getExportPort());
|
|
|
+ entity.setExportPort(exportPort);
|
|
|
+ //目的港+,+运抵国别转英文
|
|
|
+ //查询数据字典获取英文
|
|
|
+ List<DictModel> sysDicts = sysDictService.queryDictItemsByCode("port_of_destination");
|
|
|
+ for (DictModel di : sysDicts) {
|
|
|
+ if (di.getText().equals(entity.getDestinationPort())) {
|
|
|
+ entity.setDestinationPort(di.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- List<DictModel> sysDicts1 = sysDictService.queryDictItemsByCode("country_of_arrival");
|
|
|
- for(DictModel di:sysDicts1){
|
|
|
- if(di.getText().equals(entity.getArriveInCountry())){
|
|
|
- entity.setArriveInCountry(di.getValue());
|
|
|
+ List<DictModel> sysDicts1 = sysDictService.queryDictItemsByCode("country_of_arrival");
|
|
|
+ for (DictModel di : sysDicts1) {
|
|
|
+ if (di.getText().equals(entity.getArriveInCountry())) {
|
|
|
+ entity.setArriveInCountry(di.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- if(oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
|
|
|
- //查询数据字典唛头
|
|
|
- List<DictModel> test = sysDictService.queryDictItemsByCode("test0902002");
|
|
|
- for (DictModel di : test) {
|
|
|
- if (di.getText().equals(list.get(0).getClientAbbreviation())) {
|
|
|
- String split[] = di.getValue().split("\\+");
|
|
|
- for (int i = 0; i < split.length; i++) {
|
|
|
- Map<String, Object> maiTou = new HashMap<>();
|
|
|
- maiTou.put("name", split[i]);
|
|
|
- maiTouList.add(maiTou);
|
|
|
+ if (oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
|
|
|
+ //查询数据字典唛头
|
|
|
+ List<DictModel> test = sysDictService.queryDictItemsByCode("test0902002");
|
|
|
+ for (DictModel di : test) {
|
|
|
+ if (di.getText().equals(list.get(0).getClientAbbreviation())) {
|
|
|
+ String split[] = di.getValue().split("\\+");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
+ maiTou.put("name", split[i]);
|
|
|
+ maiTouList.add(maiTou);
|
|
|
+ }
|
|
|
+ boo = false;
|
|
|
}
|
|
|
- boo = false;
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- if(boo == true){
|
|
|
- Map<String,Object> maiTou = new HashMap<>();
|
|
|
- maiTou.put("name", " ");
|
|
|
- maiTouList.add(maiTou);
|
|
|
- }
|
|
|
+ if (boo == true) {
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
+ maiTou.put("name", " ");
|
|
|
+ maiTouList.add(maiTou);
|
|
|
+ }
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
- //转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) {
|
|
|
+ //转map
|
|
|
+ Field[] fields = entity.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
field.setAccessible(true);
|
|
|
- mapList.put(field.getName(), field.get(li));
|
|
|
+ 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);
|
|
|
}
|
|
|
- listMap.add(mapList);
|
|
|
- }
|
|
|
|
|
|
- map.put("item", listMap);
|
|
|
- map.put("list",maiTouList);
|
|
|
+ map.put("item", listMap);
|
|
|
+ map.put("list", maiTouList);
|
|
|
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params,map);
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
|
|
|
|
|
|
- }else if(testName.equals("报关信息-合同")){
|
|
|
+ } else if (testName.equals("报关信息-合同")) {
|
|
|
|
|
|
- //获取当前日期减去60天
|
|
|
- Calendar calendar = Calendar.getInstance();
|
|
|
- calendar.setTime(date);
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH,-60);
|
|
|
- String dateTime = sf.format(calendar.getTime());
|
|
|
- Date locale = sf.parse(dateTime);
|
|
|
- SimpleDateFormat sdf1 = new SimpleDateFormat("MMM'.'dd'th,' yyyy", Locale.UK); // 月日年
|
|
|
- entity.setDateTime(sdf1.format(locale));
|
|
|
+ //获取当前日期减去60天
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(date);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
+ String dateTime = sf.format(calendar.getTime());
|
|
|
+ Date locale = sf.parse(dateTime);
|
|
|
+ SimpleDateFormat sdf1 = new SimpleDateFormat("MMM'.'dd'th,' yyyy", Locale.UK); // 月日年
|
|
|
+ entity.setDateTime(sdf1.format(locale));
|
|
|
|
|
|
- //出口口岸转大写拼音
|
|
|
- String exportPort = py.toPinYin(entity.getExportPort());
|
|
|
- entity.setExportPort(exportPort);
|
|
|
+ //出口口岸转大写拼音
|
|
|
+ String exportPort = py.toPinYin(entity.getExportPort());
|
|
|
+ entity.setExportPort(exportPort);
|
|
|
|
|
|
- //目的港+,+运抵国别转英文
|
|
|
- //查询数据字典获取英文
|
|
|
- List<DictModel> sysDicts = sysDictService.queryDictItemsByCode("port_of_destination");
|
|
|
- for(DictModel di:sysDicts){
|
|
|
- if(di.getText().equals(entity.getDestinationPort())){
|
|
|
- entity.setDestinationPort(di.getValue());
|
|
|
+ //目的港+,+运抵国别转英文
|
|
|
+ //查询数据字典获取英文
|
|
|
+ List<DictModel> sysDicts = sysDictService.queryDictItemsByCode("port_of_destination");
|
|
|
+ for (DictModel di : sysDicts) {
|
|
|
+ if (di.getText().equals(entity.getDestinationPort())) {
|
|
|
+ entity.setDestinationPort(di.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- List<DictModel> sysDicts1 = sysDictService.queryDictItemsByCode("country_of_arrival");
|
|
|
- for(DictModel di:sysDicts1){
|
|
|
- if(di.getText().equals(entity.getArriveInCountry())){
|
|
|
- entity.setArriveInCountry(di.getValue());
|
|
|
+ List<DictModel> sysDicts1 = sysDictService.queryDictItemsByCode("country_of_arrival");
|
|
|
+ for (DictModel di : sysDicts1) {
|
|
|
+ if (di.getText().equals(entity.getArriveInCountry())) {
|
|
|
+ entity.setArriveInCountry(di.getValue());
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
- //转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) {
|
|
|
+ //转map
|
|
|
+ Field[] fields = entity.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
field.setAccessible(true);
|
|
|
- mapList.put(field.getName(), field.get(li));
|
|
|
+ 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);
|
|
|
}
|
|
|
- listMap.add(mapList);
|
|
|
- }
|
|
|
|
|
|
- map.put("item", listMap);
|
|
|
+ map.put("item", listMap);
|
|
|
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params,map);
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
|
|
|
|
|
|
- }else if(testName.equals("报关信息-装箱单")){
|
|
|
- List<Map<String,Object>> maiTouList = new ArrayList<>();
|
|
|
- boolean boo = true;
|
|
|
+ } else if (testName.equals("报关信息-合同-面料")) {
|
|
|
|
|
|
- entity.setDateTime(sf.format(date));
|
|
|
+ //获取当前日期减去60天
|
|
|
+ Calendar calendar = Calendar.getInstance();
|
|
|
+ calendar.setTime(date);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
+ String dateTime = sf.format(calendar.getTime());
|
|
|
+ Date locale = sf.parse(dateTime);
|
|
|
+ SimpleDateFormat sdf1 = new SimpleDateFormat("MMM'.'dd'th,' yyyy", Locale.UK); // 月日年
|
|
|
+ entity.setDateTime(sdf1.format(locale));
|
|
|
|
|
|
- //出口口岸中文
|
|
|
- entity.setExportPortName(entity.getExportPort());
|
|
|
- //出口口岸转大写拼音
|
|
|
- String exportPort = py.toPinYin(entity.getExportPort());
|
|
|
- entity.setExportPort(exportPort);
|
|
|
+ //出口口岸转大写拼音
|
|
|
+ String exportPort = py.toPinYin(entity.getExportPort());
|
|
|
+ entity.setExportPort(exportPort);
|
|
|
|
|
|
- if(oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
|
|
|
- //查询数据字典唛头
|
|
|
- List<DictModel> test = sysDictService.queryDictItemsByCode("test0902002");
|
|
|
- for (DictModel di : test) {
|
|
|
- if (di.getText().equals(list.get(0).getClientAbbreviation())) {
|
|
|
- String split[] = di.getValue().split("\\+");
|
|
|
- for (int i = 0; i < split.length; i++) {
|
|
|
- Map<String, Object> maiTou = new HashMap<>();
|
|
|
- maiTou.put("name", split[i]);
|
|
|
- maiTouList.add(maiTou);
|
|
|
- }
|
|
|
- boo = false;
|
|
|
+ //目的港+,+运抵国别转英文
|
|
|
+ //查询数据字典获取英文
|
|
|
+ List<DictModel> sysDicts = sysDictService.queryDictItemsByCode("port_of_destination");
|
|
|
+ for (DictModel di : sysDicts) {
|
|
|
+ if (di.getText().equals(entity.getDestinationPort())) {
|
|
|
+ entity.setDestinationPort(di.getValue());
|
|
|
}
|
|
|
+ }
|
|
|
+ List<DictModel> sysDicts1 = sysDictService.queryDictItemsByCode("country_of_arrival");
|
|
|
+ for (DictModel di : sysDicts1) {
|
|
|
+ if (di.getText().equals(entity.getArriveInCountry())) {
|
|
|
+ entity.setArriveInCountry(di.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
+
|
|
|
+ //转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);
|
|
|
}
|
|
|
- }
|
|
|
- if(boo == true){
|
|
|
- Map<String,Object> maiTou = new HashMap<>();
|
|
|
- maiTou.put("name", " ");
|
|
|
- maiTouList.add(maiTou);
|
|
|
- }
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
|
|
|
+ map.put("item", listMap);
|
|
|
+
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
+
|
|
|
+
|
|
|
+ }else if (testName.equals("报关信息-装箱单")) {
|
|
|
+ List<Map<String, Object>> maiTouList = new ArrayList<>();
|
|
|
+ boolean boo = true;
|
|
|
+
|
|
|
+ entity.setDateTime(sf.format(date));
|
|
|
+
|
|
|
+ //出口口岸中文
|
|
|
+ entity.setExportPortName(entity.getExportPort());
|
|
|
+ //出口口岸转大写拼音
|
|
|
+ String exportPort = py.toPinYin(entity.getExportPort());
|
|
|
+ entity.setExportPort(exportPort);
|
|
|
+
|
|
|
+ if (oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
|
|
|
+ //查询数据字典唛头
|
|
|
+ List<DictModel> test = sysDictService.queryDictItemsByCode("test0902002");
|
|
|
+ for (DictModel di : test) {
|
|
|
+ if (di.getText().equals(list.get(0).getClientAbbreviation())) {
|
|
|
+ String split[] = di.getValue().split("\\+");
|
|
|
+ for (int i = 0; i < split.length; i++) {
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
+ maiTou.put("name", split[i]);
|
|
|
+ maiTouList.add(maiTou);
|
|
|
+ }
|
|
|
+ boo = false;
|
|
|
+ }
|
|
|
|
|
|
- //转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) {
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (boo == true) {
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
+ maiTou.put("name", " ");
|
|
|
+ maiTouList.add(maiTou);
|
|
|
+ }
|
|
|
+
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
+
|
|
|
+ //转map
|
|
|
+ Field[] fields = entity.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
field.setAccessible(true);
|
|
|
- mapList.put(field.getName(), field.get(li));
|
|
|
+ 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);
|
|
|
}
|
|
|
- listMap.add(mapList);
|
|
|
- }
|
|
|
|
|
|
- map.put("item", listMap);
|
|
|
- map.put("list", maiTouList);
|
|
|
+ map.put("item", listMap);
|
|
|
+ map.put("list", maiTouList);
|
|
|
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params,map);
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ workbook.write(outputStream);
|
|
|
|
|
|
- }else if(testName.equals("报关信息-结汇发票")){
|
|
|
+ } else if (testName.equals("报关信息-结汇发票")) {
|
|
|
|
|
|
- List<Map<String,Object>> taitouList = new ArrayList<>();
|
|
|
+ List<Map<String, Object>> taitouList = new ArrayList<>();
|
|
|
|
|
|
- //查询数据字典-公司抬头
|
|
|
- List<DictModel> test = sysDictService.queryDictItemsByCode("company_title");
|
|
|
+ //查询数据字典-公司抬头
|
|
|
+ List<DictModel> test = sysDictService.queryDictItemsByCode("company_title");
|
|
|
|
|
|
- if(oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
|
|
|
- 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);
|
|
|
+ if (oConvertUtils.isNotEmpty(list.get(0).getClientAbbreviation())) {
|
|
|
+ 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]);
|
|
|
}
|
|
|
- entity.setClientAbbreviation(split[0]);
|
|
|
} else {
|
|
|
String split[] = test.get(1).getValue().split("\\+");
|
|
|
for (int i = 0; i < split.length; i++) {
|
|
@@ -1067,43 +1128,68 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
}
|
|
|
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);
|
|
|
+
|
|
|
+ //转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);
|
|
|
}
|
|
|
- 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.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);
|
|
|
}
|
|
|
- //集合转map
|
|
|
- for(SyShippingOrderItem li:list){
|
|
|
- Field[] fieldsList = li.getClass().getDeclaredFields();
|
|
|
- Map<String, Object> mapList = new HashMap<String, Object>();
|
|
|
- for (Field field : fieldsList) {
|
|
|
+
|
|
|
+ if (testName.equals("报关信息-报关单-面料")) {
|
|
|
+ int size = 0;
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
+
|
|
|
+ //转map
|
|
|
+ Field[] fields = entity.getClass().getDeclaredFields();
|
|
|
+ for (Field field : fields) {
|
|
|
field.setAccessible(true);
|
|
|
- mapList.put(field.getName(), field.get(li));
|
|
|
+ map.put(field.getName(), field.get(entity));
|
|
|
}
|
|
|
- listMap.add(mapList);
|
|
|
- }
|
|
|
+ //集合转map
|
|
|
+ for (SyShippingOrderItem li : list) {
|
|
|
+ li.setTotalPrice(li.getNetWeight().multiply(li.getUnitPrice()));//重新计算金额 = 净重*单价
|
|
|
+ size++;
|
|
|
+ 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));
|
|
|
+ }
|
|
|
+ mapList.put("size", size);
|
|
|
+ listMap.add(mapList);
|
|
|
+ }
|
|
|
+ map.put("item", listMap);
|
|
|
|
|
|
- map.put("item", listMap);
|
|
|
- map.put("list", taitouList);
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
|
|
+ workbook.write(outputStream);
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params,map);
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
- }
|
|
|
|
|
|
result.setSuccess(true);
|
|
|
result.setMessage("导出成功,请往桌面查看!");
|