Commit 3a44e978 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents b61cd627 28511dae
......@@ -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;
},
......
......@@ -4,44 +4,139 @@
:title="title"
:visible.sync="open"
:direction="direction"
size="50%">
size="50%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<Field label="员工姓名" prop="staffName" v-model="form.staffName" placeholder="请输入员工姓名"/>
<Field label="性别" prop="gender" v-model="form.gender" type="select" :enumData="dict.gender" placeholder="请选择性别"/>
<Field label="出生日期" prop="birthday" v-model="form.birthday" type="date" />
<Field label="照片" prop="photoPath" v-model="form.photoPath" type="textarea" placeholder="请输入照片"/>
<Field label="联系电话" prop="phoneNumber" v-model="form.phoneNumber" placeholder="请输入联系电话"/>
<Field label="身份证号码" prop="idCard" v-model="form.idCard" placeholder="请输入身份证号码"/>
<Field label="工号" prop="workNum" v-model="form.workNum" placeholder="请输入工号"/>
<Field label="政治面貌 " prop="politicalstatus" v-model="form.politicalstatus" type="select" :enumData="dict.politicalstatus" placeholder="请选择政治面貌 "/>
<Field label="所属部门" prop="deptId" v-model="form.deptId" :enumData="dict.deptId" placeholder="请输入所属部门"/>
<Field label="职位ID" prop="jobId" v-model="form.jobId" :enumData="dict.jobId" placeholder="请输入职位ID"/>
<Field label="员工类型" prop="staffType" v-model="form.staffType" type="select" :enumData="dict.staffType" placeholder="请选择员工类型"/>
<Field label="员工状态" prop="status" v-model="form.status" type="select" :enumData="dict.status" placeholder="请选择员工状态"/>
<Field label="入职时间" prop="entryDate" v-model="form.entryDate" type="date" />
<Field label="离职时间" prop="leaveDate" v-model="form.leaveDate" type="date" />
<Field label="离职原因" prop="leaveReason" v-model="form.leaveReason" type="textarea" placeholder="请输入离职原因"/>
<Field label="审核状态" prop="auditStatus" v-model="form.auditStatus" type="select" :enumData="dict.auditStatus" placeholder="请选择审核状态"/>
<Field
label="员工姓名"
prop="staffName"
v-model="form.staffName"
placeholder="请输入员工姓名"
/>
<Field
label="性别"
prop="gender"
v-model="form.gender"
type="select"
:enumData="dict.gender"
placeholder="请选择性别"
/>
<Field
label="出生日期"
prop="birthday"
v-model="form.birthday"
type="date"
/>
<Field
label="照片"
prop="photoPath"
v-model="form.photoPath"
type="textarea"
placeholder="请输入照片"
/>
<Field
label="联系电话"
prop="phoneNumber"
v-model="form.phoneNumber"
placeholder="请输入联系电话"
/>
<Field
label="身份证号码"
prop="idCard"
v-model="form.idCard"
placeholder="请输入身份证号码"
/>
<Field
label="工号"
prop="workNum"
v-model="form.workNum"
placeholder="请输入工号"
/>
<Field
label="政治面貌 "
prop="politicalstatus"
v-model="form.politicalstatus"
type="select"
:enumData="dict.politicalstatus"
placeholder="请选择政治面貌 "
/>
<Field
label="所属部门"
prop="deptId"
v-model="form.deptId"
:enumData="dict.deptId"
placeholder="请输入所属部门"
/>
<Field
label="职位ID"
prop="jobId"
v-model="form.jobId"
:enumData="dict.jobId"
placeholder="请输入职位ID"
/>
<Field
label="员工类型"
prop="staffType"
v-model="form.staffType"
type="select"
:enumData="dict.staffType"
placeholder="请选择员工类型"
/>
<Field
label="员工状态"
prop="status"
v-model="form.status"
type="select"
:enumData="dict.status"
placeholder="请选择员工状态"
/>
<Field
label="入职时间"
prop="entryDate"
v-model="form.entryDate"
type="date"
/>
<Field
label="离职时间"
prop="leaveDate"
v-model="form.leaveDate"
type="date"
/>
<Field
label="离职原因"
prop="leaveReason"
v-model="form.leaveReason"
type="textarea"
placeholder="请输入离职原因"
/>
<Field
label="审核状态"
prop="auditStatus"
v-model="form.auditStatus"
type="select"
:enumData="dict.auditStatus"
placeholder="请选择审核状态"
/>
</el-row>
<form-buttons @submit='submitForm' noCancelBtn />
<form-buttons
@submit="submitForm"
noCancelBtn
v-if="(title == '修改员工离职信息')"
/>
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
export default {
import form from "@/assets/mixins/formdialog";
export default {
name: "StaffLeaveDetail",
mixins: [form],
components: {
},
components: {},
created() {
this.changePath("staff/leave")
this.changePath("staff/leave");
},
data() {
return {
......@@ -51,57 +146,51 @@
title: "员工离职信息",
// 是否显示弹出层
open: false,
direction:"rtl",
toString:[
direction: "rtl",
toString: [
"gender",
"politicalstatus",
"staffType",
"status",
"auditStatus",
],
toDate:[
"birthday",
"entryDate",
"leaveDate",
],
toDate: ["birthday", "entryDate", "leaveDate"],
// 表单校验
rules: {
staffName: [
{required: true,message: "请输入员工姓名", trigger: "blur" },
{max: 64,message: "最多只能录入64个字符",trigger: "blur",},
{ required: true, message: "请输入员工姓名", trigger: "blur" },
{ max: 64, message: "最多只能录入64个字符", trigger: "blur" },
],
createTime: [
{required: true,message: "请选择创建时间" },
],
}
createTime: [{ required: true, message: "请选择创建时间" }],
},
};
},
methods: {
/** 编辑 */
edit(row) {
this.reset()
this.reset();
this.query = { id: row.id };
this.urls.currUrl ="staff/leave/edit";
this.urls.currUrl = "staff/leave/edit";
this.getData();
this.pageInfo.type="edit"
this.pageInfo.type = "edit";
this.title = "修改员工离职信息";
},
/** 新增 */
add(row) {
this.reset()
this.reset();
this.urls.currUrl = "staff/leave/add";
this.getData();
this.pageInfo.type="add"
this.pageInfo.type = "add";
this.title = "新增员工离职信息";
},
/** 查看*/
view(row) {
this.reset()
this.reset();
this.query = { id: row.id };
this.urls.currUrl ="staff/leave/view";
this.urls.currUrl = "staff/leave/view";
this.getData();
this.pageInfo.type="view"
this.pageInfo.type = "view";
this.title = "员工离职信息详细";
},
/**取消按钮 */
......@@ -121,25 +210,25 @@
// 表单重置
reset() {
this.form = {
staffId : null,
staffName : "",
gender : 1,
birthday : null,
photoPath : "",
phoneNumber : "",
idCard : "",
workNum : "",
politicalstatus : 1,
deptId : null,
deptName : "",
jobId : null,
jobName : "",
staffType : 1,
status : 1,
entryDate : null,
leaveDate : null,
leaveReason : "",
auditStatus : 0,
staffId: null,
staffName: "",
gender: 1,
birthday: null,
photoPath: "",
phoneNumber: "",
idCard: "",
workNum: "",
politicalstatus: 1,
deptId: null,
deptName: "",
jobId: null,
jobName: "",
staffType: 1,
status: 1,
entryDate: null,
leaveDate: null,
leaveReason: "",
auditStatus: 0,
};
this.resetForm("form");
},
......@@ -149,5 +238,5 @@
}
},
},
};
};
</script>
......@@ -298,7 +298,7 @@ export default {
{
prop: "roleIds",
label: "所属角色",
formatter: this.formatters,
formatter: this.formatter,
align: "center",
},
......
......@@ -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,98 @@ 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);
}
}
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;
}
}
}
}
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