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
c9b389a2
Commit
c9b389a2
authored
Dec 26, 2023
by
KeYong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
2c62b9ae
ae63084e
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
431 additions
and
234 deletions
+431
-234
JgEnableDisableDto.java
...ejoin/amos/boot/module/jg/api/dto/JgEnableDisableDto.java
+5
-0
WorkFlowStatusEnum.java
...oin/amos/boot/module/jg/api/enums/WorkFlowStatusEnum.java
+9
-1
JgEnableDisableMapper.java
...amos/boot/module/jg/api/mapper/JgEnableDisableMapper.java
+8
-0
IJgEquipTransferService.java
...s/boot/module/jg/api/service/IJgEquipTransferService.java
+0
-8
JgChangeRegistrationUnitMapper.xml
.../main/resources/mapper/JgChangeRegistrationUnitMapper.xml
+3
-2
JgEnableDisableMapper.xml
...g-api/src/main/resources/mapper/JgEnableDisableMapper.xml
+68
-0
JgEnableDisableController.java
...t/module/jg/biz/controller/JgEnableDisableController.java
+41
-60
JgEquipTransferController.java
...t/module/jg/biz/controller/JgEquipTransferController.java
+1
-2
JgChangeRegistrationUnitServiceImpl.java
...biz/service/impl/JgChangeRegistrationUnitServiceImpl.java
+10
-107
JgEnableDisableServiceImpl.java
...odule/jg/biz/service/impl/JgEnableDisableServiceImpl.java
+251
-12
JgEquipTransferServiceImpl.java
...odule/jg/biz/service/impl/JgEquipTransferServiceImpl.java
+35
-42
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/JgEnableDisableDto.java
View file @
c9b389a2
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
...
@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
*
*
...
@@ -75,4 +76,8 @@ public class JgEnableDisableDto extends BaseDto {
...
@@ -75,4 +76,8 @@ public class JgEnableDisableDto extends BaseDto {
@ApiModelProperty
(
value
=
"申请类型(1启用,0停用)"
)
@ApiModelProperty
(
value
=
"申请类型(1启用,0停用)"
)
private
String
applyType
;
private
String
applyType
;
private
List
<
String
>
roleIds
;
private
String
type
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/WorkFlowStatusEnum.java
View file @
c9b389a2
...
@@ -71,7 +71,15 @@ public enum WorkFlowStatusEnum {
...
@@ -71,7 +71,15 @@ public enum WorkFlowStatusEnum {
UNITCHANGE_SUBMIT
(
"使用单位提交"
,
"unitChangeSubmit"
,
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
),
UNITCHANGE_SUBMIT
(
"使用单位提交"
,
"unitChangeSubmit"
,
"使用单位待提交"
,
"一级受理已驳回"
,
"使用单位已撤回"
),
UNITCHANGE_RECEIVE
(
"一级受理"
,
"unitChangeReceive"
,
"一级待受理"
,
"二级受理已驳回"
,
"一级受理已撤回"
),
UNITCHANGE_RECEIVE
(
"一级受理"
,
"unitChangeReceive"
,
"一级待受理"
,
"二级受理已驳回"
,
"一级受理已撤回"
),
UNITCHANGE_PRELIMINARY
(
"二级受理"
,
"unitChangePreliminary"
,
"二级待受理"
,
"三级受理已驳回"
,
"二级受理已撤回"
),
UNITCHANGE_PRELIMINARY
(
"二级受理"
,
"unitChangePreliminary"
,
"二级待受理"
,
"三级受理已驳回"
,
"二级受理已撤回"
),
UNITCHANGE_REEXAMINE
(
"三级受理"
,
"unitChangeReexamine"
,
"三级待受理"
,
""
,
""
);
UNITCHANGE_REEXAMINE
(
"三级受理"
,
"unitChangeReexamine"
,
"三级待受理"
,
""
,
""
),
/**
* 停用启用流程
*/
ENABLE_SUBMIT
(
"使用单位提交"
,
"enableSubmit"
,
"待提交"
,
"已驳回"
,
"已撤回"
),
ENABLE_RECEIVE
(
"监管受理"
,
"enableReceive"
,
"待受理"
,
""
,
""
);
private
final
String
name
;
private
final
String
name
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgEnableDisableMapper.java
View file @
c9b389a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
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.JgEnableDisableDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
/**
/**
* Mapper 接口
* Mapper 接口
...
@@ -11,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -11,4 +16,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
*/
public
interface
JgEnableDisableMapper
extends
BaseMapper
<
JgEnableDisable
>
{
public
interface
JgEnableDisableMapper
extends
BaseMapper
<
JgEnableDisable
>
{
Page
<
Map
<
String
,
Object
>>
pageList
(
@Param
(
"page"
)
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"dto"
)
JgEnableDisableDto
dto
);
Map
<
String
,
Object
>
getDetail
(
@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/IJgEquipTransferService.java
View file @
c9b389a2
...
@@ -34,12 +34,4 @@ public interface IJgEquipTransferService extends IService<JgEquipTransfer> {
...
@@ -34,12 +34,4 @@ public interface IJgEquipTransferService extends IService<JgEquipTransfer> {
* @return 设备移交详情
* @return 设备移交详情
*/
*/
Map
<
String
,
Object
>
queryBySequenceNbr
(
Long
sequenceNbr
);
Map
<
String
,
Object
>
queryBySequenceNbr
(
Long
sequenceNbr
);
/**
* 保存设备移交接口
* @param submitType 按钮类型
* @param dto dto
* @param selectedOrgInfo reginParams
*/
void
saveEquipTransfer
(
String
submitType
,
Map
<
String
,
JgEquipTransferDto
>
dto
,
ReginParams
selectedOrgInfo
);
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgChangeRegistrationUnitMapper.xml
View file @
c9b389a2
...
@@ -58,7 +58,8 @@
...
@@ -58,7 +58,8 @@
</if>
</if>
</where>
</where>
ORDER BY
ORDER BY
isn.create_date,isn.apply_no DESC
isn.create_date DESC, isn.apply_no DESC
</select>
</select>
<select
id=
"queryEquipInformation"
resultType=
"java.util.Map"
>
<select
id=
"queryEquipInformation"
resultType=
"java.util.Map"
>
...
@@ -67,7 +68,7 @@
...
@@ -67,7 +68,7 @@
isn.apply_no AS applyNo,
isn.apply_no AS applyNo,
isn.change_certificate AS changeCertificate,
isn.change_certificate AS changeCertificate,
isn.remark AS remark,
isn.remark AS remark,
isn.
use_regist_code
AS equRegisterCode,
isn.
equ_code_b
AS equRegisterCode,
ri.equ_list AS equList,
ri.equ_list AS equList,
ri.equ_category AS equCategory,
ri.equ_category AS equCategory,
ri.EQU_DEFINE AS equDefine,
ri.EQU_DEFINE AS equDefine,
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgEnableDisableMapper.xml
View file @
c9b389a2
...
@@ -2,4 +2,72 @@
...
@@ -2,4 +2,72 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!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.JgEnableDisableMapper"
>
<mapper
namespace=
"com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper"
>
<select
id=
"pageList"
resultType=
"java.util.Map"
>
SELECT jed.sequence_nbr as sequenceNbr,
jed.apply_no as applyNo,
date_format(jed.apply_date, '%Y-%m-%d') as applyDate,
CASE
when
jed.apply_type = 1 then '停用'
else '启用' end as applyType,
jri.USE_ORG_CODE as useOrgCode,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine,
jri.PRODUCT_NAME as productName,
use.USE_UNIT_NAME as useUnitName,
jed.receive_org_name as receiveOrgName,
concat(use."PROVINCE_NAME", '-', use."CITY_NAME", '-', use."COUNTY_NAME", '-', use."ADDRESS") as address,
use."USE_INNER_CODE" as useInnerCode,
jed.audit_status as auditStatus,
date_format(jed.audit_pass_date, '%Y-%m-%d') as auditPassDate,
jed.instance_id as instanceId,
jed.execute_sequence as executeSequence,
jed.next_executor_ids as nextExecutorIds,
jed.promoter
FROM tzs_jg_enable_disable jed
LEFT JOIN tzs_jg_enable_disable_eq jede on jed.sequence_nbr = jede.enable_disable_apply_id
LEFT JOIN idx_biz_jg_register_info jri on jede.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on jri.RECORD = use.RECORD
<where>
<if
test=
"dto.applyNo != null and dto.applyNo != '' "
>
and jed.apply_no like concat('%',#{dto.applyNo},'%')
</if>
<if
test=
"dto.applyNo != null and dto.applyNo != '' "
>
and jed.apply_no = #{dto.receiveOrgCode}
</if>
<if
test=
"dto.auditStatus != null and dto.auditStatus != '' "
>
and jed.audit_status = #{dto.auditStatus}
</if>
<if
test=
"dto.type == 'enterprise'"
>
and jed.use_unit_credit_code = #{dto.useUnitCreditCode}
</if>
<if
test=
"dto.type == 'supervision'"
>
and jed.receive_org_code = #{dto.useUnitCreditCode}
</if>
<if
test=
"dto.roleIds != null and dto.type == 'supervision'"
>
<foreach
collection=
'dto.roleIds'
item=
'role'
open=
'and ('
close=
')'
separator=
'or'
>
execute_sequence like concat('%',#{role},'%')
</foreach>
</if>
</where>
order by jed.rec_date desc
</select>
<select
id=
"getDetail"
resultType=
"java.util.Map"
>
SELECT jed.sequence_nbr as sequenceNbr,
concat(jed.receive_org_code,'_',jed.receive_org_name) as receiveOrgCode,
concat(use."PROVINCE_NAME", use."CITY_NAME", use."COUNTY_NAME", use."ADDRESS",
use.STREET_NAME) as address,
jri.EQU_CODE as equCode,
jed.apply_type as applyType,
jed.remark,
use.RECORD as record,
jfi.FACTORY_NUM as factoryNum
FROM tzs_jg_enable_disable jed
LEFT JOIN tzs_jg_enable_disable_eq jede on jed.sequence_nbr = jede.enable_disable_apply_id
LEFT JOIN idx_biz_jg_register_info jri on jede.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on jri.RECORD = use.RECORD
LEFT JOIN idx_biz_jg_factory_info jfi on jri.RECORD = jfi.RECORD
where jed.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
</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/JgEnableDisableController.java
View file @
c9b389a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationEqDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgEnableDisableServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto
;
...
@@ -18,8 +26,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...
@@ -18,8 +26,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
/**
/**
*
*
* @author system_generator
* @author system_generator
* @date 2023-12-25
* @date 2023-12-25
*/
*/
...
@@ -39,78 +45,53 @@ public class JgEnableDisableController extends BaseController {
...
@@ -39,78 +45,53 @@ public class JgEnableDisableController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
<
JgEnableDisableDto
>
save
(
@RequestBody
JgEnableDisableDto
model
)
{
public
ResponseModel
<
Object
>
save
(
@RequestBody
JSONObject
map
)
{
model
=
jgEnableDisableServiceImpl
.
createWithModel
(
model
);
jgEnableDisableServiceImpl
.
saveOrUpdate
(
map
);
return
ResponseHelper
.
buildResponse
(
model
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"使用登记设备关系表分页查询"
,
notes
=
"使用登记设备关系表分页查询"
)
public
ResponseModel
<
JgEnableDisableDto
>
updateBySequenceNbrJgEnableDisable
(
@RequestBody
JgEnableDisableDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
page
(
@RequestParam
(
value
=
"current"
)
int
current
,
model
.
setSequenceNbr
(
sequenceNbr
);
@RequestParam
(
value
=
"size"
)
int
size
,
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
updateWithModel
(
model
));
JgEnableDisableDto
dto
)
{
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
pageList
(
page
,
dto
));
}
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@PostMapping
(
value
=
"/flowExecute"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除"
,
notes
=
"根据sequenceNbr删除"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行流程"
,
notes
=
"执行流程"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
public
ResponseModel
<
Object
>
flowExecute
(
@RequestBody
JSONObject
map
)
{
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
removeById
(
sequenceNbr
));
jgEnableDisableServiceImpl
.
flowExecute
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))),
String
.
valueOf
(
map
.
get
(
"instanceId"
)),
String
.
valueOf
(
map
.
get
(
"operate"
)),
String
.
valueOf
(
map
.
get
(
"comment"
)));
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@PostMapping
(
value
=
"/withdraw"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个"
,
notes
=
"根据sequenceNbr查询单个"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
public
ResponseModel
<
JgEnableDisableDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
public
ResponseModel
<
Object
>
withdraw
(
@RequestBody
JSONObject
map
)
{
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
queryBySeq
(
sequenceNbr
));
jgEnableDisableServiceImpl
.
withdraw
(
String
.
valueOf
(
map
.
get
(
"instanceId"
)));
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@DeleteMapping
(
value
=
"/deleteMessage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"删除"
,
notes
=
"删除"
)
public
ResponseModel
<
Page
<
JgEnableDisableDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
public
ResponseModel
<
Object
>
deleteMessage
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
(
value
=
"size"
)
int
size
)
{
jgEnableDisableServiceImpl
.
deleteMessage
(
sequenceNbr
);
Page
<
JgEnableDisableDto
>
page
=
new
Page
<
JgEnableDisableDto
>();
return
ResponseHelper
.
buildResponse
(
"ok"
);
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
queryForJgEnableDisablePage
(
page
));
}
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询
"
)
@GetMapping
(
value
=
"/detail
"
)
@GetMapping
(
value
=
"/list
"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"详情"
,
notes
=
"详情
"
)
public
ResponseModel
<
List
<
JgEnableDisableDto
>>
selectForList
(
)
{
public
ResponseModel
<
Object
>
detail
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
queryForJgEnableDisableList
(
));
return
ResponseHelper
.
buildResponse
(
jgEnableDisableServiceImpl
.
getDetail
(
sequenceNbr
));
}
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgEquipTransferController.java
View file @
c9b389a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.jg.api.common.BaseException
;
import
com.yeejoin.amos.boot.module.jg.api.common.BaseException
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEquipTransfer
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
...
@@ -132,7 +131,7 @@ public class JgEquipTransferController extends BaseController {
...
@@ -132,7 +131,7 @@ public class JgEquipTransferController extends BaseController {
String
companyCode
=
companyModels
.
get
(
0
).
getCompanyCode
();
String
companyCode
=
companyModels
.
get
(
0
).
getCompanyCode
();
String
companyName
=
companyModels
.
get
(
0
).
getCompanyName
();
String
companyName
=
companyModels
.
get
(
0
).
getCompanyName
();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
"个人主体"
.
equals
(
companyType
))
{
if
(
"个人主体"
.
equals
(
companyType
))
{
map
.
put
(
"useUnitName"
,
companyName
.
split
(
"_"
)[
1
]);
map
.
put
(
"useUnitName"
,
companyName
.
split
(
"_"
)[
1
]);
map
.
put
(
"useUnitCreditCode"
,
companyCode
.
split
(
"_"
)[
1
]);
map
.
put
(
"useUnitCreditCode"
,
companyCode
.
split
(
"_"
)[
1
]);
map
.
put
(
"companyType"
,
"person"
);
map
.
put
(
"companyType"
,
"person"
);
...
...
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
View file @
c9b389a2
...
@@ -297,112 +297,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -297,112 +297,6 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
return
this
.
updateBatchById
(
JgChangeRegistrationUnits
);
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
@Override
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
...
@@ -509,7 +403,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -509,7 +403,7 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
dto
.
setEquType
((
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY"
))));
dto
.
setEquType
((
String
.
valueOf
(
obj
.
get
(
"EQU_CATEGORY"
))));
dto
.
setProductNameB
((
String
.
valueOf
(
obj
.
get
(
"PRODUCT_NAME"
))));
dto
.
setProductNameB
((
String
.
valueOf
(
obj
.
get
(
"PRODUCT_NAME"
))));
dto
.
setEquCodeB
((
String
.
valueOf
(
obj
.
get
(
"EQU_CODE"
))));
dto
.
setEquCodeB
((
String
.
valueOf
(
obj
.
get
(
"EQU_CODE"
))));
dto
.
setUseInnerCode
(
(
String
.
valueOf
(
obj
.
get
(
"USE_INNER_CODE"
)
)));
dto
.
setUseInnerCode
(
ValidationUtil
.
isEmpty
(
obj
.
get
(
"USE_INNER_CODE"
))
?
""
:
String
.
valueOf
(
obj
.
get
(
"USE_INNER_CODE"
)));
dto
.
setEquAddress
((
String
.
valueOf
(
obj
.
get
(
"ADDRESS"
))));
dto
.
setEquAddress
((
String
.
valueOf
(
obj
.
get
(
"ADDRESS"
))));
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
...
@@ -573,6 +467,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
...
@@ -573,6 +467,15 @@ public class JgChangeRegistrationUnitServiceImpl extends BaseService<JgChangeReg
}
}
}
}
String
newUseUnitId
=
model
.
getNewUseUnitCreditCode
();
if
(!
ObjectUtils
.
isEmpty
(
newUseUnitId
))
{
String
[]
newUseUnitList
=
newUseUnitId
.
split
(
"_"
);
if
(
newUseUnitList
.
length
>
1
)
{
model
.
setNewUseUnitCreditCode
(
newUseUnitList
[
0
]);
model
.
setNewUseUnitName
(
newUseUnitList
[
1
]);
}
}
String
receiveOrgCode
=
model
.
getReceiveOrgCode
();
String
receiveOrgCode
=
model
.
getReceiveOrgCode
();
if
(!
ObjectUtils
.
isEmpty
(
receiveOrgCode
))
{
if
(!
ObjectUtils
.
isEmpty
(
receiveOrgCode
))
{
String
[]
receiveOrgCodeList
=
receiveOrgCode
.
split
(
"_"
);
String
[]
receiveOrgCodeList
=
receiveOrgCode
.
split
(
"_"
);
...
...
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/JgEnableDisableServiceImpl.java
View file @
c9b389a2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisable
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgEnableDisableEq
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgMaintenanceContract
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.enums.WorkFlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgEnableDisableMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgEnableDisableService
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgEnableDisableDto
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.ApplicationFormTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
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.factory.annotation.Autowired
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
/**
/**
* 服务实现类
* 服务实现类
...
@@ -16,18 +43,229 @@ import java.util.List;
...
@@ -16,18 +43,229 @@ import java.util.List;
* @date 2023-12-25
* @date 2023-12-25
*/
*/
@Service
@Service
public
class
JgEnableDisableServiceImpl
extends
BaseService
<
JgEnableDisableDto
,
JgEnableDisable
,
JgEnableDisableMapper
>
implements
IJgEnableDisableService
{
public
class
JgEnableDisableServiceImpl
extends
BaseService
<
JgEnableDisableDto
,
JgEnableDisable
,
JgEnableDisableMapper
>
implements
IJgEnableDisableService
{
/**
* 分页查询
@Autowired
*/
WorkFlowFeignService
workFlowFeginService
;
public
Page
<
JgEnableDisableDto
>
queryForJgEnableDisablePage
(
Page
<
JgEnableDisableDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
@Autowired
RedisUtils
redisUtils
;
@Autowired
JgEnableDisableEqServiceImpl
jgEnableDisableEqService
;
@Autowired
TzsServiceFeignClient
tzsServiceFeignClient
;
private
final
String
WORK_FLOW_KEY
=
"deactivateEnable"
;
public
void
saveOrUpdate
(
JSONObject
map
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
JgEnableDisable
jgEnableDisable
=
new
JgEnableDisable
();
BeanUtil
.
copyProperties
(
map
,
jgEnableDisable
);
jgEnableDisable
.
setApplyDate
(
new
Date
());
String
submit
=
String
.
valueOf
(
map
.
get
(
"submit"
));
String
pageType
=
String
.
valueOf
(
map
.
get
(
"pageType"
));
if
(
map
.
containsKey
(
"receiveOrgCode"
))
{
// 接收机构
String
[]
splitMaintenanceUnitCode
=
String
.
valueOf
(
map
.
getString
(
"receiveOrgCode"
)).
split
(
"_"
);
jgEnableDisable
.
setReceiveOrgCode
(
splitMaintenanceUnitCode
[
0
]);
jgEnableDisable
.
setReceiveOrgName
(
splitMaintenanceUnitCode
[
1
]);
}
jgEnableDisable
.
setUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
jgEnableDisable
.
setUseUnitName
(
reginParams
.
getCompany
().
getCompanyName
());
// 仅保存
if
(
"add"
.
equals
(
pageType
))
{
// 获取申请编号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
if
(!
ObjectUtils
.
isEmpty
(
listResponseModel
))
{
jgEnableDisable
.
setApplyNo
(
listResponseModel
.
getResult
().
get
(
0
));
}
jgEnableDisable
.
setAuditStatus
(
WorkFlowStatusEnum
.
ENABLE_SUBMIT
.
getPass
());
this
.
save
(
jgEnableDisable
);
}
else
{
// 编辑
jgEnableDisable
.
setSequenceNbr
(
Long
.
valueOf
(
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
))));
this
.
baseMapper
.
updateById
(
jgEnableDisable
);
LambdaQueryWrapper
<
JgEnableDisableEq
>
lambda
=
new
QueryWrapper
<
JgEnableDisableEq
>().
lambda
();
lambda
.
eq
(
JgEnableDisableEq:
:
getEnableDisableApplyId
,
String
.
valueOf
(
map
.
get
(
"sequenceNbr"
)));
jgEnableDisableEqService
.
getBaseMapper
().
delete
(
lambda
);
}
// 关联设备表
JgEnableDisableEq
jgEnableDisableEq
=
new
JgEnableDisableEq
();
jgEnableDisableEq
.
setEquId
(
String
.
valueOf
(
map
.
get
(
"record"
)));
jgEnableDisableEq
.
setEnableDisableApplyId
(
jgEnableDisable
.
getSequenceNbr
().
toString
());
jgEnableDisableEqService
.
save
(
jgEnableDisableEq
);
// 提交启动流程
if
(
"1"
.
equals
(
submit
))
{
String
instanceId
=
""
;
if
(
map
.
containsKey
(
"instanceId"
))
{
instanceId
=
map
.
get
(
"instanceId"
).
toString
();
}
else
{
instanceId
=
startByVariable
();
}
if
(!
ObjectUtils
.
isEmpty
(
instanceId
))
{
// 更新数据状态
updateExecuteIds
(
instanceId
,
jgEnableDisable
.
getSequenceNbr
(),
"0"
);
// 执行流程
flowExecute
(
jgEnableDisable
.
getSequenceNbr
(),
instanceId
,
"0"
,
""
);
}
}
}
}
/**
* 列表查询 示例
public
Page
<
Map
<
String
,
Object
>>
pageList
(
Page
<
Map
<
String
,
Object
>>
page
,
JgEnableDisableDto
dto
)
{
*/
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
public
List
<
JgEnableDisableDto
>
queryForJgEnableDisableList
()
{
dto
.
setUseUnitCreditCode
(
reginParams
.
getCompany
().
getCompanyCode
());
return
this
.
queryForList
(
""
,
false
);
return
this
.
baseMapper
.
pageList
(
page
,
dto
);
}
public
String
startByVariable
()
{
String
instanceId
=
""
;
//启动流程
try
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
WORK_FLOW_KEY
);
dto
.
setBusinessKey
(
"submit"
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
instanceId
=
((
Map
<?,
?>)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
return
instanceId
;
}
public
void
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
)
{
try
{
JSONObject
task
=
workFlowFeginService
.
getTaskNoAuth
(
instanceId
);
JSONObject
taskMessage
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
task
.
get
(
"data"
)));
String
taskId
=
taskMessage
.
getString
(
"id"
);
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
dto
.
setComment
(
comment
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
operate
);
dto
.
setVariable
(
map
);
//执行流程
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// 更新下一步执行人
updateExecuteIds
(
instanceId
,
id
,
operate
);
}
public
void
withdraw
(
String
instanceId
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
taskCode
=
""
;
JgEnableDisable
jgEnableDisable
=
new
JgEnableDisable
();
LambdaQueryWrapper
<
JgEnableDisable
>
lambda
=
new
QueryWrapper
<
JgEnableDisable
>().
lambda
();
lambda
.
eq
(
JgEnableDisable:
:
getInstanceId
,
instanceId
);
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
try
{
workFlowFeginService
.
rollBack
(
instanceId
);
JSONObject
taskNoAuth
=
workFlowFeginService
.
getTaskNoAuth
(
instanceId
);
JSONObject
nextTask
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
taskNoAuth
.
get
(
"data"
)));
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
.
get
(
"data"
)))
{
String
nextTaskId
=
nextTask
.
getString
(
"id"
);
FeignClientResult
<
JSONObject
>
nodeInfo
=
workFlowFeginService
.
getNodeInfo
(
nextTaskId
);
JSONObject
result
=
nodeInfo
.
getResult
();
Map
<
String
,
Object
>
taskInfo
=
(
Map
<
String
,
Object
>)
result
.
get
(
"taskInfo"
);
taskCode
=
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"
))
{
roleList
.
add
(((
Map
<?,
?>)
datum
).
get
(
"groupId"
).
toString
());
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(!
ObjectUtils
.
isEmpty
(
taskCode
))
{
jgEnableDisable
.
setAuditStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getRollBack
());
}
String
join
=
String
.
join
(
","
,
roleList
);
jgEnableDisable
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
jgEnableDisable
.
setNextExecutorIds
(
join
);
this
.
update
(
jgEnableDisable
,
lambda
);
}
public
void
updateExecuteIds
(
String
instanceId
,
Long
sequenceNbr
,
String
operate
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
role
=
""
;
String
taskCode
=
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
();
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
JgEnableDisable
jgEnableDisable
=
this
.
getBaseMapper
().
selectById
(
sequenceNbr
);
try
{
// 查询下节点任务
JSONObject
taskNoAuth
=
workFlowFeginService
.
getTaskNoAuth
(
instanceId
);
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
.
get
(
"data"
)))
{
JSONObject
nextTask
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
taskNoAuth
.
get
(
"data"
)));
String
nextTaskId
=
nextTask
.
getString
(
"id"
);
FeignClientResult
<
JSONObject
>
nodeInfo
=
workFlowFeginService
.
getNodeInfo
(
nextTaskId
);
JSONObject
result
=
nodeInfo
.
getResult
();
Map
<
String
,
Object
>
taskInfo
=
(
Map
<
String
,
Object
>)
result
.
get
(
"taskInfo"
);
taskCode
=
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"
))
{
roleList
.
add
(((
Map
)
datum
).
get
(
"groupId"
).
toString
());
}
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
if
(!
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
().
equals
(
taskCode
))
{
role
=
String
.
join
(
","
,
roleList
);
jgEnableDisable
.
setNextExecutorIds
(
role
);
jgEnableDisable
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
jgEnableDisable
.
setInstanceId
(
instanceId
);
jgEnableDisable
.
setApplyDate
(
new
Date
());
if
(!
ObjectUtils
.
isEmpty
(
jgEnableDisable
.
getExecuteSequence
()))
{
jgEnableDisable
.
setExecuteSequence
(
jgEnableDisable
.
getExecuteSequence
()
+
","
+
role
);
}
else
{
jgEnableDisable
.
setExecuteSequence
(
role
);
}
if
(
"0"
.
equals
(
operate
))
{
// 通过操作
jgEnableDisable
.
setAuditStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getPass
());
}
else
{
// 驳回操作
jgEnableDisable
.
setAuditStatus
(
WorkFlowStatusEnum
.
getMessage
(
taskCode
).
getReject
());
jgEnableDisable
.
setPromoter
(
null
);
}
}
else
{
jgEnableDisable
.
setAuditStatus
(
taskCode
);
jgEnableDisable
.
setAuditPassDate
(
new
Date
());
}
this
.
getBaseMapper
().
updateById
(
jgEnableDisable
);
}
public
void
deleteMessage
(
Long
sequenceNbr
)
{
this
.
baseMapper
.
deleteById
(
sequenceNbr
);
LambdaQueryWrapper
<
JgEnableDisableEq
>
lambda
=
new
QueryWrapper
<
JgEnableDisableEq
>().
lambda
();
lambda
.
eq
(
JgEnableDisableEq:
:
getEnableDisableApplyId
,
sequenceNbr
);
jgEnableDisableEqService
.
getBaseMapper
().
delete
(
lambda
);
}
public
Map
<
String
,
Object
>
getDetail
(
Long
sequenceNbr
)
{
return
this
.
baseMapper
.
getDetail
(
sequenceNbr
);
}
}
}
\ 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/JgEquipTransferServiceImpl.java
View file @
c9b389a2
...
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON;
...
@@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
...
@@ -30,14 +29,15 @@ import org.apache.commons.lang3.ObjectUtils;
...
@@ -30,14 +29,15 @@ import org.apache.commons.lang3.ObjectUtils;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.text.ParseException
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
...
@@ -49,7 +49,7 @@ import java.util.stream.Collectors;
*/
*/
@Slf4j
@Slf4j
@Service
@Service
public
class
JgEquipTransferServiceImpl
extends
BaseService
<
JgEquipTransferDto
,
JgEquipTransfer
,
JgEquipTransferMapper
>
implements
IJgEquipTransferService
{
public
class
JgEquipTransferServiceImpl
extends
BaseService
<
JgEquipTransferDto
,
JgEquipTransfer
,
JgEquipTransferMapper
>
implements
IJgEquipTransferService
{
private
static
final
String
EQUIP_TRANSFER_PROCESS_KEY
=
"equipmentHandover"
;
private
static
final
String
EQUIP_TRANSFER_PROCESS_KEY
=
"equipmentHandover"
;
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
private
static
final
String
SUBMIT_TYPE_FLOW
=
"1"
;
...
@@ -80,20 +80,26 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -80,20 +80,26 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
return
;
return
;
}
}
// 获取设备移交顺序号
ResponseModel
<
List
<
String
>>
listResponseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SBYJ
.
getCode
(),
deviceList
.
size
());
ResponseModel
<
List
<
String
>>
responseModel
=
tzsServiceFeignClient
.
applicationFormCode
(
ApplicationFormTypeEnum
.
SBYJ
.
getCode
(),
deviceList
.
size
());
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
listResponseModel
)
&&
listResponseModel
.
getStatus
()
!=
HttpStatus
.
OK
.
value
())
{
if
(
CollectionUtils
.
isEmpty
(
responseModel
.
getResult
()))
{
log
.
error
(
"告知单获取失败: {}"
,
listResponseModel
.
getMessage
());
return
;
throw
new
BadRequest
(
"告知单生成失败!"
);
}
List
<
String
>
applyNoList
=
listResponseModel
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
log
.
error
(
"告知单返回为空"
);
throw
new
BadRequest
(
"告知单生成失败!"
);
}
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
// 判断当前是否为提交
ArrayList
<
String
>
instanceIdList
=
new
ArrayList
<>();
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
// 发起流程
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
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
();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
EQUIP_TRANSFER_PROCESS_KEY
);
dto
.
setProcessDefinitionKey
(
EQUIP_TRANSFER_PROCESS_KEY
);
...
@@ -105,14 +111,14 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -105,14 +111,14 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
try
{
try
{
FeignClientResult
result
=
Workflow
.
taskV2Client
.
startByVariableBatch
(
actWorkflowBatchDTO
);
FeignClientResult
result
=
Workflow
.
taskV2Client
.
startByVariableBatch
(
actWorkflowBatchDTO
);
List
<
Object
>
returnList
=
(
List
<
Object
>)
result
.
getResult
();
List
<
Object
>
returnList
=
(
List
<
Object
>)
result
.
getResult
();
for
(
Object
obj
:
returnList
for
(
Object
obj
:
returnList
)
{
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSONObject
.
toJSONString
(
obj
));
String
instanceId
=
jsonObject
.
getString
(
"id"
);
String
instanceId
=
jsonObject
.
getString
(
"id"
);
instanceIdList
.
add
(
instanceId
);
instanceIdList
.
add
(
instanceId
);
// 查询下节点任务
// 查询下节点任务
if
(
returnList
.
get
(
0
).
equals
(
obj
))
{
if
(
returnList
.
get
(
0
).
equals
(
obj
))
{
getNext
(
roleListFirst
,
instanceId
,
taskName
);
getNext
(
roleListFirst
,
instanceId
,
taskName
);
}
}
// 推动下一个节点
// 推动下一个节点
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
...
@@ -131,7 +137,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -131,7 +137,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
try
{
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
if
(
ajaxResult1
.
get
(
"code"
).
equals
(
200
))
{
if
(
ajaxResult1
.
get
(
"code"
).
equals
(
200
))
{
getNext
(
roleListSecond
,
instanceId
,
taskName
);
getNext
(
roleListSecond
,
instanceId
,
taskName
);
}
else
{
}
else
{
log
.
error
(
"提交失败"
);
log
.
error
(
"提交失败"
);
}
}
...
@@ -151,11 +157,11 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -151,11 +157,11 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
JgEquipTransfer
dto
=
new
JgEquipTransfer
();
JgEquipTransfer
dto
=
new
JgEquipTransfer
();
BeanUtils
.
copyProperties
(
model
,
dto
);
BeanUtils
.
copyProperties
(
model
,
dto
);
int
i
=
deviceList
.
indexOf
(
obj
);
int
i
=
deviceList
.
indexOf
(
obj
);
String
applyNo
=
responseModel
.
getResult
()
.
get
(
i
);
String
applyNo
=
applyNoList
.
get
(
i
);
dto
.
setApplyNo
(
applyNo
);
dto
.
setApplyNo
(
applyNo
);
dto
.
setApplyDate
(
new
Date
());
dto
.
setApplyDate
(
new
Date
());
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
dto
.
setNextExecuteIds
(
String
.
join
(
","
,
roleListSecond
));
dto
.
setNextExecuteIds
(
String
.
join
(
","
,
roleListSecond
));
dto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
dto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
...
@@ -216,6 +222,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -216,6 +222,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
/**
/**
* 启动工作流
* 启动工作流
*
* @param businessKey businessKey
* @param businessKey businessKey
* @return s
* @return s
* @throws Exception e
* @throws Exception e
...
@@ -248,7 +255,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -248,7 +255,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
equipTransferDto
.
setApplyStatusDesc
(
FlowStatusEnum
.
getNameByType
(
Long
.
valueOf
(
transfer
.
getApplyStatus
())));
equipTransferDto
.
setApplyStatusDesc
(
FlowStatusEnum
.
getNameByType
(
Long
.
valueOf
(
transfer
.
getApplyStatus
())));
}
}
return
equipTransferDto
;
return
equipTransferDto
;
}).
collect
(
java
.
util
.
stream
.
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
equipTransferDtoPage
.
setRecords
(
records
);
equipTransferDtoPage
.
setRecords
(
records
);
return
equipTransferDtoPage
;
return
equipTransferDtoPage
;
...
@@ -280,12 +287,6 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -280,12 +287,6 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
return
resultMap
;
return
resultMap
;
}
}
@Override
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
public
void
saveEquipTransfer
(
String
submitType
,
Map
<
String
,
JgEquipTransferDto
>
dto
,
ReginParams
selectedOrgInfo
)
{
String
[]
taskName
=
new
String
[]{
"流程结束"
};
}
private
Map
<
String
,
Object
>
createEquipTransferInfo
(
JgEquipTransfer
equipTransfer
)
{
private
Map
<
String
,
Object
>
createEquipTransferInfo
(
JgEquipTransfer
equipTransfer
)
{
Map
<
String
,
Object
>
equipTransferInfo
=
new
HashMap
<>(
BeanUtil
.
beanToMap
(
equipTransfer
));
Map
<
String
,
Object
>
equipTransferInfo
=
new
HashMap
<>(
BeanUtil
.
beanToMap
(
equipTransfer
));
equipTransferInfo
.
put
(
"installUnitCreditCode"
,
equipTransfer
.
getInstallUnitCreditCode
()
+
"_"
+
equipTransfer
.
getInstallUnitName
());
equipTransferInfo
.
put
(
"installUnitCreditCode"
,
equipTransfer
.
getInstallUnitCreditCode
()
+
"_"
+
equipTransfer
.
getInstallUnitName
());
...
@@ -303,23 +304,15 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -303,23 +304,15 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
String
userId
=
RequestContext
.
getExeUserId
();
String
userId
=
RequestContext
.
getExeUserId
();
JgEquipTransfer
jgEquipTransfer
=
this
.
baseMapper
.
selectById
(
jgEquipTransferDto
.
getSequenceNbr
());
JgEquipTransfer
jgEquipTransfer
=
this
.
baseMapper
.
selectById
(
jgEquipTransferDto
.
getSequenceNbr
());
jgEquipTransfer
.
setProcessAdvice
(
jgEquipTransferDto
.
getProcessAdvice
());
jgEquipTransfer
.
setProcessAdvice
(
jgEquipTransferDto
.
getProcessAdvice
());
// 组装设备注册代码
StringBuffer
stringBuffer
=
new
StringBuffer
();
String
ym
=
null
;
try
{
ym
=
DateUtils
.
dateFormat
(
new
Date
(),
DateUtils
.
DATE_PATTERN_MM
);
}
catch
(
ParseException
e
)
{
log
.
error
(
"日期转换失败:{}"
,
e
.
getMessage
());
}
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
boolean
submit
=
submit
(
jgEquipTransfer
,
op
);
boolean
submit
=
submit
(
jgEquipTransfer
,
op
);
if
(
submit
)
{
if
(
submit
)
{
getNext
(
roleList
,
jgEquipTransferDto
.
getInstanceId
(),
taskName
);
getNext
(
roleList
,
jgEquipTransferDto
.
getInstanceId
(),
taskName
);
jgEquipTransfer
.
setApplyStatus
(
taskName
[
0
]);
jgEquipTransfer
.
setApplyStatus
(
taskName
[
0
]);
if
(
"0"
.
equals
(
op
))
{
if
(
"0"
.
equals
(
op
))
{
if
(
roleList
.
isEmpty
())
{
if
(
roleList
.
isEmpty
())
{
jgEquipTransfer
.
setApplyStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
jgEquipTransfer
.
setApplyStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
jgEquipTransfer
.
setPromoter
(
""
);
jgEquipTransfer
.
setPromoter
(
""
);
}
else
{
}
else
{
...
@@ -341,7 +334,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -341,7 +334,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
}
}
}
}
public
boolean
submit
(
JgEquipTransfer
transfer
,
String
op
)
{
public
boolean
submit
(
JgEquipTransfer
transfer
,
String
op
)
{
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
transfer
.
getInstanceId
());
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
transfer
.
getInstanceId
());
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
String
taskId
=
dataObject
.
getString
(
"id"
);
...
@@ -354,7 +347,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -354,7 +347,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
map
.
put
(
"approvalStatus"
,
op
);
map
.
put
(
"approvalStatus"
,
op
);
dto
.
setVariable
(
map
);
dto
.
setVariable
(
map
);
//执行流程
//执行流程
AjaxResult
ajaxResult1
=
null
;
AjaxResult
ajaxResult1
;
try
{
try
{
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
return
ajaxResult1
.
get
(
"code"
).
equals
(
200
);
return
ajaxResult1
.
get
(
"code"
).
equals
(
200
);
...
@@ -396,7 +389,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -396,7 +389,7 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
equipTransferDto
.
setInstanceId
(
instanceId
);
equipTransferDto
.
setInstanceId
(
instanceId
);
// 查询下节点任务
// 查询下节点任务
getNext
(
roleListFirst
,
instanceId
,
taskName
);
getNext
(
roleListFirst
,
instanceId
,
taskName
);
equipTransferDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
equipTransferDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
.
getMessage
());
log
.
error
(
"提交失败:{}"
,
e
.
getMessage
());
...
@@ -404,13 +397,13 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
...
@@ -404,13 +397,13 @@ public class JgEquipTransferServiceImpl extends BaseService<JgEquipTransferDto,J
}
}
}
}
JgEquipTransfer
transfer
=
new
JgEquipTransfer
();
JgEquipTransfer
transfer
=
new
JgEquipTransfer
();
BeanUtils
.
copyProperties
(
equipTransferDto
,
transfer
);
BeanUtils
.
copyProperties
(
equipTransferDto
,
transfer
);
boolean
submit
=
submit
(
transfer
,
op
);
boolean
submit
=
submit
(
transfer
,
op
);
if
(
submit
)
{
if
(
submit
)
{
// 查询下节点任务
// 查询下节点任务
getNext
(
roleListSecond
,
transfer
.
getInstanceId
(),
taskName
);
getNext
(
roleListSecond
,
transfer
.
getInstanceId
(),
taskName
);
transfer
.
setApplyStatus
(
taskName
[
0
]);
transfer
.
setApplyStatus
(
taskName
[
0
]);
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
transfer
.
getInstanceStatus
()))
{
if
(!
org
.
springframework
.
util
.
ObjectUtils
.
isEmpty
(
transfer
.
getInstanceStatus
()))
{
transfer
.
setInstanceStatus
(
transfer
.
getInstanceStatus
()
+
","
+
roleListSecond
);
transfer
.
setInstanceStatus
(
transfer
.
getInstanceStatus
()
+
","
+
roleListSecond
);
...
...
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