删除接口ids改为json入参
This commit is contained in:
parent
b56a48c885
commit
fb42a5f041
|
|
@ -0,0 +1,7 @@
|
|||
package com.api.salary.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
@Path("/bs/hrmsalary/taxdeclaration")
|
||||
public class TaxDeclarationController extends com.engine.salary.web.TaxDeclarationController{
|
||||
}
|
||||
|
|
@ -7,18 +7,13 @@ import com.engine.salary.entity.taxrate.TaxAgent;
|
|||
import com.engine.salary.entity.taxrate.param.TaxAgentQueryParam;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.TaxAgentMapper;
|
||||
import com.google.common.collect.Collections2;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TaxAgentDeleteCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||
|
||||
|
|
@ -36,11 +31,10 @@ public class TaxAgentDeleteCmd extends AbstractCommonCommand<Map<String, Object>
|
|||
public Map<String, Object> execute(CommandContext commandContext) {
|
||||
Map<String, Object> apidatas = new HashMap<String, Object>(16);
|
||||
|
||||
List<String> ids = castList(params.get("ids"), String.class);
|
||||
if (CollectionUtils.isEmpty(ids)) {
|
||||
Collection<Long> idList = (Collection<Long>)params.get("ids");
|
||||
if (CollectionUtils.isEmpty(idList)) {
|
||||
throw new SalaryRunTimeException("参数错误");
|
||||
}
|
||||
List<Long> idList = ids.stream().map(Long::valueOf).collect(Collectors.toList());
|
||||
|
||||
|
||||
SqlSession sqlSession = MyBatisFactory.sqlSessionFactory.openSession();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.engine.salary.service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface TaxDeclarationService {
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*/
|
||||
Map<String, Object> listPage(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> delete(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> save(Map<String, Object> params);
|
||||
|
||||
Map<String, Object> update(Map<String, Object> params);
|
||||
|
||||
}
|
||||
|
|
@ -3,8 +3,6 @@ package com.engine.salary.service;
|
|||
import java.util.Map;
|
||||
|
||||
public interface TaxRateBaseService {
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.service.TaxDeclarationService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxDeclarationServiceImpl extends Service implements TaxDeclarationService {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> delete(Map<String, Object> params) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> save(Map<String, Object> params) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> update(Map<String, Object> params) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -5,20 +5,20 @@ import com.engine.common.util.ServiceUtil;
|
|||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.beanutils.BeanUtils;
|
||||
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.*;
|
||||
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.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxAgentController {
|
||||
|
|
@ -73,9 +73,11 @@ public class TaxAgentController {
|
|||
@POST
|
||||
@Path("/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Collection<Long> ids) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ResponseResult.run(getService(user)::delete, ParamUtil.request2Map(request));
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
map.put("ids",ids);
|
||||
return ResponseResult.run(getService(user)::delete, map);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -0,0 +1,131 @@
|
|||
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);
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.service.TaxRateBaseService;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class TaxRateWrapper extends Service {
|
||||
|
||||
private TaxRateBaseService getService(User user) {
|
||||
return (TaxRateBaseService) ServiceUtil.getService(TaxRateWrapper.class, user);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> listPage(Map<String, Object> stringObjectMap) {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue