Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
Project
Project
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
竹天卫
tianjin-cement
Commits
169620c3
Commit
169620c3
authored
Mar 12, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导出委托进展
parent
bea3477f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
267 additions
and
152 deletions
+267
-152
DataStatisticsController.java
.../cement/business/controller/DataStatisticsController.java
+6
-13
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+1
-3
DataStatisticsMapper.java
.../wise/sc/cement/business/mapper/DataStatisticsMapper.java
+1
-0
DataStatisticsMapper.xml
...se/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
+56
-1
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+1
-1
IDataStatisticsService.java
...se/sc/cement/business/service/IDataStatisticsService.java
+4
-2
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+2
-3
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+176
-120
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+20
-9
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/DataStatisticsController.java
View file @
169620c3
...
...
@@ -5,6 +5,7 @@ import cn.wise.sc.cement.business.model.PageQuery;
import
cn.wise.sc.cement.business.model.query.CountItemDistributionQuery
;
import
cn.wise.sc.cement.business.model.vo.ItemDistributionVo
;
import
cn.wise.sc.cement.business.service.IDataStatisticsService
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -34,6 +35,8 @@ public class DataStatisticsController {
@Autowired
private
IDataStatisticsService
dataStatisticsService
;
@Autowired
private
IEntrustService
entrustService
;
@ApiOperation
(
value
=
"统计概览-重要数值统计"
)
...
...
@@ -112,24 +115,14 @@ public class DataStatisticsController {
public
void
exportEntrustList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
dataStatisticsService
.
exportEntrustList
(
cycle
,
startDate
,
endDate
,
clientId
,
clientName
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"列表导出-委托单进展统计{}"
,
e
);
}
}
// dataStatisticsService.exportEntrustList(cycle, startDate, endDate, clientId, clientName, fileName, response);
dataStatisticsService
.
exportConsignation
(
cycle
,
startDate
,
endDate
,
clientId
,
clientName
,
fileName
,
response
);
@ApiOperation
(
"委托单进展统计-列表导出(新)"
)
@PostMapping
(
"/exportEntrustIngList"
)
public
void
exportEntrustIngList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
dataStatisticsService
.
exportEntrustIngList
(
cycle
,
startDate
,
endDate
,
clientId
,
clientName
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"
委托单进展统计-列表导出(新)
{}"
,
e
);
log
.
debug
(
"
列表导出-委托单进展统计
{}"
,
e
);
}
}
@ApiOperation
(
value
=
"统计概览-进行中任务数量统计"
)
@GetMapping
(
"/countTaskIng"
)
public
BaseResponse
countTaskIng
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
169620c3
...
...
@@ -81,12 +81,10 @@ public class EntrustController {
public
void
export
(
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
,
String
fileName
,
HttpServletResponse
response
)
{
long
a
=
System
.
currentTimeMillis
();
try
{
entrustService
.
export
Consignation
(
startDate
,
endDate
,
status
,
entrustService
.
export
(
startDate
,
endDate
,
status
,
clientId
,
projectName
,
projectCode
,
fileName
,
response
);
System
.
out
.
println
(
System
.
currentTimeMillis
()-
a
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"委托列表导出{}"
,
e
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/DataStatisticsMapper.java
View file @
169620c3
...
...
@@ -39,6 +39,7 @@ public interface DataStatisticsMapper {
IPage
<
EntrustVo
>
countEntrustPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
exportEntrustList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
exportEntrustNewList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
IPage
<
DataStatisticsVo
>
countHandlePage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
View file @
169620c3
...
...
@@ -188,7 +188,7 @@
IF(ISNULL(e.id),'',e.id) as entrustId,
IF(ISNULL(e.entrust_code),'',e.entrust_code) as 委托单号,
IF(ISNULL(c.name),'',c.name) as 委托单位,
IF(ISNULL(p.
name),'',p.nam
e) as 项目编号,
IF(ISNULL(p.
code),'',p.cod
e) as 项目编号,
IF(ISNULL(p.name),'',p.name) as 项目名称,
IF(ISNULL(su.name),'',su.name) as 委托人,
IF(ISNULL(e.sample_num),'',e.sample_num) as 样品数量,
...
...
@@ -222,6 +222,61 @@
order by 序号
</select>
<select
id=
"exportEntrustNewList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
e.id as entrustId,
IF(ISNULL(e.entrust_code),'',e.entrust_code) as 委托单号,
(
CASE e.is_urgent
WHEN 0 THEN '不加急'
WHEN 1 THEN '加急'
ELSE NULL
END
) as 是否加急,
IF(ISNULL(p.name),'',p.name) as 项目名称,
IF(ISNULL(p.code),'',p.code) as 项目编号,
IF(ISNULL(su.name),'',su.name) as 委托人,
IF(ISNULL(c.name),'',c.name) as 委托单位,
IF(ISNULL(e.entrust_date),'',e.entrust_date) as 委托日期,
IF(ISNULL(e.sample_num),'',e.sample_num) as 样品数量,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
WHEN 9 THEN '修改待确认'
WHEN 10 THEN '已作废'
ELSE ''
END
) as 状态
from entrust e
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
,(select @i:=0)aa
where e.status != 0 and e.project_type is not null
<if
test=
"params.clientId != null"
>
and e.clientId = #{clientId}
</if>
<if
test=
"params.clientName != null and params.clientName != ''"
>
and c.name like concat('%', #{params.clientName}, '%')
</if>
<if
test=
"params.startDate != null and params.startDate != ''"
>
and DATE(e.create_time)
>
= #{params.startDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
order by 序号
</select>
<select
id=
"countHandlePage"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT su.id as id, su.name as name, count(*) as value FROM sample_handle sh
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
169620c3
...
...
@@ -82,7 +82,7 @@
END
) as 是否加急,
IF(ISNULL(p.name),'',p.name) as 项目名称,
IF(ISNULL(p.
name),'',p.nam
e) as 项目编号,
IF(ISNULL(p.
code),'',p.cod
e) as 项目编号,
IF(ISNULL(su.name),'',su.name) as 委托人,
IF(ISNULL(c.name),'',c.name) as 委托单位,
IF(ISNULL(e.entrust_date),'',e.entrust_date) as 委托日期,
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IDataStatisticsService.java
View file @
169620c3
...
...
@@ -39,8 +39,10 @@ public interface IDataStatisticsService {
void
exportEntrustList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
);
void
exportEntrustIngList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
);
void
exportConsignation
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
);
BaseResponse
<
Map
<
String
,
Object
>>
countTaskIng
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
169620c3
...
...
@@ -144,9 +144,8 @@ public interface IEntrustService extends IService<Entrust> {
Integer
clientId
,
String
projectName
,
String
projectCode
,
String
fileName
,
HttpServletResponse
response
);
void
exportConsignation
(
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
,
String
fileName
,
HttpServletResponse
response
);
void
exportConsignation
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
);
BaseResponse
<
EntrustVo
>
getBaseDtail
(
Integer
id
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
169620c3
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
169620c3
...
...
@@ -5347,24 +5347,25 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
private
ISampleDistributionService
sampleDistributionService
;
@Override
public
void
exportConsignation
(
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCod
e
,
public
void
exportConsignation
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientNam
e
,
String
fileName
,
HttpServletResponse
response
)
{
//1.首先查询所有可见的检测项
QueryWrapper
<
Team
>
teamQueryWrapper
=
new
QueryWrapper
<>();
teamQueryWrapper
.
eq
(
"is_display"
,
1
);
teamQueryWrapper
.
eq
(
"status"
,
1
);
List
<
Team
>
teamList
=
teamService
.
list
(
teamQueryWrapper
);
//转化成id为key的map
Map
<
Integer
,
Team
>
teamMap
=
teamList
.
stream
().
collect
(
Collectors
.
toMap
(
Team:
:
getId
,
a
->
a
,
(
k1
,
k2
)
->
k1
));
//
Map<Integer, Team> teamMap = teamList.stream().collect(Collectors.toMap(Team::getId, a -> a, (k1, k2) -> k1));
//2.条件查询委托单项
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"cycle"
,
cycle
);
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"clientName"
,
clientName
);
List
<
Map
<
String
,
Object
>>
entrustList
=
entrustMapper
.
exportList
(
params
);
//获取所有的委托单号
List
<
Integer
>
queryList
=
entrustList
.
stream
().
map
(
x
->
Integer
.
parseInt
(
x
.
get
(
"entrustId"
).
toString
())).
collect
(
Collectors
.
toList
());
...
...
@@ -5396,7 +5397,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
"项目名称"
,
"委托人"
,
"样品数量"
,
"
发样
日期"
,
"
委托
日期"
,
"是否加急"
,
"实际产值"
,
};
...
...
@@ -5414,9 +5415,19 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//处理委托人信息表头
for
(
int
i
=
0
;
i
<
infoHeader
.
size
();
i
++)
{
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
if
(
infoHeader
.
get
(
i
).
equals
(
"实际产值"
)){
Double
outPutValue
=
sampleList
.
stream
()
.
filter
(
x
->
x
.
getCementCode
().
equals
(
x
.
getParallelCode
())
&&
x
.
getEntrustId
()
==
entrustId
)
.
mapToDouble
(
item
->
item
.
getOutputValue
().
doubleValue
()).
sum
();
tempCell
.
setCellValue
(
outPutValue
==
null
?
""
:
outPutValue
.
toString
());
tempCell
.
setCellStyle
(
style
);
}
else
{
tempCell
.
setCellValue
(
entrust
.
get
(
infoHeader
.
get
(
i
))
==
null
?
""
:
entrust
.
get
(
infoHeader
.
get
(
i
)).
toString
());
tempCell
.
setCellStyle
(
style
);
}
}
//处理检测项总产值表头
for
(
int
i
=
infoHeader
.
size
();
i
<
teamList
.
size
()
+
infoHeader
.
size
();
i
++)
{
XSSFCell
tempCell
=
row0
.
createCell
(
i
);
...
...
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