|
@@ -92,12 +92,12 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
|
|
|
@Override
|
|
|
public int updateByExampleSelective(RefundManage refundManage, RefundManageExample refundManageExample) {
|
|
|
- return modelMapper.updateByExampleSelective(refundManage,refundManageExample);
|
|
|
+ return modelMapper.updateByExampleSelective(refundManage, refundManageExample);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int updateByExample(RefundManage refundManage, RefundManageExample refundManageExample) {
|
|
|
- return modelMapper.updateByExample(refundManage,refundManageExample);
|
|
|
+ return modelMapper.updateByExample(refundManage, refundManageExample);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -118,10 +118,11 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
|
|
|
/**
|
|
|
* 根据身份证号带出关联房屋
|
|
|
+ *
|
|
|
* @param identityCard
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<ParkRoomResponse> getHouseListByIdCard(String identityCard){
|
|
|
+ public List<ParkRoomResponse> getHouseListByIdCard(String identityCard) {
|
|
|
|
|
|
// 根据身份证查询 买方信息
|
|
|
BuyerExample buyerExample = new BuyerExample();
|
|
@@ -134,7 +135,7 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
.andStatusNotEqualTo(5);
|
|
|
List<RoomSelectionInfo> selectionList = roomSelectionInfoMapper.selectByExample(roomSelectionInfoExample);
|
|
|
List<ParkRoomResponse> result = new ArrayList<>();
|
|
|
- for(RoomSelectionInfo info : selectionList){
|
|
|
+ for (RoomSelectionInfo info : selectionList) {
|
|
|
// 根据客户id 合同房间id 查询合同
|
|
|
ContractManageExample example = new ContractManageExample();
|
|
|
example.createCriteria().andCustomerManagementIdEqualTo(info.getCustomerManagementId())
|
|
@@ -152,15 +153,16 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
|
|
|
/**
|
|
|
* 新增退款
|
|
|
+ *
|
|
|
* @param model
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public int add(RefundManageDto model){
|
|
|
+ public int add(RefundManageDto model) {
|
|
|
|
|
|
ContractManage contractManage = contractManageMapper.selectByPrimaryKey(model.getContractId());
|
|
|
// 已退房
|
|
|
- if(contractManage.getContractStatus() == 3){
|
|
|
+ if (contractManage.getContractStatus() == 3) {
|
|
|
throw new RuntimeException("该房间已退款,请重新选择!!!");
|
|
|
}
|
|
|
|
|
@@ -170,11 +172,11 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
List<RefundDetail> details = JSONObject.parseArray(model.getRefundDetailInfoStr(), RefundDetail.class);
|
|
|
Integer collectionStatus = null;
|
|
|
Integer fundCollectionStatus = null;
|
|
|
- for (RefundDetail detail : details){
|
|
|
- if(detail.getType().equals("定金") || detail.getType().equals("房款")){
|
|
|
+ for (RefundDetail detail : details) {
|
|
|
+ if (detail.getType().equals("定金") || detail.getType().equals("房款")) {
|
|
|
collectionStatus = 3;
|
|
|
}
|
|
|
- if(detail.getType().equals("专项维修资金")){
|
|
|
+ if (detail.getType().equals("专项维修资金")) {
|
|
|
fundCollectionStatus = 3;
|
|
|
}
|
|
|
detail.setRefundManageId(id);
|
|
@@ -182,9 +184,13 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
detail.setCreatedAt(date);
|
|
|
refundDetailService.insertSelective(detail);
|
|
|
// 收款记录 更新退款状态
|
|
|
- PayLog payLog = payLogMapper.selectByPrimaryKey(detail.getPayLogId());
|
|
|
- payLog.setPaymentStatus(2);
|
|
|
- payLogMapper.updateByPrimaryKeySelective(payLog);
|
|
|
+ String[] split = detail.getPayLogId().split(",");
|
|
|
+ for (String paylogId : split) {
|
|
|
+ PayLog payLog = payLogMapper.selectByPrimaryKey(paylogId);
|
|
|
+ payLog.setPaymentStatus(2);
|
|
|
+ payLogMapper.updateByPrimaryKeySelective(payLog);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
}
|
|
|
model.setId(id);
|
|
@@ -219,11 +225,12 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
|
|
|
/**
|
|
|
* 编辑退款
|
|
|
+ *
|
|
|
* @param model
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional
|
|
|
- public int edit(RefundManageDto model){
|
|
|
+ public int edit(RefundManageDto model) {
|
|
|
|
|
|
String id = model.getId();
|
|
|
String userId = ShiroUtils.getUserId();
|
|
@@ -232,12 +239,12 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
RefundDetailExample refundDetailExample = new RefundDetailExample();
|
|
|
refundDetailExample.createCriteria().andRefundManageIdEqualTo(model.getId());
|
|
|
List<RefundDetail> oldDetails = refundDetailService.selectByExample(refundDetailExample);
|
|
|
- for(RefundDetail detail : oldDetails){
|
|
|
+ for (RefundDetail detail : oldDetails) {
|
|
|
refundDetailService.deleteByPrimaryKey(detail.getId());
|
|
|
}
|
|
|
// 再新增
|
|
|
List<RefundDetail> details = JSONObject.parseArray(model.getRefundDetailInfoStr(), RefundDetail.class);
|
|
|
- for (RefundDetail detail : details){
|
|
|
+ for (RefundDetail detail : details) {
|
|
|
detail.setRefundManageId(id);
|
|
|
detail.setCreatedId(userId);
|
|
|
detail.setCreatedAt(date);
|
|
@@ -252,6 +259,7 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
|
|
|
/**
|
|
|
* 退款列表
|
|
|
+ *
|
|
|
* @param tablepar
|
|
|
* @param model
|
|
|
* @param dt
|
|
@@ -264,17 +272,16 @@ public class RefundManageService implements BaseService<RefundManage, RefundMana
|
|
|
return pageInfo;
|
|
|
}
|
|
|
|
|
|
- public RefundManageDto getById(String id){
|
|
|
+ public RefundManageDto getById(String id) {
|
|
|
RefundManage refundManage = selectByPrimaryKey(id);
|
|
|
RefundManageDto result = new RefundManageDto();
|
|
|
FrameUser frameUser = frameUserMapper.selectByPrimaryKey(refundManage.getCreatedId());
|
|
|
String userName = "";
|
|
|
userName = frameUser == null ? "" : frameUser.getTruename();
|
|
|
result.setCreatedName(userName);
|
|
|
- BeanUtil.copyProperties(refundManage,result);
|
|
|
+ BeanUtil.copyProperties(refundManage, result);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
}
|