修改sql
This commit is contained in:
parent
5c550365f1
commit
f8a704e66c
|
|
@ -1,20 +1,20 @@
|
|||
package com.engine.salary.entity.salaryarchive.param;
|
||||
|
||||
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.dto.TaxAgentListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveEmployeePO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveItemPO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchiveTaxAgentPO;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.taxrate.TaxAgent;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -31,15 +31,31 @@ import java.util.List;
|
|||
@AllArgsConstructor
|
||||
public class SalaryArchiveImportHandleParam {
|
||||
|
||||
//**********************前端需传入参数**************************/
|
||||
|
||||
/**
|
||||
* 上传文件id
|
||||
*/
|
||||
String imageId;
|
||||
|
||||
/**
|
||||
* 导入类型
|
||||
*
|
||||
* @see SalaryArchiveImportTypeEnum
|
||||
*/
|
||||
String importType;
|
||||
|
||||
//************************************************************/
|
||||
|
||||
/**
|
||||
* 获取租户下所有的人员
|
||||
*/
|
||||
List<SalaryArchiveEmployeePO> employees;
|
||||
List<DataCollectionEmployee> employees;
|
||||
|
||||
/**
|
||||
* 获取所有个税扣缴义务人
|
||||
*/
|
||||
Collection<TaxAgentListDTO> taxAgentList;
|
||||
Collection<TaxAgent> taxAgentList;
|
||||
|
||||
/**
|
||||
* 获取所有可被引用的薪资项目
|
||||
|
|
@ -79,12 +95,12 @@ public class SalaryArchiveImportHandleParam {
|
|||
/**
|
||||
* 当前时间
|
||||
*/
|
||||
LocalDateTime nowTime = LocalDateTime.now();
|
||||
Date nowTime = new Date();
|
||||
|
||||
/**
|
||||
* 当天
|
||||
*/
|
||||
LocalDate today = LocalDate.now();
|
||||
Date today = new Date();
|
||||
|
||||
/**
|
||||
* 待保存薪资档案
|
||||
|
|
|
|||
|
|
@ -92,7 +92,9 @@ public class SalarySobItemPO {
|
|||
Collection<Long> ids;
|
||||
Collection<Long> salarySobIds;
|
||||
|
||||
//not in
|
||||
|
||||
Collection<Long> salaryItemIds;
|
||||
|
||||
Collection<Long> notInSalaryItemIds;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,12 @@
|
|||
#{salaryItemId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="notInSalaryItemIds != null and notInSalaryItemIds.size()>0">
|
||||
AND salary_item_id NOT IN
|
||||
<foreach collection="notInSalaryItemIds" open="(" item="salaryItemId" separator="," close=")">
|
||||
#{salaryItemId}
|
||||
</foreach>
|
||||
</if>
|
||||
ORDER BY id DESC
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -32,10 +32,13 @@ import java.util.*;
|
|||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 数据采集-考勤引用数据
|
||||
* @Author: wangxiangzhong
|
||||
* @Date: 2021-11-17 14:37
|
||||
*/
|
||||
* 数据采集-考勤引用数据
|
||||
* <p>Copyright: Copyright (c) 2022</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
public class AttendQuoteDataServiceImpl extends Service implements AttendQuoteDataService {
|
||||
|
||||
private AttendQuoteBiz quoteBiz = new AttendQuoteBiz();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -73,7 +73,7 @@ public class SalarySobItemServiceImpl extends Service implements SalarySobItemSe
|
|||
|
||||
@Override
|
||||
public List<SalarySobItemPO> listBySalarySobIdAndSalaryItemIdNotIn(Long salarySobId, Collection<Long> salaryItemIds) {
|
||||
return salarySobItemMapper.listSome(SalarySobItemPO.builder().salarySobId(salarySobId).salaryItemIds(salaryItemIds).build());
|
||||
return salarySobItemMapper.listSome(SalarySobItemPO.builder().salarySobId(salarySobId).notInSalaryItemIds(salaryItemIds).build());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import java.io.InputStream;
|
||||
import java.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
/**
|
||||
* Excel 解析工具类
|
||||
|
|
@ -121,6 +121,35 @@ public class ExcelParseHelper {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将sheet数据转为map
|
||||
* @param file
|
||||
* @param sheetIndex sheet下标
|
||||
* @param rowIndex 从哪行开始解析
|
||||
* @return
|
||||
*/
|
||||
public static List<Map<String, Object>> parse(InputStream file, int sheetIndex, int rowIndex) {
|
||||
Sheet sheet = ExcelSupport.parseFile(file, sheetIndex, EXCEL_TYPE_XLSX);
|
||||
int rowCount = sheet.getPhysicalNumberOfRows(); // 总行数
|
||||
int cellCount = sheet.getRow(PARSE_EXCEL_ROW_VALID_CELL_INDEX).getPhysicalNumberOfCells(); // 总列数
|
||||
|
||||
List<String> sheetHeader = ExcelSupport.getSheetHeader(sheet, PARSE_EXCEL_ROW_VALID_CELL_INDEX);
|
||||
|
||||
List<Map<String, Object>> result = new ArrayList<>();
|
||||
for (; rowIndex < rowCount; rowIndex++) {
|
||||
Map<String, Object> cellResult = new HashMap<>();
|
||||
for (int j = 0; j < cellCount; j++) {
|
||||
String key = sheetHeader.get(j);
|
||||
cellResult.put(key, ExcelSupport.getCellValue(sheet, rowIndex, j));
|
||||
}
|
||||
result.add(cellResult);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 为对象的每一个属性赋值
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2,10 +2,7 @@ package com.engine.salary.util.excel;
|
|||
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.DateUtil;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
|
|
@ -13,7 +10,10 @@ import java.io.BufferedInputStream;
|
|||
import java.io.InputStream;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import static org.apache.poi.ss.usermodel.CellType.STRING;
|
||||
|
||||
|
|
@ -23,8 +23,8 @@ public class ExcelSupport {
|
|||
private static final String pattern = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
//excel类型
|
||||
private static final String EXCEL_TYPE_XLSX = "xlsx";
|
||||
private static final String EXCEL_TYPE_XLS = "xls";
|
||||
public static final String EXCEL_TYPE_XLSX = "xlsx";
|
||||
public static final String EXCEL_TYPE_XLS = "xls";
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -73,6 +73,26 @@ public class ExcelSupport {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取sheet的头列
|
||||
*
|
||||
* @param sheet
|
||||
* @param headerIndex 头下标
|
||||
* @return
|
||||
*/
|
||||
public static List<String> getSheetHeader(Sheet sheet, int headerIndex) {
|
||||
List<java.lang.String> headers = new ArrayList<>();
|
||||
Row headerRow = sheet.getRow(headerIndex);
|
||||
Iterator cellIterator = headerRow.cellIterator();
|
||||
while (cellIterator.hasNext()) {
|
||||
Cell cell = (Cell) cellIterator.next();
|
||||
java.lang.String stringCellValue = cell.getStringCellValue();
|
||||
headers.add(stringCellValue);
|
||||
}
|
||||
return headers;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回指定单元格的数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -185,12 +185,11 @@ public class ExcelUtil {
|
|||
}
|
||||
|
||||
if(CollectionUtils.isNotEmpty(comments)){
|
||||
comments.forEach(c -> {
|
||||
for (ExcelComment c:comments) {
|
||||
XSSFDrawing patr = sheet.createDrawingPatriarch();
|
||||
XSSFComment cellComment = patr.createCellComment(new XSSFClientAnchor(c.dx1, c.dy1, c.dx2, c.dy2, c.col1, c.row1, c.col2, c.row2));
|
||||
cellComment.setString(c.content);
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
return workbook;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import com.engine.salary.service.SalaryArchiveItemService;
|
|||
import com.engine.salary.service.SalaryArchiveService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.SalaryArchiveItemServiceImpl;
|
||||
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
|
@ -45,7 +44,8 @@ import java.util.stream.Collectors;
|
|||
public class SalaryArchiveWrapper extends Service {
|
||||
|
||||
private SalaryArchiveService getSalaryArchiveService(User user) {
|
||||
return (SalaryArchiveService) ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
return null;
|
||||
// return (SalaryArchiveService) ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private SalaryArchiveItemService getSalaryArchiveItemService(User user) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue