提交修改
This commit is contained in:
commit
bd75727e5c
@ -23,7 +23,7 @@ public enum WorkMsgTypeEnum {
|
|||||||
SCORE(9, "绩效考评待办事项", "评分", "\n @的绩效\n \n 需您去评分"),
|
SCORE(9, "绩效考评待办事项", "评分", "\n @的绩效\n \n 需您去评分"),
|
||||||
SKIP(10, "绩效跳过", "跳过", "# @的绩效\n ## 己经跳过"),
|
SKIP(10, "绩效跳过", "跳过", "# @的绩效\n ## 己经跳过"),
|
||||||
TRANSFER(11, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
|
TRANSFER(11, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
|
||||||
CLEARN(10, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
|
CLEARN(12, "绩效转交", "转交", "# @的绩效\n ## 己经转交"),
|
||||||
// 您的2020年10月绩效考核已经开始,请尽快制定绩效目标
|
// 您的2020年10月绩效考核已经开始,请尽快制定绩效目标
|
||||||
// 吴林的2020年12月绩效考核的目标需要您确认,点击前往确认
|
// 吴林的2020年12月绩效考核的目标需要您确认,点击前往确认
|
||||||
;
|
;
|
||||||
|
|||||||
@ -87,4 +87,6 @@ public interface FlowRecordMapper extends BaseMapper<FlowRecord> {
|
|||||||
List<FlowRecord> selectLastFlowRecordsById(@Param("recordId") Long recordId);
|
List<FlowRecord> selectLastFlowRecordsById(@Param("recordId") Long recordId);
|
||||||
|
|
||||||
List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(@Param("recordId") Long recordId, @Param("flowIndex") int flowIndex);
|
List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(@Param("recordId") Long recordId, @Param("flowIndex") int flowIndex);
|
||||||
|
|
||||||
|
List<FlowRecord> selectSkipFlowRecordsById(@Param("recordId") Long recordId);
|
||||||
}
|
}
|
||||||
@ -82,4 +82,6 @@ public interface FlowRecordService extends IService<FlowRecord> {
|
|||||||
List<FlowRecord> selectLastFlowRecordsById(Long recordId);
|
List<FlowRecord> selectLastFlowRecordsById(Long recordId);
|
||||||
//获取制定步骤一个小节点的所有数据
|
//获取制定步骤一个小节点的所有数据
|
||||||
List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex);
|
List<FlowRecord> selectLastFlowRecordsByIdAndFlowIndex(Long recordId, int flowIndex);
|
||||||
|
|
||||||
|
List<FlowRecord> selectSkipFlowRecordsById(Long recordId);
|
||||||
}
|
}
|
||||||
@ -221,4 +221,9 @@ public class FlowRecordServiceImpl extends ServiceImpl<FlowRecordMapper, FlowRec
|
|||||||
return flowRecordMapper.selectLastFlowRecordsByIdAndFlowIndex(recordId, flowIndex);
|
return flowRecordMapper.selectLastFlowRecordsByIdAndFlowIndex(recordId, flowIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FlowRecord> selectSkipFlowRecordsById(Long recordId){
|
||||||
|
return flowRecordMapper.selectSkipFlowRecordsById(recordId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -243,7 +243,7 @@ public class DingtalkBusiness {
|
|||||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
||||||
if(resultRecord != null){
|
if(resultRecord != null){
|
||||||
FlowStart flowStart = flowStartService.selectFlowStartById(resultRecord.getStartId());
|
FlowStart flowStart = flowStartService.selectFlowStartById(resultRecord.getStartId());
|
||||||
StaffSimpleInfo fromStaff = staffService.selectStaffSimpleInfo(resultRecord.getStaffId());
|
StaffSimpleInfo fromStaff = staffService.selectStaffSimpleInfo(resultRecord.getStaffId());//查询来自那里
|
||||||
fromStaff.setResultRecord(resultRecord);
|
fromStaff.setResultRecord(resultRecord);
|
||||||
fromStaff.setFlowStart(flowStart);
|
fromStaff.setFlowStart(flowStart);
|
||||||
List<StaffSimpleInfo> toStaffids = new ArrayList<>();
|
List<StaffSimpleInfo> toStaffids = new ArrayList<>();
|
||||||
@ -252,21 +252,16 @@ public class DingtalkBusiness {
|
|||||||
if(type == WorkMsgTypeEnum.REJECT.getType()){//被拒
|
if(type == WorkMsgTypeEnum.REJECT.getType()){//被拒
|
||||||
|
|
||||||
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.REJECT.getType());
|
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.REJECT.getType());
|
||||||
|
}else if(type == WorkMsgTypeEnum.URGING.getType()){//被拒
|
||||||
|
|
||||||
|
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.URGING.getType());
|
||||||
|
}else if(type == WorkMsgTypeEnum.SKIP.getType()){//被拒
|
||||||
|
|
||||||
|
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.SKIP.getType());
|
||||||
|
}else if(type == WorkMsgTypeEnum.TRANSFER.getType()){//被拒
|
||||||
|
|
||||||
|
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.TRANSFER.getType());
|
||||||
}else{
|
}else{
|
||||||
/*List<FlowRecord> flowRecords =
|
|
||||||
flowRecordService.selectFlowRecordByRecordIdStatus(resultRecordId, 2);
|
|
||||||
List<Long> ids = flowRecords.stream().map(new Function<FlowRecord, Long>() {
|
|
||||||
@Override
|
|
||||||
public Long apply(FlowRecord flowRecord) {
|
|
||||||
return flowRecord.getApprovalStaffId();
|
|
||||||
}
|
|
||||||
}).collect(Collectors.toList());
|
|
||||||
toStaffids = staffService.selectStaffSimpleInfos(ids);
|
|
||||||
for (StaffSimpleInfo simpleInfo:toStaffids
|
|
||||||
) {
|
|
||||||
simpleInfo.setResultRecord(resultRecord);
|
|
||||||
simpleInfo.setFlowStart(flowStart);
|
|
||||||
}*/
|
|
||||||
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
|
sendWorkMSGWithAsyn(null, toStaffids, WorkMsgTypeEnum.PROCESS.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,6 +475,7 @@ public class DingtalkBusiness {
|
|||||||
|
|
||||||
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.TRANSFER.getType()){//转交
|
if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.TRANSFER.getType()){//转交
|
||||||
//转交
|
//转交
|
||||||
|
//并发转交会有问题
|
||||||
logger.info("转交待办任务处理");
|
logger.info("转交待办任务处理");
|
||||||
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
|
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
|
||||||
info.getId(), 0);
|
info.getId(), 0);
|
||||||
@ -489,10 +485,12 @@ public class DingtalkBusiness {
|
|||||||
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
||||||
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
||||||
}
|
}
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
FlowRecord flowRecord = flowRecordService.selectFlowRecordById(flowChange.getFlowRecordId());
|
||||||
|
StaffSimpleInfo staffSimpleInfo = staffService.selectStaffSimpleInfo(flowRecord.getApprovalStaffId());
|
||||||
|
//List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
||||||
//发送待办任务到新指定人员,转交过来一定会有数据
|
//发送待办任务到新指定人员,转交过来一定会有数据
|
||||||
sendNotic(info.getId(), info.getEmployeeId(),
|
sendNotic(info.getId(), staffSimpleInfo.getEmployeeId(),
|
||||||
flowRecords.get(0).getFlowName(), info.getFlowStart().getName(),
|
flowRecord.getFlowName(), info.getFlowStart().getName(),
|
||||||
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
info.getResultRecord().getStaffName(), token, url, info.getResultRecord().getId());
|
||||||
|
|
||||||
|
|
||||||
@ -500,36 +498,32 @@ public class DingtalkBusiness {
|
|||||||
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.SKIP.getType()){//跳过
|
}else if(workMsgTypeEnum.getType() == WorkMsgTypeEnum.SKIP.getType()){//跳过
|
||||||
//跳过
|
//跳过
|
||||||
logger.info("跳过待办任务处理");
|
logger.info("跳过待办任务处理");
|
||||||
FlowChange flowChange = flowChangeService.selectFlowChangeByRecordIdAndToIdAndType(info.getResultRecord().getId(),
|
|
||||||
info.getId(), 1);
|
|
||||||
ThirdMsgSendRecord thirdMsgSendRecord =
|
List<FlowRecord> flowRecords =
|
||||||
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
flowRecordService.selectSkipFlowRecordsById(info.getResultRecord().getId());//取消所有跳过的人
|
||||||
info.getResultRecord().getId(),
|
|
||||||
flowChange.getApprovalId(), 1, 1);
|
|
||||||
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
|
||||||
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
|
||||||
}
|
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectAndOrFlowRecordsById(flowChange.getFlowRecordId(), info.getResultRecord().getId());
|
|
||||||
logger.info("查询到可能需要更新待办任务数量{}", flowRecords.size());
|
logger.info("查询到可能需要更新待办任务数量{}", flowRecords.size());
|
||||||
if(flowRecords.size() > 0){
|
if(flowRecords.size() > 0){
|
||||||
if(flowRecords.get(0).getType().intValue() == 1){
|
//if(flowRecords.get(0).getType().intValue() == 1){
|
||||||
//或签
|
//或签
|
||||||
logger.info("或签,需要更新该节点下所有人员的待办任务");
|
logger.info("或签,需要更新该节点下所有人员的待办任务");
|
||||||
for (FlowRecord flowRecord:flowRecords
|
for (FlowRecord flowRecord:flowRecords
|
||||||
) {
|
) {
|
||||||
if(flowRecord.getApprovalStaffId().longValue() != info.getId()){
|
//if(flowRecord.getApprovalStaffId().longValue() != info.getId()){
|
||||||
logger.info("更新非直接跳关人员的待办任务,人员id:{}, 姓名:{}", flowRecord.getApprovalStaffId(),
|
logger.info("更新非直接跳关人员的待办任务,人员id:{}, 姓名:{}", flowRecord.getApprovalStaffId(),
|
||||||
flowRecord.getApprovalStaffName());
|
flowRecord.getApprovalStaffName());
|
||||||
thirdMsgSendRecord =
|
ThirdMsgSendRecord thirdMsgSendRecord =
|
||||||
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
thirdMsgSendRecordService.selectThirdMsgSendRecordByWorkIdAndStaffIdAndTypeAndStatus(
|
||||||
info.getResultRecord().getId(),
|
info.getResultRecord().getId(),
|
||||||
flowRecord.getApprovalStaffId(), 1, 1);
|
flowRecord.getApprovalStaffId(), 1, 1);
|
||||||
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
if(thirdMsgSendRecord != null){//把原来的任务更新掉
|
||||||
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
dingTalkUtil.updateWorkMSG(thirdMsgSendRecord, token);
|
||||||
|
}else{
|
||||||
|
logger.info("无需更新");
|
||||||
}
|
}
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
}
|
//}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(info.getResultRecord().getId(), 2);
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import com.lz.modules.sys.entity.SysUserEntity;
|
|||||||
import com.lz.modules.sys.entity.SysUserEntityDto;
|
import com.lz.modules.sys.entity.SysUserEntityDto;
|
||||||
import com.lz.modules.sys.entity.SysUserTokenEntity;
|
import com.lz.modules.sys.entity.SysUserTokenEntity;
|
||||||
import com.lz.modules.sys.service.ShiroService;
|
import com.lz.modules.sys.service.ShiroService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.shiro.authc.*;
|
import org.apache.shiro.authc.*;
|
||||||
import org.apache.shiro.authz.AuthorizationInfo;
|
import org.apache.shiro.authz.AuthorizationInfo;
|
||||||
import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
||||||
@ -30,6 +31,7 @@ import java.util.Set;
|
|||||||
* @author Mark sunlightcs@gmail.com
|
* @author Mark sunlightcs@gmail.com
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
|
@Slf4j
|
||||||
public class OAuth2Realm extends AuthorizingRealm {
|
public class OAuth2Realm extends AuthorizingRealm {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShiroService shiroService;
|
private ShiroService shiroService;
|
||||||
@ -74,8 +76,10 @@ public class OAuth2Realm extends AuthorizingRealm {
|
|||||||
SysUserEntity user = null;
|
SysUserEntity user = null;
|
||||||
StaffEntity staffEntity = staffService.selectStaffById(tokenEntity.getUserId());
|
StaffEntity staffEntity = staffService.selectStaffById(tokenEntity.getUserId());
|
||||||
if(tokenEntity.getType() == 0){ //如果是系统用户
|
if(tokenEntity.getType() == 0){ //如果是系统用户
|
||||||
|
log.info("token判定为系统用户");
|
||||||
user = shiroService.queryUser(tokenEntity.getUserId());
|
user = shiroService.queryUser(tokenEntity.getUserId());
|
||||||
if(staffEntity != null){
|
if(staffEntity != null){
|
||||||
|
log.info("查询到系统用户信息");
|
||||||
user.setAvatar(staffEntity.getAvatar());
|
user.setAvatar(staffEntity.getAvatar());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -310,5 +310,9 @@
|
|||||||
<select id="selectLastFlowRecordsByIdAndFlowIndex" resultType="com.lz.modules.flow.entity.FlowRecord">
|
<select id="selectLastFlowRecordsByIdAndFlowIndex" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||||
select * from lz_flow_record where is_delete = 0 and flow_index = #{flowIndex} and record_id = #{recordId}
|
select * from lz_flow_record where is_delete = 0 and flow_index = #{flowIndex} and record_id = #{recordId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectSkipFlowRecordsById" resultType="com.lz.modules.flow.entity.FlowRecord">
|
||||||
|
select * from lz_flow_record where is_delete = 0 and (status=4 or status=3) and record_id = #{recordId}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user