考勤接口
This commit is contained in:
parent
afb65fced8
commit
6b76829b39
|
|
@ -7,6 +7,8 @@ alter table hrsa_add_up_situation modify id bigint auto_increment;
|
|||
alter table hrsa_other_deduction modify id bigint auto_increment;
|
||||
alter table hrsa_attend_quote_field modify id bigint auto_increment;
|
||||
alter table hrsa_attend_quote_sync_set modify id bigint auto_increment;
|
||||
alter table hrsa_attend_quote_data modify id bigint auto_increment;
|
||||
alter table hrsa_attend_quote_data_value modify id bigint auto_increment;
|
||||
|
||||
alter table hrsa_salary_item modify id bigint auto_increment;
|
||||
alter table hrsa_salary_sob modify id bigint auto_increment;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.engine.salary.entity.datacollection.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 数据采集-考勤导入参数
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class AttendQuoteDataImportParam {
|
||||
|
||||
//上传文件id
|
||||
@DataCheck(require = true,message = "imageId为空")
|
||||
String imageId;
|
||||
|
||||
//薪资所属月
|
||||
@DataCheck(require = true,message = "薪资所属月为空")
|
||||
String salaryYearMonth;
|
||||
|
||||
//账套id
|
||||
@DataCheck(require = true,message = "账套id为空")
|
||||
Long salarySobId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -15,6 +15,7 @@ import java.util.Date;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_attend_quote_data_value
|
||||
public class AttendQuoteDataValuePO {
|
||||
/**
|
||||
* 主键
|
||||
|
|
|
|||
|
|
@ -303,6 +303,7 @@
|
|||
|
||||
<insert id="insertData">
|
||||
INSERT INTO hrsa_attend_quote_data(
|
||||
id,
|
||||
employee_id,
|
||||
attend_quote_id,
|
||||
create_time,
|
||||
|
|
@ -312,6 +313,7 @@
|
|||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.employeeId},
|
||||
#{item.attendQuoteId},
|
||||
#{item.createTime},
|
||||
|
|
@ -323,6 +325,7 @@
|
|||
</insert>
|
||||
<insert id="insertData" databaseId="oracle">
|
||||
INSERT INTO hrsa_attend_quote_data(
|
||||
id,
|
||||
employee_id,
|
||||
attend_quote_id,
|
||||
create_time,
|
||||
|
|
@ -332,6 +335,7 @@
|
|||
|
||||
<foreach collection="collection" item="item" separator="union all">
|
||||
select
|
||||
#{item.id},
|
||||
#{item.employeeId},
|
||||
#{item.attendQuoteId},
|
||||
#{item.createTime},
|
||||
|
|
@ -343,6 +347,7 @@
|
|||
</insert>
|
||||
<insert id="insertData" databaseId="sqlserver">
|
||||
INSERT INTO hrsa_attend_quote_data(
|
||||
id,
|
||||
employee_id,
|
||||
attend_quote_id,
|
||||
create_time,
|
||||
|
|
@ -352,6 +357,7 @@
|
|||
VALUES
|
||||
<foreach collection="collection" item="item" separator=",">
|
||||
(
|
||||
#{item.id},
|
||||
#{item.employeeId},
|
||||
#{item.attendQuoteId},
|
||||
#{item.createTime},
|
||||
|
|
|
|||
|
|
@ -70,5 +70,5 @@ public interface AttendQuoteDataValueMapper {
|
|||
*/
|
||||
void insertData(@Param("collection") List<AttendQuoteDataValuePO> values);
|
||||
|
||||
List<AttendQuoteDataValuePO> listSome(AttendQuoteDataValuePO param);
|
||||
List<AttendQuoteDataValuePO> listSome(@Param("param") AttendQuoteDataValuePO param);
|
||||
}
|
||||
|
|
@ -291,7 +291,7 @@
|
|||
<if test="param.attendQuoteId != null and param.attendQuoteId != ''">
|
||||
AND attend_quote_id = #{param.attendQuoteId}
|
||||
</if>
|
||||
<if test="param.employeeIds != null and param.employeeIds.size() > 0 ''">
|
||||
<if test="param.employeeIds != null and param.employeeIds.size() > 0">
|
||||
AND employee_id IN
|
||||
<foreach collection="param.employeeIds" open="(" item="employeeId" separator="," close=")">
|
||||
#{employeeId}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.engine.salary.service;
|
|||
import com.engine.salary.entity.datacollection.dto.AttendQuoteDataBaseDTO;
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteDataDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataExportTemplateParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataSyncParam;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
|
|
@ -69,4 +70,18 @@ public interface AttendQuoteDataService {
|
|||
*/
|
||||
List<Map<String, Object>> getListMaps(List<AttendQuoteDataBaseDTO> attendQuoteDataBases);
|
||||
|
||||
/**
|
||||
* 预览
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> preview(AttendQuoteDataImportParam param);
|
||||
|
||||
/**
|
||||
* 导入
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> importAttendQuoteData(AttendQuoteDataImportParam param);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,11 +5,9 @@ import com.engine.core.impl.Service;
|
|||
import com.engine.salary.biz.*;
|
||||
import com.engine.salary.common.LocalDateRange;
|
||||
import com.engine.salary.constant.SalaryDefaultTenantConstant;
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.datacollection.dto.*;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataExportTemplateParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataSyncParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteFieldSettingQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.*;
|
||||
import com.engine.salary.entity.datacollection.po.AttendQuoteDataPO;
|
||||
import com.engine.salary.entity.datacollection.po.AttendQuoteDataValuePO;
|
||||
import com.engine.salary.entity.datacollection.po.AttendQuoteFieldPO;
|
||||
|
|
@ -17,6 +15,7 @@ import com.engine.salary.entity.datacollection.po.AttendQuotePO;
|
|||
import com.engine.salary.entity.salarysob.bo.SalarySobRangeBO;
|
||||
import com.engine.salary.entity.salarysob.dto.SalarySobCycleDTO;
|
||||
import com.engine.salary.entity.salarysob.param.SalarySobRangeEmpQueryParam;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobPO;
|
||||
import com.engine.salary.entity.salarysob.po.SalarySobRangePO;
|
||||
import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
|
|
@ -29,18 +28,31 @@ import com.engine.salary.service.SalarySobService;
|
|||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.excel.ExcelParseHelper;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import com.engine.salary.util.excel.ExcelUtil;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.util.page.PageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
import com.google.common.base.Joiner;
|
||||
import com.google.common.collect.Maps;
|
||||
import dm.jdbc.util.IdGenerator;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.file.ImageFileManager;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.YearMonth;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
/**
|
||||
* 数据采集-考勤引用数据
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
|
|
@ -60,6 +72,7 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
private AttendQuoteFieldSettingService getFieldSettingService(User user) {
|
||||
return (AttendQuoteFieldSettingService) ServiceUtil.getService(AttendQuoteFieldSettingServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalarySobService getSalarySobService(User user) {
|
||||
return (SalarySobService) ServiceUtil.getService(SalarySobServiceImpl.class, user);
|
||||
}
|
||||
|
|
@ -67,15 +80,16 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
private AttendQuoteDataMapper getAttendQuoteDataMapper() {
|
||||
return MapperProxyFactory.getProxy(AttendQuoteDataMapper.class);
|
||||
}
|
||||
|
||||
|
||||
private SalarySobMapper getSalarySobMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobMapper.class);
|
||||
}
|
||||
|
||||
private SalarySobRangeMapper getSalarySobRangeMapper() {
|
||||
return MapperProxyFactory.getProxy(SalarySobRangeMapper.class);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// private HrmCommonEmployeeService employeeService;
|
||||
|
||||
// private AttendQuoteFieldSettingService attendQuoteFieldSettingService;
|
||||
|
|
@ -482,213 +496,223 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
return ExcelUtil.genWorkbookV2(rows, sheetName);
|
||||
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * 导入考核数据
|
||||
// */
|
||||
// @BatchImportHandler("importAttendQuoteData")
|
||||
// public void importAttendQuoteData() {
|
||||
// BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage();
|
||||
// log.info("【考勤引用数据】接收到上传的数据:{}", JSONObject.toJSONString(message));
|
||||
// // 租户key
|
||||
// String tenantKey = message.getTenantKey().toLowerCase();
|
||||
// try {
|
||||
// // 加密用
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// // 接收到解析的数据
|
||||
// batchImportEbatch(message);
|
||||
// } catch (Exception e) {
|
||||
// log.error("【考勤引用数据】导入失败:{}", String.format("BatchTaskId=%s,错误信息=%s", message.getBatchTaskId(), e.getMessage()));
|
||||
// } finally {
|
||||
// // 加密用
|
||||
// DSTenantKeyThreadVar.tenantKey.remove();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 导入的数据插入到数据库中
|
||||
// * @param message
|
||||
// * @throws ParseException
|
||||
// */
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void batchImportEbatch(BatchDocumentMessage message) {
|
||||
// List<ExcelSheet> excelSheets = message.getBatchFile().getExcelSheets();
|
||||
//
|
||||
// // 租户key
|
||||
// String tenantKey = message.getTenantKey().toLowerCase();
|
||||
// Long currentEmployeeId = message.getUserId();
|
||||
// // 加密用
|
||||
// DSTenantKeyThreadVar.tenantKey.set(tenantKey);
|
||||
// String paramsData = message.getUploadSet().getCustomData();
|
||||
// Map<String, Object> params = JSONObject.parseObject(paramsData, Map.class);
|
||||
//
|
||||
// // 参数校验
|
||||
// boolean isValid = checkParams(message, params);
|
||||
// if (!isValid) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// String salaryYearMonth = params.get("salaryYearMonth").toString();
|
||||
// int year = Integer.parseInt(salaryYearMonth.split("-")[0]);
|
||||
// int month = Integer.parseInt(salaryYearMonth.split("-")[1]);
|
||||
//
|
||||
// // 获取租户下所有的人员
|
||||
// List<DataCollectionEmployeePO> employees = attendQuoteMapper.listEmployee(tenantKey);
|
||||
// // 获取已设置的可同步的考勤字段
|
||||
// List<AttendQuoteFieldPO> attendQuoteFields = getAttendQuoteSetFields(AttendQuoteSourceTypeEnum.IMPORT, currentEmployeeId, tenantKey);
|
||||
// // 获取考勤引用
|
||||
// AttendQuotePO attendQuote = getAttendQuote(AttendQuoteSourceTypeEnum.IMPORT, Long.valueOf(params.get("salarySobId").toString()), year, month, StringUtils.EMPTY, message.getUserId(), tenantKey);
|
||||
//
|
||||
// int total = 0;
|
||||
// for (ExcelSheet excelSheet : excelSheets) {
|
||||
// List<Map<String, Object>> data = excelSheet.getData();
|
||||
// if (data != null) {
|
||||
// total += data.size();
|
||||
// }
|
||||
// }
|
||||
// int index = 0;
|
||||
// int successCount = 0;
|
||||
// int errorCount = 0;
|
||||
// // 错误excel内容
|
||||
// List<ExcelSheet> errorExcelSheets = new ArrayList<>();
|
||||
// // 待导入数据
|
||||
// List<AttendQuoteDataPO> pos = new ArrayList<>();
|
||||
// List<AttendQuoteDataValuePO> values = new ArrayList<>();
|
||||
// String valI18n = SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 100581, "请输入数字");
|
||||
// for (ExcelSheet excelSheet : excelSheets) {
|
||||
// if (excelSheet.getHeader().size() == 0) {
|
||||
// continue;
|
||||
// }
|
||||
// List<Map> headers = excelSheet.getHeader();
|
||||
// boolean isValidHeader = checkHeaders(message, headers, attendQuoteFields);
|
||||
// if (!isValidHeader) {
|
||||
// return;
|
||||
// }
|
||||
// // 错误sheet数据
|
||||
// List<Map<String,Object>> errorData = new ArrayList<>();
|
||||
// // 错误提示
|
||||
// List<ExcelComment> excelComments = new ArrayList<>();
|
||||
//
|
||||
// List<Map<String, Object>> data = excelSheet.getData();
|
||||
// Map<String, Object> map;
|
||||
// if (data == null) {
|
||||
// continue;
|
||||
// }
|
||||
// AttendQuoteDataPO po;
|
||||
// for (int i = 0; i < data.size(); i++) {
|
||||
// index += 1;
|
||||
// map = data.get(i);
|
||||
//
|
||||
// po = new AttendQuoteDataPO();
|
||||
// po.setId(IdGenerator.generate());
|
||||
// po.setCreateTime(LocalDateTime.now());
|
||||
// po.setUpdateTime(LocalDateTime.now());
|
||||
// po.setCreator(message.getUserId());
|
||||
// po.setTenantKey(tenantKey);
|
||||
// // 考勤引用表的主键id
|
||||
// po.setAttendQuoteId(attendQuote.getId());
|
||||
//
|
||||
// int errorSum = 0;
|
||||
//
|
||||
// String userName = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 85429, "姓名"))).orElse("").toString();
|
||||
// String deparmentName = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 86185, "部门"))).orElse("").toString();
|
||||
// List<Long> employeeSameIds = employees.stream().filter(e -> (com.weaver.teams.util.StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName))
|
||||
// && (com.weaver.teams.util.StringUtils.isBlank(deparmentName) || Objects.equals(e.getDeparmentName(), deparmentName))).map(DataCollectionEmployeePO::getEmployeeId)
|
||||
// .collect(Collectors.toList());
|
||||
//
|
||||
// for (int j = 0; j < headers.size(); j++) {
|
||||
// Map header = headers.get(j);
|
||||
// Object key = header.get("key");
|
||||
// if (key == null) {
|
||||
// continue;
|
||||
// }
|
||||
// String cellVal = Optional.ofNullable(map.get(key.toString())).orElse("").toString();
|
||||
// if (SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 85429, "姓名").equals(key.toString())) {
|
||||
// if (com.weaver.teams.util.StringUtils.isEmpty(cellVal)) {
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 100577, "不能为空"), errorCount+1, errorCount+1, j, j);
|
||||
// errorSum += 1;
|
||||
// } else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) {
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 100578, "员工信息不能为空且不可重复(姓名与部门同时确认唯一)"), errorCount+1, errorCount+1, j, j);
|
||||
// errorSum += 1;
|
||||
// } else {
|
||||
// Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1?employeeSameIds.get(0):null;
|
||||
// if (employeeId!=null && employeeId>0) {
|
||||
// po.setEmployeeId(employeeId);
|
||||
// } else {
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 100579, "姓名错误,系统内不存在该姓名"), errorCount+1, errorCount+1, j, j);
|
||||
// errorSum += 1;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// String bigDecimalValue;
|
||||
// for (AttendQuoteFieldPO attendQuoteField : attendQuoteFields) {
|
||||
// if (attendQuoteField.getFieldName().equals(key.toString())) {
|
||||
// bigDecimalValue = bigDecimalVal(cellVal, excelComments, valI18n, errorCount+1, j);
|
||||
// errorSum += StringUtils.isEmpty(bigDecimalValue)?1:0;
|
||||
// if (StringUtils.isNotEmpty(bigDecimalValue)) {
|
||||
// values.add(AttendQuoteDataValuePO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .createTime(LocalDateTime.now())
|
||||
// .updateTime(LocalDateTime.now())
|
||||
// .creator(message.getUserId())
|
||||
// .tenantKey(tenantKey)
|
||||
// .employeeId(po.getEmployeeId())
|
||||
// .attendQuoteId(attendQuote.getId())
|
||||
// .attendQuoteDataId(po.getId())
|
||||
// .attendQuoteFieldId(attendQuoteField.getId())
|
||||
// .dataValue(cellVal)
|
||||
// .build());
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if (errorSum>0) {
|
||||
// errorCount += 1;
|
||||
// // 添加错误数据
|
||||
// errorData.add(map);
|
||||
// } else {
|
||||
// successCount += 1;
|
||||
// // 成功一条就添加一条记录
|
||||
// pos.add(po);
|
||||
// }
|
||||
// // 导入进度
|
||||
// salaryBatchService.sendImportRate(message.getBizId(), total, index);
|
||||
// }
|
||||
//
|
||||
// // 如果sheet包含错误数据
|
||||
// if (CollectionUtils.isNotEmpty(errorData)) {
|
||||
// salaryBatchService.createErrorExcelSheet(headers, errorData, excelSheet.getName(), excelComments, errorExcelSheets);
|
||||
// }
|
||||
// }
|
||||
// // 数据入库处理
|
||||
// log.info("【考勤引用数据】导入记录:{}", JsonUtil.toJsonString(pos));
|
||||
// handleDataToDB(attendQuote.getId(), pos, values, tenantKey);
|
||||
// // 记录日志
|
||||
|
||||
/**
|
||||
* 导入的数据插入到数据库中
|
||||
*/
|
||||
public Map<String, Object> preview(AttendQuoteDataImportParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
Long salarySobId = param.getSalarySobId();
|
||||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salarySobId);
|
||||
if (salarySobPO == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100537, "薪资账套不存在"));
|
||||
}
|
||||
String salaryYearMonth = param.getSalaryYearMonth();
|
||||
if (!SalaryDateUtil.checkYearMonth(salaryYearMonth)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100365, "薪资所属月格式有误,正确格式示例为'2021-01'"));
|
||||
}
|
||||
|
||||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
apidatas.put("headers", ExcelSupport.getSheetHeader(sheet, 0));
|
||||
apidatas.put("list", ExcelParseHelper.parse2List(sheet, 1));
|
||||
return apidatas;
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入的数据插入到数据库中
|
||||
*/
|
||||
public Map<String, Object> importAttendQuoteData(AttendQuoteDataImportParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
Long salarySobId = param.getSalarySobId();
|
||||
SalarySobPO salarySobPO = getSalarySobService(user).getById(salarySobId);
|
||||
if (salarySobPO == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100537, "薪资账套不存在"));
|
||||
}
|
||||
String salaryYearMonth = param.getSalaryYearMonth();
|
||||
if (!SalaryDateUtil.checkYearMonth(salaryYearMonth)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100365, "薪资所属月格式有误,正确格式示例为'2021-01'"));
|
||||
}
|
||||
int year = Integer.parseInt(salaryYearMonth.split("-")[0]);
|
||||
int month = Integer.parseInt(salaryYearMonth.split("-")[1]);
|
||||
|
||||
// 获取租户下所有的人员
|
||||
List<DataCollectionEmployee> employees = employeeBiz.listEmployee();
|
||||
// 获取已设置的可同步的考勤字段
|
||||
List<AttendQuoteFieldPO> attendQuoteFields = getAttendQuoteSetFields(AttendQuoteSourceTypeEnum.IMPORT);
|
||||
// 获取考勤引用
|
||||
AttendQuotePO attendQuote = getAttendQuote(AttendQuoteSourceTypeEnum.IMPORT, salarySobId, year, month, StringUtils.EMPTY);
|
||||
|
||||
int total = 0;
|
||||
|
||||
int index = 0;
|
||||
int successCount = 0;
|
||||
int errorCount = 0;
|
||||
|
||||
// 待导入数据
|
||||
List<AttendQuoteDataPO> pos = new ArrayList<>();
|
||||
List<AttendQuoteDataValuePO> values = new ArrayList<>();
|
||||
String valI18n = SalaryI18nUtil.getI18nLabel(100581, "请输入数字");
|
||||
|
||||
InputStream fileInputStream = null;
|
||||
try {
|
||||
fileInputStream = ImageFileManager.getInputStreamById(Integer.parseInt(param.getImageId()));
|
||||
Sheet sheet = ExcelSupport.parseFile(fileInputStream, 0, EXCEL_TYPE_XLSX);
|
||||
// 表头
|
||||
List<String> headers = ExcelSupport.getSheetHeader(sheet, 0);
|
||||
|
||||
boolean isValidHeader = checkHeaders(headers, attendQuoteFields);
|
||||
|
||||
// 错误sheet数据
|
||||
List<Map<String, Object>> errorData = new ArrayList<>();
|
||||
// 错误提示
|
||||
List<Map<String, String>> excelComments = new ArrayList<>();
|
||||
|
||||
// 处理数值
|
||||
List<Map<String, Object>> data = ExcelParseHelper.parse2Map(sheet, 1);
|
||||
total = data.size();
|
||||
|
||||
Map<String, Object> map;
|
||||
Date now = new Date();
|
||||
|
||||
AttendQuoteDataPO po;
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
index += 1;
|
||||
map = data.get(i);
|
||||
|
||||
po = new AttendQuoteDataPO();
|
||||
po.setId(IdGenerator.generate());
|
||||
po.setCreateTime(now);
|
||||
po.setUpdateTime(now);
|
||||
po.setCreator((long) user.getUID());
|
||||
po.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY);
|
||||
// 考勤引用表的主键id
|
||||
po.setAttendQuoteId(attendQuote.getId());
|
||||
|
||||
int errorSum = 0;
|
||||
|
||||
String userName = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(85429, "姓名"))).orElse("").toString();
|
||||
String deparmentName = Optional.ofNullable(map.get(SalaryI18nUtil.getI18nLabel(86185, "部门"))).orElse("").toString();
|
||||
List<Long> employeeSameIds = employees.stream().filter(e -> (StringUtils.isBlank(userName) || Objects.equals(e.getUsername(), userName))
|
||||
&& (StringUtils.isBlank(deparmentName) || Objects.equals(e.getDepartmentName(), deparmentName))).map(DataCollectionEmployee::getEmployeeId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (int j = 0; j < headers.size(); j++) {
|
||||
String key = headers.get(j);
|
||||
if (key == null) {
|
||||
continue;
|
||||
}
|
||||
String cellVal = Optional.ofNullable(map.get(key.toString())).orElse("").toString();
|
||||
if (SalaryI18nUtil.getI18nLabel(85429, "姓名").equals(key.toString())) {
|
||||
if (StringUtils.isEmpty(cellVal)) {
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(100579, "不能为空"));
|
||||
excelComments.add(errorMessageMap);
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel( 100577, "不能为空"), errorCount + 1, errorCount + 1, j, j);
|
||||
errorSum += 1;
|
||||
} else if (CollectionUtils.isEmpty(employeeSameIds) || employeeSameIds.size() > 1) {
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(100579, "员工信息不能为空且不可重复(姓名与部门同时确认唯一)"));
|
||||
excelComments.add(errorMessageMap);
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel( 100578, "员工信息不能为空且不可重复(姓名与部门同时确认唯一)"), errorCount + 1, errorCount + 1, j, j);
|
||||
errorSum += 1;
|
||||
} else {
|
||||
Long employeeId = CollectionUtils.isNotEmpty(employeeSameIds) && employeeSameIds.size() == 1 ? employeeSameIds.get(0) : null;
|
||||
if (employeeId != null && employeeId > 0) {
|
||||
po.setEmployeeId(employeeId);
|
||||
} else {
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", SalaryI18nUtil.getI18nLabel(100579, "姓名错误,系统内不存在该姓名"));
|
||||
excelComments.add(errorMessageMap);
|
||||
// salaryBatchService.createExcelComment(excelComments, SalaryI18nUtil.getI18nLabel( 100579, "姓名错误,系统内不存在该姓名"), errorCount + 1, errorCount + 1, j, j);
|
||||
errorSum += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
String bigDecimalValue;
|
||||
for (AttendQuoteFieldPO attendQuoteField : attendQuoteFields) {
|
||||
if (attendQuoteField.getFieldName().equals(key)) {
|
||||
bigDecimalValue = bigDecimalVal(cellVal, excelComments, valI18n, errorCount + 1, j);
|
||||
errorSum += StringUtils.isEmpty(bigDecimalValue) ? 1 : 0;
|
||||
if (StringUtils.isNotEmpty(bigDecimalValue)) {
|
||||
values.add(AttendQuoteDataValuePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator((long) user.getUID())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.employeeId(po.getEmployeeId())
|
||||
.attendQuoteId(attendQuote.getId())
|
||||
.attendQuoteDataId(po.getId())
|
||||
.attendQuoteFieldId(attendQuoteField.getId())
|
||||
.dataValue(cellVal)
|
||||
.build());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (errorSum > 0) {
|
||||
errorCount += 1;
|
||||
// 添加错误数据
|
||||
errorData.add(map);
|
||||
} else {
|
||||
successCount += 1;
|
||||
// 成功一条就添加一条记录
|
||||
pos.add(po);
|
||||
}
|
||||
// 导入进度
|
||||
// salaryBatchService.sendImportRate(message.getBizId(), total, index);
|
||||
}
|
||||
|
||||
// 数据入库处理
|
||||
handleDataToDB(attendQuote.getId(), pos, values);
|
||||
|
||||
|
||||
// todo 记录日志
|
||||
// recordLog(attendQuote, message.getUserId(), message.getTenantKey(), message.getClientIp());
|
||||
// // 发送导入回调信息
|
||||
// salaryBatchService.sendImportCallBackInfo(message, successCount, errorCount, errorExcelSheets);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 获取金额数字值
|
||||
// * @param bigDecimalValStr
|
||||
// * @param excelComments
|
||||
// * @param i
|
||||
// * @param j
|
||||
// * @return
|
||||
// */
|
||||
// private String bigDecimalVal(String bigDecimalValStr, List<ExcelComment> excelComments, String valI18n, int i, int j) {
|
||||
// BigDecimal bigDecimalVal = null;
|
||||
// try {
|
||||
// bigDecimalVal = new BigDecimal(bigDecimalValStr);
|
||||
// } catch (Exception e) {
|
||||
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>();
|
||||
apidatas.put("successCount", successCount);
|
||||
apidatas.put("errorCount", errorCount);
|
||||
apidatas.put("errorData", excelComments);
|
||||
return apidatas;
|
||||
} finally {
|
||||
IOUtils.closeQuietly(fileInputStream);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取金额数字值
|
||||
*
|
||||
* @param bigDecimalValStr
|
||||
* @param excelComments
|
||||
* @param i
|
||||
* @param j
|
||||
* @return
|
||||
*/
|
||||
private String bigDecimalVal(String bigDecimalValStr, List<Map<String, String>> excelComments, String valI18n, int i, int j) {
|
||||
BigDecimal bigDecimalVal = null;
|
||||
try {
|
||||
bigDecimalVal = new BigDecimal(bigDecimalValStr);
|
||||
} catch (Exception e) {
|
||||
Map<String, String> errorMessageMap = Maps.newHashMap();
|
||||
errorMessageMap.put("message", valI18n);
|
||||
excelComments.add(errorMessageMap);
|
||||
// salaryBatchService.createExcelComment(excelComments, valI18n, i, i, j, j);
|
||||
// }
|
||||
// return bigDecimalVal == null? "" : bigDecimalVal.toString();
|
||||
// }
|
||||
//
|
||||
}
|
||||
return bigDecimalVal == null ? "" : bigDecimalVal.toString();
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 记录日志
|
||||
// * @param attendQuote
|
||||
|
|
@ -708,8 +732,8 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
// loggerContext.setTargetId(String.valueOf(attendQuote.getId()));
|
||||
// loggerContext.setTargetName(SalaryDateUtil.getFormatYearMonth(attendQuote.getSalaryYearMonth())+" "+(CollectionUtils.isNotEmpty(salarySobs)?salarySobs.get(0).getName():""));
|
||||
// loggerContext.setOperateType(OperateTypeEnum.ADD.getValue());
|
||||
// loggerContext.setOperateTypeName(sourceType+SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 93931, "考勤数据"));
|
||||
// loggerContext.setOperatedesc(sourceType+SalaryI18nUtil.getI18nLabel(currentTenantKey, currentEmployeeId, 93931, "考勤数据"));
|
||||
// loggerContext.setOperateTypeName(sourceType+SalaryI18nUtil.getI18nLabel(93931, "考勤数据"));
|
||||
// loggerContext.setOperatedesc(sourceType+SalaryI18nUtil.getI18nLabel( 93931, "考勤数据"));
|
||||
// loggerContext.setNewValues(attendQuote);
|
||||
// loggerContext.setTenant_key(currentTenantKey);
|
||||
// loggerContext.setOperator(currentEmployeeId.toString());
|
||||
|
|
@ -718,13 +742,14 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
// }
|
||||
// attendQuoteLoggerTemplate.write(loggerContext);
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 检查参数
|
||||
// * @param message
|
||||
// * @param params
|
||||
// * @return
|
||||
// */
|
||||
|
||||
/**
|
||||
* 检查参数
|
||||
*
|
||||
* @param message
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
// private boolean checkParams(BatchDocumentMessage message, Map<String, Object> params) {
|
||||
// boolean isValid = true;
|
||||
// String errorMsg = "";
|
||||
|
|
@ -760,42 +785,32 @@ public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDa
|
|||
// }
|
||||
// return isValid;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 检查列头
|
||||
// * @param message
|
||||
// * @param headers
|
||||
// * @param attendQuoteFields
|
||||
// * @return
|
||||
// */
|
||||
// private boolean checkHeaders(BatchDocumentMessage message, List<Map> headers, List<AttendQuoteFieldPO> attendQuoteFields) {
|
||||
// boolean isValid = true;
|
||||
//
|
||||
// String tenantKey = message.getTenantKey();
|
||||
// Long currentEmployeeId = message.getUserId();
|
||||
// String userNameI18n = SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 85429, "姓名");
|
||||
//
|
||||
// List<String> headerList = headers.stream().map(m->m.getOrDefault("key", "").toString()).collect(Collectors.toList());
|
||||
//
|
||||
// List<String> mustHeaders = CollectionUtils.emptyIfNull(attendQuoteFields).stream().map(AttendQuoteFieldPO::getFieldName).collect(Collectors.toList());
|
||||
// mustHeaders.add(userNameI18n);
|
||||
//
|
||||
// // 缺少的必须列
|
||||
// List<String> lackHeaders = mustHeaders.stream().filter(item -> !headerList.contains(item)).collect(Collectors.toList());
|
||||
//
|
||||
// String errorMsg = "";
|
||||
// String checkHeaderI18n = SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 101850, "缺少如下列,请检查:");
|
||||
// if (CollectionUtils.isEmpty(attendQuoteFields)) {
|
||||
// errorMsg = SalaryI18nUtil.getI18nLabel(tenantKey, currentEmployeeId, 101849, "考勤字段列缺失,请补充");
|
||||
// } else if (CollectionUtils.isNotEmpty(lackHeaders)) {
|
||||
// errorMsg = checkHeaderI18n + Joiner.on(",").join(lackHeaders);
|
||||
// }
|
||||
// // 有错误信息发送
|
||||
// if (com.weaver.teams.util.StringUtils.isNotEmpty(errorMsg)) {
|
||||
// // 发送导入回调信息
|
||||
// salaryBatchService.sendImportCallBackInfo(message, errorMsg);
|
||||
// isValid = false;
|
||||
// }
|
||||
// return isValid;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 检查列头
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private boolean checkHeaders(List<String> headerList, List<AttendQuoteFieldPO> attendQuoteFields) {
|
||||
boolean isValid = true;
|
||||
String userNameI18n = SalaryI18nUtil.getI18nLabel(85429, "姓名");
|
||||
|
||||
List<String> mustHeaders = attendQuoteFields.stream().map(AttendQuoteFieldPO::getFieldName).collect(Collectors.toList());
|
||||
mustHeaders.add(userNameI18n);
|
||||
|
||||
// 缺少的必须列
|
||||
List<String> lackHeaders = mustHeaders.stream().filter(item -> !headerList.contains(item)).collect(Collectors.toList());
|
||||
|
||||
String errorMsg = "";
|
||||
String checkHeaderI18n = SalaryI18nUtil.getI18nLabel(101850, "缺少如下列,请检查:");
|
||||
if (CollectionUtils.isEmpty(attendQuoteFields)) {
|
||||
errorMsg = SalaryI18nUtil.getI18nLabel(101849, "考勤字段列缺失,请补充");
|
||||
} else if (CollectionUtils.isNotEmpty(lackHeaders)) {
|
||||
errorMsg = checkHeaderI18n + Joiner.on(",").join((Iterable<?>) lackHeaders);
|
||||
}
|
||||
if (StringUtils.isNotEmpty(errorMsg)) {
|
||||
throw new SalaryRunTimeException(errorMsg);
|
||||
}
|
||||
return isValid;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.AttendQuoteFieldBiz;
|
||||
import com.engine.salary.biz.AttendQuoteFieldSettingBiz;
|
||||
|
|
@ -16,10 +17,12 @@ import com.engine.salary.entity.datacollection.po.AttendQuoteFieldSettingPO;
|
|||
import com.engine.salary.enums.datacollection.AttendQuoteFieldSourceTypeEnum;
|
||||
import com.engine.salary.enums.datacollection.AttendQuoteSourceTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.service.AttendQuoteFieldService;
|
||||
import com.engine.salary.service.AttendQuoteFieldSettingService;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
|
@ -47,13 +50,12 @@ public class AttendQuoteFieldSettingServiceImpl extends Service implements Atten
|
|||
// private AttendQuoteFieldMapper attendQuoteFieldMapper;
|
||||
// @Autowired
|
||||
// private LoggerTemplate attendQuoteFieldSettingLoggerTemplate;
|
||||
// @Resource
|
||||
// private AttendQuoteFieldService attendQuoteFieldService;
|
||||
|
||||
private AttendQuoteFieldService getAttendQuoteFieldService(User user) {
|
||||
return (AttendQuoteFieldService) ServiceUtil.getService(AttendQuoteFieldServiceImpl.class, user);
|
||||
}
|
||||
@Override
|
||||
public List<AttendQuoteFieldSettingListDTO> list(AttendQuoteFieldSettingQueryParam queryParam) {
|
||||
// todo 同步字段
|
||||
//attendQuoteFieldService.syncAttendFields(employeeId, tenantKey);
|
||||
getAttendQuoteFieldService(user).syncAttendFields();
|
||||
// 获取字段设置
|
||||
List<AttendQuoteFieldSettingPO> list = biz.getAttendQuoteFieldSetting(queryParam.getSourceType());
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import javax.ws.rs.core.Response;
|
|||
import javax.ws.rs.core.StreamingOutput;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDate;
|
||||
import java.time.YearMonth;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
|
@ -121,9 +122,9 @@ public class AttendQuoteController {
|
|||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100250, "薪资所属月和薪资账套id不能为空"));
|
||||
}
|
||||
XSSFWorkbook workbook = getAttendQuoteDataWrapper(user).downloadTemplate(param);
|
||||
String fileName = null;
|
||||
String fileName = "考勤引用导入模板" + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode("考勤引用导入模板.xlsx", "UTF-8");
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -139,6 +140,35 @@ public class AttendQuoteController {
|
|||
.header("Cache-Control", "no-cache").build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 预览
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/preview")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String preview(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AttendQuoteDataImportParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AttendQuoteDataImportParam, Map<String, Object>>().run(getAttendQuoteDataWrapper(user)::preview, queryParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入考勤数据
|
||||
*
|
||||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/importAttendQuoteData")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String importAttendQuoteData(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody AttendQuoteDataImportParam queryParam) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<AttendQuoteDataImportParam, Map<String, Object>>().run(getAttendQuoteDataWrapper(user)::importAttendQuoteData, queryParam);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查看考勤数据
|
||||
|
|
@ -181,9 +211,9 @@ public class AttendQuoteController {
|
|||
String attendQuoteId = request.getParameter("attendQuoteId");
|
||||
AttendQuoteDataQueryParam param = AttendQuoteDataQueryParam.builder().attendQuoteId(Long.valueOf(attendQuoteId)).build();
|
||||
XSSFWorkbook workbook = getAttendQuoteDataWrapper(user).export(param);
|
||||
String fileName = null;
|
||||
String fileName = "考勤导出" + LocalDate.now();
|
||||
try {
|
||||
fileName = URLEncoder.encode("考勤导出.xlsx", "UTF-8");
|
||||
fileName = URLEncoder.encode(fileName + ".xlsx", "UTF-8");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.datacollection.dto.AttendQuoteDataBaseDTO;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataExportTemplateParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataImportParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataQueryParam;
|
||||
import com.engine.salary.entity.datacollection.param.AttendQuoteDataSyncParam;
|
||||
import com.engine.salary.entity.datacollection.po.AttendQuoteFieldPO;
|
||||
|
|
@ -40,11 +41,11 @@ public class AttendQuoteDataWrapper extends Service {
|
|||
private AttendQuoteDataService getAttendQuoteDataService(User user) {
|
||||
return (AttendQuoteDataService) ServiceUtil.getService(AttendQuoteDataServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private AttendQuoteFieldService getAttendQuoteFieldService(User user) {
|
||||
return (AttendQuoteFieldService) ServiceUtil.getService(AttendQuoteFieldServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
private ExecutorService taskExecutor;
|
||||
|
||||
/**
|
||||
|
|
@ -63,7 +64,7 @@ public class AttendQuoteDataWrapper extends Service {
|
|||
* @param queryParam
|
||||
* @return
|
||||
*/
|
||||
public Map<String,Object> view(AttendQuoteDataQueryParam queryParam) {
|
||||
public Map<String, Object> view(AttendQuoteDataQueryParam queryParam) {
|
||||
Long id = queryParam.getAttendQuoteId();
|
||||
if (id == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(100253, "考勤引用id不能为空"));
|
||||
|
|
@ -82,10 +83,10 @@ public class AttendQuoteDataWrapper extends Service {
|
|||
|
||||
// 表格表头
|
||||
List<WeaTableColumn> columns = new ArrayList<>();
|
||||
columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel( 85429, "姓名"), "username", "150"));
|
||||
columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel( 86185, "部门"), "departmentName", "150"));
|
||||
columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel( 86186, "手机号"), "mobile", "150"));
|
||||
columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel( 86317, "工号"), "jobNum", "150"));
|
||||
columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(85429, "姓名"), "username", "150"));
|
||||
columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86185, "部门"), "departmentName", "150"));
|
||||
columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86186, "手机号"), "mobile", "150"));
|
||||
columns.add(new WeaTableColumn(SalaryI18nUtil.getI18nLabel(86317, "工号"), "jobNum", "150"));
|
||||
// 动态列
|
||||
if (CollectionUtils.isNotEmpty(listMaps)) {
|
||||
Map<String, Object> map = listMaps.get(0);
|
||||
|
|
@ -104,9 +105,9 @@ public class AttendQuoteDataWrapper extends Service {
|
|||
result.putAll(weaTable.makeDataResult());
|
||||
result.success();
|
||||
|
||||
Map<String,Object> datas = new HashMap<>();
|
||||
Map<String, Object> datas = new HashMap<>();
|
||||
datas.put("pageInfo", listPage);
|
||||
datas.put("dataKey",result.getResultMap());
|
||||
datas.put("dataKey", result.getResultMap());
|
||||
|
||||
return datas;
|
||||
}
|
||||
|
|
@ -118,7 +119,7 @@ public class AttendQuoteDataWrapper extends Service {
|
|||
* @return
|
||||
*/
|
||||
public XSSFWorkbook downloadTemplate(AttendQuoteDataExportTemplateParam templateParam) {
|
||||
return getAttendQuoteDataService(user).downloadTemplate(templateParam);
|
||||
return getAttendQuoteDataService(user).downloadTemplate(templateParam);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -131,4 +132,24 @@ public class AttendQuoteDataWrapper extends Service {
|
|||
return getAttendQuoteDataService(user).export(queryParam);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预览
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> preview(AttendQuoteDataImportParam param) {
|
||||
return getAttendQuoteDataService(user).preview(param);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导入
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
public Map<String, Object> importAttendQuoteData(AttendQuoteDataImportParam param) {
|
||||
return getAttendQuoteDataService(user).importAttendQuoteData(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue