|
|
@ -29,8 +29,11 @@ import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.base.api.baseinternalpurchase.BaseInternalPurchase; |
|
|
|
import com.yxt.anrui.base.api.baseinternalpurchase.flow.GetNodeVo; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.BaseTrailerFeign; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.TrailerVo; |
|
|
|
import com.yxt.anrui.base.api.basetrailer.TraliveredVo; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicle; |
|
|
|
import com.yxt.anrui.base.api.basevehicle.BaseVehicleFeign; |
|
|
|
import com.yxt.anrui.base.api.commonappendix.*; |
|
|
@ -42,6 +45,7 @@ import com.yxt.anrui.base.common.utils.domain.BillNo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrder; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderFeign; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderDetailsVo; |
|
|
|
import com.yxt.anrui.buscenter.api.bussalesorderprice.BusSalesOrderPrice; |
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.*; |
|
|
|
import com.yxt.anrui.fin.api.finbillapplication.flowable.FinBillNodeQuery; |
|
|
@ -73,6 +77,7 @@ import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrg; |
|
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserVo; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.UserRoleQuery; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
@ -167,7 +172,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
qw.eq("fba.billStateKey", query.getBillStateKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCreateByName())) { |
|
|
|
qw.eq("fba.createByName", query.getCreateByName()); |
|
|
|
qw.like("fba.createByName", query.getCreateByName()); |
|
|
|
} |
|
|
|
String applyStartDate = query.getApplyStartDate(); |
|
|
|
String applyEndDate = query.getApplyEndDate(); |
|
|
@ -268,7 +273,6 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
if (finBillApplication == null) { |
|
|
|
rb.setMsg("该数据不存在"); |
|
|
|
} |
|
|
|
dto.setArrearsMoney("0"); |
|
|
|
updateByDto(dto); |
|
|
|
finBillFileService.deleteByFinAppSid(dtoSid); |
|
|
|
//附件信息
|
|
|
@ -371,8 +375,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} else { |
|
|
|
for (FinBillVehicleVo finBillVehicleVo : finBillVehicleVos) { |
|
|
|
BaseVehicle baseVehicle = baseVehicleFeign.selectByVinNoAndOrgSid(finBillVehicleVo.getVinNo(), entity.getUseOrgSid()).getData(); |
|
|
|
List<TrailerVo> trailerVos = baseTrailerFeign.trailerList(baseVehicle.getSid()).getData(); |
|
|
|
for (TrailerVo trailerVo : trailerVos) { |
|
|
|
TraliveredVo data = baseTrailerFeign.trailerList(baseVehicle.getSid()).getData(); |
|
|
|
List<TrailerVo> trailerVoList = data.getList(); |
|
|
|
for (TrailerVo trailerVo : trailerVoList) { |
|
|
|
FinBillTrailerVo finBillTrailerVo = new FinBillTrailerVo(); |
|
|
|
finBillTrailerVo.setBillAppSid(sid); |
|
|
|
finBillTrailerVo.setVinNo(finBillVehicleVo.getVinNo()); |
|
|
@ -407,9 +412,17 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
fileUrl = urlPrefix + fileUrl; |
|
|
|
cldjhtApplicationAppendx.setFileUrl(fileUrl); |
|
|
|
} |
|
|
|
List<FinBillFileVo> zjApplicationAppendxs = finBillFileService.fetchzjBySid(sid); |
|
|
|
for (FinBillFileVo zjApplicationAppendx : zjApplicationAppendxs) { |
|
|
|
String fileUrl = zjApplicationAppendx.getFileUrl(); |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
fileUrl = urlPrefix + fileUrl; |
|
|
|
zjApplicationAppendx.setFileUrl(fileUrl); |
|
|
|
} |
|
|
|
vo.setKhkpsqsApplicationAppendxs(khkpsqsApplicationAppendxs); |
|
|
|
vo.setKpxxqrsApplicationAppendxs(kpxxqrsApplicationAppendxs); |
|
|
|
vo.setCldjhtApplicationAppendxs(cldjhtApplicationAppendxs); |
|
|
|
vo.setZjApplicationAppendxs(zjApplicationAppendxs); |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
@ -698,6 +711,11 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finVehicleInvoiceDto.setUseOrgSid(finBillApplication.getUseOrgSid()); |
|
|
|
finVehicleInvoiceService.mySave(finVehicleInvoiceDto); |
|
|
|
} |
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderFeign.selectOrderByContractNo(finBillApplication.getContractNo()).getData(); |
|
|
|
BigDecimal oneBillMoney = busSalesOrder.getOneBillMoney(); |
|
|
|
if (oneBillMoney == null){ |
|
|
|
busSalesOrderFeign.updateOneBillMoneyByOrderSid(busSalesOrder.getSid(),finBillApplication.getOneBillMoney().toString()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
@ -883,6 +901,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(map); |
|
|
|
finBillVehicleService.updateByMainSid(finBillApplication.getSid()); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |
|
|
@ -891,6 +910,16 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
|
|
|
|
public ResultBean submitFinBillApplication(SubmitFinBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String contractNo = dto.getContractNo(); |
|
|
|
List<FinBillApplicationDetailsVo> finBillApplicationDetailsVos = baseMapper.selectByContractNo(contractNo); |
|
|
|
if (finBillApplicationDetailsVos != null){ |
|
|
|
for (FinBillApplicationDetailsVo finBillApplicationDetailsVo : finBillApplicationDetailsVos) { |
|
|
|
String nodeState = finBillApplicationDetailsVo.getNodeState(); |
|
|
|
if (!"待提交".equals(nodeState) && !"已办结".equals(nodeState) &&!"终止".equals(nodeState)){ |
|
|
|
return rb.setMsg("该合同已有开票/欠款开票申请正在审批中,不可提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgSidPath())) { |
|
|
@ -1396,6 +1425,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
List<FinBillFileDto> khkpsqsApplicationAppendxs = dto.getKhkpsqsApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> kpxxqrsApplicationAppendxs = dto.getKpxxqrsApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> cldjhtApplicationAppendxs = dto.getCldjhtApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> zjApplicationAppendxs = dto.getZjApplicationAppendxs(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) {//新增
|
|
|
|
FinBillApplication finBillApplication = new FinBillApplication(); |
|
|
|
BeanUtil.copyProperties(dto, finBillApplication, "sid"); |
|
|
@ -1421,35 +1451,53 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillTrailerService.save(finBillTrailer); |
|
|
|
} |
|
|
|
//附件信息
|
|
|
|
for (FinBillFileDto finBillFileDto : khkpsqsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
if (khkpsqsApplicationAppendxs.size() > 0){ |
|
|
|
for (FinBillFileDto finBillFileDto : khkpsqsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.KHKPSQS.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.KHKPSQS.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
for (FinBillFileDto finBillFileDto : kpxxqrsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
if (kpxxqrsApplicationAppendxs.size() > 0){ |
|
|
|
for (FinBillFileDto finBillFileDto : kpxxqrsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.KPXXQRS.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.KPXXQRS.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
for (FinBillFileDto finBillFileDto : cldjhtApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
if (cldjhtApplicationAppendxs.size() > 0){ |
|
|
|
for (FinBillFileDto finBillFileDto : cldjhtApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.CLDJHT.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (zjApplicationAppendxs.size() > 0){ |
|
|
|
for (FinBillFileDto finBillFileDto : zjApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.ZJ.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.CLDJHT.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
return rb.success().setMsg("保存成功").setData(finBillApplication.getSid()); |
|
|
|
} |
|
|
@ -1457,11 +1505,10 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
if (finBillApplication == null) { |
|
|
|
rb.setMsg("该数据不存在"); |
|
|
|
} |
|
|
|
dto.setArrearsMoney("0"); |
|
|
|
updateByDto(dto); |
|
|
|
finBillFileService.deleteByFinAppSid(dtoSid); |
|
|
|
//附件信息
|
|
|
|
if (khkpsqsApplicationAppendxs != null) { |
|
|
|
if (khkpsqsApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : khkpsqsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
@ -1473,7 +1520,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (kpxxqrsApplicationAppendxs != null) { |
|
|
|
if (kpxxqrsApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : kpxxqrsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
@ -1485,7 +1532,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (cldjhtApplicationAppendxs != null) { |
|
|
|
if (cldjhtApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : cldjhtApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
@ -1497,6 +1544,18 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (zjApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : zjApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.ZJ.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
finBillVehicleService.delByBillAppSid(dtoSid); |
|
|
|
for (FinBillVehicleDto finBillVehicleDto : finBillVehicles) { |
|
|
|
FinBillVehicle finBillVehicle = new FinBillVehicle(); |
|
|
@ -1516,6 +1575,16 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
|
|
|
|
public ResultBean submitFinBillApplicationQK(SubmitFinBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String contractNo = dto.getContractNo(); |
|
|
|
List<FinBillApplicationDetailsVo> finBillApplicationDetailsVos = baseMapper.selectByContractNo(contractNo); |
|
|
|
if (finBillApplicationDetailsVos != null){ |
|
|
|
for (FinBillApplicationDetailsVo finBillApplicationDetailsVo : finBillApplicationDetailsVos) { |
|
|
|
String nodeState = finBillApplicationDetailsVo.getNodeState(); |
|
|
|
if (!"待提交".equals(nodeState) && !"已办结".equals(nodeState) &&!"终止".equals(nodeState)){ |
|
|
|
return rb.setMsg("该合同已有开票/欠款开票申请正在审批中,不可提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgSidPath())) { |
|
|
@ -1618,6 +1687,11 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
BusSalesOrder busSalesOrder = busSalesOrderFeign.selectOrderByContractNo(finBillApplication.getContractNo()).getData(); |
|
|
|
BigDecimal oneBillMoney = busSalesOrder.getOneBillMoney(); |
|
|
|
if (oneBillMoney == null){ |
|
|
|
busSalesOrderFeign.updateOneBillMoneyByOrderSid(busSalesOrder.getSid(),finBillApplication.getOneBillMoney().toString()); |
|
|
|
} |
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
@ -1783,6 +1857,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(map); |
|
|
|
finBillVehicleService.updateByMainSid(finBillApplication.getSid()); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |
|
|
@ -1814,7 +1889,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
qw.eq("fba.billStateKey", query.getBillStateKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCreateByName())) { |
|
|
|
qw.eq("fba.createByName", query.getCreateByName()); |
|
|
|
qw.like("fba.createByName", query.getCreateByName()); |
|
|
|
} |
|
|
|
String returnedMoneyStartDate = query.getReturnedMoneyStartDate(); |
|
|
|
String returnedMoneyEndDate = query.getReturnedMoneyEndDate(); |
|
|
@ -1826,4 +1901,61 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
PagerVo<FinBillApplicationVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean companyToDivisionOperateQK(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(bv.getBusinessSid()); |
|
|
|
bv.setOrgSidPath(finBillApplication.getOrgSidPath()); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
bv.getFormVariables().put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<GetNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), GetNodeVo.class)).collect(Collectors.toList()); |
|
|
|
List<String> candidateGroups = voList.get(0).getCandidateGroups(); |
|
|
|
UserRoleQuery userRoleQuery = new UserRoleQuery(); |
|
|
|
userRoleQuery.setRoleSid(candidateGroups.get(0)); |
|
|
|
List<SysUserVo> sysUserVos = sysUserFeign.getOtherOrgRoleUser(userRoleQuery).getData(); |
|
|
|
StringBuilder nextNodeUserSids = new StringBuilder(); |
|
|
|
if (sysUserVos.size() > 0) { |
|
|
|
for (SysUserVo sysUserVo : sysUserVos) { |
|
|
|
String sid = sysUserVo.getSid(); |
|
|
|
nextNodeUserSids.append(sid).append(","); |
|
|
|
} |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(nextNodeUserSids)) { |
|
|
|
return rb.setMsg("下一环节暂无操作人员"); |
|
|
|
} |
|
|
|
String substring = nextNodeUserSids.substring(0, nextNodeUserSids.lastIndexOf(",")); |
|
|
|
bv.setNextNodeUserSids(substring); |
|
|
|
if (bv.getTaskId().equals(finBillApplication.getTaskId())) { |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", bv.getBusinessSid()); |
|
|
|
variables.put("app", appMap); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean1 = flowableFeign.handleProsess(bv); |
|
|
|
if (!resultBean1.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean1.getMsg()); |
|
|
|
} |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean1.getData())); |
|
|
|
//极光推送
|
|
|
|
UpdateFlowFieldVo ufVo = resultBean1.getData(); |
|
|
|
finBillApplication = fetchBySid(bv.getBusinessSid()); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
messageFlowVo.setProcInsId(finBillApplication.getProcInstSid()); |
|
|
|
messageFlowVo.setProcDefId(finBillApplication.getProcDefId()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(bv.getBusinessSid()); |
|
|
|
messageFlowableQuery.setModuleName("欠款开票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款开票"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success().setData(resultBean1.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |