|
@@ -14,8 +14,15 @@ import javax.servlet.ServletOutputStream;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
+import com.alibaba.excel.EasyExcel;
|
|
|
+import com.alibaba.excel.ExcelWriter;
|
|
|
+import com.alibaba.excel.write.metadata.WriteSheet;
|
|
|
+import com.alibaba.excel.write.metadata.fill.FillConfig;
|
|
|
+import com.alibaba.excel.write.metadata.fill.FillWrapper;
|
|
|
import com.baomidou.mybatisplus.annotation.TableField;
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.vo.DictModel;
|
|
@@ -49,7 +56,9 @@ import org.jeecg.modules.splt.service.impl.SyPackingListTailoringItemServiceImpl
|
|
|
import org.jeecg.modules.system.entity.SysDict;
|
|
|
import org.jeecg.modules.system.service.impl.SysDictServiceImpl;
|
|
|
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
|
|
+import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
import org.jeecgframework.poi.excel.entity.TemplateExportParams;
|
|
|
+import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -576,75 +585,62 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
public void syShippingOrderPrint(String id,String testName,String isAhaa,HttpServletResponse response) throws ParseException {
|
|
|
|
|
|
Result<SyShippingOrder> result= new Result<SyShippingOrder>();
|
|
|
- String readyFabric = "";
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
+ List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
|
|
|
+ String readyFabric = "";
|
|
|
//子表集合
|
|
|
List<SyShippingOrderItem> list = new ArrayList<>();
|
|
|
//总毛重
|
|
|
BigDecimal totalGrossWeight = BigDecimal.ZERO;
|
|
|
- //总净重
|
|
|
+ //总净重
|
|
|
BigDecimal totalNetweight = BigDecimal.ZERO;
|
|
|
//总数量
|
|
|
BigDecimal tatolNumber = BigDecimal.ZERO;
|
|
|
- //总金额
|
|
|
+ //总金额
|
|
|
BigDecimal tatolMoney = BigDecimal.ZERO;
|
|
|
//总体积
|
|
|
BigDecimal tatolVolume = BigDecimal.ZERO;
|
|
|
//总箱数
|
|
|
BigDecimal tatolBoxnumber = BigDecimal.ZERO;
|
|
|
|
|
|
- Map<String, Object> map = new HashMap<String, Object>();
|
|
|
-
|
|
|
- List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
|
|
|
- //获取当前时间
|
|
|
+ //获取当前时间
|
|
|
Date date = new Date();
|
|
|
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();
|
|
|
-
|
|
|
//查询主表数据
|
|
|
SyShippingOrder entity = syShippingOrderService.getById(id);
|
|
|
- int box = entity.getBoxNumber().intValue();
|
|
|
- entity.setBoxNumber(new BigDecimal(box));
|
|
|
- entity.setTotalNetWeight(entity.getTotalNetWeight().setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
- entity.setTotalGrossWeight(entity.getTotalGrossWeight().setScale(2,BigDecimal.ROUND_HALF_UP));
|
|
|
- entity.setTotalVolume(entity.getTotalVolume().setScale(3,BigDecimal.ROUND_HALF_UP));
|
|
|
try {
|
|
|
|
|
|
- if(oConvertUtils.isNotEmpty(entity.getLatestDateOfShipment())){
|
|
|
- Date date1 = sf.parse(entity.getLatestDateOfShipment());
|
|
|
- String lasttime = sf.format(date1);
|
|
|
- entity.setLatestDateOfShipment(lasttime);
|
|
|
- }else{
|
|
|
- entity.setLatestDateOfShipment("");
|
|
|
- }
|
|
|
+ //转换最终船期
|
|
|
+ if (oConvertUtils.isNotEmpty(entity.getLatestDateOfShipment())) {
|
|
|
+ Date date1 = sf.parse(entity.getLatestDateOfShipment());
|
|
|
+ String lasttime = sf.format(date1);
|
|
|
+ entity.setLatestDateOfShipment(lasttime);
|
|
|
+ } else {
|
|
|
+ entity.setLatestDateOfShipment("");
|
|
|
+ }
|
|
|
|
|
|
// 只要不是成品,需要做汇总操作,汇总条件为报关品名+HSCODE
|
|
|
- if(entity.getReadyFabric().equals("成衣")){
|
|
|
+ if (entity.getReadyFabric().equals("成衣")) {
|
|
|
readyFabric = "申报要素-成衣";
|
|
|
list = syShippingOrderMapper.queryEelement(id);
|
|
|
- for(SyShippingOrderItem li:list){
|
|
|
+ for (SyShippingOrderItem li : list) {
|
|
|
totalGrossWeight = totalGrossWeight.add(li.getGrossWeight());
|
|
|
totalNetweight = totalNetweight.add(li.getNetWeight());
|
|
|
- tatolNumber = tatolNumber.add(li.getNumber());
|
|
|
+ tatolNumber = tatolNumber.add(li.getNumber());
|
|
|
tatolMoney = tatolMoney.add(li.getTotalPrice());
|
|
|
tatolVolume = tatolVolume.add(li.getVolume());
|
|
|
tatolBoxnumber = tatolBoxnumber.add(li.getBoxNumber());
|
|
|
li.setDestination(entity.getArriveInCountry());
|
|
|
}
|
|
|
- //总数量
|
|
|
- entity.setTatolNumber(tatolNumber);
|
|
|
- //总金额
|
|
|
- entity.setTatolMoney(tatolMoney);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
readyFabric = "申报要素-面辅料";
|
|
|
list = syShippingOrderMapper.queryEelementMerge(id);
|
|
|
- for(SyShippingOrderItem li:list){
|
|
|
+ for (SyShippingOrderItem li : list) {
|
|
|
totalGrossWeight = totalGrossWeight.add(li.getGrossWeight());
|
|
|
totalNetweight = totalNetweight.add(li.getNetWeight());
|
|
|
- tatolNumber = tatolNumber.add(li.getNumber());
|
|
|
+ tatolNumber = tatolNumber.add(li.getNumber());
|
|
|
tatolMoney = tatolMoney.add(li.getTotalPrice());
|
|
|
tatolVolume = tatolVolume.add(li.getVolume());
|
|
|
tatolBoxnumber = tatolBoxnumber.add(li.getBoxNumber());
|
|
@@ -665,371 +661,36 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
//总箱数
|
|
|
entity.setBoxNumber(tatolBoxnumber);
|
|
|
//判空
|
|
|
- if(oConvertUtils.isEmpty(entity.getUnitInOperation())){
|
|
|
- entity.setUnitInOperation(" ");
|
|
|
- }
|
|
|
- if(oConvertUtils.isEmpty(entity.getCustomsCode())){
|
|
|
- entity.setCustomsCode(" ");
|
|
|
- }
|
|
|
- if(oConvertUtils.isEmpty(entity.getDutyParagraph())){
|
|
|
- entity.setDutyParagraph(" ");
|
|
|
- }
|
|
|
- //海关
|
|
|
- if(oConvertUtils.isEmpty(entity.getExportPort())){
|
|
|
- entity.setExportPort(" ");
|
|
|
- }
|
|
|
- if(oConvertUtils.isEmpty(entity.getLatestDateOfShipment())){
|
|
|
- entity.setLatestDateOfShipment(" ");
|
|
|
- }
|
|
|
- if(oConvertUtils.isEmpty(entity.getTypeOfShipping())){
|
|
|
- entity.setTypeOfShipping(" ");
|
|
|
- } if(oConvertUtils.isEmpty(entity.getShippingOrderNumber())){
|
|
|
- entity.setShippingOrderNumber(" ");
|
|
|
- } if(oConvertUtils.isEmpty(entity.getTradeCountry())){
|
|
|
- entity.setTradeCountry(" ");
|
|
|
- }
|
|
|
- if(oConvertUtils.isEmpty(entity.getArriveInCountry())){
|
|
|
- entity.setArriveInCountry(" ");
|
|
|
- }
|
|
|
- if(oConvertUtils.isEmpty(entity.getDestinationPort())){
|
|
|
- entity.setDestinationPort(" ");
|
|
|
+ if (oConvertUtils.isEmpty(entity.getUnitInOperation())) { entity.setUnitInOperation(" "); }
|
|
|
+ if (oConvertUtils.isEmpty(entity.getCustomsCode())) {entity.setCustomsCode(" ");}
|
|
|
+ if (oConvertUtils.isEmpty(entity.getDutyParagraph())) {entity.setDutyParagraph(" ");}
|
|
|
+ if (oConvertUtils.isEmpty(entity.getExportPort())) {entity.setExportPort(" ");}
|
|
|
+ if (oConvertUtils.isEmpty(entity.getLatestDateOfShipment())) { entity.setLatestDateOfShipment(" "); }
|
|
|
+ if (oConvertUtils.isEmpty(entity.getTypeOfShipping())) { entity.setTypeOfShipping(" "); }
|
|
|
+ if (oConvertUtils.isEmpty(entity.getShippingOrderNumber())) { entity.setShippingOrderNumber(" "); }
|
|
|
+ if (oConvertUtils.isEmpty(entity.getTradeCountry())) { entity.setTradeCountry(" "); }
|
|
|
+ if (oConvertUtils.isEmpty(entity.getArriveInCountry())) { entity.setArriveInCountry(" "); }
|
|
|
+ if (oConvertUtils.isEmpty(entity.getDestinationPort())) { entity.setDestinationPort(" "); }
|
|
|
+
|
|
|
+ List<SyShippingOrderItem> itemList = null;
|
|
|
+
|
|
|
+ //成衣的
|
|
|
+ if (readyFabric.equals("申报要素-成衣")) {
|
|
|
+ itemList = syShippingOrderMapper.elmentsList(entity.getId());
|
|
|
+ } else {
|
|
|
+ itemList = syShippingOrderMapper.elmentsListFabric(entity.getId());
|
|
|
}
|
|
|
|
|
|
- if(isAhaa.equals("国内")){
|
|
|
-
|
|
|
- if (testName.equals("报关信息-报关单")) {
|
|
|
- int size = 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) {
|
|
|
- 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);
|
|
|
- response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
- response.setCharacterEncoding("utf-8");
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
-
|
|
|
- workbook.write(outputStream);
|
|
|
-
|
|
|
- } else if (testName.equals("报关信息-申报要素")) {
|
|
|
-
|
|
|
- List<SyShippingOrderItem> itemList = null;
|
|
|
- List<String> elmentid = new ArrayList<>();
|
|
|
-
|
|
|
-// 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);
|
|
|
-
|
|
|
- //成衣的
|
|
|
- if(readyFabric.equals("申报要素-成衣")){
|
|
|
- itemList = syShippingOrderMapper.elmentsList(entity.getId());
|
|
|
- }else{
|
|
|
- itemList = syShippingOrderMapper.elmentsListFabric(entity.getId());
|
|
|
- }
|
|
|
-
|
|
|
-// for(SyShippingOrderItem li : itemList){
|
|
|
-//
|
|
|
-// elmentid.add(li.getId());
|
|
|
-// }
|
|
|
-
|
|
|
- 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<SyDeclarationElements> entityQueryWrapper = new QueryWrapper<>();
|
|
|
-// entityQueryWrapper.eq("id",li.getElementsId()).groupBy("hs_code");
|
|
|
-// List<SyDeclarationElements> entityList = syDeclarationElementsService.list(entityQueryWrapper);
|
|
|
-//
|
|
|
- //查询子表
|
|
|
- QueryWrapper<SyDeclarationElementsItem> itemQueryWrapper = new QueryWrapper<>();
|
|
|
- itemQueryWrapper.eq("sy_declaration_elements_id", li.getElementsId()).eq("del_flag", 0).orderByAsc("sort");
|
|
|
- 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++;
|
|
|
-
|
|
|
-// if(entity.getReadyFabric().equals("成衣")){
|
|
|
-// map6.put("name", "");
|
|
|
-// }else{
|
|
|
-// 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);
|
|
|
-
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
- response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
- response.setCharacterEncoding("utf-8");
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- else if (testName.equals("报关信息-发票") || 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());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- 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);
|
|
|
- response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
- response.setCharacterEncoding("utf-8");
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
-
|
|
|
-
|
|
|
- } else if (testName.equals("报关信息-合同") || 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);
|
|
|
-
|
|
|
- entity.setDateTime(sdf1.format(locale));
|
|
|
-
|
|
|
- //出口口岸转大写拼音
|
|
|
- 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());
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ if (isAhaa.equals("国内")) {
|
|
|
|
|
|
- //转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);
|
|
|
-
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
- response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
- response.setCharacterEncoding("utf-8");
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }else if (testName.equals("报关信息-装箱单") || 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;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- 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);
|
|
|
- response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
- response.setCharacterEncoding("utf-8");
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
- workbook.write(outputStream);
|
|
|
-
|
|
|
- } else if (testName.equals("报关信息-结汇发票")) {
|
|
|
+ if (testName.equals("-结汇发票")) {
|
|
|
|
|
|
List<Map<String, Object>> taitouList = new ArrayList<>();
|
|
|
+ //获取对应模板
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\报关信息-结汇发票.xlsx");
|
|
|
|
|
|
//查询数据字典-公司抬头
|
|
|
List<DictModel> test = sysDictService.queryDictItemsByCode("company_title");
|
|
|
-
|
|
|
if (oConvertUtils.isNotEmpty(list.get(0).getPkOrg())) {
|
|
|
if (list.get(0).getPkOrg().equals("101")) {
|
|
|
String split[] = test.get(0).getValue().split("\\+");
|
|
@@ -1039,7 +700,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
taitouList.add(maiTou);
|
|
|
}
|
|
|
entity.setClientAbbreviation(split[0]);
|
|
|
- } else if (list.get(0).getPkOrg().equals("102")){
|
|
|
+ } else if (list.get(0).getPkOrg().equals("102")) {
|
|
|
String split[] = test.get(1).getValue().split("\\+");
|
|
|
for (int i = 0; i < split.length; i++) {
|
|
|
Map<String, Object> maiTou = new HashMap<>();
|
|
@@ -1047,7 +708,8 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
taitouList.add(maiTou);
|
|
|
}
|
|
|
entity.setClientAbbreviation(split[0]);
|
|
|
- }if (list.get(0).getPkOrg().equals("103")){
|
|
|
+ }
|
|
|
+ if (list.get(0).getPkOrg().equals("103")) {
|
|
|
String split[] = test.get(1).getValue().split("\\+");
|
|
|
for (int i = 0; i < split.length; i++) {
|
|
|
Map<String, Object> maiTou = new HashMap<>();
|
|
@@ -1057,17 +719,6 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
entity.setClientAbbreviation(split[0]);
|
|
|
}
|
|
|
}
|
|
|
- //2023.1.13注释
|
|
|
-// 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) {
|
|
@@ -1084,55 +735,314 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
}
|
|
|
listMap.add(mapList);
|
|
|
}
|
|
|
-
|
|
|
map.put("item", listMap);
|
|
|
map.put("list", taitouList);
|
|
|
|
|
|
-
|
|
|
Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
response.setCharacterEncoding("utf-8");
|
|
|
ServletOutputStream outputStream = response.getOutputStream();
|
|
|
workbook.write(outputStream);
|
|
|
- }
|
|
|
|
|
|
- if (testName.equals("报关信息-报关单-面料")) {
|
|
|
- int size = 0;
|
|
|
+ } else {
|
|
|
|
|
|
- //转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) {
|
|
|
- BigDecimal cc = li.getNetWeight().multiply(li.getUnitPrice());
|
|
|
- //2023.1.12注释
|
|
|
- //li.setTotalPrice(cc.setScale(2,BigDecimal.ROUND_HALF_UP));//重新计算金额 = 净重*单价
|
|
|
- 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));
|
|
|
+ if(entity.getReadyFabric().equals("成衣")){
|
|
|
+ //获取模板输入流
|
|
|
+ InputStream inStream = new FileInputStream("D:\\单证模板\\托书成衣合并Excel.xlsx");
|
|
|
+ //通过poi创建表对象
|
|
|
+ XSSFWorkbook workbook = new XSSFWorkbook(inStream);
|
|
|
+ //遍历复制sheet
|
|
|
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
|
+ //写到流
|
|
|
+ workbook.write(bos);
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
|
|
|
+ ExcelWriter excelWriter = EasyExcel.write(outputStream).withTemplate(is).build();
|
|
|
+
|
|
|
+ //填充配置, 这里的意义是给模板中的集合数据添加新行, 保证导出不会错乱
|
|
|
+ FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
|
|
|
+
|
|
|
+//---------------------------申报要素------------------------------
|
|
|
+ WriteSheet writeSheet1 = EasyExcel.writerSheet("申报要素").build();
|
|
|
+//
|
|
|
+
|
|
|
+ int i = 1;
|
|
|
+ for (SyShippingOrderItem li : itemList) {
|
|
|
+ map.put("name", "没用" + li.getReadyFabric());
|
|
|
+
|
|
|
+ Map<String, Object> map1 = 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).orderByAsc("sort");
|
|
|
+ List<SyDeclarationElementsItem> itemList1 = syDeclarationElementsItemService.list(itemQueryWrapper);
|
|
|
+ if (itemList1.size() == 0) {
|
|
|
+ map1.put("name", i + "、商品编码:");
|
|
|
+ map1.put("value", "");
|
|
|
+ listMap.add(map1);
|
|
|
+
|
|
|
+ map4.put("name", "申报要素:");
|
|
|
+ map4.put("value", "");
|
|
|
+ listMap.add(map4);
|
|
|
+ } else {
|
|
|
+ map1.put("name", i + "、商品编码:");
|
|
|
+ map1.put("value", elementEntity.getHsCode());
|
|
|
+ listMap.add(map1);
|
|
|
+
|
|
|
+ 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++;
|
|
|
+ map5.put("name", "");
|
|
|
+ map5.put("value", "");
|
|
|
+ listMap.add(map5);
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
- mapList.put("size", size);
|
|
|
- listMap.add(mapList);
|
|
|
- }
|
|
|
- map.put("item", listMap);
|
|
|
+ map.put("readyFabric", readyFabric);
|
|
|
+
|
|
|
+ excelWriter.fill(map, fillConfig, writeSheet1);
|
|
|
+ excelWriter.fill(listMap, fillConfig, writeSheet1);
|
|
|
+
|
|
|
+//---------------------------合同------------------------------
|
|
|
+ WriteSheet writeSheet2 = EasyExcel.writerSheet("合同").build();
|
|
|
+ //获取当前日期减去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);
|
|
|
+ entity.setDateTime(sdf1.format(locale));
|
|
|
+
|
|
|
+ excelWriter.fill(entity, fillConfig, writeSheet2);
|
|
|
+ excelWriter.fill(list, fillConfig, writeSheet2);
|
|
|
+
|
|
|
+
|
|
|
+//---------------------------发票------------------------------
|
|
|
+ WriteSheet writeSheet3 = EasyExcel.writerSheet("发票").build();
|
|
|
+ List<Map<String, Object>> maiTouList = new ArrayList<Map<String, Object>>();
|
|
|
+
|
|
|
+ boolean boo = true;
|
|
|
+ //重新赋值
|
|
|
+ entity.setLatestDateOfShipment(sf.format(date));
|
|
|
+
|
|
|
+ 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 b = 0; b < split.length; b++) {
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
+ maiTou.put("name", split[b]);
|
|
|
+ maiTouList.add(maiTou);
|
|
|
+ }
|
|
|
+ boo = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (boo == true) {
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
+ maiTou.put("name", " ");
|
|
|
+ maiTouList.add(maiTou);
|
|
|
+ }
|
|
|
+ excelWriter.fill(entity, fillConfig, writeSheet3);
|
|
|
+ excelWriter.fill(new FillWrapper("list", list), fillConfig, writeSheet3);
|
|
|
+ excelWriter.fill(new FillWrapper("maiTouList", maiTouList), fillConfig, writeSheet3);
|
|
|
+
|
|
|
+
|
|
|
+//---------------------------装箱单------------------------------
|
|
|
+ WriteSheet writeSheet4 = EasyExcel.writerSheet("装箱单").build();
|
|
|
+ //出口口岸中文
|
|
|
+ entity.setExportPortName(entity.getExportPort());
|
|
|
+ //List<Map<String, Object>> maiTouList = new ArrayList<>();
|
|
|
+ //出口口岸中文
|
|
|
+ entity.setExportPortName(entity.getExportPort());
|
|
|
+ entity.setDateTime(sf.format(date));
|
|
|
+
|
|
|
+ excelWriter.fill(entity, fillConfig, writeSheet4);
|
|
|
+ excelWriter.fill(new FillWrapper("list", list), fillConfig, writeSheet4);
|
|
|
+ excelWriter.fill(new FillWrapper("maiTouList", maiTouList), fillConfig, writeSheet4);
|
|
|
+
|
|
|
+
|
|
|
+//---------------------------报关单------------------------------
|
|
|
+ WriteSheet writeSheet5 = EasyExcel.writerSheet("报关单").build();
|
|
|
+ excelWriter.fill(entity, fillConfig, writeSheet5);
|
|
|
+ excelWriter.fill(list, fillConfig, writeSheet5);
|
|
|
+
|
|
|
+
|
|
|
+ //关流
|
|
|
+ excelWriter.finish();
|
|
|
+ inStream.close();
|
|
|
+
|
|
|
+ }else{//面辅料数据
|
|
|
+
|
|
|
+ //获取模板输入流
|
|
|
+ InputStream inStream = new FileInputStream("D:\\单证模板\\托书面辅料合并Excel.xlsx");
|
|
|
+ //通过poi创建表对象
|
|
|
+ XSSFWorkbook workbook = new XSSFWorkbook(inStream);
|
|
|
+ //遍历复制sheet
|
|
|
+ ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
|
|
+ //写到流
|
|
|
+ workbook.write(bos);
|
|
|
+ ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ ByteArrayInputStream is = new ByteArrayInputStream(bos.toByteArray());
|
|
|
+ ExcelWriter excelWriter = EasyExcel.write(outputStream).withTemplate(is).build();
|
|
|
+
|
|
|
+ //填充配置, 这里的意义是给模板中的集合数据添加新行, 保证导出不会错乱
|
|
|
+ FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
|
|
|
+
|
|
|
+//---------------------------面辅料-申报要素-----------------------------
|
|
|
+ WriteSheet writeSheet1 = EasyExcel.writerSheet("申报要素").build();
|
|
|
+
|
|
|
+ int i = 1;
|
|
|
+ for (SyShippingOrderItem li : itemList) {
|
|
|
+ map.put("name", "没用" + li.getReadyFabric());
|
|
|
+
|
|
|
+ Map<String, Object> map1 = 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).orderByAsc("sort");
|
|
|
+ List<SyDeclarationElementsItem> itemList1 = syDeclarationElementsItemService.list(itemQueryWrapper);
|
|
|
+ if (itemList1.size() == 0) {
|
|
|
+ map1.put("name", i + "、商品编码:");
|
|
|
+ map1.put("value", "");
|
|
|
+ listMap.add(map1);
|
|
|
+
|
|
|
+ map4.put("name", "申报要素:");
|
|
|
+ map4.put("value", "");
|
|
|
+ listMap.add(map4);
|
|
|
+ } else {
|
|
|
+ map1.put("name", i + "、商品编码:");
|
|
|
+ map1.put("value", elementEntity.getHsCode());
|
|
|
+ listMap.add(map1);
|
|
|
+
|
|
|
+ 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++;
|
|
|
+ map5.put("name", "");
|
|
|
+ map5.put("value", "");
|
|
|
+ listMap.add(map5);
|
|
|
|
|
|
- Workbook workbook = ExcelExportUtil.exportExcel(params, map);
|
|
|
- response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
|
|
- response.setCharacterEncoding("utf-8");
|
|
|
- ServletOutputStream outputStream = response.getOutputStream();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ map.put("readyFabric", readyFabric);
|
|
|
+
|
|
|
+ excelWriter.fill(map, fillConfig, writeSheet1);
|
|
|
+ excelWriter.fill(listMap, fillConfig, writeSheet1);
|
|
|
+
|
|
|
+
|
|
|
+//---------------------------面辅料-合同-----------------------------
|
|
|
+ WriteSheet writeSheet2 = EasyExcel.writerSheet("合同").build();
|
|
|
+ //获取当前日期减去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);
|
|
|
+ entity.setDateTime(sdf1.format(locale));
|
|
|
+
|
|
|
+ excelWriter.fill(entity, fillConfig, writeSheet2);
|
|
|
+ excelWriter.fill(list, fillConfig, writeSheet2);
|
|
|
+
|
|
|
+
|
|
|
+//---------------------------发票------------------------------
|
|
|
+ WriteSheet writeSheet3 = EasyExcel.writerSheet("发票").build();
|
|
|
+ List<Map<String, Object>> maiTouList = new ArrayList<Map<String, Object>>();
|
|
|
+
|
|
|
+ boolean boo = true;
|
|
|
+ //重新赋值
|
|
|
+ entity.setLatestDateOfShipment(sf.format(date));
|
|
|
+
|
|
|
+ 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 b = 0; b < split.length; b++) {
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
+ maiTou.put("name", split[b]);
|
|
|
+ maiTouList.add(maiTou);
|
|
|
+ }
|
|
|
+ boo = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (boo == true) {
|
|
|
+ Map<String, Object> maiTou = new HashMap<>();
|
|
|
+ maiTou.put("name", " ");
|
|
|
+ maiTouList.add(maiTou);
|
|
|
+ }
|
|
|
+ excelWriter.fill(entity, fillConfig, writeSheet3);
|
|
|
+ excelWriter.fill(new FillWrapper("list", list), fillConfig, writeSheet3);
|
|
|
+ excelWriter.fill(new FillWrapper("maiTouList", maiTouList), fillConfig, writeSheet3);
|
|
|
|
|
|
- workbook.write(outputStream);
|
|
|
|
|
|
+//---------------------------装箱单------------------------------
|
|
|
+ WriteSheet writeSheet4 = EasyExcel.writerSheet("装箱单").build();
|
|
|
+ //出口口岸中文
|
|
|
+ entity.setExportPortName(entity.getExportPort());
|
|
|
+ List<Map<String, Object>> maiTouList1 = new ArrayList<>();
|
|
|
+ entity.setDateTime(sf.format(date));
|
|
|
+
|
|
|
+ excelWriter.fill(entity, fillConfig, writeSheet4);
|
|
|
+ excelWriter.fill(new FillWrapper("list", list), fillConfig, writeSheet4);
|
|
|
+ excelWriter.fill(new FillWrapper("maiTouList", maiTouList), fillConfig, writeSheet4);
|
|
|
+
|
|
|
+
|
|
|
+//---------------------------报关单------------------------------
|
|
|
+ WriteSheet writeSheet5 = EasyExcel.writerSheet("报关单").build();
|
|
|
+ excelWriter.fill(entity, fillConfig, writeSheet5);
|
|
|
+ excelWriter.fill(list, fillConfig, writeSheet5);
|
|
|
+
|
|
|
+
|
|
|
+ //关流
|
|
|
+ excelWriter.finish();
|
|
|
+ inStream.close();
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- //国外
|
|
|
- }else{
|
|
|
+ }else{ //国外
|
|
|
+
|
|
|
+ //获取对应模板
|
|
|
+ TemplateExportParams params = new TemplateExportParams("D:\\单证模板\\"+testName+".xlsx");
|
|
|
+
|
|
|
if (testName.equals("国外-报关信息-装箱单")) {
|
|
|
|
|
|
List<Map<String, Object>> maiTouList = new ArrayList<>();
|
|
@@ -1193,7 +1103,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
|
|
|
}else if (testName.equals("国外-报关信息-发票")) {
|
|
|
|
|
|
- List<SyShippingOrderItem> listItem = new ArrayList<>();
|
|
|
+ List<SyShippingOrderItem> listItem = new ArrayList<>();
|
|
|
|
|
|
List<Map<String, Object>> maiTouList = new ArrayList<>();
|
|
|
|
|
@@ -1228,7 +1138,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
//增加同样数据
|
|
|
for (SyShippingOrderItem li : list) {
|
|
|
|
|
|
- li.setHscodeGw("HS CODE:"+li.getHsCode());
|
|
|
+ li.setHscodeGw("HS CODE:"+li.getHsCode());
|
|
|
li.setNumberGw("");
|
|
|
li.setPcsGw("");
|
|
|
li.setPoGw(li.getEnglishProductName());
|
|
@@ -1287,7 +1197,7 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
workbook.write(outputStream);
|
|
|
|
|
|
}else if(testName.equals("国外-报关信息-托书")){
|
|
|
- List<Map<String,Object>> mergeMap = new ArrayList<>();
|
|
|
+ List<Map<String,Object>> mergeMap = new ArrayList<>();
|
|
|
|
|
|
entity.setDateTime(sdf1.format(entity.getShippingOrderDate()));
|
|
|
String earliestDeliveryDate[] = list.get(list.size()-1).getEarliestDeliveryDate().split(" ");
|
|
@@ -1336,13 +1246,8 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
|
|
|
workbook.write(outputStream);
|
|
|
|
|
|
}
|
|
|
- }
|
|
|
- result.setSuccess(true);
|
|
|
- result.setMessage("导出成功,请往桌面查看!");
|
|
|
- result.setResult(entity);
|
|
|
-
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
|
|
}catch (Exception ex){
|
|
|
|