Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
Overview
Overview
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
wangweidong
patzn-cloud-service-hmhj
Commits
0ad36d00
Commit
0ad36d00
authored
Jul 30, 2021
by
ghxdhr
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.patzn.com:wangweidong/patzn-cloud-service-hmhj
parents
bbf333e4
821c05a0
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
180 additions
and
65 deletions
+180
-65
EntrustController.java
...cloud/service/lims/hmhj/controller/EntrustController.java
+6
-1
EntrustReportController.java
...service/lims/hmhj/controller/EntrustReportController.java
+13
-0
EntrustReportTemplateConfigController.java
...mhj/controller/EntrustReportTemplateConfigController.java
+8
-8
EntrustReportTemplateController.java
...lims/hmhj/controller/EntrustReportTemplateController.java
+18
-19
EntrustReportTemplateConfigMapper.java
...e/lims/hmhj/mapper/EntrustReportTemplateConfigMapper.java
+2
-0
EntrustReportTemplateMapper.java
...service/lims/hmhj/mapper/EntrustReportTemplateMapper.java
+3
-1
IEntrustReportService.java
...loud/service/lims/hmhj/service/IEntrustReportService.java
+4
-0
IEntrustReportTemplateConfigService.java
...ims/hmhj/service/IEntrustReportTemplateConfigService.java
+3
-0
IEntrustReportTemplateService.java
...vice/lims/hmhj/service/IEntrustReportTemplateService.java
+3
-0
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+16
-0
EntrustReportTemplateConfigServiceImpl.java
.../service/impl/EntrustReportTemplateConfigServiceImpl.java
+11
-1
EntrustReportTemplateServiceImpl.java
...s/hmhj/service/impl/EntrustReportTemplateServiceImpl.java
+10
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+15
-21
EntrustMapper.xml
src/main/resources/mapper/hmhj/EntrustMapper.xml
+32
-13
EntrustReportTemplateConfigMapper.xml
...sources/mapper/hmhj/EntrustReportTemplateConfigMapper.xml
+15
-0
EntrustReportTemplateMapper.xml
...ain/resources/mapper/hmhj/EntrustReportTemplateMapper.xml
+20
-0
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+1
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustController.java
View file @
0ad36d00
...
...
@@ -227,6 +227,8 @@ public class EntrustController extends ServiceController {
public
RestResult
<
Page
<
EntrustVO
>>
getPageMakeHis
(
EntrustVO
entrust
)
{
entrust
.
setNotSampleStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
// 涉及到检测人的数据
entrust
.
setTesterId
(
getAccount
().
getUserId
());
return
success
(
entrustService
.
pageEntrustByNotSample
(
getPage
(),
entrust
));
}
...
...
@@ -487,7 +489,7 @@ public class EntrustController extends ServiceController {
public
RestResult
<
Page
<
EntrustVO
>>
getPageTaskTestData
(
EntrustVO
entrust
)
{
entrust
.
setItemStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
// 过滤当前人为检测人的委托数据 - 节点数据不为空,且为检测时,只查询当前人信息
if
(
StringUtils
.
isNotBlank
(
entrust
.
getSource
())
&&
EntrustFlowEnum
.
TEST
.
getName
().
equalsIgnoreCase
(
entrust
.
getSource
()))
{
if
(
EntrustFlowEnum
.
TEST
.
getName
().
equalsIgnoreCase
(
entrust
.
getSource
()))
{
entrust
.
setTesterId
(
getAccount
().
getUserId
());
}
// 获取当前用户分组
...
...
@@ -535,6 +537,7 @@ public class EntrustController extends ServiceController {
));
// 获取当前用户分组
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
entrust
.
setTesterId
(
getAccount
().
getUserId
());
return
success
(
entrustService
.
pageEntrustByItemDataHis
(
getPage
(),
entrust
));
}
...
...
@@ -610,6 +613,7 @@ public class EntrustController extends ServiceController {
entrust
.
setSampleStatus
(
EntrustSampleStatusEnum
.
REPORT_MAKE
);
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
REPORT_MAKE
.
getName
());
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
entrust
.
setTesterId
(
getAccount
().
getUserId
());
return
success
(
entrustService
.
pageEntrustBySample
(
getPage
(),
entrust
));
}
...
...
@@ -624,6 +628,7 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_entrust_report_make_his"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportMakeHis
(
EntrustVO
entrust
)
{
entrust
.
setReportNotStatus
(
EntrustReportStatusEnum
.
MAKING
);
entrust
.
setTesterId
(
getAccount
().
getUserId
());
return
success
(
entrustService
.
pageEntrustByReportNotHis
(
getPage
(),
entrust
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustReportController.java
View file @
0ad36d00
...
...
@@ -24,6 +24,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -326,4 +327,16 @@ public class EntrustReportController extends ServiceController {
return
success
(
entrustReportService
.
backFromReportIssueToAllow
(
ids
,
reason
,
getAccount
()));
}
@ApiOperation
(
"委托下报告"
)
@PostMapping
(
"/report_under_entrust"
)
public
RestResult
<
List
<
EntrustReport
>>
getReportUnderEntrust
(
@RequestParam
(
"entrustId"
)
Long
entrustId
)
{
return
success
(
entrustReportService
.
getReportUnderEntrust
(
entrustId
));
}
@ApiOperation
(
"下载excel"
)
@GetMapping
(
"/download"
)
public
void
downloadExcel
(
@RequestParam
(
"id"
)
Long
id
,
HttpServletResponse
response
)
{
entrustReportService
.
downloadExcel
(
id
,
response
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustReportTemplateConfigController.java
View file @
0ad36d00
...
...
@@ -2,14 +2,7 @@ package com.patzn.cloud.service.lims.hmhj.controller;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportTemplateConfig
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
...
...
@@ -22,6 +15,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -67,6 +61,12 @@ public class EntrustReportTemplateConfigController extends ServiceController {
return
success
(
entrustReportTemplateConfigService
.
updateById
(
entrustReportTemplateConfig
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@PostMapping
(
"/update"
)
public
RestResult
<
Boolean
>
update
(
@RequestBody
EntrustReportTemplateConfig
entrustReportTemplateConfig
)
{
return
success
(
entrustReportTemplateConfigService
.
updateConfigById
(
entrustReportTemplateConfig
,
getAccount
()));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
EntrustReportTemplateConfig
entrustReportTemplateConfig
)
{
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustReportTemplateController.java
View file @
0ad36d00
...
...
@@ -2,14 +2,7 @@ package com.patzn.cloud.service.lims.hmhj.controller;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportTemplate
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
...
...
@@ -45,9 +38,9 @@ public class EntrustReportTemplateController extends ServiceController {
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
})
@PostMapping
(
"/page"
)
public
RestResult
<
Page
<
EntrustReportTemplate
>>
getPage
(
EntrustReportTemplate
entrustReportTemplate
)
{
public
RestResult
<
Page
<
EntrustReportTemplate
>>
getPage
(
EntrustReportTemplate
entrustReportTemplate
)
{
return
success
(
entrustReportTemplateService
.
page
(
getPage
(),
entrustReportTemplate
));
}
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
...
...
@@ -63,30 +56,36 @@ public class EntrustReportTemplateController extends ServiceController {
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
EntrustReportTemplate
entrustReportTemplate
)
{
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
EntrustReportTemplate
entrustReportTemplate
)
{
entrustReportTemplate
.
setId
(
id
);
return
success
(
entrustReportTemplateService
.
updateById
(
entrustReportTemplate
));
}
}
@ApiOperation
(
"根据 id 修改信息"
)
@PostMapping
(
"/update"
)
public
RestResult
<
Boolean
>
update
(
@RequestBody
EntrustReportTemplate
entrustReportTemplate
)
{
return
success
(
entrustReportTemplateService
.
updateTemplateById
(
entrustReportTemplate
,
getAccount
()));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
EntrustReportTemplate
entrustReportTemplate
)
{
public
RestResult
<
Boolean
>
add
(
EntrustReportTemplate
entrustReportTemplate
)
{
return
success
(
entrustReportTemplateService
.
save
(
entrustReportTemplate
));
}
}
@ApiOperation
(
"根据 ids 删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
})
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
entrustReportTemplateService
.
removeByIds
(
ids
));
}
}
@ApiOperation
(
value
=
"附件上传"
,
notes
=
"附件上传"
)
@PostMapping
(
"/upload_template/"
)
public
RestResult
<
Boolean
>
uploadTemplate
(
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"classType"
)
String
classType
,
@RequestParam
(
"remark"
)
String
remark
,
MultipartFile
file
)
{
return
success
(
entrustReportTemplateService
.
uploadTemplate
(
file
,
name
,
classType
,
remark
));
public
RestResult
<
Boolean
>
uploadTemplate
(
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"classType"
)
String
classType
,
@RequestParam
(
"remark"
)
String
remark
,
MultipartFile
file
)
{
return
success
(
entrustReportTemplateService
.
uploadTemplate
(
file
,
name
,
classType
,
remark
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustReportTemplateConfigMapper.java
View file @
0ad36d00
...
...
@@ -2,6 +2,7 @@ package com.patzn.cloud.service.lims.hmhj.mapper;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportTemplateConfig
;
import
org.apache.ibatis.annotations.Param
;
/**
* <p>
...
...
@@ -13,4 +14,5 @@ import com.patzn.cloud.service.hmhj.entity.EntrustReportTemplateConfig;
*/
public
interface
EntrustReportTemplateConfigMapper
extends
BatchMapper
<
EntrustReportTemplateConfig
>
{
boolean
updateConfigById
(
@Param
(
"vo"
)
EntrustReportTemplateConfig
entrustReportTemplateConfig
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustReportTemplateMapper.java
View file @
0ad36d00
...
...
@@ -2,10 +2,11 @@ package com.patzn.cloud.service.lims.hmhj.mapper;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportTemplate
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
org.apache.ibatis.annotations.Param
;
/**
* <p>
*
Mapper 接口
* Mapper 接口
* </p>
*
* @author wwd
...
...
@@ -13,4 +14,5 @@ import com.patzn.cloud.commons.mapper.BatchMapper;
*/
public
interface
EntrustReportTemplateMapper
extends
BatchMapper
<
EntrustReportTemplate
>
{
boolean
updateTemplateById
(
@Param
(
"vo"
)
EntrustReportTemplate
entrustReportTemplate
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustReportService.java
View file @
0ad36d00
...
...
@@ -8,6 +8,7 @@ import com.patzn.cloud.service.hmhj.entity.EntrustReport;
import
com.patzn.cloud.service.hmhj.enums.EntrustReportStatusEnum
;
import
com.patzn.cloud.service.hmhj.vo.EntrustReportVO
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.util.List
;
...
...
@@ -55,4 +56,7 @@ public interface IEntrustReportService extends IBaseService<EntrustReport> {
boolean
updateLastFlowCheckByEntrustId
(
Long
entrustId
,
Account
account
);
List
<
EntrustReport
>
getReportUnderEntrust
(
Long
entrustId
);
void
downloadExcel
(
Long
id
,
HttpServletResponse
response
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustReportTemplateConfigService.java
View file @
0ad36d00
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportTemplateConfig
;
...
...
@@ -17,4 +18,6 @@ public interface IEntrustReportTemplateConfigService extends IBaseService<Entrus
Page
<
EntrustReportTemplateConfig
>
page
(
Page
<
EntrustReportTemplateConfig
>
page
,
EntrustReportTemplateConfig
entrustReportTemplateConfig
);
boolean
removeByIds
(
List
<
Long
>
ids
);
boolean
updateConfigById
(
EntrustReportTemplateConfig
entrustReportTemplateConfig
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustReportTemplateService.java
View file @
0ad36d00
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportTemplate
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
@@ -20,4 +21,6 @@ public interface IEntrustReportTemplateService extends IBaseService<EntrustRepor
boolean
removeByIds
(
List
<
Long
>
ids
);
boolean
uploadTemplate
(
MultipartFile
file
,
String
name
,
String
classType
,
String
remark
);
boolean
updateTemplateById
(
EntrustReportTemplate
entrustReportTemplate
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportServiceImpl.java
View file @
0ad36d00
...
...
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.baomidou.mybatisplus.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.toolkit.StringUtils
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
...
...
@@ -25,6 +26,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.File
;
import
java.io.InputStream
;
import
java.util.*
;
...
...
@@ -109,6 +111,20 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
@Override
public
List
<
EntrustReport
>
getReportUnderEntrust
(
Long
entrustId
)
{
RestAssert
.
fail
(
null
==
entrustId
,
"委托编号为空"
);
return
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
entrustId
));
}
@Override
public
void
downloadExcel
(
Long
id
,
HttpServletResponse
response
)
{
RestAssert
.
fail
(
null
==
id
,
"报告编号为空"
);
EntrustReport
report
=
getById
(
id
);
RestAssert
.
fail
(
StringUtils
.
isEmpty
(
report
.
getObjectKey
()),
"报告objectKey为空"
);
ossClient
.
download
(
report
.
getObjectKey
(),
report
.
getSampleName
()
+
".xlsx"
,
response
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
entrustReportRelSampleService
.
remove
(
Condition
.
create
().
in
(
"report_id"
,
ids
));
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportTemplateConfigServiceImpl.java
View file @
0ad36d00
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportTemplateConfig
;
import
com.patzn.cloud.service.lims.hmhj.mapper.EntrustReportTemplateConfigMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustReportTemplateConfigService
;
...
...
@@ -9,6 +11,7 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -23,7 +26,7 @@ public class EntrustReportTemplateConfigServiceImpl extends BaseServiceImpl<Entr
@Override
public
Page
<
EntrustReportTemplateConfig
>
page
(
Page
<
EntrustReportTemplateConfig
>
page
,
EntrustReportTemplateConfig
entrustReportTemplateConfig
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustReportTemplateConfig
);
wrapper
.
orderBy
(
"ctime"
,
true
);
return
this
.
page
(
page
,
wrapper
);
}
...
...
@@ -31,4 +34,11 @@ public class EntrustReportTemplateConfigServiceImpl extends BaseServiceImpl<Entr
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Override
public
boolean
updateConfigById
(
EntrustReportTemplateConfig
entrustReportTemplateConfig
,
Account
account
)
{
RestAssert
.
fail
(
null
==
entrustReportTemplateConfig
.
getId
(),
"配置项编号为空"
);
entrustReportTemplateConfig
.
setLtime
(
new
Date
()).
setLid
(
account
.
getUserId
());
return
baseMapper
.
updateConfigById
(
entrustReportTemplateConfig
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportTemplateServiceImpl.java
View file @
0ad36d00
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.hmhj.entity.EntrustReportTemplate
;
...
...
@@ -15,6 +16,7 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
import
com.baomidou.mybatisplus.plugins.Page
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -37,6 +39,7 @@ public class EntrustReportTemplateServiceImpl extends BaseServiceImpl<EntrustRep
if
(
StringUtils
.
isNotBlank
(
name
))
{
wrapper
.
like
(
"name"
,
name
);
}
wrapper
.
orderBy
(
"class_type"
).
orderBy
(
"name"
);
return
this
.
page
(
page
,
wrapper
);
}
...
...
@@ -66,4 +69,11 @@ public class EntrustReportTemplateServiceImpl extends BaseServiceImpl<EntrustRep
attachment
.
setVersionId
(
result
.
getVersionId
());
return
super
.
save
(
attachment
);
}
@Override
public
boolean
updateTemplateById
(
EntrustReportTemplate
entrustReportTemplate
,
Account
account
)
{
RestAssert
.
fail
(
null
==
entrustReportTemplate
.
getId
(),
"报告模板ID为空"
);
entrustReportTemplate
.
setLid
(
account
.
getUserId
()).
setLtime
(
new
Date
());
return
baseMapper
.
updateTemplateById
(
entrustReportTemplate
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
0ad36d00
...
...
@@ -267,11 +267,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
}
// 验证样品非空字段
private
void
judgeSampleFields
(
EntrustSample
sample
)
{
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sample
.
getCode
()),
"样品编号不能为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sample
.
getName
()),
"样品名称(物资名称)不能为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sample
.
getSampleFrom
()),
"样品来源不能为空"
);
private
void
judgeSampleFields
(
EntrustSample
sample
,
boolean
isRequiredFill
)
{
if
(
isRequiredFill
)
{
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sample
.
getCode
()),
"样品编号不能为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sample
.
getName
()),
"样品名称(物资名称)不能为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sample
.
getSampleFrom
()),
"样品来源不能为空"
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -304,7 +307,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
sample
.
setEntrustId
(
entrust
.
getId
());
//生成样品编号
initSampleCode
(
sample
);
judgeSampleFields
(
sample
);
judgeSampleFields
(
sample
,
true
);
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setOrderBy
(
incNum
);
saveSampleList
.
add
(
sample
);
...
...
@@ -503,7 +506,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
saveSampleList
.
add
(
sample
);
}
judgeSampleFields
(
sample
);
judgeSampleFields
(
sample
,
true
);
List
<
EntrustSampleItem
>
viewItemList
=
dto
.
getItemList
();
if
(
CollectionUtils
.
isNotEmpty
(
viewItemList
))
{
...
...
@@ -702,23 +705,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override
public
Page
<
EntrustVO
>
pageEntrustByReportNotHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
RestAssert
.
fail
(
null
==
entrust
.
getReportNotStatus
(),
"报告状态不能为空"
);
List
<
EntrustReport
>
reportList
=
entrustReportService
.
list
(
Condition
.
create
().
ne
(
"status"
,
entrust
.
getReportNotStatus
()));
if
(
CollectionUtils
.
isEmpty
(
reportList
))
{
return
page
;
}
List
<
Long
>
ids
=
reportList
.
stream
().
map
(
s
->
{
return
s
.
getEntrustId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
page
;
}
entrust
.
setIdsList
(
ids
);
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
@Override
public
Page
<
EntrustVO
>
pageEntrustByReportHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
//
...
...
@@ -1021,12 +1010,17 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
int
sampleIndex
=
0
;
for
(
EntrustSample
sample
:
sampleList
)
{
Long
oldSampleId
=
sample
.
getId
();
String
sampleCode
=
sample
.
getCode
();
sample
.
setId
(
null
);
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setCode
(
null
);
//生成样品编号,可能存在为空的情况
initSampleCode
(
sample
);
judgeSampleFields
(
sample
);
// 样品编号问题,手填的样品编号不清空
if
(
StringUtils
.
isBlank
(
sample
.
getCode
()))
{
sample
.
setCode
(
sampleCode
);
}
judgeSampleFields
(
sample
,
false
);
sample
.
setEntrustId
(
entrust
.
getId
()).
setOrderBy
(
sampleIndex
).
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
).
setProgress
(
EntrustSampleStatusEnum
.
DRAFT
)
.
setOrderBy
(
sampleIndex
).
setOkJudge
(
null
).
setJudgerId
(
null
).
setJudgeProgress
(
null
).
setJudger
(
null
).
setJudgeStatus
(
null
).
setJudgeCheckTime
(
null
)
.
setJudgeCheckerId
(
null
).
setAppearanceResult
(
null
).
setSurplusSampleLimit
(
null
).
setReceiver
(
null
).
setReceiverId
(
null
).
setReceiveTime
(
null
)
...
...
src/main/resources/mapper/hmhj/EntrustMapper.xml
View file @
0ad36d00
...
...
@@ -62,8 +62,8 @@
and exists (
select 1 from entrust_sample s
join entrust_sample_prepare p on p.entrust_sample_id = s.id
where s.deleted = 0 and p.deleted = 0 and
p.entrust_sample_id is not null
and
s.entrust_id = e.id
and p.status = #{vo.prepareStatus}
where s.deleted = 0 and p.deleted = 0 and
s.entrust_id = e.id
and
p.entrust_sample_id is not null
and p.status = #{vo.prepareStatus}
)
</if>
<if
test=
"null != vo.prepareNotStatus"
>
...
...
@@ -104,16 +104,35 @@
<if
test=
"null != vo.itemStatus"
>
AND exists (
select 1 from entrust_sample_item i join entrust_sample s on i.entrust_sample_id = s.id
where s.deleted = 0 and i.deleted = 0 and s.entrust_id = e.id and i.status = #{vo.itemStatus}
select 1 from entrust_sample_item i
join entrust_sample s on i.entrust_sample_id = s.id
where s.deleted = 0 and i.deleted = 0
and s.entrust_id = e.id and i.status = #{vo.itemStatus}
)
</if>
<if
test=
"null!=vo.testerId"
>
and exists (
select 1 from entrust_sample_item i
join entrust_sample s on i.entrust_sample_id = s.id
where s.deleted = 0 and i.deleted = 0
and s.entrust_id = e.id and i.tester_id = #{vo.testerId}
)
</if>
<if
test=
"null != vo.reportStatus"
>
AND exists (
select 1 from entrust_report r where r.deleted = 0 and r.entrust_id = e.id
and r.status = #{vo.reportStatus}
)
</if>
<if
test=
"null != vo.reportNotStatus"
>
AND exists (
select 1 from entrust_report r where r.deleted = 0 and r.entrust_id = e.id
and r.status != #{vo.reportNotStatus}
)
</if>
<if
test=
"null != vo.reportStatusList"
>
AND exists (
...
...
@@ -161,17 +180,17 @@
<if
test=
"null!=vo.itemStatus"
>
and exists (
select 1 from entrust_sample es
,entrust_sample_item esi
where es.id = esi.entrust_sample_
id
and es.deleted = 0 and esi.deleted = 0
select 1 from entrust_sample es
join entrust_sample_item esi on esi.entrust_sample_id = es.
id
where es.deleted = 0 and esi.deleted = 0 and es.entrust_id = e.id
and esi.status = #{vo.itemStatus}
)
</if>
<if
test=
"null!=vo.itemStatusEnumList"
>
and exists (
select 1 from entrust_sample es
,entrust_sample_item esi
where es.id = esi.entrust_sample_
id
and es.deleted = 0 and esi.deleted = 0
select 1 from entrust_sample es
join entrust_sample_item esi on esi.entrust_sample_id = es.
id
where es.deleted = 0 and esi.deleted = 0 and es.entrust_id = e.id
and esi.status IN
<foreach
collection=
"vo.itemStatusEnumList"
index=
"index"
item=
"status"
open=
"("
separator=
","
close=
")"
>
#{status}
...
...
@@ -180,9 +199,9 @@
</if>
<if
test=
"null!=vo.testerId"
>
and exists (
select 1 from entrust_sample es
,entrust_sample_item esi
where es.id = esi.entrust_sample_
id
and es.deleted = 0 and esi.deleted = 0
select 1 from entrust_sample es
join entrust_sample_item esi on esi.entrust_sample_id = es.
id
where es.deleted = 0 and esi.deleted = 0 and es.entrust_id = e.id
and esi.tester_id = #{vo.testerId}
)
</if>
...
...
src/main/resources/mapper/hmhj/EntrustReportTemplateConfigMapper.xml
View file @
0ad36d00
...
...
@@ -2,4 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.EntrustReportTemplateConfigMapper"
>
<update
id=
"updateConfigById"
>
update entrust_report_template_config
set
attribute_name = #{vo.attributeName}
,data_attribute = #{vo.dataAttribute}
,column_place = #{vo.columnPlace}
,template_id = #{vo.templateId}
,lid = #{vo.lid}
,ltime = #{vo.ltime}
,merge_begin = #{vo.mergeBegin}
,merge_end = #{vo.mergeEnd}
,merge_row_num = #{vo.mergeRowNum}
,sheet_num = #{vo.sheetNum}
where id = #{vo.id}
</update>
</mapper>
src/main/resources/mapper/hmhj/EntrustReportTemplateMapper.xml
View file @
0ad36d00
...
...
@@ -2,4 +2,24 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.EntrustReportTemplateMapper"
>
<update
id=
"updateTemplateById"
>
update entrust_report_template
set
lid = #{vo.lid}
,ltime = #{vo.ltime}
,version = #{vo.version}
,uri = #{vo.uri}
,remark = #{vo.remark}
,bucket_name = #{vo.bucketName}
,object_key = #{vo.objectKey}
,version_id = #{vo.versionId}
,name = #{vo.name}
,uname = #{vo.uname}
,sample_begin_row = #{vo.sampleBeginRow}
,sample_merger_num = #{vo.sampleMergerNum}
,template_sample_num = #{vo.templateSampleNum}
,class_type = #{vo.classType}
,more_sheet = #{vo.moreSheet}
where id = #{vo.id}
</update>
</mapper>
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
0ad36d00
...
...
@@ -424,7 +424,7 @@
WHERE ii.deleted = 0
GROUP BY ii.entrust_sample_item_id
) ii on ii.entrust_sample_item_id = i.id
where e.deleted = 0 and s.deleted = 0 and i.deleted = 0
where e.deleted = 0 and s.deleted = 0 and i.deleted = 0
and s.type = 0
and coalesce(ii."END_INDEX",0) = 0
<if
test=
"null != vo.entrustId"
>
and e.id = #{vo.entrustId}
...
...
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