| @@ -104,7 +104,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| public ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName) { | |||
| if (null == record.getShopId()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "shopId不能为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "shopId不能为空"); | |||
| } | |||
| WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(record.getRentContractId()); | |||
| @@ -117,7 +117,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| } | |||
| } | |||
| if (null == record.getMerchantId()) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "merchantId不能为空"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId不能为空"); | |||
| } | |||
| WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(record.getMerchantId()); | |||
| if (merchant == null) { | |||
| @@ -152,7 +152,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| if (count > 0) { | |||
| return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); | |||
| } | |||
| int dayType = record.getAdjustPeriod().equals(EnumRentContractAdjustPeriod.ADJUST_PERIOD_DAY.getCode()) ? Calendar.DAY_OF_MONTH : Calendar.MONTH; | |||
| //保存物业合同信息 | |||
| String message = ""; | |||
| if (record.getId() == null) { | |||
| @@ -161,7 +161,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| //计租开始时间 | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(record.getRentalStartDate()); | |||
| instance.add(Calendar.MONTH, record.getLease()); | |||
| instance.add(dayType, record.getLease()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setRentalEndDate(instance.getTime()); | |||
| //起租结束时间 | |||
| @@ -191,7 +191,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| } | |||
| Calendar instance = Calendar.getInstance(); | |||
| instance.setTime(record.getRentalStartDate()); | |||
| instance.add(Calendar.MONTH, record.getLease()); | |||
| instance.add(dayType, record.getLease()); | |||
| instance.add(Calendar.DAY_OF_MONTH, -1); | |||
| record.setRentalEndDate(instance.getTime()); | |||
| //起租结束时间 | |||
| @@ -247,10 +247,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| WxPropertyContract record = wxPropertyContractMapper.selectByPrimaryKey(id); | |||
| if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) | |||
| && record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { | |||
| WxBillProperty wxBillProperty = new WxBillProperty(); | |||
| wxBillProperty.setMerchantId(record.getMerchantId()); | |||
| List<Map<String, Object>> billPropertyList = wxBillPropertyMapper.queryBillPropertyList(wxBillProperty); | |||
| if (billPropertyList.size() == 0) { | |||
| //WxBillProperty wxBillProperty = new WxBillProperty(); | |||
| //wxBillProperty.setMerchantId(record.getMerchantId()); | |||
| //List<Map<String, Object>> billPropertyList = wxBillPropertyMapper.queryBillPropertyList(wxBillProperty); | |||
| //if (billPropertyList.size() == 0) { | |||
| WxMerchant wxMerchant = new WxMerchant(); | |||
| wxMerchant.setId(record.getMerchantId()); | |||
| wxMerchant.setTenantId(record.getTenantId()); | |||
| @@ -258,7 +258,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||
| buildProperty(wxMerchant); | |||
| //物业押金账单 | |||
| buildDeposit(wxMerchant); | |||
| } | |||
| //} | |||
| } | |||
| return new ResultData(Result.SUCCESS, "操作成功"); | |||
| } | |||