Pārlūkot izejas kodu

公出&报销表

anderx 1 gadu atpakaļ
vecāks
revīzija
b3bacdf7cc

+ 4 - 0
src/main/java/com/goafanti/common/dao/PublicReleaseMapper.java

@@ -3,6 +3,8 @@ package com.goafanti.common.dao;
 import com.goafanti.admin.bo.OutFinanceCount;
 import com.goafanti.common.model.OutPublicReleaseCount;
 import com.goafanti.common.model.PublicRelease;
+import com.goafanti.expenseAccount.bo.ExpenseCountsOrder;
+import com.goafanti.weChat.bo.InputreleaseAndExpenseCount;
 import com.goafanti.weChat.bo.OutPublicRelease;
 import com.goafanti.weChat.bo.OutPublicReleaseAndDetails;
 import com.goafanti.weChat.bo.OutPublicReleaseList;
@@ -63,4 +65,6 @@ public interface PublicReleaseMapper {
     OutPublicReleaseList selectOutListBoById(Integer id);
 
     List<PublicRelease>  selectAll();
+
+    List<ExpenseCountsOrder> releaseAndExpenseCount(InputreleaseAndExpenseCount in);
 }

+ 38 - 0
src/main/java/com/goafanti/common/mapper/PublicReleaseMapper.xml

@@ -749,5 +749,43 @@
         from public_release
         where  status in  (1,2)
     </select>
+    <select id="releaseAndExpenseCount" resultType="com.goafanti.expenseAccount.bo.ExpenseCountsOrder">
+        select
+            a.order_no orderNo,a.contract_no contractNo,b.buyer_name buyerName,toc.max_duration maxDuration ,toc.actual_duration actualDuration ,
+            toc.exceed_duration exceedDuration, a.total_amount totalAmount,a.settlement_amount settlementAmount,b.bid_type bidType,
+            c.expenseCount,c.peopleCount,c.notExamine,c.rejectCount,d.paymentAmount,c.days,c.amount expenseAmount
+        from t_order_new a left join t_order_mid b on a.order_no =b.order_no
+        left join t_order_public_release_count toc on a.order_no =toc.order_no
+        left join (select a.order_no,a.expenseCount,b.peopleCount,c.notExamine, c.rejectCount,a.days,a.amount
+                from (select a.order_no,count(a.id)expenseCount,sum(a.amount) amount,sum(ROUND(a.duration/7.5) )days
+                    from expense_account a where a.target_type = 1 and a.status=2 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.target_type = 1 and a.status=2 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.target_type=1 )a group by order_no)c on a.order_no=c.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       group by order_no )d on a.order_no=d.order_no
+        where 1=1
+          <if test="contractNo != null">
+          and a.contract_no = #{contractNo}
+          </if>
+          <if test="buyerName != null">
+              and b.buyer_name like  concat('%',#{buyerName},'%')
+          </if>
+          <if test="depId != null">
+              and a.order_dep = #{depId}
+          </if>
+          <if test="aid != null">
+          and a.salesman_id = #{aid}
+          </if>
+        <if test="allStatus == 1">
+            and toc.exceed_duration =0
+        </if>
+        <if test="allStatus == 2">
+            and toc.exceed_duration >0
+        </if>
+    </select>
 </mapper>
 

+ 66 - 24
src/main/java/com/goafanti/expenseAccount/bo/ExpenseCountsOrder.java

@@ -38,65 +38,75 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
     private Integer notExamine;
     @Excel(name = "驳回单数")
     private Integer rejectCount;
+    private Integer exceedType;
 
     @Override
-    public String getMaxDuration() {
-        return maxDuration;
+    public String getOrderNo() {
+        return orderNo;
     }
 
     @Override
-    public void setMaxDuration(String maxDuration) {
-        this.maxDuration = maxDuration;
+    public void setOrderNo(String orderNo) {
+        this.orderNo = orderNo;
     }
 
     @Override
-    public String getActualDuration() {
-        return actualDuration;
+    public String getContractNo() {
+        return contractNo;
     }
 
     @Override
-    public void setActualDuration(String actualDuration) {
-        this.actualDuration = actualDuration;
+    public void setContractNo(String contractNo) {
+        this.contractNo = contractNo;
     }
 
     @Override
-    public String getExceedDuration() {
-        return exceedDuration;
+    public String getBuyerName() {
+        return buyerName;
     }
 
     @Override
-    public void setExceedDuration(String exceedDuration) {
-        this.exceedDuration = exceedDuration;
+    public void setBuyerName(String buyerName) {
+        this.buyerName = buyerName;
     }
 
     @Override
-    public String getOrderNo() {
-        return orderNo;
+    public String getMaxDuration() {
+        if(maxDuration==null){
+            maxDuration="0";
+        }
+        return maxDuration;
     }
 
     @Override
-    public void setOrderNo(String orderNo) {
-        this.orderNo = orderNo;
+    public void setMaxDuration(String maxDuration) {
+        this.maxDuration = maxDuration;
     }
 
     @Override
-    public String getContractNo() {
-        return contractNo;
+    public String getActualDuration() {
+        if(actualDuration==null){
+            actualDuration="0";
+        }
+        return actualDuration;
     }
 
     @Override
-    public void setContractNo(String contractNo) {
-        this.contractNo = contractNo;
+    public void setActualDuration(String actualDuration) {
+        this.actualDuration = actualDuration;
     }
 
     @Override
-    public String getBuyerName() {
-        return buyerName;
+    public String getExceedDuration() {
+        if(exceedDuration==null){
+            exceedDuration="0";
+        }
+        return exceedDuration;
     }
 
     @Override
-    public void setBuyerName(String buyerName) {
-        this.buyerName = buyerName;
+    public void setExceedDuration(String exceedDuration) {
+        this.exceedDuration = exceedDuration;
     }
 
     @Override
@@ -121,6 +131,9 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
 
     @Override
     public BigDecimal getExpenseAmount() {
+        if(expenseAmount==null){
+            return BigDecimal.ZERO;
+        }
         return expenseAmount;
     }
 
@@ -131,6 +144,9 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
 
     @Override
     public BigDecimal getPaymentAmount() {
+        if(paymentAmount==null){
+            paymentAmount=BigDecimal.ZERO;
+        }
         return paymentAmount;
     }
 
@@ -141,6 +157,9 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
 
     @Override
     public Integer getPeopleCount() {
+        if(peopleCount==null){
+            peopleCount=0;
+        }
         return peopleCount;
     }
 
@@ -151,6 +170,9 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
 
     @Override
     public Integer getDays() {
+        if(days==null){
+            days=0;
+        }
         return days;
     }
 
@@ -161,6 +183,9 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
 
     @Override
     public Integer getExpenseCount() {
+        if(expenseCount==null){
+            expenseCount=0;
+        }
         return expenseCount;
     }
 
@@ -171,6 +196,9 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
 
     @Override
     public Integer getNotExamine() {
+        if(notExamine==null){
+            notExamine=0;
+        }
         return notExamine;
     }
 
@@ -181,6 +209,9 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
 
     @Override
     public Integer getRejectCount() {
+        if(rejectCount==null){
+            rejectCount=0;
+        }
         return rejectCount;
     }
 
@@ -188,4 +219,15 @@ public class ExpenseCountsOrder extends ExpenseCountsBo{
     public void setRejectCount(Integer rejectCount) {
         this.rejectCount = rejectCount;
     }
+
+    public Integer getExceedType() {
+        if(exceedType==null){
+            exceedType=0;
+        }
+        return exceedType;
+    }
+
+    public void setExceedType(Integer exceedType) {
+        this.exceedType = exceedType;
+    }
 }

+ 49 - 0
src/main/java/com/goafanti/weChat/bo/InputreleaseAndExpenseCount.java

@@ -0,0 +1,49 @@
+package com.goafanti.weChat.bo;
+
+public class InputreleaseAndExpenseCount {
+    private String contractNo;
+    private String buyerName;
+    private String depId;
+    private String aid;
+    private Integer allStatus;
+
+    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 getDepId() {
+        return depId;
+    }
+
+    public void setDepId(String depId) {
+        this.depId = depId;
+    }
+
+    public String getAid() {
+        return aid;
+    }
+
+    public void setAid(String aid) {
+        this.aid = aid;
+    }
+
+    public Integer getAllStatus() {
+        return allStatus;
+    }
+
+    public void setAllStatus(Integer allStatus) {
+        this.allStatus = allStatus;
+    }
+}

+ 8 - 0
src/main/java/com/goafanti/weChat/controller/AdminReleaseApiController.java

@@ -442,6 +442,14 @@ public class AdminReleaseApiController extends CertifyApiController{
 		Result res =new Result();
 		return res.data(publicReleaseService.pushDateClock());
 	}
+	/**
+	 * 公出&报销表
+	 */
+	@RequestMapping(value = "/releaseAndExpenseCount",method = RequestMethod.GET)
+	public Result releaseAndExpenseCount (InputreleaseAndExpenseCount in){
+		Result res =new Result();
+		return res.data(publicReleaseService.releaseAndExpenseCount(in));
+	}
 
 
 

+ 2 - 0
src/main/java/com/goafanti/weChat/service/PublicReleaseService.java

@@ -71,4 +71,6 @@ public interface PublicReleaseService {
 	void pushOutPublicDtails(List<OutPublicDtails> outList);
 
 	Object pushDateClock();
+
+	Object releaseAndExpenseCount(InputreleaseAndExpenseCount in);
 }

+ 26 - 0
src/main/java/com/goafanti/weChat/service/impl/PublicReleaseServiceImpl.java

@@ -20,6 +20,7 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.websocket.SystemWebSocketHandler;
 import com.goafanti.customer.bo.FollowBusinessBo;
 import com.goafanti.customer.service.CustomerService;
+import com.goafanti.expenseAccount.bo.ExpenseCountsOrder;
 import com.goafanti.order.bo.TOrderNewBo;
 import com.goafanti.weChat.bo.*;
 import com.goafanti.weChat.service.PublicReleaseService;
@@ -1923,6 +1924,7 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 		return 1;
 	}
 
+
 	private void addPublicReleaseDateClock(PublicRelease e) {
 		publicReleaseDateClockMapper.deleteByPrid(e.getId());
 		List<PublicReleaseDateClock> list= new ArrayList<>();
@@ -1951,4 +1953,28 @@ public class PublicReleaseServiceImpl extends BaseMybatisDao<PublicReleaseMapper
 			list.clear();
 		}
 	}
+
+
+
+
+	@Override
+	public Object releaseAndExpenseCount(InputreleaseAndExpenseCount in) {
+		List<ExpenseCountsOrder> expenseCountsOrders = publicReleaseMapper.releaseAndExpenseCount(in);
+		expenseCountsOrders.forEach(e->{
+			if (e.getExceedDuration()!=null){
+				double exceedDuration = Double.parseDouble(e.getExceedDuration());
+				if (exceedDuration>0){
+					e.setExceedType(1);
+				}
+			}
+			if (e.getMaxDuration()!=null){
+				if(e.getMaxDuration().equals("-1")){
+					e.setMaxDuration("不限制");
+				}
+			}
+
+
+		});
+		return expenseCountsOrders;
+	}
 }