Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
chejia-smart-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c1e735c6
authored
Apr 27, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
查询产品树修改
1 parent
daed9eb6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
0 deletions
src/main/java/com/glsx/smart/enums/DeviceChannelEnum.java
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
src/main/java/com/glsx/smart/enums/DeviceChannelEnum.java
0 → 100644
View file @
c1e735c
package
com
.
glsx
.
smart
.
enums
;
/**
* <p>Description:
* <p>Project: chejia-smart
*
* @author wbh
* @date 2021-04-27
*/
public
enum
DeviceChannelEnum
{
TU_YA
((
byte
)
0
,
"access_platform_tuya"
),
AQARA
((
byte
)
0
,
"access_platform_aqara"
),
DIDIHU
((
byte
)
0
,
"access_platform_didihu"
)
;
private
final
Byte
channel
;
private
final
String
platformKey
;
DeviceChannelEnum
(
Byte
channel
,
String
platformKey
)
{
this
.
channel
=
channel
;
this
.
platformKey
=
platformKey
;
}
public
static
Byte
getChannelByPlatformKey
(
String
platformKey
)
{
Byte
channel
=
values
()[
0
].
channel
;
for
(
DeviceChannelEnum
value
:
values
())
{
if
(
value
.
platformKey
.
equalsIgnoreCase
(
platformKey
))
{
channel
=
value
.
channel
;
break
;
}
}
return
channel
;
}
}
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
View file @
c1e735c
...
@@ -14,6 +14,7 @@ import com.glsx.smart.dao.entity.SmartSysCode;
...
@@ -14,6 +14,7 @@ import com.glsx.smart.dao.entity.SmartSysCode;
import
com.glsx.smart.dao.mapper.SmartDeviceOrderMapper
;
import
com.glsx.smart.dao.mapper.SmartDeviceOrderMapper
;
import
com.glsx.smart.dao.mapper.SmartProductMapper
;
import
com.glsx.smart.dao.mapper.SmartProductMapper
;
import
com.glsx.smart.dao.mapper.SmartSysCodeMapper
;
import
com.glsx.smart.dao.mapper.SmartSysCodeMapper
;
import
com.glsx.smart.enums.DeviceChannelEnum
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.service.BaseService
;
import
com.glsx.smart.service.BaseService
;
...
@@ -263,6 +264,9 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
...
@@ -263,6 +264,9 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
productInfo
.
put
(
"icon"
,
product
.
getIconUrl
());
productInfo
.
put
(
"icon"
,
product
.
getIconUrl
());
productInfo
.
put
(
"typeId"
,
product
.
getNetworkKey
());
productInfo
.
put
(
"typeId"
,
product
.
getNetworkKey
());
productInfo
.
put
(
"shopProductId"
,
product
.
getShopProductId
());
productInfo
.
put
(
"shopProductId"
,
product
.
getShopProductId
());
productInfo
.
put
(
"platformKey"
,
product
.
getPlatformKey
());
productInfo
.
put
(
"channel"
,
DeviceChannelEnum
.
getChannelByPlatformKey
(
product
.
getPlatformKey
()));
productInfoArray
.
add
(
productInfo
);
productInfoArray
.
add
(
productInfo
);
}
}
// 将本级分类名和匹配到的产品类型放到 list 中
// 将本级分类名和匹配到的产品类型放到 list 中
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment