|
|
@ -128,8 +128,6 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
@Autowired |
|
|
|
private FinBillFileService finBillFileService; |
|
|
|
@Autowired |
|
|
|
private FinBillApplicationPublicService finBillApplicationPublicService; |
|
|
|
@Autowired |
|
|
|
private FlowTaskFeign flowTaskFeign; |
|
|
|
@Autowired |
|
|
|
private FlowableFeign flowableFeign; |
|
|
@ -469,10 +467,18 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
fileUrl = urlPrefix + fileUrl; |
|
|
|
zjApplicationAppendx.setFileUrl(fileUrl); |
|
|
|
} |
|
|
|
List<FinBillFileVo> fjApplicationAppendxs = finBillFileService.fetchfjBySid(sid); |
|
|
|
for (FinBillFileVo fjApplicationAppendx : fjApplicationAppendxs) { |
|
|
|
String fileUrl = fjApplicationAppendx.getFileUrl(); |
|
|
|
String urlPrefix = fileUploadComponent.getUrlPrefix(); |
|
|
|
fileUrl = urlPrefix + fileUrl; |
|
|
|
fjApplicationAppendx.setFileUrl(fileUrl); |
|
|
|
} |
|
|
|
vo.setKhkpsqsApplicationAppendxs(khkpsqsApplicationAppendxs); |
|
|
|
vo.setKpxxqrsApplicationAppendxs(kpxxqrsApplicationAppendxs); |
|
|
|
vo.setCldjhtApplicationAppendxs(cldjhtApplicationAppendxs); |
|
|
|
vo.setZjApplicationAppendxs(zjApplicationAppendxs); |
|
|
|
vo.setFjApplicationAppendxs(fjApplicationAppendxs); |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
@ -492,134 +498,6 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
|
|
|
|
/*public ResultBean submitFinBillApplication(SubmitFinBillApplicationDto dto) { |
|
|
|
String orgSid = checkUserOrg(dto.getStaffSid()); |
|
|
|
ResultBean<String> resultBean = saveOrUpdateDto(dto); |
|
|
|
String businessSid = resultBean.getData(); |
|
|
|
Map<String, Object> variables = new HashMap<>(); |
|
|
|
variables.put("businessSid", businessSid); |
|
|
|
variables.put("orgSid", orgSid); //部门sid
|
|
|
|
String contractSid = dto.getContractSid(); |
|
|
|
String oneBillMoney = dto.getOneBillMoney(); |
|
|
|
ResultBean<CommonContractVo> commonContractVoResultBean = commonContractFeign.fetchBySid(contractSid); |
|
|
|
CommonContractVo data1 = commonContractVoResultBean.getData(); |
|
|
|
String busSid = data1.getBusSid(); |
|
|
|
ResultBean<String> priceByOrderSid = busSalesOrderPriceFeign.getPriceByOrderSid(busSid); |
|
|
|
String price = priceByOrderSid.getData(); |
|
|
|
if (price.equals(oneBillMoney)) { |
|
|
|
variables.put("isHighAndLowOpen", false); |
|
|
|
} else { |
|
|
|
variables.put("isHighAndLowOpen", true); |
|
|
|
} |
|
|
|
if (StringUtils.isBlank(dto.getTaskId())) { // 新提交
|
|
|
|
String proDefId = ProcDefEnum.SEALAPPLY.getProDefId(); |
|
|
|
ResultBean resultBean1 = null; |
|
|
|
//ResultBean resultBean1 = flowableFeign.businessStart(ProcDefEnum.FINBILLAPPLICATION.getProDefId(), dto.getUserSid(), variables);
|
|
|
|
if (resultBean1.getSuccess() && resultBean1.getData() != null) { |
|
|
|
Map<String, String> map = (Map<String, String>) resultBean1.getData(); |
|
|
|
//更新业务表中的流程状态
|
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
paramMap.put("procDefId", ProcDefEnum.SEALAPPLY.getProDefId()); |
|
|
|
paramMap.put("nodeState", map.get("nodeState")); |
|
|
|
paramMap.put("procInsId", map.get("procInsId")); |
|
|
|
paramMap.put("taskDefKey", map.get("taskDefKey")); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
} |
|
|
|
return resultBean1; |
|
|
|
} else { // 驳回到发起人后再次提交
|
|
|
|
variables.put("comment", StringUtils.isNotBlank(dto.getComment()) ? dto.getComment() : "重新提交"); |
|
|
|
variables.put("instanceId", dto.getInstanceId()); |
|
|
|
variables.put("taskId", dto.getTaskId()); |
|
|
|
variables.put("userSid", dto.getUserSid()); |
|
|
|
return complete(variables); |
|
|
|
} |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 检查用户是否设置部门 |
|
|
|
* |
|
|
|
* @param staffSid |
|
|
|
* @return 返回部门sid |
|
|
|
*/ |
|
|
|
private String checkUserOrg(String staffSid) { |
|
|
|
String orgSid = ""; |
|
|
|
ResultBean<String> resultBean = sysStaffOrgFeign.getSysStaffOrgSidListByStaffSid(staffSid); |
|
|
|
if (resultBean.getSuccess()) { |
|
|
|
orgSid = resultBean.getData(); |
|
|
|
} |
|
|
|
return orgSid; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 保存流程业务关联表 数据 |
|
|
|
* |
|
|
|
* @param map |
|
|
|
*/ |
|
|
|
/* private void submitFinBillApplication(Map<String, String> map) { |
|
|
|
String sid = map.get("sid"); |
|
|
|
ResultBean resultBean = sysFormLinkFeign.selectByBusinessSid(sid); |
|
|
|
if (!resultBean.getSuccess()) { // 新增
|
|
|
|
SysFormLinkDto sysFormLinkDto = new SysFormLinkDto(); |
|
|
|
sysFormLinkDto.setBusinessSid(map.get("sid")); |
|
|
|
sysFormLinkDto.setProcInsId(map.get("procInsId")); |
|
|
|
sysFormLinkDto.setTaskDefKey(map.get("taskDefKey")); |
|
|
|
sysFormLinkDto.setNodeState(map.get("nodeState")); |
|
|
|
sysFormLinkDto.setFormType(SysFormLinkTypeEnum.ORDER_DEPOSIT_VEHICLE.getCode()); |
|
|
|
sysFormLinkDto.setFlowState(Integer.parseInt(SysFormLinkFlowStateEnum.PROCESSING.getCode())); |
|
|
|
sysFormLinkFeign.save(sysFormLinkDto); |
|
|
|
} else { // 更新
|
|
|
|
Map<String, Object> updateMap = new HashMap<>(); |
|
|
|
updateMap.put("businessSid", sid); |
|
|
|
updateMap.put("nodeState", map.get("nodeState")); |
|
|
|
updateMap.put("taskDefKey", map.get("taskDefKey")); |
|
|
|
updateMap.put("flowState", SysFormLinkFlowStateEnum.PROCESSING.getCode()); |
|
|
|
sysFormLinkFeign.updateFiled(updateMap); |
|
|
|
} |
|
|
|
}*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 办理 |
|
|
|
* |
|
|
|
* @param variables |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
/* public ResultBean complete(Map<String, Object> variables) { |
|
|
|
BusinessVariables bv = BusinessVariables.builder().build(); |
|
|
|
bv.setFormVariables(variables); |
|
|
|
ResultBean<com.yxt.anrui.flowable.api.flowtask.FlowTask> resultBean = flowTaskFeign.businessComplete(bv); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
String nodeState = ""; |
|
|
|
String taskDefKey = ""; |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", variables.get("businessSid").toString()); |
|
|
|
if (resultBean.getData() != null) { |
|
|
|
ResultBean<List<LatestTaskVo>> listResultBean = flowTaskFeign.getLatestTasks(resultBean.getData().getProcInsId()); |
|
|
|
if (listResultBean.getSuccess() && listResultBean.getData() != null && listResultBean.getData().size() != 0) { |
|
|
|
nodeState = listResultBean.getData().get(0).getName_(); |
|
|
|
taskDefKey = listResultBean.getData().get(0).getTask_def_key_(); |
|
|
|
} else { |
|
|
|
nodeState = ProcessStateEnum.FINISHED.getStateName(); |
|
|
|
taskDefKey = "Event_end"; |
|
|
|
paramMap.put("flowState", FlowComment.SETTLE.getRemark()); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(variables.get("businessSid").toString()); |
|
|
|
String oneBillMoney = finBillApplication.getOneBillMoney().toString(); |
|
|
|
String sid1 = finBillApplication.getContractSid(); |
|
|
|
ResultBean<CommonContractVo> commonContractVoResultBean = commonContractFeign.fetchBySid(sid1); |
|
|
|
CommonContractVo data = commonContractVoResultBean.getData(); |
|
|
|
String orderSid = data.getBusSid(); |
|
|
|
busSalesOrderFeign.updateOneBillMoneyByOrderSid(orderSid, oneBillMoney); |
|
|
|
} |
|
|
|
} |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
}*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 更新流程相关的状态 |
|
|
|
* |
|
|
@ -630,94 +508,6 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
return baseMapper.updateFlowFiled(map); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 撤回 |
|
|
|
* |
|
|
|
* @param userSid |
|
|
|
* @param businessSid |
|
|
|
* @param flowTaskVo |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
/* public ResultBean revokeProcess(String userSid, String businessSid, FlowTaskVo flowTaskVo) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(flowTaskVo, fl); |
|
|
|
fl.setUserSid(userSid); |
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.revokeProcess(fl); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
String nodeState = resultBean.getData().get(0).getName_(); |
|
|
|
String taskDefKey = resultBean.getData().get(0).getTask_def_key_(); |
|
|
|
String incomingSourceRef = resultBean.getData().get(0).getIncomingSourceRef(); |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
|
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
}*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 驳回 |
|
|
|
* |
|
|
|
* @param businessSid |
|
|
|
* @param flowTaskVo |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
/* public ResultBean taskReject(String businessSid, FlowTaskVo flowTaskVo) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(flowTaskVo, fl); |
|
|
|
ResultBean<List<LatestTaskVo>> resultBean = flowTaskFeign.taskReject(fl); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
String nodeState = resultBean.getData().get(0).getName_(); |
|
|
|
String taskDefKey = resultBean.getData().get(0).getTask_def_key_(); |
|
|
|
String incomingSourceRef = resultBean.getData().get(0).getIncomingSourceRef(); |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
paramMap.put("nodeState", nodeState); |
|
|
|
paramMap.put("taskDefKey", taskDefKey); |
|
|
|
paramMap.put("flowState", nodeState); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
}*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 终止流程 |
|
|
|
* |
|
|
|
* @param businessSid |
|
|
|
* @param flowTaskVo |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
/* public ResultBean breakProcess(String businessSid, FlowTaskVo flowTaskVo) { |
|
|
|
com.yxt.anrui.flowable.api.flowtask.FlowTaskVo fl = new com.yxt.anrui.flowable.api.flowtask.FlowTaskVo(); |
|
|
|
BeanUtil.copyProperties(flowTaskVo, fl); |
|
|
|
ResultBean resultBean = flowTaskFeign.breakProcess(fl); |
|
|
|
if (!resultBean.getSuccess()) { |
|
|
|
return resultBean; |
|
|
|
} |
|
|
|
Map<String, Object> paramMap = new HashMap<>(); |
|
|
|
paramMap.put("sid", businessSid); |
|
|
|
paramMap.put("nodeState", String.valueOf(resultBean.getData())); |
|
|
|
paramMap.put("taskDefKey", "Event_end"); |
|
|
|
paramMap.put("flowState", String.valueOf(resultBean.getData())); |
|
|
|
updateFlowFiled(paramMap); |
|
|
|
return resultBean; |
|
|
|
}*/ |
|
|
|
|
|
|
|
/** |
|
|
|
* 流程历史流转记录 |
|
|
|
* |
|
|
|
* @param procInsId |
|
|
|
* @param deployId |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
public ResultBean flowRecord(String procInsId, String deployId) { |
|
|
|
return flowTaskFeign.businessFlowRecord(procInsId); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean complete(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String businessSid = bv.getBusinessSid(); |
|
|
@ -811,7 +601,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
messageFlowableQuery.setModuleName("开票申请"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("开票申请"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
@ -930,7 +720,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
} |
|
|
|
messageFlowableQuery.setMsgTitle("开票申请"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
} |
|
|
@ -1072,7 +862,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
messageFlowableQuery.setModuleName("开票申请"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("开票申请"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return voResultBean; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
@ -1410,7 +1200,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
messageFlowableQuery.setModuleName("开票申请"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("开票申请"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return voResultBean; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
@ -1667,6 +1457,122 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
return rb.success().setMsg("修改成功").setData(dtoSid); |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean saveQKLP(FinBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String dtoSid = dto.getSid(); |
|
|
|
List<FinBillTrailerDto> finBillTrailers = dto.getFinBillTrailers(); |
|
|
|
List<FinBillVehicleDto> finBillVehicles = dto.getFinBillVehicles(); |
|
|
|
List<FinBillFileDto> fjApplicationAppendxs = dto.getFjApplicationAppendxs(); |
|
|
|
if (StringUtils.isBlank(dtoSid)) {//新增
|
|
|
|
FinBillApplication finBillApplication = new FinBillApplication(); |
|
|
|
BeanUtil.copyProperties(dto, finBillApplication, "sid"); |
|
|
|
finBillApplication.setNodeState("待提交"); |
|
|
|
String billNo = getApplyCodeQKLP(dto.getUseOrgSid()); |
|
|
|
finBillApplication.setBillNo(billNo); |
|
|
|
finBillApplication.setBillStateKey("004"); |
|
|
|
finBillApplication.setBillStateValue("欠款领票"); |
|
|
|
finBillApplication.setNum(finBillVehicles.size()); |
|
|
|
save(finBillApplication); |
|
|
|
//主车开票信息
|
|
|
|
for (FinBillVehicleDto finBillVehicleDto : finBillVehicles) { |
|
|
|
FinBillVehicle finBillVehicle = new FinBillVehicle(); |
|
|
|
BeanUtil.copyProperties(finBillVehicleDto, finBillVehicle, "sid"); |
|
|
|
finBillVehicle.setBillAppSid(finBillApplication.getSid()); |
|
|
|
finBillVehicleService.save(finBillVehicle); |
|
|
|
} |
|
|
|
//挂车开票信息
|
|
|
|
for (FinBillTrailerDto finBillTrailerDto : finBillTrailers) { |
|
|
|
FinBillTrailer finBillTrailer = new FinBillTrailer(); |
|
|
|
BeanUtil.copyProperties(finBillTrailerDto, finBillTrailer, "sid"); |
|
|
|
finBillTrailer.setBillAppSid(finBillApplication.getSid()); |
|
|
|
for (FinBillVehicleDto finBillVehicle : finBillVehicles) { |
|
|
|
if (finBillVehicle.getVinNo().equals(finBillTrailerDto.getVinNo())) { |
|
|
|
finBillTrailer.setBillTypeKey(finBillVehicle.getBillTypeKey()); |
|
|
|
finBillTrailer.setBillTypeValue(finBillVehicle.getBillTypeValue()); |
|
|
|
finBillTrailer.setOpenTickSid(finBillVehicle.getOpenTickSid()); |
|
|
|
finBillTrailer.setOpenTickName(finBillVehicle.getOpenTickName()); |
|
|
|
} |
|
|
|
} |
|
|
|
finBillTrailerService.save(finBillTrailer); |
|
|
|
} |
|
|
|
//附件信息
|
|
|
|
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(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.FJ.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
return rb.success().setMsg("保存成功").setData(finBillApplication.getSid()); |
|
|
|
} |
|
|
|
FinBillApplication finBillApplication = fetchBySid(dtoSid); |
|
|
|
if (finBillApplication == null) { |
|
|
|
rb.setMsg("该数据不存在"); |
|
|
|
} |
|
|
|
dto.setBillStateKey("004"); |
|
|
|
dto.setBillStateValue("欠款领票"); |
|
|
|
updateByDto(dto); |
|
|
|
finBillFileService.deleteByFinAppSid(dtoSid); |
|
|
|
//附件信息
|
|
|
|
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(finBillApplication.getSid()); |
|
|
|
finBillFileDto.setAttachType(FinAttachTypeEnum.FJ.getAttachType()); |
|
|
|
finBillFileService.saveOrUpdateDto(finBillFileDto); |
|
|
|
} |
|
|
|
} |
|
|
|
finBillVehicleService.delByBillAppSid(dtoSid); |
|
|
|
for (FinBillVehicleDto finBillVehicleDto : finBillVehicles) { |
|
|
|
FinBillVehicle finBillVehicle = new FinBillVehicle(); |
|
|
|
BeanUtil.copyProperties(finBillVehicleDto, finBillVehicle, "sid"); |
|
|
|
finBillVehicle.setBillAppSid(dtoSid); |
|
|
|
finBillVehicleService.save(finBillVehicle); |
|
|
|
} |
|
|
|
finBillTrailerService.delByBillAppSid(dtoSid); |
|
|
|
for (FinBillTrailerDto finBillTrailerDto : finBillTrailers) { |
|
|
|
FinBillTrailer finBillTrailer = new FinBillTrailer(); |
|
|
|
BeanUtil.copyProperties(finBillTrailerDto, finBillTrailer, "sid"); |
|
|
|
finBillTrailer.setBillAppSid(dtoSid); |
|
|
|
for (FinBillVehicleDto finBillVehicle : finBillVehicles) { |
|
|
|
if (finBillVehicle.getVinNo().equals(finBillTrailerDto.getVinNo())) { |
|
|
|
finBillTrailer.setBillTypeKey(finBillVehicle.getBillTypeKey()); |
|
|
|
finBillTrailer.setBillTypeValue(finBillVehicle.getBillTypeValue()); |
|
|
|
finBillTrailer.setOpenTickSid(finBillVehicle.getOpenTickSid()); |
|
|
|
finBillTrailer.setOpenTickName(finBillVehicle.getOpenTickName()); |
|
|
|
} |
|
|
|
} |
|
|
|
finBillTrailerService.save(finBillTrailer); |
|
|
|
} |
|
|
|
return rb.success().setMsg("修改成功").setData(dtoSid); |
|
|
|
} |
|
|
|
|
|
|
|
private String getApplyCodeQKLP(String useOrgSid) { |
|
|
|
ResultBean<SysOrganizationVo> resultBean1 = sysOrganizationFeign.fetchBySid(useOrgSid); |
|
|
|
String orgCode = resultBean1.getData().getOrgCode(); |
|
|
|
BillNo b = new BillNo(); |
|
|
|
b.setOrgCode(orgCode); |
|
|
|
b.setBillType(BillTypeEnum.QKLP.getBillType()); |
|
|
|
String bill = Rule.getBill(b); |
|
|
|
String i = baseMapper.selectNum(bill); |
|
|
|
String billNo = ""; |
|
|
|
if (StringUtils.isNotBlank(i)) { |
|
|
|
billNo = Rule.getBillNo(bill, Integer.valueOf(i).intValue()); |
|
|
|
} else { |
|
|
|
billNo = Rule.getBillNo(bill, 0); |
|
|
|
} |
|
|
|
return billNo; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean submitFinBillApplicationQK(SubmitFinBillApplicationDto dto) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
String contractNo = dto.getContractNo(); |
|
|
@ -1746,7 +1652,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
messageFlowableQuery.setModuleName("欠款开票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款开票"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return voResultBean; |
|
|
|
} |
|
|
|
if (r == 2) { |
|
|
@ -1801,13 +1707,51 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
messageFlowableQuery.setModuleName("欠款开票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款开票"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
} |
|
|
|
return rb.success().setData(resultBean.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean completeBy(BusinessVariables bv) { |
|
|
|
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())); |
|
|
|
//极光推送
|
|
|
|
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<List<FinBillNodeVo>> getPreviousNodesForRejectQK(FinBillNodeQuery query) { |
|
|
@ -1900,7 +1844,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
} |
|
|
|
messageFlowableQuery.setMsgTitle("欠款开票"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success(); |
|
|
|
} |
|
|
|
} |
|
|
@ -2006,6 +1950,53 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<FinBillApplicationVo> listPageQKLP(PagerQuery<FinBillApplicationQuery> pq) { |
|
|
|
FinBillApplicationQuery query = pq.getParams(); |
|
|
|
QueryWrapper<FinBillApplication> qw = new QueryWrapper<>(); |
|
|
|
if (StringUtils.isNotBlank(query.getOrgPath())) { |
|
|
|
String useOrgSid = sysStaffOrgFeign.getOrgSidByPath(query.getOrgPath()).getData(); |
|
|
|
query.setUseOrgSid(useOrgSid); |
|
|
|
} |
|
|
|
qw.eq("fba.billStateKey", "004"); |
|
|
|
qw.eq("fba.useOrgSid", query.getUseOrgSid()); |
|
|
|
qw.eq("fba.createBySid", query.getCreateBySid()); |
|
|
|
if ("1".equals(query.getType())) { |
|
|
|
qw.eq("fba.nodeState", "待提交"); |
|
|
|
} else if ("2".equals(query.getType())) { |
|
|
|
qw.ne("fba.nodeState", "待提交"); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getSaleTypeKey())) { |
|
|
|
qw.eq("fba.saleTypeKey", query.getSaleTypeKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getContractNo())) { |
|
|
|
qw.like("fba.contractNo", query.getContractNo()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getOpenTickUnitName())) { |
|
|
|
qw.like("fba.openTickUnitName", query.getOpenTickUnitName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCustomerName())) { |
|
|
|
qw.like("fba.customerName", query.getCustomerName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getModelName())) { |
|
|
|
qw.like("fba.modelName", query.getModelName()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getBillStateKey())) { |
|
|
|
qw.eq("fba.billStateKey", query.getBillStateKey()); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(query.getCreateByName())) { |
|
|
|
qw.like("fba.createByName", query.getCreateByName()); |
|
|
|
} |
|
|
|
String returnedMoneyStartDate = query.getReturnedMoneyStartDate(); |
|
|
|
String returnedMoneyEndDate = query.getReturnedMoneyEndDate(); |
|
|
|
qw.apply(StringUtils.isNotEmpty(returnedMoneyStartDate), "date_format (fba.returnedMoneyDate,'%Y-%m-%d') >= date_format('" + returnedMoneyStartDate + "','%Y-%m-%d')"). |
|
|
|
apply(StringUtils.isNotEmpty(returnedMoneyEndDate), "date_format (fba.returnedMoneyDate,'%Y-%m-%d') <= date_format('" + returnedMoneyEndDate + "','%Y-%m-%d')" |
|
|
|
); |
|
|
|
IPage<FinBillApplication> page = PagerUtil.queryToPage(pq); |
|
|
|
IPage<FinBillApplicationVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
PagerVo<FinBillApplicationVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
return p; |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean companyToDivisionOperateQK(BusinessVariables bv) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
|
FinBillApplication finBillApplication = fetchBySid(bv.getBusinessSid()); |
|
|
@ -2056,7 +2047,7 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
messageFlowableQuery.setModuleName("欠款开票"); |
|
|
|
messageFlowableQuery.setMsgContent(finBillApplication.getCreateByName() + "提交的" + messageFlowableQuery.getModuleName() + ",请审批"); |
|
|
|
messageFlowableQuery.setMsgTitle("欠款开票"); |
|
|
|
ResultBean<String> stringResultBean = messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
messageFeign.pushMessage(messageFlowableQuery); |
|
|
|
return rb.success().setData(resultBean1.getData()); |
|
|
|
} else { |
|
|
|
return rb.setMsg("操作失败!提交的数据不一致"); |
|
|
@ -2096,4 +2087,6 @@ public class FinBillApplicationService extends MybatisBaseService<FinBillApplica |
|
|
|
} |
|
|
|
return rb.success().setData(finBillApplicationDetailsVo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |