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
59d72e24
Commit
59d72e24
authored
Aug 18, 2020
by
fuyunnan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into develop
parents
f233932c
c81f753e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
55 deletions
+85
-55
MessageHandler.php
src/Handler/MessageHandler.php
+33
-0
DatacenterServiceInterface.php
src/Service/Interfaces/DatacenterServiceInterface.php
+27
-0
MaterialServiceInterface.php
src/Service/Interfaces/MaterialServiceInterface.php
+0
-46
MaterialServiceInterface.php
src/Service/Interfaces/Product/MaterialServiceInterface.php
+11
-3
ProductChildServiceInterface.php
...rvice/Interfaces/Product/ProductChildServiceInterface.php
+8
-0
Drawer.php
src/Tools/Drawer.php
+4
-4
ExcelImporter.php
src/Tools/ExcelImporter.php
+2
-2
No files found.
src/Handler/MessageHandler.php
View file @
59d72e24
...
...
@@ -64,4 +64,37 @@ class MessageHandler
$this
->
messageService
->
send
(
$receiverIds
,
$application
,
0
,
$sendUserId
,
[],
$content
);
}
/**
* 自动发送模板消息
* @param $receiverIds
* @param $templateId
* @param array $replace
* @throws HttpResponseException
*/
public
function
sendAutoTemp
(
$receiverIds
,
$templateId
,
$replace
=
[])
{
$application
=
$this
->
config
->
get
(
'app_name'
);
if
(
!
$application
)
{
throw
new
HttpResponseException
(
"请设置应用名app_name"
);
}
$receiverIds
=
is_array
(
$receiverIds
)
?
$receiverIds
:
[
$receiverIds
];
$this
->
messageService
->
send
(
$receiverIds
,
$application
,
$templateId
,
0
,
$replace
);
}
/**
* 定时任务专用 发送文本消息
* @param $receiverIds
* @param $content
* @throws HttpResponseException
*/
public
function
sendCrontabText
(
$receiverIds
,
$content
)
{
$application
=
$this
->
config
->
get
(
'app_name'
);
if
(
!
$application
)
{
throw
new
HttpResponseException
(
"请设置应用名app_name"
);
}
$receiverIds
=
is_array
(
$receiverIds
)
?
$receiverIds
:
[
$receiverIds
];
$this
->
messageService
->
send
(
$receiverIds
,
$application
,
0
,
0
,
[],
$content
);
}
}
src/Service/Interfaces/DatacenterServiceInterface.php
0 → 100644
View file @
59d72e24
<?php
/**
* Created by PhpStorm.
* User: 王源
* Date: 2020/3/16
* Time: 15:07
*/
namespace
Meibuyu\Micro\Service\Interfaces
;
interface
DatacenterServiceInterface
{
/**
* description:获取国家汇率 默认取最新一个汇率值
* author: fuyunnan
* @param int $currencyId 货币id
* @param array $field 字段
* @return array
* @throws
* Date: 2020/8/11
*/
public
function
getCurrencyRate
(
$currencyId
,
$field
=
[
'id'
,
'currency_id'
,
'rate_val'
])
:
array
;
}
\ No newline at end of file
src/Service/Interfaces/MaterialServiceInterface.php
deleted
100644 → 0
View file @
f233932c
<?php
/**
* Created by PhpStorm.
* User: 梁俊杰
* Date: 2020/5/15
* Time: 15:07
*/
namespace
Meibuyu\Micro\Service\Interfaces
;
interface
MaterialServiceInterface
{
/**
* 获取单个数据
* @param int $id 原料id
* @param array $columns 原料表的字段,默认显示全部
* @return array|null
*/
public
function
get
(
$id
,
array
$columns
=
[
'*'
]);
/**
* 通过id列表获取原料数组
* @param array $idList 原料id的列表, 默认去重
* @param array $columns 原料表的字段,默认显示全部
* @return array 默认keyBy('id')
*/
public
function
getByIdList
(
array
$idList
,
array
$columns
=
[
'*'
])
:
array
;
/**
* 通过内部code列表获取原料列表
* @param array $codeList 默认去重
* @param array $columns
* @return array 默认keyBy('internal_code')
*/
public
function
getByCodeList
(
array
$codeList
,
array
$columns
=
[
'id'
]);
/**
* 通过原料品名id列表获取原料品名数组
* @param array $idList 原料品名id的列表, 默认去重
* @param array $columns 原料品名表的字段,默认显示全部
* @return array 默认keyBy('id')
*/
public
function
getMaterialNamesByIdList
(
array
$idList
,
array
$columns
=
[
'*'
])
:
array
;
}
src/Service/Interfaces/Product/MaterialServiceInterface.php
View file @
59d72e24
...
...
@@ -39,7 +39,7 @@ interface MaterialServiceInterface
* 获取指定品名下所有的原料数据
* @param array $nameIds 默认去重
* @param array $columns
* @return array 默认
key
By('material_name_id')
* @return array 默认
group
By('material_name_id')
*/
public
function
getListByNameIds
(
array
$nameIds
,
array
$columns
=
[
'*'
]);
...
...
@@ -76,9 +76,17 @@ interface MaterialServiceInterface
/**
* 获取产品对应颜色绑定的原料
* @param $productId
* @param array $colorIds
* @param array $colorIds 默认去重
* @param bool $withMaterials
* @return array 默认keyBy('color_id')
*/
public
function
getProductColorMaterials
(
$productId
,
array
$colorIds
,
$withMaterials
=
false
);
/**
* 获取维护完全原料数量的颜色id
* @param $productId
* @return array
*/
public
function
get
ProductColorMaterials
(
$productId
,
array
$colorIds
);
public
function
get
FullMaterialCountColorIds
(
$productId
);
}
src/Service/Interfaces/Product/ProductChildServiceInterface.php
View file @
59d72e24
...
...
@@ -92,4 +92,12 @@ interface ProductChildServiceInterface
*/
public
function
getListByProductId
(
int
$productId
,
$columns
=
[
'id'
,
'child_sku'
]);
/**
* 模糊搜索仓库子sku,获取id数组
* @param string $childSku 仓库子sku
* @param array|null $limitIds 限制id数组,不传为不限制
* @return array
*/
public
function
getIdsByChildSku
(
string
$childSku
,
array
$limitIds
=
null
);
}
src/Tools/Drawer.php
View file @
59d72e24
...
...
@@ -154,14 +154,14 @@ class Drawer
* @param int $h 图片高度
* @param string $p 单元格索引
* @param Worksheet $sheet
* @param
bool $addBoard
* @param
int $boardPx
*/
public
function
draw2Excel
(
$path
,
$h
,
$p
,
$sheet
,
$
addBoard
=
true
)
public
function
draw2Excel
(
$path
,
$h
,
$p
,
$sheet
,
$
boardPx
=
0
)
{
try
{
$path
=
$this
->
parseImagePath
(
$path
);
if
(
$
addBoard
)
{
$path
=
$this
->
addBoard
(
$path
);
if
(
$
boardPx
)
{
$path
=
$this
->
addBoard
(
$path
,
$boardPx
);
}
$drawing
=
new
Drawing
();
$drawing
->
setPath
(
$path
)
->
setCoordinates
(
$p
)
->
setHeight
(
$h
)
->
setWorksheet
(
$sheet
);
...
...
src/Tools/ExcelImporter.php
View file @
59d72e24
...
...
@@ -116,7 +116,7 @@ class ExcelImporter
}
/**
*
必填检测
数据
*
检测必填
数据
* @param $requires
* @param $errorCount
* @throws \PhpOffice\PhpSpreadsheet\Exception
...
...
@@ -136,7 +136,7 @@ class ExcelImporter
}
/**
*
必填检测
数据
*
检测数字类型
数据
* @param $data
* @param $errorCount
* @throws \PhpOffice\PhpSpreadsheet\Exception
...
...
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