wms租赁定时任务推送到bms(把获取当前登录人的一级id改为参数传入)

This commit is contained in:
zhou-hongcheng
2026-02-26 09:36:53 +08:00
parent 2a570fbefc
commit 9621deccf1
9 changed files with 70 additions and 4 deletions
@@ -98,7 +98,10 @@ public class CostCalculationApplicationService {
taskFlowRecordsDO.setTaskFlow(OrderSequence.getOrderCode("JFRW"));
taskFlowRecordsDO.setRequestParams(JSON.toJSONString(costCalculationDTO));
taskFlowRecordsDO.setOriginalBusinessNum(costCalculationDTO.getOriginalBusinessNum());
Boolean flag = taskFlowRecordsDomainService.saveInCost(taskFlowRecordsDO);
taskFlowRecordsDO.setTopOrganizationId(costCalculationDTO.getTopOrganizationId());
taskFlowRecordsDO.setOrganizationId(costCalculationDTO.getOrganizationId());
taskFlowRecordsDO.setOrganizationName(costCalculationDTO.getOrganizationName());
Boolean flag = taskFlowRecordsDomainService.saveInCost2(taskFlowRecordsDO);
if (!flag) {
throw new ServiceException("计费任务记录保存失败,请重试");
}
@@ -141,7 +144,7 @@ public class CostCalculationApplicationService {
throw new ServiceException("单据类型未找到");
}
//遍历费用科目取出对应配置的费用科目项
AjaxResult expenseAccountAjax = systemServiceFeign.getSubInfoByCode(costCalculationDTO.getSubjectCode());
AjaxResult expenseAccountAjax = systemServiceFeign.getSubInfoByCode2(costCalculationDTO.getSubjectCode(),costCalculationDTO.getTopOrganizationId());
if(!"200".equals(String.valueOf(ajaxResult.get("code")))) {
throw new ServiceException("费用科目不存在或已被删除");
}
@@ -304,7 +304,7 @@ public class BusinessDocumentApplicationService {
}
//根据费用科目code查询费用信息,并赋值
if(StringUtils.isNotEmpty(businessDocumentDO.getSecondSubjectCode())){
AjaxResult ajaxResult = systemServiceFeign.getSubInfoByCode(businessDocumentDO.getSecondSubjectCode());
AjaxResult ajaxResult = systemServiceFeign.getSubInfoByCode2(businessDocumentDO.getSecondSubjectCode(),businessDocumentDO.getTopOrganizationId());
if("200".equals(String.valueOf(ajaxResult.get("code")))){
ExpenseAccountPO expenseAccountPO = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), ExpenseAccountPO.class);
if(null == expenseAccountPO || expenseAccountPO.getExpenseAccountId()==null){
@@ -826,6 +826,8 @@ public class BusinessDocumentApplicationService {
costCalculationDTO.setSubjectCode(StringUtils.isEmpty(businessDocumentDO.getSecondSubjectCode()) ? businessDocumentDO.getFirstSubjectCode():businessDocumentDO.getSecondSubjectCode());
costCalculationDTO.setDocumentTypeCode(businessDocumentDO.getDocumentTypeCode());
costCalculationDTO.setTopOrganizationId(businessDocumentDO.getTopOrganizationId());
costCalculationDTO.setOrganizationId(businessDocumentDO.getOrganizationId());
costCalculationDTO.setOrganizationName(businessDocumentDO.getOrganizationName());
BillingCostPo billingCostPo = costCalculationApplicationService.costCalculation(costCalculationDTO);
businessDocumentDO.setEstimatedCost(billingCostPo.getComputationalCost());
businessDocumentDO.setBillAmount(billingCostPo.getComputationalCost());//计费金额与计算金额一致
@@ -83,4 +83,15 @@ public class TaskFlowRecordsDomainService {
taskFlowRecordsDO.setCreateTime(new Date());
return taskFlowRecordsService.insert(taskFlowRecordsDO);
}
/**
* 保存任务流水
*/
public Boolean saveInCost2(TaskFlowRecordsDO taskFlowRecordsDO) {
taskFlowRecordsDO.setTopOrganizationId(taskFlowRecordsDO.getTopOrganizationId());
taskFlowRecordsDO.setOrganizationId(taskFlowRecordsDO.getOrganizationId());
taskFlowRecordsDO.setOrganizationName(taskFlowRecordsDO.getOrganizationName());
taskFlowRecordsDO.setCreateTime(new Date());
return taskFlowRecordsService.insert(taskFlowRecordsDO);
}
}
@@ -40,6 +40,12 @@ public class CostCalculationDTO{
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
private String organizationName;