|
|
@ -47,6 +47,8 @@ import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.LoanRepaymentHistory; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymenthistory.LoanRepaymentHistoryRecordVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrepaymentplandetails.LoanRepaymentPlanDetails; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrestorereportapply.AlrepaidAndArrVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansubletapply.SubletVinList; |
|
|
|
import com.yxt.anrui.riskcenter.api.loansubletapply.VehDisposal; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanbuckleapplyrecord.LoanBuckleApplyRecordService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanfile.LoanFileService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanredemptionveh.LoanRedemptionVehService; |
|
|
@ -242,7 +244,7 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
qw.orderByDesc("v.createTime"); |
|
|
|
qw.eq("v.stockState", "库存"); |
|
|
|
qw.eq("v.disposal", "未处置"); |
|
|
|
qw.eq("v.vehType","主车"); |
|
|
|
qw.eq("v.vehType", "主车"); |
|
|
|
IPage<VinListVo> pagging = baseMapper.getVinList(page, qw); |
|
|
|
PagerVo<VinListVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
@ -308,6 +310,7 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
if (StringUtils.isNotBlank(redemptionInitVo.getVehType())) { |
|
|
|
mainVeh.setVehType(redemptionInitVo.getVehType()); |
|
|
|
} |
|
|
|
mainVeh.setLedgerSid(ledgerSid); |
|
|
|
vinList.add(mainVeh); |
|
|
|
if (StringUtils.isNotBlank(redemptionInitVo.getLedgerSid())) { |
|
|
|
RedemptionVinList trailerVeh = baseMapper.selTrailerByLedgerSid(redemptionInitVo.getLedgerSid()); |
|
|
@ -427,7 +430,6 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
} |
|
|
|
} |
|
|
|
loanRedemptionVehService.insert(redemptionVeh); |
|
|
|
//todo 交回车辆状态处置状态修改
|
|
|
|
} |
|
|
|
} |
|
|
|
//删除附件表中关于该linkSid的文件
|
|
|
@ -444,6 +446,10 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
return rb.success().setData(sid); |
|
|
|
} |
|
|
|
|
|
|
|
public int updateVehLedgerDisposal(String sid, String disposalKey, String disposal) { |
|
|
|
return baseMapper.updateVehLedgerDisposal(sid, disposalKey, disposal); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<LoanRedemptionApplyInit> redemptionDetails(String sid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
LoanRedemptionApplyInit vo = new LoanRedemptionApplyInit(); |
|
|
@ -542,7 +548,6 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
if (i == 0) { |
|
|
|
return rb.setMsg("删除失败"); |
|
|
|
} |
|
|
|
//todo 修改交回车辆台账状态
|
|
|
|
} |
|
|
|
return ResultBean.fireSuccess().setMsg("删除成功"); |
|
|
|
} |
|
|
@ -597,6 +602,17 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
List<RedemptionVinList> dtoVinList = dto.getVinList(); |
|
|
|
if (!dtoVinList.isEmpty()) { |
|
|
|
for (RedemptionVinList v : dtoVinList) { |
|
|
|
VehDisposal vehDisposal = baseMapper.selVehDisposal(v.getLedgerSid()); |
|
|
|
if (null != vehDisposal) { |
|
|
|
if (!vehDisposal.getDisposal().equals("未处置")) { |
|
|
|
return rb.setMsg("当前所选车辆不是未处置状态,无法提交!"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
String businessSid = ""; |
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = saveRedemption(dto); |
|
|
@ -605,6 +621,13 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
} else { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
//提交之后修改车辆台账
|
|
|
|
List<RedemptionVinList> vinLists1 = loanRedemptionVehService.selByMainSid(businessSid); |
|
|
|
if (!vinLists1.isEmpty()) { |
|
|
|
vinLists1.stream().forEach(v -> { |
|
|
|
updateVehLedgerDisposal(v.getLedgerSid(), "02", "客户赎回"); |
|
|
|
}); |
|
|
|
} |
|
|
|
LoanRedemptionApply entity = fetchBySid(businessSid); |
|
|
|
String orgSidPath = ""; |
|
|
|
if (StringUtils.isNotBlank(entity.getOrgSidPath())) { |
|
|
@ -756,11 +779,27 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
int i = updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
LoanRedemptionApply redemptionApply = fetchBySid(businessSid); |
|
|
|
redemptionApply.setClosingDate(new DateTime()); |
|
|
|
baseMapper.updateById(redemptionApply); |
|
|
|
//todo 修改交车车辆台账状态
|
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
loanRedemptionApply = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
messageFlowVo.setProcDefId(loanRedemptionApply.getProcDefId()); |
|
|
|
messageFlowVo.setProcInsId(loanRedemptionApply.getProcInstId()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("交回车辆赎回申请"); |
|
|
|
messageFlowableQuery.setMsgContent(loanRedemptionApply.getApplyName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("交回车辆赎回申请"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
@ -785,6 +824,21 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
loanRedemptionApply = fetchBySid(query.getBusinessSid()); |
|
|
|
String procId = loanRedemptionApply.getProcInstId(); |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(procId); |
|
|
|
String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_(); |
|
|
|
String nextName = listResultBean.getData().get(0).getName_(); |
|
|
|
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); |
|
|
|
if ("发起申请".equals(nextName)) { |
|
|
|
//退回车辆处置状态
|
|
|
|
List<RedemptionVinList> vinLists1 = loanRedemptionVehService.selByMainSid(query.getBusinessSid()); |
|
|
|
if (!vinLists1.isEmpty()) { |
|
|
|
vinLists1.stream().forEach(v -> { |
|
|
|
updateVehLedgerDisposal(v.getLedgerSid(), "01", "未处置"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |
|
|
@ -850,6 +904,13 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
// if (receiveSidList.size() == 1 && receiveSidList.get(0).equals(busVehicleApply.getCreateBySid())) {
|
|
|
|
if ("发起申请".equals(nextName)) { |
|
|
|
messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); |
|
|
|
//退回车辆处置状态
|
|
|
|
List<RedemptionVinList> vinLists1 = loanRedemptionVehService.selByMainSid(query.getBusinessSid()); |
|
|
|
if (!vinLists1.isEmpty()) { |
|
|
|
vinLists1.stream().forEach(v -> { |
|
|
|
updateVehLedgerDisposal(v.getLedgerSid(), "01", "未处置"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
SysUserVo userVo = sysUserFeign.fetchBySid(loanRedemptionApply.getCreateBySid()).getData(); |
|
|
|
if (userVo != null) { |
|
|
@ -892,9 +953,13 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
//终止任务后操作
|
|
|
|
LoanRedemptionApply entity = fetchBySid(query.getBusinessSid()); |
|
|
|
if (entity.getNodeState().equals("终止")) { |
|
|
|
|
|
|
|
// todo 修改交回车辆状态
|
|
|
|
|
|
|
|
List<RedemptionVinList> vinLists = loanRedemptionVehService.selByMainSid(query.getBusinessSid()); |
|
|
|
if (!vinLists.isEmpty()) { |
|
|
|
vinLists.stream().forEach(v -> { |
|
|
|
updateVehLedgerDisposal(v.getLedgerSid(), "01", "未处置"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
@ -910,9 +975,13 @@ public class LoanRedemptionApplyService extends MybatisBaseService<LoanRedemptio |
|
|
|
//终止任务后操作
|
|
|
|
LoanRedemptionApply entity = fetchBySid(query.getBusinessSid()); |
|
|
|
if (entity.getNodeState().equals("终止")) { |
|
|
|
|
|
|
|
// todo 修改交回车辆状态
|
|
|
|
|
|
|
|
List<RedemptionVinList> vinLists = loanRedemptionVehService.selByMainSid(query.getBusinessSid()); |
|
|
|
if (!vinLists.isEmpty()) { |
|
|
|
vinLists.stream().forEach(v -> { |
|
|
|
updateVehLedgerDisposal(v.getLedgerSid(), "01", "未处置"); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|