Browse Source

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

anderx 5 years ago
parent
commit
b9eaeb1ae4

+ 4 - 4
GeneratorConfig.xml

@@ -1,14 +1,14 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
 <generatorConfiguration>
-   <classPathEntry location="C:/Users/Administrator/.dbeaver-drivers/maven/maven-central/mysql/mysql-connector-java-5.1.39.jar" /> 
+   <classPathEntry location="C:\Users\Administrator.SC-202009251130\AppData\Roaming\DBeaverData\drivers\maven\maven-central\mysql\mysql-connector-java-8.0.17.jar" /> 
    <!-- <classPathEntry location="C:\Users\Administrator\.dbeaver-drivers\maven\maven-central\mysql\mysql-connector-java-5.1.44.jar" /> -->
   <context id="context1">	
-     <jdbcConnection connectionURL="jdbc:mysql://localhost:3306/aft"  
-    	driverClass="com.mysql.jdbc.Driver" password="123456" userId="root" />
+     <jdbcConnection connectionURL="jdbc:mysql://localhost:3306/aft?serverTimezone=UTC"  
+    	driverClass="com.mysql.cj.jdbc.Driver" password="123456" userId="root" />
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="kede-server" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="kede-server" />
     <javaClientGenerator  targetPackage="com.goafanti.common.dao"  type="XMLMAPPER" targetProject="kede-server"  />
-    <table schema="aft" tableName="third_party_company"/>
+    <table schema="aft" tableName="t_order_outsource"/>
   </context>
 </generatorConfiguration>

+ 2 - 2
pom.xml

@@ -4,8 +4,8 @@
 
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>com.goafanti</groupId>
-	<artifactId>aft</artifactId>
-	<name>aft</name>
+	<artifactId>kede-server</artifactId>
+	<name>kede-server</name>
 
 	<packaging>war</packaging>
 	<version>1.0.0-BUILD-SNAPSHOT</version>

+ 0 - 1
src/main/java/com/goafanti/common/dao/TOrderOutsourceMapper.java

@@ -6,7 +6,6 @@ import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.organization.bo.outProjectBo;
 
 import java.util.List;
-import java.util.Map;
 
 import org.apache.ibatis.annotations.Param;
 

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

@@ -95,7 +95,8 @@ public interface UserLockReleaseMapper {
 			@Param("newStatus")Integer newStatus,@Param("date") Date date);
 	void updateUserTypeLockList(@Param("list")List<String> list, @Param("aid")String aid,@Param("type")Integer type,
 			@Param("newStatus")Integer newStatus,@Param("date") Date date);
-	List<LockingReleaseBo> selectWaitReleaseCustomer(String aid);
+	
+	List<LockingReleaseBo> selectWaitReleaseCustomer(@Param("aid")String aid, @Param("type")Integer type);
 
 	List<LockingReleaseBo> selectWaitReleaseBusiness(String aid);
 

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

@@ -1277,10 +1277,10 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   		where order_no = #{_parameter,jdbcType=VARCHAR}
   </select>
   <select id="selectOrderNewListByPage" resultType="com.goafanti.order.bo.TOrderNewBo">
-  	select a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,a.contract_no as contractNo,
-  		b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,a.order_status as orderStatus,
-  		a.liquidation_status as liquidationStatus,a.approval,c.salesman_name as salesmanName,dep.name as depName,c.finance_name as financeName,
-  		c.invoice_amount invoiceAmount,a.settlement_amount settlementAmount
+  	select a.order_no as orderNo,a.create_time as createTime, date_format(a.sign_time,'%Y-%m-%d' ) as signDate,
+  	a.contract_no as contractNo, b.nickname as userName ,a.process_status as processStatus,a.total_amount as totalAmount,
+  	a.order_status as orderStatus, a.liquidation_status as liquidationStatus,a.approval,c.salesman_name as salesmanName,
+  	dep.name as depName,c.finance_name as financeName,c.invoice_amount invoiceAmount,a.settlement_amount settlementAmount
   	<if test="specially == 2">
   	,f.name as initiateName ,e.reason ,date_format(e.create_time,'%Y-%m-%d' ) as backDate,e.id as backId
   	</if>
@@ -1289,9 +1289,6 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
   	left join department dep on a.order_dep=dep.id
-  	<if test="specially == 1">
-  	left join admin ad on a.salesman_id=ad.id
-  	</if>
   	<if test="specially == 2">
 	left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
   	left join admin f on e.initiate=f.id
@@ -1312,8 +1309,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	</if>
   	<if test="specially == 1">
   	and a.process_status = 1  and a.order_status = 1
-  	<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
-  	and ad.department_id in
+  	and a.order_dep in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
   	</foreach>
@@ -1410,11 +1406,8 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	select count(*)
   	from t_order_new a  left join `user` b on a.buyer_id=b.id left join t_order_mid c on a.order_no=c.order_no
   	left join department dep on a.order_dep=dep.id
-  	<if test="specially == 1">
-  	left join admin ad on a.salesman_id=ad.id
-  	</if>
   	where a.delete_sign !=1
-    	<if test="outsource != null">
+    <if test="outsource != null">
   	and a.outsource= #{outsource,jdbcType=INTEGER}
   	</if>
   	<if test="specially == 0">
@@ -1424,7 +1417,7 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
   	<if test="specially == 1">
   	and a.process_status = 1  and a.order_status = 1
   	<!-- and c.department_id in (#{deps,jdbcType=VARCHAR}) -->
-  	and ad.department_id in
+  	and a.order_dep in
   	<foreach close=")" collection="deps" item="deps" open="(" separator=",">
 	 #{deps.id}
   	</foreach>
@@ -1598,10 +1591,16 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     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.agreement_url agreementUrl,
     h.name NowFinance,h.contact_mobile NowFinanceMobile,a.additional_order additionalOrder,i.name as oldSalesmanName, i.contact_mobile oldSalesmanMobile
-    from t_order_new a left join `user` b on a.buyer_id=b.id left join admin i on a.old_salesman_id=i.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 admin h on dep.finance_id=h.id left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
-  	left join admin f on e.initiate=f.id left join organization_identity g on a.buyer_id=g.uid
+    from t_order_new a 
+    left join `user` b on a.buyer_id=b.id 
+    left join admin i on a.old_salesman_id=i.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 admin h on dep.finance_id=h.id 
+    left join (select * from t_order_back a where back_status=0) e on a.order_no=e.order_no
+  	left join admin f on e.initiate=f.id 
+  	left join organization_identity g on a.buyer_id=g.uid
     where a.order_no = #{orderNo,jdbcType=VARCHAR}
   </select>
   

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

@@ -241,6 +241,9 @@
       <if test="patentType != null">
         patent_type,
       </if>
+      <if test="actualOfficial != null">
+        actual_official,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -300,6 +303,9 @@
       <if test="patentType != null">
         #{patentType,jdbcType=INTEGER},
       </if>
+      <if test="actualOfficial != null">
+        #{actualOfficial,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.goafanti.common.model.TOrderOutsourceExample" resultType="java.lang.Long">
@@ -475,6 +481,9 @@
       <if test="patentType != null">
         patent_type = #{patentType,jdbcType=INTEGER},
       </if>
+      <if test="actualOfficial != null">
+        actual_official = #{actualOfficial,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -509,7 +518,7 @@
      	select id, order_no orderNo, refund_status refundStatus, date_format(create_time,'%Y-%m-%d %H:%i:%S') createTimes , remarks,
 	 date_format(audit_time,'%Y-%m-%d %H:%i:%S') auditTimes,attachment_url attachmentUrl, picture_url pictureUrl, amount,
 	 company_name companyName ,unit_price unitPrice,unit_number unitNumber,outsource_remarks outsourceRemarks,start_type startType,
-	 patent_name patentName,patent_type patentType,patent_name_type patentNameType
+	 patent_name patentName,patent_type patentType,patent_name_type patentNameType,actual_official actualOfficial
 	 from t_order_outsource
 	 where 1=1
 	  <if test="orderNo != null">

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

@@ -1559,7 +1559,7 @@ ifnull(ttm.party_amount,0) partyAmount,a.commodity_price commodityPrice,a.outsou
   	</if>
   </select>
   <select id="getOrderTaskDetail" resultType="com.goafanti.order.bo.TOrderTaskDetailBo">
-select  
+ select  
 	a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,a.task_comment as taskComment,a.project_status as projectStatus,
 	a.task_status as taskStatus,e.contacts,a.attachment_url as attachmentUrl,a.outsource_name outsourceName, f.nickname as userName,a.set_up_amount as setUpAmount,
 	g.name as salesmanName,date_format(a.task_start_time,'%Y-%m-%d') as startDate,a.retrieve_content as retrieveContent, a.arrival_money as arrivalMoney,
@@ -1568,7 +1568,8 @@ select
 	date_format(a.task_end_time,'%Y-%m-%d') as endDate,date_format(a.accept_time,'%Y-%m-%d') as acceptDate,h.name as depName,e.contact_mobile as contactMobile ,
 	date_format(a.review_time,'%Y-%m-%d') as reviewDate,date_format(a.publicity_time,'%Y-%m-%d') as publicityDate,a.outsource_price outsourcePrice,
 	date_format(a.licence_time,'%Y-%m-%d') as licenceDate,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,e.legal_person as legalPerson,
-	e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch
+	e.legal_person_tel as legalPersonTel, a.split_status splitStatus, a.split_super splitSuper, a.split_id splitId,a.declaration_batch declarationBatch,
+	a.cost_reduction costReduction,  a.official_cost officialCost
 	from t_order_task a left join business_project b on a.commodity_id=b.id left join business_category c on b.cid=c.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 department h on e.order_dep=h.id left join user f on e.buyer_id=f.id

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

@@ -378,17 +378,20 @@
   
   <select id="selectWaitReleaseCustomer" resultType="com.goafanti.customer.bo.LockingReleaseBo">
 	select 
-		t0.id,
-		t0.uid,
-		t0.aid,
-		t0.lock_time,
-		t1.last_follow_time
+		t0.id, t0.uid, t0.aid, t0.lock_time lockTime,
+		t1.last_follow_time lastFollowTime
 	from
 		(select id,uid,aid,lock_time from user_lock_release where aid = #{aid} and type = 0 and status = 0)t0
 	left join 
 		(select uid,aid,max(create_time) as last_follow_time from user_follow where aid = #{aid} group by uid)t1
 	on t0.uid = t1.uid 
-	where datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))>30 or datediff(now(),t0.lock_time)>270
+	where 1=1
+	<if test="type==0">
+	 and datediff(now(),if(t0.lock_time &lt; t1.last_follow_time,t1.last_follow_time,t1.t0.lock_time))>30
+	</if>
+	<if test="type==1">
+	 and datediff(now(),t0.lock_time)>270
+	</if>
   </select>
   
   <select id="selectWaitReleaseBusiness"  resultType="com.goafanti.customer.bo.LockingReleaseBo">

+ 86 - 284
src/main/java/com/goafanti/common/model/TOrderOutsource.java

@@ -2,451 +2,253 @@ package com.goafanti.common.model;
 
 import java.math.BigDecimal;
 import java.util.Date;
+import javax.annotation.Generated;
 
 public class TOrderOutsource {
 
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.id
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.id")
 	private Integer id;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.order_no
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.order_no")
 	private String orderNo;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.refund_status
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.refund_status")
 	private Integer refundStatus;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.create_time
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.create_time")
 	private Date createTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.remarks
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.remarks")
 	private String remarks;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.attachment_url
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.attachment_url")
 	private String attachmentUrl;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.picture_url
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
-	private String pictureUrl;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.amount
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.amount")
 	private BigDecimal amount;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.company_name
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.company_name")
 	private String companyName;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.audit_time
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.audit_time")
 	private Date auditTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.unit_price
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.unit_price")
 	private BigDecimal unitPrice;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.unit_number
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.unit_number")
 	private Integer unitNumber;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.outsource_remarks
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.outsource_remarks")
 	private String outsourceRemarks;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.type")
 	private Integer type;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.tid
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.tid")
 	private Integer tid;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.start_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.start_type")
 	private Integer startType;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.patent_name_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_type")
+	private Integer patentType;
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_name_type")
 	private Integer patentNameType;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.patent_name
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_name")
 	private String patentName;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order_outsource.patent_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
-	private Integer patentType;
-	
-	
-	
-	private String reason;
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.628+08:00", comments = "Source field: t_order_outsource.actual_official")
+	private Integer actualOfficial;
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.628+08:00", comments = "Source field: t_order_outsource.picture_url")
+	private String pictureUrl;
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.id
-	 * @return  the value of t_order_outsource.id
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.id")
 	public Integer getId() {
 		return id;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.id
-	 * @param id  the value for t_order_outsource.id
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.id")
 	public void setId(Integer id) {
 		this.id = id;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.order_no
-	 * @return  the value of t_order_outsource.order_no
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.order_no")
 	public String getOrderNo() {
 		return orderNo;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.order_no
-	 * @param orderNo  the value for t_order_outsource.order_no
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.order_no")
 	public void setOrderNo(String orderNo) {
 		this.orderNo = orderNo;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.refund_status
-	 * @return  the value of t_order_outsource.refund_status
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.refund_status")
 	public Integer getRefundStatus() {
 		return refundStatus;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.refund_status
-	 * @param refundStatus  the value for t_order_outsource.refund_status
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.refund_status")
 	public void setRefundStatus(Integer refundStatus) {
 		this.refundStatus = refundStatus;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.create_time
-	 * @return  the value of t_order_outsource.create_time
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.create_time")
 	public Date getCreateTime() {
 		return createTime;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.create_time
-	 * @param createTime  the value for t_order_outsource.create_time
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.create_time")
 	public void setCreateTime(Date createTime) {
 		this.createTime = createTime;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.remarks
-	 * @return  the value of t_order_outsource.remarks
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.remarks")
 	public String getRemarks() {
 		return remarks;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.remarks
-	 * @param remarks  the value for t_order_outsource.remarks
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.remarks")
 	public void setRemarks(String remarks) {
 		this.remarks = remarks;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.attachment_url
-	 * @return  the value of t_order_outsource.attachment_url
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.attachment_url")
 	public String getAttachmentUrl() {
 		return attachmentUrl;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.attachment_url
-	 * @param attachmentUrl  the value for t_order_outsource.attachment_url
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.attachment_url")
 	public void setAttachmentUrl(String attachmentUrl) {
 		this.attachmentUrl = attachmentUrl;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.picture_url
-	 * @return  the value of t_order_outsource.picture_url
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
-	public String getPictureUrl() {
-		return pictureUrl;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.picture_url
-	 * @param pictureUrl  the value for t_order_outsource.picture_url
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
-	public void setPictureUrl(String pictureUrl) {
-		this.pictureUrl = pictureUrl;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.amount
-	 * @return  the value of t_order_outsource.amount
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.amount")
 	public BigDecimal getAmount() {
 		return amount;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.amount
-	 * @param amount  the value for t_order_outsource.amount
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.amount")
 	public void setAmount(BigDecimal amount) {
 		this.amount = amount;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.company_name
-	 * @return  the value of t_order_outsource.company_name
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.company_name")
 	public String getCompanyName() {
 		return companyName;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.company_name
-	 * @param companyName  the value for t_order_outsource.company_name
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.company_name")
 	public void setCompanyName(String companyName) {
 		this.companyName = companyName;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.audit_time
-	 * @return  the value of t_order_outsource.audit_time
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.audit_time")
 	public Date getAuditTime() {
 		return auditTime;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.audit_time
-	 * @param auditTime  the value for t_order_outsource.audit_time
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.audit_time")
 	public void setAuditTime(Date auditTime) {
 		this.auditTime = auditTime;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.unit_price
-	 * @return  the value of t_order_outsource.unit_price
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.unit_price")
 	public BigDecimal getUnitPrice() {
 		return unitPrice;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.unit_price
-	 * @param unitPrice  the value for t_order_outsource.unit_price
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.unit_price")
 	public void setUnitPrice(BigDecimal unitPrice) {
 		this.unitPrice = unitPrice;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.unit_number
-	 * @return  the value of t_order_outsource.unit_number
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.unit_number")
 	public Integer getUnitNumber() {
 		return unitNumber;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.unit_number
-	 * @param unitNumber  the value for t_order_outsource.unit_number
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.unit_number")
 	public void setUnitNumber(Integer unitNumber) {
 		this.unitNumber = unitNumber;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.outsource_remarks
-	 * @return  the value of t_order_outsource.outsource_remarks
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.outsource_remarks")
 	public String getOutsourceRemarks() {
 		return outsourceRemarks;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.outsource_remarks
-	 * @param outsourceRemarks  the value for t_order_outsource.outsource_remarks
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.outsource_remarks")
 	public void setOutsourceRemarks(String outsourceRemarks) {
 		this.outsourceRemarks = outsourceRemarks;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.type
-	 * @return  the value of t_order_outsource.type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.type")
 	public Integer getType() {
 		return type;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.type
-	 * @param type  the value for t_order_outsource.type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.type")
 	public void setType(Integer type) {
 		this.type = type;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.tid
-	 * @return  the value of t_order_outsource.tid
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.tid")
 	public Integer getTid() {
 		return tid;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.tid
-	 * @param tid  the value for t_order_outsource.tid
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.tid")
 	public void setTid(Integer tid) {
 		this.tid = tid;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.start_type
-	 * @return  the value of t_order_outsource.start_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.start_type")
 	public Integer getStartType() {
 		return startType;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.start_type
-	 * @param startType  the value for t_order_outsource.start_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.start_type")
 	public void setStartType(Integer startType) {
 		this.startType = startType;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.patent_name_type
-	 * @return  the value of t_order_outsource.patent_name_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_type")
+	public Integer getPatentType() {
+		return patentType;
+	}
+
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_type")
+	public void setPatentType(Integer patentType) {
+		this.patentType = patentType;
+	}
+
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_name_type")
 	public Integer getPatentNameType() {
 		return patentNameType;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.patent_name_type
-	 * @param patentNameType  the value for t_order_outsource.patent_name_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_name_type")
 	public void setPatentNameType(Integer patentNameType) {
 		this.patentNameType = patentNameType;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.patent_name
-	 * @return  the value of t_order_outsource.patent_name
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_name")
 	public String getPatentName() {
 		return patentName;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.patent_name
-	 * @param patentName  the value for t_order_outsource.patent_name
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.627+08:00", comments = "Source field: t_order_outsource.patent_name")
 	public void setPatentName(String patentName) {
 		this.patentName = patentName;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order_outsource.patent_type
-	 * @return  the value of t_order_outsource.patent_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
-	public Integer getPatentType() {
-		return patentType;
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.628+08:00", comments = "Source field: t_order_outsource.actual_official")
+	public Integer getActualOfficial() {
+		return actualOfficial;
 	}
 
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order_outsource.patent_type
-	 * @param patentType  the value for t_order_outsource.patent_type
-	 * @mbg.generated  Fri Jun 12 13:38:21 CST 2020
-	 */
-	public void setPatentType(Integer patentType) {
-		this.patentType = patentType;
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.628+08:00", comments = "Source field: t_order_outsource.actual_official")
+	public void setActualOfficial(Integer actualOfficial) {
+		this.actualOfficial = actualOfficial;
 	}
 
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.628+08:00", comments = "Source field: t_order_outsource.picture_url")
+	public String getPictureUrl() {
+		return pictureUrl;
+	}
+
+	@Generated(value = "org.mybatis.generator.api.MyBatisGenerator", date = "2020-11-25T17:04:15.628+08:00", comments = "Source field: t_order_outsource.picture_url")
+	public void setPictureUrl(String pictureUrl) {
+		this.pictureUrl = pictureUrl;
+	}
+
+	private String reason;
+
 	public String getReason() {
 		return reason;
 	}

+ 12 - 3
src/main/java/com/goafanti/common/task/ReleaseUserTask.java

@@ -102,11 +102,18 @@ public class ReleaseUserTask {
 			List<User> userList = userServiceImpl.selectUserByRoleName("营销员","营销经理");
 			List<LockingReleaseBo> lockUserList = new ArrayList<LockingReleaseBo>();
 			List<LockingReleaseBo> userTmpList = null;
+			List<LockingReleaseBo> userTmpList2 = null;
 			if (userList!=null&&!userList.isEmpty()) {
 				for(User u : userList){
 					if(StringUtils.isNotBlank(u.getId())) {
-						userTmpList = customerServiceImpl.selectWaitReleaseCustomer(u.getId());
-							if(userTmpList!=null&&!userTmpList.isEmpty())lockUserList.addAll(userTmpList);
+						//获取30天释放
+						userTmpList = customerServiceImpl.selectWaitReleaseCustomer(u.getId(),0);
+						//获取270天释放
+						userTmpList2 = customerServiceImpl.selectWaitReleaseCustomer(u.getId(),1);
+						customerServiceImpl.pushReleaseLog(userTmpList,0);
+						customerServiceImpl.pushReleaseLog(userTmpList2,1);
+						if(userTmpList!=null&&!userTmpList.isEmpty())lockUserList.addAll(userTmpList);
+						if(userTmpList2!=null&&!userTmpList2.isEmpty())lockUserList.addAll(userTmpList2);
 						}
 				}
 			}
@@ -115,7 +122,9 @@ public class ReleaseUserTask {
 				  for(int i=0;i<lockUserList.size();i++){
 					  newList.add(lockUserList.get(i));
 					  if(pointsDataLimit == newList.size()||i == lockUserList.size()-1){
-						  if(newList.size()>0) customerServiceImpl.updatePendingReleaseLock(newList);
+						  if(newList.size()>0) {
+							  customerServiceImpl.updatePendingReleaseLock(newList);
+						  }
 						  newList.clear();
 						  Thread.sleep(2000);
 					  }  

+ 14 - 1
src/main/java/com/goafanti/customer/service/CustomerService.java

@@ -454,7 +454,13 @@ public interface CustomerService {
 	 */
 	Pagination<CustomerListOut> listSignPersonalCustomer(CustomerListIn cli, Integer pageNo, Integer pageSize);
 	
-	List<LockingReleaseBo> selectWaitReleaseCustomer(String uid);
+	/**
+	 * 查询需要释放的客户
+	 * @param uid 客户Id
+	 * @param type   0 未跟进  1未签单
+	 * @return
+	 */
+	List<LockingReleaseBo> selectWaitReleaseCustomer(String uid, Integer type);
 	
 	List<LockingReleaseBo> selectWaitReleaseBusiness(String uid);
 	
@@ -519,5 +525,12 @@ public interface CustomerService {
 	int pushGuidance(String uid);
 	
 	boolean checkMax(String aid);
+	/**
+	 * 
+	 * @param list 释放客户
+	 * @param type 0 未跟进  1未签单
+	 * @throws InterruptedException 
+	 */
+	void pushReleaseLog(List<LockingReleaseBo> list,Integer type) throws InterruptedException;
 	
 }

+ 89 - 45
src/main/java/com/goafanti/customer/service/impl/CustomerServiceImpl.java

@@ -24,7 +24,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import com.alibaba.druid.sql.parser.Token;
 import com.goafanti.common.bo.Error;
 import com.goafanti.common.bo.userDaysBo;
 import com.goafanti.common.constant.AFTConstants;
@@ -996,7 +995,7 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 			user.setInformationMaintainer(TokenManager.getAdminId());
 			user.setSource(2);//客户来源设置为领取
 			user.setTransferTime(now);
-			flag = addUserLock(uid,TokenManager.getAdminId(),0,null,now,false); //指定用户锁定客户
+			flag = addUserLock(uid,TokenManager.getAdminId(),1,null,now,false); //指定用户锁定客户
 			if(flag <= 0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_ALREADY_RECEIVE,""));
 			//取消客户领取时把联系人一并转移
 			//organizationContactBookMapper.updateAdmin(uid,TokenManager.getAdminId());
@@ -1010,35 +1009,16 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 				//查询这个客户是否是登陆人的客户
 				if(userMapper.getAidAndUser(uid,TokenManager.getAdminId())<=0)throw new BusinessException(new Error("请勿非法操作!","请勿非法操作!"));
 				flag = updateUserLock(uid,oldAid,UserLockReleaseStatus.LOCKED.getCode(),UserLockReleaseStatus.RELEASE.getCode()); //原用户释放客户
-				if(flag > 0 ) flag = addUserLock(uid,String.valueOf(params[0]),0,null,now,isUs); //指定用户锁定客户
+				if(flag > 0 ) flag = addUserLock(uid,String.valueOf(params[0]),2,null,now,isUs); //指定用户锁定客户
 				if(flag <= 0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_TRANSFER_FAIL,""));
-				addtransferLog(uid,null,TokenManager.getAdminId(),String.valueOf(params[0]),0,isUs);
 			}else {
 				for (String us : uList) {
 					if(userMapper.getAidAndUser(us,TokenManager.getAdminId())<=0)throw new BusinessException(new Error("请勿非法操作!","请勿非法操作!"));
 				}
 				flag = updateUsersLock(uList,oldAid,UserLockReleaseStatus.LOCKED.getCode(),UserLockReleaseStatus.RELEASE.getCode()); //原用户释放客户
-				if(flag > 0 ) flag = addUserLock(uid,String.valueOf(params[0]),0,null,now,isUs); //指定用户锁定客户
+				if(flag > 0 ) flag = addUserLock(uid,String.valueOf(params[0]),2,null,now,isUs); //指定用户锁定客户
 				if(flag <= 0) throw new BusinessException(new Error(ErrorConstants.CUSTOMER_TRANSFER_FAIL,""));
-				addtransferLog(uid,null,TokenManager.getAdminId(),String.valueOf(params[0]),0,isUs);
 			}
-		}else if(AFTConstants.SIGN_USER_TRANSFER_TO_OTHER.equals(operatorType)){
-			if(!isUs) {
-				user.setAid(String.valueOf(params[0]));
-				user.setSource(3);//客户来源设置为转交
-				if (AFTConstants.SIGN_USER_TRANSFER_TO_OTHER==operatorType) {
-					user.setShareType(2);
-				}
-				//查询这个客户是否是登陆人的客户
-				if(userMapper.getAidAndUser(uid,TokenManager.getAdminId())<=0)throw new BusinessException(new Error("请勿非法操作!","请勿非法操作!"));
-				addtransferLog(uid,null,TokenManager.getAdminId(),String.valueOf(params[0]),0,isUs);
-			}else {
-				for (String us : uList) {
-					if(userMapper.getAidAndUser(us,TokenManager.getAdminId())<=0)throw new BusinessException(new Error("请勿非法操作!","请勿非法操作!"));
-				}
-				addtransferLog(uid,null,TokenManager.getAdminId(),String.valueOf(params[0]),0,isUs);
-			}
-			
 		}
 		if (isUs) {
 			if (AFTConstants.SIGN_USER_TRANSFER_TO_OTHER==operatorType) {
@@ -1474,40 +1454,64 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return userLockReleaseMapper.updateUsersLock(uList,aid,oldStatus,newStatus);
 	}
 	
+	/**
+	 * 
+	 * @param uid
+	 * @param aid
+	 * @param type  0录入  1领取 2转交客户 3转交业务
+	 * @param pid
+	 * @param lockTime
+	 * @param isUs
+	 * @return
+	 */
 	private int addUserLock(String uid,String aid,Integer type,String pid,Date lockTime, boolean isUs){
 		if (!isUs) {
 			UserLockRelease ulr = new UserLockRelease();
+			UserTransferLog utl=new UserTransferLog();
 			ulr.setId(UUID.randomUUID().toString());
-			if (type==0) {
-				ulr.setType(0);
-			}else {
-				ulr.setType(1);
-				ulr.setBusinessProjectId(pid);
-			}
+			ulr.setType(0);
 			ulr.setAid(aid);
 			ulr.setLockTime(lockTime);
 			ulr.setStatus(UserLockReleaseStatus.LOCKED.getCode());
 			ulr.setUid(uid);
 			userLockReleaseMapper.insert(ulr);
+			utl.setType(type);
+			if(type==0||type==1) utl.setAid(aid);
+			else if(type==2||type==3) {
+				utl.setAid(TokenManager.getAdminId());
+				utl.setTakeAid(aid);
+			}
+			if(type==3)utl.setPid(pid);
+			utl.setCreateTime(lockTime);
+			utl.setUid(uid);
+			userTransferLogMapper.insertSelective(utl);
 		}else {
 			List<String> ulist=Arrays.asList(uid.split(","));
 			List<UserLockRelease> ulrList=new ArrayList<>();
+			List<UserTransferLog> utlList=new ArrayList<>();
 			for (String s : ulist) {
 				UserLockRelease ulr = new UserLockRelease();
+				UserTransferLog utl=new UserTransferLog();
 				ulr.setId(UUID.randomUUID().toString());
-				if (type==0) {
-					ulr.setType(0);
-				}else {
-					ulr.setType(1);
-					ulr.setBusinessProjectId(pid);
-				}
+				ulr.setType(0);
 				ulr.setAid(aid);
 				ulr.setLockTime(lockTime);
 				ulr.setStatus(UserLockReleaseStatus.LOCKED.getCode());
 				ulr.setUid(s);
 				ulrList.add(ulr);
+				if(type==0||type==1) utl.setAid(aid);
+				else if(type==2||type==3) {
+					utl.setAid(TokenManager.getAdminId());
+					utl.setTakeAid(aid);
+				}
+				if(type==3)utl.setPid(pid);
+				utl.setCreateTime(lockTime);
+				utl.setUid(uid);
+				utl.setType(type);
+				utlList.add(utl);
 			}
 			 userLockReleaseMapper.insertList(ulrList);
+			 userTransferLogMapper.insertList(utlList);
 		}
 		return 1;
 	}
@@ -1516,14 +1520,10 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	
 	
 	
-	/**
-	 * 查询需要释放客户
-	 * @param uid
-	 * @return
-	 */
+	
 	@Override
-	public List<LockingReleaseBo> selectWaitReleaseCustomer(String uid){
-		return userLockReleaseMapper.selectWaitReleaseCustomer(uid);
+	public List<LockingReleaseBo> selectWaitReleaseCustomer(String uid,Integer type){
+		return userLockReleaseMapper.selectWaitReleaseCustomer(uid,type);
 	}
 	
 	/**
@@ -1672,10 +1672,9 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		LockingReleaseBo l=list.get(0);
 		UserLockRelease ul=new UserLockRelease();
 		ul.setId(l.getId());
-
 		ul.setAid(inputId);
 		userLockReleaseMapper.updateByPrimaryKeySelective(ul);
-		addtransferLog(uid,pid,TokenManager.getAdminId(),inputId,1,false);
+		addtransferLog(uid,pid,TokenManager.getAdminId(),inputId,3,false);
 		List<BusinessListBo> bl=userBusinessMapper.selectBusinessProjectByUAPid(uid, TokenManager.getAdminId(), pid);
 		if (bl.size()==1) {
 			UserBusiness ub=new UserBusiness();
@@ -1724,23 +1723,39 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 	@Override
 	public int pushReleaseUser(String id) {
 		Date date =new Date();
+		String aid=TokenManager.getAdminId();
 		if (!id.contains(",")) {
+			
 			User u=userMapper.selectByPrimaryKey(id);
-			if (!u.getAid().equals(TokenManager.getAdminId())) {
+			if (!u.getAid().equals(aid)) {
 				throw new BuilderException("客户归属错误!");
 			}
+			UserTransferLog utl=new UserTransferLog();
 			u.setTransferTime(date);
 			u.setShareType(1);
 			userMapper.updateByPrimaryKeySelective(u);
+			utl.setAid(aid);
+			utl.setCreateTime(date);
+			utl.setType(6);
+			utl.setUid(id);
+			userTransferLogMapper.insertSelective(utl);
 			userLockReleaseMapper.updateUserTypeLock(u.getId(), TokenManager.getAdminId(), 0, 2,date);
 		}else {
 			List<String> list=Arrays.asList(id.split(","));
+			List<UserTransferLog> ulList=new ArrayList<UserTransferLog>();
 			for (String str : list) {
 				User u=userMapper.selectByPrimaryKey(str);
 				if (!u.getAid().equals(TokenManager.getAdminId())) {
 					throw new BuilderException("客户归属错误!");
 				}
+				UserTransferLog utl=new UserTransferLog();
+				utl.setAid(aid);
+				utl.setCreateTime(date);
+				utl.setType(6);
+				utl.setUid(str);
+				ulList.add(utl);
 			}
+			userTransferLogMapper.insertList(ulList);
 			userMapper.updateList(null, null, null,date,1, list);
 			userLockReleaseMapper.updateUserTypeLockList(list, TokenManager.getAdminId(), 0, 2,date);
 		}
@@ -1780,5 +1795,34 @@ public class CustomerServiceImpl extends BaseMybatisDao<UserMapper> implements C
 		return false;
 	}
 
+	@Override
+	public void pushReleaseLog(List<LockingReleaseBo> list,Integer type) throws InterruptedException {
+		Date date=new Date();
+		List<LockingReleaseBo> newList=new ArrayList<LockingReleaseBo>();
+		  if (list!=null&&list.size()>0) {
+			  for(int i=0;i<list.size();i++){
+				  newList.add(list.get(i));
+				  if(50 == newList.size()||i == list.size()-1){
+					  if(newList.size()>0) {
+						  List<UserTransferLog> list3=new ArrayList<UserTransferLog>();
+						  for (LockingReleaseBo lrb : newList) {
+							  UserTransferLog utl=new UserTransferLog();
+							  utl.setAid(lrb.getAid());
+							  utl.setCreateTime(date);
+							  if(type==0)utl.setType(4);
+							  else if(type==1)utl.setType(5);
+							  utl.setUid(lrb.getUid());
+							  list3.add(utl);
+						}
+						  userTransferLogMapper.insertList(list3);
+					  }
+					  newList.clear();
+					  Thread.sleep(2000);
+				  }
+			  }
+		  }
+		
+	}
+
 
 }

+ 17 - 0
src/main/java/com/goafanti/order/bo/TOrderTaskDetailBo.java

@@ -83,6 +83,11 @@ public class TOrderTaskDetailBo {
 	 */
 	private Integer bpType;
 	
+	/** 官费 */
+	private Integer officialCost;
+	/** 费减 */
+	private Integer costReduction;
+	
 	
 	public Integer getSplitStatus() {
 		return splitStatus;
@@ -361,6 +366,18 @@ public class TOrderTaskDetailBo {
 	public void setBpType(Integer bpType) {
 		this.bpType = bpType;
 	}
+	public Integer getOfficialCost() {
+		return officialCost;
+	}
+	public void setOfficialCost(Integer officialCost) {
+		this.officialCost = officialCost;
+	}
+	public Integer getCostReduction() {
+		return costReduction;
+	}
+	public void setCostReduction(Integer costReduction) {
+		this.costReduction = costReduction;
+	}
 	
 	
 }

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

@@ -665,11 +665,9 @@ public class OrderChangeServiceImpl extends BaseMybatisDao<NewOrderChangeMapper>
 		}else if(nob.getType()==OrderChangeType.TDTK.getCode()) {
 			//先将业务锁关闭
 			List<String> list=tOrderTaskMapper.getLockId(nb.getOrderNo(),o.getSalesmanId(),o.getBuyerId());
-			userLockReleaseMapper.updateReleaseList(list);
+			if(!list.isEmpty())userLockReleaseMapper.updateReleaseList(list);
 			int i=userLockReleaseMapper.selectByUidGetCount(o.getSalesmanId(),o.getBuyerId());
-			if (i<1) {
-				userLockReleaseMapper.updateReleaseUser(o.getOrderNo());
-			}
+			if (i<1) userLockReleaseMapper.updateReleaseUser(o.getOrderNo());
 		}
 		//
 		List<TOrderTaskBo> taskBos=tOrderTaskMapper.selectOrderTask(nb.getOrderNo());

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

@@ -96,7 +96,6 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.customer.bo.LockingReleaseBo;
 import com.goafanti.order.bo.InputArrearsDunListBo;
 import com.goafanti.order.bo.OrderDunTaskBo;
-import com.goafanti.order.bo.OrderOutsourceDtails;
 import com.goafanti.order.bo.OrderRefundDetailBo;
 import com.goafanti.order.bo.OutArrearsDunListBo;
 import com.goafanti.order.bo.OutNewOrderDunBo;
@@ -1329,7 +1328,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 			//旧项目变更,如果驳回修改成新的项目变更
 			if(o.getUnitNumber()!=null)tOrderOutsourceMapper.updateByidNull(o.getId());
 		}
-		updateOrderCostAmount(o.getTid(),o.getStartType());
+		updateOrderCostAmount(o.getTid(),o.getStartType(),o.getActualOfficial());
 		return 1;
 	}
 
@@ -1337,13 +1336,13 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 	 * 发起外包时,通过计算获取项目的成本,订单的成本
 	 * @param tid
 	 */
-	private void updateOrderCostAmount(Integer tid,Integer startType) {
+	private void updateOrderCostAmount(Integer tid,Integer startType,Integer actualOfficial) {
 		//计算项目成本
 		List<OutThirdPartyCompany>list=thirdPartyCompanyMapper.selectByTid(tid);
 		BigDecimal tCount=new BigDecimal(0);
 		for (OutThirdPartyCompany op : list) {
 			tCount=tCount.add(new BigDecimal(op.getTotalAmount()));
-			if(op.getOfficialCost()==1 && startType==1) {
+			if(op.getOfficialCost()==1 && startType==1 && actualOfficial==0) {
 				BigDecimal sum= new BigDecimal(0);
 				if (op.getCostReduction()==0) {
 					sum= new BigDecimal(op.getOfficialUnitPrice()).multiply(new BigDecimal(op.getQuantity()));

+ 2 - 2
src/main/resources/props/config_local.properties

@@ -64,12 +64,12 @@ user_remind_days=15
 portal.host=//sf.jishutao.com/portal/2.0.6
 avatar.upload.host=//sb.jishutao.com/upload
 #连接开发
-#static.host=//sb.jishutao.com:3000/1.1.57
+#static.host=//sb.jishutao.com:3000/1.1.58
 #avatar.host=//sb.jishutao.com
 
 #连测试
 avatar.host=//static.jishutao.com
-static.host=//static.jishutao.com/1.1.57
+static.host=//static.jishutao.com/1.1.58
 
 upload.path=F:/data/public/upload
 upload.private.path=F:/data/private/upload

+ 1 - 1
src/main/resources/props/config_test.properties

@@ -59,7 +59,7 @@ user.private.max=1000
 #客户释放提醒
 user_remind_days=15
 
-static.host=//static.jishutao.com/1.1.57
+static.host=//static.jishutao.com/1.1.58
 portal.host=//static.jishutao.com/portal/2.0.6
 avatar.host=//static.jishutao.com
 avatar.upload.host=//static.jishutao.com/upload

+ 5 - 5
src/main/webapp/WEB-INF/web.xml

@@ -1,8 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee  
-                             http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
-	version="3.1">
+<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
+         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
+         version="3.1">
 
 	<display-name>AFT</display-name>