Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
吴学德
gdtel-gztel-school-center
Commits
1c49ba71
Commit
1c49ba71
authored
Mar 03, 2021
by
陈浩建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
一人一码订单通报*4(未完成,获取数据失败先提交备份)
parent
bda2096a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
201 additions
and
0 deletions
+201
-0
common/src/main/java/com/winsun/mapper/OrderMapper.java
+25
-0
common/src/main/resources/com/winsun/mapper/mapping/OrderMapper.xml
+95
-0
service-manager/src/main/java/com/winsun/controller/OrderConversionController.java
+81
-0
No files found.
common/src/main/java/com/winsun/mapper/OrderMapper.java
View file @
1c49ba71
...
@@ -161,4 +161,29 @@ public interface OrderMapper extends BaseMapper<Order> {
...
@@ -161,4 +161,29 @@ public interface OrderMapper extends BaseMapper<Order> {
* */
* */
@Select
(
"SELECT * FROM hhr_order WHERE user_type = '5' and order_status = '未下单'"
)
@Select
(
"SELECT * FROM hhr_order WHERE user_type = '5' and order_status = '未下单'"
)
List
<
Map
<
String
,
Object
>>
selectDKList
();
List
<
Map
<
String
,
Object
>>
selectDKList
();
/**
* 一人一码订单通报 -- 移动订单(学校)
* @return
*/
List
<
Map
<
String
,
Object
>>
orderConversionXX
(
String
startTime
,
String
endTime
);
/**
* 一人一码订单通报 -- 移动订单(学校)
* @return
*/
List
<
Map
<
String
,
Object
>>
orderConversionXF
(
String
startTime
,
String
endTime
);
/**
* 一人一码订单通报 -- 宽带订单(学校)
* @return
*/
List
<
Map
<
String
,
Object
>>
kdOrderConversionXX
(
String
startTime
,
String
endTime
);
/**
* 一人一码订单通报 -- 宽带订单(学校)
* @return
*/
List
<
Map
<
String
,
Object
>>
kdOrderConversionXF
(
String
startTime
,
String
endTime
);
}
}
common/src/main/resources/com/winsun/mapper/mapping/OrderMapper.xml
View file @
1c49ba71
...
@@ -196,4 +196,98 @@
...
@@ -196,4 +196,98 @@
update hhr_order set order_status = "待受理" where DATE_FORMAT(rh_time, "%y-%m-%d")
<
date_format(now(), "%y-%m-%d") and order_status = "未下单"
update hhr_order set order_status = "待受理" where DATE_FORMAT(rh_time, "%y-%m-%d")
<
date_format(now(), "%y-%m-%d") and order_status = "未下单"
</update>
</update>
<select
id=
"orderConversionXX"
parameterType=
"String"
resultType=
"HashMap"
>
SELECT order_by,sub_name,school,supervisor ,
COUNT(o.id) orderCount ,
COUNT(o.xb_order_id) xb_orderCount ,
COUNT(CASE WHEN xb_order_id is NULL or xb_order_id = '' THEN o.id end) yz_orderCount ,
count(case when o.order_status in( '待识别','重新下单','待选号','审核中','待受理','提交中') then o.id end) status_1,
count(case when o.order_status = '待处理' then o.id end) status_2,
count(case when o.order_status = '待配送' then o.id end) status_3,
count(case when o.order_status in ('待活体','已发货') then o.id end) status_4,
count(case when o.order_status = '已完成' then o.id end) status_5
FROM hhr_report_conversion rc
LEFT JOIN hhr_order o
ON rc.hehuoren_school = o.hehuoren_school
and rc.sub_name = o.hehuoren_area
and user_type = 0
and order_status != '异常单'
and o.kapin != '天翼学生证'
and DATE_FORMAT(create_time,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
GROUP BY order_by,sub_name,school,supervisor
HAVING order_by is not null
ORDER BY order_by
</select>
<select
id=
"orderConversionXF"
parameterType=
"String"
resultType=
"HashMap"
>
SELECT sub_id,sub_name ,
COUNT(o.id) orderCount ,
COUNT(o.xb_order_id) xb_orderCount ,
COUNT(CASE WHEN xb_order_id is NULL or xb_order_id = '' THEN o.id end) yz_orderCount ,
count(case when o.order_status in( '待识别','重新下单','待选号','审核中','待受理','提交中') then o.id end) status_1,
count(case when o.order_status = '待处理' then o.id end) status_2,
count(case when o.order_status = '待配送' then o.id end) status_3,
count(case when o.order_status in ('待活体','已发货') then o.id end) status_4,
count(case when o.order_status = '已完成' then o.id end) status_5
FROM hhr_report_conversion rc
LEFT JOIN hhr_order o
ON rc.hehuoren_school = o.hehuoren_school
and rc.sub_name = o.hehuoren_area
and user_type = 0
and order_status != '异常单'
and o.kapin != '天翼学生证'
and DATE_FORMAT(create_time,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
GROUP BY sub_id,sub_name
HAVING sub_name is not null and sub_name != 'null'
ORDER BY sub_id
</select>
<select
id=
"kdOrderConversionXX"
parameterType=
"String"
resultType=
"HashMap"
>
SELECT order_by,sub_name,school,supervisor,
COUNT(o.id) orderCount ,
count(case when o.user_type ='5' then o.id end) status_5_1,
count(case when o.user_type ='5' and order_status = '已完成' then o.id end) status_5_2,
count(case when o.user_type ='5' and order_status = '异常单' then o.id end) status_5_3,
count(case when o.user_type ='3' then o.id end) status_3_1,
count(case when o.user_type ='3' and order_status = '已完成' then o.id end) status_3_2,
count(case when o.user_type ='3' and order_status = '异常单' then o.id end) status_3_3,
count(case when o.user_type ='10' then o.id end) status_10_1,
count(case when o.user_type ='10' and order_status = '已完成' then o.id end) status_10_2,
count(case when o.user_type ='10' and order_status = '异常单' then o.id end) status_10_3
FROM hhr_report_conversion rc
LEFT JOIN hhr_order o
ON rc.hehuoren_school = o.hehuoren_school
and rc.sub_name = o.hehuoren_area
and user_type in ('3','5','10')
and DATE_FORMAT(create_time,'%Y-%m-%d') BETWEEN #{startTime} AND #{endTime}
GROUP BY order_by,sub_name,school,supervisor
HAVING order_by is not null
ORDER BY order_by
</select>
<select
id=
"kdOrderConversionXF"
parameterType=
"String"
resultType=
"HashMap"
>
SELECT sub_id,sub_name,
count(DISTINCT school) schoolCount,
count(o.id) orderCount ,
count(case when o.user_type ='5' then o.id end) status_5_1,
count(case when o.user_type ='5' and order_status = '已完成' then o.id end) status_5_2,
count(case when o.user_type ='5' and order_status = '异常单' then o.id end) status_5_3,
count(case when o.user_type ='3' then o.id end) status_3_1,
count(case when o.user_type ='3' and order_status = '已完成' then o.id end) status_3_2,
count(case when o.user_type ='3' and order_status = '异常单' then o.id end) status_3_3,
count(case when o.user_type ='10' then o.id end) status_10_1,
count(case when o.user_type ='10' and order_status = '已完成' then o.id end) status_10_2,
count(case when o.user_type ='10' and order_status = '异常单' then o.id end) status_10_3
FROM hhr_report_conversion rc
LEFT JOIN hhr_order o
ON rc.hehuoren_school = o.hehuoren_school
and rc.sub_name = o.hehuoren_area
and user_type in ('3','5','10')
and DATE_FORMAT(create_time,'%Y-%m-%d') BETWEEN '2019-01-01' AND '2021-03-01'
GROUP BY sub_id,sub_name
HAVING sub_id not in (14,15)
ORDER BY sub_id
</select>
</mapper>
</mapper>
\ No newline at end of file
service-manager/src/main/java/com/winsun/controller/OrderConversionController.java
0 → 100644
View file @
1c49ba71
package
com
.
winsun
.
controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.winsun.auth.core.annotion.Permission
;
import
com.winsun.auth.core.base.controller.BaseController
;
import
com.winsun.auth.core.common.model.ResponseData
;
import
com.winsun.auth.core.shiro.ShiroUser
;
import
com.winsun.bean.Order
;
import
com.winsun.mapper.OrderMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.formula.functions.Now
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* @Author: chenhaojian
* @Date: 2021/3/3 10:33
*/
@Slf4j
@RestController
@RequestMapping
(
"/orderConversion"
)
public
class
OrderConversionController
extends
BaseController
{
private
static
OrderMapper
orderMapper
;
// 获取订单通报数据
// conversionType:
// 00:移动通报学校
// 01:移动通报县份
// 10:宽带通报学校
// 11:宽带通报学校
// @RequestMapping(value = "getOrderConversionInfo",method = RequestMethod.POST)
@Permission
(
menuname
=
"获取订单通报数据"
,
value
=
"getOrderConversionInfo"
,
method
=
RequestMethod
.
POST
)
public
ResponseData
getOrderConversionInfo
(
@RequestParam
(
"startTime"
)
String
startTime
,
@RequestParam
(
"endTime"
)
String
endTime
,
@RequestParam
(
"conversionType"
)
String
conversionType
,
@RequestParam
(
name
=
"pageNo"
)
int
pageNo
,
@RequestParam
(
name
=
"pageSize"
)
int
pageSize
){
ShiroUser
user
=
getShiroUser
();
if
(!
user
.
getRoleNames
().
stream
().
anyMatch
(
roleName
->
StringUtils
.
equalsAny
(
roleName
,
"超级管理员"
,
"县分管理员(订单)"
)))
{
ResponseData
.
error
(
"无权限查询订单"
);
}
List
<
Map
<
String
,
Object
>>
list
=
null
;
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>(
pageNo
,
pageSize
);
if
(
""
.
equals
(
startTime
)&&
""
.
equals
(
endTime
)){
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// 暂时计算2019年6月1号开始数据
startTime
=
"2019-06-01"
;
endTime
=
sdf
.
format
(
new
Date
());
}
try
{
switch
(
conversionType
){
case
"00"
:
list
=
orderMapper
.
orderConversionXX
(
startTime
,
endTime
);
break
;
case
"01"
:
list
=
orderMapper
.
orderConversionXF
(
startTime
,
endTime
);
break
;
case
"10"
:
list
=
orderMapper
.
kdOrderConversionXX
(
startTime
,
endTime
);
break
;
case
"11"
:
list
=
orderMapper
.
kdOrderConversionXF
(
startTime
,
endTime
);
break
;
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
page
.
setRecords
(
list
);
return
ResponseData
.
success
(
page
,
"查询成功!"
);
}
}
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