Browse Source

订单管理

wanghui 8 years ago
parent
commit
a1b5e4b52d

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

@@ -1352,4 +1352,96 @@
 		where
 			a.bill_no = #{billNo,jdbcType=VARCHAR}
   </select>
+  
+  <select id="selectSetUpProjectByPage" resultType="com.goafanti.order.bo.OrderListBo">
+		select
+			a.order_no as orderNo,
+			a.order_type as orderType,
+			date_format(a.create_time,'%Y-%m-%d %H:%i:%S') as createTime,
+			a.order_status as orderStatus,
+			a.liquidation_status as liquidationStatus,
+			a.approval,
+			a.order_channel as orderChannel,
+			b.nickname as buyerName,
+			c.name as salesmanName,
+			d.name as financeName,
+			e.name as technicianName,
+			f.departmentName
+		from
+			t_order a left join user b on
+			a.buyer_id = b.id left join admin c on
+			a.salesman_id = c.id left join admin d on
+			a.finance_id = d.id left join admin e on
+			a.technician_id = e.id left join department_management f on 
+			d.department_id = f.id
+		where a.type = 0 and a.order_status = 3 
+			and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
+		<if test="salesmanId != null">
+			and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
+		</if>
+		<if test="financeId != null">
+			and a.finance_id = #{financeId,jdbcType=VARCHAR}
+		</if>
+		<if test="technicianId != null">
+			and a.technician_id = #{technicianId,jdbcType=VARCHAR}
+		</if>
+		<if test="startDate != null">
+			and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
+		</if>
+		<if test="endDate != null">
+			and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
+		</if>
+		<if test="buyerName != null and buyerName != ''">
+			and b.nickname = #{buyerName,jdbcType=VARCHAR}
+		</if>
+		<if test="approval != null">
+			and a.approval = #{approval,jdbcType=INTEGER}
+		</if>
+		<if test="depId != null and depId != ''">
+			and f.id = #{depId,jdbcType=VARCHAR}
+		</if>
+		<if test="page_sql != null">
+			${page_sql}
+		</if>
+  </select>
+  <select id="selectSetUpProjectCount" resultType="java.lang.Integer">
+		select
+			count(0)
+		from
+			t_order a left join user b on
+			a.buyer_id = b.id left join admin c on
+			a.salesman_id = c.id left join admin d on
+			a.finance_id = d.id left join admin e on
+			a.technician_id = e.id left join department_management f on 
+			d.department_id = f.id
+		where a.type = 0 and a.order_status = 3 
+			and (a.liquidation_status = 1 or a.liquidation_status = 2 or a.approval = 2) <!-- 已首付 or 已付清 or 已特批 -->
+		<if test="salesmanId != null">
+			and a.salesman_id = #{a.salesmanId,jdbcType=VARCHAR}
+		</if>
+		<if test="financeId != null">
+			and a.finance_id = #{financeId,jdbcType=VARCHAR}
+		</if>
+		<if test="technicianId != null">
+			and a.technician_id = #{technicianId,jdbcType=VARCHAR}
+		</if>
+		<if test="startDate != null">
+			and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
+		</if>
+		<if test="endDate != null">
+			and a.create_time &lt; #{a.endDate,jdbcType=TIMESTAMP}
+		</if>
+		<if test="buyerName != null and buyerName != ''">
+			and b.nickname = #{buyerName,jdbcType=VARCHAR}
+		</if>
+		<if test="approval != null">
+			and a.approval = #{approval,jdbcType=INTEGER}
+		</if>
+		<if test="depId != null and depId != ''">
+			and f.id = #{depId,jdbcType=VARCHAR}
+		</if>
+		<if test="page_sql != null">
+			${page_sql}
+		</if>
+  </select>
 </mapper>

+ 10 - 11
src/main/java/com/goafanti/order/service/OrderService.java

@@ -320,23 +320,22 @@ public interface OrderService {
 	int updateBill(String billNo,String financialPayNo,String financialPayTime,String remarks);
 
 	/**
+	 * 特批订单
+	 * @param orderNo
+	 * @param confirm
+	 * @return
+	 */
+	int approvalServiceOrder(String orderNo, Integer confirm);
+	/**
 	 * 查询待立项订单
 	 * @param bo
 	 * @param startDate
 	 * @param endDate
-	 * @param depIds
+	 * @param depId
 	 * @param pageNo
 	 * @param pageSize
 	 * @return
 	 */
-	Pagination<OrderListBo> listSetUpServiceOrder(OrderListBo bo, String startDate, String endDate, String depIds, Integer pageNo,
-			Integer pageSize);
-
-	/**
-	 * 特批订单
-	 * @param orderNo
-	 * @param confirm
-	 * @return
-	 */
-	int approvalServiceOrder(String orderNo, Integer confirm);
+	Pagination<OrderListBo> listSetUpServiceOrder(String buyerName,String salesmanName, String financeName,
+			String depId,Integer approval, Integer pageNo, Integer pageSize);
 }

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

@@ -1264,19 +1264,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		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);
-	}
-
 	@Override
 	public int approvalServiceOrder(String orderNo, Integer confirm) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
@@ -1297,4 +1284,25 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrderMapper.updateByPrimaryKeySelective(tOrder);
 		return 1;
 	}
+	
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderListBo> listSetUpServiceOrder(String buyerName,String salesmanName, String financeName,
+			String depId,Integer approval, Integer pageNo, Integer pageSize) {
+		Map<String,Object> params = new HashMap<String,Object>();
+		if(StringUtils.isNotBlank(buyerName))
+			params.put("buyerName", buyerName);
+		if(StringUtils.isNotBlank(salesmanName))
+			params.put("salesmanName", salesmanName);
+		if(StringUtils.isNotBlank(financeName))
+			params.put("financeName",financeName);
+		if(StringUtils.isNotBlank(depId))
+			params.put("depId", depId);
+		if(approval != null)
+			params.put("approval", approval);
+		return  (Pagination<OrderListBo>)findPage("selectSetUpServiceOrderByPage","selectSetUpServiceOrderCount", 
+				params, pageNo, pageSize);
+	}
+
 }

+ 3 - 4
src/main/java/com/goafanti/techproject/controller/AdminTechProjectApiController.java

@@ -41,7 +41,6 @@ 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;
@@ -574,10 +573,10 @@ public class AdminTechProjectApiController extends CertifyApiController {
 	
 	/** 查询立项订单 **/
 	@RequestMapping(value = "/listSetUpServiceOrder", method = RequestMethod.POST)
-	public Result listSetUpServiceOrder(OrderListBo bo,String startDate,String endDate,
-			String depIds,Integer pageNo, Integer pageSize){
+	public Result listSetUpServiceOrder(String buyerName,String salesmanName, String financeName,
+			String depId,Integer approval, Integer pageNo, Integer pageSize){
 		Result res = new Result();
-		res.setData(orderServiceImpl.listSetUpServiceOrder(bo,startDate,endDate,depIds,pageNo,pageSize));
+		res.setData(orderServiceImpl.listSetUpServiceOrder(buyerName, salesmanName, financeName, depId, approval, pageNo, pageSize));
 		return res;
 	}
 }

+ 1 - 1
src/main/java/com/goafanti/techproject/service/TechProjectService.java

@@ -7,6 +7,7 @@ import com.goafanti.common.model.Contract;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.model.TechProjectLog;
 import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.OrderListBo;
 import com.goafanti.techproject.bo.TechProjectClientListBo;
 import com.goafanti.techproject.bo.TechProjectContractListBo;
 import com.goafanti.techproject.bo.TechProjectDetailBo;
@@ -36,5 +37,4 @@ public interface TechProjectService {
 	List<TechProjectContractListBo> listContractTechProjectByContractId(String contractId);
 
 	void batchInsertContractRecord(Contract c);
-
 }

+ 1 - 5
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -1,6 +1,5 @@
 package com.goafanti.techproject.service.impl;
 
-import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
@@ -12,12 +11,10 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.constant.AFTConstants;
-import com.goafanti.common.dao.ContractMapper;
 import com.goafanti.common.dao.NoticeMapper;
 import com.goafanti.common.dao.TechProjectLogMapper;
 import com.goafanti.common.dao.TechProjectMapper;
 import com.goafanti.common.dao.UserMapper;
-import com.goafanti.common.enums.ContractBusinessStatus;
 import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.NoticeReadStatus;
 import com.goafanti.common.enums.NoticeStatus;
@@ -32,6 +29,7 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.OrderListBo;
 import com.goafanti.techproject.bo.TechProjectClientListBo;
 import com.goafanti.techproject.bo.TechProjectContractListBo;
 import com.goafanti.techproject.bo.TechProjectDetailBo;
@@ -49,8 +47,6 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 	private NoticeMapper			noticeMapper;
 	@Autowired
 	private UserMapper				userMapper;
-	@Autowired
-	private ContractMapper			contractMapper;
 
 	@SuppressWarnings("unchecked")
 	@Override