Commit 462392e6 authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 403d0b5b 05a2dddc
......@@ -224,100 +224,24 @@ export default {
type: [],
resource: "",
},
config: {
data: [
{
name: "部门1",
value: 95,
},
{
name: "部门2",
value: 90,
},
{
name: "部门3",
value: 98,
},
{
name: "部门4",
value: 91,
},
{
name: "部门5",
value: 80,
},
{
name: "部门6",
value: 92,
},
{
name: "部门7",
value: 93,
},
{
name: "部门8",
value: 94,
},
{
name: "部门9",
value: 90,
},
{
name: "部门10",
value: 100,
},
],
},
personConfig: {
data: [
{
name: "个人1",
value: 95,
},
{
name: "个人2",
value: 90,
},
{
name: "个人3",
value: 98,
},
{
name: "个人4",
value: 91,
},
{
name: "个人5",
value: 80,
},
{
name: "个人6",
value: 92,
},
{
name: "个人7",
value: 93,
},
{
name: "个人8",
value: 94,
},
{
name: "个人9",
value: 90,
},
{
name: "个人10",
value: 100,
},
],
},
config: {},//部门绩效总分top10
personConfig: {},//个人绩效总分top10
cricleData: [
{ value: 756, name: "考勤绩效" },
{ value: 690, name: "评价绩效" },
{ value: 559, name: "办件绩效" },
{ value: 1278, name: "效能绩效" },
],
// 个人绩效总分排名
staffQuery:{
page:1,
size:10,
},
// 部门
depQuery:{
page:1,
size:10,
},
};
},
......@@ -326,9 +250,48 @@ export default {
this.drawRulePie();
this.drawCorePie();
this.drawRecordPie();
this.staffStatList()
this.depStatList()
},
methods: {
// 个人绩效总分排名
staffStatList(){
this.$post("/staff/perform/stat/list", this.staffQuery).then((res) => {
const {code,data} = res
if(code == 1){
const row = data.data || []
const depArr = []
row.forEach(element => {
depArr.push({
name:element.staffName,
value:element.totalScore
})
});
this.personConfig = {data:depArr}
console.log(row,"个人")
}
});
},
// 部门绩效总分排名
depStatList(){
this.$post("/dept/perform/stat/list", this.depQuery).then((res) => {
const {code,data} = res
if(code == 1){
const row = data.data || []
const depArr = []
row.forEach(element => {
depArr.push({
name:element.deptName,
value:element.totalScore
})
});
this.config = {data:depArr}
// console.log(row,depArr,"部门")
}
});
},
drawLeiDa() {
// 基于dom,初始化echarts实例
let myChart = this.$echarts.init(document.getElementById("leida"));
......
......@@ -12,7 +12,7 @@
+ {{ type == 1 ? "新增考核部门" : "新增考核个人" }}</el-button
>
</div>
<div class="mid_content">
<div class="mid_content" style="height: auto;">
<div class="goal_box" v-for="(val, i) in dataList" :key="i">
<div class="goal_title">
<img src="../../../../assets/images/u17641.svg" alt="" />
......@@ -321,7 +321,7 @@ export default {
box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.117647058823529);
-moz-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.117647058823529);
-webkit-box-shadow: 0px 0px 5px rgba(0, 0, 0, 0.117647058823529);
margin: 0 20px 20px 0;
margin: 10px 20px 10px 20px;
padding: 20px;
.goal_title {
width: 100%;
......
......@@ -224,7 +224,7 @@ export default {
const x = []
const y = []
row.forEach(element => {
x.push(element.deptName)
x.push(element.staffName)
y.push(element.totalScore)
});
this.depStatObj.totalScore.x = x
......@@ -241,13 +241,30 @@ export default {
const x = []
const y = []
row.forEach(element => {
x.push(element.deptName)
x.push(element.staffName)
y.push(element.attendScoreAdd)
});
this.depStatObj.attendScoreAdd.x = x
this.depStatObj.attendScoreAdd.y = y
}
});
// 减分
const top10Sub = {...this.boardQuery,size:10,orderColList:[{colName:'totalSubScore',sortKind:'desc'}]}
this.$post("/staff/perform/stat/list", top10Sub).then((res) => {
const {code,data,dict} = res
if(code == 1){
const row = data.data || []
// this.statArr = row
const x = []
const y = []
row.forEach(element => {
x.push(element.staffName)
y.push(element.totalSubScore)
});
this.depStatObj.totalSubScore.x = x
this.depStatObj.totalSubScore.y = y
}
});
},
// 部门绩效分数统计
statList(){
......@@ -274,7 +291,7 @@ export default {
});
// 加分top10
const top10 = {...this.boardQuery,size:10,orderColList:[{colName:'totalAddScore',sortKind:'desc'}]}
this.$post("/staff/perform/stat/list", top10).then((res) => {
this.$post("/dept/perform/stat/list", top10).then((res) => {
const {code,data,dict} = res
if(code == 1){
const row = data.data || []
......@@ -292,7 +309,7 @@ export default {
});
// 减分
const top10Sub = {...this.boardQuery,size:10,orderColList:[{colName:'totalSubScore',sortKind:'desc'}]}
this.$post("/staff/perform/stat/list", top10Sub).then((res) => {
this.$post("/dept/perform/stat/list", top10Sub).then((res) => {
const {code,data,dict} = res
if(code == 1){
const row = data.data || []
......@@ -334,7 +351,7 @@ export default {
const x = []
const y = []
row.forEach(element => {
x.push(element.deptName)
x.push(element.staffName)
y.push(element[this.value])
});
this.depStatObj.alignment.x = x
......
......@@ -40,6 +40,9 @@ public abstract class BaseReq implements Serializable {
* 规则编码
*/
private String ruleCode;
private Long ruleId;
private String phone;
......
......@@ -31,7 +31,7 @@ import java.util.Date;
@RestController
@Slf4j
@RequestMapping("/api/v1/web/")
public class ApiWebPerformController extends AbstractBaseController<PerformReq> {
public class ApiWebPerformController extends AbstractBaseController<PerformReq> {
@Autowired
private PerformAttendRecordService attendRecordService;
......@@ -67,7 +67,7 @@ public class ApiWebPerformController extends AbstractBaseControll
if (ObjectUtils.isEmpty(req.getPhone())) throw new AppException("手机号码不能为空!");
if (ObjectUtils.isEmpty(req.getRuleCode())) throw new AppException("绩效规则编码不能为空!");
boolean bool = attend(req);
if (!bool) throw new AppException(busiDesc + "失败!");
if (bool) throw new AppException(busiDesc + "失败!");
} catch (Exception e) {
log.error(busiDesc, e);
return Rest.fail(e.getMessage());
......@@ -88,11 +88,11 @@ public class ApiWebPerformController extends AbstractBaseControll
String busiDesc = "外部评价新增";
Rest rest = Rest.ok(busiDesc + "成功!");
try {
try {
if (ObjectUtils.isEmpty(req.getPhone())) throw new AppException("手机号码不能为空!");
if (ObjectUtils.isEmpty(req.getRuleCode())) throw new AppException("绩效规则编码不能为空!");
boolean bool = review(req);
if (!bool) throw new AppException(busiDesc + "失败!");
if (bool) throw new AppException(busiDesc + "失败!");
} catch (Exception e) {
log.error(busiDesc, e);
return Rest.fail(e.getMessage());
......@@ -117,7 +117,7 @@ public class ApiWebPerformController extends AbstractBaseControll
if (ObjectUtils.isEmpty(req.getPhone())) throw new AppException("手机号码不能为空!");
if (ObjectUtils.isEmpty(req.getRuleCode())) throw new AppException("绩效规则编码不能为空!");
boolean bool = complain(req);
if (!bool) throw new AppException(busiDesc + "失败!");
if (bool) throw new AppException(busiDesc + "失败!");
} catch (Exception e) {
log.error(busiDesc, e);
return Rest.fail(e.getMessage());
......@@ -142,7 +142,7 @@ public class ApiWebPerformController extends AbstractBaseControll
if (ObjectUtils.isEmpty(req.getPhone())) throw new AppException("手机号码不能为空!");
if (ObjectUtils.isEmpty(req.getRuleCode())) throw new AppException("绩效规则编码不能为空!");
boolean bool = gowork(req);
if (!bool) throw new AppException(busiDesc + "失败!");
if (bool) throw new AppException(busiDesc + "失败!");
} catch (Exception e) {
log.error(busiDesc, e);
return Rest.fail(e.getMessage());
......@@ -163,11 +163,11 @@ public class ApiWebPerformController extends AbstractBaseControll
String busiDesc = "外部效能新增";
Rest rest = Rest.ok(busiDesc + "成功!");
try {
try {
if (ObjectUtils.isEmpty(req.getPhone())) throw new AppException("手机号码不能为空!");
if (ObjectUtils.isEmpty(req.getRuleCode())) throw new AppException("绩效规则编码不能为空!");
boolean bool = effect(req);
if (!bool) throw new AppException(busiDesc + "失败!");
if (bool) throw new AppException(busiDesc + "失败!");
} catch (Exception e) {
log.error(busiDesc, e);
return Rest.fail(e.getMessage());
......@@ -188,11 +188,11 @@ public class ApiWebPerformController extends AbstractBaseControll
String busiDesc = "外部其它绩效新增";
Rest rest = Rest.ok(busiDesc + "成功!");
try {
try {
if (ObjectUtils.isEmpty(req.getPhone())) throw new AppException("手机号码不能为空!");
if (ObjectUtils.isEmpty(req.getRuleCode())) throw new AppException("绩效规则编码不能为空!");
boolean bool = other(req);
if (!bool) throw new AppException(busiDesc + "失败!");
if (bool) throw new AppException(busiDesc + "失败!");
} catch (Exception e) {
log.error(busiDesc, e);
return Rest.fail(e.getMessage());
......
......@@ -245,15 +245,14 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
private boolean attend(InspectSaveReq req) throws AppException {
//考勤保存
//通过手机号码查询员工属性
PerformRulesEntity rule = getRule(req.getRuleCode());
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
//StaffEntity staffEntity = getStaff(req.getPhone());
PerformAttendRecordEntity recordEntity = new PerformAttendRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
// recordEntity.setStaffId(staffEntity.getId());
// recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
......@@ -274,15 +273,15 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
private boolean review(InspectSaveReq req) throws AppException {
//评价保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
// StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
PerformReviewRecordEntity recordEntity = new PerformReviewRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
// recordEntity.setStaffId(staffEntity.getId());
// recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
......@@ -299,15 +298,15 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
private boolean complain(InspectSaveReq req) throws AppException {
//投诉保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
// StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
PerformComplainRecordEntity recordEntity = new PerformComplainRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
// recordEntity.setStaffId(staffEntity.getId());
// recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
......@@ -324,15 +323,15 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
private boolean gowork(InspectSaveReq req) throws AppException {
//办件保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
// StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
PerformGoworkRecordEntity recordEntity = new PerformGoworkRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
// recordEntity.setStaffId(staffEntity.getId());
// recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
......@@ -349,15 +348,15 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
private boolean effect(InspectSaveReq req) throws AppException {
//效能保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
//StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
PerformEffectRecordEntity recordEntity = new PerformEffectRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
//recordEntity.setStaffId(staffEntity.getId());
//recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
......@@ -374,15 +373,15 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
private boolean other(InspectSaveReq req) throws AppException {
//其它保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
// StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleId().toString());
PerformOtherRecordEntity recordEntity = new PerformOtherRecordEntity();
recordEntity.initAttrValue();
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
//recordEntity.setStaffId(staffEntity.getId());
// recordEntity.setStaffName(staffEntity.getName());
recordEntity.setSubAddType(rule.getSubAddType());
recordEntity.setScore(rule.getScore());
recordEntity.setRuleId(rule.getId());
......@@ -397,14 +396,16 @@ public class InspectApiController extends AbstractBaseController<PerformReq> {
}
private PerformRulesEntity getRule(String ruleCode) {
PerformRulesEntity rule = rulesService.getCache(ruleCode);
private PerformRulesEntity getRule(String ruleId) {
PerformRulesEntity rule = rulesService.getCache(ruleId);
if (ObjectUtils.isEmpty(rule))
throw new AppException(String.format("当前手机号码未找到匹配的员工!rule:%s", ruleCode));
throw new AppException(String.format("当前手机号码未找到匹配的员工!rule:%s", ruleId));
return rule;
}
private StaffEntity getStaff(String phone) {
StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(phone));
if (ObjectUtils.isEmpty(staffEntity))
......
......@@ -167,9 +167,10 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
performInfo.setPerformType(PerformTypeEnum.考勤绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
if(!ObjectUtils.isEmpty(entity)) {
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
}
return performInfo;
}).collect(Collectors.toList());
......@@ -190,8 +191,11 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
performInfo.setPerformType(PerformTypeEnum.评价差评绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
if (!ObjectUtils.isEmpty(entity)) {
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
}
return performInfo;
}).collect(Collectors.toList());
......@@ -212,8 +216,10 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
if (!ObjectUtils.isEmpty(entity)) {
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
}
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
......@@ -232,8 +238,12 @@ public class PerformApiController extends AbstractBaseController<PerformReq> {
performInfo.setPerformType(PerformTypeEnum.办件绩效.getValue());
//判断是否存在申诉
PerformAttendAppealEntity entity = appealService.selectOne(new PerformAttendAppealQuery().checkRecordId(item.getId()));
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
if (!ObjectUtils.isEmpty(entity)) {
Boolean bool = entity.newEntity();
updateAppealStatus(performInfo, bool, entity.getProcessStatus(), entity.getAppealResult());
}
return performInfo;
}).collect(Collectors.toList());
model.put(KEY_RESULT_DATA, collect);
......
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.common.utils.BeanUtil;
......@@ -18,12 +19,12 @@ import lombok.extern.slf4j.Slf4j;
import java.util.Date;
/**
* PerformAttendRecordService
* 考勤绩效记录信息 service实现
*
* @author zxfei
* @date 2023-07-10
*/
* PerformAttendRecordService
* 考勤绩效记录信息 service实现
*
* @author zxfei
* @date 2023-07-10
*/
@Service("performAttendRecordService")
@Slf4j
public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<PerformAttendRecordDao, PerformAttendRecordEntity, Long> implements PerformAttendRecordService {
......@@ -35,28 +36,29 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
protected void saveAfter(PerformAttendRecordEntity entity, Context context) throws AppException {
CheckAttendRecordEntity checkAttendRecordEntity = new CheckAttendRecordEntity();
checkAttendRecordEntity.initAttrValue();
BeanUtils.copyProperties(entity,checkAttendRecordEntity, BeanUtil.getNullPropertyNames(entity));
BeanUtils.copyProperties(entity, checkAttendRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkAttendRecordEntity.setId(null);
checkAttendRecordEntity.setRecordId(entity.getId());
if(entity.getSubMethod()== SubMethodEnum.系统自动.getValue()){
if (entity.getSubMethod() == SubMethodEnum.系统自动.getValue()) {
checkAttendRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
}else {
} else {
checkAttendRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkAttendRecordService.save(checkAttendRecordEntity,context);
checkAttendRecordEntity.setCheckTime(new Date());
checkAttendRecordService.save(checkAttendRecordEntity, context);
}
@Override
public void updateProcessStatus(Long id, Integer status) throws AppException {
if(id==null){
if (id == null) {
throw new AppException("考勤绩效记录Id不能为空");
}
PerformAttendRecordEntity entity = this.get(id);
if(entity==null){
if (entity == null) {
throw new AppException("无效的考勤绩效记录Id");
}
if(status==null){
status=1; //处理状态(1.未核查,2.已核查)
if (status == null) {
status = 1; //处理状态(1.未核查,2.已核查)
}
PerformAttendRecordEntity update = new PerformAttendRecordEntity();
update.setId(id);
......
......@@ -43,6 +43,7 @@ public class PerformComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Pe
}else {
checkComplainRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkComplainRecordEntity.setCheckTime(new Date());
checkComplainRecordService.save(checkComplainRecordEntity,context);
}
......
......@@ -43,6 +43,7 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
}else {
checkEffectRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkEffectRecordEntity.setCheckTime(new Date());
checkEffectRecordService.save(checkEffectRecordEntity,context);
}
......
......@@ -43,6 +43,7 @@ public class PerformGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
}else {
checkGoworkRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkGoworkRecordEntity.setCheckTime(new Date());
checkGoworkRecordService.save(checkGoworkRecordEntity,context);
}
......
......@@ -43,6 +43,7 @@ public class PerformOtherRecordServiceImpl extends AbstractCRUDServiceImpl<Perfo
}else {
checkOtherRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkOtherRecordEntity.setCheckTime(new Date());
checkOtherRecordService.save(checkOtherRecordEntity,context);
}
......
......@@ -42,6 +42,9 @@ public class PerformReviewRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
}else {
checkReviewRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
//checkReviewRecordEntity.s
checkReviewRecordService.save(checkReviewRecordEntity,context);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment