|
@@ -3,6 +3,7 @@ package com.fs.admin.controller;
|
|
|
import com.fs.common.annotation.Log;
|
|
import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.company.domain.Company;
|
|
import com.fs.company.domain.Company;
|
|
@@ -11,7 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 总后台租户管理控制器
|
|
* 总后台租户管理控制器
|
|
@@ -115,4 +118,25 @@ public class CompanyAdminController extends BaseController {
|
|
|
result.put("disabledCount", all.size() - activeCount);
|
|
result.put("disabledCount", all.size() - activeCount);
|
|
|
return AjaxResult.success(result);
|
|
return AjaxResult.success(result);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 租户充值/扣款
|
|
|
|
|
+ */
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('admin:company:edit')")
|
|
|
|
|
+ @Log(title = "租户管理", businessType = BusinessType.UPDATE)
|
|
|
|
|
+ @PostMapping("/{companyId}/recharge")
|
|
|
|
|
+ public AjaxResult rechargeCompany(@PathVariable Long companyId, @RequestBody Map<String, Object> params) {
|
|
|
|
|
+ String operateType = (String) params.get("operateType");
|
|
|
|
|
+ BigDecimal amount = null;
|
|
|
|
|
+ Object amountObj = params.get("amount");
|
|
|
|
|
+ if (amountObj != null) {
|
|
|
|
|
+ amount = new BigDecimal(amountObj.toString());
|
|
|
|
|
+ }
|
|
|
|
|
+ String remark = (String) params.get("remark");
|
|
|
|
|
+ R r = companyService.rechargeCompany(companyId, operateType, amount, remark);
|
|
|
|
|
+ if (r != null && Integer.valueOf(200).equals(r.get("code"))) {
|
|
|
|
|
+ return AjaxResult.success();
|
|
|
|
|
+ }
|
|
|
|
|
+ return AjaxResult.error(r != null ? (String) r.get("msg") : "操作失败");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|