停薪action传个税扣缴义务人名
This commit is contained in:
parent
a044335406
commit
b30c08d3ff
|
|
@ -2,10 +2,13 @@ package com.engine.salary.action;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
||||
import com.engine.salary.service.SalaryArchiveService;
|
||||
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.db.MapperProxyFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
|
@ -36,6 +39,9 @@ public class CheckStopSalaryAction implements Action {
|
|||
return ServiceUtil.getService(SalaryArchiveServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentMapper getTaxAgentMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
|
||||
}
|
||||
|
||||
private String tableName;
|
||||
|
||||
|
|
@ -70,7 +76,13 @@ public class CheckStopSalaryAction implements Action {
|
|||
}
|
||||
// 流程数据
|
||||
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, CheckStopSalaryAction.SalaryField::getSalaryName, CheckStopSalaryAction.SalaryField::getValue);
|
||||
Long taxAgentId = Long.valueOf(importDataMap.getOrDefault("个税扣缴义务人", "0").toString());
|
||||
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
||||
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
||||
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
||||
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
||||
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package com.engine.salary.action;
|
|||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.salary.entity.salaryarchive.po.SalaryArchivePO;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveMapper;
|
||||
import com.engine.salary.mapper.taxagent.TaxAgentMapper;
|
||||
import com.engine.salary.service.SalaryArchiveService;
|
||||
import com.engine.salary.service.impl.SalaryArchiveServiceImpl;
|
||||
import com.engine.salary.util.SalaryDateUtil;
|
||||
|
|
@ -42,6 +44,11 @@ public class StopSalaryAction implements Action {
|
|||
return MapperProxyFactory.getProxy(SalaryArchiveMapper.class);
|
||||
}
|
||||
|
||||
private TaxAgentMapper getTaxAgentMapper() {
|
||||
return MapperProxyFactory.getProxy(TaxAgentMapper.class);
|
||||
}
|
||||
|
||||
|
||||
private String tableName;
|
||||
|
||||
|
||||
|
|
@ -63,6 +70,7 @@ public class StopSalaryAction implements Action {
|
|||
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
|
||||
String queryImageId = "select salaryname,processfield from " + tableName + " where workflowid = ?";
|
||||
rs.executeQuery(queryImageId, requestInfo.getWorkflowid());
|
||||
|
||||
|
|
@ -75,7 +83,17 @@ public class StopSalaryAction implements Action {
|
|||
}
|
||||
// 流程数据
|
||||
Map<String, Object> importDataMap = SalaryEntityUtil.convert2Map(list, StopSalaryAction.SalaryField::getSalaryName, StopSalaryAction.SalaryField::getValue);
|
||||
Long taxAgentId = Long.valueOf(importDataMap.getOrDefault("个税扣缴义务人", "0").toString());
|
||||
//操作人
|
||||
String uid = importDataMap.getOrDefault("操作人","1").toString();
|
||||
User user = new User(Integer.parseInt(uid));
|
||||
|
||||
String taxAgentName = importDataMap.getOrDefault("个税扣缴义务人", "").toString();
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listByName(taxAgentName);
|
||||
if(CollectionUtils.isEmpty(taxAgentPOS)){
|
||||
requestInfo.getRequestManager().setMessage("个税扣缴义务人不存在!");
|
||||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
Long taxAgentId = Long.valueOf( taxAgentPOS.get(0).getId() );
|
||||
Long employeeId = Long.valueOf(importDataMap.getOrDefault("员工id", "-1").toString());
|
||||
if( importDataMap.get("最后发薪日期") == null || StringUtils.isBlank(importDataMap.get("最后发薪日期").toString())){
|
||||
requestInfo.getRequestManager().setMessage("缺少最后发薪日期字段!");
|
||||
|
|
@ -85,9 +103,6 @@ public class StopSalaryAction implements Action {
|
|||
return FAILURE_AND_CONTINUE;
|
||||
}
|
||||
|
||||
//操作人
|
||||
String uid = importDataMap.getOrDefault("操作人","1").toString();
|
||||
User user = new User(Integer.parseInt(uid));
|
||||
// 获取薪资档案
|
||||
List<SalaryArchivePO> salaryArchiveList = getSalaryArchiveService(user).listSome(SalaryArchivePO.builder().taxAgentId(taxAgentId).employeeId(employeeId).deleteType(NumberUtils.INTEGER_ZERO).build());
|
||||
if(CollectionUtils.isEmpty(salaryArchiveList)){
|
||||
|
|
|
|||
Loading…
Reference in New Issue