|
|
@ -26,6 +26,7 @@ |
|
|
|
package com.yxt.anrui.buscenter.biz.buscollectionconfirmation; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.alibaba.nacos.api.config.filter.IFilterConfig; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicleQuery; |
|
|
@ -39,6 +40,8 @@ import com.yxt.anrui.buscenter.api.busselectedreceivablesdetailed.BusSelectedRec |
|
|
|
import com.yxt.anrui.buscenter.api.busselectedreceivablesdetailed.BusSelectedReceivablesDetailedDto; |
|
|
|
import com.yxt.anrui.buscenter.api.busselectedreceivablesdetailed.BusSelectedReceivablesDetailedVo; |
|
|
|
import com.yxt.anrui.buscenter.biz.busselectedreceivablesdetailed.BusSelectedReceivablesDetailedService; |
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
@ -49,6 +52,7 @@ import com.yxt.common.core.vo.PagerVo; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
@ -74,6 +78,10 @@ public class BusCollectionConfirmationService extends MybatisBaseService<BusColl |
|
|
|
private CommonAppendixFeign commonAppendixFeign; |
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
@Autowired |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
@Autowired |
|
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
|
|
|
|
|
private QueryWrapper<BusCollectionConfirmation> createQueryWrapper(BusCollectionConfirmationQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
@ -189,12 +197,25 @@ public class BusCollectionConfirmationService extends MybatisBaseService<BusColl |
|
|
|
* 手机端—获取款项确认列表 |
|
|
|
* |
|
|
|
* @param pagerQuery |
|
|
|
* @return |
|
|
|
* @ |
|
|
|
*/ |
|
|
|
public IPage<AppBusCollectionConfirmationPageVo> getCollectionConfirmList(PagerQuery<AppBusCollectionConfirmationQuery> pagerQuery) { |
|
|
|
IPage<AppBusCollectionConfirmationQuery> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
QueryWrapper<AppBusCollectionConfirmationPageVo> qw = appBuildQueryWrapper(pagerQuery.getParams()); |
|
|
|
return baseMapper.getCollectionConfirmList(page,qw); |
|
|
|
IPage<AppBusCollectionConfirmationPageVo> collectionConfirmList = baseMapper.getCollectionConfirmList(page, qw); |
|
|
|
for (AppBusCollectionConfirmationPageVo record : collectionConfirmList.getRecords()) { |
|
|
|
Integer balance = record.getBalance(); |
|
|
|
String collectionBillState = record.getCollectionBillState(); |
|
|
|
if (balance <= 0 || collectionBillState.equals("1") || collectionBillState.equals("3")) { |
|
|
|
record.setShowHandle(false); |
|
|
|
} |
|
|
|
record.setShowDownload(false); |
|
|
|
List<BusSelectedReceivablesDetailedVo> busSelectedReceivablesDetailedVos = busSelectedReceivablesDetailedService.fetchByCillSid(record.getCollectionBillSid()); |
|
|
|
if (busSelectedReceivablesDetailedVos.size() > 0 || collectionBillState != "1") { |
|
|
|
record.setShowDelete(false); |
|
|
|
} |
|
|
|
} |
|
|
|
return collectionConfirmList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -212,4 +233,111 @@ public class BusCollectionConfirmationService extends MybatisBaseService<BusColl |
|
|
|
} |
|
|
|
return qw; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 手机端—新增款项确认申请单 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean addCollectionConfirm(AppBusCollectionConfirmationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String staffSid = sysUserFeign.getUserOrgInfoByUserSid(dto.getUserSid()).getData().getStaffSid(); |
|
|
|
BusCollectionConfirmation busCollectionConfirmation = new BusCollectionConfirmation(); |
|
|
|
CommonAppendixDto commonAppendixDto = new CommonAppendixDto(); |
|
|
|
String sid = busCollectionConfirmation.getSid(); |
|
|
|
busCollectionConfirmation.setSid(sid); |
|
|
|
busCollectionConfirmation.setCollectionDate(dto.getCollectionDate()); |
|
|
|
busCollectionConfirmation.setCollectionBank(dto.getCollectionBank()); |
|
|
|
busCollectionConfirmation.setCollectionBankNum(dto.getCollectionNum()); |
|
|
|
busCollectionConfirmation.setCollectionMoney(dto.getPaymentMoney()); |
|
|
|
busCollectionConfirmation.setCollectionTypeKey(dto.getCollectionTypeKey()); |
|
|
|
busCollectionConfirmation.setCollectionTypeValue(dto.getCollectionType()); |
|
|
|
busCollectionConfirmation.setPayerName(dto.getPaymentName()); |
|
|
|
busCollectionConfirmation.setCollectionMoney(dto.getPaymentMoney()); |
|
|
|
busCollectionConfirmation.setRemarks(dto.getRemarks()); |
|
|
|
insert(busCollectionConfirmation); |
|
|
|
List<String> payFiles = dto.getPayFiles(); |
|
|
|
for (String payFile : payFiles) { |
|
|
|
String payFilePath = payFile.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
commonAppendixDto.setLinkSid(sid); |
|
|
|
commonAppendixDto.setFilePath(payFilePath); |
|
|
|
commonAppendixDto.setCreateBySid(staffSid); |
|
|
|
commonAppendixDto.setAttachType(CommonAttachTypeEnum.PAYMENT_VOUCHER.getAttachType()); |
|
|
|
commonAppendixFeign.save(commonAppendixDto); |
|
|
|
} |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 手机端—初始化收款确认申请 |
|
|
|
* |
|
|
|
* @param collectionBillSid |
|
|
|
* @param userSid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean<AppBusCollectionConfirmationInitVo> initCollectionConfirm(String collectionBillSid, String userSid) { |
|
|
|
ResultBean<AppBusCollectionConfirmationInitVo> rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isNotBlank(userSid)) { |
|
|
|
return rb.fail().setMsg("用户sid不能为空"); |
|
|
|
} |
|
|
|
String useOrgSid = sysOrganizationFeign.getUseOrgByUserSid(userSid).getData().getSid(); |
|
|
|
AppBusCollectionConfirmationInitVo vo = baseMapper.initCollectionConfirm(collectionBillSid, useOrgSid); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 手机端—提交款项确认申请 |
|
|
|
* |
|
|
|
* @param dto |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean submitCollectionConfirm(AppBusCollectionConfirmationDto dto) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 手机端—删除收款确认单 |
|
|
|
* |
|
|
|
* @param collectionBillSid |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public ResultBean deleteCollectionConfirm(String collectionBillSid) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
deleteBySid(collectionBillSid); |
|
|
|
busSelectedReceivablesDetailedService.deleteByCollSid(collectionBillSid); |
|
|
|
return rb.success().setMsg("删除成功"); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 手机端—查询可使用款项明细列表 |
|
|
|
* |
|
|
|
* @param pagerQuery |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public IPage<AppBusSelectedReceivablesPaymentDetailsVo> getPaymentDetailsList(PagerQuery<AppBusSelectedReceivablesPaymentDetailsQuery> pagerQuery) { |
|
|
|
IPage<AppBusSelectedReceivablesPaymentDetailsQuery> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
QueryWrapper<AppBusSelectedReceivablesPaymentDetailsVo> qw = appPaymentDetailsBuildQueryWrapper(pagerQuery.getParams()); |
|
|
|
IPage<AppBusSelectedReceivablesPaymentDetailsVo> collectionConfirmList = busSelectedReceivablesDetailedService.getPaymentDetailsList(page, qw); |
|
|
|
return collectionConfirmList; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 构造条件 |
|
|
|
* |
|
|
|
* @param pagerQuery 查询条件 |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
private QueryWrapper<AppBusSelectedReceivablesPaymentDetailsVo> appPaymentDetailsBuildQueryWrapper(AppBusSelectedReceivablesPaymentDetailsQuery pagerQuery) { |
|
|
|
QueryWrapper<AppBusSelectedReceivablesPaymentDetailsVo> qw = new QueryWrapper<>(); |
|
|
|
if (pagerQuery != null) { |
|
|
|
if (com.yxt.common.base.utils.StringUtils.isNotBlank(pagerQuery.getName())) {//车架号
|
|
|
|
qw.like("bv.vinNo", pagerQuery.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
return qw; |
|
|
|
} |
|
|
|
} |