|
|
@@ -1,10 +1,12 @@
|
|
|
package com.goafanti.expenseAccount.controller;
|
|
|
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
+import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.CertifyApiController;
|
|
|
import com.goafanti.common.utils.ParamUtils;
|
|
|
+import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.expenseAccount.bo.InputExpenseAccountPrivate;
|
|
|
-import com.goafanti.expenseAccount.service.ExpenseAccountService;
|
|
|
+import com.goafanti.expenseAccount.service.ExpenseAccountPrivateService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -17,7 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class ExpenseAccountController extends CertifyApiController {
|
|
|
|
|
|
@Autowired
|
|
|
- private ExpenseAccountService expenseAccountService;
|
|
|
+ private ExpenseAccountPrivateService expenseAccountPrivateService;
|
|
|
|
|
|
/**
|
|
|
* 新增私有报销帐号
|
|
|
@@ -32,7 +34,25 @@ public class ExpenseAccountController extends CertifyApiController {
|
|
|
ParamUtils.getParamName(in,bindingResult.getFieldError().getField())));
|
|
|
return res;
|
|
|
}
|
|
|
- res.setData(expenseAccountService.add(in));
|
|
|
+ in.setAid(TokenManager.getAdminId());
|
|
|
+ if (expenseAccountPrivateService.checkAccounts(in)){
|
|
|
+ res.getError().add(buildErrorMessageParams(ErrorConstants.PARAM_BEING_ERROR,"帐号"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ res.setData(expenseAccountPrivateService.add(in));
|
|
|
return res;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 私有报销帐号列表
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/selectList",method = RequestMethod.POST)
|
|
|
+ public Result selectList(Integer pageSize,Integer pageNo){
|
|
|
+ Result res =new Result();
|
|
|
+ res.setData(expenseAccountPrivateService.selectList(pageSize,pageNo));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|