anderx лет назад: 2
Родитель
Сommit
125148b3da

+ 12 - 6
src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml

@@ -2139,7 +2139,7 @@
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
     left join t_order_mid c on a.order_no =c.order_no
     left join t_order_mid c on a.order_no =c.order_no
     left join t_task_member e on a.id=e.tid
     left join t_task_member e on a.id=e.tid
-    <if test="shiroType ==2">
+    <if test="shiroType ==2 or  shiroType ==3">
       left join department d on b.order_dep =d.id
       left join department d on b.order_dep =d.id
     </if>
     </if>
     where  b.delete_sign in (0,2)
     where  b.delete_sign in (0,2)
@@ -2150,9 +2150,12 @@
     <if test="shiroType ==2">
     <if test="shiroType ==2">
       and (d.finance_id  = #{aid} or  d.retrial_finance_id =#{aid})
       and (d.finance_id  = #{aid} or  d.retrial_finance_id =#{aid})
     </if>
     </if>
-    <if test="approvalType !=null">
-      and a.approval= #{approvalType}
+    <if test="shiroType ==3">
+      and d.approval_aid= #{aid}
     </if>
     </if>
+<!--    <if test="approvalType !=null">-->
+<!--      and a.approval= #{approvalType}-->
+<!--    </if>-->
     <if test="orderNo != null">
     <if test="orderNo != null">
       and a.order_no = #{orderNo}
       and a.order_no = #{orderNo}
     </if>
     </if>
@@ -2209,7 +2212,7 @@
     select count(*)
     select count(*)
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
     from t_order_task a left join t_order_new b on a.order_no =b.order_no
     left join t_order_mid c on a.order_no =c.order_no
     left join t_order_mid c on a.order_no =c.order_no
-    <if test="shiroType ==2">
+    <if test="shiroType ==2 or shiroType ==3">
       left join department d on b.order_dep =d.id
       left join department d on b.order_dep =d.id
     </if>
     </if>
     where  b.delete_sign in (0,2)
     where  b.delete_sign in (0,2)
@@ -2220,9 +2223,12 @@
     <if test="shiroType ==2">
     <if test="shiroType ==2">
       and (d.finance_id  = #{aid} or  d.retrial_finance_id =#{aid})
       and (d.finance_id  = #{aid} or  d.retrial_finance_id =#{aid})
     </if>
     </if>
-    <if test="approvalType !=null">
-      and a.approval= #{approvalType}
+    <if test="shiroType ==3">
+      and d.approval_aid= #{aid}
     </if>
     </if>
+<!--    <if test="approvalType !=null">-->
+<!--      and a.approval= #{approvalType}-->
+<!--    </if>-->
     <if test="orderNo != null">
     <if test="orderNo != null">
       and a.order_no = #{orderNo}
       and a.order_no = #{orderNo}
     </if>
     </if>

+ 18 - 7
src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

@@ -1261,11 +1261,11 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		if(in.getStatus()!=null) map.put("status", in.getStatus());
 		if(in.getStatus()!=null) map.put("status", in.getStatus());
 		if(in.getShiroType()!=null) map.put("shiroType", in.getShiroType());
 		if(in.getShiroType()!=null) map.put("shiroType", in.getShiroType());
 		map.put("aid",TokenManager.getAdminId());
 		map.put("aid",TokenManager.getAdminId());
-		if (TokenManager.hasRole(AFTConstants.VICE_CED)){
-			map.put("approvalType",2);
-		}else if (TokenManager.hasRole(AFTConstants.CED)){
-			map.put("approvalType",1);
-		}
+//		if (TokenManager.hasRole(AFTConstants.VICE_CED)){
+//			map.put("approvalType",2);
+//		}else if (TokenManager.hasRole(AFTConstants.CED)){
+//			map.put("approvalType",1);
+//		}
 	}
 	}
 
 
 	@Override
 	@Override
@@ -1333,7 +1333,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 						});
 						});
 				OrganizationListOut dep = tOrderNewMapper.selectOrderFinance(task.getOrderNo());
 				OrganizationListOut dep = tOrderNewMapper.selectOrderFinance(task.getOrderNo());
 				int examineType =task.getExamineType();
 				int examineType =task.getExamineType();
-
+				//判定谁审核的财务审核,
 				if (aid.equals(dep.getFinanceId())){
 				if (aid.equals(dep.getFinanceId())){
 					if (examineType==3){
 					if (examineType==3){
 						examineType=2;
 						examineType=2;
@@ -1348,12 +1348,21 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 					}
 					}
 				}
 				}
 				nt.setExamineType(examineType);
 				nt.setExamineType(examineType);
+				//全都已经审核的情况下
 				if(examineType==4){
 				if(examineType==4){
 					flag=true;
 					flag=true;
 				}
 				}
+
+				//需要特批的情况下
 				if (task.getMemberType()==1||task.getMemberType()==2){
 				if (task.getMemberType()==1||task.getMemberType()==2){
 					if (flag){
 					if (flag){
-						nt.setProcessStatus(2);
+						Department department = tOrderNewMapper.selectDepByOrderNo(task.getOrderNo());
+						//部门设置无需特批的情况下直接完成,否则走正常流程
+						if (department.getApproval()==0){
+							nt.setProcessStatus(3);
+						}else {
+							nt.setProcessStatus(2);
+						}
 					}
 					}
 					status=1;
 					status=1;
 				}else if (task.getMemberType()==0){
 				}else if (task.getMemberType()==0){
@@ -1367,6 +1376,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 
 
 				}
 				}
 				if(flag){
 				if(flag){
+
 					subtractionFinanceCountMember(task.getOrderNo(),tTaskMember.getCreateTime(),1);
 					subtractionFinanceCountMember(task.getOrderNo(),tTaskMember.getCreateTime(),1);
 				}
 				}
 			}else if(in.getType()==1){
 			}else if(in.getType()==1){
@@ -1489,6 +1499,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		tOrderTask.setMain(0);
 		tOrderTask.setMain(0);
 		tOrderTask.setCommodityPrice(new BigDecimal(0));
 		tOrderTask.setCommodityPrice(new BigDecimal(0));
 		tOrderTaskMapper.insertSelective(tOrderTask);
 		tOrderTaskMapper.insertSelective(tOrderTask);
+
 		TTaskMember t = tTaskMemberMapper.selectByTid(tid);
 		TTaskMember t = tTaskMemberMapper.selectByTid(tid);
 		TOrderTaskBo tb=new TOrderTaskBo();
 		TOrderTaskBo tb=new TOrderTaskBo();
 		BeanUtils.copyProperties(tOrderTask,tb);
 		BeanUtils.copyProperties(tOrderTask,tb);