|
|
@ -46,6 +46,7 @@ import com.yxt.anrui.fin.api.finbillapplication.flowable.FinBillTaskQuery; |
|
|
|
import com.yxt.anrui.fin.api.finbillapplicationpublic.FinBillApplicationPublic; |
|
|
|
import com.yxt.anrui.fin.api.finbillapplicationpublic.FinBillApplicationPublicDto; |
|
|
|
import com.yxt.anrui.fin.api.finbillfile.FinBillFile; |
|
|
|
import com.yxt.anrui.fin.api.finbillfile.FinBillFileAppendxVo; |
|
|
|
import com.yxt.anrui.fin.api.finbillfile.FinBillFileVo; |
|
|
|
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicle; |
|
|
|
import com.yxt.anrui.fin.api.finbillvehicle.FinBillVehicleDto; |
|
|
@ -77,10 +78,13 @@ import com.yxt.common.core.vo.PagerVo; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFeign; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowVo; |
|
|
|
import com.yxt.messagecenter.api.message.MessageFlowableQuery; |
|
|
|
import org.apache.commons.beanutils.BeanUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.bouncycastle.voms.VOMSAttribute; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import javax.xml.crypto.Data; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
@ -493,6 +497,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 检查用户是否设置部门 |
|
|
|
* |
|
|
@ -907,12 +912,12 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo,messageFlowVo); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("开票申请"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName()+"提交的"+messageFlowableQuery.getModuleName()+",请审批"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("业务中心"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return voResultBean; |
|
|
@ -952,6 +957,171 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
return r; |
|
|
|
} |
|
|
|
|
|
|
|
public IPage<AppBillApplicationPageVo> getInvoicedApplyList(PagerQuery<AppBillApplicationPageQuery> pagerQuery) { |
|
|
|
IPage<AppBillApplicationPageQuery> page = PagerUtil.queryToPage(pagerQuery); |
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(pagerQuery.getParams().getUserSid()).getData(); |
|
|
|
pagerQuery.getParams().setUseOrgSid(useOrgSid); |
|
|
|
QueryWrapper<AppBillApplicationPageVo> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getParams().getUseOrgSid())) { |
|
|
|
qw.eq("fba.useOrgSid", pagerQuery.getParams().getUseOrgSid()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(pagerQuery.getParams().getName())) { |
|
|
|
qw.like("fba.customerName", pagerQuery.getParams().getName()); |
|
|
|
} |
|
|
|
IPage<AppBillApplicationPageVo> iPage = baseMapper.getInvoicedApplyList(page, qw); |
|
|
|
List<AppBillApplicationPageVo> records = iPage.getRecords(); |
|
|
|
for (AppBillApplicationPageVo record : records) { |
|
|
|
String contractSid = record.getContractSid(); |
|
|
|
SysUserVo data = sysUserFeign.fetchBySid(contractSid).getData(); |
|
|
|
record.setApplyName(data.getName()); |
|
|
|
} |
|
|
|
return iPage; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<AppBillApplicationIInfoVo> getInvoicedApply(String sid) { |
|
|
|
ResultBean<AppBillApplicationIInfoVo> rb = ResultBean.fireFail(); |
|
|
|
AppBillApplicationIInfoVo vo = baseMapper.getInvoicedApply(sid); |
|
|
|
List<AppVinListVo> vinList = vo.getVinList(); |
|
|
|
List<FinBillVehicleVo> finBillVehicleVos = finBillVehicleService.fetchVehBySid(sid); |
|
|
|
for (FinBillVehicleVo finBillVehicleVo : finBillVehicleVos) { |
|
|
|
AppVinListVo appVinListVo = new AppVinListVo(); |
|
|
|
BeanUtil.copyProperties(finBillVehicleVo, appVinListVo, "sid"); |
|
|
|
vinList.add(appVinListVo); |
|
|
|
} |
|
|
|
List<String> customerInvoiceApplyImages = new ArrayList<>(); |
|
|
|
List<String> registerContractImages = new ArrayList<>(); |
|
|
|
List<String> invoiceApplyConfirmImages = new ArrayList<>(); |
|
|
|
List<FinBillFileAppendxVo> finBillFileAppendxVos1 = finBillFileService.fetchFileBySid(sid, CommonAttachTypeEnum.INVOICE_KHKPSQS.getAttachType()); |
|
|
|
for (FinBillFileAppendxVo finBillFileAppendxVo : finBillFileAppendxVos1) { |
|
|
|
customerInvoiceApplyImages.add(fileUploadComponent.getUrlPrefix() + finBillFileAppendxVo.getFilePath()); |
|
|
|
} |
|
|
|
List<FinBillFileAppendxVo> finBillFileAppendxVos2 = finBillFileService.fetchFileBySid(sid, CommonAttachTypeEnum.INVOICE_CLDJHT.getAttachType()); |
|
|
|
for (FinBillFileAppendxVo finBillFileAppendxVo : finBillFileAppendxVos2) { |
|
|
|
registerContractImages.add(fileUploadComponent.getUrlPrefix() + finBillFileAppendxVo.getFilePath()); |
|
|
|
} |
|
|
|
List<FinBillFileAppendxVo> finBillFileAppendxVos3 = finBillFileService.fetchFileBySid(sid, CommonAttachTypeEnum.INVOICE_KPXXQRS.getAttachType()); |
|
|
|
for (FinBillFileAppendxVo finBillFileAppendxVo : finBillFileAppendxVos3) { |
|
|
|
invoiceApplyConfirmImages.add(fileUploadComponent.getUrlPrefix() + finBillFileAppendxVo.getFilePath()); |
|
|
|
} |
|
|
|
vo.setCustomerInvoiceApplyImages(customerInvoiceApplyImages); |
|
|
|
vo.setRegisterContractImages(registerContractImages); |
|
|
|
vo.setInvoiceApplyConfirmImages(invoiceApplyConfirmImages); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean saveInvoicedApplyInfo(AppBillApplicationIInfoDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String s1 = "";//客户开票申请书
|
|
|
|
String s2 = "";//车辆登记合同
|
|
|
|
String s3 = "";//开票信息确认书
|
|
|
|
String userSid = dto.getCreateBySid();//用户sid
|
|
|
|
String useOrgSid = sysStaffOrgFeign.getPathSidByUserSid(userSid).getData();//分公司sid
|
|
|
|
if (StringUtils.isBlank(dto.getSid())) { |
|
|
|
FinBillApplication finBillApplication = new FinBillApplication(); |
|
|
|
BeanUtil.copyProperties(dto, finBillApplication, "sid"); |
|
|
|
finBillApplication.setUseOrgSid(useOrgSid); |
|
|
|
String sid = finBillApplication.getSid(); |
|
|
|
|
|
|
|
List<AppVinListDto> vinList = dto.getVinList(); |
|
|
|
for (AppVinListDto appVinListDto : vinList) { |
|
|
|
FinBillVehicle finBillVehicle = new FinBillVehicle(); |
|
|
|
BeanUtil.copyProperties(appVinListDto, finBillVehicle, "sid"); |
|
|
|
finBillVehicle.setBillAppSid(sid); |
|
|
|
finBillVehicleService.save(finBillVehicle); |
|
|
|
} |
|
|
|
|
|
|
|
List<String> INVOICE_KHKPSQS = dto.getCustomerInvoiceApplyImages(); |
|
|
|
if (INVOICE_KHKPSQS.size() > 0) { |
|
|
|
for (String invoice_khkpsqs : INVOICE_KHKPSQS) { |
|
|
|
if (invoice_khkpsqs.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s1 = invoice_khkpsqs.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
FinBillFile finBillFile = new FinBillFile(); |
|
|
|
finBillFile.setBillAppSid(sid); |
|
|
|
finBillFile.setFileType(CommonAttachTypeEnum.INVOICE_KHKPSQS.getAttachType()); |
|
|
|
finBillFile.setFileUrl(s1); |
|
|
|
finBillFileService.save(finBillFile); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> INVOICE_CLDJHT = dto.getRegisterContractImages(); |
|
|
|
if (INVOICE_CLDJHT.size() > 0) { |
|
|
|
for (String invoice_cldjht : INVOICE_CLDJHT) { |
|
|
|
if (invoice_cldjht.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s2 = invoice_cldjht.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
FinBillFile finBillFile = new FinBillFile(); |
|
|
|
finBillFile.setBillAppSid(sid); |
|
|
|
finBillFile.setFileType(CommonAttachTypeEnum.INVOICE_CLDJHT.getAttachType()); |
|
|
|
finBillFile.setFileUrl(s2); |
|
|
|
finBillFileService.save(finBillFile); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> INVOICE_KPXXQRS = dto.getInvoiceApplyConfirmImages(); |
|
|
|
if (INVOICE_KPXXQRS.size() > 0) { |
|
|
|
for (String invoice_kpxxqrs : INVOICE_KPXXQRS) { |
|
|
|
if (invoice_kpxxqrs.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s3 = invoice_kpxxqrs.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
FinBillFile finBillFile = new FinBillFile(); |
|
|
|
finBillFile.setBillAppSid(sid); |
|
|
|
finBillFile.setFileType(CommonAttachTypeEnum.INVOICE_KPXXQRS.getAttachType()); |
|
|
|
finBillFile.setFileUrl(s3); |
|
|
|
finBillFileService.save(finBillFile); |
|
|
|
} |
|
|
|
} |
|
|
|
save(finBillApplication); |
|
|
|
return rb.success().setData(finBillApplication.getSid()); |
|
|
|
} else { |
|
|
|
FinBillApplication finBillApplication = fetchBySid(dto.getSid()); |
|
|
|
BeanUtil.copyProperties(dto, finBillApplication, "sid"); |
|
|
|
String sid = finBillApplication.getSid(); |
|
|
|
finBillFileService.deleteByFinAppSid(sid); |
|
|
|
List<String> INVOICE_KHKPSQS = dto.getCustomerInvoiceApplyImages(); |
|
|
|
if (INVOICE_KHKPSQS.size() > 0) { |
|
|
|
for (String invoice_khkpsqs : INVOICE_KHKPSQS) { |
|
|
|
if (invoice_khkpsqs.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s1 = invoice_khkpsqs.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
FinBillFile finBillFile = new FinBillFile(); |
|
|
|
finBillFile.setBillAppSid(sid); |
|
|
|
finBillFile.setFileType(CommonAttachTypeEnum.INVOICE_KHKPSQS.getAttachType()); |
|
|
|
finBillFile.setFileUrl(s1); |
|
|
|
finBillFileService.save(finBillFile); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> INVOICE_CLDJHT = dto.getRegisterContractImages(); |
|
|
|
if (INVOICE_CLDJHT.size() > 0) { |
|
|
|
for (String invoice_cldjht : INVOICE_CLDJHT) { |
|
|
|
if (invoice_cldjht.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s2 = invoice_cldjht.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
FinBillFile finBillFile = new FinBillFile(); |
|
|
|
finBillFile.setBillAppSid(sid); |
|
|
|
finBillFile.setFileType(CommonAttachTypeEnum.INVOICE_CLDJHT.getAttachType()); |
|
|
|
finBillFile.setFileUrl(s2); |
|
|
|
finBillFileService.save(finBillFile); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> INVOICE_KPXXQRS = dto.getInvoiceApplyConfirmImages(); |
|
|
|
if (INVOICE_KPXXQRS.size() > 0) { |
|
|
|
for (String invoice_kpxxqrs : INVOICE_KPXXQRS) { |
|
|
|
if (invoice_kpxxqrs.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
s3 = invoice_kpxxqrs.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
FinBillFile finBillFile = new FinBillFile(); |
|
|
|
finBillFile.setBillAppSid(sid); |
|
|
|
finBillFile.setFileType(CommonAttachTypeEnum.INVOICE_KPXXQRS.getAttachType()); |
|
|
|
finBillFile.setFileUrl(s3); |
|
|
|
finBillFileService.save(finBillFile); |
|
|
|
} |
|
|
|
} |
|
|
|
updateById(finBillApplication); |
|
|
|
return rb.success().setData(finBillApplication.getSid()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* public ResultBean submitFinBillApplicationPageList(SubmitFinBillApplicationPageListDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinBillApplicationDetailsVo finBillApplicationDetailsVo = fetchDetailsVoBySid(dto.getSid()); |
|
|
|