|
@@ -559,7 +559,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
@AutoLog(value = "发票打印")
|
|
@AutoLog(value = "发票打印")
|
|
@ApiOperation(value = "发票打印")
|
|
@ApiOperation(value = "发票打印")
|
|
@RequestMapping(value = "/syShippingOrderPrint")
|
|
@RequestMapping(value = "/syShippingOrderPrint")
|
|
- public Result<SyShippingOrder> syShippingOrderPrint(String id,String testName,HttpServletResponse response) throws ParseException {
|
|
|
|
|
|
+ public Result<SyShippingOrder> syShippingOrderPrint(String id,String testName,String isAhaa,HttpServletResponse response) throws ParseException {
|
|
|
|
|
|
Result<SyShippingOrder> result= new Result<SyShippingOrder>();
|
|
Result<SyShippingOrder> result= new Result<SyShippingOrder>();
|
|
String readyFabric = "";
|
|
String readyFabric = "";
|
|
@@ -582,6 +582,9 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
//获取当前时间
|
|
//获取当前时间
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ SimpleDateFormat sdf1 = new SimpleDateFormat("MMM'.'dd'th,' yyyy", Locale.UK); // 月日年
|
|
|
|
+ //获取对应模板
|
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
TopinYin py = new TopinYin();
|
|
TopinYin py = new TopinYin();
|
|
|
|
|
|
@@ -672,10 +675,10 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
entity.setDestinationPort(" ");
|
|
entity.setDestinationPort(" ");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(isAhaa.equals("国内")){
|
|
|
|
|
|
if (testName.equals("报关信息-报关单")) {
|
|
if (testName.equals("报关信息-报关单")) {
|
|
int size = 0;
|
|
int size = 0;
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
|
|
//转map
|
|
//转map
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
@@ -705,7 +708,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
|
|
|
} else if (testName.equals("报关信息-申报要素")) {
|
|
} else if (testName.equals("报关信息-申报要素")) {
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
+
|
|
List<String> elmentid = new ArrayList<>();
|
|
List<String> elmentid = new ArrayList<>();
|
|
|
|
|
|
// QueryWrapper<SyShippingOrderItem> queryWrapper = new QueryWrapper<>();
|
|
// QueryWrapper<SyShippingOrderItem> queryWrapper = new QueryWrapper<>();
|
|
@@ -793,77 +796,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
workbook.write(outputStream);
|
|
workbook.write(outputStream);
|
|
|
|
|
|
}
|
|
}
|
|
-// else if(testName.equals("报关信息-申报要素-面料")){
|
|
|
|
-//
|
|
|
|
-// List<Map<String, Object>> listMap1 = new ArrayList<Map<String, Object>>();
|
|
|
|
-//
|
|
|
|
-// 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>();
|
|
|
|
-//
|
|
|
|
-// //查询主表
|
|
|
|
-// SyDeclarationElements elementEntity = syDeclarationElementsService.getById(li.getElementsId());
|
|
|
|
-// //查询子表
|
|
|
|
-// QueryWrapper<SyDeclarationElementsItem> itemQueryWrapper = new QueryWrapper<>();
|
|
|
|
-// itemQueryWrapper.eq("sy_declaration_elements_id",li.getElementsId()).eq("del_flag",0);
|
|
|
|
-// List<SyDeclarationElementsItem> itemList1 = syDeclarationElementsItemService.list(itemQueryWrapper);
|
|
|
|
-//
|
|
|
|
-// map1.put("name",i+"、商品税号:");
|
|
|
|
-// map1.put("value",elementEntity.getHsCode());
|
|
|
|
-// map1.put("text","");
|
|
|
|
-// listMap.add(map1);
|
|
|
|
-//
|
|
|
|
-// map3.put("name","商品名称:");
|
|
|
|
-// map3.put("value",elementEntity.getInventoryName());
|
|
|
|
-// map3.put("text","");
|
|
|
|
-// listMap.add(map3);
|
|
|
|
-//
|
|
|
|
-// map4.put("name","申报要素项数");
|
|
|
|
-// map4.put("value","申报要素内容");
|
|
|
|
-// map4.put("text","");
|
|
|
|
-// listMap.add(map4);
|
|
|
|
-//
|
|
|
|
-// int m = 0;
|
|
|
|
-// for(SyDeclarationElementsItem li1:itemList1){
|
|
|
|
-// Map<String, Object> map2 = new HashMap<String, Object>();
|
|
|
|
-// if(li1.getTypeValue().equals("品名")){
|
|
|
|
-// li1.setDescribeText(elementEntity.getDeclarationName());
|
|
|
|
-// map2.put("name","");
|
|
|
|
-// map2.put("value",li1.getTypeValue());
|
|
|
|
-// map2.put("text",li1.getDescribeText());
|
|
|
|
-// listMap.add(map2);
|
|
|
|
-// }else {
|
|
|
|
-// map2.put("name", m);
|
|
|
|
-// map2.put("value", li1.getTypeValue());
|
|
|
|
-// map2.put("text", li1.getDescribeText());
|
|
|
|
-// listMap.add(map2);
|
|
|
|
-// m++;
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// i++;
|
|
|
|
-//
|
|
|
|
-// map5.put("name","");
|
|
|
|
-// map5.put("value","");
|
|
|
|
-// listMap.add(map5);
|
|
|
|
-// }
|
|
|
|
-// map.put("list", listMap);
|
|
|
|
-//
|
|
|
|
-// Workbook workbook = ExcelExportUtil.exportExcel(params,map);
|
|
|
|
-// ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
-// workbook.write(outputStream);
|
|
|
|
-//
|
|
|
|
-// }
|
|
|
|
|
|
+
|
|
else if (testName.equals("报关信息-发票") || testName.equals("报关信息-发票-面料")) {
|
|
else if (testName.equals("报关信息-发票") || testName.equals("报关信息-发票-面料")) {
|
|
|
|
|
|
List<Map<String, Object>> maiTouList = new ArrayList<Map<String, Object>>();
|
|
List<Map<String, Object>> maiTouList = new ArrayList<Map<String, Object>>();
|
|
@@ -910,7 +843,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
maiTouList.add(maiTou);
|
|
maiTouList.add(maiTou);
|
|
}
|
|
}
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
|
|
//转map
|
|
//转map
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
@@ -945,7 +877,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
String dateTime = sf.format(calendar.getTime());
|
|
String dateTime = sf.format(calendar.getTime());
|
|
Date locale = sf.parse(dateTime);
|
|
Date locale = sf.parse(dateTime);
|
|
- SimpleDateFormat sdf1 = new SimpleDateFormat("MMM'.'dd'th,' yyyy", Locale.UK); // 月日年
|
|
|
|
|
|
+
|
|
entity.setDateTime(sdf1.format(locale));
|
|
entity.setDateTime(sdf1.format(locale));
|
|
|
|
|
|
//出口口岸转大写拼音
|
|
//出口口岸转大写拼音
|
|
@@ -967,7 +899,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
|
|
//转map
|
|
//转map
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
@@ -1028,8 +959,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
maiTouList.add(maiTou);
|
|
maiTouList.add(maiTou);
|
|
}
|
|
}
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
-
|
|
|
|
//转map
|
|
//转map
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
for (Field field : fields) {
|
|
for (Field field : fields) {
|
|
@@ -1118,8 +1047,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
map.put("item", listMap);
|
|
map.put("item", listMap);
|
|
map.put("list", taitouList);
|
|
map.put("list", taitouList);
|
|
|
|
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
-
|
|
|
|
|
|
|
|
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
@@ -1128,7 +1055,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
|
|
|
if (testName.equals("报关信息-报关单-面料")) {
|
|
if (testName.equals("报关信息-报关单-面料")) {
|
|
int size = 0;
|
|
int size = 0;
|
|
- TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\" + testName + ".xlsx");
|
|
|
|
|
|
|
|
//转map
|
|
//转map
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
Field[] fields = entity.getClass().getDeclaredFields();
|
|
@@ -1161,12 +1087,212 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //国外
|
|
|
|
+ }else{
|
|
|
|
+ if (testName.equals("国外-报关信息-装箱单")) {
|
|
|
|
+
|
|
|
|
+ List<Map<String, Object>> maiTouList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ boolean boo = true;
|
|
|
|
+
|
|
|
|
+ entity.setDateTime(sdf1.format(entity.getShippingOrderDate()));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (boo == true) {
|
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
|
+ maiTou.put("name", " ");
|
|
|
|
+ maiTouList.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);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ 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<SyShippingOrderItem> listItem = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ List<Map<String, Object>> maiTouList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ boolean boo = true;
|
|
|
|
+
|
|
|
|
+ entity.setDateTime(sdf1.format(entity.getShippingOrderDate()));
|
|
|
|
+
|
|
|
|
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (boo == true) {
|
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
|
+ maiTou.put("name", " ");
|
|
|
|
+ maiTouList.add(maiTou);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ BigDecimal sumMoneyGw = BigDecimal.ZERO;
|
|
|
|
+ //增加同样数据
|
|
|
|
+ for (SyShippingOrderItem li : list) {
|
|
|
|
+
|
|
|
|
+ li.setHscodeGw("HS CODE:"+li.getHsCode());
|
|
|
|
+ li.setNumberGw("");
|
|
|
|
+ li.setPcsGw("");
|
|
|
|
+ li.setPoGw(li.getEnglishProductName());
|
|
|
|
+ li.setItemNumberGw("");
|
|
|
|
+ li.setUsdGw("");
|
|
|
|
+ li.setPriceGw("");
|
|
|
|
+ li.setPcGw("");
|
|
|
|
+ li.setMoneyGw("");
|
|
|
|
+ li.setCmpGw("CMP");
|
|
|
|
+ li.setTotalMoneyGw("");
|
|
|
|
+ listItem.add(li);
|
|
|
|
+
|
|
|
|
+ SyShippingOrderItem newEntity = new SyShippingOrderItem();
|
|
|
|
+ newEntity.setHscodeGw("");
|
|
|
|
+ Integer numberInt = li.getNumber().intValue() ;
|
|
|
|
+ newEntity.setNumberGw(numberInt.toString());
|
|
|
|
+ newEntity.setPcsGw("PCS");
|
|
|
|
+ newEntity.setPoGw(li.getSmailPo());
|
|
|
|
+ newEntity.setItemNumberGw(li.getStyleNumber());
|
|
|
|
+ newEntity.setUsdGw(li.getCurr());
|
|
|
|
+ newEntity.setPriceGw(li.getUnitPrice().toString());
|
|
|
|
+ newEntity.setPcGw("/PC");
|
|
|
|
+ newEntity.setMoneyGw(li.getTotalPrice().toString());
|
|
|
|
+ newEntity.setCmpGw(li.getFactoryUnitPrice());
|
|
|
|
+ BigDecimal m = new BigDecimal(li.getFactoryUnitPrice()).multiply(li.getNumber());
|
|
|
|
+ newEntity.setTotalMoneyGw(m.setScale(2,BigDecimal.ROUND_HALF_UP).toString());
|
|
|
|
+ sumMoneyGw = sumMoneyGw.add(new BigDecimal(newEntity.getTotalMoneyGw()));
|
|
|
|
+ listItem.add(newEntity);
|
|
|
|
+ }
|
|
|
|
+ entity.setSumMoneyGw(sumMoneyGw.toString());
|
|
|
|
+ //转map
|
|
|
|
+ Field[] fields = entity.getClass().getDeclaredFields();
|
|
|
|
+ for (Field field : fields) {
|
|
|
|
+ field.setAccessible(true);
|
|
|
|
+ map.put(field.getName(), field.get(entity));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //集合转map
|
|
|
|
+ for (SyShippingOrderItem li : listItem) {
|
|
|
|
+ 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", maiTouList);
|
|
|
|
+
|
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
+ workbook.write(outputStream);
|
|
|
|
+
|
|
|
|
+ }else if(testName.equals("国外-报关信息")){
|
|
|
|
+ List<Map<String,Object>> mergeMap = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ entity.setDateTime(sdf1.format(entity.getShippingOrderDate()));
|
|
|
|
+
|
|
|
|
+ //转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);
|
|
|
|
+
|
|
|
|
+ //根据款号合并
|
|
|
|
+ List<SyShippingOrderItem> mergeStyleNumberList = syShippingOrderMapper.mergeStyleNumber(id);
|
|
|
|
+ for(SyShippingOrderItem li:mergeStyleNumberList){
|
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
|
+ Map<String, Object> maiTou1 = new HashMap<>();
|
|
|
|
+ Map<String, Object> maiTou2 = new HashMap<>();
|
|
|
|
+ maiTou.put("style","Style#:");
|
|
|
|
+ maiTou.put("mergeStyleNumber",li.getStyleNumber());
|
|
|
|
+ mergeMap.add(maiTou);
|
|
|
|
+ maiTou1.put("style","Description:");
|
|
|
|
+ maiTou1.put("mergeStyleNumber",li.getEnglishName()+" HS CODE:"+li.getHsCode());
|
|
|
|
+ mergeMap.add(maiTou1);
|
|
|
|
+ maiTou2.put("style"," ");
|
|
|
|
+ maiTou2.put("mergeStyleNumber"," ");
|
|
|
|
+ mergeMap.add(maiTou2);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ map.put("list", mergeMap);
|
|
|
|
+
|
|
|
|
+ Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
|
+ workbook.write(outputStream);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
result.setSuccess(true);
|
|
result.setSuccess(true);
|
|
result.setMessage("导出成功,请往桌面查看!");
|
|
result.setMessage("导出成功,请往桌面查看!");
|
|
result.setResult(entity);
|
|
result.setResult(entity);
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}catch (Exception ex){
|
|
}catch (Exception ex){
|
|
|
|
|
|
ex.printStackTrace();
|
|
ex.printStackTrace();
|