|
|
@ -73,8 +73,8 @@ public class LoanReturnVehLedgerService extends MybatisBaseService<LoanReturnVeh |
|
|
|
loanReturnVehLedger.setBorrowerName(loanReturnInboundApply.getLoanName()); |
|
|
|
loanReturnVehLedger.setBorrowerSid(loanReturnInboundApply.getLoanSid()); |
|
|
|
loanReturnVehLedger.setLocation(loanReturnInboundApply.getLocationName()); |
|
|
|
// loanReturnVehLedger.setDisposal();
|
|
|
|
// loanReturnVehLedger.setDisposalKey();
|
|
|
|
loanReturnVehLedger.setDisposal(ReturnVehType.Disposal.WCZ.getRemarks()); |
|
|
|
loanReturnVehLedger.setDisposalKey(ReturnVehType.Disposal.WCZ.getCode()); |
|
|
|
loanReturnVehLedger.setInboundMoney(loanReturnInboundApply.getInboundMoney()); |
|
|
|
loanReturnVehLedger.setInboundDate(new Date()); |
|
|
|
loanReturnVehLedger.setUseOrgSid(loanReturnInboundApply.getUseOrgSid()); |
|
|
@ -84,7 +84,8 @@ public class LoanReturnVehLedgerService extends MybatisBaseService<LoanReturnVeh |
|
|
|
loanReturnVehLedger.setBusVinSid(loanReturnInboundApply.getBusVinSid()); |
|
|
|
BusSalesOrderVehicle busSalesOrderVehicle = baseMapper.selectBusVinSid(loanReturnVehLedger.getBusVinSid()); |
|
|
|
loanReturnVehLedger.setSaleOrderSid(busSalesOrderVehicle.getSalesOrderSid()); |
|
|
|
loanReturnVehLedger.setVehicleState("库存"); |
|
|
|
loanReturnVehLedger.setStockState(ReturnVehType.ReturnVehicleState.KC.getRemarks()); |
|
|
|
loanReturnVehLedger.setStockStateKey(ReturnVehType.ReturnVehicleState.KC.getCode()); |
|
|
|
baseMapper.insert(loanReturnVehLedger); |
|
|
|
if (loanReturnInboundTrailer != null) { |
|
|
|
LoanReturnVehLedger loanReturnVehLedgerTrailer = new LoanReturnVehLedger(); |
|
|
@ -97,18 +98,21 @@ public class LoanReturnVehLedgerService extends MybatisBaseService<LoanReturnVeh |
|
|
|
loanReturnVehLedgerTrailer.setPSid(loanReturnVehLedger.getSid()); |
|
|
|
loanReturnVehLedgerTrailer.setCustomer(loanReturnInboundApply.getCustomerName()); |
|
|
|
loanReturnVehLedgerTrailer.setCustomerSid(loanReturnInboundApply.getCustomerSid()); |
|
|
|
loanReturnVehLedgerTrailer.setVehicleState("库存"); |
|
|
|
loanReturnVehLedgerTrailer.setStockState(ReturnVehType.ReturnVehicleState.KC.getRemarks()); |
|
|
|
loanReturnVehLedgerTrailer.setStockStateKey(ReturnVehType.ReturnVehicleState.KC.getCode()); |
|
|
|
loanReturnVehLedgerTrailer.setBorrowerSid(loanReturnInboundApply.getLoanSid()); |
|
|
|
loanReturnVehLedgerTrailer.setBorrowerName(loanReturnInboundApply.getLoanName()); |
|
|
|
// loanReturnVehLedgerTrailer.setDisposal();
|
|
|
|
// loanReturnVehLedgerTrailer.setDisposalKey();
|
|
|
|
loanReturnVehLedgerTrailer.setDisposal(ReturnVehType.Disposal.WCZ.getRemarks()); |
|
|
|
loanReturnVehLedgerTrailer.setDisposalKey(ReturnVehType.Disposal.WCZ.getCode()); |
|
|
|
loanReturnVehLedgerTrailer.setInboundMoney(loanReturnInboundApply.getInboundMoney()); |
|
|
|
loanReturnVehLedgerTrailer.setInboundDate(new Date()); |
|
|
|
loanReturnVehLedgerTrailer.setOrgSidPath(loanReturnInboundApply.getOrgSidPath()); |
|
|
|
loanReturnVehLedgerTrailer.setBusSid(businessSid); |
|
|
|
loanReturnVehLedgerTrailer.setVehType("挂车"); |
|
|
|
loanReturnVehLedgerTrailer.setLocation(loanReturnVehLedger.getLocation()); |
|
|
|
loanReturnVehLedgerTrailer.setLocationSid(loanReturnVehLedger.getLocationSid()); |
|
|
|
baseMapper.insert(loanReturnVehLedgerTrailer); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return rb.success(); |
|
|
@ -159,9 +163,13 @@ public class LoanReturnVehLedgerService extends MybatisBaseService<LoanReturnVeh |
|
|
|
apply(StringUtils.isNotBlank(query.getInboundDateEnd()), "date_format (lv.inboundDate,'%Y-%m-%d') <= date_format('" + query.getInboundDateEnd() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
//出库日期开始
|
|
|
|
qw.apply(StringUtils.isNotBlank(query.getInboundDateStart()), "date_format (lv.outboundDate,'%Y-%m-%d') >= date_format('" + query.getInboundDateStart() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(query.getInboundDateEnd()), "date_format (lv.outboundDate,'%Y-%m-%d') <= date_format('" + query.getInboundDateEnd() + "','%Y-%m-%d')" |
|
|
|
qw.apply(StringUtils.isNotBlank(query.getOutboundDateStart()), "date_format (lv.outboundDate,'%Y-%m-%d') >= date_format('" + query.getOutboundDateStart() + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotBlank(query.getOutboundDateEnd()), "date_format (lv.outboundDate,'%Y-%m-%d') <= date_format('" + query.getOutboundDateEnd() + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
//库存状态
|
|
|
|
if (StringUtils.isNotBlank(query.getVehicleStateKey())) { |
|
|
|
qw.eq("lv.stockStateKey", query.getVehicleStateKey()); |
|
|
|
} |
|
|
|
//========================================数据授权开始
|
|
|
|
if (StringUtils.isNotBlank(query.getMenuUrl())) { |
|
|
|
//=======================
|
|
|
@ -210,11 +218,14 @@ public class LoanReturnVehLedgerService extends MybatisBaseService<LoanReturnVeh |
|
|
|
paggingRecords.removeAll(Collections.singleton(null)); |
|
|
|
if (!paggingRecords.isEmpty()) { |
|
|
|
for (LoanReturnVehLedgerVo record : pagging.getRecords()) { |
|
|
|
AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr(record.getBusVinSid()); |
|
|
|
if (alrepaidAndArrVo != null) { |
|
|
|
record.setOverMoney(alrepaidAndArrVo.getCurrentBeMoney()); |
|
|
|
record.setNotBecomeDueMoney(alrepaidAndArrVo.getUnexpiredMoney()); |
|
|
|
if ("主车".equals(record.getVehType())) { |
|
|
|
AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr(record.getBusVinSid()); |
|
|
|
if (alrepaidAndArrVo != null) { |
|
|
|
record.setOverMoney(alrepaidAndArrVo.getCurrentBeMoney()); |
|
|
|
record.setNotBecomeDueMoney(alrepaidAndArrVo.getUnexpiredMoney()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
PagerVo<LoanReturnVehLedgerVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
@ -237,7 +248,16 @@ public class LoanReturnVehLedgerService extends MybatisBaseService<LoanReturnVeh |
|
|
|
ResultBean<LoanReturnLedgerVo> rb = ResultBean.fireFail(); |
|
|
|
LoanReturnVehLedger loanReturnVehLedger = fetchBySid(sid); |
|
|
|
LoanReturnLedgerVo loanReturnLedgerVo = new LoanReturnLedgerVo(); |
|
|
|
BeanUtil.copyProperties(loanReturnVehLedger,loanReturnLedgerVo); |
|
|
|
BeanUtil.copyProperties(loanReturnVehLedger, loanReturnLedgerVo); |
|
|
|
if ("主车".equals(loanReturnVehLedger.getVehType())) { |
|
|
|
AlrepaidAndArrVo alrepaidAndArrVo = loanRestoreReportApplyService.getAlrepaidAndArr(loanReturnVehLedger.getBusVinSid()); |
|
|
|
if (alrepaidAndArrVo != null) { |
|
|
|
loanReturnLedgerVo.setOverMoney(alrepaidAndArrVo.getCurrentBeMoney()); |
|
|
|
loanReturnLedgerVo.setNotBecomeDueMoney(alrepaidAndArrVo.getUnexpiredMoney()); |
|
|
|
} |
|
|
|
} |
|
|
|
loanReturnLedgerVo.setVehicleState(loanReturnVehLedger.getStockState()); |
|
|
|
loanReturnLedgerVo.setVehicleStateKey(loanReturnVehLedger.getStockStateKey()); |
|
|
|
return rb.success().setData(loanReturnLedgerVo); |
|
|
|
} |
|
|
|
} |
|
|
|