mirror of
https://gitee.com/ShopeX/OMS
synced 2026-04-20 03:55:42 +08:00
1. 【新增】售后单售后原因类型支持搜索
2. 【新增】手工创建订单折扣可输入正数 3. 【优化】盘点申请单确认 4. 【修复】采购退货单模拟出库失败问题 5. 【新增】订单金额客户实付与结算金额 6. 【优化】仓库发货统计报表物料名称显示 7. 【优化】自有仓储虚拟发货逻辑 8. 【修复】基础物料分类管理问题
This commit is contained in:
@@ -48,7 +48,7 @@ class monitor_event_notify
|
||||
$notifyData['template_id'] = $templateInfo['template_id'];
|
||||
$notifyData['event_type'] = $eventType;
|
||||
$notifyData['original_content'] = $templateInfo['content'];
|
||||
$notifyData['send_content'] = '**域名:'.kernel::base_url(1)."**\n".$this->getNotifyParams($templateInfo, $params);
|
||||
$notifyData['send_content'] = ($templateInfo['send_type'] == 'workwx' ? '**域名:'.kernel::base_url(1)."**\n" : '').$this->getNotifyParams($templateInfo, $params);
|
||||
$notifyData['send_type'] = $templateInfo['send_type'];
|
||||
$notifyData['params'] = json_encode($params);
|
||||
$notifyData['file_path'] = json_encode($params['file_path'],JSON_UNESCAPED_SLASHES);
|
||||
@@ -78,7 +78,10 @@ class monitor_event_notify
|
||||
//同步发送
|
||||
if ($is_sync) {
|
||||
//调用发送方法
|
||||
$this->sendNotify($result);
|
||||
if($params['receiver']) {
|
||||
$notifyData['receiver'] = $params['receiver'];
|
||||
}
|
||||
$this->sendNotify($result, $notifyData);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -213,14 +216,22 @@ class monitor_event_notify
|
||||
* 每天检测将超过30天的发送数据清除
|
||||
*/
|
||||
public function clean($clean_time = 30){
|
||||
$db = kernel::database();
|
||||
|
||||
$time = time();
|
||||
|
||||
$where = " WHERE `at_time`<'".date('Y-m-d',$time-$clean_time*24*60*60).' 00:00:00'."' ";
|
||||
|
||||
$del_sql = " DELETE FROM `sdb_monitor_event_notify` $where ";
|
||||
|
||||
kernel::database()->exec($del_sql);
|
||||
// // 只查询一条数据,判断是否有数据
|
||||
// $select_sql = "SELECT notify_id FROM sdb_monitor_event_notify ". $where ." LIMIT 0, 1";
|
||||
// $dataList = $db->select($select_sql);
|
||||
// if(empty($dataList)){
|
||||
// return true;
|
||||
// }
|
||||
|
||||
// 删除数据
|
||||
$del_sql = " DELETE FROM `sdb_monitor_event_notify` $where ";
|
||||
$db->exec($del_sql);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,11 +56,30 @@ class monitor_event_template
|
||||
'rpc_warning' => 'RPC调用失败报警',
|
||||
'store_freeze_abnormal' => '库存或冻结消费异常报警',
|
||||
'inventory_calc_error' => '库存计算异常报警',
|
||||
'order_ship_refund_apply' => '订单已发货仅退款发起申请',
|
||||
'order_unship_refund_apply' => '订单未发货退款发起申请',
|
||||
'order_refund_apply_reback_fail' => '订单退款发起申请发货单撤销失败',
|
||||
'order_part_ship_refund_apply' => '订单部分发货仅退款发起申请',
|
||||
'order_refund_apply_reback_succ' => '退款申请对应发货单均撤回',
|
||||
'order_refund_apply_force_refund' => '退款单强制退款',
|
||||
'order_delivery_timeliness' => '订单发货时效提醒',
|
||||
'order_delivery_platform_sync_error' => '订单发货回写平台失败',
|
||||
'inventory_calc_error' => '库存计算异常报警',
|
||||
// 新增事件类型
|
||||
'delivery_cancel_success' => '发货单取消成功通知',
|
||||
'reship_cancel_success' => '退货单取消成功通知',
|
||||
'delivery_cancel_wms' => '发货单撤销WMS通知',
|
||||
'sap_sync_error' => 'SAP同步异常报警',
|
||||
'order_lack_notify' => '订单缺货通知',
|
||||
);
|
||||
foreach(kernel::servicelist('monitor.service.event.template.get.after') as $object) {
|
||||
if(method_exists($object, 'getEventType')){
|
||||
$rs = $object->getEventType();
|
||||
if(is_array($rs) && $rs) {
|
||||
$eventType = array_merge($eventType, $rs);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $eventType;
|
||||
}
|
||||
|
||||
@@ -161,6 +180,29 @@ SAP同步异常报警
|
||||
>接口名:<font color="warning">{method}</font>
|
||||
>错误信息:<font color="warning">{errmsg}</font>
|
||||
TPL
|
||||
,
|
||||
'order_delivery_platform_sync_error' => <<<TPL
|
||||
订单发货回写平台失败
|
||||
>订单号:<font color="warning">{order_bn}</font>
|
||||
>发货单号:<font color="warning">{delivery_bn}</font>
|
||||
>平台:<font color="warning">{platform}</font>
|
||||
>店铺:<font color="warning">{shop_name}</font>
|
||||
>错误信息:<font color="warning">{errmsg}</font>
|
||||
TPL
|
||||
,
|
||||
'delivery_cancel_wms' => <<<TPL
|
||||
{shop_type}平台{shop_name}店铺发货单号({delivery_bn})已撤销,明细如下,请WMS端及时取消出货,谢谢。
|
||||
{detail_list}
|
||||
TPL
|
||||
,
|
||||
'order_lack_notify' => <<<TPL
|
||||
订单缺货通知
|
||||
>订单号:<font color="warning">{order_bn}</font>
|
||||
>仓库:<font color="warning">{branch_name}</font>
|
||||
>缺货商品数量:<font color="warning">{lack_count}</font>
|
||||
>缺货商品详情:
|
||||
{lack_products}
|
||||
TPL
|
||||
,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,14 @@ class monitor_event_trigger_notify_email extends monitor_event_trigger_notify_co
|
||||
$receiverInfo = $eventReceiverMdl->getList('receiver',['id'=>$receiverId]);
|
||||
}
|
||||
}else{
|
||||
$receiverInfo[] = ['receiver'=>$notifyInfo['receiver']];
|
||||
$receiverInfo = [];
|
||||
if(is_array($notifyInfo['receiver'])) {
|
||||
foreach($notifyInfo['receiver'] as $receiver) {
|
||||
$receiverInfo[] = ['receiver'=>$receiver];
|
||||
}
|
||||
}else{
|
||||
$receiverInfo[] = ['receiver'=>$notifyInfo['receiver']];
|
||||
}
|
||||
}
|
||||
// 安全检查:确保$receiverInfo有值且包含有效的receiver字段
|
||||
if (empty($receiverInfo) || !is_array($receiverInfo)) {
|
||||
@@ -132,4 +139,4 @@ class monitor_event_trigger_notify_email extends monitor_event_trigger_notify_co
|
||||
return ['rsp' =>'fail','msg'=> $emailLib->ErrorInfo];
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
50
app/monitor/lib/event/trigger/notify/zhannei.php
Normal file
50
app/monitor/lib/event/trigger/notify/zhannei.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @Author: xueding@shopex.cn
|
||||
* @Vsersion: 2022/10/18
|
||||
* @Describe: 预警通知邮件发送
|
||||
*/
|
||||
class monitor_event_trigger_notify_zhannei extends monitor_event_trigger_notify_common
|
||||
{
|
||||
public function send($notifyInfo)
|
||||
{
|
||||
if (!$notifyInfo['send_content']) {
|
||||
return ['rsp' => 'fail', 'msg' => '发送失败,发送内容为空'];
|
||||
}
|
||||
if ($notifyInfo['status'] == '1') {
|
||||
return ['rsp' => 'fail', 'msg' => '已发送不能重复发送'];
|
||||
}
|
||||
// 系统消息推送到 service(monitor.service.notify.zhannei),以便业务自定义扩展行为
|
||||
foreach (kernel::servicelist('monitor.service.notify.zhannei') as $object) {
|
||||
if (method_exists($object, 'send')) {
|
||||
$object->send($notifyInfo);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
// 获取rpcnotify模型
|
||||
$rpcNotifyMdl = app::get('base')->model('rpcnotify');
|
||||
|
||||
// 准备插入数据
|
||||
$data = [
|
||||
'callback' => '', // 空回调地址
|
||||
'rsp' => 'succ', // 默认成功状态
|
||||
'msg' => $notifyInfo['send_content'], // 发送内容作为消息
|
||||
'notifytime' => time(), // 当前时间戳
|
||||
'status' => 'false', // 默认未读状态
|
||||
];
|
||||
|
||||
// 插入数据到rpcnotify表
|
||||
$result = $rpcNotifyMdl->insert($data);
|
||||
|
||||
if ($result) {
|
||||
return ['rsp' => 'succ', 'msg' => '数据已成功写入rpcnotify表'];
|
||||
} else {
|
||||
return ['rsp' => 'fail', 'msg' => '数据写入失败'];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return ['rsp' => 'fail', 'msg' => $e->getMessage()];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user