anderx пре 4 година
родитељ
комит
be12b11207

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

@@ -361,5 +361,50 @@
     </set>
     where order_no = #{orderNo,jdbcType=VARCHAR}
   </update>
-
+  <select id="legalAffairsOrderList" resultType="com.goafanti.order.bo.OutOrderLegalAffairsListBo">
+    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.order_arrears orderArrears,b.dun_start_time dunStartTime,date_format(b.dun_start_time,'%Y-%m-%d %H:%i:%S')dunStartTimes
+    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="in.userName != null">
+      and b.buyer_name like concat('%',#{in.userName},'%')
+      </if>
+      <if test="in.in.legalAffairs != null">
+      and b.legal_affairs = #{in.legalAffairs}
+      </if>
+    <if test="in.in.contractNo != null">
+      and a.contract_no like  concat('%',#{in.contractNo},'%')
+    </if>
+    <if test="in.in.aid != null">
+      and b.salesman_id = #{in.aid}
+    </if>
+    <if test="in.in.depId != null">
+      and a.order_dep = #{in.depId}
+    </if>
+    order by b.dun_start_time desc
+    <if test="page_sql != null">
+        ${page_sql}
+    </if>
+  </select>
+  <select id="legalAffairsOrderList" 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="in.userName != null">
+      and b.buyer_name like concat('%',#{in.userName},'%')
+    </if>
+    <if test="in.in.legalAffairs != null">
+      and b.legal_affairs = #{in.legalAffairs}
+    </if>
+    <if test="in.in.contractNo != null">
+      and a.contract_no like  concat('%',#{in.contractNo},'%')
+    </if>
+    <if test="in.in.aid != null">
+      and b.salesman_id = #{in.aid}
+    </if>
+    <if test="in.in.depId != null">
+      and a.order_dep = #{in.depId}
+    </if>
+  </select>
 </mapper>

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

@@ -0,0 +1,67 @@
+package com.goafanti.order.bo;
+
+public class InputOrderListBo {
+    private String userName;
+    private Integer legalAffairs;
+    private String contractNo;
+    private String aid;
+    private String depId;
+    private Integer pageSize;
+    private Integer pageNo;
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public Integer getLegalAffairs() {
+        return legalAffairs;
+    }
+
+    public void setLegalAffairs(Integer legalAffairs) {
+        this.legalAffairs = legalAffairs;
+    }
+
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    public Integer getPageSize() {
+        return pageSize;
+    }
+
+    public void setPageSize(Integer pageSize) {
+        this.pageSize = pageSize;
+    }
+
+    public Integer getPageNo() {
+        return pageNo;
+    }
+
+    public void setPageNo(Integer pageNo) {
+        this.pageNo = pageNo;
+    }
+}

+ 106 - 0
src/main/java/com/goafanti/order/bo/OutOrderLegalAffairsListBo.java

@@ -0,0 +1,106 @@
+package com.goafanti.order.bo;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+public class OutOrderLegalAffairsListBo {
+    private String orderNo;
+    private String contractNo;
+    private String buyerName;
+    private String salesmanName;
+    private String depName;
+    private BigDecimal totalAmount;
+    private BigDecimal settlementAmount;
+    private BigDecimal orderReceivables;
+    private BigDecimal orderArrears;
+    private Date dunStartTime;
+    private String dunStartTimes;
+
+    public String getOrderNo() {
+        return orderNo;
+    }
+
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
+    }
+
+    public String getContractNo() {
+        return contractNo;
+    }
+
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
+    }
+
+    public String getBuyerName() {
+        return buyerName;
+    }
+
+    public void setBuyerName(String buyerName) {
+        this.buyerName = buyerName;
+    }
+
+    public String getSalesmanName() {
+        return salesmanName;
+    }
+
+    public void setSalesmanName(String salesmanName) {
+        this.salesmanName = salesmanName;
+    }
+
+    public String getDepName() {
+        return depName;
+    }
+
+    public void setDepName(String depName) {
+        this.depName = depName;
+    }
+
+    public BigDecimal getTotalAmount() {
+        return totalAmount;
+    }
+
+    public void setTotalAmount(BigDecimal totalAmount) {
+        this.totalAmount = totalAmount;
+    }
+
+    public BigDecimal getSettlementAmount() {
+        return settlementAmount;
+    }
+
+    public void setSettlementAmount(BigDecimal settlementAmount) {
+        this.settlementAmount = settlementAmount;
+    }
+
+    public BigDecimal getOrderReceivables() {
+        return orderReceivables;
+    }
+
+    public void setOrderReceivables(BigDecimal orderReceivables) {
+        this.orderReceivables = orderReceivables;
+    }
+
+    public BigDecimal getOrderArrears() {
+        return orderArrears;
+    }
+
+    public void setOrderArrears(BigDecimal orderArrears) {
+        this.orderArrears = orderArrears;
+    }
+
+    public Date getDunStartTime() {
+        return dunStartTime;
+    }
+
+    public void setDunStartTime(Date dunStartTime) {
+        this.dunStartTime = dunStartTime;
+    }
+
+    public String getDunStartTimes() {
+        return dunStartTimes;
+    }
+
+    public void setDunStartTimes(String dunStartTimes) {
+        this.dunStartTimes = dunStartTimes;
+    }
+}

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

@@ -3,9 +3,11 @@ package com.goafanti.order.controller;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.order.bo.InputOrderListBo;
 import com.goafanti.order.service.LegalAffairsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 @RestController
@@ -26,4 +28,12 @@ public class LegalAffairsApiController extends CertifyApiController {
         return res;
 
     }
+
+    @RequestMapping(value = "/orderList",method = RequestMethod.GET)
+    public Result orderList(InputOrderListBo in){
+        Result res =new Result();
+        res.data(legalAffairsService.orderList(in));
+        return res;
+
+    }
 }

+ 4 - 0
src/main/java/com/goafanti/order/service/LegalAffairsService.java

@@ -1,7 +1,11 @@
 package com.goafanti.order.service;
 
+import com.goafanti.order.bo.InputOrderListBo;
+
 public interface LegalAffairsService {
 
 
     int pushTransferLagalAffairs(String orderNo);
+
+    Object orderList(InputOrderListBo in);
 }

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

@@ -3,10 +3,13 @@ package com.goafanti.order.service.impl;
 import com.goafanti.common.dao.TOrderMidMapper;
 import com.goafanti.common.model.TOrderMid;
 import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.order.bo.InputOrderListBo;
 import com.goafanti.order.service.LegalAffairsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
+
 @Service
 public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> implements LegalAffairsService {
     @Autowired
@@ -20,4 +23,11 @@ public class LegalAffairsServiceImpl extends BaseMybatisDao<TOrderMidMapper> imp
         tm.setLegalAffairs(1);
         return tOrderMidMapper.updateByOrderNo(tm);
     }
+
+    @Override
+    public Object orderList(InputOrderListBo in) {
+        HashMap<String, Object> map = new HashMap<>();
+        map.put("in",in);
+        return findPage("legalAffairsOrderList","legalAffairsOrderCount",map,in.getPageNo(),in.getPageSize());
+    }
 }