发起考核添加部分日志
This commit is contained in:
parent
a15f7ba3e5
commit
07023f79d2
@ -20,6 +20,7 @@ import com.lz.modules.sys.entity.app.ResultDetail;
|
||||
import com.lz.modules.sys.entity.app.ResultRecord;
|
||||
import com.lz.modules.sys.service.app.ResultDetailService;
|
||||
import com.lz.modules.sys.service.app.ResultRecordService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.map.HashedMap;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -41,6 +42,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart> implements FlowStartService {
|
||||
|
||||
|
||||
@ -130,8 +132,10 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
|
||||
//发起指定用户的绩效,中途添加的时候
|
||||
public R startStaffs(StartGroups startGroupStaffIds){
|
||||
log.info("发起指定用户的绩效,中途添加的时候{}", startGroupStaffIds);
|
||||
FlowStart flowStart = flowStartMapper.selectFlowStartById(startGroupStaffIds.getStartId());
|
||||
if(flowStart == null){
|
||||
log.info("发起任务不存在");
|
||||
return R.error("发起任务不存在");
|
||||
}
|
||||
|
||||
@ -142,6 +146,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
) {
|
||||
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(groupStaffs.getStaffIds());
|
||||
if(staffSimpleInfos.size() == 0){
|
||||
log.info("无有效考核人员");
|
||||
R.error(groupStaffs.getEvaluationGroup().getName() + "——无有效考核人员");
|
||||
}
|
||||
switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos, mustRole, selfMustRole)){
|
||||
@ -165,8 +170,10 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
|
||||
@Override
|
||||
public R saveStart(FlowStart flowStart){
|
||||
log.info("发起考核{}", flowStart);
|
||||
//下面生成或者合并发起绩效
|
||||
if(flowStart.getStartTime() == null){
|
||||
log.info("未设置有效考核月份");
|
||||
return R.error("未设置有效考核月份");
|
||||
}
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月");
|
||||
@ -175,6 +182,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
if(flowStart.getCycleType().intValue() != 0){
|
||||
//月份
|
||||
if(flowStart.getEndTime() == null){
|
||||
log.info("未设置有效考核结束月份");
|
||||
return R.error("未设置有效考核结束月份");
|
||||
}
|
||||
String endDate = sdf.format(flowStart.getStartTime());
|
||||
@ -244,7 +252,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
List<StaffSimpleInfo> staffIds = evaluationGroupService.selectAllStaffSimpleInfoByGroupId(evaluationGroup);
|
||||
if(staffIds.size() == 0){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||
|
||||
log.info("无有效考核人员");
|
||||
return R.error(evaluationGroup.getName() + "——无有效考核人员");
|
||||
}
|
||||
if(flowStart.getIsDelete() != null){//已经发起过的
|
||||
@ -260,6 +268,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
staffIds = map.values().stream().collect(Collectors.toList());
|
||||
|
||||
if(staffIds.size() == 0){
|
||||
log.info("本次发起参与人员为0");
|
||||
return R.error(evaluationGroup.getName() + "——本次发起参与人员为0");
|
||||
}
|
||||
}
|
||||
@ -294,12 +303,14 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
List<ResultModelDto> resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId());
|
||||
if(resultModelDtos.size() == 0){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||
log.info("没有设置考核模板");
|
||||
return 1;
|
||||
}
|
||||
|
||||
List<FlowChart> flowCharts = flowChartService.selectFlowChartsByGroupId(evaluationGroup.getId());
|
||||
if(flowCharts.size() == 0){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||
log.info("无有效绩效流程节点");
|
||||
return 2;
|
||||
}
|
||||
List<FlowChartDetailRecord> flowChartDetailRecords = new ArrayList<>();
|
||||
@ -312,6 +323,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
|
||||
if(flowChartDetailRecords.size() == 0){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||
log.info("没有设置考核流程");
|
||||
return 3;
|
||||
}
|
||||
Map<Long, String> chartNameMaps =
|
||||
@ -322,6 +334,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
|
||||
if(staffManagers == null || staffManagers.size() == 0){
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||
log.info("没有设置绩效管理人员");
|
||||
return 4;
|
||||
}
|
||||
|
||||
@ -646,6 +659,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
|
||||
//如果有下面通知所有管理人员
|
||||
}else{
|
||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
|
||||
log.info("初始化考核流程失败");
|
||||
return 5;
|
||||
}
|
||||
return 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user