|
@@ -4,16 +4,19 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.rongwe.zhsw.system.domain.*;
|
|
import com.rongwe.zhsw.system.domain.*;
|
|
|
|
+import com.rongwei.rwadmincommon.system.vo.SysUserVo;
|
|
import com.rongwei.rwcommon.base.R;
|
|
import com.rongwei.rwcommon.base.R;
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
import com.rongwei.zhsw.system.dao.SwRefundRequestRecordDao;
|
|
import com.rongwei.zhsw.system.dao.SwRefundRequestRecordDao;
|
|
import com.rongwei.zhsw.system.service.*;
|
|
import com.rongwei.zhsw.system.service.*;
|
|
|
|
+import com.rongwei.zhsw.system.utils.ZhswCommonUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import static com.rongwei.zhsw.system.utils.SaveConstans.billInfo.PENDINGSTATUS;
|
|
import static com.rongwei.zhsw.system.utils.SaveConstans.billInfo.PENDINGSTATUS;
|
|
import static com.rongwei.zhsw.system.utils.SaveConstans.billReccord.FULLREFUNDSTATUS;
|
|
import static com.rongwei.zhsw.system.utils.SaveConstans.billReccord.FULLREFUNDSTATUS;
|
|
@@ -48,20 +51,27 @@ public class SwRefundRequestRecordServiceImpl extends ServiceImpl<SwRefundReques
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public R refundApplication(String id) {
|
|
public R refundApplication(String id) {
|
|
|
|
|
|
|
|
+ //当前用户
|
|
|
|
+ SysUserVo currentUser = ZhswCommonUtils.getCurrentUser();
|
|
|
|
+
|
|
//1.获取退款记录
|
|
//1.获取退款记录
|
|
SwRefundRequestRecordDO refundRequestRecordDO = swRefundRequestRecordService.getById(id);
|
|
SwRefundRequestRecordDO refundRequestRecordDO = swRefundRequestRecordService.getById(id);
|
|
|
|
|
|
// 缴费记录表更新:
|
|
// 缴费记录表更新:
|
|
- updateBillRecord(refundRequestRecordDO);
|
|
|
|
|
|
+ updateBillRecord(refundRequestRecordDO,currentUser);
|
|
|
|
|
|
BigDecimal balanceAdd =BigDecimal.ZERO;
|
|
BigDecimal balanceAdd =BigDecimal.ZERO;
|
|
|
|
|
|
//全额 退款
|
|
//全额 退款
|
|
if (refundRequestRecordDO.getRefundmethod().equals(REFUNDMETHODALL)){
|
|
if (refundRequestRecordDO.getRefundmethod().equals(REFUNDMETHODALL)){
|
|
- // 退款记录表更新 实退金额
|
|
|
|
|
|
+ // 退款记录表更新 实退金额 退款操作人,操作时间
|
|
swRefundRequestRecordService.update(new LambdaUpdateWrapper<SwRefundRequestRecordDO>()
|
|
swRefundRequestRecordService.update(new LambdaUpdateWrapper<SwRefundRequestRecordDO>()
|
|
.eq(SwRefundRequestRecordDO::getId, refundRequestRecordDO.getId())
|
|
.eq(SwRefundRequestRecordDO::getId, refundRequestRecordDO.getId())
|
|
- .set(SwRefundRequestRecordDO::getActualretirement, refundRequestRecordDO.getRefundamount()));
|
|
|
|
|
|
+ .set(SwRefundRequestRecordDO::getActualretirement, refundRequestRecordDO.getRefundamount())
|
|
|
|
+ .set(SwRefundRequestRecordDO::getRefundoperatorid, currentUser.getId())
|
|
|
|
+ .set(SwRefundRequestRecordDO::getRefundoperatorname, currentUser.getName())
|
|
|
|
+ .set(SwRefundRequestRecordDO::getRefundtime,new Date())
|
|
|
|
+ );
|
|
|
|
|
|
//预收账单记录表更新: 已缴账单记录表更新
|
|
//预收账单记录表更新: 已缴账单记录表更新
|
|
updateOrSaveBills(refundRequestRecordDO.getPaymentrecordid());
|
|
updateOrSaveBills(refundRequestRecordDO.getPaymentrecordid());
|
|
@@ -118,16 +128,19 @@ public class SwRefundRequestRecordServiceImpl extends ServiceImpl<SwRefundReques
|
|
|
|
|
|
/**
|
|
/**
|
|
* 更新缴费记录
|
|
* 更新缴费记录
|
|
|
|
+ *
|
|
* @param refundRequestRecordDO
|
|
* @param refundRequestRecordDO
|
|
|
|
+ * @param currentUser
|
|
*/
|
|
*/
|
|
- private void updateBillRecord(SwRefundRequestRecordDO refundRequestRecordDO) {
|
|
|
|
|
|
+ private void updateBillRecord(SwRefundRequestRecordDO refundRequestRecordDO, SysUserVo currentUser) {
|
|
// 将对应的 【退款金额】【退款人】【退款时间】记录到 缴费记录表中,
|
|
// 将对应的 【退款金额】【退款人】【退款时间】记录到 缴费记录表中,
|
|
SwBillingRecordDo swBillingRecordUpdateDo = new SwBillingRecordDo();
|
|
SwBillingRecordDo swBillingRecordUpdateDo = new SwBillingRecordDo();
|
|
swBillingRecordUpdateDo.setId(refundRequestRecordDO.getPaymentrecordid());
|
|
swBillingRecordUpdateDo.setId(refundRequestRecordDO.getPaymentrecordid());
|
|
- swBillingRecordUpdateDo.setRefundtime(refundRequestRecordDO.getRefundtime());
|
|
|
|
- swBillingRecordUpdateDo.setRefundoperatorid(refundRequestRecordDO.getRefundoperatorid());
|
|
|
|
- swBillingRecordUpdateDo.setRefundoperatorname(refundRequestRecordDO.getRefundoperatorname());
|
|
|
|
|
|
+ swBillingRecordUpdateDo.setRefundtime(new Date());
|
|
|
|
+ swBillingRecordUpdateDo.setRefundoperatorid(currentUser.getId());
|
|
|
|
+ swBillingRecordUpdateDo.setRefundoperatorname(currentUser.getName());
|
|
swBillingRecordUpdateDo.setRefundamount(refundRequestRecordDO.getRefundamount());
|
|
swBillingRecordUpdateDo.setRefundamount(refundRequestRecordDO.getRefundamount());
|
|
|
|
+
|
|
//全额退款 系统需要同时缴费记录的缴费 状态 更新为 “全部退款” 状态,【本次实缴-整数】更新为 0,【缴费后余额】更新为 0
|
|
//全额退款 系统需要同时缴费记录的缴费 状态 更新为 “全部退款” 状态,【本次实缴-整数】更新为 0,【缴费后余额】更新为 0
|
|
if (refundRequestRecordDO.getRefundmethod().equals(REFUNDMETHODALL)){
|
|
if (refundRequestRecordDO.getRefundmethod().equals(REFUNDMETHODALL)){
|
|
swBillingRecordUpdateDo.setPayfeesstatus(FULLREFUNDSTATUS);
|
|
swBillingRecordUpdateDo.setPayfeesstatus(FULLREFUNDSTATUS);
|