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
0366eb59
Commit
0366eb59
authored
Oct 21, 2020
by
qinhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql优化
parent
4d16adfe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
38 deletions
+14
-38
NormProductionController.java
.../cement/business/controller/NormProductionController.java
+0
-1
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+4
-19
SampleHandleMapper.xml
...wise/sc/cement/business/mapper/xml/SampleHandleMapper.xml
+8
-6
NormProductionServiceImpl.java
...ment/business/service/impl/NormProductionServiceImpl.java
+2
-6
QualityApplyServiceImpl.java
...cement/business/service/impl/QualityApplyServiceImpl.java
+0
-6
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NormProductionController.java
View file @
0366eb59
...
@@ -184,7 +184,6 @@ public class NormProductionController {
...
@@ -184,7 +184,6 @@ public class NormProductionController {
return
BaseResponse
.
okData
(
PageUtil
.
listConvertToPage
(
rts
,
pageQuery
));
return
BaseResponse
.
okData
(
PageUtil
.
listConvertToPage
(
rts
,
pageQuery
));
}
}
@PostMapping
(
"/export/statistics"
)
@PostMapping
(
"/export/statistics"
)
@ApiOperation
(
"导出标准产值列表"
)
@ApiOperation
(
"导出标准产值列表"
)
public
void
exportNormProductionStatistics
(
String
start
,
String
end
,
String
name
,
Integer
groupId
,
HttpServletResponse
response
)
{
public
void
exportNormProductionStatistics
(
String
start
,
String
end
,
String
name
,
Integer
groupId
,
HttpServletResponse
response
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
0366eb59
...
@@ -100,22 +100,6 @@
...
@@ -100,22 +100,6 @@
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.*,
select e.*,
(
(
...
@@ -238,6 +222,7 @@
...
@@ -238,6 +222,7 @@
<include
refid=
"checkWhere"
/>
<include
refid=
"checkWhere"
/>
order by e.update_time desc
order by e.update_time desc
</select>
</select>
<select
id=
"getReportDetail"
resultType=
"cn.wise.sc.cement.business.entity.EntrustReport"
>
<select
id=
"getReportDetail"
resultType=
"cn.wise.sc.cement.business.entity.EntrustReport"
>
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
RIGHT JOIN
RIGHT JOIN
...
@@ -250,6 +235,7 @@
...
@@ -250,6 +235,7 @@
ON sct.check_id = sc.id ) scct
ON sct.check_id = sc.id ) scct
ON s.id = scct.sample_id) sscct
ON s.id = scct.sample_id) sscct
ON sscct.entrust_id = e.id
ON sscct.entrust_id = e.id
WHERE e.id IS NOT NULL
</select>
</select>
<select
id=
"getQualityDetail"
resultType=
"cn.wise.sc.cement.business.entity.QualityDetail"
>
<select
id=
"getQualityDetail"
resultType=
"cn.wise.sc.cement.business.entity.QualityDetail"
>
...
@@ -257,11 +243,11 @@
...
@@ -257,11 +243,11 @@
RIGHT JOIN
RIGHT JOIN
(SELECT count_result as input_result,sample_id,entrust_id,team_group_name,team_group_id,user_id FROM sample_check sc
(SELECT count_result as input_result,sample_id,entrust_id,team_group_name,team_group_id,user_id FROM sample_check sc
RIGHT JOIN
RIGHT JOIN
(SELECT * FROM sample_check_team) sct
(SELECT * FROM sample_check_team) sct
ON sct.check_id = sc.id WHERE sc.entrust_id = #{entrustId}) sscct
ON sct.check_id = sc.id WHERE sc.entrust_id = #{entrustId}) sscct
ON e.id = sscct.entrust_id) esscct
ON e.id = sscct.entrust_id) esscct
LEFT JOIN
LEFT JOIN
(SELECT name as sample_name,id,cement_code,sample_form,sample_code FROM sample) s
(SELECT name as sample_name,id,cement_code,sample_form,sample_code FROM sample) s
ON esscct.sample_id = s.id
ON esscct.sample_id = s.id
</select>
</select>
...
@@ -292,5 +278,4 @@
...
@@ -292,5 +278,4 @@
</where>
</where>
</sql>
</sql>
</mapper>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleHandleMapper.xml
View file @
0366eb59
...
@@ -77,12 +77,14 @@
...
@@ -77,12 +77,14 @@
</select>
</select>
<select
id=
"getEntrustSample"
resultType=
"cn.wise.sc.cement.business.entity.EntrustSample"
>
<select
id=
"getEntrustSample"
resultType=
"cn.wise.sc.cement.business.entity.EntrustSample"
>
SELECT e.project_name,e.entrust_code,g.distribution_id,g.entrust_id,g.`sample_name`,g.user_id,g.sample_id FROM entrust e
SELECT project_name,entrust_code,h.id,s.entrust_id,h.user_id,s.id as sample_id,e.status FROM entrust e
RIGHT JOIN
LEFT JOIN
(SELECT s.`name` as sample_name,d.distribution_id,s.entrust_id,d.user_id,s.id as sample_id FROM sample s
(SELECT * FROM sample) s
RIGHT JOIN
ON e.id = s.entrust_id
(SELECT user_id, id as distribution_id,sample_id FROM sample_handle ) d
LEFT JOIN
on s.id = d.sample_id ) g ON g.entrust_id = e.id
(SELECT * FROM sample_handle) h
ON h.sample_id = s.id
WHERE e.status > 4 AND h.id IS NOT NULL
</select>
</select>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NormProductionServiceImpl.java
View file @
0366eb59
...
@@ -594,7 +594,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -594,7 +594,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
@Override
@Override
public
List
<
WorkloadStatisticsVo
>
workloadStatistics
(
Date
startTime
,
Date
endTime
)
{
public
List
<
WorkloadStatisticsVo
>
workloadStatistics
(
Date
startTime
,
Date
endTime
)
{
long
start
=
getDefaultStart
(
startTime
==
null
?
0
:
startTime
.
getTime
());
long
start
=
getDefaultStart
(
startTime
==
null
?
0
:
startTime
.
getTime
());
long
end
=
getDefaultEnd
(
endTime
.
getTime
());
long
end
=
getDefaultEnd
(
endTime
.
getTime
());
Map
<
String
,
Integer
>
map1
=
initMonthMoneyMap
(
start
,
end
);
Map
<
String
,
Integer
>
map1
=
initMonthMoneyMap
(
start
,
end
);
...
@@ -608,7 +607,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -608,7 +607,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
qw
.
eq
(
"status"
,
2
);
qw
.
eq
(
"status"
,
2
);
List
<
SampleDistribution
>
sampleDistributions
=
iSampleDistributionService
.
list
(
qw
);
List
<
SampleDistribution
>
sampleDistributions
=
iSampleDistributionService
.
list
(
qw
);
//脾气比能力大 蠢货
QueryWrapper
<
NonStandardApply
>
qwA
=
new
QueryWrapper
<>();
QueryWrapper
<
NonStandardApply
>
qwA
=
new
QueryWrapper
<>();
if
(
startTime
!=
null
)
{
if
(
startTime
!=
null
)
{
qwA
.
ge
(
"start_time"
,
DateUtil
.
format
(
DateUtil
.
date
(
start
),
"yyyy-MM-dd"
));
qwA
.
ge
(
"start_time"
,
DateUtil
.
format
(
DateUtil
.
date
(
start
),
"yyyy-MM-dd"
));
...
@@ -617,7 +616,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -617,7 +616,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
qwA
.
eq
(
"status"
,
2
);
qwA
.
eq
(
"status"
,
2
);
List
<
NonStandardApply
>
nonStandardApplies
=
iNonStandardApplyService
.
list
(
qwA
);
List
<
NonStandardApply
>
nonStandardApplies
=
iNonStandardApplyService
.
list
(
qwA
);
for
(
SampleDistribution
sampleDistribution
:
sampleDistributions
)
{
for
(
SampleDistribution
sampleDistribution
:
sampleDistributions
)
{
addCount
(
sampleDistribution
.
getFinishTime
(),
map1
);
addCount
(
sampleDistribution
.
getFinishTime
(),
map1
);
}
}
...
@@ -641,13 +639,11 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -641,13 +639,11 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
private
void
addCount
(
LocalDateTime
date
,
Map
<
String
,
Integer
>
map
)
{
private
void
addCount
(
LocalDateTime
date
,
Map
<
String
,
Integer
>
map
)
{
Date
nextDate
=
DateUtil
.
endOfMonth
(
asDate
(
date
));
Date
nextDate
=
DateUtil
.
endOfMonth
(
asDate
(
date
));
map
.
put
(
nextDate
.
getMonth
()
+
1
+
""
,
map
.
get
(
nextDate
.
getMonth
()
+
1
+
""
)
+
1
);
map
.
put
(
nextDate
.
getMonth
()
+
1
+
""
,
map
.
get
(
nextDate
.
getMonth
()
+
1
+
""
)
+
1
);
}
}
private
void
addCount
(
LocalDate
date
,
Map
<
String
,
Integer
>
map
)
{
private
void
addCount
(
LocalDate
date
,
Map
<
String
,
Integer
>
map
)
{
Date
nextDate
=
DateUtil
.
endOfMonth
(
asDate
(
date
));
Date
nextDate
=
DateUtil
.
endOfMonth
(
asDate
(
date
));
map
.
put
(
nextDate
.
getMonth
()
+
1
+
""
,
map
.
get
(
nextDate
.
getMonth
()
+
1
+
""
)
+
1
);
map
.
put
(
nextDate
.
getMonth
()
+
1
+
""
,
map
.
get
(
nextDate
.
getMonth
()
+
1
+
""
)
+
1
);
}
}
private
static
Date
asDate
(
LocalDate
localDate
)
{
private
static
Date
asDate
(
LocalDate
localDate
)
{
...
@@ -907,7 +903,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -907,7 +903,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
}
}
/**
/**
* 计算标准产值的工时标准系数
* 计算标准产值的工时标准系数
plan
* 额定工日*建议系数/报出对应分析结果*考核工值*分析占比
* 额定工日*建议系数/报出对应分析结果*考核工值*分析占比
*
*
* @param normProduction 标准产值配置对象 如:六元素
* @param normProduction 标准产值配置对象 如:六元素
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/QualityApplyServiceImpl.java
View file @
0366eb59
...
@@ -12,12 +12,7 @@ import cn.wise.sc.cement.business.util.RedisUtil;
...
@@ -12,12 +12,7 @@ import cn.wise.sc.cement.business.util.RedisUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.Data
;
import
org.apache.poi.ss.usermodel.Header
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -117,7 +112,6 @@ public class QualityApplyServiceImpl extends ServiceImpl<QualityApplyMapper, Qua
...
@@ -117,7 +112,6 @@ public class QualityApplyServiceImpl extends ServiceImpl<QualityApplyMapper, Qua
return
;
return
;
}
}
for
(
Integer
projectId
:
projectIds
)
{
for
(
Integer
projectId
:
projectIds
)
{
//找到每个项目的检测组 以检测组归类
//找到每个项目的检测组 以检测组归类
Set
<
Integer
>
teamIds
=
list
.
stream
()
Set
<
Integer
>
teamIds
=
list
.
stream
()
...
...
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