|
@@ -248,6 +248,7 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
|
|
|
payLog.setHouseId(null);
|
|
|
payLog.setContractId(null);
|
|
|
payLog.setCustomerManagementId(model.getCustomerManagementId());
|
|
|
+ payLog.setBusinessId(id);
|
|
|
// 收款类型 预收款
|
|
|
payLog.setPayType(1);
|
|
|
// 款项内容 意向金
|
|
@@ -366,15 +367,8 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
|
|
|
if (StringUtils.isEmpty(uerId)){
|
|
|
uerId = ShiroUtils.getUserId();
|
|
|
}
|
|
|
- String roomSelectionInfoId = IdUtil.simpleUUID();
|
|
|
-
|
|
|
- // 转定金
|
|
|
- model.setStatus(2);
|
|
|
- model.setHandleId(ShiroUtils.getUserId());
|
|
|
- model.setHandleDate(new Date());
|
|
|
- model.setRoomSelectionInfoId(roomSelectionInfoId);
|
|
|
- int result = modelMapper.updateByPrimaryKeySelective(model);
|
|
|
-
|
|
|
+ String roomSelectionInfoId;
|
|
|
+ RoomSelectionInfo roomSelectionInfo;
|
|
|
String houseId = model.getHouseId();
|
|
|
String customerManagementId = model.getCustomerManagementId();
|
|
|
|
|
@@ -393,24 +387,48 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
|
|
|
customerManagement.setHouseName(builder.toString());
|
|
|
customerManagementMapper.updateByPrimaryKeySelective(customerManagement);
|
|
|
|
|
|
- // 新增选房信息
|
|
|
- RoomSelectionInfo roomSelectionInfo = new RoomSelectionInfo();
|
|
|
- roomSelectionInfo.setId(roomSelectionInfoId);
|
|
|
- roomSelectionInfo.setCustomerManagementId(customerManagementId);
|
|
|
- roomSelectionInfo.setHouseId(response.getId());
|
|
|
- roomSelectionInfo.setBuildId(response.getBuildId());
|
|
|
- roomSelectionInfo.setDiscId(response.getDiscId());
|
|
|
- roomSelectionInfo.setGroupId(response.getGroupId());
|
|
|
- roomSelectionInfo.setCreatedAt(new Date());
|
|
|
- roomSelectionInfo.setCreatedId(ShiroUtils.getUserId());
|
|
|
- roomSelectionInfo.setReceivableMoney(model.getReceivableMoney());
|
|
|
- roomSelectionInfo.setReceivedAmount(model.getReceivedAmount());
|
|
|
- // 收取状态 意向金转入
|
|
|
- roomSelectionInfo.setStatus(3);
|
|
|
- roomSelectionInfo.setSerialNumber(model.getDepositSerialNumber());
|
|
|
- roomSelectionInfo.setPaymentMethod(model.getPaymentMethod());
|
|
|
- roomSelectionInfo.setCollectionTime(model.getCollectionTime());
|
|
|
- roomSelectionInfoMapper.insertSelective(roomSelectionInfo);
|
|
|
+ RoomSelectionInfoExample roomSelectionInfoExample = new RoomSelectionInfoExample();
|
|
|
+ roomSelectionInfoExample.createCriteria().andCustomerManagementIdEqualTo(customerManagementId);
|
|
|
+ List<RoomSelectionInfo> list = roomSelectionInfoMapper.selectByExample(roomSelectionInfoExample);
|
|
|
+ // 已选房的情况
|
|
|
+ if (CollectionUtils.isNotEmpty(list)) {
|
|
|
+ roomSelectionInfo = list.get(0);
|
|
|
+ roomSelectionInfoId = roomSelectionInfo.getId();
|
|
|
+ roomSelectionInfo.setCustomerManagementId(customerManagementId);
|
|
|
+ roomSelectionInfo.setHouseId(response.getId());
|
|
|
+ roomSelectionInfo.setBuildId(response.getBuildId());
|
|
|
+ roomSelectionInfo.setDiscId(response.getDiscId());
|
|
|
+ roomSelectionInfo.setGroupId(response.getGroupId());
|
|
|
+ roomSelectionInfo.setReceivableMoney(model.getReceivableMoney());
|
|
|
+ roomSelectionInfo.setReceivedAmount(model.getReceivedAmount());
|
|
|
+ // 收取状态 意向金转入
|
|
|
+ roomSelectionInfo.setStatus(3);
|
|
|
+ roomSelectionInfo.setSerialNumber(model.getDepositSerialNumber());
|
|
|
+ roomSelectionInfo.setPaymentMethod(model.getPaymentMethod());
|
|
|
+ roomSelectionInfo.setCollectionTime(model.getCollectionTime());
|
|
|
+ roomSelectionInfoMapper.updateByPrimaryKeySelective(roomSelectionInfo);
|
|
|
+ }else {
|
|
|
+ roomSelectionInfoId = IdUtil.simpleUUID();
|
|
|
+ // 新增选房信息
|
|
|
+ roomSelectionInfo = new RoomSelectionInfo();
|
|
|
+ roomSelectionInfo.setId(roomSelectionInfoId);
|
|
|
+ roomSelectionInfo.setCustomerManagementId(customerManagementId);
|
|
|
+ roomSelectionInfo.setHouseId(response.getId());
|
|
|
+ roomSelectionInfo.setBuildId(response.getBuildId());
|
|
|
+ roomSelectionInfo.setDiscId(response.getDiscId());
|
|
|
+ roomSelectionInfo.setGroupId(response.getGroupId());
|
|
|
+ roomSelectionInfo.setCreatedAt(new Date());
|
|
|
+ roomSelectionInfo.setCreatedId(ShiroUtils.getUserId());
|
|
|
+ roomSelectionInfo.setReceivableMoney(model.getReceivableMoney());
|
|
|
+ roomSelectionInfo.setReceivedAmount(model.getReceivedAmount());
|
|
|
+ // 收取状态 意向金转入
|
|
|
+ roomSelectionInfo.setStatus(3);
|
|
|
+ roomSelectionInfo.setSerialNumber(model.getDepositSerialNumber());
|
|
|
+ roomSelectionInfo.setPaymentMethod(model.getPaymentMethod());
|
|
|
+ roomSelectionInfo.setCollectionTime(model.getCollectionTime());
|
|
|
+ roomSelectionInfoMapper.insertSelective(roomSelectionInfo);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
// 转定金后生成合同
|
|
|
String contractId = IdUtil.simpleUUID();
|
|
@@ -484,6 +502,12 @@ public class IntentionalDepositService implements BaseService<IntentionalDeposit
|
|
|
receiptManageService.updateByPrimaryKeySelective(manage);
|
|
|
}
|
|
|
|
|
|
+ // 转定金
|
|
|
+ model.setStatus(2);
|
|
|
+ model.setHandleId(ShiroUtils.getUserId());
|
|
|
+ model.setHandleDate(new Date());
|
|
|
+ model.setRoomSelectionInfoId(roomSelectionInfoId);
|
|
|
+ int result = modelMapper.updateByPrimaryKeySelective(model);
|
|
|
|
|
|
return result;
|
|
|
|