Browse Source

Merge branch 'master' into ls

shish 1 year ago
parent
commit
d1aeaf1329

+ 6 - 1
app-ghs/controllers/CashController.php

@@ -30,7 +30,12 @@ class CashController extends BaseController
     //申请提现 ssh 2021.3.14
     public function actionApply()
     {
-        util::fail('系统自动提现,无需人为操作');
+        if (getenv('YII_ENV') == 'production') {
+            util::fail('系统自动提现,无需人为操作');
+        }else{
+            //这里需要测试,所以打开来
+            //util::fail('系统自动提现,无需人为操作');
+        }
         $get = Yii::$app->request->get();
         $get['shopAdminId'] = $this->shopAdminId;
         $shopAdmin = $this->shopAdmin;

+ 1 - 1
app-ghs/controllers/ConsoleController.php

@@ -166,7 +166,7 @@ class ConsoleController extends BaseController
             }
         }
 
-        //$notice[] = ['title' => '收银机开始支持【挂单】和重复扫码', 'action' => '查看', 'page' => '/admin/notice/warning'];
+        $notice[] = ['title' => '节日期间官方技术服务电话2号:17189513228', 'action' => '', 'page' => ''];
 
         $mainId = $this->mainId;
         $respond = StatSaleClass::profile($mainId);

+ 10 - 1
app-ghs/controllers/ItemController.php

@@ -974,7 +974,16 @@ class ItemController extends BaseController
             Yii::$app->redis->executeCommand('DEL', ['ghs_cashier_' . $mainId . '_' . $staffId . '_may_refresh']);
         }
 
-        util::success(['list' => $list]);
+        $productList = [];
+        if (!empty($list)) {
+            foreach ($list as $key => $item) {
+                if(!empty($item)){
+                    $productList = array_merge($productList, $item);
+                }
+            }
+        }
+
+        util::success(['list' => $list, 'productList' => $productList]);
     }
 
     public function actionAdd()

+ 2 - 2
app-ghs/controllers/OrderController.php

@@ -707,9 +707,9 @@ class OrderController extends BaseController
         //支付宝文档说明 https://opendocs.alipay.com/open/194/106039/
         $aliPattern = '/^(25|26|27|28|29|30)\d{14,22}$/';
         if (!preg_match($wxPattern, $authCode) && !preg_match($aliPattern, $authCode)) {
-            $msg = '付款码有问题';
+            $msg = '付款码错误,请使用微信或支付宝付款码';
             $remind = $msg . "(付款码:{$authCode})" . '(' . $name . ')';
-            noticeUtil::push($remind . ' 编号002', '15280215347');
+            //noticeUtil::push($remind . ' 编号002', '15280215347');
             util::success(['returnStatus' => 'FAILURE'], $msg);
         }
 

+ 23 - 15
app-ghs/controllers/ProductController.php

@@ -171,32 +171,40 @@ class ProductController extends BaseController
             $unit = '若干' . $info->smallUnit . '/' . $info->bigUnit;
         }
         $p->times = $num;
-        if (stringUtil::getWordNum($name) > 7) {
+        if (stringUtil::getWordNum($name) > 8) {
             $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
         } else {
             $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
         }
-        //杭州斗南批发店
-        if (isset($get['type']) == false && $this->shopId == 4608) {
-            $content .= '<QR x="35"  y="100"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $id . '</QR>';
-            $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
+
+        if ($type == 0) {
+            //打标签
+            $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
+            if (in_array($mainId, [52, 1459])) {
+                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
+            } elseif ($mainId == 16948) {
+                $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
+            } else {
+                $content .= '<TEXT x="30" y="250" font="12" w="1" h="1" r="0">' . $unit . '</TEXT>';
+            }
         } else {
-            if ($type == 0) {
-                //打标签
-                $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
-                if (in_array($mainId, [52, 1459])) {
-                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">惠雅鲜花</TEXT>';
-                } elseif ($mainId == 16948) {
-                    $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">淘花里鲜花</TEXT>';
-                } else {
-                    $content .= '<TEXT x="30" y="250" font="12" w="1" h="1" r="0">' . $unit . '</TEXT>';
-                }
+            if (getenv('YII_ENV') == 'production') {
+                $printPrice = [4556];
+            } else {
+                $printPrice = [644];
+            }
+            if (in_array($this->mainId, $printPrice)) {
+                //打价格
+                $price = $info->skPrice ?? 0;
+                $price = floatval($price);
+                $content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '元</TEXT>';
             } else {
                 //打价码
                 $content .= '<QR x="35"  y="100"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $id . '</QR>';
                 $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
             }
         }
+
         $p->printLabelMsg($content);
         util::complete();
     }

+ 23 - 3
app-ghs/controllers/PurchaseOrderController.php

@@ -197,6 +197,14 @@ class PurchaseOrderController extends BaseController
         }
         $p = new printUtil($printLabelSn);
 
+        $ids = [];
+        foreach ($itemList as $key => $item) {
+            $productId = $item->productId ?? 0;
+            $ids[] = $productId;
+        }
+        $ids = array_unique($ids);
+        $infoList = ProductClass::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id');
+
         foreach ($itemList as $key => $item) {
             $name = $item->name ?? '';
             $num = !empty($item->itemNum) ? floatval($item->itemNum) : 0;
@@ -215,7 +223,7 @@ class PurchaseOrderController extends BaseController
                 $unit = '若干' . $smallUnit . '/' . $bigUnit;
             }
 
-            if (stringUtil::getWordNum($name) > 7) {
+            if (stringUtil::getWordNum($name) > 8) {
                 $content = '<TEXT x="30" y="30" font="12" w="1" h="1" r="0">' . $name . '</TEXT>';
             } else {
                 $content = '<TEXT x="30" y="30" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
@@ -233,8 +241,20 @@ class PurchaseOrderController extends BaseController
                     $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $unit . '</TEXT>';
                 }
             } else {
-                $content .= '<QR x="35"  y="100"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $productId . '</QR>';
-                $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
+                if (getenv('YII_ENV') == 'production') {
+                    $printPrice = [4556];
+                } else {
+                    $printPrice = [644];
+                }
+                if (in_array($this->mainId, $printPrice)) {
+                    //打价格
+                    $price = $infoList[$productId] && $infoList[$productId]['skPrice'] ? $infoList[$productId]['skPrice'] : 0;
+                    $price = floatval($price);
+                    $content .= '<TEXT x="35" y="150" font="12" w="4" h="4" r="0">' . $price . '元</TEXT>';
+                } else {
+                    $content .= '<QR x="35"  y="100"  e="L"  w="5">' . Yii::$app->params['mallHost'] . "/item/show-info?id=" . $productId . '</QR>';
+                    $content .= '<TEXT x="40" y="270" font="12" w="1" h="1" r="0">扫码看价格</TEXT>';
+                }
             }
             $p->printLabelMsg($content);
         }

+ 6 - 14
app-ghs/controllers/TestController.php

@@ -345,16 +345,10 @@ class TestController extends BaseController
             //['name' => '宜宾花房里', 'merchantNo' => '82267105399041L', 'wx' => [702588640, 702570297], 'zfb' => '2088060798606945'],
             //['name' => '普莲花艺', 'merchantNo' => '8223990539902H8', 'wx' => [709291364, 709278546], 'zfb' => '2088160744835387'],
             //['name' => '凯里壹号鲜花工厂', 'merchantNo' => '82271305992000N', 'wx' => [735074420, 735074312], 'zfb' => '2088660471452939'],
-
-            //['name' => '淮北花语集鲜花批发', 'merchantNo' => '82236605992000K', 'wx' => [747493528, 747494351], 'zfb' => '2088960295011854'],
-            //['name' => '中山淘花里鲜花', 'merchantNo' => '82260305992004F', 'wx' => [750281744, 750282146], 'zfb' => '2088960768726142'],
-            ['name' => '济南花中花', 'merchantNo' => '8224510599200DW', 'wx' => [750727543, 750727855], 'zfb' => '2088960829581057'],
-            //['name' => '南通花香草', 'merchantNo' => '82230605992004S', 'wx' => [754954733, 754953957], 'zfb' => '2088070539461201'],
-            ['name' => '广州天天鲜花', 'merchantNo' => '82258505992003V', 'wx' => [756889316, 756889307], 'zfb' => '2088070803130745'],
-            //['name' => '平潭花天下', 'merchantNo' => '8223910599200DU', 'wx' => [742408710, 742408308], 'zfb' => '2088860472568840'],
-            //['name' => '福清辉煌鲜花批发', 'merchantNo' => '8223910599200EA', 'wx' => [745744183, 745743573], 'zfb' => '2088860913726576'],
+            ['name' => '平潭花天下', 'merchantNo' => '8223910599200DU', 'wx' => [742408710, 742408308], 'zfb' => '2088860472568840'],
+            ['name' => '徐州贴心鲜花批发', 'merchantNo' => '82230305992005L', 'wx' => [770844003, 770842534], 'zfb' => '2088370485434992'],
             //['name' => '日照月下鲜花批发', 'merchantNo' => '82247705992002D', 'wx' => [759404451, 759404055], 'zfb' => '2088170264295192'],
-            ['name' => '陆丰幸运花坊', 'merchantNo' => '82259705992001N', 'wx' => [762636401,762635754 ], 'zfb' => '2088170810827880'],
+            //['name' => '陆丰幸运花坊', 'merchantNo' => '82259705992001N', 'wx' => [762636401,762635754 ], 'zfb' => '2088170810827880'],
             //['name' => '阜阳芳棠鲜花批发', 'merchantNo' => '82237205992002Q', 'wx' => [733203298, 733203681], 'zfb' => '2088660084283241'],
             //['name' => '厦门拾花蒲鲜花批发', 'merchantNo' => '8223930599200BH', 'wx' => [732030422, 732025011], 'zfb' => '2088560833972467'],
             //['name' => '肇庆兄弟花业鲜花批发', 'merchantNo' => '8225880599200AN', 'wx' => [731684756, 731684322], 'zfb' => '2088560782624772'],
@@ -705,7 +699,7 @@ class TestController extends BaseController
     //零售订单查询 ssh 20231031
     public function actionLsTradeQuery()
     {
-
+        $shopId = 1490;
         $shop = ShopClass::getById($shopId, true);
         if (empty($shop)) {
             util::stop('没有找到门店21');
@@ -722,7 +716,7 @@ class TestController extends BaseController
         ];
         $laResource = new Lakala($params);
         $queryParams = [
-
+            'orderSn' => 'KD26596032',
             //'tradeNo' => '20231029110113130266215259252887',
         ];
         $response = $laResource->query($queryParams, 0);
@@ -834,10 +828,9 @@ class TestController extends BaseController
     //交易查询 ssh 20231021
     public function actionTradeQuery()
     {
-
+        $shopId = 763;
         $shop = ShopClass::getById($shopId, true);
         if (empty($shop)) {
-
             util::stop('没有找到门店,编号677230');
         }
         $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
@@ -852,7 +845,6 @@ class TestController extends BaseController
         ];
         $laResource = new Lakala($params);
         $queryParams = [
-,
             'orderSn' => 'CG28416364',
             //'tradeNo' => '66221061685504',
         ];

+ 6 - 1
app-hd/controllers/CashController.php

@@ -21,7 +21,12 @@ class CashController extends BaseController
     //申请提现 ssh 2021.3.14
     public function actionApply()
     {
-        util::fail('系统自动提现,无需人为操作');
+        if (getenv('YII_ENV') == 'production') {
+            util::fail('系统自动提现,无需人为操作');
+        } else {
+            //这里需要测试,所以打开来
+            //util::fail('系统自动提现,无需人为操作');
+        }
         $get = Yii::$app->request->get();
         $get['shopAdminId'] = $this->shopAdminId;
         $shopAdmin = $this->shopAdmin;

+ 11 - 1
app-hd/controllers/ItemController.php

@@ -101,7 +101,17 @@ class ItemController extends BaseController
         $where['status'] = 1;
 
         $list = \bizHd\item\classes\ItemClass::getShowList($where);
-        util::success(['list' => $list]);
+
+        $productList = [];
+        if (!empty($list)) {
+            foreach ($list as $key => $item) {
+                if (!empty($item)) {
+                    $productList = array_merge($productList, $item);
+                }
+            }
+        }
+
+        util::success(['list' => $list, 'productList' => $productList]);
     }
 
     public function actionAdd()

+ 1 - 1
app-hd/controllers/NoticeController.php

@@ -454,7 +454,7 @@ class NoticeController extends PublicController
                                     //福州我要花、花路鲜花批发打二次小票,有多处要修改搜索关键词tow_print
                                     $needTwoPrint = [7538, 36707];
                                 } else {
-                                    $needTwoPrint = [644];
+                                    $needTwoPrint = [];
                                 }
                                 if (in_array($order->mainId, $needTwoPrint)) {
                                     if ($order->mainId == 7538) {

+ 2 - 2
app-hd/controllers/OrderController.php

@@ -293,9 +293,9 @@ class OrderController extends BaseController
             //支付宝文档说明 https://opendocs.alipay.com/open/194/106039/
             $aliPattern = '/^(25|26|27|28|29|30)\d{14,22}$/';
             if (!preg_match($wxPattern, $authCode) && !preg_match($aliPattern, $authCode)) {
-                $msg = '付款码有问题';
+                $msg = '付款码错误,请使用微信或支付宝付款码';
                 $remind = $msg . "(零售端付款码:{$authCode})" . '(' . $name . ')';
-                noticeUtil::push($remind . ' 编号009', '15280215347');
+                //noticeUtil::push($remind . ' 编号009', '15280215347');
                 util::success(['returnStatus' => 'FAILURE'], $msg);
             }
 

+ 7 - 0
app-hd/controllers/PurchaseController.php

@@ -283,6 +283,11 @@ class PurchaseController extends BaseController
             $orderNum = [];
             foreach ($productList as $key => $product) {
                 $bigNum = $product['bigNum'] ?? 0;
+                $smallNum = $product['smallNum'] ?? 0;
+                $pName = $product['name'] ?? '';
+                if ($smallNum > 0) {
+                    util::fail($pName . '不能选小单位');
+                }
                 $productId = $product['productId'] ?? 0;
                 $orderNum[$productId] = ['num' => $bigNum];
             }
@@ -330,6 +335,8 @@ class PurchaseController extends BaseController
                     if ($version >= 10) {
                         $stock = $currentInfo['stock'] ?? 0;
                         $stock = floatval($stock);
+                        //会有0.5扎和2.5扎问题,所以要转成整数,不然会出严重问题 ssh 20250503
+                        $stock = intval($stock);
                         $productId = $currentInfo['id'] ?? 0;
                         $productName = $currentInfo['name'] ?? '';
                         $num = $orderNum[$productId] && $orderNum[$productId]['num'] ? $orderNum[$productId]['num'] : 0;

+ 4 - 4
app-pt/views/main/app.php

@@ -31,23 +31,23 @@ if ($xhbApi == 'wixhb.com') {
 <div style="text-align:center;margin-top:30px;">
     <a style="margin:0 auto;display:inline-block;border:none;padding:8px 15px;border-radius:16px;color:white;background-color:#3385FF;text-decoration:none"
 
-       href="https://img.wixhb.com/apk/hd/pad171.apk">花掌柜收银</a>
+       href="https://img.wixhb.com/apk/hd/pad178.apk">花掌柜收银</a>
 </div>
 <div style="text-align:center;margin-top:30px;">
     <a style="margin:0 auto;display:inline-block;border:none;padding:8px 15px;border-radius:16px;color:white;background-color:#3385FF;text-decoration:none"
 
-       href="https://img.wixhb.com/apk/ghs/pad135.apk">销花宝收银</a>
+       href="https://img.wixhb.com/apk/ghs/pad141.apk">销花宝收银</a>
 </div>
 <div style="width:100%;text-align:center;margin-top:20px;">-----------------------------------------------------------------</div>
 <div style="text-align:center;margin-top:30px;">
     <a style="margin:0 auto;display:inline-block;border:none;padding:8px 15px;border-radius:16px;color:white;background-color:#3385FF;text-decoration:none"
 
-       href="https://img.wixhb.com/apk/hd/pad176.apk">花掌柜收银(最新版)</a>
+       href="https://img.wixhb.com/apk/hd/pad179.apk">花掌柜收银(最新版)</a>
 </div>
 <div style="text-align:center;margin-top:30px;">
     <a style="margin:0 auto;display:inline-block;border:none;padding:8px 15px;border-radius:16px;color:white;background-color:#3385FF;text-decoration:none"
 
-       href="https://img.wixhb.com/apk/ghs/pad140.apk">销花宝收银(最新版)</a>
+       href="https://img.wixhb.com/apk/ghs/pad143.apk">销花宝收银(最新版)</a>
 </div>
 </body>
 </html>

+ 6 - 0
biz-ghs/product/classes/ProductClass.php

@@ -1468,6 +1468,9 @@ class ProductClass extends BaseClass
                 if ($data['stock'] < 0) {
                     util::fail("库存不能小于0");
                 }
+                if ($data['stock'] > 999999) {
+                    util::fail('库存数不能超过6个9');
+                }
                 //增加盘点记录 2021.7.27
                 $ratio = $product->ratio ?? 0;
                 $formNum = ProductClass::formatStock($data['stock'], $ratio);
@@ -2140,6 +2143,9 @@ class ProductClass extends BaseClass
             if ($data['stock'] < 0) {
                 util::fail("库存数不能小于0");
             }
+            if ($data['stock'] > 999999) {
+                util::fail('库存数不能超过6个9');
+            }
             $stock = $data['stock'];
         }
         //没有库存则下架

+ 45 - 45
biz/sj/classes/CashClass.php

@@ -128,53 +128,53 @@ class CashClass extends BaseClass
         ];
         ShopYeChangeClass::addChange($change, true);
 
-        $txAsset = null;
-        if ($ptStyle == dict::getDict('ptStyle', 'hd')) {
-            $txAsset = PtAssetClass::getHdTxBalance();
-        } elseif ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
-            $txAsset = PtAssetClass::getGhsTxBalance();
-        } else {
-            util::fail('提现失败');
-        }
-        $currentPtTxBalance = $txAsset->amount;
-        $currentPtTxBalance = bcsub($currentPtTxBalance, $txBalance, 2);
-        $txAsset->amount = $currentPtTxBalance;
-        $txAsset->save();
+//        $txAsset = null;
+//        if ($ptStyle == dict::getDict('ptStyle', 'hd')) {
+//            $txAsset = PtAssetClass::getHdTxBalance();
+//        } elseif ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
+//            $txAsset = PtAssetClass::getGhsTxBalance();
+//        } else {
+//            util::fail('提现失败');
+//        }
+//        $currentPtTxBalance = $txAsset->amount;
+//        $currentPtTxBalance = bcsub($currentPtTxBalance, $txBalance, 2);
+//        $txAsset->amount = $currentPtTxBalance;
+//        $txAsset->save();
 
-        $asset = null;
-        if ($ptStyle == dict::getDict('ptStyle', 'hd')) {
-            $asset = PtAssetClass::getHdBalance();
-        } elseif ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
-            $asset = PtAssetClass::getGhsBalance();
-        } else {
-            util::fail('没有找到平台');
-        }
-        if (bccomp($txBalance, $asset->amount, 2) == 1) {
-            //util::fail('平台余额不足..');
-            //noticeUtil::push('商家提现,平台余额不足。商家提现:' . $txBalance . ',平台余额:' . $asset->amount, '15280215347');
-        }
-        $currentPtBalance = bcsub($asset->amount, $txBalance, 2);
-        $asset->amount = $currentPtBalance;
-        $asset->save();
+//        $asset = null;
+//        if ($ptStyle == dict::getDict('ptStyle', 'hd')) {
+//            $asset = PtAssetClass::getHdBalance();
+//        } elseif ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
+//            $asset = PtAssetClass::getGhsBalance();
+//        } else {
+//            util::fail('没有找到平台');
+//        }
+//        if (bccomp($txBalance, $asset->amount, 2) == 1) {
+//            //util::fail('平台余额不足..');
+//            //noticeUtil::push('商家提现,平台余额不足。商家提现:' . $txBalance . ',平台余额:' . $asset->amount, '15280215347');
+//        }
+//        $currentPtBalance = bcsub($asset->amount, $txBalance, 2);
+//        $asset->amount = $currentPtBalance;
+//        $asset->save();
 
-        $change = [
-            'relateId' => $id,
-            'capitalType' => $capitalType,
-            'amount' => $txBalance,
-            'balance' => $currentPtBalance,
-            'txBalance' => $currentPtTxBalance,
-            'io' => 0,
-            'payWay' => 0,
-            'event' => "【{$shop->merchantName} {$shop->shopName}】提现",
-            'sjId' => $sjId,
-            'shopId' => $shopId,
-            'tx' => $tx,
-            'ptStyle' => $ptStyle,
-            'shopName' => $shop->shopName,
-            'sjName' => $shop->merchantName,
-            'mainId' => $mainId
-        ];
-        PtYeChangeClass::addChange($change, true);
+//        $change = [
+//            'relateId' => $id,
+//            'capitalType' => $capitalType,
+//            'amount' => $txBalance,
+//            'balance' => $currentPtBalance,
+//            'txBalance' => $currentPtTxBalance,
+//            'io' => 0,
+//            'payWay' => 0,
+//            'event' => "【{$shop->merchantName} {$shop->shopName}】提现",
+//            'sjId' => $sjId,
+//            'shopId' => $shopId,
+//            'tx' => $tx,
+//            'ptStyle' => $ptStyle,
+//            'shopName' => $shop->shopName,
+//            'sjName' => $shop->merchantName,
+//            'mainId' => $mainId
+//        ];
+//        PtYeChangeClass::addChange($change, true);
 
         //noticeUtil::push("客户:{$sjName} {$shopName}申请提现,金额:{$txBalance}元", '15280215347');
         return $return;