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
30061fcd
Commit
30061fcd
authored
Dec 25, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
使用单位变更
parent
83739154
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1323 additions
and
0 deletions
+1323
-0
JgChangeRegistrationUnitEqMapper.java
...odule/jg/api/mapper/JgChangeRegistrationUnitEqMapper.java
+14
-0
JgChangeRegistrationUnitMapper.java
.../module/jg/api/mapper/JgChangeRegistrationUnitMapper.java
+40
-0
IJgChangeRegistrationUnitEqService.java
...le/jg/api/service/IJgChangeRegistrationUnitEqService.java
+12
-0
IJgChangeRegistrationUnitService.java
...dule/jg/api/service/IJgChangeRegistrationUnitService.java
+69
-0
JgChangeRegistrationUnitEqMapper.xml
...ain/resources/mapper/JgChangeRegistrationUnitEqMapper.xml
+5
-0
JgChangeRegistrationUnitMapper.xml
.../main/resources/mapper/JgChangeRegistrationUnitMapper.xml
+113
-0
JgChangeRegistrationUnitController.java
...jg/biz/controller/JgChangeRegistrationUnitController.java
+192
-0
JgChangeRegistrationUnitEqController.java
.../biz/controller/JgChangeRegistrationUnitEqController.java
+116
-0
JgChangeRegistrationUnitEqServiceImpl.java
...z/service/impl/JgChangeRegistrationUnitEqServiceImpl.java
+34
-0
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+728
-0
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/mapper/JgChangeRegistrationUnitEqMapper.java
0 → 100644
View file @
30061fcd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnitEq
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
/**
* 单位变更登记设备关系表 Mapper 接口
*
* @author system_generator
* @date 2023-12-22
*/
public
interface
JgChangeRegistrationUnitEqMapper
extends
CustomBaseMapper
<
JgChangeRegistrationUnitEq
>
{
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgChangeRegistrationUnitMapper.java
0 → 100644
View file @
30061fcd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* 单位变更登记 Mapper 接口
*
* @author system_generator
* @date 2023-12-22
*/
public
interface
JgChangeRegistrationUnitMapper
extends
CustomBaseMapper
<
JgChangeRegistrationUnit
>
{
/**
* 分页查询
*
* @param page 分页对象
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @return 安装告知列表
*/
Page
<
JgChangeRegistrationUnit
>
queryForPage
(
Page
<
JgChangeRegistrationUnit
>
page
,
@Param
(
"param"
)
JgChangeRegistrationUnitDto
model
,
@Param
(
"type"
)
String
type
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"roleIds"
)
List
<
String
>
roleIds
);
/**
* 根据安装告知编号查询设备、设计、制造等信息
*
* @param sequenceNbr 安装告知编号
*/
@MapKey
(
"sequenceNbr"
)
List
<
Map
<
String
,
Object
>>
queryEquipInformation
(
@Param
(
"sequenceNbr"
)
long
sequenceNbr
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgChangeRegistrationUnitEqService.java
0 → 100644
View file @
30061fcd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
service
;
/**
* 单位变更登记设备关系表接口类
*
* @author system_generator
* @date 2023-12-22
*/
public
interface
IJgChangeRegistrationUnitEqService
{
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgChangeRegistrationUnitService.java
0 → 100644
View file @
30061fcd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit
;
import
java.util.Map
;
/**
* 单位变更登记接口类
*
* @author system_generator
* @date 2023-12-22
*/
public
interface
IJgChangeRegistrationUnitService
{
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return 安装告知
*/
Map
<
String
,
Map
<
String
,
Object
>>
queryBySequenceNbr
(
Long
sequenceNbr
);
/**
* 更新安装告知
*
* @param noticeDto 安装告知
* @param op 操作类型
*/
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
);
/**
* 分页查询
*
* @param page 分页对象
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @return 安装告知列表
*/
Page
<
JgChangeRegistrationUnitDto
>
queryForJgChangeRegistrationUnitPage
(
Page
<
JgChangeRegistrationUnit
>
page
,
JgChangeRegistrationUnitDto
model
,
String
type
,
ReginParams
reginParams
);
/**
* 批量删除
*
* @param sequenceNbrs 主键
* @return 是否删除成功
*/
Boolean
deleteForBatch
(
Long
[]
sequenceNbrs
);
/**
* 保存安装告知单
*
* @param model 数据
* @param submitType 保存类型
*/
void
saveNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
model
,
ReginParams
reginParams
);
/**
* 打印告知单
*
* @param sequenceNbr 主键
* @return pdf文件路径
*/
String
generateInstallationNoticeReport
(
Long
sequenceNbr
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationUnitEqMapper.xml
0 → 100644
View file @
30061fcd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationUnitEqMapper"
>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationUnitMapper.xml
0 → 100644
View file @
30061fcd
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationUnitMapper"
>
<select
id=
"queryForPage"
resultType=
"com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit"
>
select
isn.sequence_nbr AS sequenceNbr,
isn.apply_no AS applyNo,
isn.apply_date AS applyDate,
isn.use_unit_name AS useUnitName,
isn.receive_org_name AS receiveOrgName,
isn.new_use_unit_name AS newUseUnitName,
isn.apply_date AS applyDate,
isn.status AS status,
isn.instance_id AS instanceId,
isn.promoter,
isn.next_execute_ids AS nextExecuteIds,
isn.instance_status AS instanceStatus,
isn.audit_pass_date AS auditPassDate,
isn.equ_type AS equType
FROM
tzs_jg_change_registration_unit isn
<where>
isn.is_delete = false
<if
test=
"param != null "
>
<if
test=
"param.applyNo != null and param.applyNo != ''"
>
AND isn.apply_no LIKE CONCAT('%', #{param.applyNo}, '%')
</if>
<if
test=
"param.receiveOrgCode != null and param.receiveOrgCode != ''"
>
AND isn.receive_org_credit_code = #{param.receiveOrgCreditCode}
</if>
<if
test=
"param.useUnitName != null and param.useUnitName != ''"
>
AND isn.use_unit_credit_code = #{param.useUnitName}
</if>
<if
test=
"param.status != null and param.status != ''"
>
AND isn.status = #{param.status}
</if>
</if>
<if
test=
"type == 'supervision'"
>
AND isn.receive_org_credit_code = #{orgCode}
AND isn.instance_id is not null
</if>
<if
test=
"type == 'enterprise'"
>
AND isn.new_use_unit_credit_code = #{orgCode}
</if>
<if
test=
"roleIds != null and type == 'supervision'"
>
<foreach
collection=
'roleIds'
item=
'role'
open=
'and ('
close=
')'
separator=
'or'
>
instance_status like concat('%',#{role},'%')
</foreach>
</if>
</where>
ORDER BY
isn.create_date DESC
</select>
<select
id=
"queryEquipInformation"
resultType=
"java.util.Map"
>
select
isn.sequence_nbr AS sequenceNbr,
isn.apply_no AS applyNo,
isn.use_unit_name AS useUnitName,
isn.use_unit_credit_code AS useUnitName,
isn.new_use_unit_credit_code AS useUnitName,
isn.new_use_unit_name AS useUnitName,
isn.receive_org_name AS receiveOrgName,
isn.receive_org_code AS receiveOrgCode,
isn.change_certificate AS changeCertificate,
isn.remark AS remark,
isn.equ_register_code AS equRegisterCode,
ri.equ_list AS equList,
ri.equ_category AS equCategory,
ri.EQU_DEFINE AS equDefine,
ri.product_name AS productName,
ri.brand_name AS brandName,
ri.equ_type AS equType,
ri.equ_price AS equPrice,
ri.product_photo AS productPhoto,
di.design_unit_credit_code AS designUnitCreditCode,
di.design_unit_name AS designUnitName,
di.design_license_num AS designLicenseNum,
di.design_use_date AS designUseDate,
di.design_date AS designDate,
di.drawing_do AS drawingDo,
di.appraisal_unit AS appraisalUnit,
di.appraisal_date AS appraisalDate,
di.design_doc AS designDoc,
di.design_standard AS designStandard,
fi.produce_unit_credit_code AS produceUnitCreditCode,
fi.produce_unit_name AS produceUnitName,
fi.produce_license_num AS produceLicenseNum,
fi.factory_num AS factoryNum,
fi.produce_date AS produceDate,
fi.imported AS imported,
fi.produce_country AS produceCountry,
fi.factory_standard AS factoryStandard,
fi.product_quality_yield_prove AS productQualityYieldProve,
fi.ins_use_maintain_explain AS insUseMaintainExplain,
ei.legal_person AS safetyManager,
ei.legal_phone AS safetyManagerPhone,
ei.address AS address
FROM
tzs_jg_change_registration_unit isn
LEFT JOIN tzs_jg_change_registration_unit_eq re ON re.equip_transfer_id = isn.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
LEFT JOIN idx_biz_jg_inspection_detection_info idi ON idi.record = re.equ_id
LEFT JOIN idx_biz_jg_use_info ui ON ui.record = re.equ_id
LEFT JOIN tz_base_enterprise_info ei ON ei.use_code = isn.use_unit_credit_code
WHERE
isn.sequence_nbr = #{sequenceNbr}
LIMIT 1
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationUnitController.java
0 → 100644
View file @
30061fcd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnit
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
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.jg.api.dto.JgChangeRegistrationUnitDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 单位变更登记
*
* @author system_generator
* @date 2023-12-22
*/
@RestController
@Api
(
tags
=
"单位变更登记Api"
)
@RequestMapping
(
value
=
"/jg-change-registration-unit"
)
public
class
JgChangeRegistrationUnitController
extends
BaseController
{
@Autowired
JgChangeRegistrationUnitServiceImpl
jgChangeRegistrationUnitServiceImpl
;
/**
* 新增
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增单位变更"
,
notes
=
"新增单位变更"
)
public
ResponseModel
<
String
>
save
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
Object
>
model
)
{
JgChangeRegistrationUnitDto
jgChangeRegistrationUnitDto
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
)),
JgChangeRegistrationUnitDto
.
class
,
true
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
jgChangeRegistrationUnitServiceImpl
.
saveNotice
(
submitType
,
jgChangeRegistrationUnitDto
,
reginParams
);
return
ResponseHelper
.
buildResponse
(
""
);
}
/**
* 根据sequenceNbr更新
*
* @param model 单位变更
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/update"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新单位变更"
,
notes
=
"根据sequenceNbr更新单位变更"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
updateBySequenceNbrJgInstallationNotice
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
Object
>
model
,
@RequestParam
(
value
=
"op"
,
required
=
false
)
String
op
)
{
JgChangeRegistrationUnitDto
installationInfo
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"changeRegisInfo"
)),
JgChangeRegistrationUnitDto
.
class
,
true
);
if
(
Objects
.
isNull
(
installationInfo
))
{
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
}
// Object o = ((LinkedHashMap<?, ?>) model.get("installationInfo")).get("proxyStatementAttachment");
// Object o1 = ((LinkedHashMap<?, ?>) model.get("installationInfo")).get("installContractAttachment");
// installationInfo.setProxyStatementAttachmentList((List<Map<String, Object>>) o);
// installationInfo.setInstallContractAttachmentList((List<Map<String, Object>>) o1);
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
updateInstallationNotice
(
submitType
,
installationInfo
,
op
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/delete"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除单位变更"
,
notes
=
"根据sequenceNbr删除单位变更"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据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
(
jgChangeRegistrationUnitServiceImpl
.
deleteForBatch
(
sequenceNbrs
));
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/details"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个单位变更"
,
notes
=
"根据sequenceNbr查询单个单位变更"
)
public
ResponseModel
<
Map
<
String
,
Map
<
String
,
Object
>>>
selectOne
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryBySequenceNbr
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位变更分页查询"
,
notes
=
"单位变更分页查询"
)
public
ResponseModel
<
Page
<
JgChangeRegistrationUnitDto
>>
queryForPage
(
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
@ApiParam
(
value
=
"类型:enterprise-企业端、supervision-监管端"
,
required
=
true
)
@RequestParam
(
value
=
"type"
,
defaultValue
=
"enterprise"
)
String
type
,
@RequestBody
(
required
=
false
)
JgChangeRegistrationUnitDto
model
)
{
Page
<
JgChangeRegistrationUnit
>
page
=
new
Page
<>(
current
,
size
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
queryForJgChangeRegistrationUnitPage
(
page
,
model
,
type
,
reginParams
));
}
/**
* 生成告知单
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位变更列表全部数据查询"
,
notes
=
"单位变更列表全部数据查询"
)
@GetMapping
(
value
=
"/generate-report"
)
public
ResponseModel
<
String
>
generateReport
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitServiceImpl
.
generateInstallationNoticeReport
(
sequenceNbr
));
}
/**
* 撤销
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/cancel"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更撤销"
,
notes
=
"单位变更撤销"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
cancel
(
@RequestBody
Map
<
String
,
Object
>
model
)
{
JgChangeRegistrationUnitDto
installationInfo
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"installationInfo"
)),
JgChangeRegistrationUnitDto
.
class
,
true
);
if
(
Objects
.
isNull
(
installationInfo
))
{
throw
new
IllegalArgumentException
(
"参数installationInfo不能为空"
);
}
jgChangeRegistrationUnitServiceImpl
.
cancel
(
installationInfo
);
return
ResponseHelper
.
buildResponse
(
installationInfo
);
}
/**
* 受理
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/accept"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"单位变更受理"
,
notes
=
"单位变更受理"
)
public
ResponseModel
<
JgChangeRegistrationUnitDto
>
accept
(
@RequestBody
Map
<
String
,
Object
>
model
,
String
op
)
{
// TODO 受理单位变更流程
LinkedHashMap
model1
=
(
LinkedHashMap
)
model
.
get
(
"model"
);
String
opinion
=
(
String
)
model
.
get
(
"opinion"
);
LinkedHashMap
installationInfo
=
(
LinkedHashMap
)
model1
.
get
(
"installationInfo"
);
JgChangeRegistrationUnitDto
jgInstallationNoticeDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
installationInfo
),
JgChangeRegistrationUnitDto
.
class
);
jgInstallationNoticeDto
.
setProcessAdvice
(
opinion
);
jgChangeRegistrationUnitServiceImpl
.
accept
(
jgInstallationNoticeDto
,
op
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgChangeRegistrationUnitEqController.java
0 → 100644
View file @
30061fcd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgChangeRegistrationUnitEqServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
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.jg.api.dto.JgChangeRegistrationUnitEqDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
* 单位变更登记设备关系表
*
* @author system_generator
* @date 2023-12-22
*/
@RestController
@Api
(
tags
=
"单位变更登记设备关系表Api"
)
@RequestMapping
(
value
=
"/jg-change-registration-unit-eq"
)
public
class
JgChangeRegistrationUnitEqController
extends
BaseController
{
@Autowired
JgChangeRegistrationUnitEqServiceImpl
jgChangeRegistrationUnitEqServiceImpl
;
/**
* 新增单位变更登记设备关系表
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增单位变更登记设备关系表"
,
notes
=
"新增单位变更登记设备关系表"
)
public
ResponseModel
<
JgChangeRegistrationUnitEqDto
>
save
(
@RequestBody
JgChangeRegistrationUnitEqDto
model
)
{
model
=
jgChangeRegistrationUnitEqServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新单位变更登记设备关系表"
,
notes
=
"根据sequenceNbr更新单位变更登记设备关系表"
)
public
ResponseModel
<
JgChangeRegistrationUnitEqDto
>
updateBySequenceNbrJgChangeRegistrationUnitEq
(
@RequestBody
JgChangeRegistrationUnitEqDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitEqServiceImpl
.
updateWithModel
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除单位变更登记设备关系表"
,
notes
=
"根据sequenceNbr删除单位变更登记设备关系表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitEqServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个单位变更登记设备关系表"
,
notes
=
"根据sequenceNbr查询单个单位变更登记设备关系表"
)
public
ResponseModel
<
JgChangeRegistrationUnitEqDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitEqServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位变更登记设备关系表分页查询"
,
notes
=
"单位变更登记设备关系表分页查询"
)
public
ResponseModel
<
Page
<
JgChangeRegistrationUnitEqDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
JgChangeRegistrationUnitEqDto
>
page
=
new
Page
<
JgChangeRegistrationUnitEqDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitEqServiceImpl
.
queryForJgChangeRegistrationUnitEqPage
(
page
));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"单位变更登记设备关系表列表全部数据查询"
,
notes
=
"单位变更登记设备关系表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
JgChangeRegistrationUnitEqDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
jgChangeRegistrationUnitEqServiceImpl
.
queryForJgChangeRegistrationUnitEqList
());
}
}
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/JgChangeRegistrationUnitEqServiceImpl.java
0 → 100644
View file @
30061fcd
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgChangeRegistrationUnitEq
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationUnitEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationUnitEqService
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitEqDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
* 单位变更登记设备关系表服务实现类
*
* @author system_generator
* @date 2023-12-22
*/
@Service
public
class
JgChangeRegistrationUnitEqServiceImpl
extends
BaseService
<
JgChangeRegistrationUnitEqDto
,
JgChangeRegistrationUnitEq
,
JgChangeRegistrationUnitEqMapper
>
implements
IJgChangeRegistrationUnitEqService
{
/**
* 分页查询
*/
public
Page
<
JgChangeRegistrationUnitEqDto
>
queryForJgChangeRegistrationUnitEqPage
(
Page
<
JgChangeRegistrationUnitEqDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
JgChangeRegistrationUnitEqDto
>
queryForJgChangeRegistrationUnitEqList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ No newline at end of file
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/JgChangeRegistrationUnitServiceImpl.java
0 → 100644
View file @
30061fcd
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.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.aspose.words.SaveFormat
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.ByteArrayMultipartFile
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgChangeRegistrationUnitDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.EquipTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationUnitMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgChangeRegistrationUnitEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgRegistrationHistoryMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationUnitService
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.ImageUtils
;
import
com.yeejoin.amos.boot.module.jg.biz.utils.WordTemplateUtils
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.OtherInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.UseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
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.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* 单位变更登记服务实现类
*
* @author system_generator
* @date 2023-12-22
*/
@Service
public
class
JgChangeRegistrationUnitServiceImpl
extends
BaseService
<
JgChangeRegistrationUnitDto
,
JgChangeRegistrationUnit
,
JgChangeRegistrationUnitMapper
>
implements
IJgChangeRegistrationUnitService
{
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
PROCESS_DEFINITION_KEY
=
"unitChange"
;
private
static
final
String
TABLE_PAGE_ID
=
"1734141426742095873"
;
@Autowired
EquipmentCategoryMapper
equipmentCategoryMapper
;
@Autowired
JgChangeRegistrationUnitEqMapper
JgChangeRegistrationUnitEqMapper
;
@Autowired
private
JgChangeRegistrationUnitMapper
JgChangeRegistrationUnitMapper
;
// @Autowired
// private EquipmentCategoryServiceImpl equipmentCategoryService;
@Autowired
RegistrationInfoMapper
tzsJgRegistrationInfoMapper
;
@Autowired
OtherInfoMapper
tzsJgOtherInfoMapper
;
@Autowired
UseInfoMapper
useInfoMapper
;
@Autowired
TzsServiceFeignClient
tzsServiceFeignClient
;
@Autowired
SupervisoryCodeInfoMapper
supervisoryCodeInfoMapper
;
@Autowired
WorkFlowFeignService
workFlowFeginService
;
@Autowired
private
JgRegistrationHistoryMapper
jgRegistrationHistoryMapper
;
@Autowired
private
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
public
static
byte
[]
file2byte
(
File
file
)
{
try
{
FileInputStream
in
=
new
FileInputStream
(
file
);
//当文件没有结束时,每次读取一个字节显示
byte
[]
data
=
new
byte
[
in
.
available
()];
in
.
read
(
data
);
in
.
close
();
return
data
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return 单位变更
*/
@Override
public
Map
<
String
,
Map
<
String
,
Object
>>
queryBySequenceNbr
(
Long
sequenceNbr
)
{
// 变更单位信息
JgChangeRegistrationUnit
notice
=
JgChangeRegistrationUnitMapper
.
selectById
(
sequenceNbr
);
if
(
Objects
.
isNull
(
notice
))
{
return
null
;
}
Map
<
String
,
Object
>
changeInfo
=
BeanUtil
.
beanToMap
(
notice
);
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getReceiveOrgCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getReceiveOrgName
()))
{
changeInfo
.
put
(
"receiveOrgCode"
,
notice
.
getReceiveOrgCode
()
+
"_"
+
notice
.
getReceiveOrgName
());
}
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getUseUnitCreditCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getUseUnitName
()))
{
changeInfo
.
put
(
"useUnitCreditCode"
,
notice
.
getUseUnitCreditCode
()
+
"_"
+
notice
.
getUseUnitName
());
}
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getNewUseUnitCreditCode
())
&&
!
ValidationUtil
.
isEmpty
(
notice
.
getNewUseUnitName
()))
{
changeInfo
.
put
(
"newUseUnitCreditCode"
,
notice
.
getNewUseUnitCreditCode
()
+
"_"
+
notice
.
getNewUseUnitName
());
}
String
[]
fields
=
{
"productPhoto"
,
"designDoc"
,
"designStandard"
,
"factoryStandard"
,
"productQualityYieldProve"
,
"insUseMaintainExplain"
,
"inspectReport"
,
"proxyStatementAttachment"
,
"installContractAttachment"
,
"changeCertificate"
};
// 设备信息
List
<
Map
<
String
,
Object
>>
equipmentInfos
=
JgChangeRegistrationUnitMapper
.
queryEquipInformation
(
sequenceNbr
);
for
(
String
s:
fields
)
{
if
(
changeInfo
.
containsKey
(
s
))
{
changeInfo
.
put
(
s
,
JSON
.
parseArray
(
changeInfo
.
get
(
s
).
toString
()));
}
if
(
equipmentInfos
.
get
(
0
).
containsKey
(
s
))
{
equipmentInfos
.
get
(
0
).
put
(
s
,
JSON
.
parseArray
(
equipmentInfos
.
get
(
0
).
get
(
s
).
toString
()));
}
}
Map
<
String
,
Object
>
newMap
=
new
HashMap
<>();
newMap
.
putAll
(
changeInfo
);
newMap
.
putAll
(
equipmentInfos
.
get
(
0
));
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
this
.
put
(
"changeInfo"
,
newMap
);
}};
}
/**
* 更新单位变更
*
* @param noticeDto 单位变更
*/
@SuppressWarnings
({
"rawtypes"
,
"Duplicates"
})
public
JgChangeRegistrationUnitDto
updateInstallationNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
noticeDto
,
String
op
)
{
if
(
Objects
.
isNull
(
noticeDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
String
[]
taskName
=
new
String
[]{
"流程结束"
};
// 字段转换
this
.
convertField
(
noticeDto
);
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
AjaxResult
ajaxResult
;
// 发起流程
if
(!
StringUtils
.
hasText
(
noticeDto
.
getInstanceId
()))
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
"1"
);
try
{
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
noticeDto
.
setInstanceId
(
instanceId
);
// 查询下节点任务
getNext
(
roleListFirst
,
instanceId
,
taskName
);
noticeDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
}
JgChangeRegistrationUnit
notice
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
noticeDto
,
notice
);
boolean
submit
=
submit
(
notice
,
op
);
if
(
submit
)
{
// 查询下节点任务
getNext
(
roleListSecond
,
notice
.
getInstanceId
(),
taskName
);
notice
.
setStatus
(
taskName
[
0
]);
if
(!
ObjectUtils
.
isEmpty
(
notice
.
getInstanceStatus
()))
{
notice
.
setInstanceStatus
(
notice
.
getInstanceStatus
()
+
","
+
roleListSecond
);
}
else
{
notice
.
setInstanceStatus
(
String
.
join
(
","
,
roleListSecond
));
}
notice
.
setPromoter
(
RequestContext
.
getExeUserId
());
notice
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListSecond
));
notice
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
JgChangeRegistrationUnitMapper
.
updateById
(
notice
);
}
}
else
{
JgChangeRegistrationUnit
bean
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
noticeDto
,
bean
);
JgChangeRegistrationUnitMapper
.
updateById
(
bean
);
}
return
noticeDto
;
}
/**
* 分页查询
*
* @param page 分页对象
* @param model 查询参数
* @param type 类型:enterprise-企业端、supervision-监管端
* @return 单位变更列表
*/
@Override
public
Page
<
JgChangeRegistrationUnitDto
>
queryForJgChangeRegistrationUnitPage
(
Page
<
JgChangeRegistrationUnit
>
page
,
JgChangeRegistrationUnitDto
model
,
String
type
,
ReginParams
reginParams
)
{
String
orgCode
;
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
Page
<
JgChangeRegistrationUnit
>
noticePage
=
JgChangeRegistrationUnitMapper
.
queryForPage
(
page
,
model
,
type
,
orgCode
,
model
.
getRoleIds
());
Page
<
JgChangeRegistrationUnitDto
>
noticeDtoPage
=
new
Page
<>();
BeanUtils
.
copyProperties
(
noticePage
,
noticeDtoPage
,
"records"
);
List
<
JgChangeRegistrationUnitDto
>
records
=
noticePage
.
getRecords
().
stream
().
map
(
notice
->
{
JgChangeRegistrationUnitDto
noticeDto
=
new
JgChangeRegistrationUnitDto
();
BeanUtils
.
copyProperties
(
notice
,
noticeDto
);
return
noticeDto
;
}).
collect
(
java
.
util
.
stream
.
Collectors
.
toList
());
noticeDtoPage
.
setRecords
(
records
);
return
noticeDtoPage
;
}
/**
* 列表查询 示例
*/
public
List
<
JgChangeRegistrationUnitDto
>
queryForJgChangeRegistrationUnitList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 批量删除
*
* @param sequenceNbrs 主键
* @return 是否删除成功
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
deleteForBatch
(
Long
[]
sequenceNbrs
)
{
if
(
Objects
.
isNull
(
sequenceNbrs
)
||
sequenceNbrs
.
length
==
0
)
{
return
false
;
}
Collection
<
JgChangeRegistrationUnit
>
JgChangeRegistrationUnits
=
this
.
listByIds
(
Arrays
.
asList
(
sequenceNbrs
));
JgChangeRegistrationUnits
.
forEach
(
notice
->
{
notice
.
setIsDelete
(
true
);
});
return
this
.
updateBatchById
(
JgChangeRegistrationUnits
);
}
/**
* 打印单位变更单
*
* @param sequenceNbr 主键
* @return pdf文件路径
*/
@Override
public
String
generateInstallationNoticeReport
(
Long
sequenceNbr
)
{
if
(
Objects
.
isNull
(
sequenceNbr
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
JgChangeRegistrationUnit
JgChangeRegistrationUnit
=
this
.
getById
(
sequenceNbr
);
List
<
Map
<
String
,
Object
>>
informationList
=
JgChangeRegistrationUnitMapper
.
queryEquipInformation
(
sequenceNbr
);
if
(
Objects
.
isNull
(
JgChangeRegistrationUnit
)
||
CollectionUtils
.
isEmpty
(
informationList
))
{
throw
new
IllegalArgumentException
(
"单位变更单不存在"
);
}
Map
<
String
,
Object
>
installation
=
informationList
.
get
(
0
);
Function
<
String
,
String
>
getValue
=
key
->
installation
.
getOrDefault
(
key
,
""
).
toString
();
// 组装模板变量
Map
<
String
,
Object
>
placeholders
=
new
HashMap
<>();
placeholders
.
put
(
"sequenceNbr"
,
getValue
.
apply
(
"sequenceNbr"
));
placeholders
.
put
(
"installUnitName"
,
getValue
.
apply
(
"installUnitName"
));
placeholders
.
put
(
"applyNo"
,
getValue
.
apply
(
"applyNo"
));
placeholders
.
put
(
"productName"
,
getValue
.
apply
(
"productName"
));
placeholders
.
put
(
"equipType"
,
getValue
.
apply
(
"equType"
));
placeholders
.
put
(
"equipCode"
,
getValue
.
apply
(
"equRegisterCode"
));
placeholders
.
put
(
"produceCode"
,
getValue
.
apply
(
"factoryNum"
));
// TODO: 出厂编号
placeholders
.
put
(
"produceUnitName"
,
getValue
.
apply
(
"produceUnitName"
));
placeholders
.
put
(
"produceLicenseNum"
,
getValue
.
apply
(
"produceLicenseNum"
));
placeholders
.
put
(
"installUnitAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
placeholders
.
put
(
"installStartDate"
,
getValue
.
apply
(
"installStartDate"
));
placeholders
.
put
(
"installType"
,
"单位变更"
);
// TODO: 施工类别
placeholders
.
put
(
"installLicenseNo"
,
getValue
.
apply
(
"installLicenseNo"
));
placeholders
.
put
(
"installLicenseExpirationDate"
,
getValue
.
apply
(
"installLicenseExpirationDate"
));
placeholders
.
put
(
"installLeaderName"
,
getValue
.
apply
(
"installLeaderName"
));
placeholders
.
put
(
"installLeaderPhone"
,
getValue
.
apply
(
"installLeaderPhone"
));
placeholders
.
put
(
"fullAddress"
,
getValue
.
apply
(
"provinceName"
)
+
getValue
.
apply
(
"cityName"
)
+
getValue
.
apply
(
"countyName"
)
+
getValue
.
apply
(
"streetName"
)
+
getValue
.
apply
(
"address"
));
placeholders
.
put
(
"useUnitName"
,
getValue
.
apply
(
"useUnitName"
));
placeholders
.
put
(
"useUnitLeaderName"
,
getValue
.
apply
(
"safetyManager"
));
placeholders
.
put
(
"useUnitLeaderPhone"
,
getValue
.
apply
(
"safetyManagerPhone"
));
placeholders
.
put
(
"useUnitLeaderAddress"
,
getValue
.
apply
(
"address"
));
// 生成二维码
String
qrCode
=
ImageUtils
.
generateQRCode
(
getValue
.
apply
(
"applyNo"
),
300
,
300
);
placeholders
.
put
(
"qrCode"
,
qrCode
);
// word转pdf
File
pdfFile
;
try
{
pdfFile
=
this
.
wordToPdf
(
"installation-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
);
}
// 更新到数据库
// JgChangeRegistrationUnit.setNoticeReportUrl(url);
this
.
updateById
(
JgChangeRegistrationUnit
);
return
url
;
}
/**
* word 转 pdf
*
* @param wordPath word文件路径
*/
private
File
wordToPdf
(
String
wordPath
,
Map
<
String
,
Object
>
placeholders
)
throws
Exception
{
Assert
.
hasText
(
wordPath
,
"word文件路径不能为空"
);
String
tempFileName
=
"单位变更单_"
+
System
.
currentTimeMillis
()
+
"_temp.pdf"
;
WordTemplateUtils
instance
=
WordTemplateUtils
.
getInstance
();
return
instance
.
fillAndConvertDocFile
(
wordPath
,
tempFileName
,
placeholders
,
SaveFormat
.
PDF
);
}
/**
* 上传文件至文件服务器
*
* @param file 文件
*/
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
=
""
;
if
(
result
!=
null
)
{
for
(
String
s
:
result
.
getResult
().
keySet
())
{
urlString
=
s
;
}
}
return
urlString
;
}
@Override
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
saveNotice
(
String
submitType
,
JgChangeRegistrationUnitDto
model
,
ReginParams
reginParams
)
{
String
[]
taskName
=
new
String
[]{
"流程结束"
};
// 字段转换
convertField
(
model
);
// 获取单位变更设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
model
.
getDeviceList
();
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
return
;
}
// 获取单位变更单号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
DWBG
.
getCode
(),
deviceList
.
size
());
List
<
String
>
applyNoList
=
listResponseModel
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
log
.
error
(
"生成申请变更单位编失败"
);
return
;
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
// 判断当前是否为提交
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// 发起流程
// ActWorkflowStartDTO dto = new ActWorkflowStartDTO();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
deviceList
.
size
()
;
i
++
)
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESS_DEFINITION_KEY
);
dto
.
setBusinessKey
(
String
.
valueOf
(
i
));
// dto.setCompleteFirstTask(true);
list
.
add
(
dto
);
}
actWorkflowBatchDTO
.
setProcess
(
list
);
try
{
FeignClientResult
result
=
Workflow
.
taskV2Client
.
startByVariableBatch
(
actWorkflowBatchDTO
);
List
<
Object
>
returnList
=
(
List
<
Object
>)
result
.
getResult
();
for
(
Object
obj
:
returnList
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
instanceId
=
jsonObject
.
getString
(
"id"
);
instanceIdList
.
add
(
instanceId
);
// 查询下节点任务
if
(
returnList
.
get
(
0
).
equals
(
obj
))
{
getNext
(
roleListFirst
,
instanceId
,
taskName
);
}
// 推动下一个节点
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
dto
.
setComment
(
""
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
"0"
);
dto
.
setVariable
(
map
);
//执行流程
AjaxResult
ajaxResult1
=
null
;
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
if
(
ajaxResult1
.
get
(
"code"
).
equals
(
200
))
{
getNext
(
roleListSecond
,
instanceId
,
taskName
);
}
else
{
log
.
error
(
"提交失败"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
}
List
<
JgChangeRegistrationUnit
>
list
=
new
ArrayList
<>();
List
<
JgChangeRegistrationUnitEq
>
equipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
obj
->
{
JgChangeRegistrationUnitEq
jgRelationEquip
=
new
JgChangeRegistrationUnitEq
();
JgChangeRegistrationUnit
dto
=
new
JgChangeRegistrationUnit
();
BeanUtils
.
copyProperties
(
model
,
dto
);
int
i
=
deviceList
.
indexOf
(
obj
);
String
applyNo
=
applyNoList
.
get
(
i
);
dto
.
setApplyNo
(
applyNo
);
dto
.
setApplyDate
(
new
Date
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
dto
.
setNextExecutorIds
(
String
.
join
(
","
,
roleListSecond
));
dto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setStatus
(
taskName
[
0
]);
}
dto
.
setNewUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
dto
.
setNewUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
dto
.
setEquType
((
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY"
))));
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setUnitChangeRegistrationId
(
applyNo
);
if
(!
CollectionUtils
.
isEmpty
(
instanceIdList
))
{
dto
.
setInstanceId
(
instanceIdList
.
get
(
i
));
dto
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_RECEIVE
.
getPass
());
}
else
{
dto
.
setStatus
(
WorkFlowStatusEnum
.
UNITCHANGE_SUBMIT
.
getPass
());
}
list
.
add
(
dto
);
equipList
.
add
(
jgRelationEquip
);
});
JgChangeRegistrationUnitMapper
.
insertBatchSomeColumn
(
list
);
List
<
JgChangeRegistrationUnitEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgChangeRegistrationUnit
>
collect
=
list
.
stream
().
filter
(
JgChangeRegistrationUnit
->
jgRelationEquip
.
getUnitChangeRegistrationId
().
equals
(
JgChangeRegistrationUnit
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
Long
sequenceNbr
=
collect
.
get
(
0
).
getSequenceNbr
();
insertOrUpdateHis
(
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
collect
.
get
(
0
))),
jgRelationEquip
.
getEquId
());
return
jgRelationEquip
.
setUnitChangeRegistrationId
(
String
.
valueOf
(
sequenceNbr
));
}).
collect
(
Collectors
.
toList
());
JgChangeRegistrationUnitEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
}
void
getNext
(
ArrayList
<
String
>
roleListFirst
,
String
instanceId
,
String
[]
taskName
)
{
AjaxResult
aj
=
Workflow
.
taskClient
.
getTaskNoAuth
(
instanceId
);
JSONObject
taskNoAuth
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
aj
.
get
(
"data"
)));
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
))
{
String
nextTaskId
=
taskNoAuth
.
getString
(
"id"
);
FeignClientResult
<
JSONObject
>
nodeInfo
=
workFlowFeginService
.
getNodeInfo
(
nextTaskId
);
JSONObject
result
=
nodeInfo
.
getResult
();
Map
<
String
,
Object
>
taskInfo
=
(
Map
<
String
,
Object
>)
result
.
get
(
"taskInfo"
);
taskName
[
0
]
=
String
.
valueOf
(
taskInfo
.
get
(
"taskDefinitionKey"
));
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
JSONArray
data
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
taskGroupName
.
get
(
"data"
)));
for
(
Object
datum
:
data
)
{
if
(((
Map
)
datum
).
containsKey
(
"groupId"
))
{
roleListFirst
.
add
(((
Map
)
datum
).
get
(
"groupId"
).
toString
());
}
}
}
}
private
void
convertField
(
JgChangeRegistrationUnitDto
model
)
{
// 处理图片
if
(!
ValidationUtil
.
isEmpty
(
model
.
getChangeCertificateList
()))
{
model
.
setChangeCertificate
(
JSON
.
toJSONString
(
model
.
getChangeCertificateList
()));
}
// 分割单位
String
useUnitId
=
model
.
getUseUnitCreditCode
();
if
(!
ObjectUtils
.
isEmpty
(
useUnitId
))
{
String
[]
useUnitList
=
useUnitId
.
split
(
"_"
);
if
(
useUnitList
.
length
>
1
)
{
model
.
setUseUnitCreditCode
(
useUnitList
[
0
]);
model
.
setUseUnitName
(
useUnitList
[
1
]);
}
}
String
receiveOrgCode
=
model
.
getReceiveOrgCode
();
if
(!
ObjectUtils
.
isEmpty
(
receiveOrgCode
))
{
String
[]
receiveOrgCodeList
=
receiveOrgCode
.
split
(
"_"
);
if
(
receiveOrgCodeList
.
length
>
1
)
{
model
.
setReceiveOrgCode
(
receiveOrgCodeList
[
0
]);
model
.
setReceiveOrgName
(
receiveOrgCodeList
[
1
]);
}
}
}
private
String
convertImageUrl
(
List
<
Map
<
String
,
String
>>
urlList
)
{
String
urls
=
""
;
if
(!
CollectionUtils
.
isEmpty
(
urlList
))
{
urls
=
urlList
.
stream
().
map
(
map
->
map
.
get
(
"url"
)).
collect
(
Collectors
.
joining
(
","
));
}
return
urls
;
}
public
void
insertOrUpdateHis
(
JSONObject
map
,
String
equipId
)
{
JgRegistrationHistory
jgRegistrationHistory
=
new
JgRegistrationHistory
();
//使用登记编号
jgRegistrationHistory
.
setUseRegistrationCode
(
idxBizJgRegisterInfoMapper
.
getUseOrgCodeByEquip
(
equipId
));
//登记类别
jgRegistrationHistory
.
setRegistrationClass
(
"单位变更登记"
);
//设备id
jgRegistrationHistory
.
setEquId
(
equipId
);
//修改数据
jgRegistrationHistory
.
setChangeData
(
JSONObject
.
toJSONString
(
map
));
//设备监管码
// jgRegistrationHistory.setSupervisoryCode(supervisoryCode);
if
(
map
.
containsKey
(
"type"
)
&&
"edit"
.
equals
(
String
.
valueOf
(
map
.
get
(
"type"
))))
{
jgRegistrationHistory
.
setSequenceNbr
(
jgRegistrationHistoryMapper
.
getSequenceNbrByEquidAndDocumentId
(
equipId
,
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
jgRegistrationHistoryMapper
.
updateById
(
jgRegistrationHistory
);
}
else
{
//当前单据id
jgRegistrationHistory
.
setCurrentDocumentId
(
map
.
get
(
"sequenceNbr"
).
toString
());
jgRegistrationHistoryMapper
.
insert
(
jgRegistrationHistory
);
}
}
public
boolean
submit
(
JgChangeRegistrationUnit
notice
,
String
op
)
{
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
notice
.
getInstanceId
());
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
if
(!
ValidationUtil
.
isEmpty
(
notice
.
getProcessAdvice
()))
{
dto
.
setComment
(
notice
.
getProcessAdvice
());
}
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
op
);
dto
.
setVariable
(
map
);
//执行流程
AjaxResult
ajaxResult1
=
null
;
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
if
(
ajaxResult1
.
get
(
"code"
).
equals
(
200
))
{
return
true
;
}
else
{
return
false
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
return
false
;
}
}
public
void
cancel
(
JgChangeRegistrationUnitDto
noticeDto
)
{
String
[]
taskName
=
new
String
[]{
"流程结束"
};
FeignClientResult
ajaxResult
=
Workflow
.
taskV2Client
.
rollBack
(
noticeDto
.
getInstanceId
());
JgChangeRegistrationUnit
JgChangeRegistrationUnit
=
this
.
baseMapper
.
selectById
(
noticeDto
.
getSequenceNbr
());
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
if
(
ajaxResult
.
getStatus
()
==
200
)
{
getNext
(
roleList
,
noticeDto
.
getInstanceId
(),
taskName
);
JgChangeRegistrationUnit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskName
[
0
]).
getRollBack
());
JgChangeRegistrationUnit
.
setPromoter
(
""
);
JgChangeRegistrationUnit
.
setNextExecutorIds
(
String
.
join
(
","
,
roleList
));
JgChangeRegistrationUnitMapper
.
updateById
(
JgChangeRegistrationUnit
);
}
}
@Transactional
public
void
accept
(
JgChangeRegistrationUnitDto
dto
,
String
op
)
{
String
[]
taskName
=
new
String
[]{
"已完成"
};
String
userId
=
RequestContext
.
getExeUserId
();
JgChangeRegistrationUnit
JgChangeRegistrationUnit
=
this
.
JgChangeRegistrationUnitMapper
.
selectById
(
dto
.
getSequenceNbr
());
JgChangeRegistrationUnit
.
setProcessAdvice
(
dto
.
getProcessAdvice
());
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
boolean
submit
=
submit
(
JgChangeRegistrationUnit
,
op
);
if
(
submit
)
{
getNext
(
roleList
,
dto
.
getInstanceId
(),
taskName
);
JgChangeRegistrationUnit
.
setStatus
(
taskName
[
0
]);
if
(
"0"
.
equals
(
op
))
{
if
(
roleList
.
size
()
==
0
)
{
JgChangeRegistrationUnit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskName
[
0
]).
getPass
());
// 生成新的使用登记编号,使用登记证 修改设备的使用登记信息表,使用单位名称,使用单位统一信用代码,使用登记证编号,更新ES
LambdaQueryWrapper
<
JgChangeRegistrationUnitEq
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
JgChangeRegistrationUnitEq:
:
getUnitChangeRegistrationId
,
dto
.
getSequenceNbr
());
JgChangeRegistrationUnitEq
jgChangeRegistrationUnitEq
=
JgChangeRegistrationUnitEqMapper
.
selectOne
(
queryWrapper
);
String
equipId
=
jgChangeRegistrationUnitEq
.
getEquId
();
LambdaQueryWrapper
<
OtherInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<>();
queryWrapper1
.
eq
(
OtherInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
OtherInfo
tzsJgOtherInfo
=
tzsJgOtherInfoMapper
.
selectOne
(
queryWrapper1
);
LambdaQueryWrapper
<
UseInfo
>
queryWrapper2
=
new
LambdaQueryWrapper
<>();
queryWrapper2
.
eq
(
UseInfo:
:
getRecord
,
jgChangeRegistrationUnitEq
.
getEquId
());
UseInfo
useInfo
=
useInfoMapper
.
selectOne
(
queryWrapper2
);
useInfo
.
setUseUnitName
(
JgChangeRegistrationUnit
.
getNewUseUnitName
());
useInfo
.
setUseUnitCreditCode
(
JgChangeRegistrationUnit
.
getNewUseUnitCreditCode
());
String
code
=
getCode
(
tzsJgOtherInfo
.
getSupervisoryCode
());
if
(
ValidationUtil
.
isEmpty
(
code
))
{
log
.
error
(
"生成新的使用登记证编号失败"
);
return
;
}
//更新使用注册登记证编号
idxBizJgRegisterInfoMapper
.
updateUseOrgCodeByEquip
(
equipId
,
code
);
useInfoMapper
.
updateById
(
useInfo
);
//es中的编号信息
Map
<
String
,
Map
<
String
,
Object
>>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
map1
=
new
HashMap
<>();
map1
.
put
(
"USE_ORG_CODE"
,
code
);
resultMap
.
put
(
equipId
,
map1
);
tzsServiceFeignClient
.
commonUpdateEsDataByIds
(
resultMap
);
// TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
// @Override
// public void afterCommit() {
// generateInstallationNoticeReport(JgChangeRegistrationUnit.getSequenceNbr());
// }
// });
}
else
{
JgChangeRegistrationUnit
.
setNextExecutorIds
(
String
.
join
(
","
,
roleList
));
if
(!
ObjectUtils
.
isEmpty
(
JgChangeRegistrationUnit
.
getInstanceStatus
()))
{
JgChangeRegistrationUnit
.
setInstanceStatus
(
JgChangeRegistrationUnit
.
getInstanceStatus
()
+
","
+
String
.
join
(
","
,
roleList
));
}
else
{
JgChangeRegistrationUnit
.
setInstanceStatus
(
String
.
join
(
","
,
roleList
));
}
JgChangeRegistrationUnit
.
setPromoter
(
userId
);
JgChangeRegistrationUnit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskName
[
0
]).
getPass
());
}
}
else
{
JgChangeRegistrationUnit
.
setPromoter
(
""
);
JgChangeRegistrationUnit
.
setStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskName
[
0
]).
getReject
());
}
JgChangeRegistrationUnitMapper
.
updateById
(
JgChangeRegistrationUnit
);
}
}
public
String
getCode
(
String
supervisoryCode
)
{
if
(!
ObjectUtils
.
isEmpty
(
supervisoryCode
)
&&
supervisoryCode
.
length
()
>
5
)
{
String
name
=
EquipTypeEnum
.
getMessage
(
supervisoryCode
.
substring
(
1
,
2
));
String
type
=
supervisoryCode
.
substring
(
2
,
4
);
String
city
=
supervisoryCode
.
substring
(
0
,
1
);
ResponseModel
<
String
>
stringResponseModel
=
tzsServiceFeignClient
.
useRegistrationCode
(
name
+
type
+
"陕"
+
city
);
return
stringResponseModel
.
getResult
();
}
return
null
;
}
}
\ 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