|
|
@@ -223,6 +223,55 @@ class WxMessageClass extends BaseClass
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //供货商重复打印通知 ssh 20240511
|
|
|
+ public static function ghsCgRepeatPrintInform($cg)
|
|
|
+ {
|
|
|
+ $shopId = $cg->shopId ?? 0;
|
|
|
+ $shop = ShopClass::getById($shopId, true);
|
|
|
+ if (empty($shop)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $orderSn = $cg->orderSn ?? '';
|
|
|
+ $num = $cg->printNum ?? 0;
|
|
|
+ $ptStyle = $shop->ptStyle;
|
|
|
+ $ghsName = $cg->ghsName ?? '';
|
|
|
+ $staffName = $cg->shopAdminName ?? '';
|
|
|
+ $wxBase = WxOpenClass::getWxBase();
|
|
|
+ $wx = $wxBase[$ptStyle] ?? [];
|
|
|
+ $message = self::getAllByCondition(['ptStyle' => $ptStyle], null, '*', 'shortTemplateId');
|
|
|
+ $shortTempId = 'ZHH202405111701';
|
|
|
+ $tempId = isset($message[$shortTempId]['templateId']) ? $message[$shortTempId]['templateId'] : '';
|
|
|
+ if (empty($tempId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $adminList = ShopAdminClass::getRemainAdmin($shop);
|
|
|
+ if (empty($adminList)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ foreach ($adminList as $admin) {
|
|
|
+ $openId = isset($admin['openId']) ? $admin['openId'] : '';
|
|
|
+ if ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
|
|
|
+ $openId = isset($admin['ghsOpenId']) ? $admin['ghsOpenId'] : '';
|
|
|
+ }
|
|
|
+ if (!empty($openId)) {
|
|
|
+ $data = [
|
|
|
+ "touser" => $openId,
|
|
|
+ "template_id" => $tempId,
|
|
|
+ "url" => Yii::$app->params['ghsDomain'],
|
|
|
+ "data" => [
|
|
|
+ "character_string20" => ["value" => $orderSn],
|
|
|
+ "thing10" => ["value" => $ghsName],
|
|
|
+ "thing17" => ["value" => "采购单打印了{$num}次"],
|
|
|
+ "thing23" => ["value" => $staffName],
|
|
|
+ ]
|
|
|
+ ];
|
|
|
+ $data['miniprogram']['appid'] = $wx['miniAppId'];
|
|
|
+ $data['miniprogram']['pagepath'] = 'pagesPurchase/info?orderSn=' . $orderSn;
|
|
|
+ wxUtil::sendTaskInform($data, $wx, $ptStyle);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//供货商新订单通知 ssh 20210529
|
|
|
public static function ghsHasNewOrderInform($shop, $order)
|
|
|
{
|