Browse Source

财务收款列表看所有单

Signed-off-by: anderx <312518615@qq.com>
anderx 6 years ago
parent
commit
78f65f5292

+ 2 - 0
src/main/java/com/goafanti/common/constant/AFTConstants.java

@@ -20,6 +20,8 @@ public class AFTConstants {
 	public static final String	CED									= "999998";				// 总裁
 		
 	public static final String  TECH_ADMIN                          = "99998";				// 技术管理员
+	
+	public static final String  FINANCE_ADMIN                       = "99997";				// 财务管理员
 
 	public static final String	AREAADMIN							= "";					// 地区管理员
 

+ 6 - 4
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1093,15 +1093,16 @@ left join (select x1.order_no,max(create_time) create_time,max(transaction_amoun
 (select x.order_no,x.create_time,x.transaction_amount from t_order_bill_new x right join (select order_no, max(create_time) maxTime from t_order_bill_new group by order_no)y
 	on  x.order_no=y.order_no and x.create_time=y.maxTime)x1 group by x1.order_no ) f on o.order_no = f.order_no
 left join ( select order_no , sum(amount) invoiceAmount from t_order_invoice where status = 2 group by order_no ) g on o.order_no = g.order_no
-where delete_sign != 1  and outsource=  #{o.outsource,jdbcType=INTEGER}
+where delete_sign != 1 and (approval = 0 or approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
 	  	<if test="o.processStatus == 4">
 	  	and o.process_status &gt;= #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
-  		and (approval = 0 or approval = 2)
+  		<if test="o.financeId != null and o.financeId != &quot;&quot;">
 	  	and d.finance_id = #{o.financeId,jdbcType=VARCHAR}
+	  	</if>
   		<if test="o.orderStatus != null and o.orderStatus != &quot;&quot;">
 	  	and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1143,15 +1144,16 @@ where delete_sign != 1  and outsource=  #{o.outsource,jdbcType=INTEGER}
   	left join department d on o.order_dep = d.id left join (select x1.order_no,max(create_time) create_time,max(transaction_amount)transaction_amount from 
 (select x.order_no,x.create_time,x.transaction_amount from t_order_bill_new x right join (select order_no, max(create_time) maxTime from t_order_bill_new group by order_no)y
 	on  x.order_no=y.order_no and x.create_time=y.maxTime)x1 group by x1.order_no ) f on o.order_no = f.order_no
-  	 where delete_sign != 1 and outsource=  #{o.outsource,jdbcType=INTEGER}
+  	 where delete_sign != 1 and (approval = 0 or approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
 	  	<if test="o.processStatus == 4">
 	  	and o.process_status &gt;= #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
-  		and (approval = 0 or approval = 2)
+	  	<if test="o.financeId != null and o.financeId != &quot;&quot;">
 	  	and d.finance_id = #{o.financeId,jdbcType=VARCHAR}
+	  	</if>
   		<if test="o.orderStatus != null and o.orderStatus != &quot;&quot;">
 	  	and o.order_status = #{o.orderStatus,jdbcType=INTEGER}
 	  	</if>

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

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.controller.CertifyApiController;
 import com.goafanti.common.model.TOrderBack;
 import com.goafanti.common.model.TOrderBillNew;
@@ -89,7 +90,10 @@ public class FundManagerOrderApiController extends CertifyApiController {
 	public Result financeList(OrderListBo order, Integer pageNo, Integer pageSize ){
 		Result res = new Result();
 		//财务专员自己的id
-		order.setFinanceId(TokenManager.getAdminId());
+		if(!TokenManager.hasRole(AFTConstants.SUPERADMIN) || !TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)
+		|| !TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)) {
+			order.setFinanceId(TokenManager.getAdminId());
+		}
 		//order.setProcessStatus(3);//分配给自己 改为前端 传3未分配  4已分配
 		order.setOrderStatus(2);//营销管理员审核通过
 		res.setData(fundManageOrderServiceImpl.financeList(order, pageNo, pageSize));

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

@@ -28,6 +28,7 @@ public interface FundManageOrderService {
 	 * @return
 	 */
 	Map<String, Object> financeList(OrderListBo order,Integer pageNo,Integer pageSize);
+	
 
 	/**
 	 * 财务管理员分派订单给财务专员

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

@@ -163,6 +163,8 @@ public class FundManagerOrderServiceImpl extends BaseMybatisDao<TOrderNewMapper>
 		result.put("count", count);
 		return result;
 	}
+	
+	
 
 	@Override
 	public Integer updateReject(TOrderBack back) {