个税对接,人员报送相关接口

This commit is contained in:
钱涛 2023-08-08 19:39:53 +08:00
parent 58eaddc33e
commit 827420c2bd
82 changed files with 1629 additions and 1125 deletions

View File

@ -1,34 +0,0 @@
create table hrsa_tax_declare_api_profile
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
api_profile int
);
/
create index id_tenant_key_22b215db on hrsa_tax_declare_api_profile(tenant_key);
/
create table hrsa_tax_payment_request
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
tax_agent_id number not null,
tax_declare_record_id number,
tax_year_month date not null,
request_id varchar2(50) not null,
request_type int not null
);
/
create index id_tenant_key_bcb610c7 on hrsa_tax_payment_request(tenant_key);
/

View File

@ -1,38 +0,0 @@
create table hrsa_tax_declare_api_config
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
host varchar2(255),
app_key varchar2(255),
app_secret varchar2(255)
);
/
create unique index idx_tenant_key_api_a6f21b46 on hrsa_tax_declare_api_config(tenant_key);
/
alter table hrsa_tax_declare_api_config modify host not null;
/
alter table hrsa_tax_declare_api_config modify app_key not null;
/
alter table hrsa_tax_declare_api_config modify app_secret not null;
/
alter table hrsa_tax_declare_api_config add enable_use int;
/
alter table hrsa_tax_declare_api_config add totality number;
/
alter table hrsa_tax_declare_api_config add remain number;
/
alter table hrsa_tax_declare_api_config add last_update_time date;
/

View File

@ -1,31 +0,0 @@
create table hrsa_tax_agent_tax_return
(
id number primary key ,
create_time date,
update_time date,
creator number,
delete_type int default 0,
tenant_key varchar2(10),
tax_agent_id number not null,
tax_code varchar2(50) not null,
tax_registration_number varchar2(50) not null,
department_code varchar2(50),
department_name varchar2(50),
nation varchar2(50),
province varchar2(50),
city varchar2(50),
area_code varchar2(50) not null,
password_type int not null,
real_account varchar2(50) ,
pwd varchar2(50) not null,
check_status int not null,
fail_reason varchar2(255)
);
/
create index id_tenant_key_tax_return on hrsa_tax_agent_tax_return(tenant_key);
/
create unique index id_tax_agent_id_tax_return on hrsa_tax_agent_tax_return(tax_agent_id);
/

View File

@ -0,0 +1,14 @@
package com.api.salary.web;
import javax.ws.rs.Path;
/**
* 智能算薪-计费
*
* @author chengliming
* @date 2022-11-15 16:05:40
*/
@Path("/bs/hrmsalary/taxdeclaration/apiflow")
public class TaxDeclarationApiFlowController extends com.engine.salary.web.TaxDeclarationApiFlowController{
}

View File

@ -18,9 +18,9 @@ import lombok.NoArgsConstructor;
@ApiModel("人员选项")
public class OptionDTO {
@ApiModelProperty("人员ID")
//人员ID")
private String id;
@ApiModelProperty("人员姓名")
//人员姓名")
private String content;
}

View File

@ -13,6 +13,6 @@ import lombok.Data;
@Data
public class AsyncRequestIdDTO {
@ApiModelProperty("异步接口中的requestId")
//异步接口中的requestId")
private String requestId;
}

View File

@ -7,8 +7,8 @@ import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import dm.jdbc.util.IdGenerator;
import org.apache.commons.collections4.CollectionUtils;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@ -43,14 +43,15 @@ public class PaymentAgencyBO {
}
public static PaymentAgencyPO buildPaymentAgencyPO(PaymentAgencyFormDTO paymentAgencyFormDTO, Long employeeId, String tenantKey) {
Date now = new Date();
return PaymentAgencyPO.builder()
.id(IdGenerator.generate())
.agencyName(paymentAgencyFormDTO.getAgencyName())
.createTime(LocalDateTime.now())
.createTime(now)
.creator(employeeId)
.tenantKey(tenantKey)
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.updateTime(LocalDateTime.now())
.updateTime(now)
.remarks(paymentAgencyFormDTO.getRemarks())
.build();
}

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.Date;
@Data
@Builder
@ -32,12 +32,12 @@ public class PaymentAgencyPO {
/**
* 创建时间
*/
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
private Date updateTime;
/**
* 创建人

View File

@ -2,11 +2,14 @@ package com.engine.salary.entity.employeedeclare.bo;
import com.api.formmode.page.util.Util;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.enums.employeedeclare.*;
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.util.SalaryDateUtil;
@ -16,13 +19,11 @@ import com.engine.salary.util.valid.SalaryCardUtil;
import com.google.common.collect.Lists;
import dm.jdbc.util.IdGenerator;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import java.time.LocalDateTime;
import java.time.YearMonth;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @description:
@ -38,14 +39,12 @@ public class EmployeeDeclareRefresh {
// 本月已有的需要报送的人员
Set<Long> employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId);
// 员工的个人信息
Map<Long, SimpleUserInfo> simpleUserInfoMap = dto.getSimpleUserInfos().stream()
.filter(simpleUserInfo -> Objects.nonNull(simpleUserInfo) && Objects.nonNull(simpleUserInfo.getUser()))
.collect(Collectors.toMap(simpleUserInfo -> simpleUserInfo.getUser().getId(), Function.identity(), (a, b) -> a));
Map<Long, DataCollectionEmployee> simpleUserInfoMap = SalaryEntityUtil.convert2Map(dto.getHrmEmployeeComInfos(), DataCollectionEmployee::getEmployeeId);
// 薪资档案的数据任职受雇从业类型起始发薪日期最后发薪日期
Map<Long, SalaryArchivePO> salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId);
// 非系统人员的数据任职受雇从业类型
Map<Long, ExtEmployeePO> extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmployeePO::getId);
LocalDateTime now = LocalDateTime.now();
Map<Long, ExtEmpPO> extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmpPO::getId);
Date now = new Date();
// 对已有人员处理人员状态离职日期任职受雇从业类型
for (EmployeeDeclarePO employeeDeclare : dto.getEmployeeDeclares()) {
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
@ -60,17 +59,17 @@ public class EmployeeDeclareRefresh {
result.getEmployeeDeclares().add(employeeDeclare);
}
}
if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
employeeDeclare.setNewEmployeeInfo(1);
}
ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId());
if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
employeeDeclare.setEmploymentType(extEmployee.getEmploymentType());
employeeDeclare.setNewEmployeeInfo(1);
}
// if (salaryArchive != null && !Objects.equals(employeeDeclare.getEmploymentType(), Util.getIntValue(salaryArchive.getEmploymentType()))) {
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
// employeeDeclare.setNewEmployeeInfo(1);
// }
// ExtEmpPO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId());
// if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) {
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
// employeeDeclare.setEmploymentType(extEmployee.getEmploymentType());
// employeeDeclare.setNewEmployeeInfo(1);
// }
}
// 自动保存上个月报送成功的人员
for (EmployeeDeclarePO preTaxCycleEmployeeDeclare : dto.getPreTaxCycleEmployeeDeclare()) {
@ -91,37 +90,37 @@ public class EmployeeDeclareRefresh {
employeeDeclare.setDismissDate(salaryArchive.getPayEndDate());
employeeDeclare.setNewEmployeeInfo(1);
}
if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
employeeDeclare.setNewEmployeeInfo(1);
}
ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId());
if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
employeeDeclare.setEmploymentType(extEmployee.getEmploymentType());
employeeDeclare.setNewEmployeeInfo(1);
}
// if (salaryArchive != null && !Objects.equals(Util.null2String(employeeDeclare.getEmploymentType()), salaryArchive.getEmploymentType())) {
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
// employeeDeclare.setNewEmployeeInfo(1);
// }
// ExtEmployeePO extEmployee = extEmployeeMap.get(employeeDeclare.getEmployeeId());
// if (extEmployee != null && !Objects.equals(employeeDeclare.getEmploymentType(), extEmployee.getEmploymentType())) {
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue());
// employeeDeclare.setEmploymentType(extEmployee.getEmploymentType());
// employeeDeclare.setNewEmployeeInfo(1);
// }
employeeIds.add(employeeDeclare.getEmployeeId());
result.getNewEmployeeDeclares().add(employeeDeclare);
}
}
// 薪资档案中新增的需报送的人员
for (HrmEmployeeComInfo hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) {
if (employeeIds.contains(hrmEmployeeComInfo.getId())) {
for (DataCollectionEmployee hrmEmployeeComInfo : dto.getHrmEmployeeComInfos()) {
if (employeeIds.contains(hrmEmployeeComInfo.getEmployeeId())) {
continue;
}
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey);
SimpleUserInfo simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getId());
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId);
DataCollectionEmployee simpleUserInfo = simpleUserInfoMap.get(hrmEmployeeComInfo.getEmployeeId());
String idNum = simpleUserInfo == null ? "" : simpleUserInfo.getIdNo();
employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getId())
employeeDeclare.setEmployeeId(hrmEmployeeComInfo.getEmployeeId())
.setEmployeeType(EmployeeTypeEnum.ORGANIZATION.getValue())
.setEmployeeName(hrmEmployeeComInfo.getUsername())
.setJobNum(hrmEmployeeComInfo.getJob_num())
.setJobNum(hrmEmployeeComInfo.getWorkcode())
.setCardNum(idNum)
.setGender(StringUtils.equalsIgnoreCase(hrmEmployeeComInfo.getSex(), GenderEnum.MALE.name())
? GenderEnum.MALE.getValue() : GenderEnum.FEMALE.getValue())
.setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateToLocalDate(simpleUserInfo.getBirthday()))
.setBirthday(simpleUserInfo == null ? null : SalaryDateUtil.dateStrToLocalDate(simpleUserInfo.getBirthday()))
.setMobile(hrmEmployeeComInfo.getMobile());
if (StringUtils.isEmpty(idNum)) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
@ -131,12 +130,12 @@ public class EmployeeDeclareRefresh {
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
} else {
employeeDeclare.setGender(SalaryCardUtil.judgeGender(idNum).getValue());
employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(idNum));
employeeDeclare.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(idNum)));
}
// 对人员处理人员状态离职日期
SalaryArchivePO salaryArchive = salaryArchiveMap.get(employeeDeclare.getEmployeeId());
if (salaryArchive != null) {
employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
// employeeDeclare.setEmploymentType(Util.getIntValue(salaryArchive.getEmploymentType()));
employeeDeclare.setEmploymentDate(salaryArchive.getPayStartDate());
if (Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_PENDING.getValue())
|| Objects.equals(salaryArchive.getRunStatus(), SalaryArchiveStatusEnum.STOP_FROM_SUSPEND.getValue())) {
@ -148,33 +147,34 @@ public class EmployeeDeclareRefresh {
result.getNewEmployeeDeclares().add(employeeDeclare);
}
// 非系统人员中新增的需报送的人员
for (ExtEmployeePO extEmployee : dto.getExtEmployees()) {
if (employeeIds.contains(extEmployee.getId())) {
continue;
}
EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey);
employeeDeclare.setEmployeeId(extEmployee.getId())
.setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue())
.setEmployeeName(extEmployee.getUsername())
.setCardNum(extEmployee.getCardNum())
.setMobile(extEmployee.getMobile())
.setEmploymentType(extEmployee.getEmploymentType())
.setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1));
if (StringUtils.isEmpty(extEmployee.getCardNum())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空"));
} else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) {
employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
} else {
employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue());
employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum()));
}
employeeIds.add(employeeDeclare.getEmployeeId());
result.getNewEmployeeDeclares().add(employeeDeclare);
}
// for (ExtEmployeePO extEmployee : dto.getExtEmployees()) {
// if (employeeIds.contains(extEmployee.getId())) {
// continue;
// }
// EmployeeDeclarePO employeeDeclare = initEmployeeDeclare(dto.getTaxAgentId(), dto.getTaxCycle(), now, employeeId, tenantKey);
// employeeDeclare.setEmployeeId(extEmployee.getId())
// .setEmployeeType(EmployeeTypeEnum.EXT_EMPLOYEE.getValue())
// .setEmployeeName(extEmployee.getUsername())
// .setCardNum(extEmployee.getCardNum())
// .setMobile(extEmployee.getMobile())
// .setEmploymentType(extEmployee.getEmploymentType())
// .setEmploymentDate(YearMonth.parse(extEmployee.getStartMonth()).atDay(1));
// if (StringUtils.isEmpty(extEmployee.getCardNum())) {
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
// employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(187460, "身份证号不能为空"));
// } else if (!SalaryCardUtil.checkIdNum(extEmployee.getCardNum())) {
// employeeDeclare.setDeclareStatus(DeclareStatusEnum.DECLARE_FAIL.getValue());
// employeeDeclare.setDeclareErrorMsg(SalaryI18nUtil.getI18nLabel(156510, "身份证号格式错误"));
// } else {
// employeeDeclare.setGender(SalaryCardUtil.judgeGender(extEmployee.getCardNum()).getValue());
// employeeDeclare.setBirthday(SalaryCardUtil.judgeBirthday(extEmployee.getCardNum()));
// }
// employeeIds.add(employeeDeclare.getEmployeeId());
// result.getNewEmployeeDeclares().add(employeeDeclare);
// }
return result;
}
private static EmployeeDeclarePO initEmployeeDeclare(Long taxAgentId, YearMonth taxCycle, Date now, Long employeeId) {
return new EmployeeDeclarePO()
.setId(IdGenerator.generate())

View File

@ -0,0 +1,142 @@
package com.engine.salary.entity.employeedeclare.bo;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
import com.engine.salary.enums.employeedeclare.GenderEnum;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEnumUtil;
import lombok.Data;
import org.apache.commons.compress.utils.Lists;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @description: 个税对接人员报送
* @author: xiajun
* @modified By: xiajun
* @date: Created in 2022/11/2 11:05 AM
* @version:v1.0
*/
@Data
public class EmployeeDeclareRequest {
/**
* 转换成请求参数
*
* @param employeeDeclares
* @return
*/
public static List<Map<String, Object>> convert2RequestParam(List<EmployeeDeclarePO> employeeDeclares) {
List<Map<String, Object>> employeeInfoMapList = Lists.newArrayList();
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
Map<String, Object> employeeInfoMap = new HashMap<>();
// 工号
employeeInfoMap.put("gh", employeeDeclare.getJobNum());
// *姓名
employeeInfoMap.put("xm", employeeDeclare.getEmployeeName());
// *证件类型
CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
employeeInfoMap.put("zzlx", cardTypeEnum == null ? "" : cardTypeEnum.getDefaultLabel());
// *证件号码
employeeInfoMap.put("zzhm", employeeDeclare.getCardNum());
// *国籍
employeeInfoMap.put("gj", "中国");
// *性别
GenderEnum genderEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getGender(), GenderEnum.class);
employeeInfoMap.put("xb", genderEnum == null ? "" : genderEnum.getDefaultLabel());
// *出生日期
employeeInfoMap.put("csny", employeeDeclare.getBirthday());
// *人员状态
EmploymentStatusEnum employmentStatusEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentStatus(), EmploymentStatusEnum.class);
employeeInfoMap.put("nsrzt", employmentStatusEnum == null ? "" : employmentStatusEnum.getDefaultLabel());
// *任职受雇类型
EmploymentTypeEnum employmentTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getEmploymentType(), EmploymentTypeEnum.class);
employeeInfoMap.put("sfgy", employmentTypeEnum == null ? "" : employmentTypeEnum.getDefaultLabel());
// 入职年度就业情形
employeeInfoMap.put("rzndjyqk", employeeDeclare.getEmploymentFirstYear());
// *手机号码
employeeInfoMap.put("lxdh", employeeDeclare.getMobile());
// *入职受雇日期
employeeInfoMap.put("rzsgrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getEmploymentDate()));
// 离职日期
employeeInfoMap.put("lzrq", SalaryDateUtil.getFormatLocalDate(employeeDeclare.getDismissDate()));
// 是否残疾
SalaryOnOffEnum disability = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDisability(), SalaryOnOffEnum.class);
employeeInfoMap.put("sfcj", disability == null ? "" : disability.getDefaultLabel());
// 残疾证号
employeeInfoMap.put("cjzh", employeeDeclare.getDisabilityCardNo());
// 是否扣除减除费用
SalaryOnOffEnum deductExpenses = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getDeductExpenses(), SalaryOnOffEnum.class);
employeeInfoMap.put("sfzdw", deductExpenses == null ? "" : deductExpenses.getDefaultLabel());
// 是否烈属
SalaryOnOffEnum martyrDependents = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getMartyrDependents(), SalaryOnOffEnum.class);
employeeInfoMap.put("sfls", martyrDependents == null ? "" : martyrDependents.getDefaultLabel());
// 烈属证号
employeeInfoMap.put("lszh", employeeDeclare.getMartyrDependentsCardNo());
// 是否孤老
SalaryOnOffEnum lonelyOld = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getLonelyOld(), SalaryOnOffEnum.class);
employeeInfoMap.put("sfgl", lonelyOld == null ? "" : lonelyOld.getDefaultLabel());
// 个人投资总额
employeeInfoMap.put("grgbze", "");
// 个人投资比例
employeeInfoMap.put("grgbbl", "");
// 备注
employeeInfoMap.put("bz", "");
// 人员地区
employeeInfoMap.put("rydq", "境内");
// 中文名
employeeInfoMap.put("xmzw", "");
// 出生地
employeeInfoMap.put("csd", "");
// 涉税事由
employeeInfoMap.put("sssx", "");
// 首次入境时间
employeeInfoMap.put("scrjsj", "");
// 预计离境时间
employeeInfoMap.put("yjljsj", "");
// 其他证件类型
employeeInfoMap.put("qtzzlx", "");
// 其他证件号码
employeeInfoMap.put("qtzzhm", "");
// 户籍地址省份城市区县街道详细地址
employeeInfoMap.put("hjszd_sheng", "");
employeeInfoMap.put("hjszd_shi", "");
employeeInfoMap.put("hjszd_qx", "");
employeeInfoMap.put("hjszd_jd", "");
employeeInfoMap.put("hjszd_xxdz", "");
// 居住地址省份城市区县街道详细地址
employeeInfoMap.put("lxdz_sheng", "");
employeeInfoMap.put("lxdz_shi", "");
employeeInfoMap.put("lxdz_qx", "");
employeeInfoMap.put("lxdz_jd", "");
employeeInfoMap.put("lxdz", "");
// 联系地
employeeInfoMap.put("wjrlxdz_sheng", "");
employeeInfoMap.put("wjrlxdz_shi", "");
employeeInfoMap.put("wjrlxdz_qx", "");
employeeInfoMap.put("wjrlxdz_jd", "");
employeeInfoMap.put("wjrlxdz_xxdz", "");
// 邮箱
employeeInfoMap.put("dzyx", "");
// 学历
employeeInfoMap.put("xl", "");
// 开户银行
employeeInfoMap.put("khyh", "");
// 开户银行省份
employeeInfoMap.put("khyhsfmz", "");
// 银行账号
employeeInfoMap.put("yhzh", "");
// 职务
employeeInfoMap.put("zw", "");
// 部门编号
employeeInfoMap.put("bmbh", "");
employeeInfoMapList.add(employeeInfoMap);
}
return employeeInfoMapList;
}
}

View File

@ -1,6 +1,5 @@
package com.engine.salary.entity.employeedeclare.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@ -25,12 +24,12 @@ public class EmployeeDeclareRateDTO implements Serializable {
private static final long serialVersionUID = 6096347310269090985L;
@ApiModelProperty("缓存索引")
//缓存索引")
private String index;
@ApiModelProperty("提示信息")
//提示信息")
private String msg;
@ApiModelProperty("状态")
//状态")
private boolean status;
@ApiModelProperty("是否已经完成")
//是否已经完成")
private boolean finish;
}

View File

@ -3,6 +3,7 @@ package com.engine.salary.entity.employeedeclare.dto;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import lombok.Data;
import lombok.experimental.Accessors;
@ -36,15 +37,12 @@ public class EmployeeDeclareRefreshDTO {
private List<SalaryArchivePO> salaryArchives;
// 员工基本信息
private List<DataCollectionEmployee> employeeInfos;
// // 员工基本信息
// private List<HrmEmployeeComInfo> hrmEmployeeComInfos;
private List<DataCollectionEmployee> hrmEmployeeComInfos;
//
// // 员工个人信息
// private List<SimpleUserInfo> simpleUserInfos;
//
// // 非系统人员
// private List<ExtEmployeePO> extEmployees;
// 非系统人员
private List<ExtEmpPO> extEmployees;
}

View File

@ -0,0 +1,96 @@
package com.engine.salary.entity.employeedeclare.param;
import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
import com.engine.salary.enums.employeedeclare.EmploymentTypeEnum;
import com.engine.salary.enums.employeedeclare.GenderEnum;
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.time.YearMonth;
/**
* @description: 人员报送人员保存参数
* @author: xiajun
* @modified By: xiajun
* @date: Created in 9/6/22 1:50 PM
* @version:v1.0
*/
@Data
public class EmployeeDeclareSaveParam {
//主键id")
private Long id;
/**
* 参数错误个税扣缴义务人id不能为空
*/
//个税扣缴义务人id")
private Long taxAgentId;
/**
* 参数错误税款所属期参数格式错误
*/
//税款所属期")
private YearMonth taxCycle;
//员工id")
private Long employeeId;
//员工类型")
private EmployeeTypeEnum employeeType;
//姓名")
private String employeeName;
//工号")
private String jobNum;
//证件类型")
private CardTypeEnum cardType;
//证件号码")
private String cardNum;
//性别")
private GenderEnum gender;
//出生日期")
private LocalDate birthday;
//状态")
private EmploymentStatusEnum employmentStatus;
//手机号码")
private String mobile;
//任职受雇从业类型")
private EmploymentTypeEnum employmentType;
//任职受雇从业日期")
private LocalDate employmentDate;
//离职日期")
private LocalDate dismissDate;
//是否残疾")
private SalaryOnOffEnum disability;
//残疾证号")
private String disabilityCardNo;
//是否孤老")
private SalaryOnOffEnum lonelyOld;
//是否是烈属")
private SalaryOnOffEnum martyrDependents;
//烈属证号")
private String martyrDependentsCardNo;
//是否扣除减除费用")
private SalaryOnOffEnum deductExpenses;
}

View File

@ -0,0 +1,56 @@
package com.engine.salary.entity.employeedeclare.po;
import lombok.Data;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* @description: 员工报送记录
* @author: xiajun
* @modified By: xiajun
* @date: 2022/11/6 16:50
* @version:v1.0
*/
@Data
@Accessors(chain = true)
//"hrsa_employee_declare_record")
public class EmployeeDeclareRecordPO {
/**
* 主键id
*/
private Long id;
/**
* 个税扣缴义务人
*/
private Long taxAgentId;
/**
* 税款所属期
*/
private String taxCycle;
/**
* 请求的requestId
*/
private String requestId;
/**
* 租户key
*/
private String tenantKey;
/**
* 创建人id
*/
private Long creator;
/**
* 是否删除
*/
private Integer deleteType;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
}

View File

@ -0,0 +1,35 @@
package com.engine.salary.entity.employeedeclare.response;
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* @description: 报送人员的反馈
* @author: xiajun
* @modified By: xiajun
* @date: Created in 2022/10/27 10:41 AM
* @version:v1.0
*/
@Data
public class DeclareEmployeeFeedbackResponse {
@ApiModelProperty("接口状态")
private SzyhResponseHead head;
@ApiModelProperty("返回数据")
private DeclareEmployeeFeedbackResponseBody body;
@Data
public static class DeclareEmployeeFeedbackResponseBody {
@ApiModelProperty("人员数据")
private List<Map<String, Object>> bsjg;
@ApiModelProperty("requestId")
private String requestId;
}
}

View File

@ -0,0 +1,23 @@
package com.engine.salary.entity.employeedeclare.response;
import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO;
import com.engine.salary.entity.taxagent.response.SzyhResponseHead;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description: 报送人员的返回数据
* @author: xiajun
* @modified By: xiajun
* @date: Created in 2022/10/25 4:49 PM
* @version:v1.0
*/
@Data
public class DeclareEmployeeInfoResponse {
@ApiModelProperty("接口状态")
private SzyhResponseHead head;
@ApiModelProperty("接口数据")
private AsyncRequestIdDTO body;
}

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @description: 核算结果的校验结果明细临时存储
@ -76,10 +76,10 @@ public class SalaryCheckResultDetailTempPO {
/**
* 创建时间
*/
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @description: 薪资核算校验异常结果
@ -64,10 +64,10 @@ public class SalaryCheckResultPO {
/**
* 创建时间
*/
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @description: 薪资核算校验异常结果明细
@ -74,10 +74,10 @@ public class SalaryCheckResultRecordPO {
/**
* 创建时间
*/
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -11,7 +11,7 @@ import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
import com.engine.salary.util.Sm4Utils;
import dm.jdbc.util.IdGenerator;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@ -43,6 +43,7 @@ public class TaxAgentTaxReturnBO {
}
public static TaxAgentTaxReturnPO convertParam2Po4Insert(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnSaveParam saveParam) throws Exception {
Date now = new Date();
return TaxAgentTaxReturnPO.builder()
.taxAgentId(saveParam.getTaxAgentId())
.taxCode(saveParam.getTaxCode())
@ -57,12 +58,13 @@ public class TaxAgentTaxReturnBO {
.id(IdGenerator.generate())
.checkStatus(TaxAgentTaxReturnStatusEnum.NOT_COMMIT.getValue())
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.createTime(LocalDateTime.now())
.updateTime(LocalDateTime.now())
.createTime(now)
.updateTime(now)
.build();
}
public static void convertParam2Po4Update(TaxDeclarationApiConfigPO apiConfig, TaxAgentTaxReturnPO po, TaxAgentTaxReturnSaveParam saveParam) throws Exception {
Date now = new Date();
po.setTaxCode(saveParam.getTaxCode())
.setNation(saveParam.getNation())
.setCity(saveParam.getCity())
@ -72,7 +74,7 @@ public class TaxAgentTaxReturnBO {
.setPwd(Sm4Utils.encryptEcb(apiConfig.getAppSecret(), saveParam.getPassword()))
.setPasswordType(TaxAgentTaxReturnPasswordTypeEnum.valueOf(saveParam.getPasswordType()).getValue())
.setTaxAgentId(saveParam.getTaxAgentId())
.setUpdateTime(LocalDateTime.now());
.setUpdateTime(now);
}
public static Map<String, Object> convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) {

View File

@ -24,19 +24,19 @@ public class TaxAgentTaxReturnCheckDTO {
* 验证状态
* @see TaxAgentTaxReturnStatusEnum
*/
@ApiModelProperty("验证状态")
//验证状态")
private Integer status;
@ApiModelProperty("登记序号")
//登记序号")
private String taxRegistrationNumber;
@ApiModelProperty("部门编号")
//部门编号")
private String departmentCode;
@ApiModelProperty("验证提示信息")
//验证提示信息")
private String message;
@ApiModelProperty("详细数据")
//详细数据")
private List<TaxAgentTaxReturnCheckFormDTO> records;
public void setMessage(String message, String currentTenantKey, Long currentEmployeeId) {

View File

@ -24,51 +24,51 @@ import lombok.NoArgsConstructor;
@ApiModel("税友验证信息")
public class TaxAgentTaxReturnCheckFormDTO {
@ApiModelProperty("税号")
//税号")
private String taxCode;
@ApiModelProperty("验证信息id")
//验证信息id")
@JsonSerialize(using = ToStringSerializer.class)
private Long index;
@ApiModelProperty("个税扣缴义务人id")
//个税扣缴义务人id")
@JsonSerialize(using = ToStringSerializer.class)
private Long taxAgentId;
@ApiModelProperty("个税扣缴义务人")
//个税扣缴义务人")
private String taxAgentName;
@ApiModelProperty("登记序号")
//登记序号")
private String taxRegistrationNumber;
@ApiModelProperty("纳税人状态")
//纳税人状态")
private String taxpayerStatus;
@ApiModelProperty("法人姓名")
//法人姓名")
private String legalPersonName;
@ApiModelProperty("联系电话")
//联系电话")
private String mobile;
@ApiModelProperty("生产经营地址")
//生产经营地址")
private String businessAddress;
@ApiModelProperty("行业名称")
//行业名称")
private String industryName;
@ApiModelProperty("主管税务机关")
//主管税务机关")
private String taxAuthorities;
@ApiModelProperty("主管税务科所")
//主管税务科所")
private String taxBranch;
@ApiModelProperty("是否分部门备案")
//是否分部门备案")
private SalaryOnOffEnum divideFiling;
@ApiModelProperty("部门名称")
//部门名称")
private String departmentName;
@ApiModelProperty("部门编码")
//部门编码")
private String departmentCode;
}

View File

@ -24,50 +24,50 @@ import lombok.experimental.Accessors;
@ApiModel("报税信息表单")
public class TaxAgentTaxReturnMainFormDTO {
@ApiModelProperty("主键id")
//主键id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("名称")
//名称")
private String name;
@ApiModelProperty("税号")
//税号")
private String taxCode;
@ApiModelProperty("报税所属区域")
//报税所属区域")
private String city;
@ApiModelProperty("省份")
//省份")
private String province;
@ApiModelProperty("国家")
//国家")
private String nation;
@ApiModelProperty("行政区划代码")
//行政区划代码")
private String areaCode;
@ApiModelProperty("密码校验类型")
//密码校验类型")
private TaxAgentTaxReturnPasswordTypeEnum passwordType;
@ApiModelProperty("个税网报密码")
//个税网报密码")
private String netPassword;
@ApiModelProperty("实名账号")
//实名账号")
private String account;
@ApiModelProperty("实名账号密码")
//实名账号密码")
private String realNamePassword;
@ApiModelProperty("登记序号")
//登记序号")
private String taxRegistrationNumber;
@ApiModelProperty("部门编码")
//部门编码")
private String departmentCode;
@ApiModelProperty("报税信息验证状态")
//报税信息验证状态")
private TaxAgentTaxReturnStatusEnum checkStatus;
@ApiModelProperty("失败原因")
//失败原因")
private String failReason;
}

View File

@ -21,47 +21,47 @@ import lombok.NoArgsConstructor;
@ApiModel("个税扣缴义务人-报税信息-保存参数")
public class TaxAgentTaxReturnSaveParam {
@ApiModelProperty("个税扣缴义务人id")
//个税扣缴义务人id")
private Long taxAgentId;
@ApiModelProperty("税号")
//税号")
private String taxCode;
@ApiModelProperty("登记序号")
//登记序号")
private String taxRegistrationNumber;
@ApiModelProperty("省级")
//省级")
private String province;
@ApiModelProperty("市级")
//市级")
private String city;
@ApiModelProperty("国家")
//国家")
private String nation;
@ApiModelProperty("密码校验类型")
//密码校验类型")
private String passwordType;
@ApiModelProperty("密码")
//密码")
private String password;
@ApiModelProperty("实名账号")
//实名账号")
private String account;
@ApiModelProperty("部门编码,分部门备案时填入")
//部门编码分部门备案时填入")
private String departmentCode;
@ApiModelProperty("部门名称,分部门备案时填入")
//部门名称分部门备案时填入")
private String departmentName;
@ApiModelProperty("请求类型 1.保存并验证 2.仅保存")
//请求类型 1.保存并验证 2.仅保存")
private Integer requestType = 1;
@ApiModelProperty("验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码")
//验证类型 1.请求税友验证报税信息 2.请求税友验证登记序号+税号 3.请求税友验证部门编码")
@JsonIgnore
private Integer type;
@ApiModelProperty("地区编码")
//地区编码")
private String areaCode;
public void checkParam() {

View File

@ -1,91 +1,88 @@
//package com.engine.salary.entity.taxapiflow.bo;
//
//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
//import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
//import com.engine.salary.enums.sicategory.DeleteTypeEnum;
//import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
//import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl;
//import com.weaver.common.distribution.genid.IdGenerator;
//import com.weaver.hrm.salary.entity.extemployee.po.ExtEmployeePO;
//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam;
//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO;
//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum;
//import com.weaver.hrm.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
//import com.weaver.hrm.salary.util.SalaryDateUtil;
//import com.weaver.hrm.salary.util.SalaryEnumUtil;
//import com.weaver.hrm.salary.util.SalaryI18nUtil;
//import com.weaver.mc.api.entity.*;
//import com.weaver.mc.util.StringUtils;
//import com.weaver.teams.domain.EntityType;
//
//import java.time.LocalDate;
//import java.time.LocalDateTime;
//import java.util.*;
//import java.util.concurrent.atomic.AtomicInteger;
//
///**
// * @author chengliming
// * @date 2022-11-16 1:41 PM
// **/
//public class TaxApiFlowBO {
//
// /**
// * 流量使用情况
// *
// * @param wrapper 包装类
// * @param taxAgentId
// * @param employeeId
// * @return
// */
// public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper,
// Long taxAgentId,
// Long employeeId) {
// return TaxDeclarationApiFlowRecordPO.builder()
// .id(IdGenerator.generate())
// .deduct(null)
// .businessType(wrapper.getBusinessType().getValue())
// .taxMonth(wrapper.getTaxYearMonth())
// .useTime(LocalDate.now())
// .createTime(LocalDateTime.now())
// .updateTime(LocalDateTime.now())
// .employeeId(employeeId)
// .taxAgentId(taxAgentId)
// .resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())
// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
// .tenantKey(wrapper.getTenantKey())
// .creator(wrapper.getCurrentEmployeeId())
// .build();
// }
//
// public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) {
// String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId());
// String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId());
// String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getUsername();
// String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmployeePO()).getCardNum();
// String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator());
// String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId());
//
// boolean isInternal = StringUtils.isNotEmpty(internalUsername);
// return TaxDeclarationApiFlowRecordListDTO.builder()
// .id(e.getId())
// .indexNum(indexNum.getAndIncrement())
// .createTime(SalaryDateUtil.DATE_TIME_FORMATTER.format(e.getCreateTime()))
// .taxAgentName(taxAgentName)
// .employeeName(isInternal ? internalUsername : externalUsername)
// .employeeType(isInternal ? "inside" : "external")
// .idCardNo(isInternal ? idNo : externalIdNo)
// .employeeId(e.getEmployeeId())
// .businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel())
// .result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel())
// .creator(creator)
// .creatorId(e.getCreator())
// .build();
// }
//
package com.engine.salary.entity.taxapiflow.bo;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam;
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEnumUtil;
import dm.jdbc.util.IdGenerator;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author chengliming
* @date 2022-11-16 1:41 PM
**/
public class TaxApiFlowBO {
/**
* 流量使用情况
*
* @param wrapper 包装类
* @param taxAgentId
* @param employeeId
* @return
*/
public static TaxDeclarationApiFlowRecordPO buildTaxDeclarationApiFlowRecordPO(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper wrapper,
Long taxAgentId,
Long employeeId) {
Date now = new Date();
return TaxDeclarationApiFlowRecordPO.builder()
.id(IdGenerator.generate())
.deduct(null)
.businessType(wrapper.getBusinessType().getValue())
.taxMonth(wrapper.getTaxYearMonth())
.useTime(now)
.createTime(now)
.updateTime(now)
.employeeId(employeeId)
.taxAgentId(taxAgentId)
.resultStatus(TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.tenantKey(wrapper.getTenantKey())
.creator(wrapper.getCurrentEmployeeId())
.build();
}
public static TaxDeclarationApiFlowRecordListDTO taxDeclarationApiFlowRecordPo2ListDTO(TaxDeclarationApiBillingServiceImpl.TempPropertiesWrapper propertiesWrapper, AtomicInteger indexNum, TaxDeclarationApiFlowRecordPO e) {
String internalUsername = propertiesWrapper.getEmpNameMap().get(e.getEmployeeId());
String idNo = propertiesWrapper.getEmpIdNoMap().get(e.getEmployeeId());
String externalUsername = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getUsername();
String externalIdNo = propertiesWrapper.getExtEmployeeMap().getOrDefault(e.getEmployeeId(), new ExtEmpPO()).getIdNo();
String creator = propertiesWrapper.getEmpNameMap().get(e.getCreator());
String taxAgentName = propertiesWrapper.getTaxAgentNameMap().get(e.getTaxAgentId());
boolean isInternal = StringUtils.isNotEmpty(internalUsername);
return TaxDeclarationApiFlowRecordListDTO.builder()
.id(e.getId())
.indexNum(indexNum.getAndIncrement())
.createTime(SalaryDateUtil.getFormatLocalDate(e.getCreateTime()))
.taxAgentName(taxAgentName)
.employeeName(isInternal ? internalUsername : externalUsername)
.employeeType(isInternal ? "inside" : "external")
.idCardNo(isInternal ? idNo : externalIdNo)
.employeeId(e.getEmployeeId())
.businessTypeName(SalaryEnumUtil.enumMatchByValue(e.getBusinessType(), EnumDeclareApiBusinessType.class).getDefaultLabel())
.result(TaxAgentTaxReturnStatusEnum.parseByValue(e.getResultStatus()).getDefaultLabel())
.creator(creator)
.creatorId(e.getCreator())
.build();
}
// public static SendMessageEntity buildSendMessageEntity(TaxDeclarationApiFlowWarnConfigPO warnConfig, List<UserEntity> receivers, TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper) {
// String title = SalaryI18nUtil.getI18nLabel(160389, "智能算薪流量不足提醒");
// String desc = String.format(SalaryI18nUtil.getI18nLabel(184069, "智能算薪流量已不足%s请及时采购续费避免次月无法使用。"), warnConfig.getThreshold());
// String title = SalaryI18nUtil.getI18nLabel(111, "智能算薪流量不足提醒");
// String desc = String.format(SalaryI18nUtil.getI18nLabel(111, "智能算薪流量已不足%s请及时采购续费避免次月无法使用。"), warnConfig.getThreshold());
// Entity entity = new Entity()
// .setId(IdGenerator.generate() + "")
// .setModule(EntityType.hrmsalary.name())
@ -120,27 +117,27 @@
// smg.setEmailInfo(emailEntity);
// return smg;
// }
//
// public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam,
// Long currentEmployeeId,
// String currentTenantKey) {
// saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" "));
// saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" "));
// return TaxDeclarationApiConfigPO.builder()
// .id(IdGenerator.generate())
// .appKey(saveParam.getAppKey())
// .appSecret(saveParam.getAppSecret())
// .enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue())
// .createTime(LocalDateTime.now())
// .updateTime(LocalDateTime.now())
// .creator(currentEmployeeId)
// .tenantKey(currentTenantKey)
// .deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
// .build();
// }
//
// @Override
// public String toString() {
// return "TaxApiFlowBO{}";
// }
//}
public static TaxDeclarationApiConfigPO buildTaxDeclarationApiConfigPO(TaxDeclarationBillingConfigSaveParam saveParam,
Long currentEmployeeId) {
Date now = new Date();
saveParam.setAppKey(Optional.ofNullable(saveParam.getAppKey()).orElse(" "));
saveParam.setAppSecret(Optional.ofNullable(saveParam.getAppSecret()).orElse(" "));
return TaxDeclarationApiConfigPO.builder()
.id(IdGenerator.generate())
.appKey(saveParam.getAppKey())
.appSecret(saveParam.getAppSecret())
.enableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue())
.createTime(now)
.updateTime(now)
.creator(currentEmployeeId)
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.deleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.build();
}
@Override
public String toString() {
return "TaxApiFlowBO{}";
}
}

View File

@ -21,15 +21,15 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@ApiModel("智能算税-流量提醒-创建规则参数")
public class CreateMessageRuleParamDTO {
@ApiModelProperty("模块")
//模块")
@JsonSerialize(using = ToStringSerializer.class)
private Integer moduleId;
@ApiModelProperty("事件")
//事件")
@JsonSerialize(using = ToStringSerializer.class)
private Integer eventId;
@ApiModelProperty("业务")
//业务")
@JsonSerialize(using = ToStringSerializer.class)
private Long businessId;
}

View File

@ -21,42 +21,42 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@ApiModel("智能算税-流量使用记录")
public class TaxDeclarationApiFlowRecordListDTO {
@ApiModelProperty("id")
//id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("序号")
//序号")
private Integer indexNum;
@ApiModelProperty("使用时间")
//使用时间")
private String createTime;
@ApiModelProperty("个税扣缴义务人")
//个税扣缴义务人")
private String taxAgentName;
@ApiModelProperty("人员")
//人员")
private String employeeName;
@ApiModelProperty("人员类型")
//人员类型")
private String employeeType;
@ApiModelProperty("人员id")
//人员id")
@JsonSerialize(using = ToStringSerializer.class)
private Long employeeId;
@ApiModelProperty("创建人id")
//创建人id")
@JsonSerialize(using = ToStringSerializer.class)
private Long creatorId;
@ApiModelProperty("身份证号码")
//身份证号码")
private String idCardNo;
@ApiModelProperty("接口业务")
//接口业务")
private String businessTypeName;
@ApiModelProperty("操作人")
//操作人")
private String creator;
@ApiModelProperty("结果")
//结果")
private String result;
}

View File

@ -22,7 +22,7 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@ApiModel("智能算税-流量统计-月度详情")
public class TaxDeclarationApiFlowStatisticDetailListDTO {
@ApiModelProperty("id")
//id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ -32,10 +32,10 @@ public class TaxDeclarationApiFlowStatisticDetailListDTO {
@JsonIgnore
private String taxAgentName;
@ApiModelProperty("税款所属期")
//税款所属期")
private String taxMonth;
@ApiModelProperty("月使用流量数")
//月使用流量数")
private Integer used;
}

View File

@ -21,20 +21,20 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@ApiModel("智能算税-流量统计")
public class TaxDeclarationApiFlowStatisticListDTO {
@ApiModelProperty("id")
//id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("序号")
//序号")
private Integer indexNum;
@ApiModelProperty("个税扣缴义务人")
//个税扣缴义务人")
private String taxAgentName;
@ApiModelProperty("个税扣缴义务人ID")
//个税扣缴义务人ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long taxAgentId;
@ApiModelProperty("已使用")
//已使用")
private Integer used;
}

View File

@ -21,18 +21,18 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@ApiModel("智能算税-流量统计")
public class TaxDeclarationApiFlowTotalDTO {
@ApiModelProperty("总流量")
//总流量")
@JsonSerialize(using = ToStringSerializer.class)
private Long total;
@ApiModelProperty("剩余流量")
//剩余流量")
@JsonSerialize(using = ToStringSerializer.class)
private Long remain;
@ApiModelProperty("已使用流量")
//已使用流量")
@JsonSerialize(using = ToStringSerializer.class)
private Long used;
@ApiModelProperty("最后更新时间")
//最后更新时间")
private String lastUpdateTime;
}

View File

@ -22,28 +22,28 @@ import lombok.NoArgsConstructor;
@ApiModel("智能算税-流量不足提醒-表单")
public class TaxDeclarationApiFlowWarnConfigFormDTO {
@ApiModelProperty("主键id")
//主键id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("提醒开关")
//提醒开关")
private Boolean enable;
@ApiModelProperty("提醒规则")
//提醒规则")
private Integer threshold;
@ApiModelProperty("提醒推送方式")
//提醒推送方式")
private String config;
@ApiModelProperty("业务ID")
//业务ID")
@JsonSerialize(using = ToStringSerializer.class)
private Long businessId;
@ApiModelProperty("模块")
//模块")
@JsonSerialize(using = ToStringSerializer.class)
private String moduleId;
@ApiModelProperty("事件")
//事件")
@JsonSerialize(using = ToStringSerializer.class)
private String eventId;
}

View File

@ -26,20 +26,20 @@ import java.util.List;
@ApiModel("智能算税-流量不足提醒对象-表单")
public class TaxDeclarationApiFlowWarnReceiverFormDTO {
@ApiModelProperty("主键id")
//主键id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("提醒对象")
//提醒对象")
private List<OptionDTO> employee;
@ApiModelProperty("手机号")
//手机号")
private String mobile;
@ApiModelProperty("邮箱列表")
//邮箱列表")
private String email;
@ApiModelProperty("邮箱列表下拉框")
//邮箱列表下拉框")
@JsonIgnore
private List<String> emailOptions;
}

View File

@ -23,20 +23,20 @@ import net.minidev.json.annotate.JsonIgnore;
@ApiModel("智能算税-流量提醒对象")
public class TaxDeclarationApiFlowWarnReceiverListDTO {
@ApiModelProperty("id")
//id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("提醒对象")
//提醒对象")
private String employeeName;
@JsonIgnore
@JsonSerialize(using = ToStringSerializer.class)
private Long employeeId;
@ApiModelProperty("手机号")
//手机号")
private String mobile;
@ApiModelProperty("邮箱")
//邮箱")
private String email;
}

View File

@ -22,16 +22,16 @@ import lombok.NoArgsConstructor;
@ApiModel("智能算税-启用设置-表单")
public class TaxDeclarationBillingConfigFormDTO {
@ApiModelProperty("主键id")
//主键id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("appKey")
//appKey")
private String appKey;
@ApiModelProperty("appSecret")
//appSecret")
private String appSecret;
@ApiModelProperty("智能算薪开关")
//智能算薪开关")
private Boolean enable;
}

View File

@ -13,11 +13,11 @@ import javax.validation.constraints.NotNull;
**/
@Data
public class CreateMessageRuleParam {
@ApiModelProperty("业务ID")
//业务ID")
@NotNull(message = "业务ID不能为空")
private String businessId;
@ApiModelProperty("详细规则")
//详细规则")
@NotNull(message = "详细规则不能为空")
private String config;
}

View File

@ -24,14 +24,14 @@ import java.time.YearMonth;
@ApiModel("流量月度详情查询参数")
public class TaxDeclarationApiFlowMonthQueryParam extends BaseQueryParam {
@ApiModelProperty("个税扣缴义务人id")
//个税扣缴义务人id")
@NotNull(message = "个税扣缴义务人不能为空")
private Long taxAgentId;
@ApiModelProperty("税款所属期开始时间")
//税款所属期开始时间")
private YearMonth startTaxMonth;
@ApiModelProperty("税款所属期结束时间")
//税款所属期结束时间")
private YearMonth endTaxMonth;
public Integer getStartTaxMonth() {

View File

@ -23,18 +23,18 @@ import java.time.LocalDate;
@ApiModel("流量月度详情查询参数")
public class TaxDeclarationApiFlowRecordQueryParam extends BaseQueryParam {
@ApiModelProperty("个税扣缴义务人id")
//个税扣缴义务人id")
private Long taxAgentId;
@ApiModelProperty("开始时间")
//开始时间")
private LocalDate startDate;
@ApiModelProperty("结束时间")
//结束时间")
private LocalDate endDate;
@ApiModelProperty("业务接口类型")
//业务接口类型")
private Integer businessType;
@ApiModelProperty("结果")
//结果")
private Integer result;
}

View File

@ -21,20 +21,20 @@ import javax.validation.constraints.NotNull;
@AllArgsConstructor
@ApiModel("流量不足提醒规则创建")
public class TaxDeclarationApiFlowWarnConfigSaveParam {
@ApiModelProperty("提醒对象Id")
//提醒对象Id")
private Long id;
@ApiModelProperty("提醒阈值")
//提醒阈值")
@NotNull(message = "提醒规则不能为空")
private Long threshold;
@ApiModelProperty("提醒开关是否打开")
//提醒开关是否打开")
private Boolean enable;
@ApiModelProperty("业务ID")
//业务ID")
@NotNull(message = "推送方式不能为空")
private Long businessId;
@ApiModelProperty("规则")
//规则")
private String config;
}

View File

@ -19,18 +19,18 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
@ApiModel("流量不足提醒对象")
public class TaxDeclarationApiFlowWarnReceiverSaveParam {
@ApiModelProperty("提醒对象Id")
//提醒对象Id")
private Long id;
@ApiModelProperty("提醒配置Id")
//提醒配置Id")
private Long warnConfigId;
@ApiModelProperty("人员Id")
//人员Id")
private Long employeeId;
@ApiModelProperty("邮箱")
//邮箱")
private String email;
@ApiModelProperty("手机号")
//手机号")
private String mobile;
}

View File

@ -20,16 +20,16 @@ import lombok.NoArgsConstructor;
@ApiModel("智能算薪配置参数")
public class TaxDeclarationBillingConfigSaveParam {
@ApiModelProperty("appKey")
//appKey")
private String appKey;
@ApiModelProperty("appSecret")
//appSecret")
private String appSecret;
@ApiModelProperty("enable")
//enable")
private String enable;
@ApiModelProperty("配置ID")
//配置ID")
private Long configId;
}

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 流量不足提醒对象
@ -52,12 +52,12 @@ public class TaxDeclarationApiFlowWarnReceiverPO implements Serializable {
/**
* 创建时间
*/
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
private Date updateTime;
/**
* 创建人

View File

@ -18,32 +18,32 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class AbnormalEmployeeListDTO {
@ApiModelProperty("主键id")
//主键id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("关联人员类型")
//关联人员类型")
private Integer employeeType;
@ApiModelProperty("关联人员id")
//关联人员id")
@JsonSerialize(using = ToStringSerializer.class)
private Long employeeId;
@ApiModelProperty("姓名")
//姓名")
private String employeeName;
@ApiModelProperty("工号")
//工号")
private String jobNum;
@ApiModelProperty("证件类型")
//证件类型")
private String cardType;
@ApiModelProperty("证件号码")
//证件号码")
private String cardNum;
@ApiModelProperty("报送状态")
//报送状态")
private DeclareStatusEnum declareStatus;
@ApiModelProperty("报送状态")
//报送状态")
private String declareStatusDesc;
}

View File

@ -17,26 +17,26 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class FailEmployeeListDTO {
@ApiModelProperty("主键id")
//主键id")
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("姓名")
//姓名")
private String employeeName;
@ApiModelProperty("个税扣缴义务人id")
//个税扣缴义务人id")
@JsonSerialize(using = ToStringSerializer.class)
private Long taxAgentId;
@ApiModelProperty("个税扣缴义务人名称")
//个税扣缴义务人名称")
private String taxAgentName;
@ApiModelProperty("证件号码")
//证件号码")
private String cardNum;
@ApiModelProperty("失败原因")
//失败原因")
private String errorMsg;
@ApiModelProperty("所得项目")
//所得项目")
private String incomeCategory;
}

View File

@ -19,15 +19,15 @@ public class TaxDeclarationRateDTO implements Serializable {
private static final long serialVersionUID = 8478996890743085394L;
@ApiModelProperty("缓存索引")
//缓存索引")
private String index;
@ApiModelProperty("提示信息")
//提示信息")
private String msg;
@ApiModelProperty("状态")
//状态")
private boolean status;
@ApiModelProperty("是否已经完成")
//是否已经完成")
private boolean finish;
@ApiModelProperty("提示信息是否自动消失")
//提示信息是否自动消失")
private boolean msgPersist;
}

View File

@ -18,13 +18,13 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class TaxDeclarationTabDTO {
@ApiModelProperty("Tab页签的名称")
//Tab页签的名称")
private String tabName;
@ApiModelProperty("收入所得类型")
//收入所得类型")
private IncomeCategoryEnum incomeCategory;
@ApiModelProperty("个税申报表id")
//个税申报表id")
@JsonSerialize(using = ToStringSerializer.class)
private Long taxDeclarationId;
}

View File

@ -26,15 +26,15 @@ import java.util.Map;
@ApiModel("个税申报记录表单")
public class TaxDeclareRecordFormDTO {
@ApiModelProperty("薪资所属月")
//薪资所属月")
private YearMonth salaryMonth;
@ApiModelProperty("个税扣缴义务人范围")
//个税扣缴义务人范围")
private TaxAgentRangeEnum taxAgentRange;
@ApiModelProperty("个税扣缴义务人id")
//个税扣缴义务人id")
private List<Map<String, Object>> taxAgentIds;
@ApiModelProperty("备注")
//备注")
private String description;
}

View File

@ -22,47 +22,47 @@ public class TaxDeclareRecordListDTO {
@JsonSerialize(using = ToStringSerializer.class)
private Long id;
@ApiModelProperty("个税扣缴义务人")
//个税扣缴义务人")
@JsonSerialize(using = ToStringSerializer.class)
private Long taxAgentId;
@ApiModelProperty("个税扣缴义务人名称")
//个税扣缴义务人名称")
private String taxAgentName;
@ApiModelProperty("薪资所属月")
//薪资所属月")
private String salaryMonth;
@ApiModelProperty("税款所属期")
//税款所属期")
private String taxCycle;
@ApiModelProperty("申报类型")
//申报类型")
private TaxDeclareTypeEnum taxDeclareType;
@ApiModelProperty("申报类型")
//申报类型")
private String taxDeclareTypeDesc;
@ApiModelProperty("申报状态")
//申报状态")
private TaxDeclareStatusEnum taxDeclareStatus;
@ApiModelProperty("申报状态")
//申报状态")
private String taxDeclareStatusDesc;
@ApiModelProperty("已缴金额")
//已缴金额")
private String taxPaidAmount;
@ApiModelProperty("操作人id")
//操作人id")
@JsonSerialize(using = ToStringSerializer.class)
private Long operateEmployeeId;
@ApiModelProperty("操作人名称")
//操作人名称")
private String operateEmployeeName;
@ApiModelProperty("操作时间")
//操作时间")
private String operateTime;
@ApiModelProperty("备注")
//备注")
private String description;
@ApiModelProperty("是否展示图标")
//是否展示图标")
private boolean displayIcon;
}

View File

@ -17,17 +17,17 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
public class AbnormalEmployeeListQueryParam extends BaseQueryParam {
@ApiModelProperty("工号、姓名、身份证号码")
//工号姓名身份证号码")
private String keyword;
@ApiModelProperty("个税申报记录id")
//个税申报记录id")
private Long taxDeclareRecordId;
@JsonIgnore
@ApiModelProperty("个税扣缴义务人id")
//个税扣缴义务人id")
private Long taxAgentId;
@JsonIgnore
@ApiModelProperty("税款所属期")
//税款所属期")
private String taxCycle;
}

View File

@ -17,15 +17,15 @@ import lombok.Data;
@ApiModel("个税申报表记录列表查询参数")
public class TaxDeclarationValueListQueryParam extends BaseQueryParam {
@ApiModelProperty("个税申报记录id")
//个税申报记录id")
private Long taxDeclareRecordId;
@ApiModelProperty("个税申报表id")
//个税申报表id")
private Long taxDeclarationId;
@ApiModelProperty("收入所得项目")
//收入所得项目")
private IncomeCategoryEnum incomeCategory;
@ApiModelProperty("导出excel时加密的密码")
//导出excel时加密的密码")
private String sharePassword;
}

View File

@ -13,6 +13,6 @@ import lombok.Data;
@Data
public class TaxDeclareRecordParam {
@ApiModelProperty("个税申报记录id")
//个税申报记录id")
private Long taxDeclareRecordId;
}

View File

@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 个税申报相关api配置
@ -61,7 +61,7 @@ public class TaxDeclarationApiConfigPO implements Serializable {
/**
* 流量最后更新时间
*/
private LocalDateTime lastUpdateTime;
private Date lastUpdateTime;
/**
* 租户key
@ -81,10 +81,10 @@ public class TaxDeclarationApiConfigPO implements Serializable {
/**
* 创建时间
*/
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 个税申报相关api配置
@ -56,10 +56,10 @@ public class TaxDeclarationApiProfilePO implements Serializable {
/**
* 创建时间
*/
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -4,7 +4,7 @@ import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Map;
/**
@ -71,10 +71,10 @@ public class TaxDeclarationValuePO implements Serializable {
/**
* 创建时间
*/
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -13,9 +13,9 @@ import lombok.Data;
@Data
public class TaxDeclareEmployeePO {
@ApiModelProperty("人员id")
//人员id")
private Long employeeId;
@ApiModelProperty("人员类型")
//人员类型")
private Integer employeeType;
}

View File

@ -4,7 +4,7 @@ import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @description: 个税申报
@ -102,10 +102,10 @@ public class TaxDeclareRecordPO implements Serializable {
* 创建时间
*/
//创建时间", ignore = true)
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
//更新时间", ignore = true)
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -2,7 +2,7 @@ package com.engine.salary.entity.taxdeclaration.po;
import lombok.Data;
import java.time.LocalDateTime;
import java.util.Date;
/**
* @description: 个税申报表表头
@ -39,7 +39,7 @@ public class TaxReportColumnPO {
//name = "是否删除", ignore = true)
private Integer deleteType;
//name = "创建时间", ignore = true)
private LocalDateTime createTime;
private Date createTime;
//name = "更新时间", ignore = true)
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -16,9 +16,9 @@ import java.util.Map;
@Data
public class CancelDeclareFeedbackResponse {
@ApiModelProperty("接口状态")
//接口状态")
private SzyhResponseHead head;
@ApiModelProperty("接口状态")
//接口状态")
private Map<String, Object> body;
}

View File

@ -15,9 +15,9 @@ import lombok.Data;
@Data
public class CancelDeclareResponse {
@ApiModelProperty("接口状态")
//接口状态")
private SzyhResponseHead head;
@ApiModelProperty("接口数据")
//接口数据")
private AsyncRequestIdDTO body;
}

View File

@ -16,9 +16,9 @@ import java.util.Map;
@Data
public class DeclareTaxFeedbackResponse {
@ApiModelProperty("接口状态")
//接口状态")
private SzyhResponseHead head;
@ApiModelProperty("接口状态")
//接口状态")
private Map<String, Object> body;
}

View File

@ -15,9 +15,9 @@ import lombok.Data;
@Data
public class DeclareTaxResponse {
@ApiModelProperty("接口状态")
//接口状态")
private SzyhResponseHead head;
@ApiModelProperty("接口数据")
//接口数据")
private AsyncRequestIdDTO body;
}

View File

@ -16,6 +16,6 @@ import lombok.Data;
@ApiModel("更正申报的返回数据")
public class UpdateDeclareResponse {
@ApiModelProperty("接口状态")
//接口状态")
private SzyhResponseHead head;
}

View File

@ -21,9 +21,9 @@ import lombok.NoArgsConstructor;
public class TaxAgreementBankFormDTO {
@ApiModelProperty("开户行")
//开户行")
private String bank;
@ApiModelProperty("开户账号")
//开户账号")
private String bankNo;
}

View File

@ -22,12 +22,12 @@ import lombok.experimental.Accessors;
@AllArgsConstructor
@ApiModel("获取三方查询反馈结果")
public class TaxAgreementFeedbackResultDTO extends TaxFeedbackResultDTO {
@ApiModelProperty("实缴金额")
//实缴金额")
private String payAmount;
@ApiModelProperty("滞纳金等金额")
//滞纳金等金额")
private String otherAmount;
@ApiModelProperty("申报人数")
//申报人数")
private String personNum;
}

View File

@ -31,7 +31,7 @@
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true)
// }
// )
// @ApiModelProperty("个税扣缴义务人")
// //个税扣缴义务人")
// private String taxAgent;
//
// @SalaryForm(
@ -42,7 +42,7 @@
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true)
// }
// )
// @ApiModelProperty("应缴金额")
// //应缴金额")
// private String amount;
//
// @SalaryForm(
@ -53,6 +53,6 @@
// @SalaryFormItem(itemType = WeaFormItemType.INPUT, maxLength = "50", readOnly = true)
// }
// )
// @ApiModelProperty("申报人数")
// //申报人数")
// private String personNum;
//}

View File

@ -20,15 +20,15 @@ import lombok.experimental.Accessors;
@AllArgsConstructor
@ApiModel("获取反馈结果")
public class TaxFeedbackResultDTO {
@ApiModelProperty("请求id")
//请求id")
private String requestId;
@ApiModelProperty("提示语")
//提示语")
private String msg;
@ApiModelProperty("处理结果")
//处理结果")
private String result;
@ApiModelProperty("是否结束轮询")
//是否结束轮询")
private Boolean finish;
}

View File

@ -20,7 +20,7 @@ import lombok.NoArgsConstructor;
@ApiModel("查询缴费信息")
public class TaxPayTypeFormDTO {
@ApiModelProperty("缴款方式")
//缴款方式")
private String type;
}

View File

@ -24,16 +24,16 @@ import java.util.List;
@AllArgsConstructor
@ApiModel("获取完税证明")
public class TaxWithheldVoucherResultDTO extends TaxFeedbackResultDTO {
@ApiModelProperty("完税证明")
//完税证明")
private List<Voucher> vouchers;
@Data
@AllArgsConstructor
public static class Voucher {
@ApiModelProperty("名称")
//名称")
private String name;
@ApiModelProperty("内容")
//内容")
private String content;
}
}

View File

@ -20,27 +20,27 @@ import java.time.YearMonth;
@ApiModel("查询企业三方信息")
public class TaxPaymentQueryParam {
@ApiModelProperty("个税扣缴义务人id")
//个税扣缴义务人id")
private Long taxAgentId;
@ApiModelProperty("税款所属期")
//税款所属期")
private YearMonth taxYearMonth;
@ApiModelProperty("个税申报记录id")
//个税申报记录id")
private Long taxDeclareRecordId;
/**
* TaxPaymentServiceTypeEnum
*/
@ApiModelProperty("业务类型")
//业务类型")
private Integer type;
@ApiModelProperty("三方协议号")
//三方协议号")
private String protocolNumber;
@ApiModelProperty("应缴税额")
//应缴税额")
private String taxAmount;
@ApiModelProperty("是否为反馈校验 0否 1是")
//是否为反馈校验 0否 1是")
private Integer checkFeedback;
}

View File

@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 个税辅助缴款-三方缴款请求
@ -93,11 +93,11 @@ public class TaxPaymentRequestPO implements Serializable {
* 创建时间
*/
//创建时间", ignore = true)
private LocalDateTime createTime;
private Date createTime;
/**
* 更新时间
*/
//更新时间", ignore = true)
private LocalDateTime updateTime;
private Date updateTime;
}

View File

@ -0,0 +1,21 @@
package com.engine.salary.service;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
import java.time.YearMonth;
/**
* @description: 员工报送记录
* @author: xiajun
* @modified By: xiajun
* @date: 2022/11/6 16:54
* @version:v1.0
*/
public interface EmployeeDeclareRecordService {
EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId);
void deleteByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId);
void save(EmployeeDeclareRecordPO employeeDeclareRecord);
}

View File

@ -3,6 +3,7 @@ package com.engine.salary.service;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRateDTO;
import com.engine.salary.entity.employeedeclare.param.*;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.util.page.PageInfo;
@ -111,10 +112,8 @@ public interface EmployeeDeclareService{
* 保存
*
* @param saveParam
* @param employeeId
* @param tenantKey
*/
// void save(EmployeeDeclareSaveParam saveParam, Long employeeId);
void save(EmployeeDeclareSaveParam saveParam);
/**
* 批量编辑
@ -168,15 +167,13 @@ public interface EmployeeDeclareService{
* 报送人员
*
* @param param
* @param tenantKey
*/
// void declare(EmployeeDeclareParam param, Long employeeId);
void declare(EmployeeDeclareParam param);
/**
* 获取报送人员的反馈
*
* @param param
* @param tenantKey
*/
// void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId);
void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate);
}

View File

@ -1,12 +1,6 @@
package com.engine.salary.service;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl;
import com.engine.salary.util.page.PageInfo;
import java.util.List;
import java.util.Map;
/**
* 个税申报计费service
@ -23,21 +17,21 @@ public interface TaxDeclarationApiBillingService {
*/
void updateApiFlowInfo(TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper updateWrapper);
/**
* 获取流量使用记录(分页)
*
* @param queryParam
* @return
*/
PageInfo<TaxDeclarationApiFlowRecordListDTO> pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam);
/**
* 获取流量使用记录不分页
*
* @param queryParam
* @return
*/
List<TaxDeclarationApiFlowRecordListDTO> listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam);
// /**
// * 获取流量使用记录(分页)
// *
// * @param queryParam
// * @return
// */
// PageInfo<TaxDeclarationApiFlowRecordListDTO> pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam);
//
// /**
// * 获取流量使用记录不分页
// *
// * @param queryParam
// * @return
// */
// List<TaxDeclarationApiFlowRecordListDTO> listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam);
/**
* 导出流量使用记录
@ -45,6 +39,6 @@ public interface TaxDeclarationApiBillingService {
* @param queryParam
* @param map
*/
void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map<String, Object> map);
// void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map<String, Object> map);
}

View File

@ -0,0 +1,46 @@
package com.engine.salary.service.impl;
import com.engine.core.impl.Service;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
import com.engine.salary.service.EmployeeDeclareRecordService;
import java.time.YearMonth;
/**
* @description: 员工报送记录
* @author: xiajun
* @modified By: xiajun
* @date: 2022/11/6 16:55
* @version:v1.0
*/
public class EmployeeDeclareRecordServiceImpl extends Service implements EmployeeDeclareRecordService {
@Override
public EmployeeDeclareRecordPO getByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) {
// return new LambdaQueryChainWrapper<>(baseMapper)
// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey)
// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString())
// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId)
// .one();
return null;
}
@Override
public void deleteByTaxCycleAndTaxAgentId(YearMonth taxCycle, Long taxAgentId) {
// new LambdaUpdateChainWrapper<>(baseMapper)
// .eq(EmployeeDeclareRecordPO::getTenantKey, tenantKey)
// .eq(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
// .eq(EmployeeDeclareRecordPO::getTaxCycle, taxCycle.toString())
// .eq(EmployeeDeclareRecordPO::getTaxAgentId, taxAgentId)
// .set(EmployeeDeclareRecordPO::getDeleteType, DeleteTypeEnum.DELETED.getValue())
// .set(EmployeeDeclareRecordPO::getUpdateTime, LocalDateTime.now())
// .update();
}
@Override
public void save(EmployeeDeclareRecordPO employeeDeclareRecord) {
}
}

View File

@ -1,42 +1,57 @@
package com.engine.salary.service.impl;
import cn.hutool.core.map.MapUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.common.LocalDateRange;
import com.engine.salary.common.taxdeclare.AsyncRequestIdDTO;
import com.engine.salary.constant.SalaryDefaultTenantConstant;
import com.engine.salary.constant.SzyhApiConstant;
import com.engine.salary.entity.datacollection.DataCollectionEmployee;
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareList;
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRefresh;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareFailListDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareInfoDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareListDTO;
import com.engine.salary.entity.employeedeclare.dto.EmployeeDeclareRefreshDTO;
import com.engine.salary.entity.employeedeclare.bo.EmployeeDeclareRequest;
import com.engine.salary.entity.employeedeclare.dto.*;
import com.engine.salary.entity.employeedeclare.param.*;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclarePO;
import com.engine.salary.entity.employeedeclare.po.EmployeeDeclareRecordPO;
import com.engine.salary.entity.employeedeclare.response.DeclareEmployeeFeedbackResponse;
import com.engine.salary.entity.employeedeclare.response.DeclareEmployeeInfoResponse;
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveDataDTO;
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
import com.engine.salary.entity.taxagent.bo.TaxAgentTaxReturnBO;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
import com.engine.salary.enums.SalaryCycleTypeEnum;
import com.engine.salary.enums.employeedeclare.CardTypeEnum;
import com.engine.salary.enums.employeedeclare.DeclareStatusEnum;
import com.engine.salary.enums.employeedeclare.EmploymentStatusEnum;
import com.engine.salary.enums.salaryaccounting.EmployeeTypeEnum;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.taxagent.TaxAgentTaxReturnStatusEnum;
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
import com.engine.salary.exception.SalaryRunTimeException;
import com.engine.salary.mapper.employeedeclare.EmployeeDeclareMapper;
import com.engine.salary.service.EmployeeDeclareService;
import com.engine.salary.service.SalaryArchiveService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.service.*;
import com.engine.salary.util.*;
import com.engine.salary.util.db.MapperProxyFactory;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.util.page.SalaryPageUtil;
import com.engine.salary.util.valid.SalaryCardUtil;
import com.engine.salary.util.valid.ValidUtil;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import dm.jdbc.util.IdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import weaver.general.Util;
import weaver.hrm.User;
import java.time.YearMonth;
@ -70,6 +85,18 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
}
private TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) {
return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user);
}
private TaxAgentTaxReturnService getTaxAgentTaxReturnService(User user) {
return ServiceUtil.getService(TaxAgentTaxReturnServiceImpl.class, user);
}
private EmployeeDeclareRecordService getEmployeeDeclareRecordService(User user) {
return ServiceUtil.getService(EmployeeDeclareRecordServiceImpl.class, user);
}
@Override
public EmployeeDeclarePO getById(Long id) {
return getEmployeeDeclareMapper().getById(id);
@ -150,45 +177,45 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
return page;
}
// @Override
// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId) {
// LocalDateTime now = LocalDateTime.now();
// EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO()
// .setTaxAgentId(saveParam.getTaxAgentId())
// .setTaxCycle(saveParam.getTaxCycle().toString())
// .setEmployeeName(saveParam.getEmployeeName())
// .setJobNum(saveParam.getJobNum())
// .setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue())
// .setCardNum(saveParam.getCardNum())
// .setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue())
// .setBirthday(SalaryCardUtil.judgeBirthday(saveParam.getCardNum()))
// .setEmploymentStatus(saveParam.getEmploymentStatus().getValue())
// .setMobile(saveParam.getMobile())
// .setEmploymentType(saveParam.getEmploymentType().getValue())
// .setEmploymentFirstYear("")
// .setEmploymentDate(saveParam.getEmploymentDate())
// .setDismissDate(saveParam.getDismissDate())
// .setDisability(saveParam.getDisability().getValue())
// .setDisabilityCardNo(saveParam.getDisabilityCardNo())
// .setLonelyOld(saveParam.getLonelyOld().getValue())
// .setMartyrDependents(saveParam.getMartyrDependents().getValue())
// .setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo())
// .setDeductExpenses(saveParam.getDeductExpenses().getValue())
// .setSuccessfullyDeclared(0)
// .setNewEmployeeInfo(0)
// .setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue())
// .setDeclareErrorMsg("");
// if (Objects.isNull(saveParam.getId())) {
// employeeDeclare.setId(IdGenerator.generate())
// .setEmployeeId(saveParam.getEmployeeId())
// .setEmployeeType(saveParam.getEmployeeType().getValue())
// .setTenantKey(tenantKey)
// .setCreator(employeeId)
// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
// .setCreateTime(now)
// .setUpdateTime(now);
// save(employeeDeclare);
// // 记录日志
@Override
public void save(EmployeeDeclareSaveParam saveParam) {
Date now = new Date();
EmployeeDeclarePO employeeDeclare = new EmployeeDeclarePO()
.setTaxAgentId(saveParam.getTaxAgentId())
.setTaxCycle(saveParam.getTaxCycle().toString())
.setEmployeeName(saveParam.getEmployeeName())
.setJobNum(saveParam.getJobNum())
.setCardType(CardTypeEnum.RESIDENT_IDENTITY_CARDS.getValue())
.setCardNum(saveParam.getCardNum())
.setGender(SalaryCardUtil.judgeGender(saveParam.getCardNum()).getValue())
.setBirthday(SalaryDateUtil.localDateToDate(SalaryCardUtil.judgeBirthday(saveParam.getCardNum())))
.setEmploymentStatus(saveParam.getEmploymentStatus().getValue())
.setMobile(saveParam.getMobile())
.setEmploymentType(saveParam.getEmploymentType().getValue())
.setEmploymentFirstYear("")
.setEmploymentDate(SalaryDateUtil.localDateToDate(saveParam.getEmploymentDate()))
.setDismissDate(SalaryDateUtil.localDateToDate(saveParam.getDismissDate()))
.setDisability(saveParam.getDisability().getValue())
.setDisabilityCardNo(saveParam.getDisabilityCardNo())
.setLonelyOld(saveParam.getLonelyOld().getValue())
.setMartyrDependents(saveParam.getMartyrDependents().getValue())
.setMartyrDependentsCardNo(saveParam.getMartyrDependentsCardNo())
.setDeductExpenses(saveParam.getDeductExpenses().getValue())
.setSuccessfullyDeclared(0)
.setNewEmployeeInfo(0)
.setDeclareStatus(DeclareStatusEnum.NOT_DECLARE.getValue())
.setDeclareErrorMsg("");
if (Objects.isNull(saveParam.getId())) {
employeeDeclare.setId(IdGenerator.generate())
.setEmployeeId(saveParam.getEmployeeId())
.setEmployeeType(saveParam.getEmployeeType().getValue())
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.setCreator((long) user.getUID())
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.setCreateTime(now)
.setUpdateTime(now);
getEmployeeDeclareMapper().insertIgnoreNull(employeeDeclare);
// 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId()));
// loggerContext.setTargetName(employeeDeclare.getEmployeeName());
@ -197,27 +224,27 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156441, "新增报送人员:") + employeeDeclare.getEmployeeName());
// loggerContext.setNewValues(employeeDeclare);
// employeeDeclareLoggerTemplate.write(loggerContext);
// } else {
// EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId(), tenantKey);
// if (Objects.isNull(originEmployeeDeclare)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "人员不存在或已被删除"));
// }
// if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1)
// && !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName())
// && !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅"));
// }
// employeeDeclare.setId(originEmployeeDeclare.getId())
// .setEmployeeId(originEmployeeDeclare.getEmployeeId())
// .setEmployeeType(originEmployeeDeclare.getEmployeeType())
// .setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared())
// .setUpdateTime(now);
// // 判断本次编辑是否有修改人员信息
// if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) {
// employeeDeclare.setNewEmployeeInfo(1);
// }
// updateById(employeeDeclare);
// // 记录日志
} else {
EmployeeDeclarePO originEmployeeDeclare = getById(saveParam.getId());
if (Objects.isNull(originEmployeeDeclare)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156442, "人员不存在或已被删除"));
}
if (Objects.equals(originEmployeeDeclare.getSuccessfullyDeclared(), 1)
&& !Objects.equals(originEmployeeDeclare.getEmployeeName(), employeeDeclare.getEmployeeName())
&& !Objects.equals(originEmployeeDeclare.getCardNum(), employeeDeclare.getCardNum())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156443, "成功报送过的人员,姓名和证件号码只能修改其一,同时需要修改的请前往办税服务厅"));
}
employeeDeclare.setId(originEmployeeDeclare.getId())
.setEmployeeId(originEmployeeDeclare.getEmployeeId())
.setEmployeeType(originEmployeeDeclare.getEmployeeType())
.setSuccessfullyDeclared(originEmployeeDeclare.getSuccessfullyDeclared())
.setUpdateTime(now);
// 判断本次编辑是否有修改人员信息
if (!StringUtils.equals(employeeDeclare.toCompareString(), originEmployeeDeclare.toCompareString())) {
employeeDeclare.setNewEmployeeInfo(1);
}
getEmployeeDeclareMapper().updateIgnoreNull(employeeDeclare);
// 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(Util.null2String(saveParam.getTaxAgentId()));
// loggerContext.setTargetName(employeeDeclare.getEmployeeName());
@ -227,9 +254,9 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// loggerContext.setOldValues(originEmployeeDeclare);
// loggerContext.setNewValues(employeeDeclare);
// employeeDeclareLoggerTemplate.write(loggerContext);
// }
// }
//
}
}
// @Override
// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId) {
// // 查询报送人员
@ -446,12 +473,12 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// List<SimpleUserInfo> newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds, tenantKey);
// List<HrmEmployeeComInfo> newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds));
// 查询本月增加了哪些非系统人员
// List<ExtEmployeePO> extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId(), tenantKey);
// List<ExtEmpPO> extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId());
// Set<Long> extEmployeeIds = employeeDeclares.stream()
// .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue()))
// .map(EmployeeDeclarePO::getEmployeeId)
// .collect(Collectors.toSet());
// List<ExtEmployeePO> newExtEmployees = extEmployees.stream()
// List<ExtEmpPO> newExtEmployees = extEmployees.stream()
// .filter(e -> !extEmployeeIds.contains(e.getId()))
// .collect(Collectors.toList());
@ -462,8 +489,8 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
.setEmployeeDeclares(employeeDeclares)
.setPreTaxCycleEmployeeDeclare(preTaxCycleEmployeeDeclares)
.setSalaryArchives(salaryArchivePOS)
.setEmployeeInfos(employeeInfos);
// .setHrmEmployeeComInfos(newHrmEmployeeComInfos)
// .setEmployeeInfos(employeeInfos)
.setHrmEmployeeComInfos(employeeInfos);
// .setSimpleUserInfos(newSimpleUserInfos)
// .setExtEmployees(newExtEmployees)
EmployeeDeclareRefresh.Result result = EmployeeDeclareRefresh.refresh(dto, employeeId);
@ -478,11 +505,11 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
// // 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(refreshParam.getTaxAgentId() + "-" + refreshParam.getTaxCycle().toString());
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString()));
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", refreshParam.getTaxCycle().toString()));
// loggerContext.setOperator(Util.null2String(employeeId));
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156447, "刷新数据"));
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156447, "刷新数据"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156447, "刷新数据"));
// employeeDeclareLoggerTemplate.write(loggerContext);
}
@ -505,171 +532,168 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla
.setDeclareSuccessSize(declareSuccessSize);
}
// @Override
// @Transactional(rollbackFor = Exception.class)
// public void declare(EmployeeDeclareParam param, Long employeeId) {
// // 获取api配置信息
// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true);
// // 查询个税扣缴义务人
// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey);
// // 查询个税扣缴义务人关联的企业信息
// TaxAgentTaxReturnPO taxAgentTaxReturn = taxAgentTaxReturnService.getByTaxAgentId(param.getTaxAgentId(), tenantKey);
// if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息"));
// }
// // 查询需要报送的人员
// List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
// if (CollectionUtils.isEmpty(employeeDeclares)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156470, "当前报送人员列表暂无数据"));
// }
// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
// if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156471, "报送中,稍后请点击【获取报送结果】更新报送状态"));
// }
// // 人员列表
// List<Map<String, Object>> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares);
// // 企业信息
// Map<String, Object> requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn);
// // 税款所属期
// requestParam.put("skssq", param.getTaxCycle().toString().replace("-", ""));
// // 人员列表
// requestParam.put("rylb", employeeInfoMapList);
//
// String reqJson = JsonUtil.toJsonString(requestParam);
// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO;
// 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);
// DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class);
// if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) {
// log.error("服务异常:" + res);
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156449, "服务异常"));
// }
// if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
// throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg());
// }
// // 删除原来的人员报送记录
// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
// // 保存新的人员报送记录
// LocalDateTime now = LocalDateTime.now();
// AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody();
// employeeDeclareRecord = new EmployeeDeclareRecordPO()
// .setId(IdGenerator.generate())
// .setTaxAgentId(param.getTaxAgentId())
// .setTaxCycle(param.getTaxCycle().toString())
// .setRequestId(asyncRequestIdDTO.getRequestId())
// .setTenantKey(tenantKey)
// .setCreator(employeeId)
// .setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
// .setCreateTime(now)
// .setUpdateTime(now);
// employeeDeclareRecordService.save(employeeDeclareRecord);
// // 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString());
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString()));
// loggerContext.setOperator(Util.null2String(employeeId));
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送"));
// employeeDeclareLoggerTemplate.write(loggerContext);
// }
//
// @Override
// @Transactional(rollbackFor = Exception.class)
// public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate, Long employeeId) {
// // 获取api配置信息
// TaxDeclarationApiConfigPO apiConfig = taxDeclarationApiConfigService.getConfig(tenantKey, employeeId, true);
// // 查询个税扣缴义务人
// TaxAgentPO taxAgent = taxAgentService.getById(param.getTaxAgentId(), employeeId, tenantKey);
// // 查询人员报送记录
// EmployeeDeclareRecordPO employeeDeclareRecord = employeeDeclareRecordService.getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
// if (Objects.isNull(employeeDeclareRecord)) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果"));
// }
// if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156451, "请先报送后再获取报送结果"));
// }
//
// String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK;
// Map<String, String> requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId());
// Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
// String res = HttpUtil.getRequest(url, header, requestParam);
// DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class);
// if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) {
// log.error("服务异常:" + res);
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156449, "服务异常"));
// }
// if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
// throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg());
// }
// DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody();
// Map<String, Map<String, Object>> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "")
// + "-" + e.getOrDefault("zzlx", "")
// + "-" + e.getOrDefault("zzhm", ""));
// // 流量使用情况
// TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper =
// new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper(tenantKey
// , employeeId, param.getTaxCycle().atDay(1)
// , apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION);
// // 查询申报的人员列表
// LocalDateTime now = LocalDateTime.now();
// List<EmployeeDeclarePO> needUpdateEmployeeDeclares = Lists.newArrayList();
// List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
// for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
// CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
// String key = employeeDeclare.getEmployeeName()
// + "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel())
// + "-" + employeeDeclare.getCardNum();
// Map<String, Object> employeeInfoMap = employeeFeedbackMap.get(key);
// if (MapUtil.isEmpty(employeeInfoMap)) {
// continue;
// }
// // 报送状态
// employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue()));
// // 失败原因
// employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy")));
// // 验证状态银行卡验证状态
// // 是否报送成功了
// if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) {
// employeeDeclare.setSuccessfullyDeclared(1);
// }
// employeeDeclare.setUpdateTime(now);
// needUpdateEmployeeDeclares.add(employeeDeclare);
//
// // 流量使用记录
// TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId());
// flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue());
// apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO);
// }
// // 更新员工的报送状态
// if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) {
// updateBatchById(needUpdateEmployeeDeclares);
// }
// // 删除原来的人员报送记录
// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey);
// // 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString());
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString()));
// loggerContext.setOperator(Util.null2String(employeeId));
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈"));
// employeeDeclareLoggerTemplate.write(loggerContext);
// // 更新流量统计
// taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper);
// // 报送失败的
// int declareFailSize = (int) needUpdateEmployeeDeclares.stream()
// .filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue()))
// .count();
// employeeDeclareRate.setFinish(true);
// if (declareFailSize > 0) {
// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156472, "报送成功{0}条,报送失败{1}条")
// .replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize))
// .replace("{1}", Util.null2String(declareFailSize)));
// } else {
// employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size())));
// }
// }
@Override
public void declare(EmployeeDeclareParam param) {
// 获取api配置信息
TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
// 查询个税扣缴义务人
TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId());
// 查询个税扣缴义务人关联的企业信息
TaxAgentTaxReturnPO taxAgentTaxReturn = getTaxAgentTaxReturnService(user).getByTaxAgentId(param.getTaxAgentId());
if (Objects.isNull(taxAgentTaxReturn) || !Objects.equals(taxAgentTaxReturn.getCheckStatus(), TaxAgentTaxReturnStatusEnum.SUCCESS.getValue())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156469, "个税扣缴义务人的报税信息验证未通过,请先维护好个税扣缴义务人的报税信息"));
}
// 查询需要报送的人员
List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
if (CollectionUtils.isEmpty(employeeDeclares)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156470, "当前报送人员列表暂无数据"));
}
EmployeeDeclareRecordPO employeeDeclareRecord = getEmployeeDeclareRecordService(user).getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
if (employeeDeclareRecord != null && StringUtils.isNotEmpty(employeeDeclareRecord.getRequestId())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156471, "报送中,稍后请点击【获取报送结果】更新报送状态"));
}
// 人员列表
List<Map<String, Object>> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares);
// 企业信息
Map<String, Object> requestParam = TaxAgentTaxReturnBO.convert2RequestMap(taxAgent, taxAgentTaxReturn);
// 税款所属期
requestParam.put("skssq", param.getTaxCycle().toString().replace("-", ""));
// 人员列表
requestParam.put("rylb", employeeInfoMapList);
String reqJson = JsonUtil.toJsonString(requestParam);
String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO;
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);
DeclareEmployeeInfoResponse declareEmployeeInfoResponse = JsonUtil.parseObject(res, DeclareEmployeeInfoResponse.class);
if (Objects.isNull(declareEmployeeInfoResponse) || Objects.isNull(declareEmployeeInfoResponse.getHead())) {
log.error("服务异常:" + res);
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
}
if (!Objects.equals(declareEmployeeInfoResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
throw new SalaryRunTimeException(declareEmployeeInfoResponse.getHead().getMsg());
}
// 删除原来的人员报送记录
getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
// 保存新的人员报送记录
Date now =new Date();
AsyncRequestIdDTO asyncRequestIdDTO = declareEmployeeInfoResponse.getBody();
employeeDeclareRecord = new EmployeeDeclareRecordPO()
.setId(IdGenerator.generate())
.setTaxAgentId(param.getTaxAgentId())
.setTaxCycle(param.getTaxCycle().toString())
.setRequestId(asyncRequestIdDTO.getRequestId())
.setTenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
.setCreator((long)user.getUID())
.setDeleteType(DeleteTypeEnum.NOT_DELETED.getValue())
.setCreateTime(now)
.setUpdateTime(now);
getEmployeeDeclareRecordService(user).save(employeeDeclareRecord);
// 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString());
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString()));
// loggerContext.setOperator(Util.null2String(employeeId));
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156450, "全部报送"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156450, "全部报送"));
// employeeDeclareLoggerTemplate.write(loggerContext);
}
@Override
public void getDeclareFeedback(EmployeeDeclareParam param, EmployeeDeclareRateDTO employeeDeclareRate) {
// 获取api配置信息
TaxDeclarationApiConfigPO apiConfig = getTaxDeclarationApiConfigService(user).getConfig(true);
// 查询个税扣缴义务人
TaxAgentPO taxAgent = getTaxAgentService(user).getById(param.getTaxAgentId());
// 查询人员报送记录
EmployeeDeclareRecordPO employeeDeclareRecord = getEmployeeDeclareRecordService(user).getByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
if (Objects.isNull(employeeDeclareRecord)) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156451, "请先报送后再获取报送结果"));
}
if (StringUtils.isEmpty(employeeDeclareRecord.getRequestId())) {
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156451, "请先报送后再获取报送结果"));
}
String url = apiConfig.getHost() + SzyhApiConstant.DECLARE_EMPLOYEE_INFO_FEEDBACK;
ImmutableMap<String, String> requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId());
Map<String, String> header = SingnatureData.initHeader(Collections.emptyMap(), apiConfig.getAppKey(), apiConfig.getAppSecret());
String res = HttpUtil.getRequest(url, header, requestParam);
DeclareEmployeeFeedbackResponse declareEmployeeFeedbackResponse = JsonUtil.parseObject(res, DeclareEmployeeFeedbackResponse.class);
if (Objects.isNull(declareEmployeeFeedbackResponse) || Objects.isNull(declareEmployeeFeedbackResponse.getHead())) {
log.error("服务异常:" + res);
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156449, "服务异常"));
}
if (!Objects.equals(declareEmployeeFeedbackResponse.getHead().getCode(), SzyhApiConstant.SUCCESS_CODE)) {
throw new SalaryRunTimeException(declareEmployeeFeedbackResponse.getHead().getMsg());
}
DeclareEmployeeFeedbackResponse.DeclareEmployeeFeedbackResponseBody declareEmployeeFeedbackResponseBody = declareEmployeeFeedbackResponse.getBody();
Map<String, Map<String, Object>> employeeFeedbackMap = SalaryEntityUtil.convert2Map(declareEmployeeFeedbackResponseBody.getBsjg(), e -> e.getOrDefault("xm", "")
+ "-" + e.getOrDefault("zzlx", "")
+ "-" + e.getOrDefault("zzhm", ""));
// 流量使用情况
TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper apiFlowUpdateWrapper = new TaxDeclarationApiBillingServiceImpl.ApiFlowUpdateWrapper( SalaryDateUtil.localDateToDate(param.getTaxCycle().atDay(1)), apiConfig, EnumDeclareApiBusinessType.EMPLOYEE_DECLARATION);
// 查询申报的人员列表
Date now = new Date();
List<EmployeeDeclarePO> needUpdateEmployeeDeclares = Lists.newArrayList();
List<EmployeeDeclarePO> employeeDeclares = listByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
for (EmployeeDeclarePO employeeDeclare : employeeDeclares) {
CardTypeEnum cardTypeEnum = SalaryEnumUtil.enumMatchByValue(employeeDeclare.getCardType(), CardTypeEnum.class);
String key = employeeDeclare.getEmployeeName()
+ "-" + (cardTypeEnum == null ? CardTypeEnum.RESIDENT_IDENTITY_CARDS.getDefaultLabel() : cardTypeEnum.getDefaultLabel())
+ "-" + employeeDeclare.getCardNum();
Map<String, Object> employeeInfoMap = employeeFeedbackMap.get(key);
if (MapUtil.isEmpty(employeeInfoMap)) {
continue;
}
// 报送状态
employeeDeclare.setDeclareStatus(SalaryEntityUtil.getIntValue(employeeInfoMap.get("sbzt"), DeclareStatusEnum.NOT_DECLARE.getValue()));
// 失败原因
employeeDeclare.setDeclareErrorMsg(SalaryEntityUtil.null2String(employeeInfoMap.get("sbyy")));
// 验证状态银行卡验证状态
// 是否报送成功了
if (Objects.equals(employeeDeclare.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) {
employeeDeclare.setSuccessfullyDeclared(1);
}
employeeDeclare.setUpdateTime(now);
needUpdateEmployeeDeclares.add(employeeDeclare);
// 流量使用记录
TaxDeclarationApiFlowRecordPO flowDetailPO = TaxApiFlowBO.buildTaxDeclarationApiFlowRecordPO(apiFlowUpdateWrapper, param.getTaxAgentId(), employeeDeclare.getEmployeeId());
flowDetailPO.setResultStatus(DeclareStatusEnum.DECLARE_SUCCESS.getValue().equals(employeeDeclare.getDeclareStatus()) ? TaxAgentTaxReturnStatusEnum.SUCCESS.getValue() : TaxAgentTaxReturnStatusEnum.FAIL.getValue());
apiFlowUpdateWrapper.getApiFlowDetailPOList().add(flowDetailPO);
}
// 更新员工的报送状态
if (CollectionUtils.isNotEmpty(needUpdateEmployeeDeclares)) {
//todo
// updateBatchById(needUpdateEmployeeDeclares);
}
// 删除原来的人员报送记录
getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId());
// 记录日志
// LoggerContext<EmployeeDeclarePO> loggerContext = new LoggerContext<>();
// loggerContext.setTargetId(param.getTaxAgentId() + "-" + param.getTaxCycle().toString());
// loggerContext.setTargetName(SalaryI18nUtil.getI18nLabel(156468, "个税扣缴义务人:「{0}」税款所属期:「{1}」").replace("{0}", taxAgent.getName()).replace("{1}", param.getTaxCycle().toString()));
// loggerContext.setOperator(Util.null2String(employeeId));
// loggerContext.setOperateType(OperateTypeEnum.UPDATE.getValue());
// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈"));
// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(156452, "获取结果反馈"));
// employeeDeclareLoggerTemplate.write(loggerContext);
// 更新流量统计
//todo
// taxDeclarationApiBillingService.updateApiFlowInfo(apiFlowUpdateWrapper);
// 报送失败的
int declareFailSize = (int) needUpdateEmployeeDeclares.stream()
.filter(e -> Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_FAIL.getValue()))
.count();
employeeDeclareRate.setFinish(true);
if (declareFailSize > 0) {
employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(156472, "报送成功{0}条,报送失败{1}条")
.replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size() - declareFailSize))
.replace("{1}", Util.null2String(declareFailSize)));
} else {
employeeDeclareRate.setMsg(SalaryI18nUtil.getI18nLabel(187388, "报送成功{0}条").replace("{0}", Util.null2String(needUpdateEmployeeDeclares.size())));
}
}
}

View File

@ -1,47 +1,43 @@
package com.engine.salary.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
import com.engine.salary.entity.taxapiflow.bo.TaxApiFlowBO;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.extemp.po.ExtEmpPO;
import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowRecordPO;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
import com.engine.salary.enums.sicategory.DeleteTypeEnum;
import com.engine.salary.enums.taxdeclaration.EnumDeclareApiBusinessType;
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowRecordMapper;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.TaxDeclarationApiBillingService;
import com.engine.salary.service.TaxDeclarationApiFlowWarnService;
import com.engine.salary.util.SalaryEntityUtil;
import com.engine.salary.util.SalaryI18nUtil;
import com.engine.salary.util.page.PageInfo;
import com.google.common.collect.Lists;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import weaver.hrm.User;
import java.time.LocalDate;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author chengliming
* @date 2022-11-11 2:57 PM
**/
@Slf4j
public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBillingService {
public class TaxDeclarationApiBillingServiceImpl extends Service implements TaxDeclarationApiBillingService {
private TaxDeclarationApiFlowRecordMapper taxDeclarationApiFlowRecordMapper;
private TaxAgentService taxAgentService;
private SalaryEmployeeService salaryEmployeeService;
public TaxAgentService getTaxAgentService(User user) {
return ServiceUtil.getService(TaxAgentServiceImpl.class, user);
}
public SalaryEmployeeService getSalaryEmployeeService(User user) {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
// private SalaryBatchService salaryBatchService;
private TaxDeclarationApiFlowWarnService taxDeclarationApiFlowWarnService;
@ -65,112 +61,106 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil
}
}
@Override
public PageInfo<TaxDeclarationApiFlowRecordListDTO> pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) {
LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam);
Page<TaxDeclarationApiFlowRecordPO> flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true));
List<TaxDeclarationApiFlowRecordPO> records = flowRecordPOPage.getRecords();
if (records.isEmpty()) {
return new PageInfo<>();
}
TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records);
// 转换数据
AtomicInteger indexNum = new AtomicInteger(1);
List<TaxDeclarationApiFlowRecordListDTO> listDTOS = records.stream().map(e ->
TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)
).collect(Collectors.toList());
return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS);
}
// @Override
// public PageInfo<TaxDeclarationApiFlowRecordListDTO> pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) {
// LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam);
// Page<TaxDeclarationApiFlowRecordPO> flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true));
// List<TaxDeclarationApiFlowRecordPO> records = flowRecordPOPage.getRecords();
// if (records.isEmpty()) {
// return new PageInfo<>();
// }
// TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records);
// // 转换数据
// AtomicInteger indexNum = new AtomicInteger(1);
// List<TaxDeclarationApiFlowRecordListDTO> listDTOS = records.stream().map(e ->
// TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)
// ).collect(Collectors.toList());
// return new SalaryPage<>(queryParam.getCurrent(), queryParam.getPageSize(), flowRecordPOPage.getTotal(), listDTOS);
// }
//
// @Override
// public List<TaxDeclarationApiFlowRecordListDTO> listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) {
// LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam);
// List<TaxDeclarationApiFlowRecordPO> list = queryChainWrapper.list();
// if (list.isEmpty()) {
// return new ArrayList<>();
// }
// TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list);
// // 转换数据
// AtomicInteger indexNum = new AtomicInteger(1);
// return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList());
// }
//
// private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List<TaxDeclarationApiFlowRecordPO> list, String currentTenantKey) {
// Map<Long, Long> employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId);
// // 获取人员信息
// List<HrmEmployeeComInfo> employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet()));
// Map<Long, String> empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername);
// Map<Long, String> empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet());
// List<ExtEmployeePO> extEmployeePOS = extEmployeeService.listAll(currentTenantKey);
// Map<Long, ExtEmployeePO> extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId);
// // 获取个税扣缴义务人信息
// List<TaxAgentPO> taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values()));
// Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName);
// return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap);
// }
//
// private LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) {
// LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper)
// .eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
// .eq(TaxDeclarationApiFlowRecordPO::getTenantKey)
// .eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId())
// .eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType())
// .eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult());
// if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) {
// chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate())
// .le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate());
// }
// return chainWrapper;
// }
@Override
public List<TaxDeclarationApiFlowRecordListDTO> listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) {
LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam);
List<TaxDeclarationApiFlowRecordPO> list = queryChainWrapper.list();
if (list.isEmpty()) {
return new ArrayList<>();
}
TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(list);
// 转换数据
AtomicInteger indexNum = new AtomicInteger(1);
return list.stream().map(e -> TaxApiFlowBO.taxDeclarationApiFlowRecordPo2ListDTO(propertiesWrapper, indexNum, e)).collect(Collectors.toList());
}
private TempPropertiesWrapper getUserInfoAndTaxAgentMap(List<TaxDeclarationApiFlowRecordPO> list, String currentTenantKey) {
Map<Long, Long> employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId);
// 获取人员信息
List<HrmEmployeeComInfo> employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet()));
Map<Long, String> empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername);
Map<Long, String> empIdNoMap = salaryEmployeeService.mapByEmployeeIds(employeeTaxAgentMap.keySet());
List<ExtEmployeePO> extEmployeePOS = extEmployeeService.listAll(currentTenantKey);
Map<Long, ExtEmployeePO> extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId);
// 获取个税扣缴义务人信息
List<TaxAgentPO> taxAgentPOS = taxAgentService.listByIds(new HashSet<>(employeeTaxAgentMap.values()));
Map<Long, String> taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName);
return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap);
}
private LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) {
LambdaQueryChainWrapper<TaxDeclarationApiFlowRecordPO> chainWrapper = new LambdaQueryChainWrapper<>(taxDeclarationApiFlowRecordMapper)
.eq(TaxDeclarationApiFlowRecordPO::getDeleteType, DeleteTypeEnum.NOT_DELETED.getValue())
.eq(TaxDeclarationApiFlowRecordPO::getTenantKey)
.eq(queryParam.getTaxAgentId() != null, TaxDeclarationApiFlowRecordPO::getTaxAgentId, queryParam.getTaxAgentId())
.eq(queryParam.getBusinessType() != null, TaxDeclarationApiFlowRecordPO::getBusinessType, queryParam.getBusinessType())
.eq(queryParam.getResult() != null, TaxDeclarationApiFlowRecordPO::getResultStatus, queryParam.getResult());
if (queryParam.getStartDate() != null && queryParam.getEndDate() != null) {
chainWrapper = chainWrapper.ge(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getStartDate())
.le(TaxDeclarationApiFlowRecordPO::getUseTime, queryParam.getEndDate());
}
return chainWrapper;
}
@Override
public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map<String, Object> map) {
ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey);
// 表头
List<String> headers = exportWrapper.getHeaders();
headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间"));
headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"));
headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员"));
headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号"));
headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务"));
headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人"));
headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果"));
exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{})));
// 获取数据
List<TaxDeclarationApiFlowRecordListDTO> dtoList = listFlowRecord(queryParam, employeeId, tenantKey);
// 组装数据
for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) {
List<Object> row = new ArrayList<>();
row.add(dto.getCreateTime());
row.add(dto.getTaxAgentName());
row.add(dto.getEmployeeName());
row.add(dto.getIdCardNo());
row.add(dto.getBusinessTypeName());
row.add(dto.getCreator());
row.add(dto.getResult());
exportWrapper.getRows().add(row);
}
// 生成表格
buildExcelData(exportWrapper);
}
/**
* 构建excel数据
*
* @param wrapper
*/
private void buildExcelData(ExportWrapper wrapper) {
wrapper.getExcelSheetData().setRows(wrapper.getRows());
wrapper.getSheetList().add(wrapper.getExcelSheetData());
salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList());
}
@BatchExportHandler("exportFlowRecord")
public void exportFlowRecordHandler() {
BatchCallbackMessage message = BatchExportContext.getBatchCallbackMessage();
log.info("接收到流量使用记录导出的结果:{}", JSONObject.toJSONString(message));
}
// @Override
// public void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map<String, Object> map) {
// ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey);
// // 表头
// List<String> headers = exportWrapper.getHeaders();
// headers.add(SalaryI18nUtil.getI18nLabel( 159083, "时间"));
// headers.add(SalaryI18nUtil.getI18nLabel( 86184, "个税扣缴义务人"));
// headers.add(SalaryI18nUtil.getI18nLabel( 100133, "人员"));
// headers.add(SalaryI18nUtil.getI18nLabel( 106277, "身份证号"));
// headers.add(SalaryI18nUtil.getI18nLabel( 159085, "接口服务"));
// headers.add(SalaryI18nUtil.getI18nLabel( 85435, "操作人"));
// headers.add(SalaryI18nUtil.getI18nLabel( 159086, "结果"));
// exportWrapper.getExcelSheetData().setHeaders(Collections.singletonList(headers.toArray(new String[]{})));
// // 获取数据
// List<TaxDeclarationApiFlowRecordListDTO> dtoList = listFlowRecord(queryParam, employeeId, tenantKey);
// // 组装数据
// for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) {
// List<Object> row = new ArrayList<>();
// row.add(dto.getCreateTime());
// row.add(dto.getTaxAgentName());
// row.add(dto.getEmployeeName());
// row.add(dto.getIdCardNo());
// row.add(dto.getBusinessTypeName());
// row.add(dto.getCreator());
// row.add(dto.getResult());
// exportWrapper.getRows().add(row);
// }
// // 生成表格
// buildExcelData(exportWrapper);
// }
// /**
// * 构建excel数据
// *
// * @param wrapper
// */
// private void buildExcelData(ExportWrapper wrapper) {
// wrapper.getExcelSheetData().setRows(wrapper.getRows());
// wrapper.getSheetList().add(wrapper.getExcelSheetData());
// salaryBatchService.simpleExportExcel(wrapper.buildExportExcelInfo(), wrapper.getSheetList());
// }
//
/**
* 封装一些临时的集合类便于方法复用
*/
@ -185,7 +175,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil
// 获取个税扣缴义务人信息
private Map<Long, String> taxAgentNameMap;
// 获取非系统人员
private Map<Long, ExtEmployeePO> extEmployeeMap;
private Map<Long, ExtEmpPO> extEmployeeMap;
}
@Data
@ -193,7 +183,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil
private String tenantKey;
private Long currentEmployeeId;
// 税款所属期
private LocalDate taxYearMonth;
private Date taxYearMonth;
// api流量使用情况
private List<TaxDeclarationApiFlowRecordPO> apiFlowDetailPOList;
// 当前租户的api接口配置
@ -201,7 +191,7 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil
// 接口类型
private EnumDeclareApiBusinessType businessType;
public ApiFlowUpdateWrapper(String tenantKey, Long currentEmployeeId, LocalDate taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) {
public ApiFlowUpdateWrapper( Date taxYearMonth, TaxDeclarationApiConfigPO apiConfig, EnumDeclareApiBusinessType businessType) {
this.tenantKey = tenantKey;
this.currentEmployeeId = currentEmployeeId;
this.taxYearMonth = taxYearMonth;

View File

@ -15,15 +15,11 @@ import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiProfileMapper;
import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper;
import com.engine.salary.service.TaxDeclarationApiConfigService;
import com.engine.salary.util.*;
import com.engine.salary.util.db.MapperProxyFactory;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.*;
/**
* @author chengliming
@ -32,13 +28,16 @@ import java.util.Optional;
@Slf4j
public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDeclarationApiConfigService {
private TaxDeclareApiConfigMapper taxDeclareApiConfigMapper;
private TaxDeclarationApiProfileMapper taxDeclarationApiProfileMapper;
private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() {
return MapperProxyFactory.getProxy(TaxDeclareApiConfigMapper.class);
}
private TaxDeclarationApiProfileMapper getTaxDeclarationApiProfileMapper() {
return MapperProxyFactory.getProxy(TaxDeclarationApiProfileMapper.class);
}
@Override
public TaxDeclarationApiConfigPO getConfig(boolean needValid) {
TaxDeclarationApiConfigPO configPO = taxDeclareApiConfigMapper.getOne();
TaxDeclarationApiConfigPO configPO = getTaxDeclareApiConfigMapper().getOne();
if (needValid) {
String tips1 = SalaryI18nUtil.getI18nLabel(183786, "当前用户智能算薪尚未配置,请先前往[设置] -> [智能算薪]中配置");
String tips2 = SalaryI18nUtil.getI18nLabel(183787, "当前用户智能算薪尚未启用,请先前往[设置] -> [智能算薪]中启用该配置");
@ -57,21 +56,21 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe
@Override
public void insert(TaxDeclarationApiConfigPO configPO) {
taxDeclareApiConfigMapper.insertIgnoreNull(configPO);
getTaxDeclareApiConfigMapper().insertIgnoreNull(configPO);
}
@Override
public void update(TaxDeclarationApiConfigPO config) {
taxDeclareApiConfigMapper.updateIgnoreNull(config);
getTaxDeclareApiConfigMapper().updateIgnoreNull(config);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) {
TaxDeclarationApiConfigPO config = this.getConfig(false);
Date now = new Date();
if (config != null) {
config.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue())
.setUpdateTime(LocalDateTime.now());
.setUpdateTime(now);
update(config);
} else {
config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID());
@ -81,14 +80,13 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) {
TaxDeclarationApiConfigPO config = this.getConfig(false);
if (config != null) {
config.setAppKey(saveParam.getAppKey())
.setAppSecret(saveParam.getAppSecret())
.setEnableUse(SalaryOnOffEnum.valueOf(saveParam.getEnable()).getValue())
.setUpdateTime(LocalDateTime.now());
.setUpdateTime(new Date());
update(config);
} else {
config = TaxApiFlowBO.buildTaxDeclarationApiConfigPO(saveParam, (long) user.getUID());
@ -109,7 +107,7 @@ public class TaxDeclarationApiConfigServiceImpl extends Service implements TaxDe
}
private String getApiHost() {
List<TaxDeclarationApiProfilePO> apiProfiles = taxDeclarationApiProfileMapper.listAll();
List<TaxDeclarationApiProfilePO> apiProfiles = getTaxDeclarationApiProfileMapper().listAll();
if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) {
return SzyhApiConstant.HOST_URL;
}

View File

@ -2,30 +2,30 @@
//
//import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
//import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
//import com.engine.salary.entity.taxagent.po.TaxAgentEmployeePO;
//import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO;
//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnConfigPO;
//import com.engine.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO;
//import com.engine.salary.mapper.taxdeclaration.TaxDeclarationApiFlowWarnConfigMapper;
//import com.engine.salary.service.SalaryEmployeeService;
//import com.engine.salary.service.TaxDeclarationApiFlowWarnService;
//import com.engine.salary.util.SalaryEntityUtil;
//import com.weaver.common.base.entity.result.WeaResult;
//import com.weaver.common.distribution.genid.IdGenerator;
//import com.weaver.framework.spring.annotation.AopClass;
//import com.weaver.hrm.salary.common.OptionDTO;
//import com.weaver.hrm.salary.dao.TaxDeclarationApiFlowWarnReceiverMapper;
//import com.weaver.hrm.salary.entity.taxagent.po.TaxAgentEmployeePO;
//import com.weaver.hrm.salary.entity.taxapiflow.bo.TaxApiFlowBO;
//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverFormDTO;
//import com.weaver.hrm.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowWarnReceiverListDTO;
//import com.weaver.hrm.salary.entity.taxapiflow.param.CreateMessageRuleParam;
//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnConfigSaveParam;
//import com.weaver.hrm.salary.entity.taxapiflow.param.TaxDeclarationApiFlowWarnReceiverSaveParam;
//import com.weaver.hrm.salary.entity.taxapiflow.po.TaxDeclarationApiFlowWarnReceiverPO;
//import com.weaver.hrm.salary.entity.taxapiflow.response.QueryAccountBalanceResponse;
//import com.weaver.hrm.salary.enums.salaryitem.SalaryOnOffEnum;
//import com.weaver.hrm.salary.enums.sicategory.DeleteTypeEnum;
//import com.weaver.hrm.salary.service.TaxAgentService;
//import com.weaver.hrm.salary.service.TaxDeclarationApiFlowStatisticService;
//import com.weaver.hrm.salary.util.SalaryAssert;
//import com.weaver.hrm.salary.util.SalaryEntityUtil;
//import com.weaver.hrm.salary.util.SalaryI18nUtil;
//import com.weaver.mc.api.async.AsyncSystemMessageRest;
//import com.weaver.mc.api.entity.*;

View File

@ -358,4 +358,51 @@ public class SalaryEntityUtil {
}
public static String null2String(Object obj) {
if (Objects.isNull(obj)) {
return "";
}
return obj.toString();
}
public static String null2String(Object obj, String def) {
if (Objects.isNull(obj)) {
return def;
}
return obj.toString();
}
public static Integer getIntValue(Object obj, Integer def) {
if (Objects.isNull(obj)) {
return def;
}
try {
return StringUtils.isEmpty(String.valueOf(obj)) ? def : Integer.valueOf(String.valueOf(obj));
} catch (NumberFormatException e) {
return def;
}
}
public static BigDecimal getBigDecimal(Object value, int scale) {
String valueStr = null2String(value);
if (StringUtils.isEmpty(valueStr)) {
return BigDecimal.ZERO;
}
try {
return new BigDecimal(valueStr).setScale(scale, RoundingMode.HALF_UP);
} catch (NumberFormatException e) {
return null;
}
}
public static BigDecimal getBigDecimal(Object value, int scale, BigDecimal defValue) {
try {
return new BigDecimal(null2String(value)).setScale(scale, RoundingMode.HALF_UP);
} catch (NumberFormatException e) {
return defValue;
}
}
}

View File

@ -10,7 +10,6 @@ import com.engine.salary.util.ResponseResult;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.wrapper.EmployeeDeclareWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
import oracle.jdbc.proxy.annotation.Post;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
@ -35,8 +34,6 @@ public class EmployeeDeclareController {
return ServiceUtil.getService(EmployeeDeclareWrapper.class, user);
}
// private SalaryBatchService salaryBatchService;
/**
* 人员报送-个税扣缴义务人列表
*
@ -71,7 +68,7 @@ public class EmployeeDeclareController {
* @param queryParam 查询条件
* @return
*/
@Post
@POST
@Path("/list4Add")
@Produces(MediaType.APPLICATION_JSON)
public String list4Add(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareAddListQueryParam queryParam) {
@ -85,7 +82,7 @@ public class EmployeeDeclareController {
* @param queryParam 查询条件
* @return
*/
@Post
@POST
@Path("/list4Update")
@Produces(MediaType.APPLICATION_JSON)
public String list4Update(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareListQueryParam queryParam) {
@ -123,7 +120,7 @@ public class EmployeeDeclareController {
// @GetMapping("/getBatchUpdateForm")
// @ApiOperation("人员报送-获取批量编辑的表单")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<WeaForm> getBatchUpdateForm() {
// WeaForm weaForm = employeeDeclareWrapper.getBatchUpdateForm();
// return WeaResult.success(weaForm);
@ -131,35 +128,35 @@ public class EmployeeDeclareController {
//
// @GetMapping("/getSearchCondition")
// @ApiOperation("人员报送-获取高级搜索条件")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<WeaSearchCondition> getSearchCondition() {
// WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition();
// return WeaResult.success(searchCondition);
// }
//
// /**
// * 人员报送-新增人员/编辑人员保存
// *
// * @param saveParam 保存参数
// * @return
// */
// @PostMapping("/save")
// @ApiOperation("人员报送-新增人员/编辑人员保存")
// @WeaPermission
// public WeaResult<Object> save(@RequestBody @Validated EmployeeDeclareSaveParam saveParam) {
// employeeDeclareWrapper.save(saveParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
// }
//
/**
* 人员报送-新增人员/编辑人员保存
*
* @param saveParam 保存参数
* @return
*/
@POST
@Path("/save")
@Produces(MediaType.APPLICATION_JSON)
public String save(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareSaveParam saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<EmployeeDeclareSaveParam, PageInfo<EmployeeDeclareFailListDTO>>(user).run(getEmployeeDeclareWrapper(user)::save, saveParam);
}
// /**
// * 人员报送-批量编辑
// *
// * @param batchUpdateParam 批量编辑参数
// * @return
// */
// @PostMapping("/batchUpdate")
// @Path("/batchUpdate")
// @ApiOperation("人员报送-批量编辑")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> batchUpdate(@RequestBody @Validated EmployeeDeclareBatchUpdateParam batchUpdateParam) {
// employeeDeclareWrapper.batchUpdate(batchUpdateParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(null);
@ -185,7 +182,7 @@ public class EmployeeDeclareController {
* @param refreshParam 刷新数据的参数
* @return
*/
@Post
@POST
@Path("/refresh")
@Produces(MediaType.APPLICATION_JSON)
public String refresh(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareRefreshParam refreshParam) {
@ -207,34 +204,34 @@ public class EmployeeDeclareController {
return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam);
}
// /**
// * 人员报送-全部报送
// *
// * @param employeeDeclareParam 在线报送
// * @return
// */
// @PostMapping("/declare")
// @ApiOperation("人员报送-全部报送")
// @WeaPermission
// public WeaResult<Object> declare(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) {
// String rateIndex = employeeDeclareWrapper.declare(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(rateIndex);
// }
//
// /**
// * 人员报送-获取报送结果反馈
// *
// * @param employeeDeclareParam 获取反馈
// * @return
// */
// @PostMapping("/getDeclareFeedback")
// @ApiOperation("人员报送-获取报送结果反馈")
// @WeaPermission
// public WeaResult<Object> getDeclareFeedback(@RequestBody @Validated EmployeeDeclareParam employeeDeclareParam) {
// String rateIndex = employeeDeclareWrapper.getDeclareFeedback(employeeDeclareParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey());
// return WeaResult.success(rateIndex);
// }
//
/**
* 人员报送-全部报送
*
* @param employeeDeclareParam 在线报送
* @return
*/
@POST
@Path("/declare")
@Produces(MediaType.APPLICATION_JSON)
public String declare(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody EmployeeDeclareParam employeeDeclareParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::declare, employeeDeclareParam);
}
/**
* 人员报送-获取报送结果反馈
*
* @param employeeDeclareParam 获取反馈
* @return
*/
@POST
@Path("/getDeclareFeedback")
@Produces(MediaType.APPLICATION_JSON)
public String getDeclareFeedback(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody EmployeeDeclareParam employeeDeclareParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<EmployeeDeclareParam, EmployeeDeclareInfoDTO>(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam);
}
// /**
// * 人员报送-后端业务逻辑是否已经完成
// *
@ -243,7 +240,7 @@ public class EmployeeDeclareController {
// */
// @GetMapping("/getRate")
// @ApiOperation("人员报送-后端业务逻辑是否已经完成")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<EmployeeDeclareRateDTO> getRate(@RequestParam(value = "index") String index) {
// EmployeeDeclareRateDTO rate = employeeDeclareWrapper.getRate(index, TenantContext.getCurrentTenantKey());
// return WeaResult.success(rate);
@ -255,9 +252,9 @@ public class EmployeeDeclareController {
// * @param queryParam 导出参数
// * @return
// */
// @PostMapping("/export")
// @Path("/export")
// @ApiOperation("人员报送-导出全部人员")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> export(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.export(queryParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap);
@ -269,9 +266,9 @@ public class EmployeeDeclareController {
// * @param queryParam 导出参数
// * @return
// */
// @PostMapping("/export4Add")
// @Path("/export4Add")
// @ApiOperation("人员报送-导出本月新增人员")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Add(queryParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap);
@ -283,9 +280,9 @@ public class EmployeeDeclareController {
// * @param queryParam 导出参数
// * @return
// */
// @PostMapping("/export4Update")
// @Path("/export4Update")
// @ApiOperation("人员报送-导出本月信息变动人员")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Update(queryParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap);
@ -297,9 +294,9 @@ public class EmployeeDeclareController {
// * @param queryParam 导出参数
// * @return
// */
// @PostMapping("/export4Fail")
// @Path("/export4Fail")
// @ApiOperation("人员报送-导出本月报送失败的人员")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.export4Fail(queryParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap);
@ -307,7 +304,7 @@ public class EmployeeDeclareController {
//
// @GetMapping("/getImportParam")
// @ApiOperation("人员报送-获取导入参数")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<ExcelImportParam> getAcctResultImportParams() {
// String tenantKey = TenantContext.getCurrentTenantKey();
// Long currentEmployeeId = UserContext.getCurrentEmployeeId();
@ -324,9 +321,9 @@ public class EmployeeDeclareController {
// * @param importParam 获取导入模板
// * @return
// */
// @PostMapping("/exportTemplate")
// @Path("/exportTemplate")
// @ApiOperation("人员报送-导出导入模板")
// @WeaPermission
// @Produces(MediaType.APPLICATION_JSON)
// public WeaResult<Object> exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) {
// Map<String, Object> exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser());
// return WeaResult.success(exportMap);

View File

@ -0,0 +1,119 @@
package com.engine.salary.web;
import com.engine.common.util.ServiceUtil;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam;
import com.engine.salary.util.ResponseResult;
import com.engine.salary.util.page.PageInfo;
import com.engine.salary.wrapper.TaxDeclarationApiFlowBillingWrapper;
import io.swagger.v3.oas.annotations.parameters.RequestBody;
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;
/**
* 智能算薪-计费
*
* @author chengliming
* @date 2022-11-15 16:05:40
*/
public class TaxDeclarationApiFlowController {
private TaxDeclarationApiFlowBillingWrapper getTaxDeclarationApiFlowBillingWrapper(User user) {
return ServiceUtil.getService(TaxDeclarationApiFlowBillingWrapper.class, user);
}
/**
* 计费配置保存
*
* @param saveParam 保存参数
* @return WeaResult 返回结果
*/
@POST
@Path("/billing/config/save")
@Produces(MediaType.APPLICATION_JSON)
public String saveConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBillingConfigSaveParam saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationBillingConfigSaveParam, String>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::saveConfig, saveParam);
}
/**
* 计费配置开关
*
* @param saveParam 保存参数
* @return WeaResult 返回结果
*/
@POST
@Path("/billing/config/enable")
@Produces(MediaType.APPLICATION_JSON)
public String enableConfig(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationBillingConfigSaveParam saveParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationBillingConfigSaveParam, String>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::enableConfig, saveParam);
}
/**
* 查询计费配置开关状态
*
* @return WeaResult 返回结果
*/
@GET
@Path("/billing/config/status")
@Produces(MediaType.APPLICATION_JSON)
public String getConfigStatus(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationBillingConfigSaveParam, Boolean>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getConfigStatus);
}
/**
* 计费配置编辑表单
*
* @return WeaResult 返回结果
*/
@GET
@Path("/billing/config/get")
@Produces(MediaType.APPLICATION_JSON)
public String getConfig(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationBillingConfigSaveParam, TaxDeclarationBillingConfigFormDTO>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getConfig);
}
/**
* 接口流量使用记录
*
* @param queryParam 查询条件
* @return WeaResult 返回结果
*/
@POST
@Path("/record/list")
@Produces(MediaType.APPLICATION_JSON)
public String getFlowRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowRecordQueryParam queryParam) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<TaxDeclarationApiFlowRecordQueryParam, PageInfo<TaxDeclarationApiFlowRecordListDTO>>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord, queryParam);
}
//
// /**
// * 导出接口流量使用记录
// *
// * @param queryParam 查询条件
// * @return WeaResult 返回结果
// */
// @POST
// @Path("/record/export")
// @Produces(MediaType.APPLICATION_JSON)
// public String exportFlowRecord(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody TaxDeclarationApiFlowRecordQueryParam queryParam) {
// User user = HrmUserVarify.getUser(request, response);
// return new ResponseResult<TaxDeclarationApiFlowRecordQueryParam, PageInfo<TaxDeclarationApiFlowRecordListDTO>>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord,queryParam);
// return WeaResult.success(getTaxDeclarationApiFlowBillingWrapper.exportFlowRecord(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey()));
// }
}

View File

@ -15,10 +15,13 @@ import com.engine.salary.entity.taxagent.po.TaxAgentPO;
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.service.EmployeeDeclareService;
import com.engine.salary.service.SalaryCacheService;
import com.engine.salary.service.SalaryEmployeeService;
import com.engine.salary.service.TaxAgentService;
import com.engine.salary.service.impl.EmployeeDeclareServiceImpl;
import com.engine.salary.service.impl.SalaryCacheServiceImpl;
import com.engine.salary.service.impl.SalaryEmployeeServiceImpl;
import com.engine.salary.service.impl.TaxAgentServiceImpl;
import com.engine.salary.util.SalaryDateUtil;
@ -63,6 +66,10 @@ public class EmployeeDeclareWrapper extends Service {
return ServiceUtil.getService(SalaryEmployeeServiceImpl.class, user);
}
private SalaryCacheService getSalaryCacheService(User user) {
return ServiceUtil.getService(SalaryCacheServiceImpl.class, user);
}
/**
* 人员报送的个税扣缴义务人列表
@ -378,19 +385,17 @@ public class EmployeeDeclareWrapper extends Service {
// });
// return searchCondition;
// }
//
// /**
// * 人员报送-新增人员/编辑人员保存
// *
// * @param saveParam
// * @param employeeId
// * @param tenantKey
// */
// public void save(EmployeeDeclareSaveParam saveParam, Long employeeId, String tenantKey) {
// employeeDeclareService.save(saveParam, employeeId, tenantKey);
// }
//
//
/**
* 人员报送-新增人员/编辑人员保存
*
* @param saveParam
*/
public void save(EmployeeDeclareSaveParam saveParam) {
getEmployeeDeclareService(user).save(saveParam);
}
// /**
// * 批量编辑
// *
@ -399,7 +404,7 @@ public class EmployeeDeclareWrapper extends Service {
// * @param tenantKey
// */
// public void batchUpdate(EmployeeDeclareBatchUpdateParam batchUpdateParam, Long employeeId, String tenantKey) {
// employeeDeclareService.batchUpdate(batchUpdateParam, employeeId, tenantKey);
// getEmployeeDeclareService(user).batchUpdate(batchUpdateParam, employeeId, tenantKey);
// }
/**
@ -452,79 +457,76 @@ public class EmployeeDeclareWrapper extends Service {
return getEmployeeDeclareService(user).getDeclareInfo(employeeDeclareParam);
}
// /**
// * 人员报送-全部报送
// *
// * @param param
// * @param employeeId
// * @param tenantKey
// */
// public String declare(EmployeeDeclareParam param, Long employeeId, String tenantKey) {
// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
// .setIndex(UUID.randomUUID().toString())
// .setStatus(true)
// .setFinish(false)
// .setMsg("");
// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
/**
* 人员报送-全部报送
*
* @param param
*/
public String declare(EmployeeDeclareParam param) {
EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
.setIndex(UUID.randomUUID().toString())
.setStatus(true)
.setFinish(false)
.setMsg("");
getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate);
// if (!cacheResult) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156513, "全部报送失败"));
// }
// LocalRunnable localRunnable = new LocalRunnable() {
// @Override
// public void execute() {
// try {
// employeeDeclareService.declare(param, employeeId, tenantKey);
// employeeDeclareRate.setFinish(true);
// } catch (SalaryRunTimeException | SalaryNullException e) {
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
// } catch (Exception e) {
// log.error("全部报送失败:{}", e.getMessage(), e);
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage());
// } finally {
// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
// }
// }
// };
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable);
// return employeeDeclareRate.getIndex();
// }
//
// /**
// * 人员报送-获取报送结果反馈
// *
// * @param param
// * @param tenantKey
// */
// public String getDeclareFeedback(EmployeeDeclareParam param, Long employeeId, String tenantKey) {
// EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
// .setIndex(UUID.randomUUID().toString())
// .setStatus(true)
// .setFinish(false)
// .setMsg("");
// boolean cacheResult = salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
LocalRunnable localRunnable = new LocalRunnable() {
@Override
public void execute() {
try {
getEmployeeDeclareService(user).declare(param);
employeeDeclareRate.setFinish(true);
} catch (SalaryRunTimeException e) {
employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
} catch (Exception e) {
log.error("全部报送失败:{}", e.getMessage(), e);
employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187472, "系统错误,请联系管理员:") + e.getMessage());
} finally {
getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate);
}
}
};
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "declare", localRunnable);
return employeeDeclareRate.getIndex();
}
/**
* 人员报送-获取报送结果反馈
*
* @param param
*/
public String getDeclareFeedback(EmployeeDeclareParam param) {
EmployeeDeclareRateDTO employeeDeclareRate = new EmployeeDeclareRateDTO()
.setIndex(UUID.randomUUID().toString())
.setStatus(true)
.setFinish(false)
.setMsg("");
getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate);
// if (!cacheResult) {
// throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156514, "获取报送结果反馈失败"));
// }
// LocalRunnable localRunnable = new LocalRunnable() {
// @Override
// public void execute() {
// try {
// employeeDeclareService.getDeclareFeedback(param, employeeDeclareRate, employeeId, tenantKey);
// employeeDeclareRate.setFinish(true);
// } catch (SalaryRunTimeException | SalaryNullException e) {
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
// } catch (Exception e) {
// log.error("获取报送结果反馈失败:{}", e.getMessage(), e);
// employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 187472, "系统错误,请联系管理员:") + e.getMessage());
// } finally {
// salaryCacheService.set(SalaryCacheKey.EMPLOYEE_DECLARE, employeeDeclareRate.getIndex(), employeeDeclareRate);
// }
// }
// };
// ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable);
// return employeeDeclareRate.getIndex();
// }
//
LocalRunnable localRunnable = new LocalRunnable() {
@Override
public void execute() {
try {
getEmployeeDeclareService(user).getDeclareFeedback(param, employeeDeclareRate);
employeeDeclareRate.setFinish(true);
} catch (SalaryRunTimeException e) {
employeeDeclareRate.setStatus(false).setFinish(true).setMsg(e.getMessage());
} catch (Exception e) {
log.error("获取报送结果反馈失败:{}", e.getMessage(), e);
employeeDeclareRate.setStatus(false).setFinish(true).setMsg(SalaryI18nUtil.getI18nLabel(187472, "系统错误,请联系管理员:") + e.getMessage());
} finally {
getSalaryCacheService(user).set(SalaryCacheKey.EMPLOYEE_DECLARE + employeeDeclareRate.getIndex(), employeeDeclareRate);
}
}
};
ThreadPoolUtil.fixedPoolExecute(ModulePoolEnum.OTHER, "getDeclareFeedback", localRunnable);
return employeeDeclareRate.getIndex();
}
// /**
// * 获取人员报送相关后端接口是否已经完成
// *
@ -533,7 +535,7 @@ public class EmployeeDeclareWrapper extends Service {
// * @return
// */
// public EmployeeDeclareRateDTO getRate(String index, String tenantKey) {
// return salaryCacheService.get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class);
// return getSalaryCacheService(user).get(SalaryCacheKey.EMPLOYEE_DECLARE, index, EmployeeDeclareRateDTO.class);
// }
//
// /**

View File

@ -1,13 +1,20 @@
package com.engine.salary.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationApiFlowRecordListDTO;
import com.engine.salary.entity.taxapiflow.dto.TaxDeclarationBillingConfigFormDTO;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationApiFlowRecordQueryParam;
import com.engine.salary.entity.taxapiflow.param.TaxDeclarationBillingConfigSaveParam;
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
import com.engine.salary.enums.SalaryOnOffEnum;
import com.engine.salary.service.TaxDeclarationApiBillingService;
import com.engine.salary.service.TaxDeclarationApiConfigService;
import com.engine.salary.service.impl.TaxDeclarationApiBillingServiceImpl;
import com.engine.salary.service.impl.TaxDeclarationApiConfigServiceImpl;
import com.engine.salary.util.page.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import weaver.hrm.User;
/**
* 个税申报计费
@ -16,21 +23,22 @@ import org.springframework.stereotype.Component;
* @date 2022-11-11 15:16:22
*/
@Slf4j
@Component
public class TaxDeclarationApiFlowBillingWrapper {
public class TaxDeclarationApiFlowBillingWrapper extends Service {
private TaxDeclarationApiBillingService taxDeclarationApiBillingService;
public TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) {
return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user);
}
private TaxDeclarationApiConfigService taxDeclarationApiConfigService;
public TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) {
return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user);
}
// private SalaryBatchService salaryBatchService;
public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) {
taxDeclarationApiConfigService.saveConfig(saveParam);
public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam) {
getTaxDeclarationApiConfigService(user).saveConfig(saveParam);
}
public TaxDeclarationBillingConfigFormDTO getConfig() {
TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false);
TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(false);
if (config == null) {
return TaxDeclarationBillingConfigFormDTO.builder().appKey("").appSecret("").enable(true).build();
}
@ -42,10 +50,11 @@ public class TaxDeclarationApiFlowBillingWrapper {
.build();
}
// public WeaTable<TaxDeclarationApiFlowRecordListDTO> getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) {
// PageInfo<TaxDeclarationApiFlowRecordListDTO> page = taxDeclarationApiBillingService.pageFlowRecord(queryParam);
// return SalaryFormatUtil.<TaxDeclarationApiFlowRecordListDTO>getInstance().buildTable(TaxDeclarationApiFlowRecordListDTO.class, page);
// }
public PageInfo<TaxDeclarationApiFlowRecordListDTO> getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) {
// PageInfo<TaxDeclarationApiFlowRecordListDTO> page = getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam);
// return page;
return null;
}
// public Map<String, Object> exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) {
// List<TaxDeclarationApiFlowRecordListDTO> dtoList = taxDeclarationApiBillingService.listFlowRecord(queryParam, employeeId, tenantKey);
@ -66,12 +75,12 @@ public class TaxDeclarationApiFlowBillingWrapper {
// return map;
// }
public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) {
taxDeclarationApiConfigService.enableConfig(saveParam);
public void enableConfig(TaxDeclarationBillingConfigSaveParam saveParam) {
getTaxDeclarationApiConfigService(user).enableConfig(saveParam);
}
public Boolean getConfigStatus(String currentTenantKey, Long currentEmployeeId) {
TaxDeclarationApiConfigPO config = taxDeclarationApiConfigService.getConfig( false);
public Boolean getConfigStatus() {
TaxDeclarationApiConfigPO config = getTaxDeclarationApiConfigService(user).getConfig(false);
return config == null || SalaryOnOffEnum.ON.getValue().equals(config.getEnableUse());
}
}