diff --git a/modules/bmw/src/main/java/com/bonus/bmw/person/service/PersonComprehensiveServiceImp.java b/modules/bmw/src/main/java/com/bonus/bmw/person/service/PersonComprehensiveServiceImp.java index 4295bee..ebc0b7e 100644 --- a/modules/bmw/src/main/java/com/bonus/bmw/person/service/PersonComprehensiveServiceImp.java +++ b/modules/bmw/src/main/java/com/bonus/bmw/person/service/PersonComprehensiveServiceImp.java @@ -155,8 +155,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService throw new IllegalArgumentException(o.getIdNumber() + "已存在或为黑名单,无法新增"); } List list = new ArrayList<>(); - if (StringUtils.isNotEmpty(o.getSocialSecurityNumber()) && - StringUtils.isNotEmpty(o.getSocialSecurityUnit())) { + if (StringUtils.isNotEmpty(o.getSocialSecurityNumber()) && StringUtils.isNotEmpty(o.getSocialSecurityUnit())) { o.setIsOwnPerson("1"); } else { o.setIsOwnPerson("0"); @@ -180,10 +179,10 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService //第四页数据添加 上传合同 if (i > 0 && StringUtils.isNotEmpty(o.getContractCode())) { String proId = o.getProId(); - if(!StringUtils.isEmpty(proId)){ + if (!StringUtils.isEmpty(proId)) { String proName = dao.getProNme(proId); String abbreviation = getInitialsUpperCaseWithPinyin(proName); - int contractNum =dao.getContractNum(); + int contractNum = dao.getContractNum(); String dateStr = DateUtil.format(DateUtil.date(), "yyyyMMdd"); // 使用 Hutool 的 DateUtil String contractCode = abbreviation + dateStr + contractNum; o.setContractCode(contractCode); @@ -261,8 +260,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService } if (o.getStatus().equals("0")) { - if (StringUtils.isNotEmpty(o.getAttendanceMachineArr()) && - o.getAttendanceMachineArr().size() > 0) { + if (StringUtils.isNotEmpty(o.getAttendanceMachineArr()) && o.getAttendanceMachineArr().size() > 0) { o.setOperate(1); o.getAttendanceMachineArr().forEach(c -> { o.setAttendanceMachineId(c); @@ -292,17 +290,11 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService private void getLight(PersonComprehensiveBean o) { String light = "0"; - if (StringUtils.isNotEmpty(o.getCompanyExamScore()) && - StringUtils.isNotEmpty(o.getDeptExamScore()) && - StringUtils.isNotEmpty(o.getTeamExamScore())) { - if (Integer.parseInt(o.getCompanyExamScore()) >= 80 && - Integer.parseInt(o.getDeptExamScore()) >= 80 && - Integer.parseInt(o.getTeamExamScore()) >= 80) { + if (StringUtils.isNotEmpty(o.getCompanyExamScore()) && StringUtils.isNotEmpty(o.getDeptExamScore()) && StringUtils.isNotEmpty(o.getTeamExamScore())) { + if (Integer.parseInt(o.getCompanyExamScore()) >= 80 && Integer.parseInt(o.getDeptExamScore()) >= 80 && Integer.parseInt(o.getTeamExamScore()) >= 80) { light = "1"; o.setIsPass("1"); - if (StringUtils.isNotEmpty(o.getTeamId()) && - StringUtils.isNotEmpty(o.getWageBankCard()) && - StringUtils.isNotEmpty(o.getContractCode())) { + if (StringUtils.isNotEmpty(o.getTeamId()) && StringUtils.isNotEmpty(o.getWageBankCard()) && StringUtils.isNotEmpty(o.getContractCode())) { light = "2"; } } else { @@ -415,8 +407,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService basePersonDao.updateIdNumberRelevanceData(basePersonBean); } int i = 0; - if (StringUtils.isNotEmpty(o.getSocialSecurityNumber()) && - StringUtils.isNotEmpty(o.getSocialSecurityUnit())) { + if (StringUtils.isNotEmpty(o.getSocialSecurityNumber()) && StringUtils.isNotEmpty(o.getSocialSecurityUnit())) { o.setIsOwnPerson("1"); } else { o.setIsOwnPerson("0"); @@ -540,8 +531,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService dao.deleteCheckupFile(o); } - if (StringUtils.isNotEmpty(o.getAttendanceMachineArr()) && - o.getAttendanceMachineArr().size() > 0) { + if (StringUtils.isNotEmpty(o.getAttendanceMachineArr()) && o.getAttendanceMachineArr().size() > 0) { o.setOperate(1); o.getAttendanceMachineArr().forEach(c -> { o.setAttendanceMachineId(c); @@ -574,8 +564,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService @Override public R> getHolidaysList(String nation) { - List list = Optional.ofNullable(dao.getHolidaysList(nation)). - orElseGet(ArrayList::new); + List list = Optional.ofNullable(dao.getHolidaysList(nation)).orElseGet(ArrayList::new); if (list.isEmpty()) { return R.ok(new ArrayList<>()); } @@ -633,8 +622,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService public PageTableResponse getWorkerRosterProList(PageTableRequest request) { Map params = request.getParams(); // List list = dao.getWorkerRosterProList(params, request.getOffset(), request.getLimit()); - List list = Optional.ofNullable(dao.getWorkerRosterProList(params, request.getOffset(), request.getLimit())) - .orElseGet(ArrayList::new); + List list = Optional.ofNullable(dao.getWorkerRosterProList(params, request.getOffset(), request.getLimit())).orElseGet(ArrayList::new); // 过滤掉所有的 null 元素 list.removeIf(Objects::isNull); @@ -678,6 +666,12 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService headerStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex()); headerStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); + // 添加边框 + headerStyle.setBorderTop(BorderStyle.THIN); // 上边框 + headerStyle.setBorderBottom(BorderStyle.THIN); // 下边框 + headerStyle.setBorderLeft(BorderStyle.THIN); // 左边框 + headerStyle.setBorderRight(BorderStyle.THIN); // 右边框 + // 设置表头字体 Font headerFont = workbook.createFont(); headerFont.setBold(true); @@ -721,26 +715,50 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService // 创建第二行表头 Row headerRow2 = sheet.createRow(1); - String[] subHeaders = new String[]{ - // 身份证信息(8列) - "姓名", "性别", "身份证号", "出生日期", "民族", "签发机关", "身份证住址", "身份证有效期", - // 银行卡信息(3列) - "银行名称", "银行卡号", "银行卡联行号", - // 亲属信息(2列) - "紧急联系人", "紧急联系人电话", - // 合同信息(3列) - "合同期限类型", "签订时间", "终止日期", - // 工资信息(2列) - "工资核定方式", "工资核定标准" - }; - // 填充第二行表头 - for (int i = 0; i < subHeaders.length; i++) { - Cell cell = headerRow2.createCell(i + 2); // 从第3列开始(前2列是序号和合同编号) - cell.setCellValue(subHeaders[i]); - cell.setCellStyle(headerStyle); + // 序号和合同编号 + createCell(headerRow2, 0, "序号", headerStyle); + createCell(headerRow2, 1, "合同编号", headerStyle); + + // 身份证信息(8列) + String[] idCardHeaders = {"姓名", "性别", "身份证号", "出生日期", "民族", "签发机关", "身份证住址", "身份证有效期"}; + for (int i = 0; i < idCardHeaders.length; i++) { + createCell(headerRow2, i + 2, idCardHeaders[i], headerStyle); } + // 银行卡信息(3列) + String[] bankCardHeaders = {"银行名称", "银行卡号", "银行卡联行号(选填)"}; + for (int i = 0; i < bankCardHeaders.length; i++) { + createCell(headerRow2, i + 10, bankCardHeaders[i], headerStyle); + } + + // 其他信息 + createCell(headerRow2, 13, "体检日期", headerStyle); + createCell(headerRow2, 14, "工种", headerStyle); + createCell(headerRow2, 15, "手机号码", headerStyle); + createCell(headerRow2, 16, "所属分包单位", headerStyle); + createCell(headerRow2, 17, "所属班组", headerStyle); + + // 亲属信息(2列) + createCell(headerRow2, 18, "紧急联系人", headerStyle); + createCell(headerRow2, 19, "紧急联系人电话", headerStyle); + + // 合同信息(3列) + String[] contractHeaders = {"合同期限类型", "签订时间", "终止日期"}; + for (int i = 0; i < contractHeaders.length; i++) { + createCell(headerRow2, i + 20, contractHeaders[i], headerStyle); + } + + // 工资信息(2列) + createCell(headerRow2, 23, "工资核定方式", headerStyle); + createCell(headerRow2, 24, "工资核定标准", headerStyle); + + // 进退场信息 + createCell(headerRow2, 25, "进场时间", headerStyle); + createCell(headerRow2, 26, "退场时间", headerStyle); + createCell(headerRow2, 27, "备注", headerStyle); + createCell(headerRow2, 28, "用工类型", headerStyle); + // 填充数据 int rowNum = 2; for (PersonComprehensiveBean data : dataList) { @@ -803,11 +821,35 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService createCell(row, col, workerType, dataStyle); } - // 自动调整列宽 - for (int i = 0; i < 29; i++) { - sheet.autoSizeColumn(i); + // 设置固定列宽(单位:字符宽度) + int[] columnWidths = {5 * 256, 20 * 256, 10 * 256, 15 * 256, 25 * 256, 15 * 256, 15 * 256, 60 * 256, + 60 * 256, 25 * 256, 25 * 256, 25 * 256, 25 * 256, + 25 * 256, 25 * 256, 20 * 256, 15 * 256, 15 * 256, + 15 * 256, 15 * 256, 15 * 256, 15 * 256, 10 * 256, + 15 * 256, 25 * 256, 25 * 256,25 * 256, 100 * 256, 15 * 256}; + + for (int i = 0; i < columnWidths.length; i++) { + if (i < sheet.getRow(0).getLastCellNum()) { + sheet.setColumnWidth(i, columnWidths[i]); + } } + // 合并单元格到第二行 + sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 0)); // 合并“序号”单元格 + sheet.addMergedRegion(new CellRangeAddress(0, 1, 1, 1)); + + sheet.addMergedRegion(new CellRangeAddress(0, 1, 13, 13)); + sheet.addMergedRegion(new CellRangeAddress(0, 1, 14, 14)); + sheet.addMergedRegion(new CellRangeAddress(0, 1, 15, 15)); + sheet.addMergedRegion(new CellRangeAddress(0, 1, 16, 16)); + sheet.addMergedRegion(new CellRangeAddress(0, 1, 17, 17)); + + + sheet.addMergedRegion(new CellRangeAddress(0, 1, 25, 25)); + sheet.addMergedRegion(new CellRangeAddress(0, 1, 26, 26)); + sheet.addMergedRegion(new CellRangeAddress(0, 1, 27, 27)); + sheet.addMergedRegion(new CellRangeAddress(0, 1, 28, 28)); + // 写入输出流 workbook.write(outputStream); outputStream.flush(); @@ -848,10 +890,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService // 创建表头 Row headerRow = sheet.createRow(0); - String[] headers = new String[]{ - "序号", "项目部", "工程名称", "工程类型", "工程状态", - "当前在场人数", "已出场人数", "累计入场人数", "第一次人员入场时间" - }; + String[] headers = new String[]{"序号", "项目部", "工程名称", "工程类型", "工程状态", "当前在场人数", "已出场人数", "累计入场人数", "第一次人员入场时间"}; // 填充表头 for (int i = 0; i < headers.length; i++) { @@ -895,8 +934,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService cell.setCellValue(value); cell.setCellStyle(style); if (colspan > 1) { - row.getSheet().addMergedRegion(new CellRangeAddress( - row.getRowNum(), row.getRowNum(), startCol, startCol + colspan - 1)); + row.getSheet().addMergedRegion(new CellRangeAddress(row.getRowNum(), row.getRowNum(), startCol, startCol + colspan - 1)); } } diff --git a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.html b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.html index fd39b5c..e0356f1 100644 --- a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.html +++ b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.html @@ -4,7 +4,8 @@ 施工人员库 - + + @@ -726,7 +727,7 @@ - + diff --git a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.js b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.js index 78cbcd6..ee13340 100644 --- a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.js +++ b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryFrom.js @@ -955,6 +955,14 @@ function uploadCompanyExamFIle(number){ size: 1024*30, //最大文件大小,单位k bindAction: '#companyExamHideUploadProve', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "公司级考试支持 jpg|png|jpeg|rar|zip|docx|doc|pdf 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { flag = false; var suffixType = ''; //后缀类型 @@ -1031,6 +1039,14 @@ function uploadDeptExamFIle(number){ size: 1024*30, //最大文件大小,单位k bindAction: '#deptExamHideUploadProve', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "部门级考试 jpg|png|jpeg|rar|zip|docx|doc|pdf 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { flag = false; var suffixType = ''; //后缀类型 @@ -1107,6 +1123,14 @@ function uploadTeamExamFIle(number){ size: 1024*30, //最大文件大小,单位k bindAction: '#teamxamHideUploadProve', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "班组级考试 jpg|png|jpeg|rar|zip|docx|doc|pdf 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { flag = false; var suffixType = ''; //后缀类型 @@ -1184,6 +1208,14 @@ function uploadFileProve(number){ size: 1024*30, //最大文件大小,单位k bindAction: '#hideUploadProve', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "社保证明 jpg|png|jpeg|txt|pdf|xlsx|xls|docx|doc|ppt|pptx 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { flag = false; var suffixType = ''; //后缀类型 @@ -1267,6 +1299,14 @@ function uploadFileWageCard(number){ size: 1024*30, //最大文件大小,单位k bindAction: '#hideUploadWageCard', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "工资卡见证照上传支持jpg|png|jpeg|txt|pdf|xlsx|xls|docx|doc|ppt|pptx 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { flag = false; var suffixType = ''; //后缀类型 @@ -1348,6 +1388,14 @@ function uploadFileContract(number){ size: 1024*30, //最大文件大小,单位k bindAction: '#hideUploadContract', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "合同见证照片支持jpg|png|jpeg|txt|pdf|xlsx|xls|docx|doc|ppt|pptx|PDF 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { flag = false; var suffixType = ''; //后缀类型 @@ -1427,6 +1475,14 @@ function uploadFileFace(num){ size: 1024*5, //最大文件大小,单位k bindAction: '#hideUploadFaceProve', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "人脸认别只支持 JPG 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { let img = document.getElementById("face_img"); obj.preview(function (index, file, result) { @@ -1911,6 +1967,14 @@ function uploadCheckup(number){ size: 1024*30, //最大文件大小,单位k bindAction: '#hideUploadCheckup', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "体检报告只支持 PDF 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { flag = false; // 清空现有预览和文件信息 @@ -1979,6 +2043,14 @@ function uploadSpecial(number){ size: 1024*30, //最大文件大小,单位k bindAction: '#hideUploadCheckup', //绑定的按钮 field: 'file', //传到后台的字段名,默认file + text: { // 自定义提示文本 + "data-format-error": "上传失败,请重新上传", // 数据格式错误的提示 + "check-error": "特种持证只支持 PDF 文件,请重新选择!", // 文件格式校验失败的提示 + "error": "上传失败,请重新上传", // 上传失败的提示 + "limit-number": null, // 限制 number 属性的提示。若设置,需为函数写法 + "limit-size": null, // 限制 size 属性的提示。若设置,需为函数写法 + "cross-domain": "", // IE 下跨域的提示 + }, choose: function (obj) { flag = false; // 清空现有预览和文件信息 diff --git a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryList.js b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryList.js index eec0ee3..397b686 100644 --- a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryList.js +++ b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/personEntryList.js @@ -188,11 +188,10 @@ function init(){ var html = ''; html += buttonCheck(idNumber, "", pers); html += buttonUpdate(idNumber, "", pers); + html += buttonCheckDataEn(idNumber, "", pers); if(checkupFilePath){ html += buttonCheckup(idNumber,checkupFilePath, "", pers); - html += buttonCheckDataEns(idNumber, "", pers); }else{ - html += buttonCheckDataEn(idNumber, "", pers); } return html; @@ -357,7 +356,7 @@ function buttonCheckup(idNumber,checkupFilePath, permission, pers) { return ""; } } - var btn = $(""); + var btn = $(""); return btn.prop("outerHTML"); } @@ -458,23 +457,13 @@ function buttonCheckDataEn(idNumber, permission, pers){ return btn.prop("outerHTML"); } -function buttonCheckDataEns(idNumber, permission, pers){ - if(permission != ""){ - if ($.inArray(permission, pers) < 0) { - return ""; - } - } - var btn = $(""); - return btn.prop("outerHTML"); -} - /** * 查看 * */ function checkViewEn(idNumber) { localStorage.setItem("idNumber", idNumber); - let width = "80%"; - let height = "90%"; + let width = "95%"; + let height = "95%"; var index = layer.open({ title: ['出入场记录', 'color:#3B70A1;background-color:#E8ECEB;font-size:20px'], type: 2, diff --git a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/workerRosterProList.html b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/workerRosterProList.html index 5dc63d9..01ff329 100644 --- a/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/workerRosterProList.html +++ b/modules/bmw/src/main/resources/static/pages/work/Person/AttendanceMachine/workerRosterProList.html @@ -7,7 +7,7 @@ - +