Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pseer
gxpt_ht
Commits
893d090d
Commit
893d090d
authored
Oct 25, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增小程序需求接口
parent
53d83141
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
167 additions
and
59 deletions
+167
-59
SysDictType.java
...ain/java/share/common/core/domain/entity/SysDictType.java
+16
-0
SCleanRecordsController.java
.../share/web/controller/system/SCleanRecordsController.java
+12
-3
SConsumerCouponController.java
...hare/web/controller/system/SConsumerCouponController.java
+1
-1
SOrderController.java
...in/java/share/web/controller/system/SOrderController.java
+9
-0
SStoreController.java
...in/java/share/web/controller/system/SStoreController.java
+10
-0
SysDictTypeController.java
...va/share/web/controller/system/SysDictTypeController.java
+1
-1
SCleanRecordsMapper.java
...rc/main/java/share/system/mapper/SCleanRecordsMapper.java
+4
-1
SStoreConsumerMapper.java
...c/main/java/share/system/mapper/SStoreConsumerMapper.java
+3
-0
ISCleanRecordsService.java
...main/java/share/system/service/ISCleanRecordsService.java
+2
-0
ISOrderService.java
...em/src/main/java/share/system/service/ISOrderService.java
+3
-1
ISStoreService.java
...em/src/main/java/share/system/service/ISStoreService.java
+2
-0
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+10
-0
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+2
-3
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+1
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+26
-2
SStoreServiceImpl.java
...ain/java/share/system/service/impl/SStoreServiceImpl.java
+57
-45
SysDictTypeServiceImpl.java
...ava/share/system/service/impl/SysDictTypeServiceImpl.java
+5
-1
SStoreConsumerMapper.xml
...src/main/resources/mapper/system/SStoreConsumerMapper.xml
+3
-0
No files found.
share-common/src/main/java/share/common/core/domain/entity/SysDictType.java
View file @
893d090d
...
...
@@ -3,12 +3,16 @@ package share.common.core.domain.entity;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Pattern
;
import
javax.validation.constraints.Size
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
share.common.annotation.Excel
;
import
share.common.annotation.Excel.ColumnType
;
import
share.common.core.domain.BaseEntity
;
import
java.util.List
;
/**
* 字典类型表 sys_dict_type
*
...
...
@@ -34,6 +38,18 @@ public class SysDictType extends BaseEntity
@Excel
(
name
=
"状态"
,
readConverterExp
=
"0=正常,1=停用"
)
private
String
status
;
/** 字典数据 */
@TableField
(
exist
=
false
)
private
List
<
SysDictData
>
dictDatas
;
public
List
<
SysDictData
>
getDictDatas
()
{
return
dictDatas
;
}
public
void
setDictDatas
(
List
<
SysDictData
>
dictDatas
)
{
this
.
dictDatas
=
dictDatas
;
}
public
Long
getDictId
()
{
return
dictId
;
...
...
share-front/src/main/java/share/web/controller/system/SCleanRecordsController.java
View file @
893d090d
...
...
@@ -82,7 +82,7 @@ public class SCleanRecordsController extends BaseController
* 开始保洁
*/
@Log
(
title
=
"开始保洁"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"startClean"
)
@PostMapping
(
value
=
"
/
startClean"
)
public
AjaxResult
startClean
(
@RequestBody
SCleanRecords
sCleanRecords
)
{
sCleanRecords
.
setStartDate
(
DateUtil
.
date
());
...
...
@@ -93,8 +93,8 @@ public class SCleanRecordsController extends BaseController
/**
* 结束保洁
*/
@Log
(
title
=
"
开始
保洁"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"endClean"
)
@Log
(
title
=
"
结束
保洁"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
value
=
"
/
endClean"
)
public
AjaxResult
endClean
(
@RequestBody
SCleanRecords
sCleanRecords
)
{
sCleanRecords
.
setEndDate
(
DateUtil
.
date
());
...
...
@@ -102,5 +102,14 @@ public class SCleanRecordsController extends BaseController
return
toAjax
(
sCleanRecordsService
.
updateSCleanRecords
(
sCleanRecords
));
}
/**
* 通过房间ID查询保洁记录
*/
@GetMapping
(
value
=
"/getByRoomId/{roomId}"
)
public
AjaxResult
getByRoomId
(
@PathVariable
(
"roomId"
)
Long
roomId
)
{
return
success
(
sCleanRecordsService
.
getByRoomId
(
roomId
));
}
}
share-front/src/main/java/share/web/controller/system/SConsumerCouponController.java
View file @
893d090d
...
...
@@ -39,7 +39,7 @@ public class SConsumerCouponController extends BaseController {
public
TableDataInfo
list
(
String
useStatus
)
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
if
(
StringUtils
.
isNotBlank
(
useStatus
)){
sConsumerCoupon
.
setUseStatus
(
useStatus
);
sConsumerCoupon
.
setUseStatus
(
Integer
.
valueOf
(
useStatus
)
);
}
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
...
...
share-front/src/main/java/share/web/controller/system/SOrderController.java
View file @
893d090d
...
...
@@ -62,6 +62,15 @@ public class SOrderController extends BaseController
}
/**
* 开门
*/
@ApiOperation
(
value
=
"开门"
)
@RequestMapping
(
value
=
"/open/door"
,
method
=
RequestMethod
.
POST
)
public
R
<
String
>
openDoor
(
@RequestBody
Long
id
){
return
R
.
ok
(
sOrderService
.
openDoor
(
id
));
}
/**
* 下单
*/
@ApiOperation
(
value
=
"下单"
)
...
...
share-front/src/main/java/share/web/controller/system/SStoreController.java
View file @
893d090d
...
...
@@ -68,4 +68,14 @@ public class SStoreController extends BaseController
return
R
.
ok
(
sStoreService
.
listVo
(
request
));
}
/**
* 保洁负责的门店
*/
@ApiOperation
(
value
=
"保洁负责的门店"
)
@RequestMapping
(
value
=
"/listVoByCleaner"
,
method
=
RequestMethod
.
GET
)
public
R
<
List
<
SStoreVo
>>
listVoByCleaner
()
{
return
R
.
ok
(
sStoreService
.
listVoByCleaner
());
}
}
share-front/src/main/java/share/web/controller/system/SysDictTypeController.java
View file @
893d090d
...
...
@@ -28,7 +28,7 @@ import share.system.service.ISysDictTypeService;
* @author ruoyi
*/
@RestController
@RequestMapping
(
"/
system
/dict/type"
)
@RequestMapping
(
"/
front
/dict/type"
)
public
class
SysDictTypeController
extends
BaseController
{
@Autowired
...
...
share-system/src/main/java/share/system/mapper/SCleanRecordsMapper.java
View file @
893d090d
package
share
.
system
.
mapper
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
share.system.domain.SCleanRecords
;
import
share.system.domain.SRoom
;
/**
* 保洁记录Mapper接口
...
...
@@ -9,7 +12,7 @@ import share.system.domain.SCleanRecords;
* @author ruoyi
* @date 2023-09-28
*/
public
interface
SCleanRecordsMapper
public
interface
SCleanRecordsMapper
extends
BaseMapper
<
SCleanRecords
>
{
/**
* 查询保洁记录
...
...
share-system/src/main/java/share/system/mapper/SStoreConsumerMapper.java
View file @
893d090d
...
...
@@ -30,4 +30,7 @@ public interface SStoreConsumerMapper {
public
int
deleteInfo
(
SStoreConsumer
storeConsumer
);
public
int
deleteInfos
(
@Param
(
"storeId"
)
Long
storeId
,
@Param
(
"consumerIds"
)
Long
[]
consumerIds
);
List
<
String
>
selectByConsumerId
(
Long
id
);
}
share-system/src/main/java/share/system/service/ISCleanRecordsService.java
View file @
893d090d
...
...
@@ -70,4 +70,6 @@ public interface ISCleanRecordsService
List
<
SCleanRecords
>
unCleanList
(
SCleanRecords
sCleanRecords
);
List
<
SCleanRecords
>
myCleanList
(
SCleanRecords
sCleanRecords
);
SCleanRecords
getByRoomId
(
Long
roomId
);
}
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
893d090d
...
...
@@ -92,8 +92,10 @@ public interface ISOrderService extends IService<SOrder>
/**
* 通过订单编号查询订单
* @param
valueOf
* @param
orderNo
* @return
*/
SOrder
getByOrderNo
(
String
orderNo
);
String
openDoor
(
Long
id
);
}
share-system/src/main/java/share/system/service/ISStoreService.java
View file @
893d090d
...
...
@@ -93,4 +93,6 @@ public interface ISStoreService extends IService<SStore>
int
deleteStoreConsumers
(
Long
storeId
,
Long
[]
consumerIds
);
int
insertStoreConsumers
(
Long
storeId
,
Long
[]
consumerIds
);
List
<
SStoreVo
>
listVoByCleaner
();
}
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
893d090d
package
share
.
system
.
service
.
impl
;
import
java.util.List
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
share.common.utils.DateUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SRoom
;
import
share.system.mapper.SCleanRecordsMapper
;
import
share.system.domain.SCleanRecords
;
import
share.system.mapper.SConsumerMapper
;
...
...
@@ -128,6 +131,13 @@ public class SCleanRecordsServiceImpl implements ISCleanRecordsService
return
sCleanRecordsMapper
.
myCleanList
(
sCleanRecords
);
}
@Override
public
SCleanRecords
getByRoomId
(
Long
roomId
)
{
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
();
queryWrapper
.
in
(
SCleanRecords:
:
getRoomId
,
roomId
);
return
sCleanRecordsMapper
.
selectOne
(
queryWrapper
);
}
private
void
sendSms
(
Long
storeId
)
{
List
<
SConsumer
>
list
=
sConsumerMapper
.
selectListByStoreId
(
storeId
);
for
(
SConsumer
consumer
:
list
)
{
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
893d090d
...
...
@@ -120,9 +120,8 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
public
List
<
SConsumerCoupon
>
availableCouponList
(
CouponRequest
couponRequest
)
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sConsumerCoupon
.
setUseStatus
(
"0"
);
// sConsumerCoupon.setConsumerId(user.getId());
sConsumerCoupon
.
setConsumerId
(
1714160213741535234L
);
sConsumerCoupon
.
setUseStatus
(
0
);
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
//查询用户未使用的优惠券
List
<
SConsumerCoupon
>
sConsumerCoupons
=
sConsumerCouponMapper
.
selectSConsumerCouponList
(
sConsumerCoupon
);
//计算时长
...
...
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
893d090d
...
...
@@ -160,7 +160,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
SConsumer
currentUser
=
getInfo
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
currentUser
.
getId
());
sConsumerCoupon
.
setUseStatus
(
"0"
);
sConsumerCoupon
.
setUseStatus
(
0
);
int
count
=
sConsumerCouponService
.
selectSConsumerCouponConut
(
sConsumerCoupon
);
if
(
count
>
0
){
currentUser
.
setNumber
(
count
);
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
893d090d
...
...
@@ -34,6 +34,7 @@ import share.system.domain.SConsumerCoupon;
import
share.system.domain.SRoom
;
import
share.system.domain.vo.FrontTokenComponent
;
import
share.system.domain.vo.MyRecord
;
import
share.system.domain.vo.SRoomVo
;
import
share.system.domain.vo.WxPayJsResultVo
;
import
share.system.mapper.SOrderMapper
;
import
share.system.domain.SOrder
;
...
...
@@ -269,6 +270,29 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
return
getOne
(
lqw
);
}
@Override
public
String
openDoor
(
Long
id
)
{
SOrder
sOrder
=
sOrderMapper
.
selectSOrderById
(
id
);
if
(
Objects
.
isNull
(
sOrder
))
{
throw
new
BaseException
(
"订单不存在!"
);
}
SRoomVo
sRoomVo
=
roomService
.
selectSRoomById
(
sOrder
.
getRoomId
());
if
(
Objects
.
isNull
(
sRoomVo
))
{
throw
new
BaseException
(
"房间不存在!"
);
}
//根据门锁编号,电机控制,密码进行开门
String
doorLockCode
=
sRoomVo
.
getDoorLockCode
();
String
electricControlCode
=
sRoomVo
.
getElectricControlCode
();
String
password
=
sRoomVo
.
getPassword
();
if
(
true
){
//TODO 开门成功
return
"开门成功"
;
}
else
{
//TODO 开门失败
return
"开门失败"
;
}
}
private
BigDecimal
computeTotalPrice
(
BigDecimal
unitPrice
,
Date
startTime
,
Date
endTime
){
return
DateUtils
.
differentHour
(
startTime
,
endTime
).
multiply
(
unitPrice
);
}
...
...
@@ -298,10 +322,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
if
(
ObjectUtil
.
isNull
(
consumerCoupon
)
||
!
consumerCoupon
.
getCouponId
().
equals
(
user
.
getId
()))
{
throw
new
BaseException
(
"优惠券领取记录不存在!"
);
}
if
(
CouponStatusEnum
.
USED
.
getValue
().
compareTo
(
Integer
.
parseInt
(
consumerCoupon
.
getUseStatus
()
))
==
0
)
{
if
(
CouponStatusEnum
.
USED
.
getValue
().
compareTo
(
consumerCoupon
.
getUseStatus
(
))
==
0
)
{
throw
new
BaseException
(
"此优惠券已使用!"
);
}
if
(
CouponStatusEnum
.
EXPIRED
.
getValue
().
compareTo
(
Integer
.
parseInt
(
consumerCoupon
.
getUseStatus
()
))
==
0
)
{
if
(
CouponStatusEnum
.
EXPIRED
.
getValue
().
compareTo
(
consumerCoupon
.
getUseStatus
(
))
==
0
)
{
throw
new
BaseException
(
"此优惠券已失效!"
);
}
//判断是否在使用时间内
...
...
share-system/src/main/java/share/system/service/impl/SStoreServiceImpl.java
View file @
893d090d
This diff is collapsed.
Click to expand it.
share-system/src/main/java/share/system/service/impl/SysDictTypeServiceImpl.java
View file @
893d090d
...
...
@@ -61,7 +61,11 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
@Override
public
List
<
SysDictType
>
selectDictTypeAll
()
{
return
dictTypeMapper
.
selectDictTypeAll
();
List
<
SysDictType
>
sysDictTypes
=
dictTypeMapper
.
selectDictTypeAll
();
sysDictTypes
.
forEach
(
item
->{
item
.
setDictDatas
(
dictDataMapper
.
selectDictDataByType
(
item
.
getDictType
()));
});
return
sysDictTypes
;
}
/**
...
...
share-system/src/main/resources/mapper/system/SStoreConsumerMapper.xml
View file @
893d090d
...
...
@@ -16,6 +16,9 @@
<select
id=
"countByStoreId"
resultType=
"Integer"
>
select count(1) from s_store_consumer where store_id=#{storeId}
</select>
<select
id=
"selectByConsumerId"
resultType=
"java.lang.String"
>
select store_id from s_store_consumer where consumer_id=#{consumerId}
</select>
<delete
id=
"deleteSStoreConsumer"
parameterType=
"Long"
>
delete from s_store_consumer where consumer_id in
...
...
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