|
|
@ -415,7 +415,8 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillTrailerVo.setHgzImageUrl(hgzImageUrls); |
|
|
|
} |
|
|
|
vo.setFinBillTrailers(finBillTrailerVos); |
|
|
|
} else { |
|
|
|
} |
|
|
|
/*else { |
|
|
|
for (FinBillVehicleVo finBillVehicleVo : finBillVehicleVos) { |
|
|
|
BaseVehicle baseVehicle = baseVehicleFeign.selectByVinNoAndOrgSid(finBillVehicleVo.getVinNo(), entity.getUseOrgSid()).getData(); |
|
|
|
TraliveredVo data = baseTrailerFeign.trailerList(baseVehicle.getSid(), entity.getContractNo()).getData(); |
|
|
@ -443,7 +444,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} |
|
|
|
} |
|
|
|
vo.setFinBillTrailers(finBillTrailerVos); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
List<FinBillFileVo> khkpsqsApplicationAppendxs = finBillFileService.fetchkhkpsqsBySid(sid); |
|
|
|
for (FinBillFileVo khkpsqsApplicationAppendx : khkpsqsApplicationAppendxs) { |
|
|
|
String fileUrl = khkpsqsApplicationAppendx.getFileUrl(); |
|
|
@ -792,7 +793,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
for (FinBillApplicationDetailsVo finBillApplicationDetailsVo : finBillApplicationDetailsVos) { |
|
|
|
String nodeState = finBillApplicationDetailsVo.getNodeState(); |
|
|
|
if (!"待提交".equals(nodeState) && !"已办结".equals(nodeState) && !"终止".equals(nodeState) && !"发起申请".equals(nodeState)) { |
|
|
|
return rb.setMsg("该合同已有开票/欠款开票申请正在审批中,不可提交"); |
|
|
|
return rb.setMsg("该合同已有开票/欠款开票/欠款领票申请正在审批中,不可提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1462,7 +1463,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
return rb.success().setMsg("修改成功").setData(dtoSid); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean saveQKLP(FinBillApplicationDto dto) { |
|
|
|
public ResultBean<String> saveQKLP(FinBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
List<FinBillTrailerDto> finBillTrailers = dto.getFinBillTrailers(); |
|
|
@ -1586,7 +1587,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
for (FinBillApplicationDetailsVo finBillApplicationDetailsVo : finBillApplicationDetailsVos) { |
|
|
|
String nodeState = finBillApplicationDetailsVo.getNodeState(); |
|
|
|
if (!"待提交".equals(nodeState) && !"已办结".equals(nodeState) && !"终止".equals(nodeState) && !"发起申请".equals(nodeState)) { |
|
|
|
return rb.setMsg("该合同已有开票/欠款开票申请正在审批中,不可提交"); |
|
|
|
return rb.setMsg("该合同已有开票/欠款开票/欠款领票申请正在审批中,不可提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1724,14 +1725,14 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
public ResultBean completeBy(BusinessVariables bv, FinBillCompleteDto query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String businessSid = bv.getBusinessSid(); |
|
|
|
List<String> idCardImages = query.getIdCardImages(); |
|
|
|
List<String> customerInvoiceApplyImages = query.getCustomerInvoiceApplyImages();//客户开票申请书
|
|
|
|
List<String> invoiceApplyConfirmImages = query.getInvoiceApplyConfirmImages();//开票信息确认书
|
|
|
|
List<String> registerContractImages = query.getRegisterContractImages();//车辆登记合同
|
|
|
|
if (idCardImages.size() == 0){ |
|
|
|
List<FinBillFileDto> khkpsqsApplicationAppendxs = query.getKhkpsqsApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> kpxxqrsApplicationAppendxs = query.getKpxxqrsApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> cldjhtApplicationAppendxs = query.getCldjhtApplicationAppendxs(); |
|
|
|
List<FinBillFileDto> zjApplicationAppendxs = query.getZjApplicationAppendxs(); |
|
|
|
if (zjApplicationAppendxs.size() == 0){ |
|
|
|
return rb.setMsg("证件不能为空"); |
|
|
|
} |
|
|
|
if (customerInvoiceApplyImages.size() == 0){ |
|
|
|
if (khkpsqsApplicationAppendxs.size() == 0){ |
|
|
|
return rb.setMsg("客户开票申请书不能为空"); |
|
|
|
} |
|
|
|
FinBillApplication finBillApplication = fetchBySid(businessSid); |
|
|
@ -1753,9 +1754,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
//更新图片
|
|
|
|
finBillFileService.deleteByFinAppSid(businessSid); |
|
|
|
//附件信息
|
|
|
|
if (customerInvoiceApplyImages.size() > 0) { |
|
|
|
for (String filePath : customerInvoiceApplyImages) { |
|
|
|
FinBillFileDto finBillFileDto = new FinBillFileDto(); |
|
|
|
if (khkpsqsApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : khkpsqsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
@ -1765,9 +1766,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (idCardImages.size() > 0) { |
|
|
|
for (String filePath : idCardImages) { |
|
|
|
FinBillFileDto finBillFileDto = new FinBillFileDto(); |
|
|
|
if (zjApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : zjApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
@ -1777,9 +1778,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (invoiceApplyConfirmImages.size() > 0) { |
|
|
|
for (String filePath : invoiceApplyConfirmImages) { |
|
|
|
FinBillFileDto finBillFileDto = new FinBillFileDto(); |
|
|
|
if (kpxxqrsApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : kpxxqrsApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
@ -1789,9 +1790,9 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
if (registerContractImages.size() > 0) { |
|
|
|
for (String filePath : registerContractImages) { |
|
|
|
FinBillFileDto finBillFileDto = new FinBillFileDto(); |
|
|
|
if (cldjhtApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : cldjhtApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
@ -2157,38 +2158,412 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean submitFinBillApplicationQKLP(SubmitFinBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
FinBillApplication finBillApplication2 = fetchBySid(dtoSid); |
|
|
|
if (!finBillApplication2.getNodeState().equals("已办结")){ |
|
|
|
return rb.setMsg("该申请仍在审核过程中,不可提交"); |
|
|
|
} |
|
|
|
if (finBillApplication2.getIsLQOrigInvoice().equals("是")){ |
|
|
|
return rb.setMsg("该申请已领取过发票原件,请重新选择"); |
|
|
|
} |
|
|
|
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) && !"发起申请".equals(nodeState)) { |
|
|
|
return rb.setMsg("该合同已有开票/欠款开票/欠款领票申请正在审批中,不可提交"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//用户的组织全路径
|
|
|
|
String orgSidPath = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgSidPath())) { |
|
|
|
orgSidPath = dto.getOrgSidPath(); |
|
|
|
} else { |
|
|
|
//根据用户sid获取staffSid
|
|
|
|
ResultBean<SysUserVo> userVoResultBean = sysUserFeign.fetchBySid(dto.getCreateBySid()); |
|
|
|
if (!userVoResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(userVoResultBean.getMsg()); |
|
|
|
} |
|
|
|
//根据staffSid获取用户的组织全路径
|
|
|
|
ResultBean<SysStaffOrg> staffOrgResultBean = sysStaffOrgFeign.getOrgByStaffSid(userVoResultBean.getData().getStaffSid()); |
|
|
|
if (!staffOrgResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(staffOrgResultBean.getMsg()); |
|
|
|
} |
|
|
|
orgSidPath = staffOrgResultBean.getData().getOrgSidPath(); |
|
|
|
} |
|
|
|
dto.setOrgSidPath(orgSidPath); |
|
|
|
finBillApplication2.setSid(null); |
|
|
|
int r = submitBusinessDataPc(dto, finBillApplication2); |
|
|
|
if (r == 3) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
if (r == 0) { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
dto.setIsLQOrigInvoice("是"); |
|
|
|
//新增修改保存
|
|
|
|
ResultBean<String> resultBean = saveQKLP(dto); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
String businessSid = resultBean.getData(); |
|
|
|
FinBillApplication finBillApplication1 = fetchBySid(businessSid); |
|
|
|
//创建BusinessVariables实体对象
|
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
variables.put("isAdj", finBillApplication1.getIsLQOrigInvoice().equals("是")); |
|
|
|
//用户的部门全路径sid
|
|
|
|
bv.setOrgSidPath(orgSidPath); |
|
|
|
//业务sid
|
|
|
|
bv.setBusinessSid(businessSid); |
|
|
|
//用户sid
|
|
|
|
bv.setUserSid(dto.getCreateBySid()); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//流程定义id
|
|
|
|
bv.setModelId(ProcDefEnum.QKLPFINBILLAPPLICATION.getProDefId()); |
|
|
|
if (r == 1) { |
|
|
|
ResultBean<UpdateFlowFieldVo> voResultBean = flowableFeign.startProcess(bv); |
|
|
|
if (!voResultBean.getSuccess()) { |
|
|
|
return rb.setMsg(voResultBean.getMsg()); |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = voResultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(ufVo)); |
|
|
|
//极光推送
|
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("欠款领票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication1.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款领票"); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return voResultBean; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
|
if (StringUtils.isBlank(dto.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
bv.setTaskId(finBillApplication1.getTaskId()); |
|
|
|
bv.setTaskDefKey(finBillApplication1.getNodeSid()); |
|
|
|
bv.setComment("重新提交"); |
|
|
|
bv.setInstanceId(dto.getInstanceId()); |
|
|
|
return complete(bv); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean completeQKLP(BusinessVariables bv) { |
|
|
|
return null; |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String businessSid = bv.getBusinessSid(); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(businessSid); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
bv.setOrgSidPath(finBillApplication.getOrgSidPath()); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
if (bv.getTaskId().equals(finBillApplication.getTaskId())) { |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
if ("Event_end".equals(resultBean.getData().getTaskDefKey())) { |
|
|
|
} else { |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
ufVo.setProcDefId(finBillApplication.getProcDefId()); |
|
|
|
ufVo.setProcInsId(finBillApplication.getProcInstSid()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("欠款领票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款领票"); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean completeByQKLP(BusinessVariables bv) { |
|
|
|
return null; |
|
|
|
public ResultBean completeByQKLP(BusinessVariables bv,FinBillCompleteDto query) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String businessSid = bv.getBusinessSid(); |
|
|
|
List<FinBillFileDto> fjApplicationAppendxs = query.getFjApplicationAppendxs(); |
|
|
|
if (fjApplicationAppendxs.size() == 0){ |
|
|
|
return rb.setMsg("附件不能为空"); |
|
|
|
} |
|
|
|
FinBillApplication finBillApplication = fetchBySid(businessSid); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
bv.setOrgSidPath(finBillApplication.getOrgSidPath()); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
if (bv.getTaskId().equals(finBillApplication.getTaskId())) { |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.handleProsess(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
//更新图片
|
|
|
|
finBillFileService.deleteByFinAppSid(businessSid); |
|
|
|
//附件信息
|
|
|
|
if (fjApplicationAppendxs.size() > 0) { |
|
|
|
for (FinBillFileDto finBillFileDto : fjApplicationAppendxs) { |
|
|
|
String filePath = finBillFileDto.getFileUrl(); |
|
|
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
} |
|
|
|
finBillFileDto.setFileUrl(filePath); |
|
|
|
finBillFileDto.setBillAppSid(businessSid); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.FJ.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
ufVo.setProcDefId(finBillApplication.getProcDefId()); |
|
|
|
ufVo.setProcInsId(finBillApplication.getProcInstSid()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("欠款领票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款领票"); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean companyToDivisionOperateQKLP(BusinessVariables bv) { |
|
|
|
return null; |
|
|
|
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("欠款领票"); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success().setData(resultBean1.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<FinBillNodeVo>> getPreviousNodesForRejectQKLP(FinBillNodeQuery query) { |
|
|
|
return null; |
|
|
|
ResultBean<List<FinBillNodeVo>> rb = ResultBean.fireFail(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//查询业务信息
|
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
bv.setModelId(ProcDefEnum.QKLPFINBILLAPPLICATION.getProDefId()); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getPreviousNodesForReject(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<FinBillNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinBillNodeVo.class)).collect(Collectors.toList()); |
|
|
|
return rb.success().setData(voList); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<List<FinBillNodeVo>> getNextNodesForSubmitQKLP(FinBillNodeQuery query) { |
|
|
|
return null; |
|
|
|
ResultBean<List<FinBillNodeVo>> rb = ResultBean.fireFail(); |
|
|
|
BusinessVariables bv = new BusinessVariables(); |
|
|
|
BeanUtil.copyProperties(query, bv); |
|
|
|
//流程中的参数赋值、若有网关,则赋值网关中判断的字段。
|
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
//查询业务信息
|
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
bv.setModelId(ProcDefEnum.QKLPFINBILLAPPLICATION.getProDefId()); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
ResultBean<List<Map<String, Object>>> resultBean = flowTaskFeign.getNextNodesForSubmit(bv); |
|
|
|
//判断数组是否为空,若为空则赋值,若不为空,则遍历循环将map中的数据赋值给getNodeVo
|
|
|
|
List<FinBillNodeVo> voList = Optional.ofNullable(resultBean.getData()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), FinBillNodeVo.class)).collect(Collectors.toList()); |
|
|
|
return rb.success().setData(voList); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean rejectQKLP(FinBillTaskQuery query) { |
|
|
|
return null; |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String businessSid = query.getBusinessSid(); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(businessSid); |
|
|
|
if (finBillApplication == null) { |
|
|
|
return rb.setMsg("该申请不存在"); |
|
|
|
} |
|
|
|
String businessTaskId = finBillApplication.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
if (StringUtils.isBlank(query.getComment())) { |
|
|
|
return rb.setMsg("请填写意见"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
Map<String, Object> appMap = new HashMap<>(); |
|
|
|
appMap.put("sid", businessSid); |
|
|
|
variables.put("app", appMap); |
|
|
|
//判断是否领取发票原件,若是,则isTrue网关参数为true=============添加
|
|
|
|
variables.put("isAdj", finBillApplication.getIsLQOrigInvoice().equals("是")); |
|
|
|
flowTaskVo.setValues(variables); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.taskReject(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
UpdateFlowFieldVo ufVo = resultBean.getData(); |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(ufVo); |
|
|
|
//更新业务中的流程相关的参数
|
|
|
|
updateFlowFiled(map); |
|
|
|
//极光推送
|
|
|
|
finBillApplication = fetchBySid(businessSid); |
|
|
|
MessageFlowableQuery messageFlowableQuery = new MessageFlowableQuery(); |
|
|
|
MessageFlowVo messageFlowVo = new MessageFlowVo(); |
|
|
|
BeanUtil.copyProperties(ufVo, messageFlowVo); |
|
|
|
String procId = finBillApplication.getProcInstSid(); |
|
|
|
ufVo.setProcInsId(procId); |
|
|
|
ufVo.setProcDefId(finBillApplication.getProcDefId()); |
|
|
|
messageFlowableQuery.setUfVo(messageFlowVo); |
|
|
|
messageFlowableQuery.setAppMap(appMap); |
|
|
|
messageFlowableQuery.setBusinessSid(businessSid); |
|
|
|
messageFlowableQuery.setModuleName("欠款领票"); |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(procId); |
|
|
|
String nextNodeUserSids = listResultBean.getData().get(0).getASSIGNEE_(); |
|
|
|
List<String> receiveSidList = Arrays.asList(nextNodeUserSids.split(",")); |
|
|
|
if (receiveSidList.size() == 1 && receiveSidList.get(0).equals(finBillApplication.getCreateBySid())) { |
|
|
|
messageFlowableQuery.setMsgContent("您提交的" + messageFlowableQuery.getModuleName() + "已被驳回,请重新提交"); |
|
|
|
} else { |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
} |
|
|
|
messageFlowableQuery.setMsgTitle("欠款领票"); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean revokeProcessQKLP(FinBillTaskQuery query) { |
|
|
|
return null; |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = finBillApplication.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.revokeProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
updateFlowFiled(BeanUtil.beanToMap(resultBean.getData())); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.setMsg("操作失败,提交的数据不一致!"); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean breakProcessQKLP(FinBillTaskQuery query) { |
|
|
|
return null; |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
if (StringUtils.isBlank(query.getInstanceId())) { |
|
|
|
return rb.setMsg("参数错误:instanceId"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getUserSid())) { |
|
|
|
return rb.setMsg("参数错误:userSid"); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(query.getComment())) { |
|
|
|
return rb.setMsg("请填写意见"); |
|
|
|
} |
|
|
|
FinBillApplication finBillApplication = fetchBySid(query.getBusinessSid()); |
|
|
|
String businessTaskId = finBillApplication.getTaskId(); |
|
|
|
if (StringUtils.isNotBlank(businessTaskId)) { |
|
|
|
if (businessTaskId.equals(query.getTaskId())) { |
|
|
|
FlowTaskVo flowTaskVo = new FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(query, flowTaskVo); |
|
|
|
ResultBean<UpdateFlowFieldVo> resultBean = flowableFeign.breakProcess(flowTaskVo); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return rb.setMsg(resultBean.getMsg()); |
|
|
|
} |
|
|
|
Map<String, Object> map = BeanUtil.beanToMap(resultBean.getData()); |
|
|
|
updateFlowFiled(map); |
|
|
|
finBillVehicleService.updateByMainSid(finBillApplication.getSid()); |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致!"); |
|
|
|
} |
|
|
|
} |