Просмотр исходного кода

订单中间表修改,法务完成表修改

anderx лет назад: 4
Родитель
Сommit
1848a0b797

+ 51 - 40
src/main/java/com/goafanti/common/mapper/TOrderMidMapper.xml

@@ -23,12 +23,13 @@
     <result column="dun_start_time" jdbcType="TIMESTAMP" property="dunStartTime" />
     <result column="legal_affairs_type" jdbcType="INTEGER" property="legalAffairsType" />
     <result column="operation_time" jdbcType="DATE" property="operationTime" />
+    <result column="legal_affairs_status" jdbcType="INTEGER" property="legalAffairsStatus" />
   </resultMap>
   <sql id="Base_Column_List">
     id, order_no, salesman_id, finance_id, salesman_name, finance_name, final_receivables, 
     final_Receivables_time, invoice_amount, create_time, buyer_name, order_receivables, 
     order_arrears, payment_amount, cost_amount, dep_name, province_name, legal_affairs, 
-    dun_start_time, legal_affairs_type, operation_time
+    dun_start_time, legal_affairs_type, operation_time, legal_affairs_status
   </sql>
   <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
     select 
@@ -47,16 +48,16 @@
       create_time, buyer_name, order_receivables, 
       order_arrears, payment_amount, cost_amount, 
       dep_name, province_name, legal_affairs, 
-      dun_start_time, legal_affairs_type, operation_time
-      )
+      dun_start_time, legal_affairs_type, operation_time, 
+      legal_affairs_status)
     values (#{orderNo,jdbcType=VARCHAR}, #{salesmanId,jdbcType=VARCHAR}, #{financeId,jdbcType=VARCHAR}, 
       #{salesmanName,jdbcType=VARCHAR}, #{financeName,jdbcType=VARCHAR}, #{finalReceivables,jdbcType=DECIMAL}, 
       #{finalReceivablesTime,jdbcType=TIMESTAMP}, #{invoiceAmount,jdbcType=DECIMAL}, 
       #{createTime,jdbcType=TIMESTAMP}, #{buyerName,jdbcType=VARCHAR}, #{orderReceivables,jdbcType=DECIMAL}, 
       #{orderArrears,jdbcType=DECIMAL}, #{paymentAmount,jdbcType=DECIMAL}, #{costAmount,jdbcType=DECIMAL}, 
       #{depName,jdbcType=VARCHAR}, #{provinceName,jdbcType=VARCHAR}, #{legalAffairs,jdbcType=INTEGER}, 
-      #{dunStartTime,jdbcType=TIMESTAMP}, #{legalAffairsType,jdbcType=INTEGER}, #{operationTime,jdbcType=DATE}
-      )
+      #{dunStartTime,jdbcType=TIMESTAMP}, #{legalAffairsType,jdbcType=INTEGER}, #{operationTime,jdbcType=DATE}, 
+      #{legalAffairsStatus,jdbcType=INTEGER})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.TOrderMid" useGeneratedKeys="true">
     insert into t_order_mid
@@ -121,6 +122,9 @@
       <if test="operationTime != null">
         operation_time,
       </if>
+      <if test="legalAffairsStatus != null">
+        legal_affairs_status,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="orderNo != null">
@@ -183,6 +187,9 @@
       <if test="operationTime != null">
         #{operationTime,jdbcType=DATE},
       </if>
+      <if test="legalAffairsStatus != null">
+        #{legalAffairsStatus,jdbcType=INTEGER},
+      </if>
     </trim>
   </insert>
   <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.TOrderMid">
@@ -248,6 +255,9 @@
       <if test="operationTime != null">
         operation_time = #{operationTime,jdbcType=DATE},
       </if>
+      <if test="legalAffairsStatus != null">
+        legal_affairs_status = #{legalAffairsStatus,jdbcType=INTEGER},
+      </if>
     </set>
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -272,7 +282,8 @@
       legal_affairs = #{legalAffairs,jdbcType=INTEGER},
       dun_start_time = #{dunStartTime,jdbcType=TIMESTAMP},
       legal_affairs_type = #{legalAffairsType,jdbcType=INTEGER},
-      operation_time = #{operationTime,jdbcType=DATE}
+      operation_time = #{operationTime,jdbcType=DATE},
+      legal_affairs_status = #{legalAffairsStatus,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
   <select id="selectByOrderNo" resultMap="BaseResultMap">
@@ -282,51 +293,51 @@
     where order_no = #{id,jdbcType=INTEGER}
   </select>
   <update id="updateSalesmanId">
-  	update t_order_mid a ,admin b set a.salesman_id=#{transferId},a.salesman_name=b.name
-	where b.id=#{transferId} and a.salesman_id=#{aid}
+    update t_order_mid a ,admin b set a.salesman_id=#{transferId},a.salesman_name=b.name
+    where b.id=#{transferId} and a.salesman_id=#{aid}
   </update>
-    <update id="updateFinanceId">
-  	update t_order_new a ,t_order_mid b,admin c  set b.finance_id=#{financeId},b.finance_name=c.name
-	where a.order_dep=#{id} and a.order_no=b.order_no and c.id= #{financeId}
+  <update id="updateFinanceId">
+    update t_order_new a ,t_order_mid b,admin c  set b.finance_id=#{financeId},b.finance_name=c.name
+    where a.order_dep=#{id} and a.order_no=b.order_no and c.id= #{financeId}
   </update>
   <update id="updatefinalReceivables">
-  update t_order_mid set final_receivables= #{amount},`final_Receivables_time`= #{receivablesTime},
-  order_arrears=if(order_arrears- #{amount} &lt; 0,0,order_arrears- #{amount})
-	where order_no= #{orderNo}
+    update t_order_mid set final_receivables= #{amount},`final_Receivables_time`= #{receivablesTime},
+                           order_arrears=if(order_arrears- #{amount} &lt; 0,0,order_arrears- #{amount})
+    where order_no= #{orderNo}
   </update>
   <update id="updateInvoice">
-  update t_order_mid m,(select order_no,sum(amount)amount from t_order_invoice where status=2 group by order_no)b
-	set m.invoice_amount=b.amount where m.order_no= #{orderNo} and  m.order_no=b.order_no
+    update t_order_mid m,(select order_no,sum(amount)amount from t_order_invoice where status=2 group by order_no)b
+    set m.invoice_amount=b.amount where m.order_no= #{orderNo} and  m.order_no=b.order_no
   </update>
   <update id="addOrderReceivables">
-  update t_order_mid  set order_receivables=order_receivables+#{money},
-  order_arrears=order_arrears+#{money}
-	where order_no=#{orderNo}
+    update t_order_mid  set order_receivables=order_receivables+#{money},
+                            order_arrears=order_arrears+#{money}
+    where order_no=#{orderNo}
   </update>
   <select id="selectDepNameByDepid" resultType="java.lang.String">
-  select name from department where id= #{orderDep}
+    select name from department where id= #{orderDep}
   </select>
 
 
   <update id="updateCostAmount">
-     update t_order_task a ,t_order_mid b
+    update t_order_task a ,t_order_mid b
     <set>
-    <if test="cost !=null">
-     b.cost_amount= #{cost},
-    </if>
-    <if test="payment !=null">
-     b.payment_amount= #{payment},
-    </if>
+      <if test="cost !=null">
+        b.cost_amount= #{cost},
+      </if>
+      <if test="payment !=null">
+        b.payment_amount= #{payment},
+      </if>
     </set>
     where  a.order_no=b.order_no and a.id= #{tid}
   </update>
 
   <update id="updateAddCostAmount">
-     update t_order_task a ,t_order_mid b
+    update t_order_task a ,t_order_mid b
     <set>
-    <if test="cost !=null">
-     b.cost_amount= b.cost_amount+#{cost},
-    </if>
+      <if test="cost !=null">
+        b.cost_amount= b.cost_amount+#{cost},
+      </if>
     </set>
     where  a.order_no=b.order_no and a.id= #{tid}
   </update>
@@ -423,15 +434,15 @@
         #{dep}
       </foreach>
     </if>
-      <if test="shiro ==2">
-        and  c.superior_id = #{sid}
-      </if>
+    <if test="shiro ==2">
+      and  c.superior_id = #{sid}
+    </if>
     <if test="userName != null">
       and b.buyer_name like concat('%',#{userName},'%')
-      </if>
-      <if test="legalAffairs != null">
+    </if>
+    <if test="legalAffairs != null">
       and b.legal_affairs = #{legalAffairs}
-      </if>
+    </if>
     <if test="contractNo != null">
       and a.contract_no like  concat('%',#{contractNo},'%')
     </if>
@@ -453,7 +464,7 @@
     </if>
     order by b.dun_start_time
     <if test="page_sql != null">
-        ${page_sql}
+      ${page_sql}
     </if>
   </select>
   <select id="legalAffairsOrderCount" resultType="integer">
@@ -514,8 +525,8 @@
     set legal_affairs=1,legal_affairs_type =0
     where order_no in(
     <foreach collection="list" index="index" item="item" separator=",">
-    #{item}
+      #{item}
     </foreach>
-        )
+    )
   </update>
 </mapper>

+ 17 - 1
src/main/java/com/goafanti/common/model/TOrderMid.java

@@ -114,6 +114,11 @@ public class TOrderMid implements Serializable {
      */
     private Date operationTime;
 
+    /**
+     * 法务状态 0否 1已回款 2已诉讼 3已坏账处理
+     */
+    private Integer legalAffairsStatus;
+
     private static final long serialVersionUID = 1L;
 
     public Integer getId() {
@@ -284,6 +289,14 @@ public class TOrderMid implements Serializable {
         this.operationTime = operationTime;
     }
 
+    public Integer getLegalAffairsStatus() {
+        return legalAffairsStatus;
+    }
+
+    public void setLegalAffairsStatus(Integer legalAffairsStatus) {
+        this.legalAffairsStatus = legalAffairsStatus;
+    }
+
     @Override
     public boolean equals(Object that) {
         if (this == that) {
@@ -316,7 +329,8 @@ public class TOrderMid implements Serializable {
             && (this.getLegalAffairs() == null ? other.getLegalAffairs() == null : this.getLegalAffairs().equals(other.getLegalAffairs()))
             && (this.getDunStartTime() == null ? other.getDunStartTime() == null : this.getDunStartTime().equals(other.getDunStartTime()))
             && (this.getLegalAffairsType() == null ? other.getLegalAffairsType() == null : this.getLegalAffairsType().equals(other.getLegalAffairsType()))
-            && (this.getOperationTime() == null ? other.getOperationTime() == null : this.getOperationTime().equals(other.getOperationTime()));
+            && (this.getOperationTime() == null ? other.getOperationTime() == null : this.getOperationTime().equals(other.getOperationTime()))
+            && (this.getLegalAffairsStatus() == null ? other.getLegalAffairsStatus() == null : this.getLegalAffairsStatus().equals(other.getLegalAffairsStatus()));
     }
 
     @Override
@@ -344,6 +358,7 @@ public class TOrderMid implements Serializable {
         result = prime * result + ((getDunStartTime() == null) ? 0 : getDunStartTime().hashCode());
         result = prime * result + ((getLegalAffairsType() == null) ? 0 : getLegalAffairsType().hashCode());
         result = prime * result + ((getOperationTime() == null) ? 0 : getOperationTime().hashCode());
+        result = prime * result + ((getLegalAffairsStatus() == null) ? 0 : getLegalAffairsStatus().hashCode());
         return result;
     }
 
@@ -374,6 +389,7 @@ public class TOrderMid implements Serializable {
         sb.append(", dunStartTime=").append(dunStartTime);
         sb.append(", legalAffairsType=").append(legalAffairsType);
         sb.append(", operationTime=").append(operationTime);
+        sb.append(", legalAffairsStatus=").append(legalAffairsStatus);
         sb.append(", serialVersionUID=").append(serialVersionUID);
         sb.append("]");
         return sb.toString();

+ 3 - 10
src/main/java/com/goafanti/order/controller/LegalAffairsApiController.java

@@ -1,26 +1,19 @@
 package com.goafanti.order.controller;
 
 import com.goafanti.common.bo.Result;
-import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
-import com.goafanti.common.enums.ActivityFields;
 import com.goafanti.common.utils.StringUtils;
-import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.enums.OrderLegalAffairsState;
 import com.goafanti.order.service.LegalAffairsService;
-import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.validation.Valid;
-import java.util.ArrayList;
-import java.util.List;
 
 @RestController
 @RequestMapping(value = "/api/admin/lagalAffairs")
@@ -32,8 +25,8 @@ public class LegalAffairsApiController extends CertifyApiController {
 
     /**
      * 订单催款转交法务
-     * @param orderNo
-     * @return
+     * @param orderNo 订单编号
+     * @return 成功 1
      */
     @RequestMapping(value = "/transfer")
     public Result transferLagalAffairs(String orderNo){
@@ -54,7 +47,7 @@ public class LegalAffairsApiController extends CertifyApiController {
     /**
      * 订单催款列表(法务)
      * @param in
-     * @return
+     * @return list
      */
     @RequestMapping(value = "/orderList",method = RequestMethod.GET)
     public Result orderList(InputOrderListBo in){

+ 0 - 1
src/main/java/com/goafanti/order/service/impl/LegalAffairsServiceImpl.java

@@ -14,7 +14,6 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.enums.NewProjectStatus;
 import com.goafanti.order.service.LegalAffairsService;
-import org.apache.poi.ss.formula.functions.Now;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;