Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
qianhe-slsy
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xuwenhao
qianhe-slsy
Commits
890e49d4
Commit
890e49d4
authored
Nov 30, 2023
by
xuwenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11.30修改商品、商品规格、商品分类、站点、站点用户功能
parent
b548905e
Hide whitespace changes
Inline
Side-by-side
Showing
44 changed files
with
1337 additions
and
815 deletions
+1337
-815
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterGoodsController.java
+87
-5
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterGoodsSpeController.java
+5
-4
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterGoodsTypeController.java
+8
-0
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterSpeController.java
+28
-11
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterStationController.java
+48
-3
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterStationUserController.java
+0
-6
qianhe-admin/src/main/java/com/qianhe/system/controller/api/WxLogin.java
+1
-1
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterGoods.java
+17
-91
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterGoodsImg.java
+12
-100
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterGoodsSpe.java
+14
-66
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterGoodsSpeVal.java
+23
-0
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterSpe.java
+15
-57
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterSpeVal.java
+30
-0
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterStation.java
+9
-119
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterStationUser.java
+12
-89
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterGoodsMapper.java
+53
-12
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterGoodsSpeMapper.java
+45
-12
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterSpeMapper.java
+44
-12
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterStationMapper.java
+37
-8
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterStationUserMapper.java
+9
-8
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterGoodsService.java
+14
-13
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterGoodsSpeService.java
+13
-12
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterSpeService.java
+17
-13
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterStationService.java
+25
-9
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterStationUserService.java
+9
-8
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterGoodsServiceImpl.java
+173
-10
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterGoodsSpeServiceImpl.java
+8
-7
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterSpeServiceImpl.java
+59
-9
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterStationServiceImpl.java
+74
-3
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterStationUserServiceImpl.java
+3
-1
qianhe-admin/src/main/java/com/qianhe/system/vo/WaterGoodsSpeVo.java
+36
-0
qianhe-admin/src/main/java/com/qianhe/system/vo/WaterGoodsVo.java
+70
-0
qianhe-admin/src/main/java/com/qianhe/system/vo/WaterSpeVo.java
+32
-0
qianhe-admin/src/main/java/com/qianhe/system/vo/WaterStationVo.java
+66
-0
qianhe-admin/src/main/resources/mapper/WaterGoodsImgMapper.xml
+7
-7
qianhe-admin/src/main/resources/mapper/WaterGoodsMapper.xml
+65
-15
qianhe-admin/src/main/resources/mapper/WaterGoodsSpeMapper.xml
+46
-25
qianhe-admin/src/main/resources/mapper/WaterGoodsTypeMapper.xml
+12
-12
qianhe-admin/src/main/resources/mapper/WaterSpeMapper.xml
+46
-25
qianhe-admin/src/main/resources/mapper/WaterStationMapper.xml
+37
-14
qianhe-admin/src/main/resources/mapper/WaterStationUserMapper.xml
+12
-12
qianhe-admin/src/main/resources/mapper/WaterUserAddressMapper.xml
+7
-7
qianhe-admin/src/main/resources/mapper/WaterUserMapper.xml
+7
-7
qianhe-admin/src/main/resources/mybatis/mybatis-config.xml
+2
-2
No files found.
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterGoodsController.java
View file @
890e49d4
...
...
@@ -5,14 +5,24 @@ import com.qianhe.common.core.controller.BaseController;
import
com.qianhe.common.core.domain.AjaxResult
;
import
com.qianhe.common.core.page.TableDataInfo
;
import
com.qianhe.common.enums.BusinessType
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.common.utils.poi.ExcelUtil
;
import
com.qianhe.system.domain.WaterGoods
;
import
com.qianhe.system.domain.WaterGoodsImg
;
import
com.qianhe.system.domain.WaterGoodsType
;
import
com.qianhe.system.domain.WaterStation
;
import
com.qianhe.system.service.IWaterGoodsImgService
;
import
com.qianhe.system.service.IWaterGoodsService
;
import
com.qianhe.system.service.IWaterGoodsTypeService
;
import
com.qianhe.system.service.IWaterStationService
;
import
com.qianhe.system.vo.WaterGoodsVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -27,6 +37,12 @@ public class WaterGoodsController extends BaseController
{
@Autowired
private
IWaterGoodsService
waterGoodsService
;
@Autowired
private
IWaterGoodsImgService
waterGoodsImgService
;
@Autowired
private
IWaterStationService
waterStationService
;
@Autowired
private
IWaterGoodsTypeService
waterGoodsTypeService
;
/**
* 查询商品列表
...
...
@@ -36,7 +52,73 @@ public class WaterGoodsController extends BaseController
{
startPage
();
List
<
WaterGoods
>
list
=
waterGoodsService
.
selectWaterGoodsList
(
waterGoods
);
return
getDataTable
(
list
);
//查询所有商品图片
List
<
WaterGoodsImg
>
waterGoodsImgs
=
waterGoodsImgService
.
selectWaterGoodsImgList
(
new
WaterGoodsImg
());
//查询所有站点
List
<
WaterStation
>
waterStations
=
waterStationService
.
selectWaterStationList
(
new
WaterStation
());
//查询所有商品分类
List
<
WaterGoodsType
>
waterGoodsTypes
=
waterGoodsTypeService
.
selectWaterGoodsTypeList
(
new
WaterGoodsType
());
List
<
WaterGoodsVo
>
waterGoodsVos
=
new
ArrayList
<>();
if
(
list
.
size
()
>
0
){
for
(
WaterGoods
goods
:
list
)
{
//转vo
WaterGoodsVo
waterGoodsVo
=
new
WaterGoodsVo
();
BeanUtils
.
copyProperties
(
goods
,
waterGoodsVo
);
List
<
WaterGoodsImg
>
coverImgs
=
new
ArrayList
<>();
List
<
WaterGoodsImg
>
detailsImgs
=
new
ArrayList
<>();
for
(
WaterGoodsImg
waterGoodsImg
:
waterGoodsImgs
)
{
if
(
goods
.
getId
().
equals
(
waterGoodsImg
.
getGoodsId
())
&&
waterGoodsImg
.
getImgType
()
==
1
){
//商品封面图
coverImgs
.
add
(
waterGoodsImg
);
}
if
(
goods
.
getId
().
equals
(
waterGoodsImg
.
getGoodsId
())
&&
waterGoodsImg
.
getImgType
()
==
2
){
//商品详情图
detailsImgs
.
add
(
waterGoodsImg
);
}
}
if
(
coverImgs
.
size
()
>
0
){
waterGoodsVo
.
setCoverImgs
(
coverImgs
);
}
if
(
detailsImgs
.
size
()
>
0
){
waterGoodsVo
.
setDetailsImgs
(
detailsImgs
);
}
//设置站点名称
if
(
StringUtils
.
isNotEmpty
(
goods
.
getBelongStationId
())){
String
[]
split
=
goods
.
getBelongStationId
().
split
(
","
);
String
stationName
=
""
;
if
(
split
.
length
>
1
){
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++)
{
for
(
WaterStation
waterStation
:
waterStations
)
{
if
(
split
[
i
].
equals
(
waterStation
.
getId
().
toString
())){
if
(
i
==
split
.
length
-
1
){
stationName
+=
waterStation
.
getStationName
();
}
else
{
stationName
+=
waterStation
.
getStationName
()
+
","
;
}
}
}
}
}
else
{
for
(
WaterStation
waterStation
:
waterStations
)
{
if
(
split
[
0
].
equals
(
waterStation
.
getId
().
toString
())){
stationName
=
waterStation
.
getStationName
();
}
}
}
waterGoodsVo
.
setBelongStationNames
(
stationName
);
}
//设置商品分类名称
if
(
StringUtils
.
isNotNull
(
goods
.
getGoodsTypeId
())){
for
(
WaterGoodsType
waterGoodsType
:
waterGoodsTypes
)
{
if
(
goods
.
getGoodsTypeId
().
equals
(
waterGoodsType
.
getId
())){
waterGoodsVo
.
setGoodsTypeName
(
waterGoodsType
.
getTypeName
());
}
}
}
waterGoodsVos
.
add
(
waterGoodsVo
);
}
}
return
getDataTable
(
waterGoodsVos
);
}
/**
...
...
@@ -65,9 +147,9 @@ public class WaterGoodsController extends BaseController
*/
@Log
(
title
=
"商品"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
WaterGoods
waterGoods
)
public
AjaxResult
add
(
@RequestBody
WaterGoods
Vo
waterGoodsVo
)
{
return
toAjax
(
waterGoodsService
.
insertWaterGoods
(
waterGoods
));
return
toAjax
(
waterGoodsService
.
insertWaterGoods
(
waterGoods
Vo
));
}
/**
...
...
@@ -75,9 +157,9 @@ public class WaterGoodsController extends BaseController
*/
@Log
(
title
=
"商品"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
WaterGoods
waterGoods
)
public
AjaxResult
edit
(
@RequestBody
WaterGoods
Vo
waterGoodsVo
)
{
return
toAjax
(
waterGoodsService
.
updateWaterGoods
(
waterGoods
));
return
toAjax
(
waterGoodsService
.
updateWaterGoods
(
waterGoods
Vo
));
}
/**
...
...
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterGoodsSpeController.java
View file @
890e49d4
...
...
@@ -8,6 +8,7 @@ import com.qianhe.common.enums.BusinessType;
import
com.qianhe.common.utils.poi.ExcelUtil
;
import
com.qianhe.system.domain.WaterGoodsSpe
;
import
com.qianhe.system.service.IWaterGoodsSpeService
;
import
com.qianhe.system.vo.WaterGoodsSpeVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -69,9 +70,9 @@ public class WaterGoodsSpeController extends BaseController
@PreAuthorize
(
"@ss.hasPermi('system:spe:add')"
)
@Log
(
title
=
"商品关联规格"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
WaterGoodsSpe
waterGoodsSpe
)
public
AjaxResult
add
(
@RequestBody
WaterGoodsSpe
Vo
waterGoodsSpeVo
)
{
return
toAjax
(
waterGoodsSpeService
.
insertWaterGoodsSpe
(
waterGoodsSpe
));
return
toAjax
(
waterGoodsSpeService
.
insertWaterGoodsSpe
(
waterGoodsSpe
Vo
));
}
/**
...
...
@@ -80,9 +81,9 @@ public class WaterGoodsSpeController extends BaseController
@PreAuthorize
(
"@ss.hasPermi('system:spe:edit')"
)
@Log
(
title
=
"商品关联规格"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
WaterGoodsSpe
waterGoodsSpe
)
public
AjaxResult
edit
(
@RequestBody
WaterGoodsSpe
Vo
waterGoodsSpeVo
)
{
return
toAjax
(
waterGoodsSpeService
.
updateWaterGoodsSpe
(
waterGoodsSpe
));
return
toAjax
(
waterGoodsSpeService
.
updateWaterGoodsSpe
(
waterGoodsSpe
Vo
));
}
/**
...
...
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterGoodsTypeController.java
View file @
890e49d4
...
...
@@ -89,4 +89,12 @@ public class WaterGoodsTypeController extends BaseController
{
return
toAjax
(
waterGoodsTypeService
.
deleteWaterGoodsTypeByIds
(
ids
));
}
/**
* 获取商品分类下拉框
*/
@GetMapping
(
"/getGoodsTypeList"
)
public
AjaxResult
getGoodsTypeList
(){
return
AjaxResult
.
success
(
waterGoodsTypeService
.
selectWaterGoodsTypeList
(
new
WaterGoodsType
()));
}
}
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterSpeController.java
View file @
890e49d4
...
...
@@ -7,12 +7,16 @@ import com.qianhe.common.core.page.TableDataInfo;
import
com.qianhe.common.enums.BusinessType
;
import
com.qianhe.common.utils.poi.ExcelUtil
;
import
com.qianhe.system.domain.WaterSpe
;
import
com.qianhe.system.domain.WaterSpeVal
;
import
com.qianhe.system.service.IWaterSpeService
;
import
com.qianhe.system.vo.WaterSpeVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -31,19 +35,36 @@ public class WaterSpeController extends BaseController
/**
* 查询商品规格列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:spe:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
WaterSpe
waterSpe
)
{
startPage
();
List
<
WaterSpe
>
list
=
waterSpeService
.
selectWaterSpeList
(
waterSpe
);
return
getDataTable
(
list
);
//返回的列表
List
<
WaterSpeVo
>
waterSpeVoList
=
new
ArrayList
<>();
//商品规格规格值列表
List
<
WaterSpeVal
>
waterSpeVals
=
waterSpeService
.
selectWaterSpeValList
(
new
WaterSpeVal
());
for
(
WaterSpe
spe
:
list
)
{
//转vo
WaterSpeVo
waterSpeVo
=
new
WaterSpeVo
();
BeanUtils
.
copyProperties
(
spe
,
waterSpeVo
);
List
<
WaterSpeVal
>
waterSpeValList
=
new
ArrayList
<>();
for
(
WaterSpeVal
waterSpeVal
:
waterSpeVals
)
{
if
(
spe
.
getId
().
equals
(
waterSpeVal
.
getSpeId
())){
waterSpeValList
.
add
(
waterSpeVal
);
}
}
if
(
waterSpeValList
.
size
()
>
0
){
waterSpeVo
.
setWaterSpeValList
(
waterSpeValList
);
}
waterSpeVoList
.
add
(
waterSpeVo
);
}
return
getDataTable
(
waterSpeVoList
);
}
/**
* 导出商品规格列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:spe:export')"
)
@Log
(
title
=
"商品规格"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
WaterSpe
waterSpe
)
...
...
@@ -56,7 +77,6 @@ public class WaterSpeController extends BaseController
/**
* 获取商品规格详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:spe:query')"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -66,29 +86,26 @@ public class WaterSpeController extends BaseController
/**
* 新增商品规格
*/
@PreAuthorize
(
"@ss.hasPermi('system:spe:add')"
)
@Log
(
title
=
"商品规格"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
WaterSpe
waterSpe
)
public
AjaxResult
add
(
@RequestBody
WaterSpe
Vo
waterSpeVo
)
{
return
toAjax
(
waterSpeService
.
insertWaterSpe
(
waterSpe
));
return
toAjax
(
waterSpeService
.
insertWaterSpe
(
waterSpe
Vo
));
}
/**
* 修改商品规格
*/
@PreAuthorize
(
"@ss.hasPermi('system:spe:edit')"
)
@Log
(
title
=
"商品规格"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
WaterSpe
waterSpe
)
public
AjaxResult
edit
(
@RequestBody
WaterSpe
Vo
waterSpeVo
)
{
return
toAjax
(
waterSpeService
.
updateWaterSpe
(
waterSpe
));
return
toAjax
(
waterSpeService
.
updateWaterSpe
(
waterSpe
Vo
));
}
/**
* 删除商品规格
*/
@PreAuthorize
(
"@ss.hasPermi('system:spe:remove')"
)
@Log
(
title
=
"商品规格"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
...
...
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterStationController.java
View file @
890e49d4
...
...
@@ -7,12 +7,16 @@ import com.qianhe.common.core.page.TableDataInfo;
import
com.qianhe.common.enums.BusinessType
;
import
com.qianhe.common.utils.poi.ExcelUtil
;
import
com.qianhe.system.domain.WaterStation
;
import
com.qianhe.system.domain.WaterStationUser
;
import
com.qianhe.system.service.IWaterStationService
;
import
com.qianhe.system.service.IWaterStationUserService
;
import
com.qianhe.system.vo.WaterStationVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -27,6 +31,8 @@ public class WaterStationController extends BaseController
{
@Autowired
private
IWaterStationService
waterStationService
;
@Autowired
private
IWaterStationUserService
waterStationUserService
;
/**
* 查询站点列表
...
...
@@ -35,8 +41,29 @@ public class WaterStationController extends BaseController
public
TableDataInfo
list
(
WaterStation
waterStation
)
{
startPage
();
List
<
WaterStation
>
list
=
waterStationService
.
selectWaterStationList
(
waterStation
);
return
getDataTable
(
list
);
List
<
WaterStation
>
waterStations
=
waterStationService
.
selectWaterStationList
(
waterStation
);
List
<
WaterStationVo
>
waterStationVoList
=
new
ArrayList
<>();
//送水工列表
List
<
WaterStationUser
>
waterStationUsers
=
waterStationUserService
.
selectWaterStationUserList
(
new
WaterStationUser
());
for
(
WaterStation
station
:
waterStations
)
{
//送水工集合
List
<
WaterStationUser
>
waterStationUserList
=
new
ArrayList
<>();
//转vo
WaterStationVo
waterStationVo
=
new
WaterStationVo
();
BeanUtils
.
copyProperties
(
station
,
waterStationVo
);
for
(
WaterStationUser
waterStationUser
:
waterStationUsers
)
{
if
(
station
.
getId
().
equals
(
waterStationUser
.
getStationId
())){
waterStationUserList
.
add
(
waterStationUser
);
}
}
if
(
waterStationUserList
.
size
()
>
0
){
waterStationVo
.
setWaterStationUserList
(
waterStationUserList
);
}
waterStationVoList
.
add
(
waterStationVo
);
}
return
getDataTable
(
waterStationVoList
);
}
/**
...
...
@@ -81,6 +108,16 @@ public class WaterStationController extends BaseController
}
/**
* 修改站点是否营业
*/
@Log
(
title
=
"站点"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
(
"/updateIsOpen"
)
public
AjaxResult
updateIsOpen
(
@RequestBody
WaterStation
waterStation
)
{
return
toAjax
(
waterStationService
.
updateIsOpen
(
waterStation
));
}
/**
* 删除站点
*/
@Log
(
title
=
"站点"
,
businessType
=
BusinessType
.
DELETE
)
...
...
@@ -89,4 +126,12 @@ public class WaterStationController extends BaseController
{
return
toAjax
(
waterStationService
.
deleteWaterStationByIds
(
ids
));
}
/**
* 查询站点下拉框
*/
@GetMapping
(
"/getStationList"
)
public
AjaxResult
getStationList
(){
return
AjaxResult
.
success
(
waterStationService
.
getStationList
());
}
}
qianhe-admin/src/main/java/com/qianhe/system/controller/WaterStationUserController.java
View file @
890e49d4
...
...
@@ -31,7 +31,6 @@ public class WaterStationUserController extends BaseController
/**
* 查询站点用户列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:user:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
list
(
WaterStationUser
waterStationUser
)
{
...
...
@@ -43,7 +42,6 @@ public class WaterStationUserController extends BaseController
/**
* 导出站点用户列表
*/
@PreAuthorize
(
"@ss.hasPermi('system:user:export')"
)
@Log
(
title
=
"站点用户"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
WaterStationUser
waterStationUser
)
...
...
@@ -56,7 +54,6 @@ public class WaterStationUserController extends BaseController
/**
* 获取站点用户详细信息
*/
@PreAuthorize
(
"@ss.hasPermi('system:user:query')"
)
@GetMapping
(
value
=
"/{id}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"id"
)
Long
id
)
{
...
...
@@ -66,7 +63,6 @@ public class WaterStationUserController extends BaseController
/**
* 新增站点用户
*/
@PreAuthorize
(
"@ss.hasPermi('system:user:add')"
)
@Log
(
title
=
"站点用户"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
WaterStationUser
waterStationUser
)
...
...
@@ -77,7 +73,6 @@ public class WaterStationUserController extends BaseController
/**
* 修改站点用户
*/
@PreAuthorize
(
"@ss.hasPermi('system:user:edit')"
)
@Log
(
title
=
"站点用户"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
public
AjaxResult
edit
(
@RequestBody
WaterStationUser
waterStationUser
)
...
...
@@ -88,7 +83,6 @@ public class WaterStationUserController extends BaseController
/**
* 删除站点用户
*/
@PreAuthorize
(
"@ss.hasPermi('system:user:remove')"
)
@Log
(
title
=
"站点用户"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{ids}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
ids
)
...
...
qianhe-admin/src/main/java/com/qianhe/system/controller/api/WxLogin.java
View file @
890e49d4
...
...
@@ -71,7 +71,7 @@ public class WxLogin {
//根据code查询微信用户的openid和session_key
Map
<
String
,
String
>
wxLoginInfo
=
wxUserInfoUtils
.
getWxLoginInfo
(
code
);
WxLoginBody
wxLoginBody
=
new
WxLoginBody
();
wxLoginBody
.
setOpenId
(
wxLoginInfo
.
get
(
"open
I
d"
));
wxLoginBody
.
setOpenId
(
wxLoginInfo
.
get
(
"open
i
d"
));
MpLoginUser
login
=
wxLoginService
.
login
(
wxLoginBody
);
if
(
StringUtils
.
isNull
(
login
))
{
return
AjaxResult
.
error
(
"login error"
);
...
...
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterGoods.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.util.Date
;
/**
* 商品对象 water_goods
*
* @author qianhe
* @date 2023-11-23
*/
public
class
WaterGoods
extends
BaseEntity
@Data
public
class
WaterGoods
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 标题 */
...
...
@@ -28,7 +35,7 @@ public class WaterGoods extends BaseEntity
/** 所属站点id */
@Excel
(
name
=
"所属站点id"
)
private
Lo
ng
belongStationId
;
private
Stri
ng
belongStationId
;
/** 封面图 */
@Excel
(
name
=
"封面图"
)
...
...
@@ -42,95 +49,14 @@ public class WaterGoods extends BaseEntity
@Excel
(
name
=
"价格"
)
private
String
price
;
/** 创建人 */
private
String
createUser
;
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/** 状态(1上架0下架) */
@Excel
(
name
=
"状态"
,
readConverterExp
=
"1=上架0下架"
)
private
Long
status
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setTitle
(
String
title
)
{
this
.
title
=
title
;
}
public
String
getTitle
()
{
return
title
;
}
public
void
setGoodsTypeId
(
Long
goodsTypeId
)
{
this
.
goodsTypeId
=
goodsTypeId
;
}
public
Long
getGoodsTypeId
()
{
return
goodsTypeId
;
}
public
void
setBelongStationId
(
Long
belongStationId
)
{
this
.
belongStationId
=
belongStationId
;
}
public
Long
getBelongStationId
()
{
return
belongStationId
;
}
public
void
setCoverImg
(
String
coverImg
)
{
this
.
coverImg
=
coverImg
;
}
public
String
getCoverImg
()
{
return
coverImg
;
}
public
void
setDetailsImg
(
String
detailsImg
)
{
this
.
detailsImg
=
detailsImg
;
}
public
String
getDetailsImg
()
{
return
detailsImg
;
}
public
void
setPrice
(
String
price
)
{
this
.
price
=
price
;
}
public
String
getPrice
()
{
return
price
;
}
public
void
setStatus
(
Long
status
)
{
this
.
status
=
status
;
}
public
Long
getStatus
()
{
return
status
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"title"
,
getTitle
())
.
append
(
"goodsTypeId"
,
getGoodsTypeId
())
.
append
(
"belongStationId"
,
getBelongStationId
())
.
append
(
"coverImg"
,
getCoverImg
())
.
append
(
"detailsImg"
,
getDetailsImg
())
.
append
(
"price"
,
getPrice
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"status"
,
getStatus
())
.
toString
();
}
}
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterGoodsImg.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
@@ -11,125 +14,34 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author qianhe
* @date 2023-11-23
*/
public
class
WaterGoodsImg
extends
BaseEntity
@Data
public
class
WaterGoodsImg
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** $column.columnComment */
@Excel
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
/** 图片名称 */
private
String
imgName
;
/** $column.columnComment */
@Excel
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
/** 类型 */
private
String
type
;
/** $column.columnComment */
@Excel
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
/** 大小 */
private
String
sizea
;
/** $column.columnComment */
@Excel
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
/** 路径 */
private
String
url
;
/** $column.columnComment */
@Excel
(
name
=
"${comment}"
,
readConverterExp
=
"$column.readConverterExp()"
)
private
String
md5
;
/** 图片类型(1商品封面图2商品详情图3主页轮播图) */
@Excel
(
name
=
"图片类型"
,
readConverterExp
=
"1=商品封面图
2商品详情图3
主页轮播图"
)
@Excel
(
name
=
"图片类型"
,
readConverterExp
=
"1=商品封面图
,2=商品详情图,3=
主页轮播图"
)
private
Integer
imgType
;
/** 商品id */
@Excel
(
name
=
"商品id"
)
private
Long
goodsId
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setImgName
(
String
imgName
)
{
this
.
imgName
=
imgName
;
}
public
String
getImgName
()
{
return
imgName
;
}
public
void
setType
(
String
type
)
{
this
.
type
=
type
;
}
public
String
getType
()
{
return
type
;
}
public
void
setSizea
(
String
sizea
)
{
this
.
sizea
=
sizea
;
}
public
String
getSizea
()
{
return
sizea
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setMd5
(
String
md5
)
{
this
.
md5
=
md5
;
}
public
String
getMd5
()
{
return
md5
;
}
public
void
setImgType
(
Integer
imgType
)
{
this
.
imgType
=
imgType
;
}
public
Integer
getImgType
()
{
return
imgType
;
}
public
void
setGoodsId
(
Long
goodsId
)
{
this
.
goodsId
=
goodsId
;
}
public
Long
getGoodsId
()
{
return
goodsId
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"imgName"
,
getImgName
())
.
append
(
"type"
,
getType
())
.
append
(
"sizea"
,
getSizea
())
.
append
(
"url"
,
getUrl
())
.
append
(
"md5"
,
getMd5
())
.
append
(
"imgType"
,
getImgType
())
.
append
(
"goodsId"
,
getGoodsId
())
.
toString
();
}
}
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterGoodsSpe.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.util.Date
;
/**
* 商品关联规格对象 water_goods_spe
*
* @author qianhe
* @date 2023-11-23
*/
public
class
WaterGoodsSpe
extends
BaseEntity
@Data
public
class
WaterGoodsSpe
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 标题 */
@Excel
(
name
=
"标题"
)
private
String
speTitle
;
/** 规格 */
@Excel
(
name
=
"规格"
)
private
String
spe
;
/** 规格值 */
@Excel
(
name
=
"规格值"
)
private
String
speVal
;
/** 商品id */
@Excel
(
name
=
"商品id"
)
private
Long
goodsId
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setSpeTitle
(
String
speTitle
)
{
this
.
speTitle
=
speTitle
;
}
public
String
getSpeTitle
()
{
return
speTitle
;
}
public
void
setSpe
(
String
spe
)
{
this
.
spe
=
spe
;
}
public
String
getSpe
()
{
return
spe
;
}
public
void
setSpeVal
(
String
speVal
)
{
this
.
speVal
=
speVal
;
}
public
String
getSpeVal
()
{
return
speVal
;
}
public
void
setGoodsId
(
Long
goodsId
)
{
this
.
goodsId
=
goodsId
;
}
public
Long
getGoodsId
()
{
return
goodsId
;
}
/** 创建人 */
private
String
createUser
;
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"speTitle"
,
getSpeTitle
())
.
append
(
"spe"
,
getSpe
())
.
append
(
"speVal"
,
getSpeVal
())
.
append
(
"goodsId"
,
getGoodsId
())
.
append
(
"createTime"
,
getCreateTime
())
.
toString
();
}
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
}
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterGoodsSpeVal.java
0 → 100644
View file @
890e49d4
package
com
.
qianhe
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.qianhe.common.annotation.Excel
;
import
lombok.Data
;
@Data
public
class
WaterGoodsSpeVal
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 商品规格id */
private
Long
speId
;
/** 规格 */
@Excel
(
name
=
"规格"
)
private
String
spe
;
/** 规格值 */
private
String
speVal
;
}
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterSpe.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.util.Date
;
/**
* 商品规格对象 water_spe
* 商品规格
主表
对象 water_spe
*
* @author qianhe
* @date 2023-11-23
*/
public
class
WaterSpe
extends
BaseEntity
@Data
public
class
WaterSpe
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 标题 */
@Excel
(
name
=
"标题"
)
private
String
speTitle
;
/** 规格 */
@Excel
(
name
=
"规格"
)
private
String
spe
;
/** 规格值 */
@Excel
(
name
=
"规格值"
)
private
String
speVal
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setSpeTitle
(
String
speTitle
)
{
this
.
speTitle
=
speTitle
;
}
public
String
getSpeTitle
()
{
return
speTitle
;
}
public
void
setSpe
(
String
spe
)
{
this
.
spe
=
spe
;
}
public
String
getSpe
()
{
return
spe
;
}
public
void
setSpeVal
(
String
speVal
)
{
this
.
speVal
=
speVal
;
}
public
String
getSpeVal
()
{
return
speVal
;
}
/** 创建人 */
private
String
createUser
;
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"speTitle"
,
getSpeTitle
())
.
append
(
"spe"
,
getSpe
())
.
append
(
"speVal"
,
getSpeVal
())
.
append
(
"createTime"
,
getCreateTime
())
.
toString
();
}
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
}
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterSpeVal.java
0 → 100644
View file @
890e49d4
package
com
.
qianhe
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.qianhe.common.annotation.Excel
;
import
lombok.Data
;
/**
* 商品规格子表对象 water_spe_val
*
* @author qianhe
* @date 2023-11-23
*/
@Data
public
class
WaterSpeVal
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 商品规格id */
private
Long
speId
;
/** 规格 */
@Excel
(
name
=
"规格"
)
private
String
spe
;
/** 规格值 */
private
String
speVal
;
}
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterStation.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.Data
;
...
...
@@ -7,6 +10,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 站点对象 water_station
...
...
@@ -15,11 +19,11 @@ import java.math.BigDecimal;
* @date 2023-11-23
*/
@Data
public
class
WaterStation
extends
BaseEntity
public
class
WaterStation
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 站点名称 */
...
...
@@ -62,121 +66,7 @@ public class WaterStation extends BaseEntity
@Excel
(
name
=
"创建人"
)
private
String
createUser
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setStationName
(
String
stationName
)
{
this
.
stationName
=
stationName
;
}
public
String
getStationName
()
{
return
stationName
;
}
public
void
setPhoneNum
(
Long
phoneNum
)
{
this
.
phoneNum
=
phoneNum
;
}
public
Long
getPhoneNum
()
{
return
phoneNum
;
}
public
void
setStationAddress
(
String
stationAddress
)
{
this
.
stationAddress
=
stationAddress
;
}
public
String
getStationAddress
()
{
return
stationAddress
;
}
public
void
setStationLon
(
BigDecimal
stationLon
)
{
this
.
stationLon
=
stationLon
;
}
public
BigDecimal
getStationLon
()
{
return
stationLon
;
}
public
void
setStationLat
(
BigDecimal
stationLat
)
{
this
.
stationLat
=
stationLat
;
}
public
BigDecimal
getStationLat
()
{
return
stationLat
;
}
public
void
setProvince
(
String
province
)
{
this
.
province
=
province
;
}
public
String
getProvince
()
{
return
province
;
}
public
void
setCity
(
String
city
)
{
this
.
city
=
city
;
}
public
String
getCity
()
{
return
city
;
}
public
void
setArea
(
String
area
)
{
this
.
area
=
area
;
}
public
String
getArea
()
{
return
area
;
}
public
void
setIsOpen
(
Long
isOpen
)
{
this
.
isOpen
=
isOpen
;
}
public
Long
getIsOpen
()
{
return
isOpen
;
}
public
void
setCreateUser
(
String
createUser
)
{
this
.
createUser
=
createUser
;
}
public
String
getCreateUser
()
{
return
createUser
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"stationName"
,
getStationName
())
.
append
(
"phoneNum"
,
getPhoneNum
())
.
append
(
"stationAddress"
,
getStationAddress
())
.
append
(
"stationLon"
,
getStationLon
())
.
append
(
"stationLat"
,
getStationLat
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"province"
,
getProvince
())
.
append
(
"city"
,
getCity
())
.
append
(
"area"
,
getArea
())
.
append
(
"isOpen"
,
getIsOpen
())
.
append
(
"createUser"
,
getCreateUser
())
.
toString
();
}
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
}
qianhe-admin/src/main/java/com/qianhe/system/domain/WaterStationUser.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
domain
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
java.util.Date
;
/**
* 站点用户对象 water_station_user
*
* @author qianhe
* @date 2023-11-23
*/
public
class
WaterStationUser
extends
BaseEntity
@Data
public
class
WaterStationUser
{
private
static
final
long
serialVersionUID
=
1L
;
/** $column.columnComment */
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 姓名 */
...
...
@@ -46,91 +53,7 @@ public class WaterStationUser extends BaseEntity
@Excel
(
name
=
"创建人"
)
private
String
createUser
;
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getName
()
{
return
name
;
}
public
void
setAge
(
Long
age
)
{
this
.
age
=
age
;
}
public
Long
getAge
()
{
return
age
;
}
public
void
setGender
(
Long
gender
)
{
this
.
gender
=
gender
;
}
public
Long
getGender
()
{
return
gender
;
}
public
void
setPhone
(
Long
phone
)
{
this
.
phone
=
phone
;
}
public
Long
getPhone
()
{
return
phone
;
}
public
void
setIdNum
(
String
idNum
)
{
this
.
idNum
=
idNum
;
}
public
String
getIdNum
()
{
return
idNum
;
}
public
void
setStationId
(
Long
stationId
)
{
this
.
stationId
=
stationId
;
}
public
Long
getStationId
()
{
return
stationId
;
}
public
void
setCreateUser
(
String
createUser
)
{
this
.
createUser
=
createUser
;
}
public
String
getCreateUser
()
{
return
createUser
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"name"
,
getName
())
.
append
(
"age"
,
getAge
())
.
append
(
"gender"
,
getGender
())
.
append
(
"phone"
,
getPhone
())
.
append
(
"idNum"
,
getIdNum
())
.
append
(
"stationId"
,
getStationId
())
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"createUser"
,
getCreateUser
())
.
toString
();
}
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
}
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterGoodsMapper.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
mapper
;
import
com.qianhe.system.domain.WaterGoods
;
import
com.qianhe.system.domain.WaterGoodsImg
;
import
com.qianhe.system.vo.WaterGoodsVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 商品Mapper接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
WaterGoodsMapper
public
interface
WaterGoodsMapper
{
/**
* 查询商品
*
*
* @param id 商品主键
* @return 商品
*/
...
...
@@ -22,7 +25,7 @@ public interface WaterGoodsMapper
/**
* 查询商品列表
*
*
* @param waterGoods 商品
* @return 商品集合
*/
...
...
@@ -30,23 +33,23 @@ public interface WaterGoodsMapper
/**
* 新增商品
*
* @param waterGoods 商品
*
* @param waterGoods
Vo
商品
* @return 结果
*/
public
int
insertWaterGoods
(
WaterGoods
waterGoods
);
public
int
insertWaterGoods
(
WaterGoods
Vo
waterGoodsVo
);
/**
* 修改商品
*
* @param waterGoods 商品
*
* @param waterGoods
Vo
商品
* @return 结果
*/
public
int
updateWaterGoods
(
WaterGoods
waterGoods
);
public
int
updateWaterGoods
(
WaterGoods
Vo
waterGoodsVo
);
/**
* 删除商品
*
*
* @param id 商品主键
* @return 结果
*/
...
...
@@ -54,9 +57,47 @@ public interface WaterGoodsMapper
/**
* 批量删除商品
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteWaterGoodsByIds
(
Long
[]
ids
);
/**
* 删除商品图片
*
* @param id 商品主键
* @return 结果
*/
public
int
deleteWaterGoodsImgByGoodsId
(
Long
id
);
/**
* 批量删除商品图片
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteWaterGoodsImgByGoodsIds
(
Long
[]
ids
);
/**
* 删除商品关联规格
*
* @param id 商品主键
* @return 结果
*/
public
int
deleteWaterGoodsSpeByGoodsId
(
Long
id
);
/**
* 批量删除商品关联规格
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteWaterGoodsSpeByGoodsIds
(
Long
[]
ids
);
/**
* 批量新增图片
* @param list
*/
void
batchInsertWaterGoodsImg
(
@Param
(
"list"
)
List
<
WaterGoodsImg
>
list
);
}
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterGoodsSpeMapper.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
mapper
;
import
com.qianhe.system.domain.WaterGoodsSpe
;
import
com.qianhe.system.domain.WaterGoodsSpeVal
;
import
com.qianhe.system.vo.WaterGoodsSpeVo
;
import
java.util.List
;
/**
* 商品关联规格Mapper接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
WaterGoodsSpeMapper
public
interface
WaterGoodsSpeMapper
{
/**
* 查询商品关联规格
*
*
* @param id 商品关联规格主键
* @return 商品关联规格
*/
...
...
@@ -22,31 +24,39 @@ public interface WaterGoodsSpeMapper
/**
* 查询商品关联规格列表
*
*
* @param waterGoodsSpe 商品关联规格
* @return 商品关联规格集合
*/
public
List
<
WaterGoodsSpe
>
selectWaterGoodsSpeList
(
WaterGoodsSpe
waterGoodsSpe
);
/**
* 查询商品关联规格值列表
*
* @param waterGoodsSpeVal 商品关联规格值
* @return 商品关联规格值集合
*/
public
List
<
WaterGoodsSpeVal
>
selectWaterGoodsSpeValList
(
WaterGoodsSpeVal
waterGoodsSpeVal
);
/**
* 新增商品关联规格
*
* @param waterGoodsSpe 商品关联规格
*
* @param waterGoodsSpe
Vo
商品关联规格
* @return 结果
*/
public
int
insertWaterGoodsSpe
(
WaterGoodsSpe
waterGoodsSpe
);
public
int
insertWaterGoodsSpe
(
WaterGoodsSpe
Vo
waterGoodsSpeVo
);
/**
* 修改商品关联规格
*
* @param waterGoodsSpe 商品关联规格
*
* @param waterGoodsSpe
Vo
商品关联规格
* @return 结果
*/
public
int
updateWaterGoodsSpe
(
WaterGoodsSpe
waterGoodsSpe
);
public
int
updateWaterGoodsSpe
(
WaterGoodsSpe
Vo
waterGoodsSpeVo
);
/**
* 删除商品关联规格
*
*
* @param id 商品关联规格主键
* @return 结果
*/
...
...
@@ -54,9 +64,32 @@ public interface WaterGoodsSpeMapper
/**
* 批量删除商品关联规格
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteWaterGoodsSpeByIds
(
Long
[]
ids
);
/**
* 删除商品关联规格值
*
* @param id 商品关联规格主键
* @return 结果
*/
public
int
deleteWaterGoodsSpeValBySpeId
(
Long
id
);
/**
* 批量删除商品关联规格值
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteWaterGoodsSpeValBySpeIds
(
Long
[]
ids
);
/**
* 批量新增商品关联规格值
* @param list
* @return
*/
int
batchInsertWaterGoodsSpeVal
(
List
<
WaterGoodsSpeVal
>
list
);
}
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterSpeMapper.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
mapper
;
import
com.qianhe.system.domain.WaterSpe
;
import
com.qianhe.system.domain.WaterSpeVal
;
import
com.qianhe.system.vo.WaterSpeVo
;
import
java.util.List
;
/**
* 商品规格Mapper接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
WaterSpeMapper
public
interface
WaterSpeMapper
{
/**
* 查询商品规格
*
*
* @param id 商品规格主键
* @return 商品规格
*/
...
...
@@ -22,31 +24,39 @@ public interface WaterSpeMapper
/**
* 查询商品规格列表
*
*
* @param waterSpe 商品规格
* @return 商品规格集合
*/
public
List
<
WaterSpe
>
selectWaterSpeList
(
WaterSpe
waterSpe
);
/**
* 查询商品规格规格值列表
*
* @param waterSpeVal 商品规格规格值
* @return 商品规格集合
*/
public
List
<
WaterSpeVal
>
selectWaterSpeValList
(
WaterSpeVal
waterSpeVal
);
/**
* 新增商品规格
*
* @param waterSpe 商品规格
*
* @param waterSpe
Vo
商品规格
* @return 结果
*/
public
int
insertWaterSpe
(
WaterSpe
waterSpe
);
public
int
insertWaterSpe
(
WaterSpe
Vo
waterSpeVo
);
/**
* 修改商品规格
*
* @param waterSpe 商品规格
*
* @param waterSpe
Vo
商品规格
* @return 结果
*/
public
int
updateWaterSpe
(
WaterSpe
waterSpe
);
public
int
updateWaterSpe
(
WaterSpe
Vo
waterSpeVo
);
/**
* 删除商品规格
*
*
* @param id 商品规格主键
* @return 结果
*/
...
...
@@ -54,9 +64,31 @@ public interface WaterSpeMapper
/**
* 批量删除商品规格
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteWaterSpeByIds
(
Long
[]
ids
);
/**
* 删除商品规格规格值
*
* @param id 商品规格主键
* @return 结果
*/
public
int
deleteWaterSpeValBySpeId
(
Long
id
);
/**
* 批量删除商品规格规格值
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteWaterSpeValBySpeIds
(
Long
[]
ids
);
/**
* 批量新增商品规格规格值
* @param waterSpeVals
*/
void
batchInsertWaterSpeVal
(
List
<
WaterSpeVal
>
waterSpeVals
);
}
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterStationMapper.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
mapper
;
import
com.qianhe.system.domain.WaterStation
;
import
com.qianhe.system.domain.WaterStationUser
;
import
com.qianhe.system.vo.WaterStationVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* 站点Mapper接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
WaterStationMapper
public
interface
WaterStationMapper
{
/**
* 查询站点
*
*
* @param id 站点主键
* @return 站点
*/
...
...
@@ -22,15 +25,22 @@ public interface WaterStationMapper
/**
* 查询站点列表
*
*
* @param waterStation 站点
* @return 站点集合
*/
public
List
<
WaterStation
>
selectWaterStationList
(
WaterStation
waterStation
);
/**
* 查询站点下拉框
*
* @return 站点集合
*/
public
List
<
Map
<
String
,
Object
>>
getStationList
();
/**
* 新增站点
*
*
* @param waterStation 站点
* @return 结果
*/
...
...
@@ -38,7 +48,7 @@ public interface WaterStationMapper
/**
* 修改站点
*
*
* @param waterStation 站点
* @return 结果
*/
...
...
@@ -46,7 +56,7 @@ public interface WaterStationMapper
/**
* 删除站点
*
*
* @param id 站点主键
* @return 结果
*/
...
...
@@ -54,9 +64,28 @@ public interface WaterStationMapper
/**
* 批量删除站点
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public
int
deleteWaterStationByIds
(
Long
[]
ids
);
/**
* 批量新增站点用户
* @param waterStationUsers
* @return
*/
void
batchInsertStationUser
(
List
<
WaterStationUser
>
waterStationUsers
);
/**
* 删除站点用户
* @param id
*/
void
deleteWaterStationUserByStationId
(
Long
id
);
/**
* 批量删除站点用户
* @param ids
*/
void
deleteWaterStationUserByStationIds
(
Long
[]
ids
);
}
qianhe-admin/src/main/java/com/qianhe/system/mapper/WaterStationUserMapper.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.qianhe.system.domain.WaterStationUser
;
import
java.util.List
;
/**
* 站点用户Mapper接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
WaterStationUserMapper
public
interface
WaterStationUserMapper
extends
BaseMapper
<
WaterStationUser
>
{
/**
* 查询站点用户
*
*
* @param id 站点用户主键
* @return 站点用户
*/
...
...
@@ -22,7 +23,7 @@ public interface WaterStationUserMapper
/**
* 查询站点用户列表
*
*
* @param waterStationUser 站点用户
* @return 站点用户集合
*/
...
...
@@ -30,7 +31,7 @@ public interface WaterStationUserMapper
/**
* 新增站点用户
*
*
* @param waterStationUser 站点用户
* @return 结果
*/
...
...
@@ -38,7 +39,7 @@ public interface WaterStationUserMapper
/**
* 修改站点用户
*
*
* @param waterStationUser 站点用户
* @return 结果
*/
...
...
@@ -46,7 +47,7 @@ public interface WaterStationUserMapper
/**
* 删除站点用户
*
*
* @param id 站点用户主键
* @return 结果
*/
...
...
@@ -54,7 +55,7 @@ public interface WaterStationUserMapper
/**
* 批量删除站点用户
*
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
...
...
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterGoodsService.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
;
import
com.qianhe.system.domain.WaterGoods
;
import
com.qianhe.system.vo.WaterGoodsVo
;
import
java.util.List
;
/**
* 商品Service接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
IWaterGoodsService
public
interface
IWaterGoodsService
{
/**
* 查询商品
*
*
* @param id 商品主键
* @return 商品
*/
public
WaterGoods
selectWaterGoodsById
(
Long
id
);
public
WaterGoods
Vo
selectWaterGoodsById
(
Long
id
);
/**
* 查询商品列表
*
*
* @param waterGoods 商品
* @return 商品集合
*/
...
...
@@ -30,23 +31,23 @@ public interface IWaterGoodsService
/**
* 新增商品
*
* @param waterGoods 商品
*
* @param waterGoods
Vo
商品
* @return 结果
*/
public
int
insertWaterGoods
(
WaterGoods
waterGoods
);
public
int
insertWaterGoods
(
WaterGoods
Vo
waterGoodsVo
);
/**
* 修改商品
*
* @param waterGoods 商品
*
* @param waterGoods
Vo
商品
* @return 结果
*/
public
int
updateWaterGoods
(
WaterGoods
waterGoods
);
public
int
updateWaterGoods
(
WaterGoods
Vo
waterGoodsVo
);
/**
* 批量删除商品
*
*
* @param ids 需要删除的商品主键集合
* @return 结果
*/
...
...
@@ -54,7 +55,7 @@ public interface IWaterGoodsService
/**
* 删除商品信息
*
*
* @param id 商品主键
* @return 结果
*/
...
...
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterGoodsSpeService.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
;
import
com.qianhe.system.domain.WaterGoodsSpe
;
import
com.qianhe.system.vo.WaterGoodsSpeVo
;
import
java.util.List
;
/**
* 商品关联规格Service接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
IWaterGoodsSpeService
public
interface
IWaterGoodsSpeService
{
/**
* 查询商品关联规格
*
*
* @param id 商品关联规格主键
* @return 商品关联规格
*/
...
...
@@ -22,7 +23,7 @@ public interface IWaterGoodsSpeService
/**
* 查询商品关联规格列表
*
*
* @param waterGoodsSpe 商品关联规格
* @return 商品关联规格集合
*/
...
...
@@ -30,23 +31,23 @@ public interface IWaterGoodsSpeService
/**
* 新增商品关联规格
*
* @param waterGoodsSpe 商品关联规格
*
* @param waterGoodsSpe
Vo
商品关联规格
* @return 结果
*/
public
int
insertWaterGoodsSpe
(
WaterGoodsSpe
waterGoodsSpe
);
public
int
insertWaterGoodsSpe
(
WaterGoodsSpe
Vo
waterGoodsSpeVo
);
/**
* 修改商品关联规格
*
* @param waterGoodsSpe 商品关联规格
*
* @param waterGoodsSpe
Vo
商品关联规格
* @return 结果
*/
public
int
updateWaterGoodsSpe
(
WaterGoodsSpe
waterGoodsSpe
);
public
int
updateWaterGoodsSpe
(
WaterGoodsSpe
Vo
waterGoodsSpeVo
);
/**
* 批量删除商品关联规格
*
*
* @param ids 需要删除的商品关联规格主键集合
* @return 结果
*/
...
...
@@ -54,7 +55,7 @@ public interface IWaterGoodsSpeService
/**
* 删除商品关联规格信息
*
*
* @param id 商品关联规格主键
* @return 结果
*/
...
...
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterSpeService.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
;
import
com.qianhe.system.domain.WaterSpe
;
import
com.qianhe.system.domain.WaterSpeVal
;
import
com.qianhe.system.vo.WaterSpeVo
;
import
java.util.List
;
/**
* 商品规格Service接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
IWaterSpeService
public
interface
IWaterSpeService
{
/**
* 查询商品规格
*
*
* @param id 商品规格主键
* @return 商品规格
*/
public
WaterSpe
selectWaterSpeById
(
Long
id
);
public
WaterSpe
Vo
selectWaterSpeById
(
Long
id
);
/**
* 查询商品规格列表
*
*
* @param waterSpe 商品规格
* @return 商品规格集合
*/
...
...
@@ -30,23 +32,23 @@ public interface IWaterSpeService
/**
* 新增商品规格
*
* @param waterSpe 商品规格
*
* @param waterSpe
Vo
商品规格
* @return 结果
*/
public
int
insertWaterSpe
(
WaterSpe
waterSpe
);
public
int
insertWaterSpe
(
WaterSpe
Vo
waterSpeVo
);
/**
* 修改商品规格
*
* @param waterSpe 商品规格
*
* @param waterSpe
Vo
商品规格
* @return 结果
*/
public
int
updateWaterSpe
(
WaterSpe
waterSpe
);
public
int
updateWaterSpe
(
WaterSpe
Vo
waterSpeVo
);
/**
* 批量删除商品规格
*
*
* @param ids 需要删除的商品规格主键集合
* @return 结果
*/
...
...
@@ -54,9 +56,11 @@ public interface IWaterSpeService
/**
* 删除商品规格信息
*
*
* @param id 商品规格主键
* @return 结果
*/
public
int
deleteWaterSpeById
(
Long
id
);
List
<
WaterSpeVal
>
selectWaterSpeValList
(
WaterSpeVal
waterSpeVal
);
}
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterStationService.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
;
import
com.qianhe.system.domain.WaterStation
;
import
com.qianhe.system.vo.WaterStationVo
;
import
java.util.List
;
import
java.util.Map
;
/**
* 站点Service接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
IWaterStationService
public
interface
IWaterStationService
{
/**
* 查询站点
*
*
* @param id 站点主键
* @return 站点
*/
public
WaterStation
selectWaterStationById
(
Long
id
);
public
WaterStation
Vo
selectWaterStationById
(
Long
id
);
/**
* 查询站点列表
*
*
* @param waterStation 站点
* @return 站点集合
*/
...
...
@@ -30,7 +32,7 @@ public interface IWaterStationService
/**
* 新增站点
*
*
* @param waterStation 站点
* @return 结果
*/
...
...
@@ -38,7 +40,7 @@ public interface IWaterStationService
/**
* 修改站点
*
*
* @param waterStation 站点
* @return 结果
*/
...
...
@@ -46,7 +48,7 @@ public interface IWaterStationService
/**
* 批量删除站点
*
*
* @param ids 需要删除的站点主键集合
* @return 结果
*/
...
...
@@ -54,9 +56,23 @@ public interface IWaterStationService
/**
* 删除站点信息
*
*
* @param id 站点主键
* @return 结果
*/
public
int
deleteWaterStationById
(
Long
id
);
/**
* 修改是否营业
* @param waterStation
* @return
*/
int
updateIsOpen
(
WaterStation
waterStation
);
/**
* 查询站点下拉框
*
* @return 站点集合
*/
public
List
<
Map
<
String
,
Object
>>
getStationList
();
}
qianhe-admin/src/main/java/com/qianhe/system/service/IWaterStationUserService.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.qianhe.system.domain.WaterStationUser
;
import
java.util.List
;
/**
* 站点用户Service接口
*
*
* @author qianhe
* @date 2023-11-23
*/
public
interface
IWaterStationUserService
public
interface
IWaterStationUserService
extends
IService
<
WaterStationUser
>
{
/**
* 查询站点用户
*
*
* @param id 站点用户主键
* @return 站点用户
*/
...
...
@@ -22,7 +23,7 @@ public interface IWaterStationUserService
/**
* 查询站点用户列表
*
*
* @param waterStationUser 站点用户
* @return 站点用户集合
*/
...
...
@@ -30,7 +31,7 @@ public interface IWaterStationUserService
/**
* 新增站点用户
*
*
* @param waterStationUser 站点用户
* @return 结果
*/
...
...
@@ -38,7 +39,7 @@ public interface IWaterStationUserService
/**
* 修改站点用户
*
*
* @param waterStationUser 站点用户
* @return 结果
*/
...
...
@@ -46,7 +47,7 @@ public interface IWaterStationUserService
/**
* 批量删除站点用户
*
*
* @param ids 需要删除的站点用户主键集合
* @return 结果
*/
...
...
@@ -54,7 +55,7 @@ public interface IWaterStationUserService
/**
* 删除站点用户信息
*
*
* @param id 站点用户主键
* @return 结果
*/
...
...
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterGoodsServiceImpl.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.qianhe.common.utils.DateUtils
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.system.domain.WaterGoods
;
import
com.qianhe.system.domain.WaterGoodsImg
;
import
com.qianhe.system.domain.WaterGoodsSpe
;
import
com.qianhe.system.domain.WaterGoodsSpeVal
;
import
com.qianhe.system.mapper.WaterGoodsImgMapper
;
import
com.qianhe.system.mapper.WaterGoodsMapper
;
import
com.qianhe.system.mapper.WaterGoodsSpeMapper
;
import
com.qianhe.system.service.IWaterGoodsService
;
import
com.qianhe.system.vo.WaterGoodsSpeVo
;
import
com.qianhe.system.vo.WaterGoodsVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -20,6 +32,10 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
{
@Autowired
private
WaterGoodsMapper
waterGoodsMapper
;
@Autowired
private
WaterGoodsSpeMapper
waterGoodsSpeMapper
;
@Autowired
private
WaterGoodsImgMapper
waterGoodsImgMapper
;
/**
* 查询商品
...
...
@@ -28,9 +44,58 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
* @return 商品
*/
@Override
public
WaterGoods
selectWaterGoodsById
(
Long
id
)
public
WaterGoods
Vo
selectWaterGoodsById
(
Long
id
)
{
return
waterGoodsMapper
.
selectWaterGoodsById
(
id
);
WaterGoods
waterGoods
=
waterGoodsMapper
.
selectWaterGoodsById
(
id
);
//转vo
WaterGoodsVo
waterGoodsVo
=
new
WaterGoodsVo
();
BeanUtils
.
copyProperties
(
waterGoods
,
waterGoodsVo
);
//查询商品图片
WaterGoodsImg
waterGoodsImg
=
new
WaterGoodsImg
();
waterGoodsImg
.
setGoodsId
(
id
);
List
<
WaterGoodsImg
>
waterGoodsImgs
=
waterGoodsImgMapper
.
selectWaterGoodsImgList
(
waterGoodsImg
);
//查询商品规格
WaterGoodsSpe
waterGoodsSpe
=
new
WaterGoodsSpe
();
waterGoodsSpe
.
setGoodsId
(
id
);
List
<
WaterGoodsSpe
>
waterGoodsSpes
=
waterGoodsSpeMapper
.
selectWaterGoodsSpeList
(
waterGoodsSpe
);
List
<
WaterGoodsSpeVo
>
waterGoodsSpeVoList
=
new
ArrayList
<>();
if
(
waterGoodsSpes
.
size
()
>
0
){
for
(
WaterGoodsSpe
goodsSpe
:
waterGoodsSpes
)
{
//转vo
WaterGoodsSpeVo
waterGoodsSpeVo
=
new
WaterGoodsSpeVo
();
BeanUtils
.
copyProperties
(
goodsSpe
,
waterGoodsSpeVo
);
WaterGoodsSpeVal
waterGoodsSpeVal
=
new
WaterGoodsSpeVal
();
waterGoodsSpeVal
.
setSpeId
(
goodsSpe
.
getId
());
List
<
WaterGoodsSpeVal
>
waterGoodsSpeVals
=
waterGoodsSpeMapper
.
selectWaterGoodsSpeValList
(
waterGoodsSpeVal
);
if
(
waterGoodsSpeVals
.
size
()
>
0
){
waterGoodsSpeVo
.
setWaterGoodsSpeValList
(
waterGoodsSpeVals
);
}
waterGoodsSpeVoList
.
add
(
waterGoodsSpeVo
);
}
}
if
(
waterGoodsSpeVoList
.
size
()
>
0
){
waterGoodsVo
.
setWaterGoodsSpe
(
waterGoodsSpeVoList
.
get
(
0
));
}
List
<
WaterGoodsImg
>
coverImgs
=
new
ArrayList
<>();
List
<
WaterGoodsImg
>
detailsImgs
=
new
ArrayList
<>();
for
(
WaterGoodsImg
waterGoodsImg1
:
waterGoodsImgs
)
{
if
(
waterGoodsImg1
.
getImgType
()
==
1
){
//商品封面图
coverImgs
.
add
(
waterGoodsImg1
);
}
if
(
waterGoodsImg1
.
getImgType
()
==
2
){
//商品详情图
detailsImgs
.
add
(
waterGoodsImg1
);
}
}
if
(
coverImgs
.
size
()
>
0
){
waterGoodsVo
.
setCoverImgs
(
coverImgs
);
}
if
(
detailsImgs
.
size
()
>
0
){
waterGoodsVo
.
setDetailsImgs
(
detailsImgs
);
}
return
waterGoodsVo
;
}
/**
...
...
@@ -48,26 +113,120 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
/**
* 新增商品
*
* @param waterGoods 商品
* @param waterGoods
Vo
商品
* @return 结果
*/
@Override
public
int
insertWaterGoods
(
WaterGoods
waterGoods
)
@Transactional
public
int
insertWaterGoods
(
WaterGoodsVo
waterGoodsVo
)
{
waterGoods
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
waterGoodsMapper
.
insertWaterGoods
(
waterGoods
);
waterGoodsVo
.
setCreateUser
(
"管理员"
);
waterGoodsVo
.
setCreateTime
(
DateUtils
.
getNowDate
());
int
i
=
waterGoodsMapper
.
insertWaterGoods
(
waterGoodsVo
);
//新增封面图
insertGoodsCoverImgs
(
waterGoodsVo
);
//新增详情图
insertGoodsDetailsImgs
(
waterGoodsVo
);
//新增商品关联规格
insertWaterGoodsSpe
(
waterGoodsVo
);
return
i
;
}
/**
* 修改商品
*
* @param waterGoods 商品
* @param waterGoods
Vo
商品
* @return 结果
*/
@Override
public
int
updateWaterGoods
(
WaterGoods
waterGoods
)
public
int
updateWaterGoods
(
WaterGoods
Vo
waterGoodsVo
)
{
return
waterGoodsMapper
.
updateWaterGoods
(
waterGoods
);
//删除商品图片
waterGoodsMapper
.
deleteWaterGoodsImgByGoodsId
(
waterGoodsVo
.
getId
());
//删除商品关联规格
waterGoodsMapper
.
deleteWaterGoodsSpeByGoodsId
(
waterGoodsVo
.
getId
());
//新增封面图
insertGoodsCoverImgs
(
waterGoodsVo
);
//新增详情图
insertGoodsDetailsImgs
(
waterGoodsVo
);
//新增商品关联规格
insertWaterGoodsSpe
(
waterGoodsVo
);
return
waterGoodsMapper
.
updateWaterGoods
(
waterGoodsVo
);
}
/**
* 新增商品关联规格
* @param waterGoodsVo
*/
private
void
insertWaterGoodsSpe
(
WaterGoodsVo
waterGoodsVo
)
{
WaterGoodsSpeVo
waterGoodsSpe
=
waterGoodsVo
.
getWaterGoodsSpe
();
//新增商品关联规格
if
(
StringUtils
.
isNotNull
(
waterGoodsSpe
)){
waterGoodsSpe
.
setGoodsId
(
waterGoodsVo
.
getId
());
waterGoodsSpe
.
setCreateUser
(
"管理员"
);
waterGoodsSpe
.
setCreateTime
(
DateUtils
.
getNowDate
());
waterGoodsSpeMapper
.
insertWaterGoodsSpe
(
waterGoodsSpe
);
}
List
<
WaterGoodsSpeVal
>
waterGoodsSpeValList
=
waterGoodsSpe
.
getWaterGoodsSpeValList
();
List
<
WaterGoodsSpeVal
>
waterGoodsSpeVals
=
new
ArrayList
<>();
//商品关联规格主键id
Long
speId
=
waterGoodsSpe
.
getId
();
if
(
StringUtils
.
isNotNull
(
waterGoodsSpeValList
)){
for
(
WaterGoodsSpeVal
waterGoodsSpeVal
:
waterGoodsSpeValList
)
{
waterGoodsSpeVal
.
setSpeId
(
speId
);
waterGoodsSpeVals
.
add
(
waterGoodsSpeVal
);
}
}
if
(
waterGoodsSpeVals
.
size
()
>
0
){
//批量新增商品关联规格值
waterGoodsSpeMapper
.
batchInsertWaterGoodsSpeVal
(
waterGoodsSpeVals
);
}
}
/**
* 新增详情图
* @param waterGoodsVo
*/
private
void
insertGoodsDetailsImgs
(
WaterGoodsVo
waterGoodsVo
)
{
List
<
WaterGoodsImg
>
detailsImgs
=
waterGoodsVo
.
getDetailsImgs
();
List
<
WaterGoodsImg
>
detailsImgList
=
new
ArrayList
<>();
//商品主键id
Long
id
=
waterGoodsVo
.
getId
();
if
(
StringUtils
.
isNotNull
(
detailsImgs
)){
for
(
WaterGoodsImg
detailsImg
:
detailsImgs
)
{
detailsImg
.
setGoodsId
(
id
);
detailsImg
.
setImgType
(
2
);
detailsImgList
.
add
(
detailsImg
);
}
}
if
(
detailsImgList
.
size
()
>
0
){
//批量新增详情图
waterGoodsMapper
.
batchInsertWaterGoodsImg
(
detailsImgList
);
}
}
/**
* 新增封面图
* @param waterGoodsVo
*/
private
void
insertGoodsCoverImgs
(
WaterGoodsVo
waterGoodsVo
)
{
List
<
WaterGoodsImg
>
coverImgs
=
waterGoodsVo
.
getCoverImgs
();
List
<
WaterGoodsImg
>
coverImgList
=
new
ArrayList
<>();
//商品主键id
Long
id
=
waterGoodsVo
.
getId
();
if
(
StringUtils
.
isNotNull
(
coverImgs
)){
for
(
WaterGoodsImg
coverImg
:
coverImgs
)
{
coverImg
.
setGoodsId
(
id
);
coverImg
.
setImgType
(
1
);
coverImgList
.
add
(
coverImg
);
}
}
if
(
coverImgList
.
size
()
>
0
){
//批量新增封面图
waterGoodsMapper
.
batchInsertWaterGoodsImg
(
coverImgList
);
}
}
/**
...
...
@@ -79,6 +238,10 @@ public class WaterGoodsServiceImpl implements IWaterGoodsService
@Override
public
int
deleteWaterGoodsByIds
(
Long
[]
ids
)
{
//删除商品图片
waterGoodsMapper
.
deleteWaterGoodsImgByGoodsIds
(
ids
);
//删除商品关联规格
waterGoodsMapper
.
deleteWaterGoodsSpeByGoodsIds
(
ids
);
return
waterGoodsMapper
.
deleteWaterGoodsByIds
(
ids
);
}
...
...
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterGoodsSpeServiceImpl.java
View file @
890e49d4
...
...
@@ -4,6 +4,7 @@ import com.qianhe.common.utils.DateUtils;
import
com.qianhe.system.domain.WaterGoodsSpe
;
import
com.qianhe.system.mapper.WaterGoodsSpeMapper
;
import
com.qianhe.system.service.IWaterGoodsSpeService
;
import
com.qianhe.system.vo.WaterGoodsSpeVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -48,26 +49,26 @@ public class WaterGoodsSpeServiceImpl implements IWaterGoodsSpeService
/**
* 新增商品关联规格
*
* @param waterGoodsSpe 商品关联规格
* @param waterGoodsSpe
Vo
商品关联规格
* @return 结果
*/
@Override
public
int
insertWaterGoodsSpe
(
WaterGoodsSpe
waterGoodsSpe
)
public
int
insertWaterGoodsSpe
(
WaterGoodsSpe
Vo
waterGoodsSpeVo
)
{
waterGoodsSpe
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
waterGoodsSpeMapper
.
insertWaterGoodsSpe
(
waterGoodsSpe
);
waterGoodsSpe
Vo
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
waterGoodsSpeMapper
.
insertWaterGoodsSpe
(
waterGoodsSpe
Vo
);
}
/**
* 修改商品关联规格
*
* @param waterGoodsSpe 商品关联规格
* @param waterGoodsSpe
Vo
商品关联规格
* @return 结果
*/
@Override
public
int
updateWaterGoodsSpe
(
WaterGoodsSpe
waterGoodsSpe
)
public
int
updateWaterGoodsSpe
(
WaterGoodsSpe
Vo
waterGoodsSpeVo
)
{
return
waterGoodsSpeMapper
.
updateWaterGoodsSpe
(
waterGoodsSpe
);
return
waterGoodsSpeMapper
.
updateWaterGoodsSpe
(
waterGoodsSpe
Vo
);
}
/**
...
...
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterSpeServiceImpl.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
.
impl
;
import
com.qianhe.common.utils.DateUtils
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.system.domain.WaterSpe
;
import
com.qianhe.system.domain.WaterSpeVal
;
import
com.qianhe.system.mapper.WaterSpeMapper
;
import
com.qianhe.system.service.IWaterSpeService
;
import
com.qianhe.system.vo.WaterSpeVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -28,9 +33,20 @@ public class WaterSpeServiceImpl implements IWaterSpeService
* @return 商品规格
*/
@Override
public
WaterSpe
selectWaterSpeById
(
Long
id
)
public
WaterSpe
Vo
selectWaterSpeById
(
Long
id
)
{
return
waterSpeMapper
.
selectWaterSpeById
(
id
);
WaterSpe
waterSpe
=
waterSpeMapper
.
selectWaterSpeById
(
id
);
//转vo
WaterSpeVo
waterSpeVo
=
new
WaterSpeVo
();
BeanUtils
.
copyProperties
(
waterSpe
,
waterSpeVo
);
//根据商品规格主键id查找商品规格规格值
WaterSpeVal
waterSpeVal
=
new
WaterSpeVal
();
waterSpeVal
.
setSpeId
(
id
);
List
<
WaterSpeVal
>
waterSpeVals
=
waterSpeMapper
.
selectWaterSpeValList
(
waterSpeVal
);
if
(
waterSpeVals
.
size
()
>
0
){
waterSpeVo
.
setWaterSpeValList
(
waterSpeVals
);
}
return
waterSpeVo
;
}
/**
...
...
@@ -48,26 +64,52 @@ public class WaterSpeServiceImpl implements IWaterSpeService
/**
* 新增商品规格
*
* @param waterSpe 商品规格
* @param waterSpe
Vo
商品规格
* @return 结果
*/
@Override
public
int
insertWaterSpe
(
WaterSpe
waterSpe
)
public
int
insertWaterSpe
(
WaterSpe
Vo
waterSpeVo
)
{
waterSpe
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
waterSpeMapper
.
insertWaterSpe
(
waterSpe
);
waterSpeVo
.
setCreateUser
(
"管理员"
);
waterSpeVo
.
setCreateTime
(
DateUtils
.
getNowDate
());
int
i
=
waterSpeMapper
.
insertWaterSpe
(
waterSpeVo
);
insertWaterSpeVal
(
waterSpeVo
);
return
i
;
}
private
void
insertWaterSpeVal
(
WaterSpeVo
waterSpeVo
)
{
//商品规格值列表
List
<
WaterSpeVal
>
waterSpeValList
=
waterSpeVo
.
getWaterSpeValList
();
List
<
WaterSpeVal
>
waterSpeVals
=
new
ArrayList
<>();
//商品规格主表id
Long
id
=
waterSpeVo
.
getId
();
if
(
StringUtils
.
isNotNull
(
waterSpeValList
)){
for
(
WaterSpeVal
waterSpeVal
:
waterSpeValList
)
{
waterSpeVal
.
setSpeId
(
id
);
waterSpeVals
.
add
(
waterSpeVal
);
}
}
if
(
waterSpeVals
.
size
()
>
0
){
//批量新增
waterSpeMapper
.
batchInsertWaterSpeVal
(
waterSpeVals
);
}
}
/**
* 修改商品规格
*
* @param waterSpe 商品规格
* @param waterSpe
Vo
商品规格
* @return 结果
*/
@Override
public
int
updateWaterSpe
(
WaterSpe
waterSpe
)
public
int
updateWaterSpe
(
WaterSpe
Vo
waterSpeVo
)
{
return
waterSpeMapper
.
updateWaterSpe
(
waterSpe
);
//删除商品规格关联的规格规格值
waterSpeMapper
.
deleteWaterSpeValBySpeId
(
waterSpeVo
.
getId
());
//新增规格规格值
insertWaterSpeVal
(
waterSpeVo
);
return
waterSpeMapper
.
updateWaterSpe
(
waterSpeVo
);
}
/**
...
...
@@ -79,6 +121,8 @@ public class WaterSpeServiceImpl implements IWaterSpeService
@Override
public
int
deleteWaterSpeByIds
(
Long
[]
ids
)
{
//批量删除商品规格关联的规格规格值
waterSpeMapper
.
deleteWaterSpeValBySpeIds
(
ids
);
return
waterSpeMapper
.
deleteWaterSpeByIds
(
ids
);
}
...
...
@@ -91,6 +135,12 @@ public class WaterSpeServiceImpl implements IWaterSpeService
@Override
public
int
deleteWaterSpeById
(
Long
id
)
{
waterSpeMapper
.
deleteWaterSpeValBySpeId
(
id
);
return
waterSpeMapper
.
deleteWaterSpeById
(
id
);
}
@Override
public
List
<
WaterSpeVal
>
selectWaterSpeValList
(
WaterSpeVal
waterSpeVal
)
{
return
waterSpeMapper
.
selectWaterSpeValList
(
waterSpeVal
);
}
}
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterStationServiceImpl.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
.
impl
;
import
com.qianhe.common.utils.DateUtils
;
import
com.qianhe.common.utils.StringUtils
;
import
com.qianhe.system.domain.WaterStation
;
import
com.qianhe.system.domain.WaterStationUser
;
import
com.qianhe.system.mapper.WaterStationMapper
;
import
com.qianhe.system.mapper.WaterStationUserMapper
;
import
com.qianhe.system.service.IWaterStationService
;
import
com.qianhe.system.vo.WaterStationVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
* 站点Service业务层处理
...
...
@@ -20,6 +28,10 @@ public class WaterStationServiceImpl implements IWaterStationService
{
@Autowired
private
WaterStationMapper
waterStationMapper
;
@Autowired
private
WaterStationUserMapper
waterStationUserMapper
;
@Autowired
private
WaterStationUserServiceImpl
waterStationUserService
;
/**
* 查询站点
...
...
@@ -28,9 +40,19 @@ public class WaterStationServiceImpl implements IWaterStationService
* @return 站点
*/
@Override
public
WaterStation
selectWaterStationById
(
Long
id
)
public
WaterStation
Vo
selectWaterStationById
(
Long
id
)
{
return
waterStationMapper
.
selectWaterStationById
(
id
);
WaterStationVo
waterStationVo
=
new
WaterStationVo
();
WaterStation
waterStation
=
waterStationMapper
.
selectWaterStationById
(
id
);
BeanUtils
.
copyProperties
(
waterStation
,
waterStationVo
);
//查询站点用户
WaterStationUser
waterStationUser
=
new
WaterStationUser
();
waterStationUser
.
setStationId
(
id
);
List
<
WaterStationUser
>
waterStationUsers
=
waterStationUserMapper
.
selectWaterStationUserList
(
waterStationUser
);
if
(
waterStationUsers
.
size
()
>
0
){
waterStationVo
.
setWaterStationUserList
(
waterStationUsers
);
}
return
waterStationVo
;
}
/**
...
...
@@ -52,10 +74,13 @@ public class WaterStationServiceImpl implements IWaterStationService
* @return 结果
*/
@Override
@Transactional
public
int
insertWaterStation
(
WaterStation
waterStation
)
{
waterStation
.
setCreateUser
(
"管理员"
);
waterStation
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
waterStationMapper
.
insertWaterStation
(
waterStation
);
int
i
=
waterStationMapper
.
insertWaterStation
(
waterStation
);
return
i
;
}
/**
...
...
@@ -65,11 +90,35 @@ public class WaterStationServiceImpl implements IWaterStationService
* @return 结果
*/
@Override
@Transactional
public
int
updateWaterStation
(
WaterStation
waterStation
)
{
//删除该站点用户
waterStationMapper
.
deleteWaterStationUserByStationId
(
waterStation
.
getId
());
return
waterStationMapper
.
updateWaterStation
(
waterStation
);
}
private
void
insertWaterStationUser
(
WaterStationVo
waterStationVo
)
{
//送水工集合
List
<
WaterStationUser
>
waterStationUserList
=
waterStationVo
.
getWaterStationUserList
();
List
<
WaterStationUser
>
waterStationUsers
=
new
ArrayList
<>();
//站点主键id
Long
id
=
waterStationVo
.
getId
();
if
(
StringUtils
.
isNotNull
(
waterStationUserList
)
&&
waterStationUserList
.
size
()
>
0
){
for
(
WaterStationUser
waterStationUser
:
waterStationUserList
)
{
waterStationUser
.
setStationId
(
id
);
waterStationUser
.
setCreateTime
(
DateUtils
.
getNowDate
());
waterStationUser
.
setCreateUser
(
"管理员"
);
waterStationUsers
.
add
(
waterStationUser
);
}
}
if
(
waterStationUsers
.
size
()
>
0
){
//批量新增站点用户
waterStationMapper
.
batchInsertStationUser
(
waterStationUsers
);
}
}
/**
* 批量删除站点
*
...
...
@@ -77,8 +126,11 @@ public class WaterStationServiceImpl implements IWaterStationService
* @return 结果
*/
@Override
@Transactional
public
int
deleteWaterStationByIds
(
Long
[]
ids
)
{
//批量删除站点用户
waterStationMapper
.
deleteWaterStationUserByStationIds
(
ids
);
return
waterStationMapper
.
deleteWaterStationByIds
(
ids
);
}
...
...
@@ -93,4 +145,23 @@ public class WaterStationServiceImpl implements IWaterStationService
{
return
waterStationMapper
.
deleteWaterStationById
(
id
);
}
/**
* 修改是否营业
* @param waterStation
* @return
*/
@Override
public
int
updateIsOpen
(
WaterStation
waterStation
)
{
return
waterStationMapper
.
updateWaterStation
(
waterStation
);
}
/**
* 查询站点下拉框
* @return
*/
@Override
public
List
<
Map
<
String
,
Object
>>
getStationList
()
{
return
waterStationMapper
.
getStationList
();
}
}
qianhe-admin/src/main/java/com/qianhe/system/service/impl/WaterStationUserServiceImpl.java
View file @
890e49d4
package
com
.
qianhe
.
system
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.qianhe.common.utils.DateUtils
;
import
com.qianhe.system.domain.WaterStationUser
;
import
com.qianhe.system.mapper.WaterStationUserMapper
;
...
...
@@ -16,7 +17,7 @@ import java.util.List;
* @date 2023-11-23
*/
@Service
public
class
WaterStationUserServiceImpl
implements
IWaterStationUserService
public
class
WaterStationUserServiceImpl
extends
ServiceImpl
<
WaterStationUserMapper
,
WaterStationUser
>
implements
IWaterStationUserService
{
@Autowired
private
WaterStationUserMapper
waterStationUserMapper
;
...
...
@@ -54,6 +55,7 @@ public class WaterStationUserServiceImpl implements IWaterStationUserService
@Override
public
int
insertWaterStationUser
(
WaterStationUser
waterStationUser
)
{
waterStationUser
.
setCreateUser
(
"管理员"
);
waterStationUser
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
waterStationUserMapper
.
insertWaterStationUser
(
waterStationUser
);
}
...
...
qianhe-admin/src/main/java/com/qianhe/system/vo/WaterGoodsSpeVo.java
0 → 100644
View file @
890e49d4
package
com
.
qianhe
.
system
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.system.domain.WaterGoodsSpeVal
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
WaterGoodsSpeVo
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 标题 */
@Excel
(
name
=
"标题"
)
private
String
speTitle
;
/** 商品id */
@Excel
(
name
=
"商品id"
)
private
Long
goodsId
;
/** 创建人 */
private
String
createUser
;
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/** 商品关联规格值集合 */
private
List
<
WaterGoodsSpeVal
>
waterGoodsSpeValList
;
}
qianhe-admin/src/main/java/com/qianhe/system/vo/WaterGoodsVo.java
0 → 100644
View file @
890e49d4
package
com
.
qianhe
.
system
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.system.domain.WaterGoodsImg
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
WaterGoodsVo
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 标题 */
@Excel
(
name
=
"标题"
)
private
String
title
;
/** 类型 */
@Excel
(
name
=
"类型"
)
private
Long
goodsTypeId
;
/** 商品分类 */
@Excel
(
name
=
"商品分类"
)
private
String
goodsTypeName
;
/** 所属站点id */
@Excel
(
name
=
"所属站点id"
)
private
String
belongStationId
;
/** 所属站点名称 */
@Excel
(
name
=
"所属站点名称"
)
private
String
belongStationNames
;
/** 封面图 */
@Excel
(
name
=
"封面图"
)
private
String
coverImg
;
/** 详情图 */
@Excel
(
name
=
"详情图"
)
private
String
detailsImg
;
/** 价格 */
@Excel
(
name
=
"价格"
)
private
String
price
;
/** 创建人 */
private
String
createUser
;
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/** 状态(1上架0下架) */
@Excel
(
name
=
"状态"
,
readConverterExp
=
"1=上架0下架"
)
private
Long
status
;
/** 封面图集合 */
private
List
<
WaterGoodsImg
>
coverImgs
;
/** 详情图集合 */
private
List
<
WaterGoodsImg
>
detailsImgs
;
/** 商品关联规格集合 */
private
WaterGoodsSpeVo
waterGoodsSpe
;
}
qianhe-admin/src/main/java/com/qianhe/system/vo/WaterSpeVo.java
0 → 100644
View file @
890e49d4
package
com
.
qianhe
.
system
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.system.domain.WaterSpeVal
;
import
lombok.Data
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
WaterSpeVo
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 标题 */
@Excel
(
name
=
"标题"
)
private
String
speTitle
;
/** 创建人 */
private
String
createUser
;
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/** 商品规格子表集合 */
private
List
<
WaterSpeVal
>
waterSpeValList
;
}
qianhe-admin/src/main/java/com/qianhe/system/vo/WaterStationVo.java
0 → 100644
View file @
890e49d4
package
com
.
qianhe
.
system
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.qianhe.common.annotation.Excel
;
import
com.qianhe.system.domain.WaterStationUser
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
WaterStationVo
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
/** 站点名称 */
@Excel
(
name
=
"站点名称"
)
private
String
stationName
;
/** 电话 */
@Excel
(
name
=
"电话"
)
private
Long
phoneNum
;
/** 详细地址 */
@Excel
(
name
=
"详细地址"
)
private
String
stationAddress
;
/** 经度 */
@Excel
(
name
=
"经度"
)
private
BigDecimal
stationLon
;
/** 纬度 */
@Excel
(
name
=
"纬度"
)
private
BigDecimal
stationLat
;
/** 省份 */
@Excel
(
name
=
"省份"
)
private
String
province
;
/** 城市 */
@Excel
(
name
=
"城市"
)
private
String
city
;
/** 市区 */
@Excel
(
name
=
"市区"
)
private
String
area
;
/** 是否打烊(1营业0打烊) */
@Excel
(
name
=
"是否打烊(1营业0打烊)"
)
private
Long
isOpen
;
/** 创建人 */
@Excel
(
name
=
"创建人"
)
private
String
createUser
;
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
createTime
;
/** 送水工集合 */
private
List
<
WaterStationUser
>
waterStationUserList
;
}
qianhe-admin/src/main/resources/mapper/WaterGoodsImgMapper.xml
View file @
890e49d4
...
...
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qianhe.system.mapper.WaterGoodsImgMapper"
>
<resultMap
type=
"WaterGoodsImg"
id=
"WaterGoodsImgResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"imgName"
column=
"img_name"
/>
...
...
@@ -21,7 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectWaterGoodsImgList"
parameterType=
"WaterGoodsImg"
resultMap=
"WaterGoodsImgResult"
>
<include
refid=
"selectWaterGoodsImgVo"
/>
<where>
<where>
del_flag = '0'
<if
test=
"imgName != null and imgName != ''"
>
and img_name like concat('%', #{imgName}, '%')
</if>
<if
test=
"type != null and type != ''"
>
and type = #{type}
</if>
<if
test=
"sizea != null and sizea != ''"
>
and sizea = #{sizea}
</if>
...
...
@@ -31,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"goodsId != null "
>
and goods_id = #{goodsId}
</if>
</where>
</select>
<select
id=
"selectWaterGoodsImgById"
parameterType=
"Long"
resultMap=
"WaterGoodsImgResult"
>
<include
refid=
"selectWaterGoodsImgVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWaterGoodsImg"
parameterType=
"WaterGoodsImg"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into water_goods_img
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -78,9 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete
id=
"deleteWaterGoodsImgByIds"
parameterType=
"String"
>
delete from water_goods_img where id in
delete from water_goods_img where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</mapper>
qianhe-admin/src/main/resources/mapper/WaterGoodsMapper.xml
View file @
890e49d4
...
...
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qianhe.system.mapper.WaterGoodsMapper"
>
<resultMap
type=
"WaterGoods"
id=
"WaterGoodsResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"title"
column=
"title"
/>
...
...
@@ -12,17 +12,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"coverImg"
column=
"cover_img"
/>
<result
property=
"detailsImg"
column=
"details_img"
/>
<result
property=
"price"
column=
"price"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"status"
column=
"status"
/>
</resultMap>
<sql
id=
"selectWaterGoodsVo"
>
select id, title, goods_type_id, belong_station_id, cover_img, details_img, price, create_time, status from water_goods
select id, title, goods_type_id, belong_station_id, cover_img, details_img, price, create_
user, create_
time, status from water_goods
</sql>
<select
id=
"selectWaterGoodsList"
parameterType=
"WaterGoods"
resultMap=
"WaterGoodsResult"
>
<include
refid=
"selectWaterGoodsVo"
/>
<where>
<where>
del_flag = '0'
<if
test=
"title != null and title != ''"
>
and title = #{title}
</if>
<if
test=
"goodsTypeId != null "
>
and goods_type_id = #{goodsTypeId}
</if>
<if
test=
"belongStationId != null "
>
and belong_station_id = #{belongStationId}
</if>
...
...
@@ -32,13 +34,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"status != null "
>
and status = #{status}
</if>
</where>
</select>
<select
id=
"selectWaterGoodsById"
parameterType=
"Long"
resultMap=
"WaterGoodsResult"
>
<include
refid=
"selectWaterGoodsVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWaterGoods"
parameterType=
"
WaterGoods
"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertWaterGoods"
parameterType=
"
com.qianhe.system.vo.WaterGoodsVo
"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into water_goods
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"title != null"
>
title,
</if>
...
...
@@ -47,6 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"coverImg != null"
>
cover_img,
</if>
<if
test=
"detailsImg != null"
>
details_img,
</if>
<if
test=
"price != null"
>
price,
</if>
<if
test=
"createUser != null"
>
create_user,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"status != null"
>
status,
</if>
</trim>
...
...
@@ -57,12 +60,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"coverImg != null"
>
#{coverImg},
</if>
<if
test=
"detailsImg != null"
>
#{detailsImg},
</if>
<if
test=
"price != null"
>
#{price},
</if>
<if
test=
"createUser != null"
>
#{createUser},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"status != null"
>
#{status},
</if>
</trim>
</insert>
<update
id=
"updateWaterGoods"
parameterType=
"
WaterGoods
"
>
<update
id=
"updateWaterGoods"
parameterType=
"
com.qianhe.system.vo.WaterGoodsVo
"
>
update water_goods
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"title != null"
>
title = #{title},
</if>
...
...
@@ -71,20 +75,67 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"coverImg != null"
>
cover_img = #{coverImg},
</if>
<if
test=
"detailsImg != null"
>
details_img = #{detailsImg},
</if>
<if
test=
"price != null"
>
price = #{price},
</if>
<if
test=
"createUser != null"
>
create_user = #{createUser},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
</trim>
where id = #{id}
</update>
<delete
id=
"deleteWaterGoodsById"
parameterType=
"Long"
>
delete from water_goods where id = #{id}
</delete>
<update
id=
"deleteWaterGoodsById"
parameterType=
"Long"
>
update water_goods set del_flag = '1' where id = #{id}
</update>
<update
id=
"deleteWaterGoodsByIds"
parameterType=
"String"
>
update water_goods set del_flag = '1' where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
<update
id=
"deleteWaterGoodsImgByGoodsId"
parameterType=
"Long"
>
update water_goods_img set del_flag = '1' where goods_id = #{id}
</update>
<update
id=
"deleteWaterGoodsImgByGoodsIds"
parameterType=
"String"
>
update water_goods_img set del_flag = '1' where goods_id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
<delete
id=
"deleteWaterGoodsByIds"
parameterType=
"String"
>
delete from water_goods where id in
<update
id=
"deleteWaterGoodsSpeByGoodsId"
parameterType=
"Long"
>
update water_goods_spe set del_flag = '1' where goods_id = #{id}
</update>
<update
id=
"deleteWaterGoodsSpeByGoodsIds"
parameterType=
"String"
>
update water_goods_spe set del_flag = '1' where goods_id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</update>
<insert
id=
"batchInsertWaterGoodsImg"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<foreach
collection=
"list"
item=
"data"
separator=
";"
>
insert into water_goods_img
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"data.imgName != null"
>
img_name,
</if>
<if
test=
"data.type != null"
>
type,
</if>
<if
test=
"data.sizea != null"
>
sizea,
</if>
<if
test=
"data.url != null"
>
url,
</if>
<if
test=
"data.md5 != null"
>
md5,
</if>
<if
test=
"data.imgType != null"
>
img_type,
</if>
<if
test=
"data.goodsId != null"
>
goods_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"data.imgName != null"
>
#{data.imgName},
</if>
<if
test=
"data.type != null"
>
#{data.type},
</if>
<if
test=
"data.sizea != null"
>
#{data.sizea},
</if>
<if
test=
"data.url != null"
>
#{data.url},
</if>
<if
test=
"data.md5 != null"
>
#{data.md5},
</if>
<if
test=
"data.imgType != null"
>
#{data.imgType},
</if>
<if
test=
"data.goodsId != null"
>
#{data.goodsId},
</if>
</trim>
</foreach>
</insert>
</mapper>
qianhe-admin/src/main/resources/mapper/WaterGoodsSpeMapper.xml
View file @
890e49d4
...
...
@@ -3,73 +3,95 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qianhe.system.mapper.WaterGoodsSpeMapper"
>
<resultMap
type=
"WaterGoodsSpe"
id=
"WaterGoodsSpeResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"speTitle"
column=
"spe_title"
/>
<result
property=
"spe"
column=
"spe"
/>
<result
property=
"speVal"
column=
"spe_val"
/>
<result
property=
"goodsId"
column=
"goods_id"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"createTime"
column=
"create_time"
/>
</resultMap>
<sql
id=
"selectWaterGoodsSpeVo"
>
select id, spe_title,
spe, spe_val, goods_id
, create_time from water_goods_spe
select id, spe_title,
goods_id, create_user
, create_time from water_goods_spe
</sql>
<select
id=
"selectWaterGoodsSpeList"
parameterType=
"WaterGoodsSpe"
resultMap=
"WaterGoodsSpeResult"
>
<include
refid=
"selectWaterGoodsSpeVo"
/>
<where>
<where>
del_flag = '0'
<if
test=
"speTitle != null and speTitle != ''"
>
and spe_title = #{speTitle}
</if>
<if
test=
"spe != null and spe != ''"
>
and spe = #{spe}
</if>
<if
test=
"speVal != null and speVal != ''"
>
and spe_val = #{speVal}
</if>
<if
test=
"goodsId != null "
>
and goods_id = #{goodsId}
</if>
</where>
</select>
<select
id=
"selectWaterGoodsSpeValList"
parameterType=
"WaterGoodsSpeVal"
resultType=
"WaterGoodsSpeVal"
>
select id, spe_id, spe, spe_val from water_goods_spe_val
<where>
del_flag = '0'
<if
test=
"speId != null"
>
and spe_id = #{speId}
</if>
</where>
</select>
<select
id=
"selectWaterGoodsSpeById"
parameterType=
"Long"
resultMap=
"WaterGoodsSpeResult"
>
<include
refid=
"selectWaterGoodsSpeVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWaterGoodsSpe"
parameterType=
"
WaterGoodsSpe
"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertWaterGoodsSpe"
parameterType=
"
com.qianhe.system.vo.WaterGoodsSpeVo
"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into water_goods_spe
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"speTitle != null"
>
spe_title,
</if>
<if
test=
"spe != null"
>
spe,
</if>
<if
test=
"speVal != null"
>
spe_val,
</if>
<if
test=
"goodsId != null"
>
goods_id,
</if>
<if
test=
"createUser != null"
>
create_user,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"speTitle != null"
>
#{speTitle},
</if>
<if
test=
"spe != null"
>
#{spe},
</if>
<if
test=
"speVal != null"
>
#{speVal},
</if>
<if
test=
"goodsId != null"
>
#{goodsId},
</if>
<if
test=
"createUser != null"
>
#{createUser},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
</trim>
</insert>
<update
id=
"updateWaterGoodsSpe"
parameterType=
"
WaterGoodsSpe
"
>
<update
id=
"updateWaterGoodsSpe"
parameterType=
"
com.qianhe.system.vo.WaterGoodsSpeVo
"
>
update water_goods_spe
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"speTitle != null"
>
spe_title = #{speTitle},
</if>
<if
test=
"spe != null"
>
spe = #{spe},
</if>
<if
test=
"speVal != null"
>
spe_val = #{speVal},
</if>
<if
test=
"goodsId != null"
>
goods_id = #{goodsId},
</if>
<if
test=
"createUser != null"
>
create_user = #{createUser},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
</trim>
where id = #{id}
</update>
<delete
id=
"deleteWaterGoodsSpeById"
parameterType=
"Long"
>
delete from water_goods_spe where id = #{id}
</delete>
<update
id=
"deleteWaterGoodsSpeById"
parameterType=
"Long"
>
update water_goods_spe set del_flag = '1' where id = #{id}
</update>
<update
id=
"deleteWaterGoodsSpeByIds"
parameterType=
"String"
>
update water_goods_spe set del_flag = '1' where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
<update
id=
"deleteWaterGoodsSpeValBySpeId"
parameterType=
"Long"
>
update water_goods_spe_val set del_flag = '1' where spe_id = #{id}
</update>
<
delete
id=
"deleteWaterGoodsSpeBy
Ids"
parameterType=
"String"
>
delete from water_goods_spe where id in
<
update
id=
"deleteWaterGoodsSpeValBySpe
Ids"
parameterType=
"String"
>
update water_goods_spe_val set del_flag = '1' where spe_id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</update>
<insert
id=
"batchInsertWaterGoodsSpeVal"
>
insert into water_goods_spe_val(spe_id, spe, spe_val)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.speId}, #{item.spe}, #{item.speVal})
</foreach>
</insert>
</mapper>
qianhe-admin/src/main/resources/mapper/WaterGoodsTypeMapper.xml
View file @
890e49d4
...
...
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qianhe.system.mapper.WaterGoodsTypeMapper"
>
<resultMap
type=
"WaterGoodsType"
id=
"WaterGoodsTypeResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"typeName"
column=
"type_name"
/>
...
...
@@ -16,16 +16,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectWaterGoodsTypeList"
parameterType=
"WaterGoodsType"
resultMap=
"WaterGoodsTypeResult"
>
<include
refid=
"selectWaterGoodsTypeVo"
/>
<where>
<where>
del_flag = '0'
<if
test=
"typeName != null and typeName != ''"
>
and type_name like concat('%', #{typeName}, '%')
</if>
</where>
</select>
<select
id=
"selectWaterGoodsTypeById"
parameterType=
"Long"
resultMap=
"WaterGoodsTypeResult"
>
<include
refid=
"selectWaterGoodsTypeVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWaterGoodsType"
parameterType=
"WaterGoodsType"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into water_goods_type
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -47,14 +48,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<
dele
te
id=
"deleteWaterGoodsTypeById"
parameterType=
"Long"
>
delete from water_goods_type
where id = #{id}
</
dele
te>
<
upda
te
id=
"deleteWaterGoodsTypeById"
parameterType=
"Long"
>
update water_goods_type set del_flag = '1'
where id = #{id}
</
upda
te>
<
dele
te
id=
"deleteWaterGoodsTypeByIds"
parameterType=
"String"
>
delete from water_goods_type where id in
<
upda
te
id=
"deleteWaterGoodsTypeByIds"
parameterType=
"String"
>
update water_goods_type set del_flag = '1' where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</update>
</mapper>
qianhe-admin/src/main/resources/mapper/WaterSpeMapper.xml
View file @
890e49d4
...
...
@@ -3,68 +3,90 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qianhe.system.mapper.WaterSpeMapper"
>
<resultMap
type=
"WaterSpe"
id=
"WaterSpeResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"speTitle"
column=
"spe_title"
/>
<result
property=
"spe"
column=
"spe"
/>
<result
property=
"speVal"
column=
"spe_val"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"createTime"
column=
"create_time"
/>
</resultMap>
<sql
id=
"selectWaterSpeVo"
>
select id, spe_title,
spe, spe_val
, create_time from water_spe
select id, spe_title,
create_user
, create_time from water_spe
</sql>
<select
id=
"selectWaterSpeList"
parameterType=
"WaterSpe"
resultMap=
"WaterSpeResult"
>
<include
refid=
"selectWaterSpeVo"
/>
<where>
<where>
del_flag = '0'
<if
test=
"speTitle != null and speTitle != ''"
>
and spe_title = #{speTitle}
</if>
<if
test=
"spe != null and spe != ''"
>
and spe = #{spe}
</if>
<if
test=
"speVal != null and speVal != ''"
>
and spe_val = #{speVal}
</if>
</where>
</select>
<select
id=
"selectWaterSpeValList"
parameterType=
"WaterSpeVal"
resultType=
"WaterSpeVal"
>
select id, spe_id, spe, spe_val from water_spe_val
<where>
del_flag = '0'
<if
test=
"speId != null "
>
and spe_id = #{speId}
</if>
</where>
</select>
<select
id=
"selectWaterSpeById"
parameterType=
"Long"
resultMap=
"WaterSpeResult"
>
<include
refid=
"selectWaterSpeVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWaterSpe"
parameterType=
"
WaterSpe
"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertWaterSpe"
parameterType=
"
com.qianhe.system.vo.WaterSpeVo
"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into water_spe
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"speTitle != null"
>
spe_title,
</if>
<if
test=
"spe != null"
>
spe,
</if>
<if
test=
"speVal != null"
>
spe_val,
</if>
<if
test=
"createUser != null and createUser != ''"
>
create_user,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"speTitle != null"
>
#{speTitle},
</if>
<if
test=
"spe != null"
>
#{spe},
</if>
<if
test=
"speVal != null"
>
#{speVal},
</if>
<if
test=
"createUser != null and createUser != ''"
>
#{createUser},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
</trim>
</insert>
<update
id=
"updateWaterSpe"
parameterType=
"
WaterSpe
"
>
<update
id=
"updateWaterSpe"
parameterType=
"
com.qianhe.system.vo.WaterSpeVo
"
>
update water_spe
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"speTitle != null"
>
spe_title = #{speTitle},
</if>
<if
test=
"spe != null"
>
spe = #{spe},
</if>
<if
test=
"speVal != null"
>
spe_val = #{speVal},
</if>
<if
test=
"createUser != null and createUser != ''"
>
create_user = #{createUser},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
</trim>
where id = #{id}
</update>
<delete
id=
"deleteWaterSpeById"
parameterType=
"Long"
>
delete from water_spe where id = #{id}
</delete>
<update
id=
"deleteWaterSpeById"
parameterType=
"Long"
>
update water_spe set del_flag = '1' where id = #{id}
</update>
<update
id=
"deleteWaterSpeByIds"
parameterType=
"String"
>
update water_spe set del_flag = '1' where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
<update
id=
"deleteWaterSpeValBySpeId"
parameterType=
"Long"
>
update water_spe_val set del_flag = '1' where spe_id = #{id}
</update>
<
delete
id=
"deleteWaterSpeBy
Ids"
parameterType=
"String"
>
delete from water_spe where id in
<
update
id=
"deleteWaterSpeValBySpe
Ids"
parameterType=
"String"
>
update water_spe_val set del_flag = '1' where spe_id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</update>
<insert
id=
"batchInsertWaterSpeVal"
>
insert into water_spe_val(spe_id, spe, spe_val)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.speId}, #{item.spe}, #{item.speVal})
</foreach>
</insert>
</mapper>
qianhe-admin/src/main/resources/mapper/WaterStationMapper.xml
View file @
890e49d4
...
...
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qianhe.system.mapper.WaterStationMapper"
>
<resultMap
type=
"WaterStation"
id=
"WaterStationResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"stationName"
column=
"station_name"
/>
...
...
@@ -25,7 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectWaterStationList"
parameterType=
"WaterStation"
resultMap=
"WaterStationResult"
>
<include
refid=
"selectWaterStationVo"
/>
<where>
<where>
del_flag = '0'
<if
test=
"stationName != null and stationName != ''"
>
and station_name like concat('%', #{stationName}, '%')
</if>
<if
test=
"phoneNum != null "
>
and phone_num = #{phoneNum}
</if>
<if
test=
"stationAddress != null and stationAddress != ''"
>
and station_address = #{stationAddress}
</if>
...
...
@@ -38,13 +39,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createUser != null and createUser != ''"
>
and create_user = #{createUser}
</if>
</where>
</select>
<select
id=
"getStationList"
resultType=
"Map"
>
select id as stationId, station_name as stationName from water_station where del_flag = '0'
</select>
<select
id=
"selectWaterStationById"
parameterType=
"Long"
resultMap=
"WaterStationResult"
>
<include
refid=
"selectWaterStationVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWaterStation"
parameterType=
"WaterStation"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertWaterStation"
parameterType=
"
com.qianhe.system.domain.
WaterStation"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into water_station
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"stationName != null"
>
station_name,
</if>
...
...
@@ -74,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
</insert>
<update
id=
"updateWaterStation"
parameterType=
"WaterStation"
>
<update
id=
"updateWaterStation"
parameterType=
"
com.qianhe.system.domain.
WaterStation"
>
update water_station
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"stationName != null"
>
station_name = #{stationName},
</if>
...
...
@@ -92,14 +97,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<
dele
te
id=
"deleteWaterStationById"
parameterType=
"Long"
>
delete from water_station
where id = #{id}
</
dele
te>
<
upda
te
id=
"deleteWaterStationById"
parameterType=
"Long"
>
update water_station set del_flag = '1'
where id = #{id}
</
upda
te>
<
dele
te
id=
"deleteWaterStationByIds"
parameterType=
"String"
>
delete from water_station where id in
<
upda
te
id=
"deleteWaterStationByIds"
parameterType=
"String"
>
update water_station set del_flag = '1' where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</update>
<insert
id=
"batchInsertStationUser"
>
insert into water_station_user(name, age, gender, phone, id_num, station_id, create_time, create_user)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.name}, #{item.age}, #{item.gender}, #{item.phone}, #{item.idNum}, #{item.stationId}, #{item.createTime}, #{item.createUser})
</foreach>
</insert>
<update
id=
"deleteWaterStationUserByStationId"
parameterType=
"Long"
>
update water_station_user set del_flag = '1' where station_id = #{id}
</update>
<update
id=
"deleteWaterStationUserByStationIds"
parameterType=
"String"
>
update water_station_user set del_flag = '1' where station_id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
</mapper>
qianhe-admin/src/main/resources/mapper/WaterStationUserMapper.xml
View file @
890e49d4
...
...
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qianhe.system.mapper.WaterStationUserMapper"
>
<resultMap
type=
"WaterStationUser"
id=
"WaterStationUserResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
...
...
@@ -22,7 +22,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectWaterStationUserList"
parameterType=
"WaterStationUser"
resultMap=
"WaterStationUserResult"
>
<include
refid=
"selectWaterStationUserVo"
/>
<where>
<where>
del_flag = '0'
<if
test=
"name != null and name != ''"
>
and name like concat('%', #{name}, '%')
</if>
<if
test=
"age != null "
>
and age = #{age}
</if>
<if
test=
"gender != null "
>
and gender = #{gender}
</if>
...
...
@@ -32,12 +33,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createUser != null and createUser != ''"
>
and create_user = #{createUser}
</if>
</where>
</select>
<select
id=
"selectWaterStationUserById"
parameterType=
"Long"
resultMap=
"WaterStationUserResult"
>
<include
refid=
"selectWaterStationUserVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWaterStationUser"
parameterType=
"WaterStationUser"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into water_station_user
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -77,14 +78,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id}
</update>
<
dele
te
id=
"deleteWaterStationUserById"
parameterType=
"Long"
>
delete from water_station_user
where id = #{id}
</
dele
te>
<
upda
te
id=
"deleteWaterStationUserById"
parameterType=
"Long"
>
update water_station_user set del_flag = '1'
where id = #{id}
</
upda
te>
<
dele
te
id=
"deleteWaterStationUserByIds"
parameterType=
"String"
>
delete from water_station_user where id in
<
upda
te
id=
"deleteWaterStationUserByIds"
parameterType=
"String"
>
update water_station_user set del_flag = '1' where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</update>
</mapper>
qianhe-admin/src/main/resources/mapper/WaterUserAddressMapper.xml
View file @
890e49d4
...
...
@@ -3,7 +3,7 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.qianhe.system.mapper.WaterUserAddressMapper"
>
<resultMap
type=
"WaterUserAddress"
id=
"WaterUserAddressResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"waterUserId"
column=
"water_user_id"
/>
...
...
@@ -21,7 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select
id=
"selectWaterUserAddressList"
parameterType=
"WaterUserAddress"
resultMap=
"WaterUserAddressResult"
>
<include
refid=
"selectWaterUserAddressVo"
/>
<where>
<where>
del_flag = '0'
<if
test=
"waterUserId != null "
>
and water_user_id = #{waterUserId}
</if>
<if
test=
"userAddress != null and userAddress != ''"
>
and user_address = #{userAddress}
</if>
<if
test=
"province != null and province != ''"
>
and province = #{province}
</if>
...
...
@@ -31,12 +32,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"phone != null "
>
and phone = #{phone}
</if>
</where>
</select>
<select
id=
"selectWaterUserAddressById"
parameterType=
"Long"
resultMap=
"WaterUserAddressResult"
>
<include
refid=
"selectWaterUserAddressVo"
/>
where id = #{id}
</select>
<insert
id=
"insertWaterUserAddress"
parameterType=
"WaterUserAddress"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into water_user_address
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -78,9 +79,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<delete
id=
"deleteWaterUserAddressByIds"
parameterType=
"String"
>
delete from water_user_address where id in
delete from water_user_address where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
</mapper>
qianhe-admin/src/main/resources/mapper/WaterUserMapper.xml
View file @
890e49d4
...
...
@@ -97,22 +97,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where open_id = #{openId}
</update>
<
dele
te
id=
"deleteWaterUserById"
parameterType=
"Long"
>
delete from water_user
where id = #{id}
</
dele
te>
<
upda
te
id=
"deleteWaterUserById"
parameterType=
"Long"
>
update water_user set status = 1
where id = #{id}
</
upda
te>
<update
id=
"deleteWaterUserByIds"
parameterType=
"String"
>
update water_user set status =
'1'
where id in
update water_user set status =
1
where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</update>
<
dele
te
id=
"deleteWaterUserAddressByIds"
parameterType=
"String"
>
delete from water_user_address
where water_user_id in
<
upda
te
id=
"deleteWaterUserAddressByIds"
parameterType=
"String"
>
update water_user_address set del_flag = '1'
where water_user_id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</
dele
te>
</
upda
te>
</mapper>
qianhe-admin/src/main/resources/mybatis/mybatis-config.xml
View file @
890e49d4
...
...
@@ -14,7 +14,7 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
<!-- 指定 MyBatis 所用日志的具体实现 -->
<setting
name=
"logImpl"
value=
"SLF4J"
/>
<!-- 使用驼峰命名法转换字段 -->
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> --
>
<setting
name=
"mapUnderscoreToCamelCase"
value=
"true"
/
>
</settings>
</configuration>
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