Commit 428d760c authored by Data-王博's avatar Data-王博

湖北消金 - 对一分钱处理

parent b8ad581f
......@@ -8,6 +8,7 @@ import cn.quantgroup.financial.json.JsonResult;
import cn.quantgroup.financial.mapper.PaymentDetailMapper;
import cn.quantgroup.financial.model.PaymentDetail;
import cn.quantgroup.financial.model.RepaymentPlanStatus;
import cn.quantgroup.financial.scheduler.HuBeiReturnDiscScheduler;
import cn.quantgroup.financial.scheduler.HuBeiSendDiscScheduler;
import cn.quantgroup.financial.service.IApiCommonService;
import cn.quantgroup.financial.service.IHuBeiService;
......@@ -46,6 +47,9 @@ public class ApiCommonController {
@Autowired
HuBeiSendDiscScheduler huBeiDayScheduler;
@Autowired
HuBeiReturnDiscScheduler huBeiReturnDiscScheduler;
/**
* 放款 通知包含还款计划
* @return
......@@ -143,15 +147,26 @@ public class ApiCommonController {
return JsonResult.SUCCESS();
}
@RequestMapping(value = "/hubei/returnDisc", method = {RequestMethod.POST,RequestMethod.GET})
public @ResponseBody JsonResult getReturnDisc(@RequestParam("applyDt") String applyDt,@RequestParam("type") Integer type,@RequestParam("docId") Long docId){
@RequestMapping(value = "/hubei/returnDiscScheduler", method = {RequestMethod.POST,RequestMethod.GET})
public @ResponseBody JsonResult getReturnDisc(){
try {
huBeiReturnDiscScheduler.dayScheduler();
} catch (Exception e) {
logger.error(e.getMessage());
}
return JsonResult.SUCCESS();
}
@RequestMapping(value = "/hubei/handleReturnDisc", method = {RequestMethod.POST,RequestMethod.GET})
public @ResponseBody JsonResult handleReturnDisc(@RequestParam("applyDt") String applyDt,@RequestParam("type") Integer type,@RequestParam("docId") Long docId){
try {
if(type.intValue()==HubeiCFCDataType.RETURN_ADVANCE_REPAYMENT.get().intValue()){
huBeiService.handleDiscData(HubeiCFCDataType.RETURN_ADVANCE_REPAYMENT,null,null,new Integer(1).byteValue(),applyDt);
// huBeiService.handleDiscData(HubeiCFCDataType.RETURN_ADVANCE_REPAYMENT,null,docId,new Integer(1).byteValue(),applyDt);
}else if(type.intValue()==HubeiCFCDataType.RETURN_BATCH_COMPENSATION.get().intValue()){
huBeiService.handleDiscData(HubeiCFCDataType.RETURN_BATCH_COMPENSATION,null,null,new Integer(1).byteValue(),applyDt);
huBeiService.handleDiscData(HubeiCFCDataType.RETURN_BATCH_COMPENSATION,null,docId,new Integer(1).byteValue(),applyDt);
}else if(type.intValue()==HubeiCFCDataType.RETURN_BATCH_DEBIT.get().intValue()){
huBeiService.handleDiscData(HubeiCFCDataType.RETURN_BATCH_DEBIT,null,null,new Integer(1).byteValue(),applyDt);
huBeiService.handleDiscData(HubeiCFCDataType.RETURN_BATCH_DEBIT,null,docId,new Integer(1).byteValue(),applyDt);
}
} catch (Exception e) {
logger.error(e.getMessage());
......
......@@ -127,6 +127,7 @@ public class HuBeiReturnDiscScheduler {
iHuBeiService.sendErrorMailNotice("回盘文件发送失败,请悉知 联系相关人员");
}
}
}
class ScheduleAdvanceRepay implements Runnable{
......
......@@ -298,7 +298,12 @@ public class HuBeiServiceImpl implements IHuBeiService {
if(jsonBean!=null&&jsonBean.getRepayAmount()!=null&&jsonBean.getReallyRepayAmount()!=null){
if(jsonBean.getReallyRepayAmount().compareTo(BigDecimal.ZERO)!=0&&jsonBean.getRepayAmount().compareTo(jsonBean.getReallyRepayAmount())!=0){
errorHuBeiHistoryList.add(history);
continue;
if(jsonBean.getRepayAmount().subtract(jsonBean.getReallyRepayAmount()).compareTo(new BigDecimal("0.01"))>0){
continue;
}else {
//差值在一分钱以内 则发错误邮件同时校准跟湖北保持一致 方便后续对账。
jsonBean.setReallyRepayAmount(jsonBean.getRepayAmount());
}
}
}else {
logger.info("jsonBean is null, history={}", JSON.toJSONString(history));
......@@ -573,10 +578,17 @@ public class HuBeiServiceImpl implements IHuBeiService {
if(paymentDetail==null){
logger.warn("loanId={} cant`t get paymentdetail",repayXyqbDetailList.get(0).getLoanApplicationHistoryId());
iApiCommonService.queryData(repayXyqbDetailList.get(0).getLoanApplicationHistoryId(),null);
paymentDetail = paymentDao.getByLoanId(repayXyqbDetailList.get(0).getLoanApplicationHistoryId());
}
List<HuBeiHistory> flowHuBeiHistoryList = huBeiCFCDao.getFlowByContractNoList(Arrays.asList(paymentDetail.getMerchantContractNo()));
List<HuBeiHistory> flowHuBeiHistoryList = null;
if(paymentDetail!=null){
try {
flowHuBeiHistoryList = huBeiCFCDao.getFlowByContractNoList(Arrays.asList(paymentDetail.getMerchantContractNo()));
} catch (Exception e) {
logger.error(e.getMessage(),e);
}
for(RepayXyqbDetail repayXyqbDetail: repayXyqbDetailList){
seqNo++;
HuBeiHistory advanceHuiBeiHistory = new HuBeiHistory();
......
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