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 9dadf665
authored
Mar 17, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
获取产品指令集功能
1 parent
4f2b2053
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
src/main/java/com/glsx/smart/controller/ProductController.java
src/main/java/com/glsx/smart/service/SmartProductService.java
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
src/main/java/com/glsx/smart/controller/ProductController.java
View file @
9dadf66
package
com
.
glsx
.
smart
.
controller
;
package
com
.
glsx
.
smart
.
controller
;
import
java.util.List
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.glsx.plat.common.utils.StringUtils
;
import
com.glsx.smart.dao.entity.SmartDeviceOrder
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
...
@@ -69,12 +71,12 @@ public class ProductController {
...
@@ -69,12 +71,12 @@ public class ProductController {
* @param id 产品 id
* @param id 产品 id
*/
*/
@RequestMapping
(
value
=
"/getCommandSetById"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/getCommandSetById"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
void
getCommandSetById
(
Lo
ng
id
)
{
public
List
<
SmartDeviceOrder
>
getCommandSetById
(
Stri
ng
id
)
{
log
.
info
(
"$$$$ /product/getCommandSetById param: {}"
,
id
);
log
.
info
(
"$$$$ /product/getCommandSetById param: {}"
,
id
);
if
(
id
==
null
)
{
if
(
StringUtils
.
isBlank
(
id
)
)
{
throw
new
BusinessException
(
ResultEnum
.
PARAM_ERROR
);
throw
new
BusinessException
(
ResultEnum
.
PARAM_ERROR
);
}
}
productService
.
getCommandSetById
(
id
);
return
productService
.
getCommandSetById
(
id
);
}
}
/**
/**
...
...
src/main/java/com/glsx/smart/service/SmartProductService.java
View file @
9dadf66
package
com
.
glsx
.
smart
.
service
;
package
com
.
glsx
.
smart
.
service
;
import
java.util.List
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.smart.dao.entity.SmartDeviceOrder
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
com.glsx.smart.dao.entity.SmartProduct
;
/**
/**
...
@@ -18,7 +20,7 @@ public interface SmartProductService {
...
@@ -18,7 +20,7 @@ public interface SmartProductService {
void
save
(
SmartProduct
product
);
void
save
(
SmartProduct
product
);
void
getCommandSetById
(
Long
i
d
);
List
<
SmartDeviceOrder
>
getCommandSetById
(
String
productI
d
);
boolean
checkShopProductId
(
String
shopProductId
);
boolean
checkShopProductId
(
String
shopProductId
);
...
...
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
View file @
9dadf66
...
@@ -5,13 +5,16 @@ import java.util.Date;
...
@@ -5,13 +5,16 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.smart.dao.entity.SmartDeviceOrder
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
com.glsx.smart.dao.entity.SmartProduct
;
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.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
;
import
com.glsx.smart.service.SmartProductService
;
import
com.glsx.smart.service.SmartProductService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -28,6 +31,9 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
...
@@ -28,6 +31,9 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
@Resource
@Resource
private
SmartProductMapper
productMapper
;
private
SmartProductMapper
productMapper
;
@Autowired
private
SmartDeviceOrderMapper
deviceOrderMapper
;
/**
/**
* 获取产品列表。
* 获取产品列表。
*
*
...
@@ -86,11 +92,14 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
...
@@ -86,11 +92,14 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
/**
/**
* 根据产品 id 获取指令集。
* 根据产品 id 获取指令集。
*
*
* @param id 产品 id
* @param productId 产品 id
* @return 结果
*/
*/
@Override
@Override
public
void
getCommandSetById
(
Long
id
)
{
public
List
<
SmartDeviceOrder
>
getCommandSetById
(
String
productId
)
{
SmartDeviceOrder
example
=
new
SmartDeviceOrder
();
example
.
setProductId
(
productId
);
return
deviceOrderMapper
.
select
(
example
);
}
}
/**
/**
...
...
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