132 lines
5.4 KiB
Java
132 lines
5.4 KiB
Java
package com.engine.salary.web;
|
|
|
|
import com.engine.common.util.ParamUtil;
|
|
import com.engine.common.util.ServiceUtil;
|
|
import com.engine.salary.entity.taxrate.param.TaxRateSaveParam;
|
|
import com.engine.salary.service.TaxRateBaseService;
|
|
import com.engine.salary.service.impl.TaxRateBaseServiceImpl;
|
|
import com.engine.salary.util.ResponseResult;
|
|
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
|
import weaver.general.BaseBean;
|
|
import weaver.hrm.HrmUserVarify;
|
|
import weaver.hrm.User;
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.ws.rs.GET;
|
|
import javax.ws.rs.POST;
|
|
import javax.ws.rs.Path;
|
|
import javax.ws.rs.Produces;
|
|
import javax.ws.rs.core.Context;
|
|
import javax.ws.rs.core.MediaType;
|
|
import java.util.Map;
|
|
|
|
public class TaxDeclarationController {
|
|
|
|
private BaseBean logger = new BaseBean();
|
|
|
|
private TaxRateBaseService getService(User user) {
|
|
return (TaxRateBaseService) ServiceUtil.getService(TaxRateBaseServiceImpl.class, user);
|
|
}
|
|
|
|
|
|
//税率表列表
|
|
@GET
|
|
@Path("/list")
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
return ResponseResult.run(getService(user)::listPage, ParamUtil.request2Map(request));
|
|
}
|
|
|
|
|
|
/**
|
|
* 新建税率表
|
|
*/
|
|
@POST
|
|
@Path("/save")
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxRateSaveParam taxRateSaveParam) {
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
|
map.put("taxRateSaveParam",taxRateSaveParam);
|
|
return ResponseResult.run(getService(user)::save, map);
|
|
}
|
|
|
|
/**
|
|
* 新建税率表
|
|
*/
|
|
@POST
|
|
@Path("/update")
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
public String update(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxRateSaveParam taxRateSaveParam) {
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
Map<String, Object> map = ParamUtil.request2Map(request);
|
|
map.put("taxRateSaveParam",taxRateSaveParam);
|
|
return ResponseResult.run(getService(user)::update, map);
|
|
}
|
|
|
|
/**
|
|
* 删除税率表
|
|
*/
|
|
@POST
|
|
@Path("/delete")
|
|
@Produces(MediaType.APPLICATION_JSON)
|
|
public String deleteTaxRate(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
return ResponseResult.run(getService(user)::delete, ParamUtil.request2Map(request));
|
|
}
|
|
|
|
|
|
|
|
// @PostMapping("/list")
|
|
// @ApiOperation("个税申报表列表")
|
|
// @WeaPermission
|
|
// public WeaResult<WeaTable<TaxDeclarationListDTO>> listTaxDeclaration(@RequestBody TaxDeclarationListQueryParam queryParam) {
|
|
// WeaTable<TaxDeclarationListDTO> weaTable = taxDeclarationWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
|
|
// return WeaResult.success(weaTable);
|
|
// }
|
|
//
|
|
// @GetMapping("/getForm")
|
|
// @ApiOperation("个税申报表表单")
|
|
// @WeaPermission
|
|
// public WeaResult<WeaForm> getForm(@RequestParam(value = "id", required = false) Long id) {
|
|
// WeaForm weaForm = taxDeclarationWrapper.getForm(id, TenantContext.getCurrentTenantKey());
|
|
// return WeaResult.success(weaForm);
|
|
// }
|
|
//
|
|
// @GetMapping("/getTaxDeclarationInfo")
|
|
// @ApiOperation("个税申报表相关信息")
|
|
// @WeaPermission
|
|
// public WeaResult<TaxDeclarationInfoDTO> getTaxDeclarationInfo(@RequestParam(value = "taxDeclarationId") Long taxDeclarationId) {
|
|
// TaxDeclarationInfoDTO taxDeclarationInfo = taxDeclarationWrapper.getTaxDeclarationInfoById(taxDeclarationId, TenantContext.getCurrentTenantKey());
|
|
// return WeaResult.success(taxDeclarationInfo);
|
|
// }
|
|
//
|
|
// @PostMapping("/save")
|
|
// @ApiOperation("个税申报表生成")
|
|
// @WeaPermission
|
|
// public WeaResult<Object> saveTaxDeclaration(@RequestBody TaxDeclarationSaveParam saveParam) {
|
|
// taxDeclarationWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
|
// return WeaResult.success(null);
|
|
// }
|
|
//
|
|
// @PostMapping("/detail/list")
|
|
// @ApiOperation("个税申报表详情列表")
|
|
// @WeaPermission
|
|
// public WeaResult<WeaTable<TaxDeclarationDetailListDTO>> listTaxDeclarationDetail(@RequestBody TaxDeclarationDetailListQueryParam queryParam) {
|
|
// WeaTable<TaxDeclarationDetailListDTO> weaTable = taxDeclarationDetailWrapper.listPage(queryParam, TenantContext.getCurrentTenantKey());
|
|
// return WeaResult.success(weaTable);
|
|
// }
|
|
//
|
|
// @PostMapping("/export")
|
|
// @ApiOperation("个税申报表相关信息")
|
|
// @WeaPermission
|
|
// public WeaResult<Map<String, Object>> exportTaxDeclaration(@RequestParam(value = "taxDeclarationId") Long taxDeclarationId) {
|
|
// Map<String, Object> map = taxDeclarationExcelService.exportTaxDeclaration(taxDeclarationId, TenantContext.getCurrentTenantKey());
|
|
// return WeaResult.success(map);
|
|
// }
|
|
|
|
|
|
}
|