Browse Source

新增催款日志开发

anderx 4 years ago
parent
commit
f73628ea7a

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

@@ -132,7 +132,7 @@
     where dun_id = #{dunId,jdbcType=VARCHAR}
   </select>
   <select id="selectByOrderNo" resultType="com.goafanti.order.bo.TDunLogListBo">
-    select a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks,
+    select a.id, a.dun_id as dunId, b.name as dumBy, a.dum_time as dumTime, a.remarks,a.type,
            a.attachment_url attachmentUrl, c.order_no orderNo,c.buyer_name userName
     from t_dun_log a left join admin b on a.dum_by=b.id left join t_order_mid c on a.order_no =c.order_no
     where c.order_no = #{orderNo}

+ 35 - 6
src/main/java/com/goafanti/common/mapper/TOrderMidMapper.xml

@@ -366,8 +366,17 @@
     select a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,b.salesman_name salesmanName,b.dep_name depName,
     a.total_amount totalAmount ,a.settlement_amount  settlementAmount ,b.order_receivables orderReceivables,b.legal_affairs legalAffairs,
     b.order_arrears orderArrears,b.dun_start_time dunStartTime,date_format(b.dun_start_time,'%Y-%m-%d %H:%i:%S')dunStartTimes
+    <if test="type==1 or type==2 or type==3">
+      ,c.operation_time operationTime,c.`type`
+    </if>
     from t_order_new a left join t_order_mid b on a.order_no =b.order_no
-    where b.order_receivables >0
+    <if test="type==1 or type==2 or type==3">
+      left join t_order_legal_affairs c on c.order_no =b.order_no
+      where b.legal_affairs =1
+    </if>
+    <if test="type==0">
+      where b.order_receivables >0
+    </if>
       <if test="userName != null">
       and b.buyer_name like concat('%',#{userName},'%')
       </if>
@@ -383,8 +392,15 @@
     <if test="depId != null">
       and a.order_dep = #{depId}
     </if>
-    <if test="startTime != null and endTime != null">
-      and b.dun_start_time between #{startTime} and #{endTime}
+    <if test="type==0">
+      <if test="startTime != null and endTime != null">
+        and b.dun_start_time between #{startTime} and #{endTime}
+      </if>
+    </if>
+    <if test="type==1 or type==2 or type==3">
+      <if test="startTime != null and endTime != null">
+        and c.operation_time between #{startTime} and #{endTime}
+      </if>
     </if>
     order by b.dun_start_time desc
     <if test="page_sql != null">
@@ -394,7 +410,13 @@
   <select id="legalAffairsOrderCount" resultType="integer">
     select count(*)
     from t_order_new a left join t_order_mid b on a.order_no =b.order_no
-    where b.order_receivables >0
+    <if test="type==1 or type==2 or type==3">
+      left join t_order_legal_affairs c on c.order_no =b.order_no
+      where b.legal_affairs =1
+    </if>
+    <if test="type==0">
+      where b.order_receivables >0
+    </if>
     <if test="userName != null">
       and b.buyer_name like concat('%',#{userName},'%')
     </if>
@@ -410,8 +432,15 @@
     <if test="depId != null">
       and a.order_dep = #{depId}
     </if>
-    <if test="startTime != null and endTime != null">
-      and b.dun_start_time between #{startTime} and #{endTime}
+    <if test="type==0">
+      <if test="startTime != null and endTime != null">
+        and b.dun_start_time between #{startTime} and #{endTime}
+      </if>
+    </if>
+    <if test="type==1 or type==2 or type==3">
+      <if test="startTime != null and endTime != null">
+        and c.operation_time between #{startTime} and #{endTime}
+      </if>
     </if>
   </select>
   <update id="updateByList">

+ 12 - 0
src/main/java/com/goafanti/order/bo/InputOrderListBo.java

@@ -9,9 +9,21 @@ public class InputOrderListBo {
     private String depName;
     private String startTime;
     private String endTime;
+    /**
+     * 0 营销员 1法务催收 2法务延期 3已完成法务
+     */
+    private Integer type;
     private Integer pageSize;
     private Integer pageNo;
 
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public String getStartTime() {
         return startTime;
     }

+ 0 - 6
src/main/java/com/goafanti/order/controller/LegalAffairsApiController.java

@@ -1,11 +1,8 @@
 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.AttachmentType;
-import com.goafanti.common.enums.PatentInfoFields;
 import com.goafanti.common.utils.StringUtils;
 import com.goafanti.common.utils.excel.NewExcelUtil;
 import com.goafanti.order.bo.InputDunOrder;
@@ -19,9 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.servlet.http.HttpServletRequest;
 import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
 import java.util.List;
 
 @RestController
@@ -118,5 +113,4 @@ public class LegalAffairsApiController extends CertifyApiController {
         return res.data(legalAffairsService.addDunOrder(in));
     }
 
-
 }

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

@@ -54,6 +54,11 @@ public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> imp
         if(in.getContractNo()!=null) map.put("contractNo", in.getContractNo());
         if(in.getLegalAffairs()!=null) map.put("legalAffairs", in.getLegalAffairs());
         if(in.getAid()!=null) map.put("aid", in.getAid());
+        if(in.getType()!=null){
+            map.put("type", in.getType());
+        }else {
+            map.put("type", 0);
+        }
         if(in.getDepId()!=null) map.put("depId", in.getDepId());
         if(in.getUserName()!=null) map.put("user", in.getUserName());
         if(in.getStartTime()!=null)map.put("startTime", in.getStartTime());