|
|
|
@@ -318,19 +318,26 @@ public class WxPropertyContractServiceImpl implements WxPropertyContractService |
|
|
|
record.setRentShopType(merchant.getRentShopType()); |
|
|
|
|
|
|
|
//保存物业合同信息 |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
if (record.getCreateType().intValue() == EnumPropertyCreateType.BY_SHOP.getCode().intValue()) { |
|
|
|
record.setEndDate(setEndDate(record.getStartDate(),record.getRentalStartDate())); |
|
|
|
} |
|
|
|
|
|
|
|
Date date = new Date(); |
|
|
|
record.setCreatetime(date); |
|
|
|
record.setUpdatetime(date); |
|
|
|
record.setStatus(EnumRentContractStatus.UNWRITE.getCode()); |
|
|
|
record.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode()); |
|
|
|
|
|
|
|
try { |
|
|
|
wxPropertyContractMapper.insert(record); |
|
|
|
if (null == record.getId()) { |
|
|
|
final IdWorker idWorker = IdWorker.get(); |
|
|
|
record.setId(idWorker.nextId()); |
|
|
|
record.setCreatetime(date); |
|
|
|
record.setUpdatetime(date); |
|
|
|
record.setStatus(EnumRentContractStatus.UNWRITE.getCode()); |
|
|
|
record.setApplyStatus(EnumRentContractAppStatus.DEFAULT.getCode()); |
|
|
|
wxPropertyContractMapper.insert(record); |
|
|
|
//编辑 |
|
|
|
}else { |
|
|
|
record.setUpdatetime(date); |
|
|
|
wxPropertyContractMapper.updateById(record); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
logger.error("保存物业合同信息失败,e:" + e.getMessage()); |
|
|
|
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage()); |
|
|
|
|