Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-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
hg-smart
Commits
b01e502c
Commit
b01e502c
authored
Aug 19, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.预览和下载记录数+1
parent
53857b14
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
0 deletions
+74
-0
HgWdSqlConstant.java
...ava/com/baosight/hggp/hg/wd/constant/HgWdSqlConstant.java
+23
-0
ServiceHGWD001B.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001B.java
+3
-0
ServiceHGWD001C.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001C.java
+3
-0
HGWD001.xml
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001.xml
+19
-0
HGWDTools.java
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
+26
-0
No files found.
src/main/java/com/baosight/hggp/hg/wd/constant/HgWdSqlConstant.java
0 → 100644
View file @
b01e502c
package
com
.
baosight
.
hggp
.
hg
.
wd
.
constant
;
/**
* @author:songx
* @date:2024/8/16,15:51
*/
public
class
HgWdSqlConstant
{
/**
* HGWD001 SQL定义
*
* @author:songx
* @date:2024/2/22,13:57
*/
public
static
class
HgWd001
{
// 预览自增
public
static
final
String
PREVIEW_INCR
=
"HGWD001.previewIncr"
;
// 下载自增
public
static
final
String
DOWNLOAD_INCR
=
"HGWD001.downloadIncr"
;
}
}
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001B.java
View file @
b01e502c
...
...
@@ -91,6 +91,9 @@ public class ServiceHGWD001B extends ServiceBase {
try
{
List
<
HGWD001B
>
fWd001bs
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGWD001B
.
class
);
for
(
HGWD001B
fWd001b
:
fWd001bs
)
{
// 预览记录+1
HGWDTools
.
HgWd001
.
previewIncr
(
fWd001b
.
getFileId
());
// 新增
DaoUtils
.
insert
(
HGWD001B
.
INSERT
,
fWd001b
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001C.java
View file @
b01e502c
...
...
@@ -88,6 +88,9 @@ public class ServiceHGWD001C extends ServiceBase {
try
{
List
<
HGWD001C
>
fWd001cs
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGWD001C
.
class
);
for
(
HGWD001C
fWd001c
:
fWd001cs
)
{
// 下载记录+1
HGWDTools
.
HgWd001
.
previewIncr
(
fWd001c
.
getFileId
());
// 新增
DaoUtils
.
insert
(
HGWD001C
.
INSERT
,
fWd001c
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
...
...
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001.xml
View file @
b01e502c
...
...
@@ -173,4 +173,23 @@
WHERE ID = #id#
</update>
<!-- 预览自增 -->
<update
id=
"previewIncr"
>
UPDATE ${hggpSchema}.HGWD001
SET
PREVIEW_NUM = PREVIEW_NUM + 1,
<include
refid=
"SqlBase.updateRevise"
/>
WHERE FILE_ID = #fileId#
</update>
<!-- 下载自增 -->
<update
id=
"downloadIncr"
>
UPDATE ${hggpSchema}.HGWD001
SET
DOWNLOAD_NUM = DOWNLOAD_NUM + 1,
<include
refid=
"SqlBase.updateRevise"
/>
WHERE FILE_ID = #fileId#
</update>
</sqlMap>
src/main/java/com/baosight/hggp/hg/wd/tools/HGWDTools.java
View file @
b01e502c
...
...
@@ -2,7 +2,9 @@ package com.baosight.hggp.hg.wd.tools;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.hg.sb.domain.HGSB002
;
import
com.baosight.hggp.hg.wd.constant.HgWdSqlConstant
;
import
com.baosight.hggp.hg.wd.domain.HGWD001
;
import
com.baosight.hggp.util.AssertUtils
;
...
...
@@ -36,6 +38,30 @@ public class HGWDTools {
return
CollectionUtils
.
isEmpty
(
results
)
?
null
:
results
.
get
(
0
);
}
/**
* 预览记录自增
*
* @param fileId
*/
public
static
void
previewIncr
(
String
fileId
)
{
AssertUtils
.
isNull
(
fileId
,
"文件ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
HGWD001
.
FIELD_FILE_ID
,
fileId
);
DaoUtils
.
update
(
HgWdSqlConstant
.
HgWd001
.
PREVIEW_INCR
,
queryMap
);
}
/**
* 下载记录自增
*
* @param fileId
*/
public
static
void
downloadIncr
(
String
fileId
)
{
AssertUtils
.
isNull
(
fileId
,
"文件ID不能为空"
);
Map
queryMap
=
new
HashMap
();
queryMap
.
put
(
HGWD001
.
FIELD_FILE_ID
,
fileId
);
DaoUtils
.
update
(
HgWdSqlConstant
.
HgWd001
.
DOWNLOAD_INCR
,
queryMap
);
}
}
}
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