Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
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
YZG
yzg-util
Commits
e6f94283
Commit
e6f94283
authored
May 07, 2019
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
消除成功接收处理
parent
903c08a6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
6 deletions
+18
-6
DateHelper.java
...src/main/java/com/yanzuoguang/util/helper/DateHelper.java
+5
-4
FileHelper.java
...src/main/java/com/yanzuoguang/util/helper/FileHelper.java
+6
-2
BaseDaoImpl.java
...b/src/main/java/com/yanzuoguang/dao/Impl/BaseDaoImpl.java
+5
-0
AllBeanRowMapper.java
...c/main/java/com/yanzuoguang/db/Impl/AllBeanRowMapper.java
+1
-0
BaseServiceImpl.java
...in/java/com/yanzuoguang/service/Impl/BaseServiceImpl.java
+1
-0
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/DateHelper.java
View file @
e6f94283
...
...
@@ -227,14 +227,15 @@ public class DateHelper {
SimpleDateFormat
shortSdf
=
new
SimpleDateFormat
(
FORMAT_DAY_STRING
);
Date
now
=
null
;
try
{
if
(
currentMonth
>=
1
&&
currentMonth
<=
3
)
if
(
currentMonth
>=
1
&&
currentMonth
<=
3
)
{
c
.
set
(
Calendar
.
MONTH
,
0
);
else
if
(
currentMonth
>=
4
&&
currentMonth
<=
6
)
}
else
if
(
currentMonth
>=
4
&&
currentMonth
<=
6
)
{
c
.
set
(
Calendar
.
MONTH
,
3
);
else
if
(
currentMonth
>=
7
&&
currentMonth
<=
9
)
}
else
if
(
currentMonth
>=
7
&&
currentMonth
<=
9
)
{
c
.
set
(
Calendar
.
MONTH
,
6
);
else
if
(
currentMonth
>=
10
&&
currentMonth
<=
12
)
}
else
if
(
currentMonth
>=
10
&&
currentMonth
<=
12
)
{
c
.
set
(
Calendar
.
MONTH
,
9
);
}
c
.
set
(
Calendar
.
DATE
,
1
);
now
=
longSdf
.
parse
(
shortSdf
.
format
(
c
.
getTime
())
+
" 00:00:00"
);
}
catch
(
Exception
e
)
{
...
...
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/FileHelper.java
View file @
e6f94283
...
...
@@ -169,11 +169,15 @@ public class FileHelper {
//删除子文件
if
(
files
[
i
].
isFile
())
{
flag
=
deleteFile
(
files
[
i
].
getAbsolutePath
());
if
(!
flag
)
break
;
if
(!
flag
)
{
break
;
}
}
//删除子目录
else
{
flag
=
deleteDirectory
(
files
[
i
].
getAbsolutePath
());
if
(!
flag
)
break
;
if
(!
flag
)
{
break
;
}
}
}
if
(!
flag
)
return
false
;
...
...
yzg-util-db/src/main/java/com/yanzuoguang/dao/Impl/BaseDaoImpl.java
View file @
e6f94283
...
...
@@ -100,6 +100,7 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param model 需要创建的数据
* @return 创建的主键编号, 创建成功,返回主键,否则为空
*/
@Override
public
String
create
(
Object
model
)
{
// 判断主键是字符串和需要生成主键
boolean
isKeyString
=
this
.
Table
.
Table
.
getKeyType
()
==
String
.
class
;
...
...
@@ -137,6 +138,7 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param model 需要修改的数据
* @return 删除的主键编号
*/
@Override
public
String
update
(
Object
model
)
{
String
keyString
=
this
.
getKeyString
(
model
);
if
(
StringHelper
.
isEmpty
(
keyString
))
{
...
...
@@ -169,6 +171,7 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param model 需要保存的数据
* @return 保存的主键编号
*/
@Override
public
String
save
(
Object
model
)
{
String
id
=
this
.
getKeyString
(
model
);
if
(
StringHelper
.
isEmpty
(
id
))
{
...
...
@@ -184,6 +187,7 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param model 需要删除的数据
* @return 删除的主键编号
*/
@Override
public
int
remove
(
Object
model
)
{
// 获取来源主键
Object
from
=
model
;
...
...
@@ -220,6 +224,7 @@ public abstract class BaseDaoImpl extends BaseDaoSql implements BaseDao {
* @param <T> 返回数据的类型
* @return 需要返回的数据
*/
@Override
public
<
T
extends
Object
>
T
load
(
Object
model
,
Class
<
T
>
cls
)
{
// 获取来源主键
Object
from
=
model
;
...
...
yzg-util-db/src/main/java/com/yanzuoguang/db/Impl/AllBeanRowMapper.java
View file @
e6f94283
...
...
@@ -168,6 +168,7 @@ public class AllBeanRowMapper<T> implements RowMapper<T> {
*
* @see ResultSetMetaData
*/
@Override
public
T
mapRow
(
ResultSet
rs
,
int
rowNumber
)
throws
SQLException
,
TypeMismatchException
{
Assert
.
state
(
this
.
mappedClass
!=
null
,
"Mapped class was not specified"
);
T
mappedObject
=
BeanUtils
.
instantiate
(
this
.
mappedClass
);
...
...
yzg-util-db/src/main/java/com/yanzuoguang/service/Impl/BaseServiceImpl.java
View file @
e6f94283
...
...
@@ -72,6 +72,7 @@ public abstract class BaseServiceImpl<T> implements BaseService<T> {
*
* @param models 需要修改的数据
*/
@Override
public
List
<
String
>
update
(
T
...
models
)
{
List
<
String
>
ids
=
new
ArrayList
<
String
>();
for
(
T
t
:
models
)
{
...
...
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