Sfoglia il codice sorgente

报销开发子报销列表新增字段

anderx 2 anni fa
parent
commit
14979bc0a3

+ 22 - 6
src/main/java/com/goafanti/common/mapper/ExpenseAccountMapper.xml

@@ -869,22 +869,22 @@
     where a.id= #{id} and a.ea_id=b.id
   </update>
   <update id="updateSonByDetId">
-    update  expense_account x ,(select b.id,sum(c.amount) amount
+    update  expense_account x ,(select b.id,sum(c.real_amount) amount
       from expense_account_details a left join expense_account b on a.eaid =b.id
       left join expense_account_details c on b.id =c.eaid
       where a.id= #{id} group by b.id)y
-    set x.total_amount =y.amount
+    set x.real_amount =y.amount
     where x.id=y.id;
   </update>
   <update id="updateMainByDetId">
-    update expense_account x ,(    select a.id,sum(c.total_amount)amount
+    update expense_account x ,(    select a.id,sum(c.real_amount)amount
       from expense_account a  left join expense_relationship b  on a.id=b.id
       left join expense_account c on b.ea_id =c.id
       where a.id in(select c.id
       from expense_account_details a left join expense_account b on a.eaid =b.id
       left join expense_relationship c on b.id =c.ea_id
       where a.id= #{id}) group by a.id)y
-    set x.total_amount =y.amount
+    set x.real_amount =y.amount
     where x.id=y.id
   </update>
 
@@ -893,7 +893,7 @@
     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,b.examine_name,
     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,
+    c.id sonId,c.total_amount sonAmount,c.`type` sonType,c.type_other sonTypeOTher,c.user_names ,c.release_start ,c.release_end,
     c.attachment_url attachmentUrl,c.secondary_type,c.secondary_type_other
     from expense_relationship a
     left join expense_account b on a.id =b.id
@@ -939,8 +939,16 @@
       <foreach collection="deps" item="dep" open="(" close=")" separator=",">
         #{dep}
       </foreach>
-      order by a.status ,a.create_time desc
     </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>
+      order by b.status ,b.create_time desc
     ${page_sql}
   </select>
   <select id="ExpenseMainCount" resultType="java.lang.Integer">
@@ -988,6 +996,14 @@
         #{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>
   </select>
 
 

+ 0 - 4
src/main/java/com/goafanti/expenseAccount/controller/ExpenseAccountController.java

@@ -358,10 +358,6 @@ public class ExpenseAccountController extends CertifyApiController {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"编号"));
             return  res;
         }
-        if (type==null){
-            res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"分类"));
-            return  res;
-        }
         if (amount==null){
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"金额"));
             return  res;

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

@@ -801,6 +801,8 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
                 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 {
                 in.setProcessStatus(0);