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
e3d53c4b
Commit
e3d53c4b
authored
Dec 14, 2023
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jg): 安装告知-详情编辑流程提交
parent
a1047513
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
34 deletions
+85
-34
JgInstallationNoticeDto.java
.../amos/boot/module/jg/api/dto/JgInstallationNoticeDto.java
+24
-15
JgInstallationNoticeMapper.xml
.../src/main/resources/mapper/JgInstallationNoticeMapper.xml
+5
-1
JgInstallationNoticeController.java
...ule/jg/biz/controller/JgInstallationNoticeController.java
+19
-14
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+37
-4
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/JgInstallationNoticeDto.java
View file @
e3d53c4b
...
...
@@ -2,27 +2,28 @@ package com.yeejoin.amos.boot.module.jg.api.dto;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.Getter
;
import
org.springframework.util.StringUtils
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
*
*
* @author system_generator
* @date 2023-12-12
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"JgInstallationNoticeDto"
,
description
=
""
)
public
class
JgInstallationNoticeDto
extends
BaseDto
{
@ApiModel
(
value
=
"JgInstallationNoticeDto"
,
description
=
""
)
public
class
JgInstallationNoticeDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"告知单编号"
)
...
...
@@ -166,13 +167,13 @@ public class JgInstallationNoticeDto extends BaseDto {
private
List
<
Map
<
String
,
String
>>
proxyStatementAttachmentList
;
@ApiModelProperty
(
value
=
"安装合同照片"
)
private
List
<
Map
<
String
,
String
>>
installContractAttachmentList
;
private
List
<
Map
<
String
,
String
>>
installContractAttachmentList
;
@ApiModelProperty
(
value
=
"安装委托书图片"
)
private
String
proxyStatementAttachment
;
@ApiModelProperty
(
value
=
"安装委托书图片"
)
private
String
proxyStatementAttachment
;
@ApiModelProperty
(
value
=
"安装合同照片"
)
private
String
installContractAttachment
;
@ApiModelProperty
(
value
=
"安装合同照片"
)
private
String
installContractAttachment
;
@ApiModelProperty
(
value
=
"是否西咸"
)
private
String
isXixian
;
...
...
@@ -186,15 +187,23 @@ public class JgInstallationNoticeDto extends BaseDto {
@ApiModelProperty
(
value
=
"区名字"
)
private
String
countyName
;
@ApiModelProperty
(
value
=
"市名字"
)
private
String
cityName
;
@ApiModelProperty
(
value
=
"市名字"
)
private
String
cityName
;
@ApiModelProperty
(
value
=
"省名字"
)
private
String
provinceName
;
@ApiModelProperty
(
value
=
"省名字"
)
private
String
provinceName
;
@ApiModelProperty
(
value
=
"完整地址"
)
private
String
fullAddress
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"告知设备列表"
)
private
List
<
Map
<
String
,
Object
>>
deviceList
;
public
String
getFullAddress
()
{
return
(
StringUtils
.
isEmpty
(
this
.
provinceName
)
?
""
:
this
.
provinceName
)
+
(
StringUtils
.
isEmpty
(
this
.
cityName
)
?
""
:
this
.
cityName
)
+
(
StringUtils
.
isEmpty
(
this
.
countyName
)
?
""
:
this
.
countyName
)
+
(
StringUtils
.
isEmpty
(
this
.
address
)
?
""
:
this
.
address
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeMapper.xml
View file @
e3d53c4b
...
...
@@ -12,7 +12,11 @@
isn.region_no AS regionNo,
isn.address AS address,
isn.notice_status AS noticeStatus,
isn.install_unit_name AS installUnitName
isn.install_unit_name AS installUnitName,
isn.province_name AS provinceName,
isn.city_name AS cityName,
isn.county_name AS countyName,
isn.instance_id AS instanceId
FROM
tzs_jg_installation_notice isn
<where>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgInstallationNoticeController.java
View file @
e3d53c4b
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import
cn.hutool.core.bean.BeanUtil
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl
;
...
...
@@ -56,12 +57,12 @@ public class JgInstallationNoticeController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新安装告知"
,
notes
=
"根据sequenceNbr更新安装告知"
)
public
ResponseModel
<
JgInstallationNoticeDto
>
updateBySequenceNbrJgInstallationNotice
(
@RequestBody
Map
<
String
,
Object
>
model
)
{
public
ResponseModel
<
JgInstallationNoticeDto
>
updateBySequenceNbrJgInstallationNotice
(
@RequestBody
Map
<
String
,
Object
>
model
,
@RequestParam
(
"op"
)
String
op
)
{
JgInstallationNoticeDto
installationInfo
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"installationInfo"
)),
JgInstallationNoticeDto
.
class
,
true
);
if
(
Objects
.
isNull
(
installationInfo
))
{
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
}
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
updateInstallationNotice
(
installationInfo
));
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
updateInstallationNotice
(
installationInfo
,
op
));
}
/**
...
...
@@ -77,6 +78,22 @@ public class JgInstallationNoticeController extends BaseController {
}
/**
* 根据sequenceNbr批量删除
*
* @param sequenceNbrs 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/batchDelete"
)
@ApiOperation
(
value
=
"根据sequenceNbr删除维保合同备案"
,
notes
=
"根据sequenceNbr删除维保合同备案"
)
public
ResponseModel
<
Boolean
>
deleteForBatch
(
@RequestParam
(
"sequenceNbrs"
)
Long
[]
sequenceNbrs
)
{
try
{
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
deleteForBatch
(
sequenceNbrs
));
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
...
...
@@ -89,18 +106,6 @@ public class JgInstallationNoticeController extends BaseController {
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
queryBySequenceNbr
(
sequenceNbr
));
}
/**
* 根据sequenceNbr批量删除
*
* @param sequenceNbrs 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/batchDelete"
)
@ApiOperation
(
value
=
"根据sequenceNbr删除维保合同备案"
,
notes
=
"根据sequenceNbr删除维保合同备案"
)
public
ResponseModel
<
Boolean
>
deleteForBatch
(
@RequestParam
(
"sequenceNbrs"
)
Long
[]
sequenceNbrs
)
{
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
deleteForBatch
(
sequenceNbrs
));
}
/**
* 列表分页查询
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
View file @
e3d53c4b
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
...
...
@@ -13,12 +15,14 @@ import com.yeejoin.amos.boot.module.jg.biz.service.ICommonService;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.AjaxResult
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.*
;
...
...
@@ -37,8 +41,6 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
JgRelationEquipMapper
jgRelationEquipMapper
;
@Autowired
private
JgInstallationNoticeMapper
jgInstallationNoticeMapper
;
@Autowired
private
ICommonService
commonService
;
/**
* 根据sequenceNbr查询
...
...
@@ -70,7 +72,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @param noticeDto 安装告知
*/
@SuppressWarnings
(
"rawtypes"
)
public
JgInstallationNoticeDto
updateInstallationNotice
(
JgInstallationNoticeDto
noticeDto
)
{
public
JgInstallationNoticeDto
updateInstallationNotice
(
JgInstallationNoticeDto
noticeDto
,
String
op
)
{
this
.
convertField
(
noticeDto
);
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
...
...
@@ -82,12 +84,38 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
noticeDto
.
setInstanceId
(
instanceId
);
noticeDto
.
setStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
noticeDto
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
JgInstallationNotice
bean
=
new
JgInstallationNotice
();
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
jgInstallationNoticeMapper
.
updateById
(
bean
);
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
noticeDto
.
getInstanceId
());
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
//组装信息
TaskResultDTO
taskResultDTO
=
new
TaskResultDTO
();
taskResultDTO
.
setResultCode
(
"approvalStatus"
);
taskResultDTO
.
setTaskId
(
taskId
);
taskResultDTO
.
setComment
(
"提交流程"
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
op
);
taskResultDTO
.
setVariable
(
map
);
//执行流程
AjaxResult
ajaxResult1
;
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
taskResultDTO
);
if
(
ObjectUtils
.
isEmpty
(
ajaxResult1
))
{
noticeDto
.
setStatus
(
String
.
valueOf
(
FlowStatusEnum
.
REJECTED
.
getCode
()));
JgInstallationNotice
bean
=
new
JgInstallationNotice
();
BeanUtils
.
copyProperties
(
dto
,
bean
);
jgInstallationNoticeMapper
.
updateById
(
bean
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
return
noticeDto
;
}
...
...
@@ -138,7 +166,12 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
return
false
;
}
Collection
<
JgInstallationNotice
>
jgInstallationNotices
=
this
.
listByIds
(
Arrays
.
asList
(
sequenceNbrs
));
jgInstallationNotices
.
forEach
(
notice
->
notice
.
setIsDelete
(
true
));
jgInstallationNotices
.
forEach
(
notice
->
{
if
(
StringUtils
.
hasText
(
notice
.
getInspectUnitId
()))
{
throw
new
IllegalStateException
(
"所选数据已存在流程,不能删除!"
);
}
notice
.
setIsDelete
(
true
);
});
return
this
.
updateBatchById
(
jgInstallationNotices
);
}
...
...
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