| @@ -59,6 +59,9 @@ public class WxRentContractController extends BaseController { | |||||
| public ResultData add(@RequestBody WxRentContract wxRentContract) { | public ResultData add(@RequestBody WxRentContract wxRentContract) { | ||||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | logger.debug("[" + getIpAddr() + "] WxRentContractController::add"); | ||||
| wxRentContract.setTenantId(getTenantId()); | wxRentContract.setTenantId(getTenantId()); | ||||
| if(wxRentContract.getMonthHandleType() != null){ | |||||
| wxRentContract.setAdjustPeriod(wxRentContract.getMonthHandleType()); | |||||
| } | |||||
| return wxRentContractService.save(wxRentContract, getUser().getId(),getUser().getName()); | return wxRentContractService.save(wxRentContract, getUser().getId(),getUser().getName()); | ||||
| } | } | ||||
| @@ -65,6 +65,21 @@ public class WxRentContract implements Serializable { | |||||
| @Transient | @Transient | ||||
| private String depositStr; | private String depositStr; | ||||
| /** | |||||
| * 月计租方式 3按自然月 | |||||
| */ | |||||
| @io.swagger.annotations.ApiModelProperty(value = "月计租方式3按自然月", name = "merchantId") | |||||
| @Transient | |||||
| private Integer monthHandleType; | |||||
| public Integer getMonthHandleType() { | |||||
| return monthHandleType; | |||||
| } | |||||
| public void setMonthHandleType(Integer monthHandleType) { | |||||
| this.monthHandleType = monthHandleType; | |||||
| } | |||||
| public String getBuilding() { | public String getBuilding() { | ||||
| return building; | return building; | ||||
| } | } | ||||
| @@ -126,6 +126,17 @@ public class WxRentContractServiceImpl implements WxRentContractService { | |||||
| } | } | ||||
| wxRentContract.setPrice(wxRentContract.getPrice() != null ? wxRentContract.getPrice() : 0); | wxRentContract.setPrice(wxRentContract.getPrice() != null ? wxRentContract.getPrice() : 0); | ||||
| wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit() : 0); | wxRentContract.setDeposit(wxRentContract.getDeposit() != null ? wxRentContract.getDeposit() : 0); | ||||
| //handle | |||||
| if(wxRentContract.getReceivePeriod().intValue() == 1){ | |||||
| wxRentContract.setAdjustPeriod(1); | |||||
| wxRentContract.setMonthHandleType(null); | |||||
| }else if(wxRentContract.getReceivePeriod().intValue() == 2){ | |||||
| wxRentContract.setAdjustPeriod(2); | |||||
| wxRentContract.setMonthHandleType(2); | |||||
| }else if(wxRentContract.getReceivePeriod().intValue() == 3){ | |||||
| wxRentContract.setAdjustPeriod(null); | |||||
| wxRentContract.setMonthHandleType(3); | |||||
| } | |||||
| result.put("wxRentContract", wxRentContract); | result.put("wxRentContract", wxRentContract); | ||||
| //关联的商户 | //关联的商户 | ||||
| if (wxRentContract.getMerchantId() != null) { | if (wxRentContract.getMerchantId() != null) { | ||||