7 Commits

Author SHA1 Message Date
yangyufu
fc24f95299 feat(sysapi): 重构接口日志查询支持动态表名与报文检索
- 替换Java硬编码查询为MyBatis XML动态SQL,支持动态切换日志表
- 新增请求报文与响应报文关键字搜索条件
- 前端字段映射由驼峰调整为下划线,适配Map返回结构
- 日志详情新增JSON一键复制功能与归档遮罩动画
2026-07-03 14:15:50 +08:00
yangyufu
5ca480ed86 feat: 出库查询添加收货地址及木箱号查询
- 出库单查询及导出增加仓库、库区和收货地址字段
- 货位查询增加木箱号查询条件
- 修复MES接口异常时缺少return的bug
- 移除出库明细页面的debugger并修正日志错别字
2026-07-02 15:13:42 +08:00
yangyufu
0a6bcde1b6 fix(logging): 优化API日志记录逻辑并改进异常处理
- 重构响应结果解析逻辑,支持多种状态字段判断
- 添加对空响应和异常响应的更完善处理
- 改进异常捕获和日志记录机制
- 将MDM服务中的异常抛出改为返回错误状态对象
- 修复finally块中日志保存可能发生的异常影响主业务流程
2026-06-16 11:16:40 +08:00
yangyufu
3b1d413025 feat(sap): 添加ZJS单据类型映射支持
- 新增ZJS单据类型到1011的映射逻辑
- 保持现有ZLR2单据类型映射不变
- 扩展默认处理逻辑以支持新的单据类型
2026-06-15 17:22:02 +08:00
yangyufu
c1fe2e18ff feat(sap): 添加ZJS单据类型映射支持
- 新增ZJS单据类型到1011的映射逻辑
- 保持现有ZLR2单据类型映射不变
- 扩展默认处理逻辑以支持新的单据类型
2026-06-12 16:22:23 +08:00
yangyufu
cbf09411f6 refactor(log): 统一API日志记录实现并优化MES服务日志
- 在MES服务中统一使用OutboundApiLogger进行API
- 为所有MES接口方法添加开始时间戳用于性能监控
- 标准化所有API接口的日志记录格式和异常处理机制
2026-06-12 10:01:17 +08:00
yangyufu
6011afc791 fix(log): 优化API日志记录和查询功能
- 实现响应体结构化解析,根据RTYPE字段判断请求状态
- 修复前端查询条件触发时机和日期格式化问题
2026-06-11 14:01:47 +08:00
25 changed files with 537 additions and 211 deletions

View File

@@ -1,6 +1,8 @@
package org.nl.modules.logging.aspect;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson2.JSONObject;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
@@ -52,7 +54,8 @@ public class ApiLogAspect {
logEntity.setBizDesc(apiLog.bizDesc());
logEntity.setTraceId(MDC.get("traceId"));
logEntity.setCreateTime(DateUtil.now());
Object result = null;
Throwable businessException = null;
try {
if (attributes != null) {
HttpServletRequest request = attributes.getRequest();
@@ -61,33 +64,77 @@ public class ApiLogAspect {
logEntity.setRequestIp(getIpAddress(request));
logEntity.setRequestHeaders(JSONUtil.toJsonStr(getRequestHeaders(request)));
}
MethodSignature signature = (MethodSignature) joinPoint.getSignature();
Method method = signature.getMethod();
Object[] args = joinPoint.getArgs();
logEntity.setRequestParams(buildRequestParams(method, args));
Object result = joinPoint.proceed();
long costTime = System.currentTimeMillis() - startTime;
logEntity.setCostTime(costTime);
logEntity.setResponseStatus(200);
logEntity.setStatus("SUCCESS");
logEntity.setResponseBody(JSONUtil.toJsonStr(result));
return result;
result = joinPoint.proceed();
try {
JSONObject jsonObject = JSONObject.parseObject(JSONUtil.toJsonStr(result));
if(null != jsonObject && jsonObject.containsKey("status")){
String status = jsonObject.getString("status");
if ("E".equalsIgnoreCase(status)) {
logEntity.setResponseStatus(400);
logEntity.setStatus("FAIL");
logEntity.setErrorMsg(JSONUtil.toJsonStr(result));
logEntity.setResponseBody(JSONUtil.toJsonStr(result));
} else {
logEntity.setResponseStatus(200);
logEntity.setStatus("SUCCESS");
logEntity.setResponseBody(JSONUtil.toJsonStr(result));
}
}else{
JSONObject jsonObject1 = jsonObject != null ? jsonObject.getJSONObject("body") : null;
if (jsonObject1 == null) {
logEntity.setResponseStatus(400);
logEntity.setStatus("FAIL");
logEntity.setErrorMsg("返回信息为空,请确认!");
logEntity.setResponseBody(JSONUtil.toJsonStr(result));
} else {
String key = "";
if (jsonObject1.containsKey("RTYPE")) {
key = "RTYPE";
} else if (jsonObject1.containsKey("TYPE")) {
key = "TYPE";
}
String rtype = StrUtil.isNotBlank(key) ? jsonObject1.getString(key) : null;
if ("E".equalsIgnoreCase(rtype)) {
logEntity.setResponseStatus(400);
logEntity.setStatus("FAIL");
logEntity.setErrorMsg(JSONUtil.toJsonStr(result));
logEntity.setResponseBody(JSONUtil.toJsonStr(result));
} else {
logEntity.setResponseStatus(200);
logEntity.setStatus("SUCCESS");
logEntity.setResponseBody(JSONUtil.toJsonStr(result));
}
}
}
} catch (Exception e) {
log.error("解析响应结果失败,记录原始响应", e);
logEntity.setResponseStatus(200);
logEntity.setStatus("SUCCESS");
logEntity.setResponseBody(JSONUtil.toJsonStr(result));
}
} catch (Throwable throwable) {
businessException = throwable;
logEntity.setStatus("FAIL");
String errorMsg = throwable.getMessage();
logEntity.setErrorMsg(errorMsg != null && errorMsg.length() > 2000 ?
errorMsg.substring(0, 2000) : errorMsg);
} finally {
long costTime = System.currentTimeMillis() - startTime;
logEntity.setCostTime(costTime);
logEntity.setStatus("FAIL");
logEntity.setErrorMsg(throwable.getMessage());
throw throwable;
} finally {
apiLogService.saveAsync(logEntity);
try {
apiLogService.saveAsync(logEntity);
} catch (Exception e) {
log.error("保存API日志失败但不影响主业务", e);
}
if (businessException != null) {
throw businessException;
}
}
return result;
}
private String getIpAddress(HttpServletRequest request) {

View File

@@ -40,65 +40,12 @@ public class SysApiLogController {
private final ISysApiLogHistoryService apiLogHistoryService;
/**
* 分页查询接口日志列表
* 分页查询接口日志列表走XML动态SQL支持动态表名
*/
@GetMapping
@Log("查询接口日志列表")
public ResponseEntity<Map<String, Object>> query(ApiLogQuery query) {
LambdaQueryWrapper<SysApiLog> wrapper = new LambdaQueryWrapper<>();
if (query.getDirection() != null) {
wrapper.eq(SysApiLog::getDirection, query.getDirection());
}
if (query.getSystemFlag() != null && !query.getSystemFlag().isEmpty()) {
wrapper.eq(SysApiLog::getSystemFlag, query.getSystemFlag());
}
if (query.getBizCode() != null && !query.getBizCode().isEmpty()) {
wrapper.eq(SysApiLog::getBizCode, query.getBizCode());
}
if (query.getTraceId() != null && !query.getTraceId().isEmpty()) {
wrapper.eq(SysApiLog::getTraceId, query.getTraceId());
}
if (query.getApiUrl() != null && !query.getApiUrl().isEmpty()) {
wrapper.like(SysApiLog::getApiUrl, query.getApiUrl());
}
if (query.getStatus() != null && !query.getStatus().isEmpty()) {
wrapper.eq(SysApiLog::getStatus, query.getStatus());
}
if (query.getBeginTime() != null && !query.getBeginTime().isEmpty()) {
wrapper.ge(SysApiLog::getCreateTime, query.getBeginTime());
}
if (query.getEndTime() != null && !query.getEndTime().isEmpty()) {
wrapper.le(SysApiLog::getCreateTime, query.getEndTime());
}
if (query.getKeyword() != null && !query.getKeyword().isEmpty()) {
wrapper.and(w -> w.like(SysApiLog::getBizDesc, query.getKeyword())
.or().like(SysApiLog::getApiDesc, query.getKeyword())
.or().like(SysApiLog::getRequestParams, query.getKeyword())
.or().like(SysApiLog::getResponseBody, query.getKeyword()));
}
wrapper.orderByDesc(SysApiLog::getCreateTime);
Page<SysApiLog> page = new Page<>(query.getPage()+1, query.getSize());
IPage<SysApiLog> result = apiLogService.page(page, wrapper);
Map<String, Object> response = new HashMap<>();
response.put("content", result.getRecords());
response.put("totalElements", result.getTotal());
response.put("totalPages", result.getPages());
response.put("size", result.getSize());
response.put("number", result.getCurrent());
return new ResponseEntity<>(response, HttpStatus.OK);
public ResponseEntity<Object> query(ApiLogQuery query) {
return new ResponseEntity<>(apiLogService.queryApiLog(query), HttpStatus.OK);
}
/**

View File

@@ -1,4 +1,5 @@
package org.nl.system.service.sysapi.entity.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import org.nl.common.domain.query.PageQuery;
@@ -24,11 +25,19 @@ public class ApiLogQuery extends PageQuery {
private String status;
private String beginTime;
private String begin_time;
private String endTime;
private String end_time;
private String keyword;
private String requestParams;
private String responseParams;
/**
* 动态表名从前台传入sys_api_log 或 sys_api_log_history
*/
private String tableName;
}

View File

@@ -1,7 +1,12 @@
package org.nl.system.service.sysapi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.nl.system.service.sysapi.entity.SysApiLog;
import org.nl.system.service.sysapi.entity.dto.ApiLogQuery;
import java.util.List;
import java.util.Map;
/**
* @author ManMan.Yang
@@ -13,4 +18,11 @@ import org.nl.system.service.sysapi.entity.SysApiLog;
@Mapper
public interface SysApiLogMapper extends BaseMapper<SysApiLog> {
/**
* 分页查询接口日志(动态表名)
* @param query 查询条件
* @return List<Map>
*/
List<Map> queryApiLog(@Param("query") ApiLogQuery query);
}

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.system.service.sysapi.mapper.SysApiLogMapper">
<select id="queryApiLog" resultType="java.util.Map">
SELECT
t.log_id,
t.direction,
t.system_flag,
t.biz_code,
t.biz_desc,
t.api_url,
t.api_desc,
t.trace_id,
t.request_method,
t.request_ip,
t.request_headers,
t.request_params,
t.response_body,
t.response_status,
t.cost_time,
t.status,
t.error_msg,
t.operator,
t.create_time
FROM
${query.tableName} t
<where>
1 = 1
<if test="query.direction != null">
and t.direction = #{query.direction}
</if>
<if test="query.systemFlag != null and query.systemFlag != ''">
and t.system_flag = #{query.systemFlag}
</if>
<if test="query.bizCode != null and query.bizCode != ''">
and t.biz_code = #{query.bizCode}
</if>
<if test="query.traceId != null and query.traceId != ''">
and t.trace_id = #{query.traceId}
</if>
<if test="query.status != null and query.status != ''">
and t.status = #{query.status}
</if>
<if test="query.begin_time != null and query.begin_time != ''">
and t.create_time <![CDATA[ >= ]]> CONCAT(#{query.begin_time}, ' 00:00:00')
</if>
<if test="query.end_time != null and query.end_time != ''">
and t.create_time <![CDATA[ <= ]]> CONCAT(#{query.end_time}, ' 23:59:59')
</if>
<if test="query.requestParams != null and query.requestParams != ''">
and t.request_params LIKE CONCAT('%', #{query.requestParams}, '%')
</if>
<if test="query.responseParams != null and query.responseParams != ''">
and t.response_body LIKE CONCAT('%', #{query.responseParams}, '%')
</if>
</where>
ORDER BY t.create_time DESC
</select>
</mapper>

View File

@@ -2,9 +2,12 @@ package org.nl.system.service.sysapi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.poi.ss.formula.functions.T;
import org.nl.system.service.sysapi.entity.SysApiLog;
import org.nl.system.service.sysapi.entity.dto.ApiLogQuery;
import org.springframework.http.ResponseEntity;
import org.springframework.scheduling.annotation.Async;
import java.util.Map;
/**
* @author ManMan.Yang
* @version V1.1
@@ -18,4 +21,11 @@ public interface ISysApiLogService extends IService<SysApiLog> {
void saveAsync(SysApiLog apiLog);
ResponseEntity<T> archiveLogs();
/**
* 分页查询接口日志走XML动态SQL
* @param query 查询条件
* @return Object
*/
Object queryApiLog(ApiLogQuery query);
}

View File

@@ -3,13 +3,17 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T;
import org.nl.common.TableDataInfo;
import org.nl.common.utils.IdUtil;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.system.service.sysapi.entity.SysApiLog;
import org.nl.system.service.sysapi.entity.SysApiLogHistory;
import org.nl.system.service.sysapi.entity.dto.ApiLogQuery;
import org.nl.system.service.sysapi.mapper.SysApiLogHistoryMapper;
import org.nl.system.service.sysapi.mapper.SysApiLogMapper;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,6 +24,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
@@ -91,4 +96,18 @@ public class SysApiLogServiceImpl extends ServiceImpl<SysApiLogMapper, SysApiLog
throw new RuntimeException("日志归档失败: " + e.getMessage());
}
}
@Override
public Object queryApiLog(ApiLogQuery query) {
// 默认查主表 sys_api_log
if (StrUtil.isEmpty(query.getTableName())) {
query.setTableName("sys_api_log");
}
// 使用 PageHelper 分页(排序已在 XML 中定义)
Page<Object> page = PageHelper.startPage(query.getPage() + 1, query.getSize());
List<Map> list = this.baseMapper.queryApiLog(query);
TableDataInfo<Map> build = TableDataInfo.build(list);
build.setTotalElements(page.getTotal());
return build;
}
}

View File

@@ -80,7 +80,7 @@ public class StructattrServiceImpl implements StructattrService {
map.put("layer_num", (String) whereJson.get("layer_num"));
map.put("is_used", (String) whereJson.get("is_used"));
map.put("is_have", (String) whereJson.get("is_have"));
map.put("storagevehicle_code",(String) whereJson.get("storagevehicleCode"));
/* // 如果是二期仓库则将层数删除
if (ObjectUtil.isNotEmpty(whereJson.get("stor_id"))) {
if ( whereJson.get("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {

View File

@@ -78,6 +78,9 @@
OPTION 输入.layer_num <> ""
struct.layer_num = 输入.layer_num
ENDOPTION
OPTION 输入.storagevehicle_code <> ""
struct.storagevehicle_code = 输入.storagevehicle_code
ENDOPTION
OPTION 输入.is_used <> ""
struct.is_used = 输入.is_used
ENDOPTION

View File

@@ -23,7 +23,6 @@ public class CrmToLmsController {
private final CrmToLmsService crmToLmsService;
@PostMapping("/getCustomerInfo")
// @Log("CRM给LMS推送客户信息")
@ApiLog(
bizCode = "/crm/getCustomerInfo",
bizDesc = "CRM给LMS推送客户信息",
@@ -35,7 +34,6 @@ public class CrmToLmsController {
}
@PostMapping("/getCPIvtInfo")
// @Log("CRM获取LMS成品库存信息")
@ApiLog(
bizCode = "/crm/getCPIvtInfo",
bizDesc = "CRM获取LMS成品库存信息",

View File

@@ -250,7 +250,9 @@ public class MdmToLmsServiceImpl implements MdmToLmsService {
if (ObjectUtil.isEmpty(material_jo)) {
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("unit_code = '" + meins + "' and is_delete ='0'").uniqueResult(0);
if (ObjectUtil.isEmpty(unit)) {
throw new BadRequestException("MDM->未查询到相关计量单位,请进行维护!");
commonResponseDto.setStatus("E");
commonResponseDto.setMessage("MDM->未查询到相关计量单位,请进行维护!");
return commonResponseDto;
}
material_jo = new JSONObject();
material_jo.put("material_id", mdId);
@@ -268,7 +270,9 @@ public class MdmToLmsServiceImpl implements MdmToLmsService {
} else {
JSONObject unit = WQLObject.getWQLObject("md_pb_measureunit").query("unit_code = '" + meins + "' and is_delete ='0'").uniqueResult(0);
if (ObjectUtil.isEmpty(unit)) {
throw new BadRequestException("MDM->未查询到相关计量单位,请进行维护!");
commonResponseDto.setStatus("E");
commonResponseDto.setMessage("MDM->未查询到相关计量单位,请进行维护!");
return commonResponseDto;
}
material_jo.put("material_name", mdDescription);
material_jo.put("base_unit_id", unit.getString("measure_unit_id"));

View File

@@ -114,7 +114,6 @@ public class LmsToMesController {
@PostMapping("/ChildScrapUpdate")
@Log("成品日报推送")
public ResponseEntity<Object> ChildScrapUpdate(@RequestBody JSONObject jo) {
return new ResponseEntity<>(lmsToMesService.ChildScrapUpdate(jo), HttpStatus.OK);
}

View File

@@ -24,7 +24,6 @@ public class MesToLmsController {
private final MesToLmsService mesToLmsService;
@PostMapping("/momRollFoilStart")
// @Log("母卷批次创建信息发送智能物流MES生箔工序Move In")
@SaIgnore
@ApiLog(
bizCode = "/mes/momRollFoilStart",
@@ -36,7 +35,6 @@ public class MesToLmsController {
}
@PostMapping("momRollFoilWeighing")
// @Log("MES获取AGV称重信息")
@SaIgnore
@ApiLog(
bizCode = "/mes/momRollFoilWeighing",
@@ -48,7 +46,6 @@ public class MesToLmsController {
}
@PostMapping("/momRollFoilComplete")
// @Log("MES执行下卷动作告诉LMS")
@SaIgnore
@ApiLog(
bizCode = "/mes/momRollFoilComplete",
@@ -60,7 +57,6 @@ public class MesToLmsController {
}
@PostMapping("/momRollBakeNextSpecTransfer")
// @Log("MES下达烘箱温度和时间配方给智能物流(MES 包装防护工序Move Out)")
@SaIgnore
@ApiLog(
bizCode = "/mes/momRollBakeNextSpecTransfer",
@@ -72,7 +68,6 @@ public class MesToLmsController {
}
@PostMapping("/cutPlanTransfer")
// @Log("分切包装段:分切计划(单表,包含母卷/改制子卷-包装箱号、空包装箱物料、纸筒/FRP管MES下发智能物流")
@SaIgnore
@ApiLog(
bizCode = "/mes/cutPlanTransfer",
@@ -84,7 +79,6 @@ public class MesToLmsController {
}
@PostMapping("/callNextAssAndMomRoll")
// @Log("分切即将完成,呼叫配送下一个母卷/改制子卷MES传智能物流")
@SaIgnore
@ApiLog(
bizCode = "/mes/callNextAssAndMomRoll",
@@ -96,7 +90,6 @@ public class MesToLmsController {
}
@PostMapping("/childRollCutStartComp")
// @Log("当母卷开始分切时MES系统会将对应的子卷进站信息发送给只能物流系统一方面物流系统可以预估下个母卷的送达时间也可以闭环期分切计划指令")
@SaIgnore
@ApiLog(
bizCode = "/mes/childRollCutStartComp",
@@ -108,7 +101,6 @@ public class MesToLmsController {
}
@PostMapping("/childRollPackComplete")
// @Log("包装完成传智能物流包装箱与子卷关系及子卷属性值LMS执行入库")
@SaIgnore
@ApiLog(
bizCode = "/mes/childRollPackComplete",
@@ -120,7 +112,6 @@ public class MesToLmsController {
}
@PostMapping("/inventoryTransferInfoSync")
// @Log("转单指令在MES平台查看后更新信息发送LMS是否拆包、更新后的入库日期、是否更换外包装箱标签,LMS重打子卷标签、包装箱外标签")
@SaIgnore
@ApiLog(
bizCode = "/mes/inventoryTransferInfoSync",
@@ -132,7 +123,6 @@ public class MesToLmsController {
}
@PostMapping("/childRollInfoUpdate")
// @Log("子卷信息更新:计划外需求有可能入库完成后ERP才回传计划外需求SalesOrder")
@SaIgnore
@ApiLog(
bizCode = "/mes/childRollInfoUpdate",
@@ -144,7 +134,6 @@ public class MesToLmsController {
}
@PostMapping("/cutPlanTransferCancel")
// @Log("分切计划取消")
@SaIgnore
@ApiLog(
bizCode = "/mes/cutPlanTransferCancel",
@@ -156,7 +145,6 @@ public class MesToLmsController {
}
@PostMapping("/sendAuditResult")
// @Log("子卷报废审批结果回传")
@SaIgnore
@ApiLog(
bizCode = "/mes/sendAuditResult",
@@ -168,7 +156,6 @@ public class MesToLmsController {
}
@PostMapping("/sendProcessInfo")
// @Log("表处母卷上料、下料接口")
@SaIgnore
@ApiLog(
bizCode = "/mes/sendProcessInfo",
@@ -180,7 +167,6 @@ public class MesToLmsController {
}
@PostMapping("/momRollTRStartMock")
// @Log("表处工单推送")
@SaIgnore
@ApiLog(
bizCode = "/mes/momRollTRStartMock",
@@ -193,7 +179,6 @@ public class MesToLmsController {
@PostMapping("/sendTargetHouse")
// @Log("MES传递给LMS入线边库或者入成品库")
@SaIgnore
@ApiLog(
bizCode = "/mes/sendTargetHouse",
@@ -205,7 +190,6 @@ public class MesToLmsController {
}
@PostMapping("/momSendSplitMfgOrderBOM")
// @Log("MES传递LMS订单BOM")
@SaIgnore
@ApiLog(
bizCode = "/mes/momSendSplitMfgOrderBOM",
@@ -217,7 +201,6 @@ public class MesToLmsController {
}
@PostMapping("/getRollInfo")
// @Log("MES传递LMS获取子卷重量信息")
@SaIgnore
@ApiLog(
bizCode = "/mes/getRollInfo",
@@ -229,7 +212,6 @@ public class MesToLmsController {
}
@PostMapping("/sendLevelInfo")
// @Log("MES传递LMS定级数据")
@SaIgnore
@ApiLog(
bizCode = "/mes/sendLevelInfo",
@@ -241,7 +223,6 @@ public class MesToLmsController {
}
@PostMapping("/containerNeedDown")
// @Log("子卷拼接完成是否下轴")
@SaIgnore
@ApiLog(
bizCode = "/mes/containerNeedDown",
@@ -253,7 +234,6 @@ public class MesToLmsController {
}
@PostMapping("/sendSubInfo")
// @Log("子卷下料信息MES传递给LMS")
@SaIgnore
@ApiLog(
bizCode = "/mes/sendSubInfo",
@@ -265,7 +245,6 @@ public class MesToLmsController {
}
@PostMapping("/changeSect")
// @Log("MES传递给LMS入线边库或者入成品库、撤销入线边库、人工改变入线边还是包装")
@SaIgnore
@ApiLog(
bizCode = "/mes/changeSect",
@@ -277,7 +256,6 @@ public class MesToLmsController {
}
@PostMapping("/getWasteFoilWeight")
// @Log("分切子卷获取LMSAGV废箔称重重量")
@SaIgnore
@ApiLog(
bizCode = "/mes/getWasteFoilWeight",
@@ -289,7 +267,6 @@ public class MesToLmsController {
}
@PostMapping("/WasteFoilSuccess")
// @Log("分切子卷获取LMSAGV废箔称重重量")
@SaIgnore
@ApiLog(
bizCode = "/mes/WasteFoilSuccess",
@@ -301,7 +278,6 @@ public class MesToLmsController {
}
@PostMapping("/boxIsPass")
// @Log("飞书通知LMS木箱是否通过")
@SaIgnore
@ApiLog(
bizCode = "/mes/boxIsPass",
@@ -313,7 +289,6 @@ public class MesToLmsController {
}
@PostMapping("/changeBomInfo")
// @Log("MES更新LMS分切工单、订单BOM信息")
@SaIgnore
@ApiLog(
bizCode = "/mes/changeBomInfo",

View File

@@ -63,7 +63,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
@Override
public JSONObject momRollFoilWeighing(JSONObject param) {
log.info("momRollFoilWeighing接口输入参数为-------------------" + param);
long startTime = System.currentTimeMillis();
JSONObject result = new JSONObject();
if (StrUtil.equals("0", is_connect_mes)) {
result.put("status", HttpStatus.OK.value());
@@ -71,7 +71,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
@@ -97,13 +97,13 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/sap/center/lms/004", "LMS的PDA操作AGV下卷AGV称重完成后AGV称重信息发送MES",
OutboundApiLogger.logFail("mes", "/CamstarApi/momRollFoilWeighing", "LMS的PDA操作AGV下卷AGV称重完成后AGV称重信息发送MES",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("sap", "/sap/center/lms/004", "LMS的PDA操作AGV下卷AGV称重完成后AGV称重信息发送MES",
OutboundApiLogger.logSuccess("mes", "/CamstarApi/momRollFoilWeighing", "LMS的PDA操作AGV下卷AGV称重完成后AGV称重信息发送MES",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
@@ -211,7 +211,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
String UserName = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_USERNAME").getValue();
String Password = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_PASSWORD").getValue();
@@ -255,7 +254,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
@Override
public JSONObject momRollSemiFGInboundComplete(JSONObject param) {
log.info("momRollSemiFGInboundComplete接口输入参数为-------------------" + param.toString());
JSONObject result = new JSONObject();
if (StrUtil.equals("0", is_connect_mes)) {
result.put("status", HttpStatus.OK.value());
@@ -263,7 +261,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
JSONArray list = new JSONArray();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
@@ -285,8 +283,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/MomRollSemiFGInboundComplete", "AGV将母卷从烘箱暂存位转移至暂存区传MES",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
log.info("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/MomRollSemiFGInboundComplete", "AGV将母卷从烘箱暂存位转移至暂存区传MES",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -299,7 +305,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
@Override
public JSONObject airSwellWithPaperTubeAssComplete(JSONObject param) {
log.info("airSwellWithPaperTubeAssComplete接口输入参数为-------------------" + param.toString());
String container_name = param.getString("container_name");
if (StrUtil.isEmpty(container_name)) {
throw new BadRequestException("子卷号不能为空!");
@@ -312,7 +317,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
JSONObject jo = new JSONObject();
jo.put("iContainerName", container_name);
jo.put("iisAirSwellAssComplete", 1);
@@ -339,8 +344,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/AirSwellWithPaperTubeAssComplete", "套轴任务完成上架暂存区智能物流PDA选任务、扫轴、扫料架货位传MES套轴任务完成信息",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
log.info("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/AirSwellWithPaperTubeAssComplete", "套轴任务完成上架暂存区智能物流PDA选任务、扫轴、扫料架货位传MES套轴任务完成信息",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -353,7 +366,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
@Override
public JSONObject cutPlanMomRollDeliveryComplete(JSONObject param) {
log.info("cutPlanMomRollDeliveryComplete接口输入参数为-------------------" + param.toString());
JSONObject result = new JSONObject();
if (StrUtil.equals("0", is_connect_mes)) {
result.put("status", HttpStatus.OK.value());
@@ -361,6 +373,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
String container_name = param.getString("container_name");
String package_box_sn = param.getString("package_box_sn");
@@ -399,8 +412,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/CutPlanMomRollDeliveryComplete", "LMS提前做/MES呼叫后做立库子卷出库完成/母卷配送至分切机暂存位AGV传MES 母卷配送完成信息/立库子卷出库完成信息",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/CutPlanMomRollDeliveryComplete", "LMS提前做/MES呼叫后做立库子卷出库完成/母卷配送至分切机暂存位AGV传MES 母卷配送完成信息/立库子卷出库完成信息",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -413,12 +434,10 @@ public class LmsToMesServiceImpl implements LmsToMesService {
@Override
public JSONObject airSwellWithPaperTubeAssArrival(JSONObject param) {
log.info("airSwellWithPaperTubeAssArrival接口输入参数为-------------------" + param.toString());
String container_name = param.getString("container_name");
if (StrUtil.isEmpty(container_name)) {
throw new BadRequestException("子卷号不能为空!");
}
JSONObject result = new JSONObject();
if (StrUtil.equals("0", is_connect_mes)) {
result.put("status", HttpStatus.OK.value());
@@ -426,6 +445,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
JSONObject jo = new JSONObject();
jo.put("iContainerName", container_name);
@@ -450,8 +470,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/AirSwellWithPaperTubeAssArrival", "提前将/按呼叫指令配送扫码校验配送先后顺序气涨轴套装运输到分切机智能物流传MES 到位信息",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
log.info("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/AirSwellWithPaperTubeAssArrival", "提前将/按呼叫指令配送扫码校验配送先后顺序气涨轴套装运输到分切机智能物流传MES 到位信息",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -464,7 +492,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
@Override
public JSONObject childRollFGInboundComplete(JSONObject param) {
log.info("childRollFGInboundComplete接口输入参数为-------------------" + param.toString());
String PackageBoxSN = param.getString("PackageBoxSN");
String User = param.getString("User");
JSONObject result = new JSONObject();
@@ -529,8 +556,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
@Override
public JSONObject childRollFGOutboundComplete(JSONObject param) {
log.info("childRollFGOutboundComplete接口输入参数为-------------------" + param.toString());
JSONObject result = new JSONObject();
if (StrUtil.equals("0", is_connect_mes)) {
result.put("status", HttpStatus.OK.value());
@@ -694,7 +719,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
String api = "/FeiShuNoticesWebApi/CreateApproval";
url = url + api;
@@ -715,8 +740,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("feishu", "/FeiShuNoticesWebApi/CreateApproval", "触发飞书报废审核流程",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("飞书提示错误:" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("feishu", "/FeiShuNoticesWebApi/CreateApproval", "触发飞书报废审核流程",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -731,7 +764,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
String api = "/FeiShuNoticesWebApi/SendCard";
url = url + api;
@@ -768,7 +801,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
String api = "CamstarApi/ChildScrapUpdate";
url = url + api;
@@ -794,8 +827,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/ChildScrapUpdate", "报废出库回传mes箱号、子卷号",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/ChildScrapUpdate", "报废出库回传mes箱号、子卷号",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -809,7 +850,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
String api = "/FeiShuNoticesWebApi/UploadImage";
url = url + api + "?fileName=" + file_name;
@@ -846,7 +887,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
result.put("data", new JSONObject());
return result;
}
long startTime = System.currentTimeMillis();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("FEISHU_URL").getValue();
String api = "/FeiShuNoticesWebApi/SendCard";
url = url + api;
@@ -893,7 +934,6 @@ public class LmsToMesServiceImpl implements LmsToMesService {
JSONObject result = new JSONObject();
log.info("momAutoTransterMoveIn接口输入参数为-------------------" + param.toString());
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
String api = "CamstarApi/momAutoTransterMoveIn";
url = url + api;
@@ -936,7 +976,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
}
JSONObject result = new JSONObject();
long startTime = System.currentTimeMillis();
log.info("momGetPackingInfo接口输入参数为-------------------" + param.toString());
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
@@ -967,8 +1007,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/momGetPackingInfo", "根据木箱号母卷获取包装信息",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/momGetPackingInfo", "根据木箱号母卷获取包装信息",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -998,7 +1046,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
if (ObjectUtil.isEmpty(rows)) {
throw new BadRequestException("箱内子卷信息不能为空!");
}
long startTime = System.currentTimeMillis();
JSONObject result = new JSONObject();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL2").getValue();
@@ -1043,8 +1091,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_MES, param, Boolean.TRUE, null, list);
} catch (Exception e) {
PdmProductSpecServiceImpl.doRecord(SpecEnum.BZ_MES, param, Boolean.FALSE, e.getMessage(), list);
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/momBoxPackageSubmit", "包装回传",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/momBoxPackageSubmit", "包装回传",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -1067,7 +1123,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
}
JSONObject result = new JSONObject();
long startTime = System.currentTimeMillis();
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL2").getValue();
String api = "CamstarApi/BoxDataCollectionSubmit2";
url = url + api;
@@ -1160,9 +1216,17 @@ public class LmsToMesServiceImpl implements LmsToMesService {
}
} catch (Exception e) {
PdmProductSpecServiceImpl.doRecord(SpecEnum.YX_MES, param, Boolean.FALSE, e.getMessage(), containerName);
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/BoxDataCollectionSubmit2", "mes验箱",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("MES错误" + e.getMessage());
}
PdmProductSpecServiceImpl.doRecord(SpecEnum.YX_MES, param, Boolean.TRUE, null, containerName);
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/BoxDataCollectionSubmit2", "mes验箱",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -1178,7 +1242,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
}
JSONObject result = new JSONObject();
long startTime = System.currentTimeMillis();
String isConnect2 = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("IS_CONNECT_MES2").getValue();
if ("0".equals(isConnect2)) {
return result;
@@ -1321,8 +1385,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
log.info("getInspectionResult接口输出参数为-------------------" + result.toString());
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/GetInspectionResult", "/CamstarApi/GetInspectionResult",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/GetInspectionResult", "/CamstarApi/GetInspectionResult",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}
@@ -1335,7 +1407,7 @@ public class LmsToMesServiceImpl implements LmsToMesService {
}
JSONObject result = new JSONObject();
long startTime = System.currentTimeMillis();
log.info("GetChildWeightIsSamplePDA接口输入参数为-------------------" + param.toString());
String url = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MES_URL").getValue();
@@ -1380,8 +1452,16 @@ public class LmsToMesServiceImpl implements LmsToMesService {
} catch (Exception e) {
// 记录失败日志
OutboundApiLogger.logFail("mes", "/CamstarApi/GetChildWeightIsSamplePDA", "/CamstarApi/GetChildWeightIsSamplePDA",
url, "POST", JSONUtil.toJsonStr(param), e.getMessage(),
System.currentTimeMillis() - startTime);
throw new BadRequestException("MES提示错误" + e.getMessage());
}
// 记录成功日志
OutboundApiLogger.logSuccess("mes", "/CamstarApi/GetChildWeightIsSamplePDA", "/CamstarApi/GetChildWeightIsSamplePDA",
url, "POST", JSONUtil.toJsonStr(param), result.toString(), 200,
System.currentTimeMillis() - startTime);
return result;
}

View File

@@ -729,6 +729,7 @@ public class MesToLmsServiceImpl implements MesToLmsService {
result.put("RTMSG", "操作失败!" + e.getMessage());
result.put("RTOAL", 0);
result.put("RTDAT", null);
return result;
}
result.put("RTYPE", "S");
result.put("RTMSG", "操作成功!");

View File

@@ -589,6 +589,9 @@ public class SapToLmsServiceImpl implements SapToLmsService {
case "ZLR2":
billType = "0014";
break;
case "ZJS":
billType = "1011";
break;
default:
if(code.contains("ZLR")){
billType = "0002";

View File

@@ -31,7 +31,6 @@ public class LmsToBigScreenController {
@PostMapping("/getStructInfo")
@Log("数字孪生请求LMS获取设备信息")
@SaIgnore
public ResponseEntity<Object> getStructInfo(@RequestBody JSONObject jo) {
return new ResponseEntity<>(LmsToBigScreenService.getStructInfo(jo), HttpStatus.OK);
@@ -39,7 +38,6 @@ public class LmsToBigScreenController {
@PostMapping("/getMonthFreight")
@Log("当月发货运费信息")
@SaIgnore
public ResponseEntity<Object> getMonthFreight(@RequestBody JSONObject jo) {
return new ResponseEntity<>(LmsToBigScreenService.getMonthFreight(jo), HttpStatus.OK);
@@ -47,7 +45,6 @@ public class LmsToBigScreenController {
@PostMapping("/getMonthYield")
@Log("当月产量信息")
@SaIgnore
public ResponseEntity<Object> getMonthYield(@RequestBody JSONObject jo) {
return new ResponseEntity<>(LmsToBigScreenService.getMonthYield(jo), HttpStatus.OK);
@@ -55,7 +52,6 @@ public class LmsToBigScreenController {
@PostMapping("/getMonthDelivery")
@Log("当月发货信息")
@SaIgnore
public ResponseEntity<Object> getMonthDelivery(@RequestBody JSONObject jo) {
return new ResponseEntity<>(LmsToBigScreenService.getMonthDelivery(jo), HttpStatus.OK);
@@ -63,7 +59,6 @@ public class LmsToBigScreenController {
@PostMapping("/getProudDayData")
@Log("成品日报")
@SaIgnore
public ResponseEntity<Object> getProudDayData(@RequestBody JSONObject jo) {
return new ResponseEntity<>(LmsToBigScreenService.getProudDayData(jo), HttpStatus.OK);

View File

@@ -444,6 +444,8 @@ public class InBillQueryServiceImpl implements InBillQueryService {
for (int i = 0; i < resultJSONArray.size(); i++) {
JSONObject json = resultJSONArray.getJSONObject(i);
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("仓库", json.getString("stor_name"));
mp.put("库区", json.getString("sect_name"));
mp.put("日期", (json.getString("confirm_time_class").substring(0, 10)).replace("-", "/"));
mp.put("班次", json.getString("classes"));
if (ObjectUtil.isEmpty(json.getString("sale_order_name"))) {
@@ -522,6 +524,8 @@ public class InBillQueryServiceImpl implements InBillQueryService {
for (int i = 0; i < resultJSONArray.size(); i++) {
JSONObject json = resultJSONArray.getJSONObject(i);
Map<String, Object> mp = new LinkedHashMap<>();
mp.put("仓库", json.getString("stor_name"));
mp.put("库区", json.getString("sect_name"));
mp.put("序号", String.valueOf(i + 1));
mp.put("日期", (json.getString("confirm_time_class").substring(0, 10)).replace("-", "/"));
mp.put("班次", json.getString("classes"));

View File

@@ -359,13 +359,13 @@ public class OutBillQueryServiceImpl implements OutBillQueryService {
.orElse(null);
mp.put("仓库", json.getString("stor_name"));
if (ObjectUtil.isNotEmpty(bill_type) && "1004".equals(bill_type)) {
mp.put("移入仓库", json.getString("in_stor_name"));
}
mp.put("库区", json.getString("sect_name"));
mp.put("生产区域", json.getString("pcsn").substring(0, 2));
String bill_type1 = json.getString("bill_type");
if(ObjectUtil.isNotEmpty(bill_type1) && "1004".equalsIgnoreCase(bill_type1)){
mp.put("收货地址(目的仓库)", json.getString("in_stor_name"));
}else{
mp.put("收货地址(目的仓库)", json.getString("receiptaddress"));
}
String bill_name = "";
switch (bill_type1) {
case "1001" :

View File

@@ -286,7 +286,8 @@
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS paper_type,
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then plan.FRP_material end AS paper_code,
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then plan.FRP_description end AS paper_name,
stor.stor_name AS in_stor_name
stor.stor_name AS in_stor_name,
mst.receiptaddress
FROM
(
SELECT
@@ -413,7 +414,8 @@
case when plan.paper_tube_or_FRP = '1' then '纸管' when plan.paper_tube_or_FRP = '2' then 'FRP管' end AS paper_type,
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_material when plan.paper_tube_or_FRP = '2' then plan.FRP_material end AS paper_code,
case when plan.paper_tube_or_FRP = '1' then plan.paper_tube_description when plan.paper_tube_or_FRP = '2' then plan.FRP_description end AS paper_name,
stor.stor_name AS in_stor_name
stor.stor_name AS in_stor_name,
mst.receiptaddress
FROM
(
SELECT

View File

@@ -1,6 +1,6 @@
import request from '@/utils/request'
export function getBizCodeList(systemFlag,direction) {
export function getBizCodeList(systemFlag, direction) {
return request({
url: 'api/sysApiLog/bizCodeList',
method: 'get',

View File

@@ -6,31 +6,31 @@
:inline="true"
class="demo-form-inline"
label-position="right"
label-width="90px"
label-width="120px"
label-suffix=":"
>
<el-form-item label="关键字">
<el-input
v-model="query.keyword"
clearable
<el-form-item label="查询日志表">
<el-select
v-model="query.tableName"
size="mini"
placeholder="请输入关键字查询"
class="filter-item"
style="width: 200px;"
@keyup.enter.native="crud.toQuery"
/>
@change="handleTableNameChange"
>
<el-option label="sys_api_log" value="sys_api_log" />
<el-option label="sys_api_log_history" value="sys_api_log_history" />
</el-select>
</el-form-item>
<el-form-item label="接口走向">
<el-form-item label="接口走向类型">
<el-select
v-model="query.direction"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
@change="crud.toQuery"
@change="directionChanged"
>
<el-option label="出站" :value="0" />
<el-option label="入站" :value="1" />
<el-option label="LMS请求外部系统" :value="0" />
<el-option label="外部系统请求LMS" :value="1" />
</el-select>
</el-form-item>
<el-form-item label="系统标识">
@@ -52,11 +52,9 @@
<el-select
v-model="query.bizCode"
clearable
filterable
size="mini"
placeholder="请选择"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in bizCodeList"
@@ -73,7 +71,6 @@
size="mini"
placeholder="请选择"
class="filter-item"
@change="crud.toQuery"
>
<el-option label="SUCCESS" value="SUCCESS" />
<el-option label="FAIL" value="FAIL" />
@@ -83,11 +80,30 @@
<el-date-picker
v-model="query.createTime"
type="daterange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="['00:00:00', '23:59:59']"
@change="crud.toQuery"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="请求报文">
<el-input
v-model="query.requestParams"
clearable
size="mini"
placeholder="请输入请求报文关键字查询"
class="filter-item"
style="width: 200px;"
/>
</el-form-item>
<el-form-item label="响应报文">
<el-input
v-model="query.responseParams"
clearable
size="mini"
placeholder="请输入响应报文关键字查询"
class="filter-item"
style="width: 200px;"
/>
</el-form-item>
<rrOperation />
@@ -99,7 +115,6 @@
class="filter-item"
type="primary"
icon="el-icon-folder-checked"
:loading="archiveLoading"
@click="handleArchive"
>
日志归档
@@ -122,29 +137,31 @@
<el-tag v-else-if="scope.row.direction === 1" type="primary"><i class="el-icon-download"></i>入站</el-tag>
</template>
</el-table-column>
<el-table-column prop="systemFlag" label="系统标识" width="100" />
<el-table-column prop="bizCode" label="业务类型" width="260" />
<el-table-column prop="bizDesc" label="业务描述" show-overflow-tooltip width="500" />
<el-table-column prop="system_flag" label="系统标识" width="100" />
<el-table-column prop="biz_code" label="业务类型" width="260" />
<el-table-column prop="biz_desc" label="业务描述" show-overflow-tooltip width="500" />
<el-table-column prop="request_method" label="请求协议" show-overflow-tooltip min-width="200" />
<el-table-column prop="status" label="状态" width="100">
<template slot-scope="scope">
<el-tag v-if="scope.row.status === 'SUCCESS'" type="success">请求成功</el-tag>
<el-tag v-else-if="scope.row.status === 'FAIL'" type="danger">请求失败</el-tag>
</template>
</el-table-column>
<el-table-column prop="costTime" label="耗时(ms)" width="100" align="center">
<el-table-column prop="cost_time" label="耗时(ms)" width="100" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.costTime <= 300" type="success">{{ scope.row.costTime }}ms</el-tag>
<el-tag v-else-if="scope.row.costTime <= 1000" type="warning">{{ scope.row.costTime }}ms</el-tag>
<el-tag v-else type="danger">{{ scope.row.costTime }}ms</el-tag>
<el-tag v-if="scope.row.cost_time <= 300" type="success">{{ scope.row.cost_time }}ms</el-tag>
<el-tag v-else-if="scope.row.cost_time <= 1000" type="warning">{{ scope.row.cost_time }}ms</el-tag>
<el-tag v-else type="danger">{{ scope.row.cost_time }}ms</el-tag>
</template>
</el-table-column>
<el-table-column prop="createTime" label="请求时间" width="180">
<el-table-column prop="create_time" label="请求时间" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
<span>{{ parseTime(scope.row.create_time) }}</span>
</template>
</el-table-column>
<el-table-column prop="requestParams" label="请求参数" show-overflow-tooltip min-width="200" />
<el-table-column prop="responseBody" label="响应结果" show-overflow-tooltip min-width="200" />
<el-table-column prop="request_params" label="请求报文" show-overflow-tooltip min-width="200" />
<el-table-column prop="response_body" label="响应报文" show-overflow-tooltip min-width="200" />
<el-table-column label="详情" width="100" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="primary" plain @click="showDetail(scope.row)">查看详情</el-button>
@@ -164,40 +181,57 @@
>
<div class="drawer-content">
<el-descriptions :column="2" border size="small">
<el-descriptions-item label="日志ID">{{ currentRow.logId }}</el-descriptions-item>
<el-descriptions-item label="链路追踪ID">{{ currentRow.traceId }}</el-descriptions-item>
<el-descriptions-item label="日志ID">{{ currentRow.log_id }}</el-descriptions-item>
<el-descriptions-item label="接口走向">
<el-tag v-if="currentRow.direction === 0" type="success" size="small"><i class="el-icon-upload2"></i>出站</el-tag>
<el-tag v-else-if="currentRow.direction === 1" type="primary" size="small"><i class="el-icon-download"></i>入站</el-tag>
</el-descriptions-item>
<el-descriptions-item label="系统标识">{{ currentRow.systemFlag }}</el-descriptions-item>
<el-descriptions-item label="业务类型">{{ currentRow.bizCode }}</el-descriptions-item>
<el-descriptions-item label="业务描述">{{ currentRow.bizDesc }}</el-descriptions-item>
<el-descriptions-item label="接口地址" :span="2">{{ currentRow.apiUrl }}</el-descriptions-item>
<el-descriptions-item label="请求方法">{{ currentRow.requestMethod }}</el-descriptions-item>
<el-descriptions-item label="请求IP">{{ currentRow.requestIp }}</el-descriptions-item>
<el-descriptions-item label="系统标识">{{ currentRow.system_flag }}</el-descriptions-item>
<el-descriptions-item label="业务类型">{{ currentRow.biz_code }}</el-descriptions-item>
<el-descriptions-item label="业务描述">{{ currentRow.biz_desc }}</el-descriptions-item>
<el-descriptions-item label="接口地址" :span="2">{{ currentRow.api_url }}</el-descriptions-item>
<el-descriptions-item label="请求方法">{{ currentRow.request_method }}</el-descriptions-item>
<el-descriptions-item label="请求IP">{{ currentRow.request_ip }}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag v-if="currentRow.status === 'SUCCESS'" type="success" size="small">SUCCESS</el-tag>
<el-tag v-else-if="currentRow.status === 'FAIL'" type="danger" size="small">FAIL</el-tag>
</el-descriptions-item>
<el-descriptions-item label="响应状态码">{{ currentRow.responseStatus }}</el-descriptions-item>
<el-descriptions-item label="耗时">{{ currentRow.costTime }}ms</el-descriptions-item>
<el-descriptions-item label="请求时间">{{ parseTime(currentRow.createTime) }}</el-descriptions-item>
<el-descriptions-item label="错误信息" :span="2" v-if="currentRow.errorMsg">
<span style="color: #f56c6c;">{{ currentRow.errorMsg }}</span>
<el-descriptions-item label="响应状态码">{{ currentRow.response_status }}</el-descriptions-item>
<el-descriptions-item label="耗时">{{ currentRow.cost_time }}ms</el-descriptions-item>
<el-descriptions-item label="请求时间">{{ parseTime(currentRow.create_time) }}</el-descriptions-item>
<el-descriptions-item label="错误信息" :span="2" v-if="currentRow.error_msg">
<span style="color: #f56c6c;">{{ currentRow.error_msg }}</span>
</el-descriptions-item>
</el-descriptions>
<el-divider content-position="left">请求头</el-divider>
<pre class="json-content">{{ formatJson(currentRow.requestHeaders) }}</pre>
<div class="json-wrapper">
<el-button class="copy-btn" type="text" icon="el-icon-document-copy" @click="copyJson(currentRow.request_headers)">复制</el-button>
<pre class="json-content">{{ formatJson(currentRow.request_headers) }}</pre>
</div>
<el-divider content-position="left">请求参数</el-divider>
<pre class="json-content">{{ formatJson(currentRow.requestParams) }}</pre>
<el-divider content-position="left">请求报文</el-divider>
<div class="json-wrapper">
<el-button class="copy-btn" type="text" icon="el-icon-document-copy" @click="copyJson(currentRow.request_params)">复制</el-button>
<pre class="json-content">{{ formatJson(currentRow.request_params) }}</pre>
</div>
<el-divider content-position="left">响应结果</el-divider>
<pre class="json-content">{{ formatJson(currentRow.responseBody) }}</pre>
<el-divider content-position="left">响应报文</el-divider>
<div class="json-wrapper">
<el-button class="copy-btn" type="text" icon="el-icon-document-copy" @click="copyJson(currentRow.response_body)">复制</el-button>
<pre class="json-content">{{ formatJson(currentRow.response_body) }}</pre>
</div>
</div>
</el-drawer>
<!-- 归档全局遮罩 -->
<div v-if="archiveLoading" class="archive-overlay">
<div class="archive-overlay__box">
<p>日志归档中请稍候...</p>
<div class="archive-overlay__bar">
<div class="archive-overlay__bar-inner"></div>
</div>
</div>
</div>
</div>
</template>
@@ -212,11 +246,22 @@ export default {
name: 'SysApiLog',
components: { rrOperation, crudOperation, pagination },
cruds() {
const today = new Date()
const year = today.getFullYear()
const month = String(today.getMonth() + 1).padStart(2, '0')
const day = String(today.getDate()).padStart(2, '0')
const dateStr = `${year}-${month}-${day}`
return CRUD({
title: '接口日志',
url: 'api/sysApiLog',
query: {
createTime: [new Date(), new Date()]
createTime: [dateStr, dateStr],
tableName: 'sys_api_log',
direction: null,
systemFlag: null,
bizCode: null, // 关键提前声明Vue.observable 才能追踪
status: null,
keyword: null
}
})
},
@@ -238,15 +283,20 @@ export default {
}
},
methods: {
handleSystemFlagChange() {
this.query.bizCode = undefined
handleTableNameChange(){
this.query.direction = null;
this.query.systemFlag = null
this.query.bizCode = null
this.bizCodeList = []
if (this.query.systemFlag) {
},
handleSystemFlagChange() {
this.query.bizCode = null
this.bizCodeList = []
if (this.query.systemFlag != null && this.query.systemFlag !== '' && this.query.direction != null && this.query.direction !== '') {
apiLog.getBizCodeList(this.query.systemFlag, this.query.direction).then(res => {
this.bizCodeList = res
})
}
this.crud.toQuery()
},
showDetail(row) {
this.currentRow = row
@@ -256,6 +306,11 @@ export default {
this.drawerVisible = false
this.currentRow = {}
},
directionChanged() {
this.query.systemFlag = null
this.query.bizCode = null
this.bizCodeList = []
},
formatJson(json) {
if (!json) return ''
try {
@@ -264,6 +319,30 @@ export default {
return json
}
},
copyJson(raw) {
if (!raw) {
this.$message.warning('暂无内容可复制')
return
}
let text = raw
try {
text = JSON.stringify(JSON.parse(raw), null, 2)
} catch (e) {
// 非 JSON 格式,直接使用原始文本
}
navigator.clipboard.writeText(text).then(() => {
this.$message.success('已复制到剪贴板')
}).catch(() => {
// 降级方案
const textarea = document.createElement('textarea')
textarea.value = text
document.body.appendChild(textarea)
textarea.select()
document.execCommand('copy')
document.body.removeChild(textarea)
this.$message.success('已复制到剪贴板')
})
},
handleArchive() {
this.$confirm('确认将历史接口日志数据进行归档备份吗?此操作可能需要较长时间。', '提示', {
confirmButtonText: '确定',
@@ -328,6 +407,24 @@ export default {
margin: 10px 0;
}
.json-wrapper {
position: relative;
}
.copy-btn {
position: absolute;
top: 10px;
right: 10px;
z-index: 10;
color: #409eff;
font-size: 12px;
padding: 4px 8px;
}
.copy-btn:hover {
color: #66b1ff;
}
::v-deep .el-drawer__header {
margin-bottom: 10px;
padding: 15px 20px;
@@ -344,15 +441,56 @@ export default {
.biz-code-item .el-select {
width: 100%;
}
::v-deep .el-drawer__body {
padding: 0;
}
.biz-code-item {
min-width: 350px;
.archive-overlay {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.45);
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
}
.biz-code-item .el-select {
.archive-overlay__box {
text-align: center;
color: #fff;
width: 360px;
}
.archive-overlay__box p {
margin-bottom: 20px;
font-size: 18px;
letter-spacing: 4px;
color: aqua;
}
.archive-overlay__bar {
width: 100%;
height: 8px;
background-color: rgba(255, 255, 255, 0.55);
border-radius: 4px;
overflow: hidden;
}
.archive-overlay__bar-inner {
width: 30%;
height: 100%;
background-color: aqua;
border-radius: 4px;
animation: archive-bar-slide 1.2s ease-in-out infinite;
}
@keyframes archive-bar-slide {
0% {
transform: translateX(-100%);
}
100% {
transform: translateX(430%);
}
}
</style>

View File

@@ -69,7 +69,14 @@
/>
</el-select>
</el-form-item>
<el-form-item label="木箱号">
<el-input
v-model="query.storagevehicleCode"
clearable
size="mini"
placeholder="请输入木箱编码"
/>
</el-form-item>
<el-form-item label="模糊搜索">
<el-input
v-model="query.search"

View File

@@ -541,7 +541,6 @@ export default {
},
divOpen() {
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => {
debugger
this.openParam = res
this.storId = this.currentRow.stor_id
this.divShow = true

View File

@@ -111,8 +111,12 @@
style="width: 100%;"
>
<el-table-column show-overflow-tooltip prop="stor_name" label="仓库" :min-width="flexWidth('stor_name',crud.data,'仓库')" />
<el-table-column v-if="query.bill_type === '1004'" show-overflow-tooltip prop="in_stor_name" label="移入仓库" :min-width="flexWidth('in_stor_name',crud.data,'仓库')" />
<el-table-column show-overflow-tooltip prop="sect_name" label="库区" :min-width="flexWidth('sect_name',crud.data,'库区')" />
<el-table-column show-overflow-tooltip prop="in_stor_name" label="收货地址(目的仓库)" :min-width="flexWidth('in_stor_name',crud.data,'收货地址(目的仓库)')" >
<template slot-scope="scope">
{{ scope.row.bill_type === '1004' ? scope.row.in_stor_name : scope.row.receiptaddress }}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" :min-width="flexWidth('bill_type',crud.data,'业务类型')" />
<el-table-column show-overflow-tooltip prop="vbeln" label="交货单号" :min-width="flexWidth('vbeln',crud.data,'交货单号')" />
<el-table-column show-overflow-tooltip prop="cust_name" label="物流公司" :min-width="flexWidth('cust_name',crud.data,'物流公司')" />