提交修改
This commit is contained in:
parent
0f43b2697e
commit
8f32cab62e
@ -16,10 +16,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
|
||||||
@ -92,9 +89,12 @@ public class RecordRoleController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
recordRoleAuths = recordRoleAuthService.selectByRoleId(role.getRoleId());
|
recordRoleAuths = recordRoleAuthService.selectByRoleId(role.getRoleId());
|
||||||
Map<Long, RecordRoleAuth> staffEntityMap = recordRoleAuths.stream().collect(Collectors.toMap(RecordRoleAuth::getAuthId,p->p));
|
Map<Long, RecordRoleAuth> staffEntityMap = new HashMap<>();
|
||||||
|
for(RecordRoleAuth auth : recordRoleAuths){
|
||||||
|
staffEntityMap.put(auth.getAuthId(),auth);
|
||||||
|
}
|
||||||
for(Long menuId:menuIds){
|
for(Long menuId:menuIds){
|
||||||
if(menuId <= 0 ){
|
if(menuId <= 0 || (menuId.toString().endsWith("000000"))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
RecordRoleAuth recordRoleAuth = staffEntityMap.get(menuId);
|
RecordRoleAuth recordRoleAuth = staffEntityMap.get(menuId);
|
||||||
|
|||||||
@ -27,4 +27,5 @@ public class Auth {
|
|||||||
private int keyResult35;
|
private int keyResult35;
|
||||||
private int keyResult37;
|
private int keyResult37;
|
||||||
private int editScore;
|
private int editScore;
|
||||||
|
private int deleteDetail;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -107,7 +107,9 @@ public class RecordAuthServiceImpl extends ServiceImpl<RecordAuthMapper, RecordA
|
|||||||
public Auth getAuth(List<RecordAuth> auths) {
|
public Auth getAuth(List<RecordAuth> auths) {
|
||||||
Map<String, Integer> map = new HashMap<>();
|
Map<String, Integer> map = new HashMap<>();
|
||||||
if (CollectionUtils.isNotEmpty(auths)) {
|
if (CollectionUtils.isNotEmpty(auths)) {
|
||||||
map = auths.stream().collect(Collectors.toMap(RecordAuth::getIdentity, RecordAuth::getStatus));
|
for(RecordAuth recordAuth : auths){
|
||||||
|
map.put(recordAuth.getIdentity(),recordAuth.getStatus());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return JSONObject.parseObject(JSON.toJSONString(map),Auth.class);
|
return JSONObject.parseObject(JSON.toJSONString(map),Auth.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,11 +134,7 @@ public class RecordRoleServiceImpl extends ServiceImpl<RecordRoleMapper, RecordR
|
|||||||
for (int j = i; j < recordAuths.size(); j++) {
|
for (int j = i; j < recordAuths.size(); j++) {
|
||||||
child = recordAuths.get(j);
|
child = recordAuths.get(j);
|
||||||
if (!child.getIdentity().equals(recordAuth.getIdentity())) {
|
if (!child.getIdentity().equals(recordAuth.getIdentity())) {
|
||||||
if (j == recordAuths.size() - 1) {
|
i = j - 1;
|
||||||
i = j;
|
|
||||||
} else {
|
|
||||||
i = j - 1;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String name = "不可见";
|
String name = "不可见";
|
||||||
|
|||||||
@ -63,7 +63,7 @@ public interface ResultRecordService extends IService<ResultRecord> {
|
|||||||
|
|
||||||
ResultRecord initResult(Long staffId ,Integer recordType,Long roleId) ;
|
ResultRecord initResult(Long staffId ,Integer recordType,Long roleId) ;
|
||||||
|
|
||||||
R checkApproval(Long recordId);
|
R checkApproval(ResultRecord resultRecord,Long userId);
|
||||||
|
|
||||||
int getDepartmentLevelIndex(List<Flow> list, int flowIndex);
|
int getDepartmentLevelIndex(List<Flow> list, int flowIndex);
|
||||||
|
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import com.lz.modules.app.service.StaffService;
|
|||||||
import com.lz.modules.app.utils.t.TwoTuple;
|
import com.lz.modules.app.utils.t.TwoTuple;
|
||||||
import com.lz.modules.flow.entity.*;
|
import com.lz.modules.flow.entity.*;
|
||||||
import com.lz.modules.flow.enums.FlowRecordEnum;
|
import com.lz.modules.flow.enums.FlowRecordEnum;
|
||||||
|
import com.lz.modules.flow.model.Auth;
|
||||||
import com.lz.modules.flow.model.StaffRoleDto;
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
import com.lz.modules.flow.model.TypeFlowDto;
|
import com.lz.modules.flow.model.TypeFlowDto;
|
||||||
import com.lz.modules.flow.model.TypeRoleDto;
|
import com.lz.modules.flow.model.TypeRoleDto;
|
||||||
@ -41,6 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -353,7 +355,8 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R checkApproval(Long recordId){
|
public R checkApproval(ResultRecord resultRecord,Long userId){
|
||||||
|
Long recordId = resultRecord.getId();
|
||||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordId);
|
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(recordId);
|
||||||
if (CollectionUtils.isEmpty(resultDetails)) {
|
if (CollectionUtils.isEmpty(resultDetails)) {
|
||||||
return R.error("请先添加绩效。");
|
return R.error("请先添加绩效。");
|
||||||
@ -362,16 +365,28 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
if (sum < 0.7) {
|
if (sum < 0.7) {
|
||||||
return R.error("recordId为[" + recordId + "]绩效权重之和必需等于0.7。");
|
return R.error("recordId为[" + recordId + "]绩效权重之和必需等于0.7。");
|
||||||
}
|
}
|
||||||
|
Map<Long, Long> staffRoleMap = recordAuthService.selectRoleIdByStaffRoleInfo(resultRecord.getFlowStaffIdRole());
|
||||||
|
List<RecordAuth> listAuth = recordAuthService.selectAuthInfo(staffRoleMap.get(userId));
|
||||||
|
Auth auth = recordAuthService.getAuth(listAuth);
|
||||||
|
// 如果是评分,查看是不是所有内容都己经评分
|
||||||
|
if(auth.getEditScore() == 1 ){
|
||||||
|
for(ResultDetail resultDetail : resultDetails ){
|
||||||
|
if(resultDetail.getAcquireScore().compareTo(BigDecimal.ZERO) <= 0 ){
|
||||||
|
return R.error("resultDetail[" + resultDetail.getId() + "] 评分必需 > 0 ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R approval(Long resultRecordId, Long userId) {
|
public R approval(Long resultRecordId, Long userId) {
|
||||||
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
ResultRecord resultRecord = resultRecordService.selectResultRecordById(resultRecordId);
|
||||||
R r = resultRecordService.checkApproval(resultRecordId);
|
R r = resultRecordService.checkApproval(resultRecord,userId);
|
||||||
if (!r.isSuccess()) {
|
if (!r.isSuccess()) {
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
StaffEntity mySelf = staffService.selectStaffById(userId);
|
StaffEntity mySelf = staffService.selectStaffById(userId);
|
||||||
TwoTuple<Long, List<FlowDepartment>> flowInfo = getFlowInfo(resultRecord.getStaffId(), resultRecord.getType());
|
TwoTuple<Long, List<FlowDepartment>> flowInfo = getFlowInfo(resultRecord.getStaffId(), resultRecord.getType());
|
||||||
Long flowId = flowInfo.getFirst();
|
Long flowId = flowInfo.getFirst();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user