Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
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
项目统一框架
amos-boot-biz
Commits
c5b79747
Commit
c5b79747
authored
Jul 19, 2022
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
检查项接口
parent
edd6eb46
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
30 deletions
+63
-30
Point.java
...c/main/java/com/yeejoin/amos/patrol/dao/entity/Point.java
+20
-0
InputItemController.java
.../amos/patrol/business/controller/InputItemController.java
+31
-24
InputItemParam.java
...om/yeejoin/amos/patrol/business/param/InputItemParam.java
+6
-6
dbTemplate_input_item.xml
...ol/src/main/resources/db/mapper/dbTemplate_input_item.xml
+6
-0
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/dao/entity/Point.java
View file @
c5b79747
...
...
@@ -234,6 +234,26 @@ public class Point extends BasicEntity {
private
String
ue4Rotation
;
public
String
getBizOrgCode
()
{
return
bizOrgCode
;
}
public
void
setBizOrgCode
(
String
bizOrgCode
)
{
this
.
bizOrgCode
=
bizOrgCode
;
}
public
String
getBizOrgName
()
{
return
bizOrgName
;
}
public
void
setBizOrgName
(
String
bizOrgName
)
{
this
.
bizOrgName
=
bizOrgName
;
}
private
String
bizOrgCode
;
private
String
bizOrgName
;
/**
* 物理区域id(数据来源于装备wl_area)
*/
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/InputItemController.java
View file @
c5b79747
...
...
@@ -78,8 +78,13 @@ public class InputItemController extends AbstractBaseController {
public
CommonResponse
queryItemByPageNew
(
@ApiParam
(
value
=
"组合查询条件"
,
required
=
false
,
defaultValue
=
"[]"
)
@RequestBody
(
required
=
false
)
InputItemPageParam
criterias
,
@ApiParam
(
value
=
"分页参数"
,
required
=
false
,
defaultValue
=
"current=0&pageSize=10或pageNumber0&pageSize=10"
)
CommonPageable
pageable
)
{
Page
<
InputItemVo
>
page
=
inputItemService
.
queryInputItemByPageNew
(
criterias
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
ResponseModel
<
Object
>
companyByBizOrgCodeList
=
jcsFeignClient
.
getCompanyByBizOrgCodeList
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
//登录人可看到单位级别下的所有检查项
//查询向上查询所属单位的bizOrgCode
String
bizOrgCode
=
((
Map
<
String
,
Object
>)
companyByBizOrgCodeList
.
getResult
()).
get
(
"bizOrgCode"
).
toString
();
criterias
.
setBizOrgCode
(
bizOrgCode
);
Page
<
InputItemVo
>
page
=
inputItemService
.
queryInputItemByPageNew
(
criterias
);
return
CommonResponseUtil
.
success
(
page
);
}
...
...
@@ -397,9 +402,7 @@ public class InputItemController extends AbstractBaseController {
@ApiOperation
(
value
=
"新增检查项"
,
notes
=
"新增检查项"
)
@RequestMapping
(
value
=
"/addItemNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
addNewItemNew
(
@ApiParam
(
value
=
"检查项信息"
)
@RequestBody
InputItemParam
param
)
{
if
(
ObjectUtils
.
isEmpty
(
param
.
getId
()))
{
return
updateItem
(
param
);
}
AgencyUserModel
user
=
getUserInfo
();
if
(
ObjectUtils
.
isEmpty
(
user
))
{
return
CommonResponseUtil
.
failure
(
"用户session过期"
);
...
...
@@ -410,6 +413,8 @@ public class InputItemController extends AbstractBaseController {
String
loginOrgCode
=
getOrgCode
(
reginParams
);
BeanUtils
.
copyProperties
(
param
,
inputItem
);
inputItem
.
setDataJson
(
param
.
getDataJson
()
!=
null
?
JSONObject
.
toJSONString
(
param
.
getDataJson
())
:
null
);
inputItem
.
setPictureJson
(
param
.
getPictureJson
()
!=
null
?
JSONObject
.
toJSONString
(
param
.
getPictureJson
())
:
null
);
///LoginUserParam loginParam = getLoginUserParam();
ResponseModel
<
Object
>
companyByBizOrgCodeList
=
jcsFeignClient
.
getCompanyByBizOrgCodeList
(
reginParams
.
getPersonIdentity
().
getBizOrgCode
());
String
bizOrgCode
=
((
Map
<
String
,
Object
>)
companyByBizOrgCodeList
.
getResult
()).
get
(
"bizOrgCode"
).
toString
();
...
...
@@ -417,36 +422,38 @@ public class InputItemController extends AbstractBaseController {
inputItem
.
setBizOrgName
(
reginParams
.
getPersonIdentity
().
getCompanyName
()==
null
?
null
:
reginParams
.
getPersonIdentity
().
getCompanyName
());
inputItem
.
setOrgCode
(
loginOrgCode
);
inputItem
.
setCreateBy
(
user
.
getUserId
());
inputItemService
.
addNewInputItem
(
inputItem
);
if
(!
ObjectUtils
.
isEmpty
(
param
.
getId
()))
{
inputItem
.
setId
(
param
.
getId
());
inputItemService
.
updateInputItem
(
inputItem
);
}
else
{
inputItemService
.
addNewInputItem
(
inputItem
);
}
return
CommonResponseUtil
.
success
();
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
"检查项新增失败: "
+
e
.
getMessage
());
}
}
/*******新增接口************/
/**
*
分页查询检查项
*
查询巡检项详情
*
* @param queryRequests
* @param pageable
* @param itemID
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"分页查询检查项"
,
notes
=
"分页查询检查项"
)
@RequestMapping
(
value
=
"/queryItemByPageNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
queryItemByPageNew
(
@ApiParam
(
value
=
"组合查询条件"
,
required
=
false
,
defaultValue
=
"[]"
)
@RequestBody
(
required
=
false
)
List
<
CommonRequest
>
queryRequests
,
@ApiParam
(
value
=
"分页参数"
,
required
=
false
,
defaultValue
=
"current=0&pageSize=10或pageNumber0&pageSize=10"
)
CommonPageable
pageable
)
{
//LoginUserParam user = CurUserCompanyCache.getInstance().getCurCompany(getUserId(), getToken());
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
loginOrgCode
=
getOrgCode
(
reginParams
);
HashMap
<
String
,
Object
>
paramMap
=
new
HashMap
<
String
,
Object
>();
paramMap
.
put
(
"orgCode"
,
loginOrgCode
);
InputItemPageParam
criterias
=
InputItemParamUtil
.
fillInputItemPageParam
(
queryRequests
,
pageable
,
paramMap
);
Page
<
InputItemVo
>
page
=
inputItemService
.
queryInputItemByPage
(
criterias
);
return
CommonResponseUtil
.
success
(
page
);
@ApiOperation
(
value
=
"检查项ID新"
,
notes
=
"检查项详情新"
)
@RequestMapping
(
value
=
"/queryItemNew"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
GET
)
public
CommonResponse
queryItemDetailNew
(
@ApiParam
(
value
=
"巡检项ID"
)
@RequestParam
(
required
=
true
)
Long
itemID
)
{
InputItem
bo
=
inputItemService
.
queryInputItemDetail
(
itemID
);
InputItemParam
inputItemVo
=
new
InputItemParam
();
BeanUtils
.
copyProperties
(
bo
,
inputItemVo
);
inputItemVo
.
setDataJson
(
bo
.
getDataJson
()
!=
null
?
JSONObject
.
parse
(
bo
.
getDataJson
()):
null
);
inputItemVo
.
setPictureJson
(
bo
.
getPictureJson
()!=
null
?
JSONObject
.
parse
(
bo
.
getPictureJson
()):
null
);
return
CommonResponseUtil
.
success
(
inputItemVo
);
}
/*******新增接口************/
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/param/InputItemParam.java
View file @
c5b79747
...
...
@@ -7,7 +7,7 @@ public class InputItemParam {
private
long
id
;
private
long
catalogId
;
private
String
dataJson
;
private
Object
dataJson
;
private
String
defaultValue
;
private
String
inputJson
;
private
String
isMultiline
;
...
...
@@ -17,7 +17,7 @@ public class InputItemParam {
private
String
name
;
private
int
orderNo
;
private
String
orgCode
;
private
String
pictureJson
;
private
Object
pictureJson
;
private
String
remark
;
private
String
level
;
private
String
itemNo
;
...
...
@@ -124,10 +124,10 @@ public class InputItemParam {
public
void
setCatalogId
(
long
catalogId
)
{
this
.
catalogId
=
catalogId
;
}
public
String
getDataJson
()
{
public
Object
getDataJson
()
{
return
dataJson
;
}
public
void
setDataJson
(
String
dataJson
)
{
public
void
setDataJson
(
Object
dataJson
)
{
this
.
dataJson
=
dataJson
;
}
public
String
getDefaultValue
()
{
...
...
@@ -184,10 +184,10 @@ public class InputItemParam {
public
void
setOrgCode
(
String
orgCode
)
{
this
.
orgCode
=
orgCode
;
}
public
String
getPictureJson
()
{
public
Object
getPictureJson
()
{
return
pictureJson
;
}
public
void
setPictureJson
(
String
pictureJson
)
{
public
void
setPictureJson
(
Object
pictureJson
)
{
this
.
pictureJson
=
pictureJson
;
}
public
String
getRemark
()
{
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_input_item.xml
View file @
c5b79747
...
...
@@ -245,6 +245,9 @@
<if
test=
"catalogIds !=null"
>
and a.catalog_id in
<foreach
collection=
"catalogIds"
item=
"catalogId"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{catalogId}
</foreach>
</if>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
<choose>
<when
test=
"level == '-0' "
>
and a.level is null
</when>
<when
test=
"level!=null and level != '-0'"
>
and a.level = #{level}
</when>
...
...
@@ -277,6 +280,9 @@
<if
test=
"catalogIds !=null"
>
and a.catalog_id in
<foreach
collection=
"catalogIds"
item=
"catalogId"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{catalogId}
</foreach>
</if>
<if
test=
"bizOrgCode!=null and bizOrgCode!=''"
>
and a.biz_org_code LIKE CONCAT (#{bizOrgCode},'%')
</if>
<choose>
<when
test=
"level == '-0' "
>
and a.level is null
</when>
<when
test=
"level!=null and level != '-0'"
>
and a.level = #{level}
</when>
...
...
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