Browse Source

变更审核列表BUG修复

anderx 6 years ago
parent
commit
24ac73d87e

+ 3 - 0
src/main/java/com/goafanti/common/dao/TOrderLogMapper.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderLog;
 import com.goafanti.common.model.TOrderLogExample;
 import com.goafanti.order.bo.TOrderLogBo;
@@ -76,4 +77,6 @@ public interface TOrderLogMapper {
 	int updateByPrimaryKey(TOrderLog record);
 
 	List<TOrderLogBo> selectOrderByNo(String orderNo);
+
+
 }

+ 1 - 1
src/main/java/com/goafanti/common/mapper/BusinessProjectMapper.xml

@@ -809,7 +809,7 @@
   </select>
   
   <select id="selectBusinessProjectCatalog" resultType="com.goafanti.common.model.BusinessCategory">
-  	select id,cname from business_category where delete_sign = 0
+  	select id,cname from business_category where delete_sign=0
   </select>
   
 

+ 48 - 12
src/main/java/com/goafanti/common/mapper/NewOrderChangeMapper.xml

@@ -641,17 +641,35 @@ from new_order_change a  where 1=1
 	<if test="salesmanName !=null">
 	and d.name like concat('%',#{salesmanName},'%')
 	</if>
-	<if test="complete ==0">
+	<if test="complete ==0 and processState != 8">
 	 and a.process_state &gt;= #{processState}
 	</if>
-	<if test="complete ==1 and processState != 5">
-	 and a.process_state = #{processState}
+	<if test="complete ==0 and processState == 8">
+	 and a.process_state &gt;= #{processState} and  a.process_state &lt; 9
+	</if>
+	<if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
+	 and a.process_state = #{processState} 
 	</if>
 	<if test="complete ==1 and processState == 5">
-	 and a.process_state in(#{processState},9)  and a.status !=4
+	 and a.process_state in(5,9)  and a.status !=4
+	</if>
+	<if test="complete ==1 and processState == 7">
+	 and a.process_state = 7  and  a.status != 4
+	</if>
+	<if test="complete ==1 and processState == 8">
+	 and a.process_state = #{processState}  and a.status != 4
+	</if>
+	<if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
+	 and a.process_state &gt; #{processState}  
+	</if>
+	<if test="complete ==2 and processState == 5">
+	 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.process_state = 8)
 	</if>
-	<if test="complete ==2">
-	 and a.process_state &gt; #{processState}
+	<if test="complete ==2 and processState == 8">
+	 and a.process_state = 8  and  a.status = 4
 	</if>
 	order by a.create_time 
 	<if test="page_sql != null">
@@ -697,17 +715,35 @@ from new_order_change a  where 1=1
 	<if test="salesmanName !=null">
 	and d.name like concat('%',#{salesmanName},'%')
 	</if>
-	<if test="complete ==0">
+	<if test="complete ==0 and processState != 8">
 	 and a.process_state &gt;= #{processState}
 	</if>
-	<if test="complete ==1 and processState != 5">
-	 and a.process_state = #{processState}
+	<if test="complete ==0 and processState == 8">
+	 and a.process_state &gt;= #{processState} and  a.process_state &lt; 9
+	</if>
+	<if test="complete ==1 and processState != 5 and processState != 7 and processState != 8">
+	 and a.process_state = #{processState} 
 	</if>
 	<if test="complete ==1 and processState == 5">
-	 and a.process_state in(#{processState},9)  and a.status !=4
+	 and a.process_state in(5,9)  and a.status !=4
+	</if>
+	<if test="complete ==1 and processState == 7">
+	 and a.process_state = 7  and  a.status != 4
+	</if>
+	<if test="complete ==1 and processState == 8">
+	 and a.process_state = #{processState}  and a.status != 4
+	</if>
+	<if test="complete ==2 and processState != 5 and processState != 7 and processState != 8">
+	 and a.process_state &gt; #{processState}  
+	</if>
+	<if test="complete ==2 and processState == 5">
+	 and ((a.process_state &gt; 5 and  a.status != 4)or  (a.process_state in (5,9) and  a.status = 4))    
+	</if>
+	<if test="complete ==2 and processState == 7">
+	 and ((a.process_state = 7  and  a.status = 4)or a.process_state = 8)
 	</if>
-	<if test="complete ==2">
-	 and a.process_state &gt; #{processState}
+	<if test="complete ==2 and processState == 8">
+	 and a.process_state = 8  and  a.status = 4
 	</if>
 	</select>
 </mapper>

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

@@ -488,7 +488,7 @@
   	left join admin ad on b.creater = ad.id
   	left join t_order_new o on o.order_no = b.order_no
   	left join admin oa on oa.id = o.salesman_id
-  	where b.delete_sign = 0 
+  	where b.delete_sign != 1 
   	<if test='b.orderNo != null and b.orderNo != ""'>
   	and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
   	</if>
@@ -526,7 +526,7 @@
   	left join `user` a on b.payee_id = a.id
   	left join t_order_new o on o.order_no = b.order_no
   	left join admin oa on oa.id = o.salesman_id
-  	where b.delete_sign = 0 
+  	where b.delete_sign != 1 
   	<if test='b.orderNo != null and b.orderNo != ""'>
   	and b.order_no = #{b.orderNo,jdbcType=VARCHAR}
   	</if>

+ 1 - 1
src/main/java/com/goafanti/common/mapper/TOrderLogMapper.xml

@@ -284,7 +284,7 @@
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectOrderByNo" 	parameterType="string"	resultType="com.goafanti.order.bo.TOrderLogBo">
-  select a.id,a.order_no as orderNo,a.process,a.create_time as createTime, b.name as adminName
+  select a.id,a.order_no as orderNo,a.aid,a.process,a.create_time as createTime, b.name as adminName
 	from t_order_log a left join admin b on a.aid=b.id
 	where a.order_no= #{orderNo,jdbcType=VARCHAR}
 	order by a.create_time

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

@@ -927,7 +927,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 = 0 
+  	 on o.order_no=e.order_no  left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1 
   	and approval in (0,2) 
   	<if test="o.outsource != null">
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
@@ -972,7 +972,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 = 0  and approval in (0,2) 
+  	left join t_order_outsource f on f.order_no=o.order_no where delete_sign != 1  and approval in (0,2) 
 	<if test="o.outsource != null">
   	and o.outsource=#{o.outsource,jdbcType=INTEGER}
   	</if>
@@ -1089,7 +1089,7 @@
   on o.order_dep=d.id left join `user` u on o.buyer_id = u.id left join admin a on o.salesman_id = a.id left join 
   (select sum(transaction_amount) as amount ,order_no from t_order_bill_new group by order_no ) b on b.order_no = o.order_no 
   left join (select order_no,max(name) as name from outsource_organization group by order_no) e 
-  on o.order_no=e.order_no where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
+  on o.order_no=e.order_no where delete_sign != 1 and outsource=#{o.outsource,jdbcType=INTEGER}
   	 	<if test="o.processStatus == 3">
 	  	and process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1136,7 +1136,7 @@
   	 left join admin a on o.salesman_id = a.id
   	 left join (select sum(transaction_amount) as amount ,order_no from t_order_bill_new
   				group by order_no ) b on b.order_no = o.order_no
-  	 where delete_sign = 0 and outsource=#{o.outsource,jdbcType=INTEGER}
+  	 where delete_sign != 1 and outsource=#{o.outsource,jdbcType=INTEGER}
   		<if test="o.processStatus == 3">
 	  	and process_status = #{o.processStatus,jdbcType=INTEGER}
 	  	</if>
@@ -1202,7 +1202,7 @@
 where super_id is null )  e on e.order_no=a.order_no
   	left join admin f on e.task_receiver=f.id
   	</if>
-  	where a.delete_sign != 1
+  	where a.delete_sign !=1
   	<if test="outsource != null">
   	and a.outsource= #{outsource,jdbcType=INTEGER}
   	</if>
@@ -1289,7 +1289,7 @@ where super_id is null )  e on e.order_no=a.order_no
 where super_id is null ) e on e.order_no=a.order_no
   	left join admin f on e.task_receiver=f.id
   	</if>
-  	where a.delete_sign = 0 
+  	where a.delete_sign != 1 
   	<if test="outsource != null">
   	and a.outsource= #{outsource,jdbcType=INTEGER}
   	</if>
@@ -1356,7 +1356,7 @@ where super_id is null ) e on e.order_no=a.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 dep on d.department_id=dep.id
-    where a.start_time is not null and b.delete_sign = 0
+    where a.start_time is not null and b.delete_sign != 1
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
@@ -1387,7 +1387,7 @@ where super_id is null ) e on e.order_no=a.order_no
 		count(*)
     from t_order_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 
-    where a.start_time is not null and b.delete_sign = 0
+    where a.start_time is not null and b.delete_sign != 1
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
@@ -1409,15 +1409,17 @@ where super_id is null ) e on e.order_no=a.order_no
   </select>
   
   <select id="getOrderNewDetail" parameterType="java.lang.String" resultType="com.goafanti.order.bo.TOrderNewBo">
-      select 
-    a.order_no as orderNo, a.order_type as orderType, a.creater, a.create_time as createTime,a.update_time as updateTime, a.buyer_id as buyerId, a.first_amount as firstAmount, 
-    a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus, a.liquidation_status as liquidationStatus, a.process_status as processStatus, 
-    a.project_status as projectStatus, a.approval, a.order_remarks as orderRemarks, a.delete_sign as deleteSign, a.salesman_id as salesmanId, finance_id as financeId, technician_id as technicianId, 
-    a.sign_time as signTime, a.settlement_time as settlementTime, a.contract_no as contractNo, a.contract_type as contractType, a.contacts, a.contact_mobile as contactMobile, 
-    a.legal_person as legalPerson, a.legal_person_tel as legalPersonTel, a.proof_count as proofCount, a.proof_aid as proofAid,contract_picture_url as contractPictureUrl,
-    c.name as salesmanName,dep.name as depName,d.name as financeName,c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName
-    ,e.back_status as backStatus,f.name as initiateName,e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid,a.order_dep as orderDep,
-    g.location_province as locationProvince,g.location_city as locationCity,g.location_area locationArea,g.postal_address postalAddress,outsource
+    select 
+    a.order_no as orderNo, a.order_type as orderType, a.creater, a.create_time as createTime,a.update_time as updateTime, a.buyer_id as buyerId,
+    a.first_amount as firstAmount,a.total_amount as totalAmount, a.settlement_amount as settlementAmount, order_status as orderStatus,
+    a.liquidation_status as liquidationStatus, a.process_status as processStatus, a.project_status as projectStatus, a.approval,
+    a.order_remarks as orderRemarks, a.delete_sign as deleteSign, a.salesman_id as salesmanId, finance_id as financeId, technician_id as technicianId, 
+    a.sign_time as signTime, a.settlement_time as settlementTime, a.contract_no as contractNo, a.contract_type as contractType, a.contacts,
+    a.contact_mobile as contactMobile, a.legal_person as legalPerson, a.legal_person_tel as legalPersonTel, a.proof_count as proofCount,
+    a.proof_aid as proofAid,contract_picture_url as contractPictureUrl, c.name as salesmanName,dep.name as depName,d.name as financeName,
+    c.contact_mobile as salesmanMobile,d.contact_mobile as financeMobile,b.nickname as userName ,e.back_status as backStatus,f.name as initiateName,
+    e.reason,date_format(e.create_time,'%Y-%m-%d') as backDate,a.buyer_id as uid,a.order_dep as orderDep, g.location_province as locationProvince,
+    g.location_city as locationCity,g.location_area locationArea,g.postal_address postalAddress,outsource,a.primary_order primaryOrder,a.additional_order additionalOrder
     from t_order_new a left join `user` b on a.buyer_id=b.id left join admin c on a.salesman_id=c.id
     left join department dep on a.order_dep=dep.id left join admin d on a.finance_id=d.id
   	left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
@@ -1431,7 +1433,7 @@ where super_id is null ) e on e.order_no=a.order_no
     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 = 0 
+    where  b.delete_sign != 1 
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
@@ -1455,7 +1457,7 @@ where super_id is null ) e on e.order_no=a.order_no
 		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 = 0 
+    where  b.delete_sign != 1 
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>

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

@@ -466,7 +466,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 d.department_id=e.id
 	left join admin f on b.finance_id=f.id
-	where 1=1 and b.outsource=1
+	where b.delete_sign !=1 and b.outsource=1
 		and d.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
@@ -491,7 +491,7 @@
   <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 
   left join `user` c on b.buyer_id=c.id  left join admin d on b.salesman_id=d.id
-  where 1=1 and b.outsource=1
+  where b.delete_sign !=1 and b.outsource=1
   	and d.department_id in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}

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

@@ -886,7 +886,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  left join (select order_no,max(name)as name from outsource_organization group by order_no) j 
-    on a.order_no=j.order_no where e.delete_sign=0  and e.order_status not in (5,7) and e.outsource= #{outsource,jdbcType=INTEGER}
+    on a.order_no=j.order_no where e.delete_sign !=1  and e.order_status not in (5,7) and e.outsource= #{outsource,jdbcType=INTEGER}
     <if test="specially == 0 or specially == 1">
     and a.task_receiver= #{aid,jdbcType=VARCHAR}
     </if>
@@ -924,7 +924,7 @@
     left join t_order_new e on a.order_no=e.order_no
     left join admin g on e.salesman_id=g.id
     left join department h on g.department_id=h.id
-    where e.delete_sign=0  and e.order_status not in (5,7)
+    where e.delete_sign !=1 and e.order_status not in (5,7)
     and e.outsource= #{outsource,jdbcType=INTEGER}
     <if test="specially == 0 or specially == 1">
     and a.task_receiver= #{aid,jdbcType=VARCHAR}
@@ -988,7 +988,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.id
     left join department dep on e.order_dep=dep.id  
     left join user f on e.buyer_id=f.id
     left join (select task_id,sum(hours) as hours from t_task_hours group by task_id) g on a.id=g.task_id
-    where e.delete_sign=0 and a.super_id is null
+    where e.delete_sign !=1 and a.super_id is null
     <if test="fid != null">
   	and e.finance_id= #{fid,jdbcType=VARCHAR}
   	</if>
@@ -1014,7 +1014,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.id
     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
-    where e.delete_sign=0 and a.super_id is null
+    where e.delete_sign !=1 and a.super_id is null
     <if test="fid != null">
   	and e.finance_id= #{fid,jdbcType=VARCHAR}
   	</if>
@@ -1042,7 +1042,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.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
-    where e.delete_sign=0 
+    where e.delete_sign !=1 
     <if test="orderNo != null">
   	and a.order_no= #{orderNo,jdbcType=VARCHAR}
   	</if>
@@ -1081,7 +1081,7 @@ from t_order_task a left join business_project b on a.commodity_id=b.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
-    where e.delete_sign=0 
+    where e.delete_sign !=1 
     <if test="orderNo != null">
   	and a.order_no= #{orderNo,jdbcType=VARCHAR}
   	</if>

+ 1 - 1
src/main/java/com/goafanti/common/mapper/TTaskHoursMapper.xml

@@ -331,7 +331,7 @@
     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 (select task_id,sum(hours) as hours from t_task_hours group by task_id) g on a.id=g.task_id
-    where e.delete_sign=0 and a.super_id is null
+    where e.delete_sign !=1 and a.super_id is null
     <if test="fid != null">
   	and e.finance_id= #{fid,jdbcType=VARCHAR}
   	</if>

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

@@ -15,6 +15,7 @@ import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.dao.NewOrderChangeMapper;
 import com.goafanti.common.dao.OrderChangeLogMapper;
 import com.goafanti.common.dao.TOrderDunMapper;
+import com.goafanti.common.dao.TOrderLogMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.error.BusinessException;
@@ -30,6 +31,7 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.NewOrderChangeBo;
 import com.goafanti.order.bo.OrderChangeLogBo;
+import com.goafanti.order.bo.TOrderLogBo;
 import com.goafanti.order.bo.TOrderTaskBo;
 import com.goafanti.order.service.OrderChangeService;
 import com.goafanti.order.service.OrderService;
@@ -42,7 +44,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 	@Autowired
 	private TOrderNewMapper			tOrderNewMapper;
 	@Autowired
-	private TOrderDunMapper	tOrderDunMapper;
+	private TOrderDunMapper			tOrderDunMapper;
+	@Autowired
+	private TOrderLogMapper 		tOrderLogMapper;  
 	@Autowired
 	private TOrderTaskMapper	tOrderTaskMapper;
 	@Autowired
@@ -90,13 +94,21 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			if(nb.getType()==0){
 				if (nb.getChangeAmount().compareTo(new BigDecimal("0.2"))<0) {//小于则总裁通过,大于则董事长
 					if(nb.getProcessState()==7) {//项目变更通过
-						changgeAdopt(nb);}else {nb.setProcessState(nb.getProcessState()+1);}
+						changgeAdopt(nb);
+						}else if(nb.getProcessState()==1){
+							nb.setProcessState(3);
+						}else{
+							nb.setProcessState(nb.getProcessState()+1);
+							}
 				}else {
 					if(nb.getProcessState()==8) {//项目变更通过
-						changgeAdopt(nb);}else {nb.setProcessState(nb.getProcessState()+1);}
+						changgeAdopt(nb);
+						}else if(nb.getProcessState()==1){
+							nb.setProcessState(3);
+						} else{
+							nb.setProcessState(nb.getProcessState()+1);
+							}
 				}
-				
-				
 			}else {
 				if(nb.getProcessState()==9) {changgeAdopt(nb);}//项目变更通过
 				//流程状态 0营销员 1营销管理员 2技术员 3技术经理 4技术总监 5财务专员(退单) 6财务总监 7总裁 8董事长 9 财务专员(非退单)
@@ -120,8 +132,10 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		TOrderNew t1=tOrderNewMapper.selectByPrimaryKey(nb.getOrderNo());
 		List<TOrderDun> td1=tOrderDunMapper.selectByOrderNo(nb.getOrderNo());
 		List<TOrderTaskBo> tt1=tOrderTaskMapper.selectOrderTask(nb.getOrderNo());
+		List<TOrderLogBo> tl1=tOrderLogMapper.selectOrderByNo(nb.getOrderNo());
 		String newOrderNo=idGenerator.generateId().toString();
 		t1.setOrderNo(newOrderNo);
+		t1.setDeleteSign(1);//将原订单作废,只能查看
 		tOrderNewMapper.insertSelective(t1);
 		for (TOrderTaskBo tOrderTaskBo : tt1) {
 			tOrderTaskBo.setId(null);
@@ -133,6 +147,11 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 			tOrderDun.setOrderNo(newOrderNo);
 			tOrderDunMapper.insertSelective(tOrderDun);
 		}
+		for (TOrderLogBo tOrderLogBo : tl1) {
+			tOrderLogBo.setId(null);
+			tOrderLogBo.setOrderNo(newOrderNo);
+			tOrderLogMapper.insertSelective(tOrderLogBo);
+		}
 		nb.setStatus(4);
 		//将订单恢复正常
 		TOrderNew orderNew =new TOrderNew();
@@ -141,10 +160,11 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		orderNew.setOrderNo(nb.getOrderNo());
 		orderNew.setDeleteSign(4);//设置为变更中
 		orderNew.setPrimaryOrder(newOrderNo);
-		if (nb.getType()==4||nb.getType()==5) {//重报或者附加
+		if (nb.getType()==4||nb.getType()==5) {//重报或者赠送
 			additionalOrderNo=idGenerator.generateId().toString();
 			orderNew.setAdditionalOrder(additionalOrderNo);
 			additionalOrder.setOrderNo(additionalOrderNo);
+			additionalOrder.setCreater(TokenManager.getAdminId());
 			additionalOrder.setOrderType(t1.getOrderType());
 			additionalOrder.setBuyerId(t1.getBuyerId());	
 			tOrderNewMapper.insertSelective(additionalOrder);