| @@ -104,7 +104,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| public ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName) { | public ResultData saveOrUpdate(WxPropertyContract record, Long userId,String userName) { | ||||
| if (null == record.getShopId()) { | 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()); | WxRentContract wxRentContract = wxRentContractMapper.selectByPrimaryKey(record.getRentContractId()); | ||||
| @@ -117,7 +117,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| } | } | ||||
| } | } | ||||
| if (null == record.getMerchantId()) { | 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()); | WxMerchant merchant = wxMerchantMapper.selectByPrimaryKey(record.getMerchantId()); | ||||
| if (merchant == null) { | if (merchant == null) { | ||||
| @@ -152,7 +152,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| if (count > 0) { | if (count > 0) { | ||||
| return new ResultData(ErrorCode.RENT_CONTRACT_WITH_SHOP_IS_FOUND); | 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 = ""; | String message = ""; | ||||
| if (record.getId() == null) { | if (record.getId() == null) { | ||||
| @@ -161,7 +161,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| //计租开始时间 | //计租开始时间 | ||||
| Calendar instance = Calendar.getInstance(); | Calendar instance = Calendar.getInstance(); | ||||
| instance.setTime(record.getRentalStartDate()); | instance.setTime(record.getRentalStartDate()); | ||||
| instance.add(Calendar.MONTH, record.getLease()); | |||||
| instance.add(dayType, record.getLease()); | |||||
| instance.add(Calendar.DAY_OF_MONTH, -1); | instance.add(Calendar.DAY_OF_MONTH, -1); | ||||
| record.setRentalEndDate(instance.getTime()); | record.setRentalEndDate(instance.getTime()); | ||||
| //起租结束时间 | //起租结束时间 | ||||
| @@ -191,7 +191,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| } | } | ||||
| Calendar instance = Calendar.getInstance(); | Calendar instance = Calendar.getInstance(); | ||||
| instance.setTime(record.getRentalStartDate()); | instance.setTime(record.getRentalStartDate()); | ||||
| instance.add(Calendar.MONTH, record.getLease()); | |||||
| instance.add(dayType, record.getLease()); | |||||
| instance.add(Calendar.DAY_OF_MONTH, -1); | instance.add(Calendar.DAY_OF_MONTH, -1); | ||||
| record.setRentalEndDate(instance.getTime()); | record.setRentalEndDate(instance.getTime()); | ||||
| //起租结束时间 | //起租结束时间 | ||||
| @@ -247,10 +247,10 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| WxPropertyContract record = wxPropertyContractMapper.selectByPrimaryKey(id); | WxPropertyContract record = wxPropertyContractMapper.selectByPrimaryKey(id); | ||||
| if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) | if (record.getMerchantId() != null && record.getStatus().equals(EnumRentContractStatus.SIGNED_RENT_UNPAID.getCode()) | ||||
| && record.getReceivePeriod() != null && record.getDeposit() > 0 && record.getPrice() > 0) { | && 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 wxMerchant = new WxMerchant(); | ||||
| wxMerchant.setId(record.getMerchantId()); | wxMerchant.setId(record.getMerchantId()); | ||||
| wxMerchant.setTenantId(record.getTenantId()); | wxMerchant.setTenantId(record.getTenantId()); | ||||
| @@ -258,7 +258,7 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService | |||||
| buildProperty(wxMerchant); | buildProperty(wxMerchant); | ||||
| //物业押金账单 | //物业押金账单 | ||||
| buildDeposit(wxMerchant); | buildDeposit(wxMerchant); | ||||
| } | |||||
| //} | |||||
| } | } | ||||
| return new ResultData(Result.SUCCESS, "操作成功"); | return new ResultData(Result.SUCCESS, "操作成功"); | ||||
| } | } | ||||