buhuazhen
2 天以前 9a5d984a74d5f893fc51366b42391d9b4f8a83ed
src/main/java/com/ruoyi/staff/service/impl/StaffSalaryMainServiceImpl.java
@@ -12,12 +12,10 @@
import com.ruoyi.project.system.mapper.SysUserDeptMapper;
import com.ruoyi.project.system.mapper.SysUserMapper;
import com.ruoyi.staff.dto.CalculateSalaryDto;
import com.ruoyi.staff.mapper.StaffLeaveMapper;
import com.ruoyi.staff.mapper.StaffOnJobMapper;
import com.ruoyi.staff.mapper.StaffSalaryDetailMapper;
import com.ruoyi.staff.pojo.SchemeApplicableStaff;
import com.ruoyi.staff.pojo.StaffOnJob;
import com.ruoyi.staff.pojo.StaffSalaryDetail;
import com.ruoyi.staff.pojo.StaffSalaryMain;
import com.ruoyi.staff.pojo.*;
import com.ruoyi.staff.mapper.StaffSalaryMainMapper;
import com.ruoyi.staff.service.StaffSalaryDetailService;
import com.ruoyi.staff.service.StaffSalaryMainService;
@@ -61,6 +59,9 @@
    @Autowired
    private StaffOnJobMapper staffOnJobMapper;
    @Autowired
    private StaffLeaveMapper staffLeaveMapper;
    @Autowired
    private AccountExpenseMapper accountExpenseMapper;
@@ -155,10 +156,21 @@
        if(CollectionUtils.isEmpty(longs)){
            return AjaxResult.error("无员工");
        }
        List<Map<String, Object>> mapList = new ArrayList<>();
        for (Map<String, Object> id : longs) {
            // 判断员工是否为当月离职
            if((Integer) id.get("staffState") == 0){
                StaffLeave id1 = staffLeaveMapper.selectOne(new LambdaQueryWrapper<StaffLeave>()
                        .eq(StaffLeave::getStaffOnJobId, id.get("id"))
                        .like(StaffLeave::getLeaveDate, calculateSalaryDto.getDate()));
                if(id1 == null){
                    continue;
                }
            }
            schemeApplicableStaffService.calculateByEmployeeId((Integer) id.get("id"),id,calculateSalaryDto.getDate());
            mapList.add(id);
        }
        return AjaxResult.success(longs);
        return AjaxResult.success(mapList);
    }
    public List<Map<String, Object>> setSchemeApplicableStaffUserInfo(List<Long> ids) {