2023-10-11 18:24:02 +08:00
|
|
|
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.GetCompanyEmployeeRequest;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
2023-12-06 15:19:07 +08:00
|
|
|
* 人员信息登记报送客户端
|
2023-10-11 18:24:02 +08:00
|
|
|
* <p>Copyright: Copyright (c) 2023</p>
|
|
|
|
|
* <p>Company: 泛微软件</p>
|
|
|
|
|
*
|
|
|
|
|
* @author qiantao
|
|
|
|
|
* @version 1.0
|
|
|
|
|
**/
|
|
|
|
|
@Slf4j
|
|
|
|
|
public class EmployeeClient extends TaxBaseClient {
|
|
|
|
|
|
|
|
|
|
public EmployeeClient(Long taxAgentId) {
|
|
|
|
|
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("");
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|