出勤、应出勤导入bug修改

master^2 056
hshansha 6 months ago
parent 55b97c14d6
commit c33b5369c2

@ -81,6 +81,7 @@ public class PayRequireAttendanceReportController extends BaseController {
PayRequireAttendanceReportBo report = new PayRequireAttendanceReportBo(); PayRequireAttendanceReportBo report = new PayRequireAttendanceReportBo();
report.setYear(date.split("-")[0]); report.setYear(date.split("-")[0]);
report.setMonth(date.split("-")[1]); report.setMonth(date.split("-")[1]);
report.setTenantId(tenantId);
List<PayRequireAttendanceReportVo> occupaReports= iPayRequireAttendanceReportService.queryList(report); List<PayRequireAttendanceReportVo> occupaReports= iPayRequireAttendanceReportService.queryList(report);
if(occupaReports!=null&&occupaReports.size()>0){//判断是否有当月应出勤信息 if(occupaReports!=null&&occupaReports.size()>0){//判断是否有当月应出勤信息
if(!updateSupport){ if(!updateSupport){

@ -3,6 +3,7 @@ package com.ruoyi.pay.mapper;
import com.ruoyi.pay.domain.PayAttendance; import com.ruoyi.pay.domain.PayAttendance;
import com.ruoyi.pay.domain.vo.PayAttendanceVo; import com.ruoyi.pay.domain.vo.PayAttendanceVo;
import com.ruoyi.common.core.mapper.BaseMapperPlus; import com.ruoyi.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
/** /**
@ -13,6 +14,6 @@ import org.apache.ibatis.annotations.Select;
*/ */
public interface PayAttendanceMapper extends BaseMapperPlus<PayAttendanceMapper, PayAttendance, PayAttendanceVo> { public interface PayAttendanceMapper extends BaseMapperPlus<PayAttendanceMapper, PayAttendance, PayAttendanceVo> {
@Select({" select e.id employeeId,d.dept_id deptId,d.dept_name deptName from pay_employee_info e join sys_dept d on e.dept_id=d.dept_id " + @Select({" select e.id employeeId,d.dept_id deptId,d.dept_name deptName from pay_employee_info e join sys_dept d on e.dept_id=d.dept_id " +
" where e.name=#{name} and e.deleted=0"} ) " where e.name=#{empName} and e.deleted=0 and e.tenant_id=#{tenantId}"} )
PayAttendance selectEmpInfoByName(String empName); PayAttendance selectEmpInfoByName(@Param("empName") String empName, @Param("tenantId")Long tenantId);
} }

@ -47,7 +47,7 @@ public interface IPayAttendanceService {
*/ */
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid); Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
PayAttendance selectEmpInfoByName(String empName); PayAttendance selectEmpInfoByName(String empName, Long tenantId);
String importAttendance(List<PayAttendanceBo> attendanceList, boolean updateSupport, String date); String importAttendance(List<PayAttendanceBo> attendanceList, boolean updateSupport, String date);
} }

@ -121,8 +121,8 @@ public class PayAttendanceServiceImpl implements IPayAttendanceService {
} }
@Override @Override
public PayAttendance selectEmpInfoByName(String empName) { public PayAttendance selectEmpInfoByName(String empName, Long tenantId) {
return baseMapper.selectEmpInfoByName(empName); return baseMapper.selectEmpInfoByName(empName,tenantId);
} }
@Override @Override
@ -143,6 +143,7 @@ public class PayAttendanceServiceImpl implements IPayAttendanceService {
PayAttendanceBo query = new PayAttendanceBo(); PayAttendanceBo query = new PayAttendanceBo();
query.setKaoqinDate(attendance.getKaoqinDate()); query.setKaoqinDate(attendance.getKaoqinDate());
query.setEmpName(attendance.getEmpName()); query.setEmpName(attendance.getEmpName());
query.setTenantId(attendance.getTenantId());
List<PayAttendanceVo> attendances=this.queryList(query); List<PayAttendanceVo> attendances=this.queryList(query);
if (null==attendances||attendances.size()==0) if (null==attendances||attendances.size()==0)
{ {

@ -161,7 +161,7 @@ public class PayRequireAttendanceReportServiceImpl implements IPayRequireAttenda
String name = attendanceReport.getEmpName(); String name = attendanceReport.getEmpName();
//根据员工name查询员工id、部门id、部门名称 //根据员工name查询员工id、部门id、部门名称
PayAttendance info = attendanceMapper.selectEmpInfoByName(name); PayAttendance info = attendanceMapper.selectEmpInfoByName(name, tenantId);
if(info==null){ if(info==null){
throw new IOException("请先在员工表中添加员工:"+name); throw new IOException("请先在员工表中添加员工:"+name);
} }

@ -1,8 +1,6 @@
package com.ruoyi.pay.util; package com.ruoyi.pay.util;
import cn.hutool.core.lang.Dict;
import com.ruoyi.common.core.service.DictService; import com.ruoyi.common.core.service.DictService;
import com.ruoyi.common.helper.LoginHelper;
import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.pay.domain.PayAttendance; import com.ruoyi.pay.domain.PayAttendance;
import com.ruoyi.pay.domain.bo.PayAttendanceBo; import com.ruoyi.pay.domain.bo.PayAttendanceBo;
@ -15,14 +13,11 @@ import org.apache.poi.ss.usermodel.Row;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import javax.annotation.PostConstruct;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
@ -186,7 +181,7 @@ public class AttendanceExcelUtil {
String wid = this.getCellValue(row1, 2).toString();//考勤机工号 String wid = this.getCellValue(row1, 2).toString();//考勤机工号
String wname = this.getCellValue(row1, 10).toString(); String wname = this.getCellValue(row1, 10).toString();
//根据员工name查询员工id、部门id、部门名称 //根据员工name查询员工id、部门id、部门名称
PayAttendance info = iPayAttendanceService.selectEmpInfoByName(wname); PayAttendance info = iPayAttendanceService.selectEmpInfoByName(wname,tenantId);
if(info==null){ if(info==null){
throw new IOException("请先在员工表中添加员工:"+wname+" 或者考勤机选择错误"); throw new IOException("请先在员工表中添加员工:"+wname+" 或者考勤机选择错误");
} }
@ -431,7 +426,7 @@ public class AttendanceExcelUtil {
String wid = this.getCellValue(row1, 0).toString();//考勤机工号 String wid = this.getCellValue(row1, 0).toString();//考勤机工号
String wname = this.getCellValue(row1, 1).toString();//姓名 String wname = this.getCellValue(row1, 1).toString();//姓名
//根据员工name查询员工id、部门id、部门名称 //根据员工name查询员工id、部门id、部门名称
PayAttendance info = iPayAttendanceService.selectEmpInfoByName(wname); PayAttendance info = iPayAttendanceService.selectEmpInfoByName(wname, tenantId);
if(info==null){ if(info==null){
throw new IOException("请先在员工表中添加员工:"+wname+" 或者考勤机选择错误"); throw new IOException("请先在员工表中添加员工:"+wname+" 或者考勤机选择错误");
} }

Loading…
Cancel
Save