Browse Source

发票新增筛选

anderx 6 years ago
parent
commit
783a702f54

+ 17 - 5
src/main/java/com/goafanti/common/mapper/TOrderInvoiceMapper.xml

@@ -721,8 +721,14 @@
      b.settlement_amount as settlementAmount, (b.total_amount-b.settlement_amount) as notAmount from t_order_invoice a 
 	left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
 	left join (select order_no,sum(amount)as  sumAmount from t_order_invoice where status =2 group by order_no) d
-	on a.order_no=d.order_no where a.status in(1,2)
-	<if test="approval ==null">
+	on a.order_no=d.order_no where 1=1
+	<if test="status ==null"> 
+	and a.status in(1,2)
+	</if>
+	<if test="status != null">
+	 and a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="approval ==null and special==null">
 	 and a.approval in(1,2)
 	</if>
 	<if test="approval != null">
@@ -743,7 +749,7 @@
 	<if test="aDep !=null">
 	and c.department_id= #{aDep,jdbcType=VARCHAR}
 	</if>
-	order by a.create_time desc
+	order by a.approval,a.status,a.create_time desc
 	<if test="page_sql!=null">
 			${page_sql}
 	</if>
@@ -752,8 +758,14 @@
   <select id="approvalOrderInvoiceCount" resultType="java.lang.Integer">
   	   select count(*) from t_order_invoice a 
 	left join t_order_new b on a.order_no=b.order_no left join admin c on b.salesman_id=c.id
-	where a.status in(1,2)
-	<if test="approval ==null">
+	where  1=1
+	<if test="status ==null"> 
+	and a.status in(1,2)
+	</if>
+	<if test="status != null">
+	 and a.status = #{status,jdbcType=INTEGER}
+	</if>
+	<if test="approval ==null and special==null">
 	 and a.approval in(1,2)
 	</if>
 	<if test="approval != null">

+ 5 - 2
src/main/java/com/goafanti/order/controller/OrderInvoiceApiController.java

@@ -107,6 +107,9 @@ public class OrderInvoiceApiController extends CertifyApiController {
 		res.data(orderInvoiceService.financeOrderInvoiceList( orderDep, orderNo , name,type,pageNo,pageSize));
 		return res;
 	}
+	
+	
+	
 	/**
 	 *  开票特批列表
 	 * @param uid
@@ -114,10 +117,10 @@ public class OrderInvoiceApiController extends CertifyApiController {
 	 * @return
 	 */
 	@RequestMapping(value = "/approvalOrderInvoiceList",method = RequestMethod.GET)
-	public Result approvalOrderInvoiceList(Integer approval,Integer type,String orderDep,String orderNo ,String name,Integer pageNo,Integer pageSize){
+	public Result approvalOrderInvoiceList(Integer status,Integer approval,Integer type,String orderDep,String orderNo ,String name,Integer pageNo,Integer pageSize){
 		Result res = new Result();
 		
-		res.data(orderInvoiceService.approvalOrderInvoiceList(approval,type, orderDep, orderNo , name,pageNo,pageSize));
+		res.data(orderInvoiceService.approvalOrderInvoiceList( status,approval,type, orderDep, orderNo, name,pageNo,pageSize));
 		return res;
 	}
 	

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

@@ -36,7 +36,7 @@ public interface OrderInvoiceService {
 
 	int updatefinanceExamine(Integer id, Integer examine, String reason);
 
-	Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer approval,Integer type, String orderDep, String orderNo, String name, Integer pageNo,
+	Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name, Integer pageNo,
 			Integer pageSize);
 
 	int updateapprovalExamine(Integer id, Integer examine, String reason);

+ 10 - 2
src/main/java/com/goafanti/order/service/impl/OrderInvoiceServiceImpl.java

@@ -112,7 +112,7 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer approval,Integer type, String orderDep, String orderNo, String name,
+	public Pagination<TOrderInvoiceBo> approvalOrderInvoiceList(Integer status,Integer approval,Integer type, String orderDep, String orderNo, String name,
 			Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
@@ -121,12 +121,20 @@ public class OrderInvoiceServiceImpl extends BaseMybatisDao<TOrderInvoiceMapper>
 		if(StringUtils.isNotBlank(orderNo))params.put("orderNo", orderNo);
 		if(StringUtils.isNotBlank(name))params.put("name", name);
 		if(approval!=null)params.put("approval", approval);
-		if(type!=null)params.put("type", type);
+		if(status!=null)params.put("status", status);
+		//0省内 1省外 2查看所有省外
+		if(type==0||type==1)params.put("type", type);
+		if (type==2) {
+			params.put("type", 1);
+			params.put("special", 1);
+		}
 		if (type ==1) {
 			//如果是省外则直接查本部门
 			Admin a=adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
 			params.put("aDep", a.getDepartmentId());
 		}
+		
+		
 		return (Pagination<TOrderInvoiceBo>)findPage("approvalOrderInvoiceList", "approvalOrderInvoiceCount", params, pageNo, pageSize);
 	}
 

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -54,7 +54,7 @@ session.validate.timespan=18000000
 app.name=AFT
 template.cacheable=false
 
-static.host=//static.jishutao.com/1.1.08
+static.host=//static.jishutao.com/1.1.10
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload