parent
fda10a06ae
commit
90a198bb54
|
|
@ -1,15 +1,9 @@
|
|||
package com.engine.salary.remote.tax.client;
|
||||
|
||||
import com.engine.salary.entity.employeedeclare.param.EmployeeDeclareParam;
|
||||
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnPasswordTypeEnum;
|
||||
import com.engine.salary.remote.tax.request.employee.BatchInvalidSubmissionRequest;
|
||||
import com.engine.salary.remote.tax.request.employee.GetCompanyEmployeeRequest;
|
||||
import com.engine.salary.remote.tax.request.employee.InformationChangeRequest;
|
||||
import com.engine.salary.remote.tax.request.employee.MergedEmployeeArchivesRequest;
|
||||
import com.engine.salary.remote.tax.response.employee.GetCompanyEmployeeResponse;
|
||||
import com.engine.salary.util.HttpUtil;
|
||||
import com.engine.salary.util.JsonUtil;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SingnatureData;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -34,100 +28,6 @@ public class EmployeeClient extends TaxBaseClient {
|
|||
super(taxAgentId);
|
||||
}
|
||||
|
||||
//4.2.3企业人员列表查询
|
||||
public GetCompanyEmployeeResponse getCompanyEmployee(EmployeeDeclareParam param) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/data/getCompanyEmployee";
|
||||
GetCompanyEmployeeRequest getCompanyEmployeeRequest = new GetCompanyEmployeeRequest();
|
||||
getCompanyEmployeeRequest.setNsrsbh(returnPO.getTaxCode());
|
||||
getCompanyEmployeeRequest.setQymc(returnPO.getTaxAgentName());
|
||||
getCompanyEmployeeRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||||
getCompanyEmployeeRequest.setAreaid(returnPO.getAreaCode());
|
||||
getCompanyEmployeeRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||||
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
|
||||
getCompanyEmployeeRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
|
||||
getCompanyEmployeeRequest.setJmsbmm("0");
|
||||
getCompanyEmployeeRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
|
||||
getCompanyEmployeeRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
|
||||
getCompanyEmployeeRequest.setJmsmmm("0");
|
||||
getCompanyEmployeeRequest.setMmlx("" + returnPO.getPasswordType());
|
||||
getCompanyEmployeeRequest.setSsyf(SalaryDateUtil.getFormatYYYYMM(param.getTaxCycle()));
|
||||
getCompanyEmployeeRequest.setPageNo("" + param.getCurrent());
|
||||
getCompanyEmployeeRequest.setPageSize("" + param.getPageSize());
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(getCompanyEmployeeRequest);
|
||||
log.info("getCompanyEmployee params --- \n{}\n", reqJson);
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
|
||||
// 开始请求
|
||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||
log.info("getCompanyEmployee res --- {}", res);
|
||||
return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class);
|
||||
|
||||
}
|
||||
|
||||
public String batchInvalidSubmission(BatchInvalidSubmissionRequest batchInvalidSubmissionRequest) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/declare/batchInvalidSubmission";
|
||||
batchInvalidSubmissionRequest.setNsrsbh(returnPO.getTaxCode());
|
||||
batchInvalidSubmissionRequest.setBizNo(UUID.randomUUID().toString().replace("-", ""));
|
||||
batchInvalidSubmissionRequest.setQymc(returnPO.getTaxAgentName());
|
||||
batchInvalidSubmissionRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||||
batchInvalidSubmissionRequest.setAreaid(returnPO.getAreaCode());
|
||||
batchInvalidSubmissionRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||||
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
|
||||
batchInvalidSubmissionRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
|
||||
batchInvalidSubmissionRequest.setJmsbmm("0");
|
||||
batchInvalidSubmissionRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
|
||||
batchInvalidSubmissionRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
|
||||
batchInvalidSubmissionRequest.setJmsmmm("0");
|
||||
batchInvalidSubmissionRequest.setMmlx("" + returnPO.getPasswordType());
|
||||
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(batchInvalidSubmissionRequest);
|
||||
log.info("batchInvalidSubmission params --- \n{}\n", reqJson);
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
|
||||
// 开始请求
|
||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||
log.info("batchInvalidSubmission res --- {}", res);
|
||||
// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class);
|
||||
return res;
|
||||
}
|
||||
|
||||
public String informationChange(InformationChangeRequest informationChangeRequest) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/employee/informationChange";
|
||||
informationChangeRequest.setNsrsbh(returnPO.getTaxCode());
|
||||
informationChangeRequest.setBizNo(UUID.randomUUID().toString().replace("-", ""));
|
||||
informationChangeRequest.setQymc(returnPO.getTaxAgentName());
|
||||
informationChangeRequest.setDjxhid(StringUtils.isNotEmpty(returnPO.getTaxRegistrationNumber()) ? returnPO.getTaxRegistrationNumber() : null);
|
||||
informationChangeRequest.setAreaid(returnPO.getAreaCode());
|
||||
informationChangeRequest.setBmbh(StringUtils.isNotEmpty(returnPO.getDepartmentCode()) ? returnPO.getDepartmentCode() : null);
|
||||
boolean realNamePwd = TaxAgentTaxReturnPasswordTypeEnum.REAL_NAME_PASSWORD.getValue().equals(returnPO.getPasswordType());
|
||||
informationChangeRequest.setSbmm(realNamePwd ? null : returnPO.getPwd());
|
||||
informationChangeRequest.setJmsbmm("0");
|
||||
informationChangeRequest.setSmzh(realNamePwd ? returnPO.getRealAccount() : null);
|
||||
informationChangeRequest.setSmmm(realNamePwd ? returnPO.getPwd() : null);
|
||||
informationChangeRequest.setJmsmmm("0");
|
||||
informationChangeRequest.setMmlx("" + returnPO.getPasswordType());
|
||||
|
||||
|
||||
String reqJson = JsonUtil.toJsonString(informationChangeRequest);
|
||||
log.info("informationChangeRequest params --- \n{}\n", reqJson);
|
||||
Map<String, String> params = new HashMap<>(1);
|
||||
Map<String, String> header = SingnatureData.initHeader(params, apiConfig.getAppKey(), apiConfig.getAppSecret());
|
||||
|
||||
// 开始请求
|
||||
String res = HttpUtil.doPost(url, header, reqJson, HttpUtil.JSON_TYPE);
|
||||
log.info("informationChangeRequest res --- {}", res);
|
||||
// return JsonUtil.parseObject(res, GetCompanyEmployeeResponse.class);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public String mergedEmployeeArchives(MergedEmployeeArchivesRequest mergedEmployeeArchivesRequest) {
|
||||
|
||||
String url = super.apiConfig.getHost() + "gateway/iit/mergedEmployeeArchives/query";
|
||||
|
|
|
|||
|
|
@ -185,19 +185,6 @@ public interface EmployeeDeclareService{
|
|||
*/
|
||||
void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate);
|
||||
|
||||
/**
|
||||
* 作废人员
|
||||
* @param param
|
||||
*/
|
||||
String invalid(EmployeeInvalidParam param);
|
||||
|
||||
/**
|
||||
* 关键信息变更
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
String informationChange(EmployeeInformationChangeParam param);
|
||||
|
||||
/**
|
||||
* 同步任职受雇日期为入职日期
|
||||
*
|
||||
|
|
|
|||
|
|
@ -739,44 +739,6 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String invalid(EmployeeInvalidParam param) {
|
||||
List<EmployeeDeclarePO> employeeDeclarePOS = listByIds(Collections.singletonList(param.getId()));
|
||||
if (CollectionUtils.isEmpty(employeeDeclarePOS)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "未找到该人员"));
|
||||
}
|
||||
|
||||
BatchInvalidSubmissionRequest request = new BatchInvalidSubmissionRequest();
|
||||
List<BatchInvalidSubmissionRequest.RY> rys = employeeDeclarePOS.stream().map(po -> {
|
||||
BatchInvalidSubmissionRequest.RY ry = new BatchInvalidSubmissionRequest.RY();
|
||||
ry.setXm(po.getEmployeeName());
|
||||
ry.setZzhm(po.getCardNum());
|
||||
ry.setZzlx(CardTypeEnum.getByValue(po.getCardType()).getDefaultLabel());
|
||||
return ry;
|
||||
}).collect(Collectors.toList());
|
||||
request.setRylb(rys);
|
||||
|
||||
EmployeeClient employeeClient = new EmployeeClient(employeeDeclarePOS.get(0).getTaxAgentId());
|
||||
String s = employeeClient.batchInvalidSubmission(request);
|
||||
return s;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String informationChange(EmployeeInformationChangeParam param) {
|
||||
EmployeeDeclarePO employeeDeclarePO = getById(param.getId());
|
||||
if (employeeDeclarePO == null) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(0, "未找到该人员"));
|
||||
}
|
||||
|
||||
InformationChangeRequest request =new InformationChangeRequest();
|
||||
request.setXm(param.getName());
|
||||
request.setZzlx(param.getCardType().getDefaultLabel());
|
||||
request.setZzhm(param.getCardNum());
|
||||
EmployeeClient employeeClient = new EmployeeClient(employeeDeclarePO.getTaxAgentId());
|
||||
String s = employeeClient.informationChange(request);
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String syncEmploymentDate(EmployeeDeclareSyncStartDateParam param) {
|
||||
|
|
|
|||
|
|
@ -242,21 +242,6 @@ public class EmployeeDeclareController {
|
|||
return new ResponseResult<EmployeeDeclareParam, String>(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/invalid")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String invalid(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeInvalidParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<EmployeeInvalidParam, String>(user).run(getEmployeeDeclareWrapper(user)::invalid, param);
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/informationChange")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String informationChange(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeInformationChangeParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<EmployeeInformationChangeParam, String>(user).run(getEmployeeDeclareWrapper(user)::informationChange, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员报送-后端业务逻辑是否已经完成
|
||||
|
|
@ -272,21 +257,6 @@ public class EmployeeDeclareController {
|
|||
return new ResponseResult<String, EmployeeDeclareRateDTO>(user).run(getEmployeeDeclareWrapper(user)::getRate, index);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业人员列表查询
|
||||
* @param request
|
||||
* @param response
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/getCompanyEmployee")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getCompanyEmployee(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam param) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<EmployeeDeclareParam, Object>(user).run(getEmployeeDeclareWrapper(user)::getCompanyEmployee, param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员报送-下载导入模板
|
||||
*
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ import com.engine.salary.enums.SalaryOnOffEnum;
|
|||
import com.engine.salary.enums.employeedeclare.*;
|
||||
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.remote.tax.client.EmployeeClient;
|
||||
import com.engine.salary.remote.tax.response.employee.GetCompanyEmployeeResponse;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
|
@ -543,16 +541,6 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
return employeeDeclareRate.getIndex();
|
||||
}
|
||||
|
||||
public String invalid(EmployeeInvalidParam param) {
|
||||
return getEmployeeDeclareService(user).invalid(param);
|
||||
}
|
||||
|
||||
public String informationChange(EmployeeInformationChangeParam param) {
|
||||
return getEmployeeDeclareService(user).informationChange(param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取人员报送相关后端接口是否已经完成
|
||||
|
|
@ -564,15 +552,6 @@ public class EmployeeDeclareWrapper extends Service {
|
|||
return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE + index);
|
||||
}
|
||||
|
||||
public Object getCompanyEmployee(EmployeeDeclareParam param) {
|
||||
ValidUtil.doValidator(param);
|
||||
|
||||
EmployeeClient employeeClient = new EmployeeClient(param.getTaxAgentId());
|
||||
GetCompanyEmployeeResponse companyEmployee = employeeClient.getCompanyEmployee(param);
|
||||
|
||||
|
||||
return companyEmployee;
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员报送-下载导入模板
|
||||
|
|
|
|||
Loading…
Reference in New Issue