Commit 055cc65f authored by 赵啸非's avatar 赵啸非

Merge branch 'master' into reg

# Conflicts:
#	attendance-performance-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthTokenServiceImpl.java
parents d3378530 a8eff47c
......@@ -127,7 +127,11 @@ export default {
const dataCopy = Object.assign({}, data);
array.forEach((item) => {
dataCopy[item] =
dataCopy[item] === undefined ? [] : dataCopy[item].split(",");
dataCopy[item] === undefined
? []
: Array.isArray(dataCopy[item])
? dataCopy[item]
: dataCopy[item].split(",");
});
return dataCopy;
},
......
......@@ -30,6 +30,8 @@ export default {
} else {
delete this.query.createTimeStart;
delete this.query.createTimeEnd;
delete this.query.errorTimeStart;
delete this.query.errorTimeEnd;
}
}
this.getData();
......
......@@ -352,6 +352,8 @@ export default {
if (this.form.createTimeMonth) {
this.form.createTimeStart = this.form.createTimeMonth + "-01";
this.form.createTimeEnd = this.form.createTimeMonth + "-31";
this.form.errorTimeStart = this.form.createTimeMonth + "-01";
this.form.errorTimeEnd = this.form.createTimeMonth + "-31";
} else if (this.form.createTimeStart1 || this.form.createTimeEnd1) {
this.form.createTimeStart = this.form.createTimeStart1;
this.form.createTimeEnd = this.form.createTimeEnd1;
......@@ -412,6 +414,8 @@ export default {
} else {
query.createTimeEnd = undefined;
query.createTimeStart = undefined;
query.errorTimeStart = undefined;
query.errorTimeEnd = undefined;
}
}
console.log({
......
......@@ -153,7 +153,9 @@ export default {
};
addobjArr.push(obj);
});
this.config.columns = [...this.initalArr, ...addobjArr];
let arr1 = this.initalArr.slice(0, 8);
let arr2 = this.initalArr.slice(8);
this.config.columns = [...arr1, ...addobjArr, ...arr2];
this.$forceUpdate();
},
beforeRender(row) {
......@@ -287,8 +289,17 @@ export default {
{ label: "员工姓名", prop: "staffName", fixed: "left", width: 100 },
{ label: "部门", prop: "deptName" },
{ label: "出勤天数", prop: "goTimes", formatter: this.formatter },
{ label: "应到", prop: "workDays", formatter: this.formatter },
{ label: "实到", prop: "goTimes", formatter: this.formatter },
{
label: "出勤率%",
prop: "attendanceRate",
formatter: (row) => {
return row.attendanceRate
? (Number(row.attendanceRate) * 100).toFixed(2) + "%"
: "--";
},
},
{
label: "缺卡次数",
prop: "morningTimes",
......@@ -341,16 +352,6 @@ export default {
{ label: "其他(天)", prop: "otherDays" },
{
label: "出勤率%",
prop: "attendanceRate",
formatter: (row) => {
return row.attendanceRate
? (Number(row.attendanceRate) * 100).toFixed(2) + "%"
: "--";
},
},
{ label: "未按规定打卡(含忘记打卡)", prop: "nonCompliancePunch" },
{ label: "迟到(次)", prop: "lateTimes" },
......
......@@ -133,6 +133,12 @@ export default {
this.$post("/check/all/record/list", {
checkStatus: 2,
staffId: id,
checkTimeStart: this.$route.query.yearmonth
? this.$route.query.yearmonth + "-01"
: "",
checkTimeEnd: this.$route.query.yearmonth
? this.$route.query.yearmonth + "-31"
: "",
}).then((res) => {
const { code, data, dict } = res;
if (code == 1) {
......@@ -164,7 +170,9 @@ export default {
/** 查看*/
view(row) {
this.reset();
this.query = { id: row.id };
this.query = {
id: row.id,
};
this.urls.currUrl = "staff/perform/summary/view";
this.getData();
this.pageInfo.type = "view";
......
......@@ -298,7 +298,7 @@ export default {
{
prop: "roleIds",
label: "所属角色",
formatter: this.formatters,
formatter: this.formatter,
align: "center",
},
......
......@@ -39,4 +39,6 @@ public class UserVo extends BaseEntityLong {
* 过期时间
*/
private Long expireTime;
String roleIdStrs;
}
\ No newline at end of file
......@@ -24,6 +24,7 @@ import com.mortals.xhx.base.system.resource.model.ResourceEntity;
import com.mortals.xhx.base.system.resource.service.ResourceService;
import com.mortals.xhx.base.system.role.dao.RoleUserDao;
import com.mortals.xhx.base.system.role.model.RoleUserEntity;
import com.mortals.xhx.base.system.role.model.RoleUserQuery;
import com.mortals.xhx.base.system.user.dao.UserDao;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.model.UserQuery;
......@@ -33,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>Title: 用户信息</p>
......@@ -149,6 +151,12 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
roleIds.add(role.getRoleId());
});
item.setRoleIds(roleIds);
String roleIdStrs = StringUtils.join(roleIds, ",");
item.setRoleIdStrs(roleIdStrs);
RoleUserQuery roleUserQuery = new RoleUserQuery();
roleUserQuery.setUserId(item.getId());
});
}
}
......@@ -338,4 +346,5 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
public UserDao getUserDao() {
return this.getDao();
}
}
\ No newline at end of file
......@@ -43,6 +43,32 @@ public class AttendanceStatEntity extends AttendanceStatVo {
*/
@Excel(name = "部门名称")
private String deptName;
/**
* 手机号码
*/
private String phoneNumer;
@Excel(name = "出勤天数")
private Integer workDays;
/**
* 出勤天数
*/
@Excel(name = "实际出勤天数")
private Integer goTimes;
/**
* 考勤汇总-出勤率(%)
*/
@Excel(name = "考勤汇总-出勤率",percentEnabled = true,suffix="%",scale=2)
private BigDecimal attendanceRate;
/**
* 上午缺卡次数
*/
@Excel(name = "缺卡次数")
private Integer morningTimes;
/**
* 下午缺卡次数
*/
private Integer afternoonTimes;
/**
* 回单位(天)
*/
......@@ -133,11 +159,7 @@ public class AttendanceStatEntity extends AttendanceStatVo {
*/
@Excel(name = "考勤汇总-其他")
private BigDecimal otherDays;
/**
* 考勤汇总-出勤率(%)
*/
@Excel(name = "考勤汇总-出勤率",percentEnabled = true,suffix="%",scale=2)
private BigDecimal attendanceRate;
/**
* 考勤汇总-未按规定打卡(含忘记打卡)
*/
......@@ -219,24 +241,7 @@ public class AttendanceStatEntity extends AttendanceStatVo {
*/
@Excel(name = "陪产假")
private BigDecimal paternityLeaveDays;
/**
* 手机号码
*/
private String phoneNumer;
/**
* 出勤天数
*/
@Excel(name = "出勤天数")
private Integer goTimes;
/**
* 上午缺卡次数
*/
@Excel(name = "缺卡次数")
private Integer morningTimes;
/**
* 下午缺卡次数
*/
private Integer afternoonTimes;
@Override
public int hashCode() {
return this.getId().hashCode();
......
......@@ -337,11 +337,7 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
for (AttendanceRecordDetailEntity recordDetailEntity : detailEntityList) {
Integer goWorkResult = recordDetailEntity.getGoWorkResult();
Integer offWorkResult = recordDetailEntity.getOffWorkResult();
//判断是否是离职员工 如果是 则不添加
//判断上班
AttendanceClassDetailEntity attendanceClassDetailEntity = attendanceClassDetailService.get(recordDetailEntity.getShiftsId());
if (ObjectUtils.isEmpty(attendanceClassDetailEntity)) continue;
......@@ -409,26 +405,30 @@ public class FixWorkOtherAttendance extends AttendanceWorkAbstract {
}
//删除当前员工当日未处理的异常后,重新添加
AttendanceRecordErrorQuery errorQuery = new AttendanceRecordErrorQuery();
errorQuery.setCreateTimeStart(dateStr);
errorQuery.setCreateTimeEnd(dateStr);
errorQuery.setStaffId(attendanceRecordEntity.getStaffId());
errorQuery.setProcessStatus(YesNoEnum.NO.getValue());
Long[] errorIds = errorService.find(errorQuery).stream().map(i -> i.getId()).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(errorIds)) {
errorService.remove(errorIds, context);
}
if (!ObjectUtils.isEmpty(errorEntityList)) {
//删除当前员工当日未处理的异常后,重新添加
AttendanceRecordErrorQuery errorQuery = new AttendanceRecordErrorQuery();
errorQuery.setErrorDateTimeStart(dateStr);
errorQuery.setErrorDateTimeEnd(dateStr);
errorQuery.setStaffId(attendanceRecordEntity.getStaffId());
errorQuery.setProcessStatus(YesNoEnum.NO.getValue());
Long[] errorIds = errorService.find(errorQuery).stream().map(i -> i.getId()).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(errorIds)) {
errorService.remove(errorIds, context);
}
for (AttendanceRecordErrorEntity errorEntity : errorEntityList) {
//查看是否存在相同的异常记录,如果存在 则不添加
errorQuery = new AttendanceRecordErrorQuery();
errorQuery.setShiftsId(errorEntity.getShiftsId());
errorQuery.setGoOffDateTime(errorEntity.getErrorDateTime());
errorQuery.setStaffId(errorEntity.getStaffId());
errorQuery.setShiftsId(errorEntity.getShiftsId());
errorQuery.setProcessStatus(YesNoEnum.YES.getValue());
AttendanceRecordErrorEntity attendanceRecordErrorEntity = errorService.selectOne(errorQuery, context);
......
......@@ -144,10 +144,10 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
for (AttendanceRecordErrorEntity recordErrorEntity : entity.getRecordErrorEntities()) {
AttendanceRecordErrorEntity updateEntity = new AttendanceRecordErrorEntity();
updateEntity.setId(recordErrorEntity.getId());
updateEntity.setAttendanceGroupId(recordErrorEntity.getAttendanceGroupId());
/* updateEntity.setAttendanceGroupId(recordErrorEntity.getAttendanceGroupId());
updateEntity.setAttendanceGroupName(recordErrorEntity.getAttendanceGroupName());
updateEntity.setErrorDateTime(recordErrorEntity.getErrorDateTime());
updateEntity.setGoOffDateTime(recordErrorEntity.getGoOffDateTime());
updateEntity.setGoOffDateTime(recordErrorEntity.getGoOffDateTime());*/
updateEntity.setProcessStatus(entity.getProcessStatus());
updateEntity.setProcessResult(entity.getProcessResult());
updateEntity.setStaffId(recordErrorEntity.getStaffId());
......
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.attendance.web;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -130,6 +131,7 @@ public class AttendanceRecordHikController extends BaseCRUDJsonBodyMappingContro
}
@PostMapping(value = "/addAttendanceRecord")
@UnAuth
public Rest<String> addAttendanceRecord(@RequestBody AttendanceRecordHikEntity hikEntity) {
Rest<String> ret = new Rest();
Map<String, Object> model = new HashMap();
......
......@@ -17,6 +17,7 @@ import com.mortals.framework.utils.ReflectUtils;
import com.mortals.framework.utils.poi.ExcelUtil;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.utils.DynamicColExcelUtil;
import com.mortals.xhx.module.attendance.model.AttendanceClassQuery;
import com.mortals.xhx.module.attendance.model.AttendanceGroupQuery;
import com.mortals.xhx.module.attendance.model.AttendanceStaffStatEntity;
......@@ -41,6 +42,7 @@ import com.mortals.xhx.module.attendance.service.AttendanceStatService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.math.BigDecimal;
import java.text.DateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
......@@ -200,7 +202,7 @@ public class AttendanceStatController extends BaseCRUDJsonBodyMappingController<
PageInfo pageInfo = new PageInfo(-1);
List<AttendanceStatEntity> list = this.getService().findExt(query, pageInfo, context).getList();
Class<AttendanceStatEntity> tClass = ReflectUtils.getClassGenricType(this.getClass(), 1);
ExcelUtil<AttendanceStatEntity, Long> util = new ExcelUtil(tClass);
DynamicColExcelUtil<AttendanceStatEntity, Long> util = new DynamicColExcelUtil(tClass);
this.doExportAfter(context, list);
DateTime startDate = DateUtil.parse(query.getSummaryTimeStart());
DateTime endDate = DateUtil.parse(query.getSummaryTimeEnd());
......@@ -210,7 +212,7 @@ public class AttendanceStatController extends BaseCRUDJsonBodyMappingController<
final String[] weekStr={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
//由于1表示周日,2表示周一所以需要-1后对应上数组下标
List<List<Map<String, Object>>> lists = list.stream().map(item -> {
attendanceStatExport(item);
List<AttendanceStaffStatEntity> attendanceStaffStatEntities = item.getAttendanceStaffStatEntities();
Map<Integer, String> collect = new HashMap<>();
if (!ObjectUtils.isEmpty(attendanceStaffStatEntities)) {
......@@ -244,7 +246,7 @@ public class AttendanceStatController extends BaseCRUDJsonBodyMappingController<
}).collect(Collectors.toList());
// byte[] data = util.exportExcel(list, properties, name);
byte[] data = util.exportExcel(list, properties, lists, name);
byte[] data = util.exportExcel(list, properties, lists, name,6);
this.responseStream(this.response, data, fileName);
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var12) {
......@@ -252,4 +254,113 @@ public class AttendanceStatController extends BaseCRUDJsonBodyMappingController<
}
}
private void attendanceStatExport(AttendanceStatEntity entity){
if(isNull(entity.getBackToUnit())){
entity.setBackToUnit(null);
}
if(isNull(entity.getOnDutyLeave())){
entity.setOnDutyLeave(null);
}
if(isNull(entity.getOutOfOffice())){
entity.setOutOfOffice(null);
}
if(isNull(entity.getShiftCompensation())){
entity.setShiftCompensation(null);
}
if(isNull(entity.getPhysicalExamination())){
entity.setPhysicalExamination(null);
}
if(isNull(entity.getQuarantine())){
entity.setQuarantine(null);
}
if(isNull(entity.getBusinessTrip())){
entity.setBusinessTrip(null);
}
if(isNull(entity.getPublicHoliday())){
entity.setPublicHoliday(null);
}
if(isNull(entity.getSickLeave())){
entity.setSickLeave(null);
}
if(isNull(entity.getFuneralLeave())){
entity.setFuneralLeave(null);
}
if(isNull(entity.getMarriageLeave())){
entity.setMarriageLeave(null);
}
if(isNull(entity.getChildRearingLeave())){
entity.setChildRearingLeave(null);
}
if(isNull(entity.getMaternityLeave())){
entity.setMaternityLeave(null);
}
if(isNull(entity.getTransferBack())){
entity.setTransferBack(null);
}
if(isNull(entity.getHomeLeave())){
entity.setHomeLeave(null);
}
if(isNull(entity.getPersonalLeave())){
entity.setPersonalLeave(null);
}
if(isNull(entity.getAbsenteeismDays())){
entity.setAbsenteeismDays(null);
}
if(isNull(entity.getOtherDays())){
entity.setOtherDays(null);
}
if(isNull(entity.getNonCompliancePunch())){
entity.setNonCompliancePunch(null);
}
if(entity.getLateTimes()!=null && entity.getLateTimes()==0){
entity.setLateTimes(null);
}
if(entity.getSurfingMobileTimes()!=null && entity.getSurfingMobileTimes()==0){
entity.setSurfingMobileTimes(null);
}
if(entity.getOvertimeTimes()!=null && entity.getOvertimeTimes()==0){
entity.setOvertimeTimes(null);
}
if(isNull(entity.getVacancy())){
entity.setVacancy(null);
}
if(entity.getNonStandardDressTimes()!=null && entity.getNonStandardDressTimes()==0){
entity.setNonStandardDressTimes(null);
}
if(isNull(entity.getUnexcusedMeetingAbsence())){
entity.setUnexcusedMeetingAbsence(null);
}
if(isNull(entity.getEarlyLeaveMeeting())){
entity.setEarlyLeaveMeeting(null);
}
if(isNull(entity.getBreastfeedingLeaveDays())){
entity.setBreastfeedingLeaveDays(null);
}
if(isNull(entity.getMenstrualLeaveDays())){
entity.setMenstrualLeaveDays(null);
}
if(isNull(entity.getAnnualLeaveDays())){
entity.setAnnualLeaveDays(null);
}
if(isNull(entity.getCompensatedLeaveDays())){
entity.setCompensatedLeaveDays(null);
}
if(isNull(entity.getPaternityLeaveDays())){
entity.setPaternityLeaveDays(null);
}
}
private boolean isNull(BigDecimal bigDecimal){
if (ObjectUtils.isEmpty(bigDecimal)){
return true;
}else {
BigDecimal zero = new BigDecimal("0");
if(bigDecimal.compareTo(zero) > 0){
return false;
}else {
return true;
}
}
}
}
......@@ -15,11 +15,11 @@ import java.util.Date;
*/
@Data
public class CheckAttendRecordVo extends BaseEntityLong {
/** 开始 创建时间 */
private String createTimeStart;
/** 开始 异常时间 */
private String errorTimeStart;
/** 结束 创建时间 */
private String createTimeEnd;
/** 结束 异常时间 */
private String errorTimeEnd;
/** 序号,主键,自增长列表 */
......
......@@ -152,6 +152,10 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
CheckAttendRecordEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
......@@ -162,29 +166,26 @@ public class CheckAttendRecordServiceImpl extends AbstractCRUDServiceImpl<CheckA
AuditUtil.audit(entity);
}
entity.setCheckTime(new Date());
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckTime(temp.getErrorTime());
entity.setUpdateTime(new Date());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
try {
CheckAttendRecordEntity temp = this.get(entity.getId());
if (temp != null) {
if (!ObjectUtils.isEmpty(entity.getRecordId())) {
PerformAttendRecordEntity performAttendRecordEntity = attendRecordService.get(entity.getRecordId());
if (!ObjectUtils.isEmpty(performAttendRecordEntity)) {
performAttendRecordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
performAttendRecordEntity.setUpdateTime(new Date());
performAttendRecordEntity.setUpdateUserId(this.getContextUserId(context));
attendRecordService.update(performAttendRecordEntity);
}
if (!ObjectUtils.isEmpty(entity.getRecordId())) {
PerformAttendRecordEntity performAttendRecordEntity = attendRecordService.get(entity.getRecordId());
if (!ObjectUtils.isEmpty(performAttendRecordEntity)) {
performAttendRecordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
performAttendRecordEntity.setUpdateTime(new Date());
performAttendRecordEntity.setUpdateUserId(this.getContextUserId(context));
attendRecordService.update(performAttendRecordEntity);
}
}
/* AttendPostServiceThread attendPostServiceThread = new AttendPostServiceThread(entity);
ThreadPool.getInstance().execute(attendPostServiceThread);*/
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
......
......@@ -150,6 +150,10 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
CheckComplainRecordEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
......@@ -158,27 +162,24 @@ public class CheckComplainRecordServiceImpl extends AbstractCRUDServiceImpl<Chec
if(!ObjectUtils.isEmpty(entity.getSubAddType())&&!ObjectUtils.isEmpty(entity.getCheckResult())){
AuditUtil.audit(entity);
}
entity.setCheckTime(new Date());
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckTime(temp.getComplainTime());
entity.setUpdateTime(new Date());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
try {
CheckComplainRecordEntity temp = this.get(entity.getId());
if (temp != null) {
if(!ObjectUtils.isEmpty(temp.getRecordId())){
PerformComplainRecordEntity recordEntity = recordService.get(temp.getRecordId());
if(!ObjectUtils.isEmpty(recordEntity)){
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
if(!ObjectUtils.isEmpty(temp.getRecordId())){
PerformComplainRecordEntity recordEntity = recordService.get(temp.getRecordId());
if(!ObjectUtils.isEmpty(recordEntity)){
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
sendCheckDingTalk(entity);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
sendCheckDingTalk(entity);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
......
......@@ -150,6 +150,10 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
if(entity.getId()==null){
throw new AppException("核查记录ID不能为空");
}
CheckEffectRecordEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if (context != null && context.getUser()!=null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
......@@ -158,28 +162,25 @@ public class CheckEffectRecordServiceImpl extends AbstractCRUDServiceImpl<CheckE
if(!ObjectUtils.isEmpty(entity.getSubAddType())&&!ObjectUtils.isEmpty(entity.getCheckResult())){
AuditUtil.audit(entity);
}
entity.setCheckTime(new Date());
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckTime(temp.getHappenTime());
entity.setUpdateTime(new Date());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
try{
CheckEffectRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
if(!ObjectUtils.isEmpty(temp.getRecordId())){
PerformEffectRecordEntity recordEntity = recordService.get(temp.getRecordId());
if(!ObjectUtils.isEmpty(recordEntity)){
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
if(!ObjectUtils.isEmpty(temp.getRecordId())){
PerformEffectRecordEntity recordEntity = recordService.get(temp.getRecordId());
if(!ObjectUtils.isEmpty(recordEntity)){
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
}
......
......@@ -147,6 +147,10 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
if(entity.getId()==null){
throw new AppException("核查记录ID不能为空");
}
CheckGoworkRecordEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if (context != null && context.getUser()!=null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
......@@ -155,28 +159,25 @@ public class CheckGoworkRecordServiceImpl extends AbstractCRUDServiceImpl<CheckG
if(!ObjectUtils.isEmpty(entity.getSubAddType())&&!ObjectUtils.isEmpty(entity.getCheckResult())){
AuditUtil.audit(entity);
}
entity.setCheckTime(new Date());
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckTime(temp.getGoworkTime());
entity.setUpdateTime(new Date());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
//发送钉钉通知信息
try{
CheckGoworkRecordEntity temp = this.get(entity.getId());
if(temp!=null) {
if(!ObjectUtils.isEmpty(temp.getRecordId())){
PerformGoworkRecordEntity recordEntity = recordService.get(temp.getRecordId());
if(!ObjectUtils.isEmpty(recordEntity)){
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
if(!ObjectUtils.isEmpty(temp.getRecordId())){
PerformGoworkRecordEntity recordEntity = recordService.get(temp.getRecordId());
if(!ObjectUtils.isEmpty(recordEntity)){
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}catch (Exception e){
log.error("汇总已审核的核查记录出错",e);
}
......
......@@ -152,6 +152,10 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
CheckOtherRecordEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
......@@ -160,28 +164,26 @@ public class CheckOtherRecordServiceImpl extends AbstractCRUDServiceImpl<CheckOt
if (!ObjectUtils.isEmpty(entity.getSubAddType()) && !ObjectUtils.isEmpty(entity.getCheckResult())) {
AuditUtil.audit(entity);
}
entity.setCheckTime(new Date());
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckTime(temp.getHappenTime());
entity.setUpdateTime(new Date());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
//发送钉钉通知信息
try {
CheckOtherRecordEntity temp = this.get(entity.getId());
if (temp != null) {
if (!ObjectUtils.isEmpty(temp.getRecordId())) {
PerformOtherRecordEntity recordEntity = recordService.get(temp.getRecordId());
if (!ObjectUtils.isEmpty(recordEntity)) {
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
if (!ObjectUtils.isEmpty(temp.getRecordId())) {
PerformOtherRecordEntity recordEntity = recordService.get(temp.getRecordId());
if (!ObjectUtils.isEmpty(recordEntity)) {
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
......
......@@ -152,6 +152,10 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
CheckReviewRecordEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
......@@ -160,28 +164,25 @@ public class CheckReviewRecordServiceImpl extends AbstractCRUDServiceImpl<CheckR
if(!ObjectUtils.isEmpty(entity.getSubAddType())&&!ObjectUtils.isEmpty(entity.getCheckResult())){
AuditUtil.audit(entity);
}
entity.setCheckTime(new Date());
entity.setUpdateTime(entity.getCheckTime());
entity.setCheckTime(temp.getReviewTime());
entity.setUpdateTime(new Date());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
//发送钉钉通知信息
try {
CheckReviewRecordEntity temp = this.get(entity.getId());
if (temp != null) {
if(!ObjectUtils.isEmpty(temp.getRecordId())){
PerformReviewRecordEntity recordEntity = recordService.get(temp.getRecordId());
if(!ObjectUtils.isEmpty(recordEntity)){
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
if(!ObjectUtils.isEmpty(temp.getRecordId())){
PerformReviewRecordEntity recordEntity = recordService.get(temp.getRecordId());
if(!ObjectUtils.isEmpty(recordEntity)){
recordEntity.setProcessStatus(ProcessStatusEnum.已处理.getValue());
recordEntity.setUpdateTime(new Date());
recordEntity.setUpdateUserId(this.getContextUserId(context));
recordService.update(recordEntity);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
}
sendCheckDingTalk(temp);
StaffCheckSummaryQuery query = new StaffCheckSummaryQuery();
query.setStaffId(temp.getStaffId());
summaryCheck(query);
} catch (Exception e) {
log.error("汇总已审核的核查记录出错", e);
}
......
......@@ -26,6 +26,8 @@ import com.mortals.xhx.module.check.service.CheckAttendRecordService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -89,9 +91,11 @@ public class CheckAttendRecordController extends BaseCRUDJsonBodyMappingControll
query.getOrderColList().add(new OrderCol("createTime", OrderCol.DESCENDING));
}
if(!ObjectUtils.isEmpty(query.getCreateTime())){
query.setCreateTimeStart(DateUtil.formatDate(query.getCreateTime()));
query.setCreateTimeEnd(DateUtil.formatDate(query.getCreateTime()));
if(ObjectUtils.isEmpty(query.getErrorTimeStart())){
LocalDateTime currentDate = LocalDateTime.now();
LocalDateTime firstDayOfMonth = currentDate.withDayOfMonth(1);
query.setErrorTimeStart(DateUtil.format(firstDayOfMonth,"yyyy-MM-dd"));
//query.setErrorTimeEnd(DateUtil.formatDate(query.getCreateTime()));
}
super.doListBefore(query, model, context);
}
......
......@@ -312,8 +312,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}
staffEntity.setName(personInfo.getPersonName());
staffEntity.setRemarkId(personInfo.getPersonId());
staffEntity.setPicUri(personInfo.getPersonPhoto().getPicUri());
staffEntity.setServerIndexCode(personInfo.getPersonPhoto().getServerIndexCode());
staffEntity.setPicUri(personInfo.getPersonPhoto()==null?"":personInfo.getPersonPhoto().getPicUri());
staffEntity.setServerIndexCode(personInfo.getPersonPhoto()==null?"":personInfo.getPersonPhoto().getServerIndexCode());
staffEntity.setDeptName(personInfo.getOrgName());
staffEntity.setGender(personInfo.getGender());
staffEntity.setWorkNum(personInfo.getJobNo());
......@@ -329,8 +329,8 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
}
staffEntity.setName(personInfo.getPersonName());
staffEntity.setRemarkId(personInfo.getPersonId());
staffEntity.setPicUri(personInfo.getPersonPhoto().getPicUri());
staffEntity.setServerIndexCode(personInfo.getPersonPhoto().getServerIndexCode());
staffEntity.setPicUri(personInfo.getPersonPhoto()==null?"":personInfo.getPersonPhoto().getPicUri());
staffEntity.setServerIndexCode(personInfo.getPersonPhoto()==null?"":personInfo.getPersonPhoto().getServerIndexCode());
staffEntity.setDeptName(personInfo.getOrgName());
staffEntity.setGender(personInfo.getGender());
staffEntity.setWorkNum(personInfo.getJobNo());
......
......@@ -11,6 +11,7 @@
s.deptId,
s.deptName,
s.phoneNumer,
count(1) as workDays,
ROUND(IFNULL(sum(s.goTimes),0)/count(1),4) as attendanceRate,
sum(s.goTimes) AS goTimes,
sum(s.morningTimes) AS morningTimes,
......
......@@ -5,7 +5,7 @@ Content-Type: application/json
{
"loginName":"admin",
"password":"xhxADMIN8@a",
"password":"admin",
"securityCode":"admin"
}
......@@ -33,8 +33,8 @@ Authorization: {{authToken}}
Content-Type: application/json
{
"attendanceDateStart":"2023-09-28",
"attendanceDateEnd":"2023-10-08"
"attendanceDateStart":"2023-12-01",
"attendanceDateEnd":"2023-12-01"
}
......
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