个税申报表接口
This commit is contained in:
parent
cd41ca92c7
commit
bfdb9a33d5
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.taxdeclaration;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -38,6 +39,7 @@ public class TaxDeclaration {
|
|||
/**
|
||||
* 薪资所属月
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM")
|
||||
private Date salaryMonth;
|
||||
/**
|
||||
* 个税扣缴义务人id
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ public class TaxDeclarationBO {
|
|||
Map<Long, String> employeeNameMap = SalaryEntityUtil.convert2Map(simpleEmployees, DataCollectionEmployee::getEmployeeId, DataCollectionEmployee::getUsername);
|
||||
return taxDeclarations.stream().map(e -> TaxDeclarationListDTO.builder()
|
||||
.id(e.getId())
|
||||
.salaryMonth(e.getSalaryMonth().toString())
|
||||
.salaryMonth(e.getSalaryMonth())
|
||||
.taxAgentId(e.getTaxAgentId())
|
||||
.taxAgentName(taxAgentNameMap.getOrDefault(e.getTaxAgentId(), ""))
|
||||
.taxCycle(e.getTaxCycle().toString())
|
||||
.taxCycle(e.getTaxCycle())
|
||||
.operateEmployeeId(e.getCreator())
|
||||
.operateEmployeeName(employeeNameMap.getOrDefault(e.getCreator(), ""))
|
||||
.operateTime(SalaryDateUtil.getFormatLocalDateTime(e.getCreateTime()))
|
||||
|
|
@ -282,8 +282,8 @@ public class TaxDeclarationBO {
|
|||
.fieldCode(key)
|
||||
.fieldValue(value.toPlainString())
|
||||
.creator(taxDeclaration.getCreator())
|
||||
.createTime(SalaryDateUtil.dateToLocalDateTime(taxDeclaration.getCreateTime()))
|
||||
.updateTime(SalaryDateUtil.dateToLocalDateTime(taxDeclaration.getUpdateTime()))
|
||||
.createTime(taxDeclaration.getCreateTime())
|
||||
.updateTime(taxDeclaration.getUpdateTime())
|
||||
.deleteType(0)
|
||||
.tenantKey(taxDeclaration.getTenantKey())
|
||||
.build();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.entity.taxdeclaration.dto;
|
||||
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -41,195 +42,234 @@ public class TaxDeclarationDetailListDTO {
|
|||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@TableTitle(title = "姓名", dataIndex = "employeeName", key = "employeeName")
|
||||
private String employeeName;
|
||||
|
||||
/**
|
||||
* 身份证件类型
|
||||
*/
|
||||
@TableTitle(title = "身份证件类型", dataIndex = "idCardType", key = "idCardType")
|
||||
private String idCardType;
|
||||
|
||||
/**
|
||||
* 身份证件号码
|
||||
*/
|
||||
@TableTitle(title = "身份证件号码", dataIndex = "idCardNo", key = "idCardNo")
|
||||
private String idCardNo;
|
||||
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
@TableTitle(title = "纳税人识别号", dataIndex = "taxpayerIdNo", key = "taxpayerIdNo")
|
||||
private String taxpayerIdNo;
|
||||
|
||||
/**
|
||||
* 是居民还是非居民
|
||||
*/
|
||||
@TableTitle(title = "是居民还是非居民", dataIndex = "residentType", key = "residentType")
|
||||
private String residentType;
|
||||
|
||||
/**
|
||||
* 所得项目
|
||||
*/
|
||||
@TableTitle(title = "所得项目", dataIndex = "incomeType", key = "incomeType")
|
||||
private String incomeType;
|
||||
|
||||
/**
|
||||
* 收入
|
||||
*/
|
||||
@TableTitle(title = "收入", dataIndex = "income", key = "income")
|
||||
private String income;
|
||||
|
||||
/**
|
||||
* 费用
|
||||
*/
|
||||
@TableTitle(title = "费用", dataIndex = "fee", key = "fee")
|
||||
private String fee;
|
||||
|
||||
/**
|
||||
* 免税收入
|
||||
*/
|
||||
@TableTitle(title = "免税收入", dataIndex = "taxFreeIncome", key = "taxFreeIncome")
|
||||
private String taxFreeIncome;
|
||||
|
||||
/**
|
||||
* 减除费用
|
||||
*/
|
||||
@TableTitle(title = "减除费用", dataIndex = "subtraction", key = "subtraction")
|
||||
private String subtraction;
|
||||
|
||||
/**
|
||||
* 养老保险
|
||||
*/
|
||||
@TableTitle(title = "养老保险", dataIndex = "endowmentInsurance", key = "endowmentInsurance")
|
||||
private String endowmentInsurance;
|
||||
|
||||
/**
|
||||
* 医疗保险
|
||||
*/
|
||||
@TableTitle(title = "医疗保险", dataIndex = "medicalInsurance", key = "medicalInsurance")
|
||||
private String medicalInsurance;
|
||||
|
||||
/**
|
||||
* 失业保险
|
||||
*/
|
||||
@TableTitle(title = "失业保险", dataIndex = "unemploymentInsurance", key = "unemploymentInsurance")
|
||||
private String unemploymentInsurance;
|
||||
|
||||
/**
|
||||
* 住房公积金
|
||||
*/
|
||||
@TableTitle(title = "住房公积金", dataIndex = "housingProvidentFund", key = "housingProvidentFund")
|
||||
private String housingProvidentFund;
|
||||
|
||||
/**
|
||||
* 年金
|
||||
*/
|
||||
@TableTitle(title = "年金", dataIndex = "annuity", key = "annuity")
|
||||
private String annuity;
|
||||
|
||||
/**
|
||||
* 商业健康保险
|
||||
*/
|
||||
@TableTitle(title = "商业健康保险", dataIndex = "commercialHealthInsurance", key = "commercialHealthInsurance")
|
||||
private String commercialHealthInsurance;
|
||||
|
||||
/**
|
||||
* 税延养老保险
|
||||
*/
|
||||
@TableTitle(title = "税延养老保险", dataIndex = "taxDeferredEndowmentInsurance", key = "taxDeferredEndowmentInsurance")
|
||||
private String taxDeferredEndowmentInsurance;
|
||||
|
||||
/**
|
||||
* 财产原值
|
||||
*/
|
||||
@TableTitle(title = "财产原值", dataIndex = "originalValueOfProperty", key = "originalValueOfProperty")
|
||||
private String originalValueOfProperty;
|
||||
|
||||
/**
|
||||
* 允许扣除的税费
|
||||
*/
|
||||
@TableTitle(title = "允许扣除的税费", dataIndex = "deductedTax", key = "deductedTax")
|
||||
private String deductedTax;
|
||||
|
||||
/**
|
||||
* 其他
|
||||
*/
|
||||
@TableTitle(title = "其他", dataIndex = "other", key = "other")
|
||||
private String other;
|
||||
|
||||
/**
|
||||
* 累计收入额
|
||||
*/
|
||||
@TableTitle(title = "累计收入额", dataIndex = "addUpIncome", key = "addUpIncome")
|
||||
private String addUpIncome;
|
||||
|
||||
/**
|
||||
* 累计减除费用
|
||||
*/
|
||||
@TableTitle(title = "累计减除费用", dataIndex = "addUpSubtraction", key = "addUpSubtraction")
|
||||
private String addUpSubtraction;
|
||||
|
||||
/**
|
||||
* 累计专项扣除
|
||||
*/
|
||||
@TableTitle(title = "累计专项扣除", dataIndex = "addUpSpecialDeduction", key = "addUpSpecialDeduction")
|
||||
private String addUpSpecialDeduction;
|
||||
|
||||
/**
|
||||
* 累计子女教育
|
||||
*/
|
||||
@TableTitle(title = "累计子女教育", dataIndex = "addUpChildEducation", key = "addUpChildEducation")
|
||||
private String addUpChildEducation;
|
||||
|
||||
/**
|
||||
* 累计继续教育
|
||||
*/
|
||||
@TableTitle(title = "累计继续教育", dataIndex = "addUpContinuingEducation", key = "addUpContinuingEducation")
|
||||
private String addUpContinuingEducation;
|
||||
|
||||
/**
|
||||
* 累计住房贷款利息
|
||||
*/
|
||||
@TableTitle(title = "累计住房贷款利息", dataIndex = "addUpHousingLoanInterest", key = "addUpHousingLoanInterest")
|
||||
private String addUpHousingLoanInterest;
|
||||
|
||||
/**
|
||||
* 累计住房租金
|
||||
*/
|
||||
@TableTitle(title = "累计住房租金", dataIndex = "addUpHousingRent", key = "addUpHousingRent")
|
||||
private String addUpHousingRent;
|
||||
|
||||
/**
|
||||
* 累计赡养老人
|
||||
*/
|
||||
@TableTitle(title = "累计赡养老人", dataIndex = "addUpSupportElderly", key = "addUpSupportElderly")
|
||||
private String addUpSupportElderly;
|
||||
|
||||
/**
|
||||
* 累计其他扣除
|
||||
*/
|
||||
@TableTitle(title = "累计其他扣除", dataIndex = "addUpOther", key = "addUpOther")
|
||||
private String addUpOther;
|
||||
|
||||
/**
|
||||
* 减按计税比例
|
||||
*/
|
||||
@TableTitle(title = "减按计税比例", dataIndex = "lessTaxProportion", key = "lessTaxProportion")
|
||||
private String lessTaxProportion;
|
||||
|
||||
/**
|
||||
* 准允扣除的捐赠额
|
||||
*/
|
||||
@TableTitle(title = "准允扣除的捐赠额", dataIndex = "allowedDonation", key = "allowedDonation")
|
||||
private String allowedDonation;
|
||||
|
||||
/**
|
||||
* 应纳税所得额
|
||||
*/
|
||||
@TableTitle(title = "应纳税所得额", dataIndex = "taxableIncome", key = "taxableIncome")
|
||||
private String taxableIncome;
|
||||
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
@TableTitle(title = "税率", dataIndex = "taxRate", key = "taxRate")
|
||||
private String taxRate;
|
||||
|
||||
/**
|
||||
* 速算扣除数
|
||||
*/
|
||||
@TableTitle(title = "速算扣除数", dataIndex = "quickDeductionFactor", key = "quickDeductionFactor")
|
||||
private String quickDeductionFactor;
|
||||
|
||||
/**
|
||||
* 应纳税款
|
||||
*/
|
||||
@TableTitle(title = "应纳税款", dataIndex = "taxPayable", key = "taxPayable")
|
||||
private String taxPayable;
|
||||
|
||||
/**
|
||||
* 减免税额
|
||||
*/
|
||||
@TableTitle(title = "减免税额", dataIndex = "taxSavings", key = "taxSavings")
|
||||
private String taxSavings;
|
||||
|
||||
/**
|
||||
* 已扣缴税额
|
||||
*/
|
||||
@TableTitle(title = "已扣缴税额", dataIndex = "taxWithheld", key = "taxWithheld")
|
||||
private String taxWithheld;
|
||||
|
||||
/**
|
||||
* 应补(退)税额
|
||||
*/
|
||||
@TableTitle(title = "应补(退)税额", dataIndex = "refundedOrSupplementedTax", key = "refundedOrSupplementedTax")
|
||||
private String refundedOrSupplementedTax;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableTitle(title = "备注", dataIndex = "description", key = "description")
|
||||
private String description;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,9 @@
|
|||
package com.engine.salary.entity.taxdeclaration.dto;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTableType;
|
||||
import com.engine.salary.annotation.SalaryTable;
|
||||
import com.engine.salary.annotation.SalaryTableColumn;
|
||||
import com.engine.salary.annotation.SalaryTableOperate;
|
||||
import com.engine.salary.annotation.TableTitle;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
|
|
@ -9,6 +13,8 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: 个税申报记录列表
|
||||
* @author: xiajun
|
||||
|
|
@ -20,27 +26,32 @@ import lombok.NoArgsConstructor;
|
|||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SalaryTable(pageId = "a4f85287-e3f9-4275-adn9-7d06e54y6rj8", tableType = WeaTableType.CHECKBOX, operates = {
|
||||
@SalaryTableOperate(text = "查看")
|
||||
})
|
||||
public class TaxDeclarationListDTO {
|
||||
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
@TableTitle(title = "薪资所属月份", dataIndex = "salaryMonth", key = "salaryMonth")
|
||||
private String salaryMonth;
|
||||
@JsonFormat(pattern = "yyyy-MM")
|
||||
@TableTitle(title = "薪资所属月", dataIndex = "salaryMonth", key = "salaryMonth")
|
||||
private Date salaryMonth;
|
||||
|
||||
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentId", key = "taxAgentId")
|
||||
//@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentId", key = "taxAgentId")
|
||||
private Long taxAgentId;
|
||||
|
||||
@TableTitle(title = "个税扣缴义务人名称", dataIndex = "taxAgentName", key = "taxAgentName")
|
||||
@TableTitle(title = "个税扣缴义务人", dataIndex = "taxAgentName", key = "taxAgentName")
|
||||
private String taxAgentName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM")
|
||||
@TableTitle(title = "税款所属期", dataIndex = "taxCycle", key = "taxCycle")
|
||||
private String taxCycle;
|
||||
private Date taxCycle;
|
||||
|
||||
@TableTitle(title = "操作人id", dataIndex = "operateEmployeeId", key = "operateEmployeeId")
|
||||
//@TableTitle(title = "操作人id", dataIndex = "operateEmployeeId", key = "operateEmployeeId")
|
||||
private Long operateEmployeeId;
|
||||
|
||||
@TableTitle(title = "操作人名称", dataIndex = "operateEmployeeName", key = "operateEmployeeName")
|
||||
@TableTitle(title = "操作人", dataIndex = "operateEmployeeName", key = "operateEmployeeName")
|
||||
private String operateEmployeeName;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
|
|
|||
|
|
@ -23,4 +23,6 @@ public class TaxDeclarationDetailListQueryParam extends BaseQueryParam {
|
|||
|
||||
//"个税申报记录id")
|
||||
private Long taxDeclarationId;
|
||||
|
||||
private String taxDeclarationIdStr;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @description: 个税申报表详情
|
||||
|
|
@ -64,12 +64,12 @@ public class TaxDeclarationDetailPO {
|
|||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 应税项目。1:正常工资薪金所得
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public interface TaxDeclarationDetailMapper {
|
|||
* @param tenantKey
|
||||
* @return
|
||||
*/
|
||||
PageInfo<Long> listEmployeeId(@Param("taxDeclarationId") Long taxDeclarationId);
|
||||
List<Long> listEmployeeId(@Param("taxDeclarationId") Long taxDeclarationId);
|
||||
/**
|
||||
* 查询个税申报表明细
|
||||
*
|
||||
|
|
@ -101,5 +101,5 @@ public interface TaxDeclarationDetailMapper {
|
|||
* @param employeeIds
|
||||
* @return
|
||||
*/
|
||||
List<TaxDeclarationDetailPO> listByTaxDeclarationIdAndEmployeeIds(Long taxDeclarationId, Collection<Long> employeeIds);
|
||||
List<TaxDeclarationDetailPO> listByTaxDeclarationIdAndEmployeeIds(@Param("taxDeclarationId") Long taxDeclarationId, @Param("collection") List<Long> employeeIds);
|
||||
}
|
||||
|
|
@ -16,9 +16,7 @@
|
|||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t
|
||||
.
|
||||
create_time
|
||||
t.create_time
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.employee_id
|
||||
|
|
@ -61,12 +59,12 @@
|
|||
resultType="com.engine.salary.entity.taxdeclaration.po.TaxDeclarationDetailPO">
|
||||
SELECT
|
||||
<include refid="baseColumns"/>
|
||||
FROM hrsa_tax_declaration_detail
|
||||
FROM hrsa_tax_declaration_detail t
|
||||
WHERE delete_type = 0
|
||||
AND tax_declaration_id = #{taxDeclarationId}
|
||||
<if test="employeeIds != null and employeeIds.size()>0">
|
||||
<if test="collection != null and collection.size()>0">
|
||||
AND employee_id IN
|
||||
<foreach collection="employeeIds" open="(" item="id" separator="," close=")">
|
||||
<foreach collection="collection" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.mzlion.core.lang.CollectionUtils;
|
|||
import weaver.hrm.User;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
|
@ -70,16 +71,18 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
|
|||
@Override
|
||||
public PageInfo<TaxDeclarationDetailListDTO> listDtoPageByParam(TaxDeclarationDetailListQueryParam queryParam) {
|
||||
// 查询个税申报表明细的人员
|
||||
PageInfo<Long> employeeIdPage = getTaxDeclarationDetailMapper(user).listEmployeeId(queryParam.getTaxDeclarationId());
|
||||
List<Long> employeeIdPage = getTaxDeclarationDetailMapper(user).listEmployeeId(queryParam.getTaxDeclarationId());
|
||||
PageInfo<TaxDeclarationDetailListDTO> dtoPage = new PageInfo<TaxDeclarationDetailListDTO>(TaxDeclarationDetailListDTO.class);
|
||||
dtoPage.setPageNum(queryParam.getCurrent());
|
||||
dtoPage.setPageSize(queryParam.getPageSize());
|
||||
List<Long> list = employeeIdPage.getList();
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
if(null==employeeIdPage){
|
||||
return dtoPage;
|
||||
}
|
||||
if (CollectionUtils.isNotEmpty(employeeIdPage)) {
|
||||
// 查询个税申报表明细
|
||||
List<TaxDeclarationDetailPO> taxDeclarationDetailPOS = listByTaxDeclarationIdAndEmployeeIds(queryParam.getTaxDeclarationId(), employeeIdPage.getList());
|
||||
List<TaxDeclarationDetailPO> taxDeclarationDetailPOS = listByTaxDeclarationIdAndEmployeeIds(queryParam.getTaxDeclarationId(), employeeIdPage);
|
||||
// 查询人员
|
||||
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService().listByIds(employeeIdPage.getList());
|
||||
List<DataCollectionEmployee> simpleEmployees = getSalaryEmployeeService().listByIds(employeeIdPage);
|
||||
// List<SimpleEmployee> simpleEmployees = hrmCommonEmployeeService.getEmployeeByIds(employeeIdPage.getRecords(), tenantKey);
|
||||
// 转换成列表dto
|
||||
TaxDeclarationBO.buildDetailListDTO(queryParam.getTaxDeclarationId(), dtoPage, taxDeclarationDetailPOS, simpleEmployees);
|
||||
|
|
@ -101,7 +104,7 @@ public class TaxDeclarationDetailServiceImpl extends Service implements TaxDecla
|
|||
public void batchSave(Collection<TaxDeclarationDetailPO> taxDeclarationDetailPOS) {
|
||||
getTaxDeclarationDetailMapper(user).batchInsert(taxDeclarationDetailPOS);
|
||||
}
|
||||
public List<TaxDeclarationDetailPO> listByTaxDeclarationIdAndEmployeeIds(Long taxDeclarationId, Collection<Long> employeeIds) {
|
||||
public List<TaxDeclarationDetailPO> listByTaxDeclarationIdAndEmployeeIds(Long taxDeclarationId, List<Long> employeeIds) {
|
||||
if (CollectionUtils.isEmpty(employeeIds)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,10 +2,14 @@ package com.engine.salary.service.impl;
|
|||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryItemAdjustRecordListDTO;
|
||||
import com.engine.salary.entity.salaryarchive.param.SalaryItemAdjustRecordQueryParam;
|
||||
import com.engine.salary.entity.salaryitem.po.SalaryItemPO;
|
||||
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailListColumn;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationDetailListDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam;
|
||||
import com.engine.salary.enums.UserStatusEnum;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationMapper;
|
||||
import com.engine.salary.service.TaxDeclarationDetailService;
|
||||
|
|
@ -23,8 +27,10 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @description: 个税申报表导出
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import org.apache.commons.collections4.CollectionUtils;
|
|||
import org.apache.ibatis.session.SqlSession;
|
||||
import weaver.conn.mybatis.MyBatisFactory;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
public class TaxDeclarationServiceImpl extends Service implements TaxDeclarationService {
|
||||
|
|
@ -46,10 +47,6 @@ public class TaxDeclarationServiceImpl extends Service implements TaxDeclaration
|
|||
localDateRange.setEndDate(SalaryDateUtil.localDateToDate(queryParam.getEndSalaryMonth().atEndOfMonth()));
|
||||
}
|
||||
po.setSalaryMonths(localDateRange);
|
||||
//Page<TaxDeclarationPO> page = SalaryPageUtil.buildPage(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
// if (SalaryEntityUtil.isNotNullOrEmpty(queryParam.getFromSalaryMonth())&&SalaryEntityUtil.isNotNullOrEmpty(queryParam.getEndSalaryMonth()) ) {
|
||||
// // taxDeclarationMapper.selectPage(page, queryWrapper)
|
||||
// }
|
||||
// 查询个税申报表
|
||||
PageUtil.start(queryParam.getCurrent(), queryParam.getPageSize());
|
||||
List<TaxDeclarationPO> taxDeclarationPOS = getTaxDeclarationMapper().listSome(po);
|
||||
|
|
|
|||
|
|
@ -406,13 +406,28 @@ public class SalaryDateUtil {
|
|||
* @param date
|
||||
* @return
|
||||
*/
|
||||
public static Date stringToDate(String date) throws ParseException {
|
||||
public static Date stringToDate(String date) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
Date parse = null;
|
||||
if (date != null) {
|
||||
parse = sdf.parse(date);
|
||||
try {
|
||||
parse = sdf.parse(date);
|
||||
} catch (ParseException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return parse;
|
||||
}
|
||||
|
||||
//格式化日期
|
||||
public static String strToDateLong(String strDate) {
|
||||
Date date = new Date();
|
||||
try {
|
||||
date = new SimpleDateFormat("yyyyMMddHHmmss").parse(strDate + "000000");//先按照原格式转换为时间
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String str = new SimpleDateFormat("yyyy-MM").format(date);//再将时间转换为对应格式字符串
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,18 +1,24 @@
|
|||
package com.engine.salary.web;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryacct.param.SalaryComparisonResultQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationDetailListDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationFormDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationInfoDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationListDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationListQueryParam;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationSaveParam;
|
||||
import com.engine.salary.mapper.taxdeclaration.TaxDeclarationDetailMapper;
|
||||
import com.engine.salary.service.TaxDeclarationExcelService;
|
||||
import com.engine.salary.service.TaxDeclarationService;
|
||||
import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxDeclarationServiceImpl;
|
||||
import com.engine.salary.util.ResponseResult;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import com.engine.salary.wrapper.TaxDeclarationDetailWrapper;
|
||||
import com.engine.salary.wrapper.TaxDeclarationWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
|
|
@ -29,6 +35,7 @@ import javax.ws.rs.core.StreamingOutput;
|
|||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class TaxDeclarationController {
|
||||
|
|
@ -45,14 +52,13 @@ public class TaxDeclarationController {
|
|||
private TaxDeclarationExcelService getTaxDeclarationExcelService(User user) {
|
||||
return (TaxDeclarationExcelService)ServiceUtil.getService(TaxDeclarationExcelServiceImpl.class, user);
|
||||
}
|
||||
/* private TaxDeclarationDetailWrapper getTaxDeclarationDetailWrapper(User user) {
|
||||
private TaxDeclarationDetailWrapper getTaxDeclarationDetailWrapper(User user) {
|
||||
return ServiceUtil.getService(TaxDeclarationDetailWrapper.class, user);
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
//个税申报表列表
|
||||
@POST
|
||||
@Path("/listPage")
|
||||
@Path("/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String list(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationListQueryParam queryParam) throws ParseException {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
|
|
@ -87,13 +93,14 @@ public class TaxDeclarationController {
|
|||
return new ResponseResult<TaxDeclarationSaveParam, Long>().run(getTaxDeclarationWrapper(user)::save, param);
|
||||
}
|
||||
//个税申报表详情列表
|
||||
/* @GET
|
||||
@POST
|
||||
@Path("/detail/list")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String listTaxDeclarationDetail(@Context HttpServletRequest request, @Context HttpServletResponse response,@RequestBody TaxDeclarationDetailListQueryParam param) {
|
||||
User user = HrmUserVerify.getUser(request, response);
|
||||
return new ResponseResult<TaxDeclarationDetailListQueryParam, Long>().run(getTaxDeclarationDetailWrapper(user)::listPage, param);
|
||||
}*/
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
param.setTaxDeclarationId(Long.parseLong(param.getTaxDeclarationIdStr()));
|
||||
return new ResponseResult<TaxDeclarationDetailListQueryParam, Map<String, Object>>().run(getTaxDeclarationDetailWrapper(user)::listPage, param);
|
||||
}
|
||||
|
||||
//个税申报表相关信息
|
||||
@GET
|
||||
|
|
|
|||
|
|
@ -1,66 +1,77 @@
|
|||
/*
|
||||
package com.engine.salary.wrapper;
|
||||
|
||||
import com.cloudstore.eccom.pc.table.WeaTable;
|
||||
import com.cloudstore.eccom.pc.table.WeaTableColumn;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.component.SalaryWeaTable;
|
||||
import com.engine.salary.entity.salaryarchive.dto.SalaryArchiveListDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.TaxDeclaration;
|
||||
import com.engine.salary.entity.taxdeclaration.bo.TaxDeclarationDetailListColumn;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationDetailListDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationLaborListDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.dto.TaxDeclarationWageListDTO;
|
||||
import com.engine.salary.entity.taxdeclaration.param.TaxDeclarationDetailListQueryParam;
|
||||
import com.engine.salary.enums.salarysob.IncomeCategoryEnum;
|
||||
import com.engine.salary.service.TaxDeclarationDetailService;
|
||||
import com.engine.salary.service.TaxDeclarationExcelService;
|
||||
import com.engine.salary.service.TaxDeclarationService;
|
||||
import com.engine.salary.service.impl.TaxDeclarationDetailServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxDeclarationExcelServiceImpl;
|
||||
import com.engine.salary.util.page.PageInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
*/
|
||||
/**
|
||||
* @description: 个税申报表明细
|
||||
|
||||
/** @description: 个税申报表明细
|
||||
* @author: xiajun
|
||||
* @modified By: xiajun
|
||||
* @date: Created in 1/23/22 6:07 PM
|
||||
* @version:v1.0
|
||||
*//*
|
||||
* @version:v1.0*/
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class TaxDeclarationDetailWrapper extends Service {
|
||||
|
||||
@Resource
|
||||
private TaxDeclarationService taxDeclarationService;
|
||||
@Resource
|
||||
private TaxDeclarationDetailService taxDeclarationDetailService;
|
||||
private TaxDeclarationDetailService getTaxDeclarationDetailService(User user) {
|
||||
return (TaxDeclarationDetailService) ServiceUtil.getService(TaxDeclarationDetailServiceImpl.class, user);
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
* 个税申报表明细列表
|
||||
|
||||
/** 个税申报表明细列表
|
||||
*
|
||||
* @param queryParam 列表查询条件
|
||||
* @return
|
||||
*//*
|
||||
* @return*/
|
||||
|
||||
public PageInfo listPage(TaxDeclarationDetailListQueryParam queryParam) {
|
||||
TaxDeclaration taxDeclaration = taxDeclarationService.getById(queryParam.getTaxDeclarationId());
|
||||
PageInfo<TaxDeclarationDetailListDTO> dtoPage = new PageInfo<TaxDeclarationDetailListDTO>(TaxDeclarationDetailListDTO.class);
|
||||
|
||||
public Map<String,Object> listPage(TaxDeclarationDetailListQueryParam queryParam) {
|
||||
PageInfo<TaxDeclarationDetailListDTO> dtoPage = getTaxDeclarationDetailService(user).listDtoPageByParam(queryParam);
|
||||
// 列表的表头
|
||||
List<WeaTableColumn> weaTableColumns = TaxDeclarationDetailListColumn.listTableColumn().stream()
|
||||
.map(weaTableColumnWapper -> (WeaTableColumn) weaTableColumnWapper)
|
||||
.collect(Collectors.toList());
|
||||
SalaryWeaTable<TaxDeclarationDetailListDTO> table = new SalaryWeaTable<TaxDeclarationDetailListDTO>(user, TaxDeclarationDetailListDTO.class);
|
||||
table.setColumns(weaTableColumns);
|
||||
|
||||
dtoPage.setTotal(dtoPage.getPageSize());
|
||||
dtoPage.setPageNum(queryParam.getCurrent());
|
||||
dtoPage.setPageSize(queryParam.getPageSize());
|
||||
// 正常工资薪金所得
|
||||
if (Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.WAGES_AND_SALARIES.getValue())) {
|
||||
PageInfo<TaxDeclarationWageListDTO> taxDeclarationWageListDTOPageInfo = taxDeclarationDetailService.listDtoPageByParam4Wage(queryParam);
|
||||
dtoPage.setList(taxDeclarationWageListDTOPageInfo.getList());
|
||||
//weaTable = SalaryFormatUtil.<TaxDeclarationWageListDTO>getInstance().buildTable(TaxDeclarationWageListDTO.class, dtoPage);
|
||||
}
|
||||
// 劳务报酬所得
|
||||
if (Objects.equals(taxDeclaration.getIncomeCategory(), IncomeCategoryEnum.REMUNERATION_FOR_LABOR.getValue())) {
|
||||
PageInfo<TaxDeclarationLaborListDTO> taxDeclarationLaborListDTOPageInfo = taxDeclarationDetailService.listDtoPageByParam4Labor(queryParam);
|
||||
dtoPage.setList(taxDeclarationLaborListDTOPageInfo.getList());
|
||||
//weaTable = SalaryFormatUtil.<TaxDeclarationLaborListDTO>getInstance().buildTable(TaxDeclarationLaborListDTO.class, dtoPage);
|
||||
}
|
||||
return dtoPage;
|
||||
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
|
||||
Map<String,Object> datas = new HashMap<>();
|
||||
datas.put("pageInfo", dtoPage);
|
||||
datas.put("dataKey",result.getResultMap());
|
||||
datas.put("pageUid", "taxDeclarationDetailList");
|
||||
return datas;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import weaver.hrm.User;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -131,9 +132,12 @@ public class TaxDeclarationWrapper extends Service {
|
|||
}
|
||||
// 查询个税扣缴义务人
|
||||
TaxAgent taxAgent = new TaxAgentBiz().getById(id);
|
||||
//日期转换
|
||||
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM");
|
||||
String transformDate=simpleDateFormat.format(taxDeclaration.getSalaryMonth());
|
||||
// 转换成个税申报表详情dto
|
||||
formDTO = TaxDeclarationFormDTO.builder()
|
||||
.salaryMonth(SalaryDateUtil.localDate2YearMonth(taxDeclaration.getSalaryMonth()))
|
||||
.salaryMonth(SalaryDateUtil.String2YearMonth(transformDate))
|
||||
.taxAgentId(taxDeclaration.getTaxAgentId())
|
||||
.taxAgentName(Optional.ofNullable(taxAgent).map(TaxAgent::getName).orElse(""))
|
||||
.description(taxDeclaration.getDescription())
|
||||
|
|
@ -170,15 +174,17 @@ public class TaxDeclarationWrapper extends Service {
|
|||
*/
|
||||
public TaxDeclarationInfoDTO getTaxDeclarationInfoById(Long id) {
|
||||
// 查询个税申报表
|
||||
//TaxDeclarationPO taxDeclarationPO = getTaxDeclarationService(user).getById(id);
|
||||
TaxDeclaration taxDeclaration = getTaxDeclarationService(user).getById(id);
|
||||
if (Objects.isNull(taxDeclaration)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(98877, "个税申报表不存在或已删除"));
|
||||
}
|
||||
//日期转换
|
||||
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM");
|
||||
String transformDate=simpleDateFormat.format(taxDeclaration.getSalaryMonth());
|
||||
// 查询个税扣缴义务人
|
||||
TaxAgent taxAgentPO = new TaxAgentBiz().getById(taxDeclaration.getTaxAgentId());
|
||||
return TaxDeclarationInfoDTO.builder()
|
||||
.salaryMonth(SalaryDateUtil.localDate2YearMonth(taxDeclaration.getSalaryMonth()))
|
||||
.salaryMonth(SalaryDateUtil.String2YearMonth(transformDate))
|
||||
.taxAgentId(taxDeclaration.getTaxAgentId())
|
||||
.taxAgentName(Optional.ofNullable(taxAgentPO).map(TaxAgent::getName).orElse(""))
|
||||
.build();
|
||||
|
|
|
|||
Loading…
Reference in New Issue