Browse Source

经理查看导出

anderx 5 years ago
parent
commit
f6b3df80cf
33 changed files with 2487 additions and 780 deletions
  1. 36 1
      src/main/java/com/goafanti/common/controller/PublicController.java
  2. 1 1
      src/main/java/com/goafanti/common/mapper/PaymentNodeMapper.xml
  3. 40 35
      src/main/java/com/goafanti/common/model/TOrderBillNew.java
  4. 71 51
      src/main/java/com/goafanti/common/model/TOrderTask.java
  5. 12 9
      src/main/java/com/goafanti/common/utils/DateUtils.java
  6. 28 0
      src/main/java/com/goafanti/common/utils/StringUtils.java
  7. 166 0
      src/main/java/com/goafanti/common/utils/excel/Excel.java
  8. 18 0
      src/main/java/com/goafanti/common/utils/excel/Excels.java
  9. 233 0
      src/main/java/com/goafanti/common/utils/excel/FileUtils.java
  10. 1018 0
      src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java
  11. 48 33
      src/main/java/com/goafanti/order/bo/OrderListBo.java
  12. 37 9
      src/main/java/com/goafanti/order/bo/OutArrearsDunListBo.java
  13. 8 0
      src/main/java/com/goafanti/order/bo/TOrderInvoiceBo.java
  14. 22 10
      src/main/java/com/goafanti/order/bo/TOrderTaskBo.java
  15. 60 0
      src/main/java/com/goafanti/order/bo/UpdateProjectStatusBo.java
  16. 170 0
      src/main/java/com/goafanti/order/bo/managerListBo.java
  17. 15 17
      src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java
  18. 25 31
      src/main/java/com/goafanti/order/controller/AdminOrderReceivablesApiController.java
  19. 1 42
      src/main/java/com/goafanti/order/controller/FundManagerOrderApiController.java
  20. 32 3
      src/main/java/com/goafanti/order/controller/OrderProjectApiController.java
  21. 76 0
      src/main/java/com/goafanti/order/enums/NewProjectStatus.java
  22. 1 7
      src/main/java/com/goafanti/order/service/OrderBillService.java
  23. 0 2
      src/main/java/com/goafanti/order/service/OrderNewService.java
  24. 2 1
      src/main/java/com/goafanti/order/service/OrderProjectService.java
  25. 0 6
      src/main/java/com/goafanti/order/service/OrderReceivablesService.java
  26. 1 30
      src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java
  27. 0 120
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  28. 17 14
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java
  29. 0 101
      src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java
  30. 340 141
      src/main/java/com/goafanti/personnel/bo/OutPersonnelListBo.java
  31. 9 11
      src/main/java/com/goafanti/personnel/controller/AdminPersonnelApiController.java
  32. 0 3
      src/main/java/com/goafanti/personnel/service/PersonnelService.java
  33. 0 102
      src/main/java/com/goafanti/personnel/service/impl/PersonnelServiceImpl.java

+ 36 - 1
src/main/java/com/goafanti/common/controller/PublicController.java

@@ -7,6 +7,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.UUID;
 
@@ -23,6 +24,7 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Scope;
+import org.springframework.http.MediaType;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
@@ -34,18 +36,21 @@ import com.goafanti.admin.service.AdminService;
 import com.goafanti.admin.service.AttachmentService;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.enums.UserType;
 import com.goafanti.common.model.User;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.common.service.IndustryCategoryService;
+import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.LoggerUtils;
 import com.goafanti.common.utils.MobileMessageUtils;
 import com.goafanti.common.utils.PasswordUtil;
 import com.goafanti.common.utils.PictureUtils;
 import com.goafanti.common.utils.TimeUtils;
 import com.goafanti.common.utils.VerifyCodeUtils;
+import com.goafanti.common.utils.excel.FileUtils;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.user.service.UserService;
 
@@ -668,7 +673,37 @@ public class PublicController extends BaseController {
           return cellValue;
           }
     
-            
+          /**
+           * 	通用下载请求
+           * 
+           * @param fileName 文件名称
+           * @param delete 是否删除
+           */
+          @RequestMapping("/download")
+          public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
+          {
+              try
+              {
+                  if (!FileUtils.checkAllowDownload(fileName))
+                  {
+                      throw new Exception("文件名称({})非法,不允许下载。 ");
+                  }
+                  String realFileName =DateUtils.parseDateToStr(AFTConstants.YYYYMMDDHHMMSS, new Date())+fileName.substring(fileName.indexOf("_") + 1);
+                  String filePath = uploadPath +"/"+ fileName;
+
+                  response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
+                  FileUtils.setAttachmentResponseHeader(response, realFileName);
+                  FileUtils.writeBytes(filePath, response.getOutputStream());
+                  if (delete)
+                  {
+                      FileUtils.deleteFile(filePath);
+                  }
+              }
+              catch (Exception e)
+              {
+                  LoggerUtils.error(PublicController.class,"下载文件失败", e);
+              }
+          }    
            
 
 	

+ 1 - 1
src/main/java/com/goafanti/common/mapper/PaymentNodeMapper.xml

@@ -476,7 +476,7 @@
   select a.tid,b.order_no orderNo,c.salesman_id salesmanId,c.salesman_name salesmanName,c.buyer_name userName,d.email from payment_node a 
 left join t_order_task b on a.tid=b.id
 left join t_order_mid c on b.order_no=c.order_no left join admin d on  c.salesman_id=d.id
-where a.tid= #{tid}
+where a.tid= #{tid} limit 1
   </select>
   
    <select id="selectByTidAndCid" resultType="com.goafanti.organization.bo.OutPaymentNode">

+ 40 - 35
src/main/java/com/goafanti/common/model/TOrderBillNew.java

@@ -3,19 +3,41 @@ package com.goafanti.common.model;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import com.goafanti.common.utils.excel.Excel;
+
+
 
 
 public class TOrderBillNew {
-    /**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.bill_no
-	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
-	 */
+    
+	@Excel(name = "订单编号")
+	private String orderNo;
+	@Excel(name = "合同编号")
+	private String contractNo;
+	@Excel(name = "收款时间")
+	private String createTimes;
+	@Excel(name = "财务流水时间")
+	private String financialPayTimes;
+	@Excel(name = "平台流水号")
+	private String financialPayNo;
+	@Excel(name = "金额(万元)")
+	private BigDecimal transactionAmount;
+	@Excel(name = "收款方")
+	private String payeeName;
+	@Excel(name = "付款方")
+	private String payerName;
+	@Excel(name = "流水科目", readConverterExp = "0=代收,1=代付,2退款")
+	private Integer transactionSubject;
+	@Excel(name = "平台流水号")
 	private String billNo;
+	@Excel(name = "收款类型", readConverterExp = "0=手工,1=批量")
+	private Integer type;
+	@Excel(name = "备注")
+	private String remarks;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.order_no
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
-	private String orderNo;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.creater
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
@@ -41,26 +63,16 @@ public class TOrderBillNew {
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
 	private String payerId;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.transaction_amount
-	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
-	 */
-	private BigDecimal transactionAmount;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.transaction_subject
-	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
-	 */
-	private Integer transactionSubject;
+	
+	
+	
+	
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.transaction_channel
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
 	private Integer transactionChannel;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.remarks
-	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
-	 */
-	private String remarks;
+	
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.confirm_sign
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
@@ -71,21 +83,15 @@ public class TOrderBillNew {
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
 	private Byte deleteSign;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.financial_pay_no
-	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
-	 */
-	private String financialPayNo;
+	
+	
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.financial_pay_time
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
 	 */
 	private Date financialPayTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.type
-	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
-	 */
-	private Integer type;
+	
+	
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_bill_new.delete_time
 	 * @mbg.generated  Wed Feb 19 08:54:03 CST 2020
@@ -421,9 +427,8 @@ public class TOrderBillNew {
 		this.refundTime = refundTime;
 	}
 
-	private String financialPayTimes;
-    private String payerName;
-    private String payeeName;
+	
+    
     private String createrName;
     private String startTime;
     private String endTime;
@@ -431,10 +436,10 @@ public class TOrderBillNew {
     private String saleId;
     private String saleName;
     private String departmentName;
-	private String createTimes;
+	
 	private String deleteTimes;
 	private String refundTimes;
-	private String contractNo;
+	
     
     public String getFinancialPayTimes() {
 		return this.financialPayTimes;

+ 71 - 51
src/main/java/com/goafanti/common/model/TOrderTask.java

@@ -4,240 +4,264 @@ import java.math.BigDecimal;
 import java.util.Date;
 
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.common.utils.excel.Excel;
+
 import java.io.Serializable;
 
 public class TOrderTask implements Serializable {
+
     /**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.id
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer id;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.order_no
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name = "订单编号",sort = 2)
 	private String orderNo;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.main
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name="是否主项目",sort = 8,readConverterExp = "0=否,1=是")
 	private Integer main;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.super_id
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String superId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.commodity_id
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String commodityId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.commodity_name
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name = "项目名称",sort = 10)
 	private String commodityName;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.commodity_quantity
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name = "项目数量",sort = 11)
 	private Integer commodityQuantity;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.commodity_mode
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String commodityMode;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.commodity_price
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name = "服务市价",sort = 11)
 	private BigDecimal commodityPrice;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.task_status
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer taskStatus;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.task_distribution_time
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Date taskDistributionTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.task_allocator
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String taskAllocator;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.task_receiver
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String taskReceiver;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.task_comment
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name = "项目说明",sort = 14)
 	private String taskComment;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.task_start_time
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Date taskStartTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.task_end_time
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Date taskEndTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.project_status
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	
 	private Integer projectStatus;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.accept_time
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Date acceptTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.review_time
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Date reviewTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.publicity_time
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Date publicityTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.licence_time
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Date licenceTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.certificate_number
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name = "证书編号",sort = 12)
 	private String certificateNumber;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.status
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer status;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.form_retrieve
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer formRetrieve;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.task_refund
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer taskRefund;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.refund_content
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String refundContent;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.retrieve_content
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String retrieveContent;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.declare_user
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String declareUser;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.declare_pwd
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String declarePwd;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.set_up_amount
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private BigDecimal setUpAmount;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.arrival_money
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer arrivalMoney;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.outsource_name
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name = "外包(内部)公司",sort = 15)
 	private String outsourceName;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.outsource_price
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
+	@Excel(name = "外包(内部)价格",sort = 16)
 	private BigDecimal outsourcePrice;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.consultant_id
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String consultantId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.manager_id
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String managerId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.outsource
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer outsource;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.split_super
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer splitSuper;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.split_status
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer splitStatus;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.split_id
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer splitId;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.split_aid
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String splitAid;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.split_time
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Date splitTime;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.cname
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String cname;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.receiver_name
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private String receiverName;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.declaration_batch
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer declarationBatch;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.cost_reduction
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer costReduction;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.official_cost
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
 	 */
 	private Integer officialCost;
 	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_task.id
+	 * @return  the value of t_order_task.id
+	 * @mbg.generated  Thu Jun 11 09:59:01 CST 2020
+	 */
+	private String specialComment;
+    /**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.id
+	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
+	 */
+	
+	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.set_up_status
 	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
 	 */
@@ -257,11 +281,7 @@ public class TOrderTask implements Serializable {
 	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
 	 */
 	private Integer highTechStatus;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.special_comment
-	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021
-	 */
-	private String specialComment;
+	
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_task.if_certification_fee
 	 * @mbg.generated  Tue Jan 26 11:11:55 CST 2021

+ 12 - 9
src/main/java/com/goafanti/common/utils/DateUtils.java

@@ -5,7 +5,8 @@ import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 
-import org.apache.ibatis.builder.BuilderException;
+
+import com.goafanti.common.error.BusinessException;
 
 public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 
@@ -461,22 +462,24 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
 	/**
 	 * 字符串转日期
 	 * @param date
-	 * @param ymd
+	 * @param format
 	 * @return
 	 * @throws ParseException
 	 */
-	public static Date StringToDate(String date,String ymd) {
-		Date parse=null;
-		SimpleDateFormat dateFormat=new SimpleDateFormat(ymd);
+	public static  Date StringToDate( String date, String format) {
+		Date date2 =new Date();
 		try {
-			parse = dateFormat.parse(date);
+			 new SimpleDateFormat(format).parse(date);
 		} catch (ParseException e) {
-			e.printStackTrace();
-			throw new BuilderException("时间转换失败");
+			throw new BusinessException("转换失败",e);
 		}
-		return parse;
+		return date2;
 	}
 	
 
+	public static final String parseDateToStr(final String format, final Date date) {
+        return new SimpleDateFormat(format).format(date);
+    }
+
 
 }

+ 28 - 0
src/main/java/com/goafanti/common/utils/StringUtils.java

@@ -8,4 +8,32 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
 	public static boolean isFractionalNumeric(String val) {
 		return FRACTIONAL_NUMERIC.matcher(val).matches();
 	}
+	
+	public static boolean isNull(Object value) {
+		return value == null;
+	}
+
+	/**
+	 * * 判断一个对象是否非空
+	 * 
+	 * @param object Object
+	 * @return true:非空 false:空
+	 */
+	public static boolean isNotNull(Object object) {
+		return !isNull(object);
+	}
+
+
+
+	/**
+	 * * 判断一个对象数组是否为空
+	 * 
+	 * @param objects 要判断的对象数组
+	 ** @return true:为空 false:非空
+	 */
+	public static boolean isEmpty(Object[] objects) {
+		return isNull(objects) || (objects.length == 0);
+	}
+
+	
 }

+ 166 - 0
src/main/java/com/goafanti/common/utils/excel/Excel.java

@@ -0,0 +1,166 @@
+package com.goafanti.common.utils.excel;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.math.BigDecimal;
+
+/**
+ * 自定义导出Excel数据注解
+ * 
+ * @author ruoyi
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.FIELD)
+public @interface Excel
+{
+    /**
+     * 导出时在excel中排序
+     */
+    public int sort() default Integer.MAX_VALUE;
+
+    /**
+     * 导出到Excel中的名字.
+     */
+    public String name() default "";
+
+    /**
+     * 日期格式, 如: yyyy-MM-dd
+     */
+    public String dateFormat() default "";
+
+    /**
+     * 如果是字典类型,请设置字典的type值 (如: sys_user_sex)
+     */
+    public String dictType() default "";
+
+    /**
+     *	 读取内容转表达式 (如: 0=男,1=女,2=未知)
+     *	
+     */
+    public String readConverterExp() default "";
+
+    /**
+     * 分隔符,读取字符串组内容
+     */
+    public String separator() default ",";
+
+    /**
+     * BigDecimal 精度 默认:-1(默认不开启BigDecimal格式化)
+     */
+    public int scale() default -1;
+
+    /**
+     * BigDecimal 舍入规则 默认:BigDecimal.ROUND_HALF_EVEN
+     */
+    public int roundingMode() default BigDecimal.ROUND_HALF_EVEN;
+
+    /**
+     * 导出类型(0数字 1字符串)
+     */
+    public ColumnType cellType() default ColumnType.STRING;
+
+    /**
+     * 导出时在excel中每个列的高度 单位为字符
+     */
+    public double height() default 14;
+
+    /**
+     * 导出时在excel中每个列的宽 单位为字符
+     */
+    public double width() default 16;
+
+    /**
+     * 文字后缀,如% 90 变成90%
+     */
+    public String suffix() default "";
+
+    /**
+     * 当值为空时,字段的默认值
+     */
+    public String defaultValue() default "";
+
+    /**
+     * 提示信息
+     */
+    public String prompt() default "";
+
+    /**
+     * 设置只能选择不能输入的列内容.
+     */
+    public String[] combo() default {};
+
+    /**
+     * 是否导出数据,应对需求:有时我们需要导出一份模板,这是标题需要但内容需要用户手工填写.
+     */
+    public boolean isExport() default true;
+
+    /**
+     * 另一个类中的属性名称,支持多级获取,以小数点隔开
+     */
+    public String targetAttr() default "";
+
+    /**
+     * 是否自动统计数据,在最后追加一行统计数据总和
+     */
+    public boolean isStatistics() default false;
+
+    /**
+     * 导出字段对齐方式(0:默认;1:靠左;2:居中;3:靠右)
+     */
+    Align align() default Align.AUTO;
+
+    public enum Align
+    {
+        AUTO(0), LEFT(1), CENTER(2), RIGHT(3);
+        private final int value;
+
+        Align(int value)
+        {
+            this.value = value;
+        }
+
+        public int value()
+        {
+            return this.value;
+        }
+    }
+
+    /**
+     * 字段类型(0:导出导入;1:仅导出;2:仅导入)
+     */
+    Type type() default Type.ALL;
+
+    public enum Type
+    {
+        ALL(0), EXPORT(1), IMPORT(2);
+        private final int value;
+
+        Type(int value)
+        {
+            this.value = value;
+        }
+
+        public int value()
+        {
+            return this.value;
+        }
+    }
+
+    public enum ColumnType
+    {
+        NUMERIC(0), STRING(1), IMAGE(2);
+        private final int value;
+
+        ColumnType(int value)
+        {
+            this.value = value;
+        }
+
+        public int value()
+        {
+            return this.value;
+        }
+    }
+}

+ 18 - 0
src/main/java/com/goafanti/common/utils/excel/Excels.java

@@ -0,0 +1,18 @@
+package com.goafanti.common.utils.excel;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Excel注解集
+ * 
+ * @author ruoyi
+ */
+@Target(ElementType.FIELD)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface Excels
+{
+    Excel[] value();
+}

+ 233 - 0
src/main/java/com/goafanti/common/utils/excel/FileUtils.java

@@ -0,0 +1,233 @@
+package com.goafanti.common.utils.excel;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.apache.commons.lang3.ArrayUtils;
+
+import com.goafanti.common.utils.StringUtils;
+
+/**
+ * 文件处理工具类
+ * 
+ * @author ruoyi
+ */
+public class FileUtils extends org.apache.commons.io.FileUtils
+{
+    public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
+    
+    public static final String[] DEFAULT_ALLOWED_EXTENSION = {
+            // 图片
+            "bmp", "gif", "jpg", "jpeg", "png",
+            // word excel powerpoint
+            "doc", "docx", "xls", "xlsx", "ppt", "pptx", "html", "htm", "txt",
+            // 压缩文件
+            "rar", "zip", "gz", "bz2",
+            // pdf
+            "pdf" };
+
+    /**
+     * 输出指定文件的byte数组
+     * 
+     * @param filePath 文件路径
+     * @param os 输出流
+     * @return
+     */
+    public static void writeBytes(String filePath, OutputStream os) throws IOException
+    {
+        FileInputStream fis = null;
+        try
+        {
+            File file = new File(filePath);
+            if (!file.exists())
+            {
+                throw new FileNotFoundException(filePath);
+            }
+            fis = new FileInputStream(file);
+            byte[] b = new byte[1024];
+            int length;
+            while ((length = fis.read(b)) > 0)
+            {
+                os.write(b, 0, length);
+            }
+        }
+        catch (IOException e)
+        {
+            throw e;
+        }
+        finally
+        {
+            if (os != null)
+            {
+                try
+                {
+                    os.close();
+                }
+                catch (IOException e1)
+                {
+                    e1.printStackTrace();
+                }
+            }
+            if (fis != null)
+            {
+                try
+                {
+                    fis.close();
+                }
+                catch (IOException e1)
+                {
+                    e1.printStackTrace();
+                }
+            }
+        }
+    }
+
+    /**
+     * 删除文件
+     * 
+     * @param filePath 文件
+     * @return
+     */
+    public static boolean deleteFile(String filePath)
+    {
+        boolean flag = false;
+        File file = new File(filePath);
+        // 路径为文件且不为空则进行删除
+        if (file.isFile() && file.exists())
+        {
+            file.delete();
+            flag = true;
+        }
+        return flag;
+    }
+
+    /**
+     * 文件名称验证
+     * 
+     * @param filename 文件名称
+     * @return true 正常 false 非法
+     */
+    public static boolean isValidFilename(String filename)
+    {
+        return filename.matches(FILENAME_PATTERN);
+    }
+
+    /**
+     * 检查文件是否可下载
+     * 
+     * @param resource 需要下载的文件
+     * @return true 正常 false 非法
+     */
+    public static boolean checkAllowDownload(String resource)
+    {
+        // 禁止目录上跳级别
+        if (StringUtils.contains(resource, ".."))
+        {
+            return false;
+        }
+
+        // 检查允许下载的文件规则
+        if (ArrayUtils.contains(DEFAULT_ALLOWED_EXTENSION, getFileType(resource)))
+        {
+            return true;
+        }
+
+        // 不在允许下载的文件规则
+        return false;
+    }
+
+    /**
+     * 下载文件名重新编码
+     * 
+     * @param request 请求对象
+     * @param fileName 文件名
+     * @return 编码后的文件名
+     */
+    public static String setFileDownloadHeader(HttpServletRequest request, String fileName) throws UnsupportedEncodingException
+    {
+        final String agent = request.getHeader("USER-AGENT");
+        String filename = fileName;
+        if (agent.contains("MSIE"))
+        {
+            // IE浏览器
+            filename = URLEncoder.encode(filename, "utf-8");
+            filename = filename.replace("+", " ");
+        }
+        else if (agent.contains("Firefox"))
+        {
+            // 火狐浏览器
+            filename = new String(fileName.getBytes(), "ISO8859-1");
+        }
+        else if (agent.contains("Chrome"))
+        {
+            // google浏览器
+            filename = URLEncoder.encode(filename, "utf-8");
+        }
+        else
+        {
+            // 其它浏览器
+            filename = URLEncoder.encode(filename, "utf-8");
+        }
+        return filename;
+    }
+
+    /**
+     * 下载文件名重新编码
+     *
+     * @param response 响应对象
+     * @param realFileName 真实文件名
+     * @return
+     */
+    public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException
+    {
+        String percentEncodedFileName = percentEncode(realFileName);
+
+        StringBuilder contentDispositionValue = new StringBuilder();
+        contentDispositionValue.append("attachment; filename=")
+                .append(percentEncodedFileName)
+                .append(";")
+                .append("filename*=")
+                .append("utf-8''")
+                .append(percentEncodedFileName);
+
+        response.setHeader("Content-disposition", contentDispositionValue.toString());
+    }
+
+    /**
+     * 百分号编码工具方法
+     *
+     * @param s 需要百分号编码的字符串
+     * @return 百分号编码后的字符串
+     */
+    public static String percentEncode(String s) throws UnsupportedEncodingException
+    {
+        String encode = URLEncoder.encode(s, StandardCharsets.UTF_8.toString());
+        return encode.replaceAll("\\+", "%20");
+    }
+    
+    /**
+     * 获取文件类型
+     * <p>
+     * 例如: ruoyi.txt, 返回: txt
+     *
+     * @param fileName 文件名
+     * @return 后缀(不含".")
+     */
+    public static String getFileType(String fileName)
+    {
+        int separatorIndex = fileName.lastIndexOf(".");
+        if (separatorIndex < 0)
+        {
+            return "";
+        }
+        return fileName.substring(separatorIndex + 1).toLowerCase();
+    }
+
+}

File diff suppressed because it is too large
+ 1018 - 0
src/main/java/com/goafanti/common/utils/excel/NewExcelUtil.java


+ 48 - 33
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -2,38 +2,62 @@ package com.goafanti.order.bo;
 
 import java.math.BigDecimal;
 
+import com.goafanti.common.utils.excel.Excel;
+
+
 /**
  * 订单列表
  * @author Administrator
  *
  */
 public class OrderListBo {
-	/** 订单编号 **/
+
+	@Excel(name = "订单编号")
 	private String orderNo;
+	@Excel(name = "合同编号")
+	private String contractNo;
+	@Excel(name = "客户名称")
+	private String buyerName;
+	@Excel(name = "订单部门")
+	private String departmentName;
+	@Excel(name = "订单负责人")
+	private String sellerName;
+	@Excel(name = "签单日期")
+	private String signTime;
+	@Excel(name = "下单日期")
+	private String createTime;
+	@Excel(name = "签单金额(万元)")
+	private BigDecimal signTotalAmount;
+	@Excel(name = "已开票金额(万元)")
+	private BigDecimal invoiceAmount;
+	@Excel(name = "已收金额(万元)")
+	private BigDecimal actuallyTotalAmount;
+	@Excel(name = "总成本(万元)")
+	private BigDecimal  costAmount;
+	@Excel(name = "已付成本(万元)")
+	private BigDecimal paymentAmount;
+	@Excel(name = "最近收款(万元)")
+	private BigDecimal finalReceivables;
+	@Excel(name = "最近收款时间")
+	private String finalReceivablesTime;
+	@Excel(name="结算状态",readConverterExp = "0=首付待付请,1=尾款待付清,2=已付请,3=部分退款,4=全部退款")
+	private Integer liquidationStatus;
+	@Excel(name="订单流程",readConverterExp = "0=已派营销员,1=已派营销员管理员,2=已派财务管理员,3=已派财务专员,4=已派咨询师管理员,5=已部分派咨询师经理,6=已部全部派咨询师经理")
+	private Integer processStatus;
+	@Excel(name="是否特批" ,readConverterExp = "0=非特批,1=待审核,2=通过,3=驳回")
+	private Integer approval;
 	/** 订单类型 **/
 	private Integer orderType;
 	/** 业务品类 **/
 	private String projectType;
-	/** 订单创建时间 **/
-	private String createTime;
-	/** 签单时间 **/
-	private String signTime;
+	
 	/** 合同首付金额 **/
 	private BigDecimal signFirstPayment;
-	/** 合同订单金额 **/
-	private BigDecimal signTotalAmount;
-	/** 实际付款金额 **/
-	private BigDecimal actuallyTotalAmount;
-	/** 买方姓名 **/
-	private String buyerName;
-	/** 卖方姓名 **/
-	private String sellerName;
+	
 	/** 订单状态 **/
 	private Integer orderStatus;
-	/** 结算状态 **/
-	private Integer liquidationStatus;
-	/** 是否特批 **/
-	private Integer approval;
+	
+	
 	/** 订单渠道 **/
 	private Integer orderChannel;
 	/** 营销员 **/
@@ -43,8 +67,7 @@ public class OrderListBo {
 	private String financeId;
 	/** 技术员 **/
 	private String technicianName;
-	/** 关联部门名称 **/
-	private String departmentName;
+
 	/** 订单阶段 **/
 	private Integer orderStage;
 	/** 项目阶段 **/
@@ -59,8 +82,7 @@ public class OrderListBo {
 	private Integer changeStatus;
 	/** 可操作状态 **/
 	private OperatorActive active;
-	/** 流程状态 **/
-	private Integer processStatus;
+	
 	/** 搜索开始时间 **/
 	private String startTime;
 	/** 搜索结束时间 **/
@@ -70,20 +92,15 @@ public class OrderListBo {
 	private String companyId;
 	/** 收款公司名称 **/
 	private String companyName;
-	/** 合同编号 */
-	private String contractNo;
 	/** 部门编号*/
 	private String departmentId;
 	/** 外包*/
 	private Integer outsource;
 	/** 外包名称*/
 	private String outsourceName;
-	/** 最后收款 */
-	private BigDecimal finalReceivables;
-	/** 最后收款 时间*/
-	private String finalReceivablesTime;
-	/** 开票金额 */
-	private BigDecimal invoiceAmount;
+	
+	
+
 	/** 结束最后收款 时间*/
 	private String endFinalReceivablesTime;
 	/** 开始最后收款 时间*/
@@ -98,10 +115,8 @@ public class OrderListBo {
 	private BigDecimal orderReceivables;
 	/**欠款 */
 	private BigDecimal  orderArrears;
-	/**总成本*/
-	private BigDecimal  costAmount;
-	/**已付成本*/
-	private BigDecimal paymentAmount;
+	
+	
 	
 	public BigDecimal getFinalReceivables() {
 		return finalReceivables;

+ 37 - 9
src/main/java/com/goafanti/order/bo/OutArrearsDunListBo.java

@@ -2,24 +2,47 @@ package com.goafanti.order.bo;
 
 import java.math.BigDecimal;
 
+import com.goafanti.common.utils.excel.Excel;
+import com.goafanti.order.enums.NewProjectStatus;
+
+
 public class OutArrearsDunListBo {
 	private String id;
+	@Excel(name = "合同编号")
 	private String contractNo;
+	@Excel(name = "订单编号")
 	private String orderNo;
+	@Excel(name = "客户名称")
 	private String userName;
+	@Excel(name = "订单负责人")
 	private String salesmanName;
-   	private Integer projectStatus;
+	@Excel(name = "订单部门")
+   	private String depName;
+	@Excel(name = "订单状态",readConverterExp = "0=待签单,1=签单待审,2=签单审核通过,3=签单审核拒绝,4=已结项,5=已驳回,6=退单中,7=已退单")
+   	private Integer orderStatus;
+	private Integer projectStatus;
+	@Excel(name = "项目状态")
+	private String projectStatusName;
+	@Excel(name = "签单金额(万元)")
    	private BigDecimal totalAmount;
+	@Excel(name = "已收款(万元)")
+	private BigDecimal settlementAmount;
+	@Excel(name = "结算状态",readConverterExp = "0=首付待付请,1=尾款待付清,2=已付请,3=部分退款,4=全部退款")
    	private Integer liquidationStatus;
-   	private BigDecimal settlementAmount;
+	@Excel(name = "催收科目",readConverterExp = "0=按时触发应收款")
+	private Integer type;
+	@Excel(name = "欠款催收")
+	private BigDecimal orderArrears;
+	@Excel(name = "合同编号")
    	private BigDecimal orderReceivables;
-   	private BigDecimal orderArrears;
-   	private Integer orderStatus; 
-   	private String startDate;
-   	private Integer type;
-   	private String depName;
-   	private String signDate;
-   	private Integer dunStatus;
+	@Excel(name = "催款状态",readConverterExp = "0=未启动,1=催款中,2=已完成,3=已暂停")
+	private Integer dunStatus;
+	@Excel(name = "催款启动时间")
+	private String startDate;
+	@Excel(name = "下单时间")
+	private String signDate;
+	
+   	
 	public String getId() {
 		return id;
 	}
@@ -55,6 +78,7 @@ public class OutArrearsDunListBo {
 	}
 	public void setProjectStatus(Integer projectStatus) {
 		this.projectStatus = projectStatus;
+		this.projectStatusName=NewProjectStatus.getValueByCode(projectStatus);
 	}
 	public BigDecimal getTotalAmount() {
 		return totalAmount;
@@ -122,6 +146,10 @@ public class OutArrearsDunListBo {
 	public void setType(Integer type) {
 		this.type = type;
 	}
+	
+	public void setProjectStatusName(String projectStatusName) {
+		this.projectStatusName = projectStatusName;
+	}
    	
    	
 

+ 8 - 0
src/main/java/com/goafanti/order/bo/TOrderInvoiceBo.java

@@ -2,17 +2,25 @@ package com.goafanti.order.bo;
 
 import java.math.BigDecimal;
 
+import com.goafanti.common.utils.excel.Excel;
+
+
 public class TOrderInvoiceBo {
+	@Excel(name = "编号")
 	private Integer id;
 	private String unitName;
+	@Excel(name = "订单编号")
 	private String orderno;
 	private String contractNo;
 	private String name;
 	private Integer projectStatus;
 	private Integer processStatus;
 	private BigDecimal sumAmount;
+	@Excel(name = "开票金额(万元)")
 	private BigDecimal amount;
+	@Excel(name = "申请时间")
 	private String createTime;
+	@Excel(name = "开票状态",readConverterExp = "1=处理中,2通过")
 	private Integer status;
 	private BigDecimal notAmount;
 	private BigDecimal settlementAmount;

+ 22 - 10
src/main/java/com/goafanti/order/bo/TOrderTaskBo.java

@@ -3,6 +3,8 @@ package com.goafanti.order.bo;
 import java.math.BigDecimal;
 
 import com.goafanti.common.model.TOrderTask;
+import com.goafanti.common.utils.excel.Excel;
+import com.goafanti.order.enums.NewProjectStatus;
 
 public class TOrderTaskBo extends TOrderTask{
 	/**
@@ -11,17 +13,21 @@ public class TOrderTaskBo extends TOrderTask{
 	private static final long serialVersionUID = 1L;
 	private String contacts;
 	private String contactsMobile;
+	@Excel(name = "合同编号",sort = 9)
 	private String cname;
 	private Integer cSort;
+	
+	@Excel(name = "合同编号",sort = 1)
 	private String contractNo;
-
+	@Excel(name = "订单负责人",sort = 4)
 	private String salesmanName;
+	@Excel(name = "项目负责人",sort = 7)
 	private String consultantName;
-
+	@Excel(name = "订单部门",sort = 5)
 	private String depName;
-
+	@Excel(name = "客户名称",sort = 3)
 	private String userName;
-	
+	@Excel(name = "订单状态",sort = 6,readConverterExp = "0=待签单,1=签单待审,2=签单审核通过,3=签单审核拒绝,4=已结项,5=已驳回,6=已退单")
 	private Integer orderStatus;
 	
 	private Integer type;
@@ -30,6 +36,18 @@ public class TOrderTaskBo extends TOrderTask{
 	
 	private BigDecimal appropriationRatio;
 	
+	@Excel(name = "项目状态",sort = 13)
+	private String projectStatusName;
+	
+	public String getProjectSatusName() {
+		return projectStatusName;
+	}
+	
+	public void setProjectStatus(Integer projectStatus) {
+		super.setProjectStatus(projectStatus);
+		this.projectStatusName=NewProjectStatus.getValueByCode(projectStatus);
+	}
+	
 	
 	public String getContractNo() {
 		return contractNo;
@@ -103,12 +121,6 @@ public class TOrderTaskBo extends TOrderTask{
 	public void setType(Integer type) {
 		this.type = type;
 	}
-	public String getConsultantName() {
-		return consultantName;
-	}
-	public void setConsultantName(String consultantName) {
-		this.consultantName = consultantName;
-	}
 	
 	
 }

+ 60 - 0
src/main/java/com/goafanti/order/bo/UpdateProjectStatusBo.java

@@ -0,0 +1,60 @@
+package com.goafanti.order.bo;
+
+
+import javax.validation.constraints.NotNull;
+
+
+public class UpdateProjectStatusBo {
+
+	@NotNull(message = "项目编号必须指定") 
+	private Integer tid;
+	@NotNull(message = "项目状态必须指定")
+	Integer projectStatus;
+	
+	private String timeRecord;
+	
+	private String certificateNumber;
+	
+	private String setUpAmount;
+
+	public Integer getTid() {
+		return tid;
+	}
+
+	public void setTid(Integer tid) {
+		this.tid = tid;
+	}
+
+	public Integer getProjectStatus() {
+		return projectStatus;
+	}
+
+	public void setProjectStatus(Integer projectStatus) {
+		this.projectStatus = projectStatus;
+	}
+
+	public String getTimeRecord() {
+		return timeRecord;
+	}
+
+	public void setTimeRecord(String timeRecord) {
+		this.timeRecord = timeRecord;
+	}
+
+	public String getCertificateNumber() {
+		return certificateNumber;
+	}
+
+	public void setCertificateNumber(String certificateNumber) {
+		this.certificateNumber = certificateNumber;
+	}
+
+	public String getSetUpAmount() {
+		return setUpAmount;
+	}
+
+	public void setSetUpAmount(String setUpAmount) {
+		this.setUpAmount = setUpAmount;
+	} 
+	
+}

+ 170 - 0
src/main/java/com/goafanti/order/bo/managerListBo.java

@@ -0,0 +1,170 @@
+package com.goafanti.order.bo;
+
+import com.goafanti.common.utils.excel.Excel;
+import com.goafanti.order.enums.NewProjectStatus;
+
+public class managerListBo {
+	@Excel(name = "项目编号")
+	private String id;
+	@Excel(name = "派单时间")
+	private String taskDistributionTime;
+	@Excel(name = "派单省份")
+	private String provinceName;
+	@Excel(name = "订单部门")
+	private String depName;
+	@Excel(name = "营销员")
+	private String salesmanName;
+	@Excel(name = "合同编号")
+	private String contractNo;
+	@Excel(name = "订单编号")
+	private String orderNo;
+	@Excel(name = "签单客户")
+	private String UserName;
+	@Excel(name = "项目类型")
+	private String cname;
+	@Excel(name = "项目名称")
+	private String commodityName;
+	@Excel(name = "数量")
+	private String commodityQuantity;
+	@Excel(name = "负责部门")
+	private String techDepName;
+	@Excel(name = "咨询师/咨询师经理")
+	private String techName;
+	@Excel(name = "项目状态")
+	private String projectStatusName;
+	private String projectStatus;
+	@Excel(name = "项目金额")
+	private String commodityPrice;
+	@Excel(name = "特批说明")
+	private String specialComment;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getTaskDistributionTime() {
+		return taskDistributionTime;
+	}
+
+	public void setTaskDistributionTime(String taskDistributionTime) {
+		this.taskDistributionTime = taskDistributionTime;
+	}
+
+	public String getProvinceName() {
+		return provinceName;
+	}
+
+	public void setProvinceName(String provinceName) {
+		this.provinceName = provinceName;
+	}
+
+	public String getDepName() {
+		return depName;
+	}
+
+	public void setDepName(String depName) {
+		this.depName = depName;
+	}
+
+	public String getSalesmanName() {
+		return salesmanName;
+	}
+
+	public void setSalesmanName(String salesmanName) {
+		this.salesmanName = salesmanName;
+	}
+
+	public String getContractNo() {
+		return contractNo;
+	}
+
+	public void setContractNo(String contractNo) {
+		this.contractNo = contractNo;
+	}
+
+	public String getOrderNo() {
+		return orderNo;
+	}
+
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+
+	public String getUserName() {
+		return UserName;
+	}
+
+	public void setUserName(String userName) {
+		UserName = userName;
+	}
+
+	public String getCname() {
+		return cname;
+	}
+
+	public void setCname(String cname) {
+		this.cname = cname;
+	}
+
+	public String getCommodityName() {
+		return commodityName;
+	}
+
+	public void setCommodityName(String commodityName) {
+		this.commodityName = commodityName;
+	}
+
+	public String getCommodityQuantity() {
+		return commodityQuantity;
+	}
+
+	public void setCommodityQuantity(String commodityQuantity) {
+		this.commodityQuantity = commodityQuantity;
+	}
+
+	public String getTechDepName() {
+		return techDepName;
+	}
+
+	public void setTechDepName(String techDepName) {
+		this.techDepName = techDepName;
+	}
+
+	public String getTechName() {
+		return techName;
+	}
+
+	public void setTechName(String techName) {
+		this.techName = techName;
+	}
+
+	public String getProjectStatus() {
+		return projectStatus;
+	}
+
+	public void setProjectStatus(String projectStatus) {
+		this.projectStatus = projectStatus;
+		this.projectStatusName=NewProjectStatus.getValueByCode(Integer.valueOf(projectStatus));
+	}
+
+	public String getCommodityPrice() {
+		return commodityPrice;
+	}
+
+	public void setCommodityPrice(String commodityPrice) {
+		this.commodityPrice = commodityPrice;
+	}
+
+	public String getSpecialComment() {
+		return specialComment;
+	}
+
+	public void setSpecialComment(String specialComment) {
+		this.specialComment = specialComment;
+	}
+
+}

+ 15 - 17
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -5,12 +5,14 @@ package com.goafanti.order.controller;
 import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
@@ -21,7 +23,10 @@ import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.TOrderNewWithBLOBs;
 import com.goafanti.common.model.TOrderRefundWithBLOBs;
 import com.goafanti.common.model.TOrderTask;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.InputArrearsDunListBo;
+import com.goafanti.order.bo.OutArrearsDunListBo;
+import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.enums.ApprovalNewState;
 import com.goafanti.order.enums.OrderNewState;
 import com.goafanti.order.service.OrderNewService;
@@ -32,6 +37,8 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	
 	@Autowired
 	private OrderNewService orderNewService;
+	@Value(value = "${upload.path}")
+	private String	uploadPath			= null;
 	/**
 	 * 创建订单
 	 * @param uid
@@ -510,31 +517,22 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	 */
 	@RequestMapping(value = "/exportOrderTaskData", method = RequestMethod.GET)
 	public Result exportOrderTaskData(String orderNo,HttpServletResponse response){
-		 Result res = new Result();
- 		try {
- 			orderNewService.exportOrderTaskData(  orderNo,response);
-		} catch (Exception e) {
-			res.getError().add(buildError("格式不正确"));
-			return res;
-		}
- 		return res;
+		List<TOrderTaskBo> list=orderNewService.selectOrderTask(orderNo);
+		NewExcelUtil<TOrderTaskBo>excel=new NewExcelUtil<>(TOrderTaskBo.class);
+		 return  excel.exportExcel(list,"订单项目列表",response);
 	}
 	
 	
 	/**
-	 * 	项目列表下载 
+	 * 	催款信息下载 
 	 * @throws IOException 
 	 */
 	@RequestMapping(value = "/exportArrearsDunListData", method = RequestMethod.GET)
 	public Result exportArrearsDunListData(InputArrearsDunListBo in,HttpServletResponse response){
-		 Result res = new Result();
- 		try {
- 			orderNewService.exportArrearsDunListData(  in,response);
-		} catch (Exception e) {
-			res.getError().add(buildError("格式不正确"));
-			return res;
-		}
- 		return res;
+		@SuppressWarnings("unchecked")
+		List<OutArrearsDunListBo> list=(List<OutArrearsDunListBo>) orderNewService.arrearsDunList(in).getList();
+		NewExcelUtil<OutArrearsDunListBo>excel=new NewExcelUtil<>(OutArrearsDunListBo.class);
+		 return  excel.exportExcel(list,"欠款催款列表",response);
 	}
 	
 }

+ 25 - 31
src/main/java/com/goafanti/order/controller/AdminOrderReceivablesApiController.java

@@ -6,6 +6,7 @@ package com.goafanti.order.controller;
 
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.annotation.Resource;
@@ -29,10 +30,15 @@ import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Attachment;
 import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
+import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.order.bo.OrderListBo;
 import com.goafanti.order.bo.ReceivablesListBo;
+import com.goafanti.order.bo.TOrderInvoiceBo;
 import com.goafanti.order.bo.TemporaryReceivablesBo;
+import com.goafanti.order.service.FundManageOrderService;
 import com.goafanti.order.service.OrderBillService;
+import com.goafanti.order.service.OrderInvoiceService;
 import com.goafanti.order.service.OrderReceivablesService;
 
 @RestController
@@ -45,6 +51,10 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
 	private AttachmentService	attachmentService;
 	@Resource
 	private OrderBillService	orderBillService;
+	@Resource
+	private OrderInvoiceService	orderInvoiceService;
+	@Resource
+	private FundManageOrderService	fundManageOrderService;
 	/**
 	 * 	新增预计回款信息
 	 * @param t
@@ -198,17 +208,13 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
      */
     @RequestMapping(value = "/exportReceivables" , method = RequestMethod.GET)
     public Result exportReceivables(HttpServletResponse response,OrderListBo o,Integer pageSize ,Integer pageNo)  {
-    	Result res=new Result();
-			try {
-				orderReceivablesService.exportReceivables( response, o,pageSize,pageNo);
-			} catch (Exception e) {
-				res.getError().add(buildError("格式不正确"));
-				e.printStackTrace();
-				return res;
-			}
-         res.data(1); 
-    	return res;
-    }
+    	@SuppressWarnings("unchecked")
+    	Pagination<OrderListBo> p=(Pagination<OrderListBo>) fundManageOrderService.financeList(o, pageNo, pageSize).get("pagination");
+		@SuppressWarnings("unchecked")
+		List<OrderListBo> list=(List<OrderListBo>)p.getList() ;
+    	NewExcelUtil<OrderListBo>excel=new NewExcelUtil<>(OrderListBo.class);
+		 return  excel.exportExcel(list,"订单回款列表",response);
+    	}
     
     /**
 	 * 	导出开票
@@ -218,16 +224,10 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
      */
     @RequestMapping(value = "/exportInvoice" , method = RequestMethod.GET)
     public Result exportInvoice(HttpServletResponse response,String orderNo,Integer pageSize ,Integer pageNo)  {
-    	Result res=new Result();
-			try {
-				orderReceivablesService.exportInvoice( response, orderNo,pageSize,pageNo);
-			} catch (Exception e) {
-				res.getError().add(buildError("格式不正确"));
-				e.printStackTrace();
-				return res;
-			}
-         res.data(1); 
-    	return res;
+		@SuppressWarnings("unchecked")
+    	List<TOrderInvoiceBo>list=(List<TOrderInvoiceBo>) orderInvoiceService.salesmanOrderInvoiceList( orderNo, pageNo,pageSize).getList();
+    	NewExcelUtil<TOrderInvoiceBo>excel=new NewExcelUtil<>(TOrderInvoiceBo.class);
+		 return  excel.exportExcel(list,"订单"+orderNo+"开票列表",response); 
     }
     /**
 	 * 	导出流水
@@ -237,15 +237,9 @@ public class AdminOrderReceivablesApiController extends CertifyApiController {
      */
     @RequestMapping(value = "/exportMyBill" , method = RequestMethod.GET)
     public Result exportMyBill(HttpServletResponse response, TOrderBillNew billNew,Integer pageSize ,Integer pageNo)  {
-    	Result res=new Result();
-			try {
-				orderReceivablesService.exportMyBill( response, billNew,pageSize,pageNo);
-			} catch (Exception e) {
-				res.getError().add(buildError("格式不正确"));
-				e.printStackTrace();
-				return res;
-			}
-         res.data(1); 
-    	return res;
+    	@SuppressWarnings("unchecked")
+		List<TOrderBillNew>list=(List<TOrderBillNew>) orderBillService.myBillList(billNew,pageNo, pageSize).getList();
+    	NewExcelUtil<TOrderBillNew>excel=new NewExcelUtil<>(TOrderBillNew.class);
+		 return  excel.exportExcel(list,"订单流水列表",response); 
     }
 }

+ 1 - 42
src/main/java/com/goafanti/order/controller/FundManagerOrderApiController.java

@@ -302,48 +302,7 @@ public class FundManagerOrderApiController extends CertifyApiController {
 		return res;
 	}
 	
-	/**
-	 * 下载部门流水数据
-	 * @param billNew
-	 * @param response
-	 * @return
-	 * @throws IOException 
-	 */
-	 @RequestMapping(value="/exportBillData", method = RequestMethod.GET)
-	 public Result exportBillData(TOrderBillNew billNew,HttpServletResponse response) throws IOException{
-		 OutputStream out = response.getOutputStream();
-		 Result res = new Result();
-		 XSSFWorkbook wb = orderBillServiceImpl.exportBillData(billNew);
-		 if(null == wb){
-			 wb = new XSSFWorkbook();
-			XSSFSheet sheet = wb.createSheet("没有流水记录");
-			XSSFRow row = sheet.createRow(0);
-			XSSFCell cell = row.createCell(0);
-			cell.setCellValue("没有流水记录");
-		 }
-		 String fileName = "部门流水" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-		 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-		 response.setContentType("application/octet-stream;charset=utf-8");  
-		 /*String fileName = "部门流水" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-		 ExportExcelUtil.download(path,response,fileName);
-		 res.setData(path);
-		 //删除
-		 File f = new File(path);
-		 if(f.exists()){
-			 System.out.println("shanchu----------------------0");
-			 f.delete();
-		 }*/
-		try {
-			// 返回数据流
-			wb.write(out); 
-			out.flush();
-			out.close();
-		} finally {
-			out.flush(); 
-			out.close(); 
-		}
-		return res;
-	 }
+	
 	 
 	 /**
 	  * 修改合同编号

+ 32 - 3
src/main/java/com/goafanti/order/controller/OrderProjectApiController.java

@@ -4,11 +4,15 @@ package com.goafanti.order.controller;
 import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.List;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
 
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
@@ -18,10 +22,13 @@ import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.TTaskHours;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TaskProgressBo;
+import com.goafanti.order.bo.UpdateProjectStatusBo;
 import com.goafanti.order.bo.inuptTaskHoursListBo;
 import com.goafanti.order.bo.inuptTaskListBo;
+import com.goafanti.order.bo.managerListBo;
 import com.goafanti.order.service.OrderProjectService;
 
 @RestController
@@ -29,8 +36,9 @@ import com.goafanti.order.service.OrderProjectService;
 public class OrderProjectApiController extends CertifyApiController {
 	
 	@Autowired
-	
 	private OrderProjectService	orderProjectService;
+	@Value(value = "${upload.path}")
+	private String	uploadPath			= null;
 	
 	/**
 	 * 项目分配
@@ -85,6 +93,23 @@ public class OrderProjectApiController extends CertifyApiController {
 				 depId, techDepId  , declarationBatch  ,commodityPrice,startTime, endTime , pageNo, pageSize));
 		return res;
 	}
+	
+	
+	/**
+	 * 经理查询订单
+	 */
+	@RequestMapping(value="/exportManagerSelect" ,method = RequestMethod.GET)
+	public Result exportManagerSelect(String name,String orderNo,String contractNo,String cid,String projectType,
+			String depId,String techDepId  ,Integer declarationBatch  ,String commodityPrice,String startTime,
+			String endTime,Integer pageNo,Integer pageSize){
+		@SuppressWarnings("unchecked")
+		List<managerListBo> list=(List<managerListBo>) orderProjectService.managerSelect( name, orderNo, contractNo, 
+				cid, projectType,depId, techDepId  , declarationBatch  ,commodityPrice,startTime, endTime , pageNo, pageSize).getList();
+		NewExcelUtil<managerListBo> excel=new NewExcelUtil<>(managerListBo.class);
+		return excel.exportExcel(list, "企业项目查询列表", uploadPath);
+	}
+	
+	
 	/**
 	 * 任务详情
 	 */
@@ -107,9 +132,13 @@ public class OrderProjectApiController extends CertifyApiController {
 	 * 修改状态(咨询师)
 	 */
 	@RequestMapping(value="/updateProjectStatus" ,method = RequestMethod.POST)
-	public Result updateProjectStatus(Integer  tid,Integer projectStatus,String timeRecord ){
+	public Result updateProjectStatus(@Valid UpdateProjectStatusBo a,BindingResult bindingResult){
 		Result res=new Result();
-		res.setData(orderProjectService.updateProjectStatus(tid, projectStatus, timeRecord ));
+		if (bindingResult.hasErrors()) {
+			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage()));
+            return res;
+		}
+		res.setData(orderProjectService.updateProjectStatus( a));
 		return res;
 	}
 	/**

+ 76 - 0
src/main/java/com/goafanti/order/enums/NewProjectStatus.java

@@ -0,0 +1,76 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 	高新
+ *	0未启动 1进行中 2暂停(客户通知暂停)3暂停(业务线通知暂停)4已提交 5未推荐 6已推荐 7未公示 8已公示 9已备案 10已下证 11退单(已申报)12退单(未申报)
+ *	科技
+ *	0-6 13已答辩 14未立项 15已立项 16前补助 17后补助 18立项已拨款 11-12
+ *	专利
+ *	0-4 19已完成/下证 20已驳回 11-12
+ *	软著
+ *	0-4 19-20(4已提交=公示)
+ *	会员
+ *	0-3 21第1年进行中 22第1年服务完成 23第2年进行中 24第2年服务完成 25第3年进行中 26第3年服务完成 27所有会员服务全部完成 11-12
+ * @author Administrator
+ *
+ */
+public enum NewProjectStatus {
+
+	WQD(0,"未启动"), JXZ(1,"进行中"), ZTKE(2,"暂停(客户通知暂停)"), ZTYW(3,"暂停(业务线通知暂停)"), YTJ(4,"已提交"), WTUIJIAN(5,"未推荐"),
+	YTUIJIAN(6,"已推荐"), WNGS(7,"未拟公示"), YNGS(8,"已拟公示"),CCWBA(28,"抽查未备案"), YBA(9,"已备案"), YXZ(10,"已下证 "), TDYSB(11,"退单(已申报)"),
+	TDWSB(12,"退单(未申报)"),
+	YDB(13,"已答辩"),WLX(14,"未立项"),YLX(15,"已立项"),QBZ(16,"前补助"),HBZ(17,"后补助"),LXYBK(18,"立项已拨款"),
+	YWCXZ(19,"已完成/下证"),YBH(20,"已驳回"),
+	D1NJX(21,"第1年进行中"),D1NWC(22,"第1年服务完成"),D2NJX(23,"第2年进行中"),D2NWC(24,"第2年服务完成"),D3NJX(25,"第3年进行中"),D3NWC(26,"第3年服务完成"),
+	QBWC(27,"所有会员服务全部完成"),
+	INVALID(99,"");
+	
+	
+	private NewProjectStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, NewProjectStatus> status = new HashMap<Integer, NewProjectStatus>();
+
+	static {
+		for (NewProjectStatus value : NewProjectStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static NewProjectStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return INVALID;
+	}
+	public static String getValueByCode(Integer code){
+        for(NewProjectStatus orderType:NewProjectStatus.values()){
+            if(code.equals(orderType.getCode())){
+                return orderType.getDesc();
+            }
+        }
+        return  INVALID.getDesc();
+    }
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 1 - 7
src/main/java/com/goafanti/order/service/OrderBillService.java

@@ -1,6 +1,5 @@
 package com.goafanti.order.service;
 
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 
 import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -17,12 +16,7 @@ public interface OrderBillService {
 	 */
 	Pagination<TOrderBillNew> myBillList(TOrderBillNew billNew,  Integer pageNo, Integer pageSize);
 	
-	/**
-	 * 导出流水数据
-	 * @param billNew
-	 * @return
-	 */
-	XSSFWorkbook exportBillData(TOrderBillNew billNew);
+	
 
 	int deleteMyBill(String billNo);
 }

+ 0 - 2
src/main/java/com/goafanti/order/service/OrderNewService.java

@@ -197,11 +197,9 @@ public interface OrderNewService {
 	List<TOrderLogBo> selectOrderLog(String orderNo);
 
 	void pushGeneralSendNoticeAndEmail(List<String> alist, Integer type,String OrderNo,String adminId,Integer approval);
-	void exportOrderTaskData(String orderNo, HttpServletResponse response)throws IOException,BusinessException ;
 	
 	int pushOutsourceProjectAudit(TOrderOutsource o);
 	Pagination<OutArrearsDunListBo> arrearsDunList(InputArrearsDunListBo in);
-	void exportArrearsDunListData(InputArrearsDunListBo in, HttpServletResponse response) throws IOException;
 	void pushOrderDun(String orderNo);
 	int checkOutAudit(Integer id);
 	

+ 2 - 1
src/main/java/com/goafanti/order/service/OrderProjectService.java

@@ -13,6 +13,7 @@ import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TOrderTaskListBo;
 import com.goafanti.order.bo.TaskLogBo;
 import com.goafanti.order.bo.TaskProgressBo;
+import com.goafanti.order.bo.UpdateProjectStatusBo;
 import com.goafanti.order.bo.inuptTaskHoursListBo;
 import com.goafanti.order.bo.inuptTaskListBo;
 import com.goafanti.order.bo.managerListBo;
@@ -67,7 +68,7 @@ public interface OrderProjectService {
 	Pagination<managerListBo> managerSelect(String name, String orderNo, String contractNo, String cid, String projectType, String depId,
 			String techDepId, Integer declarationBatch, String commodityPrice, String startTime, String endTime, Integer pageNo, Integer pageSize);
 
-	int updateProjectStatus(Integer tid, Integer projectStatus, String timeRecord);
+	int updateProjectStatus(UpdateProjectStatusBo b);
 
 
 

+ 0 - 6
src/main/java/com/goafanti/order/service/OrderReceivablesService.java

@@ -2,13 +2,10 @@ package com.goafanti.order.service;
 
 import java.util.Map;
 
-import javax.servlet.http.HttpServletResponse;
 
 import org.springframework.web.multipart.MultipartFile;
 
-import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.order.bo.OrderListBo;
 import com.goafanti.order.bo.ReceivablesListBo;
 import com.goafanti.order.bo.TemporaryReceivablesBo;
 
@@ -34,11 +31,8 @@ public interface OrderReceivablesService {
 	Map<String, Object> getCountlistReceivables(ReceivablesListBo rl, Integer status, String adminName, String adminDepId,
 			String orderDepId);
 
-	void exportReceivables(HttpServletResponse response,OrderListBo o, Integer pageSize, Integer pageNo)throws Exception;
 
-	void exportInvoice(HttpServletResponse response, String orderNo, Integer pageSize, Integer pageNo)throws Exception;
 
-	void exportMyBill(HttpServletResponse response, TOrderBillNew billNew, Integer pageSize, Integer pageNo)throws Exception;
 
 
 }

+ 1 - 30
src/main/java/com/goafanti/order/service/impl/OrderBillServiceImpl.java

@@ -55,36 +55,7 @@ public class OrderBillServiceImpl extends BaseMybatisDao<TOrderBillNewMapper> im
 	}
 
 
-	@Override
-	public XSSFWorkbook exportBillData(TOrderBillNew billNew) {
-		// 判断导出是否有部门
-		String deptid = billNew.getDepartmentId();
-		Map<String, List<TOrderBillNew>> map = new HashMap<String, List<TOrderBillNew>>();
-		if(StringUtils.isBlank(deptid)){
-			//获得所有有数据的部门
-			List<TOrderBillNew> dlist = billNewMapper.getDeptBySome(billNew);
-			if(null == dlist || dlist.size() == 0){
-				return null;
-			}
-			for (int i = 0; i < dlist.size(); i++) {
-				TOrderBillNew ob = dlist.get(i);
-				billNew.setDepartmentId(ob.getDepartmentId());
-				map.put(ob.getDepartmentName(), billNewMapper.getBillData(billNew));
-			}
-		}else{
-			map.put(billNew.getDepartmentName(), billNewMapper.getBillData(billNew));
-		}
-		String[] comment = {"平台流水编号","平台流水时间","交易金额(万元)","付款方","收款方","流水科目","交易渠道","交易时间","财务流水号","订单编号","订单负责人"};
-		String filePath = uploadPath + "/billtemp";
-//		File f = new File(filePath);
-//		if(!f.exists()){
-//			f.mkdirs();
-//		}
-		//filePath += "/" + System.nanoTime() +".xls";
-		XSSFWorkbook wb = ExportExcelUtil.exportDeptBillInfo(map,  comment, filePath);
-		
-		return wb;
-	}
+	
 
 
 	@Override

+ 0 - 120
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -1229,66 +1229,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
-	@Override
-	public void exportOrderTaskData(String orderNo, HttpServletResponse response) throws IOException,BusinessException {
-		OutputStream out = response.getOutputStream();
-		try {
-			List<TOrderTaskBo> list=selectOrderTask(orderNo);
-    		String[] comment = {"合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","项目负责人","是否主项目","项目别类","项目名称","项目数量","服务市价","证书編号","项目状态","项目说明","外包(内部)公司","外包(内部)价格"};
-    		String fileName ="项目信息记录表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-    		//type 0 变更
-    		XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"项目信息");
-    		//根据列表编写文档
-    		XSSFSheet sheet =wb.getSheetAt(0);
-    		for (TOrderTaskBo ob : list) {
-    			//新增一行
-    			XSSFRow r = sheet.createRow(sheet.getLastRowNum()+1);
-    			for (int i = 0; i < comment.length; i++) {
-    				//当前列的只
-    				String o = "";
-    				switch (comment[i]) {
-//    "合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","项目负责人","是否主项目","项目别类","项目名称","项目数量",
-//    				"服务市价","证书編号","项目状态","项目说明"
-    				case "合同编号": o = ob.getContractNo(); break;
-    				case "订单编号": o = ob.getOrderNo().toString(); break;
-    				case "客户名称": o = ob.getUserName(); break;
-    				case "订单负责人": o = ob.getSalesmanName(); break;
-    				case "订单部门": o = ob.getDepName(); break;
-    				case "订单状态": o = OrderNewState.getValueByCode(ob.getOrderStatus());break;
-    				case "项目负责人": o = ob.getConsultantName(); break;
-    				case "是否主项目": o = ob.getMain()==0?"否":"是"; break;
-    				case "项目别类": o = ob.getCname(); break;
-    				case "项目名称": o = ob.getCommodityName(); break;
-    				case "项目数量": o = ob.getCommodityQuantity().toString(); break;
-    				case "服务市价": o = ob.getCommodityPrice()!=null?ob.getCommodityPrice().toString():""; break;
-    				case "证书編号": o = ob.getCertificateNumber(); break;
-    				case "项目状态": o = ProjectNewStage.getValueByCode(ob.getProjectStatus()); break;
-    				case "项目说明": o = ob.getTaskComment(); break;
-    				case "外包(内部)公司": o = ob.getOutsourceName(); break;
-    				case "外包(内部)价格": o = ob.getOutsourcePrice()!=null?ob.getOutsourcePrice().toString():""; break;
-    				default: o = ""; break;
-    				}
-    				XSSFCell c = r.createCell(i);
-    				c.setCellValue(o);
-    			}
-    		}
-    		//返回名称及参数
-			 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-			 response.setContentType("application/octet-stream;charset=utf-8");
-    		 // 返回数据流
-			 wb.write(out); 
-			 out.flush();
-			 out.close();
-		} catch (Exception e) {
-			throw new BusinessException(new Error("表格生成错误。"));
-		}finally {
-			out.flush(); 
-			 out.close(); 
-		}
-		
 	
-		
-	}
 
 
 
@@ -1398,67 +1339,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 
 
-	@SuppressWarnings("unchecked")
-	@Override
-	public void exportArrearsDunListData(InputArrearsDunListBo in, HttpServletResponse response) throws IOException {
-		OutputStream out = response.getOutputStream();
-		try {
-			List<OutArrearsDunListBo> list=(List<OutArrearsDunListBo>) arrearsDunList(in).getList();
-    		String[] comment = {"合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","项目状态","签单金额(万元)","已收款(万元)","结算状态","催收科目","欠款催收","催款状态","催款启动时间","下单时间"};
-    		String fileName ="欠款催款记录表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-    		//type 0 变更
-    		XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"催款信息");
-    		//根据列表编写文档
-    		XSSFSheet sheet =wb.getSheetAt(0);
-    		for (OutArrearsDunListBo ob : list) {
-    			//新增一行
-    			XSSFRow r = sheet.createRow(sheet.getLastRowNum()+1);
-    			for (int i = 0; i < comment.length; i++) {
-    				//当前列的只
-    				String o = "";
-    				switch (comment[i]) {
-//    "合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","项目状态","签单金额(万元)","已收款(万元)
-//    				","结算状态","催收科目","欠款催收","催款状态","催款启动时间",
-    				case "合同编号": o = ob.getContractNo(); break;
-    				case "订单编号": o = ob.getOrderNo().toString(); break;
-    				case "客户名称": o = ob.getUserName(); break;
-    				case "订单负责人": o = ob.getSalesmanName(); break;
-    				case "订单部门": o = ob.getDepName(); break;
-    				case "订单状态": o = OrderNewState.getValueByCode(ob.getOrderStatus());break;
-    				case "项目状态": o = ProjectNewStage.getValueByCode(ob.getOrderStatus());break;
-    				case "签单金额(万元)": o = ob.getTotalAmount().toString();break;
-    				case "已收款(万元)": o = ob.getSettlementAmount().toString();break;
-    				case "结算状态": o = LiquidationNewState.getValueByCode(ob.getLiquidationStatus());break;
-    				case "催收科目": o = ob.getType()==0?"按时触发应收款":"未知";break;
-    				case "欠款催收": o = ob.getOrderArrears().toString();break;
-    				case "催款状态": o = NewDunState.getValueByCode(ob.getDunStatus());break;
-    				case "催款启动时间": o = ob.getStartDate();break;
-    				case "下单时间": o = ob.getSignDate();break;
-    				default: o = ""; break;
-    				}
-    				XSSFCell c = r.createCell(i);
-    				c.setCellValue(o);
-    			}
-    		}
-    		//返回名称及参数
-			 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-			 response.setContentType("application/octet-stream;charset=utf-8");
-    		 // 返回数据流
-			 wb.write(out); 
-			 out.flush();
-			 out.close();
-		} catch (Exception e) {
-			throw new BusinessException(new Error("表格生成错误。"));
-		}finally {
-			out.flush(); 
-			 out.close(); 
-		}
-		
-	
-		
-	}
-
-
 
 	@Override
 	public int checkOutAudit(Integer id) {

+ 17 - 14
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -93,6 +93,7 @@ import com.goafanti.order.bo.TOrderTaskDetailBo;
 import com.goafanti.order.bo.TOrderTaskListBo;
 import com.goafanti.order.bo.TaskLogBo;
 import com.goafanti.order.bo.TaskProgressBo;
+import com.goafanti.order.bo.UpdateProjectStatusBo;
 import com.goafanti.order.bo.inuptTaskHoursListBo;
 import com.goafanti.order.bo.inuptTaskListBo;
 import com.goafanti.order.bo.managerListBo;
@@ -437,19 +438,21 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	}
 	
 	
-	public int updateProjectStatus(Integer tid,Integer projectStatus,String timeRecord ) {
+	public int updateProjectStatus(UpdateProjectStatusBo b) {
 		TOrderTask t=new TOrderTask();
-		t.setId(tid);
-		t.setProjectStatus(projectStatus);
-		t.setTimeRecord(timeRecord);
-		TOrderTask task2=tOrderTaskMapper.selectByPrimaryKey(tid);//查询出项目信息
-		if(projectStatus!=task2.getProjectStatus()&&
-				projectStatus==NewProjectStatus.YLX.getCode()) t.setSetUpStatus(1);
-		if(projectStatus!=task2.getProjectStatus()&&
-				projectStatus==NewProjectStatus.YGS.getCode()) t.setSetUpStatus(1);
+		t.setId(b.getTid());
+		t.setProjectStatus(b.getProjectStatus());
+		t.setTimeRecord(b.getTimeRecord());
+		t.setCertificateNumber(b.getCertificateNumber());
+		t.setSetUpAmount(b.getSetUpAmount());
+		TOrderTask task2=tOrderTaskMapper.selectByPrimaryKey(b.getTid());//查询出项目信息
+		if(b.getProjectStatus()!=task2.getProjectStatus()&&
+				b.getProjectStatus()==NewProjectStatus.YLX.getCode()) t.setSetUpStatus(1);
+		if(b.getProjectStatus()!=task2.getProjectStatus()&&
+				b.getProjectStatus()==NewProjectStatus.YNGS.getCode()) t.setSetUpStatus(1);
 		tOrderTaskMapper.updateByPrimaryKeySelective(t);
-		projectSplitPush(tid, projectStatus,task2);
-		if(projectStatus!=task2.getProjectStatus())pushTaskLog(tid, projectStatus);
+		projectSplitPush(b.getTid(), b.getProjectStatus(),task2);
+		if(b.getProjectStatus()!=task2.getProjectStatus())pushTaskLog(b.getTid(), b.getProjectStatus());
 		return 1;
 	}
 
@@ -460,7 +463,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		tl.setCreateTime(new Date());
 		tl.setTaskId(tid);
 		tl.setAid(TokenManager.getAdminId());
-		StringBuffer s = new StringBuffer("将当前项目状态修改为:");
+		StringBuffer s = new StringBuffer("项目状态修改为:");
 		s.append(NewProjectStatus.getValueByCode(projectStatus));
 		tl.setContent(s.toString());
 		taskLogMapper.insertSelective(tl);
@@ -674,7 +677,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			tNew.setOrderNo(task.getOrderNo());
 			tOrderNewMapper.updateByPrimaryKeySelective(tNew);
 			if (task.getProjectStatus()==NewProjectStatus.YTJ.getCode()||task.getProjectStatus()==NewProjectStatus.YLX.getCode()||
-					task.getProjectStatus()==NewProjectStatus.YGS.getCode()) {
+					task.getProjectStatus()==NewProjectStatus.YNGS.getCode()) {
 				TOrderBonus tb=new TOrderBonus();
 				TOrderNew t=tOrderNewMapper.selectByPrimaryKey(task.getOrderNo());
 				tb.setId(UUID.randomUUID().toString());
@@ -684,7 +687,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 					addOrderLog(task.getOrderNo(),OrderLogProcess.XMWC.getCode(),null);
 				}
 				if (task.getProjectStatus()==NewProjectStatus.YLX.getCode())tb.setBonusSubject(23);//项目立项
-				if (task.getProjectStatus()==NewProjectStatus.YGS.getCode())tb.setBonusSubject(24);//项目公示
+				if (task.getProjectStatus()==NewProjectStatus.YNGS.getCode())tb.setBonusSubject(24);//项目公示
 				tb.setGrantType(1);//技术员
 				//新增奖金之前检查这个奖金数据是否存在
 				tb.setGrantTarget(task.getTaskReceiver());

+ 0 - 101
src/main/java/com/goafanti/order/service/impl/OrderReceivablesServiceImpl.java

@@ -2,9 +2,7 @@ package com.goafanti.order.service.impl;
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.OutputStream;
 import java.math.BigDecimal;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -13,7 +11,6 @@ import java.util.Map;
 import java.util.UUID;
 
 import javax.annotation.Resource;
-import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -485,107 +482,9 @@ public class OrderReceivablesServiceImpl extends BaseMybatisDao<TemporaryReceiva
         	        return cellValue;
 	}
         
-		@SuppressWarnings("unchecked")
-		@Override
-		public void exportReceivables(HttpServletResponse response,OrderListBo order, Integer pageSize, Integer pageNo) throws Exception {
-			 OutputStream out = response.getOutputStream();
-			 	//	财务专员自己的id
-				order.setFinanceId(TokenManager.getAdminId());
-				//order.setProcessStatus(3);//分配给自己 改为前端 传3未分配  4已分配
-				order.setOrderStatus(2);//营销管理员审核通过
-				if(pageSize==null||pageSize<0)pageSize=9999;
-				if(pageNo==null||pageNo<0)pageNo=1;
-				Pagination<OrderListBo> p=(Pagination<OrderListBo>) fundManageOrderService.financeList(order, pageNo, pageSize).get("pagination");
-				List<OrderListBo> list=(List<OrderListBo>)p.getList() ;
-				if(list.isEmpty())throw new BusinessException(new Error("数据是空的。","数据是空的。"));
-		    	try {
-		    		//设计表头
-		    		String[] comment = {"订单编号", "合同编号","客户名称","订单部门","订单负责人","签单日期","下单日期", 
-							"签单金额(万元)", "已开票金额(万元)", "已收金额(万元)","总成本(万元)","已付成本(万元)",
-							"最近收款(万元)","最近收款时间","结算状态","订单流程","是否特批"};
-		    		String fileName = "收款结算列表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-		    		XSSFWorkbook wb =exportTemplateInfoS(comment,"收款结算",list,0);
-		    		//根据列表编写文档
-					
-		    		//返回名称及参数
-					 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-					 response.setContentType("application/octet-stream;charset=utf-8");
-		    		 // 返回数据流
-					 wb.write(out); 
-					 out.flush();
-					 out.close();
-				} catch (Exception e) {
-					throw new BusinessException(new Error("表格生成错误。"));
-				}finally {
-					out.flush(); 
-					 out.close(); 
-				}
-		}
 		
-		@SuppressWarnings("unchecked")
-		@Override
-		public void exportInvoice(HttpServletResponse response, String orderNo, Integer pageSize, Integer pageNo)throws Exception {
-
-			 OutputStream out = response.getOutputStream();
-				if(pageSize==null||pageSize<0)pageSize=9999;
-				if(pageNo==null||pageNo<0)pageNo=1;
-				List<TOrderInvoiceBo>list=(List<TOrderInvoiceBo>) orderInvoiceService.salesmanOrderInvoiceList( orderNo, pageNo,pageSize).getList();
-//				if(list.isEmpty())throw new BusinessException(new Error("数据是空的。"));
-		    	try {
-		    		//设计表头
-		    		String[] comment = {"编号","订单编号","开票金额(万元)","申请时间","开票状态"};
-		    		String fileName = orderNo+"开票记录列表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-		    		//type 0 收款 1开票 2流水
-		    		XSSFWorkbook wb =exportTemplateInfoS(comment,"开票记录",list,1);
-		    		//根据列表编写文档
-					
-		    		//返回名称及参数
-					 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-					 response.setContentType("application/octet-stream;charset=utf-8");
-		    		 // 返回数据流
-					 wb.write(out); 
-					 out.flush();
-					 out.close();
-				} catch (Exception e) {
-					throw new BusinessException(new Error("表格生成错误。"));
-				}finally {
-					out.flush(); 
-					 out.close(); 
-				}
 		
-		}
 		
-		@SuppressWarnings("unchecked")
-		@Override
-		public void exportMyBill(HttpServletResponse response, TOrderBillNew billNew, Integer pageSize, Integer pageNo)throws Exception {
-
-			 OutputStream out = response.getOutputStream();
-				if(pageSize==null||pageSize<0)pageSize=9999;
-				if(pageNo==null||pageNo<0)pageNo=1;
-				
-				List<TOrderBillNew>list=(List<TOrderBillNew>) orderBillService.myBillList(billNew,pageNo, pageSize).getList();
-		    	try {
-		    		//设计表头
-		    		String[] comment = {"订单编号","合同编号","收款时间","财务流水时间","财务流水号","金额(万元)","收款方","付款方","流水科目","平台流水号","收款类型","备注"};
-		    		String fileName = (billNew.getOrderNo()==null?"":billNew.getOrderNo())+"流水记录列表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-		    		//type 0 收款 1开票 2流水
-		    		XSSFWorkbook wb =exportTemplateInfoS(comment,"流水记录",list,2);
-		    		//根据列表编写文档
-		    		//返回名称及参数
-					 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-					 response.setContentType("application/octet-stream;charset=utf-8");
-		    		 // 返回数据流
-					 wb.write(out); 
-					 out.flush();
-					 out.close();
-				} catch (Exception e) {
-					throw new BusinessException(new Error("表格生成错误。"));
-				}finally {
-					out.flush(); 
-					 out.close(); 
-				}
-		
-		}
 		/**
 		 * 
 		 * @param comment

+ 340 - 141
src/main/java/com/goafanti/personnel/bo/OutPersonnelListBo.java

@@ -3,605 +3,804 @@ package com.goafanti.personnel.bo;
 import java.util.Calendar;
 import java.util.Date;
 
+import com.goafanti.common.utils.excel.Excel;
+
 public class OutPersonnelListBo {
 	private Integer id;
+	private Date entryTime;
+	private String company;
+	private String jobNature;
+	private String jobNatureRemarks;
+	private Date birthday;
+	private Integer son;
+	private Integer girl;
+	private String promotionTime;
+	private String contractStart;
+	private String contractEnd;
+	private Integer residenceProvince;
+	private Integer residenceCity;
+	private Integer residenceArea;
+	private Integer nativePlaceProvince;
+	private Integer nativePlaceCity;
+	private Integer nowProvince;
+	private Integer nowCity;
+	private Integer nowArea;
+	private String rpName;
+	private String rcName;
+	private String raName;
+	private String nppName;
+	private String npcName;
+	private String npName;
+	private String ncName;
+	private String naName;
+	private String nowAddress;
+	private String residenceAddress;
+	@Excel(name = "员工编号")
+	private Integer employeeId;
+	@Excel(name = "门禁编号")
 	private Integer doorId;
+	@Excel(name = "姓名")
 	private String name;
+	@Excel(name = "员工状态", readConverterExp = "0=实习生,1=在职(试用期),2=在职(合同期),3=兼职,4=已离职")
 	private Integer status;
+	@Excel(name = "所属系统", readConverterExp = "0=管理系统,1=营销系统,2=技术系统")
 	private Integer system;
-	private String company;
-	private String depName;
+	@Excel(name = "职位名称")
 	private String jobsName;
-	private Integer lvl;
+	@Excel(name = "等级名称")
 	private String starName;
-	private String jobNature;
-	private String jobNatureRemarks;
+	@Excel(name = "所属公司")
+	private String depName;
+	@Excel(name = "星级", readConverterExp = "0=员工,1=主管,2=经理,3=总经理,4=总监,5=副总,6=总裁,7=董事长")
+	private Integer lvl;
+	@Excel(name = "入职时间")
 	private String entryTimes;
-	private String promotionTimes;
-	private Date birthday;
+	@Excel(name = "出生日期")
 	private String birthdays;
-	private Date entryTime;
-	private Integer marriage;
+	@Excel(name = "性别", readConverterExp = "0=男,1=女")
 	private Integer sex;
-	private Integer son;
-	private Integer girl;
+	@Excel(name = "婚否", readConverterExp = "0=未婚,1=已婚,2=离异")
+	private Integer marriage;
+	@Excel(name = "子女")
+	private String sonGirl;
+	@Excel(name = "政治面貌", readConverterExp = "0=群众,1=中共预备党员,2=中共党员,3=致公党党员")
 	private Integer politicalOutlook;
+	@Excel(name = "学历", readConverterExp = "0=高中/中专,1=专科/高职,2=本科,3=研究生,4=硕士,5=博士")
 	private Integer education;
+	@Excel(name = "毕业学校")
 	private String school;
+	@Excel(name = "所学专业")
 	private String major;
+	@Excel(name = "职称/证书")
 	private String title;
+	@Excel(name = "晋升明细")
 	private String promotionRemarks;
-	private String promotionTime;
-	private String contractStart;
-	private String contractEnd;
+	@Excel(name = "最近晋升时间")
+	private String promotionTimes;
+	@Excel(name = "合同")
+	private String contractStartEnd;
+	@Excel(name = "联系电话")
 	private String mobile;
+	@Excel(name = "办公室电话")
 	private String fixedTel;
+	@Excel(name = "身份证号码")
 	private String idCard;
+	@Excel(name = "身份证发证地")
 	private String certificationAuthority;
-	private Integer residenceProvince;
-	private Integer residenceCity;
-	private Integer residenceArea;
-	private String residenceAddress;
-	private Integer nativePlaceProvince;
-	private Integer nativePlaceCity;
-	private Integer nowProvince;
-	private Integer nowCity;
-	private Integer nowArea;
-	private String nowAddress;
+	@Excel(name = "户籍所在地")
+	private String residenceName;
+	@Excel(name = "现住址")
+	private String nowName;
+	@Excel(name = "紧急联系人")
 	private String emergencyContact;
+	@Excel(name = "紧急联系人电话")
 	private String emergencyMobile;
+	@Excel(name = "离职时间")
 	private String quitTime;
+	@Excel(name = "工作年限")
 	private Integer workingYear;
+	@Excel(name = "年龄")
 	private Integer age;
+	@Excel(name = "出生月份")
 	private Integer month;
+	@Excel(name = "参保时间")
 	private String insuranceStartTimes;
+	@Excel(name = "停保时间")
 	private String insuranceEndTimes;
+	@Excel(name = "入公积金时间")
 	private String fundStartTimes;
+	@Excel(name = "停公积金时间")
 	private String fundEndTimes;
-	private Integer employeeId;
-	private String rpName;
-	private String rcName;
-	private String raName;
-	private String nppName;
-	private String npcName;
-	private String npName;
-	private String ncName;
-	private String  naName;
-	
-	
+
 	public String getRpName() {
 		return rpName;
 	}
+
 	public void setRpName(String rpName) {
 		this.rpName = rpName;
+		this.residenceName = new StringBuffer("").append(rpName).append("省").toString();
 	}
+
 	public String getRcName() {
 		return rcName;
 	}
+
 	public void setRcName(String rcName) {
 		this.rcName = rcName;
+		this.residenceName = new StringBuffer(residenceName).append(rcName).toString();
 	}
+
 	public String getRaName() {
 		return raName;
 	}
+
 	public void setRaName(String raName) {
 		this.raName = raName;
+		this.residenceName = new StringBuffer(this.residenceName).append(raName).toString();
+	}
+
+	public void setResidenceAddress(String residenceAddress) {
+		this.residenceAddress = residenceAddress;
+		this.residenceName = new StringBuffer(this.residenceName == null ? "" : this.residenceName)
+				.append(residenceAddress).toString();
 	}
+
 	public String getNppName() {
 		return nppName;
 	}
+
 	public void setNppName(String nppName) {
 		this.nppName = nppName;
+
 	}
+
 	public String getNpcName() {
 		return npcName;
 	}
+
 	public void setNpcName(String npcName) {
 		this.npcName = npcName;
 	}
+
 	public String getNpName() {
 		return npName;
 	}
+
 	public void setNpName(String npName) {
 		this.npName = npName;
+		this.nowName = new StringBuffer("").append(npName).toString();
 	}
+
 	public String getNcName() {
 		return ncName;
 	}
+
 	public void setNcName(String ncName) {
 		this.ncName = ncName;
+		this.nowName = new StringBuffer(this.nowName).append(ncName).toString();
 	}
+
 	public String getNaName() {
 		return naName;
 	}
+
 	public void setNaName(String naName) {
 		this.naName = naName;
+		this.nowName = new StringBuffer(this.nowName).append(naName).toString();
 	}
+
+	public void setNowAddress(String nowAddress) {
+		this.nowAddress = nowAddress;
+		this.nowName = new StringBuffer(this.nowName == null ? "" : this.nowName).append(nowAddress).toString();
+	}
+
 	public String getInsuranceStartTimes() {
 		return insuranceStartTimes;
 	}
+
 	public void setInsuranceStartTimes(String insuranceStartTimes) {
 		this.insuranceStartTimes = insuranceStartTimes;
 	}
+
 	public String getInsuranceEndTimes() {
 		return insuranceEndTimes;
 	}
+
 	public void setInsuranceEndTimes(String insuranceEndTimes) {
 		this.insuranceEndTimes = insuranceEndTimes;
 	}
+
 	public String getFundStartTimes() {
 		return fundStartTimes;
 	}
+
 	public void setFundStartTimes(String fundStartTimes) {
 		this.fundStartTimes = fundStartTimes;
 	}
+
 	public String getFundEndTimes() {
 		return fundEndTimes;
 	}
+
 	public void setFundEndTimes(String fundEndTimes) {
 		this.fundEndTimes = fundEndTimes;
 	}
+
 	public Integer getId() {
 		return id;
 	}
+
 	public void setId(Integer id) {
 		this.id = id;
 	}
+
 	public Integer getDoorId() {
 		return doorId;
 	}
+
 	public void setDoorId(Integer doorId) {
 		this.doorId = doorId;
 	}
+
 	public String getName() {
 		return name;
 	}
+
 	public void setName(String name) {
 		this.name = name;
 	}
+
 	public Integer getStatus() {
 		return status;
 	}
+
 	public void setStatus(Integer status) {
 		this.status = status;
 	}
+
 	public Integer getSystem() {
 		return system;
 	}
+
 	public void setSystem(Integer system) {
 		this.system = system;
 	}
+
 	public String getCompany() {
 		return company;
 	}
+
 	public void setCompany(String company) {
 		this.company = company;
 	}
+
 	public String getJobsName() {
 		return jobsName;
 	}
+
 	public void setJobsName(String jobsName) {
 		this.jobsName = jobsName;
 	}
+
 	public Integer getLvl() {
 		return lvl;
 	}
+
 	public void setLvl(Integer lvl) {
 		this.lvl = lvl;
 	}
+
 	public String getStarName() {
 		return starName;
 	}
+
 	public void setStarName(String starName) {
 		this.starName = starName;
 	}
+
 	public String getEntryTimes() {
 		return entryTimes;
 	}
+
 	public void setEntryTimes(String entryTimes) {
 		this.entryTimes = entryTimes;
 	}
+
 	public String getPromotionTimes() {
 		return promotionTimes;
 	}
+
 	public void setPromotionTimes(String promotionTimes) {
 		this.promotionTimes = promotionTimes;
 	}
+
 	public Date getBirthday() {
 		return birthday;
 	}
+
 	public void setBirthday(Date birthday) {
 		this.birthday = birthday;
+		if ( this.birthday != null) {
+			this.age = getAgeByBirth(this.birthday);
+			Calendar cal = Calendar.getInstance();
+			cal.setTime(birthday);
+			this.month = cal.get(Calendar.MONTH) + 1;
+		}
 	}
-	
+
 	public String getBirthdays() {
 		return birthdays;
 	}
+
 	public void setBirthdays(String birthdays) {
 		this.birthdays = birthdays;
 	}
+
 	public Date getEntryTime() {
 		return entryTime;
 	}
+
 	public void setEntryTime(Date entryTime) {
 		this.entryTime = entryTime;
+		if (this.entryTime != null) {
+			int wy = getAgeByBirth(this.entryTime);
+			this.workingYear = 0 < wy ? 0 : wy;
+		}
 	}
+
 	public Integer getSex() {
 		return sex;
 	}
+
 	public void setSex(Integer sex) {
 		this.sex = sex;
 	}
+
 	public Integer getSon() {
 		return son;
 	}
+
 	public void setSon(Integer son) {
 		this.son = son;
+		this.sonGirl = new StringBuffer(this.sonGirl == null ? "/" : this.sonGirl).insert(0, son).toString();
 	}
+
 	public Integer getGirl() {
 		return girl;
 	}
+
 	public void setGirl(Integer girl) {
 		this.girl = girl;
+		this.sonGirl = new StringBuffer(this.sonGirl == null ? "/" : this.sonGirl).append(girl).toString();
 	}
+
 	public Integer getPoliticalOutlook() {
 		return politicalOutlook;
 	}
+
 	public String getPoliticalOutlookName() {
-		if (politicalOutlook!=null) {
-			if (politicalOutlook==0) {
+		if (politicalOutlook != null) {
+			if (politicalOutlook == 0) {
 				return "群众";
-			}else if (politicalOutlook==1) {
+			} else if (politicalOutlook == 1) {
 				return "中共预备党员";
-			}else if (politicalOutlook==2) {
+			} else if (politicalOutlook == 2) {
 				return "中共党员";
-			}else if (politicalOutlook==3) {
+			} else if (politicalOutlook == 3) {
 				return "致公党党员";
-			} 
+			}
 		}
 		return "";
 	}
+
 	public void setPoliticalOutlook(Integer politicalOutlook) {
 		this.politicalOutlook = politicalOutlook;
 	}
+
 	public Integer getEducation() {
 		return education;
 	}
-	
+
 	public String getEducationName() {
-		if(education!=null) {
-			if(education==0)return "高中/中专";
-			else if(education==1)return "专科/高职";
-			else if(education==2)return "本科";
-			else if(education==3)return "研究生";
-			else if(education==4)return "硕士";
-			else if(education==5)return "博士";
-			
+		if (education != null) {
+			if (education == 0)
+				return "高中/中专";
+			else if (education == 1)
+				return "专科/高职";
+			else if (education == 2)
+				return "本科";
+			else if (education == 3)
+				return "研究生";
+			else if (education == 4)
+				return "硕士";
+			else if (education == 5)
+				return "博士";
+
 		}
-		
+
 		return "";
 	}
+
 	public void setEducation(Integer education) {
 		this.education = education;
 	}
+
 	public String getSchool() {
 		return school;
 	}
+
 	public void setSchool(String school) {
 		this.school = school;
 	}
+
 	public String getMajor() {
 		return major;
 	}
+
 	public void setMajor(String major) {
 		this.major = major;
 	}
+
 	public String getTitle() {
 		return title;
 	}
+
 	public void setTitle(String title) {
 		this.title = title;
 	}
+
 	public String getPromotionRemarks() {
 		return promotionRemarks;
 	}
+
 	public void setPromotionRemarks(String promotionRemarks) {
 		this.promotionRemarks = promotionRemarks;
 	}
+
 	public String getPromotionTime() {
 		return promotionTime;
 	}
+
 	public void setPromotionTime(String promotionTime) {
 		this.promotionTime = promotionTime;
 	}
+
 	public String getContractStart() {
 		return contractStart;
 	}
+
 	public void setContractStart(String contractStart) {
 		this.contractStart = contractStart;
+		this.contractStartEnd = new StringBuffer(this.contractStartEnd == null ? "~" : this.contractStartEnd)
+				.insert(0, contractStart).toString();
 	}
+
 	public String getContractEnd() {
 		return contractEnd;
 	}
+
 	public void setContractEnd(String contractEnd) {
 		this.contractEnd = contractEnd;
+		this.contractStartEnd = new StringBuffer(this.contractStartEnd == null ? "~" : this.contractStartEnd)
+				.append(contractEnd).toString();
 	}
+
 	public String getMobile() {
 		return mobile;
 	}
+
 	public void setMobile(String mobile) {
 		this.mobile = mobile;
 	}
+
 	public String getFixedTel() {
 		return fixedTel;
 	}
+
 	public void setFixedTel(String fixedTel) {
 		this.fixedTel = fixedTel;
 	}
+
 	public String getIdCard() {
 		return idCard;
 	}
+
 	public void setIdCard(String idCard) {
 		this.idCard = idCard;
 	}
+
 	public String getCertificationAuthority() {
 		return certificationAuthority;
 	}
+
 	public void setCertificationAuthority(String certificationAuthority) {
 		this.certificationAuthority = certificationAuthority;
 	}
+
 	public Integer getResidenceProvince() {
 		return residenceProvince;
 	}
+
 	public void setResidenceProvince(Integer residenceProvince) {
 		this.residenceProvince = residenceProvince;
 	}
+
 	public Integer getResidenceCity() {
 		return residenceCity;
 	}
+
 	public void setResidenceCity(Integer residenceCity) {
 		this.residenceCity = residenceCity;
 	}
+
 	public Integer getResidenceArea() {
 		return residenceArea;
 	}
+
 	public void setResidenceArea(Integer residenceArea) {
 		this.residenceArea = residenceArea;
 	}
+
 	public String getResidenceAddress() {
 		return residenceAddress;
 	}
-	public void setResidenceAddress(String residenceAddress) {
-		this.residenceAddress = residenceAddress;
-	}
+
 	public Integer getNativePlaceProvince() {
 		return nativePlaceProvince;
 	}
+
 	public void setNativePlaceProvince(Integer nativePlaceProvince) {
 		this.nativePlaceProvince = nativePlaceProvince;
 	}
+
 	public Integer getNativePlaceCity() {
 		return nativePlaceCity;
 	}
+
 	public void setNativePlaceCity(Integer nativePlaceCity) {
 		this.nativePlaceCity = nativePlaceCity;
 	}
+
 	public Integer getNowProvince() {
 		return nowProvince;
 	}
+
 	public void setNowProvince(Integer nowProvince) {
 		this.nowProvince = nowProvince;
 	}
+
 	public Integer getNowCity() {
 		return nowCity;
 	}
+
 	public void setNowCity(Integer nowCity) {
 		this.nowCity = nowCity;
 	}
+
 	public Integer getNowArea() {
 		return nowArea;
 	}
+
 	public void setNowArea(Integer nowArea) {
 		this.nowArea = nowArea;
 	}
+
 	public String getNowAddress() {
 		return nowAddress;
 	}
-	public void setNowAddress(String nowAddress) {
-		this.nowAddress = nowAddress;
-	}
+
 	public String getQuitTime() {
 		return quitTime;
 	}
+
 	public void setQuitTime(String quitTime) {
 		this.quitTime = quitTime;
 	}
+
 	public Integer getWorkingYear() {
-		if (this.workingYear==null&& this.entryTime!=null) {
-			int wy=getAgeByBirth(this.entryTime);
-			return 0<wy?0:wy;
-		}
 		return workingYear;
 	}
+
 	public void setWorkingYear(Integer workingYear) {
+		
 		this.workingYear = workingYear;
 	}
-	
+
 	public Integer getAge() {
-		if (this.age==null&& this.birthday!=null) {
-			return getAgeByBirth(this.birthday);
-		}
 		return age;
 	}
+
 	public void setAge(Integer age) {
-		this.age = age;
-	}
-
-	 public static int getAgeByBirth(Date birthDay)  {
-	        int age = 0;
-	        Calendar cal = Calendar.getInstance();
-	        int yearNow = cal.get(Calendar.YEAR);  //当前年份
-	        int monthNow = cal.get(Calendar.MONTH);  //当前月份
-	        int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); //当前日期
-	        cal.setTime(birthDay);
-	        int yearBirth = cal.get(Calendar.YEAR);
-	        int monthBirth = cal.get(Calendar.MONTH);
-	        int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
-	        age = yearNow - yearBirth;   //计算整岁数
-	        if (monthNow <= monthBirth) {
-	            if (monthNow == monthBirth) {
-	                if (dayOfMonthNow < dayOfMonthBirth) age--;//当前日期在生日之前,年龄减一
-	            } else {
-	                age--;//当前月份在生日之前,年龄减一
-	            }
-	        }
-	        return age;
-
-	 }
+		 this.age = age;
+	}
+	
 	public Integer getMonth() {
-		if (this.month==null&&this.birthday!=null) {
-			Calendar cal =Calendar.getInstance();
-			cal.setTime(birthday);
-			return cal.get(Calendar.MONTH)+1;
-		}
 		return month;
 	}
+
 	public void setMonth(Integer month) {
-		this.month = month;
+		 this.month = month;
+	}
+
+	public static int getAgeByBirth(Date birthDay) {
+		int age = 0;
+		Calendar cal = Calendar.getInstance();
+		int yearNow = cal.get(Calendar.YEAR); // 当前年份
+		int monthNow = cal.get(Calendar.MONTH); // 当前月份
+		int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH); // 当前日期
+		cal.setTime(birthDay);
+		int yearBirth = cal.get(Calendar.YEAR);
+		int monthBirth = cal.get(Calendar.MONTH);
+		int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
+		age = yearNow - yearBirth; // 计算整岁数
+		if (monthNow <= monthBirth) {
+			if (monthNow == monthBirth) {
+				if (dayOfMonthNow < dayOfMonthBirth)
+					age--;// 当前日期在生日之前,年龄减一
+			} else {
+				age--;// 当前月份在生日之前,年龄减一
+			}
+		}
+		return age;
+
 	}
+
 	public String getDepName() {
 		return depName;
 	}
+
 	public void setDepName(String depName) {
 		this.depName = depName;
 	}
+
 	public String getStatusName() {
-		if (this.status!=null) {
-			if (status==0) {
+		if (this.status != null) {
+			if (status == 0) {
 				return "实习生";
-			}else if (status==1) {
+			} else if (status == 1) {
 				return "在职(试用期)";
-			}else if (status==2) {
+			} else if (status == 2) {
 				return "在职(合同期)";
-			}else if (status==3) {
+			} else if (status == 3) {
 				return "兼职";
-			}else if (status==4) {
+			} else if (status == 4) {
 				return "已离职";
 			}
 		}
 		return "";
 	}
-	
+
 	public String getSystemName() {
-		if (this.system!=null) {
-			if (system==0) {
+		if (this.system != null) {
+			if (system == 0) {
 				return "管理系统";
-			}else if (system==1) {
+			} else if (system == 1) {
 				return "营销系统";
-			}else if (system==2) {
+			} else if (system == 2) {
 				return "技术系统";
 			}
 		}
 		return "";
 	}
-	
+
 	public String getLvlName() {
-		//级别 0员工1主管2经理3总经理4总监5副总6总裁7董事长
-		if (this.lvl!=null) {
-			if (lvl==0) {
+		// 级别 0员工1主管2经理3总经理4总监5副总6总裁7董事长
+		if (this.lvl != null) {
+			if (lvl == 0) {
 				return "员工";
-			}else if (lvl==1) {
+			} else if (lvl == 1) {
 				return "主管";
-			}else if (lvl==2) {
+			} else if (lvl == 2) {
 				return "经理";
-			}else if (lvl==3) {
+			} else if (lvl == 3) {
 				return "总经理";
-			}else if (lvl==4) {
+			} else if (lvl == 4) {
 				return "总监";
-			}else if (lvl==5) {
+			} else if (lvl == 5) {
 				return "副总";
-			}else if (lvl==6) {
+			} else if (lvl == 6) {
 				return "总裁";
-			}else if (lvl==7) {
+			} else if (lvl == 7) {
 				return "董事长";
 			}
 		}
 		return "";
 	}
-	
+
 	public Integer getMarriage() {
 		return marriage;
 	}
+
 	public String getMarriageName() {
-		if (marriage!=null) {
-			if (marriage==0) {
+		if (marriage != null) {
+			if (marriage == 0) {
 				return "未婚";
-			}else if (marriage==1) {
+			} else if (marriage == 1) {
 				return "已婚";
-			}else if (marriage==2) {
+			} else if (marriage == 2) {
 				return "离异";
 			}
 		}
 		return "";
 	}
+
 	public void setMarriage(Integer marriage) {
 		this.marriage = marriage;
 	}
+
 	public String getEmergencyContact() {
 		return emergencyContact;
 	}
+
 	public void setEmergencyContact(String emergencyContact) {
 		this.emergencyContact = emergencyContact;
 	}
+
 	public String getEmergencyMobile() {
 		return emergencyMobile;
 	}
+
 	public void setEmergencyMobile(String emergencyMobile) {
 		this.emergencyMobile = emergencyMobile;
 	}
+
 	public String getResidenceName() {
-		String str="";
-		if(rpName!=null)str=str+rpName.trim()+"省";
-		if(rcName!=null)str=str+rcName.trim();
-		if(raName!=null)str=str+raName.trim();
-		if (residenceAddress!=null)str=str+residenceAddress; 
+		String str = "";
+		if (rpName != null)
+			str = str + rpName.trim() + "省";
+		if (rcName != null)
+			str = str + rcName.trim();
+		if (raName != null)
+			str = str + raName.trim();
+		if (residenceAddress != null)
+			str = str + residenceAddress;
 		return str;
 	}
-	
+
 	public String getNativePlaceName() {
-		String str="";
-		if(nppName!=null)str=str+nppName.trim()+"省";
-		if(npcName!=null)str=str+npcName.trim();
+		String str = "";
+		if (nppName != null)
+			str = str + nppName.trim() + "省";
+		if (npcName != null)
+			str = str + npcName.trim();
 		return str;
 	}
-	
+
 	public String getNowName() {
-		String str="";
-		if(npName!=null)str=str+npName.trim()+"省";
-		if(ncName!=null)str=str+ncName.trim();
-		if(naName!=null)str=str+naName.trim();
-		if (nowAddress!=null)str=str+nowAddress; 
+		String str = "";
+		if (npName != null)
+			str = str + npName.trim() + "省";
+		if (ncName != null)
+			str = str + ncName.trim();
+		if (naName != null)
+			str = str + naName.trim();
+		if (nowAddress != null)
+			str = str + nowAddress;
 		return str;
 	}
-	
+
 	public String getJobNature() {
 		return jobNature;
 	}
+
 	public void setJobNature(String jobNature) {
 		this.jobNature = jobNature;
 	}
+
 	public String getJobNatureRemarks() {
 		return jobNatureRemarks;
 	}
+
 	public void setJobNatureRemarks(String jobNatureRemarks) {
 		this.jobNatureRemarks = jobNatureRemarks;
 	}
+
 	public Integer getEmployeeId() {
 		return employeeId;
 	}
+
 	public void setEmployeeId(Integer employeeId) {
 		this.employeeId = employeeId;
 	}
-	
-	
+
 }

+ 9 - 11
src/main/java/com/goafanti/personnel/controller/AdminPersonnelApiController.java

@@ -1,6 +1,8 @@
 package com.goafanti.personnel.controller;
 
 
+import java.util.List;
+
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -15,6 +17,7 @@ import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.utils.DateUtils;
 import com.goafanti.common.utils.StringUtils;
+import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.personnel.bo.InputPersonnelChooseBo;
 import com.goafanti.personnel.bo.InputPersonnelBo;
 import com.goafanti.personnel.bo.InputPersonnelContactBo;
@@ -25,6 +28,7 @@ import com.goafanti.personnel.bo.InputPersonnelLvlBo;
 import com.goafanti.personnel.bo.InputPersonnelPromotionBo;
 import com.goafanti.personnel.bo.InputPersonnelQuitBo;
 import com.goafanti.personnel.bo.IntpersonnelWelfareBo;
+import com.goafanti.personnel.bo.OutPersonnelListBo;
 import com.goafanti.personnel.service.PersonnelService;
 
 
@@ -277,23 +281,17 @@ public class AdminPersonnelApiController extends CertifyApiController {
 	}
 	
 	/**
-	 * 	导出变更列表
+	 * 	导出人事列表
      * 
      * @param response
      * @return
      */
     @RequestMapping(value = "/exportPersonnelList" , method = RequestMethod.GET)
     public Result exportPersonnelList(HttpServletResponse response,InputPersonnelListBo i)  {
-    	Result res=new Result();
-			try {
-				personnelService.exportPersonnelList( response, i);
-			} catch (Exception e) {
-				res.getError().add(buildError("格式不正确"));
-				e.printStackTrace();
-				return res;
-			}
-         res.data(1); 
-    	return res;
+    	@SuppressWarnings("unchecked")
+		List<OutPersonnelListBo>list=(List<OutPersonnelListBo>) personnelService.selectList(i).getList();
+    	NewExcelUtil<OutPersonnelListBo> excel=new NewExcelUtil<>(OutPersonnelListBo.class);
+    	return excel.exportExcel(list, "人事档案表", response);
     }
 	
 	/** 证件上传 **/

+ 0 - 3
src/main/java/com/goafanti/personnel/service/PersonnelService.java

@@ -1,9 +1,7 @@
 package com.goafanti.personnel.service;
 
-import java.io.IOException;
 import java.util.List;
 
-import javax.servlet.http.HttpServletResponse;
 
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.personnel.bo.InputPersonnelBo;
@@ -45,7 +43,6 @@ public interface PersonnelService {
 
 	OutPersonnelBo selectBypdId(Integer id);
 
-	void exportPersonnelList(HttpServletResponse response, InputPersonnelListBo i) throws IOException;
 
 	List<OutPersonnelLvlBo> selectLvlList();
 

+ 0 - 102
src/main/java/com/goafanti/personnel/service/impl/PersonnelServiceImpl.java

@@ -1,26 +1,15 @@
 package com.goafanti.personnel.service.impl;
 
-import java.io.IOException;
-import java.io.OutputStream;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.poi.xssf.usermodel.XSSFCell;
-import org.apache.poi.xssf.usermodel.XSSFRow;
-import org.apache.poi.xssf.usermodel.XSSFSheet;
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
-import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.AdminMapper;
 import com.goafanti.common.dao.PersonnelChooseMapper;
@@ -33,14 +22,12 @@ import com.goafanti.common.dao.PersonnelMidMapper;
 import com.goafanti.common.dao.PersonnelPromotionMapper;
 import com.goafanti.common.dao.PersonnelQuitMapper;
 import com.goafanti.common.dao.PersonnelWelfareMapper;
-import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.PersonnelContact;
 import com.goafanti.common.model.PersonnelDossier;
 import com.goafanti.common.model.PersonnelEntry;
 import com.goafanti.common.model.PersonnelMid;
 import com.goafanti.common.model.PersonnelWelfare;
-import com.goafanti.common.utils.ExportExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
@@ -263,95 +250,6 @@ public class PersonnelServiceImpl  extends BaseMybatisDao<PersonnelDossierMapper
 		return op;
 	}
 
-	@SuppressWarnings("unchecked")
-	@Override
-	public void exportPersonnelList(HttpServletResponse response, InputPersonnelListBo in) throws IOException {
-		OutputStream out = response.getOutputStream();
-		try {
-			List<OutPersonnelListBo>list=(List<OutPersonnelListBo>) selectList(in).getList();
-			
-    		String[] comment = {"员工编号","门禁编号","姓名","员工状态","所属系统","所属公司","职位名称","等级名称","星级","入职时间","转正时间","出生日期","性别"
-    				,"婚否","子女","政治面貌","学历","毕业学校","所学专业","职称/证书","晋升明细","最近晋升时间","合同","联系电话","办公室电话",
-    				"身份证号码","身份证发证地","户籍所在地","现住址","紧急联系人","紧急联系人电话","离职时间","工作年限","年龄","出生月份","参保时间","停保时间",
-    				"入公积金时间","停公积金时间"};
-    		String fileName ="人事档案表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
-    		//type 0 变更
-    		XSSFWorkbook wb =ExportExcelUtil.exportTemplateInfoS(comment,"人事档案表");
-    		//根据列表编写文档
-    		XSSFSheet sheet =wb.getSheetAt(0);
-    		for (OutPersonnelListBo ob : (List<OutPersonnelListBo>)list) {
-    			//新增一行
-    			XSSFRow r = sheet.createRow(sheet.getLastRowNum()+1);
-    			
-    			for (int i = 0; i < comment.length; i++) {
-    				//当前列的只
-    				String o = "";
-    				switch (comment[i]) {
-//    				"员工编号","门禁编号","姓名","员工状态","所属系统","所属公司","职位名称","等级名称","星级","入职时间","转正时间","出生日期","性别"
-    				case "员工编号": o = ob.getEmployeeId()==null?"":ob.getEmployeeId().toString(); break;
-    				case "门禁编号": o = ob.getDoorId().toString(); break;
-    				case "姓名": o = ob.getName(); break;
-    				case "员工状态": o = ob.getStatusName(); break;
-    				case "所属系统": o = ob.getSystemName(); break;
-    				case "所属公司": o = ob.getDepName(); break;
-    				case "职位名称": o = ob.getJobsName(); break;
-    				case "等级名称": o = ob.getStarName(); break;
-    				case "星级": o = ob.getLvlName(); break;
-    				case "入职时间": o = ob.getEntryTimes(); break;
-    				case "转正时间": o = ob.getPromotionTimes()==null?"":ob.getPromotionTimes(); break;
-    				case "出生日期": o = ob.getBirthdays(); break;
-    				case "性别": o = ob.getSex()==0?"男":"女"; break;
-    				case "婚否": o = ob.getMarriageName(); break;
-    				case "子女": o = ob.getSon().toString()+"/"+ob.getGirl().toString(); break;
-    				case "政治面貌": o = ob.getPoliticalOutlookName(); break;
-    				case "学历": o = ob.getEducationName(); break;
-    				case "毕业学校": o = ob.getSchool(); break;
-    				case "所学专业": o = ob.getMajor(); break;
-    				case "职称/证书": o = ob.getTitle(); break;
-    				case "晋升明细": o = ob.getPromotionRemarks(); break;
-    				case "最近晋升时间": o = ob.getPromotionTimes(); break;
-    				case "合同": if (ob.getContractStart()!=null&&ob.getContractEnd()!=null) {
-    					o = ob.getContractStart()+" ~ "+ob.getContractEnd();
-    				}
-    				break;
-    				case "联系电话": o = ob.getMobile(); break;
-    				case "办公室电话": o = ob.getFixedTel(); break;
-    				case "身份证号码": o = ob.getIdCard(); break;
-    				case "身份证发证地": o = ob.getCertificationAuthority(); break;
-    				case "户籍所在地": o = ob.getResidenceName(); break;
-    				case "现住址": o = ob.getNowName(); break;
-    				case "紧急联系人": o = ob.getEmergencyContact(); break;
-    				case "紧急联系人电话": o = ob.getEmergencyMobile(); break;
-    				case "离职时间": o = ob.getQuitTime(); break;
-    				case "工作年限": o = ob.getWorkingYear()==null?"":ob.getWorkingYear().toString(); break;
-    				case "年龄": o = ob.getAge()==null?"":ob.getAge().toString(); break;
-    				case "出生月份": o = ob.getMonth()==null?"":ob.getMonth().toString(); break;
-    				case "参保时间": o = ob.getInsuranceStartTimes(); break;
-    				case "停保时间": o = ob.getInsuranceEndTimes(); break;
-    				case "入公积金时间": o = ob.getFundStartTimes(); break;
-    				case "停公积金时间": o = ob.getFundEndTimes(); break;
-    				default: o = ""; break;
-    				}
-    				XSSFCell c = r.createCell(i);
-    				c.setCellValue(o);
-    			}
-    		}
-    		//返回名称及参数
-			 response.addHeader("Content-Disposition", "attachment;filename="  + new String(fileName.getBytes(),"iso-8859-1"));  
-			 response.setContentType("application/octet-stream;charset=utf-8");
-    		 // 返回数据流
-			 wb.write(out); 
-			 out.flush();
-			 out.close();
-		} catch (Exception e) {
-			logger.error(e.getLocalizedMessage());
-			throw new BusinessException(new Error("表格生成错误。"));
-		}finally {
-			out.flush(); 
-			 out.close(); 
-		}
-	}
-	
 	
 
 	@Override