Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
d359400b
Commit
d359400b
authored
Apr 27, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加大厅与窗口关联
parent
4f19ee3d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
117 additions
and
20 deletions
+117
-20
base-manager/src/main/java/com/mortals/xhx/module/site/service/SiteHallService.java
.../com/mortals/xhx/module/site/service/SiteHallService.java
+19
-8
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteHallServiceImpl.java
...als/xhx/module/site/service/impl/SiteHallServiceImpl.java
+52
-0
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteHallController.java
...a/com/mortals/xhx/module/site/web/SiteHallController.java
+46
-12
No files found.
base-manager/src/main/java/com/mortals/xhx/module/site/service/SiteHallService.java
View file @
d359400b
package
com.mortals.xhx.module.site.service
;
package
com.mortals.xhx.module.site.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.business.model.BusinessEntity
;
import
com.mortals.xhx.module.site.model.SiteHallEntity
;
import
com.mortals.xhx.module.site.model.SiteHallEntity
;
import
com.mortals.xhx.module.site.dao.SiteHallDao
;
import
com.mortals.xhx.module.site.dao.SiteHallDao
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
java.util.List
;
/**
/**
* SiteHallService
* SiteHallService
*
* <p>
* 站点大厅信息 service接口
* 站点大厅信息 service接口
*
*
* @author zxfei
* @author zxfei
* @date 2023-04-25
* @date 2023-04-25
*/
*/
public
interface
SiteHallService
extends
ICRUDService
<
SiteHallEntity
,
Long
>
{
public
interface
SiteHallService
extends
ICRUDService
<
SiteHallEntity
,
Long
>
{
SiteHallDao
getDao
();
SiteHallDao
getDao
();
Rest
<
List
<
BusinessEntity
>>
getBusinessByHall
(
SiteHallEntity
siteHall
,
Context
context
);
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteHallServiceImpl.java
View file @
d359400b
package
com.mortals.xhx.module.site.service.impl
;
package
com.mortals.xhx.module.site.service.impl
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.module.business.model.BusinessEntity
;
import
com.mortals.xhx.module.business.model.BusinessQuery
;
import
com.mortals.xhx.module.business.service.BusinessService
;
import
com.mortals.xhx.module.site.model.SiteBusinessQuery
;
import
com.mortals.xhx.module.site.service.SiteBusinessService
;
import
com.mortals.xhx.module.window.model.WindowBusinessQuery
;
import
com.mortals.xhx.module.window.model.WindowHallEntity
;
import
com.mortals.xhx.module.window.model.WindowHallEntity
;
import
com.mortals.xhx.module.window.model.WindowHallQuery
;
import
com.mortals.xhx.module.window.service.WindowBusinessService
;
import
com.mortals.xhx.module.window.service.WindowHallService
;
import
com.mortals.xhx.module.window.service.WindowHallService
;
import
org.checkerframework.checker.units.qual.A
;
import
org.checkerframework.checker.units.qual.A
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -11,6 +20,10 @@ import com.mortals.framework.model.Context;
...
@@ -11,6 +20,10 @@ import com.mortals.framework.model.Context;
import
com.mortals.xhx.module.site.dao.SiteHallDao
;
import
com.mortals.xhx.module.site.dao.SiteHallDao
;
import
com.mortals.xhx.module.site.model.SiteHallEntity
;
import
com.mortals.xhx.module.site.model.SiteHallEntity
;
import
com.mortals.xhx.module.site.service.SiteHallService
;
import
com.mortals.xhx.module.site.service.SiteHallService
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* SiteHallService
* SiteHallService
...
@@ -24,6 +37,13 @@ public class SiteHallServiceImpl extends AbstractCRUDServiceImpl<SiteHallDao, Si
...
@@ -24,6 +37,13 @@ public class SiteHallServiceImpl extends AbstractCRUDServiceImpl<SiteHallDao, Si
@Autowired
@Autowired
private
WindowHallService
windowHallService
;
private
WindowHallService
windowHallService
;
@Autowired
private
WindowBusinessService
windowBusinessService
;
@Autowired
private
SiteBusinessService
siteBusinessService
;
@Autowired
private
BusinessService
businessService
;
/**
/**
* @param entity
* @param entity
...
@@ -39,4 +59,36 @@ public class SiteHallServiceImpl extends AbstractCRUDServiceImpl<SiteHallDao, Si
...
@@ -39,4 +59,36 @@ public class SiteHallServiceImpl extends AbstractCRUDServiceImpl<SiteHallDao, Si
windowHallEntity
.
setHallName
(
entity
.
getHallName
());
windowHallEntity
.
setHallName
(
entity
.
getHallName
());
windowHallService
.
getDao
().
update
(
windowHallEntity
,
condition
);
windowHallService
.
getDao
().
update
(
windowHallEntity
,
condition
);
}
}
/**
* @param siteHall
* @param context
* @return
*/
@Override
public
Rest
<
List
<
BusinessEntity
>>
getBusinessByHall
(
SiteHallEntity
siteHall
,
Context
context
)
{
if
(
ObjectUtils
.
isEmpty
(
siteHall
.
getId
()))
{
return
Rest
.
fail
(
"大厅ID不能为空!"
);
}
List
<
Long
>
windowIds
=
windowHallService
.
find
(
new
WindowHallQuery
().
hallId
(
siteHall
.
getId
())).
parallelStream
().
map
(
i
->
i
.
getWindowId
()).
distinct
().
collect
(
Collectors
.
toList
());
if
(
ObjectUtils
.
isEmpty
(
windowIds
))
{
return
Rest
.
fail
(
"窗口list不能为空!"
);
}
WindowBusinessQuery
windowBusinessQuery
=
new
WindowBusinessQuery
();
windowBusinessQuery
.
setWindowIdList
(
windowIds
);
List
<
Long
>
siteBusinessIdList
=
windowBusinessService
.
find
(
windowBusinessQuery
).
parallelStream
().
map
(
i
->
i
.
getSiteBusinessId
()).
distinct
().
collect
(
Collectors
.
toList
());
if
(
ObjectUtils
.
isEmpty
(
siteBusinessIdList
))
{
return
Rest
.
fail
(
"站点业务list不能为空!"
);
}
SiteBusinessQuery
siteBusinessQuery
=
new
SiteBusinessQuery
();
siteBusinessQuery
.
setIdList
(
siteBusinessIdList
);
List
<
Long
>
businessIdList
=
siteBusinessService
.
find
(
siteBusinessQuery
).
parallelStream
().
map
(
i
->
i
.
getBusinessId
()).
distinct
().
collect
(
Collectors
.
toList
());
if
(
ObjectUtils
.
isEmpty
(
businessIdList
))
{
return
Rest
.
fail
(
"业务list不能为空!"
);
}
BusinessQuery
businessQuery
=
new
BusinessQuery
();
businessQuery
.
setIdList
(
businessIdList
);
List
<
BusinessEntity
>
businessEntities
=
businessService
.
find
(
businessQuery
);
return
Rest
.
ok
(
businessEntities
);
}
}
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteHallController.java
View file @
d359400b
package
com.mortals.xhx.module.site.web
;
package
com.mortals.xhx.module.site.web
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.base.system.param.service.ParamService
;
import
com.mortals.xhx.module.business.model.BusinessEntity
;
import
com.mortals.xhx.module.site.model.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.module.site.model.SiteHallEntity
;
import
com.mortals.xhx.module.site.service.SiteHallService
;
import
com.mortals.xhx.module.site.service.SiteHallService
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
com.mortals.framework.util.StringUtils
;
import
com.mortals.framework.util.StringUtils
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
import
static
com
.
mortals
.
framework
.
ap
.
SysConstains
.*;
/**
/**
*
* 站点大厅信息
* 站点大厅信息
*
*
* @author zxfei
* @author zxfei
* @date 2023-04-25
* @date 2023-04-25
*/
*/
@RestController
@RestController
@RequestMapping
(
"site/hall"
)
@RequestMapping
(
"site/hall"
)
public
class
SiteHallController
extends
BaseCRUDJsonBodyMappingController
<
SiteHallService
,
SiteHallEntity
,
Long
>
{
public
class
SiteHallController
extends
BaseCRUDJsonBodyMappingController
<
SiteHallService
,
SiteHallEntity
,
Long
>
{
@Autowired
@Autowired
private
ParamService
paramService
;
private
ParamService
paramService
;
public
SiteHallController
(){
public
SiteHallController
()
{
super
.
setModuleDesc
(
"站点大厅信息"
);
super
.
setModuleDesc
(
"站点大厅信息"
);
}
}
@Override
@Override
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"floor"
,
paramService
.
getParamBySecondOrganize
(
"SiteHall"
,
"floor"
));
this
.
addDict
(
model
,
"floor"
,
paramService
.
getParamBySecondOrganize
(
"SiteHall"
,
"floor"
));
this
.
addDict
(
model
,
"build"
,
paramService
.
getParamBySecondOrganize
(
"SiteHall"
,
"build"
));
this
.
addDict
(
model
,
"build"
,
paramService
.
getParamBySecondOrganize
(
"SiteHall"
,
"build"
));
super
.
init
(
model
,
context
);
super
.
init
(
model
,
context
);
}
}
/**
* 根据大厅查询所属业务
*/
@PostMapping
(
value
=
"getBusinessByHall"
)
@UnAuth
public
String
getBusinessByHall
(
@RequestBody
SiteHallEntity
siteHall
)
{
JSONObject
jsonObject
=
new
JSONObject
();
String
busiDesc
=
"根据大厅查询所属业务"
;
try
{
Rest
<
List
<
BusinessEntity
>>
rest
=
this
.
service
.
getBusinessByHall
(
siteHall
,
getContext
());
recordSysLog
(
request
,
busiDesc
+
" 【成功】"
);
jsonObject
.
put
(
KEY_RESULT_DATA
,
rest
.
getData
());
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_SUCCESS
);
jsonObject
.
put
(
KEY_RESULT_MSG
,
busiDesc
+
"成功!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
"获取异常"
,
e
);
jsonObject
.
put
(
KEY_RESULT_CODE
,
VALUE_RESULT_FAILURE
);
jsonObject
.
put
(
KEY_RESULT_MSG
,
super
.
convertException
(
e
));
}
return
jsonObject
.
toJSONString
();
}
}
}
\ No newline at end of file
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