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
516db5f9
Commit
516db5f9
authored
Dec 14, 2023
by
yangyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jyjc):merge新增、更新接口
parent
adfcdb7d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
31 deletions
+68
-31
OpeningApplicationStatusEnums.java
.../module/jyjc/api/enums/OpeningApplicationStatusEnums.java
+29
-0
JyjcOpeningApplicationController.java
...jyjc/biz/controller/JyjcOpeningApplicationController.java
+1
-1
JyjcOpeningApplicationServiceImpl.java
...c/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
+37
-29
CreateCodeController.java
.../boot/module/tcm/api/controller/CreateCodeController.java
+1
-1
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/enums/OpeningApplicationStatusEnums.java
0 → 100644
View file @
516db5f9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
api
.
enums
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* 检验检测开通流程执行状态
* <p>
* ProjectName: amos-boot-biz
* PackageName: com.yeejoin.amos.boot.module.jyjc.api.enums
*
* @author yangyang
* @version v1.0
* @date 2023/12/14 21:56
*/
@Getter
@AllArgsConstructor
public
enum
OpeningApplicationStatusEnums
{
START
(
"start"
,
"启动"
),
EXCUTING
(
"excuting"
,
"执行中"
),
REJECT
(
"reject"
,
"驳回"
),
WITHDRAW
(
"withdraw"
,
"撤回"
),
COMPLETE
(
"complete"
,
"完成"
);
private
String
code
;
private
String
name
;
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/JyjcOpeningApplicationController.java
View file @
516db5f9
...
@@ -79,7 +79,7 @@ public class JyjcOpeningApplicationController extends BaseController {
...
@@ -79,7 +79,7 @@ public class JyjcOpeningApplicationController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"重新提交开通申请"
,
notes
=
"重新提交开通申请"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"重新提交开通申请"
,
notes
=
"重新提交开通申请"
)
public
ResponseModel
<
JyjcOpeningApplicationModel
>
resubmitJyjcOpeningApplication
(
@RequestBody
JyjcOpeningApplicationModel
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
<
JyjcOpeningApplicationModel
>
resubmitJyjcOpeningApplication
(
@RequestBody
JyjcOpeningApplicationModel
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
jyjcOpeningApplicationServiceImpl
.
saveOrUpdateModel
(
model
,
true
));
return
ResponseHelper
.
buildResponse
(
jyjcOpeningApplicationServiceImpl
.
resubmit
(
model
));
}
}
/**
/**
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
View file @
516db5f9
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
...
@@ -13,6 +13,7 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.AttachmentDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.common.CommonConstants
;
import
com.yeejoin.amos.boot.module.jyjc.api.common.CommonConstants
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcOpeningApplication
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.OpeningApplicationStatusEnums
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcOpeningApplicationMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcOpeningApplicationMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcOpeningApplicationService
;
import
com.yeejoin.amos.boot.module.jyjc.api.service.IJyjcOpeningApplicationService
;
...
@@ -109,7 +110,8 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
...
@@ -109,7 +110,8 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
String
roleGroups
=
executorArray
.
stream
().
map
(
json
->
Optional
.
ofNullable
(((
LinkedHashMap
)
json
).
get
(
"groupId"
)).
orElse
(
""
).
toString
()).
collect
(
Collectors
.
joining
(
","
));
String
roleGroups
=
executorArray
.
stream
().
map
(
json
->
Optional
.
ofNullable
(((
LinkedHashMap
)
json
).
get
(
"groupId"
)).
orElse
(
""
).
toString
()).
collect
(
Collectors
.
joining
(
","
));
model
.
setWorkflowRole
(
roleGroups
);
model
.
setWorkflowRole
(
roleGroups
);
}
}
model
.
setStatus
(!
ValidationUtil
.
isEmpty
(
dataObject
)
&&
!
ValidationUtil
.
isEmpty
(
dataObject
.
get
(
"status"
))
?
String
.
valueOf
(
dataObject
.
get
(
"status"
))
:
""
);
model
.
setStatus
(
OpeningApplicationStatusEnums
.
START
.
getCode
());
// model.setStatus(!ValidationUtil.isEmpty(dataObject) && !ValidationUtil.isEmpty(dataObject.get("status")) ? String.valueOf(dataObject.get("status")) : "");
model
.
setWorkflowProstanceId
(
instanceId
);
model
.
setWorkflowProstanceId
(
instanceId
);
}
}
if
(
model
.
getSequenceNbr
()
==
null
)
{
if
(
model
.
getSequenceNbr
()
==
null
)
{
...
@@ -128,7 +130,15 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
...
@@ -128,7 +130,15 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
}
}
}
}
public
void
updateModelByInstanceId
(
String
instanceId
)
{
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
public
JyjcOpeningApplicationModel
resubmit
(
JyjcOpeningApplicationModel
model
)
{
model
.
setStatus
(
OpeningApplicationStatusEnums
.
EXCUTING
.
getCode
());
model
=
this
.
updateWithModel
(
model
);
execueFlow
(
"0"
,
model
.
getWorkflowProstanceId
(),
""
);
return
model
;
}
public
void
updateModelByInstanceId
(
String
instanceId
,
String
status
)
{
log
.
info
(
"updateModelByInstanceId, instanceId={}"
,
instanceId
);
log
.
info
(
"updateModelByInstanceId, instanceId={}"
,
instanceId
);
JyjcOpeningApplication
entity
=
this
.
lambdaQuery
().
eq
(
JyjcOpeningApplication:
:
getWorkflowProstanceId
,
instanceId
).
one
();
JyjcOpeningApplication
entity
=
this
.
lambdaQuery
().
eq
(
JyjcOpeningApplication:
:
getWorkflowProstanceId
,
instanceId
).
one
();
if
(
entity
==
null
)
{
if
(
entity
==
null
)
{
...
@@ -137,30 +147,11 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
...
@@ -137,30 +147,11 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
JSONObject
taskJson
=
getTask
(
instanceId
);
JSONObject
taskJson
=
getTask
(
instanceId
);
log
.
info
(
"taskJson => {}"
,
taskJson
);
log
.
info
(
"taskJson => {}"
,
taskJson
);
entity
.
setWorkflowRole
(
getWorkflowRoleGroups
(
taskJson
));
entity
.
setWorkflowRole
(
getWorkflowRoleGroups
(
taskJson
));
entity
.
setStatus
(
getWorkflowStatus
(
taskJson
));
// entity.setStatus(getWorkflowStatus(taskJson));
entity
.
setStatus
(
status
);
this
.
updateById
(
entity
);
this
.
updateById
(
entity
);
}
}
private
String
getWorkflowStatus
(
JSONObject
dataObject
)
{
return
!
ValidationUtil
.
isEmpty
(
dataObject
)
&&
!
ValidationUtil
.
isEmpty
(
dataObject
.
get
(
"status"
))
?
String
.
valueOf
(
dataObject
.
get
(
"status"
))
:
""
;
}
private
String
getWorkflowRoleGroups
(
JSONObject
dataObject
)
{
JSONArray
executorArray
=
dataObject
.
getJSONObject
(
"nodeInfo"
).
getJSONArray
(
"executor"
);
if
(!
ValidationUtil
.
isEmpty
(
executorArray
))
{
return
executorArray
.
stream
().
map
(
json
->
Optional
.
ofNullable
(((
LinkedHashMap
)
json
).
get
(
"groupId"
)).
orElse
(
""
).
toString
()).
collect
(
Collectors
.
joining
(
","
));
}
return
null
;
}
private
JSONObject
getTask
(
String
instanceId
)
{
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
// 工作流ID
FeignClientResult
<
JSONObject
>
nodeInfo
=
workflowFeignClient
.
getNodeInfotoken
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
taskId
);
dataObject
.
put
(
"nodeInfo"
,
nodeInfo
.
getResult
());
return
dataObject
;
}
/**
/**
* 分页查询
* 分页查询
...
@@ -270,8 +261,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
...
@@ -270,8 +261,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
if
(
ajaxResult
==
null
||
(
ajaxResult
.
get
(
AjaxResult
.
CODE_TAG
)
!=
null
&&
!
"200"
.
equals
(
ajaxResult
.
get
(
AjaxResult
.
CODE_TAG
).
toString
())))
{
if
(
ajaxResult
==
null
||
(
ajaxResult
.
get
(
AjaxResult
.
CODE_TAG
)
!=
null
&&
!
"200"
.
equals
(
ajaxResult
.
get
(
AjaxResult
.
CODE_TAG
).
toString
())))
{
throw
new
BaseException
(
"开启工作流错误"
);
throw
new
BaseException
(
"开启工作流错误"
);
}
}
String
instanceId
=
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
return
((
Map
)
ajaxResult
.
get
(
"data"
)).
get
(
"id"
).
toString
();
return
instanceId
;
}
}
/**
/**
...
@@ -297,14 +287,12 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
...
@@ -297,14 +287,12 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
}
}
updateModelByInstanceId
(
instanceId
);
updateModelByInstanceId
(
instanceId
,
"0"
.
equals
(
op
)
?
OpeningApplicationStatusEnums
.
EXCUTING
.
getCode
()
:
OpeningApplicationStatusEnums
.
REJECT
.
getCode
()
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
/**
/**
* 撤回流程办理单
* 撤回流程办理单
*/
*/
...
@@ -315,12 +303,32 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
...
@@ -315,12 +303,32 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
if
(
ObjectUtils
.
isEmpty
(
ajaxResult1
))
{
if
(
ObjectUtils
.
isEmpty
(
ajaxResult1
))
{
}
}
updateModelByInstanceId
(
instanceId
);
updateModelByInstanceId
(
instanceId
,
OpeningApplicationStatusEnums
.
WITHDRAW
.
getCode
()
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
private
String
getWorkflowStatus
(
JSONObject
dataObject
)
{
return
!
ValidationUtil
.
isEmpty
(
dataObject
)
&&
!
ValidationUtil
.
isEmpty
(
dataObject
.
get
(
"status"
))
?
String
.
valueOf
(
dataObject
.
get
(
"status"
))
:
""
;
}
private
String
getWorkflowRoleGroups
(
JSONObject
dataObject
)
{
JSONArray
executorArray
=
dataObject
.
getJSONObject
(
"nodeInfo"
).
getJSONArray
(
"executor"
);
if
(!
ValidationUtil
.
isEmpty
(
executorArray
))
{
return
executorArray
.
stream
().
map
(
json
->
Optional
.
ofNullable
(((
LinkedHashMap
)
json
).
get
(
"groupId"
)).
orElse
(
""
).
toString
()).
collect
(
Collectors
.
joining
(
","
));
}
return
null
;
}
private
JSONObject
getTask
(
String
instanceId
)
{
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTask
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
String
taskId
=
dataObject
.
getString
(
"id"
);
// 工作流ID
FeignClientResult
<
JSONObject
>
nodeInfo
=
workflowFeignClient
.
getNodeInfotoken
(
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
(),
RequestContext
.
getToken
(),
taskId
);
dataObject
.
put
(
"nodeInfo"
,
nodeInfo
.
getResult
());
return
dataObject
;
}
/**
/**
* JY+年(4位)+月(2位)+日(2位)+序列号(3位
* JY+年(4位)+月(2位)+日(2位)+序列号(3位
...
...
amos-boot-system-tzs/amos-boot-module-tcm/amos-boot-module-tcm-api/src/main/java/com/yeejoin/amos/boot/module/tcm/api/controller/CreateCodeController.java
View file @
516db5f9
...
@@ -53,6 +53,6 @@ public class CreateCodeController extends BaseController {
...
@@ -53,6 +53,6 @@ public class CreateCodeController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"申请单编号生成"
,
notes
=
"申请单编号生成"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"申请单编号生成"
,
notes
=
"申请单编号生成"
)
public
ResponseModel
<
List
<
String
>>
CreateANCode1
(
@RequestParam
(
"type"
)
String
type
,
public
ResponseModel
<
List
<
String
>>
CreateANCode1
(
@RequestParam
(
"type"
)
String
type
,
@RequestParam
(
"num"
)
int
num
)
{
@RequestParam
(
"num"
)
int
num
)
{
return
ResponseHelper
.
buildResponse
(
createCodeService
.
CreateAN
Code
(
type
,
num
));
return
ResponseHelper
.
buildResponse
(
createCodeService
.
createApplicationForm
Code
(
type
,
num
));
}
}
}
}
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