薪资列表

This commit is contained in:
钱涛 2022-10-10 14:58:29 +08:00
parent 5431ed9506
commit 41203342d0
5 changed files with 306 additions and 5 deletions

View File

@ -152,6 +152,20 @@
<if test="param.hiredate != null and param.hiredate.size() == 2">
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
</if>
<!-- 人事状态 -->
<if test="param.personnelStatuss != null and param.personnelStatuss.size()>0">
AND e.status IN
<foreach collection="param.personnelStatuss" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 档案状态 -->
<if test="param.runStatusList != null and param.runStatusList.size()>0">
AND t1.run_status IN
<foreach collection="param.runStatusList" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
@ -210,6 +224,20 @@
<if test="param.hiredate != null and param.hiredate.size() == 2">
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
</if>
<!-- 人事状态 -->
<if test="param.personnelStatuss != null and param.personnelStatuss.size()>0">
AND e.status IN
<foreach collection="param.personnelStatuss" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 档案状态 -->
<if test="param.runStatusList != null and param.runStatusList.size()>0">
AND t1.run_status IN
<foreach collection="param.runStatusList" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}
@ -269,6 +297,20 @@
<if test="param.hiredate != null and param.hiredate.size() == 2">
AND (e.companystartdate BETWEEN #{param.hiredate[0]} AND #{param.hiredate[1]})
</if>
<!-- 人事状态 -->
<if test="param.personnelStatuss != null and param.personnelStatuss.size()>0">
AND e.status IN
<foreach collection="param.personnelStatuss" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 档案状态 -->
<if test="param.runStatusList != null and param.runStatusList.size()>0">
AND t1.run_status IN
<foreach collection="param.runStatusList" open="(" item="id" separator="," close=")">
#{id}
</foreach>
</if>
<!-- 排序 -->
<if test="param.orderRule != null">
ORDER BY ${param.orderRule.orderRule} ${param.orderRule.ascOrDesc}

View File

@ -164,4 +164,11 @@ public interface SalaryArchiveService {
* @param stopSalaryParam
*/
void stopSalary(SalaryArchiveStopParam stopSalaryParam);
/**
* 获取各tab总人数
*
* @return
*/
Map<String, Long> queryTabTotal();
}

View File

@ -1827,4 +1827,62 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
return map;
}
@Override
public Map<String, Long> queryTabTotal() {
long currentEmployeeId = user.getUID();
// tab页签数量
Map<String, Long> result = new HashMap<>();
Boolean needAuth = getTaxAgentService(user).isNeedAuth(currentEmployeeId);
//获取管理的人员范围
List<TaxAgentManageRangeEmployeeDTO> taxAgentEmployeeDTOS = getTaxAgentService(user).listTaxAgentAndEmployeeTree(currentEmployeeId);
Map<Long, List<TaxAgentManageRangeEmployeeDTO.TaxAgentEmployee>> taxAgentEmployeesMap = SalaryEntityUtil.convert2Map(taxAgentEmployeeDTOS, TaxAgentManageRangeEmployeeDTO::getTaxAgentId, TaxAgentManageRangeEmployeeDTO::getEmployeeList);
List<SalaryArchivePO> list = null;
if (needAuth) {
// 获取作为管理员的所有个税扣缴义务人列表
Collection<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listAllTaxAgentsAsAdmin(currentEmployeeId);
Set<Long> taxAgentIds = SalaryEntityUtil.properties(taxAgentPOS, TaxAgentPO::getId);
//获取所有薪资档案
List<SalaryArchivePO> archiveListDTOS = getSalaryArchiveMapper().listAll();
list = archiveListDTOS.stream().filter(dto -> taxAgentIds.contains(dto.getTaxAgentId())).collect(Collectors.toList());
Boolean adminEnable = getTaxAgentService(user).isAdminEnable(currentEmployeeId);
//不是管理员看不到数据返回空
if (!adminEnable) {
list = new ArrayList<>();
}
} else {
list = getSalaryArchiveMapper().listAll();
}
long pendingTotal = 0L;
long fixedTotal = 0L;
long suspendTotal = 0L;
long stopTotal = 0L;
for (SalaryArchivePO sa : list) {
if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.PENDING.getValue())) {
pendingTotal += 1;
} else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.FIXED.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
fixedTotal += 1;
if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.SUSPEND.getValue())) {
suspendTotal += 1;
}
} else if (sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue()) || sa.getRunStatus().equals(SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
stopTotal += 1;
}
}
result.put(SalaryArchiveListTypeEnum.PENDING.getValue(), pendingTotal);
result.put(SalaryArchiveListTypeEnum.FIXED.getValue(), fixedTotal);
result.put(SalaryArchiveListTypeEnum.SUSPEND.getValue(), suspendTotal);
result.put(SalaryArchiveListTypeEnum.STOP.getValue(), stopTotal);
return result;
}
}

View File

@ -60,6 +60,172 @@ public class SalaryArchiveController {
// /******** 薪资档案主表 start ***********************************************************************************************/
/**
* 获取各tab总人数
*
* @param request
* @param response
* @return
*/
@GET
@Path("/queryTabTotal")
@Produces(MediaType.APPLICATION_JSON)
public String queryTabTotal(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryArchiveQueryParam, Map<String, Long>>(user).run(getSalaryArchiveWrapper(user)::queryTabTotal);
}
// /**
// * 待定薪列表
// *
// * @param queryParam
// * @return
// */
// @PostMapping("/pendingList")
// @ApiOperation("待定薪列表")
// @WeaPermission
// public WeaResult<WeaTable<LinkedHashMap>> pendingList(@RequestBody SalaryArchiveQueryParam queryParam) {
// return WeaResult.success(salaryArchiveWrapper.pendingList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 设为定薪员工
// *
// * @param ids
// * @return
// */
// @PostMapping("/gotoFixed")
// @ApiOperation("设为定薪员工")
// @WeaPermission
// public WeaResult<Map<String, Object>> gotoFixed(@RequestBody Collection<Long> ids) {
// return WeaResult.success(salaryArchiveWrapper.gotoFixed(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 一键全部设为定薪员工
// *
// * @param queryParam
// * @return
// */
// @PostMapping("/allGotoFixed")
// @ApiOperation("一键全部设为定薪员工")
// @WeaPermission
// public WeaResult<Map<String, Object>> allGotoFixed(@RequestBody SalaryArchiveQueryParam queryParam) {
// return WeaResult.success(salaryArchiveWrapper.allGotoFixed(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 删除待定薪待办
// *
// * @param ids
// * @return
// */
// @PostMapping("/deletePendingTodo")
// @ApiOperation("删除待定薪待办")
// @WeaPermission
// public WeaResult<String> deletePendingTodo(@RequestBody Collection<Long> ids) {
// return WeaResult.success(salaryArchiveWrapper.deletePendingTodo(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 定薪列表
// *
// * @param queryParam
// * @return
// */
// @PostMapping("/fixedList")
// @ApiOperation("定薪列表")
// @WeaPermission
// public WeaResult<WeaTable<LinkedHashMap>> fixedList(@RequestBody SalaryArchiveQueryParam queryParam) {
// return WeaResult.success(salaryArchiveWrapper.fixedList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 待停薪列表
// *
// * @param queryParam
// * @return
// */
// @PostMapping("/suspendList")
// @ApiOperation("待停薪列表")
// @WeaPermission
// public WeaResult<WeaTable<LinkedHashMap>> suspendList(@RequestBody SalaryArchiveQueryParam queryParam) {
// return WeaResult.success(salaryArchiveWrapper.suspendList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 停薪
// *
// * @param ids
// * @return
// */
// @PostMapping("/gotoStop")
// @ApiOperation("停薪")
// @WeaPermission
// public WeaResult<Map<String, Object>> gotoStop(@RequestBody Collection<Long> ids) {
// return WeaResult.success(salaryArchiveWrapper.gotoStop(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 一键全部停薪
// *
// * @param queryParam
// * @return
// */
// @PostMapping("/allGotoStop")
// @ApiOperation("一键全部停薪")
// @WeaPermission
// public WeaResult<Map<String, Object>> allGotoStop(@RequestBody SalaryArchiveQueryParam queryParam) {
// return WeaResult.success(salaryArchiveWrapper.allGotoStop(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 删除待停薪待办
// *
// * @param ids
// * @return
// */
// @PostMapping("/deleteSuspendTodo")
// @ApiOperation("删除待停薪待办")
// @WeaPermission
// public WeaResult<String> deleteSuspendTodo(@RequestBody Collection<Long> ids) {
// return WeaResult.success(salaryArchiveWrapper.deleteSuspendTodo(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 停薪列表
// *
// * @param queryParam
// * @return
// */
// @PostMapping("/stopList")
// @ApiOperation("停薪列表")
// @WeaPermission
// public WeaResult<WeaTable<LinkedHashMap>> stopList(@RequestBody SalaryArchiveQueryParam queryParam) {
// return WeaResult.success(salaryArchiveWrapper.stopList(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
// /**
// * 取消停薪
// *
// * @param ids
// * @return
// */
// @PostMapping("/cancelStop")
// @ApiOperation("取消停薪")
// @WeaPermission
// public WeaResult<String> cancelStop(@RequestBody Collection<Long> ids) {
// return WeaResult.success(salaryArchiveWrapper.cancelStop(ids, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
//
//
//
/**
* 薪资档案列表
*
@ -71,7 +237,7 @@ public class SalaryArchiveController {
@Produces(MediaType.APPLICATION_JSON)
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveQueryParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryArchiveQueryParam, Map<String, Object>>(user).run(getSalaryArchiveWrapper(user)::list, queryParam);
return new ResponseResult<SalaryArchiveQueryParam, Map<String, Object>>(user).run(getSalaryArchiveWrapper(user)::listPage, queryParam);
}
/**
@ -263,6 +429,7 @@ public class SalaryArchiveController {
/**
* 导入薪资档案附件上传前置校验
*
* @param importParam
* @return
*/
@ -298,7 +465,7 @@ public class SalaryArchiveController {
@Produces(MediaType.APPLICATION_JSON)
public String stopSalary(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryArchiveStopParam stopSalaryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<SalaryArchiveStopParam, String>(user).run(getSalaryArchiveWrapper(user)::stopSalary,stopSalaryParam);
return new ResponseResult<SalaryArchiveStopParam, String>(user).run(getSalaryArchiveWrapper(user)::stopSalary, stopSalaryParam);
}
// ******** 薪资档案主表 end ***********************************************************************************************/

View File

@ -20,9 +20,7 @@ import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
import com.engine.salary.entity.taxagent.dto.TaxAgentListDTO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.enums.UserStatusEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveImportTypeEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveTaxAgentAdjustReasonEnum;
import com.engine.salary.enums.salaryarchive.*;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.service.SalaryArchiveItemService;
import com.engine.salary.service.SalaryArchiveService;
@ -111,6 +109,30 @@ public class SalaryArchiveWrapper extends Service {
return datas;
}
/**
* 获取各tab总人数
*
* @return
*/
public Map<String, Long> queryTabTotal() {
return getSalaryArchiveService(user).queryTabTotal();
}
/**
* 待定薪列表
*
* @param queryParam
* @return
*/
public Map<String, Object> listPage(SalaryArchiveQueryParam queryParam) {
// queryParam.setRunStatusList(Arrays.asList(SalaryArchiveStatusEnum.FIXED.getValue()));
// WeaTable<LinkedHashMap> weaTable = list(queryParam, SalaryArchiveListTypeEnum.PENDING);
Map<String, Object> list = list(queryParam);
return list;
}
/**
* 获取薪资档案详情表单
*
@ -300,6 +322,7 @@ public class SalaryArchiveWrapper extends Service {
/**
* 检查导入文件
*
* @param param
* @return
*/
@ -347,10 +370,14 @@ public class SalaryArchiveWrapper extends Service {
/**
* 停薪
*
* @param stopSalaryParam
* @return
*/
public void stopSalary(SalaryArchiveStopParam stopSalaryParam) {
getSalaryArchiveService(user).stopSalary(stopSalaryParam);
}
}