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
d832aad3
Commit
d832aad3
authored
Feb 23, 2021
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计的导出功能
parent
0e362a24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
547 additions
and
80 deletions
+547
-80
DataStatisticsController.java
.../cement/business/controller/DataStatisticsController.java
+28
-7
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+12
-0
SampleDistributionEnclosure.java
...c/cement/business/entity/SampleDistributionEnclosure.java
+1
-0
DataStatisticsMapper.java
.../wise/sc/cement/business/mapper/DataStatisticsMapper.java
+5
-3
EntrustMapper.java
...java/cn/wise/sc/cement/business/mapper/EntrustMapper.java
+2
-0
DataStatisticsMapper.xml
...se/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
+112
-2
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+1
-1
SampleDistributionEnclosureMapper.xml
...business/mapper/xml/SampleDistributionEnclosureMapper.xml
+4
-0
IDataStatisticsService.java
...se/sc/cement/business/service/IDataStatisticsService.java
+7
-2
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+2
-0
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+191
-49
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+54
-1
PrecipriceServiceImpl.java
...c/cement/business/service/impl/PrecipriceServiceImpl.java
+16
-13
DataStatisticsMapper.xml
...n/wise/sc/cement/business/mapper/DataStatisticsMapper.xml
+112
-2
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/DataStatisticsController.java
View file @
d832aad3
...
...
@@ -74,12 +74,14 @@ public class DataStatisticsController {
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"cycle"
,
value
=
"统计周期1:本周 2:本月 3:本年"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"clientId"
,
value
=
"委托单位Id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"clientName"
,
value
=
"委托单位名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/countEntrustStatus"
)
public
BaseResponse
countEntrustStatus
(
Integer
cycle
,
String
startDate
,
String
endDate
)
{
public
BaseResponse
countEntrustStatus
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
)
{
try
{
return
dataStatisticsService
.
countEntrustStatus
(
cycle
,
startDate
,
endDate
);
return
dataStatisticsService
.
countEntrustStatus
(
cycle
,
startDate
,
endDate
,
clientId
,
clientName
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"统计概览-委托单进展统计{}"
,
e
);
}
...
...
@@ -92,19 +94,30 @@ public class DataStatisticsController {
@ApiImplicitParam
(
name
=
"cycle"
,
value
=
"统计周期1:本周 2:本月 3:本年"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"clientId"
,
value
=
"委托单位Id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"clientName"
,
value
=
"委托单位名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/countEntrustPage"
)
public
BaseResponse
countEntrustPage
(
PageQuery
pageQuery
,
Integer
cycle
,
String
startDate
,
String
endDate
,
String
clientName
)
{
public
BaseResponse
countEntrustPage
(
PageQuery
pageQuery
,
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
)
{
try
{
return
dataStatisticsService
.
countEntrustPage
(
pageQuery
,
cycle
,
startDate
,
endDate
,
clientName
);
return
dataStatisticsService
.
countEntrustPage
(
pageQuery
,
cycle
,
startDate
,
endDate
,
client
Id
,
client
Name
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"委托单进展统计-列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
//todo 委托单进展统计-列表导出
@ApiOperation
(
"列表导出-委托单进展统计"
)
@PostMapping
(
"/exportEntrustList"
)
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
);
}
}
@ApiOperation
(
value
=
"统计概览-进行中任务数量统计"
)
@GetMapping
(
"/countTaskIng"
)
...
...
@@ -153,8 +166,16 @@ public class DataStatisticsController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
//todo 检测项"检测项统计-列表导出
@ApiOperation
(
"列表导出-检测项统计"
)
@PostMapping
(
"/exportTeamList"
)
public
void
exportTeamList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
String
fileName
,
HttpServletResponse
response
)
{
try
{
dataStatisticsService
.
exportTeamList
(
cycle
,
startDate
,
endDate
,
fileName
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测项统计-列表导出{}"
,
e
);
}
}
@ApiOperation
(
value
=
"各委托单位项目数量统计"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
d832aad3
...
...
@@ -601,6 +601,18 @@ public class EntrustController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"检测结果查看附件(只显示公开的附件)"
)
@GetMapping
(
"/getClientEnclosureList"
)
public
BaseResponse
getClientEnclosureList
(
Integer
sampleDistributionId
)
{
try
{
return
entrustService
.
getClientEnclosureList
(
sampleDistributionId
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测结果查看附件(只显示公开的附件){}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"样品检测/校核上传附件"
)
@PostMapping
(
"/uploadEnclosurePF"
)
public
BaseResponse
uploadEnclosurePF
(
SampleHandleEnclosureQuery
query
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SampleDistributionEnclosure.java
View file @
d832aad3
...
...
@@ -34,6 +34,7 @@ public class SampleDistributionEnclosure implements Serializable {
*/
private
Integer
sampleDistributionId
;
/**
* 处理项表id
*/
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/DataStatisticsMapper.java
View file @
d832aad3
...
...
@@ -30,12 +30,16 @@ public interface DataStatisticsMapper {
List
<
DataStatisticsVo
>
countTeamByOrigin
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
Integer
countEntrustSumNum
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
DataStatisticsVo
>
countEntrustStatus
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
DataStatisticsVo
>
countEntrustType
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
IPage
<
EntrustVo
>
countEntrustPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
exportEntrustList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
IPage
<
DataStatisticsVo
>
countHandlePage
(
@Param
(
"page"
)
Page
page
);
Integer
countHandleWeek
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"weekType"
)
Integer
weekType
);
...
...
@@ -50,9 +54,7 @@ public interface DataStatisticsMapper {
IPage
<
DataStatisticsTeamVo
>
countTeamPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
exportTeamList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
Integer
countEntrustNum
(
@Param
(
"teamId"
)
Integer
teamId
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/EntrustMapper.java
View file @
d832aad3
...
...
@@ -50,4 +50,6 @@ public interface EntrustMapper extends BaseMapper<Entrust> {
IPage
<
SampleReturnHandleVo
>
getSampleReturnDistributioPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
IPage
<
EntrustVo
>
getSampleReturnCheckPage
(
@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 @
d832aad3
...
...
@@ -21,10 +21,9 @@
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.
endDate = null and params.endDate
= null"
>
<if
test=
"params.
startDate == null and params.endDate =
= null"
>
and date(sd.create_time) > date_sub(curdate(),interval 30 day)
</if>
group by name
</select>
...
...
@@ -52,6 +51,26 @@
group by s.origin
</select>
<select
id=
"countEntrustSumNum"
resultType=
"integer"
>
SELECT count(*)
FROM entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<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>
<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>
</select>
<select
id=
"countEntrustStatus"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT (
...
...
@@ -71,6 +90,7 @@
) as name,
count(*) as value
FROM entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
...
...
@@ -86,6 +106,12 @@
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
<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>
group by e.status
</select>
...
...
@@ -93,6 +119,7 @@
<select
id=
"countEntrustType"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
select e.project_type as name, count(*) as value
from entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
...
...
@@ -109,6 +136,12 @@
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
<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>
group by e.project_type
</select>
...
...
@@ -125,6 +158,7 @@
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
WHEN 9 THEN '修改待确认'
ELSE ''
END
) as statusValue
...
...
@@ -133,6 +167,9 @@
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
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>
...
...
@@ -145,6 +182,54 @@
order by create_time desc
</select>
<select
id=
"exportEntrustList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
e.id as entrustId,
IF(ISNULL(e.entrust_code),'',e.entrust_code) as 委托单号,
IF(ISNULL(p.name),'',p.name) as 项目名称,
IF(ISNULL(p.name),'',p.name) as 项目编号,
e.project_type 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 '修改待确认'
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
...
...
@@ -249,6 +334,31 @@
group by sd.team_id
</select>
<select
id=
"exportTeamList"
resultType=
"java.util.HashMap"
>
SELECT (@i:=@i+1) as 序号,t.id as id, t.name as 检测项目, count(*) as 检测项数量
FROM sample_distribution sd
left join team t on t.id = sd.team_id
,(select @i:=0)t
where 1=1
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.startDate != null and params.startDate != ''"
>
and DATE(sd.create_time)
>
= #{params.startDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
group by sd.team_id
order by 序号
</select>
<select
id=
"countEntrustNum"
resultType=
"integer"
>
select count(*) as entrustNum from (
SELECT sd.entrust_id as id, count(*) as entrustNum FROM sample_distribution sd
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
d832aad3
...
...
@@ -72,7 +72,7 @@
SELECT
(@i:=@i+1) as 序号,
e.id as entrustId,
IF(ISNULL(e.entrust_code),'',e.entrust_code) as 委托
编
号,
IF(ISNULL(e.entrust_code),'',e.entrust_code) as 委托
单
号,
(
CASE e.is_urgent
WHEN 0 THEN '不加急'
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleDistributionEnclosureMapper.xml
View file @
d832aad3
...
...
@@ -19,9 +19,13 @@
<if
test=
"params.userId != null"
>
and t.user_id = #{params.userId}
</if>
<if
test=
"params.isPublic != null"
>
and t.is_public = #{params.isPublic}
</if>
order by t.id ASC
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/service/IDataStatisticsService.java
View file @
d832aad3
...
...
@@ -32,9 +32,12 @@ public interface IDataStatisticsService {
BaseResponse
<
List
<
DataStatisticsVo
>>
countTeamByOrigin
(
Integer
cycle
,
String
startDate
,
String
endDate
);
BaseResponse
<
Map
<
String
,
Object
>>
countEntrustStatus
(
Integer
cycle
,
String
startDate
,
String
endDate
);
BaseResponse
<
Map
<
String
,
Object
>>
countEntrustStatus
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
);
BaseResponse
<
IPage
<
EntrustVo
>>
countEntrustPage
(
PageQuery
pageQuery
,
Integer
cycle
,
String
startDate
,
String
endDate
,
String
clientName
);
BaseResponse
<
IPage
<
EntrustVo
>>
countEntrustPage
(
PageQuery
pageQuery
,
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
);
void
exportEntrustList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
clientName
,
String
fileName
,
HttpServletResponse
response
);
BaseResponse
<
Map
<
String
,
Object
>>
countTaskIng
(
PageQuery
pageQuery
);
...
...
@@ -44,6 +47,8 @@ public interface IDataStatisticsService {
BaseResponse
<
IPage
<
DataStatisticsTeamVo
>>
countTeamList
(
PageQuery
pageQuery
,
Integer
cycle
,
String
startDate
,
String
endDate
);
void
exportTeamList
(
Integer
cycle
,
String
startDate
,
String
endDate
,
String
fileName
,
HttpServletResponse
response
);
BaseResponse
<
List
<
DataStatisticsVo
>>
countByClient
();
/**
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
d832aad3
...
...
@@ -110,6 +110,8 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse
<
List
<
SampleDistributionEnclosureVo
>>
getSampleDistributionEnclosureList
(
Integer
sampleDistributionId
);
BaseResponse
<
List
<
SampleDistributionEnclosureVo
>>
getClientEnclosureList
(
Integer
sampleDistributionId
);
BaseResponse
<
SampleDistributionEnclosure
>
uploadEnclosurePF
(
SampleHandleEnclosureQuery
query
);
BaseResponse
<
String
>
deleteEnclosure
(
Integer
id
,
Integer
type
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
d832aad3
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
d832aad3
...
...
@@ -1107,7 +1107,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List
<
SampleDistributionTeamVo
>
sdtvList
=
sampleTeamGroupVo2
.
getSampleDistributionTeamVoList
();
sdtvList
.
add
(
sampleDistributionTeamVo
);
sampleTeamGroupVo2
.
setSampleDistributionTeamVoList
(
sdtvList
);
sampleTeamGroupVoListed
.
add
(
sampleTeamGroupVo2
);
//
sampleTeamGroupVoListed.add(sampleTeamGroupVo2);
}
}
sampleVo
.
setSampleTeamGroupVoList
(
sampleTeamGroupVoListed
);
...
...
@@ -3655,6 +3655,59 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
okData
(
list
);
}
/**
* 检测结果查看附件 (平行样的样品附件 也都展示在一个检测项下面里面)
* @param sampleDistributionId
* @return
*/
@Override
public
BaseResponse
<
List
<
SampleDistributionEnclosureVo
>>
getClientEnclosureList
(
Integer
sampleDistributionId
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
sampleDistributionId
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sampleDistributionId"
,
sampleDistributionId
);
params
.
put
(
"isPublic"
,
1
);
List
<
SampleDistributionEnclosureVo
>
list
=
sampleDistributionEnclosureMapper
.
getList
(
params
);
//如果有平行样
SampleDistribution
sampleDistribution
=
distributionMapper
.
selectById
(
sampleDistributionId
);
Sample
sample
=
sampleMapper
.
selectById
(
sampleDistribution
.
getSampleId
());
List
<
Sample
>
otherSampleList
=
sampleMapper
.
getOtherSampleList
(
sampleDistribution
.
getEntrustId
(),
sample
.
getCementCode
(),
sample
.
getId
());
if
(
otherSampleList
!=
null
&&
otherSampleList
.
size
()>
0
){
for
(
Sample
s
:
otherSampleList
){
QueryWrapper
<
SampleDistribution
>
sdWrapper
=
new
QueryWrapper
<>();
sdWrapper
.
eq
(
"entrust_id"
,
sampleDistribution
.
getEntrustId
());
sdWrapper
.
eq
(
"sample_id"
,
s
.
getId
());
sdWrapper
.
eq
(
"team_group_id"
,
sampleDistribution
.
getTeamGroupId
());
sdWrapper
.
eq
(
"team_id"
,
sampleDistribution
.
getTeamId
());
List
<
SampleDistribution
>
sdList
=
distributionMapper
.
selectList
(
sdWrapper
);
if
(
sdList
!=
null
&&
sdList
.
size
()>
0
){
for
(
SampleDistribution
sd
:
sdList
){
Map
<
String
,
Object
>
params2
=
new
HashMap
<>();
params2
.
put
(
"sampleDistributionId"
,
sd
.
getId
());
params
.
put
(
"isPublic"
,
1
);
List
<
SampleDistributionEnclosureVo
>
sdevList
=
sampleDistributionEnclosureMapper
.
getList
(
params2
);
if
(
sdevList
!=
null
&&
sdevList
.
size
()>
0
){
for
(
SampleDistributionEnclosureVo
sdev
:
sdevList
){
list
.
add
(
sdev
);
}
}
}
}
}
}
return
BaseResponse
.
okData
(
list
);
}
/**
* 样品处理上传附件
*
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PrecipriceServiceImpl.java
View file @
d832aad3
...
...
@@ -5,21 +5,10 @@ import cn.hutool.core.collection.CollectionUtil;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.Entrust
;
import
cn.wise.sc.cement.business.entity.Handle
;
import
cn.wise.sc.cement.business.entity.NonStandardApply
;
import
cn.wise.sc.cement.business.entity.NonStandardValue
;
import
cn.wise.sc.cement.business.entity.NormProduction
;
import
cn.wise.sc.cement.business.entity.NormProductionStatistics
;
import
cn.wise.sc.cement.business.entity.Preciprice
;
import
cn.wise.sc.cement.business.entity.Sample
;
import
cn.wise.sc.cement.business.entity.SampleDistribution
;
import
cn.wise.sc.cement.business.entity.SysGroup
;
import
cn.wise.sc.cement.business.entity.SysPost
;
import
cn.wise.sc.cement.business.entity.SysUser
;
import
cn.wise.sc.cement.business.entity.TeamGroup
;
import
cn.wise.sc.cement.business.entity.*
;
import
cn.wise.sc.cement.business.mapper.EntrustMapper
;
import
cn.wise.sc.cement.business.mapper.PrecipriceMapper
;
import
cn.wise.sc.cement.business.mapper.ProjectMapper
;
import
cn.wise.sc.cement.business.mapper.SampleMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
...
...
@@ -104,6 +93,10 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
PrecipriceMapper
precipriceMapper
;
@Resource
private
SampleMapper
sampleMapper
;
@Resource
private
EntrustMapper
entrustMapper
;
@Resource
private
ProjectMapper
projectMapper
;
public
PrecipriceServiceImpl
(
EntrustMapper
iEntrustService
,
...
...
@@ -621,6 +614,16 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
rts
.
setCementCode
(
sample
.
getCementCode
());
}
}
//增加项目信息
if
(
preciprice
.
getEntrustId
()
!=
null
){
Entrust
entrust
=
entrustMapper
.
selectById
(
preciprice
.
getEntrustId
());
if
(
entrust
!=
null
&&
entrust
.
getProjectId
()
!=
null
){
Project
project
=
projectMapper
.
selectById
(
entrust
.
getProjectId
());
if
(
project
!=
null
&&
project
.
getName
()
!=
null
){
rts
.
setProjectName
(
project
.
getName
());
}
}
}
rts
.
setAssessId
(
preciprice
.
getTargetId
());
rts
.
setWorkTimeCoefficient
(
preciprice
.
getPreciprice
());
rts
.
setCheckTime
(
getDateTimeOfTimestamp
(
preciprice
.
getCreateTime
()));
...
...
cement-business/target/classes/cn/wise/sc/cement/business/mapper/DataStatisticsMapper.xml
View file @
d832aad3
...
...
@@ -21,10 +21,9 @@
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
<if
test=
"params.
endDate = null and params.endDate
= null"
>
<if
test=
"params.
startDate == null and params.endDate =
= null"
>
and date(sd.create_time) > date_sub(curdate(),interval 30 day)
</if>
group by name
</select>
...
...
@@ -52,6 +51,26 @@
group by s.origin
</select>
<select
id=
"countEntrustSumNum"
resultType=
"integer"
>
SELECT count(*)
FROM entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<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>
<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>
</select>
<select
id=
"countEntrustStatus"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
SELECT (
...
...
@@ -71,6 +90,7 @@
) as name,
count(*) as value
FROM entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
...
...
@@ -86,6 +106,12 @@
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
<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>
group by e.status
</select>
...
...
@@ -93,6 +119,7 @@
<select
id=
"countEntrustType"
resultType=
"cn.wise.sc.cement.business.model.vo.DataStatisticsVo"
>
select e.project_type as name, count(*) as value
from entrust e
left join client c on c.id = e.client_id
where e.status != 0 and e.project_type is not null
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(e.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
...
...
@@ -109,6 +136,12 @@
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.create_time)
<
= #{params.endDate}
</if>
<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>
group by e.project_type
</select>
...
...
@@ -125,6 +158,7 @@
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
WHEN 9 THEN '修改待确认'
ELSE ''
END
) as statusValue
...
...
@@ -133,6 +167,9 @@
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
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>
...
...
@@ -145,6 +182,54 @@
order by create_time desc
</select>
<select
id=
"exportEntrustList"
resultType=
"java.util.HashMap"
>
SELECT
(@i:=@i+1) as 序号,
e.id as entrustId,
IF(ISNULL(e.entrust_code),'',e.entrust_code) as 委托单号,
IF(ISNULL(p.name),'',p.name) as 项目名称,
IF(ISNULL(p.name),'',p.name) as 项目编号,
e.project_type 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 '修改待确认'
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
...
...
@@ -249,6 +334,31 @@
group by sd.team_id
</select>
<select
id=
"exportTeamList"
resultType=
"java.util.HashMap"
>
SELECT (@i:=@i+1) as 序号,t.id as id, t.name as 检测项目, count(*) as 检测项数量
FROM sample_distribution sd
left join team t on t.id = sd.team_id
,(select @i:=0)t
where 1=1
<if
test=
"params.cycle == 1 "
>
and YEARWEEK(date_format(sd.create_time,'%Y-%m-%d' ) ) = YEARWEEK(now())
</if>
<if
test=
"params.cycle == 2 "
>
and DATE_FORMAT( sd.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE( ) ,'%Y%m')
</if>
<if
test=
"params.cycle == 3 "
>
and YEAR(sd.create_time) = YEAR( NOW( ) )
</if>
<if
test=
"params.startDate != null and params.startDate != ''"
>
and DATE(sd.create_time)
>
= #{params.startDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(sd.create_time)
<
= #{params.endDate}
</if>
group by sd.team_id
order by 序号
</select>
<select
id=
"countEntrustNum"
resultType=
"integer"
>
select count(*) as entrustNum from (
SELECT sd.entrust_id as id, count(*) as entrustNum FROM sample_distribution sd
...
...
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