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
2e19bdf8
Commit
2e19bdf8
authored
Jun 04, 2020
by
梁俊杰
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 39.100.151.123:hwq/micro
# Conflicts: # src/functions.php 修复冲突
parents
2f50fd8b
7e572e33
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
20 deletions
+104
-20
BaseInfoServiceInterface.php
src/Service/Interfaces/BaseInfoServiceInterface.php
+10
-10
DispatchPlanServiceInterface.php
src/Service/Interfaces/DispatchPlanServiceInterface.php
+25
-0
MessageTemplateServiceInterface.php
src/Service/Interfaces/MessageTemplateServiceInterface.php
+20
-0
WebSocketServiceInterface.php
src/Service/Interfaces/WebSocketServiceInterface.php
+13
-0
ExcelImporter.php
src/Tools/ExcelImporter.php
+31
-5
functions.php
src/functions.php
+5
-5
No files found.
src/Service/Interfaces/BaseInfoServiceInterface.php
View file @
2e19bdf8
...
...
@@ -66,44 +66,44 @@ interface BaseInfoServiceInterface
* 根据id获取单个数据
* @param int $id 货币id
* @param array $columns 要显示的字段 默认全部 ['id', 'name', 'code', 'symbol']
* @return array
* @return array
|null
*/
public
function
getCurrencyById
(
$id
,
array
$columns
=
[
'id'
,
'name'
,
'code'
,
'symbol'
])
:
array
;
public
function
getCurrencyById
(
$id
,
array
$columns
=
[
'id'
,
'name'
,
'code'
,
'symbol'
]);
/**
* 根据id获取单个数据
* @param int $id
* @param array $columns 要显示的字段 默认全部
* @return array
* @return array
|null
*/
public
function
getCountryById
(
$id
,
array
$columns
=
[
'*'
])
:
array
;
public
function
getCountryById
(
$id
,
array
$columns
=
[
'*'
]);
/**
* 获取单个团队数据
* @param int $id
* @param array $relations 支持的关联关系 ['leader', 'sites', "users", "parent", "children"] 分别代表 负责人、团队下的站点、团队成员、父级团队,再级团队
* @param array $columns 要显示的字段 默认['id', 'pid', "name", "leader_user_id", "leader_user_id", "department_id"]
* @return array
* @return array
|null
*/
public
function
getTeamById
(
$id
,
array
$relations
=
[],
array
$columns
=
[
'id'
,
'pid'
,
"name"
,
"leader_user_id"
,
"leader_user_id"
,
"department_id"
])
:
array
;
public
function
getTeamById
(
$id
,
array
$relations
=
[],
array
$columns
=
[
'id'
,
'pid'
,
"name"
,
"leader_user_id"
,
"leader_user_id"
,
"department_id"
]);
/**
* 获取单个站点数据
* @param int $id
* @param array $relations $relations 支持的关联关系 ['team', 'country'] 分别代表 团队、国家、
* @param array $columns 要显示的字段 默认['id', "name", "url", "country_id", "team_id"]
* @return array
* @return array
|null
*/
public
function
getSiteById
(
$id
,
array
$relations
=
[],
array
$columns
=
[
'id'
,
"name"
,
"url"
,
"country_id"
,
"team_id"
])
:
array
;
public
function
getSiteById
(
$id
,
array
$relations
=
[],
array
$columns
=
[
'id'
,
"name"
,
"url"
,
"country_id"
,
"team_id"
]);
/**
* 根据团队id获取对应的站点列表
* @param int $teamId 团队id
* @param array $relations $relations 支持的关联关系 ['team', 'country'] 分别代表 团队、国家、
* @param array $columns 要显示的字段 默认['id', "name", "url", "country_id", "team_id"]
* @return array
* @return array
|null
*/
public
function
getSiteListByTeamId
(
$teamId
,
array
$relations
=
[],
array
$columns
=
[
'id'
,
"name"
,
"url"
,
"country_id"
,
"team_id"
])
:
array
;
public
function
getSiteListByTeamId
(
$teamId
,
array
$relations
=
[],
array
$columns
=
[
'id'
,
"name"
,
"url"
,
"country_id"
,
"team_id"
]);
/**
* 返回所有货币数据
...
...
src/Service/Interfaces/DispatchPlanServiceInterface.php
0 → 100644
View file @
2e19bdf8
<?php
/**
* Created by PhpStorm.
* User: 姜克保
* Date: 2020/5/20
* Time: 15:48
*/
namespace
Meibuyu\Micro\Service\Interfaces
;
interface
DispatchPlanServiceInterface
{
/**
* 根据发货计划id获取发货计划信息
* @param int $id 计划任务id
* @return array
*/
public
function
getDispatchPlanById
(
int
$id
)
:
array
;
/**
*获取发货任务列表
* @return array
*/
public
function
listDispatchPlans
(
array
$conditions
,
bool
$isPage
=
true
)
:
array
;
}
src/Service/Interfaces/MessageTemplateServiceInterface.php
0 → 100644
View file @
2e19bdf8
<?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/WebSocketServiceInterface.php
0 → 100644
View file @
2e19bdf8
<?php
/**
* Created by PhpStorm.
* User: 姜克保
* Date: 2020/5/20
* Time: 15:48
*/
namespace
Meibuyu\Micro\Service\Interfaces\DingTalk
;
interface
WebSocketServiceInterface
{
}
src/Tools/ExcelImporter.php
View file @
2e19bdf8
...
...
@@ -121,14 +121,15 @@ class ExcelImporter
* @param $errorCount
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public
function
checkRequire
(
$requires
,
$errorCount
)
public
function
checkRequire
(
$requires
,
&
$errorCount
)
{
foreach
(
$requires
as
$k
=>
$v
)
{
if
(
$v
===
''
)
{
if
(
!
$v
||
$v
===
''
)
{
$this
->
setErrorMessage
(
$k
.
"不能为空"
,
$errorCount
);
continu
e
;
return
fals
e
;
}
}
return
true
;
}
/**
...
...
@@ -137,14 +138,15 @@ class ExcelImporter
* @param $errorCount
* @throws \PhpOffice\PhpSpreadsheet\Exception
*/
public
function
checkNumeric
(
$data
,
$errorCount
)
public
function
checkNumeric
(
$data
,
&
$errorCount
)
{
foreach
(
$data
as
$k
=>
$v
)
{
if
(
!
is_numeric
(
$v
))
{
$this
->
setErrorMessage
(
"
{
$k
}
只能是数字"
,
$errorCount
);
continu
e
;
return
fals
e
;
}
}
return
true
;
}
/**
...
...
@@ -228,4 +230,28 @@ class ExcelImporter
return
$this
->
errorColumn
;
}
/**
* 对比不同的数据,返回是否有不同
* @param array $list
* @param array $data
* @return bool
*/
public
static
function
checkDiffVal
(
array
$list
,
array
$data
)
{
foreach
(
$list
as
$key
=>
$val
)
{
if
(
isset
(
$data
[
$key
])
&&
$data
[
$key
])
{
if
(
is_array
(
$val
))
{
if
(
self
::
checkDiffVal
(
$val
,
$data
[
$key
]))
{
return
true
;
}
}
else
{
if
(
$list
[
$key
]
!==
$data
[
$key
])
{
return
true
;
}
}
}
}
return
false
;
}
}
src/functions.php
View file @
2e19bdf8
...
...
@@ -422,22 +422,22 @@ if (!function_exists('putLog')) {
/**
* description:记录日志 文件会生成在当前项目 /runtime/dev/
* author: fuyunnan
* @param string|array $output 日志内容
* @param string|array $output 日志
内容
* @param string $dir 目录
* @param string $filename 文件名称
* date: 2020/3/18
* @throws
* @return void
*/
function
put
L
og
(
$output
=
'out-mes'
,
$filename
=
''
,
$dir
=
BASE_PATH
.
'/runtime/dev/'
)
function
put
_l
og
(
$output
=
'out-mes'
,
$filename
=
''
,
$dir
=
BASE_PATH
.
'/runtime/dev/'
)
{
!
is_dir
(
$dir
)
&&
!
mkdir
(
$dir
,
0777
,
true
);
// 创建一个 Channel,参数 log 即为 Channel 的名字
$log
=
new
Logger
(
''
);
$log
=
make
(
Logger
::
class
,
[
''
]
);
// 创建两个 Handler,对应变量 $stream 和 $fire
!
$filename
&&
$filename
=
date
(
'Y-m-d'
,
time
())
.
'.log'
;
$stream
=
new
StreamHandler
(
$dir
.
$filename
,
Logger
::
WARNING
);
$fire
=
new
FirePHPHandler
(
);
$stream
=
make
(
StreamHandler
::
class
,
[
$dir
.
$filename
,
Logger
::
WARNING
]
);
$fire
=
make
(
FirePHPHandler
::
class
);
if
(
is_array
(
$output
))
{
$output
=
var_export
(
$output
,
true
);
}
...
...
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