|  | @@ -9,6 +9,7 @@ import java.util.*;
 | 
											
												
													
														|  |  import java.util.function.Function;
 |  |  import java.util.function.Function;
 | 
											
												
													
														|  |  import java.util.stream.Collectors;
 |  |  import java.util.stream.Collectors;
 | 
											
												
													
														|  |  import javax.annotation.Resource;
 |  |  import javax.annotation.Resource;
 | 
											
												
													
														|  | 
 |  | +import javax.servlet.ServletOutputStream;
 | 
											
												
													
														|  |  import javax.servlet.http.HttpServletRequest;
 |  |  import javax.servlet.http.HttpServletRequest;
 | 
											
												
													
														|  |  import javax.servlet.http.HttpServletResponse;
 |  |  import javax.servlet.http.HttpServletResponse;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
										
											
												
													
														|  | @@ -16,11 +17,18 @@ import com.baomidou.mybatisplus.annotation.TableField;
 | 
											
												
													
														|  |  import org.apache.poi.ss.usermodel.Workbook;
 |  |  import org.apache.poi.ss.usermodel.Workbook;
 | 
											
												
													
														|  |  import org.jeecg.common.api.vo.Result;
 |  |  import org.jeecg.common.api.vo.Result;
 | 
											
												
													
														|  |  import org.jeecg.common.aspect.annotation.AutoLog;
 |  |  import org.jeecg.common.aspect.annotation.AutoLog;
 | 
											
												
													
														|  | 
 |  | +import org.jeecg.common.system.vo.DictModel;
 | 
											
												
													
														|  |  import org.jeecg.common.util.oConvertUtils;
 |  |  import org.jeecg.common.util.oConvertUtils;
 | 
											
												
													
														|  |  import org.jeecg.modules.documents.letterDeposit.entity.SyRmb;
 |  |  import org.jeecg.modules.documents.letterDeposit.entity.SyRmb;
 | 
											
												
													
														|  |  import org.jeecg.modules.documents.letterDeposit.entity.SyUsd;
 |  |  import org.jeecg.modules.documents.letterDeposit.entity.SyUsd;
 | 
											
												
													
														|  | 
 |  | +import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElements;
 | 
											
												
													
														|  | 
 |  | +import org.jeecg.modules.documents.seclarationElements.entity.SyDeclarationElementsItem;
 | 
											
												
													
														|  | 
 |  | +import org.jeecg.modules.documents.seclarationElements.service.impl.SyDeclarationElementsItemServiceImpl;
 | 
											
												
													
														|  | 
 |  | +import org.jeecg.modules.documents.seclarationElements.service.impl.SyDeclarationElementsServiceImpl;
 | 
											
												
													
														|  | 
 |  | +import org.jeecg.modules.documents.shippingDetails.entity.SyShippingDetailsItem;
 | 
											
												
													
														|  |  import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrder;
 |  |  import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrder;
 | 
											
												
													
														|  |  import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem;
 |  |  import org.jeecg.modules.documents.syShippingOrder.entity.SyShippingOrderItem;
 | 
											
												
													
														|  | 
 |  | +import org.jeecg.modules.documents.syShippingOrder.entity.VO.ElmentReady;
 | 
											
												
													
														|  |  import org.jeecg.modules.documents.syShippingOrder.entity.VO.SyPackingList;
 |  |  import org.jeecg.modules.documents.syShippingOrder.entity.VO.SyPackingList;
 | 
											
												
													
														|  |  import org.jeecg.modules.documents.syShippingOrder.mapper.SyShippingOrderMapper;
 |  |  import org.jeecg.modules.documents.syShippingOrder.mapper.SyShippingOrderMapper;
 | 
											
												
													
														|  |  import org.jeecg.modules.documents.syShippingOrder.service.ISyShippingOrderService;
 |  |  import org.jeecg.modules.documents.syShippingOrder.service.ISyShippingOrderService;
 | 
											
										
											
												
													
														|  | @@ -30,7 +38,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
											
												
													
														|  |  import lombok.extern.slf4j.Slf4j;
 |  |  import lombok.extern.slf4j.Slf4j;
 | 
											
												
													
														|  |  import org.jeecg.common.system.base.controller.JeecgController;
 |  |  import org.jeecg.common.system.base.controller.JeecgController;
 | 
											
												
													
														|  |  import org.jeecg.modules.documents.syShippingOrder.service.impl.SyShippingOrderItemServiceImpl;
 |  |  import org.jeecg.modules.documents.syShippingOrder.service.impl.SyShippingOrderItemServiceImpl;
 | 
											
												
													
														|  | 
 |  | +import org.jeecg.modules.documents.syShippingOrder.tool.TopinYin;
 | 
											
												
													
														|  |  import org.jeecg.modules.splt.mapper.SyPackingListTailoringItemMapper;
 |  |  import org.jeecg.modules.splt.mapper.SyPackingListTailoringItemMapper;
 | 
											
												
													
														|  | 
 |  | +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.ExcelExportUtil;
 | 
											
												
													
														|  |  import org.jeecgframework.poi.excel.entity.TemplateExportParams;
 |  |  import org.jeecgframework.poi.excel.entity.TemplateExportParams;
 | 
											
												
													
														|  |  import org.springframework.beans.factory.annotation.Autowired;
 |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
											
										
											
												
													
														|  | @@ -53,11 +64,15 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 | 
											
												
													
														|  |  	@Autowired
 |  |  	@Autowired
 | 
											
												
													
														|  |  	private ISyShippingOrderService syShippingOrderService;
 |  |  	private ISyShippingOrderService syShippingOrderService;
 | 
											
												
													
														|  |  	@Autowired
 |  |  	@Autowired
 | 
											
												
													
														|  | -	private SyPackingListTailoringItemMapper syPackingListTailoringItemMapper;
 |  | 
 | 
											
												
													
														|  | 
 |  | +	private SyDeclarationElementsServiceImpl syDeclarationElementsService;
 | 
											
												
													
														|  | 
 |  | +	 @Autowired
 | 
											
												
													
														|  | 
 |  | +	 private SyDeclarationElementsItemServiceImpl syDeclarationElementsItemService;
 | 
											
												
													
														|  |  	 @Autowired
 |  |  	 @Autowired
 | 
											
												
													
														|  |  	private SyShippingOrderItemServiceImpl syShippingOrderItemService;
 |  |  	private SyShippingOrderItemServiceImpl syShippingOrderItemService;
 | 
											
												
													
														|  |  	 @Resource
 |  |  	 @Resource
 | 
											
												
													
														|  |  	 private SyShippingOrderMapper syShippingOrderMapper;
 |  |  	 private SyShippingOrderMapper syShippingOrderMapper;
 | 
											
												
													
														|  | 
 |  | +	 @Autowired
 | 
											
												
													
														|  | 
 |  | +	 private SysDictServiceImpl sysDictService;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  	
 |  |  	
 | 
											
												
													
														|  |  	/**
 |  |  	/**
 | 
											
										
											
												
													
														|  | @@ -452,25 +467,34 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  		 try {
 |  |  		 try {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -			 if(org.jeecg.modules.system.util.oConvertUtils.isEmpty(syShippingOrder.getId())){
 |  | 
 | 
											
												
													
														|  | 
 |  | +			 if(syShippingOrder.getIds().size()==0){
 | 
											
												
													
														|  |  				 result.setMessage("未拿到ID");
 |  |  				 result.setMessage("未拿到ID");
 | 
											
												
													
														|  |  				 result.setSuccess(false);
 |  |  				 result.setSuccess(false);
 | 
											
												
													
														|  |  				 return  result;
 |  |  				 return  result;
 | 
											
												
													
														|  |  			 }
 |  |  			 }
 | 
											
												
													
														|  | -			 //判断是否有该数据
 |  | 
 | 
											
												
													
														|  | -			 SyShippingOrder entity = syShippingOrderService.getById(syShippingOrder.getId());
 |  | 
 | 
											
												
													
														|  | -			 if(org.jeecg.modules.system.util.oConvertUtils.isEmpty(entity)){
 |  | 
 | 
											
												
													
														|  | -				 result.setMessage("未找到该数据!");
 |  | 
 | 
											
												
													
														|  | -				 result.setSuccess(false);
 |  | 
 | 
											
												
													
														|  | -				 return  result;
 |  | 
 | 
											
												
													
														|  | 
 |  | +			 //判断是否有提交数据
 | 
											
												
													
														|  | 
 |  | +			 QueryWrapper<SyShippingOrder> queryWrapper = new QueryWrapper<SyShippingOrder>();
 | 
											
												
													
														|  | 
 |  | +			 queryWrapper.in("id",syShippingOrder.getIds());
 | 
											
												
													
														|  | 
 |  | +			 List<SyShippingOrder> entityList = syShippingOrderService.list(queryWrapper);
 | 
											
												
													
														|  | 
 |  | +			 if(syShippingOrder.getType().equals("1")){
 | 
											
												
													
														|  | 
 |  | +				 for (SyShippingOrder li : entityList) {
 | 
											
												
													
														|  | 
 |  | +			 		if(li.getTheDocumentsState().equals("1")){
 | 
											
												
													
														|  | 
 |  | +						result.setSuccess(false);
 | 
											
												
													
														|  | 
 |  | +						result.setMessage("部分单据已提交,请勿重复提交!");
 | 
											
												
													
														|  | 
 |  | +						return result;
 | 
											
												
													
														|  | 
 |  | +					}
 | 
											
												
													
														|  | 
 |  | +				}
 | 
											
												
													
														|  | 
 |  | +			 }else{
 | 
											
												
													
														|  | 
 |  | +				 for (SyShippingOrder li : entityList) {
 | 
											
												
													
														|  | 
 |  | +					 if(li.getTheDocumentsState().equals("0")){
 | 
											
												
													
														|  | 
 |  | +						 result.setSuccess(false);
 | 
											
												
													
														|  | 
 |  | +						 result.setMessage("部分单据已取消提交,请勿重复取消提交!");
 | 
											
												
													
														|  | 
 |  | +						 return result;
 | 
											
												
													
														|  | 
 |  | +					 }
 | 
											
												
													
														|  | 
 |  | +				 }
 | 
											
												
													
														|  |  			 }
 |  |  			 }
 | 
											
												
													
														|  | -			 //判断是否已提交
 |  | 
 | 
											
												
													
														|  | -//		  if(shippingDetails.getState().equals("1") && syShippingDetails.getType().equals("1")){
 |  | 
 | 
											
												
													
														|  | -//			  result.setMessage("该单据已提交,不允许再次提交!");
 |  | 
 | 
											
												
													
														|  | -//			  result.setSuccess(false);
 |  | 
 | 
											
												
													
														|  | -//			  return  result;
 |  | 
 | 
											
												
													
														|  | -//		  }
 |  | 
 | 
											
												
													
														|  | -			 int i = syShippingOrderService.syShippingOrderSubmit(syShippingOrder.getId(),syShippingOrder.getType());
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +			 int i = syShippingOrderService.syShippingOrderSubmit(syShippingOrder.getIds(),syShippingOrder.getType());
 | 
											
												
													
														|  |  			 if(i>0){
 |  |  			 if(i>0){
 | 
											
												
													
														|  |  				 if(syShippingOrder.getType().equals("1")){
 |  |  				 if(syShippingOrder.getType().equals("1")){
 | 
											
												
													
														|  |  					 result.setSuccess(true);
 |  |  					 result.setSuccess(true);
 | 
											
										
											
												
													
														|  | @@ -501,14 +525,12 @@ 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)  throws ParseException {
 |  | 
 | 
											
												
													
														|  | 
 |  | +	 public void syShippingOrderPrint(String id,String testName,HttpServletResponse response)  throws ParseException {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  		 Result<SyShippingOrder> result= new Result<SyShippingOrder>();
 |  |  		 Result<SyShippingOrder> result= new Result<SyShippingOrder>();
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  		 //子表集合
 |  |  		 //子表集合
 | 
											
												
													
														|  |  		 List<SyShippingOrderItem> list = new ArrayList<>();
 |  |  		 List<SyShippingOrderItem> list = new ArrayList<>();
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | -		 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
 |  | 
 | 
											
												
													
														|  |  		 //总毛重
 |  |  		 //总毛重
 | 
											
												
													
														|  |  		 BigDecimal totalGrossWeight = BigDecimal.ZERO;
 |  |  		 BigDecimal totalGrossWeight = BigDecimal.ZERO;
 | 
											
												
													
														|  |           //总净重
 |  |           //总净重
 | 
											
										
											
												
													
														|  | @@ -518,9 +540,10 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 | 
											
												
													
														|  |           //总金额
 |  |           //总金额
 | 
											
												
													
														|  |  		 BigDecimal tatolMoney = BigDecimal.ZERO;
 |  |  		 BigDecimal tatolMoney = BigDecimal.ZERO;
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +		 //查询主表数据
 | 
											
												
													
														|  | 
 |  | +		 SyShippingOrder entity = syShippingOrderService.getById(id);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  		 try {
 |  |  		 try {
 | 
											
												
													
														|  | -			 //查询主表数据
 |  | 
 | 
											
												
													
														|  | -			 SyShippingOrder entity = syShippingOrderService.getById(id);
 |  | 
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  			 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
 |  |  			 SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
 | 
											
												
													
														|  |  			 Date date = sf.parse(entity.getLatestDateOfShipment());
 |  |  			 Date date = sf.parse(entity.getLatestDateOfShipment());
 | 
											
										
											
												
													
														|  | @@ -559,8 +582,13 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 | 
											
												
													
														|  |  			 //String[] nameList = new String[]{"报关信息-报关单","报关信息-申报要素-成衣","报关信息-发票","报关信息-合同","报关信息-申报要素-面料","报关信息-装箱单"};
 |  |  			 //String[] nameList = new String[]{"报关信息-报关单","报关信息-申报要素-成衣","报关信息-发票","报关信息-合同","报关信息-申报要素-面料","报关信息-装箱单"};
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  			 if(testName.equals("报关信息-报关单")){
 |  |  			 if(testName.equals("报关信息-报关单")){
 | 
											
												
													
														|  | -				 TemplateExportParams params = new TemplateExportParams("D:\\"+testName+".xlsx");
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  				 Map<String, Object> map = new HashMap<String, Object>();
 |  |  				 Map<String, Object> map = new HashMap<String, Object>();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 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) {
 | 
											
										
											
												
													
														|  | @@ -580,13 +608,155 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 | 
											
												
													
														|  |  				 map.put("item", listMap);
 |  |  				 map.put("item", listMap);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  				 Workbook workbook = ExcelExportUtil.exportExcel(params,map);
 |  |  				 Workbook workbook = ExcelExportUtil.exportExcel(params,map);
 | 
											
												
													
														|  | -				 File savefile = new File("C:\\Users\\Mr_zeng\\Desktop\\");
 |  | 
 | 
											
												
													
														|  | -				 if (!savefile.exists()) {
 |  | 
 | 
											
												
													
														|  | -					 savefile.mkdirs();
 |  | 
 | 
											
												
													
														|  | 
 |  | +//				 File savefile = new File("C:\\Users\\Mr_zeng\\Desktop\\");
 | 
											
												
													
														|  | 
 |  | +//				 if (!savefile.exists()) {
 | 
											
												
													
														|  | 
 |  | +//					 savefile.mkdirs();
 | 
											
												
													
														|  | 
 |  | +//				 }
 | 
											
												
													
														|  | 
 |  | +				 ServletOutputStream outputStream = response.getOutputStream();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +//				 FileOutputStream fos = new FileOutputStream(outputStream);
 | 
											
												
													
														|  | 
 |  | +				 workbook.write(outputStream);
 | 
											
												
													
														|  | 
 |  | +//				 fos.close();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +			 }else if(testName.equals("报关信息-申报要素-成衣")){
 | 
											
												
													
														|  | 
 |  | +                 //传出的Map
 | 
											
												
													
														|  | 
 |  | +				 Map<String, Object> map = new HashMap<String, Object>();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
 | 
											
												
													
														|  | 
 |  | +				 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);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				for(SyShippingOrderItem li:itemList){
 | 
											
												
													
														|  | 
 |  | +					map.put("name","zzzz"+li.getReadyFabric());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +					Map<String, Object> map1 = 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);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +					for(SyDeclarationElementsItem li1:itemList1){
 | 
											
												
													
														|  | 
 |  | +						Field[] fieldsList = li1.getClass().getDeclaredFields();
 | 
											
												
													
														|  | 
 |  | +						Map<String, Object> map2 = new HashMap<String, Object>();
 | 
											
												
													
														|  | 
 |  | +						for (Field field : fieldsList) {
 | 
											
												
													
														|  | 
 |  | +							field.setAccessible(true);
 | 
											
												
													
														|  | 
 |  | +							map2.put(field.getName(), field.get(li1));
 | 
											
												
													
														|  | 
 |  | +						}
 | 
											
												
													
														|  | 
 |  | +						listMap1.add(map2);
 | 
											
												
													
														|  | 
 |  | +					}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +					map1.put("name","商品编码  "+elementEntity.getInventoryCode());
 | 
											
												
													
														|  | 
 |  | +					map1.put("value","商品描述: ");
 | 
											
												
													
														|  | 
 |  | +					map1.put("item",listMap1);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +					listMap.add(map1);
 | 
											
												
													
														|  | 
 |  | +				}
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 map.put("list", listMap);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 Workbook workbook = ExcelExportUtil.exportExcel(params,map);
 | 
											
												
													
														|  | 
 |  | +//				 File savefile = new File("C:\\Users\\Mr_zeng\\Desktop\\");
 | 
											
												
													
														|  | 
 |  | +//				 if (!savefile.exists()) {
 | 
											
												
													
														|  | 
 |  | +//					 savefile.mkdirs();
 | 
											
												
													
														|  | 
 |  | +//				 }
 | 
											
												
													
														|  | 
 |  | +//				 FileOutputStream fos = new FileOutputStream("C:\\Users\\Mr_zeng\\Desktop\\"+testName+"1.xlsx");
 | 
											
												
													
														|  | 
 |  | +//				 workbook.write(fos);
 | 
											
												
													
														|  | 
 |  | +//				 fos.close();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +			 }if(testName.equals("报关信息-发票")){
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 Map<String, Object> map = new HashMap<String, Object>();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 //重新赋值
 | 
											
												
													
														|  | 
 |  | +				 Date date1 = new Date();
 | 
											
												
													
														|  | 
 |  | +				 entity.setLatestDateOfShipment(sf.format(date1));
 | 
											
												
													
														|  | 
 |  | +				 //出口口岸转大写拼音
 | 
											
												
													
														|  | 
 |  | +				 TopinYin py = new TopinYin();
 | 
											
												
													
														|  | 
 |  | +				 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> test = sysDictService.queryDictItemsByCode("test0902002");
 | 
											
												
													
														|  | 
 |  | +				 for(DictModel di:test){
 | 
											
												
													
														|  | 
 |  | +					 if(di.getText().equals(list.get(0).getClientAbbreviation())){
 | 
											
												
													
														|  | 
 |  | +					 	String split[] = di.getValue().split("\\+");
 | 
											
												
													
														|  | 
 |  | +					 	if(split.length != 12){
 | 
											
												
													
														|  | 
 |  | +							result.setSuccess(false);
 | 
											
												
													
														|  | 
 |  | +							result.setMessage("数据字典-唛头信息维护不正确!");
 | 
											
												
													
														|  | 
 |  | +							result.setResult(entity);
 | 
											
												
													
														|  | 
 |  | +						}
 | 
											
												
													
														|  | 
 |  | +						 entity.setPrimark(split[0]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setKimballNo(split[1]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setOrderNo(split[2]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setCartonGrossWeight(split[3]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setCartonDimensions(split[4]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setCartonNumber(split[5]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setCartonQuantity(split[6]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setSubSectionDescription(split[7]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setAssortedSizeCodes(split[8]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setColour(split[9]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setMadeInChina(split[10]);
 | 
											
												
													
														|  | 
 |  | +						 entity.setSizeBreakdown(split[11]);
 | 
											
												
													
														|  | 
 |  | +					 }
 | 
											
												
													
														|  | 
 |  | +				 }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 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);
 | 
											
												
													
														|  |  				 }
 |  |  				 }
 | 
											
												
													
														|  | -				 FileOutputStream fos = new FileOutputStream("C:\\Users\\Mr_zeng\\Desktop\\"+testName+"1.xlsx");
 |  | 
 | 
											
												
													
														|  | -				 workbook.write(fos);
 |  | 
 | 
											
												
													
														|  | -				 fos.close();
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 map.put("item", listMap);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +				 Workbook workbook = ExcelExportUtil.exportExcel(params,map);
 | 
											
												
													
														|  | 
 |  | +//				 File savefile = new File("C:\\Users\\Mr_zeng\\Desktop\\");
 | 
											
												
													
														|  | 
 |  | +//				 if (!savefile.exists()) {
 | 
											
												
													
														|  | 
 |  | +//					 savefile.mkdirs();
 | 
											
												
													
														|  | 
 |  | +//				 }
 | 
											
												
													
														|  | 
 |  | +				 ServletOutputStream outputStream = response.getOutputStream();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +//				 FileOutputStream fos = new FileOutputStream(outputStream);
 | 
											
												
													
														|  | 
 |  | +				 workbook.write(outputStream);
 | 
											
												
													
														|  | 
 |  | +//				 fos.close();
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  			 }
 |  |  			 }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  			 result.setSuccess(true);
 |  |  			 result.setSuccess(true);
 | 
											
										
											
												
													
														|  | @@ -599,7 +769,8 @@ public class SyShippingOrderController extends JeecgController<SyShippingOrder,
 | 
											
												
													
														|  |  		 	log.error("生成失败:" + ex.getMessage());
 |  |  		 	log.error("生成失败:" + ex.getMessage());
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |  		 }
 |  |  		 }
 | 
											
												
													
														|  | -	 	return result;
 |  | 
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  	 }
 |  |  	 }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  }
 |  |  }
 |