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
03614a3c
Commit
03614a3c
authored
Feb 26, 2022
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务时间调整 每3分钟执行一次更改为5分钟;
优化原始记录关联查询;
parent
c9bca976
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
112 additions
and
29 deletions
+112
-29
EntrustSampleItemController.java
...ice/lims/hmhj/controller/EntrustSampleItemController.java
+1
-1
UserStatsTask.java
...patzn/cloud/service/lims/hmhj/schedule/UserStatsTask.java
+3
-4
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+5
-8
OriginalTemplateItemServiceImpl.java
...ms/hmhj/service/impl/OriginalTemplateItemServiceImpl.java
+5
-3
OriginalTemplateItemMapper.xml
...main/resources/mapper/hmhj/OriginalTemplateItemMapper.xml
+23
-12
20220224新增字段与函数.sql
src/test/java/resources/db_sql/hmhj/v176/20220224新增字段与函数.sql
+75
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleItemController.java
View file @
03614a3c
...
...
@@ -298,7 +298,7 @@ public class EntrustSampleItemController extends ServiceController {
@ApiOperation
(
"手工分配"
)
@PostMapping
(
"/allot_item"
)
public
RestResult
<
Boolean
>
allotItem
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"tester"
)
String
tester
,
@RequestParam
(
"testerId"
)
Long
testerId
,
@RequestParam
(
"type"
)
Integer
type
)
{
public
RestResult
<
Boolean
>
allotItem
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"tester"
)
String
tester
,
@RequestParam
(
"testerId"
)
Long
testerId
,
Integer
type
)
{
return
success
(
entrustSampleItemService
.
allotItem
(
ids
,
tester
,
testerId
,
type
,
getAccount
()));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/schedule/UserStatsTask.java
View file @
03614a3c
...
...
@@ -10,12 +10,11 @@ import javax.annotation.Resource;
import
java.time.LocalDateTime
;
/**
*
* @author: meazty
* @since: 2022/2/21 19:44
**/
@Component
@Configuration
//1.主要用于标记配置类,兼备Component的效果。
@Configuration
@EnableScheduling
public
class
UserStatsTask
{
...
...
@@ -23,9 +22,9 @@ public class UserStatsTask {
private
IUserTestStatisticsService
userTestStatisticsService
;
/**
* 每
3
分钟执行一次
* 每
5
分钟执行一次
*/
@Scheduled
(
cron
=
"0 */
3
* * * ?"
)
@Scheduled
(
cron
=
"0 */
5
* * * ?"
)
private
void
configureTasks
()
{
System
.
err
.
println
(
"执行同步用户检测量定时任务时间: "
+
LocalDateTime
.
now
());
userTestStatisticsService
.
updateUserStatisticsInfo
();
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
03614a3c
...
...
@@ -822,24 +822,21 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Override
public
Page
<
EntrustSampleVO
>
pageSampleByItem
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
)
{
if
(
null
==
entrustSample
.
getEntrustId
())
{
return
page
;
}
if
(
null
==
entrustSample
.
getItemStatus
())
{
if
(
null
==
entrustSample
.
getEntrustId
()
||
null
==
entrustSample
.
getItemStatus
())
{
return
page
;
}
/* 移除冗余代码
List<EntrustSampleItem> itemList = entrustSampleItemService.list(Condition.create().eq("status", entrustSample.getItemStatus()));
if (CollectionUtils.isEmpty(itemList)) {
return page;
}
List
<
Long
>
sampleIdsList
=
itemList
.
stream
().
map
(
i
->
{
List<Long> sampleIdsList = itemList.stream().map( i -> {
return i.getEntrustSampleId();
}).collect(Collectors.toList());
entrustSample.setIds(sampleIdsList);
*/
// 此处逻辑 用到了样品检测项目状态,样品编号,委托编号
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrustSample
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/OriginalTemplateItemServiceImpl.java
View file @
03614a3c
...
...
@@ -16,9 +16,7 @@ import org.apache.commons.collections4.ListUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -77,6 +75,10 @@ public class OriginalTemplateItemServiceImpl extends BaseServiceImpl<OriginalTem
if
(
CollectionUtils
.
isEmpty
(
sampleItemList
))
{
return
Collections
.
emptyList
();
}
Set
<
Long
>
templateIdSet
=
new
HashSet
<>();
for
(
SampleItemDTO
dto
:
sampleItemList
)
{
}
return
baseMapper
.
listIdsByItems
(
sampleItemList
);
}
}
src/main/resources/mapper/hmhj/OriginalTemplateItemMapper.xml
View file @
03614a3c
...
...
@@ -3,21 +3,32 @@
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.OriginalTemplateItemMapper"
>
<select
id=
"listIdsByItems"
resultType=
"java.lang.Long"
>
select ot.id from original_template ot
select
distinct ot.id
from original_template ot
left join (
select st.company_id,st.template_id,string_agg(st.name,'~~') || '~~' "sname"
from original_template_item st where st.deleted = 0 and st.type = 'sample'
group by st.company_id,st.template_id
) st ON st.template_id = ot.id
left join (
select it.company_id,it.template_id,string_agg(it.name,'~~') || '~~' "iname"
from original_template_item it where it.deleted = 0 and it.type = 'item'
group by it.company_id,it.template_id
) it ON it.template_id = ot.id
where ot.deleted = 0 and (
<foreach
collection=
"sampleItemList"
index=
"index"
item=
"sampleItem"
separator=
"or"
open=
"("
close=
")"
>
exists (
select 1 from original_template_item oti where oti.deleted = 0 and oti.template_id = ot.id
and oti.type = 'sample' and(oti.name is null or oti.name = #{sampleItem.name})
)
and exists (
select 1 from original_template_item oi where oi.deleted = 0 and oi.template_id = ot.id
and oi.type = 'item' and ( oi.name is null or oi.name in
<foreach
collection=
"sampleItem.itemList"
index=
"ix"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
1 != 2
<if
test=
"null != sampleItem.name"
>
and strpos(st.sname,concat(#{sampleItem.name},'~~')) > 0
</if>
<if
test=
"null != sampleItem.itemList"
>
and (
<foreach
collection=
"sampleItem.itemList"
index=
"ix"
item=
"item"
separator=
"or"
open=
"("
close=
")"
>
strpos(it.iname,concat(#{item},'~~')) > 0
</foreach>
)
)
</if>
</foreach>
)
</select>
...
...
src/test/java/resources/db_sql/hmhj/v176/20220224新增字段与函数.sql
View file @
03614a3c
/** c
reated by meazty on 2022/2/17 23:13 **/
/** c
reated by meazty on 2022/2/17 23:13 **/
/** created by meazty on 2022/2/17 23:13 **/
-- ----------------------------
-- Table structure for user_test_statistics
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"user_test_statistics"
;
CREATE
TABLE
"public"
.
"user_test_statistics"
(
"user_id"
int8
NOT
NULL
,
"user_name"
varchar
(
64
)
COLLATE
"pg_catalog"
.
"default"
,
"real_name"
varchar
(
64
)
COLLATE
"pg_catalog"
.
"default"
,
"group_ids"
varchar
(
512
)
COLLATE
"pg_catalog"
.
"default"
,
"untested"
int4
,
"testing"
int4
,
"tested"
int4
,
"total"
int4
,
"company_id"
int8
DEFAULT
'1356149618195193858'
::
bigint
)
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"user_id"
IS
'用户ID'
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"user_name"
IS
'用户名'
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"real_name"
IS
'真实名称'
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"group_ids"
IS
'分组(科室)ids'
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"untested"
IS
'未检测数量'
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"testing"
IS
'正在检测数量'
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"tested"
IS
'已检测数量'
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"total"
IS
'总数'
;
COMMENT
ON
COLUMN
"public"
.
"user_test_statistics"
.
"company_id"
IS
'企业ID'
;
-- ----------------------------
-- Uniques structure for table user_test_statistics
-- ----------------------------
ALTER
TABLE
"public"
.
"user_test_statistics"
ADD
CONSTRAINT
"ueq_user_id"
UNIQUE
(
"user_id"
);
COMMENT
ON
CONSTRAINT
"ueq_user_id"
ON
"public"
.
"user_test_statistics"
IS
'用户id'
;
-- ----------------------------
-- Primary Key structure for table user_test_statistics
-- ----------------------------
ALTER
TABLE
"public"
.
"user_test_statistics"
ADD
CONSTRAINT
"user_test_stats_pkey"
PRIMARY
KEY
(
"user_id"
);
-- ----------------------------
-- Table structure for original_template_item
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"original_template_item"
;
CREATE
TABLE
"public"
.
"original_template_item"
(
"id"
int8
NOT
NULL
,
"template_id"
int8
,
"name"
varchar
(
64
)
COLLATE
"pg_catalog"
.
"default"
,
"type"
varchar
(
32
)
COLLATE
"pg_catalog"
.
"default"
,
"remark"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"company_id"
int8
,
"deleted"
int2
DEFAULT
0
,
"uid"
int8
,
"ctime"
timestamp
(
6
)
DEFAULT
NULL
::
timestamp
without
time
zone
,
"lid"
int8
,
"ltime"
timestamp
(
6
)
DEFAULT
NULL
::
timestamp
without
time
zone
)
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"id"
IS
'ID'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"template_id"
IS
'原始记录模板ID'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"name"
IS
'名称'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"type"
IS
'类型'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"remark"
IS
'备注'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"company_id"
IS
'企业ID'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"deleted"
IS
'是否删除0否1是'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"uid"
IS
'创建人ID'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"ctime"
IS
'创建时间'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"lid"
IS
'最后修改人ID'
;
COMMENT
ON
COLUMN
"public"
.
"original_template_item"
.
"ltime"
IS
'最后修改时间'
;
COMMENT
ON
TABLE
"public"
.
"original_template_item"
IS
'原始记录配置项(配置的字段,样品、项目等)'
;
-- ----------------------------
-- Primary Key structure for table original_template_item
-- ----------------------------
ALTER
TABLE
"public"
.
"original_template_item"
ADD
CONSTRAINT
"original_template_item_pkey"
PRIMARY
KEY
(
"id"
);
-- 委托样品 --
ALTER
TABLE
"public"
.
"entrust_sample_item"
ADD
COLUMN
"period"
varchar
(
32
);
...
...
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