Browse Source

订单管理

wanghui 8 years ago
parent
commit
04cc347356

+ 48 - 0
src/main/java/com/goafanti/common/mapper/TOrderMapper.xml

@@ -1271,6 +1271,54 @@
 	<if test="isFinance == 1"> <!-- 我的结算流水 -->
 		and b.finance_id = #{aid,jdbcType=VARCHAR} 
 	</if>
+	<if test="page_sql != null">
+		${page_sql}
+	</if>
+  </select>
+  <select id="selectBillCount" resultType="java.lang.Integer">
+  	select
+  		count(0)
+  	from
+		t_order_bill a left join t_order b on
+		a.order_no = b.order_no left join user c on 
+		a.payee_id = c.id left join user d on
+		a.payer_id = d.id left join admin e on 
+		b.finance_id = e.id left join admin f on 
+		b.salesman_id = f.id left join department_management g on
+		f.department_id = g.id
+	where 1=1
+	<if test="payeeName != null and payeeName != ''">
+		and c.name = #{payeeName,jdbcType=VARCHAR}
+	</if>
+	<if test="payerName != null and payerName !=''">
+		and d.name = #{payerName,jdbcType=VARCHAR}
+	</if>
+	<if test="salesmanName != null and salesmanName != ''">
+		and f.name = #{salesmanName,jdbcType=VARCHAR}
+	</if>
+	<if test="financeName != null and financeName != ''">
+		and e.name = #{financeName,jdbcType=VARCHAR}
+	</if>
+	<if test="confirmSign != null">
+		and a.confirm_sign = #{confirmSign,jdbcType=INTEGER}
+	</if>
+	<if test="deleteSign != null">
+		and a.delete_sign = #{deleteSign,jdbcType=VARCHAR}
+	</if>
+	<if test="depId != null and depId != ''">
+		and f.department_id = #{depId,jdbcType=VARCHAR}
+	</if>
+	<if test="isFinance == 0"> <!-- 我的订单流水查询 -->
+		and 
+			(b.salesman_id = #{aid,jdbcType=VARCHAR} 
+		or 
+			b.finance_id = #{aid,jdbcType=VARCHAR} 
+		or 
+			b.technician_id = #{aid,jdbcType=VARCHAR})
+	</if>
+	<if test="isFinance == 1"> <!-- 我的结算流水 -->
+		and b.finance_id = #{aid,jdbcType=VARCHAR} 
+	</if>
   </select>
   
   <select id="selectBillDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillDetailBo">

+ 0 - 7
src/main/java/com/goafanti/order/controller/AdminOrderApiController.java

@@ -413,11 +413,4 @@ public class AdminOrderApiController extends CertifyApiController {
 		orderServiceImpl.updateBill(billNo, financialPayNo, financialPayTime, remarks);
 		return res;
 	}
-
-	/** 查询立项订单 **/
-	@RequestMapping(value = "/listSetUpServiceOrder", method = RequestMethod.POST)
-	public Result listSetUpServiceOrder(Integer pageNo, Integer pageSize){
-		Result res = new Result();
-		return res;
-	}
 }

+ 13 - 0
src/main/java/com/goafanti/order/service/OrderService.java

@@ -318,4 +318,17 @@ public interface OrderService {
 	 * @return
 	 */
 	int updateBill(String billNo,String financialPayNo,String financialPayTime,String remarks);
+
+	/**
+	 * 查询待立项订单
+	 * @param bo
+	 * @param startDate
+	 * @param endDate
+	 * @param depIds
+	 * @param pageNo
+	 * @param pageSize
+	 * @return
+	 */
+	Pagination<OrderListBo> listSetUpServiceOrder(OrderListBo bo, String startDate, String endDate, String depIds, Integer pageNo,
+			Integer pageSize);
 }

+ 13 - 0
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -1262,5 +1262,18 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrderBillMapper.updateByPrimaryKey(bill);
 		return 1;
 	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderListBo> listSetUpServiceOrder(OrderListBo bo, String startDate, String endDate,
+			String depIds, Integer pageNo, Integer pageSize) {
+		Map<String,Object> params = disposeParams(bo,startDate,endDate);
+		if(StringUtils.isNotBlank(depIds)) {
+			params.put("depIds", depIds);
+		}
+		params.put("projectStage", ProjectStage.WAIT_SET_UP.getCode());
+		return  (Pagination<OrderListBo>)findPage("selectServiceOrderByPage","selectServiceOrderCount", 
+				params, pageNo, pageSize);
+	}
 	
 }

+ 14 - 2
src/main/java/com/goafanti/techproject/controller/AdminTechProjectApiController.java

@@ -41,6 +41,8 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.easemob.EasemobUtils;
 import com.goafanti.easemob.enums.EasemonSysUsers;
+import com.goafanti.order.bo.OrderListBo;
+import com.goafanti.order.service.OrderService;
 import com.goafanti.techproject.bo.InputTechProject;
 import com.goafanti.techproject.bo.InputTechWebsite;
 import com.goafanti.techproject.bo.TechProjectManageListBo;
@@ -67,7 +69,9 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	private UserService				userService;
 	@Resource
 	private AdminService			adminService;
-
+	@Resource
+	private OrderService orderServiceImpl;
+	
 	@Autowired
 	EasemobUtils					easemobUtils;
 
@@ -567,5 +571,13 @@ public class AdminTechProjectApiController extends CertifyApiController {
 		}
 		return status;
 	}
-
+	
+	/** 查询立项订单 **/
+	@RequestMapping(value = "/listSetUpServiceOrder", method = RequestMethod.POST)
+	public Result listSetUpServiceOrder(OrderListBo bo,String startDate,String endDate,
+			String depIds,Integer pageNo, Integer pageSize){
+		Result res = new Result();
+		res.setData(orderServiceImpl.listSetUpServiceOrder(bo,startDate,endDate,depIds,pageNo,pageSize));
+		return res;
+	}
 }