Explorar el Código

报销列表合同编号搜索修改

anderx hace 1 año
padre
commit
f28eb8f281

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

@@ -5,6 +5,7 @@ import com.goafanti.common.model.FinanceCount;
 import com.goafanti.common.model.TOrderBillNew;
 import com.goafanti.common.model.TOrderNew;
 import com.goafanti.expenseAccount.bo.ExpenseCountsBo;
+import com.goafanti.expenseAccount.bo.ExpenseCountsInput;
 import com.goafanti.order.bo.*;
 import com.goafanti.order.bo.outStatistics.OutOrderSalesSourceAmount;
 import com.goafanti.organization.bo.OrganizationListOut;
@@ -103,5 +104,5 @@ public interface TOrderNewMapper {
 
     void updateOrderDepFinanceExamineName(List<String> list);
 
-    List<ExpenseCountsBo> selectExpenseCount();
+    List<ExpenseCountsBo> selectExpenseCount(ExpenseCountsInput in);
 }

+ 37 - 4
src/main/java/com/goafanti/common/mapper/TOrderNewMapper.xml

@@ -2210,10 +2210,43 @@ left join department d on o.order_dep = d.id   left join t_order_mid a on o.orde
     where b.status=0 and b.aid = #{financeId} and a.process_status = 3
   </select>
     <select id="selectExpenseCount" resultType="com.goafanti.expenseAccount.bo.ExpenseCountsBo">
-      select a.order_no orderNo ,a.contract_no contractNo ,b.buyer_name buyerName
-      from t_order_new a left join t_order_mid b on a.order_no =b.order_no
-      where a.order_no in
-            (select a.order_no from expense_account a where a.target_type =1 group by order_no)
+      select a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,
+             c.expenseCount,c.peopleCount,c.notExamine,c.rejectCount,c.paymentAmount,c.days
+      from t_order_new a left join t_order_mid b on a.order_no =b.order_no left join (select a.order_no,a.expenseCount,b.peopleCount,c.notExamine,
+            c.rejectCount,ifnull(d.paymentAmount,0)paymentAmount,a.days from (select a.order_no,count(a.id)expenseCount,
+                sum(ROUND(a.duration/7.5) )days from expense_account a where a.order_no in (select a.order_no from expense_account a
+                where a.target_type = #{targetType}
+                <if test="startTime !=null and endTime != null">
+                  and a.create_time BETWEEN #{startTime} and #{endTime}
+                </if>
+                group by order_no)
+
+                group by order_no )a left join (select order_no,count(aid)peopleCount from (select a.order_no,aid from expense_account a where a.order_no in
+                (select a.order_no from expense_account a  where a.target_type = #{targetType}
+                <if test="startTime !=null and endTime != null">
+                and a.create_time BETWEEN #{startTime} and #{endTime}
+                </if>
+                group by order_no)
+                group by order_no,aid )a group by order_no)b on a.order_no=b.order_no left join (select a.order_no,sum(notExamine)notExamine,sum(rejectCount)rejectCount
+                from (select a.order_no,status ,IF(status=1,1,0)notExamine,IF(status=3,1,0)rejectCount
+                from expense_account a where a.order_no in (select a.order_no from expense_account a where a.target_type = #{targetType}
+                <if test="startTime !=null and endTime != null">
+                  and a.create_time BETWEEN #{startTime} and #{endTime}
+                </if>
+                group by order_no))a group by order_no)c on a.order_no=c.order_no left join (    select a.order_no ,sum(c.payment_amount) paymentAmount
+                from t_order_new a left join t_order_task b on a.order_no =b.order_no left join  t_order_payment c on b.id =c.tid
+                where c.status =3 and a.order_no in (select a.order_no from expense_account a  where a.target_type = #{targetType}
+                <if test="startTime !=null and endTime != null">
+                  and a.create_time BETWEEN #{startTime} and #{endTime}
+                </if>
+                 group by order_no) group by order_no )d on a.order_no=d.order_no)c on a.order_no =c.order_no
+      where a.order_no in (select a.order_no from expense_account a where a.target_type = #{targetType}
+                <if test="startTime !=null and endTime != null">
+                  and a.create_time BETWEEN #{startTime} and #{endTime}
+                </if>
+                group by order_no)
+        and  a.contract_no like concat('%' ,#{contractNo},'%')
+        and a.order_dep = #{depId}
     </select>
 
 </mapper>

+ 74 - 1
src/main/java/com/goafanti/expenseAccount/bo/ExpenseCountsBo.java

@@ -2,5 +2,78 @@ package com.goafanti.expenseAccount.bo;
 
 public class ExpenseCountsBo {
 
-    private String orderNo , contractNo , buyerName;
+    private String orderNo , contractNo , buyerName ,expenseCount,peopleCount,notExamine,rejectCount,paymentAmount,days;
+
+
+    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 getExpenseCount() {
+        return expenseCount;
+    }
+
+    public void setExpenseCount(String expenseCount) {
+        this.expenseCount = expenseCount;
+    }
+
+    public String getPeopleCount() {
+        return peopleCount;
+    }
+
+    public void setPeopleCount(String peopleCount) {
+        this.peopleCount = peopleCount;
+    }
+
+    public String getNotExamine() {
+        return notExamine;
+    }
+
+    public void setNotExamine(String notExamine) {
+        this.notExamine = notExamine;
+    }
+
+    public String getRejectCount() {
+        return rejectCount;
+    }
+
+    public void setRejectCount(String rejectCount) {
+        this.rejectCount = rejectCount;
+    }
+
+    public String getPaymentAmount() {
+        return paymentAmount;
+    }
+
+    public void setPaymentAmount(String paymentAmount) {
+        this.paymentAmount = paymentAmount;
+    }
+
+    public String getDays() {
+        return days;
+    }
+
+    public void setDays(String days) {
+        this.days = days;
+    }
 }

+ 53 - 0
src/main/java/com/goafanti/expenseAccount/bo/ExpenseCountsInput.java

@@ -0,0 +1,53 @@
+package com.goafanti.expenseAccount.bo;
+
+public class ExpenseCountsInput {
+    private String startTime;
+    private String endTime;
+    private String depId;
+    private String contactNo;
+
+    /**
+     * 0:部门 1 订单
+     */
+    private Integer targetType;
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    public String getContactNo() {
+        return contactNo;
+    }
+
+    public void setContactNo(String contactNo) {
+        this.contactNo = contactNo;
+    }
+
+    public Integer getTargetType() {
+        return targetType;
+    }
+
+    public void setTargetType(Integer targetType) {
+        this.targetType = targetType;
+    }
+}

+ 3 - 2
src/main/java/com/goafanti/expenseAccount/controller/ExpenseCountsController.java

@@ -2,6 +2,7 @@ package com.goafanti.expenseAccount.controller;
 
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.expenseAccount.bo.ExpenseCountsInput;
 import com.goafanti.expenseAccount.service.ExpenseCountsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -15,8 +16,8 @@ public class ExpenseCountsController extends CertifyApiController {
     @Autowired
     private ExpenseCountsService expenseAccountService;
     @RequestMapping(value = "/getcounts",method = RequestMethod.GET)
-    public Result getCounts(){
+    public Result getCounts(ExpenseCountsInput in){
         Result res=new Result();
-        return res.data(expenseAccountService.getCounts());
+        return res.data(expenseAccountService.getCounts(in));
     }
 }

+ 3 - 1
src/main/java/com/goafanti/expenseAccount/service/ExpenseCountsService.java

@@ -1,5 +1,7 @@
 package com.goafanti.expenseAccount.service;
 
+import com.goafanti.expenseAccount.bo.ExpenseCountsInput;
+
 public interface ExpenseCountsService {
-    Object getCounts();
+    Object getCounts(ExpenseCountsInput in);
 }

+ 4 - 8
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseCountsServiceImpl.java

@@ -2,13 +2,11 @@ package com.goafanti.expenseAccount.service.impl;
 
 import com.goafanti.common.dao.ExpenseAccountMapper;
 import com.goafanti.common.dao.TOrderNewMapper;
-import com.goafanti.expenseAccount.bo.ExpenseCountsBo;
+import com.goafanti.expenseAccount.bo.ExpenseCountsInput;
 import com.goafanti.expenseAccount.service.ExpenseCountsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-
 @Service
 public class ExpenseCountsServiceImpl implements ExpenseCountsService {
 
@@ -17,10 +15,8 @@ public class ExpenseCountsServiceImpl implements ExpenseCountsService {
     @Autowired
     private ExpenseAccountMapper expenseAccountMapper;
     @Override
-    public Object getCounts() {
-        //获取订单基本信息
-        List<ExpenseCountsBo> expenseCountsBos = tOrderNewMapper.selectExpenseCount();
-        //获取订单报销多人
-        return null;
+    public Object getCounts(ExpenseCountsInput in) {
+        if (in.getTargetType()==null)in.setTargetType(0);
+        return tOrderNewMapper.selectExpenseCount(in);
     }
 }