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 4561cdc7
authored
Mar 26, 2021
by
tyfanchz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
删除无用方法和接口
1 parent
7c8ba50e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2 additions
and
81 deletions
src/main/java/com/glsx/smart/controller/ProductController.java
src/main/java/com/glsx/smart/controller/ProductTypeController.java
src/main/java/com/glsx/smart/service/SmartProductService.java
src/main/java/com/glsx/smart/service/SmartProductTypeService.java
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartProductTypeServiceImpl.java
src/main/java/com/glsx/smart/utils/DjApiInvoker.java
src/main/resources/application.properties
src/main/java/com/glsx/smart/controller/ProductController.java
View file @
4561cdc
...
@@ -112,18 +112,6 @@ public class ProductController {
...
@@ -112,18 +112,6 @@ public class ProductController {
}
}
/**
/**
* 校验商城商品 id。
*
* @param shopProductId 商品 id
* @return 商品 id 是否合法
*/
@RequestMapping
(
value
=
"/checkShopProductId"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
Boolean
checkShopProductId
(
String
shopProductId
)
{
log
.
info
(
"$$$$ /product/checkShopProductId param: {}"
,
shopProductId
);
return
productService
.
checkShopProductId
(
shopProductId
);
}
/**
* 上下架产品。
* 上下架产品。
*
*
* @param id 产品 id
* @param id 产品 id
...
...
src/main/java/com/glsx/smart/controller/ProductTypeController.java
View file @
4561cdc
...
@@ -74,17 +74,6 @@ public class ProductTypeController {
...
@@ -74,17 +74,6 @@ public class ProductTypeController {
}
}
/**
/**
* 获取商城标签。
*
* @return 结果
*/
@RequestMapping
(
value
=
"/getShopTagList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
List
<
String
>
getShopTagList
()
{
log
.
info
(
"$$$$ /productType/getShopTagList ..."
);
return
productTypeService
.
getShopTagList
();
}
/**
* 根据id列表获取指令执行内容
* 根据id列表获取指令执行内容
*
*
* @return 结果
* @return 结果
...
...
src/main/java/com/glsx/smart/service/SmartProductService.java
View file @
4561cdc
...
@@ -31,7 +31,5 @@ public interface SmartProductService {
...
@@ -31,7 +31,5 @@ public interface SmartProductService {
List
<
SmartDeviceOrder
>
getCommandSetById
(
Long
id
);
List
<
SmartDeviceOrder
>
getCommandSetById
(
Long
id
);
Boolean
checkShopProductId
(
String
shopProductId
);
Boolean
putOnOff
(
Long
id
);
Boolean
putOnOff
(
Long
id
);
}
}
src/main/java/com/glsx/smart/service/SmartProductTypeService.java
View file @
4561cdc
...
@@ -21,8 +21,6 @@ public interface SmartProductTypeService {
...
@@ -21,8 +21,6 @@ public interface SmartProductTypeService {
Boolean
save
(
SmartProductType
productType
);
Boolean
save
(
SmartProductType
productType
);
List
<
String
>
getShopTagList
();
List
<
SmartProductType
>
getListAndContent
(
List
<
Long
>
list
);
List
<
SmartProductType
>
getListAndContent
(
List
<
Long
>
list
);
List
<
SmartProductType
>
getListAndCondition
(
List
<
Long
>
list
);
List
<
SmartProductType
>
getListAndCondition
(
List
<
Long
>
list
);
...
...
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
View file @
4561cdc
...
@@ -3,9 +3,7 @@ package com.glsx.smart.service.impl;
...
@@ -3,9 +3,7 @@ package com.glsx.smart.service.impl;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -18,10 +16,8 @@ import com.glsx.smart.dao.mapper.SmartProductMapper;
...
@@ -18,10 +16,8 @@ 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.exception.BusinessException
;
import
com.glsx.smart.exception.BusinessException
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.exception.ResultEnum
;
import
com.glsx.smart.pojo.DjApiDTO
;
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
com.glsx.smart.utils.DjApiInvoker
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -204,22 +200,6 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
...
@@ -204,22 +200,6 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
}
}
/**
/**
* 校验商城商品 id。
*
* @param shopProductId 商品 id
* @return 商品 id 是否合法
*/
@Override
public
Boolean
checkShopProductId
(
String
shopProductId
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"id"
,
shopProductId
);
DjApiDTO
djApiDTO
=
DjApiInvoker
.
of
().
postForResult
(
DjApiInvoker
.
DjApiMethod
.
CHECK_SHOP_PRODUCT_ID
,
paramMap
);
boolean
valid
=
"0"
.
equals
(
djApiDTO
.
getCode
())
&&
djApiDTO
.
getData
()
!=
null
;
return
valid
;
}
/**
* 上下架产品。
* 上下架产品。
*
*
* @param id 产品 id
* @param id 产品 id
...
...
src/main/java/com/glsx/smart/service/impl/SmartProductTypeServiceImpl.java
View file @
4561cdc
package
com
.
glsx
.
smart
.
service
.
impl
;
package
com
.
glsx
.
smart
.
service
.
impl
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.smart.dao.entity.SmartProductType
;
import
com.glsx.smart.dao.entity.SmartProductType
;
import
com.glsx.smart.dao.mapper.SmartProductTypeMapper
;
import
com.glsx.smart.dao.mapper.SmartProductTypeMapper
;
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.pojo.DjApiDTO
;
import
com.glsx.smart.service.BaseService
;
import
com.glsx.smart.service.BaseService
;
import
com.glsx.smart.service.SmartProductTypeService
;
import
com.glsx.smart.service.SmartProductTypeService
;
import
com.glsx.smart.utils.DjApiInvoker
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -116,25 +109,4 @@ public class SmartProductTypeServiceImpl extends BaseService implements SmartPro
...
@@ -116,25 +109,4 @@ public class SmartProductTypeServiceImpl extends BaseService implements SmartPro
public
List
<
SmartProductType
>
getListAndCondition
(
List
<
Long
>
list
)
{
public
List
<
SmartProductType
>
getListAndCondition
(
List
<
Long
>
list
)
{
return
productTypeMapper
.
getListAndCondition
(
list
);
return
productTypeMapper
.
getListAndCondition
(
list
);
}
}
/**
* 获取商城标签。
*
* @return 结果
*/
@Override
public
List
<
String
>
getShopTagList
()
{
List
<
String
>
shopTagList
=
new
ArrayList
<>();
DjApiDTO
djApiDTO
=
DjApiInvoker
.
of
().
postForResult
(
DjApiInvoker
.
DjApiMethod
.
GET_SHOP_TAGS
,
new
HashMap
<>());
String
data
=
djApiDTO
.
getData
();
if
(
"0"
.
equals
(
djApiDTO
.
getCode
())
&&
data
!=
null
)
{
JSONArray
dataList
=
JSON
.
parseArray
(
data
);
for
(
int
i
=
0
;
i
<
dataList
.
size
();
i
++)
{
JSONObject
obj
=
dataList
.
getJSONObject
(
i
);
shopTagList
.
add
(
obj
.
getString
(
"labelName"
));
}
}
return
shopTagList
;
}
}
}
src/main/java/com/glsx/smart/utils/DjApiInvoker.java
View file @
4561cdc
...
@@ -14,18 +14,17 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -14,18 +14,17 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.context.ApplicationContextAware
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.stereotype.Component
;
/**
/**
* <p>Description: 嘀加商城 API 调用工具类
* <p>Description: 嘀加商城 API 调用工具类
* <p>Project: chejia-smart
* <p>Project: chejia-smart
*
*
* @deprecated 已废弃,
不用 http 方式
调用嘀加接口
* @deprecated 已废弃,
改成在上层应用中使用 dubbo
调用嘀加接口
* @author wbh
* @author wbh
* @date 2021-03-23
* @date 2021-03-23
*/
*/
@Slf4j
@Slf4j
@Component
//
@Component
@Deprecated
@Deprecated
public
class
DjApiInvoker
implements
ApplicationContextAware
,
DisposableBean
{
public
class
DjApiInvoker
implements
ApplicationContextAware
,
DisposableBean
{
private
static
final
String
ARG_METHOD
=
"method"
;
private
static
final
String
ARG_METHOD
=
"method"
;
...
...
src/main/resources/application.properties
View file @
4561cdc
...
@@ -22,6 +22,3 @@ pagehelper.helperDialect=mysql
...
@@ -22,6 +22,3 @@ pagehelper.helperDialect=mysql
#pagehelper.reasonable=true
#pagehelper.reasonable=true
pagehelper.supportMethodsArguments
=
true
pagehelper.supportMethodsArguments
=
true
pagehelper.params
=
count=countSql
pagehelper.params
=
count=countSql
#\u8BBE\u5907\u8FDC\u7A0B\u8BBF\u95EEurl
device_remote_url
=
http://192.168.3.222:8099/smartDevices-platform-service
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