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
821c05a0
Commit
821c05a0
authored
Jul 29, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加克隆验证问题;
添加下载excel接口;
parent
c9a26c00
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
5 deletions
+45
-5
EntrustReportController.java
...service/lims/hmhj/controller/EntrustReportController.java
+13
-0
IEntrustReportService.java
...loud/service/lims/hmhj/service/IEntrustReportService.java
+4
-0
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+16
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+11
-4
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+1
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustReportController.java
View file @
821c05a0
...
...
@@ -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/service/IEntrustReportService.java
View file @
821c05a0
...
...
@@ -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/impl/EntrustReportServiceImpl.java
View file @
821c05a0
...
...
@@ -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/EntrustServiceImpl.java
View file @
821c05a0
...
...
@@ -269,11 +269,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
// 验证样品非空字段
private
void
judgeSampleFields
(
EntrustSample
sample
)
{
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
)
@Override
...
...
@@ -305,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
);
...
...
@@ -504,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
))
{
...
...
@@ -1008,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/EntrustSampleItemMapper.xml
View file @
821c05a0
...
...
@@ -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