51 Commits

Author SHA1 Message Date
liufumingren
7d9d754f72 fix(dianguanjia):约束传递给wms创建订单只取下标0-24 2026-10-29 16:04:08 +08:00
liufumingren
7b18287328 fix: 全项目清理 PHP 7.4 升级遗留(open_basedir 临时目录、implode 反序、null 取下标、嵌套三元)
一、open_basedir 不能再写 /tmp(7.4 池子把白名单收紧,Monolog/EasyWeChat 会抛异常)
- addons/shopro/library/Wechat.php:easywechat 日志改到 runtime/easywechat/
- addons/epay/library/Yansongda/Supports/Logger.php:epay 日志默认路径改到 runtime/epay/
- application/admin/library/traits/Backend.php:CSV 导入临时文件改到 runtime/temp/

二、implode 参数反序(7.4 起 E_DEPRECATED,TP5 会抛异常)
- application/api/controller/Datas.php
- application/index/controller/wms/Pda.php
- 另修正 Wms.php 中 1 处(拆分面单提示)

三、null 取下标(7.4 起 "Trying to access array offset on value of type null")
- 覆盖 71 个文件 135 行:find()/value()/json_decode()/redis get 等结果未判空即取下标处,
  统一 (\['k'] ?? null) 兜底;foreach 目标用 ?? [];in_array/count 等数组参数用 ?? []
- 涉及 api/*、admin/shopro/*、addons/shopro/*、addons/epay/*、index/wms/* 等

四、嵌套三元未加括号(7.4 弃用)
- application/index/controller/wms/Wms.php getPackingprice 2 处,补括号后与旧版本解析顺序一致

验证:74 个文件、148 行改动,逐行括号/引号配平与 HEAD 一致,未改动 vendor/ 与 thinkphp/;
剩余扫描命中均为写目标、unset、或已被 if(!\){error()} 拦截的假阳性。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-25 09:47:48 +08:00
liufumingren
dedb18a80c fix(wms): split_excel 导出目录不可写时给出可执行的修复提示
现象:返回 "fopen(.../public/export/xxx.xlsx): failed to open stream: Permission denied"。
public/export 目录属主/权限不允许 PHP 运行用户写入。

改动:
- 目录不存在时 mkdir(0777);不可写时先 @chmod(0777) 尝试自愈
- 仍不可写则返回明确信息:目录、属主、权限、PHP 运行用户,并附带
  chown -R www:www <dir> && chmod -R 775 <dir> 的修复命令
- posix 信息获取做 is_array 保护,避免取不到用户时再抛 notice

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 21:06:55 +08:00
liufumingren
58f553586c fix(wms): split_excel 上传拆单接口异常时返回真实原因并加固解析
现象:POST /index/wms/wms/split_excel 返回 {"msg":{}}。
原因:catch(Exception) 里直接 json(["msg"=>\]),Exception 对象序列化为 {};
而 TP5 的 ErrorException 继承 think\Exception,说明 try 内抛的是 PHP
notice/warning(7.4 下 error_reporting 含 E_NOTICE 时全部转异常)。

加固点:
- Excel 行取列改为 (\['E'] ?? '')、B/C/D 同样兜底,避免表格列数不足时
  "Undefined index: E" 中断
- 上传文件为空时返回明确提示(原先是调用 null->validate() 的致命错误)
- unlink 前判断文件存在
- 导出目录不存在时自动创建
- catch 改为 \Throwable,日志记录 message@file:line,响应返回真实错误信息

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 21:04:47 +08:00
liufumingren
3f28fa9423 fix(wms): 修复 Wms.php 在 PHP 7.4 下的弃用语法与 null 取下标
1) implode 参数反序(7.4 起 E_DEPRECATED,TP5 会抛异常):
   拆分面单提示处 implode(\["items"],"\n") -> implode("\n",\["items"])

2) find()/json_decode()/redis->get() 结果未判空就取下标(7.4 起
   "Trying to access array offset on value of type null" 会抛异常),
   共 219 行按 (\['k'] ?? null) 形式兜底,覆盖 getinfo/getorderinfo/
   createGrab/createPostNum/ckd/plateresult 等函数;
   嵌套访问一并包住(如 \['data']['nickName'] 整体兜底);
   字符串插值处(plateresult 临时车辆提示)改为拼接表达式

未改动:赋值目标(写下标本身不会触发该 notice)、unset() 调用

语义不变:仅在原本会抛异常的"记录/JSON 不存在"场景返回 null 或空串,
有数据时行为与升级前完全一致。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 20:30:11 +08:00
liufumingren
276a6ef37d fix(chat): 修复 PHP 7.4 升级引发的其余告警(implode 弃用、null 取下标)
全量检查 chat 相关代码(Chat.php / qiwe/Index.php / library/chat/Orders.php
/ library/qiwe / new_wms/Forward.php),补齐升级后才暴露的问题:

1. implode 参数反序(4 处,PHP 7.4 起 E_DEPRECATED,TP5 会抛成异常):
   Chat.php 群列表/指令/门店查询里  implode(\," and ")
   -> implode(" and ", \),输出 SQL 完全一致
2. carriage 查运费:getOrderInfoByPostnum 未命中返回 false,
   if(\["ID"]) 在 7.4 会抛 bool 取下标 -> 改为 if(\ && \["ID"])
3. kdroomMessageExplpde2 队列消费:json_decode 失败时 \ 为 null,
   补 is_array 判断跳过脏数据
4. qiwe/Index.php 5 处接口返回 json_decode 后直接用 \["code"]:
   补 \ && 前置判断(getRoomList/batchGetRoomDetails/
   batchGetUserinfo/sendImage/sendFile),避免空返回时抛 notice
5. chat/Orders.php createOrderToWms:订单回查为 null 时取 POSTNUM/ID/
   ERRORRECORDS 的兜底,改为 empty() 与 ??

以上均为 7.4 兼容性修复,业务行为保持不变。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 14:23:27 +08:00
liufumingren
c4aa873bea fix(chat): 修复消息事务中的 null 取下标(PHP 7.4 抛出 ErrorException)
企微入口 processMessages 在事务中捕获到 Trying to access array offset on
value of type null:消息"打包视频+单号"走 dabaoVideo -> getOrderInfoByPostnum
时,Express 表查不到该单号,find() 返回 null,随后直接取 ["TRADEORDER"]。
PHP 7.4 起该 notice 被抛成异常,导致整条消息事务回滚、无回复。

- getOrderInfoByPostnum:先取 TRADEORDER 到变量并用 ?? 兜底,4 处引用统一
- fastruku:仓库未取到时 ["operatorID"] 加 ?? 0
- createOrder:群未登记时 ['isOrder'] 用 ?? 0 兜底
- createPostnum:3 处 Wsdl::webservice 的仓库参数补 ?? 兜底
- grabnum(): 为空时改用 empty() 判断,避免 notice
- qiwe processMessages 事务失败日志补充出错文件与行号,便于定位

以上均为等价语义,仅消除 PHP 7.4 下的 notice/异常。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 14:19:18 +08:00
liufumingren
a73f3b1c2a fix(chat): 避免群信息查不到时对 null 取下标(PHP 7.4 报错)
processMessage 中 room_id 未在 Rooms/qiweRooms 表中登记时,find() 返回
null,PHP 7.4 起取 ['type'] 会抛 Trying to access array offset on value
of type null。改用 ?? 取默认 null,行为与升级前一致:落 switch default
返回"群聊类型未命中"。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 14:13:57 +08:00
liufumingren
8d56189d4e fix(chat): 修正 preg_match 字符类非法范围导致 PHP 7.4 下报错
[\s-_] 中 - 被当作范围连接符,PCRE2(PHP 7.3+,7.4 更严格)会报
invalid range in character class,导致 getPostNums 的手机号+分机号
过滤规则失效并产生 warning。改为 [\s\-_],语义不变。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-22 14:05:17 +08:00
liufumingren
2c60b84eb9 取消转发 2026-10-12 17:34:58 +08:00
68df579a82 测试 2026-10-07 15:56:07 +08:00
5993d4850e 散单策略数组边界 2026-10-05 11:50:48 +08:00
615dd6f038 散单去重无效撤销 2026-10-04 20:36:51 +08:00
bf80315e91 抓取散单去重 2026-10-04 00:21:31 +08:00
e92d44c6b3 测试提交 2026-09-29 18:31:09 +08:00
64286c44ff 1 2026-09-29 17:48:15 +08:00
liufumingren
01434b27f8 2 2026-09-29 17:25:42 +08:00
liufumingren
0c6cabb85b 1 2026-09-29 17:23:47 +08:00
liufumingren
66caee7a76 fix:移除空行 2026-09-29 17:19:41 +08:00
1221ed8ef4 增加一个空行 2026-09-29 17:16:45 +08:00
liufumingren
8d8ea6cfc8 fix:修正领料未拣货接口条件判断 2026-09-29 16:38:40 +08:00
liufumingren
2ac785dea9 修正Redis认证密码: 本机连接 auth('qwe2019') 改为 'qwe2019@' 2026-09-26 02:13:02 +08:00
liufumingren
2afd401ddd Redis连接迁移: 47.100.78.112 DB2 用法改连本机 127.0.0.1(qwe2019@/DB15) 2026-09-26 02:12:11 +08:00
liufumingren
6f4b2c46d3 1 2026-09-21 22:16:37 +08:00
liufumingren
a1b5c356ea 1 2026-09-21 18:39:34 +08:00
liufumingren
f0dfb0b156 1 2026-09-21 17:41:51 +08:00
liufumingren
731cd17802 1 2026-09-21 17:40:39 +08:00
liufumingren
0c8b76b479 1 2026-09-21 17:38:36 +08:00
liufumingren
fac4bc321f 1 2026-09-21 17:34:24 +08:00
liufumingren
83dea0260c 1 2026-09-21 17:27:46 +08:00
liufumingren
f57c656369 1 2026-09-21 17:23:25 +08:00
liufumingren
9c88a83a1b 1. 2026-09-21 17:11:27 +08:00
liufumingren
ca919e4a48 feat: Authorization 回调原文(含GET参数)转发到测试环境 2026-09-21 17:03:38 +08:00
liufumingren
ca30f3302b feat: QiweMessage 队列追加入队时间 ts
用于排查 / 按时间清理积压。

- 统一入口 Wms::withQueueTs(),覆盖 toMsgCache 与 AutoCreatePostNum 的 lpush
- Chat::send_group_message() 内联补 ts
- wx 队列 Message 故意不加:其消费端会把整个数组 http_build_query 转发给外部发送接口,
  未验证对方是否忽略未知参数
2026-09-16 22:10:27 +08:00
liufumingren
d289a0757d feat: 车辆进出场伪造 system 消息推送到 WMS
- plateresult 出口/入口识别到车牌后,通过 inbox.push 推送站内信:
  群ID=system、群名=系统、来源=system,内容为 {车牌}离场 / {车牌}进场
- 进场额外附带 extData.allow(是否已放行)与 reason(临时车辆-到货 / 白名单 / 无访问权限)
- 防重锁提前统一获取一次(原逻辑仅在开门群存在时才加锁):
  出口推送、进场推送与开门群消息共用同一个 20 秒锁,避免重复推送或互相吞锁
- requestId 形如 exit:{仓库}:{车牌}:{时间戳},用于 WMS 侧幂等去重
2026-09-16 22:10:27 +08:00
liufumingren
afdcc62459 1 2026-09-16 18:01:29 +08:00
liufumingren
61383c2592 1 2026-09-16 17:59:39 +08:00
liufumingren
878fbc22ef 1 2026-09-10 14:16:37 +08:00
liufumingren
395cfeb14a feat: new_wms_notify reply 支持多用户 @(user_id 数组/分隔字符串) 2026-08-29 06:36:22 +08:00
liufumingren
f35b201810 7001 端口迁移,改为 7071/7072 故障转移发送 2026-08-28 20:00:31 +08:00
liufumingren
42dd50e1ef 1 2026-08-26 14:48:21 +08:00
liufumingren
28933bc391 fix:修正团购打包是否打包 2026-08-26 14:43:59 +08:00
liufumingren
d081846e2f 1 2026-08-22 18:00:47 +08:00
liufumingren
b65b99b94b 1 2026-08-22 17:51:23 +08:00
liufumingren
e177a4771f feat: IM通道在线检测(qiwe新增getProfile/checkOnline,new_wms_notify reply离线返回503) 2026-08-18 00:55:01 +08:00
liufumingren
468b1ecfe9 fix:无methods_name时,默认调用tuijian方法 2026-08-16 18:24:29 +08:00
liufumingren
3d566595e0 feat: 入站通知接口 + 调试日志增强
- 新增 notify/Dispatcher.php 入站分发器(验签+method路由)
- Wms.php 新增 new_wms_notify 统一入站入口
- Forward.php 修正字段映射(groupId/userId 强转字符串,groupName/userName 修正)
- Base.php 调试日志全部改为 error 级别,打印完整请求/响应
- 移除 sourceType 入参
2026-08-07 21:47:34 +08:00
liufumingren
c35ac184ae feat: WMS 开放接口签名 & 消息转发模块
- 新增 extra/wms.php 统一配置(app_key/app_secret/base_url)
- 新增 WmsSign.php 签名工具(canonicalQuery + bodySign + stableStringify)
- 新增 WmsVerify.php 验签工具(恒定时间比较防时序攻击)
- 新增 func/ 目录与远端 API 对应(Index.ping / Store.list / Inbox.push)
- 重构 Forward.php 使用 Inbox.push 转发群聊消息到 WMS 站内信
- Chat.php processMessage 接入 Forward 转发,异常不阻塞原有流程
- 删除冗余 WmsSignConfig.php,配置统一从 config('wms') 读取
- 修复 deploy.js chown/chmod .user.ini 报错
2026-08-06 22:46:30 +08:00
liufumingren
248b8876be 1 2026-08-06 18:06:02 +08:00
liufumingren
61b6d603cd 1 2026-08-06 17:46:06 +08:00