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
77b114eb
Commit
77b114eb
authored
Sep 29, 2020
by
qinhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
质量控制--列表and查看详情--联调
parent
bfe18a88
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
1971 additions
and
1934 deletions
+1971
-1934
QualityController.java
...wise/sc/cement/business/controller/QualityController.java
+0
-1
StandardController.java
...ise/sc/cement/business/controller/StandardController.java
+6
-5
EntrustReport.java
...java/cn/wise/sc/cement/business/entity/EntrustReport.java
+2
-0
StandardMapper.java
...ava/cn/wise/sc/cement/business/mapper/StandardMapper.java
+4
-0
StandardMapper.xml
.../cn/wise/sc/cement/business/mapper/xml/StandardMapper.xml
+7
-0
IStandardService.java
.../cn/wise/sc/cement/business/service/IStandardService.java
+4
-2
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+1667
-1663
StandardServiceImpl.java
.../sc/cement/business/service/impl/StandardServiceImpl.java
+281
-263
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/QualityController.java
View file @
77b114eb
...
@@ -61,5 +61,4 @@ public class QualityController {
...
@@ -61,5 +61,4 @@ public class QualityController {
}
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/StandardController.java
View file @
77b114eb
...
@@ -8,6 +8,7 @@ import cn.wise.sc.cement.business.model.PageQuery;
...
@@ -8,6 +8,7 @@ import cn.wise.sc.cement.business.model.PageQuery;
import
cn.wise.sc.cement.business.model.query.ChangeStockQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeStockQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeValidDateQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeValidDateQuery
;
import
cn.wise.sc.cement.business.model.query.StandardQuery
;
import
cn.wise.sc.cement.business.model.query.StandardQuery
;
import
cn.wise.sc.cement.business.model.vo.StandardValueVo
;
import
cn.wise.sc.cement.business.service.IStandardService
;
import
cn.wise.sc.cement.business.service.IStandardService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -156,10 +157,10 @@ public class StandardController {
...
@@ -156,10 +157,10 @@ public class StandardController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
@ApiOperation
(
"获取样本标准值列表"
)
@GetMapping
(
"/detailList"
)
public
BaseResponse
<
List
<
StandardValueVo
>>
getStandardDetailList
(){
return
standardService
.
getStandardDetailList
();
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/EntrustReport.java
View file @
77b114eb
...
@@ -51,6 +51,7 @@ public class EntrustReport {
...
@@ -51,6 +51,7 @@ public class EntrustReport {
* 检测依据 ids
* 检测依据 ids
*/
*/
private
String
methodNumbers
;
private
String
methodNumbers
;
/**
/**
* 检测依据名字
* 检测依据名字
*/
*/
...
@@ -80,6 +81,7 @@ public class EntrustReport {
...
@@ -80,6 +81,7 @@ public class EntrustReport {
* 项目编号
* 项目编号
*/
*/
private
String
entrustCode
;
private
String
entrustCode
;
/**
/**
* 项目类型
* 项目类型
*/
*/
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/StandardMapper.java
View file @
77b114eb
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.Standard
;
import
cn.wise.sc.cement.business.entity.Standard
;
import
cn.wise.sc.cement.business.model.vo.StandardValueVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
java.util.List
;
/**
/**
* <p>
* <p>
* Mapper 接口
* Mapper 接口
...
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
StandardMapper
extends
BaseMapper
<
Standard
>
{
public
interface
StandardMapper
extends
BaseMapper
<
Standard
>
{
List
<
StandardValueVo
>
getStandardDetaulList
();
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/StandardMapper.xml
View file @
77b114eb
...
@@ -2,4 +2,11 @@
...
@@ -2,4 +2,11 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.StandardMapper"
>
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.StandardMapper"
>
<select
id=
"getStandardDetaulList"
resultType=
"cn.wise.sc.cement.business.model.vo.StandardValueVo"
>
SELECT standard_id as id,element_value,element_name FROM `standard_value` sv
LEFT JOIN
(SELECT id FROM standard) s
ON sv.standard_id = s.id
</select>
</mapper>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/service/IStandardService.java
View file @
77b114eb
...
@@ -6,10 +6,13 @@ import cn.wise.sc.cement.business.model.PageQuery;
...
@@ -6,10 +6,13 @@ import cn.wise.sc.cement.business.model.PageQuery;
import
cn.wise.sc.cement.business.model.query.ChangeStockQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeStockQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeValidDateQuery
;
import
cn.wise.sc.cement.business.model.query.ChangeValidDateQuery
;
import
cn.wise.sc.cement.business.model.query.StandardQuery
;
import
cn.wise.sc.cement.business.model.query.StandardQuery
;
import
cn.wise.sc.cement.business.model.vo.StandardValueVo
;
import
cn.wise.sc.cement.business.model.vo.StandardVo
;
import
cn.wise.sc.cement.business.model.vo.StandardVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
/**
* <p>
* <p>
* 服务类
* 服务类
...
@@ -36,6 +39,5 @@ public interface IStandardService extends IService<Standard> {
...
@@ -36,6 +39,5 @@ public interface IStandardService extends IService<Standard> {
BaseResponse
<
String
>
overdue
(
Integer
id
);
BaseResponse
<
String
>
overdue
(
Integer
id
);
BaseResponse
<
List
<
StandardValueVo
>>
getStandardDetailList
();
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
77b114eb
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.*
;
import
cn.wise.sc.cement.business.entity.*
;
import
cn.wise.sc.cement.business.mapper.*
;
import
cn.wise.sc.cement.business.mapper.*
;
...
@@ -21,6 +22,7 @@ import org.springframework.beans.BeanUtils;
...
@@ -21,6 +22,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
...
@@ -99,6 +101,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -99,6 +101,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 委托分页
* 委托分页
*
* @param pageQuery
* @param pageQuery
* @param startDate
* @param startDate
* @param endDate
* @param endDate
...
@@ -109,9 +112,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -109,9 +112,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
*/
*/
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
public
BaseResponse
<
IPage
<
EntrustVo
>>
getPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -122,38 +125,38 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -122,38 +125,38 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"projectCode"
,
projectCode
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"委托评审"
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"委托评审"
);
if
(
approvalId
==
null
)
{
if
(
approvalId
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
}
}
if
(
loginUser
.
getId
()
!=
approvalId
)
{
if
(
loginUser
.
getId
()
!=
approvalId
)
{
params
.
put
(
"userId"
,
loginUser
.
getId
());
params
.
put
(
"userId"
,
loginUser
.
getId
());
}
}
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getPage
(
page
,
params
);
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getPage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
//检测项目名称
//检测项目名称
String
sampleNames
=
""
;
String
sampleNames
=
""
;
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()>
0
)
{
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
//样品名称 列表中的拼接
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
sampleNames
=
sampleNames
.
equals
(
""
)?
sampleTmp
.
getName
():(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
sampleNames
=
sampleNames
.
equals
(
""
)
?
sampleTmp
.
getName
()
:
(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
}
}
entrustVo
.
setSampleNames
(
sampleNames
);
entrustVo
.
setSampleNames
(
sampleNames
);
//检测项 和检测依据 列表里只显示第一个样品的
//检测项 和检测依据 列表里只显示第一个样品的
SampleTmp
sampleTmp
=
sampleTmpList
.
get
(
0
);
SampleTmp
sampleTmp
=
sampleTmpList
.
get
(
0
);
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
checkTeam
=
""
;
String
checkTeam
=
""
;
if
(
teamIds
!=
null
)
{
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(
team
!=
null
)
{
checkTeam
=
checkTeam
.
equals
(
""
)?
team
.
getName
():(
checkTeam
+
"、"
+
team
.
getName
());
checkTeam
=
checkTeam
.
equals
(
""
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
}
}
}
...
@@ -168,22 +171,23 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -168,22 +171,23 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 置顶取消置顶
* 置顶取消置顶
*
* @param id 委托表id
* @param id 委托表id
* @return
* @return
*/
*/
public
BaseResponse
<
String
>
setTopping
(
Integer
id
)
{
public
BaseResponse
<
String
>
setTopping
(
Integer
id
)
{
if
(
id
==
null
)
{
if
(
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据错误"
);
return
BaseResponse
.
errorMsg
(
"数据错误"
);
}
}
String
msg
=
""
;
String
msg
=
""
;
if
(
entrust
.
getCreateTime
().
isEqual
(
entrust
.
getUpdateTime
()))
{
if
(
entrust
.
getCreateTime
().
isEqual
(
entrust
.
getUpdateTime
()))
{
entrust
.
setUpdateTime
(
LocalDateTime
.
now
());
entrust
.
setUpdateTime
(
LocalDateTime
.
now
());
msg
=
"置顶成功"
;
msg
=
"置顶成功"
;
}
else
{
}
else
{
entrust
.
setUpdateTime
(
entrust
.
getCreateTime
());
entrust
.
setUpdateTime
(
entrust
.
getCreateTime
());
msg
=
"取消置顶成功"
;
msg
=
"取消置顶成功"
;
}
}
...
@@ -194,29 +198,30 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -194,29 +198,30 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 新增委托
* 新增委托
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
Entrust
>
create
(
EntrustQuery
query
)
{
public
BaseResponse
<
Entrust
>
create
(
EntrustQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
query
.
getClientId
()
==
null
)
{
if
(
query
.
getClientId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请选择委托单位"
);
return
BaseResponse
.
errorMsg
(
"请选择委托单位"
);
}
}
if
(
query
.
getProjectId
()
==
null
||
StringUtils
.
isEmpty
(
query
.
getProjectCode
()))
{
if
(
query
.
getProjectId
()
==
null
||
StringUtils
.
isEmpty
(
query
.
getProjectCode
()))
{
if
(
StringUtils
.
isEmpty
(
query
.
getProjectName
()))
{
if
(
StringUtils
.
isEmpty
(
query
.
getProjectName
()))
{
return
BaseResponse
.
errorMsg
(
"请填写项目名称或选择已有项目"
);
return
BaseResponse
.
errorMsg
(
"请填写项目名称或选择已有项目"
);
}
}
}
}
if
(
StringUtils
.
isEmpty
(
query
.
getSendName
())
||
StringUtils
.
isEmpty
(
query
.
getSendPhone
()))
{
if
(
StringUtils
.
isEmpty
(
query
.
getSendName
())
||
StringUtils
.
isEmpty
(
query
.
getSendPhone
()))
{
return
BaseResponse
.
errorMsg
(
"请填写送样人信息"
);
return
BaseResponse
.
errorMsg
(
"请填写送样人信息"
);
}
}
Entrust
entrust
=
new
Entrust
();
Entrust
entrust
=
new
Entrust
();
BeanUtils
.
copyProperties
(
query
,
entrust
);
BeanUtils
.
copyProperties
(
query
,
entrust
);
//生成委托编号
//生成委托编号
String
entrustCode
=
commonService
.
createNo
(
"WT"
,
entrustMapper
.
counts
());
String
entrustCode
=
commonService
.
createNo
(
"WT"
,
entrustMapper
.
counts
());
entrust
.
setEntrustCode
(
entrustCode
)
entrust
.
setEntrustCode
(
entrustCode
)
...
@@ -229,20 +234,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -229,20 +234,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setUpdateTime
(
entrust
.
getCreateTime
())
.
setUpdateTime
(
entrust
.
getCreateTime
())
.
setSampleNum
(
query
.
getSampleTmpList
().
size
());
.
setSampleNum
(
query
.
getSampleTmpList
().
size
());
entrustMapper
.
insert
(
entrust
);
entrustMapper
.
insert
(
entrust
);
if
(
query
.
getSampleTmpList
()
!=
null
&&
query
.
getSampleTmpList
().
size
()>
0
)
{
if
(
query
.
getSampleTmpList
()
!=
null
&&
query
.
getSampleTmpList
().
size
()
>
0
)
{
List
<
SampleTmp
>
sampleTmpList
=
new
ArrayList
<>();
List
<
SampleTmp
>
sampleTmpList
=
new
ArrayList
<>();
for
(
SampleTmpQuery
sampleTmpQuery
:
query
.
getSampleTmpList
())
{
for
(
SampleTmpQuery
sampleTmpQuery
:
query
.
getSampleTmpList
())
{
SampleTmp
sampleTmp
=
new
SampleTmp
();
SampleTmp
sampleTmp
=
new
SampleTmp
();
BeanUtils
.
copyProperties
(
sampleTmpQuery
,
sampleTmp
);
BeanUtils
.
copyProperties
(
sampleTmpQuery
,
sampleTmp
);
String
teamIds
=
sampleTmpQuery
.
getTeamIds
();
//选择的检测项id集合
String
teamIds
=
sampleTmpQuery
.
getTeamIds
();
//选择的检测项id集合
BigDecimal
charge
=
new
BigDecimal
(
"0.00"
);
BigDecimal
charge
=
new
BigDecimal
(
"0.00"
);
if
(
teamIds
!=
null
)
{
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(
team
!=
null
)
{
charge
=
charge
.
compareTo
(
BigDecimal
.
ZERO
)==
0
?
team
.
getCharge
():
(
charge
.
add
(
team
.
getCharge
()));
charge
=
charge
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
team
.
getCharge
()
:
(
charge
.
add
(
team
.
getCharge
()));
}
}
}
}
}
}
...
@@ -259,35 +264,36 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -259,35 +264,36 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 委托详情
* 委托详情
*
* @param id
* @param id
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
EntrustVo
>
getDtail
(
Integer
id
)
{
public
BaseResponse
<
EntrustVo
>
getDtail
(
Integer
id
)
{
if
(
id
==
null
)
{
if
(
id
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
EntrustVo
entrustVo
=
entrustMapper
.
getDetail
(
id
);
EntrustVo
entrustVo
=
entrustMapper
.
getDetail
(
id
);
if
(
entrustVo
.
getStatus
()!=
0
)
{
if
(
entrustVo
.
getStatus
()
!=
0
)
{
QueryWrapper
<
Sample
>
sampleWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
Sample
>
sampleWrapper
=
new
QueryWrapper
<>();
sampleWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
sampleWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
sampleWrapper
.
orderByAsc
(
"id"
);
sampleWrapper
.
orderByAsc
(
"id"
);
List
<
Sample
>
sampleList
=
sampleService
.
list
(
sampleWrapper
);
List
<
Sample
>
sampleList
=
sampleService
.
list
(
sampleWrapper
);
List
<
SampleVo
>
sampleVoList
=
new
ArrayList
<>();
List
<
SampleVo
>
sampleVoList
=
new
ArrayList
<>();
List
<
SampleVo
>
sampleHandleVoList
=
new
ArrayList
<>();
List
<
SampleVo
>
sampleHandleVoList
=
new
ArrayList
<>();
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
)
{
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
for
(
Sample
sample
:
sampleList
)
{
for
(
Sample
sample
:
sampleList
)
{
SampleVo
sampleVo
=
new
SampleVo
();
SampleVo
sampleVo
=
new
SampleVo
();
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
String
teamIds
=
sample
.
getTeamIds
();
String
teamIds
=
sample
.
getTeamIds
();
String
teamName
=
""
;
String
teamName
=
""
;
List
<
SampleDistributionTeamVo
>
sampleNoDistributionTeamVoList
=
new
ArrayList
<>();
List
<
SampleDistributionTeamVo
>
sampleNoDistributionTeamVoList
=
new
ArrayList
<>();
if
(
teamIds
!=
null
)
{
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
TeamVo
teamVo
=
teamMapper
.
getDetail
(
Integer
.
valueOf
(
teamId
));
TeamVo
teamVo
=
teamMapper
.
getDetail
(
Integer
.
valueOf
(
teamId
));
if
(
teamVo
!=
null
)
{
if
(
teamVo
!=
null
)
{
teamName
=
teamName
.
equals
(
""
)?
teamVo
.
getName
():(
teamName
+
"、"
+
teamVo
.
getName
());
teamName
=
teamName
.
equals
(
""
)
?
teamVo
.
getName
()
:
(
teamName
+
"、"
+
teamVo
.
getName
());
SampleDistributionTeamVo
distributionTeamVo
=
new
SampleDistributionTeamVo
();
SampleDistributionTeamVo
distributionTeamVo
=
new
SampleDistributionTeamVo
();
distributionTeamVo
.
setTeamGroupId
(
teamVo
.
getGroupId
());
distributionTeamVo
.
setTeamGroupId
(
teamVo
.
getGroupId
());
distributionTeamVo
.
setTeamGroupName
(
teamVo
.
getGroupName
());
distributionTeamVo
.
setTeamGroupName
(
teamVo
.
getGroupName
());
...
@@ -300,43 +306,43 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -300,43 +306,43 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleVo
.
setTeamName
(
teamName
);
sampleVo
.
setTeamName
(
teamName
);
//评审人员可以查看所有的检测项内容
//评审人员可以查看所有的检测项内容
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
,
null
);
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
,
null
);
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()>
0
)
{
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()
>
0
)
{
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
}
else
{
}
else
{
sampleVo
.
setSampleDistributionTeamVoList
(
sampleNoDistributionTeamVoList
);
sampleVo
.
setSampleDistributionTeamVoList
(
sampleNoDistributionTeamVoList
);
}
}
sampleVoList
.
add
(
sampleVo
);
sampleVoList
.
add
(
sampleVo
);
//样品处理列表只展示
//样品处理列表只展示
if
(
sample
.
getIsParallel
()==
1
)
{
if
(
sample
.
getIsParallel
()
==
1
)
{
if
(
sample
.
getCementCode
().
equals
(
sample
.
getParallelCode
()))
{
if
(
sample
.
getCementCode
().
equals
(
sample
.
getParallelCode
()))
{
sampleHandleVoList
.
add
(
sampleVo
);
sampleHandleVoList
.
add
(
sampleVo
);
}
}
}
else
{
}
else
{
sampleHandleVoList
.
add
(
sampleVo
);
sampleHandleVoList
.
add
(
sampleVo
);
}
}
}
}
}
}
entrustVo
.
setSampleList
(
sampleVoList
);
//样品列表(展示平行样样品)
entrustVo
.
setSampleList
(
sampleVoList
);
//样品列表(展示平行样样品)
entrustVo
.
setSampleHandleList
(
sampleHandleVoList
);
//处理样品列表(不展示平行样样品)
entrustVo
.
setSampleHandleList
(
sampleHandleVoList
);
//处理样品列表(不展示平行样样品)
}
else
{
}
else
{
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
List
<
SampleTmpVo
>
sampleTmpVoList
=
new
ArrayList
<>();
List
<
SampleTmpVo
>
sampleTmpVoList
=
new
ArrayList
<>();
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()>
0
)
{
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
SampleTmpVo
sampleTmpVo
=
new
SampleTmpVo
();
SampleTmpVo
sampleTmpVo
=
new
SampleTmpVo
();
BeanUtils
.
copyProperties
(
sampleTmp
,
sampleTmpVo
);
BeanUtils
.
copyProperties
(
sampleTmp
,
sampleTmpVo
);
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
teamName
=
""
;
String
teamName
=
""
;
if
(
teamIds
!=
null
)
{
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(
team
!=
null
)
{
team
.
getName
();
team
.
getName
();
teamName
=
teamName
.
equals
(
""
)?
team
.
getName
():(
teamName
+
"、"
+
team
.
getName
());
teamName
=
teamName
.
equals
(
""
)
?
team
.
getName
()
:
(
teamName
+
"、"
+
team
.
getName
());
}
}
}
}
}
}
...
@@ -351,27 +357,28 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -351,27 +357,28 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 获取样品表里最大的平行样编号
* 获取样品表里最大的平行样编号
*
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
String
>
getMaxCementCode
()
{
public
BaseResponse
<
String
>
getMaxCementCode
()
{
Object
obj
=
redisUtil
.
getString
(
"maxCementCode"
);
Object
obj
=
redisUtil
.
getString
(
"maxCementCode"
);
String
maxCementCode
=
""
;
String
maxCementCode
=
""
;
if
(
obj
==
null
)
{
if
(
obj
==
null
)
{
maxCementCode
=
sampleMapper
.
getMaxCementCode
();
maxCementCode
=
sampleMapper
.
getMaxCementCode
();
}
else
{
}
else
{
maxCementCode
=
obj
.
toString
();
maxCementCode
=
obj
.
toString
();
}
}
//校验获取的最大本所编号
//校验获取的最大本所编号
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yy"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yy"
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
String
yesrString
=
sdf
.
format
(
date
);
String
yesrString
=
sdf
.
format
(
date
);
if
(
maxCementCode
==
null
)
{
//如果数据库没有本所编号,初始化本所编号
if
(
maxCementCode
==
null
)
{
//如果数据库没有本所编号,初始化本所编号
maxCementCode
=
yesrString
+
"-0000"
;
maxCementCode
=
yesrString
+
"-0000"
;
}
else
{
}
else
{
String
yearStr
=
commonService
.
getIntegerYear
(
maxCementCode
);
String
yearStr
=
commonService
.
getIntegerYear
(
maxCementCode
);
if
(!
yearStr
.
equals
(
yesrString
))
{
//如果数据库本所编号年份和当前不一样,初始化本所编号
if
(!
yearStr
.
equals
(
yesrString
))
{
//如果数据库本所编号年份和当前不一样,初始化本所编号
maxCementCode
=
yesrString
+
"-0000"
;
maxCementCode
=
yesrString
+
"-0000"
;
}
}
}
}
redisUtil
.
setString
(
"maxCementCode"
,
maxCementCode
);
redisUtil
.
setString
(
"maxCementCode"
,
maxCementCode
);
...
@@ -380,43 +387,44 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -380,43 +387,44 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 委托评审
* 委托评审
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
approval
(
ApprovalQuery
query
)
{
public
BaseResponse
<
String
>
approval
(
ApprovalQuery
query
)
{
if
(
query
.
getId
()
==
null
||
query
.
getIsAgree
()
==
null
)
{
if
(
query
.
getId
()
==
null
||
query
.
getIsAgree
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
EntrustVo
entrustVo
=
entrustMapper
.
getDetail
(
query
.
getId
());
EntrustVo
entrustVo
=
entrustMapper
.
getDetail
(
query
.
getId
());
if
(
entrustVo
==
null
)
{
if
(
entrustVo
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
if
(
entrustVo
.
getStatus
()
!=
0
)
{
if
(
entrustVo
.
getStatus
()
!=
0
)
{
return
BaseResponse
.
errorMsg
(
"当前状态不允许评审"
);
return
BaseResponse
.
errorMsg
(
"当前状态不允许评审"
);
}
}
Entrust
entrust
=
entrustMapper
.
selectById
(
entrustVo
.
getId
());
Entrust
entrust
=
entrustMapper
.
selectById
(
entrustVo
.
getId
());
if
(
query
.
getIsAgree
()
==
1
)
{
//通过
if
(
query
.
getIsAgree
()
==
1
)
{
//通过
if
(
StringUtils
.
isEmpty
(
query
.
getProjectType
()))
{
if
(
StringUtils
.
isEmpty
(
query
.
getProjectType
()))
{
return
BaseResponse
.
errorMsg
(
"请选择项目类型"
);
return
BaseResponse
.
errorMsg
(
"请选择项目类型"
);
}
}
if
(
query
.
getSampleList
()
!=
null
&&
query
.
getSampleList
().
size
()>
0
)
{
if
(
query
.
getSampleList
()
!=
null
&&
query
.
getSampleList
().
size
()
>
0
)
{
List
<
Sample
>
sampleList
=
new
ArrayList
<>();
List
<
Sample
>
sampleList
=
new
ArrayList
<>();
QueryWrapper
<
Sample
>
sampleQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
Sample
>
sampleQueryWrapper
=
new
QueryWrapper
<>();
String
maxCementCode
=
""
;
//最大本所编号对应的平行样编号
String
maxCementCode
=
""
;
//最大本所编号对应的平行样编号
Integer
integerMaxCode
=
commonService
.
getIntegerCode
(
getMaxCementCode
().
getData
());
Integer
integerMaxCode
=
commonService
.
getIntegerCode
(
getMaxCementCode
().
getData
());
for
(
SampleQuery
sampleQuery
:
query
.
getSampleList
())
{
for
(
SampleQuery
sampleQuery
:
query
.
getSampleList
())
{
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getCementCode
()))
{
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getCementCode
()))
{
return
BaseResponse
.
errorMsg
(
"本所编号不能为空"
);
return
BaseResponse
.
errorMsg
(
"本所编号不能为空"
);
}
}
Integer
cementCodeInteger
=
commonService
.
getIntegerCode
(
sampleQuery
.
getCementCode
());
Integer
cementCodeInteger
=
commonService
.
getIntegerCode
(
sampleQuery
.
getCementCode
());
if
(
cementCodeInteger
<=
integerMaxCode
)
{
if
(
cementCodeInteger
<=
integerMaxCode
)
{
return
BaseResponse
.
errorMsg
(
"本所编号必须大于最大值"
);
return
BaseResponse
.
errorMsg
(
"本所编号必须大于最大值"
);
}
}
integerMaxCode
=
cementCodeInteger
>
integerMaxCode
?
cementCodeInteger:
integerMaxCode
;
integerMaxCode
=
cementCodeInteger
>
integerMaxCode
?
cementCodeInteger
:
integerMaxCode
;
String
yearStr
=
commonService
.
getIntegerYear
(
maxCementCode
);
String
yearStr
=
commonService
.
getIntegerYear
(
maxCementCode
);
maxCementCode
=
yearStr
+
"-"
+
commonService
.
getCementCode
(
integerMaxCode
);
maxCementCode
=
yearStr
+
"-"
+
commonService
.
getCementCode
(
integerMaxCode
);
Sample
sample
=
new
Sample
();
Sample
sample
=
new
Sample
();
BeanUtils
.
copyProperties
(
sampleQuery
,
sample
);
BeanUtils
.
copyProperties
(
sampleQuery
,
sample
);
sample
.
setId
(
null
)
sample
.
setId
(
null
)
...
@@ -426,7 +434,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -426,7 +434,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setIsHandle
(
0
)
//样品处理未完成状态
.
setIsHandle
(
0
)
//样品处理未完成状态
.
setIsDistribution
(
0
)
//任务派发未完成状态
.
setIsDistribution
(
0
)
//任务派发未完成状态
.
setIsCheck
(
0
);
//样品校核未完成状态
.
setIsCheck
(
0
);
//样品校核未完成状态
if
(
sampleQuery
.
getIsParallel
()
==
1
)
{
//平行样
if
(
sampleQuery
.
getIsParallel
()
==
1
)
{
//平行样
//生成平行样编号 (如果是平行样,会生成两条记录,本所编号是相同的,
//生成平行样编号 (如果是平行样,会生成两条记录,本所编号是相同的,
// 第一个平行样编号和本所编号相同,第二个平行样的平行样编号会在本所编号上+1)
// 第一个平行样编号和本所编号相同,第二个平行样的平行样编号会在本所编号上+1)
sample
.
setParallelCode
(
sampleQuery
.
getCementCode
());
sample
.
setParallelCode
(
sampleQuery
.
getCementCode
());
...
@@ -436,11 +444,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -436,11 +444,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sample2
.
setParallelCode
(
commonService
.
createParallelCode
(
sampleQuery
.
getCementCode
()));
sample2
.
setParallelCode
(
commonService
.
createParallelCode
(
sampleQuery
.
getCementCode
()));
sampleList
.
add
(
sample2
);
sampleList
.
add
(
sample2
);
maxCementCode
=
sample2
.
getParallelCode
();
maxCementCode
=
sample2
.
getParallelCode
();
}
else
if
(
sampleQuery
.
getIsParallel
()
==
0
)
{
//非平行样
}
else
if
(
sampleQuery
.
getIsParallel
()
==
0
)
{
//非平行样
//如果不是平行样,本所编号和平行样编号是相同的。且就一条记录
//如果不是平行样,本所编号和平行样编号是相同的。且就一条记录
sample
.
setParallelCode
(
sampleQuery
.
getCementCode
());
sample
.
setParallelCode
(
sampleQuery
.
getCementCode
());
sampleList
.
add
(
sample
);
sampleList
.
add
(
sample
);
}
else
{
}
else
{
return
BaseResponse
.
errorMsg
(
"请选择是否需要平行样"
);
return
BaseResponse
.
errorMsg
(
"请选择是否需要平行样"
);
}
}
}
}
...
@@ -450,10 +458,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -450,10 +458,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
entrust
.
setStatus
(
1
).
setProjectType
(
query
.
getProjectType
());
entrust
.
setStatus
(
1
).
setProjectType
(
query
.
getProjectType
());
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"修改评审状态为“通过”"
,
null
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"修改评审状态为“通过”"
,
null
);
}
else
if
(
query
.
getIsAgree
()
==
2
)
{
//驳回
}
else
if
(
query
.
getIsAgree
()
==
2
)
{
//驳回
entrust
.
setStatus
(
2
);
entrust
.
setStatus
(
2
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"修改评审状态为“驳回”"
,
null
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"修改评审状态为“驳回”"
,
null
);
}
else
{
}
else
{
return
BaseResponse
.
errorMsg
(
"请选择正确按钮"
);
return
BaseResponse
.
errorMsg
(
"请选择正确按钮"
);
}
}
//记录审批信息
//记录审批信息
...
@@ -473,49 +481,50 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -473,49 +481,50 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 发送样品处理任务
* 发送样品处理任务
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
handle
(
HandleQuery
query
)
{
public
BaseResponse
<
String
>
handle
(
HandleQuery
query
)
{
if
(
query
.
getId
()
==
null
)
{
if
(
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
Entrust
entrust
=
entrustMapper
.
selectById
(
query
.
getId
());
Entrust
entrust
=
entrustMapper
.
selectById
(
query
.
getId
());
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
if
(
entrust
.
getStatus
()
!=
1
)
{
if
(
entrust
.
getStatus
()
!=
1
)
{
return
BaseResponse
.
errorMsg
(
"当前状态不允许样品处理"
);
return
BaseResponse
.
errorMsg
(
"当前状态不允许样品处理"
);
}
}
if
(
query
.
getSampleHandleQueryList
()
!=
null
&&
query
.
getSampleHandleQueryList
().
size
()>
0
)
{
if
(
query
.
getSampleHandleQueryList
()
!=
null
&&
query
.
getSampleHandleQueryList
().
size
()
>
0
)
{
List
<
SampleHandleQuery
>
sampleHandleQueryList
=
query
.
getSampleHandleQueryList
();
List
<
SampleHandleQuery
>
sampleHandleQueryList
=
query
.
getSampleHandleQueryList
();
for
(
SampleHandleQuery
sampleHandleQuery
:
sampleHandleQueryList
)
{
for
(
SampleHandleQuery
sampleHandleQuery
:
sampleHandleQueryList
)
{
//样品处理表
//样品处理表
SampleHandle
sampleHandle
=
new
SampleHandle
();
SampleHandle
sampleHandle
=
new
SampleHandle
();
if
(
sampleHandleQuery
.
getSampleId
()
==
null
)
{
if
(
sampleHandleQuery
.
getSampleId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
if
(
sampleHandleQuery
.
getUserId
()
==
null
)
{
if
(
sampleHandleQuery
.
getUserId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请选择处理人"
);
return
BaseResponse
.
errorMsg
(
"请选择处理人"
);
}
}
if
(
StringUtils
.
isEmpty
(
sampleHandleQuery
.
getContent
()))
{
if
(
StringUtils
.
isEmpty
(
sampleHandleQuery
.
getContent
()))
{
return
BaseResponse
.
errorMsg
(
"请选择处理项"
);
return
BaseResponse
.
errorMsg
(
"请选择处理项"
);
}
}
if
(
sampleHandleQuery
.
getPlanFinishDate
()
==
null
)
{
if
(
sampleHandleQuery
.
getPlanFinishDate
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请选择要求完成日期"
);
return
BaseResponse
.
errorMsg
(
"请选择要求完成日期"
);
}
}
BeanUtils
.
copyProperties
(
sampleHandleQuery
,
sampleHandle
);
BeanUtils
.
copyProperties
(
sampleHandleQuery
,
sampleHandle
);
sampleHandle
.
setStatus
(
0
).
setCreateTime
(
LocalDateTime
.
now
());
sampleHandle
.
setStatus
(
0
).
setCreateTime
(
LocalDateTime
.
now
());
sampleHandleMapper
.
insert
(
sampleHandle
);
sampleHandleMapper
.
insert
(
sampleHandle
);
//样品处理项附件表
//样品处理项附件表
if
(
sampleHandle
.
getContent
()
!=
null
)
{
if
(
sampleHandle
.
getContent
()
!=
null
)
{
String
[]
handIdS
=
sampleHandle
.
getContent
().
split
(
"、"
);
String
[]
handIdS
=
sampleHandle
.
getContent
().
split
(
"、"
);
List
<
SampleHandleEnclosure
>
sampleHandleEnclosureList
=
new
ArrayList
<>();
List
<
SampleHandleEnclosure
>
sampleHandleEnclosureList
=
new
ArrayList
<>();
for
(
String
handleId
:
handIdS
)
{
for
(
String
handleId
:
handIdS
)
{
Handle
handle
=
handleMapper
.
selectById
(
Integer
.
valueOf
(
handleId
));
Handle
handle
=
handleMapper
.
selectById
(
Integer
.
valueOf
(
handleId
));
if
(
handle
==
null
)
{
if
(
handle
==
null
)
{
return
BaseResponse
.
errorMsg
(
"选择的处理项信息有误"
);
return
BaseResponse
.
errorMsg
(
"选择的处理项信息有误"
);
}
}
SampleHandleEnclosure
sampleHandleEnclosure
=
new
SampleHandleEnclosure
();
SampleHandleEnclosure
sampleHandleEnclosure
=
new
SampleHandleEnclosure
();
...
@@ -551,14 +560,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -551,14 +560,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 样品处理任务分页
* 样品处理任务分页
*
* @param pageQuery
* @param pageQuery
* @param projectCode
* @param projectCode
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
projectCode
)
{
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
projectCode
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -568,31 +578,31 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -568,31 +578,31 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getSampleHandlePage
(
page
,
params
);
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getSampleHandlePage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
entrustVo
.
getId
());
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
entrustVo
.
getId
());
//样品名称名称
//样品名称名称
String
sampleNames
=
""
;
String
sampleNames
=
""
;
//处理项名称
//处理项名称
String
handleNames
=
""
;
String
handleNames
=
""
;
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
)
{
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
//样品名称 列表中的拼接
for
(
Sample
sample
:
sampleList
)
{
for
(
Sample
sample
:
sampleList
)
{
sampleNames
=
sampleNames
.
equals
(
""
)?
sample
.
getName
():(
sampleNames
+
"、"
+
sample
.
getName
());
sampleNames
=
sampleNames
.
equals
(
""
)
?
sample
.
getName
()
:
(
sampleNames
+
"、"
+
sample
.
getName
());
}
}
//处理项表里只显示第一个样品的
//处理项表里只显示第一个样品的
Sample
sample
=
sampleList
.
get
(
0
);
Sample
sample
=
sampleList
.
get
(
0
);
QueryWrapper
<
SampleHandle
>
shWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleHandle
>
shWrapper
=
new
QueryWrapper
<>();
shWrapper
.
eq
(
"sample_id"
,
sample
.
getId
());
shWrapper
.
eq
(
"sample_id"
,
sample
.
getId
());
List
<
SampleHandle
>
shList
=
sampleHandleMapper
.
selectList
(
shWrapper
);
List
<
SampleHandle
>
shList
=
sampleHandleMapper
.
selectList
(
shWrapper
);
if
(
shList
!=
null
&&
shList
.
size
()>
0
)
{
if
(
shList
!=
null
&&
shList
.
size
()
>
0
)
{
for
(
SampleHandle
sampleHandle
:
shList
)
{
for
(
SampleHandle
sampleHandle
:
shList
)
{
if
(
sampleHandle
.
getContent
()
!=
null
)
{
if
(
sampleHandle
.
getContent
()
!=
null
)
{
String
[]
handleIdS
=
sampleHandle
.
getContent
().
split
(
"、"
);
String
[]
handleIdS
=
sampleHandle
.
getContent
().
split
(
"、"
);
for
(
String
handelId
:
handleIdS
)
{
for
(
String
handelId
:
handleIdS
)
{
Handle
handle
=
handleMapper
.
selectById
(
Integer
.
valueOf
(
handelId
));
Handle
handle
=
handleMapper
.
selectById
(
Integer
.
valueOf
(
handelId
));
if
(
handle
!=
null
)
{
if
(
handle
!=
null
)
{
handleNames
=
handleNames
.
equals
(
""
)?
handle
.
getName
():(
handleNames
+
"、"
+
handle
.
getName
());
handleNames
=
handleNames
.
equals
(
""
)
?
handle
.
getName
()
:
(
handleNames
+
"、"
+
handle
.
getName
());
}
}
}
}
}
}
...
@@ -612,14 +622,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -612,14 +622,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 样品处理任务列表
* 样品处理任务列表
*
* @param id 委托表id
* @param id 委托表id
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
Map
<
String
,
Object
>>
getSampleHandleList
(
Integer
id
)
{
public
BaseResponse
<
Map
<
String
,
Object
>>
getSampleHandleList
(
Integer
id
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
...
@@ -628,22 +639,22 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -628,22 +639,22 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
params
.
put
(
"userId"
,
loginUser
.
getId
());
params
.
put
(
"userId"
,
loginUser
.
getId
());
List
<
SampleHandleVo
>
sampleHandleList
=
sampleHandleMapper
.
getSampleHandleList
(
params
);
List
<
SampleHandleVo
>
sampleHandleList
=
sampleHandleMapper
.
getSampleHandleList
(
params
);
Integer
handleStatus
=
null
;
Integer
handleStatus
=
null
;
if
(
sampleHandleList
!=
null
&&
sampleHandleList
.
size
()>
0
)
{
if
(
sampleHandleList
!=
null
&&
sampleHandleList
.
size
()
>
0
)
{
for
(
SampleHandleVo
shVo
:
sampleHandleList
)
{
for
(
SampleHandleVo
shVo
:
sampleHandleList
)
{
if
(
handleStatus
!=
null
&&
handleStatus
!=
shVo
.
getStatus
())
{
if
(
handleStatus
!=
null
&&
handleStatus
!=
shVo
.
getStatus
())
{
return
BaseResponse
.
errorMsg
(
"接受或完成的状态信息错误"
);
return
BaseResponse
.
errorMsg
(
"接受或完成的状态信息错误"
);
}
}
handleStatus
=
shVo
.
getStatus
()==
1
?
1
:(
shVo
.
getStatus
()==
2
?
2
:
0
);
handleStatus
=
shVo
.
getStatus
()
==
1
?
1
:
(
shVo
.
getStatus
()
==
2
?
2
:
0
);
String
contentName
=
""
;
String
contentName
=
""
;
if
(
shVo
.
getContent
()
!=
null
)
{
if
(
shVo
.
getContent
()
!=
null
)
{
String
[]
handIdS
=
shVo
.
getContent
().
split
(
"、"
);
String
[]
handIdS
=
shVo
.
getContent
().
split
(
"、"
);
List
<
SampleHandleEnclosure
>
sampleHandleEnclosureList
=
new
ArrayList
<>();
List
<
SampleHandleEnclosure
>
sampleHandleEnclosureList
=
new
ArrayList
<>();
for
(
String
handleId
:
handIdS
)
{
for
(
String
handleId
:
handIdS
)
{
Handle
handle
=
handleMapper
.
selectById
(
Integer
.
valueOf
(
handleId
));
Handle
handle
=
handleMapper
.
selectById
(
Integer
.
valueOf
(
handleId
));
if
(
handle
==
null
)
{
if
(
handle
==
null
)
{
return
BaseResponse
.
errorMsg
(
"选择的处理项信息有误"
);
return
BaseResponse
.
errorMsg
(
"选择的处理项信息有误"
);
}
}
contentName
=
contentName
.
equals
(
""
)?
handle
.
getName
():
contentName
+
"、"
+
handle
.
getName
();
contentName
=
contentName
.
equals
(
""
)
?
handle
.
getName
()
:
contentName
+
"、"
+
handle
.
getName
();
}
}
}
}
shVo
.
setContentName
(
contentName
);
shVo
.
setContentName
(
contentName
);
...
@@ -657,29 +668,30 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -657,29 +668,30 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 接受样品处理任务
* 接受样品处理任务
*
* @param ids 委托单
* @param ids 委托单
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
acceptHandle
(
Integer
[]
ids
)
{
public
BaseResponse
<
String
>
acceptHandle
(
Integer
[]
ids
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
ids
==
null
||
ids
.
length
<=
0
)
{
if
(
ids
==
null
||
ids
.
length
<=
0
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
List
<
SampleHandle
>
sampleHandleList
=
new
ArrayList
<>();
List
<
SampleHandle
>
sampleHandleList
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
SampleHandle
sampleHandle
=
sampleHandleMapper
.
selectById
(
id
);
SampleHandle
sampleHandle
=
sampleHandleMapper
.
selectById
(
id
);
if
(
sampleHandle
==
null
)
{
if
(
sampleHandle
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
if
(
sampleHandle
.
getStatus
()
!=
0
)
{
if
(
sampleHandle
.
getStatus
()
!=
0
)
{
return
BaseResponse
.
errorMsg
(
"状态错误"
);
return
BaseResponse
.
errorMsg
(
"状态错误"
);
}
}
if
(
loginUser
.
getId
()
!=
sampleHandle
.
getUserId
())
{
if
(
loginUser
.
getId
()
!=
sampleHandle
.
getUserId
())
{
return
BaseResponse
.
errorMsg
(
"请登录样品处理人账号操作"
);
return
BaseResponse
.
errorMsg
(
"请登录样品处理人账号操作"
);
}
}
sampleHandle
.
setStatus
(
1
).
setAcceptTime
(
LocalDateTime
.
now
());
sampleHandle
.
setStatus
(
1
).
setAcceptTime
(
LocalDateTime
.
now
());
...
@@ -688,7 +700,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -688,7 +700,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleHandleService
.
updateBatchById
(
sampleHandleList
);
sampleHandleService
.
updateBatchById
(
sampleHandleList
);
//记录委托单日志
//记录委托单日志
Sample
sample
=
sampleService
.
getById
(
sampleHandleList
.
get
(
0
).
getSampleId
());
Sample
sample
=
sampleService
.
getById
(
sampleHandleList
.
get
(
0
).
getSampleId
());
if
(
sample
==
null
)
{
if
(
sample
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
sample
.
getEntrustId
(),
"接受样品处理任务"
,
null
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
sample
.
getEntrustId
(),
"接受样品处理任务"
,
null
);
...
@@ -697,12 +709,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -697,12 +709,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 数据上传列表
* 数据上传列表
*
* @param sampleHandleId 样品处理表id
* @param sampleHandleId 样品处理表id
* @return
* @return
*/
*/
public
BaseResponse
<
List
<
SampleHandleEnclosureVo
>>
getSampleHandleEnclosureList
(
Integer
sampleHandleId
)
{
public
BaseResponse
<
List
<
SampleHandleEnclosureVo
>>
getSampleHandleEnclosureList
(
Integer
sampleHandleId
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -714,28 +727,29 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -714,28 +727,29 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 样品处理数据上传附件
* 样品处理数据上传附件
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
SampleHandleEnclosure
>
uploadEnclosureCL
(
SampleHandleEnclosureQuery
query
)
{
public
BaseResponse
<
SampleHandleEnclosure
>
uploadEnclosureCL
(
SampleHandleEnclosureQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
SampleHandleEnclosure
sampleHandleEnclosure
=
sampleHandleEnclosureMapper
.
selectById
(
query
.
getId
());
SampleHandleEnclosure
sampleHandleEnclosure
=
sampleHandleEnclosureMapper
.
selectById
(
query
.
getId
());
if
(
sampleHandleEnclosure
==
null
)
{
if
(
sampleHandleEnclosure
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据错误"
);
return
BaseResponse
.
errorMsg
(
"数据错误"
);
}
}
sampleHandleEnclosure
.
setEnclosureUrl
(
query
.
getEnclosureUrl
())
sampleHandleEnclosure
.
setEnclosureUrl
(
query
.
getEnclosureUrl
())
.
setExtName
(
query
.
getExtName
())
.
setExtName
(
query
.
getExtName
())
.
setUpdateTime
(
LocalDateTime
.
now
())
.
setUpdateTime
(
LocalDateTime
.
now
())
.
setStatus
(
1
);
.
setStatus
(
1
);
if
(
StringUtils
.
isEmpty
(
query
.
getEnclosureUrl
()))
{
if
(
StringUtils
.
isEmpty
(
query
.
getEnclosureUrl
()))
{
sampleHandleEnclosure
.
setStatus
(
2
);
//上传失败
sampleHandleEnclosure
.
setStatus
(
2
);
//上传失败
}
}
sampleHandleEnclosureMapper
.
updateById
(
sampleHandleEnclosure
);
sampleHandleEnclosureMapper
.
updateById
(
sampleHandleEnclosure
);
...
@@ -744,40 +758,42 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -744,40 +758,42 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 样品处理详情
* 样品处理详情
*
* @param id
* @param id
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
SampleHandleVo
>
getHandleDtail
(
Integer
id
)
{
public
BaseResponse
<
SampleHandleVo
>
getHandleDtail
(
Integer
id
)
{
SampleHandleVo
sampleHandleVo
=
sampleHandleMapper
.
getDetail
(
id
);
SampleHandleVo
sampleHandleVo
=
sampleHandleMapper
.
getDetail
(
id
);
return
BaseResponse
.
okData
(
sampleHandleVo
);
return
BaseResponse
.
okData
(
sampleHandleVo
);
}
}
/**
/**
* 完成样品处理任务
* 完成样品处理任务
*
* @param ids
* @param ids
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
finishHandle
(
Integer
[]
ids
)
{
public
BaseResponse
<
String
>
finishHandle
(
Integer
[]
ids
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
ids
==
null
||
ids
.
length
<=
0
)
{
if
(
ids
==
null
||
ids
.
length
<=
0
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
Entrust
entrust
=
null
;
Entrust
entrust
=
null
;
for
(
Integer
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
SampleHandle
sampleHandle
=
sampleHandleMapper
.
selectById
(
id
);
SampleHandle
sampleHandle
=
sampleHandleMapper
.
selectById
(
id
);
if
(
sampleHandle
==
null
)
{
if
(
sampleHandle
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
if
(
sampleHandle
.
getStatus
()
!=
1
)
{
if
(
sampleHandle
.
getStatus
()
!=
1
)
{
return
BaseResponse
.
errorMsg
(
"状态错误"
);
return
BaseResponse
.
errorMsg
(
"状态错误"
);
}
}
if
(
loginUser
.
getId
()
!=
sampleHandle
.
getUserId
())
{
if
(
loginUser
.
getId
()
!=
sampleHandle
.
getUserId
())
{
return
BaseResponse
.
errorMsg
(
"请登录样品处理人账号操作"
);
return
BaseResponse
.
errorMsg
(
"请登录样品处理人账号操作"
);
}
}
sampleHandle
.
setStatus
(
2
).
setFinishTime
(
LocalDateTime
.
now
());
sampleHandle
.
setStatus
(
2
).
setFinishTime
(
LocalDateTime
.
now
());
...
@@ -785,47 +801,47 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -785,47 +801,47 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//判断该委托单下的所有样品的处理 及 处理项是否全部完成
//判断该委托单下的所有样品的处理 及 处理项是否全部完成
Sample
sample
=
sampleMapper
.
selectById
(
sampleHandle
.
getSampleId
());
Sample
sample
=
sampleMapper
.
selectById
(
sampleHandle
.
getSampleId
());
if
(
sample
==
null
)
{
if
(
sample
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
entrust
=
entrustMapper
.
selectById
(
sample
.
getEntrustId
());
entrust
=
entrustMapper
.
selectById
(
sample
.
getEntrustId
());
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托信息错误"
);
}
}
QueryWrapper
<
SampleHandle
>
sampleHandleWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleHandle
>
sampleHandleWrapper
=
new
QueryWrapper
<>();
sampleHandleWrapper
.
eq
(
"sample_id"
,
sample
.
getId
());
sampleHandleWrapper
.
eq
(
"sample_id"
,
sample
.
getId
());
sampleHandleWrapper
.
ne
(
"status"
,
2
);
sampleHandleWrapper
.
ne
(
"status"
,
2
);
List
<
SampleHandle
>
sampleHandleIngList
=
sampleHandleMapper
.
selectList
(
sampleHandleWrapper
);
List
<
SampleHandle
>
sampleHandleIngList
=
sampleHandleMapper
.
selectList
(
sampleHandleWrapper
);
if
(
sampleHandleIngList
==
null
||
sampleHandleIngList
.
size
()
==
0
)
{
if
(
sampleHandleIngList
==
null
||
sampleHandleIngList
.
size
()
==
0
)
{
if
(
sample
.
getIsParallel
()
==
0
)
{
if
(
sample
.
getIsParallel
()
==
0
)
{
sample
.
setIsHandle
(
1
);
//样品处理全部完成
sample
.
setIsHandle
(
1
);
//样品处理全部完成
sampleMapper
.
updateById
(
sample
);
sampleMapper
.
updateById
(
sample
);
}
else
if
(
sample
.
getIsParallel
()
==
1
)
{
}
else
if
(
sample
.
getIsParallel
()
==
1
)
{
List
<
Sample
>
sampleList1
=
sampleMapper
.
getByCementCode
(
entrust
.
getId
(),
sample
.
getCementCode
());
List
<
Sample
>
sampleList1
=
sampleMapper
.
getByCementCode
(
entrust
.
getId
(),
sample
.
getCementCode
());
// 如果是平行样,平行样的状态也改成已处理完成
// 如果是平行样,平行样的状态也改成已处理完成
if
(
sampleList1
.
size
()
==
2
)
{
if
(
sampleList1
.
size
()
==
2
)
{
for
(
Sample
sam
:
sampleList1
)
{
for
(
Sample
sam
:
sampleList1
)
{
sam
.
setIsHandle
(
1
);
sam
.
setIsHandle
(
1
);
sampleMapper
.
updateById
(
sam
);
sampleMapper
.
updateById
(
sam
);
}
}
}
else
{
}
else
{
sample
.
setIsHandle
(
1
);
//样品处理全部完成
sample
.
setIsHandle
(
1
);
//样品处理全部完成
sampleMapper
.
updateById
(
sample
);
sampleMapper
.
updateById
(
sample
);
}
}
}
}
}
}
if
(
entrust
!=
null
)
{
if
(
entrust
!=
null
)
{
if
(
entrust
.
getStatus
()
!=
3
)
{
if
(
entrust
.
getStatus
()
!=
3
)
{
return
BaseResponse
.
errorMsg
(
"委托单状态错误"
);
return
BaseResponse
.
errorMsg
(
"委托单状态错误"
);
}
}
List
<
Sample
>
sampleList
=
sampleMapper
.
getNoHandleList
(
sample
.
getEntrustId
());
List
<
Sample
>
sampleList
=
sampleMapper
.
getNoHandleList
(
sample
.
getEntrustId
());
if
(
sampleList
==
null
||
sampleList
.
size
()
==
0
)
{
if
(
sampleList
==
null
||
sampleList
.
size
()
==
0
)
{
entrust
.
setStatus
(
4
);
entrust
.
setStatus
(
4
);
}
}
entrustMapper
.
updateById
(
entrust
);
entrustMapper
.
updateById
(
entrust
);
}
}
}
}
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托信息错误"
);
}
}
//记录委托单日志
//记录委托单日志
...
@@ -835,42 +851,43 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -835,42 +851,43 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 派发检测项目任务
* 派发检测项目任务
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
distribution
(
DistributionQuery
query
)
{
public
BaseResponse
<
String
>
distribution
(
DistributionQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
query
.
getId
()
==
null
)
{
if
(
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
Entrust
entrust
=
entrustMapper
.
selectById
(
query
.
getId
());
Entrust
entrust
=
entrustMapper
.
selectById
(
query
.
getId
());
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
if
(
entrust
.
getStatus
()
!=
4
)
{
if
(
entrust
.
getStatus
()
!=
4
)
{
return
BaseResponse
.
errorMsg
(
"当前状态不允许派发"
);
return
BaseResponse
.
errorMsg
(
"当前状态不允许派发"
);
}
}
if
(
query
.
getSampleDistributionQueryList
()
!=
null
&&
query
.
getSampleDistributionQueryList
().
size
()>
0
)
{
if
(
query
.
getSampleDistributionQueryList
()
!=
null
&&
query
.
getSampleDistributionQueryList
().
size
()
>
0
)
{
List
<
SampleDistributionQuery
>
sampleDistributionQueryList
=
query
.
getSampleDistributionQueryList
();
List
<
SampleDistributionQuery
>
sampleDistributionQueryList
=
query
.
getSampleDistributionQueryList
();
List
<
SampleDistribution
>
sampleDistributionList
=
new
ArrayList
<>();
List
<
SampleDistribution
>
sampleDistributionList
=
new
ArrayList
<>();
List
<
Sample
>
sampleList
=
new
ArrayList
<>();
List
<
Sample
>
sampleList
=
new
ArrayList
<>();
for
(
SampleDistributionQuery
distributionQuery
:
sampleDistributionQueryList
)
{
for
(
SampleDistributionQuery
distributionQuery
:
sampleDistributionQueryList
)
{
if
(
distributionQuery
==
null
||
distributionQuery
.
getSampleId
()
==
null
)
{
if
(
distributionQuery
==
null
||
distributionQuery
.
getSampleId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
if
(
distributionQuery
.
getSampleDistributionTeamQueryList
()
!=
null
&&
distributionQuery
.
getSampleDistributionTeamQueryList
().
size
()>
0
)
{
if
(
distributionQuery
.
getSampleDistributionTeamQueryList
()
!=
null
&&
distributionQuery
.
getSampleDistributionTeamQueryList
().
size
()
>
0
)
{
List
<
SampleDistributionTeamQuery
>
sampleDistributionTeamQueryList
=
distributionQuery
.
getSampleDistributionTeamQueryList
();
List
<
SampleDistributionTeamQuery
>
sampleDistributionTeamQueryList
=
distributionQuery
.
getSampleDistributionTeamQueryList
();
for
(
SampleDistributionTeamQuery
distributionTeamQuery
:
sampleDistributionTeamQueryList
)
{
for
(
SampleDistributionTeamQuery
distributionTeamQuery
:
sampleDistributionTeamQueryList
)
{
if
(
distributionTeamQuery
==
null
||
distributionTeamQuery
.
getTeamId
()
==
null
||
if
(
distributionTeamQuery
==
null
||
distributionTeamQuery
.
getTeamId
()
==
null
||
distributionTeamQuery
.
getTeamGroupId
()
==
null
)
{
distributionTeamQuery
.
getTeamGroupId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"检测项信息错误"
);
return
BaseResponse
.
errorMsg
(
"检测项信息错误"
);
}
}
if
(
distributionTeamQuery
.
getUserId
()
==
null
)
{
if
(
distributionTeamQuery
.
getUserId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请选择检测人员"
);
return
BaseResponse
.
errorMsg
(
"请选择检测人员"
);
}
}
SampleDistribution
sampleDistribution
=
new
SampleDistribution
();
SampleDistribution
sampleDistribution
=
new
SampleDistribution
();
...
@@ -884,7 +901,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -884,7 +901,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
}
}
Sample
sample
=
sampleService
.
getById
(
distributionQuery
.
getSampleId
());
Sample
sample
=
sampleService
.
getById
(
distributionQuery
.
getSampleId
());
if
(
sample
==
null
)
{
if
(
sample
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
sample
.
setStatus
(
1
);
//样品状态改成已领用状态
sample
.
setStatus
(
1
);
//样品状态改成已领用状态
...
@@ -902,16 +919,17 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -902,16 +919,17 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 派发任务分页
* 派发任务分页
*
* @param pageQuery
* @param pageQuery
* @param projectName
* @param projectName
* @param projectCode
* @param projectCode
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
projectName
,
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
projectName
,
String
projectCode
)
{
String
projectCode
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -921,26 +939,26 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -921,26 +939,26 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getSampleDistributionPage
(
page
,
params
);
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getSampleDistributionPage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
entrustVo
.
getId
());
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
entrustVo
.
getId
());
//检测项目名称
//检测项目名称
String
sampleNames
=
""
;
String
sampleNames
=
""
;
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
)
{
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
//样品名称 列表中的拼接
for
(
Sample
sample
:
sampleList
)
{
for
(
Sample
sample
:
sampleList
)
{
sampleNames
=
sampleNames
.
equals
(
""
)?
sample
.
getName
():(
sampleNames
+
"、"
+
sample
.
getName
());
sampleNames
=
sampleNames
.
equals
(
""
)
?
sample
.
getName
()
:
(
sampleNames
+
"、"
+
sample
.
getName
());
}
}
//检测项 和检测依据 列表里只显示第一个样品的
//检测项 和检测依据 列表里只显示第一个样品的
Sample
sample
=
sampleList
.
get
(
0
);
Sample
sample
=
sampleList
.
get
(
0
);
String
teamIds
=
sample
.
getTeamIds
();
String
teamIds
=
sample
.
getTeamIds
();
String
checkTeam
=
""
;
String
checkTeam
=
""
;
if
(
teamIds
!=
null
)
{
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(
team
!=
null
)
{
checkTeam
=
checkTeam
.
equals
(
""
)?
team
.
getName
():(
checkTeam
+
"、"
+
team
.
getName
());
checkTeam
=
checkTeam
.
equals
(
""
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
}
}
}
...
@@ -956,51 +974,52 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -956,51 +974,52 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 检测通知单详情
* 检测通知单详情
*
* @param id 委托表id
* @param id 委托表id
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
Map
<
String
,
Object
>>
getSampleDistributionList
(
Integer
id
)
{
public
BaseResponse
<
Map
<
String
,
Object
>>
getSampleDistributionList
(
Integer
id
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
id
);
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
id
);
List
<
SampleVo
>
sampleVoList
=
new
ArrayList
<>();
List
<
SampleVo
>
sampleVoList
=
new
ArrayList
<>();
Integer
distributionStatus
=
null
;
Integer
distributionStatus
=
null
;
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
)
{
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
for
(
Sample
sample
:
sampleList
)
{
for
(
Sample
sample
:
sampleList
)
{
SampleVo
sampleVo
=
new
SampleVo
();
SampleVo
sampleVo
=
new
SampleVo
();
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
//判断是否为平行样
//判断是否为平行样
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
null
;
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
null
;
if
(
sample
.
getIsParallel
()
==
0
)
{
if
(
sample
.
getIsParallel
()
==
0
)
{
//检测人员只能看到自己则的检测内容
//检测人员只能看到自己则的检测内容
sampleDistributionTeamVoList
=
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
,
loginUser
.
getId
());
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
,
loginUser
.
getId
());
}
else
if
(
sample
.
getIsParallel
()
==
1
)
{
}
else
if
(
sample
.
getIsParallel
()
==
1
)
{
List
<
Sample
>
sampleList1
=
sampleMapper
.
getByCementCode
(
entrust
.
getId
(),
sample
.
getCementCode
());
List
<
Sample
>
sampleList1
=
sampleMapper
.
getByCementCode
(
entrust
.
getId
(),
sample
.
getCementCode
());
//检测人员只能看到自己则的检测内容
//检测人员只能看到自己则的检测内容
if
(
sampleList1
.
size
()
==
2
)
{
if
(
sampleList1
.
size
()
==
2
)
{
sampleDistributionTeamVoList
=
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sampleList1
.
get
(
0
).
getId
(),
sampleList1
.
get
(
1
).
getId
(),
loginUser
.
getId
());
distributionMapper
.
getDistributionTeamList
(
sampleList1
.
get
(
0
).
getId
(),
sampleList1
.
get
(
1
).
getId
(),
loginUser
.
getId
());
}
else
{
}
else
{
sampleDistributionTeamVoList
=
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
,
loginUser
.
getId
());
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
,
loginUser
.
getId
());
}
}
}
}
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()>
0
)
{
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()
>
0
)
{
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
for
(
SampleDistributionTeamVo
sdVo
:
sampleDistributionTeamVoList
)
{
for
(
SampleDistributionTeamVo
sdVo
:
sampleDistributionTeamVoList
)
{
if
(
distributionStatus
!=
null
&&
distributionStatus
!=
sdVo
.
getStatus
())
{
if
(
distributionStatus
!=
null
&&
distributionStatus
!=
sdVo
.
getStatus
())
{
return
BaseResponse
.
errorMsg
(
"接受或完成的状态信息错误"
);
return
BaseResponse
.
errorMsg
(
"接受或完成的状态信息错误"
);
}
}
distributionStatus
=
sdVo
.
getStatus
()==
1
?
1
:(
sdVo
.
getStatus
()==
2
?
2
:
0
);
distributionStatus
=
sdVo
.
getStatus
()
==
1
?
1
:
(
sdVo
.
getStatus
()
==
2
?
2
:
0
);
}
}
}
}
sampleVoList
.
add
(
sampleVo
);
sampleVoList
.
add
(
sampleVo
);
...
@@ -1014,27 +1033,28 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1014,27 +1033,28 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 接受检测项目任务
* 接受检测项目任务
*
* @param ids 样品派发表id
* @param ids 样品派发表id
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
acceptDistribution
(
Integer
[]
ids
)
{
public
BaseResponse
<
String
>
acceptDistribution
(
Integer
[]
ids
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
ids
==
null
||
ids
.
length
<=
0
)
{
if
(
ids
==
null
||
ids
.
length
<=
0
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
List
<
SampleDistribution
>
sampleHandleList
=
new
ArrayList
<>();
List
<
SampleDistribution
>
sampleHandleList
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
SampleDistribution
distribution
=
distributionMapper
.
selectById
(
id
);
SampleDistribution
distribution
=
distributionMapper
.
selectById
(
id
);
if
(
distribution
==
null
)
{
if
(
distribution
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
if
(
distribution
.
getStatus
()
!=
0
)
{
if
(
distribution
.
getStatus
()
!=
0
)
{
return
BaseResponse
.
errorMsg
(
"状态错误"
);
return
BaseResponse
.
errorMsg
(
"状态错误"
);
}
}
distribution
.
setStatus
(
1
).
setAcceptTime
(
LocalDateTime
.
now
());
distribution
.
setStatus
(
1
).
setAcceptTime
(
LocalDateTime
.
now
());
...
@@ -1043,7 +1063,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1043,7 +1063,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
distributionService
.
updateBatchById
(
sampleHandleList
);
distributionService
.
updateBatchById
(
sampleHandleList
);
Sample
sample
=
sampleService
.
getById
(
sampleHandleList
.
get
(
0
).
getSampleId
());
Sample
sample
=
sampleService
.
getById
(
sampleHandleList
.
get
(
0
).
getSampleId
());
if
(
sample
==
null
)
{
if
(
sample
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
sample
.
getEntrustId
(),
"接受检测项目任务"
,
null
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
sample
.
getEntrustId
(),
"接受检测项目任务"
,
null
);
...
@@ -1052,21 +1072,22 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1052,21 +1072,22 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 检测项目上传附件
* 检测项目上传附件
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
SampleDistribution
>
uploadEnclosurePF
(
SampleDistributionEnclosureQuery
query
)
{
public
BaseResponse
<
SampleDistribution
>
uploadEnclosurePF
(
SampleDistributionEnclosureQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
SampleDistribution
sampleDistribution
=
distributionMapper
.
selectById
(
query
.
getId
());
SampleDistribution
sampleDistribution
=
distributionMapper
.
selectById
(
query
.
getId
());
if
(
sampleDistribution
==
null
)
{
if
(
sampleDistribution
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据错误"
);
return
BaseResponse
.
errorMsg
(
"数据错误"
);
}
}
sampleDistribution
.
setEnclosureUrl
(
query
.
getEnclosureUrl
())
sampleDistribution
.
setEnclosureUrl
(
query
.
getEnclosureUrl
())
...
@@ -1080,56 +1101,57 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1080,56 +1101,57 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 完成检测项目任务
* 完成检测项目任务
*
* @param ids 样品派发表id
* @param ids 样品派发表id
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
finishDistribution
(
Integer
[]
ids
)
{
public
BaseResponse
<
String
>
finishDistribution
(
Integer
[]
ids
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
ids
==
null
||
ids
.
length
<=
0
)
{
if
(
ids
==
null
||
ids
.
length
<=
0
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
Entrust
entrust
=
null
;
Entrust
entrust
=
null
;
for
(
Integer
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
SampleDistribution
distribution
=
distributionMapper
.
selectById
(
id
);
SampleDistribution
distribution
=
distributionMapper
.
selectById
(
id
);
if
(
distribution
==
null
)
{
if
(
distribution
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
if
(
distribution
.
getStatus
()
!=
1
)
{
if
(
distribution
.
getStatus
()
!=
1
)
{
return
BaseResponse
.
errorMsg
(
"状态错误"
);
return
BaseResponse
.
errorMsg
(
"状态错误"
);
}
}
distribution
.
setStatus
(
2
).
setFinishTime
(
LocalDateTime
.
now
());
distribution
.
setStatus
(
2
).
setFinishTime
(
LocalDateTime
.
now
());
distributionMapper
.
updateById
(
distribution
);
distributionMapper
.
updateById
(
distribution
);
//判断该委托单下的所有样品的检测 及 检测项是否全部完成
//判断该委托单下的所有样品的检测 及 检测项是否全部完成
Sample
sample
=
sampleMapper
.
selectById
(
distribution
.
getSampleId
());
Sample
sample
=
sampleMapper
.
selectById
(
distribution
.
getSampleId
());
if
(
sample
==
null
)
{
if
(
sample
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
QueryWrapper
<
SampleDistribution
>
sampleDistributionWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleDistribution
>
sampleDistributionWrapper
=
new
QueryWrapper
<>();
sampleDistributionWrapper
.
eq
(
"sample_id"
,
sample
.
getId
());
sampleDistributionWrapper
.
eq
(
"sample_id"
,
sample
.
getId
());
sampleDistributionWrapper
.
ne
(
"status"
,
2
);
sampleDistributionWrapper
.
ne
(
"status"
,
2
);
List
<
SampleDistribution
>
sampleDistributionIngList
=
distributionMapper
.
selectList
(
sampleDistributionWrapper
);
List
<
SampleDistribution
>
sampleDistributionIngList
=
distributionMapper
.
selectList
(
sampleDistributionWrapper
);
if
(
sampleDistributionIngList
==
null
||
sampleDistributionIngList
.
size
()
==
0
)
{
if
(
sampleDistributionIngList
==
null
||
sampleDistributionIngList
.
size
()
==
0
)
{
sample
.
setIsDistribution
(
1
);
//样品检测全部完成
sample
.
setIsDistribution
(
1
);
//样品检测全部完成
}
}
sampleMapper
.
updateById
(
sample
);
sampleMapper
.
updateById
(
sample
);
entrust
=
entrustMapper
.
selectById
(
sample
.
getEntrustId
());
entrust
=
entrustMapper
.
selectById
(
sample
.
getEntrustId
());
if
(
entrust
!=
null
)
{
if
(
entrust
!=
null
)
{
if
(
entrust
.
getStatus
()
!=
5
)
{
if
(
entrust
.
getStatus
()
!=
5
)
{
return
BaseResponse
.
errorMsg
(
"委托单状态错误"
);
return
BaseResponse
.
errorMsg
(
"委托单状态错误"
);
}
}
List
<
Sample
>
sampleList
=
sampleMapper
.
getNoDistributionList
(
sample
.
getEntrustId
());
List
<
Sample
>
sampleList
=
sampleMapper
.
getNoDistributionList
(
sample
.
getEntrustId
());
if
(
sampleList
==
null
||
sampleList
.
size
()
==
0
)
{
if
(
sampleList
==
null
||
sampleList
.
size
()
==
0
)
{
entrust
.
setStatus
(
6
);
entrust
.
setStatus
(
6
);
}
}
entrustMapper
.
updateById
(
entrust
);
entrustMapper
.
updateById
(
entrust
);
}
}
}
}
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托信息错误"
);
}
}
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"完成检测项目任务"
,
null
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"完成检测项目任务"
,
null
);
...
@@ -1138,6 +1160,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1138,6 +1160,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 数据校核分页
* 数据校核分页
*
* @param pageQuery
* @param pageQuery
* @param startDate
* @param startDate
* @param endDate
* @param endDate
...
@@ -1149,9 +1172,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1149,9 +1172,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
*/
*/
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getCheckPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
public
BaseResponse
<
IPage
<
EntrustVo
>>
getCheckPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
@@ -1162,38 +1185,38 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1162,38 +1185,38 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"projectCode"
,
projectCode
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"数据校核"
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"数据校核"
);
if
(
approvalId
==
null
)
{
if
(
approvalId
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据校核信息错误"
);
return
BaseResponse
.
errorMsg
(
"数据校核信息错误"
);
}
}
if
(
loginUser
.
getId
()
!=
approvalId
)
{
if
(
loginUser
.
getId
()
!=
approvalId
)
{
return
BaseResponse
.
errorMsg
(
"当前登录账号没有数据校核权限"
);
return
BaseResponse
.
errorMsg
(
"当前登录账号没有数据校核权限"
);
}
}
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getCheckPage
(
page
,
params
);
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getCheckPage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
for
(
EntrustVo
entrustVo
:
list
)
{
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
//检测项目名称
//检测项目名称
String
sampleNames
=
""
;
String
sampleNames
=
""
;
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()>
0
)
{
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
//样品名称 列表中的拼接
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
sampleNames
=
sampleNames
.
equals
(
""
)?
sampleTmp
.
getName
():(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
sampleNames
=
sampleNames
.
equals
(
""
)
?
sampleTmp
.
getName
()
:
(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
}
}
entrustVo
.
setSampleNames
(
sampleNames
);
entrustVo
.
setSampleNames
(
sampleNames
);
//检测项 和检测依据 列表里只显示第一个样品的
//检测项 和检测依据 列表里只显示第一个样品的
SampleTmp
sampleTmp
=
sampleTmpList
.
get
(
0
);
SampleTmp
sampleTmp
=
sampleTmpList
.
get
(
0
);
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
checkTeam
=
""
;
String
checkTeam
=
""
;
if
(
teamIds
!=
null
)
{
if
(
teamIds
!=
null
)
{
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(
team
!=
null
)
{
checkTeam
=
checkTeam
.
equals
(
""
)?
team
.
getName
():(
checkTeam
+
"、"
+
team
.
getName
());
checkTeam
=
checkTeam
.
equals
(
""
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
}
}
}
...
@@ -1208,30 +1231,31 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1208,30 +1231,31 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 数据校核详情列表
* 数据校核详情列表
*
* @param id 委托表id
* @param id 委托表id
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
Map
<
String
,
Object
>>
getCheckList
(
Integer
id
)
{
public
BaseResponse
<
Map
<
String
,
Object
>>
getCheckList
(
Integer
id
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
List
<
Sample
>
sampleList
=
sampleMapper
.
getCheckSampleList
(
id
);
List
<
Sample
>
sampleList
=
sampleMapper
.
getCheckSampleList
(
id
);
List
<
SampleVo
>
sampleVoList
=
new
ArrayList
<>();
List
<
SampleVo
>
sampleVoList
=
new
ArrayList
<>();
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
)
{
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
for
(
Sample
sample
:
sampleList
)
{
for
(
Sample
sample
:
sampleList
)
{
SampleVo
sampleVo
=
new
SampleVo
();
SampleVo
sampleVo
=
new
SampleVo
();
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
,
null
);
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
,
null
);
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()>
0
)
{
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()
>
0
)
{
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
}
else
{
}
else
{
sampleVo
.
setSampleDistributionTeamVoList
(
null
);
sampleVo
.
setSampleDistributionTeamVoList
(
null
);
}
}
sampleVoList
.
add
(
sampleVo
);
sampleVoList
.
add
(
sampleVo
);
...
@@ -1244,15 +1268,16 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1244,15 +1268,16 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 样品检测项校核详情
* 样品检测项校核详情
*
* @param cementCode 本所编号
* @param cementCode 本所编号
* @return
* @return
*/
*/
public
BaseResponse
<
List
<
SampleCheckVo
>>
getCheckDetail
(
String
cementCode
)
{
public
BaseResponse
<
List
<
SampleCheckVo
>>
getCheckDetail
(
String
cementCode
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
}
if
(
StringUtils
.
isEmpty
(
cementCode
))
{
if
(
StringUtils
.
isEmpty
(
cementCode
))
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
...
@@ -1262,20 +1287,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1262,20 +1287,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List
<
SampleCheckVo
>
sampleCheckVoList
=
new
ArrayList
<>();
List
<
SampleCheckVo
>
sampleCheckVoList
=
new
ArrayList
<>();
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
)
{
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
Sample
sampleOne
=
sampleList
.
get
(
0
);
Sample
sampleOne
=
sampleList
.
get
(
0
);
if
(
sampleOne
==
null
)
{
if
(
sampleOne
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
Entrust
entrust
=
entrustMapper
.
selectById
(
sampleOne
.
getEntrustId
());
Entrust
entrust
=
entrustMapper
.
selectById
(
sampleOne
.
getEntrustId
());
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托单信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托单信息错误"
);
}
}
//根据样品 和派发任务表 找到都有哪些检测组
//根据样品 和派发任务表 找到都有哪些检测组
if
(
sampleOne
.
getIsCheck
()
==
0
)
{
//未校核时显示
if
(
sampleOne
.
getIsCheck
()
==
0
)
{
//未校核时显示
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
=
distributionMapper
.
getSampleCheckGroupList
(
sampleOne
.
getId
());
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
=
distributionMapper
.
getSampleCheckGroupList
(
sampleOne
.
getId
());
if
(
sampleCheckGroupVoList
!=
null
&&
sampleCheckGroupVoList
.
size
()>
0
)
{
if
(
sampleCheckGroupVoList
!=
null
&&
sampleCheckGroupVoList
.
size
()
>
0
)
{
for
(
SampleCheckGroupVo
sampleCheckGroupVo
:
sampleCheckGroupVoList
)
{
for
(
SampleCheckGroupVo
sampleCheckGroupVo
:
sampleCheckGroupVoList
)
{
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
sampleCheckVo
.
setEntrustId
(
entrust
.
getId
());
sampleCheckVo
.
setEntrustId
(
entrust
.
getId
());
sampleCheckVo
.
setSampleName
(
sampleOne
.
getName
());
sampleCheckVo
.
setSampleName
(
sampleOne
.
getName
());
...
@@ -1283,7 +1308,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1283,7 +1308,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleCheckVo
.
setTeamGroupId
(
sampleCheckGroupVo
.
getTeamGroupId
());
sampleCheckVo
.
setTeamGroupId
(
sampleCheckGroupVo
.
getTeamGroupId
());
sampleCheckVo
.
setTeamGroupName
(
sampleCheckGroupVo
.
getTeamGroupName
());
sampleCheckVo
.
setTeamGroupName
(
sampleCheckGroupVo
.
getTeamGroupName
());
TeamGroup
teamGroup
=
teamGroupMapper
.
selectById
(
sampleCheckGroupVo
.
getTeamGroupId
());
TeamGroup
teamGroup
=
teamGroupMapper
.
selectById
(
sampleCheckGroupVo
.
getTeamGroupId
());
if
(
teamGroup
==
null
)
{
if
(
teamGroup
==
null
)
{
return
BaseResponse
.
errorMsg
(
"检测组信息错误"
);
return
BaseResponse
.
errorMsg
(
"检测组信息错误"
);
}
}
//根据检测组id返回检测组对应的所有检测项信息
//根据检测组id返回检测组对应的所有检测项信息
...
@@ -1291,7 +1316,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1291,7 +1316,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleCheckVo
.
setCountResult
(
checkResutlList
.
toString
());
sampleCheckVo
.
setCountResult
(
checkResutlList
.
toString
());
sampleCheckVo
.
setIsParallel
(
sampleOne
.
getIsParallel
());
sampleCheckVo
.
setIsParallel
(
sampleOne
.
getIsParallel
());
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
for
(
Sample
sample
:
sampleList
)
{
for
(
Sample
sample
:
sampleList
)
{
SampleCheckTeamVo
sampleCheckTeamVo
=
new
SampleCheckTeamVo
();
SampleCheckTeamVo
sampleCheckTeamVo
=
new
SampleCheckTeamVo
();
sampleCheckTeamVo
.
setCheckId
(
null
);
sampleCheckTeamVo
.
setCheckId
(
null
);
sampleCheckTeamVo
.
setSampleId
(
sample
.
getId
());
sampleCheckTeamVo
.
setSampleId
(
sample
.
getId
());
...
@@ -1312,12 +1337,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1312,12 +1337,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleCheckVoList
.
add
(
sampleCheckVo
);
sampleCheckVoList
.
add
(
sampleCheckVo
);
}
}
}
}
}
else
{
//校核之后显示
}
else
{
//校核之后显示
QueryWrapper
<
SampleCheck
>
sampleCheckQW
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleCheck
>
sampleCheckQW
=
new
QueryWrapper
<>();
sampleCheckQW
.
eq
(
"cement_code"
,
cementCode
);
sampleCheckQW
.
eq
(
"cement_code"
,
cementCode
);
List
<
SampleCheck
>
sampleCheckList
=
sampleCheckMapper
.
selectList
(
sampleCheckQW
);
List
<
SampleCheck
>
sampleCheckList
=
sampleCheckMapper
.
selectList
(
sampleCheckQW
);
if
(
sampleCheckList
!=
null
&&
sampleCheckList
.
size
()>
0
)
{
if
(
sampleCheckList
!=
null
&&
sampleCheckList
.
size
()
>
0
)
{
for
(
SampleCheck
sampleCheck
:
sampleCheckList
)
{
for
(
SampleCheck
sampleCheck
:
sampleCheckList
)
{
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
sampleCheckVo
.
setEntrustId
(
entrust
.
getId
());
sampleCheckVo
.
setEntrustId
(
entrust
.
getId
());
sampleCheckVo
.
setSampleName
(
sampleOne
.
getName
());
sampleCheckVo
.
setSampleName
(
sampleOne
.
getName
());
...
@@ -1330,8 +1355,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1330,8 +1355,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleCheckTeamQW
.
eq
(
"checkId"
,
sampleCheck
.
getId
());
sampleCheckTeamQW
.
eq
(
"checkId"
,
sampleCheck
.
getId
());
List
<
SampleCheckTeam
>
sampleCheckTeamList
=
sampleCheckTeamMapper
.
selectList
(
sampleCheckTeamQW
);
List
<
SampleCheckTeam
>
sampleCheckTeamList
=
sampleCheckTeamMapper
.
selectList
(
sampleCheckTeamQW
);
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
if
(
sampleCheckTeamList
!=
null
&&
sampleCheckTeamList
.
size
()>
0
)
{
if
(
sampleCheckTeamList
!=
null
&&
sampleCheckTeamList
.
size
()
>
0
)
{
for
(
SampleCheckTeam
sampleCheckTeam
:
sampleCheckTeamList
)
{
for
(
SampleCheckTeam
sampleCheckTeam
:
sampleCheckTeamList
)
{
SampleCheckTeamVo
sampleCheckTeamVo
=
new
SampleCheckTeamVo
();
SampleCheckTeamVo
sampleCheckTeamVo
=
new
SampleCheckTeamVo
();
sampleCheckTeamVo
.
setCheckId
(
sampleCheck
.
getId
());
sampleCheckTeamVo
.
setCheckId
(
sampleCheck
.
getId
());
sampleCheckTeamVo
.
setSampleId
(
sampleCheckTeam
.
getSampleId
());
sampleCheckTeamVo
.
setSampleId
(
sampleCheckTeam
.
getSampleId
());
...
@@ -1359,12 +1384,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1359,12 +1384,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 根据样品id,检测组id,检测人id 查询任务检测附件信息
* 根据样品id,检测组id,检测人id 查询任务检测附件信息
*
* @param sampleId
* @param sampleId
* @param teamGroupId
* @param teamGroupId
* @param userId
* @param userId
* @return
* @return
*/
*/
public
BaseResponse
<
List
<
SampleDistribution
>>
getEnclosureList
(
Integer
sampleId
,
Integer
teamGroupId
,
Integer
userId
)
{
public
BaseResponse
<
List
<
SampleDistribution
>>
getEnclosureList
(
Integer
sampleId
,
Integer
teamGroupId
,
Integer
userId
)
{
QueryWrapper
<
SampleDistribution
>
sdQueryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleDistribution
>
sdQueryWrapper
=
new
QueryWrapper
<>();
sdQueryWrapper
.
eq
(
"sample_id"
,
sampleId
);
sdQueryWrapper
.
eq
(
"sample_id"
,
sampleId
);
sdQueryWrapper
.
eq
(
"team_group_id"
,
teamGroupId
);
sdQueryWrapper
.
eq
(
"team_group_id"
,
teamGroupId
);
...
@@ -1376,87 +1402,88 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1376,87 +1402,88 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
/**
* 校核计算
* 校核计算
*
* @param query
* @param query
* @return
* @return
*/
*/
public
BaseResponse
<
Map
<
String
,
String
>>
checkCount
(
CheckCountQuery
query
)
{
public
BaseResponse
<
Map
<
String
,
String
>>
checkCount
(
CheckCountQuery
query
)
{
if
(
query
==
null
)
{
if
(
query
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
List
<
String
>
checkResutlList
=
teamMapper
.
getByGroup
(
query
.
getTeamGroupId
());
List
<
String
>
checkResutlList
=
teamMapper
.
getByGroup
(
query
.
getTeamGroupId
());
Map
<
String
,
String
>
countMap
=
new
HashMap
<>();
Map
<
String
,
String
>
countMap
=
new
HashMap
<>();
if
(
query
.
getIsParallel
()
==
0
)
{
if
(
query
.
getIsParallel
()
==
0
)
{
Map
<
String
,
String
>
mainMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getMainResult
());
Map
<
String
,
String
>
mainMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getMainResult
());
countMap
=
mainMap
;
countMap
=
mainMap
;
}
else
if
(
query
.
getIsParallel
()
==
1
)
{
}
else
if
(
query
.
getIsParallel
()
==
1
)
{
Map
<
String
,
String
>
mainMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getMainResult
());
Map
<
String
,
String
>
mainMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getMainResult
());
Map
<
String
,
String
>
secondaryMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getSecondaryResult
());
Map
<
String
,
String
>
secondaryMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getSecondaryResult
());
for
(
String
name
:
checkResutlList
)
{
for
(
String
name
:
checkResutlList
)
{
if
(
name
.
equals
(
"L.O.I"
))
{
if
(
name
.
equals
(
"L.O.I"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"SiO2"
))
{
}
else
if
(
name
.
equals
(
"SiO2"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"Al2O3+TiO2"
))
{
}
else
if
(
name
.
equals
(
"Al2O3+TiO2"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"Al2O3"
))
{
}
else
if
(
name
.
equals
(
"Al2O3"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"Fe2O3"
))
{
}
else
if
(
name
.
equals
(
"Fe2O3"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"CaO"
))
{
}
else
if
(
name
.
equals
(
"CaO"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"MgO"
))
{
}
else
if
(
name
.
equals
(
"MgO"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"TiO2"
))
{
}
else
if
(
name
.
equals
(
"TiO2"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"K2O"
))
{
}
else
if
(
name
.
equals
(
"K2O"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"Na2O"
))
{
}
else
if
(
name
.
equals
(
"Na2O"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"SO3"
))
{
}
else
if
(
name
.
equals
(
"SO3"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"Cl"
))
{
}
else
if
(
name
.
equals
(
"Cl"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"合量"
))
{
}
else
if
(
name
.
equals
(
"合量"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"KH"
))
{
}
else
if
(
name
.
equals
(
"KH"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"SM"
))
{
}
else
if
(
name
.
equals
(
"SM"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
if
(
name
.
equals
(
"AM"
))
{
}
else
if
(
name
.
equals
(
"AM"
))
{
String
parallelResult
=
String
parallelResult
=
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
countMap
.
put
(
name
,
parallelResult
);
countMap
.
put
(
name
,
parallelResult
);
}
else
{
}
else
{
countMap
.
put
(
name
,
mainMap
.
get
(
name
));
countMap
.
put
(
name
,
mainMap
.
get
(
name
));
}
}
}
}
...
@@ -1465,39 +1492,38 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1465,39 +1492,38 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
/**
/**
* 数据校核
* 数据校核
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
check
(
CheckQuery
query
)
{
public
BaseResponse
<
String
>
check
(
CheckQuery
query
)
{
if
(
query
.
getId
()
==
null
)
{
if
(
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
Entrust
entrust
=
entrustMapper
.
selectById
(
query
.
getId
());
Entrust
entrust
=
entrustMapper
.
selectById
(
query
.
getId
());
entrust
.
setStatus
(
7
);
entrust
.
setStatus
(
7
);
if
(
entrust
==
null
)
{
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
}
if
(
entrust
.
getStatus
()
<
6
)
{
if
(
entrust
.
getStatus
()
<
6
)
{
return
BaseResponse
.
errorMsg
(
"当前状态不允许校核"
);
return
BaseResponse
.
errorMsg
(
"当前状态不允许校核"
);
}
}
LoginUser
loginUser
=
userService
.
getLoginUser
();
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录用户"
);
return
BaseResponse
.
errorMsg
(
"请登录用户"
);
}
}
String
cementCode
=
""
;
String
cementCode
=
""
;
if
(
query
.
getSampleCheckTeamQueryList
()
!=
null
&&
query
.
getSampleCheckTeamQueryList
().
size
()>
0
)
{
if
(
query
.
getSampleCheckTeamQueryList
()
!=
null
&&
query
.
getSampleCheckTeamQueryList
().
size
()
>
0
)
{
List
<
SampleCheckTeamQuery
>
sctQueryList
=
query
.
getSampleCheckTeamQueryList
();
List
<
SampleCheckTeamQuery
>
sctQueryList
=
query
.
getSampleCheckTeamQueryList
();
for
(
SampleCheckTeamQuery
sctQuery
:
sctQueryList
)
{
for
(
SampleCheckTeamQuery
sctQuery
:
sctQueryList
)
{
if
(
sctQuery
==
null
||
sctQuery
.
getCementCode
()
==
null
)
{
if
(
sctQuery
==
null
||
sctQuery
.
getCementCode
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"检测组或样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"检测组或样品信息错误"
);
}
}
if
(
sctQuery
.
getTeamGroupId
()==
null
||
StringUtils
.
isEmpty
(
sctQuery
.
getTeamGroupName
()))
{
if
(
sctQuery
.
getTeamGroupId
()
==
null
||
StringUtils
.
isEmpty
(
sctQuery
.
getTeamGroupName
()))
{
return
BaseResponse
.
errorMsg
(
"请选择检测组"
);
return
BaseResponse
.
errorMsg
(
"请选择检测组"
);
}
}
cementCode
=
sctQuery
.
getCementCode
();
//获取本所编号用于判断委托单和样品表状态
cementCode
=
sctQuery
.
getCementCode
();
//获取本所编号用于判断委托单和样品表状态
...
@@ -1538,7 +1564,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1538,7 +1564,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setCreateTime
(
LocalDateTime
.
now
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setRemark
(
"委托派发-数据校核"
);
.
setRemark
(
"委托派发-数据校核"
);
equipmentUseMapper
.
insert
(
equipmentUse
);
equipmentUseMapper
.
insert
(
equipmentUse
);
if
(
check
.
getIsParallel
()
==
1
)
{
if
(
check
.
getIsParallel
()
==
1
)
{
SampleCheckTeam
sampleCheckTeam2
=
new
SampleCheckTeam
();
SampleCheckTeam
sampleCheckTeam2
=
new
SampleCheckTeam
();
sampleCheckTeam2
.
setCheckId
(
check
.
getId
())
sampleCheckTeam2
.
setCheckId
(
check
.
getId
())
.
setSampleId
(
sctQuery
.
getSecondarySampleId
())
.
setSampleId
(
sctQuery
.
getSecondarySampleId
())
...
@@ -1570,8 +1596,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1570,8 +1596,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
QueryWrapper
<
Sample
>
sampleQW
=
new
QueryWrapper
<>();
QueryWrapper
<
Sample
>
sampleQW
=
new
QueryWrapper
<>();
sampleQW
.
eq
(
"cement_code"
,
cementCode
);
sampleQW
.
eq
(
"cement_code"
,
cementCode
);
List
<
Sample
>
sampleList
=
sampleMapper
.
selectList
(
sampleQW
);
List
<
Sample
>
sampleList
=
sampleMapper
.
selectList
(
sampleQW
);
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
)
{
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
for
(
Sample
sample
:
sampleList
)
{
for
(
Sample
sample
:
sampleList
)
{
sample
.
setIsCheck
(
1
);
sample
.
setIsCheck
(
1
);
sampleMapper
.
updateById
(
sample
);
sampleMapper
.
updateById
(
sample
);
}
}
...
@@ -1579,7 +1605,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1579,7 +1605,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//如果是保存并完成按钮,检测委托单中其他样品是否都是保存冰完成状态,如果是,委托单为检测完成状态
//如果是保存并完成按钮,检测委托单中其他样品是否都是保存冰完成状态,如果是,委托单为检测完成状态
List
<
Sample
>
sampleNoCheckList
=
sampleMapper
.
getNoCheckList
(
entrust
.
getId
());
List
<
Sample
>
sampleNoCheckList
=
sampleMapper
.
getNoCheckList
(
entrust
.
getId
());
if
(
sampleNoCheckList
==
null
||
sampleNoCheckList
.
size
()
==
0
)
{
if
(
sampleNoCheckList
==
null
||
sampleNoCheckList
.
size
()
==
0
)
{
entrust
.
setStatus
(
8
);
entrust
.
setStatus
(
8
);
}
}
entrustMapper
.
updateById
(
entrust
);
entrustMapper
.
updateById
(
entrust
);
...
@@ -1590,10 +1616,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1590,10 +1616,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getReportPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
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
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"endDate"
,
endDate
);
...
@@ -1606,9 +1628,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1606,9 +1628,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
approvalId
==
null
)
{
if
(
approvalId
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
}
}
if
(
loginUser
.
getId
()
!=
approvalId
)
{
params
.
put
(
"userId"
,
loginUser
.
getId
());
}
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getPage
(
page
,
params
);
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getPage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
...
@@ -1623,7 +1642,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1623,7 +1642,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
//样品名称 列表中的拼接
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
sampleNames
=
sampleNames
.
equals
(
""
)
?
sampleTmp
.
getName
()
:
(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
sampleNames
=
""
.
equals
(
sampleNames
)
?
sampleTmp
.
getName
()
:
(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
}
}
entrustVo
.
setSampleNames
(
sampleNames
);
entrustVo
.
setSampleNames
(
sampleNames
);
//检测项 和检测依据 列表里只显示第一个样品的
//检测项 和检测依据 列表里只显示第一个样品的
...
@@ -1635,7 +1654,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1635,7 +1654,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(
team
!=
null
)
{
checkTeam
=
checkTeam
.
equals
(
""
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
checkTeam
=
""
.
equals
(
checkTeam
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
}
}
}
...
@@ -1720,25 +1739,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1720,25 +1739,20 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getQualityPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
public
BaseResponse
<
IPage
<
EntrustVo
>>
getQualityPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>(
9
);
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"status"
,
8
);
params
.
put
(
"status"
,
8
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"projectType"
,
"质量
检测
"
);
params
.
put
(
"projectType"
,
"质量
控制
"
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"委托评审"
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"委托评审"
);
if
(
approvalId
==
null
)
{
if
(
approvalId
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
}
}
if
(
loginUser
.
getId
()
!=
approvalId
)
{
params
.
put
(
"userId"
,
loginUser
.
getId
());
}
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getPage
(
page
,
params
);
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getPage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
...
@@ -1753,7 +1767,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1753,7 +1767,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()
>
0
)
{
//样品名称 列表中的拼接
//样品名称 列表中的拼接
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
for
(
SampleTmp
sampleTmp
:
sampleTmpList
)
{
sampleNames
=
sampleNames
.
equals
(
""
)
?
sampleTmp
.
getName
()
:
(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
sampleNames
=
""
.
equals
(
sampleNames
)
?
sampleTmp
.
getName
()
:
(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
}
}
entrustVo
.
setSampleNames
(
sampleNames
);
entrustVo
.
setSampleNames
(
sampleNames
);
//检测项 和检测依据 列表里只显示第一个样品的
//检测项 和检测依据 列表里只显示第一个样品的
...
@@ -1765,7 +1779,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1765,7 +1779,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
for
(
String
teamId
:
teamIdS
)
{
for
(
String
teamId
:
teamIdS
)
{
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
)
{
if
(
team
!=
null
)
{
checkTeam
=
checkTeam
.
equals
(
""
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
checkTeam
=
""
.
equals
(
checkTeam
)
?
team
.
getName
()
:
(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
}
}
}
...
@@ -1786,13 +1800,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1786,13 +1800,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
null
;
return
null
;
}
}
QualityDetail
firstQualityDetail
=
qualityDetails
.
get
(
0
);
QualityDetail
firstQualityDetail
=
qualityDetails
.
get
(
0
);
QualityDetailVo
qualityDetailVo
=
new
QualityDetailVo
();
QualityDetailVo
qualityDetailVo
=
new
QualityDetailVo
();
qualityDetailVo
.
setProjectName
(
firstQualityDetail
.
getProjectName
());
BeanUtil
.
copyProperties
(
firstQualityDetail
,
qualityDetailVo
);
qualityDetailVo
.
setEntrustCode
(
firstQualityDetail
.
getEntrustCode
());
qualityDetailVo
.
setSampleNum
(
firstQualityDetail
.
getSampleNum
());
qualityDetailVo
.
setSendPhone
(
firstQualityDetail
.
getSendPhone
());
qualityDetailVo
.
setSendName
(
firstQualityDetail
.
getSendName
());
//获取clientId和userName
//获取clientId和userName
String
userCacheKey
=
"CACHE:USER"
;
String
userCacheKey
=
"CACHE:USER"
;
String
clientCacheKey
=
"CACHE:CLIENT"
;
String
clientCacheKey
=
"CACHE:CLIENT"
;
...
@@ -1814,14 +1823,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1814,14 +1823,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
filter
(
opt
->
opt
.
getId
().
intValue
()
==
firstQualityDetail
.
getClientId
())
.
filter
(
opt
->
opt
.
getId
().
intValue
()
==
firstQualityDetail
.
getClientId
())
.
findFirst
().
ifPresent
(
opt
->
qualityDetailVo
.
setClientName
(
opt
.
getName
()));
.
findFirst
().
ifPresent
(
opt
->
qualityDetailVo
.
setClientName
(
opt
.
getName
()));
//关联检测者名字
//关联检测者名字
qualityDetails
.
forEach
(
arg
->
{
qualityDetails
.
forEach
(
arg
->
sysUsers
.
stream
()
sysUsers
.
stream
()
.
filter
(
opt
->
opt
.
getId
().
intValue
()
==
arg
.
getUserId
())
.
filter
(
opt
->
opt
.
getId
().
intValue
()
==
arg
.
getUserId
())
.
findFirst
().
ifPresent
(
opt
->
{
.
findFirst
().
ifPresent
(
opt
->
arg
.
setUserName
(
opt
.
getName
())));
arg
.
setUserName
(
opt
.
getName
());
});
});
//为每个检测组 创建实体
//为每个检测组 创建实体
qualityDetails
.
stream
()
qualityDetails
.
stream
()
.
map
(
QualityDetail:
:
getTeamGroupName
)
.
map
(
QualityDetail:
:
getTeamGroupName
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/StandardServiceImpl.java
View file @
77b114eb
...
@@ -8,6 +8,7 @@ import cn.wise.sc.cement.business.model.BaseResponse;
...
@@ -8,6 +8,7 @@ import cn.wise.sc.cement.business.model.BaseResponse;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.vo.StandardValueVo
;
import
cn.wise.sc.cement.business.model.vo.StandardVo
;
import
cn.wise.sc.cement.business.model.vo.StandardVo
;
import
cn.wise.sc.cement.business.service.IStandardEnterService
;
import
cn.wise.sc.cement.business.service.IStandardEnterService
;
import
cn.wise.sc.cement.business.service.IStandardService
;
import
cn.wise.sc.cement.business.service.IStandardService
;
...
@@ -56,6 +57,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -56,6 +57,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/**
/**
* 分页查询
* 分页查询
*
* @param pageQuery
* @param pageQuery
* @param name
* @param name
* @param supplierName
* @param supplierName
...
@@ -64,10 +66,10 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -64,10 +66,10 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
@Override
@Override
public
BaseResponse
<
IPage
<
Standard
>>
getPage
(
PageQuery
pageQuery
,
String
name
,
String
supplierName
)
{
public
BaseResponse
<
IPage
<
Standard
>>
getPage
(
PageQuery
pageQuery
,
String
name
,
String
supplierName
)
{
QueryWrapper
<
Standard
>
qw
=
new
QueryWrapper
<>();
QueryWrapper
<
Standard
>
qw
=
new
QueryWrapper
<>();
if
(
StringUtils
.
isNotEmpty
(
name
))
{
if
(
StringUtils
.
isNotEmpty
(
name
))
{
qw
.
like
(
"name"
,
name
);
qw
.
like
(
"name"
,
name
);
}
}
if
(
StringUtils
.
isNotEmpty
(
supplierName
))
{
if
(
StringUtils
.
isNotEmpty
(
supplierName
))
{
qw
.
like
(
"supplier_name"
,
supplierName
);
qw
.
like
(
"supplier_name"
,
supplierName
);
}
}
qw
.
orderByDesc
(
"create_time"
);
qw
.
orderByDesc
(
"create_time"
);
...
@@ -79,6 +81,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -79,6 +81,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/**
/**
* 新增标样
* 新增标样
*
* @param query
* @param query
* @return
* @return
*/
*/
...
@@ -100,19 +103,19 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -100,19 +103,19 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
.
setCreateTime
(
LocalDateTime
.
now
());
.
setCreateTime
(
LocalDateTime
.
now
());
standardMapper
.
insert
(
standard
);
standardMapper
.
insert
(
standard
);
//添加标准值
//添加标准值
if
(
query
.
getStandardValueQueryList
()
!=
null
&&
query
.
getStandardValueQueryList
().
size
()>
0
)
{
if
(
query
.
getStandardValueQueryList
()
!=
null
&&
query
.
getStandardValueQueryList
().
size
()
>
0
)
{
List
<
StandardValueQuery
>
standardValueQueryList
=
query
.
getStandardValueQueryList
();
List
<
StandardValueQuery
>
standardValueQueryList
=
query
.
getStandardValueQueryList
();
List
<
StandardValue
>
standardValueList
=
new
ArrayList
<>();
List
<
StandardValue
>
standardValueList
=
new
ArrayList
<>();
for
(
StandardValueQuery
standardValueQuery
:
standardValueQueryList
)
{
for
(
StandardValueQuery
standardValueQuery
:
standardValueQueryList
)
{
StandardValue
standardValue
=
new
StandardValue
();
StandardValue
standardValue
=
new
StandardValue
();
standardValue
.
setStandardId
(
standard
.
getId
())
standardValue
.
setStandardId
(
standard
.
getId
())
.
setElementName
(
standardValueQuery
.
getElementName
())
.
setElementName
(
standardValueQuery
.
getElementName
())
.
setCreateTime
(
LocalDateTime
.
now
());
.
setCreateTime
(
LocalDateTime
.
now
());
if
(
standardValueQuery
.
getElementValue
()
!=
null
&&
standardValueQuery
.
getElementValue
().
size
()>
0
)
{
if
(
standardValueQuery
.
getElementValue
()
!=
null
&&
standardValueQuery
.
getElementValue
().
size
()
>
0
)
{
String
elementValue
=
JSON
.
toJSON
(
standardValueQuery
.
getElementValue
()).
toString
();
String
elementValue
=
JSON
.
toJSON
(
standardValueQuery
.
getElementValue
()).
toString
();
standardValue
.
setElementValue
(
elementValue
);
standardValue
.
setElementValue
(
elementValue
);
}
else
{
}
else
{
standardValue
.
setElementValue
(
null
);
standardValue
.
setElementValue
(
null
);
}
}
standardValueList
.
add
(
standardValue
);
standardValueList
.
add
(
standardValue
);
...
@@ -130,7 +133,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -130,7 +133,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
standardEnterMapper
.
insert
(
enter
);
standardEnterMapper
.
insert
(
enter
);
//保存标样材料信息
//保存标样材料信息
Boolean
ref
=
commonService
.
saveEntityEnclosure
(
EntityEnclosure
.
EntityType
.
STANDARD_SAMPLE
,
standard
.
getId
(),
query
.
getEnclosureQueryList
());
Boolean
ref
=
commonService
.
saveEntityEnclosure
(
EntityEnclosure
.
EntityType
.
STANDARD_SAMPLE
,
standard
.
getId
(),
query
.
getEnclosureQueryList
());
if
(!
ref
)
{
if
(!
ref
)
{
return
BaseResponse
.
errorMsg
(
"保存保存校核附件失败!"
);
return
BaseResponse
.
errorMsg
(
"保存保存校核附件失败!"
);
}
}
...
@@ -139,6 +142,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -139,6 +142,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/**
/**
* 修改标样
* 修改标样
*
* @param query
* @param query
* @return
* @return
*/
*/
...
@@ -159,7 +163,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -159,7 +163,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
BeanUtils
.
copyProperties
(
query
,
standard
);
BeanUtils
.
copyProperties
(
query
,
standard
);
standardMapper
.
updateById
(
standard
);
standardMapper
.
updateById
(
standard
);
//添加标准值
//添加标准值
if
(
query
.
getStandardValueQueryList
()
!=
null
&&
query
.
getStandardValueQueryList
().
size
()>
0
)
{
if
(
query
.
getStandardValueQueryList
()
!=
null
&&
query
.
getStandardValueQueryList
().
size
()
>
0
)
{
//删除之前的标准值信息
//删除之前的标准值信息
QueryWrapper
<
StandardValue
>
queryWrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
StandardValue
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"standard_id"
,
standard
.
getId
());
queryWrapper
.
eq
(
"standard_id"
,
standard
.
getId
());
...
@@ -167,15 +171,15 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -167,15 +171,15 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
//添加新的标准值
//添加新的标准值
List
<
StandardValueQuery
>
standardValueQueryList
=
query
.
getStandardValueQueryList
();
List
<
StandardValueQuery
>
standardValueQueryList
=
query
.
getStandardValueQueryList
();
List
<
StandardValue
>
standardValueList
=
new
ArrayList
<>();
List
<
StandardValue
>
standardValueList
=
new
ArrayList
<>();
for
(
StandardValueQuery
standardValueQuery
:
standardValueQueryList
)
{
for
(
StandardValueQuery
standardValueQuery
:
standardValueQueryList
)
{
StandardValue
standardValue
=
new
StandardValue
();
StandardValue
standardValue
=
new
StandardValue
();
standardValue
.
setStandardId
(
standard
.
getId
())
standardValue
.
setStandardId
(
standard
.
getId
())
.
setElementName
(
standardValueQuery
.
getElementName
())
.
setElementName
(
standardValueQuery
.
getElementName
())
.
setCreateTime
(
LocalDateTime
.
now
());
.
setCreateTime
(
LocalDateTime
.
now
());
if
(
standardValueQuery
.
getElementValue
()
!=
null
&&
standardValueQuery
.
getElementValue
().
size
()>
0
)
{
if
(
standardValueQuery
.
getElementValue
()
!=
null
&&
standardValueQuery
.
getElementValue
().
size
()
>
0
)
{
String
elementValue
=
JSON
.
toJSON
(
standardValueQuery
.
getElementValue
()).
toString
();
String
elementValue
=
JSON
.
toJSON
(
standardValueQuery
.
getElementValue
()).
toString
();
standardValue
.
setElementValue
(
elementValue
);
standardValue
.
setElementValue
(
elementValue
);
}
else
{
}
else
{
standardValue
.
setElementValue
(
null
);
standardValue
.
setElementValue
(
null
);
}
}
standardValueList
.
add
(
standardValue
);
standardValueList
.
add
(
standardValue
);
...
@@ -184,7 +188,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -184,7 +188,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
}
}
//保存标样材料信息
//保存标样材料信息
Boolean
ref
=
commonService
.
saveEntityEnclosure
(
EntityEnclosure
.
EntityType
.
STANDARD_SAMPLE
,
standard
.
getId
(),
query
.
getEnclosureQueryList
());
Boolean
ref
=
commonService
.
saveEntityEnclosure
(
EntityEnclosure
.
EntityType
.
STANDARD_SAMPLE
,
standard
.
getId
(),
query
.
getEnclosureQueryList
());
if
(!
ref
)
{
if
(!
ref
)
{
return
BaseResponse
.
errorMsg
(
"保存保存校核附件失败!"
);
return
BaseResponse
.
errorMsg
(
"保存保存校核附件失败!"
);
}
}
return
BaseResponse
.
okData
(
standard
);
return
BaseResponse
.
okData
(
standard
);
...
@@ -192,13 +196,14 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -192,13 +196,14 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/**
/**
* 标样详情
* 标样详情
*
* @param id 标样表id
* @param id 标样表id
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
StandardVo
>
getDetail
(
Integer
id
)
{
public
BaseResponse
<
StandardVo
>
getDetail
(
Integer
id
)
{
Standard
standard
=
standardMapper
.
selectById
(
id
);
Standard
standard
=
standardMapper
.
selectById
(
id
);
if
(
standard
==
null
)
{
if
(
standard
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
}
StandardVo
standardVo
=
new
StandardVo
();
StandardVo
standardVo
=
new
StandardVo
();
...
@@ -207,7 +212,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -207,7 +212,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
(
EntityEnclosure
.
EntityType
.
STANDARD_SAMPLE
,
standard
.
getId
());
(
EntityEnclosure
.
EntityType
.
STANDARD_SAMPLE
,
standard
.
getId
());
List
<
EnclosureQuery
>
enclosureQueryList
=
new
ArrayList
<>();
List
<
EnclosureQuery
>
enclosureQueryList
=
new
ArrayList
<>();
for
(
EntityEnclosure
entityEnclosure
:
entityEnclosureList
)
{
for
(
EntityEnclosure
entityEnclosure
:
entityEnclosureList
)
{
EnclosureQuery
enclosureQuery
=
new
EnclosureQuery
();
EnclosureQuery
enclosureQuery
=
new
EnclosureQuery
();
enclosureQuery
.
setAlias
(
entityEnclosure
.
getAlias
())
enclosureQuery
.
setAlias
(
entityEnclosure
.
getAlias
())
.
setEnclosureUrl
(
entityEnclosure
.
getEnclosureUrl
())
.
setEnclosureUrl
(
entityEnclosure
.
getEnclosureUrl
())
...
@@ -225,18 +230,19 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -225,18 +230,19 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/**
/**
*新增入库
* 新增入库
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
enter
(
ChangeStockQuery
query
)
{
public
BaseResponse
<
String
>
enter
(
ChangeStockQuery
query
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
}
Standard
standard
=
standardMapper
.
selectById
(
query
.
getId
());
Standard
standard
=
standardMapper
.
selectById
(
query
.
getId
());
if
(
standard
==
null
)
{
if
(
standard
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
}
StandardEnter
enter
=
new
StandardEnter
();
StandardEnter
enter
=
new
StandardEnter
();
...
@@ -254,17 +260,18 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -254,17 +260,18 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/**
/**
* 领用出库
* 领用出库
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
out
(
ChangeStockQuery
query
)
{
public
BaseResponse
<
String
>
out
(
ChangeStockQuery
query
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
}
Standard
standard
=
standardMapper
.
selectById
(
query
.
getId
());
Standard
standard
=
standardMapper
.
selectById
(
query
.
getId
());
if
(
standard
==
null
)
{
if
(
standard
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
}
StandardOut
out
=
new
StandardOut
();
StandardOut
out
=
new
StandardOut
();
...
@@ -281,17 +288,18 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -281,17 +288,18 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/**
/**
* 变更有效期
* 变更有效期
*
* @param query
* @param query
* @return
* @return
*/
*/
@Transactional
@Transactional
@Override
@Override
public
BaseResponse
<
String
>
changeValidDate
(
ChangeValidDateQuery
query
)
{
public
BaseResponse
<
String
>
changeValidDate
(
ChangeValidDateQuery
query
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
}
Standard
standard
=
standardMapper
.
selectById
(
query
.
getId
());
Standard
standard
=
standardMapper
.
selectById
(
query
.
getId
());
if
(
standard
==
null
)
{
if
(
standard
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
}
...
@@ -303,6 +311,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -303,6 +311,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
/**
/**
* 过期处置
* 过期处置
*
* @param id
* @param id
* @return
* @return
*/
*/
...
@@ -313,7 +322,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -313,7 +322,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
}
Standard
standard
=
standardMapper
.
selectById
(
id
);
Standard
standard
=
standardMapper
.
selectById
(
id
);
if
(
standard
==
null
)
{
if
(
standard
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
}
standard
.
setStatus
(
0
);
standard
.
setStatus
(
0
);
...
@@ -321,7 +330,16 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
...
@@ -321,7 +330,16 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
return
BaseResponse
.
okData
(
"过期处置完成"
);
return
BaseResponse
.
okData
(
"过期处置完成"
);
}
}
@Override
public
BaseResponse
<
List
<
StandardValueVo
>>
getStandardDetailList
()
{
List
<
StandardValueVo
>
standardValueVos
=
standardMapper
.
getStandardDetaulList
();
if
(
standardValueVos
.
size
()
!=
0
)
{
return
BaseResponse
.
okData
(
standardValueVos
);
}
else
{
return
BaseResponse
.
errorMsg
(
"没找数据!"
);
}
}
}
}
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