Browse Source

Merge branch 'test' of http://git.jishutao.com/jishutao/kede-server.git into test

limin 7 years ago
parent
commit
401513052f
23 changed files with 1411 additions and 77 deletions
  1. 1 1
      GeneratorConfig.xml
  2. 2 2
      src/main/java/com/goafanti/admin/controller/AdminApiController.java
  3. 2 2
      src/main/java/com/goafanti/admin/controller/AdminSuperviseApiController.java
  4. 2 2
      src/main/java/com/goafanti/admin/controller/AdminSuperviserApiController.java
  5. 2 2
      src/main/java/com/goafanti/admin/service/AdminService.java
  6. 1 1
      src/main/java/com/goafanti/admin/service/NewAdminService.java
  7. 10 25
      src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java
  8. 2 1
      src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java
  9. 2 0
      src/main/java/com/goafanti/common/dao/TOrderRefundMapper.java
  10. 96 0
      src/main/java/com/goafanti/common/dao/TTaskLogMapper.java
  11. 30 2
      src/main/java/com/goafanti/common/mapper/AdminMapper.xml
  12. 10 3
      src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml
  13. 5 1
      src/main/java/com/goafanti/common/mapper/TOrderRefundMapper.xml
  14. 67 2
      src/main/java/com/goafanti/common/mapper/TOrderTaskMapper.xml
  15. 286 0
      src/main/java/com/goafanti/common/mapper/TTaskLogMapper.xml
  16. 170 0
      src/main/java/com/goafanti/common/model/TTaskLog.java
  17. 623 0
      src/main/java/com/goafanti/common/model/TTaskLogExample.java
  18. 2 1
      src/main/java/com/goafanti/common/task/OrderDunTask.java
  19. 11 1
      src/main/java/com/goafanti/order/controller/OrderProjectApiController.java
  20. 2 0
      src/main/java/com/goafanti/order/enums/OrderNewState.java
  21. 3 0
      src/main/java/com/goafanti/order/service/OrderProjectService.java
  22. 17 13
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java
  23. 65 18
      src/main/java/com/goafanti/order/service/impl/OrderProjectServiceImpl.java

+ 1 - 1
GeneratorConfig.xml

@@ -9,6 +9,6 @@
     <javaModelGenerator targetPackage="com.goafanti.common.model" targetProject="aft" />
     <sqlMapGenerator targetPackage="com.goafanti.common.mapper" targetProject="aft" />
     <javaClientGenerator targetPackage="com.goafanti.common.dao" targetProject="aft" type="XMLMAPPER" />
-    <table schema="aft" tableName="t_order_bonus"/> 
+    <table schema="aft" tableName="t_task_log"/> 
   </context>
 </generatorConfiguration>

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminApiController.java

@@ -3109,9 +3109,9 @@ public class AdminApiController extends CertifyApiController {
 	 * 常用联系人列表
 	 */
 	@RequestMapping(value = "/frequentContactsList", method = RequestMethod.GET)
-	public Result frequentContactsList(String departmentId,String name,Integer pageSize,Integer pageNo) {
+	public Result frequentContactsList(String departmentId,String name,String roleName,Integer pageSize,Integer pageNo) {
 		Result res = new Result();
-		res.setData(adminService.frequentContactsList(departmentId, name, pageSize, pageNo));
+		res.setData(adminService.frequentContactsList(departmentId, name,roleName, pageSize, pageNo));
 		return res;
 	}
 	/**

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminSuperviseApiController.java

@@ -111,7 +111,7 @@ public class AdminSuperviseApiController extends CertifyApiController {
 	 * 管理员列表
 	 */
 	@RequestMapping(value = "/adminList", method = RequestMethod.GET)
-	public Result adminList(Integer province, Integer number, String mobile, String name, String pageNo,
+	public Result adminList(Integer province, Integer number, String mobile, String name,String roleName, String pageNo,
 			String pageSize) {
 		Result res = new Result();
 		Integer pNo = 1;
@@ -122,7 +122,7 @@ public class AdminSuperviseApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(adminService.listAdmin(province, number, mobile, name, pNo, pSize));
+		res.setData(adminService.listAdmin(province, number, mobile, name, roleName, pNo, pSize));
 		return res;
 	}
 

+ 2 - 2
src/main/java/com/goafanti/admin/controller/AdminSuperviserApiController.java

@@ -46,7 +46,7 @@ public class AdminSuperviserApiController extends CertifyApiController {
 	private AdminMapper			adminMapper;
 	/**管理员列表*/
 	@RequestMapping(value = "/adminList", method = RequestMethod.GET)
-	public Result adminList(AdminListBo alb, String rid, String pageNo,
+	public Result adminList(AdminListBo alb, String rid,String roleName, String pageNo,
 			String pageSize) {
 		Result res = new Result();
 		Integer pNo = 1;
@@ -57,7 +57,7 @@ public class AdminSuperviserApiController extends CertifyApiController {
 		if (StringUtils.isNumeric(pageNo)) {
 			pNo = Integer.parseInt(pageNo);
 		}
-		res.setData(newAdminService.listAdmin(alb,rid, pNo, pSize));
+		res.setData(newAdminService.listAdmin(alb,rid,roleName, pNo, pSize));
 		return res;
 	}
 	

+ 2 - 2
src/main/java/com/goafanti/admin/service/AdminService.java

@@ -16,7 +16,7 @@ public interface AdminService {
 
 	Admin selectByPrimaryKey(String key);
 
-	Pagination<AdminListBo> listAdmin(Integer province, Integer number, String mobile, String name, Integer pNo,
+	Pagination<AdminListBo> listAdmin(Integer province, Integer number, String mobile, String name, String roleName, Integer pNo,
 			Integer pSize);
 
 	int insert(Admin ad);
@@ -73,7 +73,7 @@ public interface AdminService {
 
 	int addFrequentContacts(String id);
 
-	Pagination<AdminListBo>  frequentContactsList(String depId, String name, Integer pageSize, Integer pageNo);
+	Pagination<AdminListBo>  frequentContactsList(String depId, String name, String roleName, Integer pageSize, Integer pageNo);
 
 	int deleteFrequentContacts(String id);
 }

+ 1 - 1
src/main/java/com/goafanti/admin/service/NewAdminService.java

@@ -9,7 +9,7 @@ import com.goafanti.common.model.Admin;
 import com.goafanti.core.mybatis.page.Pagination;
 
 public interface NewAdminService {
-	Pagination<AdminListBo> listAdmin(AdminListBo alb,String rid,Integer pageNo, Integer pageSize);
+	Pagination<AdminListBo> listAdmin(AdminListBo alb,String rid,String roleName, Integer pageNo, Integer pageSize);
 	
 	List<Admin> selectAllAdmin();
 

+ 10 - 25
src/main/java/com/goafanti/admin/service/impl/AdminServiceImpl.java

@@ -59,32 +59,16 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<AdminListBo> listAdmin(Integer province, Integer number, String mobile, String name,
+	public Pagination<AdminListBo> listAdmin(Integer province, Integer number, String mobile, String name,String roleName,
 			Integer pageNo, Integer pageSize) {
 		Map<String, Object> params = new HashMap<>();
-
-		if (StringUtils.isNotBlank(mobile)) {
-			params.put("mobile", mobile);
-		}
-
-		if (StringUtils.isNotBlank(name)) {
-			params.put("name", name);
-		}
-
-		if (null != number) {
-			params.put("number", number);
-		}
-
-		if (pageNo == null || pageNo < 0) {
-			pageNo = 1;
-		}
-
-		if (pageSize == null || pageSize < 0 || pageSize > 10) {
-			pageSize = 10;
-		}
-		if (province != null) {
-			params.put("province", province);
-		}
+		if (StringUtils.isNotBlank(roleName))params.put("roleName", roleName);
+		if (StringUtils.isNotBlank(mobile))params.put("mobile", mobile);
+		if (StringUtils.isNotBlank(name))params.put("name", name);
+		if (null != number)params.put("number", number);
+		if (pageNo == null || pageNo < 0)pageNo = 1;
+		if (pageSize == null || pageSize < 0 || pageSize > 10)pageSize = 10;
+		if (province != null) params.put("province", province);
 		return (Pagination<AdminListBo>) findPage("findAdminListByPage", "findAdminCount", params, pageNo,
 					pageSize);
 	}
@@ -351,12 +335,13 @@ public class AdminServiceImpl extends BaseMybatisDao<AdminMapper> implements Adm
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<AdminListBo> frequentContactsList(String depId, String name, Integer pageSize, Integer pageNo) {
+	public Pagination<AdminListBo> frequentContactsList(String depId, String name,String roleName, Integer pageSize, Integer pageNo) {
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
 		if (StringUtils.isNotBlank(depId)) params.put("depId", depId);
 		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if (StringUtils.isNotBlank(roleName)) params.put("roleName", roleName);
 		params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
 		Pagination<AdminListBo> p = (Pagination<AdminListBo>)findPage("frequentContactsList", "frequentContactsCount", params, pageNo, pageSize);
 		return p;

+ 2 - 1
src/main/java/com/goafanti/admin/service/impl/NewAdminServiceImpl.java

@@ -34,9 +34,10 @@ public class NewAdminServiceImpl extends BaseMybatisDao<AdminMapper> implements
 	private AdminLocationMapper	adminLocationMapper;
 	
 	@Override
-	public Pagination<AdminListBo> listAdmin(AdminListBo alb, String rid, Integer pageNo, Integer pageSize) {
+	public Pagination<AdminListBo> listAdmin(AdminListBo alb, String rid,String roleName,Integer pageNo, Integer pageSize) {
 		Map<String,Object> params = new HashMap<String, Object>();
 		if(StringUtils.isNotBlank(alb.getName())) params.put("name", alb.getName());
+		if(StringUtils.isNotBlank(roleName)) params.put("roleName", roleName);
 		if(StringUtils.isNotBlank(alb.getDepartmentId())) params.put("departmentId", alb.getDepartmentId());
 		if(StringUtils.isNotBlank(rid)) params.put("rid", rid);
 		if(StringUtils.isNotBlank(alb.getDuty())) params.put("duty",alb.getDuty());

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

@@ -95,4 +95,6 @@ public interface TOrderRefundMapper {
 	int updateByPrimaryKey(TOrderRefund record);
 	
 	int updateRefundById(TOrderRefund record);
+
+	int checkOrderNo(String orderNo);
 }

+ 96 - 0
src/main/java/com/goafanti/common/dao/TTaskLogMapper.java

@@ -0,0 +1,96 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TTaskLog;
+import com.goafanti.common.model.TTaskLogExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface TTaskLogMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    long countByExample(TTaskLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    int deleteByExample(TTaskLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    int deleteByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    int insert(TTaskLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    int insertSelective(TTaskLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    List<TTaskLog> selectByExample(TTaskLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    TTaskLog selectByPrimaryKey(Integer id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    int updateByExampleSelective(@Param("record") TTaskLog record, @Param("example") TTaskLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    int updateByExample(@Param("record") TTaskLog record, @Param("example") TTaskLogExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    int updateByPrimaryKeySelective(TTaskLog record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    int updateByPrimaryKey(TTaskLog record);
+}

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

@@ -674,7 +674,12 @@
     left join admin_location al on a.id = al.admin_id
     left join admin aa on aa.id = a.superior_id
     left join department dm on a.department_id = dm.id
+    left join user_role x on x.uid=a.id
+    left join `role` y on x.rid=y.id
     where a.id <![CDATA[ <> ]]> '1'
+    <if test="roleName != null"> 
+    	where y.role_name= #{roleName,jdbcType=VARCHAR}
+    </if>
     <if test="mobile != null"> 
     	and a.mobile = #{mobile,jdbcType=VARCHAR}
     </if>
@@ -696,6 +701,11 @@
   <select id="findAdminCount" parameterType="java.lang.String" resultType="java.lang.Integer">
    	select count(1) from admin
     where id <![CDATA[ <> ]]> '1'
+     left join `role` y on x.rid=y.id
+    where a.id <![CDATA[ <> ]]> '1'
+    <if test="roleName != null"> 
+    	where y.role_name= #{roleName,jdbcType=VARCHAR}
+    </if>
     <if test="mobile != null"> 
     	and mobile = #{mobile,jdbcType=VARCHAR}
     </if>
@@ -734,8 +744,12 @@
     left join admin_location al on a.id = al.admin_id
     left join admin aa on aa.id = a.superior_id
     left join user_role ur on a.id=ur.uid
+    left join `role` y on ur.rid=y.id
     where a.id <![CDATA[ <> ]]> '1'
     and a.status ='正常'
+    <if test="roleName != null"> 
+    	and y.role_name= #{roleName,jdbcType=VARCHAR}
+    </if>
     <if test="name != null"> 
     	and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
     </if>
@@ -770,8 +784,12 @@
    	select count(t.counts) 
    	from(select a.id counts from (select a.id  from admin a
    	left join user_role ur on a.id=ur.uid
+   	 left join `role` y on ur.rid=y.id
     where a.id <![CDATA[ <> ]]> '1'
     and (a.status != '注销' or a.status is null)
+    <if test="roleName != null"> 
+    	and y.role_name= #{roleName,jdbcType=VARCHAR}
+    </if>
     <if test="name != null"> 
     	and a.name like concat('%',#{name,jdbcType=VARCHAR},'%')
     </if>
@@ -982,8 +1000,12 @@
   	 select a.id,b.id as contactId,b.name,b.position,b.contact_mobile as contactMobile,c.name as departmentName
     from admin_contacts a left join admin b 
     on a.contacts_id=b.id left join department c 
-    on c.id=b.department_id
+    on c.id=b.department_id left join user_role x on x.uid=b.id
+    left join `role` y on x.rid=y.id
     where b.status ='正常'
+    <if test="roleName != null"> 
+    and y.role_name= #{roleName,jdbcType=VARCHAR}
+    </if>
     <if test="aid != null"> 
     and a.aid= #{aid,jdbcType=VARCHAR}
     </if>
@@ -1001,7 +1023,13 @@
   <select id="frequentContactsCount" parameterType="java.lang.String" resultType="java.lang.Integer">
    select count(*)
     from admin_contacts a left join admin b 
-    on a.contacts_id=b.id where b.status ='正常'
+    on a.contacts_id=b.id 
+    left join user_role x on x.uid=b.id
+    left join `role` y on x.rid=y.id
+    where b.status ='正常'
+    <if test="roleName != null"> 
+    and y.role_name= #{roleName,jdbcType=VARCHAR}
+    </if>
     <if test="aid != null"> 
     and a.aid= #{aid,jdbcType=VARCHAR}
     </if>

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

@@ -1079,6 +1079,9 @@
   	<if test="specially == 5">
   	and c.department_id=(select department_id from admin where  id= #{aid,jdbcType=VARCHAR})
   	</if>
+  	<if test="distribution == 0">
+  	and a.process_status &lt; 5
+  	</if>
   	<if test="distribution == 1">
   	and a.process_status = 5
   	</if>
@@ -1106,7 +1109,7 @@
   	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 admin d on a.finance_id=d.id
-  	<if test="specially == 2">
+  		<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
   	</if>
@@ -1124,6 +1127,7 @@
   	</if>
   	<if test="specially == 2">
   	and a.order_status in(3,5) 
+  	and a.salesman_id = #{aid,jdbcType=VARCHAR}
   	</if>
   	<if test="specially == 3">
   	and a.approval = 1 and  a.order_status=2
@@ -1134,6 +1138,9 @@
   	<if test="specially == 5">
   	and c.department_id=(select department_id from admin where  id= #{aid,jdbcType=VARCHAR})
   	</if>
+  	<if test="distribution == 0">
+  	and a.process_status &lt; 5
+  	</if>
   	<if test="distribution == 1">
   	and a.process_status = 5
   	</if>
@@ -1217,7 +1224,7 @@
     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 and b.order_status = 6
+    where  b.delete_sign = 0 
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>
@@ -1241,7 +1248,7 @@
 		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 and b.order_status = 6
+    where  b.delete_sign = 0 
     <if test="name != null">
   	and c.nickname like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
   	</if>

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

@@ -536,5 +536,9 @@
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
-  
+  <select id="checkOrderNo" resultType="java.lang.Integer">
+	select count(*) from t_order_refund
+	where refund_status=0
+	and order_no= #{orderNo,jdbcType=VARCHAR}  
+  </select>
 </mapper>

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

@@ -674,6 +674,7 @@
     and a.commodity_quantity =1
     </if>
     <if test="specially == 1">
+    and a.task_receiver= #{aid,jdbcType=VARCHAR}
     and a.super_id is null
     </if>
     <if test="specially == 2">
@@ -711,10 +712,11 @@
     where e.delete_sign=0 
     <if test="specially == 0">
     and a.task_receiver= #{aid,jdbcType=VARCHAR}
-    and a.commodity_quantity =1<!-- 不看父任务 -->
+    and a.commodity_quantity =1
     </if>
     <if test="specially == 1">
-    and a.super_id is null<!-- 不看子任务 -->
+    and a.task_receiver= #{aid,jdbcType=VARCHAR}
+    and a.super_id is null
     </if>
     <if test="specially == 2">
     and d.superior_id= (select department_id from admin where  id= #{aid,jdbcType=VARCHAR})
@@ -803,4 +805,67 @@ from t_order_task a left join business_project b on a.commodity_id=b.id
   	and a.task_start_time between #{starTime,jdbcType=VARCHAR} and #{endTime,jdbcType=VARCHAR}
   	</if>
   </select>
+  
+   <select id="selectTaskListByPage" resultType="com.goafanti.order.bo.TOrderTaskListBo">
+  	select  a.id,a.commodity_name as taskName,a.order_no as orderNo,c.cname,d.name as receiverName,
+    a.project_status as projectStatus,a.task_status as taskStatus,date_format(a.task_distribution_time,'%Y-%m-%d') as taskDate,
+    a.commodity_quantity as commodityQuantity,f.nickname as userName
+    from t_task_log x left join  t_order_task a on x.task_id=a.id 
+  	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 user f on e.buyer_id=f.id
+    where e.delete_sign=0 
+    and x.task_receiver= #{aid,jdbcType=VARCHAR}
+    <if test="orderNo != null">
+  	and a.order_no= #{orderNo,jdbcType=VARCHAR}
+  	</if>
+    <if test="name != null">
+  	and a.commodity_name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="orderNo != null">
+  	and a.order_no= #{orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test="taskId != null">
+  	and a.id= #{taskId,jdbcType=VARCHAR}
+  	</if>
+  	<if test="taskStatus != null">
+  	and a.task_status= #{taskStatus,jdbcType=INTEGER}
+  	</if>
+  	<if test="adminName != null">
+  	and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
+  	</if>
+  	order by a.task_distribution_time desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+   <select id="selectTaskListCount" resultType="java.lang.Integer">
+  	select  count(*)
+    from t_task_log x left join  t_order_task a on x.task_id=a.id 
+    left join admin d on a.task_receiver=d.id
+    left join t_order_new e on a.order_no=e.order_no
+    where e.delete_sign=0 
+    and x.task_receiver= #{aid,jdbcType=VARCHAR}
+    <if test="orderNo != null">
+  	and a.order_no= #{orderNo,jdbcType=VARCHAR}
+  	</if>
+    <if test="name != null">
+  	and a.commodity_name like CONCAT('%',#{name,jdbcType=VARCHAR},'%')
+  	</if>
+  	<if test="orderNo != null">
+  	and a.order_no= #{orderNo,jdbcType=VARCHAR}
+  	</if>
+  	<if test="taskId != null">
+  	and a.id= #{taskId,jdbcType=VARCHAR}
+  	</if>
+  	<if test="taskStatus != null">
+  	and a.task_status= #{taskStatus,jdbcType=INTEGER}
+  	</if>
+  	<if test="adminName != null">
+  	and d.name like CONCAT('%', #{adminName,jdbcType=VARCHAR},'%')
+  	</if>
+  </select>
 </mapper>

+ 286 - 0
src/main/java/com/goafanti/common/mapper/TTaskLogMapper.xml

@@ -0,0 +1,286 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.goafanti.common.dao.TTaskLogMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TTaskLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="task_id" jdbcType="INTEGER" property="taskId" />
+    <result column="task_allocator" jdbcType="VARCHAR" property="taskAllocator" />
+    <result column="task_receiver" jdbcType="VARCHAR" property="taskReceiver" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    id, task_id, task_allocator, task_receiver, create_time
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.TTaskLogExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from t_task_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from t_task_log
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    delete from t_task_log
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TTaskLogExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    delete from t_task_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.TTaskLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    insert into t_task_log (id, task_id, task_allocator, 
+      task_receiver, create_time)
+    values (#{id,jdbcType=INTEGER}, #{taskId,jdbcType=INTEGER}, #{taskAllocator,jdbcType=VARCHAR}, 
+      #{taskReceiver,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TTaskLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    insert into t_task_log
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="taskId != null">
+        task_id,
+      </if>
+      <if test="taskAllocator != null">
+        task_allocator,
+      </if>
+      <if test="taskReceiver != null">
+        task_receiver,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="taskId != null">
+        #{taskId,jdbcType=INTEGER},
+      </if>
+      <if test="taskAllocator != null">
+        #{taskAllocator,jdbcType=VARCHAR},
+      </if>
+      <if test="taskReceiver != null">
+        #{taskReceiver,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.TTaskLogExample" resultType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    select count(*) from t_task_log
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    update t_task_log
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.taskId != null">
+        task_id = #{record.taskId,jdbcType=INTEGER},
+      </if>
+      <if test="record.taskAllocator != null">
+        task_allocator = #{record.taskAllocator,jdbcType=VARCHAR},
+      </if>
+      <if test="record.taskReceiver != null">
+        task_receiver = #{record.taskReceiver,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    update t_task_log
+    set id = #{record.id,jdbcType=INTEGER},
+      task_id = #{record.taskId,jdbcType=INTEGER},
+      task_allocator = #{record.taskAllocator,jdbcType=VARCHAR},
+      task_receiver = #{record.taskReceiver,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TTaskLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    update t_task_log
+    <set>
+      <if test="taskId != null">
+        task_id = #{taskId,jdbcType=INTEGER},
+      </if>
+      <if test="taskAllocator != null">
+        task_allocator = #{taskAllocator,jdbcType=VARCHAR},
+      </if>
+      <if test="taskReceiver != null">
+        task_receiver = #{taskReceiver,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TTaskLog">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 04 15:28:04 CST 2018.
+    -->
+    update t_task_log
+    set task_id = #{taskId,jdbcType=INTEGER},
+      task_allocator = #{taskAllocator,jdbcType=VARCHAR},
+      task_receiver = #{taskReceiver,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 170 - 0
src/main/java/com/goafanti/common/model/TTaskLog.java

@@ -0,0 +1,170 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class TTaskLog {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_task_log.id
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    private Integer id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_task_log.task_id
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    private Integer taskId;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_task_log.task_allocator
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    private String taskAllocator;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_task_log.task_receiver
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    private String taskReceiver;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column t_task_log.create_time
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    private Date createTime;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_task_log.id
+     *
+     * @return the value of t_task_log.id
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public Integer getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_task_log.id
+     *
+     * @param id the value for t_task_log.id
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    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_task_log.task_id
+     *
+     * @return the value of t_task_log.task_id
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public Integer getTaskId() {
+        return taskId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_task_log.task_id
+     *
+     * @param taskId the value for t_task_log.task_id
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public void setTaskId(Integer taskId) {
+        this.taskId = taskId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_task_log.task_allocator
+     *
+     * @return the value of t_task_log.task_allocator
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public String getTaskAllocator() {
+        return taskAllocator;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_task_log.task_allocator
+     *
+     * @param taskAllocator the value for t_task_log.task_allocator
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public void setTaskAllocator(String taskAllocator) {
+        this.taskAllocator = taskAllocator;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_task_log.task_receiver
+     *
+     * @return the value of t_task_log.task_receiver
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public String getTaskReceiver() {
+        return taskReceiver;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_task_log.task_receiver
+     *
+     * @param taskReceiver the value for t_task_log.task_receiver
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public void setTaskReceiver(String taskReceiver) {
+        this.taskReceiver = taskReceiver;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column t_task_log.create_time
+     *
+     * @return the value of t_task_log.create_time
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column t_task_log.create_time
+     *
+     * @param createTime the value for t_task_log.create_time
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 623 - 0
src/main/java/com/goafanti/common/model/TTaskLogExample.java

@@ -0,0 +1,623 @@
+package com.goafanti.common.model;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class TTaskLogExample {
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    protected String orderByClause;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    protected boolean distinct;
+
+    /**
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    protected List<Criteria> oredCriteria;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public TTaskLogExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Integer value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Integer value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Integer value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Integer value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Integer value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Integer> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Integer> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Integer value1, Integer value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdIsNull() {
+            addCriterion("task_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdIsNotNull() {
+            addCriterion("task_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdEqualTo(Integer value) {
+            addCriterion("task_id =", value, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdNotEqualTo(Integer value) {
+            addCriterion("task_id <>", value, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdGreaterThan(Integer value) {
+            addCriterion("task_id >", value, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("task_id >=", value, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdLessThan(Integer value) {
+            addCriterion("task_id <", value, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdLessThanOrEqualTo(Integer value) {
+            addCriterion("task_id <=", value, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdIn(List<Integer> values) {
+            addCriterion("task_id in", values, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdNotIn(List<Integer> values) {
+            addCriterion("task_id not in", values, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdBetween(Integer value1, Integer value2) {
+            addCriterion("task_id between", value1, value2, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("task_id not between", value1, value2, "taskId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorIsNull() {
+            addCriterion("task_allocator is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorIsNotNull() {
+            addCriterion("task_allocator is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorEqualTo(String value) {
+            addCriterion("task_allocator =", value, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorNotEqualTo(String value) {
+            addCriterion("task_allocator <>", value, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorGreaterThan(String value) {
+            addCriterion("task_allocator >", value, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorGreaterThanOrEqualTo(String value) {
+            addCriterion("task_allocator >=", value, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorLessThan(String value) {
+            addCriterion("task_allocator <", value, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorLessThanOrEqualTo(String value) {
+            addCriterion("task_allocator <=", value, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorLike(String value) {
+            addCriterion("task_allocator like", value, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorNotLike(String value) {
+            addCriterion("task_allocator not like", value, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorIn(List<String> values) {
+            addCriterion("task_allocator in", values, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorNotIn(List<String> values) {
+            addCriterion("task_allocator not in", values, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorBetween(String value1, String value2) {
+            addCriterion("task_allocator between", value1, value2, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskAllocatorNotBetween(String value1, String value2) {
+            addCriterion("task_allocator not between", value1, value2, "taskAllocator");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverIsNull() {
+            addCriterion("task_receiver is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverIsNotNull() {
+            addCriterion("task_receiver is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverEqualTo(String value) {
+            addCriterion("task_receiver =", value, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverNotEqualTo(String value) {
+            addCriterion("task_receiver <>", value, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverGreaterThan(String value) {
+            addCriterion("task_receiver >", value, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverGreaterThanOrEqualTo(String value) {
+            addCriterion("task_receiver >=", value, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverLessThan(String value) {
+            addCriterion("task_receiver <", value, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverLessThanOrEqualTo(String value) {
+            addCriterion("task_receiver <=", value, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverLike(String value) {
+            addCriterion("task_receiver like", value, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverNotLike(String value) {
+            addCriterion("task_receiver not like", value, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverIn(List<String> values) {
+            addCriterion("task_receiver in", values, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverNotIn(List<String> values) {
+            addCriterion("task_receiver not in", values, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverBetween(String value1, String value2) {
+            addCriterion("task_receiver between", value1, value2, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andTaskReceiverNotBetween(String value1, String value2) {
+            addCriterion("task_receiver not between", value1, value2, "taskReceiver");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table t_task_log
+     *
+     * @mbg.generated do_not_delete_during_merge Tue Dec 04 15:28:04 CST 2018
+     */
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    /**
+     * This class was generated by MyBatis Generator.
+     * This class corresponds to the database table t_task_log
+     *
+     * @mbg.generated Tue Dec 04 15:28:04 CST 2018
+     */
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

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

@@ -14,6 +14,7 @@ import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 import org.springframework.stereotype.Controller;
 import org.springframework.transaction.annotation.Transactional;
+import org.springframework.transaction.interceptor.TransactionAspectSupport;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 
@@ -79,5 +80,5 @@ public class OrderDunTask {
 		 orderNewService.updateOrderDun(tDun);
 		orderNewService.addNoticAndSendEmail(t.getOrderNo(),t,NoticeStatus.ORDER_DUN.getCode());
 	}
-  	
+ 
 }

+ 11 - 1
src/main/java/com/goafanti/order/controller/OrderProjectApiController.java

@@ -55,6 +55,17 @@ public class OrderProjectApiController extends CertifyApiController {
 		res.setData(orderProjectService.orderTaskList( name, orderNo, taskId, taskStatus, adminName,specially , pageNo, pageSize));
 		return res;
 	}
+	
+	
+	/**
+	 * 任务派单查询
+	 */
+	@RequestMapping(value="/selectTaskList" ,method = RequestMethod.GET)
+	public Result selectTaskList(String name,String orderNo,String taskId,Integer taskStatus,String adminName,Integer specially  ,Integer pageNo,Integer pageSize){
+		Result res=new Result();
+		res.setData(orderProjectService.selectTaskList( name, orderNo, taskId, taskStatus, adminName,specially , pageNo, pageSize));
+		return res;
+	}
 	/**
 	 * 任务详情
 	 */
@@ -116,7 +127,6 @@ public class OrderProjectApiController extends CertifyApiController {
 	@RequestMapping(value = "/uploadOrderTaskFile", method = RequestMethod.POST)
 	public Result uploadOrderTaskFile(HttpServletRequest req,String sign){
 		Result res = new Result();
-		//order_refund_file
 		res.setData(handleFile(res, "/order_task_file/", false, req, sign));
 		return res;
 	}

+ 2 - 0
src/main/java/com/goafanti/order/enums/OrderNewState.java

@@ -16,6 +16,8 @@ public enum OrderNewState {
 	YJX(4, "已结项"),
 	/** 已驳回 **/
 	YBH(5, "已驳回"),
+	/** 退单中 **/
+	TDZ(6, "退单中"),
 	/** 已退单 **/
 	YTD(6, "已退单");
 	

+ 3 - 0
src/main/java/com/goafanti/order/service/OrderProjectService.java

@@ -24,5 +24,8 @@ public interface OrderProjectService {
 			Integer pageNo, Integer pageSize);
 
 	XSSFWorkbook exportTaskHoursListData(String name, String taskId, String starTime, String endTime);
+
+	Pagination<TOrderTaskListBo>  selectTaskList(String name, String orderNo, String taskId, Integer taskStatus, String adminName,
+			Integer specially, Integer pageNo, Integer pageSize);
 	
 }

+ 17 - 13
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -15,11 +15,13 @@ import javax.mail.MessagingException;
 
 import org.apache.commons.lang3.StringUtils;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.apache.xmlbeans.impl.xb.xsdschema.Public;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import com.alibaba.fastjson.JSON;
 import com.goafanti.admin.bo.AdminListBo;
@@ -44,6 +46,7 @@ import com.goafanti.common.model.TDunLog;
 import com.goafanti.common.model.TOrderBack;
 import com.goafanti.common.model.TOrderDun;
 import com.goafanti.common.model.TOrderNew;
+import com.goafanti.common.model.TOrderRefund;
 import com.goafanti.common.model.TOrderRefundWithBLOBs;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.utils.ExportExcelUtil;
@@ -187,19 +190,23 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 
 	@Override
 	public int updateServiceOrder(TOrderNew t, Integer isSubmit) {
-		OrganizationContactBook contactBook=new OrganizationContactBook();
-		contactBook.setId(UUID.randomUUID().toString());
-		contactBook.setAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
-		contactBook.setUid(t.getBuyerId());
-		contactBook.setName(t.getContacts());
-		contactBook.setMobile(t.getContactMobile());
-		organizationContactBookMapper.insertSelective(contactBook);
+		TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
+		//判断手机号码是否存在
+		if (StringUtils.isNotBlank(t.getContacts())&&StringUtils.isNotBlank(t.getContactMobile())&&
+				organizationContactBookMapper.checkContacts(t2.getBuyerId(), t2.getContactMobile(),TokenManager.getAdminId()==null?"1":TokenManager.getAdminId() )>0) {
+			OrganizationContactBook contactBook=new OrganizationContactBook();
+			contactBook.setId(UUID.randomUUID().toString());
+			contactBook.setAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
+			contactBook.setUid(t2.getBuyerId());
+			contactBook.setName(t.getContacts());
+			contactBook.setMobile(t.getContactMobile());
+			organizationContactBookMapper.insertSelective(contactBook);
+		}
 		if (isSubmit==1) {
 			t.setOrderStatus(OrderNewState.QDDS.getCode());
 			t.setProcessStatus(ProcessStatus.YPYXGLY.getCode());
 			
 		}
-		TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
 		if (t2.getApproval()==ApprovalNewState.BH.getCode()||
 				t2.getOrderStatus()==OrderNewState.QDSHJJ.getCode()||
 					t2.getOrderStatus()==OrderNewState.YBH.getCode()) {
@@ -370,7 +377,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		t.setResult("");
 		TOrderNew tOrder=new TOrderNew(); 
 		tOrder.setOrderNo(t.getOrderNo());
-		//tOrder.setOrderStatus(OrderNewState.YTD.getCode());
+		tOrder.setOrderStatus(OrderNewState.TDZ.getCode());
 		tOrderNewMapper.updateByPrimaryKeySelective(tOrder);
 		return tOrderRefundMapper.insertSelective(t);
 	}
@@ -465,7 +472,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		TOrderNew tOrder= tOrderNewMapper.selectByPrimaryKey(orderNo);
 		if (tOrder.getSettlementAmount()==null||
 				tOrder.getSettlementAmount().doubleValue()==0||
-					tOrder.getOrderStatus()==OrderNewState.YTD.getCode()){
+					tOrder.getOrderStatus()==OrderNewState.TDZ.getCode()){
 				return true;
 		}
 		return false;
@@ -581,7 +588,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		 tOrderDunMapper.updateByPrimaryKeySelective(tDun);
 	}
 
-
 	public void addNotic(String orderNo,Integer type,AdminListBo a,TOrderNewBo b) {
 		LoggerUtils.debug(logger, "======================站内消息发送启动===================");
 		 String id="1";
@@ -596,7 +602,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		n.setReaded(0);//未读
 		noticeMapper.insertSelective(n);
 	}
-	
 	public void  sendEmail(String orderNo,String dunId,AdminListBo a,TOrderNewBo b) throws UnsupportedEncodingException, MessagingException{
 		LoggerUtils.debug(logger, "======================邮件信息发送===================");
 		String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + orderNo + "</div>";
@@ -630,5 +635,4 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		 addNotic(type==NoticeStatus.ORDER_DUN.getCode()?t.getOrderNo():orderNo,type,a, b);
 	}
 	
-	
 }

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

@@ -20,14 +20,18 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import com.goafanti.common.dao.OrganizationContactBookMapper;
 import com.goafanti.common.dao.TOrderBonusMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
 import com.goafanti.common.dao.TOrderTaskMapper;
 import com.goafanti.common.dao.TTaskHoursMapper;
+import com.goafanti.common.dao.TTaskLogMapper;
+import com.goafanti.common.model.OrganizationContactBook;
 import com.goafanti.common.model.TOrderBonus;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.common.model.TOrderTask;
 import com.goafanti.common.model.TTaskHours;
+import com.goafanti.common.model.TTaskLog;
 import com.goafanti.common.utils.ExportExcelUtil;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -49,6 +53,10 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	private TTaskHoursMapper	tTaskHoursMapper;
 	@Autowired
 	private TOrderBonusMapper 	tOrderBonusMapper;
+	@Autowired
+	private TTaskLogMapper	tTaskLogMapper;
+	@Autowired
+	private OrganizationContactBookMapper	organizationContactBookMapper;
 	@Value(value = "${upload.path}")
 	private String 					uploadPath 			= null;
 	
@@ -57,9 +65,11 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 	public int updateProjectDistribution(Integer taskId, String taskReceiverId,Integer specially) {
 		TOrderTask t=tOrderTaskMapper.selectByPrimaryKey(taskId);
 		t.setTaskStatus(TaskState.DISTRIBUTION.getCode());
+		t.setTaskAllocator(TokenManager.getAdminId());
 		t.setTaskReceiver(taskReceiverId);
 		t.setTaskDistributionTime(new Date());
 		tOrderTaskMapper.updateByPrimaryKeySelective(t);
+		insetLog(taskId, taskReceiverId);
 		if (specially==0&&t.getCommodityQuantity()>1) {
 			for (int i = 0; i < t.getCommodityQuantity(); i++) {
 				TOrderTask tOrderTask=new TOrderTask();
@@ -94,6 +104,15 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		return 1;
 	}
 
+	private void insetLog(Integer taskId, String taskReceiverId) {
+		TTaskLog tl=new TTaskLog();
+		tl.setCreateTime(new Date());
+		tl.setTaskId(taskId);
+		tl.setTaskAllocator(TokenManager.getAdminId());
+		tl.setTaskReceiver(taskReceiverId);
+		tTaskLogMapper.insertSelective(tl);
+	}
+
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TOrderTaskListBo> orderTaskList(String name, String orderNo, String taskId, Integer taskStatus,
@@ -101,9 +120,7 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		Map<String, Object> params = new HashMap<String, Object>();
 		if(pageSize==null||pageSize<0)pageSize=10;
 		if(pageNo==null||pageNo<0)pageNo=1;
-		if (specially!=null&&(specially==0||specially==2)) {
-			params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
-		}
+		params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
 		if (null!=specially) params.put("specially", specially);
 		if (StringUtils.isNotBlank(name)) params.put("name", name);
 		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
@@ -128,13 +145,22 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		task.setTaskStatus(t.getTaskStatus());
 		task.setProjectStatus(t.getProjectStatus());
 		task.setTaskComment(t.getTaskComment());
-		TOrderNew tn=new TOrderNew(); 
-		tn.setOrderNo(t.getOrderNo());
-		tn.setContacts(t.getContacts());
-		tn.setContactMobile(t.getContacts());
-		tn.setLegalPerson(t.getLegalPerson());
-		tn.setLegalPersonTel(t.getLegalPersonTel());
+		TOrderNew tn=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo()); 
+		if(StringUtils.isNotEmpty(t.getContacts()))tn.setContacts(t.getContacts());
+		if(StringUtils.isNotEmpty(t.getContacts()))	tn.setContactMobile(t.getContactMobile());
+		if(StringUtils.isNotEmpty(t.getContacts()))tn.setLegalPerson(t.getLegalPerson());
+		if(StringUtils.isNotEmpty(t.getContacts()))tn.setLegalPersonTel(t.getLegalPersonTel());
 		tOrderNewMapper.updateByPrimaryKeySelective(tn);
+		int adcount=organizationContactBookMapper.checkContacts(tn.getBuyerId(), t.getContactMobile(),tn.getSalesmanId());
+		if (StringUtils.isNotBlank(t.getContacts())&&StringUtils.isNotBlank(t.getContactMobile())&&adcount<1) {
+			OrganizationContactBook contactBook=new OrganizationContactBook();
+			contactBook.setId(UUID.randomUUID().toString());
+			contactBook.setAid(tn.getSalesmanId());
+			contactBook.setUid(tn.getBuyerId());
+			contactBook.setName(t.getContacts());
+			contactBook.setMobile(t.getContactMobile());
+			organizationContactBookMapper.insertSelective(contactBook);
+		}
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 		try {
 			if(StringUtils.isNotBlank(t.getStartDate()))task.setTaskStartTime(sdf.parse(t.getStartDate()));
@@ -167,15 +193,19 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 			tNew.setOrderNo(task.getOrderNo());
 			tOrderNewMapper.updateByPrimaryKeySelective(tNew);
 			//新增奖金信息
-			TOrderBonus tb=new TOrderBonus();
-			tb.setId(UUID.randomUUID().toString());
-			tb.setOrderNo(task.getOrderNo());
-			if (task.getProjectStatus()==ProjectNewStage.YTJ.getCode())tb.setBonusSubject(21);//项目已提交
-			if (task.getProjectStatus()==ProjectNewStage.LS.getCode())tb.setBonusSubject(23);//项目立项
-			if (task.getProjectStatus()==ProjectNewStage.GS.getCode())tb.setBonusSubject(24);//项目公示
-			tb.setGrantTarget(task.getTaskReceiver());
-			tb.setGrantType(1);//技术员
-			tOrderBonusMapper.insertSelective(tb);
+			if (task.getProjectStatus()==ProjectNewStage.YTJ.getCode()||task.getProjectStatus()==ProjectNewStage.LS.getCode()||
+					task.getProjectStatus()==ProjectNewStage.GS.getCode()) {
+				TOrderBonus tb=new TOrderBonus();
+				tb.setId(UUID.randomUUID().toString());
+				tb.setOrderNo(task.getOrderNo());
+				if (task.getProjectStatus()==ProjectNewStage.YTJ.getCode())tb.setBonusSubject(21);//项目已提交
+				if (task.getProjectStatus()==ProjectNewStage.LS.getCode())tb.setBonusSubject(23);//项目立项
+				if (task.getProjectStatus()==ProjectNewStage.GS.getCode())tb.setBonusSubject(24);//项目公示
+				tb.setGrantTarget(task.getTaskReceiver());
+				tb.setGrantType(1);//技术员
+				tOrderBonusMapper.insertSelective(tb);
+				
+			}
 		}
 	}
 
@@ -221,6 +251,23 @@ public class OrderProjectServiceImpl extends BaseMybatisDao<TOrderTaskMapper> im
 		XSSFWorkbook wb = ExportExcelUtil.exportTaskHoursListData(list, comment, filePath);
 		return wb;
 	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<TOrderTaskListBo> selectTaskList(String name, String orderNo, String taskId, Integer taskStatus,
+			String adminName, Integer specially, Integer pageNo, Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(pageSize==null||pageSize<0)pageSize=10;
+		if(pageNo==null||pageNo<0)pageNo=1;
+		params.put("aid", TokenManager.getAdminId()==null?"e82a4405-2104-481d-ba5f-72a639589efd":TokenManager.getAdminId());
+		if (StringUtils.isNotBlank(name)) params.put("name", name);
+		if (StringUtils.isNotBlank(orderNo)) params.put("orderNo", orderNo);
+		if (StringUtils.isNotBlank(taskId)) params.put("taskId", taskId);
+		if (StringUtils.isNotBlank(adminName)) params.put("adminName", adminName);
+		if (null != taskStatus) params.put("taskStatus", taskStatus);
+		Pagination<TOrderTaskListBo> p = (Pagination<TOrderTaskListBo>)findPage("selectTaskListByPage", "selectTaskListCount", params, pageNo, pageSize);
+		return p;
+	}
 	
 	
 }