|
|
@ -22,10 +22,12 @@ import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanoverduefin.UrlQuery; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanrestorereportapply.AlrepaidAndArrVo; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanreturninboundapply.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanreturninboundapply.flowable.*; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanreturninboundtrailer.LoanReturnInboundTrailer; |
|
|
|
import com.yxt.anrui.riskcenter.api.loanreturninboundtrailer.LoanReturnInboundTrailerDto; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanrestorereportapply.LoanRestoreReportApplyService; |
|
|
|
import com.yxt.anrui.riskcenter.biz.loanreturninboundtrailer.LoanReturnInboundTrailerService; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
@ -72,6 +74,8 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
@Autowired |
|
|
|
private FlowableFeign flowableFeign; |
|
|
|
@Autowired |
|
|
|
private LoanRestoreReportApplyService loanRestoreReportApplyService; |
|
|
|
|
|
|
|
public PagerVo<LoanReturnInboundApplyVo> listPageVo(PagerQuery<LoanReturnInboundApplyQuery> pq) { |
|
|
|
LoanReturnInboundApplyQuery query = pq.getParams(); |
|
|
@ -124,6 +128,10 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
qw.apply(StringUtils.isNotBlank(query.getCloseDateStart()), "date_format (la.closeDate,'%Y-%m-%d') >= date_format('" + query.getCloseDateStart() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(query.getCloseDateEnd()), "date_format (la.closeDate,'%Y-%m-%d') <= date_format('" + query.getCloseDateEnd() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
//申请日期
|
|
|
|
qw.apply(StringUtils.isNotBlank(query.getCreateDateStart()), "date_format (la.createTime,'%Y-%m-%d') >= date_format('" + query.getCreateDateStart() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(query.getCreateDateEnd()), "date_format (la.createTime,'%Y-%m-%d') <= date_format('" + query.getCreateDateEnd() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
//========================================数据授权开始
|
|
|
|
if (StringUtils.isNotBlank(query.getMenuUrl())) { |
|
|
|
//=======================
|
|
|
@ -283,20 +291,6 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
if ("是".equals(dto.getTralier())) { |
|
|
|
loanReturnInboundTrailerService.saveOrInsert(dto.getLoanReturnInboundTrailer(), loanReturnInboundApply.getSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getCurrentBeMoney())) { |
|
|
|
List<String> stringList = Arrays.asList(dto.getCurrentBeMoney().split("/")); |
|
|
|
if (StringUtils.isNotBlank(stringList.get(0))) { |
|
|
|
loanReturnInboundApply.setCurrentBeMoney(new BigDecimal(stringList.get(0))); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(stringList.get(1))) { |
|
|
|
loanReturnInboundApply.setWheFundOccMoney(new BigDecimal(stringList.get(1))); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getNper())) { |
|
|
|
List<String> stringList = Arrays.asList(dto.getNper().split("/")); |
|
|
|
loanReturnInboundApply.setNper(stringList.get(0)); |
|
|
|
loanReturnInboundApply.setCurrentPeriod(stringList.get(1)); |
|
|
|
} |
|
|
|
baseMapper.insert(loanReturnInboundApply); |
|
|
|
sid = loanReturnInboundApply.getSid(); |
|
|
|
} else { |
|
|
@ -320,27 +314,6 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
} else { |
|
|
|
loanReturnInboundTrailerService.deleteByMainSid(sid); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getCurrentBeMoney())) { |
|
|
|
List<String> stringList = Arrays.asList(dto.getCurrentBeMoney().split("/")); |
|
|
|
if (StringUtils.isNotBlank(stringList.get(0))) { |
|
|
|
loanReturnInboundApply.setCurrentBeMoney(new BigDecimal(stringList.get(0))); |
|
|
|
} else { |
|
|
|
loanReturnInboundApply.setCurrentBeMoney(new BigDecimal(0)); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(stringList.get(1))) { |
|
|
|
loanReturnInboundApply.setWheFundOccMoney(new BigDecimal(stringList.get(1))); |
|
|
|
} else { |
|
|
|
loanReturnInboundApply.setWheFundOccMoney(new BigDecimal(0)); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getNper())) { |
|
|
|
List<String> stringList = Arrays.asList(dto.getNper().split("/")); |
|
|
|
loanReturnInboundApply.setNper(stringList.get(0)); |
|
|
|
loanReturnInboundApply.setCurrentPeriod(stringList.get(1)); |
|
|
|
} else { |
|
|
|
loanReturnInboundApply.setNper(""); |
|
|
|
loanReturnInboundApply.setCurrentPeriod(""); |
|
|
|
} |
|
|
|
baseMapper.updateById(loanReturnInboundApply); |
|
|
|
} |
|
|
|
return rb.success().setData(sid); |
|
|
@ -380,15 +353,25 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(userVoResultBean.getMsg()); |
|
|
|
} |
|
|
|
//根据交回车辆事前报备申请sid查询数据
|
|
|
|
loanReturnInboundApplyDetailsVo = baseMapper.selectSidOne(chooseSid); |
|
|
|
AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr(loanReturnInboundApplyDetailsVo.getBusVinSid()); |
|
|
|
if (alrepaidAndArrVo != null) { |
|
|
|
BeanUtil.copyProperties(alrepaidAndArrVo, loanReturnInboundApplyDetailsVo); |
|
|
|
} |
|
|
|
loanReturnInboundApplyDetailsVo.setCreateDept(deptName); |
|
|
|
loanReturnInboundApplyDetailsVo.setCreateDeptSid(deptSid); |
|
|
|
loanReturnInboundApplyDetailsVo.setCreateByName(userVoResultBean.getData().getName()); |
|
|
|
loanReturnInboundApplyDetailsVo.setCreatgeDate(DateUtil.today()); |
|
|
|
//根据交回车辆事前报备申请sid查询数据
|
|
|
|
loanReturnInboundApplyDetailsVo = baseMapper.selectSidOne(chooseSid); |
|
|
|
loanReturnInboundApplyDetailsVo.setCreateDate(DateUtil.today()); |
|
|
|
loanReturnInboundApplyDetailsVo.setOrgPath(query.getOrgPath()); |
|
|
|
loanReturnInboundApplyDetailsVo.setUserSid(query.getUserSid()); |
|
|
|
|
|
|
|
|
|
|
|
} else {//编辑初始化
|
|
|
|
LoanReturnInboundApply loanReturnInboundApply = fetchBySid(sid); |
|
|
|
if (loanReturnInboundApply == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
loanReturnInboundApplyDetailsVo = baseMapper.selectDetails(sid); |
|
|
|
String files = loanReturnInboundApplyDetailsVo.getFiles(); |
|
|
|
List<UrlQuery> list = new ArrayList<>(); |
|
|
@ -409,6 +392,8 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
} |
|
|
|
loanReturnInboundApplyDetailsVo.setLoanReturnInboundTrailer(loanReturnInboundTrailerDto); |
|
|
|
} |
|
|
|
loanReturnInboundApplyDetailsVo.setOrgPath(loanReturnInboundApply.getOrgSidPath()); |
|
|
|
loanReturnInboundApplyDetailsVo.setUserSid(loanReturnInboundApply.getCreateBySid()); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
@ -440,6 +425,8 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
//根据busVinSid查询车辆是否已入库
|
|
|
|
|
|
|
|
ResultBean<String> resultBean = saveOrUpdateReturnInbound(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
@ -531,6 +518,7 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
loanReturnInboundApply = fetchBySid(businessSid); |
|
|
|
loanReturnInboundApply.setCloseDate(DateUtil.today()); |
|
|
|
baseMapper.updateById(loanReturnInboundApply); |
|
|
|
//
|
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
loanReturnInboundApply = fetchBySid(businessSid); |
|
|
@ -673,12 +661,32 @@ public class LoanReturnInboundApplyService extends MybatisBaseService<LoanReturn |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<ReturnInboundVo>> getInboundList(String useOrgSid) { |
|
|
|
public PagerVo<ReturnInboundVo> getInboundList(PagerQuery<LoanReturnQuery> pq) { |
|
|
|
LoanReturnQuery query = pq.getParams(); |
|
|
|
QueryWrapper<LoanReturnInboundApply> qw = new QueryWrapper<>(); |
|
|
|
List<String> busVinSid = new ArrayList<>(); |
|
|
|
if (query != null) { |
|
|
|
if (StringUtils.isNotBlank(query.getOrgPath())) { |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()).getData(); |
|
|
|
qw.eq("la.useOrgSid", useOrgSid); |
|
|
|
busVinSid = baseMapper.selectVehInbound(useOrgSid); |
|
|
|
busVinSid.removeAll(Collections.singleton(null)); |
|
|
|
} |
|
|
|
qw.eq("la.nodeState", "已办结"); |
|
|
|
|
|
|
|
} |
|
|
|
IPage<LoanReturnInboundApply> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<ReturnInboundVo> pagging = baseMapper.getInboundList(page, qw, busVinSid); |
|
|
|
PagerVo<ReturnInboundVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
/* public ResultBean<List<ReturnInboundVo>> getInboundList(String useOrgSid) { |
|
|
|
ResultBean<List<ReturnInboundVo>> rb = ResultBean.fireFail(); |
|
|
|
List<String> busVinSid = baseMapper.selectVehInbound(useOrgSid); |
|
|
|
busVinSid.removeAll(Collections.singleton(null)); |
|
|
|
List<ReturnInboundVo> list = baseMapper.getInboundList(useOrgSid, busVinSid); |
|
|
|
list.removeAll(Collections.singleton(null)); |
|
|
|
return rb.success().setData(list); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
} |
|
|
|