瀏覽代碼

Merge branch 'test' of jishutao/kede-server into prod

anderx 1 年之前
父節點
當前提交
8996801296

+ 86 - 87
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -1032,9 +1032,21 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
     <if test="specially == 3">
-  	<if test="manageType ==0">
-      and dep.approval_aid= #{aid,jdbcType=VARCHAR}
+      and  a.order_status=2 and dep.approval_aid= #{aid,jdbcType=VARCHAR}
+
+      <if test="approval ==0">
+        and a.process_status in(4)
+        and a.approval = 0
+      </if>
+      <if test="approval ==1">
+        and a.process_status in(4)
+        and a.approval in(1)
+      </if>
+      <if test="approval ==2">
+        and a.approval in (2,3)
+      </if>
     </if>
+    <if test="specially == 11">
       and  a.order_status=2
       <if test="approval ==0">
         and a.process_status in(4)
@@ -1042,26 +1054,13 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
       </if>
       <if test="approval ==1">
         and a.process_status in(4)
-        and a.approval in
-            <if test="manageType ==0">
-            (1)
-            </if>
-        <if test="manageType ==1">
-          (4)
-        </if>
+        and a.approval in (4)
       </if>
       <if test="approval ==2">
-        and a.approval in
-        <if test="manageType ==0">
-          (2,3)
-        </if>
-        <if test="manageType ==1">
-          (5,6)
-        </if>
-
+        and a.approval in (5,6)
       </if>
     </if>
-  	  <if test="specially !=3 ">
+  	<if test="specially !=3 and specially !=11">
         <if test="approval ==0">
           and a.approval = 0
         </if>
@@ -1186,31 +1185,43 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
          and a.salesman_id = #{aid,jdbcType=VARCHAR}
        </if>
      </if>
-    <if test="outsource != null">
-  	and a.outsource= #{outsource,jdbcType=INTEGER}
-  	</if>
-  	<if test="specially == 0">
-      <if test="approval ==null">
-        and a.approval in(0,1,2,4,5,7,8)
-      </if>
-      and a.order_status  in(0,1,2,4)
-      and a.salesman_id = #{aid,jdbcType=VARCHAR}
-    </if>
+     <if test="outsource != null">
+       and a.outsource= #{outsource,jdbcType=INTEGER}
+     </if>
+     <if test="specially == 0">
+       <if test="approval ==null">
+         and a.approval in(0,1,2,4,5,7,8)
+       </if>
+       and a.order_status  in(0,1,2,4)
+       and a.salesman_id = #{aid,jdbcType=VARCHAR}
+     </if>
      <if test="specially == 10">
        and a.process_status = 1  and a.order_status in (0,1,2)
        and mg.manager_id= #{aid}
      </if>
-  	<if test="specially == 1">
-  	and a.process_status = 2  and a.order_status in (0,1,2)
-  	</if>
-  	<if test="specially == 2">
-  	and a.order_status in(3,5)
-  	and a.salesman_id = #{aid,jdbcType=VARCHAR}
-  	</if>
+     <if test="specially == 1">
+       and a.process_status = 2  and a.order_status in (0,1,2)
+     </if>
+     <if test="specially == 2">
+       and a.order_status in(3,5)
+       and a.salesman_id = #{aid,jdbcType=VARCHAR}
+     </if>
      <if test="specially == 3">
-       <if test="manageType ==0">
-         and dep.approval_aid= #{aid,jdbcType=VARCHAR}
+       and  a.order_status=2 and dep.approval_aid= #{aid,jdbcType=VARCHAR}
+
+       <if test="approval ==0">
+         and a.process_status in(4)
+         and a.approval = 0
        </if>
+       <if test="approval ==1">
+         and a.process_status in(4)
+         and a.approval in(1)
+       </if>
+       <if test="approval ==2">
+         and a.approval in (2,3)
+       </if>
+     </if>
+     <if test="specially == 11">
        and  a.order_status=2
        <if test="approval ==0">
          and a.process_status in(4)
@@ -1218,26 +1229,13 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
        </if>
        <if test="approval ==1">
          and a.process_status in(4)
-         and a.approval in
-         <if test="manageType ==0">
-           (1)
-         </if>
-         <if test="manageType ==1">
-           (4)
-         </if>
+         and a.approval in (4)
        </if>
        <if test="approval ==2">
-         and a.approval in
-         <if test="manageType ==0">
-           (2,3)
-         </if>
-         <if test="manageType ==1">
-           (5,6)
-         </if>
-
+         and a.approval in (5,6)
        </if>
      </if>
-     <if test="specially !=3 ">
+     <if test="specially !=3 and specially !=11">
        <if test="approval ==0">
          and a.approval = 0
        </if>
@@ -1251,10 +1249,10 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
          and a.approval in (1,2,4,5,7,8)
        </if>
      </if>
-  	<if test="specially == 4">
-  	and a.process_status in (3,5,6,7,99)
-  	and a.order_status  in(1,2,3,4,6)
-  	</if>
+     <if test="specially == 4">
+       and a.process_status in (3,5,6,7,99)
+       and a.order_status  in(1,2,3,4,6)
+     </if>
      <if test="deps!=null">
        and a.order_dep in
        <foreach close=")" collection="deps" item="dep" open="(" separator=",">
@@ -1273,48 +1271,49 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
      <if test="distribution == 3">
        and a.process_status = 7
      </if>
-  	<if test="name != null">
-  	and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
-  	</if>
+     <if test="name != null">
+       and b.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+     </if>
      <if test="projectType != null">
        and c.project_type = #{projectType}
      </if>
      <if test="processStatus != null">
        and a.process_status = #{processStatus}
      </if>
-  	<if test="orderNo != null">
-  	and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
-  	</if>
-  	<if test="contractNo != null">
-  	and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
-  	</if>
-  	<if test="liquidationStatus != null">
-  	and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
-  	</if>
+     <if test="orderNo != null">
+       and a.order_no like CONCAT('%',#{orderNo,jdbcType=VARCHAR},'%')
+     </if>
+     <if test="contractNo != null">
+       and a.contract_no like CONCAT('%',#{contractNo,jdbcType=VARCHAR},'%')
+     </if>
+     <if test="liquidationStatus != null">
+       and a.liquidation_status = #{liquidationStatus,jdbcType=INTEGER}
+     </if>
      <if test="tag != null">
        and a.tag= #{tag}
      </if>
-  	<if test="amountStatus == 0">
-  	and a.total_amount &lt; 10
-  	</if>
-  	<if test="amountStatus == 1">
-  	and a.total_amount between 10 and 20
-  	</if>
-  	<if test="amountStatus == 2">
-  	and a.total_amount between 20 and 30
-  	</if>
-  	<if test="amountStatus == 3">
-  	and a.total_amount between 30 and 40
-  	</if>
-  	<if test="amountStatus == 4">
-  	and a.total_amount  &gt; 40
-  	</if>
-  	<if test="starTime !=null and endTime !=null">
-  	and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
-  	</if>
+     <if test="amountStatus == 0">
+       and a.total_amount &lt; 10
+     </if>
+     <if test="amountStatus == 1">
+       and a.total_amount between 10 and 20
+     </if>
+     <if test="amountStatus == 2">
+       and a.total_amount between 20 and 30
+     </if>
+     <if test="amountStatus == 3">
+       and a.total_amount between 30 and 40
+     </if>
+     <if test="amountStatus == 4">
+       and a.total_amount  &gt; 40
+     </if>
+     <if test="starTime !=null and endTime !=null">
+       and a.create_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
+     </if>
      <if test="contractStart !=null and contractEnd !=null">
        and a.sign_time between #{contractStart,jdbcType=VARCHAR} and #{contractEnd,jdbcType=VARCHAR}
      </if>
+
   </select>
 
   <select id="selectDunOrderNewListByPage" resultType="com.goafanti.order.bo.outOrderDunListBo">

+ 5 - 3
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -1045,9 +1045,11 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
 
         in.setAid(TokenManager.getAdminId());
         OutExpenseAccount useEa = expenseAccountMapper.selectByaidAndPrid(in);
-        ExpenseRelationship er = expenseRelationshipMapper.selectSonId(useEa.getId());
-        if (er!=null){
-            throw new BusinessException("公出已经发起报销");
+        if (useEa!=null){
+            ExpenseRelationship er = expenseRelationshipMapper.selectSonId(useEa.getId());
+            if (er!=null){
+                throw new BusinessException("公出已经发起报销");
+            }
         }
         return useEa;
     }

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

@@ -943,14 +943,13 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			if (StringUtils.isNotBlank(in.getAid())) {
 				params.put("aid", in.getAid());
 			}
-		}
-		if (in.getSpecially()==3){
+		}else if (in.getSpecially()==3){
 			params.put("aid", TokenManager.getAdminId());
-			if (TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_ASSISTANT)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)){
-				params.put("manageType",1);
-			}else  {
-				params.put("manageType",0);
-			}
+			params.put("manageType",0);
+		}else if (in.getSpecially()==11){
+			params.put("aid", TokenManager.getAdminId());
+			params.put("manageType",1);
+			if (in.getApproval()==null)params.put("approval",1);
 		}
 		params.put("specially", in.getSpecially());
 		if (StringUtils.isNotBlank(in.getName())) {