From 827420c2bda646274ae7e44e0947d2c2cca80031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=92=B1=E6=B6=9B?= <15850646081@163.com> Date: Tue, 8 Aug 2023 19:39:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E7=A8=8E=E5=AF=B9=E6=8E=A5=EF=BC=8C?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=8A=A5=E9=80=81=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/sqlupgrade/GS/sql202307180103.sql | 34 -- resource/sqlupgrade/GS/sql202307180203.sql | 38 -- resource/sqlupgrade/GS/sql202307180403.sql | 31 -- .../web/TaxDeclarationApiFlowController.java | 14 + src/com/engine/salary/common/OptionDTO.java | 4 +- .../common/taxdeclare/AsyncRequestIdDTO.java | 2 +- .../entity/agency/bo/PaymentAgencyBO.java | 7 +- .../entity/agency/po/PaymentAgencyPO.java | 6 +- .../bo/EmployeeDeclareRefresh.java | 128 ++--- .../bo/EmployeeDeclareRequest.java | 142 +++++ .../dto/EmployeeDeclareRateDTO.java | 9 +- .../dto/EmployeeDeclareRefreshDTO.java | 12 +- .../param/EmployeeDeclareSaveParam.java | 96 ++++ .../po/EmployeeDeclareRecordPO.java | 56 ++ .../DeclareEmployeeFeedbackResponse.java | 35 ++ .../response/DeclareEmployeeInfoResponse.java | 23 + .../po/SalaryCheckResultDetailTempPO.java | 6 +- .../salaryacct/po/SalaryCheckResultPO.java | 6 +- .../po/SalaryCheckResultRecordPO.java | 6 +- .../taxagent/bo/TaxAgentTaxReturnBO.java | 10 +- .../dto/TaxAgentTaxReturnCheckDTO.java | 10 +- .../dto/TaxAgentTaxReturnCheckFormDTO.java | 30 +- .../dto/TaxAgentTaxReturnMainFormDTO.java | 30 +- .../param/TaxAgentTaxReturnSaveParam.java | 28 +- .../entity/taxapiflow/bo/TaxApiFlowBO.java | 219 ++++---- .../dto/CreateMessageRuleParamDTO.java | 6 +- .../TaxDeclarationApiFlowRecordListDTO.java | 24 +- ...larationApiFlowStatisticDetailListDTO.java | 6 +- ...TaxDeclarationApiFlowStatisticListDTO.java | 10 +- .../dto/TaxDeclarationApiFlowTotalDTO.java | 8 +- ...axDeclarationApiFlowWarnConfigFormDTO.java | 14 +- ...DeclarationApiFlowWarnReceiverFormDTO.java | 10 +- ...DeclarationApiFlowWarnReceiverListDTO.java | 8 +- .../TaxDeclarationBillingConfigFormDTO.java | 8 +- .../param/CreateMessageRuleParam.java | 4 +- .../TaxDeclarationApiFlowMonthQueryParam.java | 6 +- ...TaxDeclarationApiFlowRecordQueryParam.java | 10 +- ...DeclarationApiFlowWarnConfigSaveParam.java | 10 +- ...clarationApiFlowWarnReceiverSaveParam.java | 10 +- .../TaxDeclarationBillingConfigSaveParam.java | 8 +- .../TaxDeclarationApiFlowWarnReceiverPO.java | 6 +- .../dto/AbnormalEmployeeListDTO.java | 18 +- .../dto/FailEmployeeListDTO.java | 14 +- .../dto/TaxDeclarationRateDTO.java | 10 +- .../dto/TaxDeclarationTabDTO.java | 6 +- .../dto/TaxDeclareRecordFormDTO.java | 8 +- .../dto/TaxDeclareRecordListDTO.java | 28 +- .../param/AbnormalEmployeeListQueryParam.java | 8 +- .../TaxDeclarationValueListQueryParam.java | 8 +- .../param/TaxDeclareRecordParam.java | 2 +- .../po/TaxDeclarationApiConfigPO.java | 8 +- .../po/TaxDeclarationApiProfilePO.java | 6 +- .../po/TaxDeclarationValuePO.java | 6 +- .../po/TaxDeclareEmployeePO.java | 4 +- .../taxdeclaration/po/TaxDeclareRecordPO.java | 6 +- .../taxdeclaration/po/TaxReportColumnPO.java | 6 +- .../CancelDeclareFeedbackResponse.java | 4 +- .../response/CancelDeclareResponse.java | 4 +- .../response/DeclareTaxFeedbackResponse.java | 4 +- .../response/DeclareTaxResponse.java | 4 +- .../response/UpdateDeclareResponse.java | 2 +- .../dto/TaxAgreementBankFormDTO.java | 4 +- .../dto/TaxAgreementFeedbackResultDTO.java | 6 +- .../taxpayment/dto/TaxAmountFormDTO.java | 6 +- .../taxpayment/dto/TaxFeedbackResultDTO.java | 8 +- .../taxpayment/dto/TaxPayTypeFormDTO.java | 2 +- .../dto/TaxWithheldVoucherResultDTO.java | 6 +- .../param/TaxPaymentQueryParam.java | 14 +- .../taxpayment/po/TaxPaymentRequestPO.java | 6 +- .../service/EmployeeDeclareRecordService.java | 21 + .../service/EmployeeDeclareService.java | 11 +- .../TaxDeclarationApiBillingService.java | 38 +- .../EmployeeDeclareRecordServiceImpl.java | 46 ++ .../impl/EmployeeDeclareServiceImpl.java | 504 +++++++++--------- .../TaxDeclarationApiBillingServiceImpl.java | 246 ++++----- .../TaxDeclarationApiConfigServiceImpl.java | 32 +- .../TaxDeclarationApiFlowWarnServiceImpl.java | 8 +- .../engine/salary/util/SalaryEntityUtil.java | 47 ++ .../salary/web/EmployeeDeclareController.java | 127 +++-- .../web/TaxDeclarationApiFlowController.java | 119 +++++ .../wrapper/EmployeeDeclareWrapper.java | 168 +++--- .../TaxDeclarationApiFlowBillingWrapper.java | 49 +- 82 files changed, 1629 insertions(+), 1125 deletions(-) delete mode 100644 resource/sqlupgrade/GS/sql202307180103.sql delete mode 100644 resource/sqlupgrade/GS/sql202307180203.sql delete mode 100644 resource/sqlupgrade/GS/sql202307180403.sql create mode 100644 src/com/api/salary/web/TaxDeclarationApiFlowController.java create mode 100644 src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java create mode 100644 src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java create mode 100644 src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java create mode 100644 src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java create mode 100644 src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java create mode 100644 src/com/engine/salary/service/EmployeeDeclareRecordService.java create mode 100644 src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java create mode 100644 src/com/engine/salary/web/TaxDeclarationApiFlowController.java diff --git a/resource/sqlupgrade/GS/sql202307180103.sql b/resource/sqlupgrade/GS/sql202307180103.sql deleted file mode 100644 index b701b86e6..000000000 --- a/resource/sqlupgrade/GS/sql202307180103.sql +++ /dev/null @@ -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); -/ - diff --git a/resource/sqlupgrade/GS/sql202307180203.sql b/resource/sqlupgrade/GS/sql202307180203.sql deleted file mode 100644 index 10aced290..000000000 --- a/resource/sqlupgrade/GS/sql202307180203.sql +++ /dev/null @@ -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; -/ - diff --git a/resource/sqlupgrade/GS/sql202307180403.sql b/resource/sqlupgrade/GS/sql202307180403.sql deleted file mode 100644 index 3a72f6ecc..000000000 --- a/resource/sqlupgrade/GS/sql202307180403.sql +++ /dev/null @@ -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); -/ - diff --git a/src/com/api/salary/web/TaxDeclarationApiFlowController.java b/src/com/api/salary/web/TaxDeclarationApiFlowController.java new file mode 100644 index 000000000..6fcdf10c5 --- /dev/null +++ b/src/com/api/salary/web/TaxDeclarationApiFlowController.java @@ -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{ + +} diff --git a/src/com/engine/salary/common/OptionDTO.java b/src/com/engine/salary/common/OptionDTO.java index 6ec60f48c..465d4ed3f 100644 --- a/src/com/engine/salary/common/OptionDTO.java +++ b/src/com/engine/salary/common/OptionDTO.java @@ -18,9 +18,9 @@ import lombok.NoArgsConstructor; @ApiModel("人员选项") public class OptionDTO { - @ApiModelProperty("人员ID") + //人员ID") private String id; - @ApiModelProperty("人员姓名") + //人员姓名") private String content; } diff --git a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java index 6f20b5f65..00cd2948f 100644 --- a/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java +++ b/src/com/engine/salary/common/taxdeclare/AsyncRequestIdDTO.java @@ -13,6 +13,6 @@ import lombok.Data; @Data public class AsyncRequestIdDTO { - @ApiModelProperty("异步接口中的requestId") + //异步接口中的requestId") private String requestId; } diff --git a/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java b/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java index 0fbe29e78..e3be152b6 100644 --- a/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java +++ b/src/com/engine/salary/entity/agency/bo/PaymentAgencyBO.java @@ -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(); } diff --git a/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java b/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java index 93045f86e..87626962b 100644 --- a/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java +++ b/src/com/engine/salary/entity/agency/po/PaymentAgencyPO.java @@ -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; /** * 创建人 diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java index aa1b60536..a0833fb49 100644 --- a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRefresh.java @@ -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 employeeIds = SalaryEntityUtil.properties(dto.getEmployeeDeclares(), EmployeeDeclarePO::getEmployeeId); // 员工的个人信息 - Map 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 simpleUserInfoMap = SalaryEntityUtil.convert2Map(dto.getHrmEmployeeComInfos(), DataCollectionEmployee::getEmployeeId); // 薪资档案的数据(任职受雇从业类型、起始发薪日期、最后发薪日期) Map salaryArchiveMap = SalaryEntityUtil.convert2Map(dto.getSalaryArchives(), SalaryArchivePO::getEmployeeId); // 非系统人员的数据(任职受雇从业类型) - Map extEmployeeMap = SalaryEntityUtil.convert2Map(dto.getExtEmployees(), ExtEmployeePO::getId); - LocalDateTime now = LocalDateTime.now(); + Map 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()) diff --git a/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java new file mode 100644 index 000000000..16b4192bc --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/bo/EmployeeDeclareRequest.java @@ -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> convert2RequestParam(List employeeDeclares) { + List> employeeInfoMapList = Lists.newArrayList(); + for (EmployeeDeclarePO employeeDeclare : employeeDeclares) { + Map 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; + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java index d53dc69fb..fe1c33f95 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRateDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java index 7d795b5a0..bc3477e99 100644 --- a/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java +++ b/src/com/engine/salary/entity/employeedeclare/dto/EmployeeDeclareRefreshDTO.java @@ -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 salaryArchives; // 员工基本信息 - private List employeeInfos; - -// // 员工基本信息 -// private List hrmEmployeeComInfos; + private List hrmEmployeeComInfos; // // // 员工个人信息 // private List simpleUserInfos; -// -// // 非系统人员 -// private List extEmployees; + + // 非系统人员 + private List extEmployees; } diff --git a/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java new file mode 100644 index 000000000..36cfe6bc8 --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/param/EmployeeDeclareSaveParam.java @@ -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; +} diff --git a/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java new file mode 100644 index 000000000..83d5ffa7e --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/po/EmployeeDeclareRecordPO.java @@ -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; +} diff --git a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java new file mode 100644 index 000000000..331090c7b --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeFeedbackResponse.java @@ -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> bsjg; + + @ApiModelProperty("requestId") + private String requestId; + } +} diff --git a/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java new file mode 100644 index 000000000..73216ff4b --- /dev/null +++ b/src/com/engine/salary/entity/employeedeclare/response/DeclareEmployeeInfoResponse.java @@ -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; +} diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java index 08d73b41d..1f03a451d 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultDetailTempPO.java @@ -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; } diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java index f8f8da978..245f1d9c0 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultPO.java @@ -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; } diff --git a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java index b57210197..9c034ff9c 100644 --- a/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java +++ b/src/com/engine/salary/entity/salaryacct/po/SalaryCheckResultRecordPO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java index c19abcd52..559aced70 100644 --- a/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java +++ b/src/com/engine/salary/entity/taxagent/bo/TaxAgentTaxReturnBO.java @@ -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 convert2RequestMap(TaxAgentPO taxAgent, TaxAgentTaxReturnPO taxAgentTaxReturn) { diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java index fbb47d85e..8b3a6717a 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckDTO.java @@ -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 records; public void setMessage(String message, String currentTenantKey, Long currentEmployeeId) { diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java index 67b5a8f5e..5430733d3 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnCheckFormDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java index 291f90835..dae97d778 100644 --- a/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java +++ b/src/com/engine/salary/entity/taxagent/dto/TaxAgentTaxReturnMainFormDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java index 23dfe7a42..a28a0b349 100644 --- a/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java +++ b/src/com/engine/salary/entity/taxagent/param/TaxAgentTaxReturnSaveParam.java @@ -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() { diff --git a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java index 879f68bb5..44b42447c 100644 --- a/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java +++ b/src/com/engine/salary/entity/taxapiflow/bo/TaxApiFlowBO.java @@ -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 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{}"; + } +} diff --git a/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java index 3de26dafa..527a7e2cf 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/CreateMessageRuleParamDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java index 47281e693..5b6ef90cb 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowRecordListDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java index 8f0897b70..9d658b6d9 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticDetailListDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java index f027f899d..ecfa10f57 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowStatisticListDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java index 139950acc..467bc6eae 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowTotalDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java index 7910b6dbd..0ce847aeb 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnConfigFormDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java index 2f3c38d1b..3ce0a8212 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverFormDTO.java @@ -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 employee; - @ApiModelProperty("手机号") + //手机号") private String mobile; - @ApiModelProperty("邮箱列表") + //邮箱列表") private String email; - @ApiModelProperty("邮箱列表下拉框") + //邮箱列表下拉框") @JsonIgnore private List emailOptions; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java index d5afc26f5..c8689ef66 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationApiFlowWarnReceiverListDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java index 1604b8e96..93502a5a6 100644 --- a/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java +++ b/src/com/engine/salary/entity/taxapiflow/dto/TaxDeclarationBillingConfigFormDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java index 15deaba5f..6a512da74 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/CreateMessageRuleParam.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java index 50e83b5f3..2ae0cbb43 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowMonthQueryParam.java @@ -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() { diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java index 8a5f7be71..d0a508a08 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowRecordQueryParam.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java index 482c76195..1dbf4be53 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnConfigSaveParam.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java index 345cc3ac7..c6b953632 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationApiFlowWarnReceiverSaveParam.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java index afb9c15e1..843a04a81 100644 --- a/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java +++ b/src/com/engine/salary/entity/taxapiflow/param/TaxDeclarationBillingConfigSaveParam.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java index e546a8edb..5ac94d180 100644 --- a/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java +++ b/src/com/engine/salary/entity/taxapiflow/po/TaxDeclarationApiFlowWarnReceiverPO.java @@ -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; /** * 创建人 diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java index 105f6ebb8..8d497acc9 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/AbnormalEmployeeListDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java index 5b73b2245..40fde19f7 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/FailEmployeeListDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java index a261ad1b0..e3a737b0c 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationRateDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java index f8604a3da..508b83537 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclarationTabDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java index e8db3265e..4d7b82a8e 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordFormDTO.java @@ -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> taxAgentIds; - @ApiModelProperty("备注") + //备注") private String description; } diff --git a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java index dd494dcdc..5b8762da2 100644 --- a/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java +++ b/src/com/engine/salary/entity/taxdeclaration/dto/TaxDeclareRecordListDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java index 3e8a7743a..dc8682958 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/AbnormalEmployeeListQueryParam.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java index 1eac68efa..939ca1fc4 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclarationValueListQueryParam.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java index de2728047..24073b49a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java +++ b/src/com/engine/salary/entity/taxdeclaration/param/TaxDeclareRecordParam.java @@ -13,6 +13,6 @@ import lombok.Data; @Data public class TaxDeclareRecordParam { - @ApiModelProperty("个税申报记录id") + //个税申报记录id") private Long taxDeclareRecordId; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java index 53231ebf8..5f3c1ae81 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiConfigPO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java index d65bacb06..d726a2ca6 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationApiProfilePO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java index 39fc3f89c..c39e85173 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclarationValuePO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java index b692fc532..60cb134ec 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareEmployeePO.java @@ -13,9 +13,9 @@ import lombok.Data; @Data public class TaxDeclareEmployeePO { - @ApiModelProperty("人员id") + //人员id") private Long employeeId; - @ApiModelProperty("人员类型") + //人员类型") private Integer employeeType; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java index 59ba8eb32..5a708da50 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxDeclareRecordPO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java index 43598e736..9d0d07871 100644 --- a/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java +++ b/src/com/engine/salary/entity/taxdeclaration/po/TaxReportColumnPO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java index b00a2d9d6..71e9cfd82 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareFeedbackResponse.java @@ -16,9 +16,9 @@ import java.util.Map; @Data public class CancelDeclareFeedbackResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; - @ApiModelProperty("接口状态") + //接口状态") private Map body; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java index 75956a672..743c44d59 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/CancelDeclareResponse.java @@ -15,9 +15,9 @@ import lombok.Data; @Data public class CancelDeclareResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; - @ApiModelProperty("接口数据") + //接口数据") private AsyncRequestIdDTO body; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java index de5292d7a..01f3ce6cf 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxFeedbackResponse.java @@ -16,9 +16,9 @@ import java.util.Map; @Data public class DeclareTaxFeedbackResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; - @ApiModelProperty("接口状态") + //接口状态") private Map body; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java index fd68013db..cb688af2a 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/DeclareTaxResponse.java @@ -15,9 +15,9 @@ import lombok.Data; @Data public class DeclareTaxResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; - @ApiModelProperty("接口数据") + //接口数据") private AsyncRequestIdDTO body; } diff --git a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java index 6d37b2695..a1f58e76f 100644 --- a/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java +++ b/src/com/engine/salary/entity/taxdeclaration/response/UpdateDeclareResponse.java @@ -16,6 +16,6 @@ import lombok.Data; @ApiModel("更正申报的返回数据") public class UpdateDeclareResponse { - @ApiModelProperty("接口状态") + //接口状态") private SzyhResponseHead head; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java index d2cece365..59b4903ca 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementBankFormDTO.java @@ -21,9 +21,9 @@ import lombok.NoArgsConstructor; public class TaxAgreementBankFormDTO { - @ApiModelProperty("开户行") + //开户行") private String bank; - @ApiModelProperty("开户账号") + //开户账号") private String bankNo; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java index f7ac03735..04bde84da 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAgreementFeedbackResultDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java index b0fc09ca7..f7a268d4d 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxAmountFormDTO.java @@ -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; //} diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java index 845e888a9..4ea43c7f4 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxFeedbackResultDTO.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java index 628200104..6a5582e4e 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxPayTypeFormDTO.java @@ -20,7 +20,7 @@ import lombok.NoArgsConstructor; @ApiModel("查询缴费信息") public class TaxPayTypeFormDTO { - @ApiModelProperty("缴款方式") + //缴款方式") private String type; } diff --git a/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java index fb6cdf770..66718e6e3 100644 --- a/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java +++ b/src/com/engine/salary/entity/taxpayment/dto/TaxWithheldVoucherResultDTO.java @@ -24,16 +24,16 @@ import java.util.List; @AllArgsConstructor @ApiModel("获取完税证明") public class TaxWithheldVoucherResultDTO extends TaxFeedbackResultDTO { - @ApiModelProperty("完税证明") + //完税证明") private List vouchers; @Data @AllArgsConstructor public static class Voucher { - @ApiModelProperty("名称") + //名称") private String name; - @ApiModelProperty("内容") + //内容") private String content; } } diff --git a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java index dd3f86edb..ac2787246 100644 --- a/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java +++ b/src/com/engine/salary/entity/taxpayment/param/TaxPaymentQueryParam.java @@ -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; } diff --git a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java index 614c5ee70..3ad3e8367 100644 --- a/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java +++ b/src/com/engine/salary/entity/taxpayment/po/TaxPaymentRequestPO.java @@ -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; } diff --git a/src/com/engine/salary/service/EmployeeDeclareRecordService.java b/src/com/engine/salary/service/EmployeeDeclareRecordService.java new file mode 100644 index 000000000..9377c324f --- /dev/null +++ b/src/com/engine/salary/service/EmployeeDeclareRecordService.java @@ -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); +} diff --git a/src/com/engine/salary/service/EmployeeDeclareService.java b/src/com/engine/salary/service/EmployeeDeclareService.java index cc5590731..097e6ae3e 100644 --- a/src/com/engine/salary/service/EmployeeDeclareService.java +++ b/src/com/engine/salary/service/EmployeeDeclareService.java @@ -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); } diff --git a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java index dec7a27be..3917b494e 100644 --- a/src/com/engine/salary/service/TaxDeclarationApiBillingService.java +++ b/src/com/engine/salary/service/TaxDeclarationApiBillingService.java @@ -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 pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); - - /** - * 获取流量使用记录(不分页) - * - * @param queryParam - * @return - */ - List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); +// /** +// * 获取流量使用记录(分页) +// * +// * @param queryParam +// * @return +// */ +// PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); +// +// /** +// * 获取流量使用记录(不分页) +// * +// * @param queryParam +// * @return +// */ +// List listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam); /** * 导出流量使用记录 @@ -45,6 +39,6 @@ public interface TaxDeclarationApiBillingService { * @param queryParam * @param map */ - void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map); +// void exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Map map); } diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java new file mode 100644 index 000000000..9fdb54b90 --- /dev/null +++ b/src/com/engine/salary/service/impl/EmployeeDeclareRecordServiceImpl.java @@ -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) { + + + } +} diff --git a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java index 0b0f6ca78..3114d8ca7 100644 --- a/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java +++ b/src/com/engine/salary/service/impl/EmployeeDeclareServiceImpl.java @@ -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); @@ -77,7 +104,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla @Override public List listByIds(Collection ids) { - if (CollectionUtils.isEmpty(ids)){ + if (CollectionUtils.isEmpty(ids)) { return Collections.emptyList(); } return getEmployeeDeclareMapper().listSome(EmployeeDeclarePO.builder().ids(ids).build()); @@ -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 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 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) { // // 查询报送人员 @@ -376,7 +403,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla dtoList.forEach(po -> { boolean isExtEmp = EmployeeTypeEnum.EXT_EMPLOYEE.getValue().compareTo(po.getEmployeeType().getValue()) == 0; DataCollectionEmployee employee = employeeInfoMap.get(po.getEmployeeId() + "-" + isExtEmp); - if(ObjectUtils.isNotEmpty(employee)){ + if (ObjectUtils.isNotEmpty(employee)) { po.setSubCompanyName(Optional.ofNullable(employee.getSubcompanyName()).orElse("")); po.setDepartmentName(Optional.ofNullable(employee.getDepartmentName()).orElse("")); } @@ -401,7 +428,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // 查询本月已有的需要报送的人员 List employeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle(), refreshParam.getTaxAgentId()); // 查询上月已有的需要报送的人员(只需要正常的) - List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1,ChronoUnit.MONTHS), refreshParam.getTaxAgentId()) + List preTaxCycleEmployeeDeclares = listByTaxCycleAndTaxAgentId(refreshParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), refreshParam.getTaxAgentId()) .stream() .filter(e -> Objects.equals(e.getEmploymentStatus(), EmploymentStatusEnum.NORMAL.getValue()) && Objects.equals(e.getDeclareStatus(), DeclareStatusEnum.DECLARE_SUCCESS.getValue())) @@ -432,7 +459,7 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla List salaryArchivePOS = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(refreshParam.getTaxAgentId()).employeeIds(employeeIds).build()); // 本月增加了哪些人员 - Set orgEmployeeIds = ((List)CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares)) + Set orgEmployeeIds = ((List) CollectionUtils.union(preTaxCycleEmployeeDeclares, employeeDeclares)) .stream() .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.ORGANIZATION.getValue())) .map(EmployeeDeclarePO::getEmployeeId) @@ -446,12 +473,12 @@ public class EmployeeDeclareServiceImpl extends Service implements EmployeeDecla // List newSimpleUserInfos = salaryEmployeeService.listByEmployeeIds(newOrgEmployeeIds, tenantKey); // List newHrmEmployeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, Lists.newArrayList(newOrgEmployeeIds)); // 查询本月增加了哪些非系统人员 -// List extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId(), tenantKey); +// List extEmployees = extEmployeeService.listBySalaryCycleAndTaxAgentId(salaryCycleRange, refreshParam.getTaxAgentId()); // Set extEmployeeIds = employeeDeclares.stream() // .filter(e -> Objects.equals(e.getEmployeeType(), EmployeeTypeEnum.EXT_EMPLOYEE.getValue())) // .map(EmployeeDeclarePO::getEmployeeId) // .collect(Collectors.toSet()); -// List newExtEmployees = extEmployees.stream() +// List 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 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 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> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); -// // 企业信息 -// Map 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 params = new HashMap<>(1); -// Map 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); -// // 记录日志 + @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 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> employeeInfoMapList = EmployeeDeclareRequest.convert2RequestParam(employeeDeclares); + // 企业信息 + Map 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 params = new HashMap<>(1); + Map 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 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.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(tenantKey, employeeId, 156450, "全部报送")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey, employeeId, 156450, "全部报送")); +// loggerContext.setOperateTypeName(SalaryI18nUtil.getI18nLabel(156450, "全部报送")); +// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(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 requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId()); -// Map 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> 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 needUpdateEmployeeDeclares = Lists.newArrayList(); -// List 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 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)) { + } + + @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 requestParam = ImmutableMap.of("requestId", employeeDeclareRecord.getRequestId()); + Map 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> 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 needUpdateEmployeeDeclares = Lists.newArrayList(); + List 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 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); -// } -// // 删除原来的人员报送记录 -// employeeDeclareRecordService.deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId(), tenantKey); -// // 记录日志 + } + // 删除原来的人员报送记录 + getEmployeeDeclareRecordService(user).deleteByTaxCycleAndTaxAgentId(param.getTaxCycle(), param.getTaxAgentId()); + // 记录日志 // LoggerContext 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.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(tenantKey,employeeId,156452, "获取结果反馈")); -// loggerContext.setOperatedesc(SalaryI18nUtil.getI18nLabel(tenantKey,employeeId,156452, "获取结果反馈")); +// 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(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()))); -// } -// } + // 报送失败的 + 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()))); + } + } } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java index da8de675c..41c63a25f 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiBillingServiceImpl.java @@ -1,51 +1,47 @@ 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; - + // private ComInfoCache comInfoCache; // private ExtEmployeeService extEmployeeService; @@ -65,112 +61,106 @@ public class TaxDeclarationApiBillingServiceImpl implements TaxDeclarationApiBil } } - @Override - public PageInfo pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { - LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); - Page flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true)); - List records = flowRecordPOPage.getRecords(); - if (records.isEmpty()) { - return new PageInfo<>(); - } - TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); - // 转换数据 - AtomicInteger indexNum = new AtomicInteger(1); - List 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 pageFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { +// LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); +// Page flowRecordPOPage = queryChainWrapper.page(new Page<>(queryParam.getCurrent(), queryParam.getPageSize(), true)); +// List records = flowRecordPOPage.getRecords(); +// if (records.isEmpty()) { +// return new PageInfo<>(); +// } +// TempPropertiesWrapper propertiesWrapper = getUserInfoAndTaxAgentMap(records); +// // 转换数据 +// AtomicInteger indexNum = new AtomicInteger(1); +// List 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 listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { +// LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); +// List 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 list, String currentTenantKey) { +// Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); +// // 获取人员信息 +// List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet())); +// Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername); +// Map empIdNoMap = getSalaryEmployeeService(user).mapByEmployeeIds(employeeTaxAgentMap.keySet()); +// List extEmployeePOS = extEmployeeService.listAll(currentTenantKey); +// Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId); +// // 获取个税扣缴义务人信息 +// List taxAgentPOS = getTaxAgentService(user).listByIds(new HashSet<>(employeeTaxAgentMap.values())); +// Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); +// return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); +// } +// +// private LambdaQueryChainWrapper getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { +// LambdaQueryChainWrapper 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 listFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { - LambdaQueryChainWrapper queryChainWrapper = getFlowRecordQueryChainWrapper(queryParam); - List 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 list, String currentTenantKey) { - Map employeeTaxAgentMap = SalaryEntityUtil.convert2Map(list, TaxDeclarationApiFlowRecordPO::getEmployeeId, TaxDeclarationApiFlowRecordPO::getTaxAgentId); - // 获取人员信息 - List employeeComInfos = comInfoCache.getCacheList(HrmEmployeeComInfo.class, new ArrayList<>(employeeTaxAgentMap.keySet())); - Map empNameMap = SalaryEntityUtil.convert2Map(employeeComInfos, HrmEmployeeComInfo::getId, HrmEmployeeComInfo::getUsername); - Map empIdNoMap = salaryEmployeeService.mapByEmployeeIds(employeeTaxAgentMap.keySet()); - List extEmployeePOS = extEmployeeService.listAll(currentTenantKey); - Map extEmployeeMap = SalaryEntityUtil.convert2Map(extEmployeePOS, ExtEmployeePO::getId); - // 获取个税扣缴义务人信息 - List taxAgentPOS = taxAgentService.listByIds(new HashSet<>(employeeTaxAgentMap.values())); - Map taxAgentNameMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getId, TaxAgentPO::getName); - return new TempPropertiesWrapper(empNameMap, empIdNoMap, taxAgentNameMap, extEmployeeMap); - } - - private LambdaQueryChainWrapper getFlowRecordQueryChainWrapper(TaxDeclarationApiFlowRecordQueryParam queryParam, String currentTenantKey) { - LambdaQueryChainWrapper 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 map) { - ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); - // 表头 - List 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 dtoList = listFlowRecord(queryParam, employeeId, tenantKey); - // 组装数据 - for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { - List 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 map) { +// ExportWrapper exportWrapper = new ExportWrapper(map, employeeId, tenantKey); +// // 表头 +// List 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 dtoList = listFlowRecord(queryParam, employeeId, tenantKey); +// // 组装数据 +// for (TaxDeclarationApiFlowRecordListDTO dto : dtoList) { +// List 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 taxAgentNameMap; // 获取非系统人员 - private Map extEmployeeMap; + private Map 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 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; diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java index f114d7330..e716e6daa 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiConfigServiceImpl.java @@ -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 apiProfiles = taxDeclarationApiProfileMapper.listAll(); + List apiProfiles = getTaxDeclarationApiProfileMapper().listAll(); if (apiProfiles.isEmpty() || TaxDeclareApiProfileEnum.PROD.getValue().equals(apiProfiles.get(0).getApiProfile())) { return SzyhApiConstant.HOST_URL; } diff --git a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java index 12ea4afa5..75fc36ec4 100644 --- a/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java +++ b/src/com/engine/salary/service/impl/TaxDeclarationApiFlowWarnServiceImpl.java @@ -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.*; diff --git a/src/com/engine/salary/util/SalaryEntityUtil.java b/src/com/engine/salary/util/SalaryEntityUtil.java index 3cc5fe7dd..6368dab61 100644 --- a/src/com/engine/salary/util/SalaryEntityUtil.java +++ b/src/com/engine/salary/util/SalaryEntityUtil.java @@ -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; + } + } + + } diff --git a/src/com/engine/salary/web/EmployeeDeclareController.java b/src/com/engine/salary/web/EmployeeDeclareController.java index 6fac3b188..aaaf3cae2 100644 --- a/src/com/engine/salary/web/EmployeeDeclareController.java +++ b/src/com/engine/salary/web/EmployeeDeclareController.java @@ -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 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 getSearchCondition() { // WeaSearchCondition searchCondition = employeeDeclareWrapper.getSearchCondition(); // return WeaResult.success(searchCondition); // } -// -// /** -// * 人员报送-新增人员/编辑人员保存 -// * -// * @param saveParam 保存参数 -// * @return -// */ -// @PostMapping("/save") -// @ApiOperation("人员报送-新增人员/编辑人员保存") -// @WeaPermission -// public WeaResult 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>(user).run(getEmployeeDeclareWrapper(user)::save, saveParam); + } + // /** // * 人员报送-批量编辑 // * // * @param batchUpdateParam 批量编辑参数 // * @return // */ -// @PostMapping("/batchUpdate") +// @Path("/batchUpdate") // @ApiOperation("人员报送-批量编辑") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult 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(user).run(getEmployeeDeclareWrapper(user)::getDeclareInfo, employeeDeclareParam); } -// /** -// * 人员报送-全部报送 -// * -// * @param employeeDeclareParam 在线报送 -// * @return -// */ -// @PostMapping("/declare") -// @ApiOperation("人员报送-全部报送") -// @WeaPermission -// public WeaResult 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 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(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(user).run(getEmployeeDeclareWrapper(user)::getDeclareFeedback, employeeDeclareParam); + } + // /** // * 人员报送-后端业务逻辑是否已经完成 // * @@ -243,7 +240,7 @@ public class EmployeeDeclareController { // */ // @GetMapping("/getRate") // @ApiOperation("人员报送-后端业务逻辑是否已经完成") -// @WeaPermission +// @Produces(MediaType.APPLICATION_JSON) // public WeaResult 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 export(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { // Map 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 export4Add(@RequestBody @Validated EmployeeDeclareAddListQueryParam queryParam) { // Map 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 export4Update(@RequestBody @Validated EmployeeDeclareListQueryParam queryParam) { // Map 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 export4Fail(@RequestBody @Validated EmployeeDeclareFailListQueryParam queryParam) { // Map 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 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 exportTemplate(@RequestBody @Validated EmployeeDeclareImportParam importParam) { // Map exportMap = employeeDeclareWrapper.exportTemplate(importParam, UserContext.getCurrentUser()); // return WeaResult.success(exportMap); diff --git a/src/com/engine/salary/web/TaxDeclarationApiFlowController.java b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java new file mode 100644 index 000000000..0a6bf2a36 --- /dev/null +++ b/src/com/engine/salary/web/TaxDeclarationApiFlowController.java @@ -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(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(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(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(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>(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>(user).run(getTaxDeclarationApiFlowBillingWrapper(user)::getFlowRecord,queryParam); +// return WeaResult.success(getTaxDeclarationApiFlowBillingWrapper.exportFlowRecord(queryParam, UserContext.getCurrentEmployeeId(), TenantContext.getCurrentTenantKey())); +// } +} diff --git a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java index 608ba0892..15438a9bf 100644 --- a/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java +++ b/src/com/engine/salary/wrapper/EmployeeDeclareWrapper.java @@ -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); + } + /** * 人员报送的个税扣缴义务人列表 @@ -182,7 +189,7 @@ public class EmployeeDeclareWrapper extends Service { queryParam.getTaxCycle().plus(-1, ChronoUnit.MONTHS), queryParam.getTaxAgentId(), employeeIds); // 获取修改了哪些字段 Map> updatedFieldMap = EmployeeDeclareList.getUpdatedField(poPageInfo.getList(), preTaxCycleEmployeeDeclares); - for (EmployeeDeclareListDTO employeeDeclareListDTO : (List)dtoPageInfo.getList()) { + for (EmployeeDeclareListDTO employeeDeclareListDTO : (List) dtoPageInfo.getList()) { Set updatedDataIndexSet = updatedFieldMap.get(employeeDeclareListDTO); employeeDeclareListDTO.setUpdatedDataIndexSet(updatedDataIndexSet); } @@ -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); // } // // /** diff --git a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java index 01edf018d..7be89079d 100644 --- a/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java +++ b/src/com/engine/salary/wrapper/TaxDeclarationApiFlowBillingWrapper.java @@ -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 { - - private TaxDeclarationApiBillingService taxDeclarationApiBillingService; - - private TaxDeclarationApiConfigService taxDeclarationApiConfigService; - -// private SalaryBatchService salaryBatchService; +public class TaxDeclarationApiFlowBillingWrapper extends Service { - public void saveConfig(TaxDeclarationBillingConfigSaveParam saveParam, Long currentEmployeeId, String currentTenantKey) { - taxDeclarationApiConfigService.saveConfig(saveParam); + public TaxDeclarationApiBillingService getTaxDeclarationApiBillingService(User user) { + return ServiceUtil.getService(TaxDeclarationApiBillingServiceImpl.class, user); + } + + public TaxDeclarationApiConfigService getTaxDeclarationApiConfigService(User user) { + return ServiceUtil.getService(TaxDeclarationApiConfigServiceImpl.class, user); + } + + 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 getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long currentEmployeeId, String currentTenantKey) { -// PageInfo page = taxDeclarationApiBillingService.pageFlowRecord(queryParam); -// return SalaryFormatUtil.getInstance().buildTable(TaxDeclarationApiFlowRecordListDTO.class, page); -// } + public PageInfo getFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam) { +// PageInfo page = getTaxDeclarationApiBillingService(user).pageFlowRecord(queryParam); +// return page; + return null; + } // public Map exportFlowRecord(TaxDeclarationApiFlowRecordQueryParam queryParam, Long employeeId, String tenantKey) { // List 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()); } }