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
5fef46ae
Commit
5fef46ae
authored
Oct 19, 2022
by
wanglong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
b147a245
4eb6805e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
91 additions
and
21 deletions
+91
-21
InstallNoticeController.java
...ot/module/ugp/biz/controller/InstallNoticeController.java
+91
-21
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/InstallNoticeController.java
View file @
5fef46ae
...
...
@@ -3,14 +3,14 @@ package com.yeejoin.amos.boot.module.ugp.biz.controller;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.NoticeStatusEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticePageDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.*
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.InstallNotice
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.InstallNoticeMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl
;
import
org.apache.poi.ss.formula.functions.T
;
...
...
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -31,9 +32,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.InstallNoticeDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
springfox.documentation.spring.web.json.Json
;
/**
* 安装告知表
...
...
@@ -58,6 +59,9 @@ public class InstallNoticeController extends BaseController {
@Autowired
ProjectServiceImpl
projectServiceImpl
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
/**
* 新增安装告知表
...
...
@@ -186,8 +190,9 @@ public class InstallNoticeController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PutMapping
(
value
=
"/submit/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"put"
,
value
=
"根据sequenceNbr更新提交申请"
,
notes
=
"根据sequenceNbr更新提交申请"
)
public
ResponseModel
<
InstallNoticeDto
>
InstallNoticeSubmit
(
@RequestBody
InstallNoticeDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
if
(
model
.
getNoticeStatus
().
isEmpty
()){
public
ResponseModel
<
InstallNoticeDto
>
InstallNoticeSubmit
(
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
final
InstallNoticeDto
model
=
installNoticeServiceImpl
.
selectOneById
(
sequenceNbr
);
if
(
model
.
getNoticeStatus
().
equals
(
"已保存"
)){
model
.
setNoticeStatus
(
"已提交"
);
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateWithModel
(
model
));
}
...
...
@@ -205,28 +210,93 @@ public class InstallNoticeController extends BaseController {
public
ResponseModel
<
InstallNoticeDto
>
saveInstallNotice
(
@RequestBody
JSONObject
object
,
@RequestParam
(
required
=
false
)
String
noticeStatus
)
{
InstallNoticeDto
installNoticeDto
=
new
InstallNoticeDto
();
final
ProjectDto
projectDto
=
projectMapper
.
selectOneByName
((
String
)
object
.
get
(
"name"
));
installNoticeDto
.
setProjectId
(
projectDto
.
getSequenceNbr
());
// final ProjectDto projectDto = projectServiceImpl.queryBySeq(object.getLong("name"));
installNoticeDto
.
setProjectId
(
object
.
getLong
(
"name"
));
installNoticeDto
.
setNoticeStatus
(
noticeStatus
);
installNoticeDto
.
setNoticeDate
(
new
Date
());
installNoticeDto
.
setApproved
(
false
);
// installNoticeDto.setOrganizationCode(orgServiceImpl.getOrgUsr().getBizOrgCode());
installNoticeDto
.
setLicenseNum
(
object
.
getString
(
"licenseNum"
));
installNoticeDto
.
setLicenseCompany
(
object
.
getString
(
"licenseCompany"
));
final
JSONArray
licenseAttch
=
object
.
getJSONArray
(
"licenseAttch"
);
final
JSONArray
contractAttch
=
object
.
getJSONArray
(
"contractAttch"
);
final
JSONArray
subForm
=
object
.
getJSONArray
(
"subForm"
);
installNoticeDto
.
setLicenseAttch
(
JSON
.
toJSONString
(
licenseAttch
));
installNoticeDto
.
setContractAttch
(
JSON
.
toJSONString
(
contractAttch
));
// projectInitiationServiceImpl.execute(projectDto.getInstanceId(),installNoticeDto,"1");
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
createWithModel
(
installNoticeDto
));
}
/**
* 根据sequenceNbr查询安装告知信息及附件
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/message/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr安装告知信息"
,
notes
=
"根据sequenceNbr安装告知信息"
)
public
ResponseModel
<
JSONObject
>
selectOneBySeq
(
@PathVariable
Long
sequenceNbr
)
{
final
InstallNoticeDto
installNoticeDto
=
installNoticeServiceImpl
.
selectOneById
(
sequenceNbr
);
final
ProjectDto
projectDto
=
projectServiceImpl
.
queryBySeq
(
installNoticeDto
.
getProjectId
());
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"name"
,
projectDto
.
getSequenceNbr
());
jsonObject
.
put
(
"installRegion"
,
projectDto
.
getInstallRegion
());
jsonObject
.
put
(
"licenseNum"
,
installNoticeDto
.
getLicenseNum
());
jsonObject
.
put
(
"licenseCompany"
,
installNoticeDto
.
getLicenseCompany
());
jsonObject
.
put
(
"licenseAttch"
,
JSON
.
parseArray
(
installNoticeDto
.
getLicenseAttch
()));
jsonObject
.
put
(
"contractAttch"
,
JSON
.
parseArray
(
installNoticeDto
.
getContractAttch
()));
return
ResponseHelper
.
buildResponse
(
jsonObject
);
}
/**
* 根据sequenceNbr修改安装告知信息及附件
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PutMapping
(
value
=
"/message/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"put"
,
value
=
"根据sequenceNbr安装告知信息"
,
notes
=
"根据sequenceNbr安装告知信息"
)
public
ResponseModel
<
InstallNoticeDto
>
updateOneBySeq
(
@PathVariable
Long
sequenceNbr
,
@RequestBody
JSONObject
object
,
@RequestParam
(
required
=
false
)
String
noticeStatus
)
{
final
InstallNoticeDto
installNoticeDto
=
installNoticeServiceImpl
.
selectOneById
(
sequenceNbr
);
if
(
installNoticeDto
.
getNoticeStatus
().
equals
(
"已保存"
)){
installNoticeDto
.
setNoticeStatus
(
noticeStatus
);
}
installNoticeDto
.
setProjectId
(
object
.
getLong
(
"name"
));
installNoticeDto
.
setLicenseNum
(
object
.
getString
(
"licenseNum"
));
installNoticeDto
.
setLicenseCompany
(
object
.
getString
(
"licenseCompany"
));
for
(
Object
o:
subForm
){
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
o
));
final
JSONArray
licenseAttch
=
jsonObject
.
getJSONArray
(
"licenseAttch"
);
final
JSONArray
contractAttch
=
jsonObject
.
getJSONArray
(
"contractAttch"
);
installNoticeDto
.
setLicenseAttch
(
JSON
.
toJSONString
(
licenseAttch
));
installNoticeDto
.
setContractAttch
(
JSON
.
toJSONString
(
contractAttch
));
break
;
}
projectInitiationServiceImpl
.
execute
(
projectDto
.
getInstanceId
(),
installNoticeDto
,
"1"
);
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
createWithModel
(
installNoticeDto
));
final
JSONArray
licenseAttch
=
object
.
getJSONArray
(
"licenseAttch"
);
final
JSONArray
contractAttch
=
object
.
getJSONArray
(
"contractAttch"
);
installNoticeDto
.
setLicenseAttch
(
JSON
.
toJSONString
(
licenseAttch
));
installNoticeDto
.
setContractAttch
(
JSON
.
toJSONString
(
contractAttch
));
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
updateWithModel
(
installNoticeDto
));
}
/**
* 根据sequenceNbr删除安装告知表
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@DeleteMapping
(
value
=
"message/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除安装告知表"
,
notes
=
"根据sequenceNbr删除安装告知表"
)
public
ResponseModel
<
Boolean
>
deleteBySeq
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
final
InstallNoticeDto
installNoticeDto
=
installNoticeServiceImpl
.
selectOneById
(
sequenceNbr
);
final
String
noticeStatus
=
installNoticeDto
.
getNoticeStatus
();
if
(
noticeStatus
.
equals
(
"已提交"
)||
noticeStatus
.
equals
(
"已保存"
)){
return
ResponseHelper
.
buildResponse
(
installNoticeServiceImpl
.
removeById
(
sequenceNbr
));
}
return
null
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/acceptNotification"
)
@ApiOperation
(
httpMethod
=
"get"
,
value
=
"接受告知"
,
notes
=
"接受告知"
)
...
...
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