Browse Source

外包特批修改

anderx 6 years ago
parent
commit
7a068065dd

+ 1 - 1
src/main/java/com/goafanti/common/enums/OrderLogProcess.java

@@ -8,7 +8,7 @@ import org.apache.commons.lang3.StringUtils;
 import com.goafanti.order.enums.OrderNewState;
 
 public enum OrderLogProcess {
-//	流程 0单 1提交 2审核 3驳回  4特批 5财务派单 6财务首付 7项目订单派单 8项目派单 9项目完成
+//	流程 0发起退单 1提交 2审核 3驳回  4特批 5财务派单 6财务首付 7项目订单派单 8项目派单 9项目完成 10 退单完成 11财务全款 12发起外包 13外包通过 14外包拒绝
 	TJ(1, "营销员提交"),
 	SH(2, "管理员审核"),
 	BH(3, "驳回"),

+ 5 - 1
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1154,8 +1154,10 @@
 where super_id is null )  e on e.order_no=a.order_no
   	left join admin f on e.task_receiver=f.id
   	</if>
-  	where a.delete_sign = 0 
+  	where a.delete_sign = 0
+  	<if test="outsource != null">
   	and a.outsource= #{outsource,jdbcType=INTEGER}
+  	</if>
   	<if test="specially == 0">
   	and a.order_status not in(3,5,6,7) and a.approval !=3
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
@@ -1240,7 +1242,9 @@ where super_id is null ) e on e.order_no=a.order_no
   	left join admin f on e.task_receiver=f.id
   	</if>
   	where a.delete_sign = 0 
+  	<if test="outsource != null">
   	and a.outsource= #{outsource,jdbcType=INTEGER}
+  	</if>
   	<if test="specially == 0">
   	and a.order_status not in(3,5,6,7) and a.approval !=3
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}

+ 2 - 2
src/main/java/com/goafanti/common/mapper/TOrderOutsourceMapper.xml

@@ -376,7 +376,7 @@
 	left join t_order_new b on a.order_no=b.order_no left join `user` c on b.buyer_id=c.id
 	left join admin d on b.salesman_id=d.id left join department e on d.department_id=e.id
 	left join admin f on b.finance_id=f.id
-	where 1=1
+	where b.approval in (0,2)
 	<if test="refundStatus != null">
 	and a.refund_status= #{refundStatus}
 	</if>
@@ -396,7 +396,7 @@
   </select>
   <select id="orderOutsourceCount" resultType="java.lang.Integer">
   select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no 
-  left join `user` c on b.buyer_id=c.id where 1=1
+  left join `user` c on b.buyer_id=c.id where b.approval in (0,2)
   <if test="refundStatus != null">
 	and a.refund_status= #{refundStatus}
 	</if>

+ 2 - 0
src/main/java/com/goafanti/order/enums/ProcessStatus.java

@@ -23,6 +23,8 @@ public enum ProcessStatus {
 	YBFPZXSGLY(5,"已部分分派咨询师经理"),
 	/** 已全部分派咨询师经理 **/
 	YQBFPZXSGLY(6,"已全部分派咨询师经理"),
+	/** 已派特批审核 **/
+	YPTPSH(7,"已派特批审核"),
 	/** 无效 **/
 	INVALID(10, "INVALID");
 	

+ 6 - 4
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -408,7 +408,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
 		if (StringUtils.isNotBlank(starTime)) params.put("starTime", starTime);
 		if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
-		params.put("outsource", outsource==null?0:outsource);
+		params.put("outsource", outsource);
 		Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectOrderNewListByPage", "selectOrderNewListCount", params, pageNo, pageSize);
 		return p;
 	}
@@ -423,6 +423,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		if (orderStatus==OrderNewState.QDSHTG.getCode()) {
 			if (t2.getApproval()==ApprovalNewState.FTP.getCode()) {//如果通过分配给财务管理员
 				t.setProcessStatus(ProcessStatus.YPCWGLY.getCode());
+			}else {
+				t.setProcessStatus(ProcessStatus.YPTPSH.getCode());
 			}
 			if(outsource!=null&&outsource==1) {
 				t.setOutsource(outsource);
@@ -437,7 +439,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				addBackOrder(orderNo, reason);
 				addOrderLog(orderNo, OrderLogProcess.BH.getCode());
 			}
-			t.setOrderStatus(orderStatus);
+			
 		}else if (outsource==1) {//外包
 			o.setRefundStatus(0);
 			
@@ -448,7 +450,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 				tOrderOutsourceMapper.updateByPrimaryKeySelective(o);
 			}
 		}
-		
+		t.setOrderStatus(orderStatus);
 		return tOrderNewMapper.updateByPrimaryKeySelective(t);
 	}
 
@@ -591,7 +593,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Override
 	public boolean chekeOrderStatus(String orderNo) {
 		TOrderNew tOrder= tOrderNewMapper.selectByPrimaryKey(orderNo);
-		if (tOrder.getOrderStatus()!=OrderNewState.QDDS.getCode()) {
+		if (tOrder.getOrderStatus()==OrderNewState.QDDS.getCode()||tOrder.getOrderStatus()==OrderNewState.QDSHTG.getCode()) {
 			return true;
 		}
 		return false;

+ 3 - 2
src/main/java/com/goafanti/order/service/impl/OutsourceOrgServiceImpl.java

@@ -89,14 +89,15 @@ public class OutsourceOrgServiceImpl  extends BaseMybatisDao<TOrderOutsourceMapp
 	@Override
 	public int updateAuditOutsource(OrderOutsourceDtails o) {
 		o.setAuditTime(new Date());
+		TOrderNew t=new TOrderNew();
+		t.setOrderNo(o.getOrderNo());
 		if (o.getRefundStatus()==1) {
-			TOrderNew t=new TOrderNew();
-			t.setOrderNo(o.getOrderNo());
 			t.setOrderStatus(2);//订单审核标记通过
 			t.setProcessStatus(2);//订单流程标记到财务
 			addOrderLog(o.getOrderNo(),OrderLogProcess.WBSH.getCode());
 			tOrderNewMapper.updateByPrimaryKeySelective(t);
 		}else {
+			t.setOrderStatus(3);
 			addOrderLog(o.getOrderNo(),OrderLogProcess.WBBH.getCode());
 		}
 		return tOrderOutsourceMapper.updateByPrimaryKeySelective(o);