anderx 5 years ago
parent
commit
089bc7c6d1

+ 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 
   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_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
 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>
   
   
    <select id="selectByTidAndCid" resultType="com.goafanti.organization.bo.OutPaymentNode">
    <select id="selectByTidAndCid" resultType="com.goafanti.organization.bo.OutPaymentNode">

+ 0 - 1
src/main/java/com/goafanti/common/utils/Excel/NewExcelUtil.java

@@ -248,7 +248,6 @@ public class NewExcelUtil<T> {
 				// 写入各个字段的列头名称
 				// 写入各个字段的列头名称
 				for (Object[] os : fields) {
 				for (Object[] os : fields) {
 					Excel excel = (Excel) os[1];
 					Excel excel = (Excel) os[1];
-					System.out.println(excel.name());
 					this.createCell(excel, row, column++);
 					this.createCell(excel, row, column++);
 				}
 				}
 
 

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

@@ -309,5 +309,6 @@ public class FileUtils {
 			}
 			}
 		}
 		}
 	}
 	}
+	
 
 
 }
 }

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

@@ -2,24 +2,46 @@ package com.goafanti.order.bo;
 
 
 import java.math.BigDecimal;
 import java.math.BigDecimal;
 
 
+import com.goafanti.common.utils.Excel.Excel;
+
 public class OutArrearsDunListBo {
 public class OutArrearsDunListBo {
 	private String id;
 	private String id;
+	@Excel(name = "合同编号")
 	private String contractNo;
 	private String contractNo;
+	@Excel(name = "订单编号")
 	private String orderNo;
 	private String orderNo;
+	@Excel(name = "客户名称")
 	private String userName;
 	private String userName;
+	@Excel(name = "订单负责人")
 	private String salesmanName;
 	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;
+	@Excel(name = "项目状态",readConverterExp = "0=项目待提交,1=项目已提交,2=项目评审,"
+			+ "3=项目立项,4=项目公示,5=项目抽查,6=项目备案,7=项目下证,8=项目验收,9=项目拨款")
+	private Integer projectStatus;
+	private String projectStatusName;
+	@Excel(name = "签单金额(万元)")
    	private BigDecimal totalAmount;
    	private BigDecimal totalAmount;
+	@Excel(name = "已收款(万元)")
+	private BigDecimal settlementAmount;
+	@Excel(name = "结算状态",readConverterExp = "0=首付待付请,1=尾款待付清,2=已付请,3=部分退款,4=全部退款")
    	private Integer liquidationStatus;
    	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 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() {
 	public String getId() {
 		return id;
 		return id;
 	}
 	}
@@ -122,6 +144,12 @@ public class OutArrearsDunListBo {
 	public void setType(Integer type) {
 	public void setType(Integer type) {
 		this.type = type;
 		this.type = type;
 	}
 	}
+	public String getProjectStatusName() {
+		return projectStatusName;
+	}
+	public void setProjectStatusName(String projectStatusName) {
+		this.projectStatusName = projectStatusName;
+	}
    	
    	
    	
    	
 
 

+ 7 - 9
src/main/java/com/goafanti/order/controller/AdminNewOrderApiController.java

@@ -25,6 +25,7 @@ import com.goafanti.common.model.TOrderRefundWithBLOBs;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.utils.Excel.NewExcelUtil;
 import com.goafanti.common.utils.Excel.NewExcelUtil;
 import com.goafanti.order.bo.InputArrearsDunListBo;
 import com.goafanti.order.bo.InputArrearsDunListBo;
+import com.goafanti.order.bo.OutArrearsDunListBo;
 import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.enums.ApprovalNewState;
 import com.goafanti.order.enums.ApprovalNewState;
 import com.goafanti.order.enums.OrderNewState;
 import com.goafanti.order.enums.OrderNewState;
@@ -511,19 +512,16 @@ public class AdminNewOrderApiController extends CertifyApiController {
 	
 	
 	
 	
 	/**
 	/**
-	 * 	项目列表下载 
+	 * 	欠款催款列表下载 
 	 * @throws IOException 
 	 * @throws IOException 
 	 */
 	 */
 	@RequestMapping(value = "/exportArrearsDunListData", method = RequestMethod.GET)
 	@RequestMapping(value = "/exportArrearsDunListData", method = RequestMethod.GET)
 	public Result exportArrearsDunListData(InputArrearsDunListBo in,HttpServletResponse response){
 	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);
+		
 	}
 	}
 	
 	
 }
 }

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

@@ -304,22 +304,7 @@ public class FundManagerOrderApiController extends CertifyApiController {
 		return res;
 		return res;
 	}
 	}
 	
 	
-	/**
-	 * 下载部门流水数据
-	 * @param billNew
-	 * @param response
-	 * @return
-	 * @throws IOException 
-	 */
-	 @RequestMapping(value="/exportBillData", method = RequestMethod.GET)
-	 public void exportBillData(TOrderBillNew billNew,HttpServletResponse response) throws IOException{
-		 
-		 @SuppressWarnings("unchecked")
-		List<TOrderBillNew>list=(List<TOrderBillNew>) orderBillServiceImpl.myBillList(billNew,1, 99999).getList();
-		 NewExcelUtil<TOrderBillNew> excelUtil=new NewExcelUtil<>(TOrderBillNew.class);
-		 excelUtil.exportExcel(list, "订单流水表", response);
-
-	 }
+	
 	 
 	 
 	 /**
 	 /**
 	  * 修改合同编号
 	  * 修改合同编号

+ 1 - 1
src/main/java/com/goafanti/order/enums/OrderNewState.java

@@ -5,7 +5,7 @@ import java.util.Map;
 
 
 public enum OrderNewState {
 public enum OrderNewState {
 	/** 待签单 **/
 	/** 待签单 **/
-	DQD(0,"待签单 "),
+	DQD(0,"待签单"),
 	/** 签单待审 **/
 	/** 签单待审 **/
 	QDDS(1,"签单待审"),
 	QDDS(1,"签单待审"),
 	/** 签单审核通过 **/
 	/** 签单审核通过 **/

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

@@ -200,7 +200,6 @@ public interface OrderNewService {
 	
 	
 	int pushOutsourceProjectAudit(TOrderOutsource o);
 	int pushOutsourceProjectAudit(TOrderOutsource o);
 	Pagination<OutArrearsDunListBo> arrearsDunList(InputArrearsDunListBo in);
 	Pagination<OutArrearsDunListBo> arrearsDunList(InputArrearsDunListBo in);
-	void exportArrearsDunListData(InputArrearsDunListBo in, HttpServletResponse response) throws IOException;
 	void pushOrderDun(String orderNo);
 	void pushOrderDun(String orderNo);
 	int checkOutAudit(Integer id);
 	int checkOutAudit(Integer id);
 	
 	

+ 1 - 59
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -1338,66 +1338,8 @@ 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
 	@Override