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
57ad5dd4
Commit
57ad5dd4
authored
Apr 19, 2023
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对碳素原料原辅料、铝侧原料原辅料编码处理;
parent
4de59f48
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
417 additions
and
53 deletions
+417
-53
QualityInspectionCodeController.java
...lims/hmhj/controller/QualityInspectionCodeController.java
+76
-0
EntrustSampleMapper.java
...n/cloud/service/lims/hmhj/mapper/EntrustSampleMapper.java
+1
-1
QualityInspectionCodeMapper.java
...service/lims/hmhj/mapper/QualityInspectionCodeMapper.java
+17
-0
IEntrustSampleService.java
...loud/service/lims/hmhj/service/IEntrustSampleService.java
+9
-5
IQualityInspectionCodeService.java
...vice/lims/hmhj/service/IQualityInspectionCodeService.java
+27
-0
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+37
-4
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+101
-33
MaterialServiceImpl.java
...d/service/lims/hmhj/service/impl/MaterialServiceImpl.java
+5
-1
QualityInspectionCodeServiceImpl.java
...s/hmhj/service/impl/QualityInspectionCodeServiceImpl.java
+119
-0
UserInfoServiceImpl.java
...d/service/lims/hmhj/service/impl/UserInfoServiceImpl.java
+20
-7
EntrustSampleMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
+1
-1
QualityInspectionCodeMapper.xml
...ain/resources/mapper/hmhj/QualityInspectionCodeMapper.xml
+4
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/QualityInspectionCodeController.java
0 → 100644
View file @
57ad5dd4
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.QualityInspectionCode
;
import
com.patzn.cloud.service.lims.hmhj.service.IQualityInspectionCodeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.util.List
;
/**
* 用户质检编码基础数据 前端控制器
*
* @author meazty
* @since 2021-06-20
*/
@Api
(
tags
=
"用户质检编码基础数据"
)
@RestController
@RequestMapping
(
"/v1/quality_inspection_code"
)
public
class
QualityInspectionCodeController
extends
ServiceController
{
@Resource
private
IQualityInspectionCodeService
qualityInspectionCodeService
;
@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
<
QualityInspectionCode
>>
getPage
(
QualityInspectionCode
qualityInspectionCode
)
{
return
success
(
qualityInspectionCodeService
.
page
(
getPage
(),
qualityInspectionCode
));
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@GetMapping
(
"/{id}"
)
public
RestResult
<
QualityInspectionCode
>
get
(
@PathVariable
(
"id"
)
Long
id
)
{
return
success
(
qualityInspectionCodeService
.
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
,
QualityInspectionCode
qualityInspectionCode
)
{
qualityInspectionCode
.
setId
(
id
);
return
success
(
qualityInspectionCodeService
.
updateById
(
qualityInspectionCode
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
QualityInspectionCode
qualityInspectionCode
)
{
qualityInspectionCode
.
setCreator
(
getAccount
().
getUserName
());
return
success
(
qualityInspectionCodeService
.
save
(
qualityInspectionCode
));
}
@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
(
qualityInspectionCodeService
.
removeByIds
(
ids
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleMapper.java
View file @
57ad5dd4
...
@@ -47,7 +47,7 @@ public interface EntrustSampleMapper extends BatchMapper<EntrustSample> {
...
@@ -47,7 +47,7 @@ public interface EntrustSampleMapper extends BatchMapper<EntrustSample> {
@SqlParser
(
filter
=
true
)
@SqlParser
(
filter
=
true
)
List
<
ReportSampleVO
>
selectReportSampleInfos
(
@Param
(
"sampleIds"
)
Long
[]
sampleIds
);
List
<
ReportSampleVO
>
selectReportSampleInfos
(
@Param
(
"sampleIds"
)
Long
[]
sampleIds
);
String
selectLastCode
(
@Param
(
"queryKey"
)
String
queryKey
);
String
selectLastCode
(
@Param
(
"
column"
)
String
column
,
@Param
(
"
queryKey"
)
String
queryKey
);
List
<
EntrustSampleIndexVO
>
selectSampleIndex
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
EntrustSampleIndexVO
sampleIndexVO
);
List
<
EntrustSampleIndexVO
>
selectSampleIndex
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
EntrustSampleIndexVO
sampleIndexVO
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/QualityInspectionCodeMapper.java
0 → 100644
View file @
57ad5dd4
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.entity.QualityInspectionCode
;
/**
* <p>
* 用质检编码基础数据 Mapper 接口
* </p>
*
* @author meazty
* @since 2023-04-19
*/
public
interface
QualityInspectionCodeMapper
extends
BatchMapper
<
QualityInspectionCode
>
{
public
Integer
selectMaxCode
();
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleService.java
View file @
57ad5dd4
...
@@ -28,11 +28,11 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
...
@@ -28,11 +28,11 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
Page
<
EntrustSample
>
page
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
);
Page
<
EntrustSample
>
page
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
);
Page
<
EntrustSample
>
pageOfReportCheck
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
,
Account
account
);
Page
<
EntrustSample
>
pageOfReportCheck
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
,
Account
account
);
Page
<
EntrustSample
>
pageOfReportIssue
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
,
Account
account
);
Page
<
EntrustSample
>
pageOfReportIssue
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
,
Account
account
);
Page
<
EntrustSample
>
pageOfReportSend
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
,
Account
account
);
Page
<
EntrustSample
>
pageOfReportSend
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
,
Account
account
);
Page
<
EntrustSample
>
pageOfQualityJudge
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
,
Account
account
);
Page
<
EntrustSample
>
pageOfQualityJudge
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
,
Account
account
);
...
@@ -62,11 +62,11 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
...
@@ -62,11 +62,11 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
Page
<
EntrustSampleVO
>
pageBySampleLeftHis
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
sampleVO
);
Page
<
EntrustSampleVO
>
pageBySampleLeftHis
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
sampleVO
);
Page
<
EntrustSampleVO
>
pageVO
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
,
Account
account
);
Page
<
EntrustSampleVO
>
pageVO
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
,
Account
account
);
Page
<
EntrustSampleVO
>
pageOfEntrust
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
,
Account
account
);
Page
<
EntrustSampleVO
>
pageOfEntrust
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
,
Account
account
);
Page
<
EntrustSampleVO
>
pageVOForMake
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
,
Account
account
);
Page
<
EntrustSampleVO
>
pageVOForMake
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
,
Account
account
);
boolean
submitToAcceptanceResultInput
(
Long
[]
ids
,
Account
account
);
boolean
submitToAcceptanceResultInput
(
Long
[]
ids
,
Account
account
);
...
@@ -136,8 +136,12 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
...
@@ -136,8 +136,12 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
String
getNewCode
(
String
queryKey
,
int
lens
);
String
getNewCode
(
String
queryKey
,
int
lens
);
String
getNewCode
(
String
queryKey
,
String
column
,
int
lens
);
String
getNewCode
(
String
queryKey
,
int
start
,
int
lens
);
String
getNewCode
(
String
queryKey
,
int
start
,
int
lens
);
String
getNewCode
(
String
queryKey
,
String
column
,
int
start
,
int
lens
);
EntrustSample
getByContractId
(
Long
contractId
);
EntrustSample
getByContractId
(
Long
contractId
);
boolean
updateAllColumnBatch
(
List
<
EntrustSample
>
sampleList
);
boolean
updateAllColumnBatch
(
List
<
EntrustSample
>
sampleList
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IQualityInspectionCodeService.java
0 → 100644
View file @
57ad5dd4
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.QualityInspectionCode
;
import
java.util.List
;
/**
* 用户质检编码基础数据 服务类
*
* @author meazty
* @since 2021-06-20
*/
public
interface
IQualityInspectionCodeService
extends
IBaseService
<
QualityInspectionCode
>
{
Page
<
QualityInspectionCode
>
page
(
Page
<
QualityInspectionCode
>
page
,
QualityInspectionCode
qualityInspectionCode
);
boolean
removeByIds
(
List
<
Long
>
ids
);
QualityInspectionCode
getOne
(
QualityInspectionCode
inspectionCode
);
String
getCode
(
Account
account
);
String
getCodeAbsentCreate
(
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
57ad5dd4
...
@@ -44,6 +44,7 @@ import org.apache.poi.xwpf.usermodel.XWPFDocument;
...
@@ -44,6 +44,7 @@ import org.apache.poi.xwpf.usermodel.XWPFDocument;
import
org.apache.poi.xwpf.usermodel.XWPFTable
;
import
org.apache.poi.xwpf.usermodel.XWPFTable
;
import
org.apache.poi.xwpf.usermodel.XWPFTableCell
;
import
org.apache.poi.xwpf.usermodel.XWPFTableCell
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.STMerge
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -106,6 +107,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -106,6 +107,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Resource
@Resource
private
IUserInfoService
userInfoService
;
private
IUserInfoService
userInfoService
;
@Resource
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
@Override
@Override
public
Page
<
EntrustSample
>
page
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
)
{
public
Page
<
EntrustSample
>
page
(
Page
<
EntrustSample
>
page
,
EntrustSample
entrustSample
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustSample
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustSample
);
...
@@ -1997,18 +2001,40 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -1997,18 +2001,40 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Override
@Override
public
String
getNewCode
(
String
queryKey
,
int
lens
)
{
public
String
getNewCode
(
String
queryKey
,
int
lens
)
{
return
getNewCode
(
queryKey
,
null
,
lens
);
}
@Override
public
String
getNewCode
(
String
queryKey
,
String
column
,
int
lens
)
{
column
=
StringUtils
.
isBlank
(
column
)
?
"code"
:
column
;
String
key
=
String
.
format
(
"%s_%s_%s"
,
column
,
queryKey
,
lens
).
toUpperCase
();
String
code
=
redisTemplate
.
opsForValue
().
get
(
key
);
String
startKey
=
"000000000000000000"
,
defKey
=
queryKey
+
startKey
.
substring
(
0
,
lens
-
1
)
+
1
;
String
startKey
=
"000000000000000000"
,
defKey
=
queryKey
+
startKey
.
substring
(
0
,
lens
-
1
)
+
1
;
if
(
StringUtils
.
isNotBlank
(
code
))
{
String
sampleSN
=
code
.
substring
(
code
.
length
()
-
lens
);
return
getNewCodeStr
(
key
,
queryKey
,
lens
,
startKey
,
code
);
}
if
(
StringUtils
.
isBlank
(
queryKey
))
{
if
(
StringUtils
.
isBlank
(
queryKey
))
{
redisTemplate
.
opsForValue
().
set
(
key
,
defKey
);
return
defKey
;
return
defKey
;
}
}
String
lastCode
=
baseMapper
.
selectLastCode
(
queryKey
);
String
lastCode
=
baseMapper
.
selectLastCode
(
column
,
queryKey
);
if
(
StringUtils
.
isBlank
(
lastCode
))
{
if
(
StringUtils
.
isBlank
(
lastCode
))
{
redisTemplate
.
opsForValue
().
set
(
key
,
defKey
);
return
defKey
;
return
defKey
;
}
}
String
sampleSN
=
lastCode
.
substring
(
lastCode
.
length
()
-
lens
);
return
getNewCodeStr
(
key
,
queryKey
,
lens
,
startKey
,
lastCode
);
}
private
String
getNewCodeStr
(
String
redisKey
,
String
queryKey
,
int
lens
,
String
startKey
,
String
lastCode
)
{
try
{
try
{
String
sampleSN
=
lastCode
.
substring
(
lastCode
.
length
()
-
lens
);
Integer
nextSN
=
Integer
.
parseInt
(
sampleSN
)
+
1
;
Integer
nextSN
=
Integer
.
parseInt
(
sampleSN
)
+
1
;
return
queryKey
+
startKey
.
substring
(
0
,
lens
-
nextSN
.
toString
().
length
())
+
nextSN
;
String
code
=
queryKey
+
startKey
.
substring
(
0
,
lens
-
nextSN
.
toString
().
length
())
+
nextSN
;
redisTemplate
.
opsForValue
().
set
(
redisKey
,
code
);
return
code
;
}
catch
(
NumberFormatException
e
)
{
}
catch
(
NumberFormatException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
.
getCause
());
logger
.
error
(
e
.
getMessage
(),
e
.
getCause
());
throw
new
PatznException
(
"样品编码流水号获取异常"
);
throw
new
PatznException
(
"样品编码流水号获取异常"
);
...
@@ -2017,6 +2043,11 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -2017,6 +2043,11 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Override
@Override
public
String
getNewCode
(
String
queryKey
,
int
start
,
int
lens
)
{
public
String
getNewCode
(
String
queryKey
,
int
start
,
int
lens
)
{
return
getNewCode
(
queryKey
,
null
,
start
,
lens
);
}
@Override
public
String
getNewCode
(
String
queryKey
,
String
column
,
int
start
,
int
lens
)
{
String
startKey
=
"000000000000000000"
;
String
startKey
=
"000000000000000000"
;
// 长度默认1
// 长度默认1
lens
=
lens
==
0
?
1
:
lens
;
lens
=
lens
==
0
?
1
:
lens
;
...
@@ -2031,7 +2062,8 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -2031,7 +2062,8 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
if
(
StringUtils
.
isBlank
(
queryKey
))
{
if
(
StringUtils
.
isBlank
(
queryKey
))
{
return
defKey
;
return
defKey
;
}
}
String
lastCode
=
baseMapper
.
selectLastCode
(
queryKey
);
column
=
StringUtils
.
isBlank
(
column
)
?
"code"
:
column
;
String
lastCode
=
baseMapper
.
selectLastCode
(
column
,
queryKey
);
if
(
StringUtils
.
isBlank
(
lastCode
))
{
if
(
StringUtils
.
isBlank
(
lastCode
))
{
return
defKey
;
return
defKey
;
}
}
...
@@ -2297,6 +2329,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -2297,6 +2329,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
if
(
StringUtils
.
isBlank
(
sample
.
getCode
()))
{
if
(
StringUtils
.
isBlank
(
sample
.
getCode
()))
{
return
false
;
return
false
;
}
}
sample
.
setCode
(
sample
.
getCode
().
trim
());
return
baseMapper
.
isRepeatSampleCode
(
sample
)
>
0
;
return
baseMapper
.
isRepeatSampleCode
(
sample
)
>
0
;
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
57ad5dd4
...
@@ -35,6 +35,7 @@ import com.patzn.poibox.xwpf.XWPFTemplate;
...
@@ -35,6 +35,7 @@ import com.patzn.poibox.xwpf.XWPFTemplate;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -45,6 +46,7 @@ import java.math.BigDecimal;
...
@@ -45,6 +46,7 @@ import java.math.BigDecimal;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -98,6 +100,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -98,6 +100,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Resource
@Resource
private
IEntrustReportRelSampleService
entrustReportRelSampleService
;
private
IEntrustReportRelSampleService
entrustReportRelSampleService
;
@Resource
private
IQualityInspectionCodeService
qualityInspectionCodeService
;
@Resource
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
@Override
@Override
public
Page
<
Entrust
>
page
(
Page
<
Entrust
>
page
,
Entrust
entrust
)
{
public
Page
<
Entrust
>
page
(
Page
<
Entrust
>
page
,
Entrust
entrust
)
{
...
@@ -194,24 +202,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -194,24 +202,14 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
sample
.
setFirstCode
(
StringHandleUtils
.
toUpper
(
firstCode
));
sample
.
setFirstCode
(
StringHandleUtils
.
toUpper
(
firstCode
));
}
}
if
(
StringUtils
.
isNotBlank
(
secondCode
))
{
if
(
StringUtils
.
isNotBlank
(
secondCode
))
{
sample
.
set
First
Code
(
StringHandleUtils
.
toUpper
(
secondCode
));
sample
.
set
Second
Code
(
StringHandleUtils
.
toUpper
(
secondCode
));
}
}
if
(
StringUtils
.
isNotBlank
(
thirdCode
))
{
if
(
StringUtils
.
isNotBlank
(
thirdCode
))
{
sample
.
set
First
Code
(
StringHandleUtils
.
toUpper
(
thirdCode
));
sample
.
set
Third
Code
(
StringHandleUtils
.
toUpper
(
thirdCode
));
}
}
}
}
/**
public
void
initSampleCode
(
Entrust
entrust
,
EntrustSample
sample
,
Map
<
String
,
LmsChemicalCategory
>
categoryMap
,
Map
<
String
,
String
>
params
)
{
* 处理槽号空格
*
* @param sample
*/
private
void
sampleSlotNoHandler
(
EntrustSample
sample
)
{
String
slotNo
=
null
==
sample
.
getSlotNo
()
?
""
:
sample
.
getSlotNo
();
sample
.
setSlotNo
(
slotNo
.
trim
());
}
public
void
initSampleCode
(
Entrust
entrust
,
EntrustSample
sample
,
Map
<
String
,
LmsChemicalCategory
>
categoryMap
)
{
// 如果合同编号不为空,样品编号不为空,一级编号不为空,则不进行编号生成
// 如果合同编号不为空,样品编号不为空,一级编号不为空,则不进行编号生成
if
(
null
!=
sample
.
getContractSampleId
()
&&
StringUtils
.
isNotBlank
(
sample
.
getCode
())
&&
StringUtils
.
isNotBlank
(
sample
.
getFirstCode
()))
{
if
(
null
!=
sample
.
getContractSampleId
()
&&
StringUtils
.
isNotBlank
(
sample
.
getCode
())
&&
StringUtils
.
isNotBlank
(
sample
.
getFirstCode
()))
{
return
;
return
;
...
@@ -233,9 +231,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -233,9 +231,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
Account
account
=
LoginHelper
.
getAccount
();
Account
account
=
LoginHelper
.
getAccount
();
int
codeTypeNo
=
0
;
int
codeTypeNo
=
0
;
List
<
SysOrg
>
orgList
=
sysOrgClient
.
getListByUserId
(
account
.
getUserId
()).
getData
();
// 具体是哪一期
// 具体是哪一期
String
phase
=
orgList
.
stream
().
anyMatch
(
t
->
t
.
getName
().
contains
(
"二期"
)
)
?
"Z"
:
"F"
;
String
phase
=
StringHandleUtils
.
nvlBlank
(
params
.
get
(
"period"
)).
contains
(
"二期"
)
?
"Z"
:
"F"
;
// 默认样品初始编号
// 默认样品初始编号
CodeTypeEnum
codeType
=
null
;
CodeTypeEnum
codeType
=
null
;
switch
(
parentCategory
)
{
switch
(
parentCategory
)
{
...
@@ -321,6 +318,27 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -321,6 +318,27 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
}
}
if
(
Objects
.
equals
(
category
,
"碳素侧原料原辅料"
)
||
Objects
.
equals
(
category
,
"铝侧原料原辅料"
))
{
logger
.
info
(
"✦✦✦✦ EntrustServiceImpl ✦✦✦✦ initSampleCode ✦✦✦✈ [category]: {}"
,
category
);
String
abbr
=
params
.
get
(
"abbr"
);
String
inspectionCode
=
qualityInspectionCodeService
.
getCodeAbsentCreate
(
account
);
String
queryKey
=
abbr
+
DateUtils
.
dateTransfer
(
new
Date
(),
"yyMMdd"
)
+
inspectionCode
;
logger
.
info
(
"✦✦✦✦ EntrustServiceImpl ✦✦✦✦ initSampleCode ✦✦✦✈ [abbr, inspectionCode, queryKey]: {},{},{}"
,
abbr
,
inspectionCode
,
queryKey
);
sampleCode
=
entrustSampleService
.
getNewCode
(
queryKey
,
"first_code"
,
3
);
logger
.
info
(
"✦✦✦✦ EntrustServiceImpl ✦✦✦✦ initSampleCode ✦✦✦✈ [sampleCode]: {}"
,
sampleCode
);
// 二级加密编码:abbr + 流水号 + 其他随机字符
logger
.
info
(
"✦✦✦✦ EntrustServiceImpl ✦✦✦✦ initSampleCode ✦✦✦✈ secondCode"
);
logger
.
info
(
"✦✦✦✦ EntrustServiceImpl ✦✦✦✦ initSampleCode ✦✦✦✈ [abbr]: {}"
,
abbr
);
String
sn
=
sampleCode
.
substring
(
sampleCode
.
length
()
-
3
);
logger
.
info
(
"✦✦✦✦ EntrustServiceImpl ✦✦✦✦ initSampleCode ✦✦✦✈ [sn]: {}"
,
sn
);
String
timestamp
=
(
System
.
currentTimeMillis
()
+
""
).
substring
(
2
);
logger
.
info
(
"✦✦✦✦ EntrustServiceImpl ✦✦✦✦ initSampleCode ✦✦✦✈ [timestamp]: {}"
,
timestamp
);
String
randomStr
=
RandomUtils
.
getRandomStr
(
4
);
// 保证二级加密编码不重复
secondCode
=
abbr
+
sn
+
timestamp
+
randomStr
;
logger
.
info
(
"✦✦✦✦ EntrustServiceImpl ✦✦✦✦ initSampleCode ✦✦✦✈ [secondCode]: {}"
,
secondCode
);
}
// 电解质散样样品编号处理
// 电解质散样样品编号处理
// else if (CodeTypeEnum.ELECT_BULK_SAMPLE_CODE == codeType) {
// else if (CodeTypeEnum.ELECT_BULK_SAMPLE_CODE == codeType) {
// // D+@yyMMdd&-&${et.slotNo}
// // D+@yyMMdd&-&${et.slotNo}
...
@@ -353,18 +371,25 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -353,18 +371,25 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 若为三级编号,修改对应类别
// 若为三级编号,修改对应类别
if
(
codeType
==
CodeTypeEnum
.
SAMPLE_WWJC_CODE
)
{
if
(
codeType
==
CodeTypeEnum
.
SAMPLE_WWJC_CODE
)
{
sample
.
setCodeType
(
2
);
sample
.
setCodeType
(
2
);
sample
.
setSecondCode
(
secondCode
.
toUpperCase
(
Locale
.
ROOT
));
sample
.
setSecondCode
(
secondCode
.
toUpperCase
());
}
else
if
(
codeType
==
CodeTypeEnum
.
SAMPLE_YFL_CODE
)
{
}
else
if
(
codeType
==
CodeTypeEnum
.
SAMPLE_YFL_CODE
)
{
sample
.
setCodeType
(
3
);
sample
.
setCodeType
(
3
);
sample
.
setSecondCode
(
secondCode
.
toUpperCase
(
Locale
.
ROOT
));
sample
.
setSecondCode
(
secondCode
.
toUpperCase
());
sample
.
setThirdCode
(
thirdCode
.
toUpperCase
(
Locale
.
ROOT
));
sample
.
setThirdCode
(
thirdCode
.
toUpperCase
());
}
}
}
}
}
}
private
String
getInspectNo
(
Account
account
)
{
private
String
getInspectNo
(
Account
account
)
{
String
inspectNo
=
userInspectionCodeService
.
getOne
(
new
UserInspectionCode
(
account
.
getUserId
(),
"ZJ"
)).
getNo
();
// 从缓存中取质检编号
return
Optional
.
ofNullable
(
inspectNo
).
orElse
(
""
);
String
key
=
"INSPECT_NO_"
+
account
.
getUserId
();
String
inspectNo
=
redisTemplate
.
opsForValue
().
get
(
key
);
if
(
StringUtils
.
isBlank
(
inspectNo
))
{
inspectNo
=
userInspectionCodeService
.
getOne
(
new
UserInspectionCode
(
account
.
getUserId
(),
"ZJ"
)).
getNo
();
inspectNo
=
StringHandleUtils
.
nvlBlank
(
inspectNo
);
redisTemplate
.
opsForValue
().
set
(
key
,
inspectNo
,
1
,
TimeUnit
.
HOURS
);
}
return
inspectNo
;
}
}
// 验证样品非空字段
// 验证样品非空字段
...
@@ -379,7 +404,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -379,7 +404,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
/**
/**
* 样品编号处理
* 样品编号处理
*/
*/
private
void
handleSampleCode
(
Entrust
entrust
,
EntrustSample
sample
,
Map
<
String
,
LmsChemicalCategory
>
categoryMap
)
{
private
void
handleSampleCode
(
Entrust
entrust
,
EntrustSample
sample
,
Map
<
String
,
LmsChemicalCategory
>
categoryMap
,
Map
<
String
,
String
>
params
)
{
String
String
sampleCode
=
sample
.
getCode
(),
sampleCode
=
sample
.
getCode
(),
secondCode
=
sample
.
getSecondCode
(),
secondCode
=
sample
.
getSecondCode
(),
...
@@ -401,7 +426,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -401,7 +426,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
sample
.
setThirdCode
(
thirdCode
);
sample
.
setThirdCode
(
thirdCode
);
}
else
{
}
else
{
initSampleCode
(
entrust
,
sample
,
categoryMap
);
initSampleCode
(
entrust
,
sample
,
categoryMap
,
params
);
if
(
StringUtils
.
isNotBlank
(
sampleCode
))
{
if
(
StringUtils
.
isNotBlank
(
sampleCode
))
{
sample
.
setCode
(
sampleCode
);
sample
.
setCode
(
sampleCode
);
sample
.
setFirstCode
(
sampleCode
);
sample
.
setFirstCode
(
sampleCode
);
...
@@ -446,13 +471,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -446,13 +471,13 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
List
<
EntrustSampleDTO
>
sampleDTOList
=
dto
.
getSampleDTOList
();
List
<
EntrustSampleDTO
>
sampleDTOList
=
dto
.
getSampleDTOList
();
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleDTOList
),
"委托样品为空"
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleDTOList
),
"委托样品为空"
);
final
Long
materialId
=
sampleDTOList
.
get
(
0
).
getMaterialId
();
final
Long
materialId
=
sampleDTOList
.
get
(
0
).
getMaterialId
();
Material
material
=
getMaterial
(
materialId
);
// 赋值 物资ID
// 赋值 物资ID
if
(
null
==
entrust
.
getMaterialId
()
&&
null
!=
materialId
)
{
if
(
null
==
entrust
.
getMaterialId
()
&&
Objects
.
nonNull
(
materialId
)
)
{
entrust
.
setMaterialId
(
materialId
);
entrust
.
setMaterialId
(
materialId
);
}
}
// 状态路径为空,物料ID不为空,查询样本库
// 状态路径为空,物料ID不为空,查询样本库
if
(
StringUtils
.
isBlank
(
entrust
.
getStatusPath
())
&&
Objects
.
nonNull
(
entrust
.
getMaterialId
()))
{
if
(
StringUtils
.
isBlank
(
entrust
.
getStatusPath
())
&&
Objects
.
nonNull
(
entrust
.
getMaterialId
()))
{
Material
material
=
materialService
.
getById
(
entrust
.
getMaterialId
());
entrust
.
setStatusPath
(
material
.
getEntrustStatusPath
());
entrust
.
setStatusPath
(
material
.
getEntrustStatusPath
());
}
}
...
@@ -470,11 +495,17 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -470,11 +495,17 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust
.
setId
(
IdWorker
.
getId
());
entrust
.
setId
(
IdWorker
.
getId
());
// 保存并提交委托时使用
// 保存并提交委托时使用
dto
.
setId
(
entrust
.
getId
());
dto
.
setId
(
entrust
.
getId
());
// 获取用户所属期数
String
period
=
userInfoService
.
getUserPeriod
(
account
);
// ==
// ==
List
<?>
dataList
=
verifyAndPrepareSampleData
(
sampleDTOList
,
isSubmit
);
List
<?>
dataList
=
verifyAndPrepareSampleData
(
sampleDTOList
,
isSubmit
);
String
sampleName
=
dataList
.
get
(
0
).
toString
();
String
sampleName
=
dataList
.
get
(
0
).
toString
();
entrust
.
setSampleName
(
sampleName
);
entrust
.
setSampleName
(
sampleName
);
Map
<
String
,
LmsChemicalCategory
>
categoryMap
=
(
Map
<
String
,
LmsChemicalCategory
>)
dataList
.
get
(
1
);
Map
<
String
,
LmsChemicalCategory
>
categoryMap
=
(
Map
<
String
,
LmsChemicalCategory
>)
dataList
.
get
(
1
);
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"period"
,
period
);
params
.
put
(
"abbr"
,
material
.
getAbbr
());
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
List
<
EntrustSampleItem
>
saveEntrustSampleItemList
=
new
ArrayList
<>();
List
<
EntrustSampleItem
>
saveEntrustSampleItemList
=
new
ArrayList
<>();
...
@@ -494,10 +525,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -494,10 +525,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 若为进场物资,需要考虑是否为采样样品
// 若为进场物资,需要考虑是否为采样样品
// 若为采样样品,需要赋值采样样品编号
// 若为采样样品,需要赋值采样样品编号
if
(
StringUtils
.
isBlank
(
sample
.
getCode
())
||
Objects
.
nonNull
(
sample
.
getSamplingId
()))
{
if
(
StringUtils
.
isBlank
(
sample
.
getCode
())
||
Objects
.
nonNull
(
sample
.
getSamplingId
()))
{
handleSampleCode
(
entrust
,
sample
,
categoryMap
);
handleSampleCode
(
entrust
,
sample
,
categoryMap
,
params
);
}
}
if
(
StringUtils
.
isNotBlank
(
sample
.
getCode
()))
{
if
(
StringUtils
.
isNotBlank
(
sample
.
getCode
()))
{
sample
.
setCode
(
sample
.
getCode
().
trim
().
toUpperCase
());
retakeSourceCodeHandle
(
sample
);
retakeSourceCodeHandle
(
sample
);
RestAssert
.
fail
(
entrustSampleService
.
isRepeatSampleCode
(
sample
),
String
.
format
(
"样品编号【%s】重复!"
,
sample
.
getCode
()));
RestAssert
.
fail
(
entrustSampleService
.
isRepeatSampleCode
(
sample
),
String
.
format
(
"样品编号【%s】重复!"
,
sample
.
getCode
()));
}
}
...
@@ -544,7 +574,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -544,7 +574,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(!
Objects
.
equals
(
"原铝重取"
,
sample
.
getName
()))
{
if
(!
Objects
.
equals
(
"原铝重取"
,
sample
.
getName
()))
{
return
;
return
;
}
}
String
code
=
sample
.
getCode
(
);
String
code
=
StringHandleUtils
.
nvlBlank
(
sample
.
getCode
()
);
if
(
StringUtils
.
isBlank
(
code
))
{
if
(
StringUtils
.
isBlank
(
code
))
{
return
;
return
;
}
}
...
@@ -705,15 +735,25 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -705,15 +735,25 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert
.
fail
(
Objects
.
isNull
(
entrustId
),
"委托编号为空"
);
RestAssert
.
fail
(
Objects
.
isNull
(
entrustId
),
"委托编号为空"
);
// ==
// ==
List
<
EntrustSampleDTO
>
sampleList
=
dto
.
getSampleDTOList
();
List
<
EntrustSampleDTO
>
sampleList
=
dto
.
getSampleDTOList
();
// == 验证 ==> 样品信息
// == 验证 ==> 样品信息
List
<?>
dataList
=
verifyAndPrepareSampleData
(
sampleList
,
isSubmit
);
List
<?>
dataList
=
verifyAndPrepareSampleData
(
sampleList
,
isSubmit
);
final
Long
materialId
=
sampleList
.
get
(
0
).
getMaterialId
();
Material
material
=
getMaterial
(
materialId
);
Entrust
entrust
=
dto
.
convert
(
Entrust
.
class
);
Entrust
entrust
=
dto
.
convert
(
Entrust
.
class
);
// 强制获取数据 样品名称
// 强制获取数据 样品名称
entrust
.
setSampleName
(
dataList
.
get
(
0
).
toString
());
entrust
.
setSampleName
(
dataList
.
get
(
0
).
toString
());
// 强制获取数据 分类列表
// 强制获取数据 分类列表
Map
<
String
,
LmsChemicalCategory
>
categoryMap
=
(
Map
<
String
,
LmsChemicalCategory
>)
dataList
.
get
(
1
);
Map
<
String
,
LmsChemicalCategory
>
categoryMap
=
(
Map
<
String
,
LmsChemicalCategory
>)
dataList
.
get
(
1
);
// 用户所属期数
String
period
=
userInfoService
.
getUserPeriod
(
account
);
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"period"
,
period
);
params
.
put
(
"abbr"
,
material
.
getAbbr
());
if
(
updateById
(
entrust
))
{
if
(
updateById
(
entrust
))
{
List
<
EntrustSample
>
updateSampleList
=
new
ArrayList
<>();
List
<
EntrustSample
>
updateSampleList
=
new
ArrayList
<>();
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
...
@@ -727,7 +767,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -727,7 +767,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(
isSubmit
)
{
if
(
isSubmit
)
{
// 样品编号为空,或者采样ID不为空
// 样品编号为空,或者采样ID不为空
if
(
StringUtils
.
isBlank
(
sample
.
getCode
())
||
Objects
.
nonNull
(
sample
.
getSamplingId
()))
{
if
(
StringUtils
.
isBlank
(
sample
.
getCode
())
||
Objects
.
nonNull
(
sample
.
getSamplingId
()))
{
handleSampleCode
(
entrust
,
sample
,
categoryMap
);
handleSampleCode
(
entrust
,
sample
,
categoryMap
,
params
);
}
}
if
(
StringUtils
.
isNotBlank
(
sample
.
getCode
()))
{
if
(
StringUtils
.
isNotBlank
(
sample
.
getCode
()))
{
sample
.
setCode
(
StringHandleUtils
.
toUpper
(
sample
.
getCode
()));
sample
.
setCode
(
StringHandleUtils
.
toUpper
(
sample
.
getCode
()));
...
@@ -1198,6 +1238,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1198,6 +1238,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
RestAssert
.
fail
(
null
==
ids
||
ids
.
length
==
0
,
"请选择要复制的委托记录"
);
RestAssert
.
fail
(
null
==
ids
||
ids
.
length
==
0
,
"请选择要复制的委托记录"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
entrustList
),
"请选择要复制的委托记录"
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
entrustList
),
"请选择要复制的委托记录"
);
Material
material
=
getMaterial
(
entrustList
.
get
(
0
).
getMaterialId
());
// 循环遍历设置委托及其样品信息
// 循环遍历设置委托及其样品信息
List
<
Long
>
entrustIdList
=
new
ArrayList
<>();
List
<
Long
>
entrustIdList
=
new
ArrayList
<>();
List
<
EntrustSample
>
entrustSampleList
=
new
ArrayList
<>();
List
<
EntrustSample
>
entrustSampleList
=
new
ArrayList
<>();
...
@@ -1215,6 +1256,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1215,6 +1256,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
// 保存委托信息
// 保存委托信息
saveEntrust
(
entrust
);
saveEntrust
(
entrust
);
entrustIdList
.
add
(
entrust
.
getId
());
entrustIdList
.
add
(
entrust
.
getId
());
// 用户期数
String
period
=
userInfoService
.
getUserPeriod
(
account
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
4
);
params
.
put
(
"period"
,
period
);
params
.
put
(
"abbr"
,
material
.
getAbbr
());
// 单独查询分类信息
// 单独查询分类信息
List
<
String
>
categoryList
=
sampleList
.
stream
().
map
(
EntrustSample:
:
getCategory
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
String
>
categoryList
=
sampleList
.
stream
().
map
(
EntrustSample:
:
getCategory
).
distinct
().
collect
(
Collectors
.
toList
());
Map
<
String
,
LmsChemicalCategory
>
categoryMap
=
lmsChemicalCategoryClient
.
getTopCategoryMap
(
categoryList
).
getData
();
Map
<
String
,
LmsChemicalCategory
>
categoryMap
=
lmsChemicalCategoryClient
.
getTopCategoryMap
(
categoryList
).
getData
();
...
@@ -1229,7 +1275,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1229,7 +1275,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setId
(
IdWorker
.
getId
());
sample
.
setCode
(
null
).
setFirstCode
(
null
).
setSecondCode
(
null
).
setThirdCode
(
null
);
sample
.
setCode
(
null
).
setFirstCode
(
null
).
setSecondCode
(
null
).
setThirdCode
(
null
);
//生成样品编号,可能存在为空的情况
//生成样品编号,可能存在为空的情况
initSampleCode
(
entrust
,
sample
,
categoryMap
);
initSampleCode
(
entrust
,
sample
,
categoryMap
,
params
);
// 样品编号问题,手填的样品编号不清空
// 样品编号问题,手填的样品编号不清空
if
(
StringUtils
.
isBlank
(
sample
.
getCode
()))
{
if
(
StringUtils
.
isBlank
(
sample
.
getCode
()))
{
sample
.
setCode
(
sampleCode
);
sample
.
setCode
(
sampleCode
);
...
@@ -1701,6 +1747,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1701,6 +1747,8 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
logger
.
error
(
"进入提交委托流程......"
);
logger
.
error
(
"进入提交委托流程......"
);
RestAssert
.
fail
(
null
==
ids
||
0
==
ids
.
length
,
"请选择要提交的委托!"
);
RestAssert
.
fail
(
null
==
ids
||
0
==
ids
.
length
,
"请选择要提交的委托!"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
final
Long
materialId
=
entrustList
.
get
(
0
).
getMaterialId
();
Material
material
=
getMaterial
(
materialId
);
List
<
Long
>
specialIds
=
new
ArrayList
<>(),
List
<
Long
>
specialIds
=
new
ArrayList
<>(),
normalIds
=
new
ArrayList
<>();
normalIds
=
new
ArrayList
<>();
List
<
Long
>
sendUserIdList
=
new
ArrayList
<>();
List
<
Long
>
sendUserIdList
=
new
ArrayList
<>();
...
@@ -1718,6 +1766,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1718,6 +1766,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
categoryList
.
add
(
category
);
categoryList
.
add
(
category
);
}
}
});
});
// 用户所属期数
String
period
=
userInfoService
.
getUserPeriod
(
account
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
4
);
params
.
put
(
"period"
,
period
);
params
.
put
(
"abbr"
,
material
.
getAbbr
());
Map
<
String
,
LmsChemicalCategory
>
categoryMap
=
lmsChemicalCategoryClient
.
getTopCategoryMap
(
categoryList
).
getData
();
Map
<
String
,
LmsChemicalCategory
>
categoryMap
=
lmsChemicalCategoryClient
.
getTopCategoryMap
(
categoryList
).
getData
();
List
<
EntrustSampleItem
>
itemList
=
entrustSampleItemService
.
list
(
Condition
.<
EntrustSampleItem
>
wrapper
().
in
(
"entrust_sample_id"
,
sampleIds
));
List
<
EntrustSampleItem
>
itemList
=
entrustSampleItemService
.
list
(
Condition
.<
EntrustSampleItem
>
wrapper
().
in
(
"entrust_sample_id"
,
sampleIds
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
itemList
),
"提交的检测项目数据为空!"
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
itemList
),
"提交的检测项目数据为空!"
);
...
@@ -1731,7 +1785,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1731,7 +1785,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
for
(
EntrustSample
sample
:
sampleList
)
{
for
(
EntrustSample
sample
:
sampleList
)
{
sample
.
setSlotNo
(
StringHandleUtils
.
nvlBlank
(
sample
.
getSlotNo
()));
sample
.
setSlotNo
(
StringHandleUtils
.
nvlBlank
(
sample
.
getSlotNo
()));
if
(
StringUtils
.
isBlank
(
sample
.
getCode
())
||
Objects
.
nonNull
(
sample
.
getSamplingId
()))
{
if
(
StringUtils
.
isBlank
(
sample
.
getCode
())
||
Objects
.
nonNull
(
sample
.
getSamplingId
()))
{
handleSampleCode
(
entrust
,
sample
,
categoryMap
);
handleSampleCode
(
entrust
,
sample
,
categoryMap
,
params
);
}
}
// 额外处理样品编号空格,大写
// 额外处理样品编号空格,大写
fillCodeAfterHandle
(
sample
);
fillCodeAfterHandle
(
sample
);
...
@@ -1783,13 +1837,21 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1783,13 +1837,21 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return
true
;
return
true
;
}
}
private
Material
getMaterial
(
Long
materialId
)
{
Material
material
=
new
Material
();
if
(
Objects
.
nonNull
(
materialId
))
{
material
=
materialService
.
getById
(
materialId
);
}
return
material
;
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveOrUpdateToSubmit
(
EntrustDTO
entrustDTO
,
Account
account
)
{
public
boolean
saveOrUpdateToSubmit
(
EntrustDTO
entrustDTO
,
Account
account
)
{
if
(
null
==
entrustDTO
.
getId
())
{
if
(
null
==
entrustDTO
.
getId
())
{
saveEntrustDTO
(
entrustDTO
,
tru
e
,
account
);
saveEntrustDTO
(
entrustDTO
,
fals
e
,
account
);
}
else
{
}
else
{
editEntrust
(
entrustDTO
,
tru
e
,
account
);
editEntrust
(
entrustDTO
,
fals
e
,
account
);
}
}
return
submitToNextFlow
(
new
Long
[]{
entrustDTO
.
getId
()},
account
);
return
submitToNextFlow
(
new
Long
[]{
entrustDTO
.
getId
()},
account
);
}
}
...
@@ -1808,6 +1870,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1808,6 +1870,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
String
sampleName
=
sampleDTO
.
getName
(),
recheckCode
=
sampleDTO
.
getRecheckCode
();
String
sampleName
=
sampleDTO
.
getName
(),
recheckCode
=
sampleDTO
.
getRecheckCode
();
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sampleName
),
"样品名称不能为空!"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
sampleName
),
"样品名称不能为空!"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
recheckCode
),
"样品复检编号不能为空!"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
recheckCode
),
"样品复检编号不能为空!"
);
Material
material
=
getMaterial
(
sampleDTO
.
getMaterialId
());
List
<
EntrustSample
>
oldSampleList
=
entrustSampleService
.
list
(
Condition
.
create
().
eq
(
"code"
,
recheckCode
));
List
<
EntrustSample
>
oldSampleList
=
entrustSampleService
.
list
(
Condition
.
create
().
eq
(
"code"
,
recheckCode
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
oldSampleList
),
"复检对应样品不存在!"
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
oldSampleList
),
"复检对应样品不存在!"
);
Entrust
oldEntrust
=
getById
(
oldSampleList
.
get
(
0
).
getEntrustId
());
Entrust
oldEntrust
=
getById
(
oldSampleList
.
get
(
0
).
getEntrustId
());
...
@@ -1822,6 +1885,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1822,6 +1885,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
.
setType
(
1
).
setPeriod
(
oldEntrust
.
getPeriod
()).
setPriority
(
oldEntrust
.
getPriority
()).
setEntrustTime
(
new
Date
())
.
setType
(
1
).
setPeriod
(
oldEntrust
.
getPeriod
()).
setPriority
(
oldEntrust
.
getPriority
()).
setEntrustTime
(
new
Date
())
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
()).
setStatusPath
(
oldEntrust
.
getStatusPath
()).
setId
(
IdWorker
.
getId
());
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
()).
setStatusPath
(
oldEntrust
.
getStatusPath
()).
setId
(
IdWorker
.
getId
());
// 用户期数
String
period
=
userInfoService
.
getUserPeriod
(
account
);
Map
<
String
,
String
>
params
=
new
HashMap
<>(
4
);
params
.
put
(
"period"
,
period
);
params
.
put
(
"abbr"
,
material
.
getAbbr
());
// 委托ID
// 委托ID
Long
entrustId
=
entrust
.
getId
();
Long
entrustId
=
entrust
.
getId
();
int
incNum
=
10
;
int
incNum
=
10
;
...
@@ -1838,7 +1906,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1838,7 +1906,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
.
setSampleGrading
(
null
).
setLtime
(
new
Date
()).
setLid
(
account
.
getUserId
()).
setCtime
(
new
Date
())
.
setSampleGrading
(
null
).
setLtime
(
new
Date
()).
setLid
(
account
.
getUserId
()).
setCtime
(
new
Date
())
.
setJudgeStatus
(
0
).
setJudgeTime
(
null
).
setJudgeCheckTime
(
null
).
setJudgeCheckerId
(
null
).
setJudger
(
null
)
.
setJudgeStatus
(
0
).
setJudgeTime
(
null
).
setJudgeCheckTime
(
null
).
setJudgeCheckerId
(
null
).
setJudger
(
null
)
.
setJudgeProgress
(
null
).
setOkJudge
(
null
).
setConclusion
(
null
);
.
setJudgeProgress
(
null
).
setOkJudge
(
null
).
setConclusion
(
null
);
initSampleCode
(
entrust
,
sample
,
categoryMap
);
initSampleCode
(
entrust
,
sample
,
categoryMap
,
params
);
// 重置三级编码
// 重置三级编码
sample
.
setThirdCode
(
getSampleThirdCode
(
sample
));
sample
.
setThirdCode
(
getSampleThirdCode
(
sample
));
sample
.
setOrderBy
(
incNum
).
setId
(
IdWorker
.
getId
());
sample
.
setOrderBy
(
incNum
).
setId
(
IdWorker
.
getId
());
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/MaterialServiceImpl.java
View file @
57ad5dd4
...
@@ -32,7 +32,8 @@ public class MaterialServiceImpl extends BaseServiceImpl<MaterialMapper, Materia
...
@@ -32,7 +32,8 @@ public class MaterialServiceImpl extends BaseServiceImpl<MaterialMapper, Materia
String
name
=
material
.
getName
();
String
name
=
material
.
getName
();
String
code
=
material
.
getCode
();
String
code
=
material
.
getCode
();
String
supplier
=
material
.
getSupplier
();
String
supplier
=
material
.
getSupplier
();
material
.
setCode
(
null
).
setName
(
null
).
setSupplier
(
null
);
String
category
=
material
.
getCategory
();
material
.
setCode
(
null
).
setName
(
null
).
setSupplier
(
null
).
setCategory
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
material
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
material
);
if
(
null
!=
materialWrapper
)
{
if
(
null
!=
materialWrapper
)
{
wrapper
=
materialWrapper
;
wrapper
=
materialWrapper
;
...
@@ -46,6 +47,9 @@ public class MaterialServiceImpl extends BaseServiceImpl<MaterialMapper, Materia
...
@@ -46,6 +47,9 @@ public class MaterialServiceImpl extends BaseServiceImpl<MaterialMapper, Materia
if
(
StringUtils
.
isNotBlank
(
supplier
))
{
if
(
StringUtils
.
isNotBlank
(
supplier
))
{
wrapper
.
like
(
"supplier"
,
supplier
);
wrapper
.
like
(
"supplier"
,
supplier
);
}
}
if
(
StringUtils
.
isNotBlank
(
category
))
{
wrapper
.
like
(
"category"
,
category
);
}
return
this
.
page
(
page
,
wrapper
);
return
this
.
page
(
page
,
wrapper
);
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/QualityInspectionCodeServiceImpl.java
0 → 100644
View file @
57ad5dd4
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.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.hmhj.entity.QualityInspectionCode
;
import
com.patzn.cloud.service.lims.hmhj.mapper.QualityInspectionCodeMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.IQualityInspectionCodeService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.omg.CORBA.TIMEOUT
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.concurrent.TimeUnit
;
/**
* 用户质检编码基础数据 服务实现类
*
* @author meazty
* @since 2021-06-20
*/
@Service
public
class
QualityInspectionCodeServiceImpl
extends
BaseServiceImpl
<
QualityInspectionCodeMapper
,
QualityInspectionCode
>
implements
IQualityInspectionCodeService
{
@Resource
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
private
static
final
String
QC_KEY
=
"QC_CODE_KEY_"
;
@Override
public
Page
<
QualityInspectionCode
>
page
(
Page
<
QualityInspectionCode
>
page
,
QualityInspectionCode
qic
)
{
String
username
=
qic
.
getUsername
(),
code
=
qic
.
getCode
();
qic
.
setUsername
(
null
).
setCode
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
qic
);
if
(
StringUtils
.
isNotBlank
(
username
))
{
wrapper
.
like
(
"username"
,
username
);
}
if
(
StringUtils
.
isNotBlank
(
code
))
{
wrapper
.
like
(
"code"
,
code
);
}
wrapper
.
orderBy
(
"ctime"
);
return
this
.
page
(
page
,
wrapper
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
@Override
public
QualityInspectionCode
getOne
(
QualityInspectionCode
entity
)
{
QualityInspectionCode
data
=
new
QualityInspectionCode
();
if
(
Objects
.
isNull
(
entity
))
{
return
data
;
}
try
{
QualityInspectionCode
inspectionCode
=
baseMapper
.
selectOne
(
entity
);
return
Optional
.
ofNullable
(
inspectionCode
).
orElse
(
data
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"获取质检编码异常:"
,
e
);
return
data
;
}
}
@Override
public
String
getCode
(
Account
account
)
{
if
(
Objects
.
isNull
(
account
)
||
Objects
.
isNull
(
account
.
getUserId
()))
{
return
null
;
}
String
key
=
QC_KEY
+
account
.
getUserId
();
String
code
=
redisTemplate
.
opsForValue
().
get
(
key
);
if
(
StringUtils
.
isNotBlank
(
code
))
{
return
code
;
}
List
<
Object
>
objects
=
baseMapper
.
selectObjs
(
Condition
.<
QualityInspectionCode
>
wrapper
()
.
setSqlSelect
(
"code"
).
eq
(
"user_id"
,
account
.
getUserId
())
.
last
(
"limit 1"
)
);
return
CollectionUtils
.
isNotEmpty
(
objects
)
?
objects
.
get
(
0
).
toString
()
:
null
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
getNewCode
(
Account
account
)
{
QualityInspectionCode
qic
=
new
QualityInspectionCode
();
qic
.
setUserId
(
account
.
getUserId
());
qic
.
setUsername
(
account
.
getUserName
());
qic
.
setCreator
(
account
.
getUserName
());
// 获取库中最大的编号
Integer
maxCode
=
baseMapper
.
selectMaxCode
();
if
(
Objects
.
isNull
(
maxCode
))
{
maxCode
=
1
;
}
Integer
newCode
=
maxCode
+
1
;
qic
.
setCode
((
newCode
>
9
)
?
(
String
.
valueOf
(
newCode
))
:
(
String
.
format
(
"0%d"
,
newCode
)));
save
(
qic
);
return
qic
.
getCode
();
}
@Override
public
String
getCodeAbsentCreate
(
Account
account
)
{
String
code
=
getCode
(
account
);
if
(
StringUtils
.
isBlank
(
code
))
{
code
=
getNewCode
(
account
);
}
// 时间1个小时刷新一次
redisTemplate
.
opsForValue
().
set
(
QC_KEY
+
account
.
getUserId
(),
code
,
1
,
TimeUnit
.
HOURS
);
return
code
;
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/UserInfoServiceImpl.java
View file @
57ad5dd4
...
@@ -17,10 +17,12 @@ import com.patzn.cloud.service.lims.hmhj.common.consts.HmConst;
...
@@ -17,10 +17,12 @@ import com.patzn.cloud.service.lims.hmhj.common.consts.HmConst;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
import
com.patzn.cloud.service.lims.hmhj.service.IUserInfoService
;
import
com.patzn.cloud.service.lims.hmhj.service.IUserInfoService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
import
java.util.stream.Stream
;
...
@@ -47,6 +49,9 @@ public class UserInfoServiceImpl implements IUserInfoService {
...
@@ -47,6 +49,9 @@ public class UserInfoServiceImpl implements IUserInfoService {
@Resource
@Resource
private
LmsUserGroupClient
lmsUserGroupClient
;
private
LmsUserGroupClient
lmsUserGroupClient
;
@Resource
private
RedisTemplate
<
String
,
String
>
redisTemplate
;
@Override
@Override
public
List
<
LmsUserGroup
>
getGroupList
(
Long
userId
)
{
public
List
<
LmsUserGroup
>
getGroupList
(
Long
userId
)
{
if
(
null
==
userId
)
{
if
(
null
==
userId
)
{
...
@@ -225,17 +230,25 @@ public class UserInfoServiceImpl implements IUserInfoService {
...
@@ -225,17 +230,25 @@ public class UserInfoServiceImpl implements IUserInfoService {
@Override
@Override
public
String
getUserPeriod
(
Account
account
)
{
public
String
getUserPeriod
(
Account
account
)
{
List
<
SysOrg
>
orgList
=
sysOrgClient
.
getListByUserId
(
account
.
getUserId
()).
getData
();
Long
userId
=
account
.
getUserId
();
String
key
=
"USER_PERIOD_"
+
userId
;
String
period
=
redisTemplate
.
opsForValue
().
get
(
key
);
if
(
StringUtils
.
isNotBlank
(
period
))
{
return
period
;
}
List
<
SysOrg
>
orgList
=
sysOrgClient
.
getListByUserId
(
userId
).
getData
();
if
(
CollectionUtils
.
isEmpty
(
orgList
))
{
if
(
CollectionUtils
.
isEmpty
(
orgList
))
{
return
null
;
return
""
;
}
}
for
(
SysOrg
org
:
orgList
)
{
for
(
SysOrg
data
:
orgList
)
{
String
period
=
getPeriod
(
org
);
String
tempPeriod
=
getPeriod
(
data
);
if
(
null
!=
period
)
{
if
(
StringUtils
.
isNotBlank
(
tempPeriod
))
{
return
period
;
period
=
tempPeriod
;
redisTemplate
.
opsForValue
().
set
(
key
,
period
,
1
,
TimeUnit
.
HOURS
);
break
;
}
}
}
}
return
null
;
return
period
;
}
}
@Override
@Override
...
...
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
View file @
57ad5dd4
...
@@ -473,7 +473,7 @@
...
@@ -473,7 +473,7 @@
</select>
</select>
<select
id=
"selectLastCode"
resultType=
"java.lang.String"
>
<select
id=
"selectLastCode"
resultType=
"java.lang.String"
>
select max(
s.code) "max_code" from entrust_sample s where s.deleted = 0 and s.code
like concat(#{queryKey},'%')
select max(
${column}) "max_code" from entrust_sample s where s.deleted = 0 and ${column}
like concat(#{queryKey},'%')
</select>
</select>
<!-- 查询样品指标 -->
<!-- 查询样品指标 -->
...
...
src/main/resources/mapper/hmhj/
User
InspectionCodeMapper.xml
→
src/main/resources/mapper/hmhj/
Quality
InspectionCodeMapper.xml
View file @
57ad5dd4
<?xml version="1.0" encoding="UTF-8"?>
<?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">
<!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.
User
InspectionCodeMapper"
>
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.
Quality
InspectionCodeMapper"
>
<select
id=
"selectMaxCode"
resultType=
"java.lang.Integer"
>
SELECT MAX(T.code)::int2 FROM quality_inspection_code T WHERE T.deleted = 0
</select>
</mapper>
</mapper>
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