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
9336156b
Commit
9336156b
authored
Sep 28, 2020
by
qinhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标准产值--联调
parent
34f88986
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
733 additions
and
94 deletions
+733
-94
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+0
-6
NormProductionController.java
.../cement/business/controller/NormProductionController.java
+48
-8
QualityController.java
...wise/sc/cement/business/controller/QualityController.java
+56
-0
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+91
-0
EntrustReport.java
...java/cn/wise/sc/cement/business/entity/EntrustReport.java
+87
-0
SampleCheckTeam.java
...va/cn/wise/sc/cement/business/entity/SampleCheckTeam.java
+13
-16
EntrustMapper.java
...java/cn/wise/sc/cement/business/mapper/EntrustMapper.java
+3
-0
SampleCheckTeamMapper.java
...wise/sc/cement/business/mapper/SampleCheckTeamMapper.java
+2
-1
SampleHandleMapper.java
...cn/wise/sc/cement/business/mapper/SampleHandleMapper.java
+2
-0
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+46
-31
SampleCheckTeamQuery.java
.../sc/cement/business/model/query/SampleCheckTeamQuery.java
+1
-3
NormProductionVo.java
...cn/wise/sc/cement/business/model/vo/NormProductionVo.java
+94
-0
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+4
-1
INormProductionService.java
...se/sc/cement/business/service/INormProductionService.java
+6
-4
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+130
-0
NormProductionServiceImpl.java
...ment/business/service/impl/NormProductionServiceImpl.java
+127
-24
PageUtil.java
...c/main/java/cn/wise/sc/cement/business/util/PageUtil.java
+23
-0
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.Project
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.models.auth.In
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NormProductionController.java
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.NormProduction
;
import
cn.wise.sc.cement.business.entity.NormProductionStatistics
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.service.INormProductionService
;
import
cn.wise.sc.cement.business.util.PageUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
...
...
@@ -14,6 +24,7 @@ import org.springframework.web.bind.annotation.PutMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
/**
...
...
@@ -44,7 +55,7 @@ public class NormProductionController {
@GetMapping
(
"/page"
)
@ApiOperation
(
"分页查询"
)
public
BaseResponse
<
IPage
<
NormProduction
>>
page
(
PageQuery
pageQuery
)
{
public
BaseResponse
<
IPage
<
NormProduction
Vo
>>
page
(
PageQuery
pageQuery
)
{
return
iNormProductionService
.
getPage
(
pageQuery
);
}
...
...
@@ -57,11 +68,11 @@ public class NormProductionController {
@GetMapping
(
"/{id}"
)
@ApiOperation
(
"根据id获取标准产值配置"
)
public
BaseResponse
<
NormProduction
>
getById
(
@PathVariable
(
"id"
)
Integer
id
)
{
if
(
id
==
null
||
id
<=
0
)
{
return
BaseResponse
.
errorMsg
(
"id不能为空!"
);
}
NormProduction
rts
=
iNormProductionService
.
getById
(
id
);
if
(
rts
!=
null
)
{
return
BaseResponse
.
okData
(
rts
);
}
else
{
...
...
@@ -79,18 +90,47 @@ public class NormProductionController {
return
iNormProductionService
.
activeOrForbidden
(
id
);
}
@GetMapping
(
"/statistics"
)
@ApiOperation
(
"标准产值统计"
)
public
BaseResponse
normProductionStatistics
(
Long
start
,
Long
end
)
{
return
iNormProductionService
.
normProductionStatistics
(
start
,
end
);
public
BaseResponse
normProductionStatistics
(
String
start
,
String
end
,
String
name
,
PageQuery
pageQuery
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
//将list拆分成分页
BaseResponse
<
List
<
NormProductionStatistics
>>
baseResponse
=
iNormProductionService
.
normProductionStatistics
(
startTime
,
endTime
,
name
);
if
(
baseResponse
.
getCode
()
==
200
)
{
List
<
NormProductionStatistics
>
data
=
baseResponse
.
getData
();
if
(
data
.
size
()
!=
0
)
{
Page
<
NormProductionStatistics
>
rts
=
PageUtil
.
listConvertToPage
(
data
,
pageQuery
);
return
BaseResponse
.
okData
(
rts
);
}
}
return
baseResponse
;
}
@GetMapping
(
"/statistics/detail"
)
public
BaseResponse
<
List
<
NormProduction
.
NormProductionDetail
>>
normProductionDetails
(
Integer
userId
,
Long
start
,
Long
end
)
{
List
<
NormProduction
.
NormProductionDetail
>
rts
=
iNormProductionService
.
normProductionDetails
(
userId
,
start
,
end
);
@ApiOperation
(
"标准产值详情"
)
public
BaseResponse
normProductionDetails
(
Integer
userId
,
String
start
,
String
end
,
PageQuery
pageQuery
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
List
<
NormProduction
.
NormProductionDetail
>
data
=
iNormProductionService
.
normProductionDetails
(
userId
,
startTime
,
endTime
);
if
(
data
.
size
()
!=
0
)
{
Page
<
NormProduction
.
NormProductionDetail
>
rts
=
PageUtil
.
listConvertToPage
(
data
,
pageQuery
);
return
BaseResponse
.
okData
(
rts
);
}
return
BaseResponse
.
okData
(
data
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/QualityController.java
0 → 100644
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.EntrustReport
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
cn.wise.sc.cement.business.util.PageUtil
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @description: Quality
* @author: qh
* @create: 2020-09-28 09:49
**/
@Api
(
tags
=
"质量管理"
)
@Slf4j
@RestController
@RequestMapping
(
"/business/quality"
)
public
class
QualityController
{
final
IEntrustService
iEntrustService
;
public
QualityController
(
IEntrustService
iEntrustService
)
{
this
.
iEntrustService
=
iEntrustService
;
}
@GetMapping
(
"/{entrustId}"
)
@ApiOperation
(
"获取报告详情"
)
public
BaseResponse
<
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
<
EntrustReport
>>
getReportDetail
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
PageQuery
pageQuery
)
{
List
<
EntrustReport
>
entrustReports
=
iEntrustService
.
getReportDetail
(
entrustId
);
if
(
entrustReports
.
size
()
!=
0
)
{
//过滤 id==null 和 projectType != '常规项目'
List
<
EntrustReport
>
list
=
entrustReports
.
stream
()
.
filter
(
arg
->
arg
.
getId
()
!=
null
&&
"质量控制"
.
equals
(
arg
.
getProjectType
()))
.
collect
(
Collectors
.
toList
());
Page
<
EntrustReport
>
rts
=
PageUtil
.
listConvertToPage
(
list
,
pageQuery
);
return
BaseResponse
.
okData
(
rts
);
}
return
BaseResponse
.
errorMsg
(
"没找到相关数据!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
0 → 100644
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.entity.EntrustReport
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.service.IEntrustService
;
import
cn.wise.sc.cement.business.util.PageUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @description: 报告管理
* @author: qh
* @create: 2020-09-25 14:37
**/
@Api
(
tags
=
"报告管理"
)
@Slf4j
@RestController
@RequestMapping
(
"/business/report"
)
public
class
ReportController
{
final
IEntrustService
iEntrustService
;
public
ReportController
(
IEntrustService
iEntrustService
)
{
this
.
iEntrustService
=
iEntrustService
;
}
@ApiOperation
(
value
=
"委托分页列表"
)
@ApiImplicitParams
(
value
=
{
@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
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
<
IPage
<
EntrustVo
>>
page
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
return
iEntrustService
.
getReportPage
(
pageQuery
,
startDate
,
endDate
,
clientId
,
projectName
,
projectCode
);
}
@ApiOperation
(
value
=
"置顶取消置顶 (createTime = updateTime显示置顶,否则显示取消置顶)"
)
@PostMapping
(
"/setTopping"
)
public
BaseResponse
<
String
>
setTopping
(
Integer
id
)
{
try
{
return
iEntrustService
.
setTopping
(
id
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"置顶取消置顶 {}"
,
e
.
getMessage
());
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@DeleteMapping
(
"/{id}"
)
@ApiOperation
(
"删除报告"
)
public
BaseResponse
<
Boolean
>
deleteById
(
@PathVariable
(
"id"
)
Integer
id
)
{
return
iEntrustService
.
deleteById
(
id
);
}
@GetMapping
(
"/{entrustId}"
)
@ApiOperation
(
"获取报告详情"
)
public
BaseResponse
<
Page
<
EntrustReport
>>
getReportDetail
(
@PathVariable
(
"entrustId"
)
Integer
entrustId
,
PageQuery
pageQuery
)
{
List
<
EntrustReport
>
entrustReports
=
iEntrustService
.
getReportDetail
(
entrustId
);
if
(
entrustReports
.
size
()
!=
0
)
{
//过滤 id==null 和 projectType != '常规项目'
List
<
EntrustReport
>
list
=
entrustReports
.
stream
()
.
filter
(
arg
->
arg
.
getId
()
!=
null
&&
"常规项目"
.
equals
(
arg
.
getProjectType
()))
.
collect
(
Collectors
.
toList
());
Page
<
EntrustReport
>
rts
=
PageUtil
.
listConvertToPage
(
list
,
pageQuery
);
return
BaseResponse
.
okData
(
rts
);
}
return
BaseResponse
.
errorMsg
(
"没找到相关数据!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/EntrustReport.java
0 → 100644
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
lombok.Data
;
/**
* @description: 委托报告
* @author: qh
* @create: 2020-09-25 20:36
**/
@Data
public
class
EntrustReport
{
private
Integer
id
;
/**
* 项目名字
*/
private
String
projectName
;
/**
* 委托人
*/
private
String
sendName
;
/**
* 委托方id
*/
private
Integer
clintId
;
/**
* 样品id
*/
private
Integer
sampleId
;
/**
* 项目id
*/
private
Integer
entrustId
;
/**
* 检测项目ids
*/
private
String
teamIds
;
/**
* 检测项目
*/
private
String
teamName
;
/**
* 检测依据 ids
*/
private
String
methodNumbers
;
/**
* 检测依据名字
*/
private
String
methodName
;
/**
* 样品名字
*/
private
String
name
;
/**
* 校核id
*/
private
Integer
checkId
;
/**
* 机械仪器名字
*/
private
String
equipmentName
;
/**
* 用户id
*/
private
Integer
userId
;
/**
* 项目编号
*/
private
String
entrustCode
;
/**
* 项目类型
*/
private
String
projectType
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SampleCheckTeam.java
View file @
9336156b
...
...
@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
...
...
@@ -23,7 +22,7 @@ import lombok.experimental.Accessors;
@Accessors
(
chain
=
true
)
public
class
SampleCheckTeam
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
...
...
@@ -48,7 +47,7 @@ public class SampleCheckTeam implements Serializable {
/**
* json串
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*/
@ApiModelProperty
(
"校核人员输入检测结果 json串"
)
private
String
inputResult
;
...
...
@@ -58,6 +57,4 @@ public class SampleCheckTeam implements Serializable {
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/EntrustMapper.java
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.Entrust
;
import
cn.wise.sc.cement.business.entity.EntrustReport
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.model.vo.ProjectVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
...
...
@@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -35,4 +37,5 @@ public interface EntrustMapper extends BaseMapper<Entrust> {
IPage
<
EntrustVo
>
getCheckPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
EntrustReport
>
getReportDetail
(
@Param
(
"entrustId"
)
Integer
entrustId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleCheckTeamMapper.java
View file @
9336156b
...
...
@@ -3,7 +3,7 @@ package cn.wise.sc.cement.business.mapper;
import
cn.wise.sc.cement.business.entity.EntrustSample
;
import
cn.wise.sc.cement.business.entity.SampleCheckTeam
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
...
...
@@ -14,6 +14,7 @@ import java.util.List;
* @author ztw
* @since 2020-08-24
*/
@Mapper
public
interface
SampleCheckTeamMapper
extends
BaseMapper
<
SampleCheckTeam
>
{
List
<
EntrustSample
>
getEntrustSample
();
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleHandleMapper.java
View file @
9336156b
...
...
@@ -7,6 +7,7 @@ import cn.wise.sc.cement.business.model.vo.SampleHandleVo;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.tomcat.jni.Local
;
...
...
@@ -23,6 +24,7 @@ import java.util.Map;
* @author ztw
* @since 2020-08-24
*/
@Mapper
public
interface
SampleHandleMapper
extends
BaseMapper
<
SampleHandle
>
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
9336156b
...
...
@@ -26,6 +26,9 @@
<if
test=
"params.userId != null"
>
and e.user_id = #{params.userId}
</if>
<if
test=
"params.projectType != null and params.projectType != ''"
>
and e.project_type = #{params.projectType}
</if>
</where>
</sql>
...
...
@@ -49,7 +52,7 @@
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
<include
refid=
"where"
/>
<include
refid=
"where"
/>
order by e.is_urgent desc, e.update_time desc
</select>
...
...
@@ -79,7 +82,6 @@
</select>
<select
id=
"getSampleHandlePage"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.id as id, e.sample_num as sampleNum,e.entrust_date as entrustDate,
(
...
...
@@ -174,9 +176,22 @@
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
<include
refid=
"checkWhere"
/>
<include
refid=
"checkWhere"
/>
order by e.update_time desc
</select>
<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
RIGHT JOIN
(SELECT id as sample_id,entrust_id,team_ids,method_numbers,name,scct.check_id,
scct.equipment_name,scct.user_id FROM sample s
RIGHT JOIN
(SELECT check_id,equipment_name,sample_id,user_id FROM sample_check_team sct
LEFT JOIN
(SELECT entrust_id,id FROM sample_check) sc
ON sct.check_id = sc.id) scct
ON s.sample_id = scct.sample_id) sscct
ON sscct.entrust_id = e.id AND e.id = #{entrustId}
</select>
<sql
id=
"checkWhere"
>
<where>
...
...
@@ -203,7 +218,7 @@
and e.user_id = #{params.userId}
</if>
</where>
</sql>
</sql>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleCheckTeamQuery.java
View file @
9336156b
...
...
@@ -39,7 +39,6 @@ public class SampleCheckTeamQuery {
@ApiModelProperty
(
"检测组名称"
)
private
String
teamGroupName
;
@ApiModelProperty
(
"主样-检测人员id"
)
private
Integer
mainUserId
;
...
...
@@ -72,10 +71,9 @@ public class SampleCheckTeamQuery {
private
Integer
secondarySampleId
;
@ApiModelProperty
(
"次样检测结果 Map集合"
)
private
Map
<
String
,
Object
>
secondaryResult
;
private
Map
<
String
,
Object
>
secondaryResult
;
@ApiModelProperty
(
"最终校核计算结果 Map集合"
)
private
Map
<
String
,
Object
>
endResult
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/NormProductionVo.java
0 → 100644
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @description:
* @author: qh
* @create: 2020-09-25 13:54
**/
@Data
public
class
NormProductionVo
{
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 检查组id
*/
@ApiModelProperty
(
"检查组id"
)
private
Integer
assessId
;
/**
* 类型 0:检测组 1:处理项
*/
@ApiModelProperty
(
"类型 0:检测组 1:处理项"
)
private
Integer
type
;
/**
* 定额工日
*/
@ApiModelProperty
(
"定额工日"
)
private
Double
quotaDay
;
/**
* 报出分析结果
*/
@ApiModelProperty
(
"报出分析结果"
)
private
Double
reportedAnalyseResult
;
/**
* 建议系数
*/
@ApiModelProperty
(
"建议系数"
)
private
Double
coefficient
;
/**
* 考核工值
*/
@ApiModelProperty
(
"考核工值"
)
private
Double
assessValue
;
/**
* 分析占比
*/
@ApiModelProperty
(
"分析占比"
)
private
Double
analyseRate
;
/**
* 分样占比
*/
@ApiModelProperty
(
"分样占比"
)
private
Double
separateRate
;
/**
* 考核占比
*/
@ApiModelProperty
(
"考核占比"
)
private
Double
assessRate
;
/**
* 报结果占比
*/
@ApiModelProperty
(
"报结果占比"
)
private
Double
reportedResultRate
;
/**
* 状态
*/
@ApiModelProperty
(
"状态"
)
private
Integer
status
;
/**
* 检测组名字
*/
@ApiModelProperty
(
"检测组名字"
)
private
String
assessName
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.Entrust
;
import
cn.wise.sc.cement.business.entity.EntrustReport
;
import
cn.wise.sc.cement.business.entity.SampleDistribution
;
import
cn.wise.sc.cement.business.entity.SampleHandleEnclosure
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
...
...
@@ -80,7 +81,9 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse
<
String
>
check
(
CheckQuery
query
);
BaseResponse
<
IPage
<
EntrustVo
>>
getReportPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
projectName
,
String
projectCode
);
BaseResponse
<
Boolean
>
deleteById
(
Integer
id
);
List
<
EntrustReport
>
getReportDetail
(
Integer
entrustId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/INormProductionService.java
View file @
9336156b
...
...
@@ -4,8 +4,10 @@ import cn.wise.sc.cement.business.entity.NormProduction;
import
cn.wise.sc.cement.business.entity.NormProductionStatistics
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
...
...
@@ -32,7 +34,7 @@ public interface INormProductionService extends IService<NormProduction> {
* @param pageQuery 分页条件
* @return 数据
*/
BaseResponse
<
IPage
<
NormProduction
>>
getPage
(
PageQuery
pageQuery
);
BaseResponse
<
IPage
<
NormProduction
Vo
>>
getPage
(
PageQuery
pageQuery
);
/**
* 编辑标准产值
...
...
@@ -57,7 +59,7 @@ public interface INormProductionService extends IService<NormProduction> {
* @param end 结束时间
* @return BaseResponse
*/
BaseResponse
<
List
<
NormProductionStatistics
>>
normProductionStatistics
(
Long
start
,
Long
end
);
BaseResponse
<
List
<
NormProductionStatistics
>>
normProductionStatistics
(
Long
start
,
Long
end
,
String
name
);
/**
* 标准产值统计 单人详情
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.*
;
import
cn.wise.sc.cement.business.mapper.*
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
...
...
@@ -11,6 +12,7 @@ import cn.wise.sc.cement.business.service.*;
import
cn.wise.sc.cement.business.util.CheckCountUtil
;
import
cn.wise.sc.cement.business.util.RedisUtil
;
import
cn.wise.sc.cement.business.wrapper.page.Query
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -1553,5 +1555,133 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
okMsg
(
"数据校核完成"
);
}
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getReportPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"status"
,
8
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"projectType"
,
"常规项目"
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"委托评审"
);
if
(
approvalId
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
}
if
(
loginUser
.
getId
()
!=
approvalId
)
{
params
.
put
(
"userId"
,
loginUser
.
getId
());
}
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getPage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
//检测项目名称
String
sampleNames
=
""
;
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
sampleNames
=
sampleNames
.
equals
(
""
)
?
sampleTmp
.
getName
()
:
(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
}
entrustVo
.
setSampleNames
(
sampleNames
);
//检测项 和检测依据 列表里只显示第一个样品的
SampleTmp
sampleTmp
=
sampleTmpList
.
get
(
0
);
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
checkTeam
=
""
;
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
checkTeam
=
checkTeam
.
equals
(
""
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
entrustVo
.
setCheckTeam
(
checkTeam
);
entrustVo
.
setCheckMethodNumber
(
sampleTmp
.
getMethodNumbers
());
}
}
}
pages
.
setRecords
(
list
);
return
BaseResponse
.
okData
(
pages
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
BaseResponse
<
Boolean
>
deleteById
(
Integer
id
)
{
if
(
id
==
null
||
id
<=
0
)
{
return
BaseResponse
.
errorMsg
(
"id编号不能为空!"
);
}
Entrust
entrust
=
this
.
getById
(
id
);
entrust
.
setIsDelete
(
0
);
boolean
b
=
this
.
updateById
(
entrust
);
return
BaseResponse
.
okData
(
b
);
}
@Override
public
List
<
EntrustReport
>
getReportDetail
(
Integer
entrustId
)
{
List
<
EntrustReport
>
list
=
entrustMapper
.
getReportDetail
(
entrustId
);
String
teamKey
=
"CACHE:TEAM"
;
String
methodKey
=
"METHOD:KEY"
;
//缓存 60s
if
(!
redisUtil
.
existsKey
(
teamKey
))
{
List
<
Team
>
teams
=
teamMapper
.
selectList
(
new
QueryWrapper
<>());
String
value
=
JSON
.
toJSONString
(
teams
);
redisUtil
.
setString
(
teamKey
,
value
,
60
);
}
if
(!
redisUtil
.
existsKey
(
methodKey
))
{
List
<
Method
>
methods
=
methodMapper
.
selectList
(
new
QueryWrapper
<>());
String
value
=
JSON
.
toJSONString
(
methods
);
redisUtil
.
setString
(
methodKey
,
value
,
60
);
}
List
<
Team
>
teams
=
JSON
.
parseArray
(
redisUtil
.
getString
(
teamKey
)
+
""
,
Team
.
class
);
List
<
Method
>
methods
=
JSON
.
parseArray
(
redisUtil
.
getString
(
methodKey
)
+
""
,
Method
.
class
);
list
.
forEach
(
arg
->
{
String
teamIds
=
arg
.
getTeamIds
();
String
[]
teamSplit
=
teamIds
.
split
(
"、"
);
for
(
String
idStr
:
teamSplit
)
{
int
id
=
Integer
.
parseInt
(
idStr
);
teams
.
forEach
(
opt
->
{
if
(
opt
.
getId
()
==
id
)
{
if
(
StrUtil
.
isBlank
(
arg
.
getTeamName
()))
{
arg
.
setTeamName
(
opt
.
getName
());
}
else
{
arg
.
setTeamName
(
arg
.
getTeamName
()
+
"、"
+
opt
.
getName
());
}
}
});
}
String
methodNumbers
=
arg
.
getMethodNumbers
();
String
[]
methodSplit
=
methodNumbers
.
split
(
"、"
);
for
(
String
idStr
:
methodSplit
)
{
int
id
=
Integer
.
parseInt
(
idStr
);
methods
.
forEach
(
opt
->
{
if
(
opt
.
getId
()
==
id
)
{
if
(
StrUtil
.
isBlank
(
arg
.
getMethodName
()))
{
arg
.
setMethodName
(
opt
.
getName
());
}
else
{
arg
.
setMethodName
(
arg
.
getMethodName
()
+
"、"
+
opt
.
getName
());
}
}
});
}
});
return
list
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NormProductionServiceImpl.java
View file @
9336156b
This diff is collapsed.
Click to expand it.
cement-business/src/main/java/cn/wise/sc/cement/business/util/PageUtil.java
0 → 100644
View file @
9336156b
package
cn
.
wise
.
sc
.
cement
.
business
.
util
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.poi.ss.formula.functions.T
;
import
java.util.List
;
/**
* @description:
* @author: qh
* @create: 2020-09-27 18:19
**/
public
class
PageUtil
{
public
static
<
T
>
Page
<
T
>
listConvertToPage
(
List
<
T
>
list
,
PageQuery
pageQuery
)
{
int
start
=
pageQuery
.
getPageNo
();
int
end
=
Math
.
min
((
start
+
pageQuery
.
getPageSize
()),
list
.
size
());
Page
<
T
>
page
=
new
Page
<>(
start
,
end
,
list
.
size
());
page
.
setRecords
(
list
.
subList
(
start
,
end
));
return
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