xml文件
This commit is contained in:
parent
6532225da3
commit
dd257ec53e
|
|
@ -4,6 +4,7 @@ import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
|||
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig;
|
||||
import com.engine.salary.entity.taxagent.config.TaxAgentConfig;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentBasePO;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
|
|
@ -42,6 +43,9 @@ public class SalaryConfig {
|
|||
@XStreamAlias("ArchiveFieldConfig")
|
||||
private ArchiveFieldConfig archiveFieldConfig;
|
||||
|
||||
@XStreamAlias("TaxAgentBaseConfig")
|
||||
private TaxAgentBasePO taxAgentBaseConfig;
|
||||
|
||||
//扣缴义务人
|
||||
@XStreamImplicit
|
||||
private List<TaxAgentConfig> taxAgentConfigs;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
|||
@XStreamAlias("SalarySobConfig")
|
||||
public class SalarySobConfig {
|
||||
|
||||
@XStreamAlias("salarySob")
|
||||
@XStreamAlias("SalarySob")
|
||||
private SalarySobPO salarySob;
|
||||
|
||||
@XStreamImplicit
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.engine.hrmelog.annotation.ElogTransform;
|
|||
import com.engine.salary.util.valid.Compare;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -23,7 +24,7 @@ import java.util.Date;
|
|||
@AllArgsConstructor
|
||||
@ElogTransform( name="薪资账套" )
|
||||
//hrsa_salary_sob
|
||||
@XStreamAlias("SalarySobPO")
|
||||
@XStreamAlias("SalarySob")
|
||||
public class SalarySobPO {
|
||||
|
||||
/**
|
||||
|
|
@ -31,8 +32,7 @@ public class SalarySobPO {
|
|||
*/
|
||||
@ElogTransform( name="主键" )
|
||||
@Compare
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
@XStreamOmitField
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
package com.engine.salary.entity.taxagent.config;
|
||||
|
||||
import com.engine.salary.entity.salarysob.config.SalarySobConfig;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentPO;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamImplicit;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
|
@ -18,35 +18,8 @@ import java.util.List;
|
|||
@XStreamAlias("TaxAgentConfig")
|
||||
public class TaxAgentConfig {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@XStreamAlias("sortedIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer sortedIndex;
|
||||
@XStreamAlias("TaxAgent")
|
||||
private TaxAgentPO taxAgent;
|
||||
|
||||
//薪资账套
|
||||
@XStreamImplicit
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.engine.salary.entity.taxagent.po;
|
||||
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -21,41 +23,57 @@ import java.util.Date;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
//hrsa_tax_agent_base")
|
||||
@XStreamAlias("TaxAgentBase")
|
||||
public class TaxAgentBasePO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@XStreamAlias("id")
|
||||
@XStreamAsAttribute
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 分权开关
|
||||
*/
|
||||
@XStreamAlias("devolutionStatus")
|
||||
@XStreamAsAttribute
|
||||
private Integer devolutionStatus;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,9 @@
|
|||
package com.engine.salary.entity.taxagent.po;
|
||||
|
||||
import com.engine.hrmelog.annotation.ElogTransform;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
|
||||
import com.thoughtworks.xstream.annotations.XStreamOmitField;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
@ -24,64 +27,86 @@ import java.util.Date;
|
|||
//hrsa_tax_agent")
|
||||
//个税扣缴义务人表")
|
||||
@ElogTransform(name = "个税扣缴义务人")
|
||||
@XStreamAlias("TaxAgent")
|
||||
public class TaxAgentPO {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@ElogTransform(name = "主键id")
|
||||
@XStreamOmitField
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ElogTransform(name = "名称")
|
||||
@XStreamAlias("name")
|
||||
@XStreamAsAttribute
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 代缴机构
|
||||
*/
|
||||
// @ElogTransform(name = "代缴机构")
|
||||
@XStreamAlias("paymentAgency")
|
||||
@XStreamAsAttribute
|
||||
private String paymentAgency;
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
@XStreamAlias("sortedIndex")
|
||||
@XStreamAsAttribute
|
||||
private Integer sortedIndex;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ElogTransform(name = "备注")
|
||||
@XStreamAlias("description")
|
||||
@XStreamAsAttribute
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 租户key
|
||||
*/
|
||||
@XStreamAlias("tenantKey")
|
||||
@XStreamAsAttribute
|
||||
private String tenantKey;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
@ElogTransform(name = "创建人id")
|
||||
@XStreamAlias("creator")
|
||||
@XStreamAsAttribute
|
||||
private Long creator;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
@XStreamAlias("deleteType")
|
||||
@XStreamAsAttribute
|
||||
private Integer deleteType;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ElogTransform(name = "创建时间")
|
||||
@XStreamAlias("createTime")
|
||||
@XStreamAsAttribute
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@ElogTransform(name = "更新时间")
|
||||
@ElogTransform(name = "updateTime")
|
||||
@XStreamAlias("updateTime")
|
||||
@XStreamAsAttribute
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sortedIndex;
|
||||
|
||||
private Collection<Long> ids;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -157,4 +157,6 @@ public interface SalarySobService {
|
|||
List<SalarySobPO> listByTaxAgentIds(Collection<Long> taxAgentIds);
|
||||
|
||||
List<SalarySobConfig> getConfig(Long taxAgentId);
|
||||
|
||||
void parseConfig(Long taxAgentId, List<SalarySobConfig> salarySobConfigs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,4 +34,8 @@ public interface TaxAgentBaseService {
|
|||
* @return
|
||||
*/
|
||||
String save(TaxAgentSaveBaseParam saveBaseParam);
|
||||
|
||||
TaxAgentBasePO getConfig();
|
||||
|
||||
void parseConfig(TaxAgentBasePO config);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -261,5 +261,7 @@ public interface TaxAgentService {
|
|||
Collection<Long> listEmployeeIdsInTaxAgent(Long taxAgentId);
|
||||
|
||||
|
||||
List<TaxAgentConfig> getAllConfig();
|
||||
List<TaxAgentConfig> getConfig();
|
||||
|
||||
void parseConfig(List<TaxAgentConfig> configs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.salary.service.impl;
|
||||
|
||||
import com.api.formmode.mybatis.util.SqlProxyHandle;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.salary.biz.SalaryArchiveBiz;
|
||||
|
|
@ -23,6 +24,7 @@ import com.engine.salary.enums.salaryarchive.SalaryArchiveItemAdjustReasonEnum;
|
|||
import com.engine.salary.enums.salaryarchive.SalaryArchiveStatusEnum;
|
||||
import com.engine.salary.exception.SalaryRunTimeException;
|
||||
import com.engine.salary.mapper.archive.SalaryArchiveItemMapper;
|
||||
import com.engine.salary.mapper.salaryitem.SalaryItemMapper;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.util.SalaryEntityUtil;
|
||||
import com.engine.salary.util.SalaryI18nUtil;
|
||||
|
|
@ -60,6 +62,10 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
|||
return MapperProxyFactory.getProxy(SalaryArchiveItemMapper.class);
|
||||
}
|
||||
|
||||
private SalaryItemMapper getSalaryItemMapper() {
|
||||
return SqlProxyHandle.getProxy(SalaryItemMapper.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SalaryArchiveItemPO getById(Long salaryArchiveItemId) {
|
||||
|
|
@ -746,9 +752,25 @@ public class SalaryArchiveItemServiceImpl extends Service implements SalaryArchi
|
|||
|
||||
@Override
|
||||
public void parseConfig(ArchiveFieldConfig config) {
|
||||
List<SalaryItemPO> salaryItemPOList = getSalaryItemService(user).listAll();
|
||||
Set<Long> ids = SalaryEntityUtil.properties(salaryItemPOList, SalaryItemPO::getId);
|
||||
Set<String> names = SalaryEntityUtil.properties(salaryItemPOList, SalaryItemPO::getName);
|
||||
Set<String> codes = SalaryEntityUtil.properties(salaryItemPOList, SalaryItemPO::getCode);
|
||||
|
||||
Optional.ofNullable(config.getSalaryItems()).orElse(new ArrayList<>())
|
||||
.forEach();
|
||||
Optional.ofNullable(config.getSalaryItems())
|
||||
.orElse(new ArrayList<>())
|
||||
.forEach(itemPO -> {
|
||||
//todo 异常提示
|
||||
if (ids.contains(itemPO.getId())) {
|
||||
|
||||
}else if(names.contains(itemPO.getName())){
|
||||
|
||||
}else if(codes.contains(itemPO.getCode())){
|
||||
|
||||
}else {
|
||||
getSalaryItemMapper().insertIgnoreNull(itemPO);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -794,6 +794,6 @@ public class SalaryItemServiceImpl extends Service implements SalaryItemService
|
|||
}else {
|
||||
getSalaryItemMapper().insertIgnoreNull(itemPO);
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -823,6 +823,61 @@ public class SalarySobServiceImpl extends Service implements SalarySobService {
|
|||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parseConfig(Long taxAgentId, List<SalarySobConfig> salarySobConfigs) {
|
||||
long uid = user.getUID();
|
||||
List<SalarySobPO> salarySobPOS = listByTaxAgentId(taxAgentId);
|
||||
Map<String, SalarySobPO> sobPOMap = SalaryEntityUtil.convert2Map(salarySobPOS, SalarySobPO::getName);
|
||||
|
||||
Optional.ofNullable(salarySobConfigs)
|
||||
.orElse(new ArrayList<>())
|
||||
.forEach(salarySobConfig -> {
|
||||
SalarySobPO salarySobPO = salarySobConfig.getSalarySob();
|
||||
String sobPOName = salarySobPO.getName();
|
||||
if (sobPOMap.containsKey(sobPOName)) {
|
||||
salarySobPO = sobPOMap.get(sobPOName);
|
||||
} else {
|
||||
salarySobPO.setCreator(uid);
|
||||
getSalarySobMapper().insertIgnoreNull(salarySobPO);
|
||||
}
|
||||
|
||||
List<SalarySobItemPO> salarySobItems = salarySobConfig.getSalarySobItems();
|
||||
for (SalarySobItemPO salarySobItem : salarySobItems) {
|
||||
salarySobItem.setSalarySobId(salarySobPO.getId());
|
||||
salarySobItem.setCreator(uid);
|
||||
}
|
||||
getSalarySobItemService(user).batchSave(salarySobItems);
|
||||
|
||||
List<SalarySobEmpFieldPO> salarySobEmpFields = salarySobConfig.getSalarySobEmpFields();
|
||||
for (SalarySobEmpFieldPO salarySobEmpField : salarySobEmpFields) {
|
||||
salarySobEmpField.setSalarySobId(salarySobPO.getId());
|
||||
salarySobEmpField.setCreator(uid);
|
||||
}
|
||||
getSalarySobEmpFieldService(user).batchSave(salarySobEmpFields);
|
||||
|
||||
List<SalarySobItemGroupPO> salarySobItemGroups = salarySobConfig.getSalarySobItemGroups();
|
||||
for (SalarySobItemGroupPO salarySobItemGroup : salarySobItemGroups) {
|
||||
salarySobItemGroup.setSalarySobId(salarySobPO.getId());
|
||||
salarySobItemGroup.setCreator(uid);
|
||||
}
|
||||
getSalarySobItemGroupService(user).batchSave(salarySobItemGroups);
|
||||
|
||||
List<SalarySobBackItemPO> salarySobBackItems = salarySobConfig.getSalarySobBackItems();
|
||||
for (SalarySobBackItemPO salarySobBackItem : salarySobBackItems) {
|
||||
salarySobBackItem.setSalarySobId(salarySobPO.getId());
|
||||
salarySobBackItem.setCreator(uid);
|
||||
}
|
||||
getSalarySobBackItemService(user).batchInsert(salarySobBackItems);
|
||||
|
||||
List<SalarySobAdjustRulePO> salarySobAdjustRules = salarySobConfig.getSalarySobAdjustRules();
|
||||
for (SalarySobAdjustRulePO salarySobAdjustRule : salarySobAdjustRules) {
|
||||
salarySobAdjustRule.setSalarySobId(salarySobPO.getId());
|
||||
salarySobAdjustRule.setCreator(uid);
|
||||
}
|
||||
getSalarySobAdjustRuleService(user).batchSave(salarySobAdjustRules);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public List<SalarySobPO> filterByAdmin(List<SalarySobPO> salarySobPOS) {
|
||||
long employeeId = user.getUID();
|
||||
|
|
|
|||
|
|
@ -95,6 +95,35 @@ public class TaxAgentBaseServiceImpl extends Service implements TaxAgentBaseServ
|
|||
return StringUtils.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TaxAgentBasePO getConfig() {
|
||||
Date now = new Date();
|
||||
TaxAgentBasePO baseInfo = getBaseInfo();
|
||||
if (baseInfo == null) {
|
||||
baseInfo = TaxAgentBasePO.builder()
|
||||
.id(IdGenerator.generate())
|
||||
.devolutionStatus(0)
|
||||
.createTime(now)
|
||||
.updateTime(now)
|
||||
.creator((long) user.getUID())
|
||||
.tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
.build();
|
||||
}
|
||||
return baseInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parseConfig(TaxAgentBasePO config) {
|
||||
TaxAgentBasePO baseInfo = getBaseInfo();
|
||||
if (baseInfo == null) {
|
||||
config.setCreator((long) user.getUID());
|
||||
getTaxAgentBaseMapper().insertIgnoreNull(config);
|
||||
}else {
|
||||
baseInfo.setDevolutionStatus(config.getDevolutionStatus());
|
||||
getTaxAgentBaseMapper().updateIgnoreNull(baseInfo);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否有未归档数据
|
||||
*
|
||||
|
|
|
|||
|
|
@ -475,7 +475,7 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
getTaxAgentMapper().deleteByIds(ids);
|
||||
|
||||
// 记录日志
|
||||
taxAgents.forEach(e ->{
|
||||
taxAgents.forEach(e -> {
|
||||
LoggerContext<TaxAgentPO> loggerContext = new LoggerContext<>();
|
||||
loggerContext.setUser(user);
|
||||
loggerContext.setTargetId(e.getId().toString());
|
||||
|
|
@ -504,12 +504,12 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
}
|
||||
// 被社保福利档案引用
|
||||
List<InsuranceArchivesBaseInfoPO> socialByPaymentOrganization = getInsuranceBaseInfoMapper().getSocialByPaymentOrganization(id);
|
||||
if(CollectionUtils.isNotEmpty(socialByPaymentOrganization)){
|
||||
if (CollectionUtils.isNotEmpty(socialByPaymentOrganization)) {
|
||||
throw new SalaryRunTimeException("存在社保福利档案引用");
|
||||
}
|
||||
// 被社保福利台账引用
|
||||
List<InsuranceAccountBatchPO> insuranceArchiveList = getInsuranceAccountBatchMapper().list(InsuranceAccountBatchParam.builder().taxAgents(Collections.singletonList(id)).build());
|
||||
if(CollectionUtils.isNotEmpty(insuranceArchiveList)){
|
||||
if (CollectionUtils.isNotEmpty(insuranceArchiveList)) {
|
||||
throw new SalaryRunTimeException("存在社保福利台账引用");
|
||||
}
|
||||
//被社保福利档案引用
|
||||
|
|
@ -796,22 +796,47 @@ public class TaxAgentServiceImpl extends Service implements TaxAgentService {
|
|||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<Long> listEmployeeIdsInTaxAgent(Long taxAgentId) {
|
||||
List<TaxAgentEmpPO> taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId),UseEmployeeTypeEnum.ALL);
|
||||
List<TaxAgentEmpPO> taxAgentEmpPOS = getTaxAgentEmpService(user).listByTaxAgentIds(Collections.singletonList(taxAgentId), UseEmployeeTypeEnum.ALL);
|
||||
|
||||
return SalaryEntityUtil.properties(taxAgentEmpPOS, TaxAgentEmpPO::getEmployeeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TaxAgentConfig> getAllConfig() {
|
||||
List<TaxAgentConfig> allConfig = getTaxAgentMapper().getAllConfig();
|
||||
allConfig.forEach(config->{
|
||||
List<SalarySobConfig> sobConfigs = getSalarySobService(user).getConfig(config.getId());
|
||||
config.setSalarySobConfigs(sobConfigs);
|
||||
});
|
||||
return allConfig;
|
||||
public List<TaxAgentConfig> getConfig() {
|
||||
List<TaxAgentPO> taxAgentPOS = getTaxAgentMapper().listAll();
|
||||
return taxAgentPOS.stream()
|
||||
.map(taxAgentPO -> {
|
||||
List<SalarySobConfig> sobConfigs = getSalarySobService(user).getConfig(taxAgentPO.getId());
|
||||
return TaxAgentConfig.builder().taxAgent(taxAgentPO).salarySobConfigs(sobConfigs).build();
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parseConfig(List<TaxAgentConfig> configs) {
|
||||
List<TaxAgentPO> taxAgentPOS = listAll();
|
||||
Map<String, TaxAgentPO> agentPOMap = SalaryEntityUtil.convert2Map(taxAgentPOS, TaxAgentPO::getName);
|
||||
|
||||
Optional.ofNullable(configs)
|
||||
.orElse(new ArrayList<>())
|
||||
.forEach(config -> {
|
||||
TaxAgentPO taxAgent = config.getTaxAgent();
|
||||
String name = taxAgent.getName();
|
||||
if (agentPOMap.containsKey(name)) {
|
||||
//存在扣缴义务人
|
||||
taxAgent = agentPOMap.get(name);
|
||||
} else {
|
||||
//新增扣缴义务人
|
||||
taxAgent.setId(null);
|
||||
taxAgent.setCreator((long) user.getUID());
|
||||
getTaxAgentMapper().insertIgnoreNull(taxAgent);
|
||||
}
|
||||
|
||||
getSalarySobService(user).parseConfig(taxAgent.getId(), config.getSalarySobConfigs());
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,14 +7,9 @@ import com.engine.salary.entity.salaryarchive.config.ArchiveFieldConfig;
|
|||
import com.engine.salary.entity.salaryformula.config.FormluaConfig;
|
||||
import com.engine.salary.entity.salaryitem.config.SalaryItemAllConfig;
|
||||
import com.engine.salary.entity.taxagent.config.TaxAgentConfig;
|
||||
import com.engine.salary.service.SalaryArchiveItemService;
|
||||
import com.engine.salary.service.SalaryFormulaService;
|
||||
import com.engine.salary.service.SalaryItemService;
|
||||
import com.engine.salary.service.TaxAgentService;
|
||||
import com.engine.salary.service.impl.SalaryArchiveItemServiceImpl;
|
||||
import com.engine.salary.service.impl.SalaryFormulaServiceImpl;
|
||||
import com.engine.salary.service.impl.SalaryItemServiceImpl;
|
||||
import com.engine.salary.service.impl.TaxAgentServiceImpl;
|
||||
import com.engine.salary.entity.taxagent.po.TaxAgentBasePO;
|
||||
import com.engine.salary.service.*;
|
||||
import com.engine.salary.service.impl.*;
|
||||
import com.engine.salary.sys.entity.param.*;
|
||||
import com.engine.salary.sys.entity.po.SalarySysConfPO;
|
||||
import com.engine.salary.sys.entity.vo.AppSettingVO;
|
||||
|
|
@ -70,6 +65,10 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
return ServiceUtil.getService(SalaryFormulaServiceImpl.class, user);
|
||||
}
|
||||
|
||||
private TaxAgentBaseService getTaxAgentBaseService(User user) {
|
||||
return ServiceUtil.getService(TaxAgentBaseServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> info() {
|
||||
BaseBean baseBean = new BaseBean();
|
||||
String log = baseBean.getPropValue("hrmSalary", "log");
|
||||
|
|
@ -213,7 +212,10 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
ArchiveFieldConfig archiveFieldConfig = getSalaryArchiveItemService(user).getConfig();
|
||||
salaryConfig.setArchiveFieldConfig(archiveFieldConfig);
|
||||
|
||||
List<TaxAgentConfig> taxAgentConfigs = getTaxAgentService(user).getAllConfig();
|
||||
TaxAgentBasePO taxAgentBaseConfig = getTaxAgentBaseService(user).getConfig();
|
||||
salaryConfig.setTaxAgentBaseConfig(taxAgentBaseConfig);
|
||||
|
||||
List<TaxAgentConfig> taxAgentConfigs = getTaxAgentService(user).getConfig();
|
||||
salaryConfig.setTaxAgentConfigs(taxAgentConfigs);
|
||||
|
||||
return salaryConfig;
|
||||
|
|
@ -233,148 +235,16 @@ public class SalarySystemConfigWrapper extends Service {
|
|||
|
||||
SalaryConfig config = XStreamUtil.unmarshal(SalaryConfig.class, xml.toString());
|
||||
|
||||
FormluaConfig formluaConfig = config.getFormluaConfig();
|
||||
getSalaryFormulaService(user).parseConfig(formluaConfig);
|
||||
getSalaryFormulaService(user).parseConfig(config.getFormluaConfig());
|
||||
|
||||
SalaryItemAllConfig salaryItemConfig = config.getSalaryItemConfig();
|
||||
getSalaryItemService(user).parseConfig(salaryItemConfig);
|
||||
getSalaryItemService(user).parseConfig(config.getSalaryItemConfig());
|
||||
|
||||
ArchiveFieldConfig archiveFieldConfig = config.getArchiveFieldConfig();
|
||||
getSalaryArchiveItemService(user).parseConfig(archiveFieldConfig);
|
||||
getSalaryArchiveItemService(user).parseConfig(config.getArchiveFieldConfig());
|
||||
|
||||
List<TaxAgentConfig> taxAgentConfigs = config.getTaxAgentConfigs();
|
||||
getTaxAgentBaseService(user).parseConfig(config.getTaxAgentBaseConfig());
|
||||
|
||||
getTaxAgentService(user).parseConfig(config.getTaxAgentConfigs());
|
||||
|
||||
// List<SalaryItemExcelConfig> configs = ExcelParseHelper.parse2Map(fileInputStream, SalaryItemExcelConfig.class, 0, 1, 13, EXCEL_TYPE_XLSX);
|
||||
//
|
||||
// // 错误excel内容
|
||||
// ImportExcelResponse response = ImportExcelResponse.builder().totalCount(configs.size()).successCount(configs.size()).errorCount(0).errorData(new ArrayList<>()).build();
|
||||
//
|
||||
// List<SysSalaryItemPO> sysSalaryItemPOS = sysSalaryItemBiz.listAll();
|
||||
// Set<String> sysItems = SalaryEntityUtil.properties(sysSalaryItemPOS, SysSalaryItemPO::getName);
|
||||
//
|
||||
// List<SalaryItemPO> adds = new ArrayList<>();
|
||||
// List<SalaryItemPO> updates = new ArrayList<>();
|
||||
// Map<Long, Map<String, String>> formulaItems = new HashMap<>();
|
||||
// for (int i = 0; i < configs.size(); i++) {
|
||||
// String rowIndex = String.format("第%s行", i + 2);
|
||||
// SalaryItemExcelConfig config = configs.get(i);
|
||||
// String name = config.getName();
|
||||
// SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByDefaultLabel(config.getValueType());
|
||||
// SalaryDataTypeEnum salaryDataTypeEnum = SalaryDataTypeEnum.parseByValue(config.getDataType());
|
||||
// SalaryItemPO itemPO = getByName(name);
|
||||
// if (itemPO == null) {
|
||||
//
|
||||
// if (sysItems.contains(name)) {
|
||||
// ImportExcelResponse.Error error = ImportExcelResponse.Error.builder().message(String.format("%s“%s”的名称与系统名称冲突", rowIndex, name)).build();
|
||||
// response.setSuccessCount(response.getSuccessCount() - 1);
|
||||
// response.setErrorCount(response.getErrorCount() + 1);
|
||||
// response.getErrorData().add(error);
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// itemPO = SalaryItemPO.builder()
|
||||
// .id(IdGenerator.generate())
|
||||
// .code(IdGenerator.getUUID())
|
||||
// .name(name)
|
||||
// .systemType(SalarySystemTypeEnum.CUSTOM.getValue())
|
||||
// .sysSalaryItemId(org.apache.commons.lang3.math.NumberUtils.LONG_ZERO)
|
||||
// .useDefault(SalaryOnOffEnum.parseByDefaultLabel(config.getUseDefault()).getValue())
|
||||
// .useInEmployeeSalary(SalaryOnOffEnum.OFF.getValue())
|
||||
// .hideDefault(SalaryOnOffEnum.parseByDefaultLabel(config.getHideDefault()).getValue())
|
||||
// .roundingMode(SalaryRoundingModeEnum.parseByDefaultLabel(config.getRoundingMode()).getValue())
|
||||
// .pattern(NumberUtil.isNumber(config.getPattern()) ? Integer.parseInt(config.getPattern()) : 2)
|
||||
// .valueType(salaryValueTypeEnum.getValue())
|
||||
// .dataType(salaryDataTypeEnum.getValue())
|
||||
// //后补
|
||||
// .formulaId(0L)
|
||||
// .description(config.getDescription())
|
||||
// .canEdit(org.apache.commons.lang3.math.NumberUtils.INTEGER_ONE)
|
||||
// .creator((long) user.getUID())
|
||||
// .deleteType(0)
|
||||
// .createTime(now)
|
||||
// .updateTime(now)
|
||||
// .tenantKey(SalaryDefaultTenantConstant.DEFAULT_TENANT_KEY)
|
||||
// .sharedType(0)
|
||||
// .taxAgentIds("")
|
||||
// .sortedIndex(NumberUtil.isNumber(config.getSortedIndex()) ? Integer.parseInt(config.getSortedIndex()) : null)
|
||||
// .width(NumberUtil.isNumber(config.getWidth()) ? Integer.parseInt(config.getWidth()) : null)
|
||||
// .defaultValue(config.getDefaultValue())
|
||||
// .build();
|
||||
// adds.add(itemPO);
|
||||
// } else {
|
||||
//
|
||||
// if (SalarySystemTypeEnum.parseByValue(itemPO.getSystemType()) == SalarySystemTypeEnum.SYSTEM) {
|
||||
// ImportExcelResponse.Error error = ImportExcelResponse.Error.builder().message(String.format("%s“%s”是系统薪资项目不支持修改", rowIndex, name)).build();
|
||||
// response.setSuccessCount(response.getSuccessCount() - 1);
|
||||
// response.setErrorCount(response.getErrorCount() + 1);
|
||||
// response.getErrorData().add(error);
|
||||
// continue;
|
||||
// }
|
||||
//
|
||||
// itemPO.setUseDefault(SalaryOnOffEnum.parseByDefaultLabel(config.getUseDefault()).getValue());
|
||||
// itemPO.setHideDefault(SalaryOnOffEnum.parseByDefaultLabel(config.getHideDefault()).getValue());
|
||||
// itemPO.setRoundingMode(SalaryRoundingModeEnum.parseByDefaultLabel(config.getRoundingMode()).getValue());
|
||||
// itemPO.setPattern(NumberUtil.isNumber(config.getPattern()) ? Integer.parseInt(config.getPattern()) : 2);
|
||||
// itemPO.setValueType(salaryValueTypeEnum.getValue());
|
||||
// itemPO.setDataType(salaryDataTypeEnum.getValue());
|
||||
// //后补
|
||||
// itemPO.setFormulaId(0L);
|
||||
// itemPO.setDescription(config.getDescription());
|
||||
// itemPO.setUpdateTime(now);
|
||||
// itemPO.setSortedIndex(NumberUtil.isNumber(config.getSortedIndex()) ? Integer.parseInt(config.getSortedIndex()) : null);
|
||||
// itemPO.setWidth(NumberUtil.isNumber(config.getWidth()) ? Integer.parseInt(config.getWidth()) : null);
|
||||
// itemPO.setDefaultValue(config.getDefaultValue());
|
||||
// updates.add(itemPO);
|
||||
// }
|
||||
//
|
||||
// //解析公式
|
||||
// if (salaryValueTypeEnum == SalaryValueTypeEnum.FORMULA || salaryValueTypeEnum == SalaryValueTypeEnum.SQL) {
|
||||
// Long id = itemPO.getId();
|
||||
// String formula = config.getFormula();
|
||||
// String sqlReturnKey = config.getSqlReturnKey();
|
||||
// Map<String, String> map = new HashMap<>();
|
||||
// map.put("rowIndex", rowIndex);
|
||||
// map.put("formula", formula);
|
||||
// map.put("sqlReturnKey", sqlReturnKey);
|
||||
// formulaItems.put(id, map);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// adds.forEach(getSalaryItemMapper()::insertIgnoreNull);
|
||||
// updates.forEach(getSalaryItemMapper()::updateIgnoreNull);
|
||||
//
|
||||
// for (Long id : formulaItems.keySet()) {
|
||||
// SalaryItemPO itemPO = getById(id);
|
||||
// Map<String, String> map = formulaItems.get(id);
|
||||
// String rowIndex = map.get("rowIndex");
|
||||
// String formula = map.get("formula");
|
||||
// String sqlReturnKey = map.get("sqlReturnKey");
|
||||
// SalaryValueTypeEnum salaryValueTypeEnum = SalaryValueTypeEnum.parseByValue(itemPO.getValueType());
|
||||
// SalaryDataTypeEnum salaryDataTypeEnum = SalaryDataTypeEnum.parseByValue(itemPO.getDataType());
|
||||
// SalaryFormulaSaveParam saveParam = SalaryFormulaSaveParam.builder()
|
||||
// .name(itemPO.getName())
|
||||
// .module("salary")
|
||||
// .useFor("salaryitem")
|
||||
// .referenceType(salaryValueTypeEnum == SalaryValueTypeEnum.FORMULA ? ReferenceTypeEnum.FORMULA.getValue() : ReferenceTypeEnum.SQL.getValue())
|
||||
// .returnType(salaryDataTypeEnum == SalaryDataTypeEnum.STRING ? ReturnTypeEnum.STRING.getValue() : ReturnTypeEnum.NUMBER.getValue())
|
||||
// .validateType(salaryDataTypeEnum == SalaryDataTypeEnum.STRING ? ReturnTypeEnum.STRING.getValue() : ReturnTypeEnum.NUMBER.getValue())
|
||||
// .extendParam("{\"isCustomFunction\":\"0\",\"sqlReturnKey\":\"" + sqlReturnKey + "\",\"openDecrypt\":\"0\",\"datasource\":{\"datasourceId\":\"\"}}")
|
||||
// .formula(formula)
|
||||
// .build();
|
||||
//
|
||||
// try {
|
||||
// FormulaPO formulaPO = getSalaryFormulaService(user).save(saveParam);
|
||||
// itemPO.setFormulaId(formulaPO.getId());
|
||||
// getSalaryItemMapper().updateIgnoreNull(itemPO);
|
||||
// } catch (Exception e) {
|
||||
// ImportExcelResponse.Error error = ImportExcelResponse.Error.builder().message(String.format("%s“%s”的公式设置有误:%s", rowIndex, itemPO.getName(), e.getMessage())).build();
|
||||
// response.setSuccessCount(response.getSuccessCount() - 1);
|
||||
// response.setErrorCount(response.getErrorCount() + 1);
|
||||
// response.getErrorData().add(error);
|
||||
// }
|
||||
// }
|
||||
// return response;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Reference in New Issue