Parcourir la source

触发逻辑修改

anderx il y a 3 ans
Parent
commit
b9efe2bc73

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

@@ -126,12 +126,12 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Apr 11 14:30:55 CST 2018.
     -->
-    order_no, order_type, creater, create_time, update_time, buyer_id, seller_id, first_payment, 
-    order_amount, brokerage_amount, sign_first_payment, actually_first_payment, sign_total_amount, 
-    actually_total_amount, sign_brokerage_amount, actually_brokerage_amount, sign_withdraw_amount, 
-    actually_withdraw_amount, order_stage, project_stage, order_status, liquidation_status, 
-    order_channel, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id, 
-    confirm_time, sign_time, set_up_time, settlement_time, contract_no, contract_type, 
+    order_no, order_type, creater, create_time, update_time, buyer_id, seller_id, first_payment,
+    order_amount, brokerage_amount, sign_first_payment, actually_first_payment, sign_total_amount,
+    actually_total_amount, sign_brokerage_amount, actually_brokerage_amount, sign_withdraw_amount,
+    actually_withdraw_amount, order_stage, project_stage, order_status, liquidation_status,
+    order_channel, approval, order_remarks, delete_sign, salesman_id, finance_id, technician_id,
+    confirm_time, sign_time, set_up_time, settlement_time, contract_no, contract_type,
     change_status
   </sql>
   <sql id="Blob_Column_List">
@@ -188,7 +188,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Apr 11 14:30:55 CST 2018.
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
@@ -221,31 +221,31 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Apr 11 14:30:55 CST 2018.
     -->
-    insert into t_order (order_no, order_type, creater, 
-      create_time, update_time, buyer_id, 
-      seller_id, first_payment, order_amount, 
-      brokerage_amount, sign_first_payment, actually_first_payment, 
-      sign_total_amount, actually_total_amount, sign_brokerage_amount, 
-      actually_brokerage_amount, sign_withdraw_amount, 
-      actually_withdraw_amount, order_stage, project_stage, 
-      order_status, liquidation_status, order_channel, 
-      approval, order_remarks, delete_sign, 
-      salesman_id, finance_id, technician_id, 
-      confirm_time, sign_time, set_up_time, 
-      settlement_time, contract_no, contract_type, 
+    insert into t_order (order_no, order_type, creater,
+      create_time, update_time, buyer_id,
+      seller_id, first_payment, order_amount,
+      brokerage_amount, sign_first_payment, actually_first_payment,
+      sign_total_amount, actually_total_amount, sign_brokerage_amount,
+      actually_brokerage_amount, sign_withdraw_amount,
+      actually_withdraw_amount, order_stage, project_stage,
+      order_status, liquidation_status, order_channel,
+      approval, order_remarks, delete_sign,
+      salesman_id, finance_id, technician_id,
+      confirm_time, sign_time, set_up_time,
+      settlement_time, contract_no, contract_type,
       change_status, contract_picture_url)
-    values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR}, 
-      #{sellerId,jdbcType=VARCHAR}, #{firstPayment,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL}, 
-      #{brokerageAmount,jdbcType=DECIMAL}, #{signFirstPayment,jdbcType=DECIMAL}, #{actuallyFirstPayment,jdbcType=DECIMAL}, 
-      #{signTotalAmount,jdbcType=DECIMAL}, #{actuallyTotalAmount,jdbcType=DECIMAL}, #{signBrokerageAmount,jdbcType=DECIMAL}, 
-      #{actuallyBrokerageAmount,jdbcType=DECIMAL}, #{signWithdrawAmount,jdbcType=DECIMAL}, 
-      #{actuallyWithdrawAmount,jdbcType=DECIMAL}, #{orderStage,jdbcType=INTEGER}, #{projectStage,jdbcType=INTEGER}, 
-      #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{orderChannel,jdbcType=INTEGER}, 
-      #{approval,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER}, 
-      #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR}, 
-      #{confirmTime,jdbcType=TIMESTAMP}, #{signTime,jdbcType=TIMESTAMP}, #{setUpTime,jdbcType=TIMESTAMP}, 
-      #{settlementTime,jdbcType=TIMESTAMP}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR}, 
+    values (#{orderNo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}, #{creater,jdbcType=VARCHAR},
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR},
+      #{sellerId,jdbcType=VARCHAR}, #{firstPayment,jdbcType=DECIMAL}, #{orderAmount,jdbcType=DECIMAL},
+      #{brokerageAmount,jdbcType=DECIMAL}, #{signFirstPayment,jdbcType=DECIMAL}, #{actuallyFirstPayment,jdbcType=DECIMAL},
+      #{signTotalAmount,jdbcType=DECIMAL}, #{actuallyTotalAmount,jdbcType=DECIMAL}, #{signBrokerageAmount,jdbcType=DECIMAL},
+      #{actuallyBrokerageAmount,jdbcType=DECIMAL}, #{signWithdrawAmount,jdbcType=DECIMAL},
+      #{actuallyWithdrawAmount,jdbcType=DECIMAL}, #{orderStage,jdbcType=INTEGER}, #{projectStage,jdbcType=INTEGER},
+      #{orderStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{orderChannel,jdbcType=INTEGER},
+      #{approval,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=INTEGER},
+      #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, #{technicianId,jdbcType=VARCHAR},
+      #{confirmTime,jdbcType=TIMESTAMP}, #{signTime,jdbcType=TIMESTAMP}, #{setUpTime,jdbcType=TIMESTAMP},
+      #{settlementTime,jdbcType=TIMESTAMP}, #{contractNo,jdbcType=VARCHAR}, #{contractType,jdbcType=VARCHAR},
       #{changeStatus,jdbcType=INTEGER}, #{contractPictureUrl,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrder">
@@ -920,7 +920,7 @@
       change_status = #{changeStatus,jdbcType=INTEGER}
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </update>
-  
+
   <select id="selectCommodityDetail" resultType="com.goafanti.order.bo.CommodityDetailBo">
   	<choose>
   		<when test="commodityType == 0">
@@ -933,24 +933,24 @@
   			select id as commodityId,name as commodityName,problem_des as introduction,ifnull(budget_cost,0) as commodityPrice,employer_id as sellerId from demand where id = #{commodityId,jdbcType=VARCHAR}
   		</when>
   		<when test="commodityType == 3">
-  			select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a 
+  			select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a
   			left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
   		</when>
   		<when test="commodityType == 4">
-  			
+
   		</when>
   		<when test="commodityType == 5">
-  		
+
   		</when>
   		<when test="commodityType == 6">
-  			select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a 
+  			select a.id as commodityId,a.nickname as commodityName,a.id as sellerId,ifnull(b.consultation_price,0) as commodityPrice,ifnull(b.professional_title,'暂无职称') as introduction from user a
   			left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
   		</when>
   	</choose>
   </select>
-  
+
   <select id="selectOrderListByPage" resultMap="BaseResultMap">
-  	select 
+  	select
     <include refid="Base_Column_List" />
     from t_order where delete_sign = 0
     <choose>
@@ -966,10 +966,10 @@
 			${page_sql}
 	</if>
   </select>
-  
+
    <select id="selectOrderListCount" resultType="java.lang.Integer">
-  	select 
-  		count(0) 
+  	select
+  		count(0)
   	from t_order where delete_sign = 0
     <choose>
     	<when test="orderStatus == 0"><!-- 意向订单 -->
@@ -980,7 +980,7 @@
     	</otherwise>
     </choose>
   </select>
-  
+
   <select id="selectOrderBillByPage" resultType="com.goafanti.order.bo.BillListBo">
 	select
 		a.order_no as orderNo,
@@ -1000,7 +1000,7 @@
 			${page_sql}
 		</if>
   </select>
-  
+
   <select id="selectOrderBillCount" resultType="java.lang.Integer">
   	select
 		count(0)
@@ -1012,7 +1012,7 @@
 			a.order_no = #{orderNo,jdbcType=VARCHAR}
 		</if>
   </select>
-  
+
   <select id="selectOrderCommodity" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderDetail">
 		select
 			id,
@@ -1033,7 +1033,7 @@
 		where
 			order_no = #{orderNo,jdbcType=VARCHAR}
   </select>
-  
+
   <select id="selectServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
 		select
 			a.order_no as orderNo,
@@ -1051,7 +1051,7 @@
 			a.buyer_id as buyerId,
 			a.seller_id as sellerId,
 			a.delete_sign as deleteSign,
-			b.nickname as buyerName,		
+			b.nickname as buyerName,
 			c.name as salesmanName,
 			d.name as financeName,
 			e.name as technicianName,
@@ -1061,9 +1061,9 @@
 			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 f on 
+			a.technician_id = e.id left join department f on
 			c.department_id = f.id
-		where a.order_type = 0 and a.delete_sign != 1
+		where a.order_type = 0 and a.delete_sign in(0,2,3)
 		<if test="deleteStatus==1">
 		and a.delete_sign = 0
 		</if>
@@ -1139,9 +1139,9 @@
 			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 f on 
+			a.technician_id = e.id left join department f on
 			c.department_id = f.id
-		where a.order_type = 0 and a.delete_sign != 1
+		where a.order_type = 0 and a.delete_sign in(0,2,3)
 		<if test="deleteStatus==1">
 		and a.delete_sign = 0
 		</if>
@@ -1211,7 +1211,7 @@
 		</if>
 		<!-- 特殊处理字段结束 -->
   </select>
-  
+
   <select id="selectServiceOrderDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.ServiceOrderDetailBo">
   		select
 			a.order_no as orderNo,
@@ -1254,13 +1254,13 @@
 			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 department x on 
+			a.finance_id = d.id left join department x on
 			c.department_id=x.id left join admin e on
 			a.technician_id = e.id left join business_category f on
 			a.contract_type = f.id
 		where a.order_no = #{orderNo,jdbcType=VARCHAR}
   </select>
-  
+
   <select id="selectPublicOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
   		select
 			a.order_no as orderNo,
@@ -1275,7 +1275,7 @@
 			b.nickname as buyerName
 		from
 			t_order a left join user b on
-			a.buyer_id = b.id 
+			a.buyer_id = b.id
 		where a.salesman_id is null
 		<if test="startDate != null">
 			and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
@@ -1304,7 +1304,7 @@
 			count(0)
 		from
 			t_order a left join user b on
-			a.buyer_id = b.id 
+			a.buyer_id = b.id
 		where a.salesman_id is null
 		<if test="startDate != null">
 			and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
@@ -1337,7 +1337,7 @@
 			a.order_channel as orderChannel,
 			a.buyer_id as buyerId,
 			a.seller_id as sellerId,
-			b.nickname as buyerName,		
+			b.nickname as buyerName,
 			c.name as salesmanName,
 			d.name as financeName,
 			e.name as technicianName,
@@ -1347,9 +1347,9 @@
 			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 f on 
+			a.technician_id = e.id left join department f on
 			c.department_id = f.id
-		where a.order_type = 0 and order_status = 3	and delete_sign = 0	
+		where a.order_type = 0 and order_status = 3	and delete_sign = 0
 		<if test="orderNo != null">
 			and a.order_no = #{orderNo,jdbcType=VARCHAR}
 		</if>
@@ -1402,9 +1402,9 @@
 			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 f on 
+			a.technician_id = e.id left join department f on
 			c.department_id = f.id
-		where a.order_type = 0 and order_status = 3	and delete_sign = 0	
+		where a.order_type = 0 and order_status = 3	and delete_sign = 0
 		<if test="orderNo != null">
 			and a.order_no = #{orderNo,jdbcType=VARCHAR}
 		</if>
@@ -1466,10 +1466,10 @@
 		g.name as departmentName
 	from
 		t_order_bill a left join t_order b on
-		a.order_no = b.order_no left join user c 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 
+		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 g on
 		f.department_id = g.id
 	where a.delete_sign = 0
@@ -1498,15 +1498,15 @@
 		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 
+		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} 
+		and b.finance_id = #{aid,jdbcType=VARCHAR}
 	</if>
 		order by a.create_time desc
 	<if test="page_sql != null">
@@ -1518,10 +1518,10 @@
   		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.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 
+		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 g on
 		f.department_id = g.id
 	where a.delete_sign = 0
@@ -1550,18 +1550,18 @@
 		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 
+		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} 
+		and b.finance_id = #{aid,jdbcType=VARCHAR}
 	</if>
   </select>
-  
+
   <select id="selectBillDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillDetailBo">
 		select
 			a.bill_no as billNo,
@@ -1594,7 +1594,7 @@
 		where
 			a.bill_no = #{billNo,jdbcType=VARCHAR}
   </select>
-  
+
   <select id="selectSetUpServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
 		select
 			a.order_no as orderNo,
@@ -1616,7 +1616,7 @@
 			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 f on 
+			a.technician_id = e.id left join department f on
 			c.department_id = f.id left join business_category g on
 			a.contract_type = g.id
 		where a.order_type = 0 and a.order_status = 3 and project_stage = 1
@@ -1665,7 +1665,7 @@
 			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 f on 
+			a.technician_id = e.id left join department f on
 			c.department_id = f.id left join business_category g on
 			a.contract_type = g.id
 		where a.order_type = 0 and a.order_status = 3 and project_stage = 1
@@ -1701,7 +1701,7 @@
 			and d.name = #{financeName,jdbcType=VARCHAR}
 		</if>
   </select>
-  
+
   <select id="selectBillByOrderNo" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillListBo">
   	select
 		a.bill_no as billNo,
@@ -1723,10 +1723,10 @@
 		g.name as departmentName
 	from
 		t_order_bill a left join t_order b on
-		a.order_no = b.order_no left join user c 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 
+		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 g on
 		f.department_id = g.id
 	where a.order_no = #{orderNo,jdbcType=VARCHAR} and a.delete_sign = 0
@@ -1736,4 +1736,4 @@
   	    select b.nickname from t_order a inner join user b on a.buyer_id =b.id
     where a.order_no= #{orderNo,jdbcType=VARCHAR}
   </select>
-</mapper>
+</mapper>

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

@@ -537,7 +537,7 @@
   	,liquidation_status,o.finance_id as financeId,contract_no as contractNo,d.name as departmentName,e.name as outsourceName
   	from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
   	left join department d on o.order_dep=d.id left join (select order_no,max(name)as name from outsource_organization group by order_no) e
-  	 on o.order_no=e.order_no  left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1
+  	 on o.order_no=e.order_no  left join t_order_outsource f on f.order_no=o.order_no where delete_sign in(0,2,3)
   	and approval in (0,2)
   	<if test="o.outsource != null">
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
@@ -581,7 +581,7 @@
   </select>
   <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
   select count(*) from t_order_new o left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id
-  	left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1  and approval in (0,2)
+  	left join t_order_outsource f on f.order_no=o.order_no where delete_sign in(0,2,3)  and approval in (0,2)
 	<if test="o.outsource != null">
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
   	</if>
@@ -1226,7 +1226,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     a.reason,b.liquidation_status as liquidationStatus
     from t_order_refund 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  b.delete_sign != 1
+    where  b.delete_sign in(0,2,3)
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
@@ -1250,7 +1250,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
 		count(*)
   	 from t_order_refund 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  b.delete_sign != 1
+    where  b.delete_sign in(0,2,3)
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
@@ -1300,7 +1300,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   <select id="countTotalAndActually" parameterType="Map" resultType="java.util.Map">
 	   select sum(o.settlement_amount) actuallyTotalAmount,sum(o.total_amount) signTotalAmount from t_order_new o
   left join department d   on o.order_dep=d.id left join `user` u on o.buyer_id = u.id  left join t_order_mid a on o.order_no=a.order_no
-  where o.delete_sign != 1  and (o.approval = 0 or o.approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}
+  where o.delete_sign in(0,2,3)  and (o.approval = 0 or o.approval = 2) and outsource=  #{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1369,7 +1369,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   </select>
   <update id="updateSalesmanId">
   	update t_order_new set salesman_id= #{transferId},old_salesman_id= #{aid}
-	where delete_sign !=1 and salesman_id= #{aid}
+	where delete_sign in(0,2,3) and salesman_id= #{aid}
   </update>
 
   <select id="selectUsedOrderByOrder" resultType="com.goafanti.order.bo.TOrderNewBo">
@@ -1407,7 +1407,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     left join (select order_no ,commodity_name from t_order_task where main =1)x on a.order_no =x.order_no
     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 t_order_mid tm on b.order_no=tm.order_no left join department dep on b.order_dep=dep.id
-    where  b.delete_sign != 1 and dun_status in (1,2,3)
+    where   b.delete_sign in(0,2,3) and dun_status in (1,2,3)
 	<if test="shiroType == 1 and fid !=null">
   	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
   	</if>
@@ -1447,7 +1447,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   select count(*) from t_arrears_dun a
    	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 t_order_mid tm on b.order_no=tm.order_no left join department dep on b.order_dep=dep.id
-	where  b.delete_sign != 1 and dun_status in (1,2,3)
+	where   b.delete_sign in(0,2,3) and dun_status in (1,2,3)
 	<if test="shiroType == 1 and fid !=null">
   	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
   	</if>

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

@@ -41,8 +41,8 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Aug 05 11:38:34 CST 2021.
     -->
-    id, order_no, refund_status, create_time, remarks, attachment_url, amount, company_name, 
-    audit_time, unit_price, unit_number, outsource_remarks, `type`, tid, start_type, 
+    id, order_no, refund_status, create_time, remarks, attachment_url, amount, company_name,
+    audit_time, unit_price, unit_number, outsource_remarks, `type`, tid, start_type,
     patent_type, patent_name_type, patent_name, actual_official
   </sql>
   <sql id="Blob_Column_List">
@@ -59,7 +59,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Aug 05 11:38:34 CST 2021.
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
@@ -81,19 +81,19 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Aug 05 11:38:34 CST 2021.
     -->
-    insert into t_order_outsource (id, order_no, refund_status, 
-      create_time, remarks, attachment_url, 
-      amount, company_name, audit_time, 
-      unit_price, unit_number, outsource_remarks, 
-      `type`, tid, start_type, 
-      patent_type, patent_name_type, patent_name, 
+    insert into t_order_outsource (id, order_no, refund_status,
+      create_time, remarks, attachment_url,
+      amount, company_name, audit_time,
+      unit_price, unit_number, outsource_remarks,
+      `type`, tid, start_type,
+      patent_type, patent_name_type, patent_name,
       actual_official, picture_url)
-    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{refundStatus,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR}, 
-      #{amount,jdbcType=DECIMAL}, #{companyName,jdbcType=VARCHAR}, #{auditTime,jdbcType=TIMESTAMP}, 
-      #{unitPrice,jdbcType=DECIMAL}, #{unitNumber,jdbcType=INTEGER}, #{outsourceRemarks,jdbcType=VARCHAR}, 
-      #{type,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{startType,jdbcType=INTEGER}, 
-      #{patentType,jdbcType=INTEGER}, #{patentNameType,jdbcType=INTEGER}, #{patentName,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=INTEGER}, #{orderNo,jdbcType=VARCHAR}, #{refundStatus,jdbcType=INTEGER},
+      #{createTime,jdbcType=TIMESTAMP}, #{remarks,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=VARCHAR},
+      #{amount,jdbcType=DECIMAL}, #{companyName,jdbcType=VARCHAR}, #{auditTime,jdbcType=TIMESTAMP},
+      #{unitPrice,jdbcType=DECIMAL}, #{unitNumber,jdbcType=INTEGER}, #{outsourceRemarks,jdbcType=VARCHAR},
+      #{type,jdbcType=INTEGER}, #{tid,jdbcType=INTEGER}, #{startType,jdbcType=INTEGER},
+      #{patentType,jdbcType=INTEGER}, #{patentNameType,jdbcType=INTEGER}, #{patentName,jdbcType=VARCHAR},
       #{actualOfficial,jdbcType=INTEGER}, #{pictureUrl,jdbcType=LONGVARCHAR})
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderOutsource">
@@ -387,7 +387,7 @@
 	<if test="type != null">
 	and a.type = #{type}
 	</if>
-	
+
 	<if test="type ==1 and tid !=null">
 	and (h.id= #{tid} or h.split_super= #{tid})
 	</if>
@@ -409,7 +409,7 @@
 	</if>
   </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 
+  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 b.approval !=3 and start_type=0
   <if test="type != null">
 	and a.type = #{type}
@@ -438,7 +438,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 b.order_dep=e.id
 	left join admin f on e.finance_id=f.id
-	where b.delete_sign !=1 and b.outsource=1
+	where b.delete_sign in(0,2,3) and b.outsource=1
 		and d.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
@@ -461,9 +461,9 @@
 	</if>
   </select>
   <select id="salesmanOrderOutsourceCount" resultType="java.lang.Integer">
-  select count(*) from t_order_outsource a left join t_order_new b on a.order_no=b.order_no 
+  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  left join admin d on b.salesman_id=d.id
-  where b.delete_sign !=1 and b.outsource=1
+  where b.delete_sign in(0,2,3) and b.outsource=1
   	and d.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
@@ -490,6 +490,6 @@
   <update id="updateByidNull">
   update t_order_outsource
 	set unit_number=null,unit_price=NULL
-	where id= #{id} 
+	where id= #{id}
   </update>
-</mapper>
+</mapper>

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

@@ -1400,7 +1400,7 @@
     left join admin d on a.task_receiver=d.id left join t_order_new e on a.order_no=e.order_no
     left join user f on e.buyer_id=f.id left join department h on e.order_dep=h.id
     left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
-    where e.delete_sign !=1
+    where e.delete_sign in(0,2,3)
     <if test="orderNo != null">
       and a.order_no= #{orderNo,jdbcType=VARCHAR}
     </if>
@@ -1439,7 +1439,7 @@
     left join user f on e.buyer_id=f.id
     left join department h on e.order_dep=h.id
     left join (select task_id , sum(already_number) as alreadyNumber from task_progress group by task_id) i on a.id=i.task_id
-    where e.delete_sign !=1
+    where e.delete_sign in(0,2,3)
     <if test="orderNo != null">
       and a.order_no= #{orderNo,jdbcType=VARCHAR}
     </if>

+ 4 - 3
src/main/java/com/goafanti/common/task/OrderDunTask.java

@@ -73,8 +73,9 @@ public class OrderDunTask {
 	 * 	每天凌晨3点轮
 	 */
 //	@ResponseBody
-	@Scheduled(cron = "0 0 3  * * ?")
+//	@Scheduled(cron = "0 0 3  * * ?")
 //	@RequestMapping(value = "/open/test", method = RequestMethod.GET)
+	@Scheduled(cron = "0 0 11  * * ?")
 	@Transactional(rollbackFor=Exception.class)
 	public void startTask() throws InterruptedException {
 		updateNewOrderDun();
@@ -155,7 +156,7 @@ public class OrderDunTask {
 					updateOrderDun(o,now,now2);
 				}
 			}
-			calibrationDun();
+//			calibrationDun();
   		} catch (Exception e) {
   			EmailBo emailBo = new EmailBo( "催款处理失败",  AFTConstants.ADMIN_EMAIL,  "超管", "平台",  "系统", devName+"催款处理失败");
   			asyncUtils.send(emailBo);
@@ -364,8 +365,8 @@ public class OrderDunTask {
 			o.setStatus(1);
 			o.setStartTime(date);
 			if (t.getMoney()==null)t.setMoney(new BigDecimal(0));
-			TOrderMid tm=orderNewService.pushOrderMidDun(t.getOrderNo(),orderNew.getSettlementAmount(),date,t);
 			newOrderDunService.updateDun(o);
+			TOrderMid tm=orderNewService.pushOrderMidDun(t.getOrderNo(),orderNew.getSettlementAmount(),date,t);
 			TArrearsDun td=new TArrearsDun();
 			td.setOrderArrears(tm.getOrderArrears());
 			td.setOrderReceivables(tm.getOrderReceivables());

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

@@ -577,6 +577,9 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 					if(flag) {
 					//如果启动催款,则新增欠款与应收款
 						TOrderNew tn=tOrderNewMapper.selectByPrimaryKey(task2.getOrderNo());
+						ob.setStatus(1);
+						ob.setStartTime(new Date());
+						newOrderDunMapper.updateByPrimaryKeySelective(ob);
 						TOrderMid tm=orderNewService.pushOrderMidDun(task2.getOrderNo(),tn.getSettlementAmount(),new Date(),ob);
 						TArrearsDun td=new TArrearsDun();
 						td.setOrderArrears(tm.getOrderArrears());
@@ -590,9 +593,6 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 							tArrearsDunMapper.updateByPrimaryKeySelective(td);
 						}
 					orderNewService.addNewDunNoticAndSendEmail(task2.getOrderNo(),ob);
-					ob.setStatus(1);
-					ob.setStartTime(new Date());
-					newOrderDunMapper.updateByPrimaryKeySelective(ob);
 
 				}
 			}