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
f66eb228
Commit
f66eb228
authored
Sep 27, 2021
by
tianbo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into developer-latentDanger
parents
46b624a5
8ebb75cd
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
270 additions
and
51 deletions
+270
-51
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+3
-4
WorkflowExcuteServiceImpl.java
...ot/biz/common/service/impl/WorkflowExcuteServiceImpl.java
+23
-11
WorkflowFeignService.java
.../boot/biz/common/workflow/feign/WorkflowFeignService.java
+12
-2
DispatchTaskDto.java
...yeejoin/amos/boot/module/tzs/api/dto/DispatchTaskDto.java
+5
-0
WechatMessageDto.java
...eejoin/amos/boot/module/tzs/api/dto/WechatMessageDto.java
+27
-0
WechatTaskLatLonDto.java
...oin/amos/boot/module/tzs/api/dto/WechatTaskLatLonDto.java
+29
-0
DispatchTask.java
...yeejoin/amos/boot/module/tzs/api/entity/DispatchTask.java
+7
-0
AlertStatusEnum.java
...ejoin/amos/boot/module/tzs/api/enums/AlertStatusEnum.java
+1
-0
IWechatService.java
...join/amos/boot/module/tzs/api/service/IWechatService.java
+8
-0
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+8
-0
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+7
-0
PlanAuditController.java
.../supervision/business/controller/PlanAuditController.java
+12
-10
IPlanAuditLogDao.java
...supervision/business/dao/repository/IPlanAuditLogDao.java
+11
-1
PlanAuditServiceImpl.java
...pervision/business/service/impl/PlanAuditServiceImpl.java
+14
-6
IPlanAuditService.java
...supervision/business/service/intfc/IPlanAuditService.java
+9
-0
WechatController.java
...amos/boot/module/tzs/biz/controller/WechatController.java
+54
-14
DispatchTaskServiceImpl.java
.../module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
+6
-3
WechatServiceImpl.java
...s/boot/module/tzs/biz/service/impl/WechatServiceImpl.java
+34
-0
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
f66eb228
...
...
@@ -30,7 +30,6 @@ import org.typroject.tyboot.core.foundation.utils.Bean;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -107,10 +106,10 @@ public class ControllerAop {
CompanyBo
company
=
new
CompanyBo
();
DepartmentBo
department
=
new
DepartmentBo
();
RoleBo
role
=
new
RoleBo
();
CompanyModel
companyM
=
user
.
getCompanys
()
.
get
(
0
)
;
CompanyModel
companyM
=
user
.
getCompanys
()
!=
null
?
user
.
getCompanys
().
get
(
0
)
:
null
;
Bean
.
copyExistPropertis
(
companyM
,
company
);
Map
<
Long
,
List
<
DepartmentModel
>>
mapDepartments
=
user
.
getCompanyDepartments
();
DepartmentModel
departmentM
=
mapDepartments
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
)
;
DepartmentModel
departmentM
=
companyM
!=
null
?
mapDepartments
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
)
:
null
;
Bean
.
copyExistPropertis
(
departmentM
,
department
);
Map
<
Long
,
List
<
RoleModel
>>
roles
=
user
.
getOrgRoles
();
Long
sequenceNbr
;
...
...
@@ -121,7 +120,7 @@ public class ControllerAop {
}
RoleModel
roleM
=
null
;
if
(
sequenceNbr
==
null
)
{
roleM
=
roles
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
)
;
roleM
=
companyM
!=
null
?
roles
.
get
(
companyM
.
getSequenceNbr
()).
get
(
0
)
:
null
;
}
else
{
roleM
=
roles
.
get
(
sequenceNbr
).
get
(
0
);
}
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/service/impl/WorkflowExcuteServiceImpl.java
View file @
f66eb228
...
...
@@ -171,19 +171,31 @@ public class WorkflowExcuteServiceImpl implements IWorkflowExcuteService {
}
return
newDate
+
result
;
}
/**
* 描述: 获取在流程启动时,直接完成的特定任务的执行角色信息。
* 作用:用来判断当前登录用户在任务回退到启动并完成的哪一步任务的执行权限,以及获取当前登录用户所属角色能够处理的当前任务的列表数据
* @param processInstanceId
* @return
*/
/**
* 描述: 获取在流程启动时,直接完成的特定任务的执行角色信息。
* 作用:用来判断当前登录用户在任务回退到启动并完成的哪一步任务的执行权限,以及获取当前登录用户所属角色能够处理的当前任务的列表数据
*
* @param processInstanceId
* @return
*/
public
String
getFristFlowDetail
(
String
processInstanceId
)
{
try
{
JSONObject
detail
=
workflowFeignService
.
getHistoricIdentityLinksForProcessInstance
(
processInstanceId
);
if
(
ObjectUtils
.
isNotEmpty
(
detail
.
getJSONArray
(
"data"
)))
{
JSONObject
json
=
detail
.
getJSONArray
(
"data"
).
getJSONObject
(
1
);
if
(
json
.
getBooleanValue
(
"group"
))
{
return
json
.
getString
(
"groupId"
);
JSONObject
historyTaskJsonObject
=
workflowFeignService
.
getHistoricTaskForProcessInstanceId
(
processInstanceId
);
if
(
ObjectUtils
.
isEmpty
(
historyTaskJsonObject
.
getJSONArray
(
"data"
)))
{
return
null
;
}
JSONObject
historyTaskObject
=
historyTaskJsonObject
.
getJSONArray
(
"data"
).
getJSONObject
(
0
);
JSONObject
detail
=
workflowFeignService
.
getHistoricIdentityLinksForTask
(
historyTaskObject
.
getString
(
"id"
));
JSONArray
resultArray
=
detail
.
getJSONArray
(
"data"
);
if
(
ObjectUtils
.
isNotEmpty
(
resultArray
))
{
for
(
int
i
=
0
;
i
<
resultArray
.
size
();
i
++)
{
JSONObject
result
=
resultArray
.
getJSONObject
(
i
);
if
(
result
.
getBooleanValue
(
"group"
))
{
return
result
.
getString
(
"groupId"
);
}
}
}
}
catch
(
ParseException
e
)
{
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/workflow/feign/WorkflowFeignService.java
View file @
f66eb228
...
...
@@ -192,6 +192,16 @@ public interface WorkflowFeignService {
* @return
* @throws ParseException
*/
@RequestMapping
(
value
=
"/activitiHistory/processes/historytasks/getGroupNamelist/{processInstanceId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
getHistoricIdentityLinksForProcessInstance
(
@PathVariable
(
"processInstanceId"
)
String
processInstanceId
)
throws
ParseException
;
@RequestMapping
(
value
=
"/activitiHistory/processes/historytasks/getGroupNamelist/{taskId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
getHistoricIdentityLinksForTask
(
@PathVariable
(
"taskId"
)
String
taskId
)
throws
ParseException
;
/**
*获取指定流程定义下所有的历史流程任务任务执行信息 --获取historytask表数据
* @param processInstanceId
* @return
* @throws ParseException
*/
@RequestMapping
(
value
=
"/processes/historytasks/getHistoricTaskForProcessInstanceId/{processInstanceId}"
,
method
=
RequestMethod
.
GET
)
JSONObject
getHistoricTaskForProcessInstanceId
(
@PathVariable
(
"processInstanceId"
)
String
processInstanceId
)
throws
ParseException
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/DispatchTaskDto.java
View file @
f66eb228
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
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
;
...
...
@@ -75,4 +76,8 @@ public class DispatchTaskDto extends BaseDto {
@ApiModelProperty
(
value
=
"警情类型code"
)
private
String
alertCode
;
@ApiModelProperty
(
value
=
"救援完成时间"
)
private
Date
saveTime
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/WechatMessageDto.java
0 → 100644
View file @
f66eb228
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.Map
;
/**
* 微信公众号模板dto
*/
@Data
@ApiModel
(
value
=
"WechatMessageDto"
,
description
=
"微信公众号模板消息dto类"
)
public
class
WechatMessageDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"模板id"
)
private
String
templateId
;
@ApiModelProperty
(
value
=
"跳转地址"
)
private
String
url
;
@ApiModelProperty
(
value
=
"数据"
)
private
Map
<
String
,
String
>
data
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/dto/WechatTaskLatLonDto.java
0 → 100644
View file @
f66eb228
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
api
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 微信公众号任务id 和经纬度接受dto类
*
* @author system_generator
* @date 2021-09-22
*/
@Data
@ApiModel
(
value
=
"WechatTaskLatLonDto"
,
description
=
"微信公众号任务id 和经纬度接受dto类"
)
public
class
WechatTaskLatLonDto
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"任务id"
)
private
Long
taskId
;
@ApiModelProperty
(
value
=
"经度"
)
private
String
longitude
;
@ApiModelProperty
(
value
=
"纬度"
)
private
String
latitude
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/entity/DispatchTask.java
View file @
f66eb228
...
...
@@ -124,4 +124,11 @@ public class DispatchTask extends BaseEntity {
@TableField
(
"task_status"
)
private
String
taskStatus
;
/**
* 救援完成时间
*/
@TableField
(
"save_time"
)
private
Date
saveTime
;
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/enums/AlertStatusEnum.java
View file @
f66eb228
...
...
@@ -51,3 +51,4 @@ public enum AlertStatusEnum {
return
null
;
}
}
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/api/service/IWechatService.java
View file @
f66eb228
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.tzs.api.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto
;
/**
* 微信公众号服务类
...
...
@@ -26,4 +27,11 @@ public interface IWechatService {
* @return
*/
JSONObject
getUserInfo
(
String
openId
);
/**
* 发送微信模板消息
* @param openId
* @return
*/
JSONObject
sendWechatModelMessage
(
String
openId
,
WechatMessageDto
wechatMessageDto
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
f66eb228
...
...
@@ -92,6 +92,14 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
"-1"
);
}
}
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 start
if
(
tempOrg
.
getBizOrgType
().
equals
(
"DEPARTMENT"
))
{
List
<
OrgUsr
>
tempList
=
iOrgUsrService
.
list
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getParentId
,
id
).
eq
(
OrgUsr:
:
getIsDelete
,
false
));
if
(
tempList
.
size
()
>
0
)
{
return
ResponseHelper
.
buildResponse
(
"-1"
);
}
}
//bug 2882 判断是否为部门 如果部门底下有人员不可直接删除 chenzhao 2021-09-27 end
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 开始*/
iOrgUsrService
.
update
(
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
String
.
valueOf
(
id
)).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
f66eb228
...
...
@@ -705,6 +705,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr
orgUsr
=
getById
(
id
);
// 动态表单数据
List
<
FormValue
>
formValue
=
getFormValue
(
id
);
//bug 2580 返回值改为具体名称 chenzhao 2021-09-27 start
for
(
FormValue
value
:
formValue
)
{
if
(
value
.
getValueName
()
!=
null
&&
!
value
.
getValueName
()
.
equals
(
" "
)){
value
.
setValue
(
value
.
getValueName
());
}
}
//bug 2580 返回值改为具体名称 chenzhao 2021-09-27 end
OrgUsrFormDto
orgUsrFormVo
=
new
OrgUsrFormDto
();
orgUsrFormVo
.
setDynamicFormAlert
(
formValue
);
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrFormVo
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/controller/PlanAuditController.java
View file @
f66eb228
...
...
@@ -2,8 +2,6 @@ package com.yeejoin.amos.supervision.business.controller;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.supervision.business.service.intfc.IPlanAuditService
;
import
com.yeejoin.amos.supervision.business.util.CommonResponse
;
import
com.yeejoin.amos.supervision.business.util.CommonResponseUtil
;
import
com.yeejoin.amos.supervision.core.framework.PersonIdentify
;
import
com.yeejoin.amos.supervision.dao.entity.PlanAuditLog
;
import
io.swagger.annotations.Api
;
...
...
@@ -15,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
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
;
@RestController
@RequestMapping
(
value
=
"/api/planAudit"
)
...
...
@@ -30,17 +30,19 @@ public class PlanAuditController extends AbstractBaseController {
@PersonIdentify
@ApiOperation
(
value
=
"计划工作流审核"
,
notes
=
"计划工作流审核"
)
@RequestMapping
(
value
=
"/auditWorkFlow"
,
produces
=
"application/json;charset=UTF-8"
,
method
=
RequestMethod
.
POST
)
public
CommonResponse
auditWorkFlow
(
public
ResponseModel
auditWorkFlow
(
@ApiParam
(
value
=
"工作流流水实例"
,
required
=
true
)
@RequestBody
PlanAuditLog
planAuditLog
,
@ApiParam
(
value
=
"工作流流水实例"
,
required
=
true
)
@RequestBody
Integer
status
,
@ApiParam
(
value
=
"执行控制条件"
,
required
=
true
)
@RequestParam
String
condition
)
{
try
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
CommonResponseUtil
.
success
(
planAuditService
.
auditWorkFlow
(
planAuditLog
,
status
,
condition
,
reginParams
));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
CommonResponseUtil
.
failure
(
"计划工作流审核失败!"
);
}
ReginParams
reginParams
=
getSelectedOrgInfo
();
return
ResponseHelper
.
buildResponse
(
planAuditService
.
auditWorkFlow
(
planAuditLog
,
status
,
condition
,
reginParams
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"指定计划的执行日志"
)
@GetMapping
(
value
=
"/{planId}/timeLine"
)
public
ResponseModel
timeLineLog
(
@PathVariable
Long
planId
)
{
return
ResponseHelper
.
buildResponse
(
planAuditService
.
listByPlanId
(
planId
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/dao/repository/IPlanAuditLogDao.java
View file @
f66eb228
package
com
.
yeejoin
.
amos
.
supervision
.
business
.
dao
.
repository
;
import
com.yeejoin.amos.supervision.dao.entity.PlanAuditLog
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
@Repository
(
"planAuditLogDao"
)
public
interface
IPlanAuditLogDao
extends
BaseDao
<
PlanAuditLog
,
Long
>
{
/**
* 指定计划的审核日志
* @param planId 计划id
* @param sort 排序条件
* @return List<PlanAuditLog>
*/
List
<
PlanAuditLog
>
findAllByPlanId
(
Long
planId
,
Sort
sort
);
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/impl/PlanAuditServiceImpl.java
View file @
f66eb228
...
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.supervision.business.service.impl;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.service.IWorkflowExcuteService
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.supervision.business.dao.repository.IPlanAuditDao
;
import
com.yeejoin.amos.supervision.business.dao.repository.IPlanAuditLogDao
;
import
com.yeejoin.amos.supervision.business.dao.repository.IPlanDao
;
...
...
@@ -12,9 +11,12 @@ import com.yeejoin.amos.supervision.dao.entity.PlanAudit;
import
com.yeejoin.amos.supervision.dao.entity.PlanAuditLog
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
@Service
(
"planAuditService"
)
...
...
@@ -30,9 +32,6 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
private
IPlanAuditLogDao
planAuditLogDao
;
@Autowired
private
WorkflowFeignService
workflowFeignService
;
@Autowired
private
IPlanDao
planDao
;
@Override
...
...
@@ -51,9 +50,9 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
workflowExcuteService
.
setTaskAssign
(
instanceId
,
personIdentity
.
getPersonSeq
());
if
(
b
)
{
PlanStatusEnum
statusEnum
=
PlanStatusEnum
.
getEnum
(
status
);
planDao
.
updatePlanStatus
(
statusEnum
.
getNextStatus
(),
planAuditLog
.
getPlanAudit
Id
());
planDao
.
updatePlanStatus
(
statusEnum
!=
null
?
statusEnum
.
getNextStatus
()
:
PlanStatusEnum
.
DRAFT
.
getValue
(),
planAuditLog
.
getPlan
Id
());
}
else
{
planDao
.
updatePlanStatus
(
PlanStatusEnum
.
DRAFT
.
getValue
(),
planAuditLog
.
getPlan
Audit
Id
());
planDao
.
updatePlanStatus
(
PlanStatusEnum
.
DRAFT
.
getValue
(),
planAuditLog
.
getPlanId
());
}
planAuditLog
.
setPlanId
(
planAudit
.
getPlanId
());
planAuditLog
.
setPlanAuditId
(
planAudit
.
getId
());
...
...
@@ -70,6 +69,15 @@ public class PlanAuditServiceImpl implements IPlanAuditService {
return
Boolean
.
FALSE
;
}
@Override
public
List
<
PlanAuditLog
>
listByPlanId
(
Long
planId
)
{
Sort
.
Order
idOrder
=
new
Sort
.
Order
(
Sort
.
Direction
.
ASC
,
"createDate"
);
List
<
Sort
.
Order
>
orders
=
new
ArrayList
<
Sort
.
Order
>();
orders
.
add
(
idOrder
);
Sort
sort
=
Sort
.
by
(
orders
);
return
planAuditLogDao
.
findAllByPlanId
(
planId
,
sort
);
}
// @Override
// @Transactional
// public Boolean auditWorkFlow(PlanAuditLog planAuditLog, String condition, ReginParams reginParams) {
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-supervision-biz/src/main/java/com/yeejoin/amos/supervision/business/service/intfc/IPlanAuditService.java
View file @
f66eb228
...
...
@@ -3,6 +3,15 @@ package com.yeejoin.amos.supervision.business.service.intfc;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.supervision.dao.entity.PlanAuditLog
;
import
java.util.List
;
public
interface
IPlanAuditService
{
Boolean
auditWorkFlow
(
PlanAuditLog
planAuditLog
,
Integer
status
,
String
condition
,
ReginParams
reginParams
);
/**
* 查询指定计划的审批日志
* @param planId 计划id
* @return List<PlanAuditLog>
*/
List
<
PlanAuditLog
>
listByPlanId
(
Long
planId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/controller/WechatController.java
View file @
f66eb228
...
...
@@ -6,15 +6,21 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
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.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatAccessDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatRelationDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatTaskLatLonDto
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.DispatchTask
;
import
com.yeejoin.amos.boot.module.tzs.api.entity.WechatRelation
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IDispatchTaskService
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IWechatService
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertCalledServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.AlertFormValueServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchTaskServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.service.impl.WechatRelationServiceImpl
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
...
...
@@ -88,9 +94,13 @@ public class WechatController extends BaseController {
IDispatchTaskService
dispatchTaskService
;
@Autowired
private
AlertFormValueServiceImpl
iAlertFormValueService
;
AlertFormValueServiceImpl
iAlertFormValueService
;
@Autowired
DispatchTaskServiceImpl
dispatchTaskServiceImpl
;
@Autowired
AlertCalledServiceImpl
iAlertCalledService
;
/**
* 获取微信回调信息返回验证是否通过
...
...
@@ -334,15 +344,14 @@ public class WechatController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/returnDistance"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据任务id 经纬度 返回现在距离任务距离"
,
notes
=
"根据任务id 经纬度 返回现在距离任务距离"
)
public
ResponseModel
<
String
>
returnDistance
(
@ApiParam
(
value
=
"任务id"
,
required
=
true
)
@RequestParam
(
name
=
"taskId"
)
Long
taskId
,
@ApiParam
(
value
=
"经度"
,
required
=
true
)
@RequestParam
(
name
=
"longitude"
)
String
longitude
,
@ApiParam
(
value
=
"纬度"
,
required
=
true
)
@RequestParam
(
name
=
"latitude"
)
String
latitude
)
{
if
(
ValidationUtil
.
isEmpty
(
taskId
)
||
ValidationUtil
.
isEmpty
(
longitude
)
||
ValidationUtil
.
isEmpty
(
latitude
)){
public
ResponseModel
<
String
>
returnDistance
(
@RequestBody
WechatTaskLatLonDto
dto
)
{
if
(
ValidationUtil
.
isEmpty
(
dto
)
||
ValidationUtil
.
isEmpty
(
dto
.
getTaskId
())
||
ValidationUtil
.
isEmpty
(
dto
.
getLatitude
())
||
ValidationUtil
.
isEmpty
(
dto
.
getLongitude
())){
throw
new
BadRequest
(
"参数校验失败."
);
}
String
distance
=
dispatchTaskService
.
returnDistanceByTaskId
(
taskId
,
longitude
,
latitude
);
String
distance
=
dispatchTaskService
.
returnDistanceByTaskId
(
dto
.
getTaskId
(),
dto
.
getLongitude
(),
dto
.
getLatitude
()
);
return
ResponseHelper
.
buildResponse
(
distance
);
}
...
...
@@ -464,9 +473,9 @@ public class WechatController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@
PostMapping
(
value
=
"/taskArrive
"
)
@ApiOperation
(
httpMethod
=
"
POS
T"
,
value
=
"点击到达触发事件"
,
notes
=
"点击到达触发事件"
)
public
ResponseModel
<
WechatMyTaskDto
>
taskArrive
(
@
RequestParam
Long
taskId
)
{
@
GetMapping
(
value
=
"/taskArrive/{taskId}
"
)
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"点击到达触发事件"
,
notes
=
"点击到达触发事件"
)
public
ResponseModel
<
WechatMyTaskDto
>
taskArrive
(
@
PathVariable
Long
taskId
)
{
if
(
ValidationUtil
.
isEmpty
(
taskId
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
...
...
@@ -580,9 +589,9 @@ public class WechatController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@
PostMapping
(
value
=
"/saveFinish
"
)
@ApiOperation
(
httpMethod
=
"
POS
T"
,
value
=
"点击救援完成触发事件"
,
notes
=
"点击救援完成触发事件"
)
public
ResponseModel
<
WechatMyTaskDto
>
saveFinish
(
@
RequestParam
Long
taskId
)
{
@
GetMapping
(
value
=
"/saveFinish/{taskId}
"
)
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"点击救援完成触发事件"
,
notes
=
"点击救援完成触发事件"
)
public
ResponseModel
<
WechatMyTaskDto
>
saveFinish
(
@
PathVariable
Long
taskId
)
{
if
(
ValidationUtil
.
isEmpty
(
taskId
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
...
...
@@ -749,4 +758,35 @@ public class WechatController extends BaseController {
}
return
ResponseHelper
.
buildResponse
(
urlString
);
}
/**
* 测试模板消息
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@GetMapping
(
value
=
"/testDispatch/{taskId}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"测试模板消息"
,
notes
=
"测试模板消息"
)
public
ResponseModel
<
JSONObject
>
testDispatch
(
@PathVariable
Long
taskId
)
{
DispatchTask
task
=
dispatchTaskServiceImpl
.
getById
(
taskId
);
String
tel
=
task
.
getResponseUserTel
();
tel
=
"15353367807"
;
// 获取openId
WechatRelation
relation
=
wechatRelationServiceImpl
.
getOne
(
new
LambdaQueryWrapper
<
WechatRelation
>().
eq
(
WechatRelation:
:
getPhone
,
tel
));
if
(
relation
==
null
)
{
throw
new
BadRequest
(
"该用户未在系统中注册,无法发送模板消息"
);
// 接口迁移到服务中时改成日志形式;
}
WechatMessageDto
test
=
new
WechatMessageDto
();
Map
<
String
,
String
>
data
=
new
HashMap
<>();
data
.
put
(
"dispatchTime"
,
DateUtils
.
date2LongStr
(
task
.
getDispatchTime
()));
AlertCalledFormDto
dto
=
iAlertCalledService
.
selectAlertCalledByIdNoCache
(
task
.
getAlertId
());
data
.
put
(
"address"
,
dto
.
getAlertCalledDto
().
getAddress
());
test
.
setUrl
(
"www.baidu.com"
);
test
.
setTemplateId
(
"SLjmNJoCNLC3FBcYzWzR-u3el0kqXf8WMTmzw8dAQm4"
);
test
.
setData
(
data
);
JSONObject
result
=
wechatService
.
sendWechatModelMessage
(
relation
.
getOpenId
(),
test
);
return
ResponseHelper
.
buildResponse
(
result
);
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/DispatchTaskServiceImpl.java
View file @
f66eb228
...
...
@@ -209,7 +209,7 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
set
(
DispatchPaper:
:
getSaveOrgName
,
task
.
getResponseOrgName
()).
eq
(
DispatchPaper:
:
getSequenceNbr
,
task
.
getPaperId
()));
// 如果存在救援过程表更新救援过程表中信息
if
(
task
.
getIsSaveTask
())
{
if
(
task
.
getIsSaveTask
()
!=
null
&&
task
.
getIsSaveTask
()
)
{
rescueProcessServiceImpl
.
update
(
new
LambdaUpdateWrapper
<
RescueProcess
>().
set
(
RescueProcess:
:
getArriveTime
,
now
).
set
(
RescueProcess:
:
getArriveStatus
,
true
).
...
...
@@ -243,6 +243,8 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
set
(
RescueProcess:
:
getRescueFeedbackType
,
"主动反馈"
).
set
(
RescueProcess:
:
getRescueFeedbackCode
,
"856"
).
eq
(
RescueProcess:
:
getAlertId
,
task
.
getAlertId
()));
task
.
setSaveTime
(
now
);
this
.
updateById
(
task
);
}
// 更新到达日志
repairConsultServiceImpl
.
saveRepairConsultByAlertIdType
(
task
.
getAlertId
(),
"JC"
,
taskId
,
null
);
...
...
@@ -263,12 +265,13 @@ public class DispatchTaskServiceImpl extends BaseService<DispatchTaskDto,Dispatc
// 更新反馈信息
DispatchTask
task
=
this
.
getById
(
wechatDispatchFeedbackDto
.
getTaskId
());
DispatchPaper
dispatchPaper
=
dispatchPaperServiceImpl
.
getById
(
task
.
getPaperId
());
Date
now
=
new
Date
();
// 反馈方式
dispatchPaper
.
setFeedbackCode
(
"856"
);
dispatchPaper
.
setFeedbackType
(
"主动反馈"
);
// 反馈时间
dispatchPaper
.
setFeedbackFinishTime
(
n
ew
Date
()
);
dispatchPaper
.
setFeedbackTime
(
n
ew
Date
()
);
dispatchPaper
.
setFeedbackFinishTime
(
n
ow
);
dispatchPaper
.
setFeedbackTime
(
n
ow
);
// 反馈人信息
dispatchPaper
.
setFeedbackUid
(
task
.
getResponseUserId
()
+
""
);
dispatchPaper
.
setFeedbackUname
(
task
.
getResponseUserName
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/biz/service/impl/WechatServiceImpl.java
View file @
f66eb228
package
com
.
yeejoin
.
amos
.
boot
.
module
.
tzs
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.WechatMessageDto
;
import
com.yeejoin.amos.boot.module.tzs.api.service.IWechatService
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -113,4 +115,35 @@ public class WechatServiceImpl implements IWechatService {
}
}
@Override
public
JSONObject
sendWechatModelMessage
(
String
openId
,
WechatMessageDto
wechatMessageDto
)
{
String
accessToken
=
this
.
getAccessToken
();
String
modelMessageUrl
=
wechatUrl
+
"/cgi-bin/message/template/send?access_token="
+
accessToken
;
JSONObject
messageBody
=
new
JSONObject
();
messageBody
.
put
(
"touser"
,
openId
);
messageBody
.
put
(
"template_id"
,
wechatMessageDto
.
getTemplateId
());
if
(
wechatMessageDto
.
getUrl
()
!=
null
)
{
messageBody
.
put
(
"url"
,
wechatMessageDto
.
getUrl
());
}
JSONObject
data
=
new
JSONObject
();
Map
<
String
,
String
>
datas
=
wechatMessageDto
.
getData
();
for
(
Map
.
Entry
<
String
,
String
>
temp
:
datas
.
entrySet
())
{
JSONObject
tempObj
=
new
JSONObject
();
tempObj
.
put
(
"value"
,
temp
.
getValue
());
data
.
put
(
temp
.
getKey
(),
tempObj
);
}
messageBody
.
put
(
"data"
,
data
);
System
.
out
.
println
(
messageBody
.
toJSONString
());
String
responseStr
=
HttpUtils
.
doPost
(
modelMessageUrl
,
messageBody
.
toJSONString
());
JSONObject
response
=
null
;
try
{
response
=
JSONObject
.
parseObject
(
responseStr
);
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
"发送模板消息出错:"
+
e
.
getMessage
());
}
return
response
;
}
}
\ 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