Commit ac9dfb4e authored by 姬鋆屾's avatar 姬鋆屾
parents baca5a58 f25ab9c8
......@@ -514,6 +514,9 @@ export default {
width: 120,
prop: "subColumns",
formatter: (row) => {
let widthsize = this.columnSet.reduce((pre, cur) => {
return pre + Number(cur.width);
}, 50);
......
......@@ -32,4 +32,9 @@ public class EffectSaveReq extends BaseReq {
* 窗口编号
*/
private String windowNum;
/**
* 抓拍图片
*/
private String snapPath;
}
......@@ -6,6 +6,7 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.xhx.busiz.h5.req.*;
import com.mortals.xhx.common.code.SubMethodEnum;
import com.mortals.xhx.module.perform.model.*;
import com.mortals.xhx.module.perform.service.*;
import com.mortals.xhx.module.staff.model.StaffEntity;
......@@ -207,6 +208,7 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
PerformAttendRecordEntity recordEntity = new PerformAttendRecordEntity();
recordEntity.initAttrValue();
recordEntity.setSubMethod(SubMethodEnum.系统自动.getValue());
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
......@@ -243,6 +245,7 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
PerformReviewRecordEntity recordEntity = new PerformReviewRecordEntity();
recordEntity.initAttrValue();
recordEntity.setSubMethod(SubMethodEnum.系统自动.getValue());
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
......@@ -271,10 +274,9 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
//投诉保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformComplainRecordEntity recordEntity = new PerformComplainRecordEntity();
recordEntity.initAttrValue();
recordEntity.setSubMethod(SubMethodEnum.系统自动.getValue());
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
......@@ -303,10 +305,9 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
//办件保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformGoworkRecordEntity recordEntity = new PerformGoworkRecordEntity();
recordEntity.initAttrValue();
recordEntity.setSubMethod(SubMethodEnum.系统自动.getValue());
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
......@@ -338,8 +339,8 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformEffectRecordEntity recordEntity = new PerformEffectRecordEntity();
recordEntity.initAttrValue();
recordEntity.setSubMethod(SubMethodEnum.系统自动.getValue());
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
......@@ -367,13 +368,11 @@ public class ApiWebPerformController extends AbstractBaseController<PerformReq>
private boolean other(OtherSaveReq req) throws AppException {
//其它保存
StaffEntity staffEntity = getStaff(req.getPhone());
PerformRulesEntity rule = getRule(req.getRuleCode());
PerformOtherRecordEntity recordEntity = new PerformOtherRecordEntity();
recordEntity.initAttrValue();
recordEntity.setSubMethod(SubMethodEnum.系统自动.getValue());
BeanUtils.copyProperties(req, recordEntity);
recordEntity.setStaffId(staffEntity.getId());
recordEntity.setStaffName(staffEntity.getName());
......
......@@ -170,7 +170,7 @@ public class PerformAttendRecordEntity extends PerformAttendRecordVo {
this.errorResult = "";
this.subMethod = 1;
this.subMethod = 2;
this.deductPerson = "";
......
......@@ -181,7 +181,7 @@ public class PerformComplainRecordEntity extends PerformComplainRecordVo {
this.ruleName = "";
this.subMethod = 1;
this.subMethod = 2;
this.deductPerson = "";
......
......@@ -168,7 +168,7 @@ public class PerformEffectRecordEntity extends PerformEffectRecordVo {
this.ruleName = "";
this.subMethod = 1;
this.subMethod = 2;
this.deductPerson = "";
......
......@@ -165,7 +165,7 @@ public class PerformGoworkRecordEntity extends PerformGoworkRecordVo {
this.ruleName = "";
this.subMethod = 1;
this.subMethod = 2;
this.deductPerson = "";
......
......@@ -154,7 +154,7 @@ public class PerformOtherRecordEntity extends PerformOtherRecordVo {
this.ruleDesc = "";
this.subMethod = 1;
this.subMethod = 2;
this.deductPerson = "";
......
......@@ -161,7 +161,7 @@ public class PerformReviewRecordEntity extends PerformReviewRecordVo {
this.ruleName = "";
this.subMethod = 1;
this.subMethod = 2;
this.deductPerson = "";
......
package com.mortals.xhx.module.perform.service.impl;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.SubMethodEnum;
import cn.hutool.core.date.DateUtil;
import com.mortals.xhx.common.code.*;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.attendance.model.*;
import com.mortals.xhx.module.attendance.service.AttendanceClassDetailService;
import com.mortals.xhx.module.attendance.service.AttendanceClassService;
import com.mortals.xhx.module.attendance.service.AttendanceGroupFixedworkService;
import com.mortals.xhx.module.attendance.service.AttendanceGroupService;
import com.mortals.xhx.module.check.model.CheckAttendRecordEntity;
import com.mortals.xhx.module.check.service.CheckAttendRecordService;
import com.mortals.xhx.module.dept.model.DeptEntity;
......@@ -23,7 +28,9 @@ import com.mortals.xhx.module.perform.service.PerformAttendRecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* PerformAttendRecordService
......@@ -40,6 +47,15 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
private CheckAttendRecordService checkAttendRecordService;
@Autowired
private DeptService deptService;
@Autowired
private AttendanceGroupService attendanceGroupService;
@Autowired
private AttendanceGroupFixedworkService fixedworkService;
@Autowired
private AttendanceClassService classService;
@Autowired
private AttendanceClassDetailService classDetailService;
@Autowired
private PerformRulesService rulesService;
@Autowired
......@@ -66,6 +82,85 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
entity.setStaffName(staffCache == null ? "" : staffCache.getName());
entity.setDeptName(staffCache == null ? "" : staffCache.getDeptName());
}
entity.setErrorResult(entity.getRuleName());
if (!ObjectUtils.isEmpty(entity.getAttendanceGroupId())) {
AttendanceGroupEntity attendanceGroupEntity = attendanceGroupService.get(entity.getAttendanceGroupId());
entity.setAttendanceGroupName(attendanceGroupEntity == null ? "" : attendanceGroupEntity.getGroupName());
//判断上下班时间
if (TypeEnum.固定班制.getValue() == attendanceGroupEntity.getType()) {
AttendanceGroupFixedworkEntity fixedworkEntity = fixedworkService.selectOne(new AttendanceGroupFixedworkQuery().groupId(attendanceGroupEntity.getId()));
if (!ObjectUtils.isEmpty(fixedworkEntity)) {
//查看当前时间是星期几
int dayOfWeek = DateUtil.dayOfWeek(entity.getAttendanceDate());
switch (dayOfWeek) {
case 1:
String goOffWorkStr = getGoOffWorkStr(fixedworkEntity.getSundayClassId());
entity.setGoOffTimeStr(goOffWorkStr);
break;
case 2:
goOffWorkStr = getGoOffWorkStr(fixedworkEntity.getMondayClassId());
entity.setGoOffTimeStr(goOffWorkStr);
break;
case 3:
goOffWorkStr = getGoOffWorkStr(fixedworkEntity.getTuesdayClassId());
entity.setGoOffTimeStr(goOffWorkStr);
break;
case 4:
goOffWorkStr = getGoOffWorkStr(fixedworkEntity.getWednesdayClassId());
entity.setGoOffTimeStr(goOffWorkStr);
break;
case 5:
goOffWorkStr = getGoOffWorkStr(fixedworkEntity.getTuesdayClassId());
entity.setGoOffTimeStr(goOffWorkStr);
break;
case 6:
goOffWorkStr = getGoOffWorkStr(fixedworkEntity.getFridayClassId());
entity.setGoOffTimeStr(goOffWorkStr);
break;
case 7:
goOffWorkStr = getGoOffWorkStr(fixedworkEntity.getSundayClassId());
entity.setGoOffTimeStr(goOffWorkStr);
break;
default:
entity.setGoOffTimeStr("");
}
}
} else if (TypeEnum.自由工时.getValue() == attendanceGroupEntity.getType()) {
} else if (TypeEnum.排班制.getValue() == attendanceGroupEntity.getType()) {
} else {
}
}
}
private String getGoOffWorkStr(Long sundayClassId) {
if (ObjectUtils.isEmpty(sundayClassId)) return "";
StringBuilder goOffWorkSb = new StringBuilder();
List<AttendanceClassDetailEntity> classDetailEntities = classDetailService.find(new AttendanceClassDetailQuery().classId(sundayClassId));
if (!ObjectUtils.isEmpty(classDetailEntities)) {
for (AttendanceClassDetailEntity classDetailEntity : classDetailEntities) {
String goWorkStr = "";
String offWorkStr = "";
if (!ObjectUtils.isEmpty(classDetailEntity.getGoWorkDate())) {
goWorkStr = DateUtil.formatDateTime(classDetailEntity.getGoWorkDate());
}
if (!ObjectUtils.isEmpty(classDetailEntity.getOffWorkDate())) {
offWorkStr = DateUtil.formatDateTime(classDetailEntity.getOffWorkDate());
}
goOffWorkSb.append(goWorkStr);
goOffWorkSb.append("--");
goOffWorkSb.append(offWorkStr);
goOffWorkSb.append(" \n");
}
}
return goOffWorkSb.toString();
}
@Override
......@@ -75,12 +170,7 @@ public class PerformAttendRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
BeanUtils.copyProperties(entity, checkAttendRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkAttendRecordEntity.setId(null);
checkAttendRecordEntity.setRecordId(entity.getId());
if (entity.getSubMethod() == SubMethodEnum.系统自动.getValue()) {
checkAttendRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
checkAttendRecordEntity.setCheckTime(new Date());
} else {
checkAttendRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkAttendRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
checkAttendRecordService.save(checkAttendRecordEntity, context);
}
......
......@@ -73,12 +73,7 @@ public class PerformComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Pe
BeanUtils.copyProperties(entity,checkComplainRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkComplainRecordEntity.setId(null);
checkComplainRecordEntity.setRecordId(entity.getId());
if(entity.getSubMethod()== SubMethodEnum.系统自动.getValue()){
checkComplainRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
checkComplainRecordEntity.setCheckTime(new Date());
}else {
checkComplainRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkComplainRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
checkComplainRecordService.save(checkComplainRecordEntity,context);
}
......
......@@ -73,12 +73,7 @@ public class PerformEffectRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
BeanUtils.copyProperties(entity, checkEffectRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkEffectRecordEntity.setId(null);
checkEffectRecordEntity.setRecordId(entity.getId());
if (entity.getSubMethod() == SubMethodEnum.系统自动.getValue()) {
checkEffectRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
checkEffectRecordEntity.setCheckTime(new Date());
} else {
checkEffectRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkEffectRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
checkEffectRecordService.save(checkEffectRecordEntity, context);
}
......
......@@ -72,12 +72,9 @@ public class PerformGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
BeanUtils.copyProperties(entity,checkGoworkRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkGoworkRecordEntity.setId(null);
checkGoworkRecordEntity.setRecordId(entity.getId());
if(entity.getSubMethod()== SubMethodEnum.系统自动.getValue()){
checkGoworkRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
checkGoworkRecordEntity.setCheckTime(new Date());
}else {
checkGoworkRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkGoworkRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
checkGoworkRecordService.save(checkGoworkRecordEntity,context);
}
......
......@@ -72,12 +72,7 @@ public class PerformOtherRecordServiceImpl extends AbstractCRUDServiceImpl<Perfo
BeanUtils.copyProperties(entity,checkOtherRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkOtherRecordEntity.setId(null);
checkOtherRecordEntity.setRecordId(entity.getId());
if(entity.getSubMethod()== SubMethodEnum.系统自动.getValue()){
checkOtherRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
checkOtherRecordEntity.setCheckTime(new Date());
}else {
checkOtherRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkOtherRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
checkOtherRecordService.save(checkOtherRecordEntity,context);
}
......
......@@ -72,13 +72,7 @@ public class PerformReviewRecordServiceImpl extends AbstractCRUDServiceImpl<Perf
BeanUtils.copyProperties(entity, checkReviewRecordEntity, BeanUtil.getNullPropertyNames(entity));
checkReviewRecordEntity.setId(null);
checkReviewRecordEntity.setRecordId(entity.getId());
if (entity.getSubMethod() == SubMethodEnum.系统自动.getValue()) {
checkReviewRecordEntity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //自动扣分相设置为已处理
checkReviewRecordEntity.setCheckTime(new Date());
} else {
checkReviewRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
}
checkReviewRecordEntity.setCheckStatus(CheckStatusEnum.未处理.getValue()); //非自动扣分相设置为未处理
checkReviewRecordService.save(checkReviewRecordEntity, context);
}
......
......@@ -84,4 +84,5 @@ public class PerformAttendRecordController extends BaseCRUDJsonBodyMappingContro
query.setCreateTimeEnd(DateUtil.formatDate(query.getCreateTime()));
}
}
}
\ No newline at end of file
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