Browse Source

Merge remote-tracking branch 'origin/test'

anderx 8 years ago
parent
commit
7b8cdf1981
34 changed files with 7452 additions and 119 deletions
  1. 1 7
      GeneratorConfig.xml
  2. 1 0
      src/main/java/com/goafanti/app/controller/AppAchievementDemandController.java
  3. 1 0
      src/main/java/com/goafanti/app/controller/AppApiController.java
  4. 2 0
      src/main/java/com/goafanti/common/constant/ErrorConstants.java
  5. 52 0
      src/main/java/com/goafanti/common/dao/TFundingRecordsMapper.java
  6. 85 0
      src/main/java/com/goafanti/common/dao/TOrderMapper.java
  7. 337 0
      src/main/java/com/goafanti/common/mapper/TFundingRecordsMapper.xml
  8. 732 0
      src/main/java/com/goafanti/common/mapper/TOrderMapper.xml
  9. 330 0
      src/main/java/com/goafanti/common/model/TFundingRecords.java
  10. 1153 0
      src/main/java/com/goafanti/common/model/TFundingRecordsExample.java
  11. 652 0
      src/main/java/com/goafanti/common/model/TOrder.java
  12. 2013 0
      src/main/java/com/goafanti/common/model/TOrderExample.java
  13. 185 0
      src/main/java/com/goafanti/common/utils/DecimalCalculate.java
  14. 110 111
      src/main/java/com/goafanti/core/mybatis/JDBCIdGenerator.java
  15. 1 0
      src/main/java/com/goafanti/message/service/impl/MessageServiceImpl.java
  16. 70 0
      src/main/java/com/goafanti/order/bo/FundingListBo.java
  17. 89 0
      src/main/java/com/goafanti/order/bo/OperatorActive.java
  18. 124 0
      src/main/java/com/goafanti/order/bo/OrderDetailBo.java
  19. 224 0
      src/main/java/com/goafanti/order/controller/OrderController.java
  20. 51 0
      src/main/java/com/goafanti/order/enums/AuditState.java
  21. 57 0
      src/main/java/com/goafanti/order/enums/CommodityType.java
  22. 56 0
      src/main/java/com/goafanti/order/enums/IntentionSate.java
  23. 60 0
      src/main/java/com/goafanti/order/enums/LiquidationSate.java
  24. 13 0
      src/main/java/com/goafanti/order/enums/OrderAction.java
  25. 52 0
      src/main/java/com/goafanti/order/enums/OrderChannel.java
  26. 56 0
      src/main/java/com/goafanti/order/enums/OrderState.java
  27. 52 0
      src/main/java/com/goafanti/order/enums/PayChannel.java
  28. 58 0
      src/main/java/com/goafanti/order/enums/PaymentState.java
  29. 54 0
      src/main/java/com/goafanti/order/enums/TradingState.java
  30. 50 0
      src/main/java/com/goafanti/order/enums/TransactionMode.java
  31. 56 0
      src/main/java/com/goafanti/order/enums/TransactionSubject.java
  32. 93 0
      src/main/java/com/goafanti/order/service/OrderService.java
  33. 579 0
      src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java
  34. 3 1
      src/main/resources/props/error.properties

+ 1 - 7
GeneratorConfig.xml

@@ -10,12 +10,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="message_from_system"/>
-    <table schema="aft" tableName="message_producer"/>
-    <table schema="aft" tableName="message_consumer"/>
-    <table schema="aft" tableName="message_from_business"/>
-    <table schema="aft" tableName="news_interest"/>
-    <table schema="aft" tableName="business_project"/>
+    <table schema="aft" tableName="t_order"/>
   </context>
 </generatorConfiguration>

+ 1 - 0
src/main/java/com/goafanti/app/controller/AppAchievementDemandController.java

@@ -176,4 +176,5 @@ public class AppAchievementDemandController extends BaseApiController {
 	
 	
 	
+	
 }

+ 1 - 0
src/main/java/com/goafanti/app/controller/AppApiController.java

@@ -191,4 +191,5 @@ public class AppApiController extends BaseApiController {
 		messageService.updateMessageConsumer(messageId);
 		return res;
 	}
+
 }

+ 2 - 0
src/main/java/com/goafanti/common/constant/ErrorConstants.java

@@ -117,4 +117,6 @@ public class ErrorConstants {
 	public static final String	SON_ALREADY_EXIST					= "SON_ALREADY_EXIST";
 	
 	public static final String USER_NICKNAME_EXIST					= "USER_NICKNAME_EXIST";
+	
+	public static final String NOT_ACCORD_WITH_NEXT					= "NOT_ACCORD_WITH_NEXT";
 }

+ 52 - 0
src/main/java/com/goafanti/common/dao/TFundingRecordsMapper.java

@@ -0,0 +1,52 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TFundingRecords;
+import com.goafanti.common.model.TFundingRecordsExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface TFundingRecordsMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_funding_records
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	long countByExample(TFundingRecordsExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_funding_records
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	int deleteByExample(TFundingRecordsExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_funding_records
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	int insert(TFundingRecords record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_funding_records
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	int insertSelective(TFundingRecords record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_funding_records
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	List<TFundingRecords> selectByExample(TFundingRecordsExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_funding_records
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	int updateByExampleSelective(@Param("record") TFundingRecords record,
+			@Param("example") TFundingRecordsExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_funding_records
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	int updateByExample(@Param("record") TFundingRecords record, @Param("example") TFundingRecordsExample example);
+}

+ 85 - 0
src/main/java/com/goafanti/common/dao/TOrderMapper.java

@@ -0,0 +1,85 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.TOrder;
+import com.goafanti.common.model.TOrderExample;
+import com.goafanti.order.bo.OrderDetailBo;
+
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface TOrderMapper {
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	long countByExample(TOrderExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	int deleteByExample(TOrderExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	int deleteByPrimaryKey(Long orderNo);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	int insert(TOrder record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	int insertSelective(TOrder record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	List<TOrder> selectByExample(TOrderExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	TOrder selectByPrimaryKey(Long orderNo);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	int updateByExampleSelective(@Param("record") TOrder record, @Param("example") TOrderExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	int updateByExample(@Param("record") TOrder record, @Param("example") TOrderExample example);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	int updateByPrimaryKeySelective(TOrder record);
+
+	/**
+	 * This method was generated by MyBatis Generator. This method corresponds to the database table t_order
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	int updateByPrimaryKey(TOrder record);
+
+	/**
+	 *  查看商品详情
+	 * @param commodityId
+	 * @param orderType
+	 * @return
+	 */
+	OrderDetailBo selectCommodityDetail(@Param("commodityId")String commodityId, @Param("commodityType")Integer commodityType);
+}

+ 337 - 0
src/main/java/com/goafanti/common/mapper/TFundingRecordsMapper.xml

@@ -0,0 +1,337 @@
+<?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.TFundingRecordsMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TFundingRecords">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 11:19:48 CST 2017.
+    -->
+    <result column="id" jdbcType="VARCHAR" property="id" />
+    <result column="order_no" jdbcType="BIGINT" property="orderNo" />
+    <result column="creater" jdbcType="VARCHAR" property="creater" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="payee_id" jdbcType="VARCHAR" property="payeeId" />
+    <result column="payer_id" jdbcType="VARCHAR" property="payerId" />
+    <result column="transaction_amount" jdbcType="DECIMAL" property="transactionAmount" />
+    <result column="transaction_subject" jdbcType="INTEGER" property="transactionSubject" />
+    <result column="transaction_channel" jdbcType="INTEGER" property="transactionChannel" />
+    <result column="transaction_mode" jdbcType="INTEGER" property="transactionMode" />
+    <result column="remarks" jdbcType="VARCHAR" property="remarks" />
+    <result column="confirm_sign" jdbcType="INTEGER" property="confirmSign" />
+    <result column="delete_sign" jdbcType="BIT" property="deleteSign" />
+  </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 26 11:19:48 CST 2017.
+    -->
+    <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 26 11:19:48 CST 2017.
+    -->
+    <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 26 11:19:48 CST 2017.
+    -->
+    id, order_no, creater, create_time, update_time, payee_id, payer_id, transaction_amount, 
+    transaction_subject, transaction_channel, transaction_mode, remarks, confirm_sign, 
+    delete_sign
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.TFundingRecordsExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 11:19:48 CST 2017.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from t_funding_records
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+  </select>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TFundingRecordsExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 11:19:48 CST 2017.
+    -->
+    delete from t_funding_records
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.TFundingRecords">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 11:19:48 CST 2017.
+    -->
+    insert into t_funding_records (id, order_no, creater, 
+      create_time, update_time, payee_id, 
+      payer_id, transaction_amount, transaction_subject, 
+      transaction_channel, transaction_mode, remarks, 
+      confirm_sign, delete_sign)
+    values (#{id,jdbcType=VARCHAR}, #{orderNo,jdbcType=BIGINT}, #{creater,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{payeeId,jdbcType=VARCHAR}, 
+      #{payerId,jdbcType=VARCHAR}, #{transactionAmount,jdbcType=DECIMAL}, #{transactionSubject,jdbcType=INTEGER}, 
+      #{transactionChannel,jdbcType=INTEGER}, #{transactionMode,jdbcType=INTEGER}, #{remarks,jdbcType=VARCHAR}, 
+      #{confirmSign,jdbcType=INTEGER}, #{deleteSign,jdbcType=BIT})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TFundingRecords">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 11:19:48 CST 2017.
+    -->
+    insert into t_funding_records
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="creater != null">
+        creater,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="payeeId != null">
+        payee_id,
+      </if>
+      <if test="payerId != null">
+        payer_id,
+      </if>
+      <if test="transactionAmount != null">
+        transaction_amount,
+      </if>
+      <if test="transactionSubject != null">
+        transaction_subject,
+      </if>
+      <if test="transactionChannel != null">
+        transaction_channel,
+      </if>
+      <if test="transactionMode != null">
+        transaction_mode,
+      </if>
+      <if test="remarks != null">
+        remarks,
+      </if>
+      <if test="confirmSign != null">
+        confirm_sign,
+      </if>
+      <if test="deleteSign != null">
+        delete_sign,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=BIGINT},
+      </if>
+      <if test="creater != null">
+        #{creater,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="payeeId != null">
+        #{payeeId,jdbcType=VARCHAR},
+      </if>
+      <if test="payerId != null">
+        #{payerId,jdbcType=VARCHAR},
+      </if>
+      <if test="transactionAmount != null">
+        #{transactionAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="transactionSubject != null">
+        #{transactionSubject,jdbcType=INTEGER},
+      </if>
+      <if test="transactionChannel != null">
+        #{transactionChannel,jdbcType=INTEGER},
+      </if>
+      <if test="transactionMode != null">
+        #{transactionMode,jdbcType=INTEGER},
+      </if>
+      <if test="remarks != null">
+        #{remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="confirmSign != null">
+        #{confirmSign,jdbcType=INTEGER},
+      </if>
+      <if test="deleteSign != null">
+        #{deleteSign,jdbcType=BIT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.TFundingRecordsExample" 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 26 11:19:48 CST 2017.
+    -->
+    select count(*) from t_funding_records
+    <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 26 11:19:48 CST 2017.
+    -->
+    update t_funding_records
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=VARCHAR},
+      </if>
+      <if test="record.orderNo != null">
+        order_no = #{record.orderNo,jdbcType=BIGINT},
+      </if>
+      <if test="record.creater != null">
+        creater = #{record.creater,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.payeeId != null">
+        payee_id = #{record.payeeId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.payerId != null">
+        payer_id = #{record.payerId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.transactionAmount != null">
+        transaction_amount = #{record.transactionAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="record.transactionSubject != null">
+        transaction_subject = #{record.transactionSubject,jdbcType=INTEGER},
+      </if>
+      <if test="record.transactionChannel != null">
+        transaction_channel = #{record.transactionChannel,jdbcType=INTEGER},
+      </if>
+      <if test="record.transactionMode != null">
+        transaction_mode = #{record.transactionMode,jdbcType=INTEGER},
+      </if>
+      <if test="record.remarks != null">
+        remarks = #{record.remarks,jdbcType=VARCHAR},
+      </if>
+      <if test="record.confirmSign != null">
+        confirm_sign = #{record.confirmSign,jdbcType=INTEGER},
+      </if>
+      <if test="record.deleteSign != null">
+        delete_sign = #{record.deleteSign,jdbcType=BIT},
+      </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 26 11:19:48 CST 2017.
+    -->
+    update t_funding_records
+    set id = #{record.id,jdbcType=VARCHAR},
+      order_no = #{record.orderNo,jdbcType=BIGINT},
+      creater = #{record.creater,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      payee_id = #{record.payeeId,jdbcType=VARCHAR},
+      payer_id = #{record.payerId,jdbcType=VARCHAR},
+      transaction_amount = #{record.transactionAmount,jdbcType=DECIMAL},
+      transaction_subject = #{record.transactionSubject,jdbcType=INTEGER},
+      transaction_channel = #{record.transactionChannel,jdbcType=INTEGER},
+      transaction_mode = #{record.transactionMode,jdbcType=INTEGER},
+      remarks = #{record.remarks,jdbcType=VARCHAR},
+      confirm_sign = #{record.confirmSign,jdbcType=INTEGER},
+      delete_sign = #{record.deleteSign,jdbcType=BIT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+</mapper>

+ 732 - 0
src/main/java/com/goafanti/common/mapper/TOrderMapper.xml

@@ -0,0 +1,732 @@
+<?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.TOrderMapper">
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.TOrder">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    <id column="order_no" jdbcType="BIGINT" property="orderNo" />
+    <result column="creater" jdbcType="VARCHAR" property="creater" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+    <result column="buyer_id" jdbcType="VARCHAR" property="buyerId" />
+    <result column="seller_id" jdbcType="VARCHAR" property="sellerId" />
+    <result column="commodity_id" jdbcType="VARCHAR" property="commodityId" />
+    <result column="commodity_quantity" jdbcType="INTEGER" property="commodityQuantity" />
+    <result column="commodity_price" jdbcType="DECIMAL" property="commodityPrice" />
+    <result column="commodity_type" jdbcType="INTEGER" property="commodityType" />
+    <result column="commodity_mode" jdbcType="VARCHAR" property="commodityMode" />
+    <result column="first_payment" jdbcType="DECIMAL" property="firstPayment" />
+    <result column="order_amount" jdbcType="DECIMAL" property="orderAmount" />
+    <result column="brokerage_amount" jdbcType="DECIMAL" property="brokerageAmount" />
+    <result column="brokerage_proportion" jdbcType="DECIMAL" property="brokerageProportion" />
+    <result column="actually_first_payment" jdbcType="DECIMAL" property="actuallyFirstPayment" />
+    <result column="actually_total_payment" jdbcType="DECIMAL" property="actuallyTotalPayment" />
+    <result column="actually_brokerage_amount" jdbcType="DECIMAL" property="actuallyBrokerageAmount" />
+    <result column="order_status" jdbcType="INTEGER" property="orderStatus" />
+    <result column="intention_status" jdbcType="INTEGER" property="intentionStatus" />
+    <result column="trading_status" jdbcType="INTEGER" property="tradingStatus" />
+    <result column="technology_transfer_progress" jdbcType="INTEGER" property="technologyTransferProgress" />
+    <result column="payment_status" jdbcType="INTEGER" property="paymentStatus" />
+    <result column="liquidation_status" jdbcType="INTEGER" property="liquidationStatus" />
+    <result column="order_follower" jdbcType="VARCHAR" property="orderFollower" />
+    <result column="order_channel" jdbcType="INTEGER" property="orderChannel" />
+    <result column="order_remarks" jdbcType="VARCHAR" property="orderRemarks" />
+    <result column="delete_sign" jdbcType="BIT" property="deleteSign" />
+  </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 26 20:46:24 CST 2017.
+    -->
+    <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 26 20:46:24 CST 2017.
+    -->
+    <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 26 20:46:24 CST 2017.
+    -->
+    order_no, creater, create_time, update_time, buyer_id, seller_id, commodity_id, commodity_quantity, 
+    commodity_price, commodity_type, commodity_mode, first_payment, order_amount, brokerage_amount, 
+    brokerage_proportion, actually_first_payment, actually_total_payment, actually_brokerage_amount, 
+    order_status, intention_status, trading_status, technology_transfer_progress, payment_status, 
+    liquidation_status, order_follower, order_channel, order_remarks, delete_sign
+  </sql>
+  <select id="selectByExample" parameterType="com.goafanti.common.model.TOrderExample" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from t_order
+    <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.Long" resultMap="BaseResultMap">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    select 
+    <include refid="Base_Column_List" />
+    from t_order
+    where order_no = #{orderNo,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    delete from t_order
+    where order_no = #{orderNo,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.goafanti.common.model.TOrderExample">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    delete from t_order
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.TOrder">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    insert into t_order (order_no, creater, create_time, 
+      update_time, buyer_id, seller_id, 
+      commodity_id, commodity_quantity, commodity_price, 
+      commodity_type, commodity_mode, first_payment, 
+      order_amount, brokerage_amount, brokerage_proportion, 
+      actually_first_payment, actually_total_payment, 
+      actually_brokerage_amount, order_status, intention_status, 
+      trading_status, technology_transfer_progress, 
+      payment_status, liquidation_status, order_follower, 
+      order_channel, order_remarks, delete_sign
+      )
+    values (#{orderNo,jdbcType=BIGINT}, #{creater,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{buyerId,jdbcType=VARCHAR}, #{sellerId,jdbcType=VARCHAR}, 
+      #{commodityId,jdbcType=VARCHAR}, #{commodityQuantity,jdbcType=INTEGER}, #{commodityPrice,jdbcType=DECIMAL}, 
+      #{commodityType,jdbcType=INTEGER}, #{commodityMode,jdbcType=VARCHAR}, #{firstPayment,jdbcType=DECIMAL}, 
+      #{orderAmount,jdbcType=DECIMAL}, #{brokerageAmount,jdbcType=DECIMAL}, #{brokerageProportion,jdbcType=DECIMAL}, 
+      #{actuallyFirstPayment,jdbcType=DECIMAL}, #{actuallyTotalPayment,jdbcType=DECIMAL}, 
+      #{actuallyBrokerageAmount,jdbcType=DECIMAL}, #{orderStatus,jdbcType=INTEGER}, #{intentionStatus,jdbcType=INTEGER}, 
+      #{tradingStatus,jdbcType=INTEGER}, #{technologyTransferProgress,jdbcType=INTEGER}, 
+      #{paymentStatus,jdbcType=INTEGER}, #{liquidationStatus,jdbcType=INTEGER}, #{orderFollower,jdbcType=VARCHAR}, 
+      #{orderChannel,jdbcType=INTEGER}, #{orderRemarks,jdbcType=VARCHAR}, #{deleteSign,jdbcType=BIT}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.TOrder">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    insert into t_order
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="orderNo != null">
+        order_no,
+      </if>
+      <if test="creater != null">
+        creater,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+      <if test="buyerId != null">
+        buyer_id,
+      </if>
+      <if test="sellerId != null">
+        seller_id,
+      </if>
+      <if test="commodityId != null">
+        commodity_id,
+      </if>
+      <if test="commodityQuantity != null">
+        commodity_quantity,
+      </if>
+      <if test="commodityPrice != null">
+        commodity_price,
+      </if>
+      <if test="commodityType != null">
+        commodity_type,
+      </if>
+      <if test="commodityMode != null">
+        commodity_mode,
+      </if>
+      <if test="firstPayment != null">
+        first_payment,
+      </if>
+      <if test="orderAmount != null">
+        order_amount,
+      </if>
+      <if test="brokerageAmount != null">
+        brokerage_amount,
+      </if>
+      <if test="brokerageProportion != null">
+        brokerage_proportion,
+      </if>
+      <if test="actuallyFirstPayment != null">
+        actually_first_payment,
+      </if>
+      <if test="actuallyTotalPayment != null">
+        actually_total_payment,
+      </if>
+      <if test="actuallyBrokerageAmount != null">
+        actually_brokerage_amount,
+      </if>
+      <if test="orderStatus != null">
+        order_status,
+      </if>
+      <if test="intentionStatus != null">
+        intention_status,
+      </if>
+      <if test="tradingStatus != null">
+        trading_status,
+      </if>
+      <if test="technologyTransferProgress != null">
+        technology_transfer_progress,
+      </if>
+      <if test="paymentStatus != null">
+        payment_status,
+      </if>
+      <if test="liquidationStatus != null">
+        liquidation_status,
+      </if>
+      <if test="orderFollower != null">
+        order_follower,
+      </if>
+      <if test="orderChannel != null">
+        order_channel,
+      </if>
+      <if test="orderRemarks != null">
+        order_remarks,
+      </if>
+      <if test="deleteSign != null">
+        delete_sign,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="orderNo != null">
+        #{orderNo,jdbcType=BIGINT},
+      </if>
+      <if test="creater != null">
+        #{creater,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="buyerId != null">
+        #{buyerId,jdbcType=VARCHAR},
+      </if>
+      <if test="sellerId != null">
+        #{sellerId,jdbcType=VARCHAR},
+      </if>
+      <if test="commodityId != null">
+        #{commodityId,jdbcType=VARCHAR},
+      </if>
+      <if test="commodityQuantity != null">
+        #{commodityQuantity,jdbcType=INTEGER},
+      </if>
+      <if test="commodityPrice != null">
+        #{commodityPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="commodityType != null">
+        #{commodityType,jdbcType=INTEGER},
+      </if>
+      <if test="commodityMode != null">
+        #{commodityMode,jdbcType=VARCHAR},
+      </if>
+      <if test="firstPayment != null">
+        #{firstPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="orderAmount != null">
+        #{orderAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="brokerageAmount != null">
+        #{brokerageAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="brokerageProportion != null">
+        #{brokerageProportion,jdbcType=DECIMAL},
+      </if>
+      <if test="actuallyFirstPayment != null">
+        #{actuallyFirstPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="actuallyTotalPayment != null">
+        #{actuallyTotalPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="actuallyBrokerageAmount != null">
+        #{actuallyBrokerageAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="orderStatus != null">
+        #{orderStatus,jdbcType=INTEGER},
+      </if>
+      <if test="intentionStatus != null">
+        #{intentionStatus,jdbcType=INTEGER},
+      </if>
+      <if test="tradingStatus != null">
+        #{tradingStatus,jdbcType=INTEGER},
+      </if>
+      <if test="technologyTransferProgress != null">
+        #{technologyTransferProgress,jdbcType=INTEGER},
+      </if>
+      <if test="paymentStatus != null">
+        #{paymentStatus,jdbcType=INTEGER},
+      </if>
+      <if test="liquidationStatus != null">
+        #{liquidationStatus,jdbcType=INTEGER},
+      </if>
+      <if test="orderFollower != null">
+        #{orderFollower,jdbcType=VARCHAR},
+      </if>
+      <if test="orderChannel != null">
+        #{orderChannel,jdbcType=INTEGER},
+      </if>
+      <if test="orderRemarks != null">
+        #{orderRemarks,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteSign != null">
+        #{deleteSign,jdbcType=BIT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.goafanti.common.model.TOrderExample" 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 26 20:46:24 CST 2017.
+    -->
+    select count(*) from t_order
+    <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 26 20:46:24 CST 2017.
+    -->
+    update t_order
+    <set>
+      <if test="record.orderNo != null">
+        order_no = #{record.orderNo,jdbcType=BIGINT},
+      </if>
+      <if test="record.creater != null">
+        creater = #{record.creater,jdbcType=VARCHAR},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.buyerId != null">
+        buyer_id = #{record.buyerId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.sellerId != null">
+        seller_id = #{record.sellerId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.commodityId != null">
+        commodity_id = #{record.commodityId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.commodityQuantity != null">
+        commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
+      </if>
+      <if test="record.commodityPrice != null">
+        commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="record.commodityType != null">
+        commodity_type = #{record.commodityType,jdbcType=INTEGER},
+      </if>
+      <if test="record.commodityMode != null">
+        commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
+      </if>
+      <if test="record.firstPayment != null">
+        first_payment = #{record.firstPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="record.orderAmount != null">
+        order_amount = #{record.orderAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="record.brokerageAmount != null">
+        brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="record.brokerageProportion != null">
+        brokerage_proportion = #{record.brokerageProportion,jdbcType=DECIMAL},
+      </if>
+      <if test="record.actuallyFirstPayment != null">
+        actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="record.actuallyTotalPayment != null">
+        actually_total_payment = #{record.actuallyTotalPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="record.actuallyBrokerageAmount != null">
+        actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="record.orderStatus != null">
+        order_status = #{record.orderStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.intentionStatus != null">
+        intention_status = #{record.intentionStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.tradingStatus != null">
+        trading_status = #{record.tradingStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.technologyTransferProgress != null">
+        technology_transfer_progress = #{record.technologyTransferProgress,jdbcType=INTEGER},
+      </if>
+      <if test="record.paymentStatus != null">
+        payment_status = #{record.paymentStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.liquidationStatus != null">
+        liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.orderFollower != null">
+        order_follower = #{record.orderFollower,jdbcType=VARCHAR},
+      </if>
+      <if test="record.orderChannel != null">
+        order_channel = #{record.orderChannel,jdbcType=INTEGER},
+      </if>
+      <if test="record.orderRemarks != null">
+        order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
+      </if>
+      <if test="record.deleteSign != null">
+        delete_sign = #{record.deleteSign,jdbcType=BIT},
+      </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 26 20:46:24 CST 2017.
+    -->
+    update t_order
+    set order_no = #{record.orderNo,jdbcType=BIGINT},
+      creater = #{record.creater,jdbcType=VARCHAR},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      buyer_id = #{record.buyerId,jdbcType=VARCHAR},
+      seller_id = #{record.sellerId,jdbcType=VARCHAR},
+      commodity_id = #{record.commodityId,jdbcType=VARCHAR},
+      commodity_quantity = #{record.commodityQuantity,jdbcType=INTEGER},
+      commodity_price = #{record.commodityPrice,jdbcType=DECIMAL},
+      commodity_type = #{record.commodityType,jdbcType=INTEGER},
+      commodity_mode = #{record.commodityMode,jdbcType=VARCHAR},
+      first_payment = #{record.firstPayment,jdbcType=DECIMAL},
+      order_amount = #{record.orderAmount,jdbcType=DECIMAL},
+      brokerage_amount = #{record.brokerageAmount,jdbcType=DECIMAL},
+      brokerage_proportion = #{record.brokerageProportion,jdbcType=DECIMAL},
+      actually_first_payment = #{record.actuallyFirstPayment,jdbcType=DECIMAL},
+      actually_total_payment = #{record.actuallyTotalPayment,jdbcType=DECIMAL},
+      actually_brokerage_amount = #{record.actuallyBrokerageAmount,jdbcType=DECIMAL},
+      order_status = #{record.orderStatus,jdbcType=INTEGER},
+      intention_status = #{record.intentionStatus,jdbcType=INTEGER},
+      trading_status = #{record.tradingStatus,jdbcType=INTEGER},
+      technology_transfer_progress = #{record.technologyTransferProgress,jdbcType=INTEGER},
+      payment_status = #{record.paymentStatus,jdbcType=INTEGER},
+      liquidation_status = #{record.liquidationStatus,jdbcType=INTEGER},
+      order_follower = #{record.orderFollower,jdbcType=VARCHAR},
+      order_channel = #{record.orderChannel,jdbcType=INTEGER},
+      order_remarks = #{record.orderRemarks,jdbcType=VARCHAR},
+      delete_sign = #{record.deleteSign,jdbcType=BIT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrder">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    update t_order
+    <set>
+      <if test="creater != null">
+        creater = #{creater,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="buyerId != null">
+        buyer_id = #{buyerId,jdbcType=VARCHAR},
+      </if>
+      <if test="sellerId != null">
+        seller_id = #{sellerId,jdbcType=VARCHAR},
+      </if>
+      <if test="commodityId != null">
+        commodity_id = #{commodityId,jdbcType=VARCHAR},
+      </if>
+      <if test="commodityQuantity != null">
+        commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
+      </if>
+      <if test="commodityPrice != null">
+        commodity_price = #{commodityPrice,jdbcType=DECIMAL},
+      </if>
+      <if test="commodityType != null">
+        commodity_type = #{commodityType,jdbcType=INTEGER},
+      </if>
+      <if test="commodityMode != null">
+        commodity_mode = #{commodityMode,jdbcType=VARCHAR},
+      </if>
+      <if test="firstPayment != null">
+        first_payment = #{firstPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="orderAmount != null">
+        order_amount = #{orderAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="brokerageAmount != null">
+        brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="brokerageProportion != null">
+        brokerage_proportion = #{brokerageProportion,jdbcType=DECIMAL},
+      </if>
+      <if test="actuallyFirstPayment != null">
+        actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="actuallyTotalPayment != null">
+        actually_total_payment = #{actuallyTotalPayment,jdbcType=DECIMAL},
+      </if>
+      <if test="actuallyBrokerageAmount != null">
+        actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
+      </if>
+      <if test="orderStatus != null">
+        order_status = #{orderStatus,jdbcType=INTEGER},
+      </if>
+      <if test="intentionStatus != null">
+        intention_status = #{intentionStatus,jdbcType=INTEGER},
+      </if>
+      <if test="tradingStatus != null">
+        trading_status = #{tradingStatus,jdbcType=INTEGER},
+      </if>
+      <if test="technologyTransferProgress != null">
+        technology_transfer_progress = #{technologyTransferProgress,jdbcType=INTEGER},
+      </if>
+      <if test="paymentStatus != null">
+        payment_status = #{paymentStatus,jdbcType=INTEGER},
+      </if>
+      <if test="liquidationStatus != null">
+        liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
+      </if>
+      <if test="orderFollower != null">
+        order_follower = #{orderFollower,jdbcType=VARCHAR},
+      </if>
+      <if test="orderChannel != null">
+        order_channel = #{orderChannel,jdbcType=INTEGER},
+      </if>
+      <if test="orderRemarks != null">
+        order_remarks = #{orderRemarks,jdbcType=VARCHAR},
+      </if>
+      <if test="deleteSign != null">
+        delete_sign = #{deleteSign,jdbcType=BIT},
+      </if>
+    </set>
+    where order_no = #{orderNo,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.TOrder">
+    <!--
+      WARNING - @mbg.generated
+      This element is automatically generated by MyBatis Generator, do not modify.
+      This element was generated on Tue Dec 26 20:46:24 CST 2017.
+    -->
+    update t_order
+    set creater = #{creater,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP},
+      buyer_id = #{buyerId,jdbcType=VARCHAR},
+      seller_id = #{sellerId,jdbcType=VARCHAR},
+      commodity_id = #{commodityId,jdbcType=VARCHAR},
+      commodity_quantity = #{commodityQuantity,jdbcType=INTEGER},
+      commodity_price = #{commodityPrice,jdbcType=DECIMAL},
+      commodity_type = #{commodityType,jdbcType=INTEGER},
+      commodity_mode = #{commodityMode,jdbcType=VARCHAR},
+      first_payment = #{firstPayment,jdbcType=DECIMAL},
+      order_amount = #{orderAmount,jdbcType=DECIMAL},
+      brokerage_amount = #{brokerageAmount,jdbcType=DECIMAL},
+      brokerage_proportion = #{brokerageProportion,jdbcType=DECIMAL},
+      actually_first_payment = #{actuallyFirstPayment,jdbcType=DECIMAL},
+      actually_total_payment = #{actuallyTotalPayment,jdbcType=DECIMAL},
+      actually_brokerage_amount = #{actuallyBrokerageAmount,jdbcType=DECIMAL},
+      order_status = #{orderStatus,jdbcType=INTEGER},
+      intention_status = #{intentionStatus,jdbcType=INTEGER},
+      trading_status = #{tradingStatus,jdbcType=INTEGER},
+      technology_transfer_progress = #{technologyTransferProgress,jdbcType=INTEGER},
+      payment_status = #{paymentStatus,jdbcType=INTEGER},
+      liquidation_status = #{liquidationStatus,jdbcType=INTEGER},
+      order_follower = #{orderFollower,jdbcType=VARCHAR},
+      order_channel = #{orderChannel,jdbcType=INTEGER},
+      order_remarks = #{orderRemarks,jdbcType=VARCHAR},
+      delete_sign = #{deleteSign,jdbcType=BIT}
+    where order_no = #{orderNo,jdbcType=BIGINT}
+  </update>
+  
+  <select id="selectCommodityDetail" resultType="com.goafanti.order.bo.OrderDetailBo">
+  	<choose>
+  		<when test="commodityType == 0">
+  			select id as commodityId,bname as commodityName,ifnull(price,0) as commodityPrice from business_project where id = #{commodityId,jdbcType=VARCHAR}
+  		</when>
+  		<when test="commodityType == 1">
+  			select id as commodityId,name as commodityName,summary as introduction,ifnull(transfer_price,0) as commodityPrice,owner_id as sellerId from achievement where id = #{commodityId,jdbcType=VARCHAR}
+  		</when>
+  		<when test="commodityType == 2">
+  			select id as commodityId,name as commodityName,problem_des as introduction,ifnull(budget_cost,0) as commodityPrice,employer_id as sellerId from demand where id = #{commodityId,jdbcType=VARCHAR}
+  		</when>
+  		<when test="commodityType == 3">
+  			select id as commodityId,nickname as commodityName,introduction,id as sellerId from user where id = #{commodityId,jdbcType=VARCHAR}
+  		</when>
+  		<when test="commodityType == 4">
+  			
+  		</when>
+  		<when test="commodityType == 5">
+  		
+  		</when>
+  	</choose>
+  </select>
+  
+  <select id="selectOrderListByPage" resultMap="BaseResultMap">
+  	select 
+    <include refid="Base_Column_List" />
+    from t_order where delete_sign = 0
+    <choose>
+    	<when test="intentionStatus == 0"><!-- 意向订单 -->
+    		and intention_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id =  #{uid,jdbcType=VARCHAR})
+    	</when>
+    	<otherwise>
+    		and intention_status != 0  and buyer_id = #{uid,jdbcType=VARCHAR}
+    	</otherwise>
+    </choose>
+  </select>
+  
+   <select id="selectOrderListCount" resultType="java.lang.Integer">
+  	select 
+  		count(0) 
+  	from t_order where delete_sign = 0
+    <choose>
+    	<when test="intentionStatus == 0"><!-- 意向订单 -->
+    		and intention_status = 0 and (buyer_id = #{uid,jdbcType=VARCHAR} or seller_id =  #{uid,jdbcType=VARCHAR})
+    	</when>
+    	<otherwise>
+    		and intention_status != 0  and buyer_id = #{uid,jdbcType=VARCHAR}
+    	</otherwise>
+    </choose>
+  </select>
+  
+  <select id="selectFundingHistoryByPage" resultType="com.goafanti.order.bo.FundingListBo">
+	select
+		a.order_no as orderNo,
+		a.create_time as createTime,
+		a.transaction_subject as transactionSubject,
+		a.transaction_amount as transactionAmount,
+		b.commodity_type as commodityType
+	from
+		t_funding_records a left join t_order b on a.order_no = b.order_no
+	where
+		(a.payee_id = #{uid,jdbcType=VARCHAR} or a.payer_id = #{uid,jdbcType=VARCHAR}) and delete_sign = 0
+		<if test="orderNo != null and orderNo != ''">
+			a.order_no = #{orderNo,jdbcType=BIGINT}
+		</if>
+  </select>
+  
+  <select id="selectFundingHistoryCount" resultType="java.lang.Integer">
+  	select
+		count(0)
+	from
+		t_funding_records a left join t_order b on a.order_no = b.order_no
+	where
+		(a.payee_id = #{uid,jdbcType=VARCHAR} or a.payer_id = #{uid,jdbcType=VARCHAR}) and delete_sign = 0
+		<if test="orderNo != null and orderNo != ''">
+			a.order_no = #{orderNo,jdbcType=BIGINT}
+		</if>
+  </select>
+</mapper>

+ 330 - 0
src/main/java/com/goafanti/common/model/TFundingRecords.java

@@ -0,0 +1,330 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class TFundingRecords {
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private String id;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.order_no
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private Long orderNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.creater
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private String creater;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.create_time
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.update_time
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private Date updateTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.payee_id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private String payeeId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.payer_id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private String payerId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.transaction_amount
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private BigDecimal transactionAmount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.transaction_subject
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private Integer transactionSubject;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.transaction_channel
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private Integer transactionChannel;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.transaction_mode
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private Integer transactionMode;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.remarks
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private String remarks;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.confirm_sign
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private Integer confirmSign;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_funding_records.delete_sign
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	private Boolean deleteSign;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.id
+	 * @return  the value of t_funding_records.id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public String getId() {
+		return id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.id
+	 * @param id  the value for t_funding_records.id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.order_no
+	 * @return  the value of t_funding_records.order_no
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public Long getOrderNo() {
+		return orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.order_no
+	 * @param orderNo  the value for t_funding_records.order_no
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setOrderNo(Long orderNo) {
+		this.orderNo = orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.creater
+	 * @return  the value of t_funding_records.creater
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public String getCreater() {
+		return creater;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.creater
+	 * @param creater  the value for t_funding_records.creater
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setCreater(String creater) {
+		this.creater = creater;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.create_time
+	 * @return  the value of t_funding_records.create_time
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.create_time
+	 * @param createTime  the value for t_funding_records.create_time
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.update_time
+	 * @return  the value of t_funding_records.update_time
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.update_time
+	 * @param updateTime  the value for t_funding_records.update_time
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.payee_id
+	 * @return  the value of t_funding_records.payee_id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public String getPayeeId() {
+		return payeeId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.payee_id
+	 * @param payeeId  the value for t_funding_records.payee_id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setPayeeId(String payeeId) {
+		this.payeeId = payeeId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.payer_id
+	 * @return  the value of t_funding_records.payer_id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public String getPayerId() {
+		return payerId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.payer_id
+	 * @param payerId  the value for t_funding_records.payer_id
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setPayerId(String payerId) {
+		this.payerId = payerId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.transaction_amount
+	 * @return  the value of t_funding_records.transaction_amount
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public BigDecimal getTransactionAmount() {
+		return transactionAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.transaction_amount
+	 * @param transactionAmount  the value for t_funding_records.transaction_amount
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setTransactionAmount(BigDecimal transactionAmount) {
+		this.transactionAmount = transactionAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.transaction_subject
+	 * @return  the value of t_funding_records.transaction_subject
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public Integer getTransactionSubject() {
+		return transactionSubject;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.transaction_subject
+	 * @param transactionSubject  the value for t_funding_records.transaction_subject
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setTransactionSubject(Integer transactionSubject) {
+		this.transactionSubject = transactionSubject;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.transaction_channel
+	 * @return  the value of t_funding_records.transaction_channel
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public Integer getTransactionChannel() {
+		return transactionChannel;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.transaction_channel
+	 * @param transactionChannel  the value for t_funding_records.transaction_channel
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setTransactionChannel(Integer transactionChannel) {
+		this.transactionChannel = transactionChannel;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.transaction_mode
+	 * @return  the value of t_funding_records.transaction_mode
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public Integer getTransactionMode() {
+		return transactionMode;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.transaction_mode
+	 * @param transactionMode  the value for t_funding_records.transaction_mode
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setTransactionMode(Integer transactionMode) {
+		this.transactionMode = transactionMode;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.remarks
+	 * @return  the value of t_funding_records.remarks
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public String getRemarks() {
+		return remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.remarks
+	 * @param remarks  the value for t_funding_records.remarks
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setRemarks(String remarks) {
+		this.remarks = remarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.confirm_sign
+	 * @return  the value of t_funding_records.confirm_sign
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public Integer getConfirmSign() {
+		return confirmSign;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.confirm_sign
+	 * @param confirmSign  the value for t_funding_records.confirm_sign
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setConfirmSign(Integer confirmSign) {
+		this.confirmSign = confirmSign;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_funding_records.delete_sign
+	 * @return  the value of t_funding_records.delete_sign
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public Boolean getDeleteSign() {
+		return deleteSign;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_funding_records.delete_sign
+	 * @param deleteSign  the value for t_funding_records.delete_sign
+	 * @mbg.generated  Tue Dec 26 11:19:48 CST 2017
+	 */
+	public void setDeleteSign(Boolean deleteSign) {
+		this.deleteSign = deleteSign;
+	}
+}

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


+ 652 - 0
src/main/java/com/goafanti/common/model/TOrder.java

@@ -0,0 +1,652 @@
+package com.goafanti.common.model;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class TOrder {
+
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.order_no
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Long orderNo;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.creater
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private String creater;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.create_time
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Date createTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.update_time
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Date updateTime;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.buyer_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private String buyerId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.seller_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private String sellerId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.commodity_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private String commodityId;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.commodity_quantity
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer commodityQuantity;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.commodity_price
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private BigDecimal commodityPrice;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.commodity_type
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer commodityType;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.commodity_mode
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private String commodityMode;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.first_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private BigDecimal firstPayment;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.order_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private BigDecimal orderAmount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.brokerage_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private BigDecimal brokerageAmount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.brokerage_proportion
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private BigDecimal brokerageProportion;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.actually_first_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private BigDecimal actuallyFirstPayment;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.actually_total_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private BigDecimal actuallyTotalPayment;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.actually_brokerage_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private BigDecimal actuallyBrokerageAmount;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.order_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer orderStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.intention_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer intentionStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.trading_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer tradingStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.technology_transfer_progress
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer technologyTransferProgress;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.payment_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer paymentStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.liquidation_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer liquidationStatus;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.order_follower
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private String orderFollower;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.order_channel
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Integer orderChannel;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.order_remarks
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private String orderRemarks;
+	/**
+	 * This field was generated by MyBatis Generator. This field corresponds to the database column t_order.delete_sign
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	private Boolean deleteSign;
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.order_no
+	 * @return  the value of t_order.order_no
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Long getOrderNo() {
+		return orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.order_no
+	 * @param orderNo  the value for t_order.order_no
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setOrderNo(Long orderNo) {
+		this.orderNo = orderNo;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.creater
+	 * @return  the value of t_order.creater
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public String getCreater() {
+		return creater;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.creater
+	 * @param creater  the value for t_order.creater
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setCreater(String creater) {
+		this.creater = creater;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.create_time
+	 * @return  the value of t_order.create_time
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.create_time
+	 * @param createTime  the value for t_order.create_time
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.update_time
+	 * @return  the value of t_order.update_time
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Date getUpdateTime() {
+		return updateTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.update_time
+	 * @param updateTime  the value for t_order.update_time
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setUpdateTime(Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.buyer_id
+	 * @return  the value of t_order.buyer_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public String getBuyerId() {
+		return buyerId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.buyer_id
+	 * @param buyerId  the value for t_order.buyer_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setBuyerId(String buyerId) {
+		this.buyerId = buyerId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.seller_id
+	 * @return  the value of t_order.seller_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public String getSellerId() {
+		return sellerId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.seller_id
+	 * @param sellerId  the value for t_order.seller_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setSellerId(String sellerId) {
+		this.sellerId = sellerId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.commodity_id
+	 * @return  the value of t_order.commodity_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public String getCommodityId() {
+		return commodityId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.commodity_id
+	 * @param commodityId  the value for t_order.commodity_id
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setCommodityId(String commodityId) {
+		this.commodityId = commodityId;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.commodity_quantity
+	 * @return  the value of t_order.commodity_quantity
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getCommodityQuantity() {
+		return commodityQuantity;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.commodity_quantity
+	 * @param commodityQuantity  the value for t_order.commodity_quantity
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setCommodityQuantity(Integer commodityQuantity) {
+		this.commodityQuantity = commodityQuantity;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.commodity_price
+	 * @return  the value of t_order.commodity_price
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public BigDecimal getCommodityPrice() {
+		return commodityPrice;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.commodity_price
+	 * @param commodityPrice  the value for t_order.commodity_price
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setCommodityPrice(BigDecimal commodityPrice) {
+		this.commodityPrice = commodityPrice;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.commodity_type
+	 * @return  the value of t_order.commodity_type
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getCommodityType() {
+		return commodityType;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.commodity_type
+	 * @param commodityType  the value for t_order.commodity_type
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setCommodityType(Integer commodityType) {
+		this.commodityType = commodityType;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.commodity_mode
+	 * @return  the value of t_order.commodity_mode
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public String getCommodityMode() {
+		return commodityMode;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.commodity_mode
+	 * @param commodityMode  the value for t_order.commodity_mode
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setCommodityMode(String commodityMode) {
+		this.commodityMode = commodityMode;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.first_payment
+	 * @return  the value of t_order.first_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public BigDecimal getFirstPayment() {
+		return firstPayment;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.first_payment
+	 * @param firstPayment  the value for t_order.first_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setFirstPayment(BigDecimal firstPayment) {
+		this.firstPayment = firstPayment;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.order_amount
+	 * @return  the value of t_order.order_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public BigDecimal getOrderAmount() {
+		return orderAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.order_amount
+	 * @param orderAmount  the value for t_order.order_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setOrderAmount(BigDecimal orderAmount) {
+		this.orderAmount = orderAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.brokerage_amount
+	 * @return  the value of t_order.brokerage_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public BigDecimal getBrokerageAmount() {
+		return brokerageAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.brokerage_amount
+	 * @param brokerageAmount  the value for t_order.brokerage_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setBrokerageAmount(BigDecimal brokerageAmount) {
+		this.brokerageAmount = brokerageAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.brokerage_proportion
+	 * @return  the value of t_order.brokerage_proportion
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public BigDecimal getBrokerageProportion() {
+		return brokerageProportion;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.brokerage_proportion
+	 * @param brokerageProportion  the value for t_order.brokerage_proportion
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setBrokerageProportion(BigDecimal brokerageProportion) {
+		this.brokerageProportion = brokerageProportion;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.actually_first_payment
+	 * @return  the value of t_order.actually_first_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public BigDecimal getActuallyFirstPayment() {
+		return actuallyFirstPayment;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.actually_first_payment
+	 * @param actuallyFirstPayment  the value for t_order.actually_first_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setActuallyFirstPayment(BigDecimal actuallyFirstPayment) {
+		this.actuallyFirstPayment = actuallyFirstPayment;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.actually_total_payment
+	 * @return  the value of t_order.actually_total_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public BigDecimal getActuallyTotalPayment() {
+		return actuallyTotalPayment;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.actually_total_payment
+	 * @param actuallyTotalPayment  the value for t_order.actually_total_payment
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setActuallyTotalPayment(BigDecimal actuallyTotalPayment) {
+		this.actuallyTotalPayment = actuallyTotalPayment;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.actually_brokerage_amount
+	 * @return  the value of t_order.actually_brokerage_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public BigDecimal getActuallyBrokerageAmount() {
+		return actuallyBrokerageAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.actually_brokerage_amount
+	 * @param actuallyBrokerageAmount  the value for t_order.actually_brokerage_amount
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setActuallyBrokerageAmount(BigDecimal actuallyBrokerageAmount) {
+		this.actuallyBrokerageAmount = actuallyBrokerageAmount;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.order_status
+	 * @return  the value of t_order.order_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getOrderStatus() {
+		return orderStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.order_status
+	 * @param orderStatus  the value for t_order.order_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setOrderStatus(Integer orderStatus) {
+		this.orderStatus = orderStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.intention_status
+	 * @return  the value of t_order.intention_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getIntentionStatus() {
+		return intentionStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.intention_status
+	 * @param intentionStatus  the value for t_order.intention_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setIntentionStatus(Integer intentionStatus) {
+		this.intentionStatus = intentionStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.trading_status
+	 * @return  the value of t_order.trading_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getTradingStatus() {
+		return tradingStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.trading_status
+	 * @param tradingStatus  the value for t_order.trading_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setTradingStatus(Integer tradingStatus) {
+		this.tradingStatus = tradingStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.technology_transfer_progress
+	 * @return  the value of t_order.technology_transfer_progress
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getTechnologyTransferProgress() {
+		return technologyTransferProgress;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.technology_transfer_progress
+	 * @param technologyTransferProgress  the value for t_order.technology_transfer_progress
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setTechnologyTransferProgress(Integer technologyTransferProgress) {
+		this.technologyTransferProgress = technologyTransferProgress;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.payment_status
+	 * @return  the value of t_order.payment_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getPaymentStatus() {
+		return paymentStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.payment_status
+	 * @param paymentStatus  the value for t_order.payment_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setPaymentStatus(Integer paymentStatus) {
+		this.paymentStatus = paymentStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.liquidation_status
+	 * @return  the value of t_order.liquidation_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getLiquidationStatus() {
+		return liquidationStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.liquidation_status
+	 * @param liquidationStatus  the value for t_order.liquidation_status
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setLiquidationStatus(Integer liquidationStatus) {
+		this.liquidationStatus = liquidationStatus;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.order_follower
+	 * @return  the value of t_order.order_follower
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public String getOrderFollower() {
+		return orderFollower;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.order_follower
+	 * @param orderFollower  the value for t_order.order_follower
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setOrderFollower(String orderFollower) {
+		this.orderFollower = orderFollower;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.order_channel
+	 * @return  the value of t_order.order_channel
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Integer getOrderChannel() {
+		return orderChannel;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.order_channel
+	 * @param orderChannel  the value for t_order.order_channel
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setOrderChannel(Integer orderChannel) {
+		this.orderChannel = orderChannel;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.order_remarks
+	 * @return  the value of t_order.order_remarks
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public String getOrderRemarks() {
+		return orderRemarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.order_remarks
+	 * @param orderRemarks  the value for t_order.order_remarks
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setOrderRemarks(String orderRemarks) {
+		this.orderRemarks = orderRemarks;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method returns the value of the database column t_order.delete_sign
+	 * @return  the value of t_order.delete_sign
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public Boolean getDeleteSign() {
+		return deleteSign;
+	}
+
+	/**
+	 * This method was generated by MyBatis Generator. This method sets the value of the database column t_order.delete_sign
+	 * @param deleteSign  the value for t_order.delete_sign
+	 * @mbg.generated  Tue Dec 26 20:46:24 CST 2017
+	 */
+	public void setDeleteSign(Boolean deleteSign) {
+		this.deleteSign = deleteSign;
+	}
+}

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


+ 185 - 0
src/main/java/com/goafanti/common/utils/DecimalCalculate.java

@@ -0,0 +1,185 @@
+package com.goafanti.common.utils;
+
+import java.math.BigDecimal;
+
+public class DecimalCalculate {
+	// 默认除法运算精度
+	private static final int DEF_DIV_SCALE = 10;
+
+	/**
+	 * 提供精确的加法运算。
+	 * 
+	 * @param v1
+	 *            被加数
+	 * @param v2
+	 *            加数
+	 * @return 两个参数的和
+	 */
+	public static double add(double v1, double v2) {
+		BigDecimal b1 = new BigDecimal(Double.toString(v1));
+		BigDecimal b2 = new BigDecimal(Double.toString(v2));
+		return b1.add(b2).doubleValue();
+	}
+
+	/**
+	 * 提供精确的减法运算。
+	 * 
+	 * @param v1
+	 *            被减数
+	 * @param v2
+	 *            减数
+	 * @return 两个参数的差
+	 */
+	public static double sub(double v1, double v2) {
+		BigDecimal b1 = new BigDecimal(Double.toString(v1));
+		BigDecimal b2 = new BigDecimal(Double.toString(v2));
+		return b1.subtract(b2).doubleValue();
+	}
+
+	/**
+	 * 提供精确的乘法运算。
+	 * 
+	 * @param v1
+	 *            被乘数
+	 * @param v2
+	 *            乘数
+	 * @return 两个参数的积
+	 */
+	public static double mul(double v1, double v2) {
+		BigDecimal b1 = new BigDecimal(Double.toString(v1));
+		BigDecimal b2 = new BigDecimal(Double.toString(v2));
+		return b1.multiply(b2).doubleValue();
+	}
+
+	/**
+	 * 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 小数点以后10位,以后的数字四舍五入。
+	 * 
+	 * @param v1
+	 *            被除数
+	 * @param v2
+	 *            除数
+	 * @return 两个参数的商
+	 */
+	public static double div(double v1, double v2) {
+		return div(v1, v2, DEF_DIV_SCALE);
+	}
+
+	/**
+	 * 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 定精度,以后的数字四舍五入。
+	 * 
+	 * @param v1
+	 *            被除数
+	 * @param v2
+	 *            除数
+	 * @param scale
+	 *            表示表示需要精确到小数点以后几位。
+	 * @return 两个参数的商
+	 */
+	public static double div(double v1, double v2, int scale) {
+		if (scale < 0) {
+			throw new IllegalArgumentException("The scale must be a positive integer or zero");
+		}
+		BigDecimal b1 = new BigDecimal(Double.toString(v1));
+		BigDecimal b2 = new BigDecimal(Double.toString(v2));
+		return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
+	}
+
+	/**
+	 * 提供精确的小数位四舍五入处理。
+	 * 
+	 * @param v
+	 *            需要四舍五入的数字
+	 * @param scale
+	 *            小数点后保留几位
+	 * @return 四舍五入后的结果
+	 */
+	public static double round(double v, int scale) {
+		if (scale < 0) {
+			throw new IllegalArgumentException("The scale must be a positive integer or zero");
+		}
+		BigDecimal b = new BigDecimal(Double.toString(v));
+		BigDecimal one = new BigDecimal("1");
+		return b.divide(one, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
+	}
+
+	/**
+	 * 提供精确的类型转换(Float)
+	 * 
+	 * @param v
+	 *            需要被转换的数字
+	 * @return 返回转换结果
+	 */
+	public static float convertsToFloat(double v) {
+		BigDecimal b = new BigDecimal(v);
+		return b.floatValue();
+	}
+
+	/**
+	 * 提供精确的类型转换(Int)不进行四舍五入
+	 * 
+	 * @param v
+	 *            需要被转换的数字
+	 * @return 返回转换结果
+	 */
+	public static int convertsToInt(double v) {
+		BigDecimal b = new BigDecimal(v);
+		return b.intValue();
+	}
+
+	/**
+	 * 提供精确的类型转换(Long)
+	 * 
+	 * @param v
+	 *            需要被转换的数字
+	 * @return 返回转换结果
+	 */
+	public static long convertsToLong(double v) {
+		BigDecimal b = new BigDecimal(v);
+		return b.longValue();
+	}
+
+	/**
+	 * 返回两个数中大的一个值
+	 * 
+	 * @param v1
+	 *            需要被对比的第一个数
+	 * @param v2
+	 *            需要被对比的第二个数
+	 * @return 返回两个数中大的一个值
+	 */
+	public static double returnMax(double v1, double v2) {
+		BigDecimal b1 = new BigDecimal(v1);
+		BigDecimal b2 = new BigDecimal(v2);
+		return b1.max(b2).doubleValue();
+	}
+
+	/**
+	 * 返回两个数中小的一个值
+	 * 
+	 * @param v1
+	 *            需要被对比的第一个数
+	 * @param v2
+	 *            需要被对比的第二个数
+	 * @return 返回两个数中小的一个值
+	 */
+	public static double returnMin(double v1, double v2) {
+		BigDecimal b1 = new BigDecimal(v1);
+		BigDecimal b2 = new BigDecimal(v2);
+		return b1.min(b2).doubleValue();
+	}
+
+	/**
+	 * 精确对比两个数字
+	 * 
+	 * @param v1
+	 *            需要被对比的第一个数
+	 * @param v2
+	 *            需要被对比的第二个数
+	 * @return 如果两个数一样则返回0,如果第一个数比第二个数大则返回1,反之返回-1
+	 */
+	public static int compareTo(double v1, double v2) {
+		BigDecimal b1 = new BigDecimal(v1);
+		BigDecimal b2 = new BigDecimal(v2);
+		return b1.compareTo(b2);
+	}
+}

+ 110 - 111
src/main/java/com/goafanti/core/mybatis/JDBCIdGenerator.java

@@ -1,112 +1,111 @@
-package com.goafanti.core.mybatis;
-
-import java.text.MessageFormat;
-import java.util.Calendar;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.util.Assert;
-
-import com.goafanti.common.utils.LoggerUtils;
-import com.goafanti.common.utils.StringUtils;
-
-/**
- * 
- * @author xiaolong
- *
- */
-public class JDBCIdGenerator {
-
-	private static final long	JDBC_EPOCH;
-
-	private static final long	SEQUENCE_BITS				= 12L;
-
-	private static final long	WORKER_ID_BITS				= 10L;
-
-	private static final long	SEQUENCE_MASK				= (1 << SEQUENCE_BITS) - 1;
-
-	private static final long	WORKER_ID_LEFT_SHIFT_BITS	= SEQUENCE_BITS;
-
-	private static final long	TIMESTAMP_LEFT_SHIFT_BITS	= WORKER_ID_LEFT_SHIFT_BITS + WORKER_ID_BITS;
-
-	private static final long	WORKER_ID_MAX_VALUE			= 1L << WORKER_ID_BITS;
-
-	private static final Logger	logger						= LoggerFactory.getLogger(JDBCIdGenerator.class);
-
-	private static long			workerId;
-
-	static {
-		Calendar calendar = Calendar.getInstance();
-		calendar.set(2016, Calendar.NOVEMBER, 1);
-		calendar.set(Calendar.HOUR_OF_DAY, 0);
-		calendar.set(Calendar.MINUTE, 0);
-		calendar.set(Calendar.SECOND, 0);
-		calendar.set(Calendar.MILLISECOND, 0);
-		JDBC_EPOCH = calendar.getTimeInMillis();
-		initWorkerId();
-	}
-
-	private long	sequence;
-
-	private long	lastTime;
-
-	static void initWorkerId() {
-		String workerId = System.getProperty("jdbc.worker.id");
-		if (StringUtils.isNoneBlank(workerId)) {
-			setWorkerId(Long.valueOf(workerId));
-			return;
-		}
-		workerId = System.getenv("JDBC_WORKER_ID");
-		if (StringUtils.isNoneBlank(workerId)) {
-			setWorkerId(Long.valueOf(workerId));
-			return;
-		}
-		setWorkerId(0l);
-	}
-
-	/**
-	 * 设置工作进程Id.
-	 *
-	 * @param workerId
-	 *            工作进程Id
-	 */
-	public static void setWorkerId(final Long workerId) {
-		LoggerUtils.debug(logger, "工作进程ID:[%s]", workerId);
-		Assert.isTrue(workerId > 0L && workerId < WORKER_ID_MAX_VALUE, "工作进程ID不能为空,且小于1024");
-		JDBCIdGenerator.workerId = workerId;
-	}
-
-	/**
-	 * 生成Id.
-	 *
-	 * @return 返回@{@link Long}类型的Id
-	 */
-	public synchronized Long generateId() {
-		long time = System.currentTimeMillis();
-		Assert.isTrue(lastTime <= time,
-				MessageFormat.format(
-						"Clock is moving backwards, last time is {0} milliseconds, current time is {1} milliseconds",
-						lastTime, time));
-		if (lastTime == time) {
-			if (0L == (sequence = ++sequence & SEQUENCE_MASK)) {
-				time = waitUntilNextTime(time);
-			}
-		} else {
-			sequence = 0;
-		}
-		lastTime = time;
-		Long res = ((time - JDBC_EPOCH) << TIMESTAMP_LEFT_SHIFT_BITS) | (workerId << WORKER_ID_LEFT_SHIFT_BITS)
-				| sequence;
-		LoggerUtils.debug(logger, "生成JDBCID:[%s] -- [%s] -- [%s] -- [%s]", lastTime, workerId, sequence, res);
-		return res;
-	}
-
-	private long waitUntilNextTime(final long lastTime) {
-		long time = System.currentTimeMillis();
-		while (time <= lastTime) {
-			time = System.currentTimeMillis();
-		}
-		return time;
-	}
-
+package com.goafanti.core.mybatis;
+
+import java.text.MessageFormat;
+import java.util.Calendar;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.Assert;
+
+import com.goafanti.common.utils.LoggerUtils;
+import com.goafanti.common.utils.StringUtils;
+
+/**
+ * 
+ * @author xiaolong
+ *
+ */
+public class JDBCIdGenerator {
+
+	private static final long	JDBC_EPOCH;
+
+	private static final long	SEQUENCE_BITS				= 12L;
+
+	private static final long	WORKER_ID_BITS				= 10L;
+
+	private static final long	SEQUENCE_MASK				= (1 << SEQUENCE_BITS) - 1;
+
+	private static final long	WORKER_ID_LEFT_SHIFT_BITS	= SEQUENCE_BITS;
+
+	private static final long	TIMESTAMP_LEFT_SHIFT_BITS	= WORKER_ID_LEFT_SHIFT_BITS + WORKER_ID_BITS;
+
+	private static final long	WORKER_ID_MAX_VALUE			= 1L << WORKER_ID_BITS;
+
+	private static final Logger	logger						= LoggerFactory.getLogger(JDBCIdGenerator.class);
+
+	private static long			workerId;
+
+	static {
+		Calendar calendar = Calendar.getInstance();
+		calendar.set(2016, Calendar.NOVEMBER, 1);
+		calendar.set(Calendar.HOUR_OF_DAY, 0);
+		calendar.set(Calendar.MINUTE, 0);
+		calendar.set(Calendar.SECOND, 0);
+		calendar.set(Calendar.MILLISECOND, 0);
+		JDBC_EPOCH = calendar.getTimeInMillis();
+		initWorkerId();
+	}
+
+	private long	sequence;
+
+	private long	lastTime;
+
+	static void initWorkerId() {
+		String workerId = System.getProperty("jdbc.worker.id");
+		if (StringUtils.isNoneBlank(workerId)) {
+			setWorkerId(Long.valueOf(workerId));
+			return;
+		}
+		workerId = System.getenv("JDBC_WORKER_ID");
+		if (StringUtils.isNoneBlank(workerId)) {
+			setWorkerId(Long.valueOf(workerId));
+			return;
+		}
+		setWorkerId(0l);
+	}
+
+	/**
+	 * 设置工作进程Id.
+	 *
+	 * @param workerId
+	 *            工作进程Id
+	 */
+	public static void setWorkerId(final Long workerId) {
+		LoggerUtils.debug(logger, "工作进程ID:[%s]", workerId);
+		Assert.isTrue(workerId > 0L && workerId < WORKER_ID_MAX_VALUE, "工作进程ID不能为空,且小于1024");
+		JDBCIdGenerator.workerId = workerId;
+	}
+
+	/**
+	 * 生成Id.
+	 *
+	 * @return 返回@{@link Long}类型的Id
+	 */
+	public synchronized Long generateId() {
+		long time = System.currentTimeMillis();
+		Assert.isTrue(lastTime <= time,
+				MessageFormat.format(
+						"Clock is moving backwards, last time is {0} milliseconds, current time is {1} milliseconds",
+						lastTime, time));
+		if (lastTime == time) {
+			if (0L == (sequence = ++sequence & SEQUENCE_MASK)) {
+				time = waitUntilNextTime(time);
+			}
+		} else {
+			sequence = 0;
+		}
+		lastTime = time;
+		Long res = ((time - JDBC_EPOCH) << TIMESTAMP_LEFT_SHIFT_BITS) | (workerId << WORKER_ID_LEFT_SHIFT_BITS)
+				| sequence;
+		LoggerUtils.debug(logger, "生成JDBCID:[%s] -- [%s] -- [%s] -- [%s]", lastTime, workerId, sequence, res);
+		return res;
+	}
+
+	private long waitUntilNextTime(final long lastTime) {
+		long time = System.currentTimeMillis();
+		while (time <= lastTime) {
+			time = System.currentTimeMillis();
+		}
+		return time;
+	}
 }

+ 1 - 0
src/main/java/com/goafanti/message/service/impl/MessageServiceImpl.java

@@ -381,4 +381,5 @@ public class MessageServiceImpl  extends BaseMybatisDao<MessageFromSystemMapper>
 		jea.setEasemobPass(easemobPass);
 		return jpushEasemobAccountMapper.insert(jea);
 	}
+	
 }

+ 70 - 0
src/main/java/com/goafanti/order/bo/FundingListBo.java

@@ -0,0 +1,70 @@
+package com.goafanti.order.bo;
+
+import java.math.BigDecimal;
+
+public class FundingListBo {
+	/** 订单编号 **/
+	private String orderNo;
+	/** 商品id **/
+	private String commodityId;
+	/** 商品名称 **/
+	private String commodityName;
+	/** 商品类型 **/
+	private Integer commodityType;
+	/** 支付流水时间 **/
+	private String createTime;
+	/** 交易科目 **/
+	private Integer transactionSubject;
+	/** 交易金额 **/
+	private BigDecimal transactionAmount;
+	/** 业务描述  收入 与 支出**/
+	private String businessDesc;
+	public String getOrderNo() {
+		return orderNo;
+	}
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+	public String getCommodityId() {
+		return commodityId;
+	}
+	public void setCommodityId(String commodityId) {
+		this.commodityId = commodityId;
+	}
+	public String getCommodityName() {
+		return commodityName;
+	}
+	public void setCommodityName(String commodityName) {
+		this.commodityName = commodityName;
+	}
+	public Integer getCommodityType() {
+		return commodityType;
+	}
+	public void setCommodityType(Integer commodityType) {
+		this.commodityType = commodityType;
+	}
+	public String getCreateTime() {
+		return createTime;
+	}
+	public void setCreateTime(String createTime) {
+		this.createTime = createTime;
+	}
+	public Integer getTransactionSubject() {
+		return transactionSubject;
+	}
+	public void setTransactionSubject(Integer transactionSubject) {
+		this.transactionSubject = transactionSubject;
+	}
+	public BigDecimal getTransactionAmount() {
+		return transactionAmount;
+	}
+	public void setTransactionAmount(BigDecimal transactionAmount) {
+		this.transactionAmount = transactionAmount;
+	}
+	public String getBusinessDesc() {
+		return businessDesc;
+	}
+	public void setBusinessDesc(String businessDesc) {
+		this.businessDesc = businessDesc;
+	}
+}

+ 89 - 0
src/main/java/com/goafanti/order/bo/OperatorActive.java

@@ -0,0 +1,89 @@
+package com.goafanti.order.bo;
+
+/**
+ * 设置用户和管理员可操作选项
+ *
+ */
+public class OperatorActive {
+	/** 确认意向订单 **/
+	private boolean confirmIntention;
+	/** 拒绝意向订单 **/
+	private boolean refuseIntention;
+	/** 支付首付 **/
+	private boolean payForFirst; 
+	/** 确认支付首付 **/
+	private boolean confirmPayForFirst; 
+	/** 支付尾款 **/
+	private boolean payForLast; 
+	/** 确认支付尾款 **/
+	private boolean confirmPayForLast;
+	/** 申请取消 **/
+	private boolean applyForCancel; 
+	/** 确认退款 **/
+	private boolean confirmRefund;
+	/** 申请提现 **/
+	private boolean applyForWithdraw;
+	/** 确认提现 **/
+	private boolean confirmWithdraw;
+	
+	public boolean isConfirmIntention() {
+		return confirmIntention;
+	}
+	public void setConfirmIntention(boolean confirmIntention) {
+		this.confirmIntention = confirmIntention;
+	}
+	public boolean isRefuseIntention() {
+		return refuseIntention;
+	}
+	public void setRefuseIntention(boolean refuseIntention) {
+		this.refuseIntention = refuseIntention;
+	}
+	public boolean isPayForFirst() {
+		return payForFirst;
+	}
+	public void setPayForFirst(boolean payForFirst) {
+		this.payForFirst = payForFirst;
+	}
+	public boolean isConfirmPayForFirst() {
+		return confirmPayForFirst;
+	}
+	public void setConfirmPayForFirst(boolean confirmPayForFirst) {
+		this.confirmPayForFirst = confirmPayForFirst;
+	}
+	public boolean isPayForLast() {
+		return payForLast;
+	}
+	public void setPayForLast(boolean payForLast) {
+		this.payForLast = payForLast;
+	}
+	public boolean isConfirmPayForLast() {
+		return confirmPayForLast;
+	}
+	public void setConfirmPayForLast(boolean confirmPayForLast) {
+		this.confirmPayForLast = confirmPayForLast;
+	}
+	public boolean isApplyForCancel() {
+		return applyForCancel;
+	}
+	public void setApplyForCancel(boolean applyForCancel) {
+		this.applyForCancel = applyForCancel;
+	}
+	public boolean isConfirmRefund() {
+		return confirmRefund;
+	}
+	public void setConfirmRefund(boolean confirmRefund) {
+		this.confirmRefund = confirmRefund;
+	}
+	public boolean isApplyForWithdraw() {
+		return applyForWithdraw;
+	}
+	public void setApplyForWithdraw(boolean applyForWithdraw) {
+		this.applyForWithdraw = applyForWithdraw;
+	}
+	public boolean isConfirmWithdraw() {
+		return confirmWithdraw;
+	}
+	public void setConfirmWithdraw(boolean confirmWithdraw) {
+		this.confirmWithdraw = confirmWithdraw;
+	}
+}

+ 124 - 0
src/main/java/com/goafanti/order/bo/OrderDetailBo.java

@@ -0,0 +1,124 @@
+package com.goafanti.order.bo;
+
+public class OrderDetailBo {
+	/** 订单编号 **/
+	private String orderNo;
+	/** 商品id **/
+	private String commodityId;
+	/** 商品名称 **/
+	private String commodityName;
+	/** 商品单价 **/
+	private String commodityPrice;
+	/** 商品数量 **/
+	private Integer commodityQuantity; 
+	/** 商品型号 **/
+	private String commodityMode;
+	/** 首付金 **/
+	private String firstPayment;
+	/** 商品类型 **/
+	private Integer commodityType;
+	/** 订单创建时间 **/
+	private String createTime;
+	/** 订单金额 **/
+	private String orderAmount;
+	/** 订单留言 **/
+	private String orderRemarks;
+	/** 商品简介 **/
+	private String introduction;
+	/** 卖方id **/
+	private String sellerId;
+	/** 订单状态 **/
+	private String orderStatus;
+	/** 可操作订单 **/
+	private OperatorActive operatorActive;
+	public String getOrderNo() {
+		return orderNo;
+	}
+	public void setOrderNo(String orderNo) {
+		this.orderNo = orderNo;
+	}
+	public String getCommodityId() {
+		return commodityId;
+	}
+	public void setCommodityId(String commodityId) {
+		this.commodityId = commodityId;
+	}
+	public String getCommodityName() {
+		return commodityName;
+	}
+	public void setCommodityName(String commodityName) {
+		this.commodityName = commodityName;
+	}
+	public String getCommodityPrice() {
+		return commodityPrice;
+	}
+	public void setCommodityPrice(String commodityPrice) {
+		this.commodityPrice = commodityPrice;
+	}
+	public Integer getCommodityQuantity() {
+		return commodityQuantity;
+	}
+	public void setCommodityQuantity(Integer commodityQuantity) {
+		this.commodityQuantity = commodityQuantity;
+	}
+	public String getCommodityMode() {
+		return commodityMode;
+	}
+	public void setCommodityMode(String commodityMode) {
+		this.commodityMode = commodityMode;
+	}
+	public String getFirstPayment() {
+		return firstPayment;
+	}
+	public void setFirstPayment(String firstPayment) {
+		this.firstPayment = firstPayment;
+	}
+	public Integer getCommodityType() {
+		return commodityType;
+	}
+	public void setCommodityType(Integer commodityType) {
+		this.commodityType = commodityType;
+	}
+	public String getCreateTime() {
+		return createTime;
+	}
+	public void setCreateTime(String createTime) {
+		this.createTime = createTime;
+	}
+	public String getOrderAmount() {
+		return orderAmount;
+	}
+	public void setOrderAmount(String orderAmount) {
+		this.orderAmount = orderAmount;
+	}
+	public String getOrderRemarks() {
+		return orderRemarks;
+	}
+	public void setOrderRemarks(String orderRemarks) {
+		this.orderRemarks = orderRemarks;
+	}
+	public String getIntroduction() {
+		return introduction;
+	}
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
+	}
+	public String getSellerId() {
+		return sellerId;
+	}
+	public void setSellerId(String sellerId) {
+		this.sellerId = sellerId;
+	}
+	public String getOrderStatus() {
+		return orderStatus;
+	}
+	public void setOrderStatus(String orderStatus) {
+		this.orderStatus = orderStatus;
+	}
+	public OperatorActive getOperatorActive() {
+		return operatorActive;
+	}
+	public void setOperatorActive(OperatorActive operatorActive) {
+		this.operatorActive = operatorActive;
+	}
+}

+ 224 - 0
src/main/java/com/goafanti/order/controller/OrderController.java

@@ -0,0 +1,224 @@
+package com.goafanti.order.controller;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.order.enums.CommodityType;
+import com.goafanti.order.service.OrderService;
+
+
+@RestController
+@RequestMapping(value = "/api/user/order")
+public class OrderController extends CertifyApiController{
+	
+	@Resource
+	private OrderService orderServiceImpl;
+	/**
+	 * 进入添加意向订单
+	 * @param commodityId 商品编号
+	 * @param commodityType 订单类型
+	 * @return
+	 */
+	@RequestMapping(value = "/toAddIntention" , method = RequestMethod.GET)
+	public Result toAddIntention(String commodityId,Integer commodityType){
+		Result res = new Result();
+		if(StringUtils.isBlank(commodityId) || null == commodityType){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"",""));
+			return res;
+		}
+		if(!CommodityType.containsType(commodityType)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","订单类型错误"));
+			return res;
+		}
+		res.setData(orderServiceImpl.selectCommodityDetail(commodityId, commodityType));
+		return res;
+	}
+	
+	/**
+	 * 添加意向订单
+	 * @param orderNo 订单编号
+	 * @param commodityId 商品id
+	 * @param commodityMode 商品规格
+	 * @param createTime 创建时间
+	 * @param commodityQuantity 商品数量
+	 * @param commodityType 商品类型
+	 * @return 
+	 * @throws ParseException 
+	 * @throws NumberFormatException 
+	 */
+	@RequestMapping(value = "/addIntention" , method = RequestMethod.POST)
+	public Result addIntention(String orderNo,String commodityId,String commodityMode,Integer commodityQuantity,Integer commodityType,
+			String createTime,String remarks) throws NumberFormatException, ParseException {
+		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
+			return res;
+		}
+		if(StringUtils.isBlank(commodityId)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","商品id"));
+			return res;
+		}
+		if(StringUtils.isBlank(createTime)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单时间"));
+			return res;
+		}
+		if(commodityQuantity == null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单数量"));
+			return res;
+		}
+		if(commodityType == null){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单类型"));
+			return res;
+		}
+		if(!CommodityType.containsType(commodityType)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","订单类型"));
+			return res;
+		}
+		orderServiceImpl.addIntention(Long.valueOf(orderNo),commodityId,commodityMode,commodityQuantity,commodityType,createTime,remarks);
+		return res;
+	}
+	
+	/**
+	 * 查看订单列表
+	 * @param confirm  我的意向-false 我的订单 - true
+	 * @return
+	 */
+	@RequestMapping(value = "/orderList", method = RequestMethod.POST)
+	public Result orderList(boolean confirm,Integer pageNo,Integer pageSize) {
+		Result res = new Result();
+		res.setData(orderServiceImpl.selectOrderList(confirm,pageNo,pageSize));
+		return res;
+	}
+	
+	/**
+	 * 查看订单详情
+	 * @return
+	 */
+	@RequestMapping(value ="/orderDetails", method = RequestMethod.GET)
+	public Result orderDetails(String orderNo) {
+		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR,"","订单编号"));
+			return res;
+		}
+		res.setData(orderServiceImpl.selectOrderDetail(Long.valueOf(orderNo)));
+		return res;
+	}
+	
+	/**
+	 * 订单支付(首付)
+	 * @param orderNo 订单编号
+	 * @param fundAmount 支付金额
+	 * @return 备注
+	 */
+	@RequestMapping(value = "/payForFirst", method = RequestMethod.POST)
+	public Result payForFirst(String orderNo,String fundAmount,String remarks) {
+		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
+			return res;
+		}
+		if(StringUtils.isBlank(fundAmount)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","支付金额"));
+			return res;
+		}
+		orderServiceImpl.payForFirst(Long.valueOf(orderNo),new BigDecimal(fundAmount),remarks);
+		return res;
+	}
+	
+	/**
+	 * 支付尾款
+	 * @param orderNo 订单编号
+	 * @param fundAmount 支付金额
+	 * @param remarks 备注
+	 * @return
+	 */
+	@RequestMapping(value = "/payForLast", method = RequestMethod.POST)
+	public Result payForLast(String orderNo,String fundAmount,String remarks){
+		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
+			return res;
+		}
+		if(StringUtils.isBlank(fundAmount)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","支付金额"));
+			return res;
+		}
+		orderServiceImpl.payForLast(Long.valueOf(orderNo),new BigDecimal(fundAmount),remarks);
+		return res;
+	}
+	
+	/**
+	 * 查询支付流水列表
+	 * @param orderNo
+	 * @return
+	 */
+	@RequestMapping(value = "/fundingHistory", method = RequestMethod.POST)
+	public Result fundingHistory(String orderNo,Integer pageNo,Integer pageSize) {
+		Result res = new Result();
+		if(StringUtils.isNotBlank(orderNo))
+			orderServiceImpl.selectFundingHistory(Long.valueOf(orderNo),pageNo,pageSize);
+		else
+			orderServiceImpl.selectFundingHistory(null,pageNo,pageSize);
+		return res;
+	}
+	
+	/**
+	 * 订单提现
+	 * @param orderNo
+	 * @return
+	 */
+	@RequestMapping(value = "/applyForWithdraw", method = RequestMethod.POST)
+	public Result applyForWithdraw(String orderNo,String remarks){
+		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
+			return res;
+		}
+		orderServiceImpl.applyForWithdraw(Long.valueOf(orderNo),remarks);
+		return res;
+	}
+	
+	/**
+	 * 取消订单
+	 * @param orderNo
+	 * @return
+	 */
+	@RequestMapping(value = "/applyForCancel", method = RequestMethod.GET)
+	public Result applyForCancel(String orderNo){
+		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
+			return res;
+		}
+		orderServiceImpl.applyForCancel(Long.valueOf(orderNo));
+		return res;
+	}
+	
+	/**
+	 * 确认意向
+	 * @param orderNo
+	 * @param confirm
+	 * @return
+	 */
+	@RequestMapping(value="/confirmIntention", method = RequestMethod.POST)
+	public Result confirmIntention(String orderNo,boolean confirm){
+		Result res = new Result();
+		if(StringUtils.isBlank(orderNo)){
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"","订单编号"));
+			return res;
+		}
+		orderServiceImpl.confirmIntention(Long.valueOf(orderNo),confirm);
+		return res;
+	}
+}

+ 51 - 0
src/main/java/com/goafanti/order/enums/AuditState.java

@@ -0,0 +1,51 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum AuditState {
+	/** 等待审核 **/
+	WAIT_AUDIT(0,"WAIT_AUDIT"),
+	/** 审核通过 **/
+	AUDIT_SUCCESS(1,"AUDIT_SUCCESS"),
+	/** 审核通过 **/
+	AUDIT_FAIL(2,"AUDIT_FAIL"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private AuditState(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, AuditState> status = new HashMap<Integer, AuditState>();
+
+	static {
+		for (AuditState value : AuditState.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static AuditState getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 57 - 0
src/main/java/com/goafanti/order/enums/CommodityType.java

@@ -0,0 +1,57 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum CommodityType {
+	/** 科技服务 **/
+	TECH_SERVICE(0,"TECH_SERVICE"),
+	/** 科技成果购买 **/
+	ACHIEVEMENT_PURCHASE(1,"ACHIEVEMENT_PURCHASE"),
+	/** 科技需求接单 **/
+	DEMAND_PROVIDE(2,"DEMAND_PROVIDE"),
+	/** 专家邀约  **/
+	EXPERT_INVITATION(3,"EXPERT_INVITATION"),
+	/** 活动报名 **/
+	ACTIVITY_APPLY(4,"ACTIVITY_APPLY"),
+	/** 会员升级 **/
+	MEMBER_UPGRADE(5,"MEMBER_UPGRADE"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	private CommodityType(Integer typeCode, String typeName) {
+		this.typeCode = typeCode;
+		this.typeName = typeName;
+	}
+
+	private static Map<Integer, CommodityType> types = new HashMap<Integer, CommodityType>();
+
+	static {
+		for (CommodityType value : CommodityType.values()) {
+			types.put(value.getTypeCode(), value);
+		}
+	}
+	public static CommodityType getTypeCode(Integer typeCode) {
+		if (containsType(typeCode)) {
+			return types.get(typeCode);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer typeCode) {
+		return types.containsKey(typeCode);
+	}
+	private Integer	typeCode;
+	private String	typeName;
+	
+	public Integer getTypeCode() {
+		return typeCode;
+	}
+	public void setTypeCode(Integer typeCode) {
+		this.typeCode = typeCode;
+	}
+	public String getTypeName() {
+		return typeName;
+	}
+	public void setTypeName(String typeName) {
+		this.typeName = typeName;
+	}
+}

+ 56 - 0
src/main/java/com/goafanti/order/enums/IntentionSate.java

@@ -0,0 +1,56 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum IntentionSate {
+	/** 待卖方确认 **/
+	WAIT_SELLER_CONFIRM(0,"WAIT_SELLER_CONFIRM"),
+	/** 卖方已确认 **/
+	SELLER_CONFIRM(1,"SELLER_CONFIRM"),
+	/** 卖方已拒绝 **/
+	SELLER_REFUSE(2,"SELLER_REFUSE"),
+	/** 买方已取消 **/
+	BUYER_CANCELLED(3,"BUYER_CANCELLED"),
+	/** 已过期 **/
+	EXPIRED(4,"EXPIRED"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private IntentionSate(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, IntentionSate> status = new HashMap<Integer, IntentionSate>();
+
+	static {
+		for (IntentionSate value : IntentionSate.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static IntentionSate getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 60 - 0
src/main/java/com/goafanti/order/enums/LiquidationSate.java

@@ -0,0 +1,60 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum LiquidationSate {
+	/** 等待支付  **/
+	WAIT_FOR_PAY(0,"WAIT_FOR_PAY"),
+	/** 部分支付 **/
+	PART_PAY(1,"PART_PAY"),
+	/** 已支付 **/
+	FULL_PAY(2,"FULL_PAY"),
+	/** 待提现 **/
+	WAIT_FOR_WITHDRAW(3,"WAIT_FOR_WITHDRAW"),
+	/** 支付结清 **/
+	PAY_SETTLE(4,"ALREADY_SETTLE"),
+	/** 等待退款 **/
+	WAIT_FOR_REFUND(5,"WAIT_FOR_REFUND"),
+	/** 退款结清 **/
+	REFUND_SETTLE(6,"REFUND_SETTLE"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private LiquidationSate(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, LiquidationSate> status = new HashMap<Integer, LiquidationSate>();
+
+	static {
+		for (LiquidationSate value : LiquidationSate.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static LiquidationSate getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 13 - 0
src/main/java/com/goafanti/order/enums/OrderAction.java

@@ -0,0 +1,13 @@
+package com.goafanti.order.enums;
+
+
+public enum OrderAction {
+	ADD_INTENTION,
+	CONFIRM_INTENTION,
+	CONFIRM_PAY_FOR_FIRST,
+	CONFIRM_PAY_FOR_LAST,
+	APPLY_FOR_WITHDRAW,
+	CONFIRM_WITHDRAW,
+	APPLY_FOR_CANCEL,
+	REFUND_CONFIRM
+}

+ 52 - 0
src/main/java/com/goafanti/order/enums/OrderChannel.java

@@ -0,0 +1,52 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum OrderChannel {
+	/** 手机APP **/
+	APP(0,"APP"),
+	/** 门户网站 **/
+	PORTAL(1,"PORTAL"),
+	/** 线下支付 **/
+	SCENE(2,"SCENE"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private OrderChannel(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, OrderChannel> channels = new HashMap<Integer, OrderChannel>();
+
+	static {
+		for (OrderChannel value : OrderChannel.values()) {
+			channels.put(value.getCode(), value);
+		}
+	}
+	public static OrderChannel getStatus(Integer code) {
+		if (containsType(code)) {
+			return channels.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return channels.containsKey(code);
+	}
+	
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 56 - 0
src/main/java/com/goafanti/order/enums/OrderState.java

@@ -0,0 +1,56 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum OrderState {
+	/** 意向订单 **/
+	INTENTION(0,"INTENTION"),
+	/** 交易中 **/
+	IN_TRADING(1,"IN_TRADING"),
+	/** 等待支付 **/
+	WAIT_FOR_PAY(2,"WAIT_FOR_PAY"),
+	/** 已完成 **/
+	COMPLETED(3,"COMPLETED"),
+	/** 已取消 **/
+	CANCELLED(4,"CANCELLED"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private OrderState(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, OrderState> status = new HashMap<Integer, OrderState>();
+
+	static {
+		for (OrderState value : OrderState.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static OrderState getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+	
+}

+ 52 - 0
src/main/java/com/goafanti/order/enums/PayChannel.java

@@ -0,0 +1,52 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PayChannel {
+	/** 微信 **/
+	WECHAT(0,"WECHAT"),
+	/** 支付宝 **/
+	ALIPAY(1,"ALIPAY"),
+	/** 银联支付 **/
+	UNIONPAY(2,"UNIONPAY"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private PayChannel(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PayChannel> channels = new HashMap<Integer, PayChannel>();
+
+	static {
+		for (PayChannel value : PayChannel.values()) {
+			channels.put(value.getCode(), value);
+		}
+	}
+	public static PayChannel getStatus(Integer code) {
+		if (containsType(code)) {
+			return channels.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return channels.containsKey(code);
+	}
+	
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 58 - 0
src/main/java/com/goafanti/order/enums/PaymentState.java

@@ -0,0 +1,58 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum PaymentState {
+	/** 首付待付清 **/
+	WAIT_PAY_FIRST_BALANCE(0,"WAIT_PAY_FIRST_BALANCE"),
+	/** 已首付 **/
+	ALREADY_FIRST_PAY(1,"ALREADY_FIRST_PAY"),
+	/** 尾款待付清 **/
+	WAIT_PAY_LAST_BALANCE(2,"WAIT_PAY_LAST_BALANCE"),
+	/** 尾款待付清 **/
+	ALREADY_LAST_PAY(3,"ALREADY_LAST_PAY"),
+	/** 待退款 **/
+	WAIT_FOR_REFUND(4,"WAIT_FOR_REFUND"),
+	/** 已退款 **/
+	ALREADY_REFUND(5,"ALREADY_REFUND"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private PaymentState(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, PaymentState> status = new HashMap<Integer, PaymentState>();
+
+	static {
+		for (PaymentState value : PaymentState.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static PaymentState getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 54 - 0
src/main/java/com/goafanti/order/enums/TradingState.java

@@ -0,0 +1,54 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum TradingState {
+	/** 等待交易 **/
+	WAIT_FOR_TRADE(0,"WAIT_FOR_TRADE"),
+	/** 交易中 **/
+	ON_TRADE(1,"ON_TRADE"),
+	/** 交易成功 **/
+	TRADE_SUCCESS(2,"TRADE_SUCCESS"),
+	/** 交易失败 **/
+	TRADE_FAILED(3,"TRADE_FAILED"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private TradingState(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, TradingState> status = new HashMap<Integer, TradingState>();
+
+	static {
+		for (TradingState value : TradingState.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static TradingState getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 50 - 0
src/main/java/com/goafanti/order/enums/TransactionMode.java

@@ -0,0 +1,50 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public enum TransactionMode {
+	/** 线上支付 **/
+	ONLINE(0,"ONLINE"),
+	/** 线下支付 **/
+	OFFLINE(1,"OFFLINE"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private TransactionMode(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, TransactionMode> status = new HashMap<Integer, TransactionMode>();
+
+	static {
+		for (TransactionMode value : TransactionMode.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+	public static TransactionMode getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+	
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 56 - 0
src/main/java/com/goafanti/order/enums/TransactionSubject.java

@@ -0,0 +1,56 @@
+package com.goafanti.order.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 资金流水科目
+ * @author Administrator
+ *
+ */
+public enum TransactionSubject {
+	/** 代收 **/
+	SUPPLY_COLLECT(0,"SUPPLY_COLLECT"),
+	/** 代付 **/
+	SUPPLY_PAY(1,"SUPPLY_PAY"),
+	/** 退款 **/
+	REFUND(2,"REFUND"),
+	/** 无效 **/
+	INVALID(10, "INVALID");
+	
+	private TransactionSubject(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, TransactionSubject> subjects = new HashMap<Integer, TransactionSubject>();
+
+	static {
+		for (TransactionSubject value : TransactionSubject.values()) {
+			subjects.put(value.getCode(), value);
+		}
+	}
+	public static TransactionSubject getStatus(Integer code) {
+		if (containsType(code)) {
+			return subjects.get(code);
+		}
+		return INVALID;
+	}
+	public static boolean containsType(Integer code) {
+		return subjects.containsKey(code);
+	}
+	private Integer	code;
+	private String	desc;
+	public Integer getCode() {
+		return code;
+	}
+	public void setCode(Integer code) {
+		this.code = code;
+	}
+	public String getDesc() {
+		return desc;
+	}
+	public void setDesc(String desc) {
+		this.desc = desc;
+	}
+}

+ 93 - 0
src/main/java/com/goafanti/order/service/OrderService.java

@@ -0,0 +1,93 @@
+package com.goafanti.order.service;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.order.bo.FundingListBo;
+import com.goafanti.order.bo.OrderDetailBo;
+
+public interface OrderService {
+	
+	/**
+	 * 查询商品详情
+	 * @param commodityId 商品id
+	 * @param orderType 订单类型
+	 * @return
+	 */
+	OrderDetailBo selectCommodityDetail(String commodityId,Integer orderType);
+
+	/**
+	 * 添加意向
+	 * @param orderNo 订单编号
+	 * @param commodityId 商品id
+	 * @param commodityMode 商品型号
+	 * @param commodityQuantity 商品数量
+	 * @param commodityType 商品类型
+	 * @param createTime 创建时间
+	 * @param remarks 备注
+	 * @return
+	 */
+	int addIntention(Long orderNo, String commodityId, String commodityMode, Integer commodityQuantity,Integer commodityType,
+			String createTime, String remarks) throws ParseException ;
+
+	/**
+	 * 支付定金
+	 * @param orderNo 订单编号
+	 * @param fundAmount 金额
+	 * @return remarks 备注
+	 */
+	int payForFirst(Long orderNo, BigDecimal fundAmount,String remarks);
+
+	/**
+	 * 支付尾款
+	 * @param orderNo 订单编号
+	 * @param fundAmount 金额
+	 * @param remarks 备注
+	 * @return
+	 */
+	int payForLast(Long orderNo, BigDecimal fundAmount, String remarks);
+
+	/**
+	 * 
+	 * @param confirm 是否
+	 * @return
+	 */
+	Pagination<OrderDetailBo> selectOrderList(boolean confirm,Integer pageNo,Integer PageSize);
+
+	/**
+	 * 查询订单详情
+	 * @param orderNo
+	 * @return
+	 */
+	OrderDetailBo selectOrderDetail(Long orderNo);
+
+	/**
+	 * 查询流水记录
+	 * @param orderNo
+	 * @return
+	 */
+	Pagination<FundingListBo> selectFundingHistory(Long orderNo,Integer pageNo,Integer PageSize);
+
+	/**
+	 * 提现
+	 * @param orderNo
+	 * @return
+	 */
+	int applyForWithdraw(Long orderNo,String remarks);
+
+	/**
+	 * 取消订单
+	 * @param orderNo
+	 * @return
+	 */
+	int applyForCancel(Long orderNo);
+
+	/**
+	 * 确认意向订单
+	 * @param orderNo 订单编号
+	 * @param confirm 是否确认
+	 * @return
+	 */
+	int confirmIntention(Long orderNo, boolean confirm);
+}

+ 579 - 0
src/main/java/com/goafanti/order/service/impl/OrderServiceImpl.java

@@ -0,0 +1,579 @@
+package com.goafanti.order.service.impl;
+
+import java.math.BigDecimal;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.goafanti.common.bo.Error;
+import com.goafanti.common.constant.AFTConstants;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.dao.TFundingRecordsMapper;
+import com.goafanti.common.dao.TOrderMapper;
+import com.goafanti.common.error.BusinessException;
+import com.goafanti.common.model.Admin;
+import com.goafanti.common.model.TFundingRecords;
+import com.goafanti.common.model.TOrder;
+import com.goafanti.common.model.User;
+import com.goafanti.common.utils.DateUtils;
+import com.goafanti.common.utils.DecimalCalculate;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.JDBCIdGenerator;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.order.bo.FundingListBo;
+import com.goafanti.order.bo.OperatorActive;
+import com.goafanti.order.bo.OrderDetailBo;
+import com.goafanti.order.enums.AuditState;
+import com.goafanti.order.enums.IntentionSate;
+import com.goafanti.order.enums.LiquidationSate;
+import com.goafanti.order.enums.OrderAction;
+import com.goafanti.order.enums.OrderChannel;
+import com.goafanti.order.enums.OrderState;
+import com.goafanti.order.enums.PayChannel;
+import com.goafanti.order.enums.PaymentState;
+import com.goafanti.order.enums.TradingState;
+import com.goafanti.order.enums.TransactionMode;
+import com.goafanti.order.enums.TransactionSubject;
+import com.goafanti.order.service.OrderService;
+
+@Service
+public class OrderServiceImpl extends BaseMybatisDao<TOrderMapper> implements OrderService {
+	
+	@Autowired
+	private TOrderMapper tOrderMapper;
+	@Autowired
+	private JDBCIdGenerator	idGenerator;
+	@Autowired
+	private TFundingRecordsMapper tFundingRecordsMapper;
+	
+	private final BigDecimal DEFAULT_FIRST_PAYMENT = new BigDecimal(0);// 默认首付价格
+	private final BigDecimal DEFAULT_COMMODITY_PRICE = new BigDecimal(0);// 默认单价
+	private final String DEFAULT_PLATFORM_ID = "0";// 平台默认id
+	private final double  DEFAULT_BROKERAGE_PROPORTION = 0; //佣金比例
+	private final double DEFAULT_COMMODITY_DISCOUNT = 1; //折扣比例
+	private final String DEFAULT_COMMODITY_MODE = "NO_MODE"; //暂无规格
+	@Override
+	public OrderDetailBo selectCommodityDetail(String commodityId, Integer commodityType) {
+		OrderDetailBo bo = tOrderMapper.selectCommodityDetail(commodityId,commodityType);
+		bo.setOrderNo(String.valueOf(idGenerator.generateId()));
+		bo.setCreateTime(DateUtils.formatDate(new Date(),AFTConstants.YYYYMMDDHHMMSS));
+		bo.setCommodityType(commodityType);
+		if(StringUtils.isBlank(bo.getFirstPayment())) bo.setFirstPayment(String.valueOf(DEFAULT_FIRST_PAYMENT.doubleValue()));
+		return bo;
+	}
+
+	@Override
+	public int addIntention(Long orderNo, String commodityId, String commodityMode, Integer commodityQuantity,Integer commodityType, 
+			String createTime,String remarks) throws ParseException {
+		OrderDetailBo bo =  tOrderMapper.selectCommodityDetail(commodityId,commodityType);
+		BigDecimal commodityPrice = StringUtils.isBlank(bo.getCommodityPrice()) ? DEFAULT_COMMODITY_PRICE 
+				: new BigDecimal(DecimalCalculate.mul(Double.valueOf(bo.getCommodityPrice()),DEFAULT_COMMODITY_DISCOUNT));
+		BigDecimal orderAmount = new BigDecimal(DecimalCalculate.mul(commodityPrice.doubleValue(),Double.valueOf(String.valueOf(commodityQuantity))));
+		TOrder tOrder = new TOrder();
+		tOrder.setOrderNo(orderNo);
+		tOrder.setCommodityId(commodityId);
+		tOrder.setCreater(TokenManager.getUserToken().getNickname());
+		tOrder.setCreateTime(DateUtils.parseDate(createTime, AFTConstants.YYYYMMDDHHMMSS));
+		tOrder.setBuyerId(TokenManager.getUserId());
+		tOrder.setSellerId(StringUtils.isBlank(bo.getSellerId()) ? DEFAULT_PLATFORM_ID : bo.getSellerId());
+		tOrder.setCommodityMode(StringUtils.isBlank(commodityMode)?DEFAULT_COMMODITY_MODE: commodityMode);
+		tOrder.setCommodityType(commodityType);
+		tOrder.setCommodityQuantity(commodityQuantity);
+		tOrder.setBrokerageProportion(new BigDecimal(DEFAULT_BROKERAGE_PROPORTION));
+		tOrder.setBrokerageAmount(new BigDecimal(DecimalCalculate.mul(commodityPrice.doubleValue(), DEFAULT_BROKERAGE_PROPORTION)));
+		tOrder.setFirstPayment(DEFAULT_FIRST_PAYMENT);
+		tOrder.setCommodityPrice(commodityPrice);
+		tOrder.setOrderAmount(orderAmount);
+		tOrder.setOrderRemarks(remarks);
+		tOrder.setDeleteSign(Boolean.FALSE);
+		tOrder.setOrderChannel(OrderChannel.APP.getCode());
+		setOrderState(OrderAction.ADD_INTENTION, new BigDecimal(0), tOrder, false);
+		return 0;
+	}
+	
+	/**
+	 * 订单状态流转
+	 * @param orderStatus
+	 * @param intentionStatus
+	 * @param tradingStatus
+	 * @param paymentStatus
+	 * @param liquidationStatus
+	 * @param actionType
+	 */
+	public void setOrderState(OrderAction orderAction,BigDecimal changeAmount,TOrder tOrder,boolean confirm){
+		if(orderAction == OrderAction.ADD_INTENTION){ //添加意向订单
+			if(tOrder.getOrderStatus() != null || tOrder.getIntentionStatus() != null || tOrder.getTradingStatus() != null
+					|| tOrder.getPaymentStatus() != null || tOrder.getLiquidationStatus() != null
+					|| tOrder.getActuallyBrokerageAmount() != null || tOrder.getActuallyFirstPayment() != null) {
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"添加意向订单"));
+			}
+			tOrder.setOrderStatus(OrderState.INTENTION.getCode());
+			tOrder.setIntentionStatus(IntentionSate.WAIT_SELLER_CONFIRM.getCode());
+			tOrder.setTradingStatus(TradingState.WAIT_FOR_TRADE.getCode()); 
+			tOrder.setPaymentStatus(PaymentState.WAIT_PAY_FIRST_BALANCE.getCode());
+			tOrder.setLiquidationStatus(LiquidationSate.WAIT_FOR_PAY.getCode());
+			tOrder.setActuallyFirstPayment(new BigDecimal(0));
+			tOrder.setActuallyTotalPayment(new BigDecimal(0));
+		}else if(orderAction == OrderAction.CONFIRM_INTENTION){ //确认意向订单 (用户确认)
+			if(tOrder.getOrderStatus() != OrderState.INTENTION.getCode() 
+					|| tOrder.getIntentionStatus() != IntentionSate.WAIT_SELLER_CONFIRM.getCode()
+					|| tOrder.getTradingStatus() != TradingState.WAIT_FOR_TRADE.getCode()
+					|| tOrder.getPaymentStatus() != PaymentState.WAIT_PAY_FIRST_BALANCE.getCode()
+					|| tOrder.getLiquidationStatus() != LiquidationSate.WAIT_FOR_PAY.getCode()){
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"确认意向订单"));
+			}
+			if(confirm){
+				tOrder.setOrderStatus(OrderState.WAIT_FOR_PAY.getCode());
+				tOrder.setIntentionStatus(IntentionSate.SELLER_CONFIRM.getCode());
+				tOrder.setTradingStatus(TradingState.ON_TRADE.getCode());
+			}else{
+				tOrder.setOrderStatus(OrderState.CANCELLED.getCode());
+				tOrder.setIntentionStatus(IntentionSate.SELLER_REFUSE.getCode());
+				tOrder.setTradingStatus(TradingState.TRADE_FAILED.getCode());
+			}
+		}else if(orderAction == OrderAction.CONFIRM_PAY_FOR_FIRST){ // 支付首付(审核员先审核流水)
+			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_PAY.getCode()
+					|| tOrder.getIntentionStatus() != IntentionSate.SELLER_CONFIRM.getCode()
+					|| tOrder.getTradingStatus() != TradingState.ON_TRADE.getCode()
+					|| tOrder.getPaymentStatus() != PaymentState.WAIT_PAY_FIRST_BALANCE.getCode()
+					|| tOrder.getLiquidationStatus() != LiquidationSate.WAIT_FOR_PAY.getCode()){
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,""));
+			}
+			int boundary = DecimalCalculate.compareTo(
+					DecimalCalculate.add(tOrder.getActuallyFirstPayment().doubleValue(),changeAmount.doubleValue()),
+					tOrder.getFirstPayment().doubleValue());
+			if(boundary == 1){
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"支付首付"));
+			}else if(boundary == -1){ //首付待付清 ()
+				tOrder.setActuallyTotalPayment(
+						new BigDecimal(DecimalCalculate.add(tOrder.getActuallyTotalPayment().doubleValue(), changeAmount.doubleValue())));
+				tOrder.setActuallyFirstPayment(
+						new BigDecimal(DecimalCalculate.add(tOrder.getActuallyFirstPayment().doubleValue(), changeAmount.doubleValue())));
+				tOrder.setPaymentStatus(PaymentState.WAIT_PAY_FIRST_BALANCE.getCode());
+				tOrder.setLiquidationStatus(LiquidationSate.PART_PAY.getCode()); 
+			}else if(boundary == 0){ //首付已结清
+				tOrder.setActuallyTotalPayment(
+						new BigDecimal(DecimalCalculate.add(tOrder.getActuallyTotalPayment().doubleValue(), changeAmount.doubleValue())));
+				tOrder.setActuallyFirstPayment(
+						new BigDecimal(DecimalCalculate.add(tOrder.getActuallyFirstPayment().doubleValue(),changeAmount.doubleValue())));
+				tOrder.setPaymentStatus(PaymentState.ALREADY_FIRST_PAY.getCode());
+				tOrder.setLiquidationStatus(LiquidationSate.PART_PAY.getCode());
+			}
+		}else if(orderAction == OrderAction.CONFIRM_PAY_FOR_LAST){ //支付尾款 (审核员先审核流水)
+			if(tOrder.getOrderStatus() != OrderState.WAIT_FOR_PAY.getCode()
+					|| tOrder.getIntentionStatus() != IntentionSate.SELLER_CONFIRM.getCode()
+					|| tOrder.getTradingStatus() != TradingState.ON_TRADE.getCode()
+					|| tOrder.getPaymentStatus() != PaymentState.ALREADY_FIRST_PAY.getCode()
+					|| tOrder.getLiquidationStatus() != LiquidationSate.PART_PAY.getCode()){
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"支付尾款"));
+			}
+			int boundary = DecimalCalculate.compareTo(
+					DecimalCalculate.add(tOrder.getActuallyTotalPayment().doubleValue(),changeAmount.doubleValue()),
+					tOrder.getOrderAmount().doubleValue());
+			if(boundary == 1){
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"支付尾款"));
+			}else if(boundary == -1){
+				tOrder.setActuallyTotalPayment(
+						new BigDecimal(DecimalCalculate.add(tOrder.getActuallyTotalPayment().doubleValue(), changeAmount.doubleValue())));
+				tOrder.setPaymentStatus(PaymentState.WAIT_PAY_LAST_BALANCE.getCode());
+				tOrder.setLiquidationStatus(LiquidationSate.PART_PAY.getCode());
+			}else if(boundary == 0){
+				tOrder.setOrderStatus(OrderState.COMPLETED.getCode());
+				tOrder.setActuallyTotalPayment(
+						new BigDecimal(DecimalCalculate.add(tOrder.getActuallyTotalPayment().doubleValue(), changeAmount.doubleValue())));
+				tOrder.setPaymentStatus(PaymentState.ALREADY_LAST_PAY.getCode());
+				tOrder.setLiquidationStatus(LiquidationSate.FULL_PAY.getCode());
+				tOrder.setTradingStatus(TradingState.TRADE_SUCCESS.getCode());
+			}
+		}else if(orderAction == OrderAction.APPLY_FOR_WITHDRAW){ //提现申请 (用户申请)
+			if(tOrder.getOrderStatus() != OrderState.COMPLETED.getCode()
+					|| tOrder.getIntentionStatus() != IntentionSate.SELLER_CONFIRM.getCode()
+					|| tOrder.getTradingStatus() != TradingState.TRADE_SUCCESS.getCode()
+					|| tOrder.getPaymentStatus() != PaymentState.ALREADY_LAST_PAY.getCode()
+					|| tOrder.getLiquidationStatus() != LiquidationSate.FULL_PAY.getCode()){
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"等待提现"));
+			}
+			tOrder.setLiquidationStatus(LiquidationSate.WAIT_FOR_WITHDRAW.getCode());
+		}else if(orderAction == OrderAction.CONFIRM_WITHDRAW){ //提现确认 (审核员先审核流水)
+			if(tOrder.getOrderStatus() != OrderState.COMPLETED.getCode()
+					|| tOrder.getIntentionStatus() != IntentionSate.SELLER_CONFIRM.getCode()
+					|| tOrder.getTradingStatus() != TradingState.TRADE_SUCCESS.getCode()
+					|| tOrder.getPaymentStatus() != PaymentState.ALREADY_LAST_PAY.getCode()
+					|| tOrder.getLiquidationStatus() != LiquidationSate.WAIT_FOR_WITHDRAW.getCode()){
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"提现确认"));
+			}
+			tOrder.setLiquidationStatus(LiquidationSate.PAY_SETTLE.getCode());
+		}else if(orderAction == OrderAction.APPLY_FOR_CANCEL){ //取消订单(用户取消)
+			boolean flag = true;
+			if(tOrder.getOrderStatus() == OrderState.CANCELLED.getCode()) flag = false;
+			if(tOrder.getIntentionStatus() == IntentionSate.SELLER_REFUSE.getCode()
+					|| tOrder.getIntentionStatus() == IntentionSate.BUYER_CANCELLED.getCode()
+					|| tOrder.getIntentionStatus() == IntentionSate.EXPIRED.getCode()){
+				flag = false;
+			}
+			if(tOrder.getTradingStatus() == TradingState.TRADE_FAILED.getCode()) flag = false;
+			if(tOrder.getPaymentStatus() == PaymentState.WAIT_FOR_REFUND.getCode() 
+					|| tOrder.getPaymentStatus() == PaymentState.ALREADY_REFUND.getCode()) flag = false;
+			if(tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_WITHDRAW.getCode()
+					|| tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_REFUND.getCode()
+					|| tOrder.getLiquidationStatus() == LiquidationSate.REFUND_SETTLE.getCode()){
+				flag = false;
+			}
+			if(!flag) throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"取消订单"));
+			tOrder.setOrderStatus(OrderState.CANCELLED.getCode());
+			tOrder.setIntentionStatus(IntentionSate.BUYER_CANCELLED.getCode());
+			if(tOrder.getTradingStatus() != TradingState.TRADE_SUCCESS.getCode()) tOrder.setTradingStatus(TradingState.TRADE_FAILED.getCode());
+			if(tOrder.getActuallyTotalPayment().doubleValue() > 0){ //需要退款
+				tOrder.setPaymentStatus(PaymentState.WAIT_FOR_REFUND.getCode());
+				tOrder.setLiquidationStatus(LiquidationSate.WAIT_FOR_REFUND.getCode());
+			}
+		}else if(orderAction == OrderAction.REFUND_CONFIRM){ //退款确认(审核员)
+			if(tOrder.getOrderStatus() != OrderState.CANCELLED.getCode()
+					|| tOrder.getIntentionStatus() != IntentionSate.BUYER_CANCELLED.getCode()
+					|| tOrder.getPaymentStatus() != PaymentState.WAIT_FOR_REFUND.getCode()
+					|| tOrder.getLiquidationStatus() != LiquidationSate.WAIT_FOR_REFUND.getCode()){
+				throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT,"确认退款"));
+			}
+			tOrder.setPaymentStatus(PaymentState.ALREADY_REFUND.getCode());
+			tOrder.setLiquidationStatus(LiquidationSate.REFUND_SETTLE.getCode());
+		}
+	}
+	
+	/**
+	 * 添加流水记录
+	 * @param orderNo 订单编号
+	 * @param creater 创建人
+	 * @param payeeId 收款人
+	 * @param payerId 付款人
+	 * @param remarks 附言
+	 * @param transactionSubject 交易科目
+	 * @param payChannel 支付渠道
+	 * @param transactionMode 支付方式
+	 * @param FundAudit 流水审核
+	 * @return
+	 */
+	public int addFundRecord(Long orderNo,String creater,String payeeId,String payerId,String remarks,TransactionSubject transactionSubject,PayChannel payChannel,
+			BigDecimal transactionAmount,TransactionMode transactionMode,AuditState auditState){
+		TFundingRecords records = new TFundingRecords();
+		records.setId(UUID.randomUUID().toString());
+		records.setConfirmSign(auditState.getCode());
+		records.setCreater(creater);
+		records.setDeleteSign(Boolean.FALSE);
+		records.setOrderNo(orderNo);
+		records.setTransactionAmount(transactionAmount);
+		records.setPayeeId(payeeId);
+		records.setPayerId(payerId);
+		records.setRemarks(remarks);
+		records.setTransactionAmount(transactionAmount);
+		records.setTransactionMode(transactionMode.getCode());
+		records.setTransactionSubject(transactionSubject.getCode());
+		tFundingRecordsMapper.insert(records);
+		return 1;
+	}
+	
+	/**
+	 * 设置按钮状态
+	 * @param tOrder
+	 * @return
+	 */
+	private OperatorActive setOperatorActive(TOrder tOrder){
+		OperatorActive active = new OperatorActive();
+		if (TokenManager.getToken() instanceof User) {
+			active.setConfirmPayForFirst(false);
+			active.setConfirmPayForLast(false);
+			active.setConfirmRefund(false);
+			active.setConfirmWithdraw(false);
+			if (TokenManager.getUserId().equals(tOrder.getBuyerId())) { // 买方
+				active.setConfirmIntention(false);
+				active.setRefuseIntention(false);
+				active.setApplyForWithdraw(false);
+				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_PAY.getCode()
+						&& tOrder.getIntentionStatus() == IntentionSate.SELLER_CONFIRM.getCode()
+						&& tOrder.getTradingStatus() == TradingState.ON_TRADE.getCode()
+						&& tOrder.getPaymentStatus() == PaymentState.WAIT_PAY_FIRST_BALANCE.getCode()
+						&& tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_PAY.getCode()) {
+					active.setPayForFirst(true);
+				} else {
+					active.setPayForFirst(false);
+				}
+				if (tOrder.getOrderStatus() == OrderState.WAIT_FOR_PAY.getCode()
+						&& tOrder.getIntentionStatus() == IntentionSate.SELLER_CONFIRM.getCode()
+						&& tOrder.getTradingStatus() == TradingState.ON_TRADE.getCode()
+						&& tOrder.getPaymentStatus() == PaymentState.ALREADY_FIRST_PAY.getCode()
+						&& tOrder.getLiquidationStatus() == LiquidationSate.PART_PAY.getCode()) {
+					active.setPayForLast(true);
+				} else {
+					active.setPayForLast(true);
+				}
+				boolean flag = true;
+				if (tOrder.getOrderStatus() == OrderState.CANCELLED.getCode())
+					flag = false;
+				if (tOrder.getIntentionStatus() == IntentionSate.SELLER_REFUSE.getCode()
+						|| tOrder.getIntentionStatus() == IntentionSate.BUYER_CANCELLED.getCode()
+						|| tOrder.getIntentionStatus() == IntentionSate.EXPIRED.getCode()) {
+					flag = false;
+				}
+				if (tOrder.getTradingStatus() == TradingState.TRADE_FAILED.getCode())
+					flag = false;
+				if (tOrder.getPaymentStatus() == PaymentState.WAIT_FOR_REFUND.getCode()
+						|| tOrder.getPaymentStatus() == PaymentState.ALREADY_REFUND.getCode())
+					flag = false;
+				if (tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_WITHDRAW.getCode()
+						|| tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_REFUND.getCode()
+						|| tOrder.getLiquidationStatus() == LiquidationSate.REFUND_SETTLE.getCode()) {
+					flag = false;
+				}
+				active.setApplyForCancel(flag);
+			} else if (TokenManager.getUserId().equals(tOrder.getSellerId())) { //卖方
+				active.setPayForFirst(false);
+				active.setPayForLast(false);
+				active.setApplyForCancel(false);
+				if (tOrder.getOrderStatus() == OrderState.INTENTION.getCode()
+						&& tOrder.getIntentionStatus() == IntentionSate.WAIT_SELLER_CONFIRM.getCode()
+						&& tOrder.getTradingStatus() == TradingState.WAIT_FOR_TRADE.getCode()
+						&& tOrder.getPaymentStatus() == PaymentState.WAIT_PAY_FIRST_BALANCE.getCode()
+						&& tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_PAY.getCode()) {
+					active.setConfirmIntention(true);
+					active.setRefuseIntention(true);
+				} else {
+					active.setConfirmIntention(false);
+					active.setRefuseIntention(false);
+				}
+				if (tOrder.getOrderStatus() == OrderState.COMPLETED.getCode()
+						&& tOrder.getIntentionStatus() == IntentionSate.SELLER_CONFIRM.getCode()
+						&& tOrder.getTradingStatus() == TradingState.TRADE_SUCCESS.getCode()
+						&& tOrder.getPaymentStatus() == PaymentState.ALREADY_LAST_PAY.getCode()
+						&& tOrder.getLiquidationStatus() == LiquidationSate.FULL_PAY.getCode()) {
+					active.setApplyForWithdraw(true);
+				} else {
+					active.setApplyForWithdraw(false);
+				}
+			} else {
+				active.setPayForFirst(false);
+				active.setPayForLast(false);
+				active.setConfirmIntention(false);
+				active.setRefuseIntention(false);
+				active.setApplyForCancel(false);
+				active.setApplyForWithdraw(false);
+			}
+		}
+		if (TokenManager.getToken() instanceof Admin) {
+			active.setApplyForCancel(false);
+			active.setPayForFirst(false);
+			active.setPayForLast(false);
+			if (tOrder.getSellerId().equals(DEFAULT_PLATFORM_ID)) { // 平台作为卖方
+				if (tOrder.getOrderStatus() == OrderState.INTENTION.getCode()
+						&& tOrder.getIntentionStatus() == IntentionSate.WAIT_SELLER_CONFIRM.getCode()
+						&& tOrder.getTradingStatus() == TradingState.WAIT_FOR_TRADE.getCode()
+						&& tOrder.getPaymentStatus() == PaymentState.WAIT_PAY_FIRST_BALANCE.getCode()
+						&& tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_PAY.getCode()) {
+					active.setConfirmIntention(true);
+					active.setRefuseIntention(true);
+				} else {
+					active.setConfirmIntention(false);
+					active.setRefuseIntention(false);
+				}
+				if (tOrder.getOrderStatus() == OrderState.COMPLETED.getCode()
+						&& tOrder.getIntentionStatus() == IntentionSate.SELLER_CONFIRM.getCode()
+						&& tOrder.getTradingStatus() == TradingState.TRADE_SUCCESS.getCode()
+						&& tOrder.getPaymentStatus() == PaymentState.ALREADY_LAST_PAY.getCode()
+						&& tOrder.getLiquidationStatus() == LiquidationSate.FULL_PAY.getCode()) {
+					active.setApplyForWithdraw(true);
+				} else {
+					active.setApplyForWithdraw(false);
+				}
+				
+			}else{
+				active.setConfirmIntention(false);
+				active.setApplyForWithdraw(false);
+			}
+			//平台作为中间方  确认首付 -尾款-提现-退款
+			if(tOrder.getOrderStatus() == OrderState.WAIT_FOR_PAY.getCode()
+					&& tOrder.getIntentionStatus() == IntentionSate.SELLER_CONFIRM.getCode()
+					&& tOrder.getTradingStatus() == TradingState.ON_TRADE.getCode()
+					&& tOrder.getPaymentStatus() == PaymentState.WAIT_PAY_FIRST_BALANCE.getCode()
+					&& tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_PAY.getCode()){
+				active.setConfirmPayForFirst(true);
+			}else{
+				active.setConfirmPayForFirst(false);
+			}
+			if(tOrder.getOrderStatus() == OrderState.WAIT_FOR_PAY.getCode()
+					&& tOrder.getIntentionStatus() == IntentionSate.SELLER_CONFIRM.getCode()
+					&& tOrder.getTradingStatus() == TradingState.ON_TRADE.getCode()
+					&& tOrder.getPaymentStatus() == PaymentState.ALREADY_FIRST_PAY.getCode()
+					&& tOrder.getLiquidationStatus() == LiquidationSate.PART_PAY.getCode()){
+				active.setConfirmPayForLast(true);
+			}else{
+				active.setConfirmPayForLast(false);
+			}
+			if(tOrder.getOrderStatus() == OrderState.COMPLETED.getCode()
+					&& tOrder.getIntentionStatus() == IntentionSate.SELLER_CONFIRM.getCode()
+					&& tOrder.getTradingStatus() == TradingState.TRADE_SUCCESS.getCode()
+					&& tOrder.getPaymentStatus() == PaymentState.ALREADY_LAST_PAY.getCode()
+					&& tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_WITHDRAW.getCode()){
+				active.setConfirmWithdraw(true);
+			}else{
+				active.setConfirmWithdraw(false);
+			}
+			if(tOrder.getOrderStatus() == OrderState.CANCELLED.getCode()
+					&& tOrder.getIntentionStatus() == IntentionSate.BUYER_CANCELLED.getCode()
+					&& tOrder.getPaymentStatus() == PaymentState.WAIT_FOR_REFUND.getCode()
+					&& tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_REFUND.getCode()){
+				active.setConfirmRefund(true);
+			}else{
+				active.setConfirmRefund(false);
+			}
+		}
+		return active;
+	}
+
+	@Override
+	public int payForFirst(Long orderNo, BigDecimal fundAmount,String remarks) {
+		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
+		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), DEFAULT_PLATFORM_ID, TokenManager.getUserId(), remarks, 
+				TransactionSubject.SUPPLY_PAY,PayChannel.UNIONPAY, fundAmount, TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
+		tOrderMapper.insert(tOrder);
+		return 1;
+	}
+
+	@Override
+	public int payForLast(Long orderNo, BigDecimal fundAmount, String remarks) {
+		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
+		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), DEFAULT_PLATFORM_ID, TokenManager.getUserId(), remarks, 
+				TransactionSubject.SUPPLY_PAY,PayChannel.UNIONPAY, fundAmount, TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
+		tOrderMapper.insert(tOrder);
+		return 1;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<OrderDetailBo> selectOrderList(boolean confirm,Integer pageNo,Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		Pagination<OrderDetailBo> result = new Pagination<OrderDetailBo>();
+		if(confirm) params.put("intentionStatus", IntentionSate.WAIT_SELLER_CONFIRM.getCode()); //购买意向
+		params.put("uid", TokenManager.getUserId());
+		Pagination<TOrder> data = (Pagination<TOrder>)findPage("selectOrderListByPage", "selectOrderListCount", params, pageNo, pageSize);
+		List<TOrder> list = (List<TOrder>)data.getList();
+		OrderDetailBo bo = null;
+		List<OrderDetailBo> boList = new ArrayList<OrderDetailBo>(); 
+		if(list.size()>0){
+			for(TOrder t:list){
+				bo = tOrderMapper.selectCommodityDetail(t.getCommodityId(),t.getCommodityType());
+				bo.setOrderNo(String.valueOf(t.getOrderNo()));
+				bo.setCommodityQuantity(t.getCommodityQuantity());
+				bo.setCommodityMode(t.getCommodityMode());
+				bo.setCommodityId(t.getCommodityId());
+				bo.setCommodityPrice(String.valueOf(t.getCommodityPrice()));
+				bo.setOrderRemarks(t.getOrderRemarks());
+				bo.setCreateTime(DateUtils.formatDate(t.getCreateTime(),AFTConstants.YYYYMMDDHHMMSS));
+				bo.setOrderStatus(OrderState.getStatus(t.getOrderStatus()).getDesc());
+				bo.setCommodityType(t.getCommodityType());
+				bo.setOrderAmount(String.valueOf(t.getOrderAmount()));
+				bo.setFirstPayment(String.valueOf(t.getFirstPayment()));
+				bo.setOperatorActive(setOperatorActive(t));
+				boList.add(bo);
+			}
+		}
+		result.setList(boList);
+		result.setPageNo(data.getPageNo());
+		result.setPageSize(data.getPageSize());
+		result.setTotalCount(data.getTotalCount());
+		result.setFilterNo(data.getFilterNo());
+		return result;
+	}
+
+	@Override
+	public OrderDetailBo selectOrderDetail(Long orderNo) {
+		TOrder t = tOrderMapper.selectByPrimaryKey(orderNo);
+		OrderDetailBo bo = tOrderMapper.selectCommodityDetail(t.getCommodityId(),t.getCommodityType());
+		bo.setOrderNo(String.valueOf(t.getOrderNo()));
+		bo.setCommodityQuantity(t.getCommodityQuantity());
+		bo.setCommodityMode(t.getCommodityMode());
+		bo.setCommodityId(t.getCommodityId());
+		bo.setCommodityPrice(String.valueOf(t.getCommodityPrice()));
+		bo.setOrderRemarks(t.getOrderRemarks());
+		bo.setCreateTime(DateUtils.formatDate(t.getCreateTime(),AFTConstants.YYYYMMDDHHMMSS));
+		bo.setOrderStatus(OrderState.getStatus(t.getOrderStatus()).getDesc());
+		bo.setCommodityType(t.getCommodityType());
+		bo.setOrderAmount(String.valueOf(t.getOrderAmount()));
+		bo.setOperatorActive(setOperatorActive(t));
+		bo.setFirstPayment(String.valueOf(t.getFirstPayment()));
+		return bo;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<FundingListBo> selectFundingHistory(Long orderNo,Integer pageNo,Integer pageSize) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		if(orderNo != null) params.put("orderNo", orderNo);
+		params.put("uid", TokenManager.getUserId());
+		Pagination<FundingListBo> data = (Pagination<FundingListBo>)findPage("selectFundingHistoryByPage","selectFundingHistoryCount", params, pageNo, pageSize);
+		List<FundingListBo> list = (List<FundingListBo>)data.getList();
+		OrderDetailBo odBo = null;
+		if(list.size()>0){
+			for(FundingListBo bo:list){
+				odBo = tOrderMapper.selectCommodityDetail(bo.getCommodityId(),bo.getCommodityType());
+				bo.setCommodityName(odBo.getCommodityName());
+				bo.setBusinessDesc(setBusinessDesc(bo.getTransactionSubject(),bo.getTransactionAmount()));
+			}
+		}
+		return data;
+	}
+
+	@Override
+	@Transactional
+	public int applyForWithdraw(Long orderNo,String remarks) {
+		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
+		BigDecimal transactionAmount = new BigDecimal(DecimalCalculate.sub(tOrder.getActuallyTotalPayment().doubleValue(), 
+				tOrder.getActuallyBrokerageAmount().doubleValue())); 
+		addFundRecord(orderNo, TokenManager.getUserToken().getNickname(), TokenManager.getUserId(), DEFAULT_PLATFORM_ID, remarks,
+				TransactionSubject.SUPPLY_COLLECT, PayChannel.UNIONPAY,transactionAmount,TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
+		setOrderState(OrderAction.APPLY_FOR_WITHDRAW, new BigDecimal(0), tOrder, false);
+		tOrderMapper.updateByPrimaryKeySelective(tOrder);
+		return 1;
+	}
+
+	@Override
+	@Transactional
+	public int applyForCancel(Long orderNo) {
+		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
+		setOrderState(OrderAction.APPLY_FOR_CANCEL, new BigDecimal(0), tOrder, false);
+		if(tOrder.getPaymentStatus() == PaymentState.WAIT_FOR_REFUND.getCode() 
+				&& tOrder.getLiquidationStatus() == LiquidationSate.WAIT_FOR_REFUND.getCode()){ //退款
+			BigDecimal transactionAmount = new BigDecimal(DecimalCalculate.sub(tOrder.getActuallyTotalPayment().doubleValue(), 
+					tOrder.getActuallyBrokerageAmount().doubleValue())); 
+			addFundRecord(orderNo, "平台方", DEFAULT_PLATFORM_ID,TokenManager.getUserId(), "买家取消订单",
+					TransactionSubject.REFUND, PayChannel.UNIONPAY,transactionAmount,TransactionMode.OFFLINE, AuditState.WAIT_AUDIT);
+		}
+		tOrderMapper.updateByPrimaryKeySelective(tOrder);
+		return 1;
+	}
+
+	private String setBusinessDesc(Integer transactionSubject,BigDecimal transactionAmount){
+		String result = "";
+		if(transactionSubject == TransactionSubject.SUPPLY_PAY.getCode() || transactionSubject == TransactionSubject.REFUND.getCode()){
+			result =  "收入-"+transactionAmount;
+		}else if(transactionSubject == TransactionSubject.SUPPLY_PAY.getCode()){
+			result =  "支出-"+transactionAmount;
+		}
+		return result;
+	}
+
+	@Override
+	public int confirmIntention(Long orderNo, boolean confirm) {
+		TOrder tOrder = tOrderMapper.selectByPrimaryKey(orderNo);
+		setOrderState(OrderAction.CONFIRM_INTENTION, new BigDecimal(0), tOrder, confirm);
+		tOrderMapper.updateByPrimaryKeySelective(tOrder);
+		return 1;
+	}
+}

+ 3 - 1
src/main/resources/props/error.properties

@@ -103,4 +103,6 @@ BUSINESS_ALREADY_EXIST = \u9879\u76EE\u5DF2\u5B58\u5728
 
 AT_LEAST_A_BUSINESS = \u81F3\u5C11\u9700\u8981\u586B\u5199\u4E00\u9879\u4E1A\u52A1
 
-USER_NICKNAME_EXIST = \u6635\u79F0\u5DF2\u5B58\u5728
+USER_NICKNAME_EXIST = \u6635\u79F0\u5DF2\u5B58\u5728
+
+NOT_ACCORD_WITH_NEXT = \u4E0D\u7B26\u5408\u6D41\u8F6C\u6761\u4EF6