From 88c878ba55fd9f9258f45a917a13c8d51e332b29 Mon Sep 17 00:00:00 2001 From: luozukai Date: Tue, 4 Jun 2019 17:36:10 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=90=88=E5=90=8C][=E4=BF=AE=E6=94=B9][?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A7=9F=E8=B5=81=E8=AE=B0=E7=A7=9F=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E6=97=A5=E6=9C=9F]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../contract/WxPropertyContractController.java | 16 +++++++++------- .../contract/WxRentContractController.java | 18 ++++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java index 4d414ea4c..89f0bd950 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxPropertyContractController.java @@ -67,15 +67,17 @@ public class WxPropertyContractController extends BaseController { @SystemControllerLog(description = "物业合同-更新租赁开始日期") public ResultData updateRentStartTime(@RequestBody WxPropertyContract wxPropertyContract) { logger.debug("[" + getIpAddr() + "] WxPropertyContractController::updateRentStartTime"); - Integer rentStartType = wxPropertyContract.getRentStartType(); - wxPropertyContract = wxPropertyContractMapper.selectByPrimaryKey(wxPropertyContract.getId()); - if(rentStartType!=null && rentStartType.equals(EnumRentStartType.STARTTIME.getCode())){ - wxPropertyContract.setRentalStartDate(wxPropertyContract.getStartDate()); + WxPropertyContract propertyContract = wxPropertyContractMapper.selectByPrimaryKey(wxPropertyContract.getId()); + propertyContract.setRentalStartDate(wxPropertyContract.getRentalStartDate()); + + if(wxPropertyContract.getRentStartType()!=null && wxPropertyContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ + propertyContract.setRentalStartDate(propertyContract.getStartDate()); } + MallUserInfo user = getUser(); - wxPropertyContract.setTenantId(user.getTenantId()); - wxPropertyContract.setAdjustPeriodHandle(); - return wxPropertyContractService.saveOrUpdate(wxPropertyContract, user.getId(), user.getName()); + propertyContract.setTenantId(user.getTenantId()); + propertyContract.setAdjustPeriodHandle(); + return wxPropertyContractService.saveOrUpdate(propertyContract, user.getId(), user.getName()); } diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java index 696ed660b..3dd06a2d6 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/contract/WxRentContractController.java @@ -29,6 +29,7 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.text.SimpleDateFormat; +import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -98,16 +99,17 @@ public class WxRentContractController extends BaseController { @SystemControllerLog(description = "租赁合同-更新租赁开始日期") public ResultData updateRentStartTime(@RequestBody WxRentContract wxRentContract) { logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentStartTime"); - Integer rentStartType = wxRentContract.getRentStartType(); - wxRentContract = wxRentContractMapper.selectByPrimaryKey(wxRentContract.getId()); - if(rentStartType!=null && rentStartType.equals(EnumRentStartType.STARTTIME.getCode())){ - wxRentContract.setRentalStartDate(wxRentContract.getStartDate()); + WxRentContract rentContract = wxRentContractMapper.selectByPrimaryKey(wxRentContract.getId()); + rentContract.setRentalStartDate(wxRentContract.getRentalStartDate()); + + if(wxRentContract.getRentStartType()!=null && wxRentContract.getRentStartType().equals(EnumRentStartType.STARTTIME.getCode())){ + rentContract.setRentalStartDate(rentContract.getStartDate()); } MallUserInfo user = getUser(); - wxRentContract.setTenantId(user.getTenantId()); - wxRentContract.setAdjustPeriodHandle(); - wxRentContract.setRentPriceHandle(); - return wxRentContractService.update(wxRentContract, user.getId(),user.getName()); + rentContract.setTenantId(user.getTenantId()); + rentContract.setAdjustPeriodHandle(); + rentContract.setRentPriceHandle(); + return wxRentContractService.update(rentContract, user.getId(),user.getName()); } @PostMapping("update")