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
2f39ea94
Commit
2f39ea94
authored
Oct 14, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复三级编码 三期编码问题;
parent
72464a23
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
8 deletions
+31
-8
ContractSamplingServiceImpl.java
...e/lims/hmhj/service/impl/ContractSamplingServiceImpl.java
+28
-7
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+3
-1
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/ContractSamplingServiceImpl.java
View file @
2f39ea94
...
@@ -13,18 +13,13 @@ import com.patzn.cloud.commons.service.impl.BaseServiceImpl;
...
@@ -13,18 +13,13 @@ import com.patzn.cloud.commons.service.impl.BaseServiceImpl;
import
com.patzn.cloud.feign.base.client.SysOrgClient
;
import
com.patzn.cloud.feign.base.client.SysOrgClient
;
import
com.patzn.cloud.feign.lims.hmhj.client.LmsChemicalCategoryClient
;
import
com.patzn.cloud.feign.lims.hmhj.client.LmsChemicalCategoryClient
;
import
com.patzn.cloud.service.base.entity.SysOrg
;
import
com.patzn.cloud.service.base.entity.SysOrg
;
import
com.patzn.cloud.service.hmhj.entity.ContractSample
;
import
com.patzn.cloud.service.hmhj.entity.*
;
import
com.patzn.cloud.service.hmhj.entity.ContractSampling
;
import
com.patzn.cloud.service.hmhj.entity.UserInspectionCode
;
import
com.patzn.cloud.service.hmhj.enums.CodeTypeEnum
;
import
com.patzn.cloud.service.hmhj.enums.CodeTypeEnum
;
import
com.patzn.cloud.service.hmhj.vo.ContractSamplingVO
;
import
com.patzn.cloud.service.hmhj.vo.ContractSamplingVO
;
import
com.patzn.cloud.service.lims.chemical.entity.LmsChemicalCategory
;
import
com.patzn.cloud.service.lims.chemical.entity.LmsChemicalCategory
;
import
com.patzn.cloud.service.lims.hmhj.common.consts.HmConst
;
import
com.patzn.cloud.service.lims.hmhj.common.consts.HmConst
;
import
com.patzn.cloud.service.lims.hmhj.mapper.ContractSamplingMapper
;
import
com.patzn.cloud.service.lims.hmhj.mapper.ContractSamplingMapper
;
import
com.patzn.cloud.service.lims.hmhj.service.ICodeRuleService
;
import
com.patzn.cloud.service.lims.hmhj.service.*
;
import
com.patzn.cloud.service.lims.hmhj.service.IContractSampleService
;
import
com.patzn.cloud.service.lims.hmhj.service.IContractSamplingService
;
import
com.patzn.cloud.service.lims.hmhj.service.IUserInspectionCodeService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -46,9 +41,15 @@ public class ContractSamplingServiceImpl extends BaseServiceImpl<ContractSamplin
...
@@ -46,9 +41,15 @@ public class ContractSamplingServiceImpl extends BaseServiceImpl<ContractSamplin
private
SysOrgClient
sysOrgClient
;
private
SysOrgClient
sysOrgClient
;
@Autowired
@Autowired
private
UserInfoServiceImpl
userInfoService
;
@Autowired
private
ICodeRuleService
codeRuleService
;
private
ICodeRuleService
codeRuleService
;
@Autowired
@Autowired
private
IMaterialService
materialService
;
@Autowired
private
IContractSampleService
contractSampleService
;
private
IContractSampleService
contractSampleService
;
@Autowired
@Autowired
...
@@ -101,6 +102,26 @@ public class ContractSamplingServiceImpl extends BaseServiceImpl<ContractSamplin
...
@@ -101,6 +102,26 @@ public class ContractSamplingServiceImpl extends BaseServiceImpl<ContractSamplin
return
saveOrUpdateBatch
(
sampleList
);
return
saveOrUpdateBatch
(
sampleList
);
}
}
private
String
getSampleThirdCode
(
EntrustSample
sample
)
{
RestAssert
.
fail
(
null
==
sample
.
getMaterialId
(),
"样品库-物资ID为空"
);
Material
material
=
materialService
.
getById
(
sample
.
getMaterialId
());
RestAssert
.
fail
(
null
==
material
,
"样品库-物资为空"
);
String
factoryArea
=
material
.
getFactoryArea
(),
abbr
=
material
.
getAbbr
();
RestAssert
.
fail
(
StringUtils
.
isBlank
(
factoryArea
),
"样品库-物资厂区为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
abbr
),
"样品库-物资简写为空"
);
String
type
=
""
;
// type 处理
if
(
factoryArea
.
contains
(
"二三期"
))
{
String
period
=
userInfoService
.
getUserPeriod
(
LoginHelper
.
getAccount
());
type
=
HmConst
.
SECOND_PERIOD
.
equals
(
period
)
?
"A"
:
"B"
;
type
=
type
+
(
abbr
.
length
()
>
2
?
abbr
:
abbr
+
"0"
);
}
else
{
type
=
type
+
abbr
;
}
String
code
=
codeRuleService
.
getKey
(
type
.
toUpperCase
(),
"SN&@yyMMdd"
,
sample
);
return
code
;
}
@Override
@Override
public
boolean
updateSampling
(
ContractSampling
contractSampling
)
{
public
boolean
updateSampling
(
ContractSampling
contractSampling
)
{
return
updateById
(
contractSampling
);
return
updateById
(
contractSampling
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
2f39ea94
...
@@ -340,8 +340,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -340,8 +340,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(
factoryArea
.
contains
(
"二三期"
))
{
if
(
factoryArea
.
contains
(
"二三期"
))
{
String
period
=
userInfoService
.
getUserPeriod
(
LoginHelper
.
getAccount
());
String
period
=
userInfoService
.
getUserPeriod
(
LoginHelper
.
getAccount
());
type
=
HmConst
.
SECOND_PERIOD
.
equals
(
period
)
?
"A"
:
"B"
;
type
=
HmConst
.
SECOND_PERIOD
.
equals
(
period
)
?
"A"
:
"B"
;
}
type
=
type
+
(
abbr
.
length
()
>
2
?
abbr
:
abbr
+
"0"
);
type
=
type
+
(
abbr
.
length
()
>
2
?
abbr
:
abbr
+
"0"
);
}
else
{
type
=
abbr
;
}
String
code
=
codeRuleService
.
getKey
(
type
.
toUpperCase
(),
"SN&@yyMMdd"
,
sample
);
String
code
=
codeRuleService
.
getKey
(
type
.
toUpperCase
(),
"SN&@yyMMdd"
,
sample
);
return
code
;
return
code
;
}
}
...
...
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