Browse Source

订单变更2.1

anderx 6 years ago
parent
commit
30f6aa5c18

+ 6 - 5
src/main/java/com/goafanti/common/mapper/NewOrderChangeMapper.xml

@@ -654,7 +654,8 @@ select
 	a.change_amount changeAmount, a.applicant, a.dep_name depName, a.project_state projectState, a.zxs_cost zxsCost,
 	a.zxs_remarks zxsRemarks, date_format(a.payment_time, '%Y-%m-%d')paymentTimes, a.payment_amount paymentAmount,
 	date_format(a. invoice_time, '%Y-%m-%d') invoiceTimes, a.invoice_amount invoiceAmount,a.invoice_type invoiceType,
-	a.cw_remarks cwRemarks from new_order_change a where 1 = 1 and a.id= #{id}
+	a.cw_remarks cwRemarks,a.estimate_cost estimateCost,estimate_refundable estimateRefundable,refund_Invoice refundInvoice
+	from new_order_change a where 1 = 1 and a.id= #{id}
   </select>
   <select id="checkOderNo" resultType="java.lang.Integer">
   select count(*) from new_order_change
@@ -726,7 +727,7 @@ select
 	 and (a.process_state &gt; 5 and a.process_state &lt; 9) or (a.process_state =9 and a.status=4) 
 	</if>
 	<if test="complete ==2 and processState == 7">
-	 and ((a.process_state = 7  and  (a.status = 4 or a.status = 2)or a.process_state &gt; 7)
+	 and ((a.process_state = 7  and  (a.status = 4 or a.status = 2))or a.process_state &gt; 7)
 	</if>
 	<if test="complete ==2 and processState == 8">
 	 and a.process_state = 8  and   (a.status = 4 or a.status = 2)
@@ -800,7 +801,7 @@ select
 	 and (a.process_state &gt; 5 and a.process_state &lt; 9) or (a.process_state =9 and a.status=4) 
 	</if>
 	<if test="complete ==2 and processState == 7">
-	 and ((a.process_state = 7  and  (a.status = 4 or a.status = 2)or a.process_state &gt; 7)
+	 and ((a.process_state = 7  and  (a.status = 4 or a.status = 2))or a.process_state &gt; 7)
 	</if>
 	<if test="complete ==2 and processState == 8">
 	 and a.process_state = 8  and  (a.status = 4 or a.status = 2)
@@ -808,12 +809,12 @@ select
 	</select>
 	<update id="addRefundInvoice" >
 	update  new_order_change
-	set `refund_Invoice`=`refund_Invoice`+ #{amount}
+	set `refund_Invoice`=ifnull(`refund_Invoice`,0)+ #{amount}
 	where order_no= #{orderNo}
 	</update>
 	<update id="subtractRefundInvoice">
 	update  new_order_change
-	set `refund_Invoice`=`refund_Invoice`- #{amount}
+	set `refund_Invoice`=ifnull(`refund_Invoice`,0)- #{amount}
 	where order_no= #{orderNo}
 	</update>
 </mapper>

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

@@ -292,6 +292,7 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	@Override
 	public int pushCompleteOrderChange(NewOrderChangeBo nb) {
 		changgeAdopt(nb);
+		newOrderChangeMapper.updateByPrimaryKeySelective(nb);
 		return 1;
 	}
 	@Override