Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
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
zhangkb
indicators
Commits
2c12ba63
Commit
2c12ba63
authored
Feb 25, 2021
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整基础数据id的获取
parent
ea41565f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
2 deletions
+22
-2
IndicatorsDefAuditMapper.java
...tors/model/mapper/indmapper/IndicatorsDefAuditMapper.java
+2
-0
BaseIndDefService.java
...obile/indicators/service/hytobacco/BaseIndDefService.java
+14
-0
IndicatorsDefAuditService.java
...dicators/service/hytobacco/IndicatorsDefAuditService.java
+0
-1
IndicatorsDefAuditMapper.xml
...in/resources/mybatis/mapping/IndicatorsDefAuditMapper.xml
+6
-1
No files found.
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndicatorsDefAuditMapper.java
View file @
2c12ba63
...
...
@@ -29,4 +29,6 @@ public interface IndicatorsDefAuditMapper extends BaseMapper<BaseIndDefAudit> {
* @Author hzc
**/
List
<
BaseIndDefAudit
>
selectByCatalogIdAndIndName
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"indName"
)
String
indName
);
String
getMaxIndId
(
@Param
(
"code"
)
String
code
,
@Param
(
"length"
)
int
length
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefService.java
View file @
2c12ba63
...
...
@@ -7,6 +7,7 @@ import java.util.List;
import
java.util.Map
;
import
com.keymobile.indicators.model.entity.indicators.IndicatorsRel
;
import
com.keymobile.indicators.model.mapper.indmapper.IndicatorsDefAuditMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.IndicatorsRelMapper
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -26,6 +27,10 @@ public class BaseIndDefService {
private
IndicatorsRelService
indRelService
;
@Autowired
private
DriveIndDefService
driveIndDefService
;
@Autowired
private
IndicatorsDefAuditMapper
indicatorsDefAuditMapper
;
public
String
saveOrUpdate
(
BaseIndDef
baseIndDef
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
,
String
isUpdate
,
String
code
)
throws
Exception
{
...
...
@@ -144,6 +149,13 @@ public class BaseIndDefService {
return
"id的编码不能大于等于id的长度"
;
}
String
maxId
=
baseIndDefMapper
.
getMaxIndId
(
code
+
"%"
,
length
);
String
auditId
=
indicatorsDefAuditMapper
.
getMaxIndId
(
code
+
"%"
,
length
);
if
(
Integer
.
parseInt
(
auditId
)>
Integer
.
parseInt
(
maxId
)){
maxId
=
auditId
;
}
if
(
StringUtils
.
isBlank
(
maxId
))
{
String
addZero
=
""
;
for
(
int
i
=
0
;
i
<(
length
-
code
.
length
()-
1
);
i
++)
{
...
...
@@ -151,6 +163,8 @@ public class BaseIndDefService {
}
maxId
=
code
+
addZero
+
"1"
;
}
return
maxId
;
}
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndicatorsDefAuditService.java
View file @
2c12ba63
...
...
@@ -63,7 +63,6 @@ public class IndicatorsDefAuditService {
baseIndDefAudit
.
setUpdateTime
(
date
);
baseIndDefAudit
.
setUpdater
(
currentUser
);
baseIndDefAudit
.
setCreater
(
currentUser
);
indicatorsDefAuditMapper
.
insert
(
baseIndDefAudit
);
log
.
info
(
"{}提交了申请,{}"
,
currentUser
,
baseIndDefAudit
);
return
Result
.
genOkResult
();
...
...
src/main/resources/mybatis/mapping/IndicatorsDefAuditMapper.xml
View file @
2c12ba63
...
...
@@ -34,5 +34,9 @@
select * from base_ind_def_audit
where status != 4 and ind_name=#{indName} and catalog_id = #{catalogId}
</select>
<select
id=
"getMaxIndId"
resultType=
"java.lang.String"
>
select (max(CAST(ind_id as SIGNED INTEGER))+1) as maxId
from base_ind_def
where ind_id like #{code} and LENGTH(ind_id)=#{length}
</select>
</mapper>
\ No newline at end of file
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