Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
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
徐少华
midjourney-proxy
Commits
05a79f8e
Commit
05a79f8e
authored
Feb 26, 2020
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1002422小睿定制化方案与内容(平台端设置与客户端展示)
parent
5fac8580
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
1084 additions
and
16 deletions
+1084
-16
CreateTaskItemDto.java
...va/com/pcloud/book/timecontrol/dto/CreateTaskItemDto.java
+2
-0
SelfPlanUserDto.java
...java/com/pcloud/book/timecontrol/dto/SelfPlanUserDto.java
+14
-0
UpdateTaskItemDto.java
...va/com/pcloud/book/timecontrol/dto/UpdateTaskItemDto.java
+2
-0
ServiceStateEnum.java
...a/com/pcloud/book/timecontrol/enums/ServiceStateEnum.java
+38
-0
BookApplication.java
...e-book/src/main/java/com/pcloud/book/BookApplication.java
+15
-8
GroupSet.java
...ook/src/main/java/com/pcloud/book/group/set/GroupSet.java
+30
-0
MQTopicConumer.java
...c/main/java/com/pcloud/book/mq/config/MQTopicConumer.java
+5
-0
TipListener.java
...k/src/main/java/com/pcloud/book/mq/topic/TipListener.java
+45
-0
SelfPlanBiz.java
...ain/java/com/pcloud/book/timecontrol/biz/SelfPlanBiz.java
+49
-0
SelfPlanBizImpl.java
...com/pcloud/book/timecontrol/biz/impl/SelfPlanBizImpl.java
+0
-0
TaskBizImpl.java
...ava/com/pcloud/book/timecontrol/biz/impl/TaskBizImpl.java
+1
-1
TimeControlSelfPlan.java
...m/pcloud/book/timecontrol/entity/TimeControlSelfPlan.java
+45
-0
TimeControlSelfPlanFeedback.java
.../book/timecontrol/entity/TimeControlSelfPlanFeedback.java
+36
-0
TimeControlSelfPlanItem.java
...loud/book/timecontrol/entity/TimeControlSelfPlanItem.java
+35
-0
TimeControlTaskItem.java
...m/pcloud/book/timecontrol/entity/TimeControlTaskItem.java
+11
-0
FeedbackTypeEnum.java
...a/com/pcloud/book/timecontrol/enums/FeedbackTypeEnum.java
+23
-0
SelfPlanFacadeImpl.java
...loud/book/timecontrol/facade/impl/SelfPlanFacadeImpl.java
+159
-0
TimeControlSelfPlanFeedbackMapper.java
...timecontrol/mapper/TimeControlSelfPlanFeedbackMapper.java
+29
-0
TimeControlSelfPlanItemMapper.java
...ook/timecontrol/mapper/TimeControlSelfPlanItemMapper.java
+19
-0
TimeControlSelfPlanMapper.java
...ud/book/timecontrol/mapper/TimeControlSelfPlanMapper.java
+46
-0
TimeControlTaskItemMapper.java
...ud/book/timecontrol/mapper/TimeControlTaskItemMapper.java
+4
-1
AddTask4SelfPlan.java
...java/com/pcloud/book/timecontrol/vo/AddTask4SelfPlan.java
+15
-0
CreateSelfPlanVO.java
...java/com/pcloud/book/timecontrol/vo/CreateSelfPlanVO.java
+16
-0
SelfPlanVO.java
.../main/java/com/pcloud/book/timecontrol/vo/SelfPlanVO.java
+57
-0
UpdateSelfPlanVO.java
...java/com/pcloud/book/timecontrol/vo/UpdateSelfPlanVO.java
+16
-0
TimeControlSelfPlanFeedbackMapper.xml
.../mapper/timecontrol/TimeControlSelfPlanFeedbackMapper.xml
+98
-0
TimeControlSelfPlanItemMapper.xml
...rces/mapper/timecontrol/TimeControlSelfPlanItemMapper.xml
+72
-0
TimeControlSelfPlanMapper.xml
...esources/mapper/timecontrol/TimeControlSelfPlanMapper.xml
+185
-0
TimeControlTaskItemMapper.xml
...esources/mapper/timecontrol/TimeControlTaskItemMapper.xml
+16
-5
TimeControlTaskMapper.xml
...in/resources/mapper/timecontrol/TimeControlTaskMapper.xml
+1
-1
No files found.
pcloud-facade-book/src/main/java/com/pcloud/book/timecontrol/dto/CreateTaskItemDto.java
View file @
05a79f8e
...
...
@@ -42,4 +42,6 @@ public class CreateTaskItemDto implements Serializable {
private
Integer
progressGuidance
;
private
String
itemIntroduce
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/timecontrol/dto/SelfPlanUserDto.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
dto
;
import
lombok.Data
;
@Data
public
class
SelfPlanUserDto
{
private
String
wxUserId
;
private
String
nickName
;
private
String
headPic
;
private
Integer
sex
;
private
Integer
slefPlanCount
;
private
Integer
orderCount
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/timecontrol/dto/UpdateTaskItemDto.java
View file @
05a79f8e
...
...
@@ -43,4 +43,6 @@ public class UpdateTaskItemDto implements Serializable {
private
Integer
progressGuidance
;
private
String
itemIntroduce
;
}
pcloud-facade-book/src/main/java/com/pcloud/book/timecontrol/enums/ServiceStateEnum.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
enums
;
public
enum
ServiceStateEnum
{
DEFAULT
(
0
,
"默认状态"
),
FINISH_BUY
(
1
,
"购买完成"
),
FINISH_SUBSCRIBE
(
2
,
"订阅完成"
);
private
Integer
value
;
private
String
code
;
public
Integer
getValue
()
{
return
value
;
}
public
void
setValue
(
Integer
value
)
{
this
.
value
=
value
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
ServiceStateEnum
(
Integer
value
,
String
code
)
{
this
.
value
=
value
;
this
.
code
=
code
;
}
ServiceStateEnum
()
{
}
}
pcloud-service-book/src/main/java/com/pcloud/book/BookApplication.java
View file @
05a79f8e
...
...
@@ -7,7 +7,6 @@ import com.pcloud.common.core.constant.MQTopicProducer;
import
com.pcloud.common.core.mq.MQExchangeConstants
;
import
com.pcloud.common.core.mq.MQQueueConstants
;
import
com.pcloud.common.core.mq.RabbitMQFactory
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.amqp.core.Binding
;
import
org.springframework.amqp.core.BindingBuilder
;
...
...
@@ -22,13 +21,6 @@ import org.springframework.context.annotation.Bean;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.PropertySource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
import
javax.sql.DataSource
;
import
springfox.documentation.builders.ApiInfoBuilder
;
import
springfox.documentation.builders.PathSelectors
;
import
springfox.documentation.builders.RequestHandlerSelectors
;
...
...
@@ -37,6 +29,11 @@ import springfox.documentation.spi.DocumentationType;
import
springfox.documentation.spring.web.plugins.Docket
;
import
springfox.documentation.swagger2.annotations.EnableSwagger2
;
import
javax.sql.DataSource
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Map
;
@SpringBootApplication
@ComponentScan
(
"com.pcloud"
)
@EnableEurekaClient
...
...
@@ -294,4 +291,14 @@ public class BookApplication {
public
Binding
selfRobotSendTextBind
()
{
return
RabbitMQFactory
.
bindingExchange
(
selfRobotSendTextQueue
(),
MQTopicProducer
.
SELF_ROBOT_SEND_TEXT
);
}
@Bean
public
Queue
tipQueue
()
{
return
RabbitMQFactory
.
queueBuilder
(
MQTopicConumer
.
TIP_FOR_WECHAT_USER
);
}
@Bean
public
Binding
tipBind
()
{
return
RabbitMQFactory
.
bindingExchange
(
tipQueue
(),
MQTopicProducer
.
TIP_FOR_WECHAT_USER
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/group/set/GroupSet.java
View file @
05a79f8e
...
...
@@ -34,6 +34,7 @@ import com.pcloud.book.keywords.dao.BookKeywordDao;
import
com.pcloud.book.keywords.dto.KeywordResourceDTO
;
import
com.pcloud.book.keywords.enums.ReplyTypeEnum
;
import
com.pcloud.book.keywords.vo.ListKeywordVO
;
import
com.pcloud.book.timecontrol.dto.SelfPlanUserDto
;
import
com.pcloud.common.core.aspect.ParamLog
;
import
com.pcloud.common.core.constant.MQTopicProducer
;
import
com.pcloud.common.enums.AppTypeEnum
;
...
...
@@ -816,4 +817,33 @@ public class GroupSet {
}
return
userBookInfoVOS
;
}
public
List
<
SelfPlanUserDto
>
setUserInfo4SelfPlan4XIAORUI
(
List
<
String
>
wechatUserIds
,
Map
<
String
,
SelfPlanUserDto
>
selfPlanUserDtoMap
)
{
List
<
SelfPlanUserDto
>
selfPlanUserDtos
=
new
ArrayList
<>();
if
(!
ListUtils
.
isEmpty
(
wechatUserIds
)){
Map
<
String
,
GroupUserDTO
>
userDTOMap
=
wechatGroupConsr
.
mapWxUserInfoByWxIdList
(
wechatUserIds
);
List
<
Long
>
labelIds
=
new
ArrayList
<>();
for
(
String
wechatUserId
:
wechatUserIds
)
{
//用户信息
if
(!
MapUtils
.
isEmpty
(
userDTOMap
)
&&
userDTOMap
.
containsKey
(
wechatUserId
))
{
SelfPlanUserDto
selfPlanUserDto
=
new
SelfPlanUserDto
();
GroupUserDTO
userDTO
=
userDTOMap
.
get
(
wechatUserId
);
selfPlanUserDto
.
setHeadPic
(
userDTO
.
getHeadPic
());
selfPlanUserDto
.
setWxUserId
(
wechatUserId
);
selfPlanUserDto
.
setNickName
(
userDTO
.
getNickName
());
selfPlanUserDto
.
setSex
(
userDTO
.
getSex
());
if
(
MapUtils
.
isEmpty
(
selfPlanUserDtoMap
)
&&
selfPlanUserDtoMap
.
containsKey
(
wechatUserId
)
&&
null
!=
selfPlanUserDtoMap
.
get
(
wechatUserId
)){
selfPlanUserDto
.
setSlefPlanCount
(
selfPlanUserDtoMap
.
get
(
wechatUserId
).
getSlefPlanCount
());
selfPlanUserDto
.
setOrderCount
(
selfPlanUserDtoMap
.
get
(
wechatUserId
).
getOrderCount
());
}
else
{
selfPlanUserDto
.
setSlefPlanCount
(
0
);
selfPlanUserDto
.
setOrderCount
(
0
);
}
selfPlanUserDtos
.
add
(
selfPlanUserDto
);
}
}
}
return
selfPlanUserDtos
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/mq/config/MQTopicConumer.java
View file @
05a79f8e
...
...
@@ -99,4 +99,9 @@ public class MQTopicConumer {
* 个人号发送文本消息
*/
public
static
final
String
SELF_ROBOT_SEND_TEXT
=
PREFIX
+
MQTopicProducer
.
SELF_ROBOT_SEND_TEXT
;
/**
* 个人号发送文本消息
*/
public
static
final
String
TIP_FOR_WECHAT_USER
=
PREFIX
+
MQTopicProducer
.
TIP_FOR_WECHAT_USER
;
}
pcloud-service-book/src/main/java/com/pcloud/book/mq/topic/TipListener.java
0 → 100644
View file @
05a79f8e
/**
*
*/
package
com
.
pcloud
.
book
.
mq
.
topic
;
import
com.pcloud.book.mq.config.MQTopicConumer
;
import
com.pcloud.book.timecontrol.biz.SelfPlanBiz
;
import
com.pcloud.facade.tradecenter.dto.TipTopicDto
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.amqp.rabbit.annotation.RabbitHandler
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
@Component
(
"tipListener"
)
@RabbitListener
(
queues
=
MQTopicConumer
.
TIP_FOR_WECHAT_USER
)
public
class
TipListener
{
private
final
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
TipListener
.
class
);
@Autowired
private
SelfPlanBiz
selfPlanBiz
;
/**
* 处理个性化定制服务
*/
@RabbitHandler
public
void
onMessage
(
TipTopicDto
tipTopicDto
)
{
if
(
tipTopicDto
==
null
)
{
return
;
}
// 如果不是文章赞赏直接返回
if
(!
"SELF_PLAN"
.
equals
(
tipTopicDto
.
getTargetType
()))
{
return
;
}
LOGGER
.
info
(
"处理个性化定制服务"
);
// 存储赞赏支付记录
long
wechatUserId
=
tipTopicDto
.
getWechatUserId
();
long
planId
=
tipTopicDto
.
getTargetId
();
selfPlanBiz
.
payBack
((
int
)
planId
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/biz/SelfPlanBiz.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
biz
;
import
com.pcloud.book.group.dto.UserSelectParamDTO
;
import
com.pcloud.book.timecontrol.dto.SelfPlanUserDto
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlan
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlanFeedback
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlanItem
;
import
com.pcloud.book.timecontrol.vo.AddTask4SelfPlan
;
import
com.pcloud.book.timecontrol.vo.CreateSelfPlanVO
;
import
com.pcloud.book.timecontrol.vo.SelfPlanVO
;
import
com.pcloud.book.timecontrol.vo.UpdateSelfPlanVO
;
import
com.pcloud.common.page.PageBeanNew
;
import
java.util.List
;
public
interface
SelfPlanBiz
{
Integer
createSelfPlan
(
CreateSelfPlanVO
createSelfPlanVO
);
void
addTask4SelfPlan
(
AddTask4SelfPlan
addTask4SelfPlan
);
PageBeanNew
<
SelfPlanVO
>
listSelfPlan
(
Integer
currentPage
,
Integer
numPerPage
,
Integer
serviceState
);
void
deleteSelfPlan
(
Integer
planId
);
void
editSelfPlanItems
(
List
<
TimeControlSelfPlanItem
>
selfPlanItemList
);
List
<
TimeControlSelfPlanItem
>
getSelfPlanItems
(
Integer
planId
);
void
commitFeedback
(
List
<
TimeControlSelfPlanFeedback
>
selfPlanFeedbackList
);
List
<
TimeControlSelfPlanFeedback
>
getFeedbackByPlan
(
Integer
planId
);
void
commitEvaluate
(
TimeControlSelfPlanFeedback
selfPlanFeedback
);
PageBeanNew
<
SelfPlanUserDto
>
listUser4SelfPlan
(
UserSelectParamDTO
userSelectParamDTO
);
void
payBack
(
Integer
planId
);
void
advancedSetting
(
TimeControlSelfPlan
timeControlSelfPlan
);
void
updateSelfPlan
(
UpdateSelfPlanVO
updateSelfPlanVO
);
TimeControlSelfPlan
getSelfPlanById
(
Integer
planId
);
PageBeanNew
<
TimeControlSelfPlanFeedback
>
getFeedbackPage
(
Integer
planId
,
Integer
currentPage
,
Integer
numPerPage
);
TimeControlSelfPlan
getLatestPlan
(
String
wxId
,
Integer
planId
);
}
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/biz/impl/SelfPlanBizImpl.java
0 → 100644
View file @
05a79f8e
This diff is collapsed.
Click to expand it.
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/biz/impl/TaskBizImpl.java
View file @
05a79f8e
...
...
@@ -368,7 +368,7 @@ public class TaskBizImpl implements TaskBiz {
if
(
null
==
timeControlTaskItem
.
getProgressGuidance
())
{
timeControlTaskItem
.
setProgressGuidance
(
0
);
}
taskItemMapper
.
updateT
t
askItem
(
timeControlTaskItem
);
taskItemMapper
.
updateTaskItem
(
timeControlTaskItem
);
//删除原item下的配置
replyMessageMapper
.
deleteByItemId
(
taskItemId
);
//重新插入
...
...
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/entity/TimeControlSelfPlan.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TimeControlSelfPlan
{
private
Integer
id
;
private
String
robotWxId
;
private
Integer
classifyId
;
private
String
classifyName
;
private
String
wxId
;
private
Integer
taskId
;
private
Double
totalPrice
;
private
String
buyReply
;
private
String
subscribeReply
;
private
String
changeReply
;
private
Integer
evaluateOpen
;
private
Integer
serviceState
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
private
String
evaluateGuide
;
private
String
planOrder
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/entity/TimeControlSelfPlanFeedback.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TimeControlSelfPlanFeedback
{
private
Integer
id
;
private
Integer
feedbackType
;
private
Integer
selfPlanId
;
private
String
robotWxId
;
private
String
wxId
;
private
Integer
planType
;
private
String
content
;
private
Integer
planScore
;
private
Integer
contentScore
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/entity/TimeControlSelfPlanItem.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
TimeControlSelfPlanItem
{
private
Integer
id
;
private
Integer
selfPlanId
;
private
Integer
type
;
private
String
title
;
private
String
content
;
private
String
description
;
private
String
picUrl
;
private
Integer
openFeedback
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
updateTime
;
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/entity/TimeControlTaskItem.java
View file @
05a79f8e
...
...
@@ -32,6 +32,8 @@ public class TimeControlTaskItem {
private
Integer
progressGuidance
;
private
String
itemIntroduce
;
public
Integer
getAddSendTime
()
{
return
addSendTime
;
}
...
...
@@ -135,4 +137,12 @@ public class TimeControlTaskItem {
public
void
setProgressGuidance
(
Integer
progressGuidance
)
{
this
.
progressGuidance
=
progressGuidance
;
}
public
String
getItemIntroduce
()
{
return
itemIntroduce
;
}
public
void
setItemIntroduce
(
String
itemIntroduce
)
{
this
.
itemIntroduce
=
itemIntroduce
;
}
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/enums/FeedbackTypeEnum.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
enums
;
public
enum
FeedbackTypeEnum
{
/**
* 1意见反馈
*/
FEEDBACK
(
1
),
/**
* 2服务评价
*/
SERVICE_EVALUATE
(
2
);
/**
* 值
*/
public
final
Integer
value
;
FeedbackTypeEnum
(
Integer
value
)
{
this
.
value
=
value
;
}
}
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/facade/impl/SelfPlanFacadeImpl.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
facade
.
impl
;
import
com.pcloud.book.group.dto.UserSelectParamDTO
;
import
com.pcloud.book.timecontrol.biz.SelfPlanBiz
;
import
com.pcloud.book.timecontrol.dto.SelfPlanUserDto
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlan
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlanFeedback
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlanItem
;
import
com.pcloud.book.timecontrol.vo.AddTask4SelfPlan
;
import
com.pcloud.book.timecontrol.vo.CreateSelfPlanVO
;
import
com.pcloud.book.timecontrol.vo.SelfPlanVO
;
import
com.pcloud.book.timecontrol.vo.UpdateSelfPlanVO
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.page.PageBeanNew
;
import
com.pcloud.common.permission.PermissionException
;
import
com.pcloud.common.utils.SessionUtil
;
import
com.pcloud.common.utils.string.StringUtil
;
import
com.pcloud.wechatgroup.base.exception.WechatGroupBizException
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestHeader
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RequestMapping
(
"selfPlan"
)
@RestController
(
"selfPlanFacade"
)
public
class
SelfPlanFacadeImpl
{
@Autowired
private
SelfPlanBiz
selfPlanBiz
;
@ApiOperation
(
"定制个性化服务-第一步"
)
@PostMapping
(
"createSelfPlan"
)
ResponseDto
<?>
createSelfPlan
(
@RequestHeader
String
token
,
@RequestBody
@Validated
CreateSelfPlanVO
createSelfPlanVO
)
{
Integer
id
=
selfPlanBiz
.
createSelfPlan
(
createSelfPlanVO
);
return
new
ResponseDto
<>(
id
);
}
@ApiOperation
(
"修改定制个性化服务-第一步"
)
@PostMapping
(
"updateSelfPlan"
)
ResponseDto
<?>
updateSelfPlan
(
@RequestHeader
String
token
,
@RequestBody
@Validated
UpdateSelfPlanVO
updateSelfPlanVO
)
{
selfPlanBiz
.
updateSelfPlan
(
updateSelfPlanVO
);
return
new
ResponseDto
<>();
}
@PostMapping
(
"addTask4SelfPlan"
)
@ApiOperation
(
"定制个性化服务-添加服务内容"
)
ResponseDto
<?>
addTask4SelfPlan
(
@RequestHeader
String
token
,
@RequestBody
@Validated
AddTask4SelfPlan
addTask4SelfPlan
)
{
selfPlanBiz
.
addTask4SelfPlan
(
addTask4SelfPlan
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
"服务记录"
)
@GetMapping
(
"listSelfPlan"
)
ResponseDto
<?>
listSelfPlan
(
@RequestHeader
String
token
,
@RequestParam
Integer
currentPage
,
@RequestParam
Integer
numPerPage
,
@RequestParam
(
value
=
"serviceState"
,
required
=
false
)
Integer
serviceState
)
{
PageBeanNew
<
SelfPlanVO
>
pageBeanNew
=
selfPlanBiz
.
listSelfPlan
(
currentPage
,
numPerPage
,
serviceState
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
@ApiOperation
(
value
=
"删除服务"
,
httpMethod
=
"GET"
)
@GetMapping
(
"deleteSelfPlan"
)
ResponseDto
<?>
deleteSelfPlan
(
@RequestHeader
String
token
,
@RequestParam
Integer
planId
)
{
selfPlanBiz
.
deleteSelfPlan
(
planId
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"编辑方案内容"
,
httpMethod
=
"POST"
)
@PostMapping
(
"editSelfPlanItems"
)
ResponseDto
<?>
editSelfPlanItems
(
@RequestHeader
String
token
,
@RequestBody
List
<
TimeControlSelfPlanItem
>
selfPlanItemList
)
{
selfPlanBiz
.
editSelfPlanItems
(
selfPlanItemList
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"获取方案内容(平台端)"
,
httpMethod
=
"GET"
)
@GetMapping
(
"getSelfPlanItems4Pcloud"
)
ResponseDto
<?>
getSelfPlanItems4Pcloud
(
@RequestHeader
String
token
,
@RequestParam
Integer
planId
)
{
return
new
ResponseDto
<>(
selfPlanBiz
.
getSelfPlanItems
(
planId
));
}
@ApiOperation
(
value
=
"获取方案内容(客户端)"
,
httpMethod
=
"GET"
)
@GetMapping
(
"getSelfPlanItems4Wechat"
)
ResponseDto
<?>
getSelfPlanItems4Wechat
(
@RequestParam
Integer
planId
)
{
return
new
ResponseDto
<>(
selfPlanBiz
.
getSelfPlanItems
(
planId
));
}
@ApiOperation
(
value
=
"新增反馈"
,
httpMethod
=
"POST"
)
@PostMapping
(
"commitFeedback"
)
ResponseDto
<?>
commitFeedback
(
@RequestBody
List
<
TimeControlSelfPlanFeedback
>
selfPlanFeedbackList
)
{
selfPlanBiz
.
commitFeedback
(
selfPlanFeedbackList
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"获取反馈"
,
httpMethod
=
"GET"
)
@GetMapping
(
"getFeedbackByPlan"
)
ResponseDto
<?>
getFeedbackByPlan
(
@RequestHeader
String
token
,
@RequestParam
Integer
planId
)
{
return
new
ResponseDto
<>(
selfPlanBiz
.
getFeedbackByPlan
(
planId
));
}
@ApiOperation
(
value
=
"个性化定制-用户列表查询"
,
httpMethod
=
"POST"
)
@PostMapping
(
"listUser4SelfPlan"
)
public
ResponseDto
<
PageBeanNew
<
SelfPlanUserDto
>>
listUser4SelfPlan
(
@RequestHeader
(
"token"
)
String
token
,
@RequestBody
@ApiParam
UserSelectParamDTO
userSelectParamDTO
)
throws
PermissionException
{
SessionUtil
.
getToken4Redis
(
token
);
if
(
null
==
userSelectParamDTO
||
null
==
userSelectParamDTO
.
getCurrentPage
()
||
null
==
userSelectParamDTO
.
getNumPerPage
())
{
throw
new
WechatGroupBizException
(
WechatGroupBizException
.
PARAM_IS_NULL
,
"缺少参数"
);
}
if
(
StringUtil
.
isEmpty
(
userSelectParamDTO
.
getRobotId
())){
throw
new
WechatGroupBizException
(
WechatGroupBizException
.
PARAM_IS_NULL
,
"请选择个人号"
);
}
PageBeanNew
<
SelfPlanUserDto
>
pageBeanNew
=
selfPlanBiz
.
listUser4SelfPlan
(
userSelectParamDTO
);
return
new
ResponseDto
<>(
pageBeanNew
);
}
@ApiOperation
(
value
=
"提交评价"
,
httpMethod
=
"POST"
)
@PostMapping
(
"commitEvaluate"
)
ResponseDto
<?>
commitEvaluate
(
@RequestBody
TimeControlSelfPlanFeedback
selfPlanFeedback
)
{
selfPlanBiz
.
commitEvaluate
(
selfPlanFeedback
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"设置高级设置"
,
httpMethod
=
"POST"
)
@PostMapping
(
"advancedSetting"
)
ResponseDto
<?>
advancedSetting
(
@RequestHeader
String
token
,
@RequestBody
TimeControlSelfPlan
timeControlSelfPlan
)
{
selfPlanBiz
.
advancedSetting
(
timeControlSelfPlan
);
return
new
ResponseDto
<>();
}
@ApiOperation
(
value
=
"获取高级设置"
,
httpMethod
=
"GET"
)
@GetMapping
(
"getSelfPlanById"
)
ResponseDto
<?>
getSelfPlanById
(
@RequestHeader
String
token
,
@RequestParam
(
"planId"
)
Integer
planId
)
{
TimeControlSelfPlan
timeControlSelfPlan
=
selfPlanBiz
.
getSelfPlanById
(
planId
);
return
new
ResponseDto
<>(
timeControlSelfPlan
);
}
@ApiOperation
(
value
=
"获取反馈意见"
,
httpMethod
=
"GET"
)
@GetMapping
(
"getFeedbackPage"
)
ResponseDto
<
PageBeanNew
<
TimeControlSelfPlanFeedback
>>
getFeedbackPage
(
@RequestHeader
String
token
,
@RequestParam
(
"planId"
)
Integer
planId
,
@RequestParam
Integer
currentPage
,
@RequestParam
Integer
numPerPage
)
{
PageBeanNew
<
TimeControlSelfPlanFeedback
>
timeControlSelfPlanPage
=
selfPlanBiz
.
getFeedbackPage
(
planId
,
currentPage
,
numPerPage
);
return
new
ResponseDto
<>(
timeControlSelfPlanPage
);
}
@ApiOperation
(
value
=
"获取最近一个计划"
,
httpMethod
=
"GET"
)
@GetMapping
(
value
=
"getLatestPlan"
)
ResponseDto
<?>
getLatestPlan
(
@RequestParam
String
wxId
,
@RequestParam
(
value
=
"planId"
,
required
=
false
)
Integer
planId
){
TimeControlSelfPlan
selfPlan
=
selfPlanBiz
.
getLatestPlan
(
wxId
,
planId
);
return
new
ResponseDto
<>(
selfPlan
);
}
}
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/mapper/TimeControlSelfPlanFeedbackMapper.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
mapper
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlanFeedback
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
(
"selfPlanFeedBackMapper"
)
public
interface
TimeControlSelfPlanFeedbackMapper
{
void
insert
(
TimeControlSelfPlanFeedback
selfPlanFeedback
);
void
batchInsert
(
List
<
TimeControlSelfPlanFeedback
>
selfPlanFeedbackList
);
void
update
(
TimeControlSelfPlanFeedback
selfPlanFeedback
);
List
<
TimeControlSelfPlanFeedback
>
getFeedbackByPlan
(
@Param
(
"planId"
)
Integer
planId
,
@Param
(
"feedbackType"
)
Integer
feedbackType
);
void
deleteById
(
@Param
(
"id"
)
Integer
id
);
void
deleteByPlanId
(
@Param
(
"planId"
)
Integer
planId
,
@Param
(
"feedbackType"
)
Integer
feedbackType
);
List
<
TimeControlSelfPlanFeedback
>
listFeedback
(
@Param
(
"planId"
)
Integer
planId
,
@Param
(
"pageNum"
)
int
pageNum
,
@Param
(
"numPerPage"
)
int
numPerPage
);
Integer
listFeedbackCount
(
Integer
planId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/mapper/TimeControlSelfPlanItemMapper.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
mapper
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlanItem
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Component
(
"selfPlanItemMapper"
)
public
interface
TimeControlSelfPlanItemMapper
{
int
batchInsert
(
List
<
TimeControlSelfPlanItem
>
selfPlanItemList
);
int
deleteByPlanId
(
@Param
(
"planId"
)
Integer
planId
);
List
<
TimeControlSelfPlanItem
>
getByPlanId
(
@Param
(
"planId"
)
Integer
planId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/mapper/TimeControlSelfPlanMapper.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
mapper
;
import
com.pcloud.book.timecontrol.dto.SelfPlanUserDto
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlan
;
import
com.pcloud.book.timecontrol.vo.SelfPlanVO
;
import
com.pcloud.book.timecontrol.vo.UpdateSelfPlanVO
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
import
java.util.Map
;
@Component
(
"selfPlanMapper"
)
public
interface
TimeControlSelfPlanMapper
{
int
insert
(
TimeControlSelfPlan
selfPlan
);
int
update
(
TimeControlSelfPlan
selfPlan
);
TimeControlSelfPlan
getById
(
@Param
(
"id"
)
Integer
id
);
int
deleteById
(
@Param
(
"id"
)
Integer
id
);
int
getSelfPlanCount
(
@Param
(
"serviceState"
)
Integer
serviceState
);
List
<
SelfPlanVO
>
listSelfPlan
(
@Param
(
"pageNum"
)
int
pageNum
,
@Param
(
"numPerPage"
)
int
numPerPage
,
@Param
(
"serviceState"
)
Integer
serviceState
);
void
bindTask
(
@Param
(
"planId"
)
Integer
planId
,
@Param
(
"taskId"
)
Integer
taskId
);
@MapKey
(
"wxUserId"
)
Map
<
String
,
SelfPlanUserDto
>
getSelfPlanUserDtoMap
(
List
<
String
>
wechatUserIds
);
void
updateServiceState
(
TimeControlSelfPlan
timeControlSelfPlan
);
void
updatePlanOrder
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"planOrder"
)
String
planOrder
);
void
advancedSetting
(
TimeControlSelfPlan
timeControlSelfPlan
);
void
updateSelfPlan
(
UpdateSelfPlanVO
updateSelfPlanVO
);
TimeControlSelfPlan
getLatestPlan
(
String
wxId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/mapper/TimeControlTaskItemMapper.java
View file @
05a79f8e
...
...
@@ -19,11 +19,13 @@ public interface TimeControlTaskItemMapper {
TimeControlTaskItem
getByTaskIdAndDay
(
@Param
(
"taskId"
)
Integer
taskId
,
@Param
(
"startDay"
)
Integer
startDay
);
void
updateT
t
askItem
(
TimeControlTaskItem
timeControlTaskItem
);
void
updateTaskItem
(
TimeControlTaskItem
timeControlTaskItem
);
List
<
ReplyMessageBaseDto
>
listTaskItemDay
(
Integer
taskId
);
List
<
TimeControlTaskItem
>
getByItemIdList
(
@Param
(
"taskItemIds"
)
List
<
Integer
>
taskItemIds
);
Integer
getTaskItemCount
(
@Param
(
"taskId"
)
Integer
taskId
);
List
<
TimeControlTaskItem
>
listByTaskId
(
Integer
taskId
);
}
\ No newline at end of file
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/vo/AddTask4SelfPlan.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
vo
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
public
class
AddTask4SelfPlan
implements
Serializable
{
@NotNull
private
Integer
planId
;
@NotNull
private
Integer
taskId
;
}
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/vo/CreateSelfPlanVO.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
vo
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
@Data
public
class
CreateSelfPlanVO
implements
Serializable
{
@NotNull
private
String
wxId
;
@NotNull
private
String
robotWxId
;
}
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/vo/SelfPlanVO.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
vo
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.pcloud.book.timecontrol.entity.TimeControlSelfPlanFeedback
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
SelfPlanVO
implements
Serializable
{
private
Integer
planId
;
private
String
robotWxId
;
@ApiModelProperty
(
"个人号类型"
)
private
Integer
robotType
;
@ApiModelProperty
(
"分类名称"
)
private
String
classifyName
;
private
String
wxId
;
private
String
nickName
;
private
String
headUrl
;
private
Integer
taskId
;
private
BigDecimal
totalPrice
;
private
Integer
evaluateOpen
;
private
Integer
serviceState
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
private
Date
createTime
;
private
String
linkUrl
;
private
Integer
feedbackState
;
//意见反馈
private
List
<
TimeControlSelfPlanFeedback
>
timeControlSelfPlanFeedback4Suggestion
;
//评分
private
TimeControlSelfPlanFeedback
timeControlSelfPlanFeedback4Evaluate
;
@ApiModelProperty
(
"编号"
)
private
String
uniqueNumber
;
}
pcloud-service-book/src/main/java/com/pcloud/book/timecontrol/vo/UpdateSelfPlanVO.java
0 → 100644
View file @
05a79f8e
package
com
.
pcloud
.
book
.
timecontrol
.
vo
;
import
javax.validation.constraints.NotNull
;
import
lombok.Data
;
@Data
public
class
UpdateSelfPlanVO
{
@NotNull
private
String
wxId
;
@NotNull
private
String
robotWxId
;
@NotNull
private
Integer
planId
;
}
pcloud-service-book/src/main/resources/mapper/timecontrol/TimeControlSelfPlanFeedbackMapper.xml
0 → 100644
View file @
05a79f8e
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.timecontrol.mapper.TimeControlSelfPlanFeedbackMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.timecontrol.entity.TimeControlSelfPlanFeedback"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"feedback_type"
property=
"feedbackType"
jdbcType=
"INTEGER"
/>
<result
column=
"self_plan_id"
property=
"selfPlanId"
jdbcType=
"INTEGER"
/>
<result
column=
"robot_wx_id"
property=
"robotWxId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_id"
property=
"wxId"
jdbcType=
"VARCHAR"
/>
<result
column=
"plan_type"
property=
"planType"
jdbcType=
"INTEGER"
/>
<result
column=
"content"
property=
"content"
jdbcType=
"VARCHAR"
/>
<result
column=
"plan_score"
property=
"planScore"
jdbcType=
"INTEGER"
/>
<result
column=
"content_score"
property=
"contentScore"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, feedback_type, self_plan_id, robot_wx_id, wx_id, plan_type, content, plan_score, content_score, create_time, update_time
</sql>
<insert
id=
"insert"
parameterType=
"TimeControlSelfPlanFeedback"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into time_control_self_plan_feedback (feedback_type, self_plan_id, robot_wx_id, wx_id,
plan_type, content, plan_score, content_score, create_time, update_time)
values (#{feedbackType,jdbcType=INTEGER}, #{selfPlanId,jdbcType=INTEGER}, #{robotWxId,jdbcType=VARCHAR}, #{wxId,jdbcType=VARCHAR},
#{planType,jdbcType=INTEGER}, #{content,jdbcType=VARCHAR}, #{planScore,jdbcType=INTEGER},
#{contentScore,jdbcType=INTEGER}, NOW(), NOW())
</insert>
<insert
id=
"batchInsert"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into time_control_self_plan_feedback (feedback_type, self_plan_id, robot_wx_id, wx_id,
plan_type, content, plan_score, content_score, create_time, update_time)
values
<foreach
collection=
"list"
separator=
","
item=
"item"
>
(#{item.feedbackType,jdbcType=INTEGER}, #{item.selfPlanId,jdbcType=INTEGER}, #{item.robotWxId,jdbcType=VARCHAR}, #{item.wxId,jdbcType=VARCHAR},
#{item.planType,jdbcType=INTEGER}, #{item.content,jdbcType=VARCHAR}, #{item.planScore,jdbcType=INTEGER},
#{item.contentScore,jdbcType=INTEGER}, NOW(), NOW())
</foreach>
</insert>
<update
id=
"update"
parameterType=
"TimeControlSelfPlanFeedback"
>
update time_control_self_plan_feedback
<set>
<if
test=
"selfPlanId != null"
>
self_plan_id = #{selfPlanId,jdbcType=INTEGER},
</if>
<if
test=
"robotWxId != null"
>
robot_wx_id = #{robotWxId,jdbcType=VARCHAR},
</if>
<if
test=
"wxId != null"
>
wx_id = #{wxId,jdbcType=VARCHAR},
</if>
<if
test=
"planType != null"
>
plan_type = #{planType,jdbcType=INTEGER},
</if>
<if
test=
"content != null"
>
content = #{content,jdbcType=VARCHAR},
</if>
update_time = NOW(),
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete
id=
"deleteByPlanId"
>
delete from time_control_self_plan_feedback
where self_plan_id = #{planId,jdbcType=INTEGER}
and feedback_type = #{feedbackType,jdbcType=INTEGER}
</delete>
<select
id=
"getFeedbackByPlan"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from time_control_self_plan_feedback
where self_plan_id = #{planId,jdbcType=INTEGER}
and feedback_type = #{feedbackType,jdbcType=INTEGER}
</select>
<select
id=
"listFeedback"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from time_control_self_plan_feedback
where self_plan_id = #{planId,jdbcType=INTEGER}
and feedback_type = 1
ORDER BY
create_time DESC
LIMIT #{pageNum}, #{numPerPage}
</select>
<select
id=
"listFeedbackCount"
parameterType=
"integer"
resultType=
"integer"
>
select
count(*)
from
time_control_self_plan_feedback
where self_plan_id = #{planId,jdbcType=INTEGER}
and feedback_type = 1
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/timecontrol/TimeControlSelfPlanItemMapper.xml
0 → 100644
View file @
05a79f8e
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.timecontrol.mapper.TimeControlSelfPlanItemMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.timecontrol.entity.TimeControlSelfPlanItem"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"self_plan_id"
property=
"selfPlanId"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"INTEGER"
/>
<result
column=
"title"
property=
"title"
jdbcType=
"VARCHAR"
/>
<result
column=
"content"
property=
"content"
jdbcType=
"VARCHAR"
/>
<result
column=
"description"
property=
"description"
jdbcType=
"VARCHAR"
/>
<result
column=
"pic_url"
property=
"picUrl"
jdbcType=
"VARCHAR"
/>
<result
column=
"open_feedback"
property=
"openFeedback"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, self_plan_id, type, title, content, description, pic_url, open_feedback, create_time, update_time
</sql>
<insert
id=
"batchInsert"
>
insert into time_control_self_plan_item (self_plan_id, type, title,
content, description, pic_url, open_feedback, create_time, update_time)
values
<foreach
collection=
"list"
separator=
","
item=
"item"
>
(#{item.selfPlanId,jdbcType=INTEGER}, #{item.type,jdbcType=INTEGER}, #{item.title,jdbcType=VARCHAR},
#{item.content,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR},#{item.picUrl,jdbcType=VARCHAR},
#{item.openFeedback,jdbcType=INTEGER}, NOW(), NOW())
</foreach>
</insert>
<update
id=
"update"
parameterType=
"TimeControlSelfPlanItem"
>
update time_control_self_plan_item
<set>
<if
test=
"selfPlanId != null"
>
self_plan_id = #{selfPlanId,jdbcType=INTEGER},
</if>
<if
test=
"type != null"
>
type = #{type,jdbcType=INTEGER},
</if>
<if
test=
"title != null"
>
title = #{title,jdbcType=VARCHAR},
</if>
<if
test=
"content != null"
>
content = #{content,jdbcType=VARCHAR},
</if>
<if
test=
"description != null"
>
description = #{description,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"getByPlanId"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from time_control_self_plan_item
where self_plan_id = #{planId,jdbcType=INTEGER}
</select>
<delete
id=
"deleteByPlanId"
parameterType=
"java.lang.Integer"
>
delete from time_control_self_plan_item
where self_plan_id = #{planId,jdbcType=INTEGER}
</delete>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/timecontrol/TimeControlSelfPlanMapper.xml
0 → 100644
View file @
05a79f8e
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.pcloud.book.timecontrol.mapper.TimeControlSelfPlanMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.pcloud.book.timecontrol.entity.TimeControlSelfPlan"
>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"robot_wx_id"
property=
"robotWxId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_id"
property=
"wxId"
jdbcType=
"VARCHAR"
/>
<result
column=
"task_id"
property=
"taskId"
jdbcType=
"INTEGER"
/>
<result
column=
"total_price"
property=
"totalPrice"
jdbcType=
"DECIMAL"
/>
<result
column=
"buy_reply"
property=
"buyReply"
jdbcType=
"VARCHAR"
/>
<result
column=
"subscribe_reply"
property=
"subscribeReply"
jdbcType=
"VARCHAR"
/>
<result
column=
"evaluate_open"
property=
"evaluateOpen"
jdbcType=
"INTEGER"
/>
<result
column=
"service_state"
property=
"serviceState"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"evaluate_guide"
property=
"evaluateGuide"
jdbcType=
"VARCHAR"
/>
<result
column=
"change_reply"
property=
"changeReply"
jdbcType=
"VARCHAR"
/>
<result
column=
"plan_order"
property=
"planOrder"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, robot_wx_id, wx_id, task_id, total_price, buy_reply, subscribe_reply, evaluate_open,
service_state, create_time, update_time,evaluate_guide,change_reply, plan_order
</sql>
<insert
id=
"insert"
parameterType=
"TimeControlSelfPlan"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into time_control_self_plan (robot_wx_id, wx_id, task_id,
total_price, buy_reply, subscribe_reply,
evaluate_open, service_state, create_time, update_time)
values (#{robotWxId,jdbcType=VARCHAR}, #{wxId,jdbcType=VARCHAR}, #{taskId,jdbcType=INTEGER},
#{totalPrice,jdbcType=DECIMAL}, #{buyReply,jdbcType=VARCHAR}, #{subscribeReply,jdbcType=VARCHAR},
0, 0, NOW(), NOW())
</insert>
<update
id=
"update"
parameterType=
"TimeControlSelfPlan"
>
update time_control_self_plan
<set>
<if
test=
"robotWxId != null"
>
robot_wx_id = #{robotWxId,jdbcType=VARCHAR},
</if>
<if
test=
"wxId != null"
>
wx_id = #{wxId,jdbcType=VARCHAR},
</if>
<if
test=
"taskId != null"
>
task_id = #{taskId,jdbcType=INTEGER},
</if>
<if
test=
"totalPrice != null"
>
total_price = #{totalPrice,jdbcType=DECIMAL},
</if>
<if
test=
"buyReply != null"
>
buy_reply = #{buyReply,jdbcType=VARCHAR},
</if>
<if
test=
"subscribeReply != null"
>
subscribe_reply = #{subscribeReply,jdbcType=VARCHAR},
</if>
<if
test=
"evaluateOpen != null"
>
evaluate_open = #{evaluateOpen,jdbcType=INTEGER},
</if>
<if
test=
"serviceState != null"
>
service_state = #{serviceState,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
<delete
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
delete from time_control_self_plan
where id = #{id,jdbcType=INTEGER}
</delete>
<select
id=
"getById"
parameterType=
"java.lang.Integer"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from time_control_self_plan
where id = #{id,jdbcType=INTEGER}
</select>
<select
id=
"getSelfPlanCount"
parameterType=
"integer"
resultType=
"java.lang.Integer"
>
SELECT
ifnull(COUNT(1), 0)
FROM
`time_control_self_plan`
where 1=1
<if
test=
"serviceState != null"
>
and service_state = #{serviceState}
</if>
</select>
<select
id=
"listSelfPlan"
resultType=
"com.pcloud.book.timecontrol.vo.SelfPlanVO"
>
SELECT
id planId,
robot_wx_id robotWxId,
wx_id wxId,
task_id taskId,
total_price totalPrice,
buy_reply buyReply,
subscribe_reply subscribeReply,
evaluate_open evaluateOpen,
service_state serviceState,
create_time createTime
FROM
time_control_self_plan
where 1=1
<if
test=
"serviceState != null"
>
and service_State = #{serviceState}
</if>
ORDER BY
create_time DESC
LIMIT #{pageNum}, #{numPerPage}
</select>
<update
id=
"bindTask"
>
update time_control_self_plan set task_id = #{taskId}, update_time = now()
where id = #{planId}
</update>
<select
id=
"getSelfPlanUserDtoMap"
parameterType=
"list"
resultType=
"java.util.Map"
>
SELECT
wx_id wxUserId,
count(id) slefPlanCount,
sum(service_state = 2) orderCount
FROM
time_control_self_plan
<where>
<if
test=
"list != null"
>
wx_id in
<foreach
collection=
"list"
index=
"index"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
</where>
</select>
<update
id=
"updateServiceState"
parameterType=
"com.pcloud.book.timecontrol.entity.TimeControlSelfPlan"
>
update time_control_self_plan set service_state = #{serviceState}
where id = #{id}
</update>
<update
id=
"updatePlanOrder"
>
update time_control_self_plan set plan_order = #{planOrder}
where id = #{id}
</update>
<update
id=
"advancedSetting"
parameterType=
"com.pcloud.book.timecontrol.entity.TimeControlSelfPlan"
>
update
time_control_self_plan
set
total_price = #{totalPrice} ,
buy_reply = #{buyReply} ,
change_reply = #{changeReply}
<if
test=
"evaluateOpen != null"
>
,evaluate_open = #{evaluateOpen}
</if>
<if
test=
"evaluateGuide != null"
>
, evaluate_guide = #{evaluateGuide}
</if>
where id = #{id}
</update>
<update
id=
"updateSelfPlan"
parameterType=
"com.pcloud.book.timecontrol.vo.UpdateSelfPlanVO"
>
update
time_control_self_plan
set
robot_wx_id = #{robotWxId},
wx_id = #{wxId}
where
id = #{planId}
</update>
<select
id=
"getLatestPlan"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from time_control_self_plan
where wx_id = #{wxId}
order by create_time desc
limit 1
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/timecontrol/TimeControlTaskItemMapper.xml
View file @
05a79f8e
...
...
@@ -15,20 +15,21 @@
<result
column=
"add_send_time"
property=
"addSendTime"
jdbcType=
"INTEGER"
/>
<result
column=
"send_hour"
property=
"sendHour"
jdbcType=
"VARCHAR"
/>
<result
column=
"progress_guidance"
property=
"progressGuidance"
jdbcType=
"INTEGER"
/>
<result
column=
"item_introduce"
property=
"itemIntroduce"
jdbcType=
"VARCHAR"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id, task_id, start_day, finish_confirm, finish_key_word, create_time, update_time,td_confirm,finish_link_introduce,finish_link_url
,add_send_time,send_hour,progress_guidance
,add_send_time,send_hour,progress_guidance
, item_introduce
</sql>
<insert
id=
"insert"
parameterType=
"com.pcloud.book.timecontrol.entity.TimeControlTaskItem"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into time_control_task_item(task_id, start_day, finish_confirm, finish_key_word, create_time, update_time
,td_confirm,finish_link_introduce,finish_link_url,add_send_time,send_hour,progress_guidance)
,td_confirm,finish_link_introduce,finish_link_url,add_send_time,send_hour,progress_guidance
, item_introduce
)
values (#{taskId}, #{startDay}, #{finishConfirm}, #{finishKeyWord}, now(), now(),#{tdConfirm},#{finishLinkIntroduce},#{finishLinkUrl}
,#{addSendTime},#{sendHour},#{progressGuidance})
,#{addSendTime},#{sendHour},#{progressGuidance}
, #{itemIntroduce}
)
</insert>
<update
id=
"updateT
t
askItem"
parameterType=
"com.pcloud.book.timecontrol.entity.TimeControlTaskItem"
>
<update
id=
"updateTaskItem"
parameterType=
"com.pcloud.book.timecontrol.entity.TimeControlTaskItem"
>
update time_control_task_item set start_day = #{startDay}, finish_confirm = #{finishConfirm}, finish_key_word = #{finishKeyWord},
td_confirm=#{tdConfirm},
<if
test=
"finishLinkIntroduce !=null"
>
...
...
@@ -40,7 +41,7 @@
add_send_time=#{addSendTime},
send_hour=#{sendHour},
progress_guidance=#{progressGuidance},
update_time = now()
update_time = now()
, item_introduce = #{itemIntroduce}
where id = #{id}
</update>
...
...
@@ -88,4 +89,13 @@
WHERE
task_id = #{taskId}
</select>
<select
id=
"listByTaskId"
parameterType=
"Integer"
resultMap=
"BaseResultMap"
>
SELECT id, task_id, start_day, finish_confirm, finish_key_word, td_confirm,finish_link_introduce,finish_link_url
,add_send_time,send_hour,progress_guidance, item_introduce
FROM
time_control_task_item
WHERE
task_id = #{taskId}
</select>
</mapper>
\ No newline at end of file
pcloud-service-book/src/main/resources/mapper/timecontrol/TimeControlTaskMapper.xml
View file @
05a79f8e
...
...
@@ -70,7 +70,7 @@
FROM
time_control_task a
LEFT JOIN time_control_task_item b ON a.task_id = b.task_id
where 1=1
where 1=1
and a.type = 0
<if
test=
"search != null"
>
and task_name like concat('%', #{search}, '%')
</if>
...
...
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