人员出入场信息管理-合同编号管理

This commit is contained in:
lSun 2025-06-04 14:31:36 +08:00
parent 226610ff13
commit fb009cdc83
3 changed files with 127 additions and 89 deletions

View File

@ -155,8 +155,7 @@ public class PersonComprehensiveServiceImp implements PersonComprehensiveService
throw new IllegalArgumentException(o.getIdNumber() + "已存在或为黑名单,无法新增");
}
List<PersonComprehensiveBean> 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<List<String>> getHolidaysList(String nation) {
List<String> list = Optional.ofNullable(dao.getHolidaysList(nation)).
orElseGet(ArrayList::new);
List<String> 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<String, Object> params = request.getParams();
// List<PersonComprehensiveBean> list = dao.getWorkerRosterProList(params, request.getOffset(), request.getLimit());
List<PersonComprehensiveBean> list = Optional.ofNullable(dao.getWorkerRosterProList(params, request.getOffset(), request.getLimit()))
.orElseGet(ArrayList::new);
List<PersonComprehensiveBean> 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));
}
}

View File

@ -7,7 +7,7 @@
<link rel="stylesheet" type="text/css" media="screen" href="../../../../css/dataTables.bootstrap.min.css">
<!-- <link rel="stylesheet" type="text/css" media="screen" href="../../../../layui/css/layui.css">-->
<link rel="stylesheet" type="text/css" media="screen" href="../../../../layui-v2.8.18/layui/css/layui.css">
<link rel="stylesheet" type="text/css" media="screen" href="../../../../css/work/data_table_setting.css">
<!-- <link rel="stylesheet" type="text/css" media="screen" href="../../../../css/work/data_table_setting.css">-->
<style>
table.table-bordered.dataTable th, table.table-bordered.dataTable td {
text-align: center;
@ -111,36 +111,36 @@
<div>
<div class="widget-body no-padding">
<table id="dt-table" class="table table-striped table-bordered table-hover" style="width:100%">
<table id="dt-table" class="table table-striped table-bordered table-hover" style="width:4200px">
<thead>
<tr>
<th rowspan="2" >序号</th>
<th rowspan="2">合同编号</th>
<th rowspan="2" style="line-height: 55px;">序号</th>
<th rowspan="2" style="line-height: 55px;">合同编号</th>
<th colspan="8">身份证信息</th>
<th colspan="3">银行卡信息</th>
<th rowspan="2">体检日期</th>
<th rowspan="2">工种</th>
<th rowspan="2">手机号码</th>
<th rowspan="2">所属分包单位</th>
<th rowspan="2">所属班组</th>
<th rowspan="2" style="line-height: 55px;">体检日期</th>
<th rowspan="2" style="line-height: 55px;">工种</th>
<th rowspan="2" style="line-height: 55px;">手机号码</th>
<th rowspan="2" style="line-height: 55px;">所属分包单位</th>
<th rowspan="2" style="line-height: 55px;">所属班组</th>
<th colspan="2">亲属</th>
<th colspan="3">合同</th>
<th colspan="2">工资</th>
<th rowspan="2">进场时间</th>
<th rowspan="2">退场时间</th>
<th rowspan="2">备注</th>
<th rowspan="2">用工类型</th>
<th rowspan="2" style="line-height: 55px;">进场时间</th>
<th rowspan="2" style="line-height: 55px;">退场时间</th>
<th rowspan="2" style="line-height: 55px;">备注</th>
<th rowspan="2" style="line-height: 55px;">用工类型</th>
</tr>
<tr>
<th>姓名</th>
<th>性别</th>
<th>身份证号</th>
<th>出生日期</th>
<th>民族</th>
<th>签发机关</th>
<th>身份证住址</th>
<th>身份证有效期</th>
<th style="width: 100px;">姓名</th>
<th style="width: 100px;">性别</th>
<th style="width: 100px;">身份证号</th>
<th style="width: 100px;">出生日期</th>
<th style="width: 100px;">民族</th>
<th style="width: 100px;">签发机关</th>
<th style="width: 100px;">身份证住址</th>
<th style="width: 100px;">身份证有效期</th>
<th>银行名称</th>
<th>银行卡号</th>
<th>银行卡联行号</th>
@ -151,7 +151,7 @@
<th>签订时间</th>
<th>终止日期</th>
<th>工资核定方式</th>
<th>工资核定标准</th>
<th style="border-right-width: 1px;">工资核定标准</th>
</tr>
</thead>
<tbody>

View File

@ -113,20 +113,20 @@ function init(){
"dom": "<'dt-toolbar'r>t<'dt-toolbar-footer'<'col-sm-4 col-xs-4 hidden-xs'i><'col-xs-8 col-sm-8' p v>>",
"columns": [
{
width: '60px',
width: '100px',
data: function (row, type, set, meta) {
var c = meta.settings._iDisplayStart + meta.row + 1;
return c;
}
},
{"data": "contractCode", "width":"180px"},
{"data": "name", "width":"100px"},
{"data": "sex", "width":"80px"},
{"data": "idNumber", "width":"180px"},
{"data": "birthday", "width":"120px"},
{"data": "ethnic", "width":"100px"},
{"data": "issueauthority", "width":"200px"},
{"data": "address", "width":"300px"},
{"data": "contractCode", width:"100px"},
{"data": "name", width:"100px"},
{"data": "sex", width:"100px"},
{"data": "idNumber", width:"100px"},
{"data": "birthday", width:"100px"},
{"data": "ethnic", width:"100px"},
{"data": "issueauthority", width:"100px"},
{"data": "address", width:"220px"}, //920
{
"data": "",
"width":"200px",
@ -140,22 +140,22 @@ function init(){
{"data": "bankName", "width":"180px"},
{"data": "bankCard", "width":"200px"},
{"data": "bankBranch", "width":"250px"},
{"data": "checkupDate", "width":"120px"},
{"data": "checkupDate", "width":"120px"}, //950
{"data": "postName", "width":"150px"},
{"data": "phone", "width":"120px"},
{"data": "subName", "width":"150px"},
{"data": "teamName", "width":"150px"},
{"data": "urgentPerson", "width":"120px"},
{"data": "urgentPersonPhone", "width":"120px"},
{"data": "laborContractType", "width":"120px"},
{"data": "contractValidDate", "width":"120px"},
{"data": "contractInvalidDate", "width":"120px"},
{"data": "wageApprovedWay", "width":"120px"},
{"data": "wageCriterion", "width":"120px"},
{"data": "urgentPerson", "width":"120px"}, //690
{"data": "urgentPersonPhone", "width":"160px"},
{"data": "laborContractType", "width":"160px"},
{"data": "contractValidDate", "width":"160px"},
{"data": "contractInvalidDate", "width":"160px"},
{"data": "wageApprovedWay", "width":"160px"},
{"data": "wageCriterion", "width":"160px"}, //960
{"data": "einTime", "width":"120px"},
{"data": "exitTime", "width":"120px"},
{"data": "remark", "width":"200px"},
{"data": "", "width":"120px",
{"data": "", "width":"150px", //590
"render": function (data, type, row) {
var workerType = row['workerType'];
var html;