Commit 41929c6c authored by LSL's avatar LSL

浙农结清问题

parent 0a903dfd
...@@ -100,12 +100,10 @@ public class BackedCommand extends AbstractCommand { ...@@ -100,12 +100,10 @@ public class BackedCommand extends AbstractCommand {
} }
} }
} }
planList = loanPlanComponent.getByLoan(loanNo);
LoanModel loanModel = loanComponent.getByLoanNo(loanNo); LoanModel loanModel = loanComponent.getByLoanNo(loanNo);
//存在还款中计划改为还款中 //存在还款中计划改为还款中
List<LoanPlanModel> backingList = planList.stream().filter(i -> i.getStatus() == DebtPlanStatusEnum.BACKING.getCode()).collect(Collectors.toList()); long l = loanPlanComponent.countLoanPlanByStatus(loanModel.getLoanNo());
if (CollectionUtils.isEmpty(backingList)) { if (Long.valueOf(l).intValue() == 0) {
loanModel.setLoanStatus(DebtInfoStatusEnum.SETTLED.getCode()); loanModel.setLoanStatus(DebtInfoStatusEnum.SETTLED.getCode());
} }
if (IsSettleEnum.ONE.getCode().equals(backedRequest.getIsSettle())) { if (IsSettleEnum.ONE.getCode().equals(backedRequest.getIsSettle())) {
......
...@@ -15,4 +15,6 @@ public interface LoanPlanComponent { ...@@ -15,4 +15,6 @@ public interface LoanPlanComponent {
int updateByLoanPlanModel(LoanPlanModel loanPlanModel); int updateByLoanPlanModel(LoanPlanModel loanPlanModel);
LoanPlanModel getPlanNoByLoan(String loanNo,String planIndex); LoanPlanModel getPlanNoByLoan(String loanNo,String planIndex);
long countLoanPlanByStatus(String loanNo);
} }
...@@ -3,13 +3,10 @@ package com.jqtx.windows.component.impl; ...@@ -3,13 +3,10 @@ package com.jqtx.windows.component.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import com.jqtx.windows.component.LoanPlanComponent; import com.jqtx.windows.component.LoanPlanComponent;
import com.jqtx.windows.component.model.LoanPlanModel; import com.jqtx.windows.component.model.LoanPlanModel;
import com.jqtx.windows.component.model.RepayModel; import com.jqtx.windows.infrastructure.feign.enums.DebtInfoStatusEnum;
import com.jqtx.windows.repository.entity.WindowsLoan;
import com.jqtx.windows.repository.entity.WindowsLoanExample;
import com.jqtx.windows.repository.entity.WindowsPlan; import com.jqtx.windows.repository.entity.WindowsPlan;
import com.jqtx.windows.repository.entity.WindowsPlanExample; import com.jqtx.windows.repository.entity.WindowsPlanExample;
import com.jqtx.windows.repository.mapper.WindowsPlanMapper; import com.jqtx.windows.repository.mapper.WindowsPlanMapper;
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;
...@@ -48,7 +45,7 @@ public class LoanPlanComponentImpl implements LoanPlanComponent { ...@@ -48,7 +45,7 @@ public class LoanPlanComponentImpl implements LoanPlanComponent {
} }
@Override @Override
public LoanPlanModel getPlanNoByLoan(String loanNo,String planIndex) { public LoanPlanModel getPlanNoByLoan(String loanNo, String planIndex) {
WindowsPlanExample example = new WindowsPlanExample(); WindowsPlanExample example = new WindowsPlanExample();
WindowsPlanExample.Criteria criteria = example.createCriteria(); WindowsPlanExample.Criteria criteria = example.createCriteria();
criteria.andLoanNoEqualTo(loanNo); criteria.andLoanNoEqualTo(loanNo);
...@@ -56,4 +53,17 @@ public class LoanPlanComponentImpl implements LoanPlanComponent { ...@@ -56,4 +53,17 @@ public class LoanPlanComponentImpl implements LoanPlanComponent {
List<WindowsPlan> windowsPlans = windowsPlanMapper.selectByExample(example); List<WindowsPlan> windowsPlans = windowsPlanMapper.selectByExample(example);
return windowsPlans.stream().map(m -> BeanUtil.toBean(m, LoanPlanModel.class)).findFirst().orElse(null); return windowsPlans.stream().map(m -> BeanUtil.toBean(m, LoanPlanModel.class)).findFirst().orElse(null);
} }
@Override
public long countLoanPlanByStatus(String loanNo) {
WindowsPlanExample example = new WindowsPlanExample();
WindowsPlanExample.Criteria criteria = example.createCriteria();
criteria.andLoanNoEqualTo(loanNo);
criteria.andStatusEqualTo(DebtInfoStatusEnum.BACKING.getCode());
long backing = windowsPlanMapper.countByExample(example);
criteria.andStatusEqualTo(DebtInfoStatusEnum.OVERDUED.getCode());
long overdued = windowsPlanMapper.countByExample(example);
return backing + overdued;
}
} }
...@@ -237,10 +237,8 @@ public class BackedBurdenJob { ...@@ -237,10 +237,8 @@ public class BackedBurdenJob {
} }
private void upWindowsLoan(LoanModel loanModel) { private void upWindowsLoan(LoanModel loanModel) {
List<LoanPlanModel> planList = loanPlanComponent.getByLoan(loanModel.getLoanNo()); long l = loanPlanComponent.countLoanPlanByStatus(loanModel.getLoanNo());
//存在还款中计划改为还款中 if (Long.valueOf(l).intValue() == 0) {
List<LoanPlanModel> backingList = planList.stream().filter(i -> i.getStatus() == DebtPlanStatusEnum.BACKING.getCode()).collect(Collectors.toList());
if (CollectionUtils.isEmpty(backingList)) {
loanModel.setLoanStatus(DebtInfoStatusEnum.SETTLED.getCode()); loanModel.setLoanStatus(DebtInfoStatusEnum.SETTLED.getCode());
} }
//修改 windows_loan 还款状态 //修改 windows_loan 还款状态
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment