扣减确认和反馈
This commit is contained in:
parent
bad6928f34
commit
660a2718a1
|
|
@ -0,0 +1,30 @@
|
|||
package com.engine.salary.entity.deductionamount.param;
|
||||
|
||||
import com.engine.salary.util.valid.DataCheck;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 扣除名单查询参数
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DeductionAmountFeedBackParam {
|
||||
|
||||
// 个税扣缴义务人id
|
||||
@DataCheck(require = true, message = "参数错误,个税扣缴义务人id不能为空")
|
||||
private Long taxAgentId;
|
||||
|
||||
@DataCheck(require = true, message = "参数错误,requestId不能为空")
|
||||
private String requestId;
|
||||
|
||||
}
|
||||
|
|
@ -9,10 +9,7 @@ import com.engine.salary.util.SingnatureData;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 申报扣减客户端
|
||||
|
|
@ -60,10 +57,9 @@ public class DeductionAmountClient extends TaxBaseClient {
|
|||
}
|
||||
|
||||
|
||||
public String confirm(String year, List<ConfirmPreDeductRequest.kczg> kczglb ) {
|
||||
|
||||
public String confirmPreDeduct(String year, List<ConfirmPreDeductRequest.kczg> kczglb ) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/queryPreDeduct";
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/confirmPreDeduct";
|
||||
ConfirmPreDeductRequest request = new ConfirmPreDeductRequest();
|
||||
request.setNsrsbh(returnPO.getTaxCode());
|
||||
request.setBizNo(UUID.randomUUID().toString().replace("-", ""));
|
||||
|
|
@ -91,4 +87,16 @@ public class DeductionAmountClient extends TaxBaseClient {
|
|||
log.info("confirmPreDeduct res --- {}", res);
|
||||
return res;
|
||||
}
|
||||
|
||||
public String feedback(String requestId) {
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/deductionAmount/getPreDeductConfirmFeedback";
|
||||
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
params.put("requestId", requestId);
|
||||
log.info("getPreDeductConfirmFeedback requestId --- \n{}\n", requestId);
|
||||
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
String res = HttpUtil.getRequest(url, header, params);
|
||||
log.info("getPreDeductConfirmFeedback res --- {}", res);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,5 +24,5 @@ public interface DeductionAmountService {
|
|||
|
||||
Object confirm(DeductionAmountConfirmParam param);
|
||||
|
||||
|
||||
void feedback(DeductionAmountFeedBackParam param);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.engine.salary.remote.tax.client.DeductionAmountClient;
|
|||
import com.engine.salary.remote.tax.request.deductionAmount.ConfirmPreDeductRequest;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.SalaryPageUtil;
|
||||
import com.engine.salary.util.valid.ValidUtil;
|
||||
|
|
@ -123,8 +124,8 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou
|
|||
employeeDeclarePOS.stream()
|
||||
.filter(employeeDeclarePO -> !oldIds.contains(employeeDeclarePO.getEmployeeId()))
|
||||
.map(employeeDeclarePO -> DeductionAmountPO.builder()
|
||||
.id(employeeDeclarePO.getEmployeeId())
|
||||
.taxAgentId(employeeDeclarePO.getEmployeeId())
|
||||
.id(IdGenerator.generate())
|
||||
.taxAgentId(employeeDeclarePO.getTaxAgentId())
|
||||
.year(param.getYear())
|
||||
.employeeId(employeeDeclarePO.getEmployeeId())
|
||||
.employeeName(employeeDeclarePO.getEmployeeName())
|
||||
|
|
@ -180,6 +181,13 @@ public class DeductionAmountServiceImpl extends Service implements DeductionAmou
|
|||
}).collect(Collectors.toList());
|
||||
|
||||
DeductionAmountClient deductionAmountClient = new DeductionAmountClient(taxAgentId);
|
||||
return deductionAmountClient.confirmPreDeduct(year, kczglb);
|
||||
return deductionAmountClient.confirm(year, kczglb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void feedback(DeductionAmountFeedBackParam param) {
|
||||
DeductionAmountClient deductionAmountClient = new DeductionAmountClient(param.getTaxAgentId());
|
||||
String feedback = deductionAmountClient.feedback(param.getRequestId());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,10 +4,7 @@ package com.engine.salary.web;
|
|||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.component.PageInfo;
|
||||
import com.engine.salary.entity.deductionamount.dto.DeductionAmountDTO;
|
||||
import com.engine.salary.entity.deductionamount.param.DeductionAmountAddParam;
|
||||
import com.engine.salary.entity.deductionamount.param.DeductionAmountConfirmParam;
|
||||
import com.engine.salary.entity.deductionamount.param.DeductionAmountListParam;
|
||||
import com.engine.salary.entity.deductionamount.param.DeductionAmountOnlineQueryParam;
|
||||
import com.engine.salary.entity.deductionamount.param.*;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.wrapper.DeductionAmountWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
|
|
@ -54,6 +51,14 @@ public class DeductionAmountController {
|
|||
return new ResponseResult<DeductionAmountAddParam, Object>(user).run(getDeductionAmountWrapper(user)::add, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/delete")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String delete(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountDeleteParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<DeductionAmountDeleteParam, Object>(user).run(getDeductionAmountWrapper(user)::delete, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/query")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
|
|
@ -70,7 +75,12 @@ public class DeductionAmountController {
|
|||
return new ResponseResult<DeductionAmountConfirmParam, Object>(user).run(getDeductionAmountWrapper(user)::confirm, param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/feedback")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String feedback(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeductionAmountFeedBackParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<DeductionAmountFeedBackParam, Object>(user).run(getDeductionAmountWrapper(user)::feedback, param);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,4 +43,8 @@ public class DeductionAmountWrapper extends Service {
|
|||
public Object confirm(DeductionAmountConfirmParam param) {
|
||||
return getDeductionAmountService(user).confirm(param);
|
||||
}
|
||||
|
||||
public void feedback(DeductionAmountFeedBackParam param) {
|
||||
getDeductionAmountService(user).feedback(param);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue