Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hp-smart
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
platform
hp-smart
Commits
5c5f3163
Commit
5c5f3163
authored
Jan 11, 2024
by
YG6494
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HPKC008页面修改,新增日期选择框,默认日期为当前月
parent
e2aae5ff
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
134 additions
and
27 deletions
+134
-27
ServiceHPKC008.java
.../java/com/baosight/hpjx/hp/kc/service/ServiceHPKC008.java
+12
-24
HPKC008.xml
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC008.xml
+2
-2
CommonMethod.java
src/main/java/com/baosight/hpjx/util/CommonMethod.java
+37
-0
StringUtil.java
src/main/java/com/baosight/hpjx/util/StringUtil.java
+80
-0
HPKC008.js
src/main/webapp/HP/KC/HPKC008.js
+2
-0
HPKC008.jsp
src/main/webapp/HP/KC/HPKC008.jsp
+1
-1
No files found.
src/main/java/com/baosight/hpjx/hp/kc/service/ServiceHPKC008.java
View file @
5c5f3163
package
com
.
baosight
.
hpjx
.
hp
.
kc
.
service
;
import
com.baosight.hpjx.hp.kc.domain.HPKC008
;
import
com.baosight.hpjx.util.StringUtil
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
...
...
@@ -22,8 +23,9 @@ public class ServiceHPKC008 extends ServiceBase {
public
EiInfo
initLoad
(
EiInfo
inInfo
)
{
HPKC008
HPKC008
=
new
HPKC008
();
EiInfo
outInfo
=
super
.
initLoad
(
inInfo
,
HPKC008
);
outInfo
.
addBlock
(
EiConstant
.
resultBlock
).
addBlockMeta
(
HPKC008
.
eiMetadata
);
return
inInfo
;
outInfo
.
addBlock
(
EiConstant
.
queryBlock
).
setCell
(
0
,
"datemonth"
,
CommonMethod
.
getCurrentSameYearMonth
());
outInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRows
().
clear
();
return
outInfo
;
}
/**
...
...
@@ -31,9 +33,10 @@ public class ServiceHPKC008 extends ServiceBase {
*/
@Override
public
EiInfo
query
(
EiInfo
inInfo
)
{
String
datemonth
=
inInfo
.
getCellStr
(
EiConstant
.
queryBlock
,
0
,
"datemonth"
);
inInfo
.
setCell
(
EiConstant
.
queryBlock
,
0
,
"datemonth"
,
StringUtil
.
removeHorizontalLine
(
datemonth
));
/* 调用EI查询方法.*/
EiInfo
outInfo
=
super
.
query
(
inInfo
,
"HPKC008.query"
,
new
HPKC008
());
return
outInfo
;
return
super
.
query
(
inInfo
,
"HPKC008.query"
,
new
HPKC008
());
}
...
...
@@ -42,28 +45,13 @@ public class ServiceHPKC008 extends ServiceBase {
*/
@Override
public
EiInfo
insert
(
EiInfo
inInfo
)
{
try
{
CommonMethod
.
creatorInfo
(
inInfo
,
EiConstant
.
resultBlock
);
super
.
insert
(
inInfo
,
"HPKC008.insert"
);
// Thpkc008 HPKC008 = new Thpkc008();
// EiBlock eiBlock = inInfo.getBlock(EiConstant.resultBlock);
// for (int i = 0; i < eiBlock.getRowCount(); i++) {
// Map<?, ?> map = eiBlock.getRow(i);
// HPKC008.fromMap(map);
// this.dao.insertBatch()//insert("HPKC008.insert", HPKC008.toMap());
// }
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
inInfo
.
setMsg
(
"新增成功!"
);
}
catch
(
PlatException
e
)
{
e
.
printStackTrace
();
inInfo
.
setStatus
(
EiConstant
.
STATUS_FAILURE
);
inInfo
.
setMsg
(
"新增失败!原因参见详细错误描述!"
);
inInfo
.
setDetailMsg
(
e
.
getMessage
());
logError
(
"新增失败"
,
e
.
getMessage
());
return
inInfo
;
CommonMethod
.
creatorInfo
(
inInfo
,
EiConstant
.
resultBlock
);
for
(
int
i
=
0
;
i
<
inInfo
.
getBlock
(
EiConstant
.
resultBlock
).
getRowCount
();
i
++)
{
String
datemonth
=
inInfo
.
getCellStr
(
EiConstant
.
resultBlock
,
i
,
"datemonth"
);
inInfo
.
setCell
(
EiConstant
.
resultBlock
,
i
,
"datemonth"
,
StringUtil
.
removeHorizontalLine
(
datemonth
));
}
return
inInfo
;
return
super
.
insert
(
inInfo
,
"HPKC008.insert"
)
;
}
...
...
src/main/java/com/baosight/hpjx/hp/kc/sql/HPKC008.xml
View file @
5c5f3163
...
...
@@ -45,10 +45,10 @@
ID = #id#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"datemonth"
>
datemonth
= #datemonth#
DATEMONTH
= #datemonth#
</isNotEmpty>
<isNotEmpty
prepend=
" AND "
property=
"statisticalNumber"
>
statisticalNumber
= #statisticalNumber#
STATISTICAL_NUMBER
= #statisticalNumber#
</isNotEmpty>
<dynamic
prepend=
"ORDER BY"
>
<isNotEmpty
property=
"orderBy"
>
...
...
src/main/java/com/baosight/hpjx/util/CommonMethod.java
View file @
5c5f3163
...
...
@@ -11,6 +11,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import
com.baosight.iplat4j.core.util.DateUtils
;
import
com.baosight.iplat4j.core.web.threadlocal.UserSession
;
import
java.util.Calendar
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -94,5 +95,41 @@ public class CommonMethod {
block
.
setCell
(
i
,
HPConstants
.
SQL_FIELD_UPDATED_TIME
,
time
);
}
}
/**
* 得到当前年月的上一月字符串
* DN 21/09/04
*/
/*public static String getCurrentYearMonth() {
int year = Calendar.getInstance().get(Calendar.YEAR);
int month = Calendar.getInstance().get(Calendar.MONTH);
String yearMonth;
if (month==0){
yearMonth=year-1+"12";
}
else if (month<10 && month>0){
yearMonth=year+"0"+month;
}
else {
yearMonth=year+""+month;
}
return yearMonth;
}*/
public
static
String
getCurrentSameYearMonth
()
{
int
year
=
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
);
int
month
=
Calendar
.
getInstance
().
get
(
Calendar
.
MONTH
)+
1
;
String
yearMonth
;
if
(
month
==
0
){
yearMonth
=
year
-
1
+
"-12"
;
}
else
if
(
month
<
10
&&
month
>
0
){
yearMonth
=
year
+
"-0"
+
month
;
}
else
{
yearMonth
=
year
+
"-"
+
month
;
}
return
yearMonth
;
}
}
src/main/java/com/baosight/hpjx/util/StringUtil.java
0 → 100644
View file @
5c5f3163
package
com
.
baosight
.
hpjx
.
util
;
import
org.springframework.util.ObjectUtils
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.regex.Pattern
;
public
class
StringUtil
{
/**
* 默认的待去除字符, 用于{@link }静态方法.
*/
private
static
final
Character
DEFAULT_CHARACTER_TO_BE_REMOVED
=
'-'
;
/**
* 数值字符串正则匹配规则.
*/
private
static
final
String
NUMBER_STRING_RULES
=
"[0-9]*"
;
/**
* 数值字符串匹配校验器.
*/
private
static
final
Pattern
NUMBER_STRING_MATCH_CHECKER
=
Pattern
.
compile
(
StringUtil
.
NUMBER_STRING_RULES
);
public
StringUtil
()
{
}
public
static
String
removeHorizontalLine
(
String
date
)
{
if
(
ObjectUtils
.
isEmpty
(
date
))
{
throw
new
RuntimeException
(
"传入的字符串是个Null或空, 系统错误信息:"
+
date
);
}
return
removeSpecifiedCharacter
(
date
,
DEFAULT_CHARACTER_TO_BE_REMOVED
);
}
public
static
String
removeSpecifiedCharacter
(
String
str
,
Character
characterToBeRemoved
)
{
StringBuilder
newDateString
=
new
StringBuilder
(
ObjectUtils
.
isEmpty
(
str
)
?
""
:
str
);
for
(
int
index
=
newDateString
.
length
()
-
1
;
index
>=
0
;
index
--)
{
if
(
newDateString
.
charAt
(
index
)
==
characterToBeRemoved
)
{
newDateString
.
deleteCharAt
(
index
);
}
}
return
newDateString
.
toString
();
}
public
static
String
getNewNumberString
(
String
sourceStr
)
{
final
StringBuilder
newStr
=
new
StringBuilder
(
sourceStr
.
length
());
for
(
int
i
=
0
,
length
=
sourceStr
.
length
();
i
<
length
;
i
++)
{
char
isNumberChar
=
sourceStr
.
charAt
(
i
);
switch
(
isNumberChar
)
{
case
'0'
:
case
'1'
:
case
'2'
:
case
'3'
:
case
'4'
:
case
'5'
:
case
'6'
:
case
'7'
:
case
'8'
:
case
'9'
:
newStr
.
append
(
isNumberChar
);
break
;
default
:
break
;
}
}
return
newStr
.
toString
();
}
}
src/main/webapp/HP/KC/HPKC008.js
View file @
5c5f3163
$
(
function
()
{
$
(
"#inqu_status-0-datemonth"
).
val
(
__eiInfo
.
blocks
.
inqu_status
.
rows
[
0
]);
// 查询
$
(
"#QUERY"
).
on
(
"click"
,
function
()
{
resultGrid
.
dataSource
.
page
(
1
);
// 点击查询按钮,从第1页开始查询
...
...
src/main/webapp/HP/KC/HPKC008.jsp
View file @
5c5f3163
...
...
@@ -22,7 +22,7 @@
<EF:EFColumn
ename=
"id"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"datemonth"
cname=
"月份"
width=
"100"
readonly=
"false"
/>
<EF:EFColumn
ename=
"datemonth"
cname=
"月份"
editType=
"date"
dateFormat=
"yyyy-MM"
parseFormats=
"['yyyyMM']"
start=
"year"
depth=
"year"
width=
"100"
readonly=
"false"
/>
<EF:EFColumn
ename=
"statisticalNumber"
cname=
"统计单单号"
width=
"100"
readonly=
"false"
/>
<EF:EFColumn
ename=
"materialCode"
cname=
"物料编码"
width=
"100"
readonly=
"false"
/>
<EF:EFColumn
ename=
"materialName"
cname=
"物料名称"
width=
"100"
readonly=
"false"
/>
...
...
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