Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rs-cloud-platform
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
周健威
rs-cloud-platform
Commits
66112688
Commit
66112688
authored
Jun 26, 2024
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
0f92aa9f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
10 deletions
+84
-10
GainDataDTO.java
.../java/com/upyuns/platform/rs/website/dto/GainDataDTO.java
+14
-1
GainData.java
.../java/com/upyuns/platform/rs/website/entity/GainData.java
+4
-0
DataMenuBiz.java
.../java/com/upyuns/platform/rs/website/biz/DataMenuBiz.java
+37
-0
GainDataController.java
...latform/rs/website/controller/web/GainDataController.java
+29
-9
No files found.
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/dto/GainDataDTO.java
View file @
66112688
package
com
.
upyuns
.
platform
.
rs
.
website
.
dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
@Data
public
class
GainDataDTO
extends
PageParam
{
private
String
id
;
private
String
menuId
;
private
String
name
;
private
String
topMenuId
;
private
String
supplier
;
//
private
String
time
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
crtTimeStart
;
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
crtTimeEnd
;
}
rs-website/rs-website-api/src/main/java/com/upyuns/platform/rs/website/entity/GainData.java
View file @
66112688
...
...
@@ -120,4 +120,8 @@ public class GainData implements Serializable {
@Column
(
name
=
"has_gtdata"
)
@ApiModelProperty
(
value
=
"是否已经存储gtdata 0--未处理;1--已处理;2--已更新"
)
private
Integer
hasGtdata
;
@Column
(
name
=
"supplier"
)
@ApiModelProperty
(
value
=
"供应商"
)
private
String
supplier
;
}
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/biz/DataMenuBiz.java
View file @
66112688
package
com
.
upyuns
.
platform
.
rs
.
website
.
biz
;
import
cn.hutool.core.collection.CollUtil
;
import
com.github.wxiaoqi.security.common.util.TreeUtil
;
import
com.github.wxiaoqi.security.common.vo.TreeNode
;
import
com.upyuns.platform.rs.website.entity.GainData
;
import
com.upyuns.platform.rs.website.vo.DataMenuTree
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -10,6 +12,7 @@ import org.springframework.stereotype.Service;
import
com.upyuns.platform.rs.website.entity.DataMenu
;
import
com.upyuns.platform.rs.website.mapper.DataMenuMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -46,4 +49,38 @@ public class DataMenuBiz extends BaseBiz<DataMenuMapper,DataMenu> {
return
TreeUtil
.
bulid
(
trees
,
root
);
}
public
List
<
DataMenuTree
>
getImageMenuTreeNoElements
(
List
<
DataMenu
>
menus
,
int
root
)
{
List
<
DataMenuTree
>
trees
=
new
ArrayList
<
DataMenuTree
>();
DataMenuTree
node
=
null
;
for
(
DataMenu
imageMenu
:
menus
)
{
node
=
new
DataMenuTree
();
BeanUtils
.
copyProperties
(
imageMenu
,
node
);
node
.
setLabel
(
imageMenu
.
getTitle
());
if
(
node
.
getChildren
()
==
null
)
{
node
.
setChildren
(
new
ArrayList
<>());
}
trees
.
add
(
node
);
}
return
TreeUtil
.
bulid
(
trees
,
root
);
}
public
List
<
Integer
>
getIdsByTopId
(
int
root
)
{
Example
exampleDataMenu
=
new
Example
(
DataMenu
.
class
);
exampleDataMenu
.
createCriteria
().
andNotEqualTo
(
"id"
,
root
);
exampleDataMenu
.
setOrderByClause
(
"order_num asc, id asc"
);
List
<
DataMenu
>
menus
=
selectByExample
(
exampleDataMenu
);
List
<
Integer
>
list
=
CollUtil
.
newArrayList
(
root
);
List
<
DataMenuTree
>
trees
=
getImageMenuTreeNoElements
(
menus
,
root
);
dealIds
(
trees
,
list
);
return
list
;
}
public
void
dealIds
(
List
<?
extends
TreeNode
>
menuTrees
,
List
<
Integer
>
ids
)
{
if
(
CollUtil
.
isNotEmpty
(
menuTrees
))
{
for
(
TreeNode
dataMenuTree
:
menuTrees
)
{
ids
.
add
(
dataMenuTree
.
getId
());
dealIds
(
dataMenuTree
.
getChildren
(),
ids
);
}
}
}
}
rs-website/rs-website-server/src/main/java/com/upyuns/platform/rs/website/controller/web/GainDataController.java
View file @
66112688
package
com
.
upyuns
.
platform
.
rs
.
website
.
controller
.
web
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.upyuns.platform.rs.website.biz.DataMenuBiz
;
import
com.upyuns.platform.rs.website.biz.GainDataBiz
;
import
com.upyuns.platform.rs.website.dto.GainDataDTO
;
import
com.upyuns.platform.rs.website.entity.DataMenu
;
import
com.upyuns.platform.rs.website.entity.GainData
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -28,6 +32,10 @@ import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_FA
@RestController
@RequestMapping
(
"gainData/web"
)
public
class
GainDataController
extends
BaseController
<
GainDataBiz
,
GainData
>
{
@Autowired
DataMenuBiz
dataMenuBiz
;
@ApiModelProperty
(
"列表"
)
@IgnoreUserToken
@RequestMapping
(
value
=
"/app/unauth/mapAll"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -35,14 +43,31 @@ public class GainDataController extends BaseController<GainDataBiz,GainData> {
Example
example
=
new
Example
(
GainData
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"isDel"
,
0
);
// if (StringUtils.isNotBlank(dto.getName())){
// criteria.andLike("name","%"+dto.getName()+"%");
criteria
.
andEqualTo
(
"status"
,
2
);
// }
// String menuId = dto.getMenuId().toString();
if
(
StringUtils
.
isNotBlank
(
dto
.
getMenuId
())){
criteria
.
andEqualTo
(
"menuId"
,
dto
.
getMenuId
());
}
if
(
StrUtil
.
isNotBlank
(
dto
.
getTopMenuId
())){
criteria
.
andIn
(
"menuId"
,
dataMenuBiz
.
getIdsByTopId
(
Integer
.
valueOf
(
dto
.
getTopMenuId
())));
}
if
(
StrUtil
.
isNotBlank
(
dto
.
getTime
())){
criteria
.
andEqualTo
(
"time"
,
dto
.
getTime
());
}
if
(
StrUtil
.
isNotBlank
(
dto
.
getSupplier
())){
criteria
.
andLike
(
"supplier"
,
"%"
+
dto
.
getSupplier
()
+
"%"
);
}
if
(
StrUtil
.
isNotBlank
(
dto
.
getName
())){
criteria
.
andLike
(
"name"
,
"%"
+
dto
.
getName
()
+
"%"
);
}
if
(
null
!=
dto
.
getCrtTimeStart
()){
criteria
.
andGreaterThanOrEqualTo
(
"crtTime"
,
DateUtil
.
beginOfDay
(
dto
.
getCrtTimeStart
()));
}
if
(
null
!=
dto
.
getCrtTimeEnd
()){
criteria
.
andLessThanOrEqualTo
(
"crtTime"
,
DateUtil
.
endOfDay
(
dto
.
getCrtTimeEnd
()));
}
PageDataVO
pageDataVO
=
PageDataVO
.
pageInfo
(
dto
.
getPage
(),
dto
.
getLimit
(),
()->
baseBiz
.
selectByExample
(
example
));
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
...
...
@@ -55,11 +80,6 @@ public class GainDataController extends BaseController<GainDataBiz,GainData> {
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"isDel"
,
0
);
criteria
.
andEqualTo
(
"status"
,
2
);
// if (StringUtils.isNotBlank(dto.getName())){
// criteria.andLike("name","%"+dto.getName()+"%");
// }
// String menuId = dto.getMenuId().toString();
if
(
StringUtils
.
isNotBlank
(
dto
.
getId
())){
criteria
.
andEqualTo
(
"id"
,
dto
.
getId
());
}
...
...
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