Commit e7ff8e04 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents df85fb78 dc8707c7
...@@ -24,8 +24,13 @@ export default { ...@@ -24,8 +24,13 @@ export default {
delete this.query.year; delete this.query.year;
} }
if (this.query.createTimeMonth == undefined) { if (this.query.createTimeMonth == undefined) {
delete this.query.createTimeStart; if (this.query.createTimeStart1 || this.query.createTimeEnd1) {
delete this.query.createTimeEnd; this.query.createTimeEnd = this.query.createTimeEnd1;
this.query.createTimeStart = this.query.createTimeStart1;
} else {
delete this.query.createTimeStart;
delete this.query.createTimeEnd;
}
} }
this.getData(); this.getData();
}, },
...@@ -80,7 +85,7 @@ export default { ...@@ -80,7 +85,7 @@ export default {
return; return;
} }
this.tableData.loading = true; this.tableData.loading = true;
console.log(this.query);
this.$post(this.pageInfo.list, this.query, { this.$post(this.pageInfo.list, this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
}) })
......
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
v-if="item.type === 'date' && !item.valueFormat" v-if="item.type === 'date' && !item.valueFormat"
type="date" type="date"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
placeholder="选择日期" :placeholder="item.label ? item.label : '选择日期'"
> >
</el-date-picker> </el-date-picker>
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
v-if="item.type === 'date' && item.valueFormat" v-if="item.type === 'date' && item.valueFormat"
type="date" type="date"
:value-format="item.valueFormat" :value-format="item.valueFormat"
placeholder="选择日期" :placeholder="item.label ? item.label : '选择日期'"
> >
</el-date-picker> </el-date-picker>
...@@ -352,6 +352,9 @@ export default { ...@@ -352,6 +352,9 @@ export default {
if (this.form.createTimeMonth) { if (this.form.createTimeMonth) {
this.form.createTimeStart = this.form.createTimeMonth + "-01"; this.form.createTimeStart = this.form.createTimeMonth + "-01";
this.form.createTimeEnd = this.form.createTimeMonth + "-31"; this.form.createTimeEnd = this.form.createTimeMonth + "-31";
} else if (this.form.createTimeStart1 || this.form.createTimeEnd1) {
this.form.createTimeStart = this.form.createTimeStart1;
this.form.createTimeEnd = this.form.createTimeEnd1;
} else { } else {
this.form.createTimeStart = undefined; this.form.createTimeStart = undefined;
this.form.createTimeEnd = undefined; this.form.createTimeEnd = undefined;
...@@ -397,18 +400,24 @@ export default { ...@@ -397,18 +400,24 @@ export default {
let data = this.decode(params); let data = this.decode(params);
// Object.assign({}, query, data) // Object.assign({}, query, data)
console.log({
...query,
...data,
});
if (!query.yearmonth) { if (!query.yearmonth) {
query.year = undefined; query.year = undefined;
query.month = undefined; query.month = undefined;
} }
if (!query.createTimeMonth) { if (!query.createTimeMonth) {
query.createTimeEnd = undefined; if (query.createTimeStart1 || query.createTimeEnd1) {
query.createTimeStart = undefined; query.createTimeEnd = query.createTimeEnd1;
query.createTimeStart = query.createTimeStart1;
} else {
query.createTimeEnd = undefined;
query.createTimeStart = undefined;
}
} }
console.log({
...query,
...data,
});
this.$router.push({ this.$router.push({
path: path, path: path,
query: { query: {
......
...@@ -94,13 +94,13 @@ export default { ...@@ -94,13 +94,13 @@ export default {
label: "请假类型", label: "请假类型",
}, },
{ {
name: "createTimeStart", name: "createTimeStart1",
type: "date", type: "date",
label: "开始时间", label: "开始时间",
fuzzy: false, fuzzy: false,
}, },
{ {
name: "createTimeEnd", name: "createTimeEnd1",
type: "date", type: "date",
label: "结束时间", label: "结束时间",
fuzzy: false, fuzzy: false,
......
...@@ -121,6 +121,12 @@ ...@@ -121,6 +121,12 @@
</div> </div>
</div> </div>
</el-drawer> </el-drawer>
<div class="mask" v-if="progress">
<el-progress
:stroke-width="26"
:percentage="percent"
></el-progress>
</div>
</div> </div>
</template> </template>
...@@ -220,25 +226,26 @@ export default { ...@@ -220,25 +226,26 @@ export default {
}, },
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
if(this.isExport==true) { if (this.isExport == true) {
this.$message.info("考勤数据正在导出中,请勿重复点击!") this.$message.info("考勤数据正在导出中,请勿重复点击!");
return false; return false;
} }
this.isExport = true; this.isExport = true;
this.progress = true;
let params = {}; let params = {};
for (let value of this.config.search) { for (let value of this.config.search) {
if (this.query[value.name]) { if (this.query[value.name]) {
params[value.name] = this.query[value.name]; params[value.name] = this.query[value.name];
} }
} }
this.percent = 75;
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params["idList"] = this.selection;
} }
let that=this; let that = this;
this.$download( this.$download(
"/attendance/record/hik/exportExcel", "/attendance/record/hik/exportExcel",
{ {
...@@ -247,10 +254,13 @@ export default { ...@@ -247,10 +254,13 @@ export default {
{ type: "excel" } { type: "excel" }
) )
.then(() => { .then(() => {
console.log("isExport222:",this.isExport) this.percent = 100;
that.isExport = false}) this.progress = false;
that.isExport = false;
})
.catch((error) => { .catch((error) => {
this.isExport = false; this.isExport = false;
this.progress = false;
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, },
...@@ -273,7 +283,9 @@ export default { ...@@ -273,7 +283,9 @@ export default {
data() { data() {
return { return {
showBtn: false, showBtn: false,
isExport:false, progress: false,
isExport: false,
percent: 0,
upload: { upload: {
headers: { headers: {
Authorization: window.sessionStorage.getItem("token") || "", Authorization: window.sessionStorage.getItem("token") || "",
...@@ -373,6 +385,21 @@ export default { ...@@ -373,6 +385,21 @@ export default {
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.mask {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 99;
padding: 0 30%;
padding-top: 20%;
background: rgba(0, 0, 0, 0.6);
}
::v-deep .el-progress__text {
color: #409eff;
font-weight: 600;
}
.hisList { .hisList {
padding: 15px; padding: 15px;
.list { .list {
......
...@@ -179,6 +179,12 @@ ...@@ -179,6 +179,12 @@
<el-button @click="upload.open = false">取 消</el-button> <el-button @click="upload.open = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<div class="mask" v-if="progress">
<el-progress
:stroke-width="26"
:percentage="percent"
></el-progress>
</div>
</div> </div>
</template> </template>
...@@ -333,6 +339,7 @@ export default { ...@@ -333,6 +339,7 @@ export default {
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
this.isExport = true; this.isExport = true;
this.progress = true;
let params = {}; let params = {};
for (let value of this.config.search) { for (let value of this.config.search) {
if (this.query[value.name]) { if (this.query[value.name]) {
...@@ -342,6 +349,7 @@ export default { ...@@ -342,6 +349,7 @@ export default {
if (this.selection.length > 0) { if (this.selection.length > 0) {
params["idList"] = this.selection; params["idList"] = this.selection;
} }
this.percent = 70;
if (this.checkList.length > 0) { if (this.checkList.length > 0) {
params["properties"] = this.checkList; params["properties"] = this.checkList;
} }
...@@ -353,10 +361,14 @@ export default { ...@@ -353,10 +361,14 @@ export default {
{ type: "excel" } { type: "excel" }
) )
.then(() => { .then(() => {
this.percent = 100;
this.progress = false;
this.isExport = false; this.isExport = false;
this.checkList = []; this.checkList = [];
}) })
.catch((error) => { .catch((error) => {
this.progress = false;
this.isExport = false; this.isExport = false;
this.$message.error(error.message); this.$message.error(error.message);
}); });
...@@ -407,6 +419,8 @@ export default { ...@@ -407,6 +419,8 @@ export default {
}, },
data() { data() {
return { return {
progress: false,
percent: 0,
upload: { upload: {
// 是否显示弹出层(员工关怀信息导入) // 是否显示弹出层(员工关怀信息导入)
open: false, open: false,
...@@ -578,6 +592,21 @@ export default { ...@@ -578,6 +592,21 @@ export default {
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
.mask {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 99;
padding: 0 30%;
padding-top: 20%;
background: rgba(0, 0, 0, 0.6);
}
::v-deep .el-progress__text {
color: #409eff;
font-weight: 600;
}
.totalNum { .totalNum {
background: rgba(64, 158, 255, 0.2); background: rgba(64, 158, 255, 0.2);
padding: 15px; padding: 15px;
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
</LayoutTable> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <dialog-show ref="dialogform" @ok="getData" />
<div class="mask" v-if="progress">
<el-progress :stroke-width="26" :percentage="percent"></el-progress>
</div>
</div> </div>
</template> </template>
...@@ -27,10 +30,12 @@ export default { ...@@ -27,10 +30,12 @@ export default {
}, },
mixins: [table], mixins: [table],
created() {}, created() {},
methods: { methods: {
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
this.progress = true;
this.percent = 75;
this.isExport = true; this.isExport = true;
this.$download( this.$download(
"/staff/perform/summary/exportExcel", "/staff/perform/summary/exportExcel",
...@@ -40,9 +45,14 @@ export default { ...@@ -40,9 +45,14 @@ export default {
}, },
{ type: "excel" } { type: "excel" }
) )
.then(() => (this.isExport = false)) .then(() => {
this.percent = 100;
this.progress = false;
this.isExport = false;
})
.catch((error) => { .catch((error) => {
this.isExport = false; this.isExport = false;
this.progress = false;
this.$message.error(error.message); this.$message.error(error.message);
}); });
}, },
...@@ -62,6 +72,8 @@ export default { ...@@ -62,6 +72,8 @@ export default {
data() { data() {
return { return {
isExport: false, isExport: false,
progress: false,
percent: 0,
config: { config: {
isshowTabPane: true, isshowTabPane: true,
search: [ search: [
...@@ -167,3 +179,20 @@ export default { ...@@ -167,3 +179,20 @@ export default {
}, },
}; };
</script> </script>
<style lang="less" scoped>
.mask {
width: 100%;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: 99;
padding: 0 30%;
padding-top: 20%;
background: rgba(0, 0, 0, 0.6);
}
::v-deep .el-progress__text {
color: #409eff;
font-weight: 600;
}
</style>
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret> <profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
<profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey> <profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey>
<profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token> <profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token>
<profiles.dingtalk.opUserId>manager8325</profiles.dingtalk.opUserId> <profiles.dingtalk.opUserId>254868153920685466</profiles.dingtalk.opUserId>
<profiles.webUrl>http://8.136.255.30:11039/attendance</profiles.webUrl> <profiles.webUrl>http://8.136.255.30:11039/attendance</profiles.webUrl>
<package.environment>serve</package.environment> <package.environment>serve</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret> <profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
<profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey> <profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey>
<profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token> <profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token>
<profiles.dingtalk.opUserId>manager8325</profiles.dingtalk.opUserId> <profiles.dingtalk.opUserId>254868153920685466</profiles.dingtalk.opUserId>
<profiles.webUrl>http://8.136.255.30:11039/attendance</profiles.webUrl> <profiles.webUrl>http://8.136.255.30:11039/attendance</profiles.webUrl>
<package.environment>test</package.environment> <package.environment>test</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret> <profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
<profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey> <profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey>
<profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token> <profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token>
<profiles.dingtalk.opUserId>manager8325</profiles.dingtalk.opUserId> <profiles.dingtalk.opUserId>254868153920685466</profiles.dingtalk.opUserId>
<profiles.webUrl>http://8.136.255.30:21039/attendance</profiles.webUrl> <profiles.webUrl>http://8.136.255.30:21039/attendance</profiles.webUrl>
<package.environment>build</package.environment> <package.environment>build</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
<profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret> <profiles.dingtalk.appSecret>bF2WALmo5_Wuj3hg5gXeWqezrYnZChUJ88HjzNWpkA9ivdOxfBDGOGYcfVRfB3vd</profiles.dingtalk.appSecret>
<profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey> <profiles.dingtalk.aesKey>1QcPYuSpAc98OS3qQwwx5HPH85CZDidxF95yBGad2fJ</profiles.dingtalk.aesKey>
<profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token> <profiles.dingtalk.token>m3WeuVx5kcTY76kh22uWZOTSu0XjvcwNhd</profiles.dingtalk.token>
<profiles.dingtalk.opUserId>manager8325</profiles.dingtalk.opUserId> <profiles.dingtalk.opUserId>254868153920685466</profiles.dingtalk.opUserId>
<profiles.webUrl>https://ybswxxcx.zwfwhfgjjfzj.yibin.gov.cn/performance-h5</profiles.webUrl> <profiles.webUrl>https://ybswxxcx.zwfwhfgjjfzj.yibin.gov.cn/performance-h5</profiles.webUrl>
<package.environment>build</package.environment> <package.environment>build</package.environment>
<skipUi>false</skipUi> <skipUi>false</skipUi>
......
...@@ -123,22 +123,24 @@ public class DingMessageController { ...@@ -123,22 +123,24 @@ public class DingMessageController {
if(rest.getCode() == Rest.SUCCESS){ if(rest.getCode() == Rest.SUCCESS){
GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResult result = rest.getData(); GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResult result = rest.getData();
log.info("审批详情:"+JSONObject.toJSONString(result) ); log.info("审批详情:"+JSONObject.toJSONString(result) );
AttendanceLeaveRecordEntity leaveRecordEntity = new AttendanceLeaveRecordEntity();
leaveRecordEntity.initAttrValue(); if(result.getTitle().contains("请假")){ //只处理请假的审批单
leaveRecordEntity.setRemark(processInstanceId); //将钉钉的事物id作为备注填入数据库 AttendanceLeaveRecordEntity leaveRecordEntity = new AttendanceLeaveRecordEntity();
Rest<String> mobileRest = dingPersonService.getPersonById(result.getOriginatorUserId()); leaveRecordEntity.initAttrValue();
if(mobileRest.getCode() == Rest.SUCCESS) { leaveRecordEntity.setRemark(processInstanceId); //将钉钉的事物id作为备注填入数据库
String mobile = mobileRest.getData();
StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(mobile));
if(!ObjectUtils.isEmpty(staffEntity)){
leaveRecordEntity.setLeavePersonId(staffEntity.getId()); Rest<String> mobileRest = dingPersonService.getPersonById(result.getOriginatorUserId());
leaveRecordEntity.setLeavePerson(staffEntity.getName()); if(mobileRest.getCode() == Rest.SUCCESS) {
leaveRecordEntity.setDeptId(staffEntity.getDeptId()); String mobile = mobileRest.getData();
leaveRecordEntity.setDeptName(staffEntity.getDeptName()); StaffEntity staffEntity = staffService.selectOne(new StaffQuery().phoneNumber(mobile));
leaveRecordEntity.setPhoneNumber(staffEntity.getPhoneNumber()); if(!ObjectUtils.isEmpty(staffEntity)){
leaveRecordEntity.setLeavePersonId(staffEntity.getId());
leaveRecordEntity.setLeavePerson(staffEntity.getName());
leaveRecordEntity.setDeptId(staffEntity.getDeptId());
leaveRecordEntity.setDeptName(staffEntity.getDeptName());
leaveRecordEntity.setPhoneNumber(staffEntity.getPhoneNumber());
...@@ -153,137 +155,137 @@ public class DingMessageController { ...@@ -153,137 +155,137 @@ public class DingMessageController {
// } // }
// } // }
String leave_code = LeaveRulesEnum.事假.getLeave_code(); String leave_code = LeaveRulesEnum.事假.getLeave_code();
String leave_name = "事假"; String leave_name = "事假";
if(result.getFormComponentValues().size() > 0 ){ if(result.getFormComponentValues().size() > 0 ){
JSONArray jsonArray = JSONArray.parseArray(result.getFormComponentValues().get(0).getValue()); JSONArray jsonArray = JSONArray.parseArray(result.getFormComponentValues().get(0).getValue());
if(jsonArray!= null && jsonArray.size() > 0){ if(jsonArray!= null && jsonArray.size() > 0){
Date startTime1 = dateFormat(jsonArray.get(0).toString(),"yyyy-MM-dd HH:mm",true); Date startTime1 = dateFormat(jsonArray.get(0).toString(),"yyyy-MM-dd HH:mm",true);
leaveRecordEntity.setStartTime(startTime1); leaveRecordEntity.setStartTime(startTime1);
} }
if(jsonArray!= null && jsonArray.size() > 1){ if(jsonArray!= null && jsonArray.size() > 1){
Date endTime1 = dateFormat(jsonArray.get(1).toString(),"yyyy-MM-dd HH:mm",false); Date endTime1 = dateFormat(jsonArray.get(1).toString(),"yyyy-MM-dd HH:mm",false);
leaveRecordEntity.setEndTime(endTime1); leaveRecordEntity.setEndTime(endTime1);
} }
if(jsonArray!= null && jsonArray.size() > 2){ if(jsonArray!= null && jsonArray.size() > 2){
if(jsonArray.size() > 3){ if(jsonArray.size() > 3){
switch (jsonArray.get(3).toString()){ switch (jsonArray.get(3).toString()){
case "halfDay": case "halfDay":
case "day": case "day":
leaveRecordEntity.setDuration((int) (Float.parseFloat(jsonArray.get(2).toString())*60*60*8)); //天转换成秒 一天工作时间9小时 leaveRecordEntity.setDuration((int) (Float.parseFloat(jsonArray.get(2).toString())*60*60*8)); //天转换成秒 一天工作时间9小时
leaveRecordEntity.setSourceDingTime(jsonArray.get(2).toString()+"天"); leaveRecordEntity.setSourceDingTime(jsonArray.get(2).toString()+"天");
break; break;
default: //除了按天和半天计算的假期 其余都是按小时返回 default: //除了按天和半天计算的假期 其余都是按小时返回
leaveRecordEntity.setDuration((int) (Float.parseFloat(jsonArray.get(2).toString())*60*60)); //小时转换成秒 leaveRecordEntity.setDuration((int) (Float.parseFloat(jsonArray.get(2).toString())*60*60)); //小时转换成秒
leaveRecordEntity.setSourceDingTime(jsonArray.get(2).toString()+"小时"); leaveRecordEntity.setSourceDingTime(jsonArray.get(2).toString()+"小时");
break; break;
}
} }
} }
if(jsonArray!= null && jsonArray.size() > 4){
leave_name = jsonArray.get(4).toString();
switch (leave_name){
case "调休":
leaveRecordEntity.setLeaveType(2);
leave_code = LeaveRulesEnum.调休.getLeave_code();
break;
case "病假":
leaveRecordEntity.setLeaveType(3);
leave_code = LeaveRulesEnum.病假.getLeave_code();
break;
case "年假":
leaveRecordEntity.setLeaveType(4);
leave_code = LeaveRulesEnum.年假.getLeave_code();
break;
case "产假":
leaveRecordEntity.setLeaveType(5);
leave_code = LeaveRulesEnum.产假.getLeave_code();
break;
case "陪产假":
leaveRecordEntity.setLeaveType(6);
leave_code = LeaveRulesEnum.陪产假.getLeave_code();
break;
case "婚假":
leaveRecordEntity.setLeaveType(7);
leave_code = LeaveRulesEnum.婚假.getLeave_code();
break;
case "例假":
leaveRecordEntity.setLeaveType(8);
leave_code = LeaveRulesEnum.例假.getLeave_code();
break;
case "哺乳假":
leaveRecordEntity.setLeaveType(9);
leave_code = LeaveRulesEnum.哺乳假.getLeave_code();
break;
case "丧假":
leaveRecordEntity.setLeaveType(10);
leave_code = LeaveRulesEnum.丧假.getLeave_code();
break;
case "回单位":
leaveRecordEntity.setLeaveType(11);
break;
case "因公请假":
leaveRecordEntity.setLeaveType(12);
break;
case "外出勘验":
leaveRecordEntity.setLeaveType(13);
break;
case "值班补班":
leaveRecordEntity.setLeaveType(14);
break;
case "体检":
leaveRecordEntity.setLeaveType(15);
break;
case "隔离":
leaveRecordEntity.setLeaveType(16);
break;
case "因公外出":
leaveRecordEntity.setLeaveType(17);
break;
case "公休":
leaveRecordEntity.setLeaveType(18);
break;
case "育儿假":
leaveRecordEntity.setLeaveType(19);
break;
case "调回单位":
leaveRecordEntity.setLeaveType(20);
break;
case "探亲假":
leaveRecordEntity.setLeaveType(21);
leave_code = LeaveRulesEnum.探亲假.getLeave_code();
break;
default:
leaveRecordEntity.setLeaveType(1); //默认事假
leave_code = LeaveRulesEnum.事假.getLeave_code();
break;
} }
if(jsonArray!= null && jsonArray.size() > 4){
leave_name = jsonArray.get(4).toString();
switch (leave_name){
case "调休":
leaveRecordEntity.setLeaveType(2);
leave_code = LeaveRulesEnum.调休.getLeave_code();
break;
case "病假":
leaveRecordEntity.setLeaveType(3);
leave_code = LeaveRulesEnum.病假.getLeave_code();
break;
case "年假":
leaveRecordEntity.setLeaveType(4);
leave_code = LeaveRulesEnum.年假.getLeave_code();
break;
case "产假":
leaveRecordEntity.setLeaveType(5);
leave_code = LeaveRulesEnum.产假.getLeave_code();
break;
case "陪产假":
leaveRecordEntity.setLeaveType(6);
leave_code = LeaveRulesEnum.陪产假.getLeave_code();
break;
case "婚假":
leaveRecordEntity.setLeaveType(7);
leave_code = LeaveRulesEnum.婚假.getLeave_code();
break;
case "例假":
leaveRecordEntity.setLeaveType(8);
leave_code = LeaveRulesEnum.例假.getLeave_code();
break;
case "哺乳假":
leaveRecordEntity.setLeaveType(9);
leave_code = LeaveRulesEnum.哺乳假.getLeave_code();
break;
case "丧假":
leaveRecordEntity.setLeaveType(10);
leave_code = LeaveRulesEnum.丧假.getLeave_code();
break;
case "回单位":
leaveRecordEntity.setLeaveType(11);
break;
case "因公请假":
leaveRecordEntity.setLeaveType(12);
break;
case "外出勘验":
leaveRecordEntity.setLeaveType(13);
break;
case "值班补班":
leaveRecordEntity.setLeaveType(14);
break;
case "体检":
leaveRecordEntity.setLeaveType(15);
break;
case "隔离":
leaveRecordEntity.setLeaveType(16);
break;
case "因公外出":
leaveRecordEntity.setLeaveType(17);
break;
case "公休":
leaveRecordEntity.setLeaveType(18);
break;
case "育儿假":
leaveRecordEntity.setLeaveType(19);
break;
case "调回单位":
leaveRecordEntity.setLeaveType(20);
break;
case "探亲假":
leaveRecordEntity.setLeaveType(21);
leave_code = LeaveRulesEnum.探亲假.getLeave_code();
break;
default:
leaveRecordEntity.setLeaveType(1); //默认事假
leave_code = LeaveRulesEnum.事假.getLeave_code();
break;
} }
} else if (result.getFormComponentValues().size() > 1) { //请假理由
GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResultFormComponentValues resonEntity = result.getFormComponentValues().get(1);
leaveRecordEntity.setReason(resonEntity.getValue());
}else if (result.getFormComponentValues().size() > 2) { //上传的附件
GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResultFormComponentValues picEntity = result.getFormComponentValues().get(2);
if(picEntity.getName().equals("图片") && picEntity.getValue() != null){
leaveRecordEntity.setAttachmentPath(picEntity.getValue());
}
} }
} else if (result.getFormComponentValues().size() > 1) { //请假理由
GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResultFormComponentValues resonEntity = result.getFormComponentValues().get(1);
leaveRecordEntity.setReason(resonEntity.getValue());
}else if (result.getFormComponentValues().size() > 2) { //上传的附件
GetProcessInstanceResponseBody.GetProcessInstanceResponseBodyResultFormComponentValues picEntity = result.getFormComponentValues().get(2);
if(picEntity.getName().equals("图片") && picEntity.getValue() != null){
leaveRecordEntity.setAttachmentPath(picEntity.getValue());
}
}
if(result.getStatus().compareToIgnoreCase("NEW") == 0 || result.getStatus().compareToIgnoreCase("RUNNING") == 0){ if(result.getStatus().compareToIgnoreCase("NEW") == 0 || result.getStatus().compareToIgnoreCase("RUNNING") == 0){
leaveRecordEntity.setProcessStatus(1); leaveRecordEntity.setProcessStatus(1);
}else if(result.getStatus().compareToIgnoreCase("COMPLETED") == 0 || result.getStatus().compareToIgnoreCase("CANCELED") == 0 }else if(result.getStatus().compareToIgnoreCase("COMPLETED") == 0 || result.getStatus().compareToIgnoreCase("CANCELED") == 0
|| result.getStatus().compareToIgnoreCase("TERMINATED") == 0){ || result.getStatus().compareToIgnoreCase("TERMINATED") == 0){
leaveRecordEntity.setProcessStatus(2); leaveRecordEntity.setProcessStatus(2);
} }
if(result.getResult().compareToIgnoreCase("AGREE") == 0){ if(result.getResult().compareToIgnoreCase("AGREE") == 0){
// if(result.getTasks().size() > 1){ // if(result.getTasks().size() > 1){
// if(result.getTasks().get(1).getStatus().compareToIgnoreCase("CANCELED") == 0){ // if(result.getTasks().get(1).getStatus().compareToIgnoreCase("CANCELED") == 0){
// leaveRecordEntity.setAuditResult(4); //撤销审批完成 // leaveRecordEntity.setAuditResult(4); //撤销审批完成
...@@ -291,60 +293,60 @@ public class DingMessageController { ...@@ -291,60 +293,60 @@ public class DingMessageController {
// leaveRecordEntity.setAuditResult(1); // leaveRecordEntity.setAuditResult(1);
// } // }
// } // }
leaveRecordEntity.setAuditResult(AppealResultEnum.通过.getValue()); leaveRecordEntity.setAuditResult(AppealResultEnum.通过.getValue());
} }
else if(result.equals("")){ //撤销假期审批中result会为空 撤销审批通过后result为AGREE else if(result.equals("")){ //撤销假期审批中result会为空 撤销审批通过后result为AGREE
if(result.getTasks().size() > 1){ if(result.getTasks().size() > 1){
log.info("status"+result.getTasks().get(1).getStatus()); log.info("status"+result.getTasks().get(1).getStatus());
if(result.getTasks().get(1).getStatus().compareToIgnoreCase("CANCELED") != 0){ if(result.getTasks().get(1).getStatus().compareToIgnoreCase("CANCELED") != 0){
leaveRecordEntity.setAuditResult(AppealResultEnum.撤销审批中.getValue()); //撤销审批中 leaveRecordEntity.setAuditResult(AppealResultEnum.撤销审批中.getValue()); //撤销审批中
}
} }
} }
} else {
else { leaveRecordEntity.setAuditResult(AppealResultEnum.审核中.getValue()); //请假审批中
leaveRecordEntity.setAuditResult(AppealResultEnum.审核中.getValue()); //请假审批中 }
}
log.info("钉钉返回的result:"+result.getResult()+"---auditresult:"+leaveRecordEntity.getAuditResult()); log.info("钉钉返回的result:"+result.getResult()+"---auditresult:"+leaveRecordEntity.getAuditResult());
leaveRecordEntity.setAuditDesc(result.getOperationRecords().get(0).getRemark()); leaveRecordEntity.setAuditDesc(result.getOperationRecords().get(0).getRemark());
leaveRecordEntity.setReason(result.getOperationRecords().get(0).getRemark()); leaveRecordEntity.setReason(result.getOperationRecords().get(0).getRemark());
//更新请假记录表 //更新请假记录表
AttendanceLeaveRecordEntity recordEntity = attendanceLeaveRecordService.selectOne(new AttendanceLeaveRecordQuery().remark(processInstanceId)); AttendanceLeaveRecordEntity recordEntity = attendanceLeaveRecordService.selectOne(new AttendanceLeaveRecordQuery().remark(processInstanceId));
if(ObjectUtils.isEmpty(recordEntity)){ if(ObjectUtils.isEmpty(recordEntity)){
leaveRecordEntity.setCreateTime(new Date()); leaveRecordEntity.setCreateTime(new Date());
leaveRecordEntity.setCreateUserId(1L); leaveRecordEntity.setCreateUserId(1L);
attendanceLeaveRecordService.save(leaveRecordEntity); attendanceLeaveRecordService.save(leaveRecordEntity);
}else{ }else{
leaveRecordEntity.setId(recordEntity.getId()); leaveRecordEntity.setId(recordEntity.getId());
leaveRecordEntity.setUpdateUserId(1L); leaveRecordEntity.setUpdateUserId(1L);
leaveRecordEntity.setUpdateTime(new Date()); leaveRecordEntity.setUpdateTime(new Date());
attendanceLeaveRecordService.update(leaveRecordEntity); attendanceLeaveRecordService.update(leaveRecordEntity);
} }
//假期余额 //假期余额
AttendanceVacationBalanceEntity attendanceVacationBalanceEntity = new AttendanceVacationBalanceEntity(); AttendanceVacationBalanceEntity attendanceVacationBalanceEntity = new AttendanceVacationBalanceEntity();
//查询假期余额 //查询假期余额
Rest<OapiAttendanceVacationQuotaListResponse.OapiLeaveQuotaUserListVo> leaveRecordsResponseBodyResultRest = Rest<OapiAttendanceVacationQuotaListResponse.OapiLeaveQuotaUserListVo> leaveRecordsResponseBodyResultRest =
dingPersonService.getLeaveRecordByUserId(result.getOriginatorUserId(),leave_code); dingPersonService.getLeaveRecordByUserId(result.getOriginatorUserId(),leave_code);
AttendanceVacationBalanceEntity balanceEntity = balanceService.selectOne(new AttendanceVacationBalanceQuery().staffId(staffEntity.getId())); AttendanceVacationBalanceEntity balanceEntity = balanceService.selectOne(new AttendanceVacationBalanceQuery().staffId(staffEntity.getId()));
if(ObjectUtils.isEmpty(balanceEntity)){ //先判断数据库里没有这个人的请假记录就初始化对象 if(ObjectUtils.isEmpty(balanceEntity)){ //先判断数据库里没有这个人的请假记录就初始化对象
attendanceVacationBalanceEntity.initAttrValue(); attendanceVacationBalanceEntity.initAttrValue();
} }
attendanceVacationBalanceEntity.setRemark(processInstanceId); // 将钉钉的事物id存入假期余额 用于判断是否为同一条请假数据 attendanceVacationBalanceEntity.setRemark(processInstanceId); // 将钉钉的事物id存入假期余额 用于判断是否为同一条请假数据
attendanceVacationBalanceEntity.setStaffId(staffEntity.getId()); attendanceVacationBalanceEntity.setStaffId(staffEntity.getId());
attendanceVacationBalanceEntity.setStaffName(staffEntity.getName()); attendanceVacationBalanceEntity.setStaffName(staffEntity.getName());
attendanceVacationBalanceEntity.setDeptId(staffEntity.getDeptId()); attendanceVacationBalanceEntity.setDeptId(staffEntity.getDeptId());
attendanceVacationBalanceEntity.setDeptName(staffEntity.getDeptName()); attendanceVacationBalanceEntity.setDeptName(staffEntity.getDeptName());
attendanceVacationBalanceEntity.setEntryTime(staffEntity.getEntryDate()); attendanceVacationBalanceEntity.setEntryTime(staffEntity.getEntryDate());
if(leaveRecordsResponseBodyResultRest.getCode() == Rest.SUCCESS){ if(leaveRecordsResponseBodyResultRest.getCode() == Rest.SUCCESS){
OapiAttendanceVacationQuotaListResponse.OapiLeaveQuotaUserListVo result1 = leaveRecordsResponseBodyResultRest.getData(); OapiAttendanceVacationQuotaListResponse.OapiLeaveQuotaUserListVo result1 = leaveRecordsResponseBodyResultRest.getData();
double leaveBlance = 0; double leaveBlance = 0;
// //如果钉钉有假期余额就写入钉钉返回的余额 否则用数据库表数据减去当前请假的天数 // //如果钉钉有假期余额就写入钉钉返回的余额 否则用数据库表数据减去当前请假的天数
// if(result1.getLeaveQuotas() != null && result1.getLeaveQuotas().size() > 0){ // if(result1.getLeaveQuotas() != null && result1.getLeaveQuotas().size() > 0){
// if(leaveRecordEntity.getAuditResult() == 4) { //撤销休假 要把已经扣除的假期加回来 // if(leaveRecordEntity.getAuditResult() == 4) { //撤销休假 要把已经扣除的假期加回来
...@@ -362,250 +364,251 @@ public class DingMessageController { ...@@ -362,250 +364,251 @@ public class DingMessageController {
// } // }
// } // }
switch (leave_name) { switch (leave_name) {
case "调休": case "调休":
if(leaveBlance == 0){ if(leaveBlance == 0){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getCompensatedLeaveDays() != null){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getCompensatedLeaveDays() != null){
leaveBlance = balanceEntity.getCompensatedLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); leaveBlance = balanceEntity.getCompensatedLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
}else { }else {
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
}
} }
} attendanceVacationBalanceEntity.setCompensatedLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setCompensatedLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "病假":
case "病假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getSickLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getSickLeaveDays() != null){ leaveBlance = balanceEntity.getSickLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getSickLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setSickLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setSickLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "年假":
case "年假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getAnnualLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getAnnualLeaveDays() != null){ leaveBlance = balanceEntity.getAnnualLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getAnnualLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setAnnualLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setAnnualLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "产假":
case "产假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getMaternityLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getMaternityLeaveDays() != null){ leaveBlance = balanceEntity.getMaternityLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getMaternityLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setMaternityLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setMaternityLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "陪产假":
case "陪产假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getPaternityLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getPaternityLeaveDays() != null){ leaveBlance = balanceEntity.getPaternityLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getPaternityLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setPaternityLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setPaternityLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "婚假":
case "婚假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getMarriageLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getMarriageLeaveDays() != null){ leaveBlance = balanceEntity.getMarriageLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getMarriageLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setMarriageLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setMarriageLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "例假":
case "例假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getMenstrualLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getMenstrualLeaveDays() != null){ leaveBlance = balanceEntity.getMenstrualLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getMenstrualLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setMenstrualLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setMenstrualLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "哺乳假":
case "哺乳假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getBreastfeedingLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getBreastfeedingLeaveDays() != null){ leaveBlance = balanceEntity.getBreastfeedingLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getBreastfeedingLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setBreastfeedingLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setBreastfeedingLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "丧假":
case "丧假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getBereavementLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getBereavementLeaveDays() != null){ leaveBlance = balanceEntity.getBereavementLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getBereavementLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setBereavementLeaveDays(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setBereavementLeaveDays(BigDecimal.valueOf(leaveBlance)); break;
break; case "回单位":
case "回单位": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getBackToUnit() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getBackToUnit() != null){ leaveBlance = balanceEntity.getBackToUnit().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getBackToUnit().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setBackToUnit(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setBackToUnit(BigDecimal.valueOf(leaveBlance)); break;
break; case "因公请假":
case "因公请假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getOnDutyLeave() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getOnDutyLeave() != null){ leaveBlance = balanceEntity.getOnDutyLeave().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getOnDutyLeave().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setOnDutyLeave(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setOnDutyLeave(BigDecimal.valueOf(leaveBlance)); break;
break; case "外出勘验":
case "外出勘验": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getOutOfOffice() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getOutOfOffice() != null){ leaveBlance = balanceEntity.getOutOfOffice().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getOutOfOffice().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setOutOfOffice(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setOutOfOffice(BigDecimal.valueOf(leaveBlance)); break;
break; case "值班补班":
case "值班补班": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getShiftCompensation() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getShiftCompensation() != null){ leaveBlance = balanceEntity.getShiftCompensation().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getShiftCompensation().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setShiftCompensation(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setShiftCompensation(BigDecimal.valueOf(leaveBlance)); break;
break; case "体检":
case "体检": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getPhysicalExamination() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getPhysicalExamination() != null){ leaveBlance = balanceEntity.getPhysicalExamination().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getPhysicalExamination().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setPhysicalExamination(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setPhysicalExamination(BigDecimal.valueOf(leaveBlance)); break;
break; case "隔离":
case "隔离": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getQuarantine() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getQuarantine() != null){ leaveBlance = balanceEntity.getQuarantine().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getQuarantine().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setQuarantine(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setQuarantine(BigDecimal.valueOf(leaveBlance)); break;
break; case "因公外出":
case "因公外出": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getBusinessTrip() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getBusinessTrip() != null){ leaveBlance = balanceEntity.getBusinessTrip().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getBusinessTrip().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setBusinessTrip(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setBusinessTrip(BigDecimal.valueOf(leaveBlance)); break;
break; case "公休":
case "公休": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getPublicHoliday() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getPublicHoliday() != null){ leaveBlance = balanceEntity.getPublicHoliday().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getPublicHoliday().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setPublicHoliday(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setPublicHoliday(BigDecimal.valueOf(leaveBlance)); break;
break; case "育儿假":
case "育儿假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getChildRearingLeave() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getChildRearingLeave() != null){ leaveBlance = balanceEntity.getChildRearingLeave().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getChildRearingLeave().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setChildRearingLeave(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setChildRearingLeave(BigDecimal.valueOf(leaveBlance)); break;
break; case "调回单位":
case "调回单位": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getTransferBack() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getTransferBack() != null){ leaveBlance = balanceEntity.getTransferBack().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getTransferBack().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setTransferBack(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setTransferBack(BigDecimal.valueOf(leaveBlance)); break;
break; case "探亲假":
case "探亲假": if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getHomeLeave() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getHomeLeave() != null){ leaveBlance = balanceEntity.getHomeLeave().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getHomeLeave().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setHomeLeave(BigDecimal.valueOf(leaveBlance));
attendanceVacationBalanceEntity.setHomeLeave(BigDecimal.valueOf(leaveBlance)); break;
break; default:
default: if(leaveBlance == 0){
if(leaveBlance == 0){ if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getPersonalLeaveDays() != null){
if(!ObjectUtils.isEmpty(balanceEntity) && balanceEntity.getPersonalLeaveDays() != null){ leaveBlance = balanceEntity.getPersonalLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration());
leaveBlance = balanceEntity.getPersonalLeaveDays().floatValue() - converMillsToDays(leaveRecordEntity.getDuration()); }else {
}else { leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天
leaveBlance = - converMillsToDays(leaveRecordEntity.getDuration()); //秒转换为天 }
} }
} attendanceVacationBalanceEntity.setPersonalLeaveDays(BigDecimal.valueOf(leaveBlance)); //默认事假
attendanceVacationBalanceEntity.setPersonalLeaveDays(BigDecimal.valueOf(leaveBlance)); //默认事假 break;
break; }
} }
}
//审批状态为同意过后再修改假期余额 //审批状态为同意过后再修改假期余额
if(result.getResult().compareToIgnoreCase("AGREE") == 0){ if(result.getResult().compareToIgnoreCase("AGREE") == 0){
AttendanceVacationBalanceEntity entity = balanceService.selectOne(new AttendanceVacationBalanceQuery().remark(processInstanceId)); AttendanceVacationBalanceEntity entity = balanceService.selectOne(new AttendanceVacationBalanceQuery().remark(processInstanceId));
if(ObjectUtils.isEmpty(entity)){ //当表中没有这条processInstanceId关联的数据表示没有扣除假期(钉钉会推送两条余额数据过来 需要加这个判断) if(ObjectUtils.isEmpty(entity)){ //当表中没有这条processInstanceId关联的数据表示没有扣除假期(钉钉会推送两条余额数据过来 需要加这个判断)
//更新假期余额表 //更新假期余额表
if(ObjectUtils.isEmpty(balanceEntity)){ if(ObjectUtils.isEmpty(balanceEntity)){
attendanceVacationBalanceEntity.setCreateUserId(1L); attendanceVacationBalanceEntity.setCreateUserId(1L);
attendanceVacationBalanceEntity.setCreateTime(new Date()); attendanceVacationBalanceEntity.setCreateTime(new Date());
balanceService.save(attendanceVacationBalanceEntity); balanceService.save(attendanceVacationBalanceEntity);
}else{ }else{
//更新对象必须传入id //更新对象必须传入id
attendanceVacationBalanceEntity.setId(balanceEntity.getId()); attendanceVacationBalanceEntity.setId(balanceEntity.getId());
attendanceVacationBalanceEntity.setUpdateUserId(1L); attendanceVacationBalanceEntity.setUpdateUserId(1L);
attendanceVacationBalanceEntity.setUpdateTime(new Date()); attendanceVacationBalanceEntity.setUpdateTime(new Date());
balanceService.update(attendanceVacationBalanceEntity); balanceService.update(attendanceVacationBalanceEntity);
}
} }
} }
}
}else {
log.info("该号码("+mobile +")未在本系统绑定");
}
}else { }else {
log.info("该号码("+mobile +")未在本系统绑定"); log.info("根据id在钉钉平台查询电话失败"+mobileRest.getMsg());
} }
}else {
log.info("根据id在钉钉平台查询电话失败"+mobileRest.getMsg());
} }
......
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