Просмотр исходного кода

Merge branch 'dev' of git.huaml.com:zhh/huahuibao into dev

shizhongqi 9 месяцев назад
Родитель
Сommit
58217fdc70

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

@@ -179,7 +179,7 @@ class ProductController extends BaseController
 
         if ($type == 0) {
             //打标签
-            $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $ptItemId . '</BC128>';
+            $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">a' . $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) {

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

@@ -229,7 +229,7 @@ class PurchaseOrderController extends BaseController
                 $content .= '<TEXT x="415" y="20" font="12" w="2" h="2" r="0">.</TEXT>';
             }
             if ($type == 0) {
-                $content .= '<BC128 x="30" y="100" h="70" s="1" r="0" n="4" w="11">' . $ptItemId . '</BC128>';
+                $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">a' . $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) {

+ 5 - 2
app-ghs/controllers/TestController.php

@@ -423,8 +423,11 @@ class TestController extends BaseController
             //['name' => '昆明小向', 'merchantNo' => '8227310599200VK', 'wx' => [821387260, 821388013], 'zfb' => '2088080376224927'],
             //['name' => '张家口实惠花屋', 'merchantNo' => '82213805992004V', 'wx' => [820489785, 820487296], 'zfb' => '2088080312197467'],
             //['name' => '滨州花镜鲜花批发', 'merchantNo' => '82246605992002P', 'wx' => [823868085, 823868943], 'zfb' => '2088080570352350'],
-            ['name' => '颍上鲜花岛', 'merchantNo' => '82237205992004L', 'wx' => [825458625, 825457898], 'zfb' => '2088080675832722'],
-            ['name' => '晋江花多多鲜花', 'merchantNo' => '8223970599200EW', 'wx' => [825459643, 825460214], 'zfb' => '2088080677754761'],
+            //['name' => '厦门天天鲜花思明店', 'merchantNo' => '8223930599200GF', 'wx' => [826153052, 826153915], 'zfb' => '2088080731944987'],
+            //['name' => '颍上鲜花岛', 'merchantNo' => '82237205992004L', 'wx' => [825458625, 825457898], 'zfb' => '2088080675832722'],
+            //['name' => '晋江花多多鲜花', 'merchantNo' => '8223970599200EW', 'wx' => [825459643, 825460214], 'zfb' => '2088080677754761'],
+            //['name' => '昆明源花汇鲜花', 'merchantNo' => '8227310599200VZ', 'wx' => [826321533, 826321247], 'zfb' => '2088080751421086'],
+            ['name' => '厦门厦茗绿植批发', 'merchantNo' => '8223930599200GK', 'wx' => [826594015, 826593264], 'zfb' => '2088080774924483'],
             ['name' => '深圳鼎盛皇室花卉', 'merchantNo' => '8225840599201MF', 'wx' => [807078304, 807076486], 'zfb' => '2088970117746334'],
             //['name' => '东莞惠雅鲜花(莞城店)', 'merchantNo' => '8226020599200GJ', 'wx' => [796953190, 796976959], 'zfb' => '2088770940104912'],
             //['name' => '东莞惠雅鲜花(南城店)', 'merchantNo' => '8226020599200JK', 'wx' => [802315656, 802315755], 'zfb' => '2088870583889365'],

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

@@ -51,7 +51,7 @@ class GoodsController extends BaseController
         }else{
             $content = '<TEXT x="30" y="45" font="12" w="2" h="2" r="0">' . $name . '</TEXT>';
         }
-        $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">' . $goodsSn . '</BC128>';
+        $content .= '<BC128 x="30" y="115" h="75" s="1" r="0" n="3" w="10">#' . $goodsSn . '</BC128>';
         if ($price > 0) {
             $content .= '<TEXT x="30" y="250" font="12" w="2" h="2" r="0">' . $price . '元</TEXT>';
         }

+ 1 - 1
biz-hd/goods/classes/GoodsClass.php

@@ -482,7 +482,7 @@ class GoodsClass extends BaseClass
         $flowerNum = $data['flowerNum'] ?? 0;
         $kindId = $data['kindId'] ?? 0;
         $kindName = $data['kindName'] ?? '';
-        $sn = orderSn::getGoodsSn();
+        $sn = orderSn::getGoodsSn($data);
         $data['sn'] = $sn;
         $addStock = $data['stock'] ?? 0;
         unset($data['stock']);

+ 16 - 9
common/components/orderSn.php

@@ -475,15 +475,22 @@ class orderSn
     }
 
     //商品有效编号1-开头 ssh 20220405
-    public static function getGoodsSn()
-    {
-        $prefix = '1-';
-        $respond = GoodsSnClass::add(['id' => null]);
-        $id = $respond['id'] ?? 0;
-        if (empty($id)) {
-            util::fail('单号没有生成');
-        }
-        return $prefix . $id;
+    public static function getGoodsSn($data)
+    {
+        $mainId = $data['mainId'] ?? 0;
+        $shopId = $data['shopId'] ?? 0;
+        $info = GoodsSnClass::getByCondition(['mainId' => $mainId], true, 'sn DESC', 'id,sn');
+        if (empty($info)) {
+            $sn = 1;
+        } else {
+            $sn = $info->sn ?? 1;
+            $sn++;
+        }
+        $respond = GoodsSnClass::add(['id' => null, 'mainId' => $mainId, 'shopId' => $shopId, 'sn' => $sn]);
+        if (empty($respond)) {
+            util::fail('商品编号生成失败');
+        }
+        return $sn;
     }
 
     //二批采购退款 ssh 20220909