|
|
|
@@ -1,14 +1,18 @@ |
|
|
|
package com.iformall.controller; |
|
|
|
|
|
|
|
import com.iformall.annotation.SystemControllerLog; |
|
|
|
import com.iformall.common.ErrorCode; |
|
|
|
import com.iformall.common.Result; |
|
|
|
import com.iformall.common.ResultData; |
|
|
|
import com.iformall.domain.po.WxBillRent; |
|
|
|
import com.iformall.domain.po.WxPayAccountBill; |
|
|
|
import com.iformall.domain.po.WxRentContract; |
|
|
|
import com.iformall.service.WxBillRentService; |
|
|
|
import com.iformall.service.WxPayAccountBillService; |
|
|
|
import com.iformall.service.WxRentContractService; |
|
|
|
import io.swagger.annotations.ApiImplicitParam; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
@@ -16,6 +20,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
/** |
|
|
|
@@ -31,6 +36,9 @@ public class WxRentContractController extends BaseController { |
|
|
|
@Autowired |
|
|
|
private WxBillRentService wxBillRentService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private WxPayAccountBillService payAccountBillService; |
|
|
|
|
|
|
|
@GetMapping("list") |
|
|
|
@ApiImplicitParams({ |
|
|
|
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), |
|
|
|
@@ -156,4 +164,36 @@ public class WxRentContractController extends BaseController { |
|
|
|
return wxRentContractService.updateRentContractStatus(id); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("getPayAccountInfo") |
|
|
|
@SystemControllerLog(description = "租赁合同-获取甲方账户") |
|
|
|
public ResultData getPayAccountInfo() { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentContractStatus"); |
|
|
|
String tenantId = getTenantId(); |
|
|
|
WxPayAccountBill payAccountBill = payAccountBillService.getByTenantId(tenantId); |
|
|
|
Map<String, String> map = new HashMap<>(); |
|
|
|
if(StringUtils.isNotBlank(payAccountBill.getBankAccountName()) && StringUtils.isNotBlank(payAccountBill.getBankCardId())) { |
|
|
|
map.put("bankAccountName", payAccountBill.getBankAccountName()); |
|
|
|
map.put("bankCardId", payAccountBill.getBankCardId()); |
|
|
|
} |
|
|
|
return new ResultData(map); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("savePayAccountInfo") |
|
|
|
@SystemControllerLog(description = "租赁合同-保存甲方账户") |
|
|
|
public ResultData savePayAccountInfo(@RequestBody WxPayAccountBill payAccountBill) { |
|
|
|
logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentContractStatus"); |
|
|
|
if(StringUtils.isBlank(payAccountBill.getBankAccountName())) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "甲方银行账户名未填写"); |
|
|
|
} |
|
|
|
if(StringUtils.isBlank(payAccountBill.getBankCardId())) { |
|
|
|
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "甲方银行账户卡号未填写"); |
|
|
|
} |
|
|
|
String tenantId = getTenantId(); |
|
|
|
WxPayAccountBill payAccountBillNew = payAccountBillService.getByTenantId(tenantId); |
|
|
|
payAccountBillNew.setBankAccountName(payAccountBill.getBankAccountName()); |
|
|
|
payAccountBillNew.setBankCardId(payAccountBill.getBankCardId()); |
|
|
|
payAccountBillService.saveOrUpdate(payAccountBillNew); |
|
|
|
return new ResultData(); |
|
|
|
} |
|
|
|
|
|
|
|
} |