Browse Source

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

anderx 2 years ago
parent
commit
2bd7479be2

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

@@ -344,4 +344,29 @@ public class ExpenseAccountController extends CertifyApiController {
         return res.data(expenseAccountService.updateMain(in));
     }
 
+    /**
+     * 修改实报金额
+     * @param type 类型 1报销与费用  2费用详细
+     * @param id 编号
+     * @param amount 金额
+     * @return
+     */
+    @RequestMapping(value = "/updateRealAmount",method = RequestMethod.POST)
+    public Result updateRealAmount(Integer type ,Integer id,BigDecimal amount){
+        Result res =new Result();
+        if (id==null){
+            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;
+        }
+        return res.data(expenseAccountService.updateRealAmount( type , id, amount));
+    }
+
 }

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

@@ -3,6 +3,7 @@ package com.goafanti.expenseAccount.service;
 import com.goafanti.common.model.ExpenseAccount;
 import com.goafanti.expenseAccount.bo.*;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 public interface ExpenseAccountService {
@@ -54,4 +55,6 @@ public interface ExpenseAccountService {
     List<ExpenseAccount> selectByIds(List<String> list);
 
     int selectCountByIdsAndType(List<String> list, Integer i);
+
+    Object updateRealAmount(Integer type, Integer id, BigDecimal amount);
 }

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

@@ -835,6 +835,22 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
         return expenseAccountMapper.selectCountByIdsAndType(list,i);
     }
 
+    @Override
+    public Object updateRealAmount(Integer type, Integer id, BigDecimal amount) {
+        if (type ==1){
+            ExpenseAccount account = new ExpenseAccount();
+            account.setId(id);
+            account.setRealAmount(amount);
+            expenseAccountMapper.updateByPrimaryKeySelective(account);
+        }else if (type ==2){
+            ExpenseAccountDetails ea= new ExpenseAccountDetails();
+            ea.setId(id);
+            ea.setRealAmount(amount);
+            expenseAccountDetailsMapper.updateByPrimaryKeySelective(ea);
+        }
+        return 1;
+    }
+
 
     /**
      * 计算当前报销显示抵扣金额