Просмотр исходного кода

报销开发费用明细列表,费用列表新增
主报销查询修改

anderx лет назад: 2
Родитель
Сommit
b42abc146d

+ 16 - 50
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -482,6 +482,12 @@
         and a.process_status >eae.`type`
       </if>
     </if>
+    <if test="processStatus ==5">
+
+    </if>
+    <if test="processStatus ==6">
+
+    </if>
     <if test="status != null">
       and a.status= #{status}
     </if>
@@ -901,6 +907,11 @@
     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
+    <include refid="ExpenseMainSql"/>
+      order by b.status ,b.create_time desc
+    ${page_sql}
+  </select>
+  <sql id="ExpenseMainSql">
     <if test="checkNo !=null">
       and b.check_no like concat('%',#{checkNo},'%')
     </if>
@@ -948,62 +959,17 @@
         and b.process_status =5 and b.status=2
       </if>
     </if>
-      order by b.status ,b.create_time desc
-    ${page_sql}
-  </select>
+    <if test="roleType == 5">
+      and adDep.finance_id  in (select id from admin where superior_id = #{aid})
+    </if>
+  </sql>
   <select id="ExpenseMainCount" 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="checkNo !=null">
-      and b.check_no like concat('%',#{checkNo},'%')
-    </if>
-    <if test=" status != null">
-      and b.status = #{status}
-    </if>
-    <if test=" roleType ==0">
-      and b.aid = #{aid}
-    </if>
-    <if test="roleType == 1">
-      <if test="listStatus ==0">
-        and b.process_status =1
-      </if>
-      <if test="listStatus ==1">
-        and b.process_status &gt; 1
-      </if>
-      and ad.superior_id= #{aid}
-    </if>
-    <if test="roleType == 2">
-      <if test="listStatus ==0">
-        and b.process_status =2
-      </if>
-      <if test="listStatus ==1">
-        and b.process_status &gt; 2
-      </if>
-      and adDep.finance_id = #{aid}
-    </if>
-    <if test="roleType == 3">
-      <if test="listStatus ==0">
-        and b.process_status =3
-      </if>
-      <if test="listStatus ==1">
-        and b.process_status &gt; 3
-      </if>
-      and ad.department_id in
-      <foreach collection="deps" item="dep" open="(" close=")" separator=",">
-        #{dep}
-      </foreach>
-    </if>
-    <if test="roleType == 4">
-      <if test="listStatus ==0">
-        and b.process_status =4 and b.status=1
-      </if>
-      <if test="listStatus ==1">
-        and b.process_status =5 and b.status=2
-      </if>
-    </if>
+    <include refid="ExpenseMainSql"/>
   </select>
 
 

+ 1 - 0
src/main/java/com/goafanti/expenseAccount/bo/ExpenseMainListInput.java

@@ -19,6 +19,7 @@ public class ExpenseMainListInput {
      */
     private Integer processStatus;
 
+
     public Integer getCheckNo() {
         return checkNo;
     }

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

@@ -85,28 +85,27 @@ public class ExpenseAccountController extends CertifyApiController {
     }
 
     /**
-     * 报销列表,子报销列表
+     * 报销列表
      * @param in
      * @return
      */
-    @RequestMapping(value = "/pageList",method = RequestMethod.GET)
-    public Result pageList(InputPageListBo in ){
+    @RequestMapping(value = "/mainList",method = RequestMethod.GET)
+    public Result mainList(ExpenseMainListInput in){
         Result res =new Result();
-        res.setData(expenseAccountService.pageList(in));
-        return res;
+        return res.data(expenseAccountService.mainList(in));
     }
 
     /**
-     * 报销列表
+     * 报销列表,子报销列表
      * @param in
      * @return
      */
-    @RequestMapping(value = "/mainList",method = RequestMethod.GET)
-    public Result mainList(ExpenseMainListInput in){
+    @RequestMapping(value = "/pageList",method = RequestMethod.GET)
+    public Result pageList(InputPageListBo in ){
         Result res =new Result();
-        return res.data(expenseAccountService.mainList(in));
+        res.setData(expenseAccountService.pageList(in));
+        return res;
     }
-
     /**
      * 报销详情列表
      * @return
@@ -118,6 +117,9 @@ public class ExpenseAccountController extends CertifyApiController {
         return res;
     }
 
+
+
+
     /**
      * 判断当前是否存在草稿
      * @param in

+ 17 - 4
src/main/java/com/goafanti/expenseAccount/service/impl/ExpenseAccountServiceImpl.java

@@ -109,6 +109,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                 AdminNoticeBo a = adminMapper.selectMyAndSuperBySuperId(aid);
                 String examineId=null;
                 String examineName=null;
+                //正常用上级,没有的情况下就是自己
                 if (a.getSuperId()!=null){
                     examineId=a.getSuperId();
                     examineName=a.getSuperName();
@@ -796,13 +797,19 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         //1-3s是不同人的审核
         if (in.getProcessStatus()!=null&&in.getProcessStatus()==1){
             if (TokenManager.hasRole(AFTConstants.SALESMAN_ADMIN)){
-                in.setProcessStatus(3);
-            }else if (TokenManager.hasRole(AFTConstants.FINANCE)||TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)){
+                in.setProcessStatus(4);
+            }else if (TokenManager.hasRole(AFTConstants.FINANCE)){
                 in.setProcessStatus(2);
             }else if (TokenManager.hasRole(AFTConstants.SALESMAN_MANAGER)){
                 in.setProcessStatus(1);
             }else if (TokenManager.hasRole(AFTConstants.APPROVAL_DECISION)||TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_ASSISTANT)){
                 in.setProcessStatus(4);
+            }else if(TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)){
+                //财务经理查看权限
+                in.setProcessStatus(5);
+            }else if(TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)||TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+                //财务管理员和超级管理员查看全部
+                in.setProcessStatus(6);
             }
         }else {
                 in.setProcessStatus(0);
@@ -956,8 +963,14 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         if (in.getStatus()!=null)param.put("status",in.getStatus());
         //如果前端未传 0自己 1审核的参数,默认自己,在审核列表的时候判断Aid,在
         if (in.getProcessStatus()==null) in.setProcessStatus(0);
-        param.put("processStatus",in.getProcessStatus());
          if(in.getProcessStatus()==2){
+             if(TokenManager.hasRole(AFTConstants.FINANCE_MANAGER)){
+                 //财务经理查看权限
+                 in.setProcessStatus(5);
+             }else if(TokenManager.hasRole(AFTConstants.FINANCE_ADMIN)||TokenManager.hasRole(AFTConstants.SUPERADMIN)){
+                 //财务管理员和超级管理员查看全部
+                 in.setProcessStatus(6);
+             }
                 if (in.getAid()!=null){
                     param.put("aid",in.getAid());
                 }
@@ -969,7 +982,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
          }else {
             param.put("aid",TokenManager.getAdminId());
         }
-
+        param.put("processStatus",in.getProcessStatus());
 
         if (in.getExamineStatus()!=null){
             param.put("examineStatus",in.getExamineStatus());