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
654e2518
Commit
654e2518
authored
Dec 20, 2023
by
LiuLin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop_tzs_register' into develop_tzs_register
parents
8f394f5c
ac3cdfe6
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
875 additions
and
105 deletions
+875
-105
JgScrapCancelDto.java
...yeejoin/amos/boot/module/jg/api/dto/JgScrapCancelDto.java
+22
-3
JgScrapCancel.java
...yeejoin/amos/boot/module/jg/api/entity/JgScrapCancel.java
+4
-0
CancelFlowStatusEnum.java
...n/amos/boot/module/jg/api/enums/CancelFlowStatusEnum.java
+36
-0
JgScrapCancelMapper.java
...n/amos/boot/module/jg/api/mapper/JgScrapCancelMapper.java
+27
-0
JgInstallationNoticeMapper.xml
.../src/main/resources/mapper/JgInstallationNoticeMapper.xml
+1
-1
JgScrapCancelMapper.xml
...-jg-api/src/main/resources/mapper/JgScrapCancelMapper.xml
+207
-0
JgScrapCancelController.java
...oot/module/jg/biz/controller/JgScrapCancelController.java
+100
-78
JgChangeRegistrationReformServiceImpl.java
...z/service/impl/JgChangeRegistrationReformServiceImpl.java
+5
-6
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+3
-3
JgScrapCancelServiceImpl.java
.../module/jg/biz/service/impl/JgScrapCancelServiceImpl.java
+470
-14
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/JgScrapCancelDto.java
View file @
654e2518
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* 设备注销报废
...
...
@@ -15,10 +19,10 @@ import java.util.Date;
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"JgScrapCancelDto"
,
description
=
"设备注销报废"
)
public
class
JgScrapCancelDto
extends
BaseDto
{
@ApiModel
(
value
=
"JgScrapCancelDto"
,
description
=
"设备注销报废"
)
public
class
JgScrapCancelDto
extends
BaseDto
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"注销类型(1报废注销,2移装注销)"
)
...
...
@@ -63,7 +67,22 @@ public class JgScrapCancelDto extends BaseDto {
@ApiModelProperty
(
value
=
"注销证明"
)
private
String
cancelCertificate
;
@ApiModelProperty
(
value
=
"注销证明文件集合格式"
)
private
List
<
Map
<
String
,
Object
>>
cancelCertificateList
;
@TableField
(
exist
=
false
)
@ApiModelProperty
(
value
=
"告知设备列表"
)
private
List
<
Map
<
String
,
Object
>>
deviceList
;
@ApiModelProperty
(
value
=
"终审通过时间"
)
private
Date
auditPassDate
;
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/entity/JgScrapCancel.java
View file @
654e2518
...
...
@@ -112,4 +112,8 @@ public class JgScrapCancel extends BaseEntity {
@TableField
(
"audit_pass_date"
)
private
Date
auditPassDate
;
@TableField
(
value
=
"promoter"
)
private
String
promoter
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/enums/CancelFlowStatusEnum.java
0 → 100644
View file @
654e2518
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* 使用登记状态西悉尼
*/
@Getter
@AllArgsConstructor
public
enum
CancelFlowStatusEnum
{
SUBMIT
(
"使用单位提交"
,
"submit"
,
"使用单位待提交"
),
RECEIVE
(
"一级受理"
,
"receive"
,
"一级待受理"
),
PRELIMINARY
(
"二级受理"
,
"preliminary"
,
"二级待受理"
),
REEXAMINE
(
"三级受理"
,
"reexamine"
,
"三级待受理"
);
private
final
String
name
;
private
final
String
code
;
private
final
String
pass
;
public
static
CancelFlowStatusEnum
getMessage
(
String
name
){
for
(
CancelFlowStatusEnum
constants
:
values
())
{
if
(
constants
.
getName
().
equals
(
name
))
{
return
constants
;
}
}
return
null
;
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgScrapCancelMapper.java
View file @
654e2518
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.JgScrapCancelDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancel
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* 设备注销报废 Mapper 接口
...
...
@@ -11,4 +19,23 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
JgScrapCancelMapper
extends
BaseMapper
<
JgScrapCancel
>
{
Page
<
Map
<
String
,
Object
>>
getListPage
(
@Param
(
"page"
)
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"dto"
)
JgScrapCancelDto
dto
,
@Param
(
"roleIds"
)
List
<
String
>
roleIds
,
@Param
(
"orgCode"
)
String
orgCode
);
Map
<
String
,
Object
>
getDetail
(
@Param
(
"id"
)
String
id
);
Map
<
String
,
Object
>
getInspectDetail
(
@Param
(
"id"
)
String
id
);
Map
<
String
,
Object
>
getUseDetail
(
@Param
(
"id"
)
String
id
);
Page
<
Map
<
String
,
Object
>>
getEquipListPage
(
@Param
(
"page"
)
Page
<
Map
<
String
,
Object
>>
page
,
@Param
(
"factoryNum"
)
String
factoryNum
,
@Param
(
"equList"
)
String
equList
,
@Param
(
"equCategory"
)
String
equCategory
);
void
updatePromoter
(
@Param
(
"id"
)
Long
id
);
/**
* 根据安装告知编号查询设备、设计、制造等信息
*
* @param sequenceNbr 安装告知编号
*/
Map
<
String
,
Object
>
queryEquipInformation
(
@Param
(
"sequenceNbr"
)
long
sequenceNbr
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeMapper.xml
View file @
654e2518
...
...
@@ -51,7 +51,7 @@
</if>
</where>
ORDER BY
isn.
notice
_date DESC
isn.
rec
_date DESC
</select>
<select
id=
"queryEquipInformation"
resultType=
"java.util.Map"
>
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgScrapCancelMapper.xml
View file @
654e2518
...
...
@@ -2,4 +2,211 @@
<!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.JgScrapCancelMapper"
>
<update
id=
"updatePromoter"
>
UPDATE tzs_jg_scrap_cancel set promoter = null
where sequence_nbr = #{id}
</update>
<select
id=
"getListPage"
resultType=
"java.util.Map"
>
select ur.sequence_nbr as sequenceNbr,
ur.instance_id as instanceId,
ur.audit_status as auditStatus,
ur.rec_date as regDate,
ur.receive_org_code as receiveOrgCode,
ur.receive_org_name as receiveOrgName,
ur.receive_company_code as receiveCompanyCode,
ur.cancel_certificate as cancelCertificate,
ur.cancel_type as cancelType,
ur.apply_no as applyNo,
ur.status,
ur.remark,
ur.instance_status as instanceStatus,
ur.promoter,
ifnull(ur.next_execute_ids,'') as nextExecuteIds,
audit_pass_date as auditPassDate,
use.USE_UNIT_CREDIT_CODE as useUnitCreditCode,
use.USE_UNIT_NAME as useUnitName,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
jri.EQU_DEFINE as equDefine,
jri.PRODUCT_NAME as productName,
jri.EQU_CODE as equCode,
use.USE_INNER_CODE as innerCode,
concat(use.PROVINCE_NAME,'-',use.CITY_NAME,'-',use.COUNTY_NAME) as place,
re.equ_id as equipId
from tzs_jg_scrap_cancel ur
LEFT JOIN tzs_jg_scrap_cancel_eq re on ur.sequence_nbr = re.equip_transfer_id
LEFT JOIN idx_biz_jg_register_info jri on re.equ_id = jri.RECORD
LEFT JOIN idx_biz_jg_use_info use on re.equ_id = use.RECORD
<where>
and ur.is_delete = 0
<!-- <if test="dto.equCategory != null and dto.equCategory != ''">-->
<!-- and jri.EQU_CATEGORY = #{dto.equCategory}-->
<!-- </if>-->
<if
test=
"dto.auditStatus != null and dto.auditStatus != ''"
>
and ur.audit_status = #{dto.auditStatus}
</if>
<!-- <if test="dto.equCode != null and dto.equCode != ''">-->
<!-- and jri.EQU_CODE like concat('%',#{dto.equCode},'%')-->
<!-- </if>-->
<!-- <if test="dto.useUnitName != null and dto.useUnitName != ''">-->
<!-- and use.USE_UNIT_NAME like concat('%',#{dto.useUnitName},'%')-->
<!-- </if>-->
<if
test=
"roleIds != null and dto.type == 'supervision'"
>
<foreach
collection=
'roleIds'
item=
'role'
open=
'and ('
close=
')'
separator=
'or'
>
ur.audit_status like concat('%',#{role},'%')
</foreach>
</if>
<if
test=
"dto.type == 'supervision'"
>
AND ur.receive_org_code = #{orgCode}
</if>
<!-- <if test="dto.type == 'enterprise'">-->
<!-- AND use.USE_UNIT_CREDIT_CODE = #{orgCode}-->
<!-- </if>-->
</where>
order by ur.rec_date desc
</select>
<select
id=
"getDetail"
resultType=
"java.util.Map"
>
SELECT jri.EQU_CODE as equCode,
-- (SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
-- (SELECT name from tz_equipment_category where code = jri.EQU_LIST) as equList,
-- (SELECT name from tz_equipment_category where code = jri.EQU_DEFINE) as equDefine,
jri.EQU_CATEGORY as equCategory,
jri.EQU_LIST as equList,
jri.EQU_DEFINE as equDefine,
jri.PRODUCT_NAME as productName,
jri.EQU_TYPE as equType,
jri.PRODUCT_PHOTO as proDuctPhoto,
jfi.FACTORY_NUM as factoryNum,
jfi.PRODUCE_UNIT_NAME as produceUnitName,
jfi.PRODUCE_DATE as produceDate,
jfi.FACTORY_STANDARD as factoryStandard,
jfi.PRODUCT_QUALITY_YIELD_PROVE as productQualityYieldProve,
jfi.INS_USE_MAINTAIN_EXPLAIN as insUseMaintainExplanin,
jci.USC_UNIT_NAME as uscUnitName,
jci.USC_UNIT_CREDIT_CODE as uscUnitCreditCode
from idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_factory_info jfi on jri.RECORD = jfi.RECORD
LEFT JOIN idx_biz_jg_construction_info jci on jri.RECORD = jci.RECORD
where jri.RECORD = #{id}
</select>
<select
id=
"getInspectDetail"
resultType=
"java.util.Map"
>
SELECT INSPECT_TYPE as inspectType,
INSPECT_STAFF as inspctStaff,
INSPECT_CONCLUSION as inspectConclusion,
INSPECT_ORG_NAME as inspectOrgName,
INSPECT_DATE as inspectDate,
NEXT_INSPECT_DATE as nextInspectDate,
INSPECT_REPORT as inspectReport
from idx_biz_jg_inspection_detection_info
where RECORD = #{id}
ORDER BY INSPECT_DATE desc LIMIT 1
</select>
<select
id=
"getUseDetail"
resultType=
"java.util.Map"
>
SELECT USE_UNIT_NAME as useUnitName,
USE_UNIT_CREDIT_CODE as useUnitCreditCode,
USE_PLACE as usePlace,
SAFETY_MANAGER as safetyManager,
PHONE as phone,
ESTATE_UNIT_NAME as estateUnitName,
ESTATE_UNIT_CREDIT_CODE as estateUnitCreditCode,
ADDRESS as address,
PROVINCE as province,
CITY as city,
COUNTY as county,
USE_INNER_CODE as useInnerCode
FROM "idx_biz_jg_use_info" where RECORD = #{id}
</select>
<select
id=
"getEquipListPage"
resultType=
"java.util.Map"
>
SELECT jri.EQU_CODE as equCode,
jri.RECORD as id,
(SELECT name from tz_equipment_category where code = jri.EQU_CATEGORY) as equCategory,
(SELECT name from tz_equipment_category where code = jri.EQU_LIST) as equList,
jfi.FACTORY_NUM as factoryNum,
jui.ADDRESS as address,
jui.USE_INNER_CODE as useInnerCode,
jfi.PRODUCE_UNIT_NAME as produceUnitName
from idx_biz_jg_register_info jri
LEFT JOIN idx_biz_jg_factory_info jfi on jri.RECORD = jfi.RECORD
LEFT JOIN idx_biz_jg_use_info jui on jri.RECORD = jui.RECORD
<where>
<if
test=
"factoryNum != null and factoryNum != ''"
>
and jfi.FACTORY_NUM like concat('%',#{factoryNum},'%')
</if>
<if
test=
"equList != null and equList != ''"
>
and jri.EQU_LIST like concat('%',#{equList},'%')
</if>
<if
test=
"equCategory != null and equCategory != ''"
>
and jri.EQU_CATEGORY like concat('%',#{equCategory},'%')
</if>
</where>
</select>
<select
id=
"queryEquipInformation"
resultType=
"java.util.Map"
>
select
ur.sequence_nbr AS sequenceNbr,
ur.instance_id as instanceId,
ur.audit_status as auditStatus,
ur.rec_date as regDate,
ur.receive_org_code as receiveOrgCode,
ur.receive_org_name as receiveOrgName,
ur.receive_company_code as receiveCompanyCode,
ur.cancel_certificate as cancelCertificate,
ur.cancel_type as cancelType,
ur.apply_no as applyNo,
ur.status,
ur.remark,
ur.instance_status as instanceStatus,
ur.promoter,
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,
ui.safety_manager AS safetyManager,
ui.phone AS safetyManagerPhone,
ui.PROVINCE_NAME AS useUnitProvinceName,
ui.CITY_NAME AS useUnitCityName,
ui.COUNTY_NAME AS useUnitCountyName,
ui.ADDRESS AS useUnitAddress
FROM
tzs_jg_scrap_cancel ur
LEFT JOIN tzs_jg_scrap_cancel_eq re ON re.equip_transfer_id = ur.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
WHERE
ur.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/JgScrapCancelController.java
View file @
654e2518
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
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgScrapCancelDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgScrapCancelServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
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.JgScrapCancelDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.*
;
/**
* 设备注销报废
...
...
@@ -28,89 +35,104 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
@RequestMapping
(
value
=
"/jg-scrap-cancel"
)
public
class
JgScrapCancelController
extends
BaseController
{
@Autowired
JgScrapCancelServiceImpl
jgScrapCancelServiceImpl
;
@Autowired
JgScrapCancelServiceImpl
jgScrapCancelService
;
/**
* 新增设备注销报废
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增
设备注销报废"
,
notes
=
"新增设备注销报废
"
)
public
ResponseModel
<
JgScrapCancelDto
>
save
(
@RequestBody
JgScrapCancelDto
model
)
{
model
=
jgScrapCancelServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增
"
,
notes
=
"新增
"
)
public
ResponseModel
<
Object
>
save
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
JgScrapCancelDto
>
model
)
{
jgScrapCancelService
.
save
(
submitType
,
model
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
* 根据sequenceNbr更新
*
* @param model 安装告知
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新设备注销报废"
,
notes
=
"根据sequenceNbr更新设备注销报废"
)
public
ResponseModel
<
JgScrapCancelDto
>
updateBySequenceNbrJgScrapCancel
(
@RequestBody
JgScrapCancelDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
jgScrapCancelServiceImpl
.
updateWithModel
(
model
));
@PostMapping
(
value
=
"/updateInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据sequenceNbr更新安装告知"
,
notes
=
"根据sequenceNbr更新安装告知"
)
public
ResponseModel
<
JgScrapCancelDto
>
updateInfo
(
@RequestParam
String
submitType
,
@RequestBody
Map
<
String
,
Object
>
model
,
@RequestParam
(
value
=
"op"
,
required
=
false
)
String
op
)
{
JgScrapCancelDto
jgScrapCancelDto
=
BeanUtil
.
mapToBean
(((
LinkedHashMap
)
model
.
get
(
"jgScrapCancelAdd"
)),
JgScrapCancelDto
.
class
,
true
);
if
(
Objects
.
isNull
(
jgScrapCancelDto
))
{
throw
new
IllegalArgumentException
(
"参数jgScrapCancelAdd不能为空"
);
}
Object
o
=
((
LinkedHashMap
<?,
?>)
model
.
get
(
"jgScrapCancelAdd"
)).
get
(
"cancelCertificateList"
);
jgScrapCancelDto
.
setCancelCertificateList
((
List
<
Map
<
String
,
Object
>>)
o
);
return
ResponseHelper
.
buildResponse
(
jgScrapCancelService
.
updateInfo
(
submitType
,
jgScrapCancelDto
,
op
));
}
/**
* 根据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
(
jgScrapCancelServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个设备注销报废"
,
notes
=
"根据sequenceNbr查询单个设备注销报废"
)
public
ResponseModel
<
JgScrapCancelDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgScrapCancelServiceImpl
.
queryBySeq
(
sequenceNbr
));
@PostMapping
(
value
=
"/flowExecute"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行流程"
,
notes
=
"执行流程"
)
public
ResponseModel
<
Object
>
flowExecute
(
@RequestBody
JSONObject
map
)
{
LinkedHashMap
model1
=
(
LinkedHashMap
)
map
.
get
(
"model"
);
LinkedHashMap
jgScrapCancelInfo
=
(
LinkedHashMap
)
model1
.
get
(
"jgScrapCancelAdd"
);
JgScrapCancelDto
jgScrapCancelDto
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
jgScrapCancelInfo
),
JgScrapCancelDto
.
class
);
jgScrapCancelService
.
flowExecute
(
Long
.
valueOf
(
String
.
valueOf
(
jgScrapCancelDto
.
getSequenceNbr
())),
jgScrapCancelDto
.
getInstanceId
(),
String
.
valueOf
(
map
.
get
(
"operate"
)),
String
.
valueOf
(
map
.
get
(
"opinion"
)),
true
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/withdraw"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"撤回"
,
notes
=
"撤回"
)
public
ResponseModel
<
Object
>
withdraw
(
@RequestBody
JSONObject
map
)
{
jgScrapCancelService
.
withdraw
(
String
.
valueOf
(
map
.
get
(
"instanceId"
)));
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/deleteBatch"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"批量删除"
,
notes
=
"批量删除"
)
public
ResponseModel
<
Object
>
deleteBatch
(
@RequestBody
JSONObject
map
)
{
List
<
Long
>
ids
=
(
List
<
Long
>)
map
.
get
(
"ids"
);
jgScrapCancelService
.
deleteBatch
(
ids
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备注销报废分页查询"
,
notes
=
"设备注销报废分页查询"
)
public
ResponseModel
<
Page
<
JgScrapCancelDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
JgScrapCancelDto
>
page
=
new
Page
<
JgScrapCancelDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
jgScrapCancelServiceImpl
.
queryForJgScrapCancelPage
(
page
));
@PostMapping
(
value
=
"/deleteMessage"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"批量删除"
,
notes
=
"批量删除"
)
public
ResponseModel
<
Object
>
deleteMessage
(
@RequestParam
(
"id"
)
Long
id
)
{
ArrayList
<
Long
>
ids
=
new
ArrayList
<>();
ids
.
add
(
id
);
jgScrapCancelService
.
deleteBatch
(
ids
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@PostMapping
(
value
=
"/getList"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
getList
(
JgScrapCancelDto
dto
,
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
Map
<
String
,
Object
>>
page
=
new
Page
<>(
current
,
size
);
return
ResponseHelper
.
buildResponse
(
jgScrapCancelService
.
getList
(
dto
,
page
,
dto
.
getRoleIds
()));
}
/**
*
列表全部数据
查询
*
* @
return
*
根据sequenceNbr
查询
*
* @
param sequenceNbr 主键
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@
ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备注销报废列表全部数据查询"
,
notes
=
"设备注销报废列表全部数据查询
"
)
@
GetMapping
(
value
=
"/list
"
)
public
ResponseModel
<
List
<
JgScrapCancelDto
>>
selectForList
(
)
{
return
ResponseHelper
.
buildResponse
(
jgScrapCancelServiceImpl
.
queryForJgScrapCancelList
(
));
@
GetMapping
(
value
=
"/details
"
)
@
ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个详情"
,
notes
=
"根据sequenceNbr查询单个详情
"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
selectOne
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgScrapCancelService
.
queryBySequenceNbr
(
sequenceNbr
));
}
}
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/JgChangeRegistrationReformServiceImpl.java
View file @
654e2518
...
...
@@ -22,6 +22,7 @@ import com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo;
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.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.*
;
import
com.yeejoin.amos.boot.module.ymt.api.service.ICreateCodeService
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
...
...
@@ -64,8 +65,6 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
private
InspectionDetectionInfoMapper
inspectionDetectionInfoMapper
;
@Autowired
private
OtherInfoMapper
otherInfoMapper
;
@Autowired
private
JgChangeRegistrationReformMapper
jgChangeRegistrationReformMapper
;
//改造登记关系表mapper
@Autowired
private
JgChangeRegistrationReformEqMapper
jgChangeRegistrationReformEqMapper
;
...
...
@@ -79,7 +78,6 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
//使用登记关系表mapper
@Autowired
private
JgUseRegistrationEqMapper
jgUseRegistrationEqMapper
;
@Autowired
private
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
;
@Autowired
...
...
@@ -153,7 +151,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
List
<
String
>
applicationFormCode
=
iCreateCodeService
.
createApplicationFormCode
(
ApplicationFormTypeEnum
.
SYDJ
.
getCode
(),
1
);
jgChangeRegistrationReform
.
setApplyNo
(
applicationFormCode
.
get
(
0
));
jgChangeRegistrationReform
.
setAuditStatus
(
"待提交"
);
jgChangeRegistrationReform
.
setStatus
(
UseStatusEnum
.
SUBMIT
.
getPass
());
jgChangeRegistrationReform
.
setStatus
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
());
this
.
save
(
jgChangeRegistrationReform
);
jgChangeRegistrationReformEq
.
setEquipTransferId
(
jgChangeRegistrationReform
.
getSequenceNbr
().
toString
());
jgChangeRegistrationReformEqMapper
.
insert
(
jgChangeRegistrationReformEq
);
...
...
@@ -178,7 +176,7 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
// 执行流程
String
status
=
flowExecute
(
jgChangeRegistrationReform
.
getSequenceNbr
(),
instanceId
,
"0"
,
""
,
true
);
jgChangeRegistrationReform
.
setAuditStatus
(
"已提交"
);
jgChangeRegistrationReform
.
setStatus
(
UseStatusEnum
.
RECEIVE
.
getPass
());
jgChangeRegistrationReform
.
setStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
}
jgChangeRegistrationReform
.
setInstanceId
(
instanceId
);
...
...
@@ -253,7 +251,8 @@ public class JgChangeRegistrationReformServiceImpl extends BaseService<JgChangeR
if
(
"流程结束"
.
equals
(
taskName
))
{
JgChangeRegistrationReformEq
jgChangeRegistrationReformEq
=
jgChangeRegistrationReformEqMapper
.
selectOne
(
new
QueryWrapper
<
JgChangeRegistrationReformEq
>().
eq
(
"equip_transfer_id"
,
jgChangeRegistrationReform
.
getSequenceNbr
()));
jgChangeRegistrationReform
.
setStatus
(
taskName
);
jgChangeRegistrationReform
.
setAuditStatus
(
"已完成"
);
jgChangeRegistrationReform
.
setAuditStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
//交换历史数据与新增数据
updateTechparamsByEquIdAndCurrentDoucumentId
(
jgChangeRegistrationReformEq
.
getEquId
(),
jgChangeRegistrationReform
.
getSequenceNbr
().
toString
());
}
else
{
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
View file @
654e2518
...
...
@@ -657,7 +657,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
jgInstallationNotice
.
setStatus
(
taskName
[
0
]);
jgInstallationNotice
.
setPromoter
(
""
);
jgInstallationNotice
.
setNextExecuteIds
(
String
.
join
(
","
,
roleList
));
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
ROLLBACK
.
getCode
()));
jgInstallationNoticeMapper
.
updateById
(
jgInstallationNotice
);
}
}
...
...
@@ -715,7 +715,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
supervisoryCodeInfo
.
setStatus
(
"1"
);
supervisoryCodeInfoMapper
.
updateById
(
supervisoryCodeInfo
);
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
HAVE_PROCESS
ED
.
getCode
()));
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISH
ED
.
getCode
()));
this
.
generateInstallationNoticeReport
(
jgInstallationNotice
.
getSequenceNbr
());
// 更新其他业务表
tzsJgOtherInfo
.
setCode96333
(
mapCode
.
get
(
"code96333"
).
toString
());
...
...
@@ -745,7 +745,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
}
}
else
{
jgInstallationNotice
.
setPromoter
(
""
);
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMIT
TED
.
getCode
()));
jgInstallationNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
REJEC
TED
.
getCode
()));
}
jgInstallationNoticeMapper
.
updateById
(
jgInstallationNotice
);
}
...
...
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/JgScrapCancelServiceImpl.java
View file @
654e2518
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgScrapCancel
;
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.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgTransferNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgUseRegistrationDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CancelFlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgScrapCancelMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationEqMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgScrapCancelService
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgScrapCancelDto
;
import
com.yeejoin.amos.boot.module.jg.flc.api.fegin.WorkFlowFeignService
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.InspectionDetectionInfo
;
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.InspectionDetectionInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.OtherInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.UseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.service.ICreateCodeService
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
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.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.StringUtils
;
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
java.util.List
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 设备注销报废服务实现类
...
...
@@ -17,17 +58,431 @@ import java.util.List;
*/
@Service
public
class
JgScrapCancelServiceImpl
extends
BaseService
<
JgScrapCancelDto
,
JgScrapCancel
,
JgScrapCancelMapper
>
implements
IJgScrapCancelService
{
/**
* 分页查询
*/
public
Page
<
JgScrapCancelDto
>
queryForJgScrapCancelPage
(
Page
<
JgScrapCancelDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
JgScrapCancelDto
>
queryForJgScrapCancelList
()
{
return
this
.
queryForList
(
""
,
false
);
@Autowired
private
JgScrapCancelEqServiceImpl
jgScrapCancelEqService
;
@Autowired
private
JgScrapCancelEqMapper
jgScrapCancelEqMapper
;
@Autowired
WorkFlowFeignService
workFlowFeginService
;
@Autowired
private
ICreateCodeService
iCreateCodeService
;
@Autowired
RedisUtils
redisUtils
;
public
Page
<
Map
<
String
,
Object
>>
getList
(
JgScrapCancelDto
dto
,
Page
<
Map
<
String
,
Object
>>
page
,
List
<
String
>
roleIds
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
Page
<
Map
<
String
,
Object
>>
listPage
=
this
.
baseMapper
.
getListPage
(
page
,
dto
,
roleIds
,
orgCode
);
listPage
.
getRecords
().
forEach
(
item
->
{
if
(
item
.
containsKey
(
"auditStatus"
)
&&
Objects
.
nonNull
(
item
.
get
(
"auditStatus"
)))
{
String
noticeStatusDesc
=
FlowStatusEnum
.
getNameByType
(
Long
.
valueOf
(
item
.
get
(
"auditStatus"
).
toString
()));
item
.
put
(
"auditStatusDesc"
,
noticeStatusDesc
);
}
});
return
listPage
;
}
public
Page
<
Map
<
String
,
Object
>>
getEquipList
(
Page
<
Map
<
String
,
Object
>>
page
,
String
factoryNum
,
String
equList
,
String
equCategory
)
{
return
this
.
baseMapper
.
getEquipListPage
(
page
,
factoryNum
,
equList
,
equCategory
);
}
private
void
convertField
(
JgScrapCancelDto
model
)
{
// 处理图片
if
(!
ValidationUtil
.
isEmpty
(
model
.
getCancelCertificateList
()))
{
model
.
setCancelCertificate
(
JSON
.
toJSONString
(
model
.
getCancelCertificateList
()));
}
String
receiveOrgId
=
model
.
getReceiveOrgCode
();
if
(!
ObjectUtils
.
isEmpty
(
receiveOrgId
))
{
String
[]
receiveOrgIdList
=
receiveOrgId
.
split
(
"_"
);
if
(
receiveOrgIdList
.
length
>
1
)
{
model
.
setReceiveOrgCode
(
receiveOrgIdList
[
0
]);
model
.
setReceiveOrgName
(
receiveOrgIdList
[
1
]);
}
}
}
@SuppressWarnings
({
"Duplicates"
,
"rawtypes"
})
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
save
(
String
submitType
,
Map
<
String
,
JgScrapCancelDto
>
jgInstallationNoticeDtoMap
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
String
[]
taskName
=
new
String
[]{
"流程结束"
};
JgScrapCancelDto
model
=
jgInstallationNoticeDtoMap
.
get
(
"jgScrapCancelAdd"
);
// 字段转换
convertField
(
model
);
// 获取告知设备列表
List
<
Map
<
String
,
Object
>>
deviceList
=
model
.
getDeviceList
();
if
(
CollectionUtils
.
isEmpty
(
deviceList
))
{
return
;
}
// 获取告知单号
List
<
String
>
applyNoList
=
iCreateCodeService
.
createApplicationFormCode
(
ApplicationFormTypeEnum
.
SBZX
.
getCode
(),
deviceList
.
size
());
if
(
CollectionUtils
.
isEmpty
(
applyNoList
))
{
return
;
}
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
// 判断当前是否为提交
List
<
String
>
instanceIdList
=
new
ArrayList
<>();
if
(
"1"
.
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
(
"scrapCancel"
);
dto
.
setBusinessKey
(
String
.
valueOf
(
i
));
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
<
JgScrapCancel
>
list
=
new
ArrayList
<>();
List
<
JgScrapCancelEq
>
equipList
=
new
ArrayList
<>();
deviceList
.
forEach
(
obj
->
{
JgScrapCancelEq
jgRelationEquip
=
new
JgScrapCancelEq
();
JgScrapCancel
dto
=
new
JgScrapCancel
();
BeanUtils
.
copyProperties
(
model
,
dto
);
int
i
=
deviceList
.
indexOf
(
obj
);
String
applyNo
=
applyNoList
.
get
(
i
);
dto
.
setApplyNo
(
applyNo
);
dto
.
setCreateDate
(
new
Date
());
dto
.
setNextExecuteIds
(
String
.
join
(
","
,
roleListSecond
));
dto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
dto
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
dto
.
setStatus
(
taskName
[
0
]);
jgRelationEquip
.
setEquId
(
String
.
valueOf
(
obj
.
get
(
"SEQUENCE_NBR"
)));
jgRelationEquip
.
setEquipTransferId
(
applyNo
);
if
(!
CollectionUtils
.
isEmpty
(
instanceIdList
))
{
dto
.
setInstanceId
(
instanceIdList
.
get
(
i
));
dto
.
setAuditStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
}
else
{
dto
.
setAuditStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
()));
}
list
.
add
(
dto
);
equipList
.
add
(
jgRelationEquip
);
});
this
.
saveBatch
(
list
);
List
<
JgScrapCancelEq
>
jgScrapCancelEqList
=
equipList
.
stream
().
map
(
t
->
{
List
<
JgScrapCancel
>
collect
=
list
.
stream
().
filter
(
item
->
t
.
getEquipTransferId
().
equals
(
item
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
Long
sequenceNbr
=
collect
.
get
(
0
).
getSequenceNbr
();
return
t
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
));
}).
collect
(
Collectors
.
toList
());
jgScrapCancelEqService
.
saveBatch
(
jgScrapCancelEqList
);
}
public
String
flowExecute
(
Long
id
,
String
instanceId
,
String
operate
,
String
comment
,
Boolean
update
)
{
String
role
=
""
;
String
taskName
=
"流程结束"
;
ArrayList
<
String
>
roleList
=
new
ArrayList
<>();
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
);
// 查询下节点任务
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"
);
taskName
=
nextTask
.
getString
(
"name"
);
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
();
}
role
=
String
.
join
(
","
,
roleList
);
if
(
update
)
{
Boolean
rollBack
=
"1"
.
equals
(
operate
)
?
true
:
false
;
updateStatus
(
id
,
instanceId
,
taskName
,
role
,
rollBack
);
}
return
role
;
}
public
void
updateStatus
(
Long
id
,
String
instanceId
,
String
taskName
,
String
role
,
Boolean
rollBack
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
LambdaQueryWrapper
<
JgScrapCancel
>
lambda
=
new
QueryWrapper
<
JgScrapCancel
>().
lambda
();
lambda
.
eq
(
JgScrapCancel:
:
getSequenceNbr
,
id
);
JgScrapCancel
jgScrapCancel
=
this
.
getBaseMapper
().
selectOne
(
lambda
);
if
(
"流程结束"
.
equals
(
taskName
))
{
jgScrapCancel
.
setStatus
(
taskName
);
jgScrapCancel
.
setAuditStatus
(
"已完成"
);
}
else
{
jgScrapCancel
.
setNextExecuteIds
(
role
);
jgScrapCancel
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
if
(!
ObjectUtils
.
isEmpty
(
jgScrapCancel
.
getInstanceStatus
()))
{
jgScrapCancel
.
setInstanceStatus
(
jgScrapCancel
.
getInstanceStatus
()
+
","
+
role
);
}
else
{
jgScrapCancel
.
setInstanceStatus
(
role
);
}
CancelFlowStatusEnum
message
=
CancelFlowStatusEnum
.
getMessage
(
taskName
);
jgScrapCancel
.
setStatus
(
message
.
getPass
());
}
if
(
rollBack
){
this
.
getBaseMapper
().
update
(
jgScrapCancel
,
lambda
);
this
.
getBaseMapper
().
updatePromoter
(
jgScrapCancel
.
getSequenceNbr
());
}
else
{
this
.
getBaseMapper
().
update
(
jgScrapCancel
,
lambda
);
}
}
public
void
withdraw
(
String
instanceId
)
{
String
taskName
=
""
;
JgScrapCancel
jgScrapCancel
=
new
JgScrapCancel
();
LambdaQueryWrapper
<
JgScrapCancel
>
lambda
=
new
QueryWrapper
<
JgScrapCancel
>().
lambda
();
lambda
.
eq
(
JgScrapCancel:
:
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"
)));
taskName
=
nextTask
.
getString
(
"name"
);
if
(!
ObjectUtils
.
isEmpty
(
taskNoAuth
.
get
(
"data"
)))
{
String
nextTaskId
=
nextTask
.
getString
(
"id"
);
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
(
taskName
))
{
CancelFlowStatusEnum
message
=
CancelFlowStatusEnum
.
getMessage
(
taskName
);
jgScrapCancel
.
setStatus
(
message
.
getPass
());
}
String
join
=
String
.
join
(
","
,
roleList
);
JgScrapCancel
jgScrapCancel1
=
this
.
getBaseMapper
().
selectOne
(
lambda
);
this
.
updateStatus
(
jgScrapCancel1
.
getSequenceNbr
(),
instanceId
,
taskName
,
join
,
true
);
}
public
void
deleteBatch
(
List
<
Long
>
ids
)
{
JgScrapCancel
jgScrapCancel
=
new
JgScrapCancel
();
jgScrapCancel
.
setIsDelete
(
true
);
LambdaQueryWrapper
<
JgScrapCancel
>
lambda
=
new
QueryWrapper
<
JgScrapCancel
>().
lambda
();
lambda
.
in
(
JgScrapCancel:
:
getSequenceNbr
,
ids
);
this
.
update
(
jgScrapCancel
,
lambda
);
}
public
Map
<
String
,
Object
>
getDetail
(
String
id
)
{
Map
<
String
,
Object
>
detail
=
this
.
baseMapper
.
getDetail
(
id
);
Map
<
String
,
Object
>
inspectDetail
=
this
.
baseMapper
.
getInspectDetail
(
id
);
Map
<
String
,
Object
>
useDetail
=
this
.
baseMapper
.
getUseDetail
(
id
);
detail
.
putAll
(
inspectDetail
);
detail
.
putAll
(
useDetail
);
detail
.
putAll
(
useDetail
);
detail
.
put
(
"proDuctPhoto"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"proDuctPhoto"
))));
detail
.
put
(
"factoryStandard"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"factoryStandard"
))));
detail
.
put
(
"productQualityYieldProve"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"productQualityYieldProve"
))));
detail
.
put
(
"insUseMaintainExplanin"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"insUseMaintainExplanin"
))));
detail
.
put
(
"inspectReport"
,
JSON
.
parse
(
String
.
valueOf
(
detail
.
get
(
"inspectReport"
))));
return
detail
;
}
public
JgScrapCancelDto
updateInfo
(
String
submitType
,
JgScrapCancelDto
jgScrapCancelDto
,
String
op
)
{
if
(
Objects
.
isNull
(
jgScrapCancelDto
)
||
StringUtils
.
isEmpty
(
submitType
))
{
throw
new
IllegalArgumentException
(
"参数不能为空"
);
}
String
[]
taskName
=
new
String
[]{
"流程结束"
};
// 字段转换
this
.
convertField
(
jgScrapCancelDto
);
ArrayList
<
String
>
roleListFirst
=
new
ArrayList
<>();
ArrayList
<
String
>
roleListSecond
=
new
ArrayList
<>();
if
(
"1"
.
equals
(
submitType
))
{
AjaxResult
ajaxResult
;
// 发起流程
if
(!
StringUtils
.
hasText
(
jgScrapCancelDto
.
getInstanceId
()))
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
"scrapCancel"
);
dto
.
setBusinessKey
(
"1"
);
try
{
ajaxResult
=
Workflow
.
taskClient
.
startByVariable
(
dto
);
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
jgScrapCancelDto
.
setInstanceId
(
instanceId
);
// 查询下节点任务
getNext
(
roleListFirst
,
instanceId
,
taskName
);
jgScrapCancelDto
.
setInstanceStatus
(
String
.
join
(
","
,
roleListFirst
));
}
catch
(
Exception
e
)
{
log
.
error
(
"提交失败:{}"
,
e
);
}
}
JgScrapCancel
jgScrapCancel
=
new
JgScrapCancel
();
BeanUtils
.
copyProperties
(
jgScrapCancelDto
,
jgScrapCancel
);
boolean
submit
=
submit
(
jgScrapCancel
,
op
);
if
(
submit
)
{
// 查询下节点任务
getNext
(
roleListSecond
,
jgScrapCancel
.
getInstanceId
(),
taskName
);
jgScrapCancel
.
setStatus
(
taskName
[
0
]);
if
(!
ObjectUtils
.
isEmpty
(
jgScrapCancel
.
getInstanceStatus
()))
{
jgScrapCancel
.
setInstanceStatus
(
jgScrapCancel
.
getInstanceStatus
()
+
","
+
roleListSecond
);
}
else
{
jgScrapCancel
.
setInstanceStatus
(
String
.
join
(
","
,
roleListSecond
));
}
jgScrapCancel
.
setPromoter
(
RequestContext
.
getExeUserId
());
jgScrapCancel
.
setNextExecuteIds
(
String
.
join
(
","
,
roleListSecond
));
jgScrapCancel
.
setAuditStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
()));
this
.
updateById
(
jgScrapCancel
);
}
}
else
{
JgScrapCancel
bean
=
new
JgScrapCancel
();
BeanUtils
.
copyProperties
(
jgScrapCancelDto
,
bean
);
this
.
updateById
(
bean
);
}
return
jgScrapCancelDto
;
}
public
boolean
submit
(
JgScrapCancel
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
);
dto
.
setComment
(
"提交流程"
);
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
;
}
}
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"
);
AjaxResult
taskGroupName
=
Workflow
.
taskClient
.
getTaskGroupName
(
nextTaskId
);
taskName
[
0
]
=
taskNoAuth
.
getString
(
"name"
);
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
());
}
}
}
}
public
Map
<
String
,
Object
>
queryBySequenceNbr
(
Long
sequenceNbr
)
{
// 安装告知信息
JgScrapCancel
notice
=
this
.
baseMapper
.
selectById
(
sequenceNbr
);
if
(
Objects
.
isNull
(
notice
))
{
return
null
;
}
Map
<
String
,
Object
>
installationInfo
=
BeanUtil
.
beanToMap
(
notice
);
installationInfo
.
put
(
"receiveOrgCode"
,
notice
.
getReceiveOrgCode
()
+
"_"
+
notice
.
getReceiveOrgName
());
installationInfo
.
put
(
"cancelCertificateList"
,
JSON
.
parseArray
(
installationInfo
.
get
(
"cancelCertificate"
).
toString
()));
// 设备信息
Map
<
String
,
Object
>
equipmentInfos
=
this
.
baseMapper
.
queryEquipInformation
(
sequenceNbr
);
BeanUtil
.
copyProperties
(
installationInfo
,
equipmentInfos
);
return
new
HashMap
<
String
,
Object
>()
{{
this
.
put
(
"jgScrapCancelAdd"
,
equipmentInfos
);
// this.put("equipmentInfo", equipmentInfos);
}};
}
}
\ 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