Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-micro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-micro
Commits
0a7b0c46
Commit
0a7b0c46
authored
Jul 07, 2020
by
jiangkebao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into jkb
# Conflicts: # src/Service/Interfaces/SocketIoServiceInterface.php
parents
7e64c1b6
c7842f12
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
289 additions
and
100 deletions
+289
-100
MessageHandler.php
src/Handler/MessageHandler.php
+50
-0
BaseRepository.php
src/Repository/Eloquent/BaseRepository.php
+1
-1
BaseInfoServiceInterface.php
src/Service/Interfaces/BaseInfoServiceInterface.php
+22
-0
DispatchPlanServiceInterface.php
src/Service/Interfaces/DispatchPlanServiceInterface.php
+0
-40
MessageServiceInterface.php
src/Service/Interfaces/MessageServiceInterface.php
+23
-0
MessageTemplateServiceInterface.php
src/Service/Interfaces/MessageTemplateServiceInterface.php
+0
-20
MaterialServiceInterface.php
src/Service/Interfaces/Product/MaterialServiceInterface.php
+21
-0
PlatformProductChildServiceInterface.php
...terfaces/Product/PlatformProductChildServiceInterface.php
+8
-0
PlatformProductServiceInterface.php
...ce/Interfaces/Product/PlatformProductServiceInterface.php
+5
-4
ProductChildServiceInterface.php
...rvice/Interfaces/Product/ProductChildServiceInterface.php
+46
-0
ProductServiceInterface.php
src/Service/Interfaces/Product/ProductServiceInterface.php
+50
-19
SocketIoServiceInterface.php
src/Service/Interfaces/SocketIoServiceInterface.php
+0
-14
StoreServiceInterface.php
src/Service/Interfaces/StoreServiceInterface.php
+20
-0
ExcelImporter.php
src/Tools/ExcelImporter.php
+4
-1
Exporter.php
src/Tools/Exporter.php
+1
-1
functions.php
src/functions.php
+38
-0
No files found.
src/Handler/MessageHandler.php
0 → 100644
View file @
0a7b0c46
<?php
/**
* Created by PhpStorm.
* User: Zero
* Date: 2020/7/3
* Time: 14:27
*/
namespace
Meibuyu\Micro\Handler
;
use
Hyperf\Contract\ConfigInterface
;
use
Hyperf\Di\Annotation\Inject
;
use
Meibuyu\Micro\Exceptions\HttpResponseException
;
use
Meibuyu\Micro\Model\Auth
;
use
Meibuyu\Micro\Service\Interfaces\MessageServiceInterface
;
class
MessageHandler
{
/**
* @Inject()
* @var MessageServiceInterface
*/
private
$messageService
;
/**
* @Inject
* @var ConfigInterface
*/
protected
$config
;
/**
* 发送模板消息
* @param $receiverIds
* @param $templateId
* @param array $replace
* @throws HttpResponseException
*/
public
function
sendTemp
(
$receiverIds
,
$templateId
,
$replace
=
[])
{
$application
=
$this
->
config
->
get
(
'app_name'
);
if
(
!
$application
)
{
throw
new
HttpResponseException
(
"请设置应用名app_name"
);
}
$receiverIds
=
is_array
(
$receiverIds
)
?
$receiverIds
:
[
$receiverIds
];
$sendUserId
=
Auth
::
id
();
$this
->
messageService
->
send
(
$receiverIds
,
$application
,
$templateId
,
$sendUserId
,
$replace
);
}
}
\ No newline at end of file
src/Repository/Eloquent/BaseRepository.php
View file @
0a7b0c46
...
...
@@ -25,7 +25,7 @@ abstract class BaseRepository implements RepositoryInterface
/**
* @var ContainerInterface
*/
pr
ivate
$container
;
pr
otected
$container
;
/**
* @var RequestInterface
...
...
src/Service/Interfaces/BaseInfoServiceInterface.php
View file @
0a7b0c46
...
...
@@ -53,6 +53,13 @@ interface BaseInfoServiceInterface
*/
public
function
getCurrencyListByIdList
(
array
$idList
,
array
$columns
=
[
'id'
,
'name'
])
:
array
;
/**
* 通过Keyword获取货币id数组
* @param $keyword
* @return array
*/
public
function
getCurrencyIdsByKeyword
(
$keyword
);
/**
* 通过单个id获取岗位信息
* @param int $id 职位id
...
...
@@ -140,4 +147,19 @@ interface BaseInfoServiceInterface
*/
public
function
sites
(
array
$relations
=
[],
array
$columns
=
[
'id'
,
"name"
])
:
array
;
/**
* 获取部门领导id数据
* @param array $ids 部门id数组
* @return array
*/
public
function
getDepartmentLeaderIdsByIds
(
$ids
);
/**
* 获取审阅人员
* @param $teamId
* @param $authId
* @return array|bool
*/
public
function
getReviewUsers
(
$teamId
,
$authId
);
}
src/Service/Interfaces/DispatchPlanServiceInterface.php
View file @
0a7b0c46
...
...
@@ -11,44 +11,4 @@ namespace Meibuyu\Micro\Service\Interfaces;
interface
DispatchPlanServiceInterface
{
/**
* description:获取退税任务列表
* author: fuyunnan
* @param array $conditions 筛选条件
* @param int $pageSize 默认10
* Date: 2020/6/13
* @return array
*/
public
function
listRefundTasks
(
array
$conditions
,
int
$pageSize
=
DEFAULT_PAGE_SIZE
)
:
array
;
/**
* description:新建退税单 获取底部产品列表
* author: fuyunnan
* @param array $conditions 请求参数
* @param int $pageSize 请求参数
* Date: 2020/6/13
* @return array
*/
public
function
listRefundProducts
(
array
$conditions
=
[],
int
$pageSize
=
DEFAULT_PAGE_SIZE
)
:
array
;
/**
* description:删除退税任务
* author: fuyunnan
* @param int $id 计划任务id
* Date: 2020/6/13
* @return bool
*/
public
function
delete
(
$id
)
:
bool
;
/**
* description:获取发货计划详情
* author: fuyunnan
* @param array $idList
* @param array $conditions 将参数条件写成二维数组形式 $conditions = [ ['id','=',1],['name','=',''jack] ]
* Date: 2020/6/13
* @return array
*/
public
function
getDispatchPlan
(
array
$idList
,
array
$conditions
=
[])
:
array
;
}
src/Service/Interfaces/MessageServiceInterface.php
0 → 100644
View file @
0a7b0c46
<?php
/**
* Created by PhpStorm.
* User: 姜克保
* Date: 2020/5/20
* Time: 15:48
*/
namespace
Meibuyu\Micro\Service\Interfaces
;
use
phpDocumentor\Reflection\Types\Integer
;
interface
MessageServiceInterface
{
/**
* @param array $receiveUserId 接收人id
* @param string $application 应用名称
* @param int $sendUserId 发送人id(发送人id等于0时是系统消息)
* @param int $templateId 模板id
* @param array $replace 替换模板内容
*/
public
function
send
(
array
$receiveUserId
,
$application
,
$templateId
,
$sendUserId
=
0
,
$replace
=
[])
:
bool
;
}
src/Service/Interfaces/MessageTemplateServiceInterface.php
deleted
100644 → 0
View file @
7e64c1b6
<?php
/**
* Created by PhpStorm.
* User: 姜克保
* Date: 2020/5/20
* Time: 15:48
*/
namespace
Meibuyu\Micro\Service\Interfaces
;
interface
MessageTemplateServiceInterface
{
/**
* 返回替换后的模板内容
* @param int $template_id 模板id
* @param array $replace 替换内容(注意顺序)
* @return string
*/
public
function
getMessage
(
int
$template_id
,
array
$replace
=
[])
:
string
;
}
src/Service/Interfaces/Product/MaterialServiceInterface.php
View file @
0a7b0c46
...
...
@@ -43,4 +43,25 @@ interface MaterialServiceInterface
*/
public
function
getMaterialNamesByIdList
(
array
$idList
,
array
$columns
=
[
'*'
])
:
array
;
/**
* 获取某原料品类下的所有原料品名
* @param $categoryId
* @return array
*/
public
function
getMaterialNamesByCategoryId
(
$categoryId
);
/**
* 判断产品是否绑定原料品名
* @param $productId
* @return bool
*/
public
function
hasProductMaterialNames
(
$productId
)
:
bool
;
/**
* 获取产品绑定的原料品名
* @param $productId
* @return array keyBy('id')
*/
public
function
getProductMaterialNames
(
$productId
);
}
src/Service/Interfaces/Product/PlatformProductChildServiceInterface.php
View file @
0a7b0c46
...
...
@@ -53,4 +53,12 @@ interface PlatformProductChildServiceInterface
*/
public
function
getBySkuList
(
array
$skuList
,
$siteId
,
array
$relations
=
[],
$columns
=
[
'*'
])
:
array
;
/**
* 模糊搜索平台子sku,获取id数组
* @param string $childSku 平台子sku
* @param array|null $limitIds 限制id数组,不传为不限制
* @return array
*/
public
function
getIdsByChildSku
(
string
$childSku
,
array
$limitIds
=
null
);
}
src/Service/Interfaces/Product/PlatformProductServiceInterface.php
View file @
0a7b0c46
...
...
@@ -34,10 +34,11 @@ interface PlatformProductServiceInterface
public
function
getByIdList
(
array
$idList
,
array
$relations
=
[],
$columns
=
[
'*'
])
:
array
;
/**
* 获取全部平台产品状态列表
* @param array $columns 默认['id', 'name']
* 获取申报要素数据
* @param array $idList
* @param bool $groupByFlag
* @return array
*/
public
function
platformProductStatus
(
array
$columns
=
[
'id'
,
'name'
])
:
array
;
public
function
getWithPoint
(
array
$idList
,
$groupByFlag
=
false
)
;
}
src/Service/Interfaces/Product/ProductChildServiceInterface.php
View file @
0a7b0c46
...
...
@@ -37,4 +37,50 @@ interface ProductChildServiceInterface
*/
public
function
getListBySkuList
(
array
$skuList
,
array
$columns
=
[
'id'
]);
/**
* 获取全部尺码列表
* @param array $columns 默认['id', 'name']
* @return array
*/
public
function
sizes
(
array
$columns
=
[
'id'
,
'name'
])
:
array
;
/**
* 获取全部颜色列表
* @param array $columns 默认['id', 'code', 'cn_name', 'en_name']
* @return array
*/
public
function
colors
(
array
$columns
=
[
'id'
,
'code'
,
'cn_name'
,
'en_name'
])
:
array
;
/**
* 通过id数组获取尺码列表
* @param array $ids 默认去重
* @param array $columns
* @return array 默认keyBY('id')
*/
public
function
getSizesByIds
(
array
$ids
,
$columns
=
[
'id'
,
'name'
])
:
array
;
/**
* 通过id数组获取颜色列表
* @param array $ids 默认去重
* @param array $columns
* @return array 默认keyBY('id')
*/
public
function
getColorsByIds
(
array
$ids
,
array
$columns
=
[
'id'
,
'code'
,
'cn_name'
,
'en_name'
])
:
array
;
/**
* 通过id获取尺码
* @param int $id
* @param array $columns
* @return array|null
*/
public
function
getSizeById
(
int
$id
,
$columns
=
[
'id'
,
'name'
]);
/**
* 通过id获取颜色
* @param int $id
* @param array $columns
* @return array|null
*/
public
function
getColorById
(
int
$id
,
array
$columns
=
[
'id'
,
'code'
,
'cn_name'
,
'en_name'
]);
}
src/Service/Interfaces/Product/ProductServiceInterface.php
View file @
0a7b0c46
...
...
@@ -21,7 +21,7 @@ interface ProductServiceInterface
* , 'bar_code', 'bar_code_image', 'creator_id', 'hot']
* @return array|null
*/
public
function
get
(
$id
,
array
$relations
=
[],
$columns
=
[
'*'
]);
public
function
get
(
$id
,
array
$relations
=
[],
array
$columns
=
[
'*'
]);
/**
* 通过id列表获取产品数组
...
...
@@ -35,20 +35,6 @@ interface ProductServiceInterface
*/
public
function
getByIdList
(
array
$idList
,
array
$relations
=
[],
array
$columns
=
[
'*'
])
:
array
;
/**
* 获取全部尺码列表
* @param array $columns 默认['id', 'name']
* @return array
*/
public
function
sizes
(
array
$columns
=
[
'id'
,
'name'
])
:
array
;
/**
* 获取全部颜色列表
* @param array $columns 默认['id', 'code', 'cn_name', 'en_name']
* @return array
*/
public
function
colors
(
array
$columns
=
[
'id'
,
'code'
,
'cn_name'
,
'en_name'
])
:
array
;
/**
* 获取全部品类列表
* @param bool $asTree 是否作为树返回
...
...
@@ -79,10 +65,55 @@ interface ProductServiceInterface
public
function
ingredients
(
array
$columns
=
[
'id'
,
'name'
,
'en_name'
])
:
array
;
/**
* 获取全部产品状态列表
* @param array $columns 默认['id', 'name']
* @return array
* 通过id数组获取品类列表
* @param array $ids 默认去重
* @param array $columns
* @return array 默认keyBY('id')
*/
public
function
getCategoriesByIds
(
array
$ids
,
array
$columns
=
[
'id'
,
'name'
,
'parent_id'
])
:
array
;
/**
* 通过id数组获取品名列表
* @param array $ids 默认去重
* @param array $columns
* @param array $relations ['report_points']
* @return array 默认keyBY('id')
*/
public
function
getProductNamesByIds
(
array
$ids
,
array
$columns
=
[
'id'
,
'name'
,
'en_name'
],
array
$relations
=
[])
:
array
;
/**
* 通过id获取品类
* @param int $id
* @param array $columns
* @return array|null
*/
public
function
getCategoryById
(
int
$id
,
array
$columns
=
[
'id'
,
'name'
,
'parent_id'
]);
/**
* 通过id获取品名
* @param int $id
* @param array $columns
* @param array $relations ['report_points']
* @return array|null
*/
public
function
getProductNameById
(
int
$id
,
array
$columns
=
[
'id'
,
'name'
,
'en_name'
],
array
$relations
=
[]);
/**
* 通过id数组获取申报要素列表
* @param array $ids 默认去重
* @param array $columns
* @param array $relations ['product_name', 'ingredient']
* @return array 默认keyBY('id')
*/
public
function
getReportPointsByIds
(
array
$ids
,
array
$relations
=
[],
array
$columns
=
[
'id'
,
'hs_code'
,
'point'
])
:
array
;
/**
* 通过id获取申报要素
* @param int $id
* @param array $columns
* @param array $relations ['product_name', 'ingredient']
* @return array|null
*/
public
function
productStatus
(
array
$columns
=
[
'id'
,
'name'
])
:
array
;
public
function
getReportPointById
(
int
$id
,
array
$relations
=
[],
array
$columns
=
[
'id'
,
'hs_code'
,
'point'
])
;
}
src/Service/Interfaces/SocketIoServiceInterface.php
deleted
100644 → 0
View file @
7e64c1b6
<?php
/**
* Created by PhpStorm.
* User: 姜克保
* Date: 2020/5/20
* Time: 15:48
*/
namespace
Meibuyu\Micro\Service\Interfaces
;
interface
SocketIoServiceInterface
{
public
function
sendToUsers
(
array
$userIdList
,
$message
);
}
src/Service/Interfaces/StoreServiceInterface.php
View file @
0a7b0c46
...
...
@@ -10,4 +10,24 @@ namespace Meibuyu\Micro\Service\Interfaces;
interface
StoreServiceInterface
{
/**
* 通过id列表获取仓库名称
* @param array $idList 仓库id的列表, 默认去重
* @param array $columns 仓库表的字段,默认显示全部
* @return array 默认keyBy('id')
*/
public
function
getByIdList
(
array
$idList
,
array
$columns
=
[
'*'
])
:
array
;
/**
* description:创建入库单
* author: fuyunnan
* @param array $data 需要入库的数组 格式请参考yapi 入库添加
* @return array
* @throws
* Date: 2020/7/6
*/
public
function
createWarehousing
(
array
$data
)
:
array
;
}
src/Tools/ExcelImporter.php
View file @
0a7b0c46
...
...
@@ -124,6 +124,9 @@ class ExcelImporter
public
function
checkRequire
(
$requires
,
&
$errorCount
)
{
foreach
(
$requires
as
$k
=>
$v
)
{
if
(
$v
==
'0'
)
{
continue
;
}
if
(
!
$v
||
$v
===
''
)
{
$this
->
setErrorMessage
(
$k
.
"不能为空"
,
$errorCount
);
return
false
;
...
...
@@ -141,7 +144,7 @@ class ExcelImporter
public
function
checkNumeric
(
$data
,
&
$errorCount
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
!
$v
||
$v
===
''
)
{
if
(
!
$v
||
$v
===
''
||
$v
==
'0'
)
{
continue
;
}
else
{
if
(
!
is_numeric
(
$v
))
{
...
...
src/Tools/Exporter.php
View file @
0a7b0c46
...
...
@@ -266,7 +266,7 @@ class Exporter
* @param $pRange
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
p
rivate
function
applyStyle
(
$pRange
)
p
ublic
function
applyStyle
(
$pRange
)
{
$styleArray
=
[
'borders'
=>
[
...
...
src/functions.php
View file @
0a7b0c46
...
...
@@ -451,6 +451,25 @@ if (!function_exists('putLog')) {
}
if
(
!
function_exists
(
'http_to_server_url'
))
{
/**
* description:将前端的绝对路径转化为服务端相对路径
* author: fuyunnan
* @param string $path 需要转化的路径
* @return string
* @throws
* Date: 2020/6/24
*/
function
http_to_server_url
(
$path
)
{
$path
=
ltrim
(
parse_url
(
$path
,
PHP_URL_PATH
),
'/'
);
return
'public/'
.
$path
;
}
}
if
(
!
function_exists
(
'empty_string_2_null'
))
{
/**
* 空字符串转NULL
...
...
@@ -660,4 +679,23 @@ if (!function_exists('make_has_relation_function')) {
}
if
(
!
function_exists
(
'int_to_chr'
))
{
/**
* 数字转字母 (类似于Excel列标)
* @param $index 索引值
* @param int $start 字母起始值
* @return string 返回字母
*/
function
int_to_chr
(
$index
,
$start
=
65
)
{
$str
=
''
;
if
(
floor
(
$index
/
26
)
>
0
)
{
$str
.=
int_to_chr
(
floor
(
$index
/
26
)
-
1
);
}
return
$str
.
chr
(
$index
%
26
+
$start
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment