Commit 9f70185e authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents bda70743 c9d6c102
......@@ -92,6 +92,34 @@ export default {
}, 300);
});
},
// 默认拉取数据
async getTable() {
try {
await this.beforeFecth();
} catch (error) {
return;
}
this.tableData.loading = true;
this.$post("/attendance/stat/summary", this.query, {
cancelToken: this.source.token,
})
.then(({ data }) => {
this.tableData = this.beforeRender(
Object.assign({}, this.tableData, data)
);
this.afterRender(this.tableData);
})
.catch((error) => {
if (error.message == "自动取消ajax操作") return;
this.$message.error(error.message);
})
.then((data) => {
clearTimeout(this.loadingTimer);
this.loadingTimer = setTimeout(() => {
this.tableData.loading = false;
}, 300);
});
},
// 复制一个数组或对象
util_copy(data) {
if (typeof data !== "object") return data;
......
......@@ -28,6 +28,14 @@
@click="setdialog"
>表格设置</el-button
>
<el-button
slot="table-head-left2"
style="margin-left: 10px"
icon="el-icon-tickets"
size="mini"
@click="restTable"
>重新汇总</el-button
>
</LayoutTable>
<dialog-show ref="dialogform" @ok="getData" />
<!-- 表格设置 -->
......@@ -101,6 +109,9 @@ export default {
return "-";
}
},
restTable() {
this.getTable();
},
afterRender(data) {
this.addColumn = getdiffdate(
this.query.summaryTimeStart,
......@@ -129,7 +140,6 @@ export default {
this.$forceUpdate();
},
beforeRender(row) {
console.log(row.data);
row.data.forEach((element) => {
if (
element.attendanceStaffStatEntities &&
......@@ -299,7 +309,16 @@ export default {
{ label: "其他(天)", prop: "otherDays" },
{ label: "出勤率%", prop: "attendanceRate" },
{
label: "出勤率%",
prop: "attendanceRate",
formatter: (row) => {
console.log(row);
return row.attendanceRate
? (Number(row.attendanceRate) * 100).toFixed(2) + "%"
: "--";
},
},
{ label: "未按规定打卡(含忘记打卡)", prop: "nonCompliancePunch" },
......
......@@ -2,6 +2,7 @@ package com.mortals.xhx.module.attendance.service.impl;
import cn.hutool.core.date.DateUtil;
import com.mortals.framework.model.PageInfo;
import com.mortals.xhx.busiz.h5.web.ApiWebPerformController;
import com.mortals.xhx.module.attendance.model.AttendanceClassDetailEntity;
import com.mortals.xhx.module.attendance.model.AttendanceClassEntity;
import com.mortals.xhx.module.attendance.service.AttendanceClassDetailService;
......@@ -34,6 +35,9 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
@Autowired
private AttendanceClassService attendanceClassService;
@Autowired
private ApiWebPerformController apiWebPerformController;
@Override
protected void findAfter(AttendanceRecordErrorEntity params, PageInfo pageInfo, Context context, List<AttendanceRecordErrorEntity> list) throws AppException {
......@@ -60,4 +64,10 @@ public class AttendanceRecordErrorServiceImpl extends AbstractCRUDServiceImpl<At
}
});
}
@Override
protected void updateAfter(AttendanceRecordErrorEntity entity, Context context) throws AppException {
}
}
\ No newline at end of file
......@@ -10,7 +10,11 @@ import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.busiz.h5.req.AttendSaveReq;
import com.mortals.xhx.busiz.h5.web.ApiWebPerformController;
import com.mortals.xhx.common.code.ErrorStatusEnum;
import com.mortals.xhx.common.code.ProcessStatusEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.attendance.model.*;
import com.mortals.xhx.module.attendance.service.*;
import com.mortals.xhx.module.dept.model.DeptQuery;
......@@ -73,6 +77,7 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
@Autowired
private AttendanceRecordErrorService errorService;
public AttendanceRecordErrorController() {
super.setModuleDesc("考勤打卡记录异常信息");
}
......@@ -136,13 +141,24 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
protected void saveBefore(AttendanceRecordErrorEntity entity, Map<String, Object> model, Context context) throws AppException {
for (AttendanceRecordErrorEntity recordErrorEntity : entity.getRecordErrorEntities()) {
recordErrorEntity.setProcessStatus(entity.getProcessStatus());
recordErrorEntity.setProcessResult(entity.getProcessResult());
recordErrorEntity.setOpertor(context.getUser().getRealName());
recordErrorEntity.setOperDateTime(new Date());
recordErrorEntity.setRemark(entity.getRemark());
AttendanceRecordErrorEntity updateEntity = new AttendanceRecordErrorEntity();
updateEntity.setId(recordErrorEntity.getId());
updateEntity.setProcessStatus(entity.getProcessStatus());
updateEntity.setGoOffDateTime(null);
updateEntity.setProcessResult(entity.getProcessResult());
updateEntity.setOpertor(context.getUser().getRealName());
updateEntity.setOperDateTime(new Date());
updateEntity.setRemark(entity.getRemark());
updateEntity.setUpdateTime(new Date());
updateEntity.setUpdateUserId(this.getContextUserId(getContext()));
this.service.update(recordErrorEntity, getContext());
}
/*
if(!ObjectUtils.isEmpty(entity.getRecordErrorEntities())){
this.batchSave(entity.getRecordErrorEntities());
}
this.batchSave(entity.getRecordErrorEntities());
*/
for (AttendanceRecordErrorEntity item : entity.getRecordErrorEntities()) {
DateUtils.convertTime2Str(item.getErrorDateTime().getTime(), DateUtils.P_yyyy_MM_dd);
......@@ -209,6 +225,50 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
super.saveBefore(entity, model, context);
}
@Override
protected int saveAfter(AttendanceRecordErrorEntity entity, Map<String, Object> model, Context context) throws AppException {
if (YesNoEnum.YES.getValue() == entity.getProcessStatus()) {
//已经处理,根据错误状态提交考勤绩效
String ruleCode = "";
if (ErrorStatusEnum.早退.getValue() == entity.getErrorStatus()) {
//判断时间差定义
//entity.getErrorStatus()
}
/* AttendSaveReq attendSaveReq = new AttendSaveReq();
attendSaveReq.setAttendanceGroupId(entity.getAttendanceGroupId());
attendSaveReq.setAttendanceGroupName(entity.getAttendanceGroupName());
attendSaveReq.setAttendanceDate(entity.getActualAttendanceDateTime());
attendSaveReq.setErrorTime(entity.getErrorDateTime());
attendSaveReq.setGoOffTimeStr(entity.getGoOrOff());
attendSaveReq.setActualAttendTime();
attendSaveReq.setErrorResult(entity.getRemark());
attendSaveReq.setExt();
attendSaveReq.setWorkNum();
attendSaveReq.setTitle();
attendSaveReq.setHappenTime(entity.getErrorDateTime());
attendSaveReq.setRuleCode(ruleCode);
attendSaveReq.setRuleId();
attendSaveReq.setPhone();
attendSaveReq.setPerformType();
attendSaveReq.setStaffId();*/
// apiWebPerformController.attendSave(attendSaveReq);
}
return super.saveAfter(entity, model, context);
}
@Override
protected int editAfter(Long id, Map<String, Object> model, AttendanceRecordErrorEntity entity, Context context) throws AppException {
this.addDict(model, "errorStatus", paramService.getParamBySecondOrganize("AttendanceRecordDetail", "goWorkResult"));
......
......@@ -141,9 +141,9 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
*/
public com.aliyun.teaopenapi.models.Config setConfig() {
com.aliyun.teaopenapi.models.Config config = new com.aliyun.teaopenapi.models.Config();
// config.protocol = "http";
// config.regionId = "central";
// config.endpoint = oaUrl;
config.protocol = "http";
config.regionId = "central";
config.endpoint = oaUrl;
return config;
}
......@@ -153,9 +153,9 @@ public class DingPersonServiceImpl extends AbstractDingTalkService implements ID
com.aliyun.dingtalkworkflow_1_0.Client client = new com.aliyun.dingtalkworkflow_1_0.Client(setConfig());
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders getProcessInstanceHeaders = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceHeaders();
getProcessInstanceHeaders.xAcsDingtalkAccessToken = getToken();
// HashMap<String, String> map = new HashMap<>();
// getProcessInstanceHeaders.setCommonHeaders(map);
// getProcessInstanceHeaders.getCommonHeaders().put("host", "172.15.28.113:8919");
HashMap<String, String> map = new HashMap<>();
getProcessInstanceHeaders.setCommonHeaders(map);
getProcessInstanceHeaders.getCommonHeaders().put("host", "172.15.28.113:8919");
com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest getProcessInstanceRequest = new com.aliyun.dingtalkworkflow_1_0.models.GetProcessInstanceRequest()
.setProcessInstanceId(processInstanceId);
......
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