Browse Source

订单管理

wanghui 8 years ago
parent
commit
8c44d8dba8
22 changed files with 2042 additions and 1684 deletions
  1. 1 1
      GeneratorConfig.xml
  2. 0 95
      src/main/java/com/goafanti/common/dao/ContractDetailMapper.java
  3. 2 2
      src/main/java/com/goafanti/common/dao/ContractMapper.java
  4. 120 0
      src/main/java/com/goafanti/common/dao/ContractTaskMapper.java
  5. 3 0
      src/main/java/com/goafanti/common/dao/TechProjectMapper.java
  6. 2 2
      src/main/java/com/goafanti/common/mapper/ContractMapper.xml
  7. 46 46
      src/main/java/com/goafanti/common/mapper/ContractDetailMapper.xml
  8. 5 1
      src/main/java/com/goafanti/common/mapper/TOrderMapper.xml
  9. 23 0
      src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml
  10. 0 329
      src/main/java/com/goafanti/common/model/ContractDetail.java
  11. 0 1122
      src/main/java/com/goafanti/common/model/ContractDetailExample.java
  12. 467 0
      src/main/java/com/goafanti/common/model/ContractTask.java
  13. 1163 0
      src/main/java/com/goafanti/common/model/ContractTaskExample.java
  14. 16 0
      src/main/java/com/goafanti/order/bo/OrderListBo.java
  15. 32 0
      src/main/java/com/goafanti/order/bo/ServiceOrderDetailBo.java
  16. 36 79
      src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java
  17. 19 2
      src/main/java/com/goafanti/techproject/bo/ProjectDetailBo.java
  18. 16 2
      src/main/java/com/goafanti/techproject/bo/ProjectListBo.java
  19. 5 0
      src/main/java/com/goafanti/techproject/bo/TaskListBo.java
  20. 27 0
      src/main/java/com/goafanti/techproject/controller/AdminTechProjectApiController.java
  21. 8 0
      src/main/java/com/goafanti/techproject/service/TechProjectService.java
  22. 51 3
      src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

+ 1 - 1
GeneratorConfig.xml

@@ -10,7 +10,7 @@
     <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="contract"/>
+    <table schema="aft" tableName="contract_task"/>
     
   </context>
 </generatorConfiguration>

+ 0 - 95
src/main/java/com/goafanti/common/dao/ContractDetailMapper.java

@@ -1,95 +0,0 @@
-package com.goafanti.common.dao;
-
-import com.goafanti.common.model.ContractDetail;
-import com.goafanti.common.model.ContractDetailExample;
-import java.util.List;
-import org.apache.ibatis.annotations.Param;
-
-public interface ContractDetailMapper {
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	long countByExample(ContractDetailExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int deleteByExample(ContractDetailExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int deleteByPrimaryKey(String id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int insert(ContractDetail record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int insertSelective(ContractDetail record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	List<ContractDetail> selectByExampleWithBLOBs(ContractDetailExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	List<ContractDetail> selectByExample(ContractDetailExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	ContractDetail selectByPrimaryKey(String id);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int updateByExampleSelective(@Param("record") ContractDetail record,
-			@Param("example") ContractDetailExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int updateByExampleWithBLOBs(@Param("record") ContractDetail record,
-			@Param("example") ContractDetailExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int updateByExample(@Param("record") ContractDetail record, @Param("example") ContractDetailExample example);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int updateByPrimaryKeySelective(ContractDetail record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int updateByPrimaryKeyWithBLOBs(ContractDetail record);
-
-	/**
-	 * This method was generated by MyBatis Generator. This method corresponds to the database table contract_detail
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	int updateByPrimaryKey(ContractDetail record);
-}

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

@@ -5,9 +5,9 @@ import java.util.List;
 import org.apache.ibatis.annotations.Param;
 
 import com.goafanti.common.model.Contract;
-import com.goafanti.common.model.ContractDetail;
 import com.goafanti.contract.bo.ContractSerialNumber;
 import com.goafanti.common.model.ContractExample;
+import com.goafanti.common.model.ContractTask;
 
 public interface ContractMapper {
     /**
@@ -90,5 +90,5 @@ public interface ContractMapper {
 	 * 批量插入和同明细
 	 * @param contractDetailList
 	 */
-	void batchInsertContractDetail(List<ContractDetail> list);
+	void batchInsertContractTask(List<ContractTask> list);
 }

+ 120 - 0
src/main/java/com/goafanti/common/dao/ContractTaskMapper.java

@@ -0,0 +1,120 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.ContractTask;
+import com.goafanti.common.model.ContractTaskExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface ContractTaskMapper {
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    long countByExample(ContractTaskExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int deleteByExample(ContractTaskExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int deleteByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int insert(ContractTask record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int insertSelective(ContractTask record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    List<ContractTask> selectByExampleWithBLOBs(ContractTaskExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    List<ContractTask> selectByExample(ContractTaskExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    ContractTask selectByPrimaryKey(String id);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int updateByExampleSelective(@Param("record") ContractTask record, @Param("example") ContractTaskExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int updateByExampleWithBLOBs(@Param("record") ContractTask record, @Param("example") ContractTaskExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int updateByExample(@Param("record") ContractTask record, @Param("example") ContractTaskExample example);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int updateByPrimaryKeySelective(ContractTask record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int updateByPrimaryKeyWithBLOBs(ContractTask record);
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method corresponds to the database table contract_task
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    int updateByPrimaryKey(ContractTask record);
+}

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

@@ -4,6 +4,7 @@ import java.util.List;
 
 import org.apache.ibatis.annotations.Param;
 
+import com.goafanti.app.bo.ProjectDetailBo;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.techproject.bo.TechProjectContractListBo;
 import com.goafanti.techproject.bo.TechProjectDetailBo;
@@ -39,4 +40,6 @@ public interface TechProjectMapper {
 	Integer findTechProjectNumByUid(String uid);
 
 	int batchDeleteByContractId(List<String> id);
+
+	ProjectDetailBo selectTechProjectDetail(String contractId);
 }

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

@@ -720,10 +720,10 @@
 	   	)
 	and uid = #{uid,jdbcType=VARCHAR} and deleted_sign = 0
   </select>
-  <insert id="batchInsert" parameterMap="BaseResultMap">
+  <insert id="batchInsertContractTask" parameterMap="BaseResultMap">
   insert
 	into
-		contract_detail(
+		contract_task(
 			id,
 			contract_id,
 			commodity_id,

+ 46 - 46
src/main/java/com/goafanti/common/mapper/ContractDetailMapper.xml

@@ -1,11 +1,11 @@
 <?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.ContractDetailMapper">
-  <resultMap id="BaseResultMap" type="com.goafanti.common.model.ContractDetail">
+<mapper namespace="com.goafanti.common.dao.ContractTaskMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.ContractTask">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="contract_id" jdbcType="VARCHAR" property="contractId" />
@@ -21,11 +21,11 @@
     <result column="task_allocator" jdbcType="VARCHAR" property="taskAllocator" />
     <result column="task_receiver" jdbcType="VARCHAR" property="taskReceiver" />
   </resultMap>
-  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.ContractDetail">
+  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.goafanti.common.model.ContractTask">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     <result column="attachment_url" jdbcType="LONGVARCHAR" property="attachmentUrl" />
   </resultMap>
@@ -33,7 +33,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -67,7 +67,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -101,7 +101,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     id, contract_id, commodity_id, commodity_name, commodity_quantity, commodity_type, 
     commodity_mode, create_time, task_comment, task_status, task_distribution_time, task_allocator, 
@@ -111,15 +111,15 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     attachment_url
   </sql>
-  <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.ContractDetailExample" resultMap="ResultMapWithBLOBs">
+  <select id="selectByExampleWithBLOBs" parameterType="com.goafanti.common.model.ContractTaskExample" resultMap="ResultMapWithBLOBs">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     select
     <if test="distinct">
@@ -128,7 +128,7 @@
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
-    from contract_detail
+    from contract_task
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -136,18 +136,18 @@
       order by ${orderByClause}
     </if>
   </select>
-  <select id="selectByExample" parameterType="com.goafanti.common.model.ContractDetailExample" resultMap="BaseResultMap">
+  <select id="selectByExample" parameterType="com.goafanti.common.model.ContractTaskExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     select
     <if test="distinct">
       distinct
     </if>
     <include refid="Base_Column_List" />
-    from contract_detail
+    from contract_task
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -159,42 +159,42 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
     select 
     <include refid="Base_Column_List" />
     ,
     <include refid="Blob_Column_List" />
-    from contract_detail
+    from contract_task
     where id = #{id,jdbcType=VARCHAR}
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    delete from contract_detail
+    delete from contract_task
     where id = #{id,jdbcType=VARCHAR}
   </delete>
-  <delete id="deleteByExample" parameterType="com.goafanti.common.model.ContractDetailExample">
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.ContractTaskExample">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    delete from contract_detail
+    delete from contract_task
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
   </delete>
-  <insert id="insert" parameterType="com.goafanti.common.model.ContractDetail">
+  <insert id="insert" parameterType="com.goafanti.common.model.ContractTask">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    insert into contract_detail (id, contract_id, commodity_id, 
+    insert into contract_task (id, contract_id, commodity_id, 
       commodity_name, commodity_quantity, commodity_type, 
       commodity_mode, create_time, task_comment, 
       task_status, task_distribution_time, task_allocator, 
@@ -205,13 +205,13 @@
       #{taskStatus,jdbcType=INTEGER}, #{taskDistributionTime,jdbcType=TIMESTAMP}, #{taskAllocator,jdbcType=VARCHAR}, 
       #{taskReceiver,jdbcType=VARCHAR}, #{attachmentUrl,jdbcType=LONGVARCHAR})
   </insert>
-  <insert id="insertSelective" parameterType="com.goafanti.common.model.ContractDetail">
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.ContractTask">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    insert into contract_detail
+    insert into contract_task
     <trim prefix="(" suffix=")" suffixOverrides=",">
       <if test="id != null">
         id,
@@ -301,13 +301,13 @@
       </if>
     </trim>
   </insert>
-  <select id="countByExample" parameterType="com.goafanti.common.model.ContractDetailExample" resultType="java.lang.Long">
+  <select id="countByExample" parameterType="com.goafanti.common.model.ContractTaskExample" resultType="java.lang.Long">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    select count(*) from contract_detail
+    select count(*) from contract_task
     <if test="_parameter != null">
       <include refid="Example_Where_Clause" />
     </if>
@@ -316,9 +316,9 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    update contract_detail
+    update contract_task
     <set>
       <if test="record.id != null">
         id = #{record.id,jdbcType=VARCHAR},
@@ -371,9 +371,9 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    update contract_detail
+    update contract_task
     set id = #{record.id,jdbcType=VARCHAR},
       contract_id = #{record.contractId,jdbcType=VARCHAR},
       commodity_id = #{record.commodityId,jdbcType=VARCHAR},
@@ -396,9 +396,9 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    update contract_detail
+    update contract_task
     set id = #{record.id,jdbcType=VARCHAR},
       contract_id = #{record.contractId,jdbcType=VARCHAR},
       commodity_id = #{record.commodityId,jdbcType=VARCHAR},
@@ -416,13 +416,13 @@
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
-  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ContractDetail">
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.ContractTask">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    update contract_detail
+    update contract_task
     <set>
       <if test="contractId != null">
         contract_id = #{contractId,jdbcType=VARCHAR},
@@ -466,13 +466,13 @@
     </set>
     where id = #{id,jdbcType=VARCHAR}
   </update>
-  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.ContractDetail">
+  <update id="updateByPrimaryKeyWithBLOBs" parameterType="com.goafanti.common.model.ContractTask">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    update contract_detail
+    update contract_task
     set contract_id = #{contractId,jdbcType=VARCHAR},
       commodity_id = #{commodityId,jdbcType=VARCHAR},
       commodity_name = #{commodityName,jdbcType=VARCHAR},
@@ -488,13 +488,13 @@
       attachment_url = #{attachmentUrl,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=VARCHAR}
   </update>
-  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ContractDetail">
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.ContractTask">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Thu Jan 25 20:08:49 CST 2018.
+      This element was generated on Fri Jan 26 16:01:38 CST 2018.
     -->
-    update contract_detail
+    update contract_task
     set contract_id = #{contractId,jdbcType=VARCHAR},
       commodity_id = #{commodityId,jdbcType=VARCHAR},
       commodity_name = #{commodityName,jdbcType=VARCHAR},

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

@@ -1141,10 +1141,14 @@
 			a.order_remarks as orderRemarks,
 			a.order_channel as orderChannel,
 			a.contract_picture_url as contractPictureUrl,
+			a.buyer_id as buyerId,
 			b.nickname as buyerName,
 			c.name as salesmanName,
+			a.finance_id as financeName,
 			d.name as financeName,
-			e.name as technicianName
+			a.technician_id as technicianId,
+			e.name as technicianName,
+			a.delete_sign as deleteSign
 		from
 			t_order a left join user b on
 			a.buyer_id = b.id left join admin c on

+ 23 - 0
src/main/java/com/goafanti/common/mapper/TechProjectMapper.xml

@@ -654,4 +654,27 @@
 		and c.create_time &lt; #{orderEndDate,jdbcType=TIMESTAMP}
 	</if>
   </select>
+  
+  <select id="selectTechProjectDetail" resultType="com.goafanti.techproject.bo.ProjectDetailBo">
+  	select
+		a.id,
+		a.serial_number as serialNumber,
+		a.sign_date as signDate,
+		a.sign_comment as signComment,
+		a.complete_date as completeDate,
+		a.complete_comment as completeComment,
+		a.uid,
+		a.status as projectStatus,
+		a.deleted_sign as deleteSign,
+		a.order_no as orderNo,
+		a.type as projectType,
+		b.nickname as buyerName,
+		d.name as salesmanName
+	from
+		contract a left join user b on
+		a.uid = b.id left join t_order c on
+		a.order_no = c.order_no left join admin d on
+		c.salesman_id = d.id
+	where a.id = #{contractId,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 0 - 329
src/main/java/com/goafanti/common/model/ContractDetail.java

@@ -1,329 +0,0 @@
-package com.goafanti.common.model;
-
-import java.util.Date;
-
-public class ContractDetail {
-
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String id;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.contract_id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String contractId;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.commodity_id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String commodityId;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.commodity_name
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String commodityName;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.commodity_quantity
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private Integer commodityQuantity;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.commodity_type
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private Integer commodityType;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.commodity_mode
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String commodityMode;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.create_time
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private Date createTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.task_comment
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String taskComment;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.task_status
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private Integer taskStatus;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.task_distribution_time
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private Date taskDistributionTime;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.task_allocator
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String taskAllocator;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.task_receiver
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String taskReceiver;
-	/**
-	 * This field was generated by MyBatis Generator. This field corresponds to the database column contract_detail.attachment_url
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	private String attachmentUrl;
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.id
-	 * @return  the value of contract_detail.id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getId() {
-		return id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.id
-	 * @param id  the value for contract_detail.id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setId(String id) {
-		this.id = id;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.contract_id
-	 * @return  the value of contract_detail.contract_id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getContractId() {
-		return contractId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.contract_id
-	 * @param contractId  the value for contract_detail.contract_id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setContractId(String contractId) {
-		this.contractId = contractId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.commodity_id
-	 * @return  the value of contract_detail.commodity_id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getCommodityId() {
-		return commodityId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.commodity_id
-	 * @param commodityId  the value for contract_detail.commodity_id
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setCommodityId(String commodityId) {
-		this.commodityId = commodityId;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.commodity_name
-	 * @return  the value of contract_detail.commodity_name
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getCommodityName() {
-		return commodityName;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.commodity_name
-	 * @param commodityName  the value for contract_detail.commodity_name
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setCommodityName(String commodityName) {
-		this.commodityName = commodityName;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.commodity_quantity
-	 * @return  the value of contract_detail.commodity_quantity
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public Integer getCommodityQuantity() {
-		return commodityQuantity;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.commodity_quantity
-	 * @param commodityQuantity  the value for contract_detail.commodity_quantity
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setCommodityQuantity(Integer commodityQuantity) {
-		this.commodityQuantity = commodityQuantity;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.commodity_type
-	 * @return  the value of contract_detail.commodity_type
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public Integer getCommodityType() {
-		return commodityType;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.commodity_type
-	 * @param commodityType  the value for contract_detail.commodity_type
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setCommodityType(Integer commodityType) {
-		this.commodityType = commodityType;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.commodity_mode
-	 * @return  the value of contract_detail.commodity_mode
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getCommodityMode() {
-		return commodityMode;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.commodity_mode
-	 * @param commodityMode  the value for contract_detail.commodity_mode
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setCommodityMode(String commodityMode) {
-		this.commodityMode = commodityMode;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.create_time
-	 * @return  the value of contract_detail.create_time
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public Date getCreateTime() {
-		return createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.create_time
-	 * @param createTime  the value for contract_detail.create_time
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setCreateTime(Date createTime) {
-		this.createTime = createTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.task_comment
-	 * @return  the value of contract_detail.task_comment
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getTaskComment() {
-		return taskComment;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.task_comment
-	 * @param taskComment  the value for contract_detail.task_comment
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setTaskComment(String taskComment) {
-		this.taskComment = taskComment;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.task_status
-	 * @return  the value of contract_detail.task_status
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public Integer getTaskStatus() {
-		return taskStatus;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.task_status
-	 * @param taskStatus  the value for contract_detail.task_status
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setTaskStatus(Integer taskStatus) {
-		this.taskStatus = taskStatus;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.task_distribution_time
-	 * @return  the value of contract_detail.task_distribution_time
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public Date getTaskDistributionTime() {
-		return taskDistributionTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.task_distribution_time
-	 * @param taskDistributionTime  the value for contract_detail.task_distribution_time
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setTaskDistributionTime(Date taskDistributionTime) {
-		this.taskDistributionTime = taskDistributionTime;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method returns the value of the database column contract_detail.task_allocator
-	 * @return  the value of contract_detail.task_allocator
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getTaskAllocator() {
-		return taskAllocator;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.task_allocator
-	 * @param taskAllocator  the value for contract_detail.task_allocator
-	 * @mbg.generated  Thu Jan 25 20:08:49 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 contract_detail.task_receiver
-	 * @return  the value of contract_detail.task_receiver
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getTaskReceiver() {
-		return taskReceiver;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.task_receiver
-	 * @param taskReceiver  the value for contract_detail.task_receiver
-	 * @mbg.generated  Thu Jan 25 20:08:49 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 contract_detail.attachment_url
-	 * @return  the value of contract_detail.attachment_url
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public String getAttachmentUrl() {
-		return attachmentUrl;
-	}
-
-	/**
-	 * This method was generated by MyBatis Generator. This method sets the value of the database column contract_detail.attachment_url
-	 * @param attachmentUrl  the value for contract_detail.attachment_url
-	 * @mbg.generated  Thu Jan 25 20:08:49 CST 2018
-	 */
-	public void setAttachmentUrl(String attachmentUrl) {
-		this.attachmentUrl = attachmentUrl;
-	}
-}

File diff suppressed because it is too large
+ 0 - 1122
src/main/java/com/goafanti/common/model/ContractDetailExample.java


+ 467 - 0
src/main/java/com/goafanti/common/model/ContractTask.java

@@ -0,0 +1,467 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class ContractTask {
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String id;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.contract_id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String contractId;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.commodity_id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String commodityId;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.commodity_name
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String commodityName;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.commodity_quantity
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private Integer commodityQuantity;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.commodity_type
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private Integer commodityType;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.commodity_mode
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String commodityMode;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.create_time
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private Date createTime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.task_comment
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String taskComment;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.task_status
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private Integer taskStatus;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.task_distribution_time
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private Date taskDistributionTime;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.task_allocator
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String taskAllocator;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.task_receiver
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String taskReceiver;
+
+    /**
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column contract_task.attachment_url
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    private String attachmentUrl;
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.id
+     *
+     * @return the value of contract_task.id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getId() {
+        return id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.id
+     *
+     * @param id the value for contract_task.id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.contract_id
+     *
+     * @return the value of contract_task.contract_id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getContractId() {
+        return contractId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.contract_id
+     *
+     * @param contractId the value for contract_task.contract_id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setContractId(String contractId) {
+        this.contractId = contractId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.commodity_id
+     *
+     * @return the value of contract_task.commodity_id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getCommodityId() {
+        return commodityId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.commodity_id
+     *
+     * @param commodityId the value for contract_task.commodity_id
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setCommodityId(String commodityId) {
+        this.commodityId = commodityId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.commodity_name
+     *
+     * @return the value of contract_task.commodity_name
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getCommodityName() {
+        return commodityName;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.commodity_name
+     *
+     * @param commodityName the value for contract_task.commodity_name
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setCommodityName(String commodityName) {
+        this.commodityName = commodityName;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.commodity_quantity
+     *
+     * @return the value of contract_task.commodity_quantity
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public Integer getCommodityQuantity() {
+        return commodityQuantity;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.commodity_quantity
+     *
+     * @param commodityQuantity the value for contract_task.commodity_quantity
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setCommodityQuantity(Integer commodityQuantity) {
+        this.commodityQuantity = commodityQuantity;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.commodity_type
+     *
+     * @return the value of contract_task.commodity_type
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public Integer getCommodityType() {
+        return commodityType;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.commodity_type
+     *
+     * @param commodityType the value for contract_task.commodity_type
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setCommodityType(Integer commodityType) {
+        this.commodityType = commodityType;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.commodity_mode
+     *
+     * @return the value of contract_task.commodity_mode
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getCommodityMode() {
+        return commodityMode;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.commodity_mode
+     *
+     * @param commodityMode the value for contract_task.commodity_mode
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setCommodityMode(String commodityMode) {
+        this.commodityMode = commodityMode;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.create_time
+     *
+     * @return the value of contract_task.create_time
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.create_time
+     *
+     * @param createTime the value for contract_task.create_time
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.task_comment
+     *
+     * @return the value of contract_task.task_comment
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getTaskComment() {
+        return taskComment;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.task_comment
+     *
+     * @param taskComment the value for contract_task.task_comment
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setTaskComment(String taskComment) {
+        this.taskComment = taskComment;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.task_status
+     *
+     * @return the value of contract_task.task_status
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public Integer getTaskStatus() {
+        return taskStatus;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.task_status
+     *
+     * @param taskStatus the value for contract_task.task_status
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setTaskStatus(Integer taskStatus) {
+        this.taskStatus = taskStatus;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.task_distribution_time
+     *
+     * @return the value of contract_task.task_distribution_time
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public Date getTaskDistributionTime() {
+        return taskDistributionTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.task_distribution_time
+     *
+     * @param taskDistributionTime the value for contract_task.task_distribution_time
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setTaskDistributionTime(Date taskDistributionTime) {
+        this.taskDistributionTime = taskDistributionTime;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column contract_task.task_allocator
+     *
+     * @return the value of contract_task.task_allocator
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getTaskAllocator() {
+        return taskAllocator;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.task_allocator
+     *
+     * @param taskAllocator the value for contract_task.task_allocator
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 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 contract_task.task_receiver
+     *
+     * @return the value of contract_task.task_receiver
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getTaskReceiver() {
+        return taskReceiver;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.task_receiver
+     *
+     * @param taskReceiver the value for contract_task.task_receiver
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 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 contract_task.attachment_url
+     *
+     * @return the value of contract_task.attachment_url
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public String getAttachmentUrl() {
+        return attachmentUrl;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column contract_task.attachment_url
+     *
+     * @param attachmentUrl the value for contract_task.attachment_url
+     *
+     * @mbg.generated Fri Jan 26 16:01:38 CST 2018
+     */
+    public void setAttachmentUrl(String attachmentUrl) {
+        this.attachmentUrl = attachmentUrl;
+    }
+}

File diff suppressed because it is too large
+ 1163 - 0
src/main/java/com/goafanti/common/model/ContractTaskExample.java


+ 16 - 0
src/main/java/com/goafanti/order/bo/OrderListBo.java

@@ -8,6 +8,8 @@ package com.goafanti.order.bo;
 public class OrderListBo {
 	/** 订单编号 **/
 	private String orderNo;
+	/** 订单类型 **/
+	private Integer orderType;
 	/** 订单创建时间 **/
 	private String createTime;
 	/** 合同首付金额 **/
@@ -36,12 +38,20 @@ public class OrderListBo {
 	private String departmentName;
 	/** 项目状态 **/
 	private Integer projectStage;
+	/** 删除、锁定 状态 **/
+	private Integer deleteSign;
 	public String getOrderNo() {
 		return orderNo;
 	}
 	public void setOrderNo(String orderNo) {
 		this.orderNo = orderNo;
 	}
+	public Integer getOrderType() {
+		return orderType;
+	}
+	public void setOrderType(Integer orderType) {
+		this.orderType = orderType;
+	}
 	public String getCreateTime() {
 		return createTime;
 	}
@@ -126,4 +136,10 @@ public class OrderListBo {
 	public void setProjectStage(Integer projectStage) {
 		this.projectStage = projectStage;
 	}
+	public Integer getDeleteSign() {
+		return deleteSign;
+	}
+	public void setDeleteSign(Integer deleteSign) {
+		this.deleteSign = deleteSign;
+	}
 }

+ 32 - 0
src/main/java/com/goafanti/order/bo/ServiceOrderDetailBo.java

@@ -15,6 +15,14 @@ public class ServiceOrderDetailBo extends OrderListBo{
 	private String orderRemarks;
 	/** 图片地址 **/
 	private String contractPictureUrl;
+	/** 买家 id **/
+	private String buyerId;
+	/** 订单负责人 **/
+	private String salesmanId;
+	/** 财务负责人 **/
+	private String financeId;
+	/** 技术人员 **/
+	private String technicianId;
 	/** 可操作内容 **/
 	private OperatorActive operatorActive;
 	public String getSignTime() {
@@ -59,6 +67,30 @@ public class ServiceOrderDetailBo extends OrderListBo{
 	public void setContractPictureUrl(String contractPictureUrl) {
 		this.contractPictureUrl = contractPictureUrl;
 	}
+	public String getBuyerId() {
+		return buyerId;
+	}
+	public void setBuyerId(String buyerId) {
+		this.buyerId = buyerId;
+	}
+	public String getSalesmanId() {
+		return salesmanId;
+	}
+	public void setSalesmanId(String salesmanId) {
+		this.salesmanId = salesmanId;
+	}
+	public String getFinanceId() {
+		return financeId;
+	}
+	public void setFinanceId(String financeId) {
+		this.financeId = financeId;
+	}
+	public String getTechnicianId() {
+		return technicianId;
+	}
+	public void setTechnicianId(String technicianId) {
+		this.technicianId = technicianId;
+	}
 	public OperatorActive getOperatorActive() {
 		return operatorActive;
 	}

+ 36 - 79
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -27,7 +27,7 @@ import com.goafanti.common.dao.TOrderMapper;
 import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Contract;
-import com.goafanti.common.model.ContractDetail;
+import com.goafanti.common.model.ContractTask;
 import com.goafanti.common.model.OrganizationManagement;
 import com.goafanti.common.model.TOrder;
 import com.goafanti.common.model.TOrderBill;
@@ -183,8 +183,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			tOrder.setActuallyBrokerageAmount(new BigDecimal(0));
 			tOrder.setActuallyWithdrawAmount(new BigDecimal(0));
 		}else if(orderAction == OrderAction.CONFIRM_INTENTION){ //确认意向订单 (用户确认)
-			if(tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()
-					&& tOrder.getOrderStage() == OrderStage.INTENTION.getCode()){
+			if(tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()){
 				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"确认意向订单"));
 			}
 			if (confrim) {
@@ -195,8 +194,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			}
 		}else if(orderAction == OrderAction.CONFIRM_PAY_FOR_FIRST){ // 支付首付(审核流水)
 			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()
-					|| tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
-					|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()){
+					|| tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()){
 				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,""));
 			}
 			int boundary = tOrder.getActuallyFirstPayment().add(changeAmount).compareTo(tOrder.getFirstPayment());
@@ -209,11 +207,11 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				tOrder.setActuallyTotalAmount(tOrder.getActuallyTotalAmount().add(changeAmount));
 				tOrder.setActuallyFirstPayment(tOrder.getActuallyFirstPayment().add(changeAmount));
 				tOrder.setLiquidationStatus(LiquidationState.WAIT_PAY_LAST_BALANCE.getCode());
+				tOrder.setProjectStage(ProjectStage.WAIT_SET_UP.getCode());
 			}
 		}else if(orderAction == OrderAction.CONFIRM_PAY_FOR_LAST){ //支付尾款 (审核流水)
 			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()
-					|| tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
-					|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()){
+					|| tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()){
 				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"支付尾款"));
 			}
 			int boundary = tOrder.getActuallyTotalAmount().add(changeAmount).compareTo(tOrder.getOrderAmount());
@@ -247,10 +245,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					|| tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
 				flag = false;
 			}
-			if(tOrder.getOrderStage() != OrderStage.INTENTION.getCode()
-				|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()){
-				flag = false;
-			}
 			if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
 					&& tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
 					&& tOrder.getLiquidationStatus() != LiquidationState.ALREADY_PAY.getCode()){
@@ -285,8 +279,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 				flag = false;
 			}
-			if(tOrder.getOrderStage() == OrderStage.INTENTION.getCode()) 
-				flag = false;
 			if(tOrder.getLiquidationStatus() == LiquidationState.WAIT_FOR_REFUND_CONFIRM.getCode()
 					|| tOrder.getLiquidationStatus() == LiquidationState.REFUSE_REFUND.getCode()
 					|| tOrder.getLiquidationStatus() == LiquidationState.AGREE_REFUND.getCode()
@@ -305,8 +297,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 				flag = false;
 			}
-			if(tOrder.getOrderStage() == OrderStage.INTENTION.getCode())
-				flag = false;
 			if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_FOR_REFUND_CONFIRM.getCode())
 				flag = false;
 			if(tOrder.getActuallyTotalAmount().doubleValue() <= 0)
@@ -326,8 +316,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 				flag = false;
 			}
-			if(tOrder.getOrderStage() == OrderStage.INTENTION.getCode())
-				flag = false;
 			if(tOrder.getLiquidationStatus() != LiquidationState.AGREE_REFUND.getCode())
 				flag = false;
 			if(tOrder.getActuallyTotalAmount().doubleValue() <= 0)
@@ -362,8 +350,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			active.setApplySign(false);
 			if (TokenManager.getUserId().equals(tOrder.getBuyerId())) { // 买方
 				active.setApplyForWithdraw(false);
-				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()
-						&& tOrder.getOrderStage() == OrderStage.INTENTION.getCode()) {
+				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()) {
 					/** 需求订单 开始 **/
 					if (tOrder.getOrderType() == CommodityType.DEMAND.getTypeCode()) {
 						active.setConfirmIntention(true); 
@@ -378,15 +365,13 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 					active.setRefuseIntention(false);
 				}
 				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_SIGN.getCode()
-						&& tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
-						&& tOrder.getOrderStage() == OrderStage.FOLLOWING.getCode()) {
+						&& tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()) {
 					active.setPayForFirst(true); //支付首付
 				} else {
 					active.setPayForFirst(false); //支付首付
 				}
 				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_SIGN.getCode()
-						&& tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
-						&& tOrder.getOrderStage() == OrderStage.FOLLOWING.getCode()) {
+						&& tOrder.getLiquidationStatus() == LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()) {
 					active.setPayForLast(true); //支付尾款
 				} else {
 					active.setPayForLast(false); //支付尾款
@@ -396,10 +381,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 						|| tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
 					flag = false;
 				}
-				if(tOrder.getOrderStage() != OrderStage.INTENTION.getCode()
-					|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()){
-					flag = false;
-				}
+				
 				if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.ALREADY_PAY.getCode()){
@@ -413,8 +395,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 						&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 					flag = false;
 				}
-				if(tOrder.getOrderStage() == OrderStage.INTENTION.getCode()) 
-					flag = false;
+				
 				if(tOrder.getLiquidationStatus() == LiquidationState.WAIT_FOR_REFUND_CONFIRM.getCode()
 						|| tOrder.getLiquidationStatus() == LiquidationState.REFUSE_REFUND.getCode()
 						|| tOrder.getLiquidationStatus() == LiquidationState.AGREE_REFUND.getCode()
@@ -428,8 +409,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				active.setPayForFirst(false);
 				active.setPayForLast(false);
 				active.setApplyForRefund(false);
-				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()
-						&& tOrder.getOrderStage() == OrderStage.INTENTION.getCode()) {
+				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()) {
 					/** 需求订单 开始 **/
 					if (tOrder.getOrderType() == CommodityType.DEMAND.getTypeCode()) {
 						active.setConfirmIntention(false); 
@@ -448,10 +428,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 						|| tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
 					flag = false;
 				}
-				if(tOrder.getOrderStage() != OrderStage.INTENTION.getCode()
-					|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()){
-					flag = false;
-				}
+			
 				if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.ALREADY_PAY.getCode()){
@@ -465,8 +442,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 						&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 					flag = false;
 				}
-				if(tOrder.getOrderStage() == OrderStage.INTENTION.getCode())
-					flag = false;
 				if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_FOR_REFUND_CONFIRM.getCode())
 					flag = false;
 				if(tOrder.getActuallyTotalAmount().doubleValue() <= 0)
@@ -498,8 +473,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			active.setApplyForWithdraw(false);
 			active.setApplyForRefund(false);
 			if (tOrder.getSellerId().equals(DEFAULT_PLATFORM_ID)) { // 平台作为卖方
-				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()
-						&& tOrder.getOrderStage() == OrderStage.INTENTION.getCode()) {
+				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_CONFIRM.getCode()) {
 					active.setConfirmIntention(true);
 					active.setRefuseIntention(true);
 				} else {
@@ -511,11 +485,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 				if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_CONFIRM.getCode()
 						|| tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
 					flag = false;
-				}
-				if(tOrder.getOrderStage() != OrderStage.INTENTION.getCode()
-					|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()){
-					flag = false;
-				}
+				}			
 				if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_FIRST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode()
 						&& tOrder.getLiquidationStatus() != LiquidationState.ALREADY_PAY.getCode()){
@@ -529,8 +499,6 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 						&& tOrder.getOrderStatus() != OrderState.SELLER_CANCEL_AFTER_SIGN.getCode()){
 					flag = false;
 				}
-				if(tOrder.getOrderStage() == OrderStage.INTENTION.getCode())
-					flag = false;
 				if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_FOR_REFUND_CONFIRM.getCode())
 					flag = false;
 				if(tOrder.getActuallyTotalAmount().doubleValue() <= 0)
@@ -576,16 +544,13 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		}else{
 			active.setApplyRevoke(false); //作废
 		}
-		if(tOrder.getOrderStage() == OrderStage.INTENTION.getCode())
-			flag = false;
 		if(tOrder.getLiquidationStatus() != LiquidationState.AGREE_REFUND.getCode())
 			flag = false;
 		if(tOrder.getActuallyTotalAmount().doubleValue() <= 0)
 			flag = false;
 		active.setCompleteRefund(flag); //完成退款
 		flag = true;
-		if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode() 
-				|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode())
+		if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode())
 			flag = false;
 		if(tOrder.getLiquidationStatus() != LiquidationState.WAIT_PAY_LAST_BALANCE.getCode() 
 					&& tOrder.getApproval() != ApprovalState.AUDIT_PASS.getCode())
@@ -869,13 +834,9 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			String orderRemarks) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
 		checkOrder(tOrder);
-		if (tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode() // 等待签单- 跟单中
-				|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()) {
+		if (tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()) {
 			throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, orderNo, ""));
 		} else {
-			if (tOrder.getLiquidationStatus() != LiquidationState.ALREADY_PAY.getCode() // 已经付款 or 特批
-					&& Integer.valueOf(approval) != ApprovalState.WAIT_AUDIT.getCode())
-				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, orderNo, ""));
 			tOrder.setSignFirstPayment(new BigDecimal(signFirstPayment));
 			tOrder.setSignTotalAmount(new BigDecimal(signTotalAmount));
 			tOrder.setOrderStage(OrderStage.SIGNED.getCode());
@@ -910,7 +871,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	
 	public void checkOrder(TOrder tOrder){
 		if(tOrder == null) 
-			 throw new BusinessException(new Error(ErrorConstants.ORDER_NOT_EXIST, tOrder.getOrderNo(),""));
+			 throw new BusinessException(new Error(ErrorConstants.ORDER_NOT_EXIST, "" ,""));
 		if(tOrder.getDeleteSign() == ActiveState.ABOLISH.getCode())
 			 throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_FREEZE, tOrder.getOrderNo(),""));
 		if(tOrder.getDeleteSign() == ActiveState.LOCKING.getCode())
@@ -923,8 +884,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 			String commodityPrice, String discountPrice,String commodityFirstPayment,String discountFirstPayment, String remarks) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
 			checkOrder(tOrder);
-			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()  //等待签单 + 跟单中
-					|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()){
+			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()){
 				 throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, orderNo,""));
 			}else{
 				TOrderDetail detail = new TOrderDetail();
@@ -964,8 +924,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		TOrderDetail oldDetail = tOrderDetailMapper.selectByPrimaryKey(detailId);
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(oldDetail.getOrderNo());
 		checkOrder(tOrder);
-		if (tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode() // 等待签单 - 跟单中
-				|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()) {
+		if (tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()) {
 			throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, oldDetail.getOrderNo(), ""));
 		} else {
 			TOrderDetail detail = new TOrderDetail();
@@ -1012,8 +971,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		TOrderDetail detail = tOrderDetailMapper.selectByPrimaryKey(detailId);
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(detail.getOrderNo());
 		checkOrder(tOrder);
-		if (tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode() // 等待签单 - 跟单中
-				|| tOrder.getOrderStage() != OrderStage.FOLLOWING.getCode()) {
+		if (tOrder.getOrderStatus() != OrderState.WAIT_FOR_SIGN.getCode()) {
 			throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, detail.getOrderNo(), ""));
 		} else {
 			BigDecimal totalAmountChange = detail.getCommodityPrice()
@@ -1273,8 +1231,7 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 	public int approvalServiceOrder(String orderNo, Integer confirm) {
 		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
 		checkOrder(tOrder);
-		if(tOrder.getProjectStage() != ProjectStage.NOT_SATISFY_CONDITION.getCode() 
-				|| tOrder.getOrderStatus() != OrderState.ALREADY_SIGN.getCode()
+		if(tOrder.getOrderStatus() != OrderState.ALREADY_SIGN.getCode()
 				|| tOrder.getOrderStage() != OrderStage.SIGNED.getCode()
 				|| tOrder.getApproval() != ApprovalState.WAIT_AUDIT.getCode()){
 			throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, orderNo , ""));
@@ -1330,9 +1287,9 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		tOrder.setUpdateTime(new Date());
 		tOrderMapper.updateByPrimaryKeySelective(tOrder);
 		//-------------- 查询订单详情 --------------------------
-		List<TOrderDetail> orderDetailList = tOrderMapper.selectOrderCommodity(orderNo);
-		List<ContractDetail> contractDetailList = new ArrayList<>();
-		ContractDetail contractDetail = null;
+		List<TOrderDetail> detailList = tOrderMapper.selectOrderCommodity(orderNo);
+		List<ContractTask> taskList = new ArrayList<>();
+		ContractTask task = null;
 		Date createTime = new Date();
 		String contractId = UUID.randomUUID().toString(); //合同ID
 		Contract contract = new Contract();
@@ -1344,21 +1301,21 @@ public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements Or
 		contract.setStatus(ProjectStage.ALREADY_SET_UP.getCode());
 		contract.setUid(tOrder.getBuyerId());
 		contractMapper.insert(contract);
-		for(TOrderDetail orderDetail: orderDetailList){
+		for(TOrderDetail orderDetail: detailList){
 			for(int i=0; i<orderDetail.getCommodityQuantity();i++){
-				contractDetail = new ContractDetail();
-				contractDetail.setId(UUID.randomUUID().toString());
-				contractDetail.setCommodityId(orderDetail.getCommodityId());
-				contractDetail.setCommodityMode(orderDetail.getCommodityMode());
-				contractDetail.setCommodityName(orderDetail.getCommodityName());
-				contractDetail.setCommodityType(orderDetail.getCommodityType());
-				contractDetail.setCommodityQuantity(1);
-				contractDetail.setCreateTime(createTime);
-				contractDetail.setContractId(contractId);
-				contractDetailList.add(contractDetail);
+				task = new ContractTask();
+				task.setId(UUID.randomUUID().toString());
+				task.setCommodityId(orderDetail.getCommodityId());
+				task.setCommodityMode(orderDetail.getCommodityMode());
+				task.setCommodityName(orderDetail.getCommodityName());
+				task.setCommodityType(orderDetail.getCommodityType());
+				task.setCommodityQuantity(1);
+				task.setCreateTime(createTime);
+				task.setContractId(contractId);
+				taskList.add(task);
 			}
 		}
-		contractMapper.batchInsertContractDetail(contractDetailList);
+		contractMapper.batchInsertContractTask(taskList);
 		return 1;
 	}
 

+ 19 - 2
src/main/java/com/goafanti/techproject/bo/ProjectDetailBo.java

@@ -3,12 +3,29 @@ package com.goafanti.techproject.bo;
 public class ProjectDetailBo extends ProjectListBo{
 	/** 立项说明 **/
 	private String signComment;
-
+	private String completeComment;
+	private String uid;
 	public String getSignComment() {
 		return signComment;
 	}
-
+	
 	public void setSignComment(String signComment) {
 		this.signComment = signComment;
 	}
+
+	public String getCompleteComment() {
+		return completeComment;
+	}
+
+	public void setCompleteComment(String completeComment) {
+		this.completeComment = completeComment;
+	}
+
+	public String getUid() {
+		return uid;
+	}
+
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
 }

+ 16 - 2
src/main/java/com/goafanti/techproject/bo/ProjectListBo.java

@@ -1,8 +1,9 @@
 package com.goafanti.techproject.bo;
 
 public class ProjectListBo {
-	/** 项目编号 **/
 	private String id;
+	/** 项目编号 **/
+	private String serialNumber;
 	/** 订单编号 **/
 	private String orderNo;
 	/** 订单创建时间 **/
@@ -29,13 +30,20 @@ public class ProjectListBo {
 	private String technicianName;
 	/** 立项时间 **/
 	private String signDate;
-
+	/** 结项时间 **/
+	private String completeDate;
 	public String getId() {
 		return id;
 	}
 	public void setId(String id) {
 		this.id = id;
 	}
+	public String getSerialNumber() {
+		return serialNumber;
+	}
+	public void setSerialNumber(String serialNumber) {
+		this.serialNumber = serialNumber;
+	}
 	public String getOrderNo() {
 		return orderNo;
 	}
@@ -114,4 +122,10 @@ public class ProjectListBo {
 	public void setSignDate(String signDate) {
 		this.signDate = signDate;
 	}
+	public String getCompleteDate() {
+		return completeDate;
+	}
+	public void setCompleteDate(String completeDate) {
+		this.completeDate = completeDate;
+	}
 }

+ 5 - 0
src/main/java/com/goafanti/techproject/bo/TaskListBo.java

@@ -0,0 +1,5 @@
+package com.goafanti.techproject.bo;
+
+public class TaskListBo {
+
+}

+ 27 - 0
src/main/java/com/goafanti/techproject/controller/AdminTechProjectApiController.java

@@ -637,9 +637,36 @@ public class AdminTechProjectApiController extends CertifyApiController {
 		if(StringUtils.isBlank(orderNo)){
 			if(StringUtils.isBlank(uid) || StringUtils.isBlank(aid) || projectType==null){
 				res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "请填写项目信息"));
+				return res;
 			} 
 		}
 		techProjectService.createProject(orderNo, uid, aid, projectType, signComment);
 		return res;
 	}
+	
+	/**
+	 * 查询项目详情
+	 * @param contractId
+	 * @return
+	 */
+	public Result getProjectDetail(String contractId){
+		Result res = new Result();
+		if(StringUtils.isBlank(contractId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "合同ID"));
+			return res;
+		}
+		res.setData(techProjectService.selectTechProjectDetail(contractId));
+		return res;
+	}
+	
+	/**
+	 * 
+	 * @param contractId
+	 * @return
+	 */
+	public Result getProjectTask(String contractId){
+		Result res = new Result();
+		
+		return res;
+	}
 }

+ 8 - 0
src/main/java/com/goafanti/techproject/service/TechProjectService.java

@@ -3,6 +3,7 @@ package com.goafanti.techproject.service;
 import java.util.Date;
 import java.util.List;
 
+import com.goafanti.app.bo.ProjectDetailBo;
 import com.goafanti.common.model.Contract;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.model.TechProjectLog;
@@ -61,4 +62,11 @@ public interface TechProjectService {
 	 * @return
 	 */
 	int createProject(String orderNo,String uid,String aid,Integer projectType,String signComment) ;
+
+	/**
+	 * 查询项目详情
+	 * @param contractId
+	 * @return
+	 */
+	ProjectDetailBo selectTechProjectDetail(String contractId);
 }

+ 51 - 3
src/main/java/com/goafanti/techproject/service/impl/TechProjectServiceImpl.java

@@ -12,8 +12,13 @@ import org.apache.commons.lang3.time.DateUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import com.goafanti.app.bo.ProjectDetailBo;
+import com.goafanti.common.bo.Error;
 import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.dao.ContractMapper;
 import com.goafanti.common.dao.NoticeMapper;
+import com.goafanti.common.dao.TOrderMapper;
 import com.goafanti.common.dao.TechProjectLogMapper;
 import com.goafanti.common.dao.TechProjectMapper;
 import com.goafanti.common.dao.UserMapper;
@@ -21,9 +26,11 @@ import com.goafanti.common.enums.DeleteStatus;
 import com.goafanti.common.enums.NoticeReadStatus;
 import com.goafanti.common.enums.NoticeStatus;
 import com.goafanti.common.enums.TechProjectStatus;
+import com.goafanti.common.error.BusinessException;
 import com.goafanti.common.model.Admin;
 import com.goafanti.common.model.Contract;
 import com.goafanti.common.model.Notice;
+import com.goafanti.common.model.TOrder;
 import com.goafanti.common.model.TechProject;
 import com.goafanti.common.model.TechProjectLog;
 import com.goafanti.common.model.User;
@@ -31,6 +38,10 @@ import com.goafanti.common.utils.StringUtils;
 import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.ServiceOrderDetailBo;
+import com.goafanti.order.enums.ActiveState;
+import com.goafanti.order.enums.CommodityType;
+import com.goafanti.order.enums.ProjectStage;
 import com.goafanti.techproject.bo.ProjectListBo;
 import com.goafanti.techproject.bo.TechProjectClientListBo;
 import com.goafanti.techproject.bo.TechProjectContractListBo;
@@ -49,7 +60,10 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 	private NoticeMapper			noticeMapper;
 	@Autowired
 	private UserMapper				userMapper;
-
+	@Autowired
+	private TOrderMapper 			tOrderMapper;
+	@Autowired
+	private ContractMapper 			contractMapper;
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<TechProjectClientListBo> listClientTechProject(String uid, Integer pageNo, Integer pageSize) {
@@ -300,7 +314,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 			try {
 				params.put("setUpStartDate", DateUtils.parseDate(setUpStartDate, AFTConstants.YYYYMMDDHHMMSS));
 				params.put("setUpEndDate", DateUtils.parseDate(setUpEndDate, AFTConstants.YYYYMMDDHHMMSS));
-				params.put(" orderStartDate", DateUtils.parseDate(orderStartDate, AFTConstants.YYYYMMDDHHMMSS));
+				params.put("orderStartDate", DateUtils.parseDate(orderStartDate, AFTConstants.YYYYMMDDHHMMSS));
 				params.put("orderEndDate", DateUtils.parseDate(orderEndDate, AFTConstants.YYYYMMDDHHMMSS));
 			} catch (ParseException e) {
 				e.printStackTrace();
@@ -310,7 +324,41 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
 
 	@Override
 	public int createProject(String orderNo, String uid, String aid, Integer projectType, String signComment) {
-		return 0;
+		Contract contract = new Contract();
+		contract.setId(UUID.randomUUID().toString());
+		contract.setStatus(ProjectStage.WAIT_SET_UP.getCode());
+		contract.setSignComment(signComment);
+		contract.setCreateTime(new Date());
+		if(StringUtils.isNotBlank(orderNo)){
+			ServiceOrderDetailBo detail = tOrderMapper.selectServiceOrderDetail(orderNo);
+			if(detail == null)
+				 throw new BusinessException(new Error(ErrorConstants.ORDER_NOT_EXIST, "",""));
+			if(detail.getDeleteSign() == ActiveState.ABOLISH.getCode())
+				 throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_FREEZE, orderNo,""));
+			if(detail.getDeleteSign() == ActiveState.LOCKING.getCode())
+				 throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_REVOKE, orderNo,""));
+			if(detail.getProjectStage() != ProjectStage.WAIT_SET_UP.getCode())
+				 throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, orderNo,""));
+			contract.setType(detail.getOrderType());
+			contract.setOrderNo(orderNo);
+			contract.setUid(detail.getBuyerId());
+			TOrder tOrder = new TOrder();
+			tOrder.setOrderNo(orderNo);
+			tOrder.setProjectStage(ProjectStage.WAIT_SET_UP.getCode());
+			tOrder.setUpdateTime(new Date());
+			tOrderMapper.updateByPrimaryKeySelective(tOrder);
+		}else {
+			contract.setType(CommodityType.SERVICE.getTypeCode());
+			contract.setUid(uid);
+		}
+		contractMapper.insert(contract);
+		return 1;
+	}
+
+	@Override
+	public ProjectDetailBo selectTechProjectDetail(String contractId) {
+		
+		return techProjectMapper.selectTechProjectDetail(contractId);
 	}
 
 }