|
|
@@ -2,6 +2,7 @@ package com.ydtech.modules.fnc.service.impl;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
@@ -163,13 +164,29 @@ public class InsPlySettleServiceImpl extends ServiceImpl<InsPlySettleMapper, Ins
|
|
|
//核销金额不能超总费用
|
|
|
InsPlySettle insPlySettle=this.baseMapper.selectBySettleno(insPlySettleHx.getSettleno());
|
|
|
insPlySettle.setHxamount(insPlySettle.getHxamount() ==null ? BigDecimal.ZERO:insPlySettle.getHxamount());
|
|
|
- if(insPlySettle.getHxamount().add(insPlySettleHx.getAmount()).compareTo(insPlySettle.getAllFeeValue())>0){
|
|
|
- return HttpResult.error("核销金额已超过总费用,请修改");
|
|
|
+ insPlySettle.setCommissionHxamount(insPlySettle.getCommissionHxamount() ==null ? BigDecimal.ZERO:insPlySettle.getCommissionHxamount());
|
|
|
+ insPlySettle.setOtherHxamount(insPlySettle.getOtherHxamount() ==null ? BigDecimal.ZERO:insPlySettle.getOtherHxamount());
|
|
|
+ if(insPlySettleHx.getFeeType().equals("S")
|
|
|
+ &&insPlySettle.getCommissionHxamount().add(insPlySettleHx.getAmount()).compareTo(insPlySettle.getCommissionFeevalue())>0){
|
|
|
+ return HttpResult.error("核销手续费金额已超过结算单手续费,请修改");
|
|
|
+ }
|
|
|
+ if(insPlySettleHx.getFeeType().equals("O")
|
|
|
+ &&insPlySettle.getOtherHxamount().add(insPlySettleHx.getAmount()).compareTo(insPlySettle.getOtherFeevalue())>0){
|
|
|
+ return HttpResult.error("核销其他费用金额已超过结算单其他费用,请修改");
|
|
|
}
|
|
|
|
|
|
+ //1.插入核销记录表
|
|
|
insPlySettleHx.setOperator(StpUtil.getLoginId().toString());
|
|
|
insPlySettleHx.setCreateTime(LocalDateTime.now());
|
|
|
insPlySettleHxMapper.insert(insPlySettleHx);
|
|
|
+ //2.修改核销状态 状态(0-未核销 1-部分核销 2-已核销)
|
|
|
+ InsPlySettle insPlySettle_status=new InsPlySettle();
|
|
|
+ if(insPlySettle.getHxamount().add(insPlySettleHx.getAmount()).compareTo(insPlySettle.getAllFeeValue())==0){
|
|
|
+ insPlySettle_status.setStatus("2");
|
|
|
+ }else{
|
|
|
+ insPlySettle_status.setStatus("1");
|
|
|
+ }
|
|
|
+ this.baseMapper.update(insPlySettle_status,new QueryWrapper<InsPlySettle>().eq("settleno",insPlySettleHx.getSettleno()));
|
|
|
return HttpResult.ok("核销成功");
|
|
|
}
|
|
|
@Override
|