package com.engine.salary.web; import com.engine.common.util.ServiceUtil; import com.engine.salary.entity.salaryacct.dto.SalaryAcctRecordFormDTO; import com.engine.salary.entity.salaryacct.param.SalaryAcctRecordQueryParam; import com.engine.salary.util.ResponseResult; import com.engine.salary.util.page.PageInfo; import com.engine.salary.wrapper.SalaryAcctRecordWrapper; import io.swagger.v3.oas.annotations.parameters.RequestBody; import weaver.hrm.HrmUserVarify; import weaver.hrm.User; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.*; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; /** * 薪资核算 *

Copyright: Copyright (c) 2022

*

Company: 泛微软件

* * @author qiantao * @version 1.0 **/ public class SalaryAcctController { private SalaryAcctRecordWrapper salaryAcctRecordWrapper; private SalaryAcctRecordWrapper getSalaryAcctRecordWrapper(User user) { return (SalaryAcctRecordWrapper) ServiceUtil.getService(SalaryAcctRecordWrapper.class, user); } // private SalaryAcctEmployeeWrapper salaryAcctEmployeeWrapper; // private SalaryAcctResultWrapper salaryAcctResultWrapper; // private SalaryAcctCheckResultWrapper salaryAcctCheckResultWrapper; // private SalaryComparisonResultWrapper salaryComparisonResultWrapper; // private SalaryAcctExcelWrapper salaryAcctExcelWrapper; // private SalaryAcctExcelService salaryAcctExcelService; // private SalaryBatchService salaryBatchService; // // /**********************************薪资核算记录相关 start*********************************/ //薪资核算列表 @POST @Path("/list") @Produces(MediaType.APPLICATION_JSON) public String list(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody SalaryAcctRecordQueryParam queryParam) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult().run(getSalaryAcctRecordWrapper(user)::listPage, queryParam); } //薪资核算详情 @GET @Path("/getForm") @Produces(MediaType.APPLICATION_JSON) public String getForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) { User user = HrmUserVarify.getUser(request, response); return new ResponseResult().run(getSalaryAcctRecordWrapper(user)::getForm, id); } // // @GetMapping("/getSalarySobCycle") // @ApiOperation(("获取薪资核算的薪资周期、考勤周期等")) // @WeaPermission // public WeaResult getSalarySobCycle(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { // SalarySobCycleDTO salarySobCycle = salaryAcctRecordWrapper.getSalarySobCycleById(salaryAcctRecordId, TenantContext.getCurrentTenantKey()); // return WeaResult.success(salarySobCycle); // } // // @PostMapping("/basic/save") // @ApiOperation("保存薪资核算的基本信息") // @WeaPermission // public WeaResult saveBasic(@RequestBody @Validated SalaryAcctRecordSaveParam saveParam) { // Long salaryAcctRecordId = salaryAcctRecordWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(salaryAcctRecordId); // } // // @PostMapping("/delete") // @ApiOperation("删除薪资核算记录") // @WeaPermission // public WeaResult deleteSalaryAcctRecord(@RequestBody Collection ids) { // salaryAcctRecordWrapper.delete(ids, TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/file") // @ApiOperation("归档薪资核算记录") // @WeaPermission // public WeaResult fileSalaryAcctRecord(@RequestParam(value = "id") Long id) { // salaryAcctRecordWrapper.file(id, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/reAccounting") // @ApiOperation("重新核算") // @WeaPermission // public WeaResult reAccounting(@RequestBody @Validated SalaryAcctRecordReAccountParam param) { // salaryAcctRecordWrapper.reCalculate(param.getSalaryAcctRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @GetMapping("/hasConsolidatedTax") // @ApiOperation("判断是否存在合并计税") // @WeaPermission // public WeaResult hasConsolidatedTax(@RequestParam(value = "id") Long id) { // Integer result = salaryAcctRecordWrapper.hasConsolidatedTax(id, TenantContext.getCurrentTenantKey()); // return WeaResult.success(result); // } // // /**********************************薪资核算记录相关 end*********************************/ // // // /**********************************薪资核算人员相关 start*********************************/ // // @PostMapping("/acctemployee/list") // @ApiOperation("薪资核算人员确认列表") // @WeaPermission // public WeaResult> listSalaryAccountingEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) { // WeaTable weaTable = salaryAcctEmployeeWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(weaTable); // } // // @PostMapping("/reducedemployee/list") // @ApiOperation("薪资核算环比上期减少人员列表") // @WeaPermission // public WeaResult> listReducedEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) { // WeaTable weaTable = salaryAcctEmployeeWrapper.listPage4Reduce(queryParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(weaTable); // } // // @GetMapping("/acctemployee/getSearchCondition") // @ApiOperation("薪资核算人员高级搜索") // @WeaPermission // public WeaResult getAcctEmpSearchCondition() { // WeaSearchCondition searchCondition = salaryAcctEmployeeWrapper.getCondition(TenantContext.getCurrentTenantKey()); // return WeaResult.success(searchCondition); // } // // @PostMapping("/acctemployee/save") // @ApiOperation("添加薪资核算人员") // @WeaPermission // public WeaResult saveSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeSaveParam saveParam) { // salaryAcctEmployeeWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/acctemployee/delete") // @ApiOperation("删除薪资核算人员") // @WeaPermission // public WeaResult deleteSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeDeleteParam deleteParam) { // salaryAcctEmployeeWrapper.delete(deleteParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/acctemployee/checkTaxAgent") // @ApiOperation("检查薪资核算人员的个税扣缴义务人") // @WeaPermission // public WeaResult checkTaxAgent(@RequestBody @Validated SalaryAcctEmpCheckTaxAgentParam param) { // salaryAcctEmployeeWrapper.checkTaxAgent(param.getSalaryAcctRecordId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/acctemployee/refreshTaxAgent") // @ApiOperation("刷新薪资核算人员的个税扣缴义务人") // @WeaPermission // public WeaResult refreshTaxAgent(@RequestBody @Validated SalaryAcctEmpRefreshTaxAgentParam param) { // salaryAcctEmployeeWrapper.refreshTaxAgent(param.getSalaryAcctRecordId(), UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/acctemployee/addFromReduce") // @ApiOperation("从环比上月减少添加薪资核算人员") // @WeaPermission // public WeaResult addFromReduce(@RequestBody @Validated SalaryAcctEmployeeAddParam param) { // salaryAcctEmployeeWrapper.addFromReduce(param, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/acctemployee/export") // @ApiOperation("导出人员范围") // @WeaPermission // public WeaResult> exportSalaryAcctEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) { // SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); // String eteamsId = TenantRpcContext.getEteamsId(); // Map map = salaryAcctExcelWrapper.exportSalaryAcctEmployee(queryParam, simpleEmployee, tenantKey, eteamsId); // return WeaResult.success(map); // } // // @PostMapping("/reducedemployee/export") // @ApiOperation("导出环比减少人员") // @WeaPermission // public WeaResult> exportReducedEmployee(@RequestBody @Validated SalaryAcctEmployeeQueryParam queryParam) { // SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); // String eteamsId = TenantRpcContext.getEteamsId(); // Map map = salaryAcctExcelWrapper.exportReducedEmployee(queryParam, simpleEmployee, tenantKey, eteamsId); // return WeaResult.success(map); // } // // /**********************************薪资核算人员相关 end*********************************/ // // /**********************************薪资核算结果 start*********************************/ // // @PostMapping("/acctresult/list") // @ApiOperation(("薪资核算结果列表")) // @WeaPermission // public WeaResult>> listSalaryAcctResult(@RequestBody @Validated SalaryAcctResultQueryParam queryParam) { // WeaTable> weaTable = salaryAcctResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(weaTable); // } // // @GetMapping("/acctresult/getSearchCondition") // @ApiOperation(("获取薪资核算结果高级搜索")) // @WeaPermission // public WeaResult getSalaryAcctResultSearchCondition() { // WeaSearchCondition searchCondition = salaryAcctResultWrapper.getSearchCondition(TenantContext.getCurrentTenantKey()); // return WeaResult.success(searchCondition); // } // // @GetMapping("/acctresult/detail") // @ApiOperation(("薪资核算结果详情")) // @WeaPermission // public WeaResult getSalaryAcctResultDetail(@RequestParam(value = "id") Long id) { // SalaryAcctResultDetailDTO dto = salaryAcctResultWrapper.getForm(id, TenantContext.getCurrentTenantKey()); // return WeaResult.success(dto); // } // // @GetMapping("/acctresult/getConsolidatedTaxDetail") // @ApiOperation(("薪资核算合并计税详情")) // @WeaPermission // public WeaResult getConsolidatedTaxDetail(@RequestParam(value = "salaryAcctEmpId") Long salaryAcctEmpId) { // ConsolidatedTaxDetailDTO dto = salaryAcctResultWrapper.getConsolidatedTaxDetail(salaryAcctEmpId, TenantContext.getCurrentTenantKey()); // return WeaResult.success(dto); // } // // @PostMapping("/acctresult/save") // @ApiOperation(("编辑薪资核算结果")) // @WeaPermission // public WeaResult saveSalaryAcctResult(@RequestBody @Validated SalaryAcctResultSaveParam saveParam) { // salaryAcctResultWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/acctresult/accounting") // @ApiOperation("薪资核算") // @WeaPermission // public WeaResult accounting(@RequestBody @Validated SalaryAcctCalculateParam acctParam) { // salaryAcctResultWrapper.calculate(acctParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(""); // } // // @PostMapping("/acctresult/export") // @ApiOperation("导出核算结果") // @WeaPermission // public WeaResult> exportSalaryAcctResult(@RequestBody @Validated SalaryAcctResultQueryParam queryParam) { // SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); // String eteamsId = TenantRpcContext.getEteamsId(); // Map map = salaryAcctExcelWrapper.exportSalaryAcctResult(queryParam, simpleEmployee, tenantKey, eteamsId); // return WeaResult.success(map); // } // // @GetMapping("/acctresult/importField") // @ApiOperation("导入核算结果前生成导入模板时可选的薪资项目") // @WeaPermission // public WeaResult getImportField(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { // SalaryAcctImportFieldDTO importField = salaryAcctExcelService.getImportField(salaryAcctRecordId, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(importField); // } // // @PostMapping("/acctresult/importtemplate/export") // @ApiOperation("导出导入模板") // @WeaPermission // public WeaResult> exportImportTemplate(@RequestBody @Validated SalaryAcctImportTemplateParam param) { // SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); // String eteamsId = TenantRpcContext.getEteamsId(); // Map map = salaryAcctExcelWrapper.exportImportTemplate(param, simpleEmployee, tenantKey, eteamsId); // return WeaResult.success(map); // } // // @GetMapping("/acctresult/importParams") // @ApiOperation("获取导入核算结果的导入参数") // @WeaPermission // public WeaResult getAcctResultImportParams() { // return WeaResult.success(salaryBatchService.buildImportParam("importSalaryAcctResult", // "importSalaryAcctResult", // "薪资核算结果", // null, // null)); // } // // /**********************************薪资核算结果 end*********************************/ // // /**********************************检验异常 start*********************************/ // // @GetMapping("/checkresult/getCount") // @ApiOperation(("获取校验结果(异常)总数")) // @WeaPermission // public WeaResult getCheckResultCount(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { // Integer salaryCheckResultCount = salaryAcctCheckResultWrapper.countBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey()); // return WeaResult.success(salaryCheckResultCount); // } // // @PostMapping("/checkresult/list") // @ApiOperation("校验结果列表") // @WeaPermission // public WeaResult> listCheckResult(@RequestBody @Validated SalaryCheckResultQueryParam queryParam) { // WeaTable weaTable = salaryAcctCheckResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(weaTable); // } // // @PostMapping("/checkresultdetail/list") // @ApiOperation("校验结果明细列表") // @WeaPermission // public WeaResult> listCheckResultRecord(@RequestBody @Validated SalaryCheckResultRecordQueryParam queryParam) { // WeaTable weaTable = salaryAcctCheckResultWrapper.listPage4CheckResultRecord(queryParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(weaTable); // } // // @PostMapping("/checkresult/ignore") // @ApiOperation("校验结果列表") // @WeaPermission // public WeaResult ignoreCheckResult(@RequestParam(value = "id") Long id) { // salaryAcctCheckResultWrapper.ignoreById(id, TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/checkresult/ignoreAll") // @ApiOperation("校验结果列表") // @WeaPermission // public WeaResult ignoreAllCheckResult(@RequestParam(value = "salaryAcctRecordId") Long salaryAcctRecordId) { // salaryAcctCheckResultWrapper.ignoreBySalaryAcctRecordId(salaryAcctRecordId, TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/acctresult/check") // @ApiOperation(("薪资核算结果校验")) // @WeaPermission // public WeaResult check(@RequestBody @Validated SalaryAcctCheckParam checkParam) { // salaryAcctResultWrapper.check(checkParam, UserContext.getCurrentUser(), TenantContext.getCurrentTenantKey()); // return WeaResult.success(null); // } // // @PostMapping("/checkresult/export") // @ApiOperation("校验异常导出") // @WeaPermission // public WeaResult> exportCheckResult(@RequestBody @Validated SalaryCheckResultExportParam exportParam) { // SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); // String eteamsId = TenantRpcContext.getEteamsId(); // Map map = salaryAcctExcelWrapper.exportCheckResult(exportParam, simpleEmployee, tenantKey, eteamsId); // return WeaResult.success(map); // } // // @PostMapping("/checkresultRecord/export") // @ApiOperation("校验异常明细导出") // @WeaPermission // public WeaResult> exportCheckResultDetail(@RequestParam(value = "checkResultId") Long checkResultId) { // SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); // String eteamsId = TenantRpcContext.getEteamsId(); // Map map = salaryAcctExcelWrapper.exportCheckResultDetail(checkResultId, simpleEmployee, tenantKey, eteamsId); // return WeaResult.success(map); // } // // /**********************************检验异常 end*********************************/ // // /**********************************线下对比 start*********************************/ // // @PostMapping("/comparisonresult/list") // @ApiOperation("线上线下对比结果列表") // @WeaPermission // public WeaResult>> listComparisonResult(@RequestBody @Validated SalaryComparisonResultQueryParam queryParam) { // WeaTable> weaTable = salaryComparisonResultWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey()); // return WeaResult.success(weaTable); // } // // @GetMapping("/comparisonresult/importParams") // @ApiOperation("获取导入核算结果的导入参数") // @WeaPermission // public WeaResult getComparisonResultImportParams() { // return WeaResult.success(salaryBatchService.buildImportParam("importExcelAcctResult", // "importExcelAcctResult", // "线下核算结果", // null, // null)); // } // // @PostMapping("/comparisonresult/export") // @ApiOperation("导出线上线下对比结果") // @WeaPermission // public WeaResult> exportComparisonResult(@RequestBody @Validated SalaryComparisonResultQueryParam queryParam) { // SimpleEmployee simpleEmployee = UserContext.getCurrentUser(); // String tenantKey = TenantContext.getCurrentTenantKey(); // String eteamsId = TenantRpcContext.getEteamsId(); // Map map = salaryAcctExcelWrapper.exportComparisonResult(queryParam, simpleEmployee, tenantKey, eteamsId); // return WeaResult.success(map); // } // // @PostMapping("/comparisonresult/importtemplate/export") // @ApiOperation("线下对比结果导入模板导出") // @WeaPermission // public WeaResult> exportComparisonResultTemplate(@RequestBody @Validated SalaryComparisonResultExportParam exportParam) { // String tenantKey = TenantContext.getCurrentTenantKey(); // Map map = salaryAcctExcelWrapper.exportComparisonResultTemplate(exportParam, tenantKey); // return WeaResult.success(map); // } /**********************************线下对比 end*********************************/ }