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
cfca91a1
Commit
cfca91a1
authored
Dec 19, 2023
by
王果
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
维修告知接口调整
parent
bb8b7d89
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
217 additions
and
107 deletions
+217
-107
JgMaintainNoticeDto.java
...join/amos/boot/module/jg/api/dto/JgMaintainNoticeDto.java
+26
-0
JgMaintainNotice.java
...join/amos/boot/module/jg/api/entity/JgMaintainNotice.java
+29
-0
MaintainTypeEnum.java
...ejoin/amos/boot/module/jg/api/enums/MaintainTypeEnum.java
+37
-0
JgMaintainNoticeMapper.xml
...-api/src/main/resources/mapper/JgMaintainNoticeMapper.xml
+35
-17
JgMaintainByWorkFlowController.java
...ule/jg/biz/controller/JgMaintainByWorkFlowController.java
+13
-13
JgMaintainNoticeController.java
.../module/jg/biz/controller/JgMaintainNoticeController.java
+5
-5
JgMaintainNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgMaintainNoticeServiceImpl.java
+72
-72
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/JgMaintainNoticeDto.java
View file @
cfca91a1
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
;
...
...
@@ -29,11 +30,15 @@ public class JgMaintainNoticeDto extends BaseDto {
private
String
applyNo
;
@ApiModelProperty
(
value
=
"告知日期"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
noticeDate
;
@ApiModelProperty
(
value
=
"告知状态"
)
private
String
noticeStatus
;
@ApiModelProperty
(
value
=
"告知状态名称"
)
private
String
noticeStatusDesc
;
@ApiModelProperty
(
value
=
"施工单位统一信用代码"
)
private
String
installUnitCreditCode
;
...
...
@@ -68,6 +73,7 @@ public class JgMaintainNoticeDto extends BaseDto {
private
String
instanceStatus
;
@ApiModelProperty
(
value
=
"受理完成日期"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
acceptDate
;
@ApiModelProperty
(
value
=
"施工区域-省"
)
...
...
@@ -86,6 +92,7 @@ public class JgMaintainNoticeDto extends BaseDto {
private
String
address
;
@ApiModelProperty
(
value
=
"计划施工日期"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
private
Date
planDate
;
@ApiModelProperty
(
value
=
"接收机构单位代码"
)
...
...
@@ -148,4 +155,23 @@ public class JgMaintainNoticeDto extends BaseDto {
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"告知设备列表"
)
private
List
<
Map
<
String
,
Object
>>
deviceList
;
@ApiModelProperty
(
value
=
"设备使用地点-街道(镇)"
)
private
String
factoryUseSiteStreet
;
@ApiModelProperty
(
value
=
"完整地址"
)
private
String
fullAddress
;
;
@ApiModelProperty
(
value
=
"区名字"
)
private
String
countyName
;
@ApiModelProperty
(
value
=
"市名字"
)
private
String
cityName
;
@ApiModelProperty
(
value
=
"省名字"
)
private
String
provinceName
;
@ApiModelProperty
(
value
=
"街道名字"
)
private
String
streetName
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/entity/JgMaintainNotice.java
View file @
cfca91a1
...
...
@@ -120,24 +120,47 @@ public class JgMaintainNotice extends BaseEntity {
private
String
province
;
/**
* 施工区域-省
*/
@TableField
(
"province_name"
)
private
String
provinceName
;
/**
* 施工区域-市
*/
@TableField
(
"city"
)
private
String
city
;
/**
* 施工区域-市
*/
@TableField
(
"city_name"
)
private
String
cityName
;
/**
* 施工区域-区/县
*/
@TableField
(
"county"
)
private
String
county
;
/**
* 施工区域-区/县
*/
@TableField
(
"county_name"
)
private
String
countyName
;
/**
* 施工区域-街道(镇)
*/
@TableField
(
"street"
)
private
String
street
;
/**
* 施工区域-街道(镇)
*/
@TableField
(
value
=
"street_name"
)
private
String
streetName
;
/**
* 施工设备详细地址
*/
@TableField
(
"address"
)
...
...
@@ -251,4 +274,10 @@ public class JgMaintainNotice extends BaseEntity {
@TableField
(
"receive_org_code"
)
private
String
receiveOrgCode
;
/**
* 施工区域-街道(镇)
*/
@TableField
(
value
=
"factory_use_site_street"
)
private
String
factoryUseSiteStreet
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/MaintainTypeEnum.java
0 → 100644
View file @
cfca91a1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
;
/**
* 办理状态枚举
*/
public
enum
MaintainTypeEnum
{
GENERAL
(
1
,
"一般维修"
),
PRIORITY
(
2
,
"重点维修"
);
private
final
int
code
;
private
final
String
name
;
MaintainTypeEnum
(
int
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
static
String
getNameByType
(
Long
code
)
{
String
name
=
null
;
for
(
MaintainTypeEnum
enumOne
:
MaintainTypeEnum
.
values
())
{
if
(
enumOne
.
getCode
()
==
code
)
{
name
=
enumOne
.
getName
();
break
;
}
}
return
name
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgMaintainNoticeMapper.xml
View file @
cfca91a1
...
...
@@ -6,23 +6,28 @@
select
tjmn.sequence_nbr AS sequenceNbr,
tjmn.apply_no AS applyNo,
tjmn.supervisory_code AS supervisoryCode,
tjmn.notice_date AS noticeDate,
tjmn.use_unit_name AS useUnitName,
tjmn.receive_org_name AS receiveOrgName,
tjmn.region_no AS regionNo,
tjmn.address AS address,
tjmn.notice_status AS noticeStatus,
tjmn.install_unit_name AS installUnitName,
tjmn.province,
tjmn.city,
tjmn.county,
tjmn.factory_use_site_street,
tjmn.street_name,
tjmn.street,
tjmn.maintain_type,
tjmn.plan_date,
tjmn.province_name AS provinceName,
tjmn.city_name AS cityName,
tjmn.county_name AS countyName,
tjmn.instance_id AS instanceId,
tjmn.notice_report_url AS noticeReportUrl
tjmn.instance_id AS instanceId
FROM
tzs_jg_maintain_notice tjmn
<where>
tjmn.is_delete =
false
tjmn.is_delete =
0
<if
test=
"param != null "
>
<if
test=
"param.applyNo != null and param.applyNo != ''"
>
AND tjmn.apply_no LIKE CONCAT('%', #{param.applyNo}, '%')
...
...
@@ -40,12 +45,13 @@
AND tjmn.notice_status = #{param.noticeStatus}
</if>
</if>
<if
test=
"type == 'supervision'"
>
AND (tjmn.notice_status in ('6612', '6613', '6614') or tjmn.status in('6614') )
</if>
<if
test=
"orgCode != null and orgCode != ''"
>
AND tjmn.install_unit_credit_code = #{orgCode}
</if>
<!-- <if test="type == 'supervision'">-->
<!-- AND (tjmn.notice_status in ('6612', '6613', '6614') or tjmn.status in('6614') )-->
<!-- AND tjmn.receive_org_credit_code = #{orgCode}-->
<!-- </if>-->
<!-- <if test="type == 'enterprise'">-->
<!-- AND tjmn.install_unit_credit_code = #{orgCode}-->
<!-- </if>-->
</where>
ORDER BY
tjmn.notice_date DESC
...
...
@@ -54,13 +60,25 @@
<select
id=
"queryEquipInformation"
resultType=
"java.util.Map"
>
select
tjmn.sequence_nbr AS sequenceNbr,
tjmn.install_unit_name AS installUnitName,
tjmn.apply_no AS applyNo,
tjmn.province,
tjmn.city AS cityName,
tjmn.county AS countyName,
tjmn.address AS address,
tjmn.notice_date AS noticeDate,
tjmn.use_unit_name AS useUnitName,
tjmn.receive_org_name AS receiveOrgName,
tjmn.address AS address,
tjmn.notice_status AS noticeStatus,
tjmn.install_unit_name AS installUnitName,
tjmn.province,
tjmn.city,
tjmn.county,
tjmn.factory_use_site_street,
tjmn.street_name,
tjmn.street,
tjmn.maintain_type,
tjmn.plan_date,
tjmn.province_name AS provinceName,
tjmn.city_name AS cityName,
tjmn.county_name AS countyName,
tjmn.instance_id AS instanceId,
ri.equ_list AS equList,
ri.equ_category AS equCategory,
ri.EQU_DEFINE AS equDefine,
...
...
@@ -97,7 +115,7 @@
ui.ADDRESS AS useUnitAddress
FROM
tzs_jg_maintain_notice tjmn
LEFT JOIN tzs_jg_
installatio
n_notice_eq re ON re.equip_transfer_id = tjmn.sequence_nbr
LEFT JOIN tzs_jg_
maintai
n_notice_eq re ON re.equip_transfer_id = tjmn.sequence_nbr
LEFT JOIN idx_biz_jg_register_info ri ON ri.record = re.equ_id
LEFT JOIN idx_biz_jg_design_info di ON di.record = re.equ_id
LEFT JOIN idx_biz_jg_factory_info fi ON fi.record = re.equ_id
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgMaintainByWorkFlowController.java
View file @
cfca91a1
...
...
@@ -34,19 +34,19 @@ public class JgMaintainByWorkFlowController {
@Autowired
JgMaintainNoticeServiceImpl
jgMaintainNoticeServiceImpl
;
/**
* 提交
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/submit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"维修告知提交"
,
notes
=
"维修告知提交"
)
public
ResponseModel
<
JgMaintainNoticeDto
>
submit
(
@RequestBody
JgMaintainNoticeDto
model
,
String
op
)
{
// TODO 发起维修告知流程
// jgMaintainNoticeServiceImpl.submit(model, op);
return
ResponseHelper
.
buildResponse
(
model
);
}
//
/**
//
* 提交
//
*
//
* @return
//
*/
//
@TycloudOperation(ApiLevel = UserType.AGENCY)
//
@PostMapping(value = "/submit")
//
@ApiOperation(httpMethod = "POST", value = "维修告知提交", notes = "维修告知提交")
//
public ResponseModel<JgMaintainNoticeDto> submit(@RequestBody JgMaintainNoticeDto model, String op) {
//
// TODO 发起维修告知流程
//
// jgMaintainNoticeServiceImpl.submit(model, op);
//
return ResponseHelper.buildResponse(model);
//
}
/**
* 撤销
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgMaintainNoticeController.java
View file @
cfca91a1
...
...
@@ -37,6 +37,7 @@ public class JgMaintainNoticeController extends BaseController {
@Autowired
private
IJgMaintainNoticeService
iJgMaintainNoticeService
;
private
static
final
String
TABLE_PAGE_ID
=
"1734141426742095873"
;
/**
* 新增
*
...
...
@@ -61,12 +62,12 @@ public class JgMaintainNoticeController extends BaseController {
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新维修告知"
,
notes
=
"根据sequenceNbr更新维修告知"
)
public
ResponseModel
<
JgMaintainNoticeDto
>
updateBySequenceNbrJgMaintainNotice
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
Object
>
model
,
@RequestParam
(
value
=
"op"
,
required
=
false
)
String
op
)
{
JgMaintainNoticeDto
maintainInfo
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"maintainInfo"
)),
JgMaintainNoticeDto
.
class
,
true
);
JgMaintainNoticeDto
maintainInfo
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
TABLE_PAGE_ID
)),
JgMaintainNoticeDto
.
class
,
true
);
if
(
Objects
.
isNull
(
maintainInfo
))
{
throw
new
IllegalArgumentException
(
"参数maintainInfo不能为空"
);
}
Object
o
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
"maintainInfo"
)).
get
(
"proxyStatementAttachmen
t"
);
Object
o1
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
"maintainInfo"
)).
get
(
"installContractAttachmen
t"
);
Object
o
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
TABLE_PAGE_ID
)).
get
(
"constructionContractLis
t"
);
Object
o1
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
TABLE_PAGE_ID
)).
get
(
"powerOfAttorneyLis
t"
);
maintainInfo
.
setConstructionContractList
((
List
<
Map
<
String
,
Object
>>)
o
);
maintainInfo
.
setPowerOfAttorneyList
((
List
<
Map
<
String
,
Object
>>)
o1
);
return
ResponseHelper
.
buildResponse
(
iJgMaintainNoticeService
.
updateMaintainNotice
(
submitType
,
maintainInfo
,
op
));
...
...
@@ -113,7 +114,6 @@ public class JgMaintainNoticeController extends BaseController {
return
ResponseHelper
.
buildResponse
(
iJgMaintainNoticeService
.
queryBySequenceNbr
(
sequenceNbr
));
}
/**
* 列表分页查询
*
...
...
@@ -123,7 +123,7 @@ public class JgMaintainNoticeController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"维修告知分页查询"
,
notes
=
"维修告知分页查询"
)
@ApiOperation
(
httpMethod
=
"
POS
T"
,
value
=
"维修告知分页查询"
,
notes
=
"维修告知分页查询"
)
public
ResponseModel
<
Page
<
JgMaintainNoticeDto
>>
queryForPage
(
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
...
...
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/JgMaintainNoticeServiceImpl.java
View file @
cfca91a1
...
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.module.jg.api.dto.JgMaintainNoticeDto;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNotice
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgMaintainNoticeEq
;
import
com.yeejoin.amos.boot.module.jg.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.MaintainTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgMaintainNoticeMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService
;
...
...
@@ -50,8 +51,6 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.function.Function
;
...
...
@@ -115,23 +114,25 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
return
null
;
}
Map
<
String
,
Object
>
maintainInfo
=
BeanUtil
.
beanToMap
(
notice
);
maintainInfo
.
put
(
"province"
,
notice
.
getProvince
()
+
"_"
+
notice
.
getProvince
());
maintainInfo
.
put
(
"city"
,
notice
.
getCity
()
+
"_"
+
notice
.
getCity
());
maintainInfo
.
put
(
"county"
,
notice
.
getCounty
()
+
"_"
+
notice
.
getCounty
());
maintainInfo
.
put
(
"powerOfAttorneyList"
,
JSON
.
parseArray
(
notice
.
getPowerOfAttorney
()));
maintainInfo
.
put
(
"constructionContractList"
,
JSON
.
parseArray
(
notice
.
getConstructionContract
()));
maintainInfo
.
put
(
"province"
,
notice
.
getProvince
()
+
"_"
+
notice
.
getProvinceName
());
maintainInfo
.
put
(
"city"
,
notice
.
getCity
()
+
"_"
+
notice
.
getCityName
());
maintainInfo
.
put
(
"county"
,
notice
.
getCounty
()
+
"_"
+
notice
.
getCountyName
());
maintainInfo
.
put
(
"fullAddress"
,
notice
.
getProvinceName
()
+
notice
.
getCityName
()
+
notice
.
getCityName
()
+
notice
.
getStreetName
()
+
notice
.
getAddress
());
maintainInfo
.
put
(
"useUnitCreditCode"
,
notice
.
getUseUnitCreditCode
()
+
"_"
+
notice
.
getUseUnitName
());
maintainInfo
.
put
(
"receiveOrgC
reditC
ode"
,
notice
.
getReceiveOrgCode
()
+
"_"
+
notice
.
getReceiveOrgName
());
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getInspectionUnitCreditCode
())
&&
ValidationUtil
.
isEmpty
(
notice
.
getInspectionUnitName
()))
{
maintainInfo
.
put
(
"receiveOrgCode"
,
notice
.
getReceiveOrgCode
()
+
"_"
+
notice
.
getReceiveOrgName
());
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getInspectionUnitCreditCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getInspectionUnitName
()))
{
maintainInfo
.
put
(
"inspectUnitId"
,
notice
.
getInspectionUnitCreditCode
()
+
"_"
+
notice
.
getInspectionUnitName
());
}
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getStreet
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getStreetName
()))
{
maintainInfo
.
put
(
"street"
,
notice
.
getStreet
()
+
"_"
+
notice
.
getStreetName
());
}
String
[]
fields
=
{
"productPhoto"
,
"designDoc"
,
"designStandard"
,
"factoryStandard"
,
"productQualityYieldProve"
,
"insUseMaintainExplain"
,
"inspectReport"
,
"proxyStatementAttachment"
,
"installContractAttachment"
};
// 设备信息
List
<
Map
<
String
,
Object
>>
equipmentInfos
=
jgMaintainNoticeMapper
.
queryEquipInformation
(
sequenceNbr
);
for
(
String
s
:
fields
)
{
if
(
maintainInfo
.
containsKey
(
s
))
{
maintainInfo
.
put
(
s
,
JSON
.
parseArray
(
maintainInfo
.
get
(
s
).
toString
()));
...
...
@@ -141,7 +142,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
}
}
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
this
.
put
(
"maintainInfo"
,
maintainInfo
);
this
.
put
(
TABLE_PAGE_ID
,
maintainInfo
);
this
.
put
(
"equipmentInfo"
,
equipmentInfos
.
get
(
0
));
}};
}
...
...
@@ -156,16 +157,14 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
if
(
Objects
.
isNull
(
noticeDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
// 字段转换
this
.
convertField
(
noticeDto
);
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
AjaxResult
ajaxResult
;
// 发起流程
if
(!
StringUtils
.
hasText
(
noticeDto
.
getInstanceId
()))
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
"maintainNoti
fication
"
);
dto
.
setProcessDefinitionKey
(
"maintainNoti
ce
"
);
dto
.
setBusinessKey
(
"1"
);
try
{
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
...
...
@@ -175,7 +174,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
log
.
error
(
"提交失败:{}"
,
e
);
}
}
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
noticeDto
.
getInstanceId
());
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
...
...
@@ -219,17 +217,9 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
*/
@Override
public
Page
<
JgMaintainNoticeDto
>
queryForJgMaintainNoticePage
(
Page
<
JgMaintainNotice
>
page
,
JgMaintainNoticeDto
model
,
String
type
,
ReginParams
reginParams
)
{
String
orgCode
;
if
(
type
.
equals
(
"enterprise"
))
{
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
}
else
{
orgCode
=
reginParams
.
getCompany
().
getOrgCode
();
}
orgCode
=
reginParams
.
getCompany
().
getOrgCode
();
Page
<
JgMaintainNotice
>
noticePage
=
jgMaintainNoticeMapper
.
queryForPage
(
page
,
model
,
type
,
orgCode
);
// 将Page<JgMaintainNotice>转化为Page<JgMaintainNoticeDto>
Page
<
JgMaintainNoticeDto
>
noticeDtoPage
=
new
Page
<>();
BeanUtils
.
copyProperties
(
noticePage
,
noticeDtoPage
,
"records"
);
List
<
JgMaintainNoticeDto
>
records
=
noticePage
.
getRecords
().
stream
().
map
(
notice
->
{
...
...
@@ -237,12 +227,16 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
BeanUtils
.
copyProperties
(
notice
,
noticeDto
);
if
(
Objects
.
nonNull
(
notice
.
getNoticeStatus
()))
{
String
noticeStatusDesc
=
FlowStatusEnum
.
getNameByType
(
Long
.
valueOf
(
notice
.
getNoticeStatus
()));
noticeDto
.
setNoticeStatus
(
noticeStatusDesc
);
noticeDto
.
setNoticeStatusDesc
(
noticeStatusDesc
);
}
if
(
Objects
.
nonNull
(
notice
.
getMaintainType
()))
{
String
maintainType
=
MaintainTypeEnum
.
getNameByType
(
Long
.
valueOf
(
notice
.
getMaintainType
()));
noticeDto
.
setMaintainType
(
maintainType
);
}
noticeDto
.
setFullAddress
(
notice
.
getProvinceName
()
+
notice
.
getCityName
()
+
notice
.
getCityName
()
+
notice
.
getStreetName
()
+
notice
.
getAddress
());
return
noticeDto
;
}).
collect
(
java
.
util
.
stream
.
Collectors
.
toList
());
noticeDtoPage
.
setRecords
(
records
);
return
noticeDtoPage
;
}
...
...
@@ -324,28 +318,29 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
placeholders
.
put
(
"qrCode"
,
qrCode
);
// word转pdf
File
pdfFile
;
try
{
pdfFile
=
this
.
wordToPdf
(
"maintai
n-notification-report.ftl"
,
placeholders
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
// 上传pdf至文件服务器
String
url
=
this
.
uploadFile
(
pdfFile
);
// 删除临时文件
try
{
Files
.
deleteIfExists
(
pdfFile
.
toPath
());
}
catch
(
IOException
e
)
{
log
.
error
(
"删除临时文件失败:{}"
,
e
);
}
//
File pdfFile;
//
try {
// pdfFile = this.wordToPdf("installatio
n-notification-report.ftl", placeholders);
//
} catch (Exception e) {
//
throw new RuntimeException(e);
//
}
//
//
// 上传pdf至文件服务器
//
String url = this.uploadFile(pdfFile);
//
//
// 删除临时文件
//
try {
//
Files.deleteIfExists(pdfFile.toPath());
//
} catch (IOException e) {
//
log.error("删除临时文件失败:{}", e);
//
}
// 更新到数据库
// jgMaintainNotice.setNoticeReportUrl(url);
// this.updateById(jgMaintainNotice);
return
url
;
// return url;
return
""
;
}
/**
...
...
@@ -370,7 +365,6 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
*/
private
String
uploadFile
(
File
file
)
{
Assert
.
notNull
(
file
,
"文件不能为空"
);
MultipartFile
multipartFile
=
new
ByteArrayMultipartFile
(
"file"
,
"file.pdf"
,
"application/pdf"
,
file2byte
(
file
));
FeignClientResult
<
Map
<
String
,
String
>>
result
=
Systemctl
.
fileStorageClient
.
updateCommonFile
(
multipartFile
);
String
urlString
=
""
;
...
...
@@ -397,11 +391,10 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
}
// 获取告知单号
List
<
String
>
applyNoList
=
iCreateCodeService
.
createApplicationFormCode
(
ApplicationFormTypeEnum
.
AZ
GZ
.
getCode
(),
deviceList
.
size
());
List
<
String
>
applyNoList
=
iCreateCodeService
.
createApplicationFormCode
(
ApplicationFormTypeEnum
.
WX
GZ
.
getCode
(),
deviceList
.
size
());
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
return
;
}
// 判断当前是否为提交
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
...
...
@@ -409,8 +402,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
// ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
deviceList
.
size
();
i
++
)
{
for
(
int
i
=
0
;
i
<
deviceList
.
size
();
i
++)
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
i
));
...
...
@@ -422,8 +414,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
try
{
FeignClientResult
result
=
Workflow
.
taskV2Client
.
startByVariableBatch
(
actWorkflowBatchDTO
);
List
<
Object
>
returnList
=
(
List
<
Object
>)
result
.
getResult
();
for
(
Object
obj
:
returnList
)
{
for
(
Object
obj
:
returnList
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
instanceIdList
.
add
(
jsonObject
.
getString
(
"id"
));
}
...
...
@@ -456,21 +447,19 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
list
.
add
(
dto
);
equipList
.
add
(
jgRelationEquip
);
});
jgMaintainNoticeMapper
.
insertBatchSomeColumn
(
list
);
List
<
JgMaintainNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgMaintainNotice
>
collect
=
list
.
stream
().
filter
(
jgMaintainNotice
->
jgRelationEquip
.
getEquipTransferId
().
equals
(
jgMaintainNotice
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
Long
sequenceNbr
=
collect
.
get
(
0
).
getSequenceNbr
();
return
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
));
}).
collect
(
Collectors
.
toList
());
jgMaintainNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
}
private
void
convertField
(
JgMaintainNoticeDto
model
)
{
// 处理图片
if
(
null
==
model
)
return
;
// 处理附件
if
(!
ValidationUtil
.
isEmpty
(
model
.
getPowerOfAttorneyList
()))
{
model
.
setPowerOfAttorney
(
JSON
.
toJSONString
(
model
.
getPowerOfAttorneyList
()));
}
...
...
@@ -478,13 +467,14 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
model
.
setConstructionContract
(
JSON
.
toJSONString
(
model
.
getConstructionContractList
()));
}
// 分割省市区字段
String
province
=
model
.
getProvince
();
if
(!
ObjectUtils
.
isEmpty
(
province
))
{
String
[]
provinceList
=
province
.
split
(
"_"
);
if
(
provinceList
.
length
>
1
)
{
model
.
setProvince
(
provinceList
[
0
]);
model
.
setProvince
(
provinceList
[
1
]);
model
.
setProvince
Name
(
provinceList
[
1
]);
}
}
...
...
@@ -493,7 +483,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
String
[]
cityList
=
city
.
split
(
"_"
);
if
(
cityList
.
length
>
1
)
{
model
.
setCity
(
cityList
[
0
]);
model
.
setCity
(
cityList
[
1
]);
model
.
setCity
Name
(
cityList
[
1
]);
}
}
...
...
@@ -502,7 +492,16 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
String
[]
countyList
=
county
.
split
(
"_"
);
if
(
countyList
.
length
>
1
)
{
model
.
setCounty
(
countyList
[
0
]);
model
.
setCounty
(
countyList
[
1
]);
model
.
setCountyName
(
countyList
[
1
]);
}
}
String
street
=
model
.
getStreet
();
if
(!
ObjectUtils
.
isEmpty
(
street
))
{
String
[]
streetList
=
street
.
split
(
"_"
);
if
(
streetList
.
length
>
1
)
{
model
.
setStreet
(
streetList
[
0
]);
model
.
setStreetName
(
streetList
[
1
]);
}
}
...
...
@@ -580,6 +579,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
}
}
@Transactional
public
void
accept
(
JgMaintainNoticeDto
dto
,
String
op
)
{
JgMaintainNotice
jgMaintainNotice
=
this
.
jgMaintainNoticeMapper
.
selectById
(
dto
.
getSequenceNbr
());
...
...
@@ -598,7 +598,7 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
LambdaQueryWrapper
<
OtherInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
//
OtherInfo tzsJgOtherInfo = tzsJgOtherInfoMapper.selectOne(queryWrapper1);
LambdaQueryWrapper
<
RegistrationInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
queryWrapper2
.
eq
(
RegistrationInfo:
:
getRecord
,
jgRelationEquip
.
getEquId
());
...
...
@@ -606,8 +606,8 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
stringBuffer
.
append
(
tzsJgRegistrationInfo
.
getEquCategory
()).
append
(
jgMaintainNotice
.
getCity
()).
append
(
ym
);
String
equCode
=
stringBuffer
.
toString
();
String
deviceRegistrationCode
=
iCreateCodeService
.
createDeviceRegistrationCode
(
equCode
);
//
String equCode = stringBuffer.toString();
//
String deviceRegistrationCode = iCreateCodeService.createDeviceRegistrationCode(equCode);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"cityCode"
,
jgMaintainNotice
.
getCity
());
map
.
put
(
"countyCode"
,
jgMaintainNotice
.
getCounty
());
...
...
@@ -624,10 +624,10 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
supervisoryCodeInfoMapper
.
updateById
(
supervisoryCodeInfo
);
//
boolean submit = submit(jgMaintainNotice, op);
// if
(submit) {
// if
("0".equals(op)) {
//
jgMaintainNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.HAVE_PROCESSED.getCode()));
boolean
submit
=
submit
(
jgMaintainNotice
,
op
);
if
(
submit
)
{
if
(
"0"
.
equals
(
op
))
{
jgMaintainNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
HAVE_PROCESSED
.
getCode
()));
// this.generateMaintainNoticeReport(jgMaintainNotice.getSequenceNbr());
// // 更新其他业务表
// tzsJgOtherInfo.setCode96333(mapCode.get("code96333").toString());
...
...
@@ -637,12 +637,12 @@ public class JgMaintainNoticeServiceImpl extends BaseService<JgMaintainNoticeDto
// jgMaintainNotice.setSupervisoryCode(mapCode.get("superviseCode").toString());
// tzsJgOtherInfoMapper.updateById(tzsJgOtherInfo);
// tzsJgRegistrationInfoMapper.updateById(tzsJgRegistrationInfo);
//
} else {
//
jgMaintainNotice.setNoticeStatus(String.valueOf(FlowStatusEnum.TO_BE_SUBMITTED.getCode()));
//
jgMaintainNotice.setInstanceStatus(String.valueOf(FlowStatusEnum.REJECTED.getCode()));
//
}
//
jgMaintainNoticeMapper.updateById(jgMaintainNotice);
//
}
}
else
{
jgMaintainNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
jgMaintainNotice
.
setInstanceStatus
(
String
.
valueOf
(
FlowStatusEnum
.
REJECTED
.
getCode
()));
}
jgMaintainNoticeMapper
.
updateById
(
jgMaintainNotice
);
}
// // 组装监管码
// String division = "";
...
...
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