Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xinrenli
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
郑云飞
xinrenli
Commits
35a38c2d
Commit
35a38c2d
authored
Apr 11, 2023
by
kaevom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交 新增两个job 邀请折扣 已接但变成已完成
parent
36a657cb
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
175 additions
and
19 deletions
+175
-19
yongqi-job/src/main/java/com/yongqi/job/service/SampleService.java
+47
-1
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/controller/DbArticleController.java
+7
-0
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/controller/DbOrderController.java
+5
-0
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/domain/DbFile.java
+4
-0
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/domain/vo/DbArticleVo.java
+2
-2
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/domain/vo/DbFileVo.java
+4
-1
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/domain/vo/DbOrderVo.java
+10
-5
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/mapper/DbOrderMapper.java
+2
-0
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/mapper/DbUserDiscountMapper.java
+5
-0
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/IDbOrderService.java
+5
-0
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/IDbUserDiscountService.java
+2
-0
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/impl/DbArticleServiceImpl.java
+2
-0
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/impl/DbOrderServiceImpl.java
+54
-1
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/impl/DbUserDiscountServiceImpl.java
+12
-0
yongqi-xinrenli/src/main/resources/mapper/DbOrderMapper.xml
+7
-4
yongqi-xinrenli/src/main/resources/mapper/DbUserDiscountMapper.xml
+7
-5
No files found.
yongqi-job/src/main/java/com/yongqi/job/service/SampleService.java
View file @
35a38c2d
...
@@ -2,7 +2,10 @@ package com.yongqi.job.service;
...
@@ -2,7 +2,10 @@ package com.yongqi.job.service;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
com.yongqi.common.utils.poi.ExcelUtil
;
import
com.yongqi.xinrenli.domain.vo.ReportFormsVo
;
import
com.yongqi.xinrenli.service.IDbOrderService
;
import
com.yongqi.xinrenli.service.IDbOrderService
;
import
com.yongqi.xinrenli.service.IDbUserDiscountService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -13,7 +16,9 @@ import java.io.DataOutputStream;
...
@@ -13,7 +16,9 @@ import java.io.DataOutputStream;
import
java.io.InputStreamReader
;
import
java.io.InputStreamReader
;
import
java.net.HttpURLConnection
;
import
java.net.HttpURLConnection
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
/**
/**
* XxlJob开发示例(Bean模式)
* XxlJob开发示例(Bean模式)
...
@@ -31,16 +36,57 @@ import java.util.Arrays;
...
@@ -31,16 +36,57 @@ import java.util.Arrays;
public
class
SampleService
{
public
class
SampleService
{
@Autowired
@Autowired
private
IDbOrderService
iDbOrderService
;
private
IDbOrderService
iDbOrderService
;
@Autowired
private
IDbUserDiscountService
iDbUserDiscountService
;
/**
* 折扣
*
* @throws Exception
*/
@XxlJob
(
"discountJob"
)
public
void
discount
()
throws
Exception
{
XxlJobHelper
.
log
(
"已完成定时任务正在运行"
);
try
{
//邀请用户大于等于三送一张九折折扣
iDbUserDiscountService
.
discountJob
();
}
catch
(
Exception
e
)
{
XxlJobHelper
.
log
(
"已完成定时任务运行失败"
+
e
.
getMessage
());
}
XxlJobHelper
.
log
(
"已完成定时任务运行结束"
);
}
/**
* 已接单维修时间加两天大于等于改成已完成
*
* @throws Exception
*/
@XxlJob
(
"completedJob"
)
public
void
completed
()
throws
Exception
{
XxlJobHelper
.
log
(
"已完成定时任务正在运行"
);
try
{
//已接单维修时间加两天大于等于改成已完成
iDbOrderService
.
completedJob
();
}
catch
(
Exception
e
)
{
XxlJobHelper
.
log
(
"已完成定时任务运行失败"
+
e
.
getMessage
());
}
XxlJobHelper
.
log
(
"已完成定时任务运行结束"
);
}
/**
/**
* 待支付
* 待支付
*/
*/
@XxlJob
(
"unpaidJob"
)
@XxlJob
(
"unpaidJob"
)
public
void
unpaid
()
throws
Exception
{
public
void
unpaid
()
throws
Exception
{
iDbOrderService
.
unpaidJob
();
XxlJobHelper
.
log
(
"待支付定时任务正在运行"
);
try
{
iDbOrderService
.
unpaidJob
();
}
catch
(
Exception
e
)
{
XxlJobHelper
.
log
(
"待支付定时任务运行失败"
+
e
.
getMessage
());
}
XxlJobHelper
.
log
(
"待支付定时任务运行结束"
);
}
}
/**
/**
* 1、简单任务示例(Bean模式)
* 1、简单任务示例(Bean模式)
*/
*/
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/controller/DbArticleController.java
View file @
35a38c2d
...
@@ -3,6 +3,7 @@ package com.yongqi.xinrenli.controller;
...
@@ -3,6 +3,7 @@ package com.yongqi.xinrenli.controller;
import
java.util.List
;
import
java.util.List
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
com.yongqi.common.core.domain.model.LoginUser
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -79,6 +80,9 @@ public class DbArticleController extends BaseController {
...
@@ -79,6 +80,9 @@ public class DbArticleController extends BaseController {
@RepeatSubmit
()
@RepeatSubmit
()
@PostMapping
()
@PostMapping
()
public
R
<
Void
>
add
(
@Validated
(
AddGroup
.
class
)
@RequestBody
DbArticleBo
bo
)
{
public
R
<
Void
>
add
(
@Validated
(
AddGroup
.
class
)
@RequestBody
DbArticleBo
bo
)
{
LoginUser
user
=
getLoginUser
();
bo
.
setCreateUser
(
user
.
getUsername
());
bo
.
setModifyUser
(
user
.
getUsername
());
return
toAjax
(
iDbArticleService
.
insertByBo
(
bo
));
return
toAjax
(
iDbArticleService
.
insertByBo
(
bo
));
}
}
...
@@ -90,6 +94,9 @@ public class DbArticleController extends BaseController {
...
@@ -90,6 +94,9 @@ public class DbArticleController extends BaseController {
@RepeatSubmit
()
@RepeatSubmit
()
@PutMapping
()
@PutMapping
()
public
R
<
Void
>
edit
(
@Validated
(
EditGroup
.
class
)
@RequestBody
DbArticleBo
bo
)
{
public
R
<
Void
>
edit
(
@Validated
(
EditGroup
.
class
)
@RequestBody
DbArticleBo
bo
)
{
LoginUser
user
=
getLoginUser
();
bo
.
setCreateUser
(
user
.
getUsername
());
bo
.
setModifyUser
(
user
.
getUsername
());
return
toAjax
(
iDbArticleService
.
updateByBo
(
bo
));
return
toAjax
(
iDbArticleService
.
updateByBo
(
bo
));
}
}
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/controller/DbOrderController.java
View file @
35a38c2d
...
@@ -271,6 +271,11 @@ public class DbOrderController extends BaseController {
...
@@ -271,6 +271,11 @@ public class DbOrderController extends BaseController {
return
R
.
fail
(
"沟通金额为空"
);
return
R
.
fail
(
"沟通金额为空"
);
}
}
}
}
if
(
"5"
.
equals
(
bo
.
getStatus
())){
if
(
ObjectUtils
.
isEmpty
(
bo
.
getActualAmount
())){
return
R
.
fail
(
"沟通金额为空"
);
}
}
return
toAjax
(
iDbOrderService
.
createPay
(
bo
));
return
toAjax
(
iDbOrderService
.
createPay
(
bo
));
}
}
}
}
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/domain/DbFile.java
View file @
35a38c2d
...
@@ -41,6 +41,10 @@ public class DbFile {
...
@@ -41,6 +41,10 @@ public class DbFile {
*/
*/
private
String
fileType
;
private
String
fileType
;
/**
/**
* 文件描述
*/
private
String
fileDesc
;
/**
* 排序
* 排序
*/
*/
private
Long
sort
;
private
Long
sort
;
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/domain/vo/DbArticleVo.java
View file @
35a38c2d
...
@@ -23,7 +23,7 @@ public class DbArticleVo {
...
@@ -23,7 +23,7 @@ public class DbArticleVo {
/**
/**
* 自增id
* 自增id
*/
*/
@ExcelProperty
(
value
=
"自增id"
)
//
@ExcelProperty(value = "自增id")
private
Long
id
;
private
Long
id
;
/**
/**
...
@@ -65,7 +65,7 @@ public class DbArticleVo {
...
@@ -65,7 +65,7 @@ public class DbArticleVo {
/**
/**
* 删除状态
* 删除状态
*/
*/
@ExcelProperty
(
value
=
"删除状态"
)
//
@ExcelProperty(value = "删除状态")
private
Integer
deleteStatus
;
private
Integer
deleteStatus
;
/**
/**
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/domain/vo/DbFileVo.java
View file @
35a38c2d
...
@@ -47,7 +47,10 @@ public class DbFileVo {
...
@@ -47,7 +47,10 @@ public class DbFileVo {
*/
*/
@ExcelProperty
(
value
=
"文件类型"
)
@ExcelProperty
(
value
=
"文件类型"
)
private
String
fileType
;
private
String
fileType
;
/**
* 文件描述
*/
private
String
fileDesc
;
/**
/**
* 排序
* 排序
*/
*/
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/domain/vo/DbOrderVo.java
View file @
35a38c2d
...
@@ -24,13 +24,13 @@ public class DbOrderVo {
...
@@ -24,13 +24,13 @@ public class DbOrderVo {
/**
/**
* 自增id
* 自增id
*/
*/
@ExcelProperty
(
value
=
"自增id"
)
//
@ExcelProperty(value = "自增id")
private
Long
id
;
private
Long
id
;
/**
/**
* 用户id
* 用户id
*/
*/
@ExcelProperty
(
value
=
"用户id"
)
//
@ExcelProperty(value = "用户id")
private
Long
userId
;
private
Long
userId
;
/**
/**
...
@@ -88,11 +88,16 @@ public class DbOrderVo {
...
@@ -88,11 +88,16 @@ public class DbOrderVo {
private
String
remark
;
private
String
remark
;
/**
/**
* 订单状态:0 已发布;1 已驳回;2 待支付;3 已接单;4 已完成;5 退款中;6 已退款
* 订单状态:0 已发布;1 已驳回;2 待支付;3 已接单;4 已完成;5 退款中;6 已退款
:7 已取消
*/
*/
@ExcelProperty
(
value
=
"订单状态:0 已发布;1 已驳回;2 待支付;3 已接单;4 已完成;5 退款中;6 已退款"
)
private
Integer
status
;
private
Integer
status
;
/**
/**
* 状态名字
*/
@ExcelProperty
(
value
=
"订单状态"
)
private
String
statusName
;
/**
* 驳回理由
* 驳回理由
*/
*/
private
String
reasonsForRejection
;
private
String
reasonsForRejection
;
...
@@ -117,7 +122,7 @@ public class DbOrderVo {
...
@@ -117,7 +122,7 @@ public class DbOrderVo {
/**
/**
* 删除状态 0:未删除 1:删除
* 删除状态 0:未删除 1:删除
*/
*/
@ExcelProperty
(
value
=
"删除状态 0:未删除 1:删除"
)
//
@ExcelProperty(value = "删除状态 0:未删除 1:删除")
private
Integer
deleteStatus
;
private
Integer
deleteStatus
;
/**
/**
* 文件列表
* 文件列表
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/mapper/DbOrderMapper.java
View file @
35a38c2d
...
@@ -37,4 +37,6 @@ public interface DbOrderMapper extends BaseMapperPlus<DbOrderMapper, DbOrder, Db
...
@@ -37,4 +37,6 @@ public interface DbOrderMapper extends BaseMapperPlus<DbOrderMapper, DbOrder, Db
ReportFormsVo
reportForms
();
ReportFormsVo
reportForms
();
Integer
unpaidJob
();
Integer
unpaidJob
();
void
completedJob
();
}
}
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/mapper/DbUserDiscountMapper.java
View file @
35a38c2d
...
@@ -4,6 +4,8 @@ import com.yongqi.xinrenli.domain.DbUserDiscount;
...
@@ -4,6 +4,8 @@ import com.yongqi.xinrenli.domain.DbUserDiscount;
import
com.yongqi.xinrenli.domain.vo.DbUserDiscountVo
;
import
com.yongqi.xinrenli.domain.vo.DbUserDiscountVo
;
import
com.yongqi.common.core.mapper.BaseMapperPlus
;
import
com.yongqi.common.core.mapper.BaseMapperPlus
;
import
java.util.List
;
/**
/**
* 用户折扣Mapper接口
* 用户折扣Mapper接口
*
*
...
@@ -12,4 +14,7 @@ import com.yongqi.common.core.mapper.BaseMapperPlus;
...
@@ -12,4 +14,7 @@ import com.yongqi.common.core.mapper.BaseMapperPlus;
*/
*/
public
interface
DbUserDiscountMapper
extends
BaseMapperPlus
<
DbUserDiscountMapper
,
DbUserDiscount
,
DbUserDiscountVo
>
{
public
interface
DbUserDiscountMapper
extends
BaseMapperPlus
<
DbUserDiscountMapper
,
DbUserDiscount
,
DbUserDiscountVo
>
{
List
<
DbUserDiscount
>
discountJobList
();
void
updateDiscount
(
DbUserDiscount
v
);
}
}
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/IDbOrderService.java
View file @
35a38c2d
...
@@ -109,4 +109,9 @@ public interface IDbOrderService {
...
@@ -109,4 +109,9 @@ public interface IDbOrderService {
* @return
* @return
*/
*/
String
refundNotify
(
String
xmlData
)
throws
WxPayException
;
String
refundNotify
(
String
xmlData
)
throws
WxPayException
;
/**
* 已支付变成已完成job
*/
void
completedJob
();
}
}
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/IDbUserDiscountService.java
View file @
35a38c2d
...
@@ -45,4 +45,6 @@ public interface IDbUserDiscountService {
...
@@ -45,4 +45,6 @@ public interface IDbUserDiscountService {
* 校验并批量删除用户折扣信息
* 校验并批量删除用户折扣信息
*/
*/
Boolean
deleteWithValidByIds
(
Collection
<
Long
>
ids
,
Boolean
isValid
);
Boolean
deleteWithValidByIds
(
Collection
<
Long
>
ids
,
Boolean
isValid
);
void
discountJob
();
}
}
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/impl/DbArticleServiceImpl.java
View file @
35a38c2d
...
@@ -70,6 +70,8 @@ public class DbArticleServiceImpl implements IDbArticleService {
...
@@ -70,6 +70,8 @@ public class DbArticleServiceImpl implements IDbArticleService {
@Override
@Override
public
TableDataInfo
<
DbArticleVo
>
queryPageList
(
DbArticleBo
bo
,
PageQuery
pageQuery
)
{
public
TableDataInfo
<
DbArticleVo
>
queryPageList
(
DbArticleBo
bo
,
PageQuery
pageQuery
)
{
LambdaQueryWrapper
<
DbArticle
>
lqw
=
buildQueryWrapper
(
bo
);
LambdaQueryWrapper
<
DbArticle
>
lqw
=
buildQueryWrapper
(
bo
);
pageQuery
.
setIsAsc
(
"desc"
);
pageQuery
.
setOrderByColumn
(
"modifyTime"
);
Page
<
DbArticleVo
>
result
=
baseMapper
.
selectPageList
(
pageQuery
.
build
(),
lqw
);
Page
<
DbArticleVo
>
result
=
baseMapper
.
selectPageList
(
pageQuery
.
build
(),
lqw
);
result
.
getRecords
().
forEach
(
record
->
{
result
.
getRecords
().
forEach
(
record
->
{
IPage
<
DbUserCommentVo
>
voPage
=
commentMapper
.
selectVoPage
(
new
Page
<
DbUserComment
>(
0
,
3
),
Wrappers
.<
DbUserComment
>
lambdaQuery
()
IPage
<
DbUserCommentVo
>
voPage
=
commentMapper
.
selectVoPage
(
new
Page
<
DbUserComment
>(
0
,
3
),
Wrappers
.<
DbUserComment
>
lambdaQuery
()
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/impl/DbOrderServiceImpl.java
View file @
35a38c2d
...
@@ -110,7 +110,34 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -110,7 +110,34 @@ public class DbOrderServiceImpl implements IDbOrderService {
@Override
@Override
public
List
<
DbOrderVo
>
queryList
(
DbOrderBo
bo
)
{
public
List
<
DbOrderVo
>
queryList
(
DbOrderBo
bo
)
{
LambdaQueryWrapper
<
DbOrder
>
lqw
=
buildQueryWrapper
(
bo
);
LambdaQueryWrapper
<
DbOrder
>
lqw
=
buildQueryWrapper
(
bo
);
return
baseMapper
.
selectVoList
(
lqw
);
List
<
DbOrderVo
>
list
=
baseMapper
.
selectVoList
(
lqw
);
list
.
stream
().
forEach
(
DbOrderVo
->
{
if
(
"0"
.
equals
(
DbOrderVo
.
getStatus
()))
{
DbOrderVo
.
setStatusName
(
"已发布"
);
}
if
(
"1"
.
equals
(
DbOrderVo
.
getStatus
()))
{
DbOrderVo
.
setStatusName
(
"已驳回"
);
}
if
(
"2"
.
equals
(
DbOrderVo
.
getStatus
()))
{
DbOrderVo
.
setStatusName
(
"待支付"
);
}
if
(
"3"
.
equals
(
DbOrderVo
.
getStatus
()))
{
DbOrderVo
.
setStatusName
(
"已接单"
);
}
if
(
"4"
.
equals
(
DbOrderVo
.
getStatus
()))
{
DbOrderVo
.
setStatusName
(
"已完成"
);
}
if
(
"5"
.
equals
(
DbOrderVo
.
getStatus
()))
{
DbOrderVo
.
setStatusName
(
"退款中"
);
}
if
(
"6"
.
equals
(
DbOrderVo
.
getStatus
()))
{
DbOrderVo
.
setStatusName
(
"已退款"
);
}
if
(
"7"
.
equals
(
DbOrderVo
.
getStatus
()))
{
DbOrderVo
.
setStatusName
(
"已取消"
);
}
});
return
list
;
}
}
private
LambdaQueryWrapper
<
DbOrder
>
buildQueryWrapper
(
DbOrderBo
bo
)
{
private
LambdaQueryWrapper
<
DbOrder
>
buildQueryWrapper
(
DbOrderBo
bo
)
{
...
@@ -148,10 +175,13 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -148,10 +175,13 @@ public class DbOrderServiceImpl implements IDbOrderService {
bo
.
setId
(
add
.
getId
());
bo
.
setId
(
add
.
getId
());
if
(!
ObjectUtils
.
isEmpty
(
bo
.
getPictureList
()))
{
if
(!
ObjectUtils
.
isEmpty
(
bo
.
getPictureList
()))
{
List
<
DbFile
>
files
=
BeanUtil
.
copyToList
(
bo
.
getPictureList
(),
DbFile
.
class
);
List
<
DbFile
>
files
=
BeanUtil
.
copyToList
(
bo
.
getPictureList
(),
DbFile
.
class
);
files
.
forEach
(
file
->
{
files
.
forEach
(
file
->
{
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setServiceId
(
add
.
getId
());
file
.
setServiceId
(
add
.
getId
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setCreateName
(
String
.
valueOf
(
user
.
getUserId
()));
file
.
setModifyName
(
String
.
valueOf
(
user
.
getUserId
()));
});
});
fileMapper
.
insertBatch
(
files
);
fileMapper
.
insertBatch
(
files
);
}
}
...
@@ -161,6 +191,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -161,6 +191,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setServiceId
(
add
.
getId
());
file
.
setServiceId
(
add
.
getId
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setCreateName
(
String
.
valueOf
(
user
.
getUserId
()));
file
.
setModifyName
(
String
.
valueOf
(
user
.
getUserId
()));
});
});
fileMapper
.
insertBatch
(
files
);
fileMapper
.
insertBatch
(
files
);
}
}
...
@@ -170,6 +202,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -170,6 +202,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setServiceId
(
add
.
getId
());
file
.
setServiceId
(
add
.
getId
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setCreateName
(
String
.
valueOf
(
user
.
getUserId
()));
file
.
setModifyName
(
String
.
valueOf
(
user
.
getUserId
()));
});
});
fileMapper
.
insertBatch
(
files
);
fileMapper
.
insertBatch
(
files
);
}
}
...
@@ -200,6 +234,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -200,6 +234,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
file
.
setServiceId
(
update
.
getId
());
file
.
setServiceId
(
update
.
getId
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setCreateName
(
String
.
valueOf
(
user
.
getUserId
()));
file
.
setModifyName
(
String
.
valueOf
(
user
.
getUserId
()));
});
});
fileMapper
.
insertBatch
(
files
);
fileMapper
.
insertBatch
(
files
);
}
}
...
@@ -209,6 +245,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -209,6 +245,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
file
.
setServiceId
(
update
.
getId
());
file
.
setServiceId
(
update
.
getId
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setCreateName
(
String
.
valueOf
(
user
.
getUserId
()));
file
.
setModifyName
(
String
.
valueOf
(
user
.
getUserId
()));
});
});
fileMapper
.
insertBatch
(
files
);
fileMapper
.
insertBatch
(
files
);
}
}
...
@@ -218,6 +256,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -218,6 +256,8 @@ public class DbOrderServiceImpl implements IDbOrderService {
file
.
setServiceId
(
update
.
getId
());
file
.
setServiceId
(
update
.
getId
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setServiceType
(
FileEnumServiceType
.
ORDER
.
getServiceTyp
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setDeleteStatus
(
DeleteStatusEnum
.
OK
.
getCode
());
file
.
setCreateName
(
String
.
valueOf
(
user
.
getUserId
()));
file
.
setModifyName
(
String
.
valueOf
(
user
.
getUserId
()));
});
});
fileMapper
.
insertBatch
(
files
);
fileMapper
.
insertBatch
(
files
);
}
}
...
@@ -332,8 +372,11 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -332,8 +372,11 @@ public class DbOrderServiceImpl implements IDbOrderService {
@Override
@Override
public
TableDataInfo
<
DbOrderVo
>
homeList
(
DbOrderBo
bo
,
PageQuery
pageQuery
)
{
public
TableDataInfo
<
DbOrderVo
>
homeList
(
DbOrderBo
bo
,
PageQuery
pageQuery
)
{
LambdaQueryWrapper
<
DbOrder
>
lqw
=
homeListWrapper
(
bo
);
LambdaQueryWrapper
<
DbOrder
>
lqw
=
homeListWrapper
(
bo
);
pageQuery
.
setOrderByColumn
(
"modifyTime"
);
//根据修改时间
pageQuery
.
setIsAsc
(
"desc"
);
//倒叙
Page
<
DbOrderVo
>
result
=
baseMapper
.
homeList
(
pageQuery
.
build
(),
lqw
);
Page
<
DbOrderVo
>
result
=
baseMapper
.
homeList
(
pageQuery
.
build
(),
lqw
);
result
.
getRecords
().
forEach
(
record
->
{
result
.
getRecords
().
forEach
(
record
->
{
//获取订单文件
List
<
DbFileVo
>
dbFileVo
=
fileMapper
.
selectVoList
(
Wrappers
.<
DbFile
>
lambdaQuery
()
List
<
DbFileVo
>
dbFileVo
=
fileMapper
.
selectVoList
(
Wrappers
.<
DbFile
>
lambdaQuery
()
.
eq
(
DbFile:
:
getServiceId
,
record
.
getId
())
.
eq
(
DbFile:
:
getServiceId
,
record
.
getId
())
.
eq
(
DbFile:
:
getServiceType
,
FileEnumServiceType
.
ORDER
.
getServiceTyp
())
.
eq
(
DbFile:
:
getServiceType
,
FileEnumServiceType
.
ORDER
.
getServiceTyp
())
...
@@ -341,6 +384,7 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -341,6 +384,7 @@ public class DbOrderServiceImpl implements IDbOrderService {
if
(
ObjectUtils
.
isEmpty
(
dbFileVo
))
{
if
(
ObjectUtils
.
isEmpty
(
dbFileVo
))
{
// throw new RuntimeException("这个订单没有文件");
// throw new RuntimeException("这个订单没有文件");
}
}
//文件类型分组
Map
<
String
,
List
<
DbFileVo
>>
groupMap
=
dbFileVo
.
stream
().
collect
(
Collectors
.
groupingBy
(
u
->
u
.
getFileType
()));
Map
<
String
,
List
<
DbFileVo
>>
groupMap
=
dbFileVo
.
stream
().
collect
(
Collectors
.
groupingBy
(
u
->
u
.
getFileType
()));
groupMap
.
forEach
((
k
,
v
)
->
{
groupMap
.
forEach
((
k
,
v
)
->
{
if
(
k
.
equals
(
"picture"
))
{
if
(
k
.
equals
(
"picture"
))
{
...
@@ -357,6 +401,7 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -357,6 +401,7 @@ public class DbOrderServiceImpl implements IDbOrderService {
});
});
return
TableDataInfo
.
build
(
result
);
return
TableDataInfo
.
build
(
result
);
}
}
/**
/**
* 下单
* 下单
*
*
...
@@ -590,6 +635,14 @@ public class DbOrderServiceImpl implements IDbOrderService {
...
@@ -590,6 +635,14 @@ public class DbOrderServiceImpl implements IDbOrderService {
}
}
/**
/**
* 已支付变成已完成
*/
@Override
public
void
completedJob
()
{
baseMapper
.
completedJob
();
}
/**
* 报表
* 报表
*
*
* @return
* @return
...
...
yongqi-xinrenli/src/main/java/com/yongqi/xinrenli/service/impl/DbUserDiscountServiceImpl.java
View file @
35a38c2d
...
@@ -14,6 +14,7 @@ import com.yongqi.xinrenli.domain.DbUserDiscount;
...
@@ -14,6 +14,7 @@ import com.yongqi.xinrenli.domain.DbUserDiscount;
import
com.yongqi.xinrenli.mapper.DbUserDiscountMapper
;
import
com.yongqi.xinrenli.mapper.DbUserDiscountMapper
;
import
com.yongqi.xinrenli.service.IDbUserDiscountService
;
import
com.yongqi.xinrenli.service.IDbUserDiscountService
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Collection
;
import
java.util.Collection
;
...
@@ -108,4 +109,15 @@ public class DbUserDiscountServiceImpl implements IDbUserDiscountService {
...
@@ -108,4 +109,15 @@ public class DbUserDiscountServiceImpl implements IDbUserDiscountService {
}
}
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
}
@Override
public
void
discountJob
()
{
List
<
DbUserDiscount
>
list
=
baseMapper
.
discountJobList
();
list
.
stream
().
forEach
(
v
->
{
v
.
setDiscountRatio
(
BigDecimal
.
valueOf
(
0.9
));
v
.
setUseStatus
(
0
);
baseMapper
.
insert
(
v
);
baseMapper
.
updateDiscount
(
v
);
});
}
}
}
yongqi-xinrenli/src/main/resources/mapper/DbOrderMapper.xml
View file @
35a38c2d
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
<select
id=
"reportFormsExl"
resultType=
"com.yongqi.xinrenli.domain.vo.ReportFormsVo"
>
<select
id=
"reportFormsExl"
resultType=
"com.yongqi.xinrenli.domain.vo.ReportFormsVo"
>
SELECT
SELECT
( SELECT count(*) FROM db_order WHERE `status` = '4' ) AS accomplish,
( SELECT count(*) FROM db_order WHERE `status` = '4' ) AS accomplish,
( SELECT count(*) FROM db_order WHERE `status` = '
2
' ) AS reject,
( SELECT count(*) FROM db_order WHERE `status` = '
1
' ) AS reject,
( SELECT count(*) FROM db_order WHERE `status` = '6' ) AS refund,
( SELECT count(*) FROM db_order WHERE `status` = '6' ) AS refund,
( SELECT CONCAT(TRUNCATE(SUM( actual_amount )/10000,2),'万元') FROM db_order WHERE `status` = '4' ) AS totalMoney,
( SELECT CONCAT(TRUNCATE(SUM( actual_amount )/10000,2),'万元') FROM db_order WHERE `status` = '4' ) AS totalMoney,
CONCAT(t.m,'-',t.w) AS contrastOrder
CONCAT(t.m,'-',t.w) AS contrastOrder
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
FROM
FROM
db_order
db_order
WHERE
WHERE
`status`
IN ( 2, 6 )
) t1,
`status`
= '3'
) t1,
( SELECT count(*) AS m FROM db_order WHERE `status` = '4' ) t2
( SELECT count(*) AS m FROM db_order WHERE `status` = '4' ) t2
) t
) t
...
@@ -110,10 +110,10 @@
...
@@ -110,10 +110,10 @@
<select
id=
"reportForms"
resultType=
"com.yongqi.xinrenli.domain.vo.ReportFormsVo"
>
<select
id=
"reportForms"
resultType=
"com.yongqi.xinrenli.domain.vo.ReportFormsVo"
>
SELECT
SELECT
( SELECT count(*) FROM db_order WHERE `status` = '4' ) AS accomplish,
( SELECT count(*) FROM db_order WHERE `status` = '4' ) AS accomplish,
( SELECT count(*) FROM db_order WHERE `status` = '
2
' ) AS reject,
( SELECT count(*) FROM db_order WHERE `status` = '
1
' ) AS reject,
( SELECT count(*) FROM db_order WHERE `status` = '6' ) AS refund,
( SELECT count(*) FROM db_order WHERE `status` = '6' ) AS refund,
( SELECT TRUNCATE ( SUM( actual_amount )/ 10000, 2 ) FROM db_order WHERE `status` = '4' ) AS totalMoney,
( SELECT TRUNCATE ( SUM( actual_amount )/ 10000, 2 ) FROM db_order WHERE `status` = '4' ) AS totalMoney,
(SELECT count(*) AS w FROM db_order WHERE `status`
IN ( 2, 6 )
) AS NoAccomplish ,
(SELECT count(*) AS w FROM db_order WHERE `status`
= '3'
) AS NoAccomplish ,
(( SELECT count(*) FROM db_order WHERE `status` = '4' )+(SELECT count(*) AS w FROM db_order WHERE `status` IN ( 2, 6 ))) as sum
(( SELECT count(*) FROM db_order WHERE `status` = '4' )+(SELECT count(*) AS w FROM db_order WHERE `status` IN ( 2, 6 ))) as sum
FROM
FROM
DUAL
DUAL
...
@@ -121,4 +121,7 @@
...
@@ -121,4 +121,7 @@
<update
id=
"unpaidJob"
>
<update
id=
"unpaidJob"
>
update db_order set status='2',modify_time=NOW() where status=3 and modify_time
<
=DATE_SUB(SYSDATE(),INTERVAL 1 hour)
update db_order set status='2',modify_time=NOW() where status=3 and modify_time
<
=DATE_SUB(SYSDATE(),INTERVAL 1 hour)
</update>
</update>
<update
id=
"completedJob"
>
update db_order set status='4',modify_time=NOW() where status='3' and DATE_ADD(repair_time, INTERVAL 2 DAY)>=NOW()
</update>
</mapper>
</mapper>
yongqi-xinrenli/src/main/resources/mapper/DbUserDiscountMapper.xml
View file @
35a38c2d
...
@@ -5,13 +5,15 @@
...
@@ -5,13 +5,15 @@
<mapper
namespace=
"com.yongqi.xinrenli.mapper.DbUserDiscountMapper"
>
<mapper
namespace=
"com.yongqi.xinrenli.mapper.DbUserDiscountMapper"
>
<resultMap
type=
"com.yongqi.xinrenli.domain.DbUserDiscount"
id=
"DbUserDiscountResult"
>
<resultMap
type=
"com.yongqi.xinrenli.domain.DbUserDiscount"
id=
"DbUserDiscountResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"discountRatio"
column=
"discount_ratio"
/>
<result
property=
"useStatus"
column=
"use_status"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"modifyTime"
column=
"modify_time"
/>
</resultMap>
</resultMap>
<select
id=
"discountJobList"
resultMap=
"DbUserDiscountResult"
>
select Inviter_id as user_id from (select Inviter_id,count(Inviter_id) as c from db_Inviter where status=1 GROUP BY Inviter_id) t where t.c>=3
</select>
<update
id=
"updateDiscount"
parameterType=
"com.yongqi.xinrenli.domain.DbUserDiscount"
>
update db_Inviter set status=0 where status=1 and Inviter_id=#{userId} LIMIT 3
</update>
</mapper>
</mapper>
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