Merge branch 'version_1.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_1.0
This commit is contained in:
commit
5ced3a2b9f
@ -80,6 +80,15 @@ public class BigDecimalUtil {
|
|||||||
return bigDecimal;
|
return bigDecimal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static BigDecimal setScale(BigDecimal bigDecimal,int num){
|
||||||
|
if(bigDecimal == null){
|
||||||
|
bigDecimal = BigDecimal.ZERO;
|
||||||
|
}
|
||||||
|
bigDecimal = bigDecimal.setScale(num,BigDecimal.ROUND_HALF_UP);
|
||||||
|
return bigDecimal;
|
||||||
|
}
|
||||||
|
|
||||||
public static double sub(double v1, double v2) {
|
public static double sub(double v1, double v2) {
|
||||||
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
BigDecimal b1 = new BigDecimal(Double.toString(v1));
|
||||||
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
BigDecimal b2 = new BigDecimal(Double.toString(v2));
|
||||||
|
|||||||
@ -89,16 +89,52 @@ public class ResultRecordController extends AbstractController {
|
|||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
@RequiresPermissions("user:lzresultrecord:list")
|
@RequiresPermissions("user:lzresultrecord:list")
|
||||||
public R list(ResultRecordReq req) {
|
public R list(ResultRecordReq req) {
|
||||||
|
List<DepartmentsDto> departmentList2 = new ArrayList<>();
|
||||||
|
List<DepartmentsDto> departmentList3 = new ArrayList<>();
|
||||||
|
List<DepartmentsDto> departmentList1 = departmentsService.selectByParentDepartmentId("1");
|
||||||
|
String department1 = "";
|
||||||
|
String department2 = "";
|
||||||
|
String department3 = "";
|
||||||
SysUserEntity user = getUser();
|
SysUserEntity user = getUser();
|
||||||
if(req.getIsSelf() == 1){
|
if (req.getIsSelf() == 1) {
|
||||||
req.setStaffId(user.getUserId());
|
req.setStaffId(user.getUserId());
|
||||||
|
}else{
|
||||||
|
DepartmentsStaffRelateEntity relateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(getUserId());
|
||||||
|
Map<String, String> map = departmentsService.selectUserAllDepartmentInFo(relateEntity.getDepartmentId());
|
||||||
|
int i = 0;
|
||||||
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i = i / 2;
|
||||||
|
if (i == 3) { // 表示有三级部门
|
||||||
|
departmentList2 = departmentsService.selectByParentDepartmentId(map.get("dd3"));
|
||||||
|
departmentList3 = departmentsService.selectByParentDepartmentId(map.get("dd2"));
|
||||||
|
department1 = map.get("dd3");
|
||||||
|
department2 = map.get("dd2");
|
||||||
|
department3 = map.get("dd1");
|
||||||
|
req.setDepartment3(map.get("dd1"));
|
||||||
|
} else if (i == 2) {
|
||||||
|
departmentList2 = departmentsService.selectByParentDepartmentId(map.get("dd2"));
|
||||||
|
department2 = map.get("dd1");
|
||||||
|
department1 = map.get("dd2");
|
||||||
|
req.setDepartment2(map.get("dd1"));
|
||||||
|
} else if (i == 1) {
|
||||||
|
department1 = map.get("dd1");
|
||||||
|
req.setDepartment1(map.get("dd1"));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
PageUtils page = lzResultRecordService.queryPage(req, user);
|
PageUtils page = lzResultRecordService.queryPage(req, user);
|
||||||
List<DepartmentsDto> departmentList1 = departmentsService.selectByParentDepartmentId("0");
|
|
||||||
return R.ok().put("page", page)
|
return R.ok().put("page", page)
|
||||||
.put("departmentList1", departmentList1);
|
.put("departmentList1", departmentList1)
|
||||||
|
.put("departmentList2", departmentList2)
|
||||||
|
.put("departmentList3", departmentList3)
|
||||||
|
.put("department1",department1)
|
||||||
|
.put("department2",department2)
|
||||||
|
.put("department3",department3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/departmentQuery")
|
@RequestMapping("/departmentQuery")
|
||||||
public R departmentQuery(ResultRecordReq req) {
|
public R departmentQuery(ResultRecordReq req) {
|
||||||
List<DepartmentsDto> departmentList1 = departmentsService.selectByParentDepartmentId(req.getDepartmentId());
|
List<DepartmentsDto> departmentList1 = departmentsService.selectByParentDepartmentId(req.getDepartmentId());
|
||||||
@ -146,6 +182,8 @@ public class ResultRecordController extends AbstractController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(resultRecord.getId());
|
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(resultRecord.getId());
|
||||||
|
BigDecimal sumWenHuaJiaZhiGuan = BigDecimal.ZERO;
|
||||||
|
BigDecimal sumYeJi = BigDecimal.ZERO;
|
||||||
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||||
Map<Integer, Long> details = resultDetails.stream().collect(Collectors.groupingBy(ResultDetail::getType, Collectors.counting()));
|
Map<Integer, Long> details = resultDetails.stream().collect(Collectors.groupingBy(ResultDetail::getType, Collectors.counting()));
|
||||||
int tempType1 = NumberUtil.objToIntDefault(details.get(new Integer(1)), 0);
|
int tempType1 = NumberUtil.objToIntDefault(details.get(new Integer(1)), 0);
|
||||||
@ -155,7 +193,7 @@ public class ResultRecordController extends AbstractController {
|
|||||||
if (tempType1 == 0) {
|
if (tempType1 == 0) {
|
||||||
yeJiCheckNum = 1;
|
yeJiCheckNum = 1;
|
||||||
list.add(resultDetailService.getYeJi());
|
list.add(resultDetailService.getYeJi());
|
||||||
list.add(resultDetailService.getYeJiKaoHe());
|
list.add(resultDetailService.getYeJiKaoHe(BigDecimal.ZERO));
|
||||||
}
|
}
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (ResultDetail resultDetail : resultDetails) {
|
for (ResultDetail resultDetail : resultDetails) {
|
||||||
@ -171,14 +209,22 @@ public class ResultRecordController extends AbstractController {
|
|||||||
resp.setIsAdd(1);
|
resp.setIsAdd(1);
|
||||||
}
|
}
|
||||||
resp.setIsEdit(1);
|
resp.setIsEdit(1);
|
||||||
|
BigDecimal checkWeight = NumberUtil.objToBigDecimalDefault(resultDetail.getCheckWeight(), BigDecimal.ZERO);
|
||||||
|
BigDecimal acquireScore = NumberUtil.objToBigDecimalDefault(resultDetail.getAcquireScore(), BigDecimal.ZERO);
|
||||||
|
BigDecimal tempSum = checkWeight.multiply(acquireScore);
|
||||||
|
if (resultDetail.getType().equals(1)) {
|
||||||
|
sumYeJi = sumYeJi.add(tempSum);
|
||||||
|
} else {
|
||||||
|
sumWenHuaJiaZhiGuan = sumWenHuaJiaZhiGuan.add(tempSum);
|
||||||
|
}
|
||||||
if (count == yeJiCheckNum + 1 && tempType1 != 0) {
|
if (count == yeJiCheckNum + 1 && tempType1 != 0) {
|
||||||
list.add(resultDetailService.getYeJiKaoHe());
|
list.add(resultDetailService.getYeJiKaoHe(BigDecimalUtil.setScale(sumYeJi, 3)));
|
||||||
}
|
}
|
||||||
list.add(resp);
|
list.add(resp);
|
||||||
}
|
}
|
||||||
if (tempType2 == 0) {
|
if (tempType2 == 0) {
|
||||||
wenHuaJiaZhiGuanNum = 2;
|
wenHuaJiaZhiGuanNum = 2;
|
||||||
list.add(resultDetailService.getYeJiKaoHe());
|
list.add(resultDetailService.getYeJiKaoHe(BigDecimal.ZERO));
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
|
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGua2(auth));
|
list.add(resultDetailService.getWenHuaJiaZhiGua2(auth));
|
||||||
}
|
}
|
||||||
@ -186,13 +232,13 @@ public class ResultRecordController extends AbstractController {
|
|||||||
yeJiCheckNum = 1;
|
yeJiCheckNum = 1;
|
||||||
wenHuaJiaZhiGuanNum = 2;
|
wenHuaJiaZhiGuanNum = 2;
|
||||||
list.add(resultDetailService.getYeJi());
|
list.add(resultDetailService.getYeJi());
|
||||||
list.add(resultDetailService.getYeJiKaoHe());
|
list.add(resultDetailService.getYeJiKaoHe(BigDecimal.ZERO));
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
|
list.add(resultDetailService.getWenHuaJiaZhiGua1(auth));
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGua2(auth));
|
list.add(resultDetailService.getWenHuaJiaZhiGua2(auth));
|
||||||
}
|
}
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGuaResult1());
|
list.add(resultDetailService.getWenHuaJiaZhiGuaResult1(sumWenHuaJiaZhiGuan));
|
||||||
list.add(resultDetailService.getWenHuaJiaZhiGuaResult2());
|
list.add(resultDetailService.getWenHuaJiaZhiGuaResult2());
|
||||||
list.add(resultDetailService.getLastResult());
|
list.add(resultDetailService.getLastResult(resultRecord.getLastScore()));
|
||||||
|
|
||||||
List<ResultComment> comments = resultCommentService.selectByRecordId(resultRecord.getId());
|
List<ResultComment> comments = resultCommentService.selectByRecordId(resultRecord.getId());
|
||||||
if (CollectionUtils.isNotEmpty(comments)) {
|
if (CollectionUtils.isNotEmpty(comments)) {
|
||||||
@ -427,6 +473,19 @@ public class ResultRecordController extends AbstractController {
|
|||||||
resultDetail.setStaffId(resultRecord.getStaffId());
|
resultDetail.setStaffId(resultRecord.getStaffId());
|
||||||
resultDetailService.insertResultDetail(resultDetail);
|
resultDetailService.insertResultDetail(resultDetail);
|
||||||
}
|
}
|
||||||
|
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(resultRecord.getId());
|
||||||
|
if (CollectionUtils.isNotEmpty(resultDetails)) {
|
||||||
|
BigDecimal sum = BigDecimal.ZERO;
|
||||||
|
for (ResultDetail resultDetail : resultDetails) {
|
||||||
|
BigDecimal checkWeight = NumberUtil.objToBigDecimalDefault(resultDetail.getCheckWeight(), BigDecimal.ZERO);
|
||||||
|
BigDecimal acquireScore = NumberUtil.objToBigDecimalDefault(resultDetail.getAcquireScore(), BigDecimal.ZERO);
|
||||||
|
sum = sum.add(checkWeight.multiply(acquireScore));
|
||||||
|
}
|
||||||
|
sum = BigDecimalUtil.setScale(sum, 3);
|
||||||
|
resultRecord.setLastScore(sum);
|
||||||
|
resultRecord.setAllScore(sum);
|
||||||
|
resultRecordService.updateResultRecordById(resultRecord);
|
||||||
|
}
|
||||||
return R.ok("保存成功").put("recordId", resultRecord.getId());
|
return R.ok("保存成功").put("recordId", resultRecord.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,4 +520,26 @@ public class ResultRecordController extends AbstractController {
|
|||||||
return R.ok();
|
return R.ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
List<DepartmentsDto> departmentList1 = new ArrayList<>();
|
||||||
|
DepartmentsDto departmentsDto1 = new DepartmentsDto();
|
||||||
|
departmentsDto1.setDepartmentId("1");
|
||||||
|
|
||||||
|
DepartmentsDto departmentsDto2 = new DepartmentsDto();
|
||||||
|
departmentsDto2.setDepartmentId("2");
|
||||||
|
|
||||||
|
|
||||||
|
DepartmentsDto departmentsDto3 = new DepartmentsDto();
|
||||||
|
departmentsDto3.setDepartmentId("3");
|
||||||
|
departmentList1.add(departmentsDto1);
|
||||||
|
departmentList1.add(departmentsDto2);
|
||||||
|
departmentList1.add(departmentsDto3);
|
||||||
|
String compare = "3";
|
||||||
|
departmentList1 = departmentList1.stream().sorted((p1, p2) -> p1.getDepartmentId().equals(compare) ? 1 : p2.getDepartmentId().equals(compare) ? 1 : 0).collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (DepartmentsDto departmentsDto : departmentList1) {
|
||||||
|
System.out.println(departmentsDto.getDepartmentId());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -14,7 +15,7 @@ import java.util.List;
|
|||||||
* @date 2020-04-30 16:59:50
|
* @date 2020-04-30 16:59:50
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
public class DepartmentsDto implements Serializable {
|
public class DepartmentsDto implements Serializable{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -40,5 +40,9 @@ public interface DepartmentsService extends IService<DepartmentsEntity> {
|
|||||||
void updateDepartmentInfo(DepartmentInfosBo departmentInfosBo);
|
void updateDepartmentInfo(DepartmentInfosBo departmentInfosBo);
|
||||||
|
|
||||||
Map<String,String> selectUserAllDepartmentIds(String departmentId);
|
Map<String,String> selectUserAllDepartmentIds(String departmentId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Map<String,String> selectUserAllDepartmentInFo(String departmentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -167,4 +167,34 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> selectUserAllDepartmentInFo(String departmentId) {
|
||||||
|
DepartmentInfos departmentInfos = departmentsDao.selectUserAllDepartmentIds(departmentId);
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
if (StringUtil.isNotBlank(departmentInfos.getDd1())) {
|
||||||
|
map.put("dd1", departmentInfos.getDd1());
|
||||||
|
map.put("dn1", departmentInfos.getDn1());
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotBlank(departmentInfos.getDd2())) {
|
||||||
|
map.put("dd2", departmentInfos.getDd2());
|
||||||
|
map.put("dn2", departmentInfos.getDn2());
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotBlank(departmentInfos.getDd3())) {
|
||||||
|
map.put("dd3", departmentInfos.getDd3());
|
||||||
|
map.put("dn3", departmentInfos.getDn3());
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotBlank(departmentInfos.getDd4())) {
|
||||||
|
map.put("dd4", departmentInfos.getDd4());
|
||||||
|
map.put("dn4", departmentInfos.getDn4());
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotBlank(departmentInfos.getDd5())) {
|
||||||
|
map.put("dd5", departmentInfos.getDd5());
|
||||||
|
map.put("dn5", departmentInfos.getDn5());
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -132,10 +132,12 @@ public class RecordAuthServiceImpl extends ServiceImpl<RecordAuthMapper, RecordA
|
|||||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
|
||||||
if (departmentsStaffRelateEntity.getIsLeader().equals(1)) {//如果是部门领导
|
if (departmentsStaffRelateEntity.getIsLeader().equals(1)) {//如果是部门领导
|
||||||
DepartmentsEntity department = departmentsService.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
DepartmentsEntity department = departmentsService.selectByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||||
DepartmentsStaffRelateEntity parentRelation = departmentsStaffRelateService.selectDepartmentByDepartmentId(department.getDepartmentId());
|
if (department != null) {
|
||||||
if(parentRelation !=null){
|
DepartmentsStaffRelateEntity parentRelation = departmentsStaffRelateService.selectDepartmentByDepartmentId(department.getDepartmentParentId());
|
||||||
StaffEntity staffEntity = staffService.selectStaffById(parentRelation.getStaffId());
|
if (parentRelation != null) {
|
||||||
return staffEntity.getName();
|
StaffEntity staffEntity = staffService.selectStaffById(parentRelation.getStaffId());
|
||||||
|
return staffEntity.getName();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public class ResultRecord implements java.io.Serializable {
|
|||||||
private Date gmtModified;
|
private Date gmtModified;
|
||||||
//月份
|
//月份
|
||||||
private Date monthTime;
|
private Date monthTime;
|
||||||
//0.新建,1 提交审批中,2 拒绝 , 3侍提交
|
//0.新建,1 审批中,2 己审批 , 3 侍提交 ,4 审批通过,5 驳回
|
||||||
private Integer status;
|
private Integer status;
|
||||||
//最后得分
|
//最后得分
|
||||||
private BigDecimal lastScore;
|
private BigDecimal lastScore;
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
package com.lz.modules.sys.service.app;
|
package com.lz.modules.sys.service.app;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.lz.common.utils.BigDecimalUtil;
|
||||||
import com.lz.modules.app.resp.ResultDetailResp;
|
import com.lz.modules.app.resp.ResultDetailResp;
|
||||||
import com.lz.modules.flow.model.Auth;
|
import com.lz.modules.flow.model.Auth;
|
||||||
import com.lz.modules.sys.entity.app.ResultDetail;
|
import com.lz.modules.sys.entity.app.ResultDetail;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,17 +42,17 @@ public interface ResultDetailService extends IService<ResultDetail> {
|
|||||||
|
|
||||||
ResultDetailResp getYeJi();
|
ResultDetailResp getYeJi();
|
||||||
|
|
||||||
ResultDetailResp getYeJiKaoHe();
|
ResultDetailResp getYeJiKaoHe(BigDecimal acquireScore);
|
||||||
|
|
||||||
ResultDetailResp getWenHuaJiaZhiGua2(Auth auth);
|
ResultDetailResp getWenHuaJiaZhiGua2(Auth auth);
|
||||||
|
|
||||||
ResultDetailResp getWenHuaJiaZhiGua1(Auth auth);
|
ResultDetailResp getWenHuaJiaZhiGua1(Auth auth);
|
||||||
|
|
||||||
ResultDetailResp getWenHuaJiaZhiGuaResult1();
|
ResultDetailResp getWenHuaJiaZhiGuaResult1(BigDecimal bigDecimal);
|
||||||
|
|
||||||
ResultDetailResp getWenHuaJiaZhiGuaResult2();
|
ResultDetailResp getWenHuaJiaZhiGuaResult2();
|
||||||
|
|
||||||
ResultDetailResp getLastResult();
|
ResultDetailResp getLastResult(BigDecimal bigDecimal);
|
||||||
|
|
||||||
void insertWenHuaJiaZhiGua(String s, Long id, Long userId);
|
void insertWenHuaJiaZhiGua(String s, Long id, Long userId);
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.lz.modules.sys.service.app.impl;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.lz.common.utils.BigDecimalUtil;
|
||||||
import com.lz.modules.app.resp.ResultDetailResp;
|
import com.lz.modules.app.resp.ResultDetailResp;
|
||||||
import com.lz.modules.flow.model.Auth;
|
import com.lz.modules.flow.model.Auth;
|
||||||
import com.lz.modules.flow.model.StaffRoleDto;
|
import com.lz.modules.flow.model.StaffRoleDto;
|
||||||
@ -87,12 +88,12 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultDetailResp getYeJiKaoHe() {
|
public ResultDetailResp getYeJiKaoHe(BigDecimal acquireScore) {
|
||||||
ResultDetailResp respHeader = new ResultDetailResp();
|
ResultDetailResp respHeader = new ResultDetailResp();
|
||||||
respHeader.setKeyResult("业务考核结果");
|
respHeader.setKeyResult("业务考核结果");
|
||||||
respHeader.setCheckWeight(new BigDecimal(0.7));
|
respHeader.setCheckWeight(new BigDecimal(0.7));
|
||||||
respHeader.setSuperScore("/");
|
respHeader.setSuperScore("/");
|
||||||
respHeader.setAcquireScore(new BigDecimal(0));
|
respHeader.setAcquireScore(acquireScore);
|
||||||
respHeader.setScoreComment("/");
|
respHeader.setScoreComment("/");
|
||||||
respHeader.setIsAdd(-1);
|
respHeader.setIsAdd(-1);
|
||||||
return respHeader;
|
return respHeader;
|
||||||
@ -118,31 +119,33 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
|
|||||||
return wenhua2;
|
return wenhua2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultDetailResp getWenHuaJiaZhiGuaResult1() {
|
public ResultDetailResp getWenHuaJiaZhiGuaResult1(BigDecimal sum) {
|
||||||
ResultDetailResp tail1 = new ResultDetailResp();
|
ResultDetailResp tail1 = new ResultDetailResp();
|
||||||
tail1.setKeyResult("文化价值观考核结果");
|
tail1.setKeyResult("文化价值观考核结果");
|
||||||
tail1.setCheckWeight(new BigDecimal(0.3));
|
tail1.setCheckWeight(new BigDecimal(0.3));
|
||||||
tail1.setSuperScore("/");
|
tail1.setSuperScore("/");
|
||||||
tail1.setAcquireScore(new BigDecimal(0));
|
tail1.setAcquireScore(BigDecimalUtil.setScale(sum, 3));
|
||||||
tail1.setScoreComment("/");
|
tail1.setScoreComment("/");
|
||||||
tail1.setIsAdd(-1);
|
tail1.setIsAdd(-1);
|
||||||
return tail1;
|
return tail1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public ResultDetailResp getWenHuaJiaZhiGuaResult2() {
|
public ResultDetailResp getWenHuaJiaZhiGuaResult2() {
|
||||||
ResultDetailResp tail2 = new ResultDetailResp();
|
ResultDetailResp tail2 = new ResultDetailResp();
|
||||||
tail2.setCheckRange("文化价值观考核结果");
|
tail2.setCheckRange("文化价值观考核结果");
|
||||||
tail2.setAcquireScore(new BigDecimal(0));
|
tail2.setAcquireScore(BigDecimal.ZERO);
|
||||||
tail2.setScoreComment("/");
|
tail2.setScoreComment("/");
|
||||||
tail2.setIsAdd(-1);
|
tail2.setIsAdd(-1);
|
||||||
return tail2;
|
return tail2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ResultDetailResp getLastResult() {
|
public ResultDetailResp getLastResult(BigDecimal value) {
|
||||||
ResultDetailResp tail3 = new ResultDetailResp();
|
ResultDetailResp tail3 = new ResultDetailResp();
|
||||||
tail3.setCheckRange("最终绩效考核结果等级");
|
tail3.setCheckRange("最终绩效考核结果等级");
|
||||||
tail3.setAcquireScore(new BigDecimal(3.25));
|
tail3.setAcquireScore(BigDecimalUtil.setScale(value, 3));
|
||||||
tail3.setScoreComment("/");
|
tail3.setScoreComment("/");
|
||||||
tail3.setIsAdd(-1);
|
tail3.setIsAdd(-1);
|
||||||
return tail3;
|
return tail3;
|
||||||
|
|||||||
@ -74,6 +74,10 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
@Autowired
|
@Autowired
|
||||||
private DepartmentsService departmentsService;
|
private DepartmentsService departmentsService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RecordAuthService recordAuthService;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -157,13 +161,15 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
params.setDepartmentIds(departmentIds);
|
params.setDepartmentIds(departmentIds);
|
||||||
|
|
||||||
String departmentLevel = Constant.ME;
|
String departmentLevel = Constant.ME;
|
||||||
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(user.getUserId());
|
if (params.getIsSelf() != 1) { // 表示点击我们审批
|
||||||
if (flowDepartment != null) {
|
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(user.getUserId());
|
||||||
departmentLevel = flowDepartment.getDepartmentLevel();
|
if (flowDepartment != null) {
|
||||||
} else {
|
departmentLevel = flowDepartment.getDepartmentLevel();
|
||||||
StaffRole staffRole = staffRoleService.selectByStaffId(user.getUserId());
|
} else {
|
||||||
if (staffRole != null) {
|
StaffRole staffRole = staffRoleService.selectByStaffId(user.getUserId());
|
||||||
departmentLevel = staffRole.getDepartmentLevel();
|
if (staffRole != null) {
|
||||||
|
departmentLevel = staffRole.getDepartmentLevel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
params.setDepartmentLevel(departmentLevel);
|
params.setDepartmentLevel(departmentLevel);
|
||||||
@ -172,11 +178,16 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
);
|
);
|
||||||
|
|
||||||
List<ResultRecord> resultRecords = pageUtils.getList();
|
List<ResultRecord> resultRecords = pageUtils.getList();
|
||||||
if(CollectionUtils.isNotEmpty(resultRecords)){
|
|
||||||
|
if (CollectionUtils.isNotEmpty(resultRecords)) {
|
||||||
List<ResultRecordResp> list = new ArrayList<>();
|
List<ResultRecordResp> list = new ArrayList<>();
|
||||||
for (ResultRecord resultRecord : resultRecords) {
|
for (ResultRecord resultRecord : resultRecords) {
|
||||||
ResultRecordResp resp = new ResultRecordResp();
|
ResultRecordResp resp = new ResultRecordResp();
|
||||||
BeanUtils.copyProperties(resultRecord, resp);
|
BeanUtils.copyProperties(resultRecord, resp);
|
||||||
|
Map<Long, Long> staffRoleMap = recordAuthService.selectRoleIdByStaffRoleInfo(resultRecord.getFlowStaffIdRole());
|
||||||
|
if (resp.getStatus().equals(1) && staffRoleMap.get(user.getUserId()) == null) {
|
||||||
|
resp.setStatus(2); // 如果不是自己审批,说明自己己经审批完成
|
||||||
|
}
|
||||||
list.add(resp);
|
list.add(resp);
|
||||||
}
|
}
|
||||||
pageUtils.setList(list);
|
pageUtils.setList(list);
|
||||||
@ -228,15 +239,15 @@ public class ResultRecordServiceImpl extends ServiceImpl<ResultRecordMapper, Res
|
|||||||
@Override
|
@Override
|
||||||
public TwoTuple getFlowInfo(Long staffId, Integer type) {
|
public TwoTuple getFlowInfo(Long staffId, Integer type) {
|
||||||
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(staffId);
|
FlowDepartment flowDepartment = flowDepartmentService.selectByStaffId(staffId);
|
||||||
|
List<FlowDepartment> list = new ArrayList<>();
|
||||||
Long flowId = flowDepartment != null ? TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.SELF, type) : 0l; // 表示是部门主管自己
|
Long flowId = flowDepartment != null ? TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.SELF, type) : 0l; // 表示是部门主管自己
|
||||||
if (flowDepartment == null) {
|
if (flowDepartment == null) {
|
||||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
|
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateService.selectLastDepartmentByStaffId(staffId);
|
||||||
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
DepartmentsStaffRelateEntity leader = departmentsStaffRelateService.selectLeaderByDepartmentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||||
flowDepartment = flowDepartmentService.selectByStaffId(leader.getStaffId());
|
flowDepartment = flowDepartmentService.selectByStaffId(leader.getStaffId());
|
||||||
flowId = TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.CHILD, type);//表示是部门下的普通员工
|
flowId = TypeFlowDto.getFlowId(flowDepartment.getFlowIds(), Constant.CHILD, type);//表示是部门下的普通员工
|
||||||
|
list.add(flowDepartment);
|
||||||
}
|
}
|
||||||
List<FlowDepartment> list = new ArrayList<>();
|
|
||||||
list.add(flowDepartment);
|
|
||||||
for (int i = 0; i < 10; i++) {
|
for (int i = 0; i < 10; i++) {
|
||||||
if (flowDepartment.getParentId() != null && flowDepartment.getParentId() > 0) {
|
if (flowDepartment.getParentId() != null && flowDepartment.getParentId() > 0) {
|
||||||
flowDepartment = flowDepartmentService.selectFlowDepartmentById(flowDepartment.getParentId());
|
flowDepartment = flowDepartmentService.selectFlowDepartmentById(flowDepartment.getParentId());
|
||||||
|
|||||||
@ -123,6 +123,7 @@
|
|||||||
<select id="selectByRecordId" resultType="com.lz.modules.sys.entity.app.ResultDetail">
|
<select id="selectByRecordId" resultType="com.lz.modules.sys.entity.app.ResultDetail">
|
||||||
select * from lz_result_detail where record_id=#{recordResultId} and is_delete = 0 order by type asc ,priority desc
|
select * from lz_result_detail where record_id=#{recordResultId} and is_delete = 0 order by type asc ,priority desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByRecordIdType" resultType="com.lz.modules.sys.entity.app.ResultDetail">
|
<select id="selectByRecordIdType" resultType="com.lz.modules.sys.entity.app.ResultDetail">
|
||||||
select * from lz_result_detail where record_id=#{recordResultId} and type = #{type} and is_delete = 0 order by type asc ,priority desc
|
select * from lz_result_detail where record_id=#{recordResultId} and type = #{type} and is_delete = 0 order by type asc ,priority desc
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@ -178,7 +178,7 @@
|
|||||||
AND DATE_FORMAT(rd.month_time, '%Y-%m-%d %H:%i:%S') <![CDATA[ >= ]]> DATE_FORMAT(#{req.monthBeginDate}, '%Y-%m-%d %H:%i:%S')
|
AND DATE_FORMAT(rd.month_time, '%Y-%m-%d %H:%i:%S') <![CDATA[ >= ]]> DATE_FORMAT(#{req.monthBeginDate}, '%Y-%m-%d %H:%i:%S')
|
||||||
</if>
|
</if>
|
||||||
<if test="req.monthEndDate != null and req.monthEndDate != '' ">
|
<if test="req.monthEndDate != null and req.monthEndDate != '' ">
|
||||||
AND DATE_FORMAT(rd.month_time, '%Y-%m-%d %H:%i:%S') <![CDATA[ >= ]]> DATE_FORMAT(#{req.monthEndDate}, '%Y-%m-%d %H:%i:%S')
|
AND DATE_FORMAT(rd.month_time, '%Y-%m-%d %H:%i:%S') <![CDATA[ <= ]]> DATE_FORMAT(#{req.monthEndDate}, '%Y-%m-%d %H:%i:%S')
|
||||||
</if>
|
</if>
|
||||||
<if test="req.status != null">
|
<if test="req.status != null">
|
||||||
and rd.status = #{req.status}
|
and rd.status = #{req.status}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user