Browse Source

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

anderx 4 years ago
parent
commit
6f9723cdca

+ 2 - 2
src/main/java/com/goafanti/common/dao/NewOrderDunMapper.java

@@ -77,7 +77,7 @@ public interface NewOrderDunMapper {
 	 */
 	 */
 	int updateByPrimaryKey(NewOrderDun record);
 	int updateByPrimaryKey(NewOrderDun record);
 
 
-	List<OutNewOrderDunBo> selectListNewOrderDun(@Param("orderNo")String orderNo,@Param("aid") String aid,@Param("status")Integer status);
+	List<OutNewOrderDunBo> selectListNewOrderDun(@Param("orderNo")String orderNo,@Param("status")Integer status);
 
 
 	List<OutNewOrderDunBo> selectAllOrderDun();
 	List<OutNewOrderDunBo> selectAllOrderDun();
 
 
@@ -91,4 +91,4 @@ public interface NewOrderDunMapper {
 
 
 	List<OutSelectOrderDun> selectOrderDun(@Param("depId") String depId,@Param("aid") String aid,@Param("sort") Integer sort,@Param("province") Integer province,
 	List<OutSelectOrderDun> selectOrderDun(@Param("depId") String depId,@Param("aid") String aid,@Param("sort") Integer sort,@Param("province") Integer province,
 										   @Param("startDate") String startDate, @Param("endDate")  String endDate);
 										   @Param("startDate") String startDate, @Param("endDate")  String endDate);
-}
+}

+ 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 is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Apr 11 14:30:55 CST 2018.
       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
     change_status
   </sql>
   </sql>
   <sql id="Blob_Column_List">
   <sql id="Blob_Column_List">
@@ -188,7 +188,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Apr 11 14:30:55 CST 2018.
       This element was generated on Wed Apr 11 14:30:55 CST 2018.
     -->
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     ,
     ,
     <include refid="Blob_Column_List" />
     <include refid="Blob_Column_List" />
@@ -221,31 +221,31 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Wed Apr 11 14:30:55 CST 2018.
       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)
       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})
       #{changeStatus,jdbcType=INTEGER}, #{contractPictureUrl,jdbcType=LONGVARCHAR})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrder">
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrder">
@@ -920,7 +920,7 @@
       change_status = #{changeStatus,jdbcType=INTEGER}
       change_status = #{changeStatus,jdbcType=INTEGER}
     where order_no = #{orderNo,jdbcType=VARCHAR}
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </update>
   </update>
-  
+
   <select id="selectCommodityDetail" resultType="com.goafanti.order.bo.CommodityDetailBo">
   <select id="selectCommodityDetail" resultType="com.goafanti.order.bo.CommodityDetailBo">
   	<choose>
   	<choose>
   		<when test="commodityType == 0">
   		<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}
   			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>
   		<when test="commodityType == 3">
   		<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}
   			left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
   		</when>
   		</when>
   		<when test="commodityType == 4">
   		<when test="commodityType == 4">
-  			
+
   		</when>
   		</when>
   		<when test="commodityType == 5">
   		<when test="commodityType == 5">
-  		
+
   		</when>
   		</when>
   		<when test="commodityType == 6">
   		<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}
   			left join user_identity b on a.id=b.uid where a.id = #{commodityId,jdbcType=VARCHAR}
   		</when>
   		</when>
   	</choose>
   	</choose>
   </select>
   </select>
-  
+
   <select id="selectOrderListByPage" resultMap="BaseResultMap">
   <select id="selectOrderListByPage" resultMap="BaseResultMap">
-  	select 
+  	select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     from t_order where delete_sign = 0
     from t_order where delete_sign = 0
     <choose>
     <choose>
@@ -966,10 +966,10 @@
 			${page_sql}
 			${page_sql}
 	</if>
 	</if>
   </select>
   </select>
-  
+
    <select id="selectOrderListCount" resultType="java.lang.Integer">
    <select id="selectOrderListCount" resultType="java.lang.Integer">
-  	select 
-  		count(0) 
+  	select
+  		count(0)
   	from t_order where delete_sign = 0
   	from t_order where delete_sign = 0
     <choose>
     <choose>
     	<when test="orderStatus == 0"><!-- 意向订单 -->
     	<when test="orderStatus == 0"><!-- 意向订单 -->
@@ -980,7 +980,7 @@
     	</otherwise>
     	</otherwise>
     </choose>
     </choose>
   </select>
   </select>
-  
+
   <select id="selectOrderBillByPage" resultType="com.goafanti.order.bo.BillListBo">
   <select id="selectOrderBillByPage" resultType="com.goafanti.order.bo.BillListBo">
 	select
 	select
 		a.order_no as orderNo,
 		a.order_no as orderNo,
@@ -1000,7 +1000,7 @@
 			${page_sql}
 			${page_sql}
 		</if>
 		</if>
   </select>
   </select>
-  
+
   <select id="selectOrderBillCount" resultType="java.lang.Integer">
   <select id="selectOrderBillCount" resultType="java.lang.Integer">
   	select
   	select
 		count(0)
 		count(0)
@@ -1012,7 +1012,7 @@
 			a.order_no = #{orderNo,jdbcType=VARCHAR}
 			a.order_no = #{orderNo,jdbcType=VARCHAR}
 		</if>
 		</if>
   </select>
   </select>
-  
+
   <select id="selectOrderCommodity" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderDetail">
   <select id="selectOrderCommodity" parameterType="java.lang.String" resultType="com.goafanti.common.model.TOrderDetail">
 		select
 		select
 			id,
 			id,
@@ -1033,7 +1033,7 @@
 		where
 		where
 			order_no = #{orderNo,jdbcType=VARCHAR}
 			order_no = #{orderNo,jdbcType=VARCHAR}
   </select>
   </select>
-  
+
   <select id="selectServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
   <select id="selectServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
 		select
 		select
 			a.order_no as orderNo,
 			a.order_no as orderNo,
@@ -1051,7 +1051,7 @@
 			a.buyer_id as buyerId,
 			a.buyer_id as buyerId,
 			a.seller_id as sellerId,
 			a.seller_id as sellerId,
 			a.delete_sign as deleteSign,
 			a.delete_sign as deleteSign,
-			b.nickname as buyerName,		
+			b.nickname as buyerName,
 			c.name as salesmanName,
 			c.name as salesmanName,
 			d.name as financeName,
 			d.name as financeName,
 			e.name as technicianName,
 			e.name as technicianName,
@@ -1061,9 +1061,9 @@
 			a.buyer_id = b.id left join admin c on
 			a.buyer_id = b.id left join admin c on
 			a.salesman_id = c.id left join admin d on
 			a.salesman_id = c.id left join admin d on
 			a.finance_id = d.id left join admin e 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
 			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">
 		<if test="deleteStatus==1">
 		and a.delete_sign = 0
 		and a.delete_sign = 0
 		</if>
 		</if>
@@ -1139,9 +1139,9 @@
 			a.buyer_id = b.id left join admin c on
 			a.buyer_id = b.id left join admin c on
 			a.salesman_id = c.id left join admin d on
 			a.salesman_id = c.id left join admin d on
 			a.finance_id = d.id left join admin e 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
 			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">
 		<if test="deleteStatus==1">
 		and a.delete_sign = 0
 		and a.delete_sign = 0
 		</if>
 		</if>
@@ -1211,7 +1211,7 @@
 		</if>
 		</if>
 		<!-- 特殊处理字段结束 -->
 		<!-- 特殊处理字段结束 -->
   </select>
   </select>
-  
+
   <select id="selectServiceOrderDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.ServiceOrderDetailBo">
   <select id="selectServiceOrderDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.ServiceOrderDetailBo">
   		select
   		select
 			a.order_no as orderNo,
 			a.order_no as orderNo,
@@ -1254,13 +1254,13 @@
 			t_order a left join user b on
 			t_order a left join user b on
 			a.buyer_id = b.id left join admin c on
 			a.buyer_id = b.id left join admin c on
 			a.salesman_id = c.id left join admin d 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
 			c.department_id=x.id left join admin e on
 			a.technician_id = e.id left join business_category f on
 			a.technician_id = e.id left join business_category f on
 			a.contract_type = f.id
 			a.contract_type = f.id
 		where a.order_no = #{orderNo,jdbcType=VARCHAR}
 		where a.order_no = #{orderNo,jdbcType=VARCHAR}
   </select>
   </select>
-  
+
   <select id="selectPublicOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
   <select id="selectPublicOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
   		select
   		select
 			a.order_no as orderNo,
 			a.order_no as orderNo,
@@ -1275,7 +1275,7 @@
 			b.nickname as buyerName
 			b.nickname as buyerName
 		from
 		from
 			t_order a left join user b on
 			t_order a left join user b on
-			a.buyer_id = b.id 
+			a.buyer_id = b.id
 		where a.salesman_id is null
 		where a.salesman_id is null
 		<if test="startDate != null">
 		<if test="startDate != null">
 			and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
 			and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
@@ -1304,7 +1304,7 @@
 			count(0)
 			count(0)
 		from
 		from
 			t_order a left join user b on
 			t_order a left join user b on
-			a.buyer_id = b.id 
+			a.buyer_id = b.id
 		where a.salesman_id is null
 		where a.salesman_id is null
 		<if test="startDate != null">
 		<if test="startDate != null">
 			and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
 			and a.create_time &gt; #{a.startDate,jdbcType=TIMESTAMP}
@@ -1337,7 +1337,7 @@
 			a.order_channel as orderChannel,
 			a.order_channel as orderChannel,
 			a.buyer_id as buyerId,
 			a.buyer_id as buyerId,
 			a.seller_id as sellerId,
 			a.seller_id as sellerId,
-			b.nickname as buyerName,		
+			b.nickname as buyerName,
 			c.name as salesmanName,
 			c.name as salesmanName,
 			d.name as financeName,
 			d.name as financeName,
 			e.name as technicianName,
 			e.name as technicianName,
@@ -1347,9 +1347,9 @@
 			a.buyer_id = b.id left join admin c on
 			a.buyer_id = b.id left join admin c on
 			a.salesman_id = c.id left join admin d on
 			a.salesman_id = c.id left join admin d on
 			a.finance_id = d.id left join admin e 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
 			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">
 		<if test="orderNo != null">
 			and a.order_no = #{orderNo,jdbcType=VARCHAR}
 			and a.order_no = #{orderNo,jdbcType=VARCHAR}
 		</if>
 		</if>
@@ -1402,9 +1402,9 @@
 			a.buyer_id = b.id left join admin c on
 			a.buyer_id = b.id left join admin c on
 			a.salesman_id = c.id left join admin d on
 			a.salesman_id = c.id left join admin d on
 			a.finance_id = d.id left join admin e 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
 			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">
 		<if test="orderNo != null">
 			and a.order_no = #{orderNo,jdbcType=VARCHAR}
 			and a.order_no = #{orderNo,jdbcType=VARCHAR}
 		</if>
 		</if>
@@ -1466,10 +1466,10 @@
 		g.name as departmentName
 		g.name as departmentName
 	from
 	from
 		t_order_bill a left join t_order b on
 		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.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
 		b.salesman_id = f.id left join department g on
 		f.department_id = g.id
 		f.department_id = g.id
 	where a.delete_sign = 0
 	where a.delete_sign = 0
@@ -1498,15 +1498,15 @@
 		and f.department_id = #{depId,jdbcType=VARCHAR}
 		and f.department_id = #{depId,jdbcType=VARCHAR}
 	</if>
 	</if>
 	<if test="isFinance == 0"> <!-- 我的订单流水查询 -->
 	<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})
 			b.technician_id = #{aid,jdbcType=VARCHAR})
 	</if>
 	</if>
 	<if test="isFinance == 1"> <!-- 我的结算流水 -->
 	<if test="isFinance == 1"> <!-- 我的结算流水 -->
-		and b.finance_id = #{aid,jdbcType=VARCHAR} 
+		and b.finance_id = #{aid,jdbcType=VARCHAR}
 	</if>
 	</if>
 		order by a.create_time desc
 		order by a.create_time desc
 	<if test="page_sql != null">
 	<if test="page_sql != null">
@@ -1518,10 +1518,10 @@
   		count(0)
   		count(0)
   	from
   	from
 		t_order_bill a left join t_order b on
 		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.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
 		b.salesman_id = f.id left join department g on
 		f.department_id = g.id
 		f.department_id = g.id
 	where a.delete_sign = 0
 	where a.delete_sign = 0
@@ -1550,18 +1550,18 @@
 		and f.department_id = #{depId,jdbcType=VARCHAR}
 		and f.department_id = #{depId,jdbcType=VARCHAR}
 	</if>
 	</if>
 	<if test="isFinance == 0"> <!-- 我的订单流水查询 -->
 	<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})
 			b.technician_id = #{aid,jdbcType=VARCHAR})
 	</if>
 	</if>
 	<if test="isFinance == 1"> <!-- 我的结算流水 -->
 	<if test="isFinance == 1"> <!-- 我的结算流水 -->
-		and b.finance_id = #{aid,jdbcType=VARCHAR} 
+		and b.finance_id = #{aid,jdbcType=VARCHAR}
 	</if>
 	</if>
   </select>
   </select>
-  
+
   <select id="selectBillDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillDetailBo">
   <select id="selectBillDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillDetailBo">
 		select
 		select
 			a.bill_no as billNo,
 			a.bill_no as billNo,
@@ -1594,7 +1594,7 @@
 		where
 		where
 			a.bill_no = #{billNo,jdbcType=VARCHAR}
 			a.bill_no = #{billNo,jdbcType=VARCHAR}
   </select>
   </select>
-  
+
   <select id="selectSetUpServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
   <select id="selectSetUpServiceOrderByPage" resultType="com.goafanti.order.bo.OrderListBo">
 		select
 		select
 			a.order_no as orderNo,
 			a.order_no as orderNo,
@@ -1616,7 +1616,7 @@
 			a.buyer_id = b.id left join admin c on
 			a.buyer_id = b.id left join admin c on
 			a.salesman_id = c.id left join admin d on
 			a.salesman_id = c.id left join admin d on
 			a.finance_id = d.id left join admin e 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
 			c.department_id = f.id left join business_category g on
 			a.contract_type = g.id
 			a.contract_type = g.id
 		where a.order_type = 0 and a.order_status = 3 and project_stage = 1
 		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.buyer_id = b.id left join admin c on
 			a.salesman_id = c.id left join admin d on
 			a.salesman_id = c.id left join admin d on
 			a.finance_id = d.id left join admin e 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
 			c.department_id = f.id left join business_category g on
 			a.contract_type = g.id
 			a.contract_type = g.id
 		where a.order_type = 0 and a.order_status = 3 and project_stage = 1
 		where a.order_type = 0 and a.order_status = 3 and project_stage = 1
@@ -1701,7 +1701,7 @@
 			and d.name = #{financeName,jdbcType=VARCHAR}
 			and d.name = #{financeName,jdbcType=VARCHAR}
 		</if>
 		</if>
   </select>
   </select>
-  
+
   <select id="selectBillByOrderNo" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillListBo">
   <select id="selectBillByOrderNo" parameterType="java.lang.String" resultType="com.goafanti.order.bo.BillListBo">
   	select
   	select
 		a.bill_no as billNo,
 		a.bill_no as billNo,
@@ -1723,10 +1723,10 @@
 		g.name as departmentName
 		g.name as departmentName
 	from
 	from
 		t_order_bill a left join t_order b on
 		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.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
 		b.salesman_id = f.id left join department g on
 		f.department_id = g.id
 		f.department_id = g.id
 	where a.order_no = #{orderNo,jdbcType=VARCHAR} and a.delete_sign = 0
 	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
   	    select b.nickname from t_order a inner join user b on a.buyer_id =b.id
     where a.order_no= #{orderNo,jdbcType=VARCHAR}
     where a.order_no= #{orderNo,jdbcType=VARCHAR}
   </select>
   </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
   	,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
   	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
   	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)
   	and approval in (0,2)
   	<if test="o.outsource != null">
   	<if test="o.outsource != null">
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
@@ -581,7 +581,7 @@
   </select>
   </select>
   <select id="getAllUnassignedCountOrder" parameterType="Map" resultType="java.lang.Integer">
   <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
   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">
 	<if test="o.outsource != null">
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
   	</if>
   	</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
     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
     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
     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">
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
   	</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(*)
 		count(*)
   	 from t_order_refund a left join t_order_new b on a.order_no=b.order_no
   	 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
     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">
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
   	</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 id="countTotalAndActually" parameterType="Map" resultType="java.util.Map">
 	   select sum(o.settlement_amount) actuallyTotalAmount,sum(o.total_amount) signTotalAmount from t_order_new o
 	   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
   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">
   	 	<if test="o.processStatus == 3">
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	and o.process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
 	  	</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>
   </select>
   <update id="updateSalesmanId">
   <update id="updateSalesmanId">
   	update t_order_new set salesman_id= #{transferId},old_salesman_id= #{aid}
   	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>
   </update>
 
 
   <select id="selectUsedOrderByOrder" resultType="com.goafanti.order.bo.TOrderNewBo">
   <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 (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_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
     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">
 	<if test="shiroType == 1 and fid !=null">
   	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
   	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
   	</if>
   	</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
   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_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
 	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">
 	<if test="shiroType == 1 and fid !=null">
   	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
   	 and tm.finance_id= #{fid,jdbcType=VARCHAR}
   	</if>
   	</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 is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Aug 05 11:38:34 CST 2021.
       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
     patent_type, patent_name_type, patent_name, actual_official
   </sql>
   </sql>
   <sql id="Blob_Column_List">
   <sql id="Blob_Column_List">
@@ -59,7 +59,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Aug 05 11:38:34 CST 2021.
       This element was generated on Thu Aug 05 11:38:34 CST 2021.
     -->
     -->
-    select 
+    select
     <include refid="Base_Column_List" />
     <include refid="Base_Column_List" />
     ,
     ,
     <include refid="Blob_Column_List" />
     <include refid="Blob_Column_List" />
@@ -81,19 +81,19 @@
       This element is automatically generated by MyBatis Generator, do not modify.
       This element is automatically generated by MyBatis Generator, do not modify.
       This element was generated on Thu Aug 05 11:38:34 CST 2021.
       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)
       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})
       #{actualOfficial,jdbcType=INTEGER}, #{pictureUrl,jdbcType=LONGVARCHAR})
   </insert>
   </insert>
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderOutsource">
   <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrderOutsource">
@@ -387,7 +387,7 @@
 	<if test="type != null">
 	<if test="type != null">
 	and a.type = #{type}
 	and a.type = #{type}
 	</if>
 	</if>
-	
+
 	<if test="type ==1 and tid !=null">
 	<if test="type ==1 and tid !=null">
 	and (h.id= #{tid} or h.split_super= #{tid})
 	and (h.id= #{tid} or h.split_super= #{tid})
 	</if>
 	</if>
@@ -409,7 +409,7 @@
 	</if>
 	</if>
   </select>
   </select>
   <select id="orderOutsourceCount" resultType="java.lang.Integer">
   <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
   left join `user` c on b.buyer_id=c.id where b.approval !=3 and start_type=0
   <if test="type != null">
   <if test="type != null">
 	and a.type = #{type}
 	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 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 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
 	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
 		and d.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
 	 #{deps.id}
@@ -461,9 +461,9 @@
 	</if>
 	</if>
   </select>
   </select>
   <select id="salesmanOrderOutsourceCount" resultType="java.lang.Integer">
   <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
   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
   	and d.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
 	 #{deps.id}
@@ -490,6 +490,6 @@
   <update id="updateByidNull">
   <update id="updateByidNull">
   update t_order_outsource
   update t_order_outsource
 	set unit_number=null,unit_price=NULL
 	set unit_number=null,unit_price=NULL
-	where id= #{id} 
+	where id= #{id}
   </update>
   </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 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 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
     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">
     <if test="orderNo != null">
       and a.order_no= #{orderNo,jdbcType=VARCHAR}
       and a.order_no= #{orderNo,jdbcType=VARCHAR}
     </if>
     </if>
@@ -1439,7 +1439,7 @@
     left join user f on e.buyer_id=f.id
     left join user f on e.buyer_id=f.id
     left join department h on e.order_dep=h.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
     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">
     <if test="orderNo != null">
       and a.order_no= #{orderNo,jdbcType=VARCHAR}
       and a.order_no= #{orderNo,jdbcType=VARCHAR}
     </if>
     </if>

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

@@ -72,9 +72,10 @@ public class OrderDunTask {
 	/**
 	/**
 	 * 	每天凌晨3点轮
 	 * 	每天凌晨3点轮
 	 */
 	 */
-	@ResponseBody
+//	@ResponseBody
 	@Scheduled(cron = "0 0 3  * * ?")
 	@Scheduled(cron = "0 0 3  * * ?")
-	@RequestMapping(value = "/open/test", method = RequestMethod.GET)
+//	@RequestMapping(value = "/open/test", method = RequestMethod.GET)
+//	@Scheduled(cron = "0 47 11  * * ?")
 	@Transactional(rollbackFor=Exception.class)
 	@Transactional(rollbackFor=Exception.class)
 	public void startTask() throws InterruptedException {
 	public void startTask() throws InterruptedException {
 		updateNewOrderDun();
 		updateNewOrderDun();
@@ -118,7 +119,6 @@ public class OrderDunTask {
 	 * 询处理需要新催款的信息
 	 * 询处理需要新催款的信息
 	 */
 	 */
 	@RequestMapping(value = "/open/updateNewOrderDun", method = RequestMethod.GET)
 	@RequestMapping(value = "/open/updateNewOrderDun", method = RequestMethod.GET)
-	@Transactional
 	public void updateNewOrderDun(){
 	public void updateNewOrderDun(){
   		try {
   		try {
   			LoggerUtils.debug(logger, "======================新催款任务轮询启动===================");
   			LoggerUtils.debug(logger, "======================新催款任务轮询启动===================");
@@ -365,8 +365,8 @@ public class OrderDunTask {
 			o.setStatus(1);
 			o.setStatus(1);
 			o.setStartTime(date);
 			o.setStartTime(date);
 			if (t.getMoney()==null)t.setMoney(new BigDecimal(0));
 			if (t.getMoney()==null)t.setMoney(new BigDecimal(0));
-			TOrderMid tm=orderNewService.pushOrderMidDun(t.getOrderNo(),orderNew.getSettlementAmount(),date,t);
 			newOrderDunService.updateDun(o);
 			newOrderDunService.updateDun(o);
+			TOrderMid tm=orderNewService.pushOrderMidDun(t.getOrderNo(),orderNew.getSettlementAmount(),date,t);
 			TArrearsDun td=new TArrearsDun();
 			TArrearsDun td=new TArrearsDun();
 			td.setOrderArrears(tm.getOrderArrears());
 			td.setOrderArrears(tm.getOrderArrears());
 			td.setOrderReceivables(tm.getOrderReceivables());
 			td.setOrderReceivables(tm.getOrderReceivables());

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

@@ -26,8 +26,8 @@ public class NewOrderDunServiceImpl extends BaseMybatisDao<NewOrderDunMapper> im
 
 
 	@Autowired
 	@Autowired
 	private NewOrderDunMapper	newOrderDunMapper;
 	private NewOrderDunMapper	newOrderDunMapper;
-	
-	
+
+
 	@Override
 	@Override
 	public int createDun(InputNewOrderDunBo ib) {
 	public int createDun(InputNewOrderDunBo ib) {
 		ib.setAid(TokenManager.getAdminId());
 		ib.setAid(TokenManager.getAdminId());
@@ -43,8 +43,8 @@ public class NewOrderDunServiceImpl extends BaseMybatisDao<NewOrderDunMapper> im
 		}else 	newOrderDunMapper.insertSelective(ib);
 		}else 	newOrderDunMapper.insertSelective(ib);
 		return 0;
 		return 0;
 	}
 	}
-	
-	
+
+
 	@Override
 	@Override
 	public int updateDun(InputNewOrderDunBo ib) {
 	public int updateDun(InputNewOrderDunBo ib) {
 		if (ib.getAppropriationRatio()!=null)ib.setMoney(null);
 		if (ib.getAppropriationRatio()!=null)ib.setMoney(null);
@@ -57,7 +57,7 @@ public class NewOrderDunServiceImpl extends BaseMybatisDao<NewOrderDunMapper> im
 	}
 	}
 	@Override
 	@Override
 	public List<OutNewOrderDunBo> selectListNewOrderDun(String orderNo) {
 	public List<OutNewOrderDunBo> selectListNewOrderDun(String orderNo) {
-		return newOrderDunMapper.selectListNewOrderDun(orderNo,null,null);
+		return newOrderDunMapper.selectListNewOrderDun(orderNo,null);
 	}
 	}
 	@Override
 	@Override
 	public OutNewOrderDunBo selectDun(Integer id) {
 	public OutNewOrderDunBo selectDun(Integer id) {
@@ -70,8 +70,8 @@ public class NewOrderDunServiceImpl extends BaseMybatisDao<NewOrderDunMapper> im
 		}
 		}
 		return ob;
 		return ob;
 	}
 	}
-	
-	
+
+
 	@Override
 	@Override
 	public List<OutNewOrderDunBo> selectAllOrderDun() {
 	public List<OutNewOrderDunBo> selectAllOrderDun() {
 		return newOrderDunMapper.selectAllOrderDun();
 		return newOrderDunMapper.selectAllOrderDun();

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

@@ -144,7 +144,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		newOrderChangeMapper.insertSelective(t);
 		newOrderChangeMapper.insertSelective(t);
 		NewOrderChangeBo ncb=newOrderChangeMapper.selectByorderNoAndStatus(t.getOrderNo());
 		NewOrderChangeBo ncb=newOrderChangeMapper.selectByorderNoAndStatus(t.getOrderNo());
 
 
-			List<OutNewOrderDunBo> listDun=newOrderDunMapper.selectListNewOrderDun(t.getOrderNo(),null,null);
+			List<OutNewOrderDunBo> listDun=newOrderDunMapper.selectListNewOrderDun(t.getOrderNo(),null);
 			List<TChangeDun> listcd=new ArrayList<>();
 			List<TChangeDun> listcd=new ArrayList<>();
 			if (listDun!=null&&!listDun.isEmpty()) {
 			if (listDun!=null&&!listDun.isEmpty()) {
 				for (OutNewOrderDunBo d : listDun) {
 				for (OutNewOrderDunBo d : listDun) {
@@ -428,7 +428,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	 */
 	 */
 	private void changeAdopt(NewOrderChangeBo nb) {
 	private void changeAdopt(NewOrderChangeBo nb) {
 		TOrderNew t1=tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
 		TOrderNew t1=tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
-		List<OutNewOrderDunBo> td2=newOrderDunMapper.selectListNewOrderDun(nb.getOrderNo(), null, null);
+		List<OutNewOrderDunBo> td2=newOrderDunMapper.selectListNewOrderDun(nb.getOrderNo(),  null);
 		List<TOrderTaskBo> tt1=tOrderTaskMapper.selectOrderTaskAll(nb.getOrderNo());
 		List<TOrderTaskBo> tt1=tOrderTaskMapper.selectOrderTaskAll(nb.getOrderNo());
 		List<TOrderLogBo> tl1=tOrderLogMapper.selectOrderByNo(nb.getOrderNo());
 		List<TOrderLogBo> tl1=tOrderLogMapper.selectOrderByNo(nb.getOrderNo());
 		String newOrderNo=idGenerator.generateId().toString();
 		String newOrderNo=idGenerator.generateId().toString();

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

@@ -646,7 +646,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		TOrderNew b=tOrderNewMapper.selectByPrimaryKey(orderNo);
 		TOrderNew b=tOrderNewMapper.selectByPrimaryKey(orderNo);
 		if(b.getApproval()==0){
 		if(b.getApproval()==0){
 			Date date = new Date();
 			Date date = new Date();
-			List<OutNewOrderDunBo> list=newOrderDunMapper.selectListNewOrderDun(orderNo,null,0);
+			List<OutNewOrderDunBo> list=newOrderDunMapper.selectListNewOrderDun(orderNo,0);
 			for (OutNewOrderDunBo o : list) {
 			for (OutNewOrderDunBo o : list) {
 				if (o.getDunType()==1) {
 				if (o.getDunType()==1) {
 					o.setStatus(1);
 					o.setStatus(1);
@@ -682,7 +682,14 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	@Synchronized
 	@Synchronized
 	public TOrderMid pushOrderMidDun(String orderNo, BigDecimal settlementAmount, Date date, OutNewOrderDunBo o) {
 	public TOrderMid pushOrderMidDun(String orderNo, BigDecimal settlementAmount, Date date, OutNewOrderDunBo o) {
 		TOrderMid tm=tOrderMidMapper.selectByOrderNo(orderNo);
 		TOrderMid tm=tOrderMidMapper.selectByOrderNo(orderNo);
-		tm.setOrderReceivables(tm.getOrderReceivables().add(o.getMoney()));
+//		代码看不出异常,但是计算会出现重复,则修改方案,每一次触发,则重新统计
+//		tm.setOrderReceivables(tm.getOrderReceivables().add(o.getMoney()));
+		List<OutNewOrderDunBo>  list =newOrderDunMapper.selectListNewOrderDun(orderNo,1);
+		BigDecimal cout=new BigDecimal(0);
+		for (OutNewOrderDunBo bo : list) {
+			cout=cout.add(bo.getMoney());
+		}
+		tm.setOrderReceivables(cout);
 		BigDecimal sum=tm.getOrderReceivables().subtract(settlementAmount);
 		BigDecimal sum=tm.getOrderReceivables().subtract(settlementAmount);
 		//如果金额大于欠款修改欠款为0
 		//如果金额大于欠款修改欠款为0
 		if (sum.compareTo(new BigDecimal(0))<0)sum=new BigDecimal(0);
 		if (sum.compareTo(new BigDecimal(0))<0)sum=new BigDecimal(0);
@@ -995,7 +1002,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	}
 	}
 	@Override
 	@Override
 	public boolean checkORderDun(String orderNo) {
 	public boolean checkORderDun(String orderNo) {
-		List<OutNewOrderDunBo> list=newOrderDunMapper.selectListNewOrderDun(orderNo, null, null);
+		List<OutNewOrderDunBo> list=newOrderDunMapper.selectListNewOrderDun(orderNo,  null);
 		if (list==null||list.size()<1) {
 		if (list==null||list.size()<1) {
 			return true;
 			return true;
 		}else {
 		}else {

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

+ 25 - 25
src/main/resources/spring/spring-mvc.xml

@@ -3,34 +3,34 @@
 	xmlns:task="http://www.springframework.org/schema/task" xmlns:mvc="http://www.springframework.org/schema/mvc"
 	xmlns:task="http://www.springframework.org/schema/task" xmlns:mvc="http://www.springframework.org/schema/mvc"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
 	xmlns:context="http://www.springframework.org/schema/context"
 	xmlns:context="http://www.springframework.org/schema/context"
-	xsi:schemaLocation="http://www.springframework.org/schema/beans 
-	http://www.springframework.org/schema/beans/spring-beans.xsd 
-	http://www.springframework.org/schema/context 
-	http://www.springframework.org/schema/context/spring-context-4.0.xsd 
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+	http://www.springframework.org/schema/beans/spring-beans.xsd
+	http://www.springframework.org/schema/context
+	http://www.springframework.org/schema/context/spring-context-4.0.xsd
 	http://www.springframework.org/schema/task
 	http://www.springframework.org/schema/task
 	http://www.springframework.org/schema/task/spring-task-4.0.xsd
 	http://www.springframework.org/schema/task/spring-task-4.0.xsd
-	http://www.springframework.org/schema/mvc 
+	http://www.springframework.org/schema/mvc
 	http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
 	http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
 	http://www.springframework.org/schema/websocket
 	http://www.springframework.org/schema/websocket
     http://www.springframework.org/schema/websocket/spring-websocket.xsd">
     http://www.springframework.org/schema/websocket/spring-websocket.xsd">
 
 
 	<!-- Scan controller -->
 	<!-- Scan controller -->
-		
+
 	<context:component-scan
 	<context:component-scan
-		base-package="com.goafanti.*.controller;com.goafanti.*.*.controller;com.goafanti.common.task;com.goafanti.common.utils;
+		base-package="com.goafanti.*.controller;com.goafanti.common.task;com.goafanti.common.utils;
 		com.goafanti.core.websocket" />
 		com.goafanti.core.websocket" />
-		
-		
-	
+
+
+
 
 
 
 
 	<bean name="springContextUtils" class="com.goafanti.common.utils.SpringContextUtils" scope="singleton"></bean>
 	<bean name="springContextUtils" class="com.goafanti.common.utils.SpringContextUtils" scope="singleton"></bean>
-	
+
 	<bean id="passwordUtil" class="com.goafanti.common.utils.PasswordUtil">
 	<bean id="passwordUtil" class="com.goafanti.common.utils.PasswordUtil">
-		<property name="algorithmName" value="${pwd.hash_algorithm_name}"/>  
-	    <property name="hashIterations" value="${pwd.hash_iterations}"/> 
+		<property name="algorithmName" value="${pwd.hash_algorithm_name}"/>
+	    <property name="hashIterations" value="${pwd.hash_iterations}"/>
 	</bean>
 	</bean>
-	
+
 	<!-- spring bean validator -->
 	<!-- spring bean validator -->
 	<bean id="validator"
 	<bean id="validator"
 		class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
 		class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
@@ -58,15 +58,15 @@
 	</bean>
 	</bean>
 
 
 
 
-	<!-- Handles HTTP GET requests for /assets/** by efficiently serving up 
+	<!-- Handles HTTP GET requests for /assets/** by efficiently serving up
 		static resources in the ${webappRoot}/assets directory -->
 		static resources in the ${webappRoot}/assets directory -->
 	<mvc:resources mapping="/static/images/**" location="/WEB-INF/images/" />
 	<mvc:resources mapping="/static/images/**" location="/WEB-INF/images/" />
 	<mvc:resources mapping="/static/html/**" location="/WEB-INF/html/" />
 	<mvc:resources mapping="/static/html/**" location="/WEB-INF/html/" />
 	<mvc:resources mapping="/static/**" location="/WEB-INF/build/" />
 	<mvc:resources mapping="/static/**" location="/WEB-INF/build/" />
 	<mvc:resources mapping="/favicon.ico" location="/WEB-INF/assets/favicon.ico" />
 	<mvc:resources mapping="/favicon.ico" location="/WEB-INF/assets/favicon.ico" />
 	<mvc:resources mapping="/robots.txt" location="/WEB-INF/assets/robots.txt" />
 	<mvc:resources mapping="/robots.txt" location="/WEB-INF/assets/robots.txt" />
-	
-	<bean id="templateResolver" 
+
+	<bean id="templateResolver"
         class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver">
         class="org.thymeleaf.spring4.templateresolver.SpringResourceTemplateResolver">
         <property name="prefix" value="/WEB-INF/views/" />
         <property name="prefix" value="/WEB-INF/views/" />
         <property name="suffix" value=".html" />
         <property name="suffix" value=".html" />
@@ -79,13 +79,13 @@
     <bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">
     <bean id="templateEngine" class="org.thymeleaf.spring4.SpringTemplateEngine">
         <property name="templateResolver" ref="templateResolver" />
         <property name="templateResolver" ref="templateResolver" />
     </bean>
     </bean>
-    
+
     <!-- Simple strategy: only path extension is taken into account -->
     <!-- Simple strategy: only path extension is taken into account -->
     <bean id="cnManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
     <bean id="cnManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
         <property name="favorPathExtension" value="true"/>
         <property name="favorPathExtension" value="true"/>
         <property name="ignoreAcceptHeader" value="true"/>
         <property name="ignoreAcceptHeader" value="true"/>
         <property name="defaultContentType" value="text/html"/>
         <property name="defaultContentType" value="text/html"/>
-        
+
         <property name="mediaTypes">
         <property name="mediaTypes">
             <map>
             <map>
                 <entry key="html" value="text/html" />
                 <entry key="html" value="text/html" />
@@ -94,7 +94,7 @@
             </map>
             </map>
         </property>
         </property>
     </bean>
     </bean>
-    
+
     <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
     <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
         <property name="contentNegotiationManager" ref="cnManager"/>
         <property name="contentNegotiationManager" ref="cnManager"/>
         <property name="viewResolvers">
         <property name="viewResolvers">
@@ -151,8 +151,8 @@
 	<bean id="shiroFilterUtils" class="com.goafanti.core.shiro.filter.ShiroFilterUtils" scope="singleton">
 	<bean id="shiroFilterUtils" class="com.goafanti.core.shiro.filter.ShiroFilterUtils" scope="singleton">
 		<property name="appName" value="${app.name}" />
 		<property name="appName" value="${app.name}" />
 	</bean>
 	</bean>
-	
-	
-	
-	
-</beans>
+
+
+
+
+</beans>