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
3bded230
Commit
3bded230
authored
Jul 18, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改质量判定逻辑;
parent
8dea0f87
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
12 deletions
+43
-12
EntrustSampleItemController.java
...ice/lims/hmhj/controller/EntrustSampleItemController.java
+9
-2
IEntrustSampleItemService.java
.../service/lims/hmhj/service/IEntrustSampleItemService.java
+3
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+31
-10
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleItemController.java
View file @
3bded230
...
...
@@ -23,6 +23,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.xml.transform.Result
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -71,6 +72,12 @@ public class EntrustSampleItemController extends ServiceController {
return
success
(
entrustSampleItemService
.
updateById
(
entrustSampleItem
));
}
@ApiOperation
(
"批量更新检测项目检测值"
)
@PostMapping
(
"/item_batch_update"
)
public
RestResult
<
Boolean
>
updateItemList
(
@RequestBody
String
itemJson
)
{
return
success
(
entrustSampleItemService
.
updateItemBatch
(
itemJson
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
EntrustSampleItem
entrustSampleItem
)
{
...
...
@@ -574,8 +581,8 @@ public class EntrustSampleItemController extends ServiceController {
@ApiOperation
(
value
=
"填写原始记录"
,
notes
=
"填写原始记录"
)
@PostMapping
(
"/save_excel_original_record"
)
public
RestResult
<
OriginalRecord
>
saveExcelOriginalRecord
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"templateId"
)
Long
templateId
,
@RequestParam
(
"entrustCode"
)
String
entrustCode
)
{
return
success
(
entrustSampleItemService
.
saveExcelOriginalRecord
(
ids
,
templateId
,
getAccount
(),
entrustCode
));
public
RestResult
<
OriginalRecord
>
saveExcelOriginalRecord
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"templateId"
)
Long
templateId
,
@RequestParam
(
"entrustCode"
)
String
entrustCode
)
{
return
success
(
entrustSampleItemService
.
saveExcelOriginalRecord
(
ids
,
templateId
,
getAccount
(),
entrustCode
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemService.java
View file @
3bded230
...
...
@@ -5,6 +5,7 @@ import com.patzn.cloud.commons.controller.Account;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.SampleItemDTO
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleItem
;
import
com.patzn.cloud.service.hmhj.entity.ItemDeviate
;
import
com.patzn.cloud.service.hmhj.entity.OriginalRecord
;
...
...
@@ -29,6 +30,8 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
boolean
removeByIds
(
List
<
Long
>
ids
);
boolean
updateItemBatch
(
String
itemJson
);
Page
<
EntrustSampleItemVO
>
pageAllotBySampleRight
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
entrustSampleItem
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
3bded230
...
...
@@ -132,6 +132,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
if
(
StringUtils
.
isNotBlank
(
name
))
{
wrapper
.
like
(
"name"
,
name
);
}
wrapper
.
orderBy
(
"id"
,
true
);
return
this
.
page
(
page
,
wrapper
);
}
...
...
@@ -142,6 +143,22 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Override
public
boolean
updateItemBatch
(
String
itemJson
)
{
RestAssert
.
fail
(
StringUtils
.
isBlank
(
itemJson
),
"检测项目数据为空"
);
try
{
List
<
EntrustSampleItem
>
entrustSampleItemList
=
JSONArray
.
parseArray
(
itemJson
,
EntrustSampleItem
.
class
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
entrustSampleItemList
),
"检测项目数据为空"
);
RestAssert
.
fail
(
entrustSampleItemList
.
stream
().
filter
(
t
->
null
==
t
.
getId
()).
count
()
>
0
,
"要修改检测值的编号为空"
);
return
updateBatchById
(
entrustSampleItemList
);
}
catch
(
Exception
e
)
{
//e.printStackTrace();
logger
.
error
(
e
.
getMessage
(),
e
.
getCause
());
RestAssert
.
fail
(
"检测数据转换失败"
);
}
return
false
;
}
@Override
public
Page
<
EntrustSampleItemVO
>
pageAllotBySampleRight
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
entrustSampleItem
)
{
if
(
ArrayUtils
.
isEmpty
(
entrustSampleItem
.
getSampleIdsArray
()))
{
RestAssert
.
fail
(
"请选择样品ID"
);
...
...
@@ -533,7 +550,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
/* 获取采集数据,并保存到SampleVO中 */
getCollectionData
(
null
,
sampleVOList
,
entrustCode
,
itemNameMap
,
template
);
getCollectionData
(
null
,
sampleVOList
,
entrustCode
,
itemNameMap
,
template
);
if
(
null
==
template
.
getSampleBeginRow
()
||
null
==
template
.
getSampleMergerNum
()
||
null
==
template
.
getTemplateSampleNum
())
{
...
...
@@ -554,7 +571,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
else
{
/* 获取采集到的数据 */
getCollectionData
(
voList
,
null
,
entrustCode
,
itemNameMap
,
template
);
getCollectionData
(
voList
,
null
,
entrustCode
,
itemNameMap
,
template
);
if
(
CollectionUtils
.
isNotEmpty
(
voList
))
{
mapReplace
.
put
(
"#{sampleFrom}"
,
voList
.
get
(
0
).
getSampleFrom
());
...
...
@@ -647,21 +664,23 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
for
(
String
data
:
datas
)
{
Map
<
String
,
String
>
stringStringMap
=
toStringStringMap
(
data
);
/* 找到曲线数据和空白数据 */
List
<
Map
<
String
,
String
>>
curveDatas
=
new
ArrayList
<
Map
<
String
,
String
>>();
List
<
Map
<
String
,
String
>>
curveDatas
=
new
ArrayList
<
Map
<
String
,
String
>>();
if
(
stringStringMap
.
containsKey
(
curve
)
&&
!
filledCur
.
get
())
{
filledCur
.
set
(
true
);
curveDatas
=
(
List
<
Map
<
String
,
String
>>)
(
JSONArray
.
parse
(
stringStringMap
.
get
(
curve
)));
vo
.
setCurveDataList
(
curveDatas
);
}
List
<
String
>
blankKeys
=
new
ArrayList
<>();
blankKeys
.
add
(
"content"
);
blankKeys
.
add
(
"correctedContent"
);
blankKeys
.
add
(
"abs"
);
blankKeys
.
add
(
"content"
);
blankKeys
.
add
(
"correctedContent"
);
blankKeys
.
add
(
"abs"
);
if
(!
filledBlank
.
get
())
{
filledBlank
.
set
(
true
);
HashMap
<
String
,
String
>
blankMap
=
new
HashMap
<>();
for
(
String
blankKey
:
blankKeys
)
{
String
value
=
stringStringMap
.
get
(
"blank"
+
StringUtils
.
capitalize
(
blankKey
));
if
(
StringUtils
.
isNotEmpty
(
value
))
{
blankMap
.
put
(
blankKey
,
value
);
blankMap
.
put
(
blankKey
,
value
);
}
}
vo
.
setBlankDataMap
(
blankMap
);
...
...
@@ -694,7 +713,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
if
(
entry
.
getValue
()
instanceof
String
)
{
stringStringHashMap
.
put
(
entry
.
getKey
(),
(
String
)
entry
.
getValue
());
}
else
{
stringStringHashMap
.
put
(
entry
.
getKey
(),((
JSONArray
)
entry
.
getValue
()).
toJSONString
());
stringStringHashMap
.
put
(
entry
.
getKey
(),
((
JSONArray
)
entry
.
getValue
()).
toJSONString
());
}
}
return
stringStringHashMap
;
...
...
@@ -886,11 +905,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
List
<
GradingProduct
>
gradingProductList
=
gradingProductService
.
list
(
Condition
.
create
()
.
eq
(
"grading_standard_id"
,
standard
.
getId
()).
eq
(
"deleted"
,
0
)
// 依旧优先级来处理判定顺序
.
orderBy
(
"judge_priority"
,
fals
e
));
.
orderBy
(
"judge_priority"
,
tru
e
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
gradingProductList
),
"产品标准不能为空"
);
// 循环产品标准依次判定级别
sample:
for
(
int
i
=
0
;
i
<
gradingProductList
.
size
();
i
++)
{
GradingProduct
product
=
gradingProductList
.
get
(
i
);
RestAssert
.
fail
(
null
==
product
.
getSumValue
(),
"产品标准合计值不能为空"
);
...
...
@@ -902,7 +922,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
continue
;
}
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
continu
e
;
break
sampl
e
;
}
// 符合合计,若不为组合判定,则直接判定合格
...
...
@@ -912,7 +932,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
updateSampleList
.
add
(
sample
.
setOkJudge
(
"合格"
).
setJudger
(
account
.
getUserName
()).
setJudgerId
(
account
.
getUserId
())
.
setJudgeCheckTime
(
new
Date
()).
setJudgeStatus
(
0
).
setJudgeProgress
(
0
)
.
setSampleGrading
(
product
.
getProductGrade
()));
continu
e
;
break
sampl
e
;
}
// 若为组合判定,比较单个大小是否都符合
List
<
GradingItem
>
gradingItemList
=
gradingItemService
.
list
(
Condition
.
create
()
...
...
@@ -946,6 +966,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 存在下一个标准等级判定,继续判定
if
(
i
>=
gradingProductList
.
size
()
-
1
)
{
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
break
sample
;
}
continue
;
}
...
...
@@ -954,7 +975,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
updateSampleList
.
add
(
sample
.
setOkJudge
(
"合格"
).
setJudger
(
account
.
getUserName
()).
setJudgerId
(
account
.
getUserId
())
.
setJudgeCheckTime
(
new
Date
()).
setJudgeStatus
(
0
).
setJudgeProgress
(
0
)
.
setSampleGrading
(
product
.
getProductGrade
()));
break
sample
;
}
}
if
(
updateSampleList
.
size
()
>
0
)
{
...
...
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