Browse Source

报销开发

anderx 2 years ago
parent
commit
92ee196eb8

+ 83 - 3
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -811,10 +811,10 @@
     left join department adDep on ad .department_id=adDep.id
     where 1=1 and b.expense_main =1
     <if test=" status != null">
-    and b.status = #{status}
+      and b.status = #{status}
     </if>
     <if test="listStatus ==0">
-     and b.status in(0,1,3)
+      and b.status in(0,1,3)
     </if>
     <if test="listStatus ==1">
       and b.status =2
@@ -823,7 +823,7 @@
       and b.aid = #{aid}
     </if>
     <if test="roleType == 1">
-    and b.process_status &gt; 0
+      and b.process_status &gt; 0
       and ad.superior_id= #{aid}
     </if>
     <if test="roleType == 2">
@@ -874,4 +874,84 @@
     </if>
   </select>
 
+
+
+  <select id="ExpenseDetailsList" resultMap="MainMap">
+    select b.id,b.check_no,b.total_amount,b.order_no,o.contract_no,b.aname,b.apply_dep,b.pay_dep,
+    date_format(a.create_time,'%Y-%m-%d %H:%i:%S')createTimeStr,b.status,b.process_status,
+    dep.name applyDepName,dep2.name payDepName, b.remarks,b.eaaid ,
+    c.id sonId,c.total_amount sonAmount,c.`type` ,c.type_other ,c.user_names ,c.release_start ,c.release_end
+    from expense_relationship a
+    left join expense_account b on a.id =b.id
+    left join department dep on b.apply_dep =dep.id left join department dep2 on b.pay_dep =dep2.id
+    left join t_order_new o on b.order_no =o.order_no
+    left join expense_account c on a.ea_id =c.id
+
+    left join admin ad on b.aid=ad.id
+    left join department adDep on ad .department_id=adDep.id
+    where 1=1 and b.expense_main =1
+    <if test=" status != null">
+      and b.status = #{status}
+    </if>
+    <if test="listStatus ==0">
+      and b.status in(0,1,3)
+    </if>
+    <if test="listStatus ==1">
+      and b.status =2
+    </if>
+    <if test=" roleType ==0">
+      and b.aid = #{aid}
+    </if>
+    <if test="roleType == 1">
+      and b.process_status &gt; 0
+      and ad.superior_id= #{aid}
+    </if>
+    <if test="roleType == 2">
+      and b.process_status &gt; 1
+      and adDep.finance_id = #{aid}
+    </if>
+    <if test="roleType == 3">
+      and b.process_status &gt; 2
+      and ad.department_id in
+      <foreach collection="deps" item="dep" open="(" close=")" separator=",">
+        #{dep}
+      </foreach>
+    </if>
+    ${page_sql}
+  </select>
+  <select id="ExpenseDetailsCount" resultType="java.lang.Integer">
+    select count(*)
+    from expense_account b
+    left join admin ad on b.aid=ad.id
+    left join department adDep on ad .department_id=adDep.id
+    where 1=1 and b.expense_main =1
+    <if test=" status != null">
+      and b.status = #{status}
+    </if>
+    <if test="listStatus ==0">
+      and b.status in(0,1,3)
+    </if>
+    <if test="listStatus ==1">
+      and b.status =2
+    </if>
+    <if test=" roleType ==0">
+      and b.aid = #{aid}
+    </if>
+    <if test="roleType == 1">
+      and b.process_status &gt; 0
+      and ad.superior_id= #{aid}
+    </if>
+    <if test="roleType == 2">
+      and b.process_status &gt; 1
+      and adDep.finance_id = #{aid}
+    </if>
+    <if test="roleType == 3">
+      and b.process_status &gt; 2
+      and ad.department_id in
+      <foreach collection="deps" item="dep" open="(" close=")" separator=",">
+        #{dep}
+      </foreach>
+    </if>
+  </select>
+
 </mapper>

+ 12 - 3
src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java

@@ -1,6 +1,5 @@
 package com.goafanti.expenseAccount.controller;
 
-import com.alibaba.fastjson.JSONObject;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
@@ -17,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 java.math.BigDecimal;
 import java.util.List;
-import java.util.Map;
 
 @RestController
 @RequestMapping("/api/admin/expenseAccount")
@@ -96,6 +93,18 @@ public class ExpenseAccountController extends CertifyApiController {
     }
 
     /**
+     * 报销列表,子报销列表
+     * @param in
+     * @return
+     */
+    @RequestMapping(value = "/detailsList",method = RequestMethod.GET)
+    public Result detailsList(InputPageListBo in ){
+        Result res =new Result();
+        res.setData(expenseAccountService.detailsList(in));
+        return res;
+    }
+
+    /**
      * 判断当前是否存在草稿
      * @param in
      * @return

+ 2 - 0
src/main/java/com/goafanti/expenseAccount/service/ExpenseAccountService.java

@@ -47,4 +47,6 @@ public interface ExpenseAccountService {
     Object updateMain(MainExpenseAccount in);
 
     Object mainList(ExpenseMainListInput id);
+
+    Object detailsList(InputPageListBo in);
 }

+ 6 - 0
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -782,6 +782,12 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         return findPage("ExpenseMainList","ExpenseMainCount",params,in.getPageNo(),in.getPageSize());
     }
 
+    @Override
+    public Object detailsList(InputPageListBo in) {
+        Map<String,Object> params = new HashMap<>();
+        return findPage("ExpenseDetailsList","ExpenseDetailsCount",params,in.getPageNo(),in.getPageSize());
+    }
+
 
     /**
      * 计算当前报销显示抵扣金额