This commit is contained in:
parent
2a692b13b4
commit
8e2ff975a9
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.salary.entity.taxdeclaration.dto;
|
||||
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationPO;
|
||||
import com.engine.salary.entity.taxdeclaration.po.TaxDeclareStatusPO;
|
||||
import com.engine.salary.enums.salarysob.DeclareReportTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 个税申报类型
|
||||
* <p>Copyright: Copyright (c) 2023</p>
|
||||
* <p>Company: 泛微软件</p>
|
||||
*
|
||||
* @author qiantao
|
||||
* @version 1.0
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TaxDeclarationReportDTO {
|
||||
|
||||
private DeclareReportTypeEnum reportType;
|
||||
|
||||
private TaxDeclareStatusPO status;
|
||||
|
||||
private List<TaxDeclarationPO> taxDeclarations;
|
||||
|
||||
}
|
||||
|
|
@ -194,4 +194,5 @@ public interface TaxDeclareRecordService {
|
|||
|
||||
void updateById(TaxDeclareRecordPO taxDeclareRecord);
|
||||
|
||||
void getTaxReportType(Long id);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1199,6 +1199,47 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
getTaxDeclareRecordMapper().updateIgnoreNull(taxDeclareRecord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTaxReportType(Long id) {
|
||||
List<TaxDeclareStatusPO> taxDeclareStatusByTaxDeclareRecordId = getTaxDeclareStatusByTaxDeclareRecordId(id);
|
||||
|
||||
DeclareReportTypeEnum declareReportType = DeclareReportTypeEnum.parseByValue(reportType);
|
||||
|
||||
TaxDeclareStatusPO declareStatus = getTaxDeclareStatus(id, reportType);
|
||||
if (declareStatus == null) {
|
||||
declareStatus = TaxDeclareStatusPO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.taxDeclareRecordId(id)
|
||||
.reportType(reportType)
|
||||
.taxDeclareType(TaxDeclareTypeEnum.NORMAL_DECLARE.getValue())
|
||||
.taxDeclareStatus(TaxDeclareStatusEnum.NOT_DECLARE.getValue())
|
||||
.taxDeclareErrorMsg("")
|
||||
.personNum(0)
|
||||
.taxPayAmount("")
|
||||
.taxPaidAmount("")
|
||||
.taxPurePaidAmount("")
|
||||
.deleteType(0)
|
||||
.build();
|
||||
getTaxDeclareStatusMapper().insertIgnoreNull(declareStatus);
|
||||
}
|
||||
|
||||
// 查询个税申报记录
|
||||
TaxDeclareRecordPO taxDeclareRecord = getById(id);
|
||||
if (Objects.isNull(taxDeclareRecord)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156495, "参数异常,个税申报记录不存在或已被删除"));
|
||||
}
|
||||
|
||||
// 查询个税申报表
|
||||
List<TaxDeclarationPO> taxDeclarations = getTaxDeclarationService(user).listByTaxCycleAndTaxAgentIds(SalaryDateUtil.localDate2YearMonth(taxDeclareRecord.getTaxCycle()), Collections.singleton(taxDeclareRecord.getTaxAgentId()));
|
||||
if (CollectionUtils.isEmpty(taxDeclarations)) {
|
||||
throw new SalaryRunTimeException(SalaryI18nUtil.getI18nLabel(156494, "当前无可申报的数据"));
|
||||
}
|
||||
|
||||
taxDeclarations.forEach(taxDeclarationPO -> {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private TaxDeclareRequest buildTaxDeclareRequest(Long id) {
|
||||
// 查询供应商信息
|
||||
|
|
|
|||
|
|
@ -90,6 +90,21 @@ public class TaxDeclarationController {
|
|||
return new ResponseResult<Long, Map>(user).run(getTaxDeclareRecordWrapper(user)::getForm, id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 个税申报左侧分类
|
||||
*
|
||||
* @param id 个税申报记录id
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getTaxReportType")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public String getTaxReportType(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam(value = "id") Long id) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return new ResponseResult<Long, Object>(user).run(getTaxDeclareRecordWrapper(user)::getTaxReportType, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 个税申报表相关信息
|
||||
*
|
||||
|
|
|
|||
|
|
@ -870,4 +870,8 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
loggerContext.setOldValues(declarationValuePO);
|
||||
SalaryElogConfig.taxDeclarationLoggerTemplate.write(loggerContext);
|
||||
}
|
||||
|
||||
public void getTaxReportType(Long id) {
|
||||
getTaxDeclareRecordService(user).getTaxReportType(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue