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
ac589cb9
Commit
ac589cb9
authored
Jan 22, 2024
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
电解质分子比数据发送;
parent
10f2335e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
15 deletions
+73
-15
build.gradle
build.gradle
+2
-2
EntrustSampleItemIndexMapper.java
...ervice/lims/hmhj/mapper/EntrustSampleItemIndexMapper.java
+8
-0
IEntrustSampleItemIndexService.java
...ice/lims/hmhj/service/IEntrustSampleItemIndexService.java
+2
-0
EntrustSampleItemIndexServiceImpl.java
.../hmhj/service/impl/EntrustSampleItemIndexServiceImpl.java
+8
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+20
-13
EntrustSampleItemIndexMapper.xml
...in/resources/mapper/hmhj/EntrustSampleItemIndexMapper.xml
+33
-0
No files found.
build.gradle
View file @
ac589cb9
...
...
@@ -11,8 +11,8 @@ ext {
maven
{
url
'https://repo.spring.io/milestone'
}
maven
{
url
'http://repo.spring.io/snapshot'
}
maven
{
url
'https://oss.sonatype.org/content/repositories/snapshots/'
}
maven
{
url
'http://1
12.6.246.18
5:8081/repository/patzn-releases/'
}
maven
{
url
'http://1
12.6.246.18
5:8081/repository/patzn-snapshots/'
}
maven
{
url
'http://1
92.168.1.14
5:8081/repository/patzn-releases/'
}
maven
{
url
'http://1
92.168.1.14
5:8081/repository/patzn-snapshots/'
}
jcenter
()
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleItemIndexMapper.java
View file @
ac589cb9
...
...
@@ -91,6 +91,14 @@ public interface EntrustSampleItemIndexMapper extends BatchMapper<EntrustSampleI
List
<
Map
<
String
,
Object
>>
selectCpSampleItemIndex
(
@Param
(
"entrustIds"
)
List
<
Long
>
entrustIds
,
@Param
(
"sampleIds"
)
List
<
Long
>
sampleIds
);
/**
* 查询电解质检测数据
* @param entrustIds
* @param sampleIds
* @return
*/
List
<
Map
<
String
,
Object
>>
selectEmrSampleItemIndex
(
@Param
(
"entrustIds"
)
List
<
Long
>
entrustIds
,
@Param
(
"sampleIds"
)
List
<
Long
>
sampleIds
);
/**
* Physical delete by item ids integer.
*
* @param itemIds the item ids
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemIndexService.java
View file @
ac589cb9
...
...
@@ -62,4 +62,6 @@ public interface IEntrustSampleItemIndexService extends IBaseService<EntrustSamp
List
<
EntrustSampleItemIndexVO
>
getInReportItemIndexBySampleIds
(
List
<
Long
>
sampleIds
);
List
<
Map
<
String
,
Object
>>
getCpSampleItemIndexList
(
Long
entrustId
,
Long
[]
sampleIds
);
List
<
Map
<
String
,
Object
>>
listEmrSampleItemIndex
(
List
<
Long
>
entrustIds
,
List
<
Long
>
sampleIds
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemIndexServiceImpl.java
View file @
ac589cb9
...
...
@@ -64,6 +64,14 @@ public class EntrustSampleItemIndexServiceImpl extends BaseServiceImpl<EntrustSa
}
@Override
public
List
<
Map
<
String
,
Object
>>
listEmrSampleItemIndex
(
List
<
Long
>
entrustIds
,
List
<
Long
>
sampleIds
)
{
if
(
CollectionUtils
.
isEmpty
(
entrustIds
)
&&
CollectionUtils
.
isEmpty
(
sampleIds
))
{
return
new
ArrayList
<>();
}
return
baseMapper
.
selectEmrSampleItemIndex
(
entrustIds
,
sampleIds
);
}
@Override
public
boolean
physicalDeleteByItemIds
(
List
<
Long
>
itemIds
)
{
if
(
CollectionUtils
.
isEmpty
(
itemIds
))
{
return
true
;
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
ac589cb9
...
...
@@ -20,7 +20,7 @@ import com.patzn.cloud.commons.toolkit.*;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.BaseEntity
;
import
com.patzn.cloud.service.hmhj.
bean
.KV
;
import
com.patzn.cloud.service.hmhj.
model
.KV
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.SampleItemDTO
;
import
com.patzn.cloud.service.hmhj.entity.*
;
...
...
@@ -208,7 +208,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
return
true
;
}
catch
(
Exception
e
)
{
//e.printStackTrace();
//
e.printStackTrace();
logger
.
error
(
e
.
getMessage
(),
e
.
getCause
());
RestAssert
.
fail
(
"检测数据转换失败"
);
}
...
...
@@ -1219,7 +1219,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
long
time2
=
(
System
.
currentTimeMillis
()
-
time1
)
/
1000
;
System
.
out
.
println
(
"time2:::::::"
+
time2
);
//其他稀有元素
//
其他稀有元素
List
<
String
>
otherYsList
=
Arrays
.
asList
(
"Mn"
,
"V"
,
"Ni"
);
List
<
EntrustSample
>
updateSampleList
=
new
ArrayList
<>();
...
...
@@ -1487,9 +1487,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
String
sampleName
=
sample
.
getName
();
log
(
"样品名称:"
+
sampleName
);
// 只针对原铝和铝成品,原铝重取只是对原铝的补充
final
String
ylname
=
"原铝"
,
cqname
=
"原铝重取"
,
cpname
=
"铝成品"
;
if
(!(
Objects
.
equals
(
ylname
,
sampleName
)
||
Objects
.
equals
(
cqname
,
sampleName
)
||
Objects
.
equals
(
cpname
,
sampleName
)))
{
log
(
"非原铝或铝成品,不予发送!"
);
final
String
ylname
=
"原铝"
,
cqname
=
"原铝重取"
,
cpname
=
"铝成品"
,
djzsy
=
"电解质散样"
,
gcdjz
=
"过程电解质"
;
if
(!(
Objects
.
equals
(
ylname
,
sampleName
)
||
Objects
.
equals
(
cqname
,
sampleName
)
||
Objects
.
equals
(
cpname
,
sampleName
))
||
Objects
.
equals
(
gcdjz
,
sampleName
)
||
Objects
.
equals
(
djzsy
,
sampleName
))
{
log
(
"非【原铝、铝成品、过程电解质、电解质散样】,不予发送!"
);
return
;
}
...
...
@@ -1516,12 +1519,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 处理逻辑,业务逻辑可以根据重取的槽号对比原铝的槽号查询原铝数据,代码实现逻辑:根据处理后的样品编号进行查询
// 将重取编号转换成原铝编号,去查询对应的原铝委托ids
// 原铝重取的样品编号可能是下面的几种情况,正常智能是第一种
//Y2204262017C
//2110164032C12
//Y2201086159C1
//Y2112052110C2
//测试环境中,原铝重取可能并不是同一天生成的,"Y" + DateUtils.dateTransfer(sample.getCtime(), "yyMMdd") + "-" + sample.getSlotNo().trim();
//根据样品编号,查询出委托id
//
Y2204262017C
//
2110164032C12
//
Y2201086159C1
//
Y2112052110C2
//
测试环境中,原铝重取可能并不是同一天生成的,"Y" + DateUtils.dateTransfer(sample.getCtime(), "yyMMdd") + "-" + sample.getSlotNo().trim();
//
根据样品编号,查询出委托id
List
<
String
>
sampleCodes
=
sampleCodeHandle
(
sampleList
,
retakeMap
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleCodes
),
"根据重取编号获取的原铝编号为空!"
);
List
<
Long
>
entrustIds
=
entrustSampleService
.
getEntrustIdsBySampleCodes
(
sampleCodes
);
...
...
@@ -1536,6 +1539,10 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 根据委托去查询,也只能根据委托去查询
dataList
=
entrustSampleItemIndexService
.
listSampleItemIndex
(
entrustIds
,
null
);
}
// 过程电解质,电解质散样
else
if
(
Objects
.
equals
(
gcdjz
,
sampleName
)
||
Objects
.
equals
(
djzsy
,
sampleName
))
{
dataList
=
entrustSampleItemIndexService
.
listEmrSampleItemIndex
(
null
,
ids
);
}
else
{
cpSample
=
true
;
dataList
=
entrustSampleItemIndexService
.
listCpSampleItemIndex
(
null
,
ids
);
...
...
@@ -2157,7 +2164,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
continue
;
}
//结果回调
//
结果回调
XSSFWorkbook
xssfWorkbook
=
null
;
try
{
xssfWorkbook
=
new
XSSFWorkbook
(
io
);
...
...
src/main/resources/mapper/hmhj/EntrustSampleItemIndexMapper.xml
View file @
ac589cb9
...
...
@@ -205,6 +205,39 @@
"sample_code"
</select>
<!--查询电解质要发送ERP数据-->
<select
id=
"selectEmrSampleItemIndex"
resultType=
"java.util.Map"
>
SELECT
split_part( s.code, '-', 1 ) "sample_code",
MAX ( s.NAME ) "sample_name",
MAX ( s.sample_from ) "sample_from",
MAX ( i.tester ) "tester",
to_char( MAX ( i.test_time ), 'YYYY-MM-DD HH24:MI:SS' ) "test_time",
MAX ( r.report_sender ) "report_sender",
MAX ( CASE WHEN ii.NAME = '电解质-MgF2' THEN TRIM ( ii.test_value ) END ) "mgf2",
MAX ( CASE WHEN ii.NAME = '电解质-分子比' THEN TRIM ( ii.test_value ) END ) "fzb",
MAX ( CASE WHEN ii.NAME = '电解质-氟化钙' THEN TRIM ( ii.test_value ) END ) "caf2",
MAX ( CASE WHEN ii.NAME = '电解质-氧化铝' THEN TRIM ( ii.test_value ) END ) "al2o3"
FROM entrust_sample_item_index ii
JOIN entrust_sample_item i on i.id = ii.entrust_sample_item_id and i.deleted = 0
JOIN entrust_sample s on s.id = i.entrust_sample_id and s.deleted = 0
JOIN entrust e on e.ID = s.entrust_id AND e.deleted = 0
LEFT JOIN entrust_report r ON r.entrust_id = s.entrust_id AND r.deleted = 0
WHERE s.name in ('过程电解质','电解质散样')
<if
test=
"null != entrustIds"
>
<foreach
collection=
"entrustIds"
index=
"index"
item=
"entrustId"
open=
" and s.entrust_id in ("
separator=
","
close=
")"
>
#{entrustId}
</foreach>
</if>
<if
test=
"null != sampleIds"
>
<foreach
collection=
"sampleIds"
index=
"index"
item=
"sampleId"
open=
" and s.id in ("
separator=
","
close=
")"
>
#{sampleId}
</foreach>
</if>
group by
"sample_code"
</select>
<delete
id=
"physicalDeleteByItemIds"
>
delete from entrust_sample_item_index where entrust_sample_item_id in
<foreach
collection=
"itemIds"
index=
"index"
item=
"itemId"
open=
" ("
separator=
","
close=
")"
>
...
...
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