处理缴款反馈
This commit is contained in:
parent
691f4c42ce
commit
a2a18245bd
|
|
@ -23,15 +23,15 @@ public interface TaxDeclareStatusService {
|
|||
TaxDeclareStatusPO getTaxDeclareStatus(Long taxDeclareRecordId, Integer reportType);
|
||||
|
||||
/**
|
||||
* 获取申报记录状态列表
|
||||
* 更新主记录,返回申报记录状态列表
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
List<TaxDeclareStatusPO> getOrInitTaxReports(Long id);
|
||||
List<TaxDeclareStatusPO> updateRecord(Long id);
|
||||
|
||||
/**
|
||||
* 更新申报状态,同时更新主记录
|
||||
* @param declareStatus
|
||||
*/
|
||||
void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus);
|
||||
void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus,boolean updateRecord);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,13 +26,12 @@ import com.engine.salary.exception.SalaryRunTimeException;
|
|||
import com.engine.salary.mapper.taxpayment.TaxPaymentRequestMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.*;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
|
@ -145,7 +144,6 @@ public abstract class AbstractTaxPaymentService extends Service implements TaxPa
|
|||
return new TempWrapper(apiConfigPO, taxReturnPO, taxAgentPO, taxDeclareRecord);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String getRequestId(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param);
|
||||
QuerySpecialAmountResponse queryResponse = getRequestIdResponse(tempWrapper.taxReturnPO, tempWrapper.taxAgentPO.getName(),
|
||||
|
|
|
|||
|
|
@ -314,7 +314,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
* @param currentEmployeeId
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handleStayDelData(long currentEmployeeId) {
|
||||
log.info("福利档案中待减员数据自动处理逻辑开始:");
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM");
|
||||
|
|
@ -351,7 +350,6 @@ public class SIArchivesServiceImpl extends Service implements SIArchivesService
|
|||
* 福利档案中增量数据处理
|
||||
* @param currentEmployeeId
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void handleChangeData(long currentEmployeeId) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,6 @@
|
|||
// }
|
||||
//
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void calcByEmployeeIds(Long salaryAcctRecordId, Collection<Long> salaryAcctEmployeeIds, DataCollectionEmployee simpleEmployee) throws Exception {
|
||||
// SalaryAcctRateDTO salaryAcctRate = new SalaryAcctRateDTO("" + salaryAcctRecordId);
|
||||
// try {
|
||||
|
|
|
|||
|
|
@ -403,7 +403,6 @@ public class SalaryArchiveExcelServiceImpl extends Service implements SalaryArch
|
|||
// * 导入薪资档案
|
||||
// */
|
||||
// @BatchImportHandler("importSalaryArchive")
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void importSalaryArchive() {
|
||||
// BatchDocumentMessage message = BatchImportContext.getBatchDocumentMessage();
|
||||
// log.info("【薪资档案】接收到上传的数据:{}", String.format("batchTaskId=%s, fileName=%s", message.getBatchTaskId(), message.getBatchFile().getName()));
|
||||
|
|
|
|||
|
|
@ -253,7 +253,6 @@ public class SalaryArchiveServiceImpl extends Service implements SalaryArchiveSe
|
|||
*
|
||||
* @param currentEmployeeId
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void handleSuspendData(Long currentEmployeeId) {
|
||||
List<String> personnelStatuss = new ArrayList<String>() {{
|
||||
add("4");
|
||||
|
|
|
|||
|
|
@ -28,13 +28,12 @@ import com.engine.salary.service.TaxDeclarationApiFlowWarnService;
|
|||
import com.engine.salary.util.SalaryAssert;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import com.engine.salary.util.db.IdGenerator;
|
||||
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.db.IdGenerator;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import weaver.common.MessageUtil;
|
||||
import weaver.email.EmailWorkRunnable;
|
||||
import weaver.general.BaseBean;
|
||||
|
|
@ -103,7 +102,6 @@ public class TaxDeclarationApiFlowWarnServiceImpl extends Service implements Tax
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteReceiver(Long id) {
|
||||
TaxDeclarationApiFlowWarnReceiverPO receiverPO = getWarnReceiverPOById(id);
|
||||
SalaryAssert.notNull(receiverPO, "该提醒对象不存在,请刷新页面后重试");
|
||||
|
|
|
|||
|
|
@ -724,7 +724,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARING.getValue());
|
||||
declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||
declareStatus.setTaxDeclareErrorMsg("");
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus);
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
|
|
@ -831,7 +831,9 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
declareStatus.setPersonNum(Integer.parseInt(Optional.ofNullable(declareTaxFeedbackResponse.getBody().get("nsrc")).orElse("0").toString()));
|
||||
declareStatus.setDeclareRequestId(declareStatus.getRequestId());
|
||||
declareStatus.setRequestId("");
|
||||
//实缴(不含滞纳金)
|
||||
BigDecimal purePaidAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPurePaidAmount());
|
||||
//应缴
|
||||
BigDecimal payAmount = SalaryEntityUtil.empty2Zero(declareStatus.getTaxPayAmount());
|
||||
if (TaxDeclareStatusEnum.DECLARE_SUCCESS_PAID.equals(taxDeclareStatusEnum) || TaxDeclareStatusEnum.DECLARE_SUCCESS_NO_PAY.equals(taxDeclareStatusEnum)) {
|
||||
// 如果是已缴纳状态,则更新已缴纳金额,判断是否需要线下退税
|
||||
|
|
@ -850,7 +852,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
declareStatus.setTaxPayAmount(payAmount.subtract(purePaidAmount).toString());
|
||||
}
|
||||
//更新申报状态
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus);
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 如果申报失败
|
||||
if (CollectionUtils.isNotEmpty(taxDeclareFails)) {
|
||||
|
|
@ -921,7 +923,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
// 更新个税申报状态
|
||||
declareStatus.setTaxDeclareStatus(TaxDeclareStatusEnum.DECLARE_CANCELLING.getValue());
|
||||
declareStatus.setRequestId(declareTaxResponse.getBody().getRequestId());
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus);
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
|
|
@ -978,7 +980,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
//更新个税申报状态
|
||||
declareStatus.setTaxDeclareStatus(taxDeclareStatusEnum.getValue());
|
||||
declareStatus.setRequestId("");
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus);
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
|
|
@ -1021,7 +1023,11 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
|
||||
Map<String, List<List<Object>>> map = new HashMap<>();
|
||||
List<TaxDeclarationPO> list = getTaxDeclarationService(user).listByTaxDeclareRecordId(id);
|
||||
list.stream().map(TaxDeclarationPO::getIncomeCategory).map(IncomeCategoryEnum::parseByValue).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse));
|
||||
list.stream()
|
||||
.map(TaxDeclarationPO::getIncomeCategory)
|
||||
.map(IncomeCategoryEnum::parseByValue)
|
||||
.filter(incomeCategoryEnum -> incomeCategoryEnum.getReportType().getValue().equals(param.getReportType()))
|
||||
.collect(Collectors.toList()).forEach(e -> e.parseGetDeclareTaxResultFeedbackResponse(map, declareTaxResultFeedbackResponse));
|
||||
return ExcelUtil.genWorkbookV2(map);
|
||||
}
|
||||
|
||||
|
|
@ -1065,7 +1071,7 @@ public class TaxDeclareRecordServiceImpl extends Service implements TaxDeclareRe
|
|||
declareStatus.setTaxDeclareType(TaxDeclareTypeEnum.UPDATE_DECLARE.getValue());
|
||||
declareStatus.setTaxDeclareStatus(NOT_DECLARE.getValue());
|
||||
declareStatus.setRequestId("");
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus);
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(declareStatus,true);
|
||||
|
||||
// 记录日志
|
||||
TaxAgentPO taxAgent = taxDeclareRequest.getTaxAgent();
|
||||
|
|
|
|||
|
|
@ -56,17 +56,19 @@ public class TaxDeclareStatusServiceImpl extends Service implements TaxDeclareSt
|
|||
|
||||
|
||||
@Override
|
||||
public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus) {
|
||||
public void updateTaxDeclareStatus(TaxDeclareStatusPO declareStatus, boolean updateRecord) {
|
||||
//更新申报表状态
|
||||
getTaxDeclareStatusMapper().updateIgnoreNull(declareStatus);
|
||||
|
||||
//更新主记录
|
||||
getOrInitTaxReports(declareStatus.getTaxDeclareRecordId());
|
||||
if (updateRecord) {
|
||||
updateRecord(declareStatus.getTaxDeclareRecordId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<TaxDeclareStatusPO> getOrInitTaxReports(Long id) {
|
||||
public List<TaxDeclareStatusPO> updateRecord(Long id) {
|
||||
|
||||
// 查询个税申报记录
|
||||
TaxDeclareRecordPO taxDeclareRecord = getTaxDeclareRecordMapper().getById(id);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import com.engine.salary.util.SalaryDateUtil;
|
|||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -42,7 +41,6 @@ public class TaxPaymentWithheldVoucherServiceImpl extends AbstractTaxPaymentServ
|
|||
return postRequest(apiConfig, url, requestParam, clazz);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public TaxWithheldVoucherResultDTO getWithheldVoucher(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
}
|
||||
|
||||
List<TaxDeclareStatusPO> statuses = getTaxDeclareRecordService(user).getTaxDeclareStatusByTaxDeclareRecordId(param.getTaxDeclareRecordId());
|
||||
for (TaxDeclareStatusPO status:statuses) {
|
||||
for (TaxDeclareStatusPO status : statuses) {
|
||||
WithholdingFeedbackResponse.Feedback feedback = Optional.of(feedbackResponse)
|
||||
.map(WithholdingFeedbackResponse::getBody)
|
||||
.map(body -> {
|
||||
|
|
@ -99,14 +99,13 @@ public class TaxPaymentWithholdingServiceImpl extends AbstractTaxPaymentService
|
|||
status.setTaxPaidAmount(totalPaid.toString());
|
||||
status.setTaxPurePaidAmount(taxPurePaidAmount.add(taxPayAmount).toString());
|
||||
status.setTaxPayAmount(BigDecimal.ZERO.toString());
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(status);
|
||||
getTaxDeclareStatusService(user).updateTaxDeclareStatus(status, false);
|
||||
}
|
||||
|
||||
TaxAmountFormDTO taxAmountFormDTO = queryTaxAmount(param);
|
||||
|
||||
// // 更新个税申报记录状态为已缴款
|
||||
// TaxDeclareRecordPO taxDeclareRecord = new TaxDeclareRecordPO();
|
||||
// updateTaxDeclareRecord(param, totalPaid);
|
||||
//更新主记录
|
||||
getTaxDeclareStatusService(user).updateRecord(param.getTaxDeclareRecordId());
|
||||
// 更新缴款请求为已反馈
|
||||
updateTaxPaymentRequest(param);
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import com.engine.salary.enums.taxdeclaration.TaxPaymentStatusEnum;
|
|||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.util.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
|
@ -44,7 +43,6 @@ import java.util.stream.Collectors;
|
|||
public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TaxFeedbackResultDTO getFeedback(TaxPaymentQueryParam param) {
|
||||
WithholdingVoucherFeedbackResponse feedbackResponse = (WithholdingVoucherFeedbackResponse) checkBeforeGetFeedbackResponse(param);
|
||||
// 校验请求结果
|
||||
|
|
@ -130,7 +128,6 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void syncWithholdingFeedback(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param);
|
||||
SyncWithholdingFeedbackResponse response = getRequestIdResponse(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(),
|
||||
|
|
@ -166,7 +163,6 @@ public class TaxPaymentWithholdingVoucherServiceImpl extends AbstractTaxPaymentS
|
|||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void cancelWithholdingVoucher(TaxPaymentQueryParam param) {
|
||||
TempWrapper tempWrapper = checkBeforeGetRequestIdResponse(param);
|
||||
Map<String, Object> requestParam = DataCollectionBO.getApiBaseQueryParams(tempWrapper.getTaxReturnPO(), tempWrapper.getTaxAgentPO().getName(), SalaryDateUtil.getFormatYYYYMM(param.getTaxYearMonth()));
|
||||
|
|
|
|||
|
|
@ -892,6 +892,6 @@ public class TaxDeclareRecordWrapper extends Service {
|
|||
}
|
||||
|
||||
public List<TaxDeclareStatusPO> getTaxReports(Long id) {
|
||||
return getTaxDeclareStatusService(user).getOrInitTaxReports(id);
|
||||
return getTaxDeclareStatusService(user).updateRecord(id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue