Commit 2e3449eb authored by 廖旭伟's avatar 廖旭伟

Merge remote-tracking branch 'origin/master'

parents 8533dcbe 74db181f
...@@ -72,6 +72,7 @@ export default { ...@@ -72,6 +72,7 @@ export default {
return; return;
} }
this.tableData.loading = true; this.tableData.loading = true;
this.$post(this.pageInfo.list, this.query, { this.$post(this.pageInfo.list, this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
}) })
...@@ -100,6 +101,7 @@ export default { ...@@ -100,6 +101,7 @@ export default {
return; return;
} }
this.tableData.loading = true; this.tableData.loading = true;
return;
this.$post("/attendance/stat/summary", this.query, { this.$post("/attendance/stat/summary", this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
}) })
......
...@@ -160,6 +160,13 @@ ...@@ -160,6 +160,13 @@
title="查询" title="查询"
>查询</el-button >查询</el-button
> >
<el-button
icon="el-icon-tickets"
@click="resetTable"
v-if="visible"
title="重新汇总"
>重新汇总</el-button
>
<el-button <el-button
icon="el-icon-download" icon="el-icon-download"
...@@ -198,9 +205,59 @@ export default { ...@@ -198,9 +205,59 @@ export default {
}, },
}, },
async created() { async created() {
console.log(this.$route);
this.$route.name == "attendance/stat/list"
? (this.visible = true)
: (this.visible = false);
this.initForm(this.$route.query); this.initForm(this.$route.query);
}, },
methods: { methods: {
resetTable() {
let { path, query } = this.$route;
if (this.form.attendanceDateStart && this.form.attendanceDateEnd) {
let startValue = Date.parse(this.form.attendanceDateStart);
let endValue = Date.parse(this.form.attendanceDateEnd);
if (startValue > endValue) {
this.$message.error("查询-结束的日期需大于开始日期");
this.form.attendanceDateEnd = "";
return false;
}
}
if (this.form.startTime && this.form.endTime) {
let startValue = Date.parse(this.form.startTime);
let endValue = Date.parse(this.form.endTime);
if (startValue > endValue) {
this.$message.error("查询-结束的日期需大于开始日期");
this.form.endTime = "";
return false;
}
}
if (this.form.summaryTimeStart && this.form.summaryTimeEnd) {
let startValue = Date.parse(this.form.summaryTimeStart);
let endValue = Date.parse(this.form.summaryTimeEnd);
if (startValue > endValue) {
this.$message.error("查询-结束的日期需大于开始日期");
this.form.summaryTimeEnd = "";
return false;
}
} else {
this.form.summaryTimeStart = getFirstDay();
this.form.summaryTimeEnd = getLastDay();
}
let params = JSON.parse(JSON.stringify(this.form)); //不更改原始数据
let data = this.decode(params);
data.size = -1;
this.$post("/attendance/stat/summary", data).then((res) => {
if (res.code == 1) {
this.$message.success(res.msg);
} else {
this.$message.error(res.msg);
}
});
},
remoteMethod(query, searchType) { remoteMethod(query, searchType) {
if (query == "") { if (query == "") {
console.log("查询参数为空!"); console.log("查询参数为空!");
...@@ -403,6 +460,7 @@ export default { ...@@ -403,6 +460,7 @@ export default {
// groupList: [], // groupList: [],
}, },
remoteOptions: {}, remoteOptions: {},
visible: false,
}; };
}, },
}; };
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<el-col :span="6" :xs="12"> <el-col :span="6" :xs="12">
<el-card> <el-card>
<div class="data_left"> <div class="data_left">
<div class="title" style="margin-bottom:40px">今日数据洞察</div> <div class="title" style="margin-bottom:40px">本月数据洞察</div>
<div class="cell1"> <div class="cell1">
<div class="title">人事数据</div> <div class="title">人事数据</div>
<div <div
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
</el-time-picker> </el-time-picker>
</div> </div>
<div> <div>
<span>时段: </span> <span>时段: </span>
<span>上班前签到</span> <span>上班前签到</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</el-time-picker> </el-time-picker>
</div> </div>
<div> <div>
<span>时段:</span> <span>时段:</span>
<span>下班前签退</span> <span>下班前签退</span>
<el-time-picker <el-time-picker
size="mini" size="mini"
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
@handleClick="handleClick" @handleClick="handleClick"
></tab-pane> ></tab-pane>
</div> </div>
<div class="totalNum flex"> <!-- <div class="totalNum flex">
<div class="item flex"> <div class="item flex">
<div> <div>
需要打卡人数 需要打卡人数
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<span class="num">{{ attendStatInfo.lackOfCards }}</span> <span class="num">{{ attendStatInfo.lackOfCards }}</span>
</div> </div>
</div> </div>
</div> </div> -->
<LayoutTable :data="tableData" :config="tableConfig" notDel notAdd> <LayoutTable :data="tableData" :config="tableConfig" notDel notAdd>
<el-button <el-button
slot="table-head-left2" slot="table-head-left2"
......
...@@ -28,14 +28,14 @@ ...@@ -28,14 +28,14 @@
@click="setdialog" @click="setdialog"
>表格设置</el-button >表格设置</el-button
> >
<el-button <!-- <el-button
slot="table-head-left2" slot="table-head-left2"
style="margin-left: 10px" style="margin-left: 10px"
icon="el-icon-tickets" icon="el-icon-tickets"
size="mini" size="mini"
@click="restTable" @click="restTable"
>重新汇总</el-button >重新汇总</el-button
> > -->
</LayoutTable> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<!-- 表格设置 --> <!-- 表格设置 -->
...@@ -47,13 +47,14 @@ ...@@ -47,13 +47,14 @@
<el-checkbox <el-checkbox
v-for="(item, index) in setcolum" v-for="(item, index) in setcolum"
:key="index" :key="index"
:label="item.label" :label="item.prop"
> >
{{ item.label }}
</el-checkbox> </el-checkbox>
</el-checkbox-group> </el-checkbox-group>
<div class="mt20" style="text-align:right"> <div class="mt20" style="text-align:right">
<el-button>取消</el-button> <el-button @click="handleCancel">取消</el-button>
<el-button type="primary">确定</el-button> <el-button type="primary" @click="handleSubmit">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 导出记录查看 --> <!-- 导出记录查看 -->
...@@ -100,14 +101,27 @@ export default { ...@@ -100,14 +101,27 @@ export default {
this.initalArr = this.config.columns; this.initalArr = this.config.columns;
}, },
methods: { methods: {
// 表格设置弹窗取消操作
handleCancel() {
this.checkList = [];
this.isdialog = false;
},
// 表格设置提交操作
handleSubmit() {
this.doExport();
this.isdialog = false;
},
// 处理 // 处理
handleArr(arr, currentTime) { handleArr(arr, currentTime) {
console.log(currentTime);
console.log(arr);
let index = arr.findIndex((item) => item.createTime == currentTime); let index = arr.findIndex((item) => item.createTime == currentTime);
if (index > -1) { if (index > -1) {
console.log(arr[index].attendanceSummary); return arr[index].attendanceSummary ? (
return arr[index].attendanceSummary; <el-tag type={"danger"} size="mini">
{arr[index].attendanceSummary}
</el-tag>
) : (
"-"
);
} else { } else {
return "-"; return "-";
} }
...@@ -172,6 +186,9 @@ export default { ...@@ -172,6 +186,9 @@ export default {
this.setcolum = this.config.columns.filter( this.setcolum = this.config.columns.filter(
(item) => item.label && item.prop (item) => item.label && item.prop
); );
this.setcolum = this.setcolum.filter(
(val) => val.prop !== "attendanceStaffStatEntities"
);
}, },
lookexportHis() { lookexportHis() {
this.drawerhistory = true; this.drawerhistory = true;
...@@ -188,6 +205,9 @@ export default { ...@@ -188,6 +205,9 @@ export default {
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params["idList"] = this.selection;
} }
if (this.checkList.length > 0) {
params["properties"] = this.checkList;
}
this.$download( this.$download(
"/attendance/stat/exportExcelExt", "/attendance/stat/exportExcelExt",
{ {
...@@ -195,7 +215,10 @@ export default { ...@@ -195,7 +215,10 @@ export default {
}, },
{ type: "excel" } { type: "excel" }
) )
.then(() => (this.isExport = false)) .then(() => {
this.isExport = false;
this.checkList = [];
})
.catch((error) => { .catch((error) => {
this.isExport = false; this.isExport = false;
this.$message.error(error.message); this.$message.error(error.message);
...@@ -321,7 +344,6 @@ export default { ...@@ -321,7 +344,6 @@ export default {
label: "出勤率%", label: "出勤率%",
prop: "attendanceRate", prop: "attendanceRate",
formatter: (row) => { formatter: (row) => {
console.log(row);
return row.attendanceRate return row.attendanceRate
? (Number(row.attendanceRate) * 100).toFixed(2) + "%" ? (Number(row.attendanceRate) * 100).toFixed(2) + "%"
: "--"; : "--";
......
...@@ -63,6 +63,14 @@ public class ApiLoginController extends BaseJsonBodyController { ...@@ -63,6 +63,14 @@ public class ApiLoginController extends BaseJsonBodyController {
JSONObject ret = new JSONObject(); JSONObject ret = new JSONObject();
JSONObject data = new JSONObject(); JSONObject data = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
String ip = super.getRequestIP(request);
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "未获取到用户信息,请重新登录");
return ret.toJSONString();
}
UserEntity userEntity = null; UserEntity userEntity = null;
try { try {
if (ObjectUtils.isEmpty(loginForm.getCode())) { if (ObjectUtils.isEmpty(loginForm.getCode())) {
...@@ -73,7 +81,8 @@ public class ApiLoginController extends BaseJsonBodyController { ...@@ -73,7 +81,8 @@ public class ApiLoginController extends BaseJsonBodyController {
if (personRest.getCode() != YesNoEnum.YES.getValue()) { if (personRest.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException(DING_AUTH_FAIL,String.format("获取钉钉用户异常,%s", personRest.getMsg())); throw new AppException(DING_AUTH_FAIL,String.format("获取钉钉用户异常,%s", personRest.getMsg()));
} }
log.info(personRest.getData()); userEntity = userService.doLogin(loginName, password, ip);
if (!ObjectUtils.isEmpty(loginForm.getCode())) { if (!ObjectUtils.isEmpty(loginForm.getCode())) {
//更新绑定钉钉 //更新绑定钉钉
userEntity.setDingUserId(loginForm.getCode()); userEntity.setDingUserId(loginForm.getCode());
......
...@@ -67,22 +67,10 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U ...@@ -67,22 +67,10 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
@Autowired @Autowired
private UserService userService; private UserService userService;
@Autowired @Autowired
private ValidCodeService validCodeService;
@Autowired
private ResourceService resourceService;
@Autowired
private MenuService menuService;
@Autowired
private ICacheService cacheService;
@Autowired
private IAuthTokenService authTokenService; private IAuthTokenService authTokenService;
@Autowired @Autowired
private StaffService staffService; private StaffService staffService;
@Autowired
private DeptService deptService;
@Autowired @Autowired
private IDingPersonService dingPersonService; private IDingPersonService dingPersonService;
...@@ -104,7 +92,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U ...@@ -104,7 +92,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
throw new AppException(String.format("获取钉钉用户异常,%s", personRest.getMsg())); throw new AppException(String.format("获取钉钉用户异常,%s", personRest.getMsg()));
} }
log.info(personRest.getData()); log.info(personRest.getData());
if (ObjectUtils.isEmpty(personRest.getData())) if (ObjectUtils.isEmpty(personRest.getData()))
throw new AppException(1012, "未找到响应的钉钉用户!"); throw new AppException(1012, "未找到响应的钉钉用户!");
//根据钉钉的用户查询系统绑定的用户,获取 //根据钉钉的用户查询系统绑定的用户,获取
...@@ -120,7 +107,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U ...@@ -120,7 +107,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
data.put("userType", userEntity.getUserType()); data.put("userType", userEntity.getUserType());
userEntity.setLoginTime(System.currentTimeMillis()); userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID()); userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime()); userEntity.setExpireTime(DateUtils.addCurrDate(1).getTime());
String token = authTokenService.createToken(userEntity); String token = authTokenService.createToken(userEntity);
data.put("token", token); data.put("token", token);
ret.put(KEY_RESULT_DATA, data); ret.put(KEY_RESULT_DATA, data);
......
...@@ -144,6 +144,8 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont ...@@ -144,6 +144,8 @@ public class AttendanceRecordErrorController extends BaseCRUDJsonBodyMappingCont
for (AttendanceRecordErrorEntity recordErrorEntity : entity.getRecordErrorEntities()) { for (AttendanceRecordErrorEntity recordErrorEntity : entity.getRecordErrorEntities()) {
AttendanceRecordErrorEntity updateEntity = new AttendanceRecordErrorEntity(); AttendanceRecordErrorEntity updateEntity = new AttendanceRecordErrorEntity();
updateEntity.setId(recordErrorEntity.getId()); updateEntity.setId(recordErrorEntity.getId());
updateEntity.setAttendanceGroupId(recordErrorEntity.getAttendanceGroupId());
updateEntity.setAttendanceGroupName(recordErrorEntity.getAttendanceGroupName());
updateEntity.setErrorDateTime(recordErrorEntity.getErrorDateTime()); updateEntity.setErrorDateTime(recordErrorEntity.getErrorDateTime());
updateEntity.setGoOffDateTime(recordErrorEntity.getGoOffDateTime()); updateEntity.setGoOffDateTime(recordErrorEntity.getGoOffDateTime());
updateEntity.setProcessStatus(entity.getProcessStatus()); updateEntity.setProcessStatus(entity.getProcessStatus());
......
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