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 65176fdd
authored
Mar 22, 2021
by
wnb0128
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
车家智能数据服务开发 场景指令条件开发--think.wang
1 parent
a5f2b0bd
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
109 additions
and
10 deletions
src/main/java/com/glsx/smart/controller/ConditionController.java
src/main/java/com/glsx/smart/controller/ContentController.java
src/main/java/com/glsx/smart/controller/OrderValueController.java
src/main/java/com/glsx/smart/controller/ProductController.java
src/main/java/com/glsx/smart/dao/mapper/SmartDeviceOrdervalueMapper.java
src/main/java/com/glsx/smart/dao/mapper/SmartProductMapper.java
src/main/java/com/glsx/smart/service/SmartDeviceOrdervalueService.java
src/main/java/com/glsx/smart/service/SmartProductService.java
src/main/java/com/glsx/smart/service/impl/SmartDeviceOrdervalueServiceImpl.java
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
src/main/resources/mapper/SmartDeviceOrdervalueMapper.xml
src/main/resources/mapper/SmartProductMapper.xml
src/main/java/com/glsx/smart/controller/ConditionController.java
View file @
65176fd
...
@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @Title:
Index
Controller.java
* @Title:
Condition
Controller.java
* @Description:获取场景指令触发条件
* @Description:获取场景指令触发条件
* @author think.wang
* @author think.wang
* @version V1.0
* @version V1.0
...
...
src/main/java/com/glsx/smart/controller/ContentController.java
View file @
65176fd
...
@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.*;
import
java.util.List
;
import
java.util.List
;
/**
/**
* @Title:
Index
Controller.java
* @Title:
Content
Controller.java
* @Description:获取场景指令执行内容
* @Description:获取场景指令执行内容
* @author think.wang
* @author think.wang
* @version V1.0
* @version V1.0
...
...
src/main/java/com/glsx/smart/controller/OrderValueController.java
0 → 100644
View file @
65176fd
package
com
.
glsx
.
smart
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.glsx.smart.dao.entity.SmartDeviceOrdervalue
;
import
com.glsx.smart.service.SmartDeviceOrdervalueService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* @Title: OrderValueController.java
* @Description:获取场景指令值列表
* @author think.wang
* @version V1.0
* @Company: Didihu.com.cn
* @Copyright Copyright (c) 2017
*/
@Slf4j
@RestController
@RequestMapping
(
"/orderValue"
)
public
class
OrderValueController
{
@Autowired
private
SmartDeviceOrdervalueService
ordervalueService
;
@ResponseBody
@RequestMapping
(
value
=
"/getList"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
List
<
SmartDeviceOrdervalue
>
getList
(
@RequestBody
SmartDeviceOrdervalue
record
){
log
.
info
(
"请求参数:{}"
,
JSON
.
toJSONString
(
record
));
return
ordervalueService
.
getList
(
record
);
}
}
src/main/java/com/glsx/smart/controller/ProductController.java
View file @
65176fd
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.smart.dao.entity.SmartDeviceOrder
;
import
com.glsx.smart.dao.entity.SmartDeviceOrder
;
...
@@ -13,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -13,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
/**
* <p>Description: 产品列表业务
* <p>Description: 产品列表业务
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -40,6 +41,18 @@ public class ProductController {
...
@@ -40,6 +41,18 @@ public class ProductController {
}
}
/**
/**
* 获取产品列表。
*
* @param req 请求体
* @return 结果
*/
@RequestMapping
(
value
=
"/getListByCondition"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
List
<
SmartProduct
>
getListByCondition
(
@RequestBody
SmartProduct
req
)
{
log
.
info
(
"/product/getListByCondition param: {}"
,
JSON
.
toJSONString
(
req
));
return
productService
.
getListByCondition
(
req
);
}
/**
* 根据 id 查询产品详情。
* 根据 id 查询产品详情。
*
*
* @param id 产品 id
* @param id 产品 id
...
...
src/main/java/com/glsx/smart/dao/mapper/SmartDeviceOrdervalueMapper.java
View file @
65176fd
...
@@ -3,6 +3,8 @@ package com.glsx.smart.dao.mapper;
...
@@ -3,6 +3,8 @@ package com.glsx.smart.dao.mapper;
import
com.glsx.smart.dao.entity.SmartDeviceOrdervalue
;
import
com.glsx.smart.dao.entity.SmartDeviceOrdervalue
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -14,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -14,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
@Mapper
public
interface
SmartDeviceOrdervalueMapper
public
interface
SmartDeviceOrdervalueMapper
extends
tk
.
mybatis
.
mapper
.
common
.
Mapper
<
SmartDeviceOrdervalue
>
{
extends
tk
.
mybatis
.
mapper
.
common
.
Mapper
<
SmartDeviceOrdervalue
>
{
List
<
SmartDeviceOrdervalue
>
getList
(
SmartDeviceOrdervalue
record
);
}
}
src/main/java/com/glsx/smart/dao/mapper/SmartProductMapper.java
View file @
65176fd
package
com
.
glsx
.
smart
.
dao
.
mapper
;
package
com
.
glsx
.
smart
.
dao
.
mapper
;
import
java.util.List
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -14,8 +15,11 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -14,8 +15,11 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
@Mapper
public
interface
SmartProductMapper
extends
tk
.
mybatis
.
mapper
.
common
.
Mapper
<
SmartProduct
>
{
public
interface
SmartProductMapper
extends
tk
.
mybatis
.
mapper
.
common
.
Mapper
<
SmartProduct
>
{
List
<
SmartProduct
>
getList
(
SmartProduct
product
);
List
<
SmartProduct
>
getList
(
SmartProduct
product
);
List
<
SmartProduct
>
getByCondition
(
SmartProduct
product
);
SmartProduct
getById
(
Long
id
);
SmartProduct
getById
(
Long
id
);
int
countByProductName
(
String
productName
);
int
countByProductName
(
String
productName
);
...
...
src/main/java/com/glsx/smart/service/SmartDeviceOrdervalueService.java
View file @
65176fd
package
com
.
glsx
.
smart
.
service
;
package
com
.
glsx
.
smart
.
service
;
import
com.glsx.smart.dao.entity.SmartDeviceOrdervalue
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -10,5 +14,6 @@ package com.glsx.smart.service;
...
@@ -10,5 +14,6 @@ package com.glsx.smart.service;
public
interface
SmartDeviceOrdervalueService
{
public
interface
SmartDeviceOrdervalueService
{
List
<
SmartDeviceOrdervalue
>
getList
(
SmartDeviceOrdervalue
record
);
}
}
src/main/java/com/glsx/smart/service/SmartProductService.java
View file @
65176fd
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.SmartDeviceOrder
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
com.glsx.smart.dao.entity.SmartProduct
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -14,8 +15,11 @@ import com.glsx.smart.dao.entity.SmartProduct;
...
@@ -14,8 +15,11 @@ import com.glsx.smart.dao.entity.SmartProduct;
*/
*/
public
interface
SmartProductService
{
public
interface
SmartProductService
{
PageInfo
<
SmartProduct
>
getList
(
SmartProduct
product
);
PageInfo
<
SmartProduct
>
getList
(
SmartProduct
product
);
List
<
SmartProduct
>
getListByCondition
(
SmartProduct
product
);
SmartProduct
getById
(
Long
id
);
SmartProduct
getById
(
Long
id
);
Boolean
save
(
SmartProduct
product
);
Boolean
save
(
SmartProduct
product
);
...
...
src/main/java/com/glsx/smart/service/impl/SmartDeviceOrdervalueServiceImpl.java
View file @
65176fd
package
com
.
glsx
.
smart
.
service
.
impl
;
package
com
.
glsx
.
smart
.
service
.
impl
;
import
javax.annotation.Resourc
e
;
import
com.glsx.smart.dao.entity.SmartDeviceOrdervalu
e
;
import
com.glsx.smart.dao.mapper.SmartDeviceOrdervalueMapper
;
import
com.glsx.smart.dao.mapper.SmartDeviceOrdervalueMapper
;
import
com.glsx.smart.service.SmartDeviceOrdervalueService
;
import
com.glsx.smart.service.SmartDeviceOrdervalueService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
/**
* <p>Description:
* <p>Description:
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -17,6 +20,10 @@ import org.springframework.stereotype.Service;
...
@@ -17,6 +20,10 @@ import org.springframework.stereotype.Service;
public
class
SmartDeviceOrdervalueServiceImpl
implements
SmartDeviceOrdervalueService
{
public
class
SmartDeviceOrdervalueServiceImpl
implements
SmartDeviceOrdervalueService
{
@Resource
@Resource
private
SmartDeviceOrdervalueMapper
smartDeviceO
rdervalueMapper
;
private
SmartDeviceOrdervalueMapper
o
rdervalueMapper
;
@Override
public
List
<
SmartDeviceOrdervalue
>
getList
(
SmartDeviceOrdervalue
record
)
{
return
ordervalueMapper
.
getList
(
record
);
}
}
}
src/main/java/com/glsx/smart/service/impl/SmartProductServiceImpl.java
View file @
65176fd
package
com
.
glsx
.
smart
.
service
.
impl
;
package
com
.
glsx
.
smart
.
service
.
impl
;
import
javax.annotation.Resource
;
import
java.util.Date
;
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.SmartDeviceOrder
;
...
@@ -18,6 +15,10 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -18,6 +15,10 @@ 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
;
import
javax.annotation.Resource
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* <p>Description: 产品列表业务
* <p>Description: 产品列表业务
* <p>Project: chejia-smart
* <p>Project: chejia-smart
...
@@ -48,6 +49,11 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
...
@@ -48,6 +49,11 @@ public class SmartProductServiceImpl extends BaseService implements SmartProduct
return
pageInfo
;
return
pageInfo
;
}
}
@Override
public
List
<
SmartProduct
>
getListByCondition
(
SmartProduct
product
)
{
return
productMapper
.
getByCondition
(
product
);
}
/**
/**
* 根据 id 查询产品详情。
* 根据 id 查询产品详情。
*
*
...
...
src/main/resources/mapper/SmartDeviceOrdervalueMapper.xml
View file @
65176fd
...
@@ -13,4 +13,12 @@
...
@@ -13,4 +13,12 @@
<!--@mbg.generated generated on Fri Mar 19 17:22:28 CST 2021.-->
<!--@mbg.generated generated on Fri Mar 19 17:22:28 CST 2021.-->
id, order_id, device_status_code, device_status_value
id, order_id, device_status_code, device_status_value
</sql>
</sql>
<select
id=
"getList"
parameterType=
"com.glsx.smart.dao.entity.SmartDeviceOrdervalue"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from smart_device_ordervalue
<where>
<if
test=
"orderId != null"
>
and order_id = #{orderId,jdbcType=INTEGER}
</if>
</where>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
src/main/resources/mapper/SmartProductMapper.xml
View file @
65176fd
...
@@ -43,6 +43,18 @@
...
@@ -43,6 +43,18 @@
order by sp.create_time desc
order by sp.create_time desc
</select>
</select>
<select
id=
"getByCondition"
parameterType=
"com.glsx.smart.dao.entity.SmartProduct"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from smart_product
<where>
<if
test=
"platformProductId != null and platformProductId != ''"
>
and platform_product_id = #{platformProductId,jdbcType=VARCHAR}
</if>
<if
test=
"status != null"
>
and `status` = #{status,jdbcType=TINYINT}
</if>
</where>
</select>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
<select
id=
"getById"
resultMap=
"BaseResultMap"
>
select sp.id, sp.product_name, sp.icon, sp.type_id, sp.shop_product_id, sp.platform_key,
select sp.id, sp.product_name, sp.icon, sp.type_id, sp.shop_product_id, sp.platform_key,
sp.platform_product_id, sp.network_key, sp.status, sp.remark, sp.create_time,
sp.platform_product_id, sp.network_key, sp.status, sp.remark, sp.create_time,
...
...
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