Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
fangxinjiang
yifu-mvp
Commits
5fd3e7cb
Commit
5fd3e7cb
authored
Dec 25, 2025
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
户及户基数调整-fxj
parent
dc47c17b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
10 deletions
+35
-10
Common.java
.../com/yifu/cloud/plus/v1/yifu/common/core/util/Common.java
+14
-0
SysBaseSetInfoServiceImpl.java
...1/yifu/social/service/impl/SysBaseSetInfoServiceImpl.java
+21
-10
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu/cloud/plus/v1/yifu/common/core/util/Common.java
View file @
5fd3e7cb
...
...
@@ -819,4 +819,18 @@ public class Common {
// 支持三种格式:2025-11、2025/11、202511
return
str
.
matches
(
"\\d{4}[-/]\\d{1,2}"
)
||
str
.
matches
(
"\\d{6}"
);
}
/**
* 安全解析字符串为Integer,处理可能的转换异常
*/
public
static
Integer
parseInteger
(
String
value
)
{
if
(
Common
.
isEmpty
(
value
))
{
return
null
;
}
try
{
return
Integer
.
valueOf
(
value
);
}
catch
(
NumberFormatException
e
)
{
return
null
;
}
}
}
yifu-social/yifu-social-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/social/service/impl/SysBaseSetInfoServiceImpl.java
View file @
5fd3e7cb
...
...
@@ -1432,29 +1432,40 @@ public class SysBaseSetInfoServiceImpl extends ServiceImpl<SysBaseSetInfoMapper,
if
(
Common
.
isEmpty
(
sysBaseSetInfos
)){
return
;
}
// 转换参数为Integer类型,处理可能的转换异常
Integer
provinceInt
=
Common
.
parseInteger
(
province
);
Integer
cityInt
=
Common
.
parseInteger
(
city
);
Integer
townInt
=
Common
.
parseInteger
(
town
);
LambdaUpdateWrapper
<
SysBaseSetInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
SysBaseSetInfo:
:
getDepartName
,
name
)
.
eq
(
SysBaseSetInfo:
:
getBaseType
,
type
)
.
set
(
SysBaseSetInfo:
:
getTown
,
Common
.
isEmpty
(
town
)?
null
:
Integer
.
valueOf
(
town
)
)
.
set
(
SysBaseSetInfo:
:
getCity
,
Common
.
isEmpty
(
city
)?
null
:
Integer
.
valueOf
(
city
)
)
.
set
(
SysBaseSetInfo:
:
getProvince
,
Common
.
isEmpty
(
province
)?
null
:
Integer
.
valueOf
(
province
)
);
.
set
(
SysBaseSetInfo:
:
getTown
,
townInt
)
.
set
(
SysBaseSetInfo:
:
getCity
,
cityInt
)
.
set
(
SysBaseSetInfo:
:
getProvince
,
provinceInt
);
this
.
update
(
updateWrapper
);
//添加日志
SysBaseSetInfo
old
=
null
;
int
logType
=
CommonConstants
.
ONE_INT
;
if
(
CommonConstants
.
ONE_STRING
.
equals
(
type
))
{
logType
=
CommonConstants
.
TWO_INT
;
}
// 创建旧数据副本用于日志记录
SysBaseSetInfo
old
=
null
;
for
(
SysBaseSetInfo
sysBaseSetInfo
:
sysBaseSetInfos
){
// 创建旧数据副本用于日志记录
old
=
new
SysBaseSetInfo
();
BeanUtil
.
copyProperties
(
sysBaseSetInfo
,
old
);
old
.
setTown
(
Common
.
isEmpty
(
old
.
getTown
())?
null
:
Integer
.
valueOf
(
old
.
getTown
()));
old
.
setCity
(
Common
.
isEmpty
(
old
.
getCity
())?
null
:
Integer
.
valueOf
(
old
.
getCity
()));
old
.
setProvince
(
Common
.
isEmpty
(
old
.
getProvince
())?
null
:
Integer
.
valueOf
(
old
.
getProvince
()));
sysBaseSetInfo
.
setProvince
(
Common
.
isEmpty
(
province
)
?
null
:
Integer
.
valueOf
(
province
));
sysBaseSetInfo
.
setCity
(
Common
.
isEmpty
(
city
)?
null
:
Integer
.
valueOf
(
city
));
sysBaseSetInfo
.
setTown
(
Common
.
isEmpty
(
town
)?
null
:
Integer
.
valueOf
(
town
));
// 转换旧数据中的区域码为Integer类型
old
.
setTown
(
Common
.
parseInteger
(
String
.
valueOf
(
old
.
getTown
())));
old
.
setCity
(
Common
.
parseInteger
(
String
.
valueOf
(
old
.
getCity
())));
old
.
setProvince
(
Common
.
parseInteger
(
String
.
valueOf
(
old
.
getProvince
())));
// 设置新值到原对象用于日志记录
sysBaseSetInfo
.
setProvince
(
provinceInt
);
sysBaseSetInfo
.
setCity
(
cityInt
);
sysBaseSetInfo
.
setTown
(
townInt
);
tSocialLogService
.
saveModificationRecord
(
logType
,
old
.
getId
(),
old
,
sysBaseSetInfo
);
}
}
}
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