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
372cd089
Commit
372cd089
authored
Jul 09, 2021
by
wangweidong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
e63219cf
e60262d4
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
921 additions
and
172 deletions
+921
-172
BeanUtils.java
...n/java/com/patzn/cloud/service/lims/common/BeanUtils.java
+37
-0
EntrustController.java
...cloud/service/lims/hmhj/controller/EntrustController.java
+20
-0
EntrustSampleController.java
...service/lims/hmhj/controller/EntrustSampleController.java
+6
-0
EntrustSampleItemController.java
...ice/lims/hmhj/controller/EntrustSampleItemController.java
+4
-0
EntrustSampleRecordController.java
...e/lims/hmhj/controller/EntrustSampleRecordController.java
+75
-0
OriginalRecordController.java
...ervice/lims/hmhj/controller/OriginalRecordController.java
+5
-0
OriginalRecordInfoController.java
...ce/lims/hmhj/controller/OriginalRecordInfoController.java
+81
-0
EntrustSampleRecordMapper.java
...d/service/lims/hmhj/mapper/EntrustSampleRecordMapper.java
+16
-0
LmsOriginalRecordInfoMapper.java
...service/lims/hmhj/mapper/LmsOriginalRecordInfoMapper.java
+3
-6
IEntrustSamplePrepareService.java
...rvice/lims/hmhj/service/IEntrustSamplePrepareService.java
+2
-0
IEntrustSampleRecordService.java
...ervice/lims/hmhj/service/IEntrustSampleRecordService.java
+26
-0
IEntrustSampleService.java
...loud/service/lims/hmhj/service/IEntrustSampleService.java
+6
-0
IEntrustService.java
...atzn/cloud/service/lims/hmhj/service/IEntrustService.java
+6
-0
ILmsOriginalRecordInfoService.java
...vice/lims/hmhj/service/ILmsOriginalRecordInfoService.java
+3
-1
ContractSampleItemServiceImpl.java
...lims/hmhj/service/impl/ContractSampleItemServiceImpl.java
+6
-1
ContractSampleServiceImpl.java
...ice/lims/hmhj/service/impl/ContractSampleServiceImpl.java
+10
-0
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+11
-3
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+5
-1
EntrustSamplePrepareServiceImpl.java
...ms/hmhj/service/impl/EntrustSamplePrepareServiceImpl.java
+37
-5
EntrustSampleRecordServiceImpl.java
...ims/hmhj/service/impl/EntrustSampleRecordServiceImpl.java
+66
-0
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+128
-49
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+156
-11
LmsOriginalRecordInfoServiceImpl.java
...s/hmhj/service/impl/LmsOriginalRecordInfoServiceImpl.java
+83
-45
LmsOriginalRecordInfoSchedule.java
.../service/lims/schedule/LmsOriginalRecordInfoSchedule.java
+0
-26
EntrustMapper.xml
src/main/resources/mapper/hmhj/EntrustMapper.xml
+3
-0
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+12
-0
EntrustSampleMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
+1
-0
EntrustSampleRecordMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleRecordMapper.xml
+5
-0
LmsOriginalRecordInfoMapper.xml
...ain/resources/mapper/hmhj/LmsOriginalRecordInfoMapper.xml
+21
-24
OriginalRecordMapper.xml
src/main/resources/mapper/hmhj/OriginalRecordMapper.xml
+7
-0
JsonObjectTest.java
...ava/com/patzn/cloud/service/lims/test/JsonObjectTest.java
+13
-0
20210708添加记录表和字段.sql
...test/java/resources/db_sql/hmhj/v145/20210708添加记录表和字段.sql
+67
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/common/BeanUtils.java
0 → 100644
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
common
;
import
org.apache.commons.beanutils.ConvertUtils
;
import
org.apache.commons.beanutils.converters.DateConverter
;
import
org.springframework.beans.BeanWrapper
;
import
org.springframework.beans.BeanWrapperImpl
;
import
java.beans.PropertyDescriptor
;
import
java.util.HashSet
;
import
java.util.Set
;
public
class
BeanUtils
{
public
static
String
[]
getNullPropertyNames
(
Object
source
)
{
final
BeanWrapper
src
=
new
BeanWrapperImpl
(
source
);
PropertyDescriptor
[]
pds
=
src
.
getPropertyDescriptors
();
Set
<
String
>
emptyNames
=
new
HashSet
<>();
for
(
PropertyDescriptor
pd
:
pds
)
{
Object
srcValue
=
src
.
getPropertyValue
(
pd
.
getName
());
if
(
srcValue
==
null
)
emptyNames
.
add
(
pd
.
getName
());
}
String
[]
result
=
new
String
[
emptyNames
.
size
()];
return
emptyNames
.
toArray
(
result
);
}
public
static
void
copyProperties
(
Object
source
,
Object
target
)
{
copyProperties
(
source
,
target
,
null
);
}
public
static
void
copyProperties
(
Object
source
,
Object
target
,
Boolean
ignoreNull
)
{
ConvertUtils
.
register
(
new
DateConverter
(
null
),
java
.
util
.
Date
.
class
);
String
[]
ignoreArr
=
null
!=
ignoreNull
&&
ignoreNull
.
booleanValue
()
?
getNullPropertyNames
(
source
)
:
null
;
org
.
springframework
.
beans
.
BeanUtils
.
copyProperties
(
source
,
target
,
ignoreArr
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustController.java
View file @
372cd089
...
...
@@ -306,6 +306,18 @@ public class EntrustController extends ServiceController {
return
success
(
entrustService
.
backFromCheck
(
ids
,
getAccount
(),
reason
));
}
@ApiOperation
(
"委托制备退回"
)
@PostMapping
(
"/back_from_make"
)
public
RestResult
<
Boolean
>
backFromMake
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustService
.
backFromMake
(
ids
,
getAccount
(),
reason
));
}
@ApiOperation
(
"委托接收退回"
)
@PostMapping
(
"/back_from_receive"
)
public
RestResult
<
Boolean
>
backFromReceive
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustService
.
backFromReceive
(
ids
,
getAccount
(),
reason
));
}
@ApiOperation
(
"提交至样品制备"
)
@PostMapping
(
"/submit_to_make"
)
...
...
@@ -320,6 +332,12 @@ public class EntrustController extends ServiceController {
return
success
(
entrustService
.
registerSubmitToMake
(
ids
,
getAccount
()));
}
@ApiOperation
(
"复制委托信息"
)
@PostMapping
(
"/clone_entrust"
)
public
RestResult
<
Boolean
>
clone
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
entrustService
.
cloneEntrust
(
ids
,
getAccount
()));
}
@ApiOperation
(
"样品接收委托分页列表"
)
@ApiImplicitParams
({
...
...
@@ -416,6 +434,8 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_entrust_test_data"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageTaskTestData
(
EntrustVO
entrust
)
{
entrust
.
setItemStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
// 过滤当前人为检测人的委托数据
entrust
.
setTesterId
(
getAccount
().
getUserId
());
// 获取当前用户分组
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustService
.
pageEntrustByItemData
(
getPage
(),
entrust
));
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleController.java
View file @
372cd089
...
...
@@ -120,6 +120,12 @@ public class EntrustSampleController extends ServiceController {
return
success
(
entrustSampleService
.
updateById
(
entrustSample
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@PutMapping
(
"/edit_sample"
)
public
RestResult
<
Boolean
>
editSample
(
EntrustSample
entrustSample
,
String
source
)
{
return
success
(
entrustSampleService
.
updateSample
(
entrustSample
,
source
,
getAccount
()));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
EntrustSample
entrustSample
)
{
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleItemController.java
View file @
372cd089
...
...
@@ -169,6 +169,7 @@ public class EntrustSampleItemController extends ServiceController {
@PostMapping
(
"/page_input_by_sample_right"
)
public
RestResult
<
Page
<
EntrustSampleItemVO
>>
getPageInputBySampleRight
(
EntrustSampleItemVO
entrustSampleItem
)
{
entrustSampleItem
.
setStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
entrustSampleItem
.
setTesterId
(
getAccount
().
getUserId
());
return
success
(
entrustSampleItemService
.
pageAllotBySampleRight
(
getPage
(),
entrustSampleItem
));
}
...
...
@@ -308,6 +309,7 @@ public class EntrustSampleItemController extends ServiceController {
@PostMapping
(
"/page_test_by_item_left"
)
public
RestResult
<
Page
<
EntrustSampleItemVO
>>
getPageTestByItemLeft
(
EntrustSampleItemVO
entrustSampleItem
)
{
entrustSampleItem
.
setStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
entrustSampleItem
.
setTesterId
(
getAccount
().
getUserId
());
return
success
(
entrustSampleItemService
.
pageByItemLeft
(
getPage
(),
entrustSampleItem
));
}
...
...
@@ -341,6 +343,8 @@ public class EntrustSampleItemController extends ServiceController {
@PostMapping
(
"/page_test_by_item_right"
)
public
RestResult
<
Page
<
EntrustSampleItemVO
>>
getPageTestByItemRight
(
EntrustSampleItemVO
entrustSampleItem
)
{
entrustSampleItem
.
setStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
// 限制只有当前人为检测人方可见
entrustSampleItem
.
setTesterId
(
getAccount
().
getUserId
());
return
success
(
entrustSampleItemService
.
pageByItemRight
(
getPage
(),
entrustSampleItem
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleRecordController.java
0 → 100644
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleRecord
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleRecordService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 样品操作日志表 前端控制器
*
* @author meazty
* @since 2021-07-08
*/
@Api
(
tags
=
"样品操作日志表"
)
@RestController
@RequestMapping
(
"/v1/entrust_sample_record"
)
public
class
EntrustSampleRecordController
extends
ServiceController
{
@Autowired
private
IEntrustSampleRecordService
entrustSampleRecordService
;
@ApiOperation
(
"分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
})
@PostMapping
(
"/page"
)
public
RestResult
<
Page
<
EntrustSampleRecord
>>
getPage
(
EntrustSampleRecord
entrustSampleRecord
)
{
return
success
(
entrustSampleRecordService
.
page
(
getPage
(),
entrustSampleRecord
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@GetMapping
(
"/{id}"
)
public
RestResult
<
EntrustSampleRecord
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
entrustSampleRecordService
.
getById
(
id
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
EntrustSampleRecord
entrustSampleRecord
)
{
entrustSampleRecord
.
setId
(
id
);
return
success
(
entrustSampleRecordService
.
updateById
(
entrustSampleRecord
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
EntrustSampleRecord
entrustSampleRecord
)
{
return
success
(
entrustSampleRecordService
.
save
(
entrustSampleRecord
));
}
@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
)
{
return
success
(
entrustSampleRecordService
.
removeByIds
(
ids
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/OriginalRecordController.java
View file @
372cd089
...
...
@@ -2,6 +2,7 @@ package com.patzn.cloud.service.lims.hmhj.controller;
import
com.patzn.cloud.service.hmhj.entity.OriginalRecord
;
import
com.patzn.cloud.service.hmhj.vo.OriginalRecordVO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -56,6 +57,10 @@ public class OriginalRecordController extends ServiceController {
})
@PostMapping
(
"/pageVO"
)
public
RestResult
<
Page
<
OriginalRecordVO
>>
getPageVO
(
OriginalRecordVO
originalRecordVO
)
{
// 数据检测只能当前人看
if
(
StringUtils
.
isNotBlank
(
originalRecordVO
.
getSource
())
&&
"test"
.
equalsIgnoreCase
(
originalRecordVO
.
getSource
()))
{
originalRecordVO
.
setTesterId
(
getAccount
().
getUserId
());
}
return
success
(
originalRecordService
.
pageVO
(
getPage
(),
originalRecordVO
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/OriginalRecordInfoController.java
0 → 100644
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
controller
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.lims.collection.entity.LmsOriginalRecordInfo
;
import
com.patzn.cloud.service.lims.hmhj.service.ILmsOriginalRecordInfoService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* 原始记录解析后的数据存储表 前端控制器
*
* @author meazty
* @since 2021-07-05
*/
@Api
(
tags
=
"原始记录解析后的数据存储表"
)
@RestController
@RequestMapping
(
"/v1/original_record_info"
)
public
class
OriginalRecordInfoController
extends
ServiceController
{
@Autowired
private
ILmsOriginalRecordInfoService
lmsOriginalRecordInfoService
;
@ApiOperation
(
"分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
})
@PostMapping
(
"/page"
)
public
RestResult
<
Page
<
LmsOriginalRecordInfo
>>
getPage
(
LmsOriginalRecordInfo
lmsOriginalRecordInfo
)
{
return
success
(
lmsOriginalRecordInfoService
.
page
(
getPage
(),
lmsOriginalRecordInfo
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@GetMapping
(
"/{id}"
)
public
RestResult
<
LmsOriginalRecordInfo
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
lmsOriginalRecordInfoService
.
getById
(
id
));
}
@ApiOperation
(
"根据 id 修改信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
LmsOriginalRecordInfo
lmsOriginalRecordInfo
)
{
lmsOriginalRecordInfo
.
setId
(
id
);
return
success
(
lmsOriginalRecordInfoService
.
updateById
(
lmsOriginalRecordInfo
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
LmsOriginalRecordInfo
lmsOriginalRecordInfo
)
{
return
success
(
lmsOriginalRecordInfoService
.
save
(
lmsOriginalRecordInfo
));
}
@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
)
{
return
success
(
lmsOriginalRecordInfoService
.
removeByIds
(
ids
));
}
@ApiOperation
(
"解析采集原始数据信息"
)
@PostMapping
(
"/analysisOriginalData"
)
public
RestResult
<
Boolean
>
analysisOriginalData
(
@RequestParam
(
"templateId"
)
Long
templateId
,
@RequestParam
(
"itemIds"
)
Long
[]
itemIds
)
{
return
success
(
lmsOriginalRecordInfoService
.
analysisOriginalData
(
templateId
,
itemIds
,
getAccount
()));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleRecordMapper.java
0 → 100644
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleRecord
;
/**
* <p>
* 样品操作日志表 Mapper 接口
* </p>
*
* @author meazty
* @since 2021-07-08
*/
public
interface
EntrustSampleRecordMapper
extends
BatchMapper
<
EntrustSampleRecord
>
{
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/LmsOriginalRecordInfoMapper.java
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.vo.OriginalRecordInfoVO
;
import
com.patzn.cloud.service.lims.collection.entity.LmsOriginalRecordInfo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -16,10 +18,5 @@ import java.util.Map;
*/
public
interface
LmsOriginalRecordInfoMapper
extends
BatchMapper
<
LmsOriginalRecordInfo
>
{
/**
* @return
*/
List
<
LmsOriginalRecordInfo
>
selectUnGeneratedEntrustData
();
List
<
LmsOriginalRecordInfo
>
selectUnGeneratedSampleData
();
List
<
OriginalRecordInfoVO
>
selectByItem
(
@Param
(
"itemIds"
)
Long
[]
itemIds
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSamplePrepareService.java
View file @
372cd089
...
...
@@ -28,4 +28,6 @@ public interface IEntrustSamplePrepareService extends IBaseService<EntrustSample
boolean
submitSampleReceive
(
Long
[]
ids
,
Account
account
);
boolean
addOrUpdateToSetStatus
(
Long
[]
sampleIds
,
EntrustSamplePrepareStatusEnum
statusEnum
);
boolean
removeBySampleIds
(
Long
[]
sampleIds
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleRecordService.java
0 → 100644
View file @
372cd089
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.EntrustSampleRecord
;
import
java.util.Collection
;
import
java.util.List
;
/**
* 样品操作日志表 服务类
*
* @author meazty
* @since 2021-07-08
*/
public
interface
IEntrustSampleRecordService
extends
IBaseService
<
EntrustSampleRecord
>
{
Page
<
EntrustSampleRecord
>
page
(
Page
<
EntrustSampleRecord
>
page
,
EntrustSampleRecord
entrustSampleRecord
);
boolean
removeByIds
(
List
<
Long
>
ids
);
void
record
(
Long
[]
ids
,
String
from
,
String
to
,
int
type
,
Account
account
,
String
remark
);
void
record
(
Collection
<
Long
>
ids
,
String
from
,
String
to
,
int
type
,
Account
account
,
String
remark
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleService.java
View file @
372cd089
...
...
@@ -74,4 +74,10 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
boolean
updateSamplePrevFlowInfo
(
Entrust
entrust
,
EntrustFlowEnum
prevFlowStatus
,
Account
account
);
boolean
addStandardSampleDTO
(
EntrustSampleDTO
dto
,
Account
account
);
List
<
EntrustSample
>
getByEntrustId
(
Long
entrustId
);
List
<
Long
>
getIdsByEntrustId
(
Long
entrustId
);
boolean
updateSample
(
EntrustSample
entrustSample
,
String
source
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustService.java
View file @
372cd089
...
...
@@ -76,4 +76,10 @@ public interface IEntrustService extends IBaseService<Entrust> {
boolean
rejectToPrevNode
(
Long
id
,
String
reason
,
Account
account
);
boolean
rejectToPrevNode
(
Entrust
entrust
,
String
reason
,
Account
account
);
boolean
cloneEntrust
(
Long
[]
ids
,
Account
account
);
boolean
backFromMake
(
Long
[]
ids
,
Account
account
,
String
reason
);
boolean
backFromReceive
(
Long
[]
ids
,
Account
account
,
String
reason
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/ILmsOriginalRecordInfoService.java
View file @
372cd089
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.lims.collection.entity.LmsOriginalRecordInfo
;
...
...
@@ -18,5 +19,6 @@ public interface ILmsOriginalRecordInfoService extends IBaseService<LmsOriginalR
boolean
removeByIds
(
List
<
Long
>
ids
);
boolean
generateOriginalRelData
();
boolean
analysisOriginalData
(
Long
templateId
,
Long
[]
itemIds
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/ContractSampleItemServiceImpl.java
View file @
372cd089
...
...
@@ -5,6 +5,7 @@ import com.patzn.cloud.service.hmhj.entity.ContractSampleItem;
import
com.patzn.cloud.service.lims.hmhj.mapper.ContractSampleItemMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.IContractSampleItemService
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
...
...
@@ -23,8 +24,12 @@ public class ContractSampleItemServiceImpl extends BaseServiceImpl<ContractSampl
@Override
public
Page
<
ContractSampleItem
>
page
(
Page
<
ContractSampleItem
>
page
,
ContractSampleItem
contractSampleItem
)
{
String
name
=
contractSampleItem
.
getName
();
contractSampleItem
.
setName
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
contractSampleItem
);
if
(
StringUtils
.
isNotBlank
(
name
)){
wrapper
.
like
(
"name"
,
name
);
}
return
this
.
page
(
page
,
wrapper
);
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/ContractSampleServiceImpl.java
View file @
372cd089
...
...
@@ -59,7 +59,17 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
@Override
public
Page
<
ContractSample
>
page
(
Page
<
ContractSample
>
page
,
ContractSample
contractSample
)
{
String
code
=
contractSample
.
getCode
();
String
materialName
=
contractSample
.
getMaterialName
();
contractSample
.
setCode
(
null
).
setMaterialName
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
contractSample
);
if
(
StringUtils
.
isNotBlank
(
code
)){
wrapper
.
like
(
"code"
,
code
);
}
if
(
StringUtils
.
isNotBlank
(
materialName
)){
wrapper
.
like
(
"material_name"
,
materialName
);
}
wrapper
.
orderBy
(
"ctime"
,
false
);
return
this
.
page
(
page
,
wrapper
);
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportServiceImpl.java
View file @
372cd089
...
...
@@ -202,7 +202,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
private
boolean
executeSubmitOperation
(
Entrust
entrust
,
Account
account
)
{
if
(
null
==
entrust
||
StringUtils
.
isBlank
(
entrust
.
getStatusPath
()))
{
if
(
StringUtils
.
isBlank
(
entrust
.
getStatusPath
()))
{
logger
.
error
(
"委托为空,或者委托路径为空不进行下一步操作"
);
return
false
;
}
...
...
@@ -269,7 +269,10 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
// 存在的状态路径时,方可进入处理操作
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
account
);
Entrust
entrust
=
getByReportId
(
ids
[
0
]);
entrust
.
setTestTimeE
(
new
Date
());
entrustService
.
updateById
(
entrust
);
executeSubmitOperation
(
entrust
,
account
);
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
@@ -301,7 +304,12 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
// 存在的状态路径时,方可进入处理操作
executeSubmitOperation
(
getByReportId
(
ids
[
0
]),
account
);
Entrust
entrust
=
getByReportId
(
ids
[
0
]);
// 报告批准,获取当前时间为检测结束时间
entrust
.
setTestTimeE
(
new
Date
());
entrustService
.
updateById
(
entrust
);
executeSubmitOperation
(
entrust
,
account
);
return
super
.
update
(
report
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
372cd089
...
...
@@ -112,8 +112,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Override
public
Page
<
EntrustSampleItem
>
page
(
Page
<
EntrustSampleItem
>
page
,
EntrustSampleItem
entrustSampleItem
)
{
String
name
=
entrustSampleItem
.
getName
();
entrustSampleItem
.
setName
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustSampleItem
);
if
(
StringUtils
.
isNotBlank
(
name
)){
wrapper
.
like
(
"name"
,
name
);
}
return
this
.
page
(
page
,
wrapper
);
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSamplePrepareServiceImpl.java
View file @
372cd089
...
...
@@ -6,6 +6,7 @@ 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.controller.LoginHelper
;
import
com.patzn.cloud.service.hmhj.dto.SamplePrepareDTO
;
import
com.patzn.cloud.service.hmhj.entity.*
;
import
com.patzn.cloud.service.hmhj.enums.*
;
...
...
@@ -64,6 +65,17 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Override
public
boolean
removeBySampleIds
(
Long
[]
sampleIds
)
{
if
(
null
==
sampleIds
||
sampleIds
.
length
==
0
){
return
false
;
}
Account
account
=
LoginHelper
.
getAccount
();
EntrustSamplePrepare
samplePrepare
=
new
EntrustSamplePrepare
();
samplePrepare
.
setDeleted
(
1
).
setLid
(
account
.
getUserId
()).
setLtime
(
new
Date
());
return
update
(
samplePrepare
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
).
eq
(
"deleted"
,
0
));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
makeEnd
(
SamplePrepareDTO
dto
,
Account
account
)
{
...
...
@@ -155,7 +167,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
saveBatch
(
savePrepare
);
List
<
EntrustSample
>
checkMakeList
=
entrustSampleService
.
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
()).
eq
(
"status"
,
EntrustSampleStatusEnum
.
DRAFT
));
if
(
CollectionUtils
.
isEmpty
(
checkMakeList
)
&&
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
())
)
{
if
(
CollectionUtils
.
isEmpty
(
checkMakeList
))
{
// String flowStatus = entrust.getFlowStatus();
// String statusPath = entrust.getStatusPath();
// // 获取委托的状态
...
...
@@ -170,7 +182,18 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
// updateEntrust.setId(entrust.getId());
// entrustService.updateById(updateEntrust);
// 根据流程状态提交
entrustService
.
submitToNextNode
(
entrust
,
account
);
if
(
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
()))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
Entrust
updateEntrust
=
new
Entrust
();
updateEntrust
.
setStatus
(
EntrustStatusEnum
.
TEST
);
updateEntrust
.
setProgress
(
EntrustStatusEnum
.
TEST
);
updateEntrust
.
setFlowStatus
(
EntrustFlowEnum
.
RECEIVE
.
getName
());
updateEntrust
.
setId
(
entrust
.
getId
());
entrustService
.
updateById
(
updateEntrust
);
// String remark = "提交至样品接收", title = "新的样品接收任务!";
// entrustRecordService.record(new Long[]{entrust.getId()}, status.getDisplay(), nextStatus.getDisplay(), 0, account, remark);
}
}
...
...
@@ -195,6 +218,12 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
sampleIdsList
.
add
(
prepare
.
getEntrustSampleId
());
}
EntrustSample
entrustSample
=
entrustSampleService
.
getById
(
prepareList
.
get
(
0
).
getEntrustSampleId
());
Entrust
entrust
=
entrustService
.
getById
(
entrustSample
.
getEntrustId
());
if
(
null
==
entrust
.
getTestAddress
()){
// entrust.setReceiveTime(new Date());
}
EntrustSamplePrepare
prepare
=
new
EntrustSamplePrepare
();
prepare
.
setStatus
(
EntrustSamplePrepareStatusEnum
.
TEST
);
prepare
.
setStatus
(
EntrustSamplePrepareStatusEnum
.
TEST
);
...
...
@@ -226,10 +255,13 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
}
if
(
CollectionUtils
.
isEmpty
(
notOkSampleIds
))
{
EntrustSample
entrustSample
=
entrustSampleService
.
getById
(
prepareList
.
get
(
0
).
getEntrustSampleId
());
Entrust
entrust
=
entrustService
.
getById
(
entrustSample
.
getEntrustId
());
// 检测开始时间为接收时间
entrust
.
setTestTimeS
(
new
Date
());
if
(
StringUtils
.
isNotEmpty
(
entrust
.
getStatusPath
()))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
TEST
.
getName
());
entrustService
.
updateById
(
entrust
);
}
}
...
...
@@ -263,7 +295,7 @@ public class EntrustSamplePrepareServiceImpl extends BaseServiceImpl<EntrustSamp
}
else
{
EntrustSamplePrepare
prepare
=
new
EntrustSamplePrepare
();
prepare
.
setStatus
(
statusEnum
).
setStatus
(
statusEnum
);
update
(
prepare
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
).
eq
(
"deleted"
,
0
));
update
(
prepare
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
).
eq
(
"deleted"
,
0
));
}
return
false
;
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleRecordServiceImpl.java
0 → 100644
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
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.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleRecord
;
import
com.patzn.cloud.service.lims.hmhj.mapper.EntrustSampleRecordMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleRecordService
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collection
;
import
java.util.List
;
/**
* 样品操作日志表 服务实现类
*
* @author meazty
* @since 2021-07-08
*/
@Service
public
class
EntrustSampleRecordServiceImpl
extends
BaseServiceImpl
<
EntrustSampleRecordMapper
,
EntrustSampleRecord
>
implements
IEntrustSampleRecordService
{
@Override
public
Page
<
EntrustSampleRecord
>
page
(
Page
<
EntrustSampleRecord
>
page
,
EntrustSampleRecord
entrustSampleRecord
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustSampleRecord
);
return
this
.
page
(
page
,
wrapper
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Override
public
void
record
(
Long
[]
ids
,
String
from
,
String
to
,
int
type
,
Account
account
,
String
remark
)
{
record
(
Arrays
.
asList
(
ids
),
from
,
to
,
type
,
account
,
remark
);
}
@Override
public
void
record
(
Collection
<
Long
>
ids
,
String
from
,
String
to
,
int
type
,
Account
account
,
String
remark
)
{
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
ids
),
"样品ID不能为空"
);
List
<
EntrustSampleRecord
>
saveRecord
=
new
ArrayList
<>();
for
(
Long
entrustId
:
ids
)
{
EntrustSampleRecord
sampleRecord
=
new
EntrustSampleRecord
();
sampleRecord
.
setSampleId
(
entrustId
);
sampleRecord
.
setOperator
(
account
.
getUserName
());
sampleRecord
.
setOperatorId
(
account
.
getUserId
());
sampleRecord
.
setOrigin
(
from
);
sampleRecord
.
setTarget
(
to
);
sampleRecord
.
setType
(
type
);
sampleRecord
.
setRemark
(
remark
);
saveRecord
.
add
(
sampleRecord
);
}
if
(
CollectionUtils
.
isNotEmpty
(
saveRecord
))
{
saveBatch
(
saveRecord
);
}
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.baomidou.mybatisplus.mapper.Condition
;
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.google.common.collect.Lists
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.commons.toolkit.DateUtils
;
import
com.patzn.cloud.commons.toolkit.FileUtils
;
import
com.patzn.cloud.feign.base.client.SysFileTemplateClient
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.service.base.entity.SysFileTemplate
;
import
com.patzn.cloud.service.hmhj.dto.EntrustSampleDTO
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.ReportDTO
;
...
...
@@ -17,16 +20,14 @@ import com.patzn.cloud.service.hmhj.dto.StatsQueryDTO;
import
com.patzn.cloud.service.hmhj.entity.*
;
import
com.patzn.cloud.service.hmhj.enums.*
;
import
com.patzn.cloud.service.hmhj.vo.*
;
import
com.patzn.cloud.service.lims.common.BeanUtils
;
import
com.patzn.cloud.service.lims.common.StringHandleUtils
;
import
com.patzn.cloud.service.lims.hmhj.common.HSSFWorkbookUtil
;
import
com.patzn.cloud.service.lims.hmhj.mapper.EntrustSampleMapper
;
import
com.patzn.cloud.service.lims.hmhj.original.OriginalUtil
;
import
com.patzn.cloud.service.lims.hmhj.service.*
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.poibox.xwpf.PoiUtil2007
;
import
com.patzn.poibox.xwpf.XWPFTemplate
;
import
org.apache.commons.collections.ListUtils
;
import
org.apache.commons.collections.MapUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.util.CellRangeAddress
;
...
...
@@ -37,9 +38,6 @@ import org.apache.poi.xwpf.usermodel.XWPFTableCell;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.io.File
;
...
...
@@ -47,7 +45,6 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -62,6 +59,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Autowired
private
SysFileTemplateClient
sysFileTemplateClient
;
@Autowired
private
IEntrustSampleRecordService
entrustSampleRecordService
;
@Autowired
private
IEntrustReportTemplateService
entrustReportTemplateService
;
...
...
@@ -222,41 +222,54 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
long
days
=
DateUtils
.
getDaysBetweenTwoDate
(
queryDTO
.
getTimeS
(),
queryDTO
.
getTimeE
());
queryDTO
.
setDays
(
days
);
List
<
AlTasteStatsVO
>
list
=
baseMapper
.
selectAlTasteStats
(
queryDTO
);
List
<
AlTasteStatsVO
>
resultList
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
resultL
ist
;
return
l
ist
;
}
List
<
AlTasteStatsVO
>
resultList
=
new
ArrayList
<>();
Map
<
String
,
List
<
AlTasteStatsVO
>>
dataMap
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
AlTasteStatsVO
vo
=
list
.
get
(
i
);
String
key
=
vo
.
getBranch
()
+
vo
.
getPlant
();
if
(
dataMap
.
isEmpty
())
{
List
<
AlTasteStatsVO
>
newList
=
new
ArrayList
<>();
newList
.
add
(
vo
);
dataMap
.
put
(
key
,
newList
);
AlTasteStatsVO
curr
=
list
.
get
(
i
);
// 以【分厂+厂房】作为获取上一条记录的KEY
String
key
=
curr
.
getBranch
()
+
curr
.
getPlant
();
// 是否存在同KEY数据
if
(
dataMap
.
containsKey
(
key
))
{
List
<
AlTasteStatsVO
>
voList
=
dataMap
.
get
(
key
);
voList
.
add
(
curr
);
// 若当前的条数为最后一条,那么处理统计数据
if
(
i
==
list
.
size
()
-
1
)
{
resultList
.
add
(
vo
);
resultList
.
add
(
getTotalData
(
list
));
// 将列表数据加入集合中
resultList
.
addAll
(
voList
);
// 将统计数据加入集合中
resultList
.
add
(
getTotalData
(
voList
));
}
continue
;
}
if
(!
dataMap
.
containsKey
(
key
))
{
AlTasteStatsVO
prevVO
=
list
.
get
(
i
-
1
);
List
<
AlTasteStatsVO
>
prevList
=
dataMap
.
get
(
prevVO
.
getBranch
()
+
prevVO
.
getPlant
());
resultList
.
addAll
(
prevList
);
resultList
.
add
(
getTotalData
(
prevList
));
}
else
{
List
<
AlTasteStatsVO
>
lists
=
dataMap
.
get
(
key
);
lists
.
add
(
vo
);
// 若不包含当前数据,取出前条数据进行统计后加入集合中,后将当前数据加入map
else
{
// 是否需要取出数据处理
if
(
i
>
0
)
{
AlTasteStatsVO
prev
=
list
.
get
(
i
-
1
);
List
<
AlTasteStatsVO
>
voList
=
dataMap
.
get
(
prev
.
getBranch
()
+
prev
.
getPlant
());
// 将列表数据加入集合中
resultList
.
addAll
(
voList
);
// 将统计数据加入集合中
resultList
.
add
(
getTotalData
(
voList
));
}
// 将当前数据加入mapData中
List
<
AlTasteStatsVO
>
voList
=
new
ArrayList
<>();
if
(
i
==
list
.
size
()
-
1
)
{
resultList
.
addAll
(
lists
);
resultList
.
add
(
getTotalData
(
lists
));
resultList
.
add
(
curr
);
voList
.
add
(
curr
);
resultList
.
add
(
getTotalData
(
voList
));
}
else
{
voList
.
add
(
curr
);
dataMap
.
put
(
key
,
voList
);
}
}
}
// 汇总所有
// 汇总所有
查询出的列表数据
AlTasteStatsVO
alTasteStatsVO
=
getTotalData
(
list
);
alTasteStatsVO
.
setBranch
(
null
);
resultList
.
add
(
alTasteStatsVO
);
...
...
@@ -280,7 +293,12 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
for
(
PMakeFeStatsVO
vo
:
list
)
{
PMakeFeVO
val
=
new
PMakeFeVO
(),
per
=
new
PMakeFeVO
(),
ltNum
=
new
PMakeFeVO
(),
gtNum
=
new
PMakeFeVO
(),
inNum
=
new
PMakeFeVO
();
PMakeFeVO
val
=
new
PMakeFeVO
();
PMakeFeVO
per
=
new
PMakeFeVO
();
PMakeFeVO
ltNum
=
new
PMakeFeVO
();
PMakeFeVO
gtNum
=
new
PMakeFeVO
();
PMakeFeVO
inNum
=
new
PMakeFeVO
();
val
.
setCVal
(
vo
.
getCVal
()
+
""
).
setMnVal
(
vo
.
getMnVal
()
+
""
).
setSiVal
(
vo
.
getSiVal
()
+
""
).
setPVal
(
vo
.
getPVal
()
+
""
).
setSVal
(
vo
.
getSVal
()
+
""
);
per
.
setCVal
(
vo
.
getCPer
()
+
""
).
setMnVal
(
vo
.
getMnPer
()
+
""
).
setSiVal
(
vo
.
getSiPer
()
+
""
).
setPVal
(
vo
.
getPPer
()
+
""
).
setSVal
(
vo
.
getSPer
()
+
""
);
ltNum
.
setCVal
(
vo
.
getCLtNum
()
+
""
).
setMnVal
(
vo
.
getMnLtNum
()
+
""
).
setSiVal
(
vo
.
getSiLtNum
()
+
""
).
setPVal
(
vo
.
getPLtNum
()
+
""
);
...
...
@@ -311,15 +329,15 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
}
else
if
(
nextFlowStatus
==
EntrustFlowEnum
.
RECEIVE
)
{
sampleStatus
=
EntrustSampleStatusEnum
.
RECEIVE
;
itemStatus
=
EntrustSampleItemStatusEnum
.
DRAFT
;
entrustSamplePrepareService
.
addOrUpdateToSetStatus
(
sampleIds
,
EntrustSamplePrepareStatusEnum
.
RECEIVE
);
entrustSamplePrepareService
.
addOrUpdateToSetStatus
(
sampleIds
,
EntrustSamplePrepareStatusEnum
.
RECEIVE
);
}
else
if
(
nextFlowStatus
==
EntrustFlowEnum
.
ALLOT
)
{
sampleStatus
=
EntrustSampleStatusEnum
.
TEST
;
itemStatus
=
EntrustSampleItemStatusEnum
.
ALLOT
;
entrustSamplePrepareService
.
addOrUpdateToSetStatus
(
sampleIds
,
EntrustSamplePrepareStatusEnum
.
RECEIVE_OK
);
entrustSamplePrepareService
.
addOrUpdateToSetStatus
(
sampleIds
,
EntrustSamplePrepareStatusEnum
.
RECEIVE_OK
);
}
else
if
(
nextFlowStatus
==
EntrustFlowEnum
.
TEST
)
{
sampleStatus
=
EntrustSampleStatusEnum
.
TEST
;
itemStatus
=
EntrustSampleItemStatusEnum
.
TEST
;
entrustSamplePrepareService
.
addOrUpdateToSetStatus
(
sampleIds
,
EntrustSamplePrepareStatusEnum
.
TEST
);
entrustSamplePrepareService
.
addOrUpdateToSetStatus
(
sampleIds
,
EntrustSamplePrepareStatusEnum
.
TEST
);
}
else
if
(
nextFlowStatus
==
EntrustFlowEnum
.
REPORT_MAKE
)
{
sampleStatus
=
EntrustSampleStatusEnum
.
REPORT_MAKE
;
itemStatus
=
EntrustSampleItemStatusEnum
.
END
;
...
...
@@ -357,7 +375,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Override
public
boolean
updateSamplePrevFlowInfo
(
Entrust
entrust
,
EntrustFlowEnum
prevFlowStatus
,
Account
account
)
{
EntrustStatusEnum
statusEnum
=
entrust
.
getStatus
();
List
<
EntrustSample
>
sampleList
=
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
()).
eq
(
"deleted"
,
0
));
List
<
EntrustSample
>
sampleList
=
getByEntrustId
(
entrust
.
getId
(
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleList
),
String
.
format
(
"编号为【%s】委托下样品为空"
,
entrust
.
getCode
()));
Long
[]
sampleIds
=
sampleList
.
stream
().
map
(
t
->
t
.
getId
()).
toArray
(
size
->
new
Long
[
size
]);
//
...
...
@@ -414,12 +432,18 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
sampleStatus
=
EntrustSampleStatusEnum
.
REPORT_SEND
;
}
if
(
statusEnum
==
EntrustStatusEnum
.
TEST
&&
prevFlowStatus
.
getValue
()
<
5
)
{
entrustSamplePrepareService
.
removeBySampleIds
(
sampleIds
);
}
if
(
null
!=
sampleStatus
)
{
updateSample
.
setStatus
(
sampleStatus
);
updateSample
.
setProgress
(
sampleStatus
);
update
(
updateSample
,
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
()));
}
if
(
null
!=
itemStatus
)
{
updateItem
.
setStatus
(
itemStatus
);
updateItem
.
setProgress
(
itemStatus
);
entrustSampleItemService
.
update
(
updateItem
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
}
return
false
;
...
...
@@ -427,24 +451,51 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Override
public
boolean
addStandardSampleDTO
(
EntrustSampleDTO
dto
,
Account
account
)
{
if
(
null
==
dto
){
if
(
null
==
dto
)
{
return
false
;
}
EntrustSample
sample
=
dto
.
convert
(
EntrustSample
.
class
);
// 添加后排序,不论是否成功添加标样
List
<
EntrustSample
>
sampleList
=
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
dto
.
getEntrustId
())
.
orderBy
(
"order_by"
,
true
).
orderBy
(
"ctime"
,
false
));
// 若为一个样品,则不进行排序处理
if
(
CollectionUtils
.
isNotEmpty
(
sampleList
)
&&
sampleList
.
size
()
>
1
)
{
for
(
int
i
=
0
;
i
<
sampleList
.
size
();
i
++)
{
sampleList
.
get
(
i
).
setOrderBy
(
i
);
}
updateBatchById
(
sampleList
);
}
EntrustSample
sample
=
dto
.
convert
(
EntrustSample
.
class
);
//标样
sample
.
setType
(
1
);
if
(
save
(
sample
)){
List
<
EntrustSampleItem
>
itemList
=
dto
.
getItemList
();
if
(
CollectionUtils
.
isNotEmpty
(
itemList
)){
for
(
EntrustSampleItem
item
:
itemList
)
{
item
.
setEntrustSampleId
(
sample
.
getId
());
item
.
setStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
item
.
setStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
}
entrustSampleItemService
.
saveBatch
(
itemList
);
}
}
return
false
;
if
(
save
(
sample
))
{
List
<
EntrustSampleItem
>
itemList
=
dto
.
getItemList
();
if
(
CollectionUtils
.
isNotEmpty
(
itemList
))
{
for
(
EntrustSampleItem
item
:
itemList
)
{
item
.
setEntrustSampleId
(
sample
.
getId
());
item
.
setStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
item
.
setProgress
(
EntrustSampleItemStatusEnum
.
TEST
);
item
.
setTester
(
account
.
getUserName
());
item
.
setTesterId
(
account
.
getUserId
());
}
entrustSampleItemService
.
saveBatch
(
itemList
);
}
}
return
true
;
}
@Override
public
List
<
EntrustSample
>
getByEntrustId
(
Long
entrustId
)
{
return
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
entrustId
).
eq
(
"deleted"
,
0
));
}
@Override
public
List
<
Long
>
getIdsByEntrustId
(
Long
entrustId
)
{
List
<
EntrustSample
>
list
=
getByEntrustId
(
entrustId
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
new
ArrayList
<>();
}
return
list
.
stream
().
map
(
t
->
t
.
getId
()).
collect
(
Collectors
.
toList
());
}
@Override
...
...
@@ -1079,7 +1130,34 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
cell
.
setText
(
StringHandleUtils
.
getFieldValueByFieldName
(
StringHandleUtils
.
getObjectFromMap
(
itemCellMap
,
k
),
object
));
}
}
}
}
@Override
public
boolean
updateSample
(
EntrustSample
entrustSample
,
String
source
,
Account
account
)
{
RestAssert
.
fail
(
StringUtils
.
isBlank
(
source
),
"来源节点不能为空"
);
EntrustFlowEnum
flowStatus
=
EntrustFlowEnum
.
convert
(
source
.
toUpperCase
());
EntrustSample
sourceSample
=
getById
(
entrustSample
.
getId
());
EntrustSample
updateSample
=
new
EntrustSample
();
BeanUtils
.
copyProperties
(
sourceSample
,
updateSample
);
BeanUtils
.
copyProperties
(
entrustSample
,
updateSample
,
true
);
updateById
(
updateSample
);
String
sampleShape
=
null
==
entrustSample
.
getSampleShape
()
?
""
:
entrustSample
.
getSampleShape
();
String
sampleFrom
=
null
==
entrustSample
.
getSampleFrom
()
?
""
:
entrustSample
.
getSampleFrom
();
StringBuffer
sb
=
new
StringBuffer
();
String
remark
=
""
;
if
(!
sourceSample
.
getSampleShape
().
equals
(
sampleShape
))
{
sb
.
append
(
String
.
format
(
"样品状态:由【%s】 修改为 【%s】,"
,
sourceSample
.
getSampleShape
(),
sampleShape
));
}
if
(!
sourceSample
.
getSampleFrom
().
equals
(
sampleFrom
))
{
sb
.
append
(
String
.
format
(
"样品来源:由【%s】 修改为 【%s】,"
,
sourceSample
.
getSampleFrom
(),
sampleFrom
));
}
if
(
sb
.
length
()
>
0
)
{
remark
=
sb
.
substring
(
0
,
sb
.
length
()
-
1
);
}
entrustSampleRecordService
.
record
(
new
Long
[]{
entrustSample
.
getId
()},
flowStatus
.
getDisplay
(),
flowStatus
.
getDisplay
(),
2
,
account
,
remark
);
return
true
;
}
}
\ No newline at end of file
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
372cd089
...
...
@@ -86,8 +86,16 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override
public
Page
<
Entrust
>
page
(
Page
<
Entrust
>
page
,
Entrust
entrust
)
{
String
code
=
entrust
.
getCode
();
String
client
=
entrust
.
getClient
();
entrust
.
setCode
(
null
).
setClient
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrust
);
wrapper
.
orderBy
(
"entrust_time"
,
false
);
if
(
StringUtils
.
isNotBlank
(
code
))
{
wrapper
.
like
(
"code"
,
code
);
}
if
(
StringUtils
.
isNotBlank
(
client
))
{
wrapper
.
like
(
"client"
,
client
);
}
wrapper
.
orderBy
(
"code"
,
false
);
return
this
.
page
(
page
,
wrapper
);
}
...
...
@@ -216,13 +224,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
List
<
EntrustSampleItem
>
saveEntrustSampleItemList
=
new
ArrayList
<>();
for
(
EntrustSampleDTO
sampleDTO
:
sampleDTOList
)
{
for
(
int
x
=
0
;
x
<
sampleDTOList
.
size
();
x
++)
{
EntrustSampleDTO
sampleDTO
=
sampleDTOList
.
get
(
x
);
EntrustSample
sample
=
sampleDTO
.
convert
(
EntrustSample
.
class
);
sample
.
setEntrustId
(
entrust
.
getId
());
//生成样品编号
initSampleCode
(
sample
);
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setOrderBy
(
x
);
saveSampleList
.
add
(
sample
);
List
<
EntrustSampleItem
>
experiments
=
sampleDTO
.
getItemList
();
if
(
CollectionUtils
.
isEmpty
(
experiments
))
{
...
...
@@ -262,6 +271,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Entrust
entrust
=
new
Entrust
();
entrust
.
setStatus
(
EntrustStatusEnum
.
CHECK
);
entrust
.
setProgress
(
EntrustStatusEnum
.
CHECK
);
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
CHECK
.
getName
());
if
(
update
(
entrust
,
Condition
.
create
().
in
(
"id"
,
ids
)))
{
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"提交至委托审核"
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
null
);
...
...
@@ -302,6 +312,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
else
{
e
.
setStatus
(
EntrustStatusEnum
.
DRAFT
);
e
.
setProgress
(
EntrustStatusEnum
.
BACK_CHECK
);
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
updateById
(
e
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
}
...
...
@@ -328,6 +339,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
else
{
e
.
setStatus
(
EntrustStatusEnum
.
MAKE
);
e
.
setProgress
(
EntrustStatusEnum
.
MAKE
);
e
.
setFlowStatus
(
EntrustFlowEnum
.
MAKE
.
getName
());
updateById
(
e
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"提交至样品待制备"
);
}
...
...
@@ -353,6 +365,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
else
{
e
.
setStatus
(
EntrustStatusEnum
.
MAKE
);
e
.
setProgress
(
EntrustStatusEnum
.
MAKE
);
e
.
setFlowStatus
(
EntrustFlowEnum
.
MAKE
.
getName
());
updateById
(
e
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"委托登记提交至样品待制备"
);
}
...
...
@@ -386,20 +399,18 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
List
<
EntrustSampleItem
>
saveItemList
=
new
ArrayList
<>();
for
(
EntrustSampleDTO
dto
:
sampleList
)
{
for
(
int
x
=
0
;
x
<
sampleList
.
size
();
x
++
)
{
EntrustSampleDTO
dto
=
sampleList
.
get
(
x
);
EntrustSample
sample
=
dto
.
convert
(
EntrustSample
.
class
);
sample
.
setOrderBy
(
x
);
if
(
null
!=
sample
.
getId
())
{
updateSampleList
.
add
(
sample
);
sampleIdsList
.
add
(
sample
.
getId
());
}
else
{
sample
.
setEntrustId
(
entrust
.
getId
());
initSampleCode
(
sample
);
sample
.
setId
(
IdWorker
.
getId
());
saveSampleList
.
add
(
sample
);
}
List
<
EntrustSampleItem
>
viewItemList
=
dto
.
getItemList
();
...
...
@@ -467,7 +478,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Entrust
entrust
=
getById
(
id
);
if
(
null
!=
entrust
)
{
EntrustDTO
vo
=
entrust
.
convert
(
EntrustDTO
.
class
);
List
<
EntrustSampleDTO
>
sampleList
=
baseMapper
.
listByContractId
(
id
);
// 只查询正常样品,不查询标样
List
<
EntrustSampleDTO
>
sampleList
=
listSampleDTOByType
(
id
,
0
);
if
(
CollectionUtils
.
isNotEmpty
(
sampleList
))
{
List
<
Long
>
sampleIdList
=
sampleList
.
stream
().
map
(
s
->
{
return
s
.
getId
();
...
...
@@ -998,12 +1010,15 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
else
if
(
prevStatus
==
EntrustStatusEnum
.
QUALITY_CHECK
)
{
uri
=
"/hmhj/quality_manage/quality_decide"
;
}
// 更新委托样品信息
entrustSampleService
.
updateSamplePrevFlowInfo
(
entrust
,
prevFlowStatus
,
account
);
entrust
.
setStatus
(
prevStatus
);
entrust
.
setProgress
(
EntrustStatusEnum
.
BACK_CHECK
);
entrust
.
setFlowStatus
(
prevFlowStatus
.
getName
());
updateById
(
entrust
);
// 更新委托样品信息
entrustSampleService
.
updateSamplePrevFlowInfo
(
entrust
,
prevFlowStatus
,
account
);
String
title
=
String
.
format
(
"新的%s任务!"
,
prevFlowStatus
.
getDisplay
()),
content
=
String
.
format
(
"有%s驳回过来,请及时%s"
,
EntrustFlowEnum
.
convert
(
flowStatus
).
getDisplay
(),
prevFlowStatus
.
getDisplay
());
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
status
.
getDisplay
(),
prevStatus
.
getDisplay
(),
1
,
account
,
reason
);
...
...
@@ -1013,4 +1028,134 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return
true
;
}
@Override
public
boolean
cloneEntrust
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
null
==
ids
||
ids
.
length
==
0
,
"请选择要复制的委托记录"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
entrustList
),
"请选择要复制的委托记录"
);
// 循环遍历设置委托及其样品信息
List
<
EntrustSample
>
entrustSampleList
=
new
ArrayList
<>();
List
<
EntrustSampleItem
>
entrustSampleItemList
=
new
ArrayList
<>();
for
(
Entrust
entrust
:
entrustList
)
{
// ==
List
<
EntrustSample
>
sampleList
=
entrustSampleService
.
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
()).
eq
(
"deleted"
,
0
));
if
(
CollectionUtils
.
isEmpty
(
sampleList
))
{
continue
;
}
entrust
.
setId
(
null
);
entrust
.
setCode
(
null
).
setStatus
(
EntrustStatusEnum
.
DRAFT
).
setProgress
(
EntrustStatusEnum
.
DRAFT
);
entrust
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
);
// 配置初始状态
String
flowStatus
=
EntrustFlowEnum
.
DRAFT
.
getName
();
if
(
StringUtils
.
isNotBlank
(
entrust
.
getStatusPath
()))
{
flowStatus
=
entrust
.
getStatusPath
().
split
(
"->"
)[
0
];
}
entrust
.
setFlowStatus
(
flowStatus
);
// 保存委托信息
saveEntrust
(
entrust
);
int
sampleIndex
=
0
;
for
(
EntrustSample
sample
:
sampleList
)
{
List
<
EntrustSampleItem
>
itemList
=
entrustSampleItemService
.
list
(
Condition
.
create
().
eq
(
"entrust_sample_id"
,
sample
.
getId
()).
eq
(
"deleted"
,
0
));
if
(
CollectionUtils
.
isEmpty
(
itemList
))
{
continue
;
}
//生成样品编号,可能存在为空的情况
initSampleCode
(
sample
);
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setEntrustId
(
entrust
.
getId
()).
setOrderBy
(
sampleIndex
);
sample
.
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
).
setProgress
(
EntrustSampleStatusEnum
.
DRAFT
);
sample
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
);
for
(
EntrustSampleItem
item
:
itemList
)
{
item
.
setId
(
null
);
item
.
setEntrustSampleId
(
sample
.
getId
());
item
.
setStatus
(
EntrustSampleItemStatusEnum
.
DRAFT
);
item
.
setProgress
(
EntrustSampleItemStatusEnum
.
DRAFT
);
item
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
);
}
entrustSampleItemList
.
addAll
(
itemList
);
sampleIndex
+=
1
;
}
entrustSampleList
.
addAll
(
sampleList
);
}
if
(
entrustSampleList
.
size
()
>
0
)
{
entrustSampleService
.
saveBatch
(
entrustSampleList
);
}
if
(
entrustSampleItemList
.
size
()
>
0
)
{
entrustSampleItemService
.
saveBatch
(
entrustSampleItemList
);
}
// 操作记录
entrustRecordService
.
record
(
ids
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
0
,
account
,
"复制初始化委托"
);
return
true
;
}
@Override
public
boolean
backFromMake
(
Long
[]
ids
,
Account
account
,
String
reason
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要驳回的委托"
);
int
count
=
super
.
count
(
Condition
.
create
().
in
(
"id"
,
ids
).
eq
(
"status"
,
EntrustStatusEnum
.
MAKE
));
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择要退回至登记的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
boolean
hasSendMessage
=
false
;
for
(
Entrust
e
:
entrustList
)
{
e
.
setStatus
(
EntrustStatusEnum
.
DRAFT
);
e
.
setProgress
(
EntrustStatusEnum
.
BACK_MAKE
);
// 流程节点变更为登记
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
updateById
(
e
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
// 更新样品状态
EntrustSample
entrustSample
=
new
EntrustSample
();
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
entrustSample
.
setProgress
(
EntrustSampleStatusEnum
.
DRAFT
);
EntrustSampleItem
entrustSampleItem
=
new
EntrustSampleItem
();
entrustSampleItem
.
setStatus
(
EntrustSampleItemStatusEnum
.
DRAFT
);
entrustSampleItem
.
setProgress
(
EntrustSampleItemStatusEnum
.
DRAFT
);
List
<
Long
>
sampleIds
=
entrustSampleService
.
getIdsByEntrustId
(
e
.
getId
());
entrustSampleService
.
update
(
entrustSample
,
Condition
.
create
().
eq
(
"entrust_id"
,
e
.
getId
()));
if
(
sampleIds
.
size
()
>
0
)
{
entrustSampleItemService
.
update
(
entrustSampleItem
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
}
}
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品制备退回,请及时查看退回原因并处理"
,
"新的样品制备退回任务!"
,
account
,
null
);
return
true
;
}
@Override
public
boolean
backFromReceive
(
Long
[]
ids
,
Account
account
,
String
reason
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要驳回的委托"
);
int
count
=
super
.
count
(
Condition
.
create
().
in
(
"id"
,
ids
).
eq
(
"status"
,
EntrustStatusEnum
.
TEST
));
RestAssert
.
fail
(
ids
.
length
!=
count
,
"请选择要退回至登记的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
boolean
hasSendMessage
=
false
;
for
(
Entrust
e
:
entrustList
)
{
e
.
setStatus
(
EntrustStatusEnum
.
DRAFT
);
e
.
setProgress
(
EntrustStatusEnum
.
BACK_RECEIVE
);
// 流程节点变更为登记
e
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
());
updateById
(
e
);
entrustRecordService
.
record
(
new
Long
[]{
e
.
getId
()},
EntrustStatusEnum
.
TEST
.
getDisplay
(),
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
1
,
account
,
reason
);
// 更新样品状态
EntrustSample
entrustSample
=
new
EntrustSample
();
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
entrustSample
.
setProgress
(
EntrustSampleStatusEnum
.
DRAFT
);
EntrustSampleItem
entrustSampleItem
=
new
EntrustSampleItem
();
entrustSampleItem
.
setStatus
(
EntrustSampleItemStatusEnum
.
DRAFT
);
entrustSampleItem
.
setProgress
(
EntrustSampleItemStatusEnum
.
DRAFT
);
List
<
Long
>
sampleIds
=
entrustSampleService
.
getIdsByEntrustId
(
e
.
getId
());
entrustSampleService
.
update
(
entrustSample
,
Condition
.
create
().
eq
(
"entrust_id"
,
e
.
getId
()));
entrustSamplePrepareService
.
removeBySampleIds
(
sampleIds
.
toArray
(
new
Long
[
sampleIds
.
size
()]));
if
(
sampleIds
.
size
()
>
0
)
{
entrustSampleItemService
.
update
(
entrustSampleItem
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
}
}
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_register"
,
"有委托从样品接收退回,请及时查看退回原因并处理"
,
"新的样品接收退回任务!"
,
account
,
null
);
return
true
;
}
private
List
<
EntrustSampleDTO
>
listSampleDTOByType
(
Long
entrustId
,
int
type
)
{
List
<
EntrustSampleDTO
>
sampleDTOList
=
baseMapper
.
listByContractId
(
entrustId
);
return
sampleDTOList
.
stream
().
filter
(
t
->
(
null
==
t
.
getType
()
?
0
:
t
.
getType
().
intValue
())
==
type
).
collect
(
Collectors
.
toList
());
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/LmsOriginalRecordInfoServiceImpl.java
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.mapper.Condition
;
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.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.controller.LoginHelper
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSample
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustStatusEnum
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleItemIndex
;
import
com.patzn.cloud.service.hmhj.entity.OriginalTemplate
;
import
com.patzn.cloud.service.hmhj.entity.OriginalTemplateConfig
;
import
com.patzn.cloud.service.hmhj.vo.CollectionVO
;
import
com.patzn.cloud.service.hmhj.vo.OriginalRecordInfoVO
;
import
com.patzn.cloud.service.lims.collection.entity.LmsOriginalRecordInfo
;
import
com.patzn.cloud.service.lims.collection.entity.OriginalAtlas
;
import
com.patzn.cloud.service.lims.hmhj.mapper.LmsOriginalRecordInfoMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleItemService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleItemIndexService
;
import
com.patzn.cloud.service.lims.hmhj.service.ILmsOriginalRecordInfoService
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.lims.hmhj.service.IOriginalTemplateConfigService
;
import
com.patzn.cloud.service.lims.hmhj.service.IOriginalTemplateService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* 原始记录解析后的数据存储表 服务实现类
...
...
@@ -35,13 +37,13 @@ import java.util.stream.Collectors;
public
class
LmsOriginalRecordInfoServiceImpl
extends
BaseServiceImpl
<
LmsOriginalRecordInfoMapper
,
LmsOriginalRecordInfo
>
implements
ILmsOriginalRecordInfoService
{
@Autowired
private
I
EntrustService
entrust
Service
;
private
I
OriginalTemplateService
originalTemplate
Service
;
@Autowired
private
I
EntrustSampleService
entrustSample
Service
;
private
I
OriginalTemplateConfigService
originalTemplateConfig
Service
;
@Autowired
private
IEntrustSampleItem
Service
entrustSampleItem
Service
;
private
IEntrustSampleItem
IndexService
entrustSampleItemIndex
Service
;
@Override
public
Page
<
LmsOriginalRecordInfo
>
page
(
Page
<
LmsOriginalRecordInfo
>
page
,
LmsOriginalRecordInfo
lmsOriginalRecordInfo
)
{
...
...
@@ -54,36 +56,72 @@ public class LmsOriginalRecordInfoServiceImpl extends BaseServiceImpl<LmsOrigina
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
/**
* 生成从委托到原始记录相关数据
*
* @return
*/
@Override
public
boolean
generateOriginalRelData
()
{
Account
account
=
LoginHelper
.
getAccount
();
// 查询未生成的委托数据
List
<
LmsOriginalRecordInfo
>
entrustList
=
baseMapper
.
selectUnGeneratedEntrustData
();
if
(
CollectionUtils
.
isNotEmpty
(
entrustList
))
{
List
<
Entrust
>
entrusts
=
entrustList
.
stream
().
map
(
t
->
{
return
new
Entrust
().
setStatus
(
EntrustStatusEnum
.
TEST
).
setProgress
(
EntrustStatusEnum
.
TEST
)
.
setCode
(
t
.
getContractCode
()).
setCompanyId
(
account
.
getCompanyId
()).
setUid
(
account
.
getUserId
());
}).
collect
(
Collectors
.
toList
());
entrustService
.
saveBatch
(
entrusts
);
public
boolean
analysisOriginalData
(
Long
templateId
,
Long
[]
itemIds
,
Account
account
)
{
RestAssert
.
fail
(
null
==
templateId
,
"原始记录模板编号为空"
);
RestAssert
.
fail
(
null
==
itemIds
||
0
==
itemIds
.
length
,
"检测项目为空"
);
OriginalTemplate
template
=
originalTemplateService
.
getById
(
templateId
);
RestAssert
.
fail
(
null
==
template
,
"原始记录模板为空"
);
// String tempName = template.getName();
// 需要采集的指标项
List
<
OriginalTemplateConfig
>
configList
=
originalTemplateConfigService
.
list
(
Condition
.
create
()
.
eq
(
"template_id"
,
template
).
eq
(
"itemed"
,
1
).
eq
(
"deleted"
,
0
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
configList
),
"原始记录模板指标未配置"
);
// 根据检测项目ID查询采集数据
List
<
OriginalRecordInfoVO
>
originalRecordInfoList
=
baseMapper
.
selectByItem
(
itemIds
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
originalRecordInfoList
),
"所选检测项目对应的采集数据不存在"
);
List
<
EntrustSampleItemIndex
>
itemIndexList
=
new
ArrayList
<>();
// 具体逻辑需要额外处理
//
for
(
OriginalRecordInfoVO
vo
:
originalRecordInfoList
)
{
// OriginalAtlas data = JSONObject.parseObject(vo.getData(),OriginalAtlas.class);
CollectionVO
data
=
JSONObject
.
parseObject
(
vo
.
getData
(),
CollectionVO
.
class
);
for
(
OriginalTemplateConfig
config
:
configList
)
{
EntrustSampleItemIndex
itemIndex
=
new
EntrustSampleItemIndex
();
itemIndex
.
setStatus
(
0
);
itemIndex
.
setProgress
(
0
);
itemIndex
.
setUid
(
account
.
getUserId
());
itemIndex
.
setName
(
config
.
getAttributeName
());
itemIndex
.
setCompanyId
(
account
.
getCompanyId
());
itemIndex
.
setEntrustSampleItemId
(
vo
.
getItemId
());
String
attrName
=
config
.
getAttributeName
();
// 取值待定
if
(
attrName
.
contains
(
"一次浓度"
))
{
itemIndex
.
setTestValue
(
data
.
getOneContent
());
}
else
if
(
attrName
.
contains
(
"二次浓度"
))
{
itemIndex
.
setTestValue
(
data
.
getTwoContent
());
}
else
if
(
attrName
.
contains
(
"三次浓度"
))
{
itemIndex
.
setTestValue
(
data
.
getThreeContent
());
}
else
if
(
attrName
.
contains
(
"四次浓度"
))
{
itemIndex
.
setTestValue
(
data
.
getFourContent
());
}
else
if
(
attrName
.
contains
(
"浓度"
)
||
attrName
.
contains
(
"初晶温度"
))
{
itemIndex
.
setTestValue
(
data
.
getContent
());
}
else
if
(
attrName
.
contains
(
"校准后荧光强度"
))
{
itemIndex
.
setTestValue
(
data
.
getCorrectedContent
());
}
else
if
(
attrName
.
contains
(
"荧光强度"
))
{
itemIndex
.
setTestValue
(
data
.
getAbs
());
}
else
if
(
attrName
.
contains
(
"分析日期"
))
{
itemIndex
.
setTestValue
(
data
.
getDateTime
());
}
else
if
(
attrName
.
contains
(
"耐压/抗折强度"
))
{
itemIndex
.
setTestValue
(
data
.
getStrength
());
}
else
if
(
attrName
.
contains
(
"最大载荷"
))
{
itemIndex
.
setTestValue
(
data
.
getMaxLoad
());
}
else
if
(
attrName
.
contains
(
"面积"
))
{
itemIndex
.
setTestValue
(
data
.
getArea
());
}
itemIndexList
.
add
(
itemIndex
);
}
}
// 查询未生成的样品数据
List
<
LmsOriginalRecordInfo
>
sampleList
=
baseMapper
.
selectUnGeneratedSampleData
();
if
(
CollectionUtils
.
isNotEmpty
(
sampleList
))
{
List
<
EntrustSample
>
samples
=
sampleList
.
stream
().
map
(
t
->
{
return
new
EntrustSample
().
setStatus
(
EntrustSampleStatusEnum
.
TEST
).
setProgress
(
EntrustSampleStatusEnum
.
TEST
)
.
setCode
(
t
.
getSampleNum
()).
setCompanyId
(
account
.
getCompanyId
()).
setUid
(
account
.
getUserId
());
}).
collect
(
Collectors
.
toList
());
List
<
Entrust
>
entrusts
=
entrustService
.
list
(
Condition
.
create
().
setSqlSelect
(
new
String
[]{
"id"
,
"code"
})
.
eq
(
"status"
,
EntrustStatusEnum
.
TEST
.
getValue
())
.
eq
(
"deleted"
,
0
));
entrustSampleService
.
saveBatch
(
samples
);
if
(
CollectionUtils
.
isNotEmpty
(
itemIndexList
))
{
entrustSampleItemIndexService
.
saveBatch
(
itemIndexList
);
}
return
false
;
return
true
;
}
}
src/main/java/com/patzn/cloud/service/lims/schedule/LmsOriginalRecordInfoSchedule.java
deleted
100644 → 0
View file @
e63219cf
package
com
.
patzn
.
cloud
.
service
.
lims
.
schedule
;
import
com.patzn.cloud.service.lims.hmhj.service.ILmsOriginalRecordInfoService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
@Component
public
class
LmsOriginalRecordInfoSchedule
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
LmsOriginalRecordInfoSchedule
.
class
);
@Autowired
private
ILmsOriginalRecordInfoService
lmsOriginalRecordInfoService
;
/**
* 每隔5分钟,执行生成委托->样品->检测项目->原始记录数据
*/
@Scheduled
(
cron
=
"0 */50 * * * ?"
)
public
void
execute
(){
logger
.
info
(
"------每隔5分钟,执行生成委托->样品->检测项目->原始记录数据------"
);
// lmsOriginalRecordInfoService.generateOriginalRelData();
}
}
src/main/resources/mapper/hmhj/EntrustMapper.xml
View file @
372cd089
...
...
@@ -87,6 +87,9 @@
<if
test=
"null!=vo.testSide"
>
AND e.test_side LIKE CONCAT('%',#{vo.testSide},'%')
</if>
<if
test=
"null!=vo.testerId"
>
AND i.tester_id = #{vo.testerId}
</if>
order by e.entrust_time desc,e.code desc
</select>
...
...
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
372cd089
...
...
@@ -28,6 +28,11 @@
#{sampleId}
</foreach>
</if>
<if
test=
"null != vo.testerId"
>
AND tester_id = #{vo.testerId}
</if>
GROUP BY name ORDER BY name
</select>
...
...
@@ -81,6 +86,9 @@
</foreach>
</if>
<if
test=
"null!=vo.testerId"
>
AND tester_id = #{vo.testerId}
</if>
)
SELECT i.*,s.name AS "sampleName",e.test_side "testSide",s.code AS "sampleCode",l.record_id,r.object_key AS "recordObjectKey" FROM i
...
...
@@ -142,6 +150,10 @@
#{sampleId}
</foreach>
</if>
<if
test=
"null != vo.testerId"
>
AND tester_id = #{vo.testerId}
</if>
)
SELECT i.*,s.name AS "sampleName",s.code AS "sampleCode",e.test_side "testSide",l.record_id,r.object_key AS "recordObjectKey"
...
...
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
View file @
372cd089
...
...
@@ -58,6 +58,7 @@
#{sampleId}
</foreach>
</if>
order by order_by asc,ctime desc
</select>
...
...
src/main/resources/mapper/hmhj/EntrustSampleRecordMapper.xml
0 → 100644
View file @
372cd089
<?xml version="1.0" encoding="UTF-8"?>
<!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.EntrustSampleRecordMapper"
>
</mapper>
src/main/resources/mapper/hmhj/LmsOriginalRecordInfoMapper.xml
View file @
372cd089
...
...
@@ -2,30 +2,27 @@
<!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.LmsOriginalRecordInfoMapper"
>
<!--获取未生成的委托数据-->
<select
id=
"selectUnGeneratedEntrustData"
resultType=
"com.patzn.cloud.service.lims.collection.entity.LmsOriginalRecordInfo"
>
select o.file_id,o.contract_code from lms_original_record_info o
<select
id=
"selectByItem"
resultType=
"com.patzn.cloud.service.hmhj.vo.OriginalRecordInfoVO"
>
with item as (
select
i.id "item_id",i.name "item_name",s.id "sample_id",s.code "sample_code",
e.id "entrust_id" ,e.code "entrust_code",i.company_id
from entrust_sample_item i,entrust_sample s,entrust e
where i.deleted = 0 and s.deleted = 0 and e.deleted = 0
and i.entrust_sample_id = s.id and s.entrust_id = e.id
AND i.id IN
<foreach
collection=
"itemIds"
index=
"index"
item=
"itemId"
open=
"("
separator=
","
close=
")"
>
#{itemId}
</foreach>
)
select
o.*,i.item_id,i.sample_id,i.entrust_id
from lms_original_record_info o, item i
where o.deleted = 0
and o.contract_code is not null
and not exists (select 1 from entrust e where e.deleted = 0 and e.code = o.contract_code)
group by o.file_id, o.contract_code order by o.file_id
</select>
<select
id=
"selectUnGeneratedSampleData"
resultType=
"com.patzn.cloud.service.lims.collection.entity.LmsOriginalRecordInfo"
>
select o.file_id,o.contract_code,o.sample_num from lms_original_record_info o
where o.deleted = 0
and o.contract_code is not null
and o.sample_num is not null
and not exists (
select 1 from entrust e,entrust_sample s
where
e.deleted = 0
and e.code = o.contract_code
and s.entrust_id = e.id
and s.code = o.sample_num
)
group by o.file_id, o.contract_code, o.sample_num order by o.file_id
and o.item_name = i.item_name
and o.contract_code = i.entrust_code
and o.sample_num = i.sample_code
and o.data is not null
</select>
</mapper>
src/main/resources/mapper/hmhj/OriginalRecordMapper.xml
View file @
372cd089
...
...
@@ -16,6 +16,13 @@
<if
test=
"null != vo.entrustCode"
>
AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%')
</if>
<if
test=
"null != vo.testerId"
>
AND exists (
select 1 from entrust_sample_item i,item_rel_original_record rr
where i.deleted = 0 and rr.deleted = 0 and rr.item_id = i.id
and r.id = rr.record_id and i.tester_id = #{vo.testerId}
)
</if>
order by r.id desc
</select>
...
...
src/test/java/com/patzn/cloud/service/lims/test/JsonObjectTest.java
0 → 100644
View file @
372cd089
package
com
.
patzn
.
cloud
.
service
.
lims
.
test
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.patzn.cloud.service.hmhj.vo.CollectionVO
;
public
class
JsonObjectTest
{
public
static
void
main
(
String
[]
args
)
{
String
str
=
"{\"abs\":\"-0.000\",\"content\":\"-0.0007\",\"curveData\":[{\"content\":\"0.0000\",\"abs\":\"0.001\"},{\"content\":\"0.0030\",\"abs\":\"0.012\"},{\"content\":\"0.0060\",\"abs\":\"0.022\"},{\"content\":\"0.0100\",\"abs\":\"0.034\"},{\"content\":\"0.0150\",\"abs\":\"0.049\"}]}"
;
CollectionVO
collectionVO
=
JSONObject
.
parseObject
(
str
,
CollectionVO
.
class
);
System
.
out
.
println
(
collectionVO
);
}
}
src/test/java/resources/db_sql/hmhj/v145/20210708添加记录表和字段.sql
0 → 100644
View file @
372cd089
CREATE
TABLE
"public"
.
"entrust_sample_record"
(
CREATE
TABLE
"public"
.
"entrust_sample_record"
(
"id"
int8
NOT
NULL
,
"sample_id"
int8
,
"remark"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
DEFAULT
NULL
::
character
varying
,
"ctime"
timestamp
(
0
)
DEFAULT
NULL
::
timestamp
without
time
zone
,
"uid"
int8
,
"lid"
int8
,
"ltime"
timestamp
(
0
)
DEFAULT
NULL
::
timestamp
without
time
zone
,
"deleted"
int2
DEFAULT
0
,
"company_id"
int8
,
"type"
int2
DEFAULT
0
,
"origin"
varchar
(
50
)
COLLATE
"pg_catalog"
.
"default"
DEFAULT
NULL
::
character
varying
,
"target"
varchar
(
50
)
COLLATE
"pg_catalog"
.
"default"
DEFAULT
NULL
::
character
varying
,
"operator"
varchar
(
50
)
COLLATE
"pg_catalog"
.
"default"
DEFAULT
NULL
::
character
varying
,
"operator_id"
int8
)
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"id"
IS
'主键'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"sample_id"
IS
'样品ID'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"remark"
IS
'操作原因'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"ctime"
IS
'创建时间'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"uid"
IS
'创建人ID'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"lid"
IS
'最后修改人ID'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"ltime"
IS
'最后修改时间'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"deleted"
IS
'是否删除0否1是'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"company_id"
IS
'企业ID'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"type"
IS
'类型 0流转 1回退 2更新'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"origin"
IS
'操作阶段'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"target"
IS
'目标阶段'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"operator"
IS
'操作人'
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_record"
.
"operator_id"
IS
'操作人ID'
;
COMMENT
ON
TABLE
"public"
.
"entrust_sample_record"
IS
'样品操作日志表'
;
-- ----------------------------
-- Primary Key structure for table entrust_sample_record
-- ----------------------------
ALTER
TABLE
"public"
.
"entrust_sample_record"
ADD
CONSTRAINT
"entrust_sample_record_pkey"
PRIMARY
KEY
(
"id"
);
-- 新增委托字段 --
ALTER
TABLE
"public"
.
"entrust"
ADD
COLUMN
"expect_send_time"
timestamp
(
6
),
ADD
COLUMN
"live_witness"
int2
,
ADD
COLUMN
"sample_size"
varchar
(
64
)
COLLATE
"pg_catalog"
.
"default"
,
ADD
COLUMN
"priority"
varchar
(
32
)
COLLATE
"pg_catalog"
.
"default"
,
ADD
COLUMN
"test_fee"
numeric
(
10
,
2
)
default
0
.
00
,
ADD
COLUMN
"test_time_s"
timestamp
(
6
),
ADD
COLUMN
"test_time_e"
timestamp
(
6
);
COMMENT
ON
COLUMN
"public"
.
"entrust"
.
"expect_send_time"
IS
'客户期望报告发出日期'
;
COMMENT
ON
COLUMN
"public"
.
"entrust"
.
"live_witness"
IS
'现场见证【0:否,1:是】'
;
COMMENT
ON
COLUMN
"public"
.
"entrust"
.
"sample_size"
IS
'样品尺寸'
;
COMMENT
ON
COLUMN
"public"
.
"entrust"
.
"priority"
IS
'优先级'
;
COMMENT
ON
COLUMN
"public"
.
"entrust"
.
"test_fee"
IS
'检测费用'
;
COMMENT
ON
COLUMN
"public"
.
"entrust"
.
"test_time_s"
IS
'检测开始日期'
;
COMMENT
ON
COLUMN
"public"
.
"entrust"
.
"test_time_e"
IS
'检测结束日期'
;
-- 新增样品字段 --
ALTER
TABLE
"public"
.
"entrust_sample"
ADD
COLUMN
"compliance_test"
int2
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample"
.
"compliance_test"
IS
'符合性检测【0:否,1:是】'
;
-- 新增样品检测项目字段 --
ALTER
TABLE
"public"
.
"entrust_sample_item"
ADD
COLUMN
"univalent"
numeric
(
10
,
2
)
default
0
.
00
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample_item"
.
"univalent"
IS
'单价'
;
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