2022-02-25 19:41:22 +08:00
|
|
|
|
package com.engine.salary.web;
|
|
|
|
|
|
|
2022-03-01 16:45:57 +08:00
|
|
|
|
import com.engine.common.util.ParamUtil;
|
2022-02-25 19:41:22 +08:00
|
|
|
|
import com.engine.common.util.ServiceUtil;
|
2022-03-01 16:45:57 +08:00
|
|
|
|
import com.engine.salary.service.TaxRateBaseService;
|
|
|
|
|
|
import com.engine.salary.service.impl.TaxRateBaseServiceImpl;
|
|
|
|
|
|
import com.engine.salary.util.ResponseResult;
|
2022-02-25 19:41:22 +08:00
|
|
|
|
import weaver.general.BaseBean;
|
2022-03-01 16:45:57 +08:00
|
|
|
|
import weaver.hrm.HrmUserVarify;
|
2022-02-25 19:41:22 +08:00
|
|
|
|
import weaver.hrm.User;
|
|
|
|
|
|
|
2022-03-01 16:45:57 +08:00
|
|
|
|
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;
|
|
|
|
|
|
|
2022-02-25 19:41:22 +08:00
|
|
|
|
public class TaxRateController {
|
|
|
|
|
|
|
|
|
|
|
|
private BaseBean logger = new BaseBean();
|
|
|
|
|
|
|
2022-03-01 16:45:57 +08:00
|
|
|
|
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) {
|
|
|
|
|
|
User user = HrmUserVarify.getUser(request, response);
|
|
|
|
|
|
return ResponseResult.run(getService(user)::save, ParamUtil.request2Map(request));
|
|
|
|
|
|
}
|
2022-02-25 19:41:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-01 16:45:57 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 删除税率表
|
|
|
|
|
|
*/
|
|
|
|
|
|
@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));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
// /**
|
|
|
|
|
|
// * 新建税率表
|
|
|
|
|
|
// *
|
|
|
|
|
|
// * @param saveParam
|
|
|
|
|
|
// * @return
|
|
|
|
|
|
// */
|
|
|
|
|
|
// @PostMapping("/save")
|
|
|
|
|
|
// @ApiOperation("保存税率表")
|
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
|
// public WeaResult<Object> saveTaxRate(@RequestBody @Validated TaxRateSaveParam saveParam) {
|
|
|
|
|
|
// if (saveParam.getTaxRateBatch().getId() == null || saveParam.getTaxRateBatch().getId() <= 0) {
|
|
|
|
|
|
// taxRateWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// taxRateWrapper.update(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
|
|
|
|
|
// }
|
|
|
|
|
|
// return WeaResult.success(null);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// /**
|
|
|
|
|
|
// * 编辑税率表
|
|
|
|
|
|
// *
|
|
|
|
|
|
// * @param saveParam
|
|
|
|
|
|
// * @return
|
|
|
|
|
|
// */
|
|
|
|
|
|
// @PostMapping("/update")
|
|
|
|
|
|
// @ApiOperation("编辑税率表")
|
|
|
|
|
|
// @WeaPermission
|
|
|
|
|
|
// public WeaResult<Object> updateTaxRate(@RequestBody @Validated TaxRateSaveParam saveParam) {
|
|
|
|
|
|
// if (Objects.isNull(saveParam.getTaxRateBatch().getId())) {
|
|
|
|
|
|
// return WeaResult.fail(SalaryI18nUtil.getI18nLabel(99703, "参数错误,ID不允许为空"));
|
|
|
|
|
|
// }
|
|
|
|
|
|
// taxRateWrapper.update(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
|
|
|
|
|
|
// return WeaResult.success(null);
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-02-25 19:41:22 +08:00
|
|
|
|
}
|