Browse Source

导出接口

dongql 7 years ago
parent
commit
6f6c5b81d7

+ 7 - 0
oa_service/oa_service.iml

@@ -17,6 +17,13 @@
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
     <orderEntry type="library" name="Maven: org.apache.poi:poi:3.16" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.16" level="project" />
+    <orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:3.16" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:2.6.0" level="project" />
+    <orderEntry type="library" name="Maven: com.bjlt.spider:plugin-rpc:0.0.1-SNAPSHOT" level="project" />
+    <orderEntry type="library" name="Maven: org.apache.poi:poi:3.16" level="project" />
     <orderEntry type="library" name="Maven: commons-codec:commons-codec:1.10" level="project" />
     <orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.1" level="project" />
     <orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:3.16" level="project" />

+ 3 - 3
oa_service/src/main/java/com/bjlt/spider/ControlcenterApplication.java

@@ -8,9 +8,9 @@ import org.springframework.cloud.netflix.feign.EnableFeignClients;
 import org.springframework.context.annotation.Bean;
 import org.springframework.transaction.annotation.EnableTransactionManagement;
 
-//@EnableFeignClients
-//@EnableDiscoveryClient
-//@EnableTransactionManagement
+@EnableFeignClients
+@EnableDiscoveryClient
+@EnableTransactionManagement
 @SpringBootApplication
 public class ControlcenterApplication {
 

+ 25 - 2
oa_service/src/main/java/com/bjlt/spider/entity/OaAccount.java

@@ -1,10 +1,13 @@
 package com.bjlt.spider.entity;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.luyn.utils.excel.annotation.ExcelField;
+import com.luyn.utils.excel.annotation.ExcelSheet;
 import lombok.AllArgsConstructor;
 import lombok.Builder;
 import lombok.Data;
 import lombok.NoArgsConstructor;
+import org.apache.poi.hssf.util.HSSFColor;
 
 import java.util.Date;
 
@@ -15,101 +18,121 @@ import java.util.Date;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
+@ExcelSheet(name = "积分", headColor = HSSFColor.HSSFColorPredefined.LIGHT_GREEN)
 public class OaAccount  extends Page {
 
 	/**
 	   
 	 */
+	@ExcelField(name = "ID")
 	private Integer id;
 	
 	/**
 	   注册人
 	 */
+	@ExcelField(name = "注册人")
 	private String registUser;
 	
 	/**
 	   订单号
 	 */
+	@ExcelField(name = "订单号")
 	private String orderNo;
 	
 	/**
 	   起飞日期
 	 */
+	@ExcelField(name = "起飞日期")
 	private String fromDate;
 	
 	/**
 	   金额
 	 */
+	@ExcelField(name = "金额")
 	private java.math.BigDecimal price;
 	
 	/**
 	   姓名
 	 */
+	@ExcelField(name = "姓名")
 	private String cname;
 	
 	/**
 	   出票编码
 	 */
+	@ExcelField(name = "出票编码")
 	private String ticketNo;
 	
 	/**
 	 亚航邮箱账户名
 	 */
+	@ExcelField(name = "亚航邮箱账户名")
 	private String email;
 	
 	/**
 	 邮箱密码
 	 */
+	@ExcelField(name = "邮箱密码")
 	private String emailPwd;
 	
 	/**
 	 亚航账户ID
 	 */
+	@ExcelField(name = "亚航账户ID")
 	private String accountId;
 	
 	/**
 	 亚航登录密码
 	 */
+	@ExcelField(name = "亚航登录密码")
 	private String accountPwd;
 	
 	/**
 	 原出票账户
 	 */
+	@ExcelField(name = "原出票账户")
 	private String payAccount;
 	
 	/**
 	 积分账户最后更新日期
 	 */
-
+	@ExcelField(name = "积分账户最后更新日期")
 	private String lastUpdateTime;
 	
 	/**
 	 积分余额
 	 */
+	@ExcelField(name = "积分余额")
 	private String balance;
 	
 	/**
 	 亚航账户是否激活
 	 */
+	@ExcelField(name = "亚航账户是否激活")
 	private Integer isActive;
 	
 	/**
 	 是否进行关联
 	 */
+	@ExcelField(name = "是否进行关联")
 	private Integer isRelated;
 
 	/**
 	 * 购买日期
 	 */
+	@ExcelField(name = "购买日期")
 	private String buyDate;
 
-
+	@ExcelField(name = "购买积分")
 	private String buyScore;
 
+	@ExcelField(name = "可使用积分")
 	private String canUseScore;
 
+	@ExcelField(name = "单价")
 	private String unitPrice;
 
+	@ExcelField(name = "其他")
 	private String other;
 	
 		

+ 14 - 10
oa_service/src/main/java/com/bjlt/spider/entity/OaPriceInExcel.java

@@ -12,81 +12,85 @@ import org.apache.poi.hssf.util.HSSFColor;
 @Builder
 @AllArgsConstructor
 @NoArgsConstructor
-@ExcelSheet(name = "商户列表", headColor = HSSFColor.HSSFColorPredefined.LIGHT_GREEN)
+@ExcelSheet(name = "价格", headColor = HSSFColor.HSSFColorPredefined.LIGHT_GREEN)
 public class OaPriceInExcel  extends Page {
 
 	/**
 	   
 	 */
-	@ExcelField(name = "id")
+	@ExcelField(name = "ID")
 	private Integer id;
 	
 	/**
 	   
 	 */
-	@ExcelField(name = "priceTableUuid")
+	@ExcelField(name = "价格ID")
 	private String priceTableUuid;
 	
 	/**
 	   
 	 */
-	@ExcelField(name = "出发城市")
+	@ExcelField(name = "出发城市三字码代码")
 	private String fromCity;
 	
 	/**
 	   
 	 */
-	@ExcelField(name = "到达城市")
+	@ExcelField(name = "到达城市三字码代码")
 	private String retCicy;
 	
 	/**
 	   
 	 */
-	@ExcelField(name = "fromDate")
+	@ExcelField(name = "出发日期")
 	private String fromDate;
 	
 	/**
 	   
 	 */
-	@ExcelField(name = "adultTax")
+	@ExcelField(name = "成人税价")
 	private String adultTax;
 	
 	/**
 	   
 	 */
-	@ExcelField(name = "priceTableUuid")
+	@ExcelField(name = "成人积分")
 	private java.math.BigDecimal adultScore;
 	
 	/**
 	   
 	 */
-	@ExcelField(name = "depAirport")
+	@ExcelField(name = "出发机场")
 	private String depAirport;
 	
 	/**
 	   
 	 */
-	@ExcelField(name = "arrAirport")
+	@ExcelField(name = "到达机场")
 	private String arrAirport;
 	
 	/**
 	   
 	 */
+	@ExcelField(name = "到达时间")
 	private String arrTime;
 	
 	/**
 	   
 	 */
+	@ExcelField(name = "出发时间")
 	private String depTime;
 	
 	/**
 	   
 	 */
+	@ExcelField(name = "航班号")
 	private String flightNumber;
 
 	/**
 
 	 */
+	@ExcelField(name = "状态")
 	private Integer status;
 
 }

+ 4 - 1
oa_service/src/main/java/com/bjlt/spider/points/controller/PriceController.java

@@ -6,6 +6,7 @@ import com.bjlt.spider.table.service.OaAccountService;
 import com.luyn.utils.excel.ExcelExportUtil;
 import org.apache.poi.ss.usermodel.Workbook;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
@@ -18,6 +19,8 @@ import java.util.List;
  * @Description:
  * @Date: Create in 23:00 2017/11/15
  */
+@RequestMapping(value = "/oaAccount")
+@Controller
 public class PriceController {
 
 
@@ -33,7 +36,7 @@ public class PriceController {
      * @param endPageIndex
      * @param pageSize
      */
-    @RequestMapping(value = "dowland", method = RequestMethod.POST)
+    @RequestMapping(value = "/dowland", method = RequestMethod.POST)
     public void downloadFile(org.apache.catalina.servlet4preview.http.HttpServletRequest request, HttpServletResponse response, String startPageIndex, String endPageIndex, String pageSize) {
 
         response.setHeader("content-Type", "application/vnd.ms-excel");

+ 0 - 37
oa_service/src/main/java/com/bjlt/spider/table/controller/OaAccountController.java

@@ -67,43 +67,6 @@ public class OaAccountController {
     }
 
 
-    /**
-     * 导入
-     * @param
-     * @return
-     */
-
-    @RequestMapping(value = "upload")
-    @ResponseBody
-    public String upload(@RequestParam("excel") MultipartFile file) {
-        if (file.isEmpty()) {
-            return "文件为空";
-        }
-        // 获取文件名
-        String fileName = file.getOriginalFilename();
-        log.info("上传的文件名为:" + fileName);
-        // 获取文件的后缀名
-        String suffixName = fileName.substring(fileName.lastIndexOf("."));
-        log.info("上传的后缀名为:" + suffixName);
-        // 文件上传后的路径
-        String filePath = "./";
-        // 解决中文问题,liunx下中文路径,图片显示问题
-        // fileName = UUID.randomUUID() + suffixName;
-        File dest = new File(filePath + fileName);
-        // 检测是否存在目录
-        if (!dest.getParentFile().exists()) {
-            dest.getParentFile().mkdirs();
-        }
-        try {
-            file.transferTo(dest);
-            return "上传成功";
-        } catch (IllegalStateException e) {
-            e.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-        return "上传失败";
-    }
 
 
 

+ 5 - 5
oa_service/src/main/resources/application-intranet.properties

@@ -34,9 +34,9 @@ spring.redis.pool.min-idle=0
 spring.redis.pool.max-active=8
 spring.redis.pool.max-wait=-1
 #
-#registration.master.hostname=localhost
-#registration.master.port=10001
+registration.master.hostname=localhost
+registration.master.port=10001
 #
-#eureka.client.serviceUrl.defaultZone=http://${registration.master.hostname}:${registration.master.port}/eureka/
-##hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=50000
-#hystrix.command.default.execution.timeout.enabled=false
+eureka.client.serviceUrl.defaultZone=http://${registration.master.hostname}:${registration.master.port}/eureka/
+hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=50000
+hystrix.command.default.execution.timeout.enabled=false