新增webcad生产单导入:1、cadtoken请求网关异常修复;2、cad拆单批量数据组织id缺省补充;

This commit is contained in:
gaoqr
2025-03-10 14:54:42 +08:00
parent b7e371ffa8
commit 526738058e
3 changed files with 12 additions and 3 deletions
@@ -214,7 +214,6 @@ public class AccessLogFilter implements GlobalFilter, Ordered {
gatewayLog.getEndTime()).toMillis()));
// 设置其它字段
gatewayLog.setUserId(SecurityFrameworkUtils.getLoginUserId(exchange));
gatewayLog.setUserType(SecurityFrameworkUtils.getLoginUserType(exchange));
gatewayLog.setResponseHeaders(response.getHeaders());
gatewayLog.setHttpStatus(response.getStatusCode());
@@ -1,6 +1,7 @@
package com.cf.imes.gateway.util;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.cf.imes.framework.common.util.json.JsonUtils;
import com.cf.imes.gateway.filter.security.LoginUser;
import lombok.SneakyThrows;
@@ -60,8 +61,10 @@ public class SecurityFrameworkUtils {
* @param user 用户
*/
public static void setLoginUser(ServerWebExchange exchange, LoginUser user) {
exchange.getAttributes().put(LOGIN_USER_ID_ATTR, user.getId());
exchange.getAttributes().put(LOGIN_USER_TYPE_ATTR, user.getUserType());
Long userId = user.getId();
if (ObjectUtil.isNotNull(userId)) {
exchange.getAttributes().put(LOGIN_USER_ID_ATTR, userId);
}
}
/**
@@ -256,6 +256,7 @@ public class WebCadOrderImportFactory {
.brand(plateGoodDO.getBrand())
.price(0.00)
.deleted(false)
.organId(organId)
.build();
Long orderGoodsId = (Long) snowFlakeGenerator.nextId(null);
@@ -279,6 +280,7 @@ public class WebCadOrderImportFactory {
.planId(0L)
.price(0.00)
.deleted(false)
.organId(organId)
.build();
goodsDOS.add(goodsDO);
@@ -641,6 +643,7 @@ public class WebCadOrderImportFactory {
.packageId(0L)
.partsId(0L)
.num(1.0)
.organId(organId)
.build();
orderItemDOS.add(orderItemDO);
}
@@ -658,6 +661,7 @@ public class WebCadOrderImportFactory {
.packageId(0L)
.partsId(0L)
.num(1.0)
.organId(organId)
.build();
orderItemDOS.add(orderItemDO);
}
@@ -789,6 +793,7 @@ public class WebCadOrderImportFactory {
.packageId(0L)
.plateId(0L)
.num(part.getNum())
.organId(organId)
.build();
orderItemDOS.add(orderItemDO);
}
@@ -804,6 +809,7 @@ public class WebCadOrderImportFactory {
.packageId(0L)
.plateId(0L)
.num(partNum)
.organId(organId)
.build();
orderItemDOS.add(orderItemDO);
} else {
@@ -819,6 +825,7 @@ public class WebCadOrderImportFactory {
.packageId(0L)
.plateId(0L)
.num(part.getNum())
.organId(organId)
.build();
orderItemDOS.add(orderItemDO);
}